diff --git "a/github_sample.jsonl" "b/github_sample.jsonl" new file mode 100644--- /dev/null +++ "b/github_sample.jsonl" @@ -0,0 +1,1024 @@ +{"text": "var videoState={\n\n \n create: function(){\n var video;\n var sprite;\n \n video = game.add.video('storyvideo');\n video.play(false);\n sprite = video.addToWorld(game.world.centerX, game.world.centerY, 0.5, 0.5, 2, 2);\n//pause\n var picLabel= game.add.image(game.width/2, game.height-30, 'skip');\n picLabel.anchor.setTo(-1,1);\n picLabel.inputEnabled = true;\n picLabel.events.onInputDown.add(this.start, this);\n\n//skip video\n// var picLabel= game.add.image(game.width/2, game.height-30, 'skip');\n// picLabel.anchor.setTo(-2,1);\n// picLabel.inputEnabled = true;\n// picLabel.events.onInputDown.add(this.startgame, this);\n\n\n\n\n\n\n // game.time.events.add(Phaser.Timer.SECOND * 10, this.fadeState, this);\n\n // game.stage.backgroundColor= '#ffffff';\n\n game.physics.startSystem(Phaser.Physics. ARCADE);\n game.renderer.renderSession.roundPixels=true;\n \n },\n \n // fadeState: function(){\n // game.state.start('play');\n\n // },\n start: function(){\n game.paused = (game.paused) ? false : true;\n game.state.start('play');\n \n },\n // startgame: function(){\n // game.state.start('play');\n \n // },\n\n};", "meta": {"content_hash": "1c932c7359417cc3e05f3380eabb7fac", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 89, "avg_line_length": 25.41176470588235, "alnum_prop": 0.5601851851851852, "repo_name": "nickchulani99/ITE-445", "id": "d9d5cb9bb5e54f95b73df6a87d4bcecebdc40318", "size": "1296", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "final/alien copy 4/js/video.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "16832"}, {"name": "JavaScript", "bytes": "451272"}]}} +{"text": "package mts\n\n//Licensed under the Apache License, Version 2.0 (the \"License\");\n//you may not use this file except in compliance with the License.\n//You may obtain a copy of the License at\n//\n//http://www.apache.org/licenses/LICENSE-2.0\n//\n//Unless required by applicable law or agreed to in writing, software\n//distributed under the License is distributed on an \"AS IS\" BASIS,\n//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//See the License for the specific language governing permissions and\n//limitations under the License.\n//\n// Code generated by Alibaba Cloud SDK Code Generator.\n// Changes may cause incorrect behavior and will be lost if the code is regenerated.\n\nimport (\n\t\"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests\"\n\t\"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses\"\n)\n\n// SearchMedia invokes the mts.SearchMedia API synchronously\nfunc (client *Client) SearchMedia(request *SearchMediaRequest) (response *SearchMediaResponse, err error) {\n\tresponse = CreateSearchMediaResponse()\n\terr = client.DoAction(request, response)\n\treturn\n}\n\n// SearchMediaWithChan invokes the mts.SearchMedia API asynchronously\nfunc (client *Client) SearchMediaWithChan(request *SearchMediaRequest) (<-chan *SearchMediaResponse, <-chan error) {\n\tresponseChan := make(chan *SearchMediaResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.SearchMedia(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}\n\n// SearchMediaWithCallback invokes the mts.SearchMedia API asynchronously\nfunc (client *Client) SearchMediaWithCallback(request *SearchMediaRequest, callback func(response *SearchMediaResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *SearchMediaResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.SearchMedia(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}\n\n// SearchMediaRequest is the request struct for api SearchMedia\ntype SearchMediaRequest struct {\n\t*requests.RpcRequest\n\tResourceOwnerId requests.Integer `position:\"Query\" name:\"ResourceOwnerId\"`\n\tDescription string `position:\"Query\" name:\"Description\"`\n\tTitle string `position:\"Query\" name:\"Title\"`\n\tPageNumber requests.Integer `position:\"Query\" name:\"PageNumber\"`\n\tCateId string `position:\"Query\" name:\"CateId\"`\n\tPageSize requests.Integer `position:\"Query\" name:\"PageSize\"`\n\tFrom string `position:\"Query\" name:\"From\"`\n\tTag string `position:\"Query\" name:\"Tag\"`\n\tKeyWord string `position:\"Query\" name:\"KeyWord\"`\n\tResourceOwnerAccount string `position:\"Query\" name:\"ResourceOwnerAccount\"`\n\tOwnerAccount string `position:\"Query\" name:\"OwnerAccount\"`\n\tOwnerId requests.Integer `position:\"Query\" name:\"OwnerId\"`\n\tSortBy string `position:\"Query\" name:\"SortBy\"`\n\tTo string `position:\"Query\" name:\"To\"`\n}\n\n// SearchMediaResponse is the response struct for api SearchMedia\ntype SearchMediaResponse struct {\n\t*responses.BaseResponse\n\tTotalNum int64 `json:\"TotalNum\" xml:\"TotalNum\"`\n\tPageSize int64 `json:\"PageSize\" xml:\"PageSize\"`\n\tRequestId string `json:\"RequestId\" xml:\"RequestId\"`\n\tPageNumber int64 `json:\"PageNumber\" xml:\"PageNumber\"`\n\tMediaList MediaListInSearchMedia `json:\"MediaList\" xml:\"MediaList\"`\n}\n\n// CreateSearchMediaRequest creates a request to invoke SearchMedia API\nfunc CreateSearchMediaRequest() (request *SearchMediaRequest) {\n\trequest = &SearchMediaRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"Mts\", \"2014-06-18\", \"SearchMedia\", \"mts\", \"openAPI\")\n\trequest.Method = requests.POST\n\treturn\n}\n\n// CreateSearchMediaResponse creates a response to parse from SearchMedia response\nfunc CreateSearchMediaResponse() (response *SearchMediaResponse) {\n\tresponse = &SearchMediaResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}\n", "meta": {"content_hash": "4765aae0af2406ea691fb001ea5a83df", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 144, "avg_line_length": 38.23275862068966, "alnum_prop": 0.7019165727170237, "repo_name": "aliyun/alibaba-cloud-sdk-go", "id": "e23386a31fa5de227e10f19984b8f3e7eb736f22", "size": "4435", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "services/mts/search_media.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Go", "bytes": "734307"}, {"name": "Makefile", "bytes": "183"}]}} +{"text": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\" />\n <title>Invitation to calendar</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n</head>\n<body>\n<h2>You was invited to calendar.</h2>\n\n<p>You can login and set password procceed by link:</p>\n\n<a href=\"<?php echo $link?>\"><?php echo $link?></a>\n</body>\n</html>", "meta": {"content_hash": "324efbc1ad28fdfe902cd1e51f7e095e", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 76, "avg_line_length": 23.733333333333334, "alnum_prop": 0.6432584269662921, "repo_name": "vchukhalyonock/calendar", "id": "5ca5e852381e8a65c1d2612696445e148aa8677b", "size": "356", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/email/invite.php", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "366"}, {"name": "CSS", "bytes": "39144"}, {"name": "HTML", "bytes": "5502"}, {"name": "JavaScript", "bytes": "460150"}, {"name": "PHP", "bytes": "1807984"}]}} +{"text": "import os\nfrom flask import Flask,render_template,url_for,request,session,redirect\nfrom flask_login import LoginManager\nfrom flask_bootstrap import Bootstrap\nfrom flask_script import Manager,Shell\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_mail import Mail\nfrom flask_moment import Moment\nfrom flask_socketio import SocketIO\nfrom flask_gravatar import Gravatar\n\napp = Flask(__name__)\nbasedir = os.path.abspath(os.path.dirname(__file__))\napp.config['SQLALCHEMY_DATABASE_URI'] =\\\n 'sqlite:///' + os.path.join(basedir, 'data.sqlite')\n#app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://sql6140009:Y1912zwYwC@sql6.freemysqlhosting.net/sql6140009'\napp.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False\napp.config['SECRET_KEY'] = 'hard to guess string'\n\napp.config['MAIL_SERVER'] = 'smtp.googlemail.com'\napp.config['MAIL_PORT'] = 587\napp.config['MAIL_USE_TLS'] = True\napp.config['MAIL_USERNAME'] = os.environ.get('MAIL_USERNAME')\napp.config['MAIL_PASSWORD'] = os.environ.get('MAIL_PASSWORD')\n\nmanager = Manager(app)\nbootstrap = Bootstrap()\ndb = SQLAlchemy(app)\nmail = Mail(app)\nmoment = Moment(app)\nsocketio = SocketIO(app)\ngravatar = Gravatar(app)\n\nlogin_manager = LoginManager()\nlogin_manager.session_protection = 'strong'\nlogin_manager.login_view = 'auth.login'\n# app.config['SECRET_KEY'] = 'hard to guess string'\n# app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True\n#app = create_app('DEVELOPMENT')\n\nbootstrap.init_app(app)\n#db.init_app(app)\nlogin_manager.init_app(app)\n\nfrom app import models\n\n@app.route('/')\ndef index():\n return render_template('index.html')\n\nfrom app.auth.views import admin\napp.register_blueprint(auth.views.admin,url_prefix = '/authentication')\n\nfrom app.main.views import welcome\napp.register_blueprint(main.views.welcome,url_prefix = '/welcome')\n\nfrom app.twitterAPI.views import api\napp.register_blueprint(twitterAPI.views.api,url_prefix = '/api')\n", "meta": {"content_hash": "a9735eefc6ff4807441825a5f2811599", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 117, "avg_line_length": 32.62068965517241, "alnum_prop": 0.7563424947145877, "repo_name": "sumedh123/debatify", "id": "89d78b1a48e585a5353b33fa5344659ba9f8770a", "size": "1892", "binary": false, "copies": "1", "ref": "refs/heads/UI", "path": "app/__init__.py", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "5939"}, {"name": "CSS", "bytes": "347155"}, {"name": "HTML", "bytes": "102503"}, {"name": "JavaScript", "bytes": "608373"}, {"name": "Python", "bytes": "8393673"}, {"name": "Shell", "bytes": "3298"}]}} +{"text": "/*\n * String hash computation (interning).\n */\n\n#include \"duk_internal.h\"\n\n/* constants for duk_hashstring() */\n#define STRING_HASH_SHORTSTRING 4096\n#define STRING_HASH_MEDIUMSTRING (256 * 1024)\n#define STRING_HASH_BLOCKSIZE 256\n\nduk_uint32_t duk_heap_hashstring(duk_heap *heap, duk_uint8_t *str, duk_size_t len) {\n\t/*\n\t * Sampling long strings by byte skipping (like Lua does) is potentially\n\t * a cache problem. Here we do 'block skipping' instead for long strings:\n\t * hash an initial part, and then sample the rest of the string with\n\t * reasonably sized chunks.\n\t *\n\t * Skip should depend on length and bound the total time to roughly\n\t * logarithmic.\n\t *\n\t * With current values:\n\t *\n\t * 1M string => 256 * 241 = 61696 bytes (0.06M) of hashing\n\t * 1G string => 256 * 16321 = 4178176 bytes (3.98M) of hashing\n\t *\n\t * After an initial part has been hashed, an offset is applied before\n\t * starting the sampling. The initial offset is computed from the\n\t * hash of the initial part of the string. The idea is to avoid the\n\t * case that all long strings have certain offset ranges that are never\n\t * sampled.\n\t */\n\t\n\t/* note: mixing len into seed improves hashing when skipping */\n\tduk_uint32_t str_seed = heap->hash_seed ^ len;\n\n\tif (len <= STRING_HASH_SHORTSTRING) {\n\t\treturn duk_util_hashbytes(str, len, str_seed);\n\t} else {\n\t\tduk_uint32_t hash;\n\t\tduk_size_t off;\n\t\tduk_size_t skip;\n\n\t\tif (len <= STRING_HASH_MEDIUMSTRING) {\n\t\t\tskip = (duk_size_t) (16 * STRING_HASH_BLOCKSIZE + STRING_HASH_BLOCKSIZE);\n\t\t} else {\n\t\t\tskip = (duk_size_t) (256 * STRING_HASH_BLOCKSIZE + STRING_HASH_BLOCKSIZE);\n\t\t}\n\n\t\thash = duk_util_hashbytes(str, (duk_size_t) STRING_HASH_SHORTSTRING, str_seed);\n\t\toff = STRING_HASH_SHORTSTRING + (skip * (hash % 256)) / 256;\n\n\t\t/* FIXME: inefficient loop */\n\t\twhile (off < len) {\n\t\t\tduk_size_t left = len - off;\n\t\t\tduk_size_t now = (duk_size_t) (left > STRING_HASH_BLOCKSIZE ? STRING_HASH_BLOCKSIZE : left);\n\t\t\thash ^= duk_util_hashbytes(str + off, now, str_seed);\n\t\t\toff += skip;\n\t\t}\n\n\t\treturn hash;\n\t}\n}\n\n", "meta": {"content_hash": "bab3317c67f40063ff7a69f3bcc74bb0", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 95, "avg_line_length": 32.140625, "alnum_prop": 0.6684491978609626, "repo_name": "JoshEngebretson/duktape", "id": "29411796cbb56b7d91920771a24db254493ccfc8", "size": "2057", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/duk_heap_hashstring.c", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "1972812"}, {"name": "C++", "bytes": "20922"}, {"name": "CoffeeScript", "bytes": "895"}, {"name": "JavaScript", "bytes": "15926045"}, {"name": "Objective-C", "bytes": "6054"}, {"name": "Python", "bytes": "136104"}, {"name": "Shell", "bytes": "12610"}]}} +{"text": "--TEST--\nRunkit_Sandbox_Parent Class -- Echo\n--SKIPIF--\n<?php if(!extension_loaded(\"runkit\") || !RUNKIT_FEATURE_SANDBOX) print \"skip\"; \n /* May not be available due to lack of TSRM interpreter support */\n if(!function_exists(\"runkit_sandbox_output_handler\")) print \"skip\"; ?>\n--FILE--\n<?php\n$php = new Runkit_Sandbox();\n$php['output_handler'] = 'test_handler';\n$php['parent_access'] = true;\n$php->ini_set('display_errors', true);\n$php->ini_set('html_errors', false);\n$php->eval('$PARENT = new Runkit_Sandbox_Parent;\n\t\t\techo \"Foo\\n\";\n\t\t\t$PARENT->echo(\"BarBar\\n\");');\n\nfunction test_handler($str) {\n if (strlen($str) == 0) return NULL; /* flush() */\n /* Echoing and returning have the same effect here, both go to parent's output chain */\n echo 'Received string from sandbox: ' . strlen($str) . \" bytes long.\\n\";\n\n return strtoupper($str);\n}\n--EXPECT--\nReceived string from sandbox: 4 bytes long.\nFOO\nReceived string from sandbox: 149 bytes long.\n\nWARNING: RUNKIT_SANDBOX_PARENT::ECHO(): ACCESS TO ECHO DATA IN THE PARENT CONTEXT IS NOT ENABLED IN UNKNOWN(0) : RUNKIT_SANDBOX EVAL CODE ON LINE 3\n", "meta": {"content_hash": "009fcdd5cf234bb851939760b7bb2bec", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 147, "avg_line_length": 36.93333333333333, "alnum_prop": 0.6796028880866426, "repo_name": "lzpfmh/runkit", "id": "44237969acec682b89517ba99d074aa575d5c09a", "size": "1108", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "tests/Runkit_Sandbox_Parent__.echo.access.phpt", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "263129"}, {"name": "C++", "bytes": "372"}, {"name": "PHP", "bytes": "141611"}, {"name": "SourcePawn", "bytes": "193"}]}} +{"text": "\npackage org.codehaus.groovy.grails.scaffolding;\n\nimport grails.build.logging.GrailsConsole;\nimport groovy.text.SimpleTemplateEngine;\nimport groovy.text.Template;\n\nimport java.io.BufferedWriter;\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.Writer;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.Map;\nimport java.util.Set;\n\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.codehaus.groovy.grails.commons.GrailsApplication;\nimport org.codehaus.groovy.grails.commons.GrailsDomainClass;\nimport org.codehaus.groovy.grails.commons.GrailsDomainClassProperty;\nimport org.codehaus.groovy.grails.plugins.GrailsPluginInfo;\nimport org.codehaus.groovy.grails.plugins.GrailsPluginManager;\nimport org.codehaus.groovy.grails.plugins.GrailsPluginUtils;\nimport org.codehaus.groovy.grails.plugins.PluginManagerAware;\nimport org.codehaus.groovy.runtime.IOGroovyMethods;\nimport org.codehaus.groovy.runtime.StringGroovyMethods;\nimport org.springframework.context.ResourceLoaderAware;\nimport org.springframework.core.io.AbstractResource;\nimport org.springframework.core.io.FileSystemResource;\nimport org.springframework.core.io.Resource;\nimport org.springframework.core.io.ResourceLoader;\nimport org.springframework.core.io.support.PathMatchingResourcePatternResolver;\nimport org.springframework.util.Assert;\nimport org.springframework.util.StringUtils;\n\npublic abstract class AbstractGrailsTemplateGenerator implements GrailsTemplateGenerator, ResourceLoaderAware, PluginManagerAware {\n\n\tprotected static final Log log = LogFactory.getLog(AbstractGrailsTemplateGenerator.class);\n\n\tprotected String basedir = \".\";\n\tprotected boolean overwrite = false;\n\tprotected SimpleTemplateEngine engine = new SimpleTemplateEngine();\n\tprotected ResourceLoader resourceLoader;\n\tprotected Template renderEditorTemplate;\n\tprotected String domainSuffix = \"\";\n\tprotected GrailsPluginManager pluginManager;\n\tprotected GrailsApplication grailsApplication;\n\n\tprotected AbstractGrailsTemplateGenerator(ClassLoader classLoader) {\n\t\tengine = new SimpleTemplateEngine(classLoader);\n\t}\n\n\tpublic void generateViews(GrailsDomainClass domainClass, String destDir) throws IOException {\n\t\tAssert.hasText(destDir, \"Argument [destdir] not specified\");\n\n\t\tFile viewsDir = new File(destDir, \"grails-app/views/\" + domainClass.getPropertyName());\n\t\tif (!viewsDir.exists()) {\n\t\t\tviewsDir.mkdirs();\n\t\t}\n\n\t\tfor (String name : getTemplateNames()) {\n if(log.isInfoEnabled())\n\t\t\t log.info(\"Generating [\"+name+\"] view for domain class [\"+domainClass.getFullName()+\"]\");\n\t\t\tgenerateView(domainClass, name, viewsDir.getAbsolutePath());\n\t\t}\n\t}\n\n\tpublic void generateController(GrailsDomainClass domainClass, String destDir) throws IOException {\n\t\tAssert.hasText(destDir, \"Argument [destdir] not specified\");\n\n\t\tif (domainClass == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tString fullName = domainClass.getFullName();\n\t\tString pkg = \"\";\n\t\tint pos = fullName.lastIndexOf('.');\n\t\tif (pos != -1) {\n\t\t\t// Package name with trailing '.'\n\t\t\tpkg = fullName.substring(0, pos + 1);\n\t\t}\n\n\t\tFile destFile = new File(destDir, \"grails-app/controllers/\" + pkg.replace('.', '/') + domainClass.getShortName() + \"Controller.groovy\");\n\t\tif (canWrite(destFile)) {\n\t\t\tdestFile.getParentFile().mkdirs();\n\n\t\t\tBufferedWriter writer = null;\n\t\t\ttry {\n\t\t\t\twriter = new BufferedWriter(new FileWriter(destFile));\n\t\t\t\tgenerateController(domainClass, writer);\n\t\t\t\ttry {\n\t\t\t\t\twriter.flush();\n\t\t\t\t}\n\t\t\t\tcatch (IOException ignored) {}\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tIOGroovyMethods.closeQuietly(writer);\n\t\t\t}\n\n\t\t\tlog.info(\"Controller generated at [\"+destFile+\"]\");\n\t\t}\n\t}\n\n @Override\n public void generateAsyncController(GrailsDomainClass domainClass, String destDir) throws IOException {\n Assert.hasText(destDir, \"Argument [destdir] not specified\");\n\n if (domainClass == null) {\n return;\n }\n\n String fullName = domainClass.getFullName();\n String pkg = \"\";\n int pos = fullName.lastIndexOf('.');\n if (pos != -1) {\n // Package name with trailing '.'\n pkg = fullName.substring(0, pos + 1);\n }\n\n File destFile = new File(destDir, \"grails-app/controllers/\" + pkg.replace('.', '/') + domainClass.getShortName() + \"Controller.groovy\");\n if (canWrite(destFile)) {\n destFile.getParentFile().mkdirs();\n\n BufferedWriter writer = null;\n try {\n writer = new BufferedWriter(new FileWriter(destFile));\n generateAsyncController(domainClass, writer);\n try {\n writer.flush();\n }\n catch (IOException ignored) {}\n }\n finally {\n IOGroovyMethods.closeQuietly(writer);\n }\n\n log.info(\"Controller generated at [\"+destFile+\"]\");\n }\n }\n\n public void generateView(GrailsDomainClass domainClass, String viewName, Writer out) throws IOException {\n\t\tString templateText = getTemplateText(viewName + \".gsp\");\n\n\t\tif (!StringUtils.hasLength(templateText)) {\n\t\t\treturn;\n\t\t}\n\n\t\tGrailsDomainClassProperty multiPart = null;\n\t\tfor (GrailsDomainClassProperty property : domainClass.getProperties()) {\n\t\t\tif (property.getType() == Byte[].class || property.getType() == byte[].class) {\n\t\t\t\tmultiPart = property;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tString packageName = StringUtils.hasLength(domainClass.getPackageName()) ? \"<%@ page import=\\\"\" + domainClass.getFullName() + \"\\\" %>\" : \"\";\n\t\tMap<String, Object> binding = createBinding(domainClass);\n\t\tbinding.put(\"packageName\", packageName);\n\t\tbinding.put(\"multiPart\", multiPart);\n\t\tbinding.put(\"propertyName\", getPropertyName(domainClass));\n\n\t\tgenerate(templateText, binding, out);\n\t}\n\n\tprotected abstract Object getRenderEditor();\n\n\tpublic void generateView(GrailsDomainClass domainClass, String viewName, String destDir) throws IOException {\n\t\tFile destFile = new File(destDir, viewName + \".gsp\");\n\t\tif (!canWrite(destFile)) {\n\t\t\treturn;\n\t\t}\n\n\t\tBufferedWriter writer = null;\n\t\ttry {\n\t\t\twriter = new BufferedWriter(new FileWriter(destFile));\n\t\t\tgenerateView(domainClass, viewName, writer);\n\t\t\ttry {\n\t\t\t\twriter.flush();\n\t\t\t}\n\t\t\tcatch (IOException ignored) {}\n\t\t}\n\t\tfinally {\n\t\t\tIOGroovyMethods.closeQuietly(writer);\n\t\t}\n\t}\n\n\tpublic void generateController(GrailsDomainClass domainClass, Writer out) throws IOException {\n\t\tString templateText = getTemplateText(\"Controller.groovy\");\n\n\t\tMap<String, Object> binding = createBinding(domainClass);\n\t\tbinding.put(\"packageName\", domainClass.getPackageName());\n\t\tbinding.put(\"propertyName\", getPropertyName(domainClass));\n\n\t\tgenerate(templateText, binding, out);\n\t}\n\n public void generateAsyncController(GrailsDomainClass domainClass, Writer out) throws IOException {\n String templateText = getTemplateText(\"AsyncController.groovy\");\n\n Map<String, Object> binding = createBinding(domainClass);\n binding.put(\"packageName\", domainClass.getPackageName());\n binding.put(\"propertyName\", getPropertyName(domainClass));\n\n generate(templateText, binding, out);\n }\n\n @Override\n public void generateAsyncTest(GrailsDomainClass domainClass, String destDir) throws IOException {\n generateTest(domainClass, destDir, \"AsyncSpec.groovy\");\n }\n\n\tpublic void generateTest(GrailsDomainClass domainClass, String destDir) throws IOException {\n generateTest(domainClass, destDir, \"Spec.groovy\");\n\t}\n\n private void generateTest(GrailsDomainClass domainClass, String destDir, String templateName) throws IOException {\n File destFile = new File(destDir, domainClass.getPackageName().replace('.', '/') + '/' + domainClass.getShortName() + \"ControllerSpec.groovy\");\n if (!canWrite(destFile)) {\n return;\n }\n\n String templateText = getTemplateText(templateName);\n\n Map<String, Object> binding = createBinding(domainClass);\n binding.put(\"packageName\", domainClass.getPackageName());\n binding.put(\"propertyName\", domainClass.getLogicalPropertyName());\n binding.put(\"modelName\", getPropertyName(domainClass));\n\n destFile.getParentFile().mkdirs();\n BufferedWriter writer = null;\n try {\n writer = new BufferedWriter(new FileWriter(destFile));\n generate(templateText, binding, writer);\n try {\n writer.flush();\n }\n catch (IOException ignored) {}\n }\n finally {\n IOGroovyMethods.closeQuietly(writer);\n }\n }\n\n\n @SuppressWarnings(\"deprecation\")\n protected Map<String, Object> createBinding(GrailsDomainClass domainClass) {\n\t\tboolean hasHibernate = pluginManager.hasGrailsPlugin(\"hibernate\") || pluginManager.hasGrailsPlugin(\"hibernate4\");\n\n\t\tMap<String, Object> binding = new HashMap<String, Object>();\n\t\tbinding.put(\"pluginManager\", pluginManager);\n\t\tbinding.put(\"domainClass\", domainClass);\n\t\tbinding.put(\"className\", domainClass.getShortName());\n\t\tbinding.put(\"renderEditor\", getRenderEditor());\n\t\tbinding.put(\"comparator\", hasHibernate ? DomainClassPropertyComparator.class : SimpleDomainClassPropertyComparator.class);\n\t\treturn binding;\n\t}\n\n\tprotected void generate(String templateText, Map<String, Object> binding, Writer out) {\n\t\ttry {\n\t\t\tengine.createTemplate(templateText).make(binding).writeTo(out);\n\t\t}\n\t\tcatch (ClassNotFoundException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}\n\n\tprotected String getPropertyName(GrailsDomainClass domainClass) {\n\t\treturn domainClass.getPropertyName() + domainSuffix;\n\t}\n\n\tprotected String getTemplateText(String template) throws IOException {\n\t\tInputStream inputStream = null;\n\t\tif (resourceLoader != null && grailsApplication.isWarDeployed()) {\n\t\t\tinputStream = resourceLoader.getResource(\"/WEB-INF/templates/scaffolding/\" + template).getInputStream();\n\t\t}\n\t\telse {\n\t\t\tAbstractResource templateFile = getTemplateResource(template);\n\t\t\tif (templateFile.exists()) {\n\t\t\t\tinputStream = templateFile.getInputStream();\n\t\t\t}\n\t\t}\n\n\t\treturn inputStream == null ? null : IOGroovyMethods.getText(inputStream);\n\t}\n\n\tprotected AbstractResource getTemplateResource(String template) throws IOException {\n\t\tString name = \"src/templates/scaffolding/\" + template;\n\t\tAbstractResource templateFile = new FileSystemResource(new File(basedir, name).getAbsoluteFile());\n\t\tif (!templateFile.exists()) {\n\t\t\ttemplateFile = new FileSystemResource(new File(getPluginDir(), name).getAbsoluteFile());\n\t\t}\n\n\t\treturn templateFile;\n\t}\n\n\tprotected File getPluginDir() throws IOException {\n\t\tGrailsPluginInfo info = GrailsPluginUtils.getPluginBuildSettings().getPluginInfoForName(\"scaffolding\");\n\t\treturn info.getDescriptor().getFile().getParentFile();\n\t}\n\n\tprotected boolean canWrite(File testFile) {\n\t\tif (overwrite || !testFile.exists()) {\n\t\t\treturn true;\n\t\t}\n\n\t\ttry {\n\t\t\tString relative = makeRelativeIfPossible(testFile.getAbsolutePath(), basedir);\n\t\t\tString response = GrailsConsole.getInstance().userInput(\n\t\t\t\t\t\"File \" + relative + \" already exists. Overwrite?\", new String[] { \"y\", \"n\", \"a\" });\n\t\t\toverwrite = overwrite || \"a\".equals(response);\n\t\t\treturn overwrite || \"y\".equals(response);\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t// failure to read from standard in means we're probably running from an automation tool like a build server\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tprotected String makeRelativeIfPossible(String fileName, String base) throws IOException {\n\t\tif (StringUtils.hasLength(base)) {\n\t\t\tfileName = StringGroovyMethods.minus(fileName, new File(base).getCanonicalPath());\n\t\t}\n\t\treturn fileName;\n\t}\n\n\tprotected Set<String> getTemplateNames() throws IOException {\n\n\t\tif (resourceLoader != null && grailsApplication.isWarDeployed()) {\n\t\t\ttry {\n\t\t\t\tPathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(resourceLoader);\n\t\t\t\treturn extractNames(resolver.getResources(\"/WEB-INF/templates/scaffolding/*.gsp\"));\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\treturn Collections.emptySet();\n\t\t\t}\n\t\t}\n\n\t\tPathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();\n\t\tSet<String> resources = new HashSet<String>();\n\n\t\tString templatesDirPath = basedir + \"/src/templates/scaffolding\";\n\t\tResource templatesDir = new FileSystemResource(templatesDirPath);\n\t\tif (templatesDir.exists()) {\n\t\t\ttry {\n\t\t\t\tresources.addAll(extractNames(resolver.getResources(\"file:\" + templatesDirPath + \"/*.gsp\")));\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tlog.error(\"Error while loading views from \" + basedir, e);\n\t\t\t}\n\t\t}\n\n\t\tFile pluginDir = getPluginDir();\n\t\ttry {\n\t\t\tresources.addAll(extractNames(resolver.getResources(\"file:\" + pluginDir + \"/src/templates/scaffolding/*.gsp\")));\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t// ignore\n\t\t\tlog.error(\"Error locating templates from \" + pluginDir + \": \" + e.getMessage(), e);\n\t\t}\n\n\t\treturn resources;\n\t}\n\n\tprotected Set<String> extractNames(Resource[] resources) {\n\t\tSet<String> names = new HashSet<String>();\n\t\tfor (Resource resource : resources) {\n\t\t\tString name = resource.getFilename();\n\t\t\tnames.add(name.substring(0, name.length() - 4));\n\t\t}\n\t\treturn names;\n\t}\n\n\tpublic void setGrailsApplication(GrailsApplication ga) {\n\t\tgrailsApplication = ga;\n\t\tObject suffix = ga.getFlatConfig().get(\"grails.scaffolding.templates.domainSuffix\");\n\t\tif (suffix instanceof CharSequence) {\n\t\t\tdomainSuffix = suffix.toString();\n\t\t}\n\t}\n\n\tpublic void setResourceLoader(ResourceLoader rl) {\n if(log.isInfoEnabled())\n\t\t log.info(\"Scaffolding template generator set to use resource loader [\"+rl+\"]\");\n\t\tresourceLoader = rl;\n\t}\n\n\tpublic void setPluginManager(GrailsPluginManager gpm) {\n\t\tpluginManager = gpm;\n\t}\n\n\tpublic void setOverwrite(boolean shouldOverwrite) {\n\t\toverwrite = shouldOverwrite;\n\t}\n}\n", "meta": {"content_hash": "8970b7709bd54fcfed5f3a9952916ba2", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 151, "avg_line_length": 34.53366583541147, "alnum_prop": 0.7154823801270942, "repo_name": "eptresmo/dbMigrationTest", "id": "e723c197e0218138ec76d778e67165fef6866c91", "size": "14445", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "dbMigrationTest/target/work/plugins/scaffolding-2.0.1/src/java/org/codehaus/groovy/grails/scaffolding/AbstractGrailsTemplateGenerator.java", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\ufeff// --------------------------------------------------------------------------------------------\r\n// <copyright file=\"EffortProviderFactory.cs\" company=\"Effort Team\">\r\n// Copyright (C) 2011-2014 Effort Team\r\n//\r\n// Permission is hereby granted, free of charge, to any person obtaining a copy\r\n// of this software and associated documentation files (the \"Software\"), to deal\r\n// in the Software without restriction, including without limitation the rights\r\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n// copies of the Software, and to permit persons to whom the Software is\r\n// furnished to do so, subject to the following conditions:\r\n//\r\n// The above copyright notice and this permission notice shall be included in\r\n// all copies or substantial portions of the Software.\r\n//\r\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n// THE SOFTWARE.\r\n// </copyright>\r\n// --------------------------------------------------------------------------------------------\r\n\r\nnamespace Effort.Provider\r\n{\r\n using System;\r\n using System.Data;\r\n using System.Data.Common;\r\n#if !EFOLD\r\n using System.Data.Entity.Core.Common;\r\n#endif\r\n\r\n /// <summary>\r\n /// Represents a set of methods for creating instances of the \r\n /// <see cref=\"N:Effort.Provider\"/> provider's implementation of the data source classes.\r\n /// </summary>\r\n public class EffortProviderFactory : DbProviderFactory, IServiceProvider\r\n {\r\n /// <summary>\r\n /// Provides a singleton instance of the <see cref=\"EffortProviderFactory\"/> class.\r\n /// </summary>\r\n public static readonly EffortProviderFactory Instance = new EffortProviderFactory();\r\n\r\n /// <summary>\r\n /// Prevents a default instance of the <see cref=\"EffortProviderFactory\" /> class\r\n /// from being created.\r\n /// </summary>\r\n private EffortProviderFactory()\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// Returns a new instance of the <see cref=\"T:EffortConnection\" /> class.\r\n /// </summary>\r\n /// <returns>\r\n /// A new instance of <see cref=\"T:EffortConnection\" />.\r\n /// </returns>\r\n public override DbConnection CreateConnection()\r\n {\r\n return new EffortConnection();\r\n }\r\n\r\n /// <summary>\r\n /// Gets the service object of the specified type.\r\n /// </summary>\r\n /// <param name=\"serviceType\">\r\n /// An object that specifies the type of service object to get.\r\n /// </param>\r\n /// <returns>\r\n /// A service object of type <paramref name=\"serviceType\" />.-or- null if there is\r\n /// no service object of type <paramref name=\"serviceType\" />.\r\n /// </returns>\r\n public object GetService(Type serviceType)\r\n {\r\n if (serviceType == typeof(DbProviderServices))\r\n {\r\n return EffortProviderServices.Instance;\r\n }\r\n\r\n return null;\r\n }\r\n }\r\n}\r\n", "meta": {"content_hash": "767841cdd80110458b083c02f09c4e70", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 96, "avg_line_length": 42.023809523809526, "alnum_prop": 0.5781869688385269, "repo_name": "wertzui/effort", "id": "62bcbbc5cb1dad86155bd8a97196855269b6d236", "size": "3532", "binary": false, "copies": "3", "ref": "refs/heads/develop", "path": "Main/Source/Effort/Provider/EffortProviderFactory.cs", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "1104"}, {"name": "C#", "bytes": "2446943"}]}} +{"text": "import { VGrid } from '../v-grid';\nimport { BindingContextInterface, OverrideContextInterface } from '../../interfaces';\nexport declare class VGridAttributesImageFix {\n private vGrid;\n private element;\n private value;\n private bindingContext;\n private overrideContext;\n constructor(element: HTMLImageElement, vGrid: VGrid);\n valueChanged(newValue: string): void;\n bind(bindingContext: BindingContextInterface, overrideContext: OverrideContextInterface): void;\n}\n", "meta": {"content_hash": "288050943bddd389f02d6c1488f7c9da", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 99, "avg_line_length": 40.5, "alnum_prop": 0.7551440329218106, "repo_name": "vegarringdal/vGrid", "id": "7a892151b3f517aeff4464ab7de2c01ac475f8d0", "size": "486", "binary": false, "copies": "4", "ref": "refs/heads/dev-rebuild", "path": "dist/es2015/grid/attributes/v-image.d.ts", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "24447"}, {"name": "HTML", "bytes": "19771"}, {"name": "JavaScript", "bytes": "7057"}, {"name": "TypeScript", "bytes": "1639454"}]}} +{"text": "layout: page\ntitle: Cliffs Tech Executive Retreat\ndate: 2016-05-24\nauthor: Beverly Snyder\ntags: weekly links, java\nstatus: published\nsummary: Vivamus sed ligula quis mi cursus venenatis sed sed nunc.\nbanner: images/banner/people.jpg\nbooking:\n startDate: 05/29/2018\n endDate: 05/31/2018\n ctyhocn: HSTFLHX\n groupCode: CTER\npublished: true\n---\nMauris id odio eget libero fermentum egestas vel vitae ligula. Suspendisse vestibulum ipsum sem, vel ornare ex lacinia ac. Etiam a sem auctor, dignissim tellus vitae, consequat arcu. Cras rutrum lorem metus, sed lacinia nunc sollicitudin non. Praesent quam mi, aliquet ut lorem at, dictum faucibus ante. Vivamus sit amet ligula vulputate, sollicitudin arcu at, ullamcorper elit. Aenean aliquet molestie tincidunt. Nulla sed lectus diam. Donec gravida enim ut lorem blandit, sed ultricies arcu auctor. Donec odio ante, fringilla id lacus vel, sagittis dignissim elit. Duis mattis turpis tellus, at pulvinar leo commodo at. Etiam in lectus odio. Curabitur ipsum nisi, tincidunt eu ligula ac, cursus pellentesque lacus. Quisque enim sem, tempor non convallis maximus, semper id nisl. Donec eu sapien vel sapien posuere semper. Cras nisi justo, rhoncus ac urna at, cursus scelerisque libero.\n\n1 Proin bibendum tortor at ipsum commodo, vel gravida elit pretium\n1 Phasellus tincidunt lorem vitae elit ultrices, id volutpat mi fermentum\n1 Nunc interdum orci vel lobortis sodales.\n\nPraesent at risus ipsum. Morbi mattis blandit mauris, in fermentum nibh condimentum ut. In mattis risus et diam sagittis euismod. Sed vel dolor id dui dapibus viverra. Praesent efficitur ut quam et auctor. Sed venenatis convallis ex, nec vulputate est tincidunt vitae. In pulvinar faucibus odio, eu viverra tortor pharetra iaculis. Nunc cursus sagittis mauris, at blandit nisi auctor eget. Sed mollis diam eu volutpat pulvinar. In a luctus felis. Integer lobortis purus id lacus porta rutrum. Etiam sit amet lobortis magna. Nulla id libero convallis, luctus lorem ac, fermentum orci. Integer vel maximus sapien, non blandit sapien. Vivamus a tempus purus.\n", "meta": {"content_hash": "43f9f6179677a71fbbce864c5125cf6a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 887, "avg_line_length": 94.31818181818181, "alnum_prop": 0.8043373493975904, "repo_name": "KlishGroup/prose-pogs", "id": "6f3c04ea1edb8b269359b353872dd5964911f4eb", "size": "2079", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "pogs/H/HSTFLHX/CTER/index.md", "mode": "33188", "license": "mit", "language": []}} +{"text": "namespace igl\n{\n // Subdivide a mesh without moving vertices: loop subdivision but odd\n // vertices stay put and even vertices are just edge midpoints\n // \n // Templates:\n // MatV matrix for vertex positions, e.g. MatrixXd\n // MatF matrix for vertex positions, e.g. MatrixXi\n // Inputs:\n // V #V by dim mesh vertices\n // F #F by 3 mesh triangles\n // Outputs:\n // NV new vertex positions, V is guaranteed to be at top\n // NF new list of face indices\n //\n // NOTE: V should not be the same as NV,\n // NOTE: F should not be the same as NF, use other proto\n //\n // Known issues:\n // - assumes (V,F) is edge-manifold.\n template <\n typename DerivedV, \n typename DerivedF,\n typename DerivedNV,\n typename DerivedNF>\n IGL_INLINE void upsample(\n const Eigen::PlainObjectBase<DerivedV>& V,\n const Eigen::PlainObjectBase<DerivedF>& F,\n Eigen::PlainObjectBase<DerivedNV>& NV,\n Eigen::PlainObjectBase<DerivedNF>& NF);\n // Virtually in place wrapper\n template <\n typename MatV, \n typename MatF>\n IGL_INLINE void upsample(\n MatV& V,\n MatF& F);\n}\n\n#ifndef IGL_STATIC_LIBRARY\n# include \"upsample.cpp\"\n#endif\n\n#endif\n", "meta": {"content_hash": "a1cdb7cff1bb173dd9cbbff48005f1e2", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 71, "avg_line_length": 26.772727272727273, "alnum_prop": 0.6612903225806451, "repo_name": "FabianRepository/SinusProject", "id": "5ca05336dfac2db8a87a07b48ee4c4d7219d853e", "size": "1710", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "Code/include/igl/upsample.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "1822674"}, {"name": "C++", "bytes": "11420706"}, {"name": "CMake", "bytes": "20858"}, {"name": "Makefile", "bytes": "4050"}, {"name": "Objective-C", "bytes": "11880"}, {"name": "Shell", "bytes": "15321"}]}} +{"text": "/*___Generated_by_IDEA___*/\n\npackage com.grafixartist.androidn;\n\n/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */\npublic final class BuildConfig {\n public final static boolean DEBUG = Boolean.parseBoolean(null);\n}", "meta": {"content_hash": "26542977f302c1033ce570a5d275b19c", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 101, "avg_line_length": 33.375, "alnum_prop": 0.7490636704119851, "repo_name": "Suleiman19/Android-N-Sample", "id": "3f2817dcd993334f72e2c9570e2c1671e560df79", "size": "267", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gen/com/grafixartist/androidn/BuildConfig.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "10473"}]}} +{"text": "<?php\n\nnamespace Molajo\\Query\\Builder;\n\nuse CommonApi\\Fieldhandler\\FieldhandlerInterface;\nuse DateTime;\n\n/**\n * Query Builder Sql Class\n *\n * External API - all other class methods are called by this class\n * DB-specific adapters extend this class\n *\n * Sql - BuildSql - BuildSqlElements - BuildSqlGroups - SetData - EditData - FilterData - Base\n *\n * @package Molajo\n * @license http://www.opensource.org/licenses/mit-license.html MIT License\n * @since 1.0\n */\nabstract class Sql extends BuildSql\n{\n /**\n * Constructor\n *\n * @since 1.0.0\n */\n public function __construct(\n FieldhandlerInterface $fieldhandler,\n $database_prefix\n ) {\n $this->fieldhandler = $fieldhandler;\n $this->database_prefix = $database_prefix;\n }\n\n /**\n * Get SQL\n *\n * At this point, all values have been input, filtered and set in element-specific item arrays\n * Now, generate the full SQL statement, building the SQL statement and quoting/escaping data\n *\n * @param null|string $sql\n *\n * @return string\n * @since 1.0.0\n */\n public function getSql($sql = null)\n {\n if ($sql === null || trim($sql) === '') {\n $this->generateSql();\n } else {\n $this->sql = '';\n $this->getExternalSql($sql);\n }\n\n return $this->sql;\n }\n\n /**\n * Get the current value (or default) of the specified property\n *\n * @param string $key `````\n * @param mixed $default\n *\n * @return mixed\n * @since 1.0.0\n */\n public function get($key, $default = null)\n {\n if ($this->$key === null) {\n $this->$key = $default;\n }\n\n return $this->$key;\n }\n\n /**\n * Clear Query String\n *\n * @return $this\n * @since 1.0.0\n */\n public function clearQuery()\n {\n $this->query_type = 'select';\n $this->distinct = false;\n $this->columns = array();\n $this->update_columns = array();\n $this->values = array();\n $this->from = array();\n $this->insert_into_table = null;\n $this->where_group = array();\n $this->where = array();\n $this->group_by = array();\n $this->having_group = array();\n $this->having = array();\n $this->query_object = 'list';\n $this->order_by = array();\n $this->use_pagination = 0;\n $this->offset = 0;\n $this->limit = 0;\n $this->sql = '';\n\n return $this;\n }\n\n /**\n * Set Query Type\n *\n * @param string $query_type\n *\n * @return $this\n * @since 1.0.0\n */\n public function setType($query_type = 'select')\n {\n if (in_array(strtolower($query_type), $this->query_type_array)) {\n $this->query_type = strtolower($query_type);\n } else {\n $this->query_type = 'select';\n }\n\n return $this;\n }\n\n /**\n * Retrieves the current date and time formatted in a manner compliant with the database driver\n *\n * @return string\n * @since 1.0.0\n */\n public function getDate()\n {\n $date = new DateTime();\n\n return $date->format($this->date_format);\n }\n\n /**\n * Returns a value for null date that is compliant with the database driver\n *\n * @return string\n * @since 1.0.0\n */\n public function getNullDate()\n {\n return $this->null_date;\n }\n\n /**\n * Retrieves the PHP date format compliant with the database driver\n *\n * @return string\n * @since 1.0.0\n */\n public function getDateFormat()\n {\n return $this->date_format;\n }\n\n /**\n * Set Distinct Indicator\n *\n * @param boolean $distinct\n *\n * @return $this\n * @since 1.0.0\n */\n public function setDistinct($distinct = false)\n {\n if ($distinct === true) {\n $this->distinct = true;\n } else {\n $this->distinct = false;\n }\n\n return $this;\n }\n\n /**\n * Used for select, insert, and update to specify column name, alias (optional)\n * For Insert and Update, only, value and data_type\n *\n * @param string $column_name\n * @param null|string $alias\n * @param null|mixed $value\n * @param null|string $data_type\n *\n * @return $this\n * @since 1.0.0\n */\n public function select($column_name, $alias = null, $value = null, $data_type = null)\n {\n $this->editRequired('column_name', $column_name);\n\n if ($data_type === 'special') {\n } else {\n if ($value === null) {\n $data_type = 'column';\n }\n }\n\n $this->columns[$column_name]\n = $this->setItem($column_name, $data_type, $value, $alias, null, false);\n\n return $this;\n }\n\n /**\n * Set From table name and optional value for alias\n *\n * @param string $table_name\n * @param null|string $alias\n * @param boolean $primary\n *\n * @return $this\n * @since 1.0.0\n */\n public function from($table_name, $alias = null, $primary = false)\n {\n $this->editRequired('table_name', $table_name);\n\n $key = $this->setFromKey($table_name, $alias);\n\n $this->from[$key] = $this->setItem($table_name, 'string', null, $alias, null, false);\n\n if ($this->findFromPrimary() === true && $primary === false) {\n return $this;\n }\n\n $this->setFromPrimary($key);\n\n return $this;\n }\n\n /**\n * Set Insert Into Table Name\n *\n * @param string $table_name\n *\n * @return $this\n * @since 1.0.0\n */\n public function setInsertInto($table_name)\n {\n $this->editRequired('table_name', $table_name);\n\n $this->insert_into_table = (string)$table_name;\n\n return $this;\n }\n\n /**\n * Set From table key\n *\n * @param string $table_name\n * @param null|string $alias\n *\n * @return $this\n * @since 1.0.0\n */\n public function setFromKey($table_name, $alias = null)\n {\n return ($table_name . ' ' . $alias);\n }\n\n /**\n * Create a grouping for 'and' or 'or' groups of where conditions\n *\n * @param string $group\n * @param string $group_connector\n *\n * @return $this\n * @since 1.0.0\n */\n public function whereGroup($group, $group_connector = 'AND')\n {\n $this->where_group\n = $this->setGroup($group, $group_connector, 'where', $this->where_group);\n\n return $this;\n }\n\n /**\n * Create a grouping for 'and' or 'or' groups of having conditions\n *\n * @param string $group\n * @param string $group_connector\n *\n * @return $this\n * @since 1.0.0\n */\n public function havingGroup($group, $group_connector = 'AND')\n {\n $this->having_group\n = $this->setGroup($group, $group_connector, 'having', $this->having_group);\n\n return $this;\n }\n\n /**\n * Set Where Conditions for Query\n *\n * @param string $left_filter\n * @param string $left\n * @param string $condition\n * @param string $right_filter\n * @param string $right\n * @param string $connector\n * @param null|string $group\n *\n * @return $this\n * @since 1.0.0\n */\n public function where(\n $left_filter = 'column',\n $left = '',\n $condition = '',\n $right_filter = 'column',\n $right = '',\n $connector = 'and',\n $group = null\n ) {\n $item = $this->setLeftRightConditionals(\n $left_filter,\n $left,\n $condition,\n $right_filter,\n $right,\n $connector,\n $group\n );\n\n $this->where[] = $item;\n\n return $this;\n }\n\n /**\n * Set Having Conditions for Query\n *\n * @param string $left_filter\n * @param string $left\n * @param string $condition\n * @param string $right_filter\n * @param string $right\n * @param string $connector\n * @param null|string $group\n *\n * @return $this\n * @since 1.0.0\n */\n public function having(\n $left_filter = 'column',\n $left = '',\n $condition = '',\n $right_filter = 'column',\n $right = '',\n $connector = 'and',\n $group = null\n ) {\n $item = $this->setLeftRightConditionals(\n $left_filter,\n $left,\n $condition,\n $right_filter,\n $right,\n $connector,\n $group\n );\n\n $this->having[] = $item;\n\n return $this;\n }\n\n /**\n * Group By column name\n *\n * @param string $column_name\n *\n * @return $this\n * @since 1.0.0\n */\n public function groupBy($column_name)\n {\n $this->group_by[] = $this->setGroupByOrderBy($column_name, 'group by');\n\n return $this;\n }\n\n /**\n * Order By column name\n *\n * @param string $column_name\n * @param null|string $direction\n *\n * @return $this\n * @since 1.0.0\n */\n public function orderBy($column_name, $direction = 'ASC')\n {\n $this->order_by[] = $this->setGroupByOrderBy($column_name, 'order by', $direction);\n\n return $this;\n }\n\n /**\n * Offset and Limit\n *\n * @param int $offset\n * @param int $limit\n *\n * @return $this\n * @since 1.0.0\n */\n public function setOffsetAndLimit($offset = 0, $limit = 0)\n {\n $this->setOffsetOrLimit($offset, $type = 'offset');\n $this->setOffsetOrLimit($limit, $type = 'limit');\n\n return $this;\n }\n}\n", "meta": {"content_hash": "4cba7c7b8d58f8f451db992b967927b1", "timestamp": "", "source": "github", "line_count": 423, "max_line_length": 99, "avg_line_length": 23.6903073286052, "alnum_prop": 0.4923660313341982, "repo_name": "Molajo/Query", "id": "35418dea65445de82454beeae6395b58c24ef1b5", "size": "10218", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/Query/Builder/Sql.php", "mode": "33188", "license": "mit", "language": [{"name": "PHP", "bytes": "512092"}]}} +{"text": "\n\npackage org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.math;\n\nimport java.math.BigDecimal;\nimport java.util.ArrayList;\nimport java.util.List;\nimport org.apache.beam.sdk.extensions.sql.impl.interpreter.BeamSqlFnExecutorTestBase;\nimport org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.BeamSqlExpression;\nimport org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.BeamSqlPrimitive;\nimport org.apache.calcite.sql.type.SqlTypeName;\nimport org.junit.Assert;\nimport org.junit.Test;\n\n/**\n * Test for {@link BeamSqlMathUnaryExpression}.\n */\npublic class BeamSqlMathUnaryExpressionTest extends BeamSqlFnExecutorTestBase {\n\n @Test public void testForGreaterThanOneOperands() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // operands more than 1 not allowed\n operands.add(BeamSqlPrimitive.of(SqlTypeName.INTEGER, 2));\n operands.add(BeamSqlPrimitive.of(SqlTypeName.INTEGER, 4));\n Assert.assertFalse(new BeamSqlAbsExpression(operands).accept());\n }\n\n @Test public void testForOperandsType() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // varchar operand not allowed\n operands.add(BeamSqlPrimitive.of(SqlTypeName.VARCHAR, \"2\"));\n Assert.assertFalse(new BeamSqlAbsExpression(operands).accept());\n }\n\n @Test public void testForUnaryExpressions() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for sqrt function\n operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf(\"2\")));\n\n // test for abs function\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.BIGINT, -28965734597L));\n Assert.assertEquals(28965734597L,\n new BeamSqlAbsExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForLnExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for LN function with operand type smallint\n operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf(\"2\")));\n Assert.assertEquals(Math.log(2),\n new BeamSqlLnExpression(operands).evaluate(record, null).getValue());\n\n // test for LN function with operand type double\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4));\n Assert\n .assertEquals(Math.log(2.4),\n new BeamSqlLnExpression(operands).evaluate(record, null).getValue());\n // test for LN function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56)));\n Assert.assertEquals(Math.log(2.56),\n new BeamSqlLnExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForLog10Expression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for log10 function with operand type smallint\n operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf(\"2\")));\n Assert.assertEquals(Math.log10(2),\n new BeamSqlLogExpression(operands).evaluate(record, null).getValue());\n // test for log10 function with operand type double\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4));\n Assert.assertEquals(Math.log10(2.4),\n new BeamSqlLogExpression(operands).evaluate(record, null).getValue());\n // test for log10 function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56)));\n Assert.assertEquals(Math.log10(2.56),\n new BeamSqlLogExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForExpExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type smallint\n operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf(\"2\")));\n Assert.assertEquals(Math.exp(2),\n new BeamSqlExpExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type double\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4));\n Assert.assertEquals(Math.exp(2.4),\n new BeamSqlExpExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56)));\n Assert.assertEquals(Math.exp(2.56),\n new BeamSqlExpExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForAcosExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type smallint\n operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf(\"2\")));\n Assert.assertEquals(Double.NaN,\n new BeamSqlAcosExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type double\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 0.45));\n Assert.assertEquals(Math.acos(0.45),\n new BeamSqlAcosExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(-0.367)));\n Assert.assertEquals(Math.acos(-0.367),\n new BeamSqlAcosExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForAsinExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type double\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 0.45));\n Assert.assertEquals(Math.asin(0.45),\n new BeamSqlAsinExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(-0.367)));\n Assert.assertEquals(Math.asin(-0.367),\n new BeamSqlAsinExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForAtanExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type double\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 0.45));\n Assert.assertEquals(Math.atan(0.45),\n new BeamSqlAtanExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(-0.367)));\n Assert.assertEquals(Math.atan(-0.367),\n new BeamSqlAtanExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForCosExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type double\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 0.45));\n Assert.assertEquals(Math.cos(0.45),\n new BeamSqlCosExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(-0.367)));\n Assert.assertEquals(Math.cos(-0.367),\n new BeamSqlCosExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForCotExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type double\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, .45));\n Assert.assertEquals(1.0d / Math.tan(0.45),\n new BeamSqlCotExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(-.367)));\n Assert.assertEquals(1.0d / Math.tan(-0.367),\n new BeamSqlCotExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForDegreesExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type smallint\n operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf(\"2\")));\n Assert.assertEquals(Math.toDegrees(2),\n new BeamSqlDegreesExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type double\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4));\n Assert.assertEquals(Math.toDegrees(2.4),\n new BeamSqlDegreesExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56)));\n Assert.assertEquals(Math.toDegrees(2.56),\n new BeamSqlDegreesExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForRadiansExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type smallint\n operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf(\"2\")));\n Assert.assertEquals(Math.toRadians(2),\n new BeamSqlRadiansExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type double\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4));\n Assert.assertEquals(Math.toRadians(2.4),\n new BeamSqlRadiansExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56)));\n Assert.assertEquals(Math.toRadians(2.56),\n new BeamSqlRadiansExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForSinExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type smallint\n operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf(\"2\")));\n Assert.assertEquals(Math.sin(2),\n new BeamSqlSinExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type double\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4));\n Assert.assertEquals(Math.sin(2.4),\n new BeamSqlSinExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56)));\n Assert.assertEquals(Math.sin(2.56),\n new BeamSqlSinExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForTanExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type smallint\n operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf(\"2\")));\n Assert.assertEquals(Math.tan(2),\n new BeamSqlTanExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type double\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4));\n Assert.assertEquals(Math.tan(2.4),\n new BeamSqlTanExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56)));\n Assert.assertEquals(Math.tan(2.56),\n new BeamSqlTanExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForSignExpression() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n\n // test for exp function with operand type smallint\n operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf(\"2\")));\n Assert.assertEquals((short) 1\n , new BeamSqlSignExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type double\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4));\n Assert.assertEquals(1.0, new BeamSqlSignExpression(operands).evaluate(record, null).getValue());\n // test for exp function with operand type decimal\n operands.clear();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56)));\n Assert.assertEquals(BigDecimal.ONE,\n new BeamSqlSignExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForPi() {\n Assert.assertEquals(Math.PI, new BeamSqlPiExpression().evaluate(record, null).getValue());\n }\n\n @Test public void testForCeil() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.68687979));\n Assert.assertEquals(Math.ceil(2.68687979),\n new BeamSqlCeilExpression(operands).evaluate(record, null).getValue());\n }\n\n @Test public void testForFloor() {\n List<BeamSqlExpression> operands = new ArrayList<>();\n operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.68687979));\n Assert.assertEquals(Math.floor(2.68687979),\n new BeamSqlFloorExpression(operands).evaluate(record, null).getValue());\n }\n\n}\n", "meta": {"content_hash": "0f912d403eeb23eb9c577b43291462b1", "timestamp": "", "source": "github", "line_count": 296, "max_line_length": 100, "avg_line_length": 44.7195945945946, "alnum_prop": 0.72675077434464, "repo_name": "wangyum/beam", "id": "d80a67071e9aebc3146dcaa4f1479f5802c1f00f", "size": "14042", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/interpreter/operator/math/BeamSqlMathUnaryExpressionTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Go", "bytes": "109377"}, {"name": "Groovy", "bytes": "84452"}, {"name": "Java", "bytes": "14117162"}, {"name": "Python", "bytes": "3165393"}, {"name": "Shell", "bytes": "55385"}]}} +{"text": "set -e\ngit clone https://github.com/nanomsg/nnpy.git\n# top of tree won't install\ncd nnpy\ngit checkout c7e718a5173447c85182dc45f99e2abcf9cd4065\nsudo pip install cffi\nsudo pip install .\ncd ..\n", "meta": {"content_hash": "2df4b09d1debc62ee0178e0ebf554c12", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 53, "avg_line_length": 23.75, "alnum_prop": 0.7947368421052632, "repo_name": "hanw/behavioral-model", "id": "77a7d63afe47a1741d549f97580015fe9cbc31ca", "size": "200", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "travis/install-nnpy.sh", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "93627"}, {"name": "C++", "bytes": "2126481"}, {"name": "M4", "bytes": "69750"}, {"name": "Makefile", "bytes": "44234"}, {"name": "P4", "bytes": "37531"}, {"name": "Python", "bytes": "271835"}, {"name": "Ruby", "bytes": "5182"}, {"name": "Shell", "bytes": "11424"}, {"name": "Thrift", "bytes": "25904"}]}} +{"text": "\npackage au.net.zeus.rmi.tls;\n\nimport java.net.Socket;\nimport java.security.AccessController;\nimport java.security.GeneralSecurityException;\nimport java.security.NoSuchAlgorithmException;\nimport java.security.NoSuchProviderException;\nimport java.security.Principal;\nimport java.security.cert.CertPath;\nimport java.security.cert.CertificateException;\nimport java.security.cert.X509Certificate;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\nimport javax.security.auth.Subject;\nimport javax.security.auth.x500.X500PrivateCredential;\nimport net.jini.io.UnsupportedConstraintException;\nimport net.jini.security.AuthenticationPermission;\nimport org.apache.river.logging.Levels;\n\n/**\n *\n * @author peter\n */\nclass ClientSubjectKeyManager extends SubjectKeyManager {\n /** Client logger */\n private static final Logger logger = CLIENT_LOGGER;\n \n \n /** Returns the client logger */\n Logger getLogger() {\n\treturn logger;\n }\n \n ClientSubjectKeyManager(Subject subject) throws NoSuchAlgorithmException, NoSuchProviderException {\n\tsuper(subject);\n }\n\n @Override\n public String[] getClientAliases(String keyType, Principal[] issuers) {\n\tList certPaths = getCertificateChains(getSubject());\n\tif (certPaths == null) {\n\t return null;\n\t}\n\tCollection result = null;\n\tfor (int i = certPaths.size(); --i >= 0;) {\n\t CertPath chain = (CertPath) certPaths.get(i);\n\t Exception exception;\n\t try {\n\t\tif (checkChain(chain, keyType, issuers) != null) {\n\t\t if (result == null) {\n\t\t\tresult = new ArrayList(certPaths.size());\n\t\t }\n\t\t result.add(getCertificateName(firstX509Cert(chain)));\n\t\t}\n\t\tcontinue;\n\t } catch (SecurityException e) {\n\t\texception = e;\n\t } catch (GeneralSecurityException ex) {\n\t\texception = ex;\n\t }\n\t Logger logger = Logger.getLogger(SubjectKeyManager.class.getName());\n\t if (logger.isLoggable(Levels.HANDLED)) {\n\t\tlogger.log(Levels.HANDLED, \"Swallowed SecurityException thrown\", exception);\n\t }\n\t}\n\tif (result == null) {\n\t return null;\n\t} else {\n\t return (String[]) result.toArray(new String[result.size()]);\n\t}\n }\n\n @Override\n public synchronized String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) {\n\t/*\n\t * Only choose new client credentials for the first handshake.\n\t * Otherwise, just use the previous client credentials.\n\t */\n\tif (clientCredential == null) {\n\t for (String keyType : keyTypes) {\n\t\ttry {\n\t\t if (exceptionMap.get(keyType) != null) {\n\t\t\t// Prior exception found for keytype\n\t\t\treturn null;\n\t\t }\n\n\t\t clientCredential = chooseCredential(keyType, issuers);\n\t\t if (clientCredential != null) {\n // clientCredential found\n\t\t\texceptionMap.put(keyType, null);\n\t\t\tbreak;\n \n } else {\n\t\t\texceptionMap.put(keyType,\n new GeneralSecurityException(\"Credentials not found\"));\n\t\t }\n\t\t continue;\n \n\t\t} catch (GeneralSecurityException e) {\n\t\t exceptionMap.put(keyType, e);\n\t\t} catch (SecurityException e) {\n\t\t exceptionMap.put(keyType, e);\n\t\t}\n\t }\n\t if (clientCredential == null) {\n\t\treturn null;\n\t }\n\t}\n \n\tX509Certificate cert = clientCredential.getCertificate();\n\tclientPrincipal = cert.getSubjectX500Principal();\n\tcredentialsValidUntil = Math.min(credentialsValidUntil, certificatesValidUntil(getCertificateChain(getSubject(), cert)));\n\tauthenticationPermission = getAuthenticationPermission(cert);\n\tString result = getCertificateName(clientCredential.getCertificate());\n\t\tif (logger.isLoggable(Level.FINE)) {\n\t\t logger.log(\n\t\t\tLevel.FINE,\n\t\t\t\"choose client alias for key types {0}\\nand issuers {1}\\n\" +\n\t\t\t\"returns {2}\",\n\t\t\tnew Object[] { toString(keyTypes), toString(issuers), result });\n\t\t}\n\treturn result;\n }\n\n /* -- X500TrustManager -- */\n /**\n * Override this X509TrustManager method in order to cache the server\n * principal and to continue to choose the same one.\n */\n @Override\n public synchronized void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {\n\tsuper.checkServerTrusted(chain, authType);\n\tif (serverPrincipal == null) {\n\t serverCredential = chain[0];\n\t serverPrincipal = serverCredential.getSubjectX500Principal();\n\t setPermittedRemotePrincipals(Collections.singleton(serverPrincipal));\n\t credentialsValidUntil = certificatesValidUntil(chain);\n\t} else if (!serverCredential.equals(chain[0])) {\n\t throw new CertificateException(\"Server credentials changed\");\n\t}\n }\n\n @Override\n public String[] getServerAliases(String arg0, Principal[] arg1) {\n\treturn null;\n }\n\n @Override\n public String chooseServerAlias(String arg0, Principal[] arg1, Socket arg2) {\n\treturn null;\n }\n\n /**\n * Returns the permission needed to connect to the last server principal\n * with the specified client certificate.\n */\n AuthenticationPermission getAuthenticationPermission(X509Certificate cert) {\n\tSet client = Collections.singleton(cert.getSubjectX500Principal());\n\tSet server = (serverPrincipal == null) ? null : Collections.singleton(serverPrincipal);\n\treturn new AuthenticationPermission(client, server, \"connect\");\n }\n\n /**\n * Gets the private credential for the specified X.509 certificate,\n * checking for AuthenticationPermission to connect with the last server\n * principal.\n *\n * @param cert the certificate for the local principal\n * @return the associated private credential or null if not found\n * @throws SecurityException if the access control context does not have\n *\t the proper AuthenticationPermission\n */\n @Override\n synchronized X500PrivateCredential getPrivateCredential(X509Certificate cert) {\n\treturn getPrivateCredential(cert, getAuthenticationPermission(cert));\n }\n\n /**\n * Gets the private credential for the specified X.509 certificate,\n * checking for the specified AuthenticationPermission.\n *\n * @param cert the certificate for the local principal\n * @param ap the permission needed to connect to the peer\n * @return the associated private credential or null if not found\n * @throws SecurityException if the access control context does not have\n *\t the proper AuthenticationPermission\n */\n protected X500PrivateCredential getPrivateCredential(X509Certificate cert, AuthenticationPermission ap) {\n\tSubject subject = getSubject();\n\tif (subject == null) {\n\t return null;\n\t}\n\tSecurityManager sm = System.getSecurityManager();\n\tif (sm != null) {\n\t sm.checkPermission(ap);\n\t}\n\treturn (X500PrivateCredential) AccessController.doPrivileged(new GetPrivateCredentialAction(subject, cert));\n }\n \n \n /**\n * Checks if the subject still contains the proper credentials, and the\n * current access control context has the proper AuthenticationPermission,\n * to use the current session. Callers should only call this method if\n * client authentication is being used.\n *\n * @throws SecurityException if the access control context does not have\n *\t the proper AuthenticationPermission\n * @throws UnsupportedConstraintException if the subject does not contain\n *\t the proper credentials\n */\n synchronized void checkAuthentication()\n\tthrows GeneralSecurityException\n {\n\tif (clientCredential == null) {\n\t throw new GeneralSecurityException(\n\t\t\"Client is not authenticated\");\n\t} else if (clientCredential.isDestroyed()) {\n\t throw new GeneralSecurityException(\n\t\t\"Private credentials are destroyed\");\n\t} else if (System.currentTimeMillis() > credentialsValidUntil) {\n\t throw new GeneralSecurityException(\n\t\t\"Certificates are no longer valid\");\n\t}\n\tif (subjectIsReadOnly) {\n\t SecurityManager sm = System.getSecurityManager();\n\t if (sm != null) {\n\t\tsm.checkPermission(authenticationPermission);\n\t }\n\t} else {\n\t Subject subject = getSubject();\n\t X509Certificate cert = clientCredential.getCertificate();\n\t if (getPrincipal(subject, cert) == null) {\n\t\tthrow new GeneralSecurityException(\"Missing principal\");\n\t }\n\t CertPath chain =\n\t\tgetCertificateChain(subject, cert);\n\t if (chain == null) {\n\t\tthrow new GeneralSecurityException(\n\t\t \"Missing public credentials\");\n\t }\n\t X500PrivateCredential pc = getPrivateCredential(\n\t\tcert, authenticationPermission);\n\t if (pc == null) {\n\t\tthrow new GeneralSecurityException(\n\t\t \"Missing private credentials\");\n\t } else if (!equalPrivateCredentials(clientCredential, pc)) {\n\t\tthrow new GeneralSecurityException(\n\t\t \"Wrong private credentials\");\n\t }\n\t}\n }\n}\n", "meta": {"content_hash": "527a69c207200fca5e44fa300086269f", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 122, "avg_line_length": 33.87258687258687, "alnum_prop": 0.7045480451384931, "repo_name": "pfirmstone/river-internet", "id": "01c4d486d5a17fffaaacedcc4db47435ee148cca", "size": "9363", "binary": false, "copies": "2", "ref": "refs/heads/trunk", "path": "JGDMS/jgdms-rmi-tls/src/main/java/au/net/zeus/rmi/tls/ClientSubjectKeyManager.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"}]}} +{"text": "(function(root) {\n\n//------------------------------------------------------------------//\n// Compatibility\n//------------------------------------------------------------------//\n\nvar emptyFn = function() {};\nvar console = root.console || {};\nvar document = root.document;\n\nconsole.error = console.error || emptyFn;\n\nroot.GLOBAL = root;\n\n//------------------------------------------------------------------//\n// Base64 encoding\n//------------------------------------------------------------------//\n\nfunction toBase64Digit(value) {\n\tvar digits =\n\t\t'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +\n\t\t'abcdefghijklmnopqrstuvwxyz' +\n\t\t'0123456789+/';\n\treturn digits[value & 0x3F];\n}\n\nfunction strToUTF8Base64(str) {\n\n\tfunction decodeSurrogatePair(hi, lo) {\n\t\tvar resultChar = 0x010000;\n\t\tresultChar += lo - 0xDC00;\n\t\tresultChar += (hi - 0xD800) << 10;\n\t\treturn resultChar;\n\t}\n\n\tvar bytes = [0, 0, 0];\n\tvar byteIndex = 0;\n\tvar result = [];\n\n\tfunction output(s) {\n\t\tresult.push(s);\n\t}\n\n\tfunction emitBase64() {\n\n\t\tvar toDigit = toBase64Digit;\n\n\t\t// --Byte 0-- --Byte 1-- --Byte 2--\n\t\t// 1111 1122 2222 3333 3344 4444\n\n\t\tvar d1 = toDigit(bytes[0] >> 2);\n\t\tvar d2 = toDigit(\n\t\t\t((bytes[0] & 0x03) << 4) |\n\t\t\t(bytes[1] >> 4));\n\t\tvar d3 = toDigit(\n\t\t\t((bytes[1] & 0x0F) << 2) |\n\t\t\t(bytes[2] >> 6));\n\t\tvar d4 = toDigit(\n\t\t\tbytes[2] & 0x3F);\n\n\t\tif (byteIndex === 1) {\n\t\t\toutput(d1 + d2 + '==');\n\t\t}\n\t\telse if (byteIndex === 2) {\n\t\t\toutput(d1 + d2 + d3 + '=');\n\t\t}\n\t\telse {\n\t\t\toutput(d1 + d2 + d3 + d4);\n\t\t}\n\t}\n\n\tfunction emit(chr) {\n\t\tbytes[byteIndex++] = chr;\n\t\tif (byteIndex === 3) {\n\t\t\temitBase64();\n\t\t\tbytes[0] = 0;\n\t\t\tbytes[1] = 0;\n\t\t\tbytes[2] = 0;\n\t\t\tbyteIndex = 0;\n\t\t}\n\t}\n\n\tfunction emitLast() {\n\t\tif (byteIndex > 0) {\n\t\t\temitBase64();\n\t\t}\n\t}\n\n\t// Converts the string to UTF8:\n\n\tvar i, chr;\n\tvar hi, lo;\n\tfor (i = 0; i < str.length; i++) {\n\t\tchr = str.charCodeAt(i);\n\n\t\t// Test and decode surrogate pairs in the string\n\t\tif (chr >= 0xD800 && chr <= 0xDBFF) {\n\t\t\thi = chr;\n\t\t\tlo = str.charCodeAt(i + 1);\n\t\t\tif (lo >= 0xDC00 && lo <= 0xDFFF) {\n\t\t\t\tchr = decodeSurrogatePair(hi, lo);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\t// Encode the character as UTF-8.\n\t\tif (chr < 0x80) {\n\t\t\temit(chr);\n\t\t}\n\t\telse if (chr < 0x0800) {\n\t\t\temit((chr >> 6) | 0xC0);\n\t\t\temit(((chr >> 0) & 0x3F) | 0x80);\n\t\t}\n\t\telse if (chr < 0x10000) {\n\t\t\temit((chr >> 12) | 0xE0);\n\t\t\temit(((chr >> 6) & 0x3F) | 0x80);\n\t\t\temit(((chr >> 0) & 0x3F) | 0x80);\n\t\t}\n\t\telse if (chr < 0x110000) {\n\t\t\temit((chr >> 18) | 0xF0);\n\t\t\temit(((chr >> 12) & 0x3F) | 0x80);\n\t\t\temit(((chr >> 6) & 0x3F) | 0x80);\n\t\t\temit(((chr >> 0) & 0x3F) | 0x80);\n\t\t}\n\t}\n\n\temitLast();\n\n\treturn result.join('');\n}\n\n// VLQ Base64 encoding used in source maps\n\nfunction toVLQ(value) {\n\n\tvar vlq, result, digit;\n\n\t// The LSB in the encoded result is used to indicate the sign of\n\t// the original value\n\tvlq = value < 0 ? ((-value) << 1) + 1 : (value << 1);\n\n\t// Digits are encoded least significant first.\n\n\tresult = '';\n\tdo {\n\t\t// Each Base64 digit encodes 5 bits. The sixth bit is a\n\t\t// continuation bit.\n\t\tdigit = vlq & 0x1F;\n\t\tvlq = vlq >> 5;\n\t\tdigit = digit | (vlq > 0 ? 0x20 : 0);\n\t\tresult += toBase64Digit(digit);\n\t}\n\twhile (vlq > 0);\n\n\treturn result;\n}\n\n//------------------------------------------------------------------//\n// Source maps\n//------------------------------------------------------------------//\n\nfunction getSourceMap(file, source, lineOffset) {\n\tvar mappings = [];\n\tvar lineCount = source.split(/\\r\\n?|\\n/).length;\n\tvar map;\n\tvar curLine, i;\n\n\tvar lastOriginalLine = 0;\n\tfunction addLineMapping(originalLine) {\n\t\tvar generatedColumn = 0;\n\t\tvar sourceIndex = 0;\n\t\tvar originalColumn = 0;\n\t\tvar segment = [\n\t\t\ttoVLQ(generatedColumn),\n\t\t\ttoVLQ(sourceIndex),\n\t\t\ttoVLQ(originalLine - lastOriginalLine),\n\t\t\ttoVLQ(originalColumn)\n\t\t].join('');\n\t\tlastOriginalLine = originalLine;\n\t\tmappings.push(segment);\n\t}\n\n\tfor (i = 0; i < lineOffset; i++) {\n\t\tmappings.push('');\n\t}\n\n\tfor (i = 0; i < lineCount; i++) {\n\t\taddLineMapping(i);\n\t}\n\n\tmap = [\n\t\t'{',\n\t\t'\"version\":3,',\n\t\t'\"sources\":[',\n\t\tJSON.stringify(file),\n\t\t'],',\n\t\t'\"names\":[],',\n\t\t'\"mappings\":',\n\t\tJSON.stringify(mappings.join(';')),\n\t\t',',\n\t\t'\"sourcesContent\":[',\n\t\tJSON.stringify(source),\n\t\t']',\n\t\t'}'\n\t].join('');\n\n\treturn map;\n}\n\n//------------------------------------------------------------------//\n// Path manipulation\n//------------------------------------------------------------------//\n\nvar basePath = window.location.pathname.replace(/\\/[^\\/]*$/, '');\nvar hrefOrigin = window.location.origin;\n\nfunction concatPath(basePath, path) {\n\tvar baseParts, pathParts, i, it;\n\tvar result = [];\n\n\t// If path is absolute, ignore the base path.\n\tif (path[0] === '/') {\n\t\t// Run the concatPath to normalize path.\n\t\treturn concatPath(path, '');\n\t}\n\n\t// Remove leading and trailing slashes and split the base path.\n\t// Note that basePath is always handled as absolute.\n\tbaseParts = basePath.replace(/^\\/|\\/$/g, '').split('/');\n\n\t// Remove any trailing slash and split the path.\n\tpathParts = path.replace(/^\\/$/, '').split('/');\n\n\t// Append the parts of basePath to the result, solving . and ..\n\t// in the path.\n\tfor (i = 0; i < baseParts.length; i++) {\n\t\tit = baseParts[i];\n\t\tif (it === '.' || (i === 0 && it === '')) {\n\t\t\t// Ignore '.' or an empty part (result of an empty\n\t\t\t// basePath).\n\t\t\tcontinue;\n\t\t}\n\t\telse if (it === '..') {\n\t\t\tresult.pop();\n\t\t}\n\t\telse {\n\t\t\tresult.push(it);\n\t\t}\n\t}\n\n\t// Append the parts of path to the result, again solving . and ..\n\tfor (i = 0; i < pathParts.length; i++) {\n\t\tit = pathParts[i];\n\t\tif (it === '.' || it === '') {\n\t\t\t// Ignore '.' or an empty part (result of an empty path).\n\t\t\tcontinue;\n\t\t}\n\t\telse if (it === '..') {\n\t\t\tresult.pop();\n\t\t}\n\t\telse {\n\t\t\tresult.push(it);\n\t\t}\n\t}\n\n\treturn '/' + result.join('/');\n}\n\nfunction solvePossiblePaths(path, relativeTo) {\n\tvar isRelative = /^(\\.){0,2}\\//.test(path);\n\tvar possiblePaths = [];\n\tvar basePath, curPath;\n\n\tif (!/\\.js/i.test(path)) {\n\t\tpath += '.js';\n\t}\n\n\tif (isRelative) {\n\t\tcurPath = concatPath(relativeTo, path);\n\t\tpossiblePaths.push(curPath);\n\t}\n\telse {\n\t\tbasePath = relativeTo;\n\t\twhile (true) {\n\t\t\tcurPath = concatPath(basePath, 'node_modules');\n\t\t\tcurPath = concatPath(curPath, path);\n\t\t\tif (possiblePaths.indexOf(curPath) >= 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpossiblePaths.push(curPath);\n\t\t\t}\n\t\t\tbasePath = concatPath(basePath, '..');\n\t\t}\n\t}\n\n\treturn possiblePaths;\n}\n\n//------------------------------------------------------------------//\n// Ajax request\n//------------------------------------------------------------------//\n\nvar requestCache = {};\nvar pendingRequests = {};\n\nfunction sendRequest(path, callback) {\n\tvar request, pending;\n\n\t// Check for a cached result\n\tif (requestCache[path]) {\n\t\tsetTimeout(function() {\n\t\t\tcallback(requestCache[path]);\n\t\t}, 0);\n\t\treturn;\n\t}\n\telse if (pendingRequests[path]) {\n\t\tpendingRequests[path].callbacks.push(callback);\n\t\treturn;\n\t}\n\n\t// If the request is not on the cache, makes the Ajax request:\n\n\tif (root.XMLHttpRequest) {\n\t\trequest = new root.XMLHttpRequest();\n\t}\n\telse if (root.ActiveXObject) {\n\t\trequest = new root.ActiveXObject('Microsoft.XMLHTTP');\n\t}\n\n\tpending = pendingRequests[path] = { callbacks: [callback] };\n\n\trequest.onreadystatechange = function() {\n\t\tvar response, callbacks, i, cb;\n\t\tif (request.readyState === 4) {\n\t\t\trequestCache[path] = response = parseResponse(request);\n\t\t\tresponse.originPath = path;\n\t\t\tcallbacks = pendingRequests[path].callbacks;\n\t\t\tdelete pendingRequests[path];\n\t\t\tfor (i = 0; i < callbacks.length; i++) {\n\t\t\t\tcb = callbacks[i];\n\t\t\t\tcb(response);\n\t\t\t}\n\t\t}\n\t};\n\n\trequest.open('GET', path, true);\n\trequest.send(null);\n}\n\nfunction parseResponse(request) {\n\tvar result = {};\n\tif (request.status === 200) {\n\t\tresult.success = true;\n\t\tresult.source = request.responseText;\n\t}\n\telse if (request.status === 404) {\n\t\tresult.success = false;\n\t\tresult.notFound = true;\n\t\tresult.error = 'Not found (404)';\n\t}\n\telse {\n\t\tresult.success = false;\n\t\tresult.error = 'Server error (' + request.status + ')';\n\t}\n\treturn result;\n}\n\n//------------------------------------------------------------------//\n// Module loading\n//------------------------------------------------------------------//\n\nvar pending = [];\nvar moduleMap = {};\nvar moduleError = {};\nvar execOrder = [];\n\nfunction getRequires(source) {\n\tvar len;\n\tvar lines;\n\tvar i, it, match;\n\tvar requires = [];\n\n\t// Strips multiline comments from source.\n\tdo {\n\t\tlen = source.length;\n\t\tsource = source.replace(/\\/\\*([^\\*]|\\*(?!\\/))*(\\*\\/|$)/, '');\n\t}\n\twhile (len !== source.length);\n\n\tlines = source.split(/\\r\\n?|\\n/);\n\tfor (i = 0; i < lines.length; i++) {\n\t\tit = lines[i];\n\t\tit = it.replace(/^\\s*((?:var)?\\s*(?:\\w+\\s*=))?\\s*/, '');\n\t\tmatch = it.match(\n\t\t\t/^require\\s*\\(\\s*(\\'|\\\")((?:(?!\\1).)+)\\1\\s*\\)\\s*(;|$)/);\n\t\tif (match) {\n\t\t\trequires.push(match[2]);\n\t\t}\n\t}\n\n\treturn requires;\n}\n\nfunction loadModule(response, request, callback) {\n\tvar originPath = response.originPath;\n\tvar pendingIndex = pending.indexOf(request);\n\tvar module;\n\tvar requireCount = 0;\n\tvar requires, i, it;\n\n\tfunction callCallbackWhenOver() {\n\t\tif (requireCount <= 0 && typeof callback === 'function') {\n\t\t\tcallback(module, request);\n\t\t}\n\t}\n\n\tfunction onRequiredLoaded(depModule, depRequest) {\n\t\tmodule.dependencies.push(depModule.path);\n\t\tmodule.requireMap[depRequest.path] = depModule.path;\n\t\trequireCount -= 1;\n\t\tcallCallbackWhenOver();\n\t}\n\n\tpending.splice(pendingIndex, 1);\n\n\tmodule = moduleMap[originPath];\n\tif (!module) {\n\t\tmodule = moduleMap[originPath] = {\n\t\t\tpath: originPath,\n\t\t\tbasePath: concatPath(originPath, '..'),\n\t\t\terror: response.success ? false : response.error,\n\t\t\trequest: request,\n\t\t\tresponse: response,\n\t\t\tsource: response.source,\n\t\t\tdependencies: [],\n\t\t\trequireMap: {},\n\t\t\tmoduleObject: {\n\t\t\t\texports: {}\n\t\t\t}\n\t\t};\n\n\t\tif (!module.error) {\n\t\t\trequires = module.requires = getRequires(module.source);\n\t\t\trequireCount = requires.length;\n\n\t\t\tfor (i = 0; i < requires.length; i++) {\n\t\t\t\tit = requires[i];\n\t\t\t\tloadFile(it, module.basePath, module.path, onRequiredLoaded);\n\t\t\t}\n\n\t\t\tcallCallbackWhenOver();\n\t\t}\n\t\telse {\n\t\t\tcallCallbackWhenOver();\n\t\t}\n\t}\n\telse {\n\t\tcallCallbackWhenOver();\n\t}\n}\n\nfunction loadFile(path, relativeTo, requestedBy, callback) {\n\n\tvar requestInfo = {\n\t\tpath: path,\n\t\tbasePath: relativeTo,\n\t\tsolvedPaths: solvePossiblePaths(path, relativeTo),\n\t\tnextIndex: 0\n\t};\n\n\tpending.push(requestInfo);\n\n\tfunction onSuccess(response) {\n\t\tloadModule(response, requestInfo, callback);\n\t}\n\n\tfunction onError(response) {\n\t\tconsole.error(\n\t\t\t\t'Failed to load `' + path +\n\t\t\t\t'` requested by `' + requestedBy +\n\t\t\t\t'`: ' + response.error);\n\t\tloadModule(response, requestInfo, callback);\n\t}\n\n\tfunction tryLoadNext() {\n\t\tvar nextPath = requestInfo.solvedPaths[requestInfo.nextIndex++];\n\t\tvar isLast = requestInfo.nextIndex >= requestInfo.solvedPaths.length;\n\n\t\t// Send the request for the next possible path.\n\t\tsendRequest(nextPath, function(response) {\n\t\t\tif (response.success) {\n\t\t\t\t// The file was successfully loaded, process the\n\t\t\t\t// result.\n\t\t\t\tonSuccess(response);\n\t\t\t}\n\t\t\telse if (response.notFound && !isLast) {\n\t\t\t\t// The file was not found, but there are other\n\t\t\t\t// possible paths, so continue trying.\n\t\t\t\ttryLoadNext();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// The request failed or the last possible path was\n\t\t\t\t// not found. Generate an error.\n\t\t\t\tonError(response);\n\t\t\t}\n\t\t});\n\t}\n\n\t// Try load the first possible path.\n\ttryLoadNext();\n}\n\n//------------------------------------------------------------------//\n// Module execution\n//------------------------------------------------------------------//\n\nfunction getModule(modulePath) {\n\tvar module = moduleMap[modulePath];\n\tif (!module) {\n\t\tthrow new Error('Module `' + modulePath + '` not loaded');\n\t}\n\treturn module;\n}\n\nfunction getLoadingOrder(module) {\n\tvar result = [];\n\tvar deps, i, it, subResult;\n\tif (module && !module.visited) {\n\t\tmodule.visited = true;\n\t\tdeps = module.dependencies;\n\t\tfor (i = 0; i < deps.length; i++) {\n\t\t\tit = getModule(deps[i]);\n\t\t\tsubResult = getLoadingOrder(it);\n\t\t\tresult = result.concat(subResult);\n\t\t}\n\t\tresult.push(module);\n\t}\n\treturn result;\n}\n\nfunction beforeModuleLoading(module) {\n}\n\nfunction afterModuleLoading(module) {\n\tif (!axloader._moduleFn) {\n\t\t// Assume a syntax error.\n\t\tmodule.syntaxError = true;\n\t}\n\tmodule.moduleFunction = axloader._moduleFn;\n\tmodule.executed = false;\n\tdelete axloader._moduleFn;\n}\n\nfunction executeModule(module, afterCallback) {\n\tvar order = getLoadingOrder(module);\n\n\tfunction loadNext() {\n\t\tvar nextModule = order.shift();\n\t\tvar script, source, sourceMap;\n\t\tif (nextModule && !nextModule.error) {\n\t\t\tbeforeModuleLoading(nextModule);\n\n\t\t\tsource = 'axloader._moduleFn = (' +\n\t\t\t\t'function(require, module, exports, global) { // ' +\n\t\t\t\tnextModule.path + '\\n' +\n\t\t\t\tnextModule.source +\n\t\t\t\t'\\n})';\n\t\t\tsource += '\\n//# sourceMappingURL=' +\n\t\t\t\t'data:application/json;charset=utf-8;base64,';\n\t\t\tsourceMap = getSourceMap(\n\t\t\t\threfOrigin + nextModule.path, nextModule.source, 1);\n\t\t\tsource += strToUTF8Base64(sourceMap);\n\n\t\t\tscript = document.createElement('script');\n\t\t\tscript.id = nextModule.path;\n\t\t\tscript.type = 'text/javascript';\n\t\t\tscript.src =\n\t\t\t\t'data:text/javascript;charset=utf-8;base64,' +\n\t\t\t\tstrToUTF8Base64(source);\n\t\t\tscript.innerHTML = source;\n\t\t\tscript.onload = function() {\n\t\t\t\tafterModuleLoading(nextModule);\n\t\t\t\tsetTimeout(loadNext, 0);\n\t\t\t};\n\t\t\tdocument.head.appendChild(script);\n\t\t}\n\t\telse if (nextModule) {\n\t\t\tnextModule.notFound = true;\n\t\t\tsetTimeout(loadNext, 0);\n\t\t}\n\t\telse {\n\t\t\tdoExecute(module);\n\t\t\tif (typeof afterCallback === 'function') {\n\t\t\t\tafterCallback();\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction doExecute(theModule) {\n\n\t\tfunction require(path) {\n\t\t\tvar solvedPath = theModule.requireMap[path];\n\t\t\tvar requiredModule = solvedPath && getModule(solvedPath);\n\t\t\tif (!requiredModule) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'require: the module `' + path + '` was not preloaded');\n\t\t\t}\n\t\t\telse if (requiredModule.notFound) {\n\t\t\t\tthrow new Error('Cannot find module \\'' + path + '\\'');\n\t\t\t}\n\t\t\telse if (requiredModule.error) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'require: the module `' + path + '` could not be loaded: ' +\n\t\t\t\t\trequiredModule.error);\n\t\t\t}\n\n\t\t\tif (!requiredModule.executed && !requiredModule.executing) {\n\t\t\t\tdoExecute(requiredModule);\n\t\t\t}\n\n\t\t\treturn requiredModule.moduleObject.exports;\n\t\t}\n\n\t\tvar fn = theModule.moduleFunction;\n\t\tvar moduleObject = theModule.moduleObject;\n\t\tvar moduleExports = moduleObject.exports;\n\n\t\tif (theModule.syntaxError) {\n\t\t\tthrow new SyntaxError(theModule.path);\n\t\t}\n\t\telse if (theModule.notFound) {\n\t\t\tthrow new Error('module not found: ' + theModule.path);\n\t\t}\n\n\t\ttry {\n\t\t\ttheModule.executing = true;\n\t\t\tfn.call(root, require, moduleObject, moduleExports, root);\n\t\t}\n\t\tfinally {\n\t\t\ttheModule.executing = false;\n\t\t}\n\t\ttheModule.executed = true;\n\t}\n\n\tloadNext();\n}\n\n//------------------------------------------------------------------//\n// Public API\n//------------------------------------------------------------------//\n\nvar axloader = {};\n\naxloader.require = function require(path, afterCallback) {\n\tloadFile(path, basePath, 'axloader.require', function(module) {\n\t\texecuteModule(module, afterCallback);\n\t});\n};\n\naxloader.getPending = function getPending() {\n\treturn pending;\n};\n\naxloader.getModuleMap = function getModuleMap() {\n\treturn moduleMap;\n};\n\nroot.axloader = axloader;\n\n}(this));\n", "meta": {"content_hash": "4743262d432c18a51e55f21bb8262f7e", "timestamp": "", "source": "github", "line_count": 671, "max_line_length": 71, "avg_line_length": 22.758569299552907, "alnum_prop": 0.5774998362910091, "repo_name": "ricardobm/ax-loader", "id": "26a7854d505d1e5992646f05b596e9df22dda295", "size": "15271", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ax-loader.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "21108"}]}} +{"text": "package jugsaar12.nio.networking;\n\nimport java.net.ServerSocket;\nimport java.net.Socket;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\n\n/**\n * TODO MAX_POOL_SIZE to 1000\n * <p/>\n * TODO show RejectedExecutionHandler -> Default AbortPolicy, CallerRunsPolicy\n */\npublic class C_ExecutorServiceMultiThreadedEchoServer {\n\n public static void main(String[] args) throws Exception {\n\n System.out.println(\"C_ExecutorServiceMultiThreadedEchoServer running\");\n\n ExecutorService es = Executors.newCachedThreadPool();\n\n try (ServerSocket ss = new ServerSocket(1337)) {\n\n while (true) {\n\n Socket s = ss.accept(); // blocking-call, never returns null!\n es.submit(() -> Util.process(s));\n }\n }\n }\n}", "meta": {"content_hash": "35befc48d23f03d692415d764e21ff48", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 78, "avg_line_length": 25.333333333333332, "alnum_prop": 0.7144736842105263, "repo_name": "jugsaar/jugsaar-meeting-12", "id": "aec0332d325665aa4bb0aec3abf2abd31679f07c", "size": "760", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java-nio-networking/code/jugsaar12-java-nio-networking/src/main/java/jugsaar12/nio/networking/C_ExecutorServiceMultiThreadedEchoServer.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "17468"}]}} +{"text": "import pyxb.binding.generate\nimport pyxb.utils.domutils\nfrom xml.dom import Node\n\nimport os.path\nschema_path = os.path.abspath(os.path.join(os.path.dirname(__file__),\n '../schemas/po1.xsd'))\ncode = pyxb.binding.generate.GeneratePython(schema_location=schema_path)\n\n#file('code.py', 'w').write(code)\nrv = compile(code, 'test', 'exec')\neval(rv)\n\nfrom pyxb.exceptions_ import *\n\nfrom pyxb.utils import domutils\n\ndef ToDOM (instance, tag=None, dom_support=None):\n return instance.toDOM(dom_support).documentElement\n\nimport unittest\n\nclass TestPO1 (unittest.TestCase):\n street_content = '''95 Main St.\nAnytown, AS 12345-6789'''\n street_xml = '<street>%s</street>' % (street_content,)\n street_dom = pyxb.utils.domutils.StringToDOM(street_xml).documentElement\n\n address1_xml = '<name>Customer</name><street>95 Main St</street>'\n address2_xml = '<name>Sugar Mama</name><street>24 E. Dearling Ave.</street>'\n\n def tearDown (self):\n pyxb.RequireValidWhenGenerating(True)\n pyxb.RequireValidWhenParsing(True)\n\n def testPythonElementSimpleContent (self):\n elt = USAddress._ElementMap['street'].elementBinding()(self.street_content)\n self.assertEqual(self.street_content, elt)\n self.assertEqual(ToDOM(elt).toxml(\"utf-8\"), self.street_xml)\n\n def testDOMElementSimpleContent (self):\n elt = USAddress._ElementMap['street'].elementBinding().createFromDOM(self.street_dom)\n self.assertEqual(ToDOM(elt).toxml(\"utf-8\"), self.street_xml)\n\n def testPythonElementComplexContent_Element (self):\n addr = USAddress(name='Customer', street='95 Main St')\n self.assertEqual('95 Main St', addr.street)\n addr = USAddress('Customer', '95 Main St')\n self.assertEqual('95 Main St', addr.street)\n addr.street = '43 West Oak'\n self.assertEqual('43 West Oak', addr.street)\n #self.assertEqual('<s>%s</s>' % (self.address1_xml,), ToDOM(addr, tag='s').toxml(\"utf-8\"))\n\n def testDOM_CTD_element (self):\n # NB: USAddress is a CTD, not an element.\n xml = '<shipTo>%s</shipTo>' % (self.address1_xml,)\n dom = pyxb.utils.domutils.StringToDOM(xml)\n addr2 = USAddress.Factory(_dom_node=dom.documentElement)\n #self.assertEqual(xml, ToDOM(addr2, tag='shipTo').toxml(\"utf-8\"))\n\n def testPurchaseOrder (self):\n po = purchaseOrder(shipTo=USAddress(name='Customer', street='95 Main St'),\n billTo=USAddress(name='Sugar Mama', street='24 E. Dearling Ave'),\n comment='Thanks!')\n xml = ToDOM(po).toxml(\"utf-8\")\n xml1 = '<ns1:purchaseOrder xmlns:ns1=\"http://www.example.com/PO1\"><shipTo><name>Customer</name><street>95 Main St</street></shipTo><billTo><name>Sugar Mama</name><street>24 E. Dearling Ave</street></billTo><ns1:comment>Thanks!</ns1:comment></ns1:purchaseOrder>'\n self.assertEqual(xml, xml1)\n\n dom = pyxb.utils.domutils.StringToDOM(xml)\n po2 = purchaseOrder.createFromDOM(dom.documentElement)\n self.assertEqual(xml1, ToDOM(po2).toxml(\"utf-8\"))\n loc = po2.shipTo._location()\n self.assertTrue((not isinstance(loc, pyxb.utils.utility.Locatable_mixin)) or (58 == loc.columnNumber))\n loc = po2.billTo.name._location()\n self.assertTrue((not isinstance(loc, pyxb.utils.utility.Locatable_mixin)) or (131 == loc.columnNumber))\n\n po2 = CreateFromDocument(xml)\n self.assertEqual(xml1, ToDOM(po2).toxml(\"utf-8\"))\n loc = po2.shipTo._location()\n self.assertTrue((not isinstance(loc, pyxb.utils.utility.Locatable_mixin)) or (58 == loc.columnNumber))\n loc = po2.billTo.name._location()\n self.assertTrue((not isinstance(loc, pyxb.utils.utility.Locatable_mixin)) or (131 == loc.columnNumber))\n\n\n xml2 = '<purchaseOrder xmlns=\"http://www.example.com/PO1\"><shipTo><name>Customer</name><street>95 Main St</street></shipTo><billTo><name>Sugar Mama</name><street>24 E. Dearling Ave</street></billTo><comment>Thanks!</comment></purchaseOrder>'\n bds = pyxb.utils.domutils.BindingDOMSupport()\n bds.setDefaultNamespace(Namespace)\n self.assertEqual(xml2, ToDOM(po2, dom_support=bds).toxml(\"utf-8\"))\n\n def testGenerationValidation (self):\n ship_to = USAddress('Robert Smith', 'General Delivery')\n po = purchaseOrder(ship_to)\n self.assertEqual('General Delivery', po.shipTo.street)\n self.assertTrue(po.billTo is None)\n\n self.assertTrue(pyxb.RequireValidWhenGenerating())\n self.assertRaises(pyxb.DOMGenerationError, po.toxml)\n try:\n pyxb.RequireValidWhenGenerating(False)\n self.assertFalse(pyxb.RequireValidWhenGenerating())\n xmls = po.toxml(\"utf-8\", root_only=True)\n self.assertEqual('<ns1:purchaseOrder xmlns:ns1=\"http://www.example.com/PO1\"><shipTo><street>General Delivery</street><name>Robert Smith</name></shipTo></ns1:purchaseOrder>', xmls)\n finally:\n pyxb.RequireValidWhenGenerating(True)\n self.assertRaises(pyxb.UnrecognizedContentError, CreateFromDocument, xmls)\n self.assertTrue(pyxb.RequireValidWhenParsing())\n try:\n pyxb.RequireValidWhenParsing(False)\n self.assertFalse(pyxb.RequireValidWhenParsing())\n po2 = CreateFromDocument(xmls)\n finally:\n pyxb.RequireValidWhenParsing(True)\n self.assertEqual('General Delivery', po2.shipTo.street)\n self.assertTrue(po2.billTo is None)\n\nif __name__ == '__main__':\n unittest.main()\n \n \n", "meta": {"content_hash": "919acf526bf392f33f5376056b08089f", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 269, "avg_line_length": 46.739495798319325, "alnum_prop": 0.6650485436893204, "repo_name": "jonfoster/pyxb1", "id": "bf3c9d2f0c5635eae42a36b08b6241bea6e6e94f", "size": "5562", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/drivers/test-po1.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Python", "bytes": "1564427"}, {"name": "Shell", "bytes": "18946"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Newtonsoft.Json;\n\nnamespace VJeek.Microdata.Intangible.StructuredValue\n{\n\tpublic partial class OpeningHoursSpecification : StructuredValue\n\t{\n\t\t[JsonProperty(\"closes\")]\n\t\tpublic TimeSpan Closes { get; set; }\n\n\t\t[JsonProperty(\"dayOfWeek\")]\n\t\tpublic DayOfWeek DayOfWeek { get; set; }\n\n\t\t[JsonProperty(\"opens\")]\n\t\tpublic TimeSpan Opens { get; set; }\n\n\t\t[JsonProperty(\"validFrom\")]\n\t\tpublic DateTime ValidFrom { get; set; }\n\n\t\t[JsonProperty(\"validThrough\")]\n\t\tpublic DateTime ValidThrough { get; set; }\n\t}\n}\n", "meta": {"content_hash": "ebe952e1b2b29a2152f4caea184b6845", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 65, "avg_line_length": 23.22222222222222, "alnum_prop": 0.7384370015948963, "repo_name": "vjeek/microdata", "id": "eee2c6ba0e8520d9bd949baba07a99f7c5b3b95c", "size": "629", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "Sources/VJeek.Microdata/Intangible/StructuredValue/OpeningHoursSpecification.cs", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "746"}, {"name": "C#", "bytes": "19991"}, {"name": "PowerShell", "bytes": "95259"}]}} +{"text": "The GraphQL module allows client applications to query the content handled by an Orchard website. \nIt enables the GraphiQL Explorer view to test GraphQL queries, and provides HTTP endpoints to send client queries.\n\n## HTTP Methods, Headers, and Body\n\n### GET request\n\nWhen receiving an HTTP GET request, the GraphQL query should be specified in the \"query\" query string. For example, if we wanted to execute the following GraphQL query:\n\n```graphql\n{\n me {\n name\n }\n}\n```\n\nThis request could be sent via an HTTP GET like so:\n\n`http://myapi/graphql?query={me{name}}`\n\nQuery variables can be sent as a JSON-encoded string in an additional query parameter called variables. If the query contains several named operations, an operationName query parameter can be used to control which one should be executed.\n\n### POST request \n\n#### application/json content type\n\nA standard GraphQL POST request should use the `application/json` content-type header, and include a JSON-encoded body of the following form:\n\n```graphql\n{\n \"query\": \"...\",\n \"operationName\": \"...\",\n \"variables\": { \"myVariable\": \"someValue\", ... }\n}\n```\n\n`operationName` and `variables` are optional fields. `operationName` is only required if multiple operations are present in the query.\n\n#### application/graphql content type\n\nAnother option is to use the `application/graphql` content-type header, and the HTTP POST body contents is treated as the GraphQL query string.\n\n#### query string\n\nIn addition to the above, If the \"query\" query string parameter is present (as in the GET example above), it will be parsed and handled in the same way as the HTTP GET case.\n\n### Response\n\nRegardless of the method by which the query and variables were sent, the response is returned in the body of the request in JSON format. \nA query might result in some data and some errors, and those are returned in a JSON object of the form:\n\n```json\n{\n \"data\": { ... },\n \"errors\": [ ... ]\n}\n```\n\nIf there were no errors returned, the \"errors\" field is not present on the response. \nIf no data is returned the \"data\" field is only included if the error occurred during execution.\n\n## Authentication\n\nExecuting a GraphQL query requires the issuer to have the `ExecuteGraphQL` permission. Like any other API in Orchard Core, the GraphQL API supports \ncookie and OAuth 2.0 authentication. This means it's compatible with the OpenId module and supports JSON Web Token (JWT).\n\nBy default anonymous users are not able to execute a GraphQL query.\n\n## Configuration\n\nIt's possible to configure graphql options for exposing exceptions and max depth, max complexity and field impact.\n\nConfiguration is done via the standard shell configuration, as follows.\n\n```json\n{\n \"OrchardCore\": {\n \"OrchardCore_Apis_GraphQL\": {\n \"ExposeExceptions\": true,\n \"MaxDepth\": 50, \n \"MaxComplexity\": 100, \n \"FieldImpact\": 2.0,\n \"DefaultNumberOfResults\": 100,\n \"MaxNumberOfResults\": 1000,\n \"MaxNumberOfResultsValidationMode\": \"Default\"\n }\n }\n}\n```\n\n*ExposeExceptions (bool, Default: false for production, true for development)*\n\nIf set to true stack traces are exposed to graphql clients\n\n*DefaultNumberOfResults (int, Default: 100)*\nThe default number of results returned by all paged fields/types.\n\n*MaxNumberOfResults (int, Default: 1000)*\nThe maximum number of results returned by all paged fields/types.\n\n*MaxNumberOfResultsValidationMode (enum, Values: Default|Enabled|Disabled, Default: Default)()*\nSpecify the validation behaviour if the max number of results is exceeded in a pager parameter\n\n* Default - In production info will be logged and only the max number of results will be returned. In development a graphql validation error will be raised.\n* Enabled - a graphql validation error will be raised\n* Disabled - Info will be logged and only the max number of results will be returned\n\n*MaxDepth (int?, Default: 20)*\n\nEnforces the total maximum nesting across all queries in a request.\n\n*MaxComplexity (int?, Default: null)*\n\n*FieldImpact (double?, Default: null)*\n\nFor more information on MaxDepth, MaxComplexity, FieldImpact & protecting against malicious queries view the graphql-dot-net documentation at <https://graphql-dotnet.github.io/docs/getting-started/malicious-queries/>\n", "meta": {"content_hash": "8ee80330a70b8aded11c89b2578ddc87", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 237, "avg_line_length": 36.43589743589744, "alnum_prop": 0.7522871217452498, "repo_name": "xkproject/Orchard2", "id": "2a44f43220f1cc656cf5d84f218eeb9a33797940", "size": "4308", "binary": false, "copies": "3", "ref": "refs/heads/master_PCCOM", "path": "src/docs/reference/modules/Apis.GraphQL/README.md", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C#", "bytes": "7779422"}, {"name": "CSS", "bytes": "2900240"}, {"name": "Dockerfile", "bytes": "424"}, {"name": "HTML", "bytes": "1472436"}, {"name": "JavaScript", "bytes": "2184254"}, {"name": "Liquid", "bytes": "43273"}, {"name": "PHP", "bytes": "2484"}, {"name": "PowerShell", "bytes": "142165"}, {"name": "Pug", "bytes": "55503"}, {"name": "SCSS", "bytes": "215570"}, {"name": "TypeScript", "bytes": "41644"}]}} +{"text": "Namespace Ribbons.Document.Create\n\n Public Class FromProfile\n Inherits RibbonButtonBase\n\n Public Sub New()\n _Image = \"\"\n _Order = 1\n _Text = \"From Profile\"\n _ToolTip = \"\"\n End Sub\n\n Protected Friend Overrides Sub OnClick()\n\n End Sub\n\n Protected Friend Overrides Sub OnIsEnabled()\n\n End Sub\n\n End Class\n\nEnd Namespace\n\n", "meta": {"content_hash": "81adc258cf3c3d2de8198ac49cb880ff", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 52, "avg_line_length": 17.375, "alnum_prop": 0.5539568345323741, "repo_name": "nublet/DMS", "id": "51e57b874a4c962bdaa2f2ba00ff815d1485c81b", "size": "417", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DMS.Forms/Ribbons/Items/Document/Create/FromProfile.vb", "mode": "33188", "license": "mit", "language": [{"name": "Visual Basic", "bytes": "2291940"}]}} +{"text": "package com.dfyy.bussiness;\n\nimport java.io.Serializable;\nimport java.util.Date;\n\nimport javax.persistence.Column;\nimport javax.persistence.Entity;\nimport javax.persistence.FetchType;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.Id;\nimport javax.persistence.JoinColumn;\nimport javax.persistence.ManyToOne;\nimport javax.persistence.Table;\nimport javax.xml.bind.annotation.XmlAccessType;\nimport javax.xml.bind.annotation.XmlAccessorType;\nimport javax.xml.bind.annotation.XmlElement;\nimport javax.xml.bind.annotation.XmlRootElement;\nimport javax.xml.bind.annotation.XmlTransient;\nimport javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\n\nimport org.hibernate.annotations.GenericGenerator;\n\nimport com.dfyy.util.JaxbDateSerializer;\n\n@Entity\n@Table(name = \"user\")\n@XmlRootElement\n@XmlAccessorType(XmlAccessType.NONE)\npublic class User implements Serializable {\n\tprivate static final long serialVersionUID = 8517308475246169441L;\n\n\t@Id\n\t@Column(name = \"id\")\n\t@GenericGenerator(name = \"idGenerator\", strategy = \"assigned\")\n\t@GeneratedValue(generator = \"idGenerator\")\n\t@XmlElement\n\tprivate String id;\n\n\t@Column(name = \"phone\")\n\t@XmlElement\n\tprivate String phone;\n\n\t@Column(name = \"password\")\n\t@XmlTransient\n\tprivate String password;\n\n\t@Column(name = \"alias\")\n\t@XmlElement\n\tprivate String alias;\n\n\t@Column(name = \"thumbnail\")\n\t@XmlElement\n\tprivate String thumbnail;\n\n\t@Column(name = \"address\")\n\t@XmlElement\n\tprivate String address;\n\n\t@Column(name = \"point\")\n\t@XmlElement\n\tprivate Integer point;\n\n\t@Column(name = \"description\")\n\t@XmlElement\n\tprivate String description;\n\n\t@Column(name = \"status\")\n\t@XmlElement\n\tprivate Integer status;\n\n\t@Column(name = \"x\")\n\t@XmlElement\n\tprivate Double x;\n\n\t@Column(name = \"y\")\n\t@XmlElement\n\tprivate Double y;\n\n\t@Column(name = \"currency\")\n\t@XmlElement\n\tprivate Integer currency;\n\t\n\t\n\t@Column(name = \"money\")\n\t@XmlElement\n\tprivate Integer money;\n\n\t@Column(name = \"scoring\")\n\t@XmlElement\n\tprivate Double scoring;\n\n\t@Column(name = \"tjcode\")\n\t@XmlElement\n\tprivate String tjcode;\n\t\n\t@Column(name = \"tjcoin\")\n\t@XmlElement\n\tprivate Integer tjcoin;\n\t\n\t\n\t@Column(name = \"time\")\n\t@XmlJavaTypeAdapter(JaxbDateSerializer.class)\n\tprivate Date time;\n\n\t@ManyToOne(fetch = FetchType.EAGER)\n\t@JoinColumn(name = \"level\")\n\t@XmlElement\n\tprivate UserLevel level;\n\n\t@ManyToOne(fetch = FetchType.EAGER)\n\t@JoinColumn(name = \"aid\")\n\t@XmlElement\n\tprivate Area area;\n\t\n\t@Column(name = \"activity\")\n\tprivate Integer activity;\n\t\n\t@Column(name = \"teamwork\")\n\t@XmlElement\n\tprivate boolean teamwork;\n\t\n\t\n\t@Column(name = \"acceptcoupon\")\n\t@XmlElement\n\tprivate boolean acceptCoupon;\n\n\tpublic User() {\n\n\t}\n\n\tpublic String getId() {\n\t\treturn id;\n\t}\n\n\tpublic void setId(String id) {\n\t\tthis.id = id;\n\t}\n\n\tpublic String getPhone() {\n\t\treturn phone;\n\t}\n\n\tpublic void setPhone(String phone) {\n\t\tthis.phone = phone;\n\t}\n\n\tpublic String getPassword() {\n\t\treturn password;\n\t}\n\n\tpublic void setPassword(String password) {\n\t\tthis.password = password;\n\t}\n\n\tpublic String getAlias() {\n\t\treturn alias;\n\t}\n\n\tpublic void setAlias(String alias) {\n\t\tthis.alias = alias;\n\t}\n\n\tpublic String getThumbnail() {\n\t\treturn thumbnail;\n\t}\n\n\tpublic void setThumbnail(String thumbnail) {\n\t\tthis.thumbnail = thumbnail;\n\t}\n\n\tpublic String getAddress() {\n\t\treturn address;\n\t}\n\n\tpublic void setAddress(String address) {\n\t\tthis.address = address;\n\t}\n\n\tpublic Integer getPoint() {\n\t\treturn point;\n\t}\n\n\tpublic void setPoint(Integer point) {\n\t\tthis.point = point;\n\t}\n\n\tpublic String getDescription() {\n\t\treturn description;\n\t}\n\n\tpublic void setDescription(String description) {\n\t\tthis.description = description;\n\t}\n\n\tpublic Integer getStatus() {\n\t\treturn status;\n\t}\n\n\tpublic void setStatus(Integer status) {\n\t\tthis.status = status;\n\t}\n\n\tpublic Double getX() {\n\t\treturn x;\n\t}\n\n\tpublic void setX(Double x) {\n\t\tthis.x = x;\n\t}\n\n\tpublic Double getY() {\n\t\treturn y;\n\t}\n\n\tpublic void setY(Double y) {\n\t\tthis.y = y;\n\t}\n\n\tpublic Integer getCurrency() {\n\t\treturn currency;\n\t}\n\n\tpublic void setCurrency(Integer currency) {\n\t\tthis.currency = currency;\n\t}\n\n\tpublic Double getScoring() {\n\t\treturn scoring;\n\t}\n\n\tpublic void setScoring(Double scoring) {\n\t\tthis.scoring = scoring;\n\t}\n\n\tpublic Date getTime() {\n\t\treturn time;\n\t}\n\n\tpublic void setTime(Date time) {\n\t\tthis.time = time;\n\t}\n\n\tpublic UserLevel getLevel() {\n\t\treturn level;\n\t}\n\n\tpublic void setLevel(UserLevel level) {\n\t\tthis.level = level;\n\t}\n\n\tpublic Area getArea() {\n\t\treturn area;\n\t}\n\n\tpublic void setArea(Area area) {\n\t\tthis.area = area;\n\t}\n\n\tpublic String getTjcode() {\n\t\treturn tjcode;\n\t}\n\n\tpublic void setTjcode(String tjcode) {\n\t\tthis.tjcode = tjcode;\n\t}\n\t\n\tpublic Integer getActivity() {\n\t\treturn activity;\n\t}\n\n\tpublic void setActivity(Integer activity) {\n\t\tthis.activity = activity;\n\t}\n\n\t@XmlElement\n\tpublic String getIdentifier() {\n\t\tif (activity == null) {\n\t\t\treturn \"\u65b0\u4eba\";\n\t\t} else if (activity >= 2000) {\n\t\t\treturn \"\u7279\u7ea7\";\n\t\t} else if (activity >= 1000 && activity <= 1999) {\n\t\t\treturn \"\u9ad8\u7ea7\";\n\t\t} else if (activity >= 500 && activity <= 999) {\n\t\t\treturn \"\u4e2d\u7ea7\";\n\t\t} else if (activity >= 200 && activity <= 499) {\n\t\t\treturn \"\u521d\u7ea7\";\n\t\t}\n\t\treturn \"\u65b0\u4eba\";\n\t}\n\n\tpublic boolean isTeamwork() {\n\t\treturn teamwork;\n\t}\n\n\tpublic void setTeamwork(boolean teamwork) {\n\t\tthis.teamwork = teamwork;\n\t}\n\t\n\tpublic Integer getTjcoin() {\n\t\treturn tjcoin;\n\t}\n\n\tpublic void setTjcoin(Integer tjcoin) {\n\t\tthis.tjcoin = tjcoin;\n\t}\n\n\tpublic boolean isAcceptCoupon() {\n\t\treturn acceptCoupon;\n\t}\n\n\tpublic void setAcceptCoupon(boolean acceptCoupon) {\n\t\tthis.acceptCoupon = acceptCoupon;\n\t}\n\n\tpublic Integer getMoney() {\n\t\treturn money;\n\t}\n\n\tpublic void setMoney(Integer money) {\n\t\tthis.money = money;\n\t}\n\t\n}\n", "meta": {"content_hash": "09961152c255dd2b8ffd2e6fccc1ddbc", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 67, "avg_line_length": 17.340557275541794, "alnum_prop": 0.7064809855382967, "repo_name": "secondflying/dfyy", "id": "b7211ffdebc40d47216eaaef59f1a68cb1ada1fc", "size": "5625", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/dfyy/bussiness/User.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ActionScript", "bytes": "70896"}, {"name": "Batchfile", "bytes": "113"}, {"name": "CSS", "bytes": "215364"}, {"name": "Java", "bytes": "2098669"}, {"name": "JavaScript", "bytes": "1312338"}, {"name": "PHP", "bytes": "1193"}]}} +{"text": "In order to translate the labels of the families and attributes, as well as some few other things, you only need to\ncreate a standard Symfony translation file with the proper syntax.\n\n| WARNING |\n| ------- |\n| Data translation is done using [*EAV* context](09-context.md) |\n\n### Translating Families\n\nThe label of a family can be directly provided in the configuration of the family by setting the \"label\" configuration\nkey. This is not recommended as it will not allow you to translate the attribute in multiple languages.\n\nThe translation system will look for this keys in order to translate a family:\n\n````yml\neav:\n family:\n <family_code>:\n label: <label>\n````\n\n### Translating Attributes\n\nThe label of an attribute can be directly provided in the configuration of the attribute by setting the \"label\"\nconfiguration key. This is not recommended as it will not allow you to translate the attribute in multiple languages.\n\nThe translation system will first look for this keys in order to translate an attribute:\n\n````yml\neav:\n family:\n <family_code>:\n attribute:\n <attribute_code>:\n label: <label>\n````\n\nHowever, if your attribute exists in multiple families and has the same label, you can use this syntax instead:\n\n````yml\neav:\n attribute:\n <attribute_code>:\n label: <label>\n````\n\n### Translating error messages\n\nThe following keys will be tested:\n\n````yml\neav:\n family:\n <family_code>:\n attribute:\n <attribute_code>:\n validation:\n <type>: <error_msg>\neav:\n attribute:\n <attribute_code>:\n validation:\n <type>: <error_msg>\neav:\n validation:\n <type>: <error_msg>\n````\n\nThe following translations parameters will be available:\n- ````%attribute%````: The translated label of the attribute.\n- ````%family%````: The translated label of the family.\n", "meta": {"content_hash": "f8a0e815459eb9d1844470c45af1fd57", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 118, "avg_line_length": 27.690140845070424, "alnum_prop": 0.6495422177009156, "repo_name": "VincentChalnot/SidusEAVModelBundle", "id": "ca512ca1b4e7c65e4b2965c9ea74f21843dfcb63", "size": "1997", "binary": false, "copies": "1", "ref": "refs/heads/v1.2-dev", "path": "Documentation/08-translate.md", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "14277"}, {"name": "PHP", "bytes": "371627"}]}} +{"text": "<html>\n<body>\n<xml:namespace ns=\"urn:schemas-microsoft-com:vml\" prefix=\"v\" />\n<!-- Include the VML behavior -->\n<style>v\\: * { behavior:url(#default#VML); display:inline-block }</style>\n<!--p-->\n<v:shape id=\"rect01\" style=\"HEIGHT:50px; LEFT:1px; TOP:1px; WIDTH:50px\"\n coordsize = \"200,200\" fillcolor = \"green\" strokecolor = \"green\"\n path = \"m1,1l1,200,200,200,200,1xe\"/>\n<!--/p-->\n<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\n\n//document.getElementById(\"rect01\").onmouseover = Change;\n\n function Change() {\n rect01.fillColor = (rect01.fillColor == \"red\") ? \"green\" :\n (rect01.fillColor == \"green\") ? \"blue\" : \"red\";\n }\n-->\n</script>\n</body>\n</html>\n\n\n", "meta": {"content_hash": "441a77285ee46cfe558d617a3a512135", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 73, "avg_line_length": 28.32, "alnum_prop": 0.6031073446327684, "repo_name": "doubleblacktech/learn-plumb", "id": "110cc3191991610eecc4e02c1f52bbf5f0a6e9f5", "size": "708", "binary": false, "copies": "18", "ref": "refs/heads/master", "path": "tests/miscellaneous/ie6-vml-mouseover.html", "mode": "33261", "license": "mit", "language": [{"name": "JavaScript", "bytes": "65950687"}]}} +{"text": "\npackage org.vaadin.spring.i18n;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.Reader;\nimport java.io.UnsupportedEncodingException;\nimport java.text.MessageFormat;\nimport java.util.Locale;\nimport java.util.MissingResourceException;\nimport java.util.PropertyResourceBundle;\nimport java.util.ResourceBundle;\n\n/**\n * Implementation of {@link org.vaadin.spring.i18n.MessageProvider} that reads messages\n * from {@link java.util.ResourceBundle}s with a specific base name.\n *\n * @author Petter Holmstr\u00f6m (petter@vaadin.com)\n */\npublic class ResourceBundleMessageProvider implements MessageProvider {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(ResourceBundleMessageProvider.class);\n\n private final String baseName;\n private final String encoding;\n\n /**\n * Creates a new {@code ResourceBundleMessageProvider} with the given base name and UTF-8 encoding.\n *\n * @param baseName the base name to use, must not be {@code null}.\n */\n public ResourceBundleMessageProvider(String baseName) {\n this(baseName, \"UTF-8\");\n }\n\n /**\n * Creates a new {@code ResourceBundleMessageProvider} with the given base name and encoding.\n *\n * @param baseName the base name to use, must not be {@code null}.\n * @param encoding the encoding to use when reading the resource bundle, must not be {@code null}.\n */\n public ResourceBundleMessageProvider(String baseName, String encoding) {\n this.baseName = baseName;\n this.encoding = encoding;\n }\n\n @Override\n public MessageFormat resolveCode(String s, Locale locale) {\n final ResourceBundle resourceBundle = getResourceBundle(locale);\n final String message = getString(resourceBundle, s);\n return getMessageFormat(message, locale);\n }\n\n private ResourceBundle getResourceBundle(Locale locale) {\n try {\n return ResourceBundle.getBundle(baseName, locale, new MessageControl());\n } catch (MissingResourceException ex) {\n LOGGER.warn(\"No message bundle with basename [{}] found for locale [{}]\", baseName, locale);\n return null;\n }\n }\n\n private String getString(ResourceBundle bundle, String s) {\n if (bundle == null) {\n return null;\n }\n try {\n return bundle.getString(s);\n } catch (MissingResourceException ex) {\n return null;\n }\n }\n\n private MessageFormat getMessageFormat(String message, Locale locale) {\n if (message == null) {\n return null;\n }\n return new MessageFormat(message, locale);\n }\n\n private class MessageControl extends ResourceBundle.Control {\n @Override\n public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException, IOException {\n if (\"java.properties\".equals(format)) {\n final String resourceName = toResourceName(toBundleName(baseName, locale), \"properties\");\n final InputStream stream = loader.getResourceAsStream(resourceName);\n if (stream == null) {\n \treturn null; // Not found\n }\n Reader reader = null;\n try {\n \treader = new InputStreamReader(stream, encoding);\n \treturn new PropertyResourceBundle(reader);\n } catch (UnsupportedEncodingException ex) {\n \tstream.close();\n \tthrow ex;\n } finally {\n \tif (reader != null) {\n \t\treader.close();\n \t}\n }\n } else {\n return super.newBundle(baseName, locale, format, loader, reload);\n }\n }\n }\n}\n", "meta": {"content_hash": "02b7a0c49ffcee61d1c511f616cd85bd", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 191, "avg_line_length": 35.4054054054054, "alnum_prop": 0.6399491094147582, "repo_name": "GJRTimmer/vaadin4spring", "id": "4ecee6be5a613a67d1526d5bbe902c27d847beca", "size": "4532", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "addons/i18n/src/main/java/org/vaadin/spring/i18n/ResourceBundleMessageProvider.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "665"}, {"name": "Java", "bytes": "353774"}]}} +{"text": "\r\n#include \"../Precompiled.h\"\r\n\r\n#include \"../Math/MathDefs.h\"\r\n#include \"../Math/StringHash.h\"\r\n\r\n#include <cstdio>\r\n\r\n#include \"../DebugNew.h\"\r\n\r\nnamespace Urho3D\r\n{\r\n\r\nconst StringHash StringHash::ZERO;\r\n\r\nStringHash::StringHash(const char* str) noexcept :\r\n value_(Calculate(str))\r\n{\r\n}\r\n\r\nStringHash::StringHash(const String& str) noexcept :\r\n value_(Calculate(str.CString()))\r\n{\r\n}\r\n\r\nunsigned StringHash::Calculate(const char* str, unsigned hash)\r\n{\r\n if (!str)\r\n return hash;\r\n\r\n while (*str)\r\n {\r\n // Perform the actual hashing as case-insensitive\r\n char c = *str;\r\n hash = SDBMHash(hash, (unsigned char)tolower(c));\r\n ++str;\r\n }\r\n\r\n return hash;\r\n}\r\n\r\nString StringHash::ToString() const\r\n{\r\n char tempBuffer[CONVERSION_BUFFER_LENGTH];\r\n sprintf(tempBuffer, \"%08X\", value_);\r\n return String(tempBuffer);\r\n}\r\n\r\n}\r\n", "meta": {"content_hash": "0fcd3d919b139550937694076bcb75e2", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 62, "avg_line_length": 18.122448979591837, "alnum_prop": 0.6081081081081081, "repo_name": "victorholt/Urho3D", "id": "7a30f2e214ef14ac1b11dffc3f48ea0c807b8192", "size": "2037", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "Source/Urho3D/Math/StringHash.cpp", "mode": "33188", "license": "mit", "language": [{"name": "AngelScript", "bytes": "1435828"}, {"name": "Batchfile", "bytes": "16483"}, {"name": "C++", "bytes": "8325877"}, {"name": "CMake", "bytes": "446542"}, {"name": "GLSL", "bytes": "154112"}, {"name": "HLSL", "bytes": "178063"}, {"name": "HTML", "bytes": "1375"}, {"name": "Java", "bytes": "78624"}, {"name": "Lua", "bytes": "568614"}, {"name": "MAXScript", "bytes": "94704"}, {"name": "Objective-C", "bytes": "6539"}, {"name": "Ruby", "bytes": "65069"}, {"name": "Shell", "bytes": "27373"}]}} +{"text": "\ufeff//\t\tThis file was generated by St4mpede.Poco 2016-06-08 22:18:52\n\n\n/* \t\t\t\nReading xml C:\\DATA\\PROJEKT\\St4mpede\\St4mpede\\St4mpede\\RdbSchema\\St4mpede.RdbSchema.xml.\nRead database with tables: Customer, Project, User.\nIncluded classes are:\nName=Customer\nName=Project\nName=User\nWriting the output file C:\\DATA\\PROJEKT\\St4mpede\\St4mpede\\St4mpede\\Poco\\PocoGenerator.xml.\nWriting 3 classes in C:\\DATA\\PROJEKT\\St4mpede\\St4mpede\\St4mpede\\..\\..\\TheDAL\\Poco.\n*/\n\n//\n//\n//\n//\n//\n//\n//\n//\n", "meta": {"content_hash": "928c42c20fba38c6343e5ad8317a1a9f", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 90, "avg_line_length": 21.727272727272727, "alnum_prop": 0.7364016736401674, "repo_name": "LosManos/St4mpede", "id": "d431056b37b6b1b0534e5cbceb4481788390d7fb", "size": "480", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "St4mpede/St4mpede/St4mpede.Poco.cs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C#", "bytes": "111411"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>classical-realizability: Not compatible</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.5.1 / classical-realizability - 8.7.0</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n classical-realizability\n <small>\n 8.7.0\n <span class=\"label label-info\">Not compatible</span>\n </small>\n </h1>\n <p><em><script>document.write(moment(\"2020-07-19 14:21:56 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2020-07-19 14:21:56 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-num base Num library distributed with the OCaml compiler\nbase-threads base\nbase-unix base\ncamlp5 7.12 Preprocessor-pretty-printer of OCaml\nconf-findutils 1 Virtual package relying on findutils\ncoq 8.5.1 Formal proof management system.\nnum 0 The Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.05.0 The OCaml compiler (virtual package)\nocaml-base-compiler 4.05.0 Official 4.05.0 release\nocaml-config 1 OCaml Switch Configuration\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/classical-realizability"\nlicense: "BSD"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/ClassicalRealizability"]\ndepends: [\n "ocaml"\n "coq" {>= "8.7" & < "8.8~"}\n]\ntags: [ "keyword: classical realizability" "keyword: Krivine's realizability" "keyword: primitive datatype" "keyword: non determinism" "keyword: quote" "keyword: axiom of countable choice" "keyword: real numbers" "category: Mathematics/Logic/Foundations" ]\nauthors: [ "Lionel Rieg <lionel.rieg@ens-lyon.org>" ]\nbug-reports: "https://github.com/coq-contribs/classical-realizability/issues"\ndev-repo: "git+https://github.com/coq-contribs/classical-realizability.git"\nsynopsis: "Krivine's classical realizability"\ndescription: """\nThe aim of this Coq library is to provide a framework for checking\nproofs in Krivine's classical realizability for second-order Peano arithmetic.\nIt is designed to be as extensible as the original theory by Krivine and to\nsupport on-the-fly extensions by new instructions with their evaluation\nrules."""\nflags: light-uninstall\nurl {\n src:\n "https://github.com/coq-contribs/classical-realizability/archive/v8.7.0.tar.gz"\n checksum: "md5=6299c2ee7d52c1535eece3376983263c"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-classical-realizability.8.7.0 coq.8.5.1</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.5.1).\nThe following dependencies couldn't be met:\n - coq-classical-realizability -> coq >= 8.7\nYour request can't be satisfied:\n - No available version of coq satisfies the constraints\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-classical-realizability.8.7.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n <small>Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a>. \u00a9 Guillaume Claret.</small>\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "6953417c96203c08c70ca885216d50c6", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 340, "avg_line_length": 43.81547619047619, "alnum_prop": 0.5651406058959381, "repo_name": "coq-bench/coq-bench.github.io", "id": "7a2fb7424f897c58b824ccbe499d4bd7f93f33f2", "size": "7363", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.6/released/8.5.1/classical-realizability/8.7.0.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "import React from 'react'\nimport '!style!css!react-loading-bar/dist/index.css'\nexport default function Loading() {\n return (\n <div>\n <span className=\"fa fa-cog fa-spin fa-3x fa-fw\" />\n <span className=\"sr-only\" aria-hidden=\"true\">Loading...</span>\n </div>\n )\n}\n", "meta": {"content_hash": "79f42d9ca7021bd62d432c1472260f62", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 68, "avg_line_length": 27.9, "alnum_prop": 0.6415770609318996, "repo_name": "moimikey/react-boilerplate", "id": "0c6503845d209715b51d2b93dbf7650d78360700", "size": "279", "binary": false, "copies": "1", "ref": "refs/heads/redux", "path": "src/app/components/Loading.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "4797"}, {"name": "HTML", "bytes": "3946"}, {"name": "JavaScript", "bytes": "29033"}]}} +{"text": "from __future__ import unicode_literals\nfrom django.conf import settings\nfrom django.contrib.contenttypes import generic\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.db import models\nfrom django.dispatch.dispatcher import receiver\nfrom model_utils.models import TimeStampedModel\nfrom registration.signals import user_registered\n\n_all = [\"Asset\", \"Profile\", \"user_registered_callback\"]\n__author__ = \"pmeier82\"\n\n\n# PROFILE\n\nclass Profile(models.Model):\n \"\"\"user profile model\"\"\"\n\n class Meta:\n app_label = \"base\"\n\n user = models.OneToOneField(\n settings.AUTH_USER_MODEL,\n unique=True)\n title = models.CharField(\n max_length=255,\n default=\"\",\n )\n affiliation = models.CharField(\n max_length=255,\n default=\"\",\n )\n research_area = models.TextField(\n default=\"\"\n )\n # TODO: build a meaningful profile\n\n # special\n def __str__(self):\n return self.user.username\n\n def __unicode__(self):\n return unicode(self.__str__())\n\n\ndef user_registered_callback(user, request, **kwargs):\n profile, is_new = Profile.objects.get_or_create(user=user)\n profile.title = request.POST.get(\"title\", \"test\")\n profile.save()\n\n\nuser_registered.connect(user_registered_callback)\n\n# ASSET\n\ndef UPLOAD_TO_HANDLER(obj, fname):\n folder = getattr(obj, \"kind\", \"default\")\n return \"{}/{}\".format(folder, fname)\n\n\nclass Asset(TimeStampedModel):\n \"\"\"generic file asset model\"\"\"\n\n class Meta:\n app_label = \"base\"\n\n UPLOAD_TO = \"default\"\n\n # fields\n name = models.CharField(max_length=255, unique=False)\n data_orig_name = models.CharField(max_length=255, unique=False)\n data = models.FileField(upload_to=UPLOAD_TO_HANDLER)\n kind = models.CharField(max_length=255, unique=False, null=False, default=UPLOAD_TO)\n\n # generic foreign key\n content_type = models.ForeignKey(ContentType, null=True)\n object_id = models.PositiveIntegerField(null=True)\n content_object = generic.GenericForeignKey()\n\n # special methods\n def __unicode__(self):\n return unicode(\"{}: {}\".format(self.__class__.__name__, self.name))\n\n # django special methods\n @models.permalink\n def get_absolute_url(self):\n return \"asset:serve\", (self.pk,), {}\n\n @models.permalink\n def get_delete_url(self):\n return \"asset:delete\", (self.pk,), {}\n\n # interface\n def save(self, *args, **kwargs):\n super(Asset, self).save(*args, **kwargs)\n\n def delete(self, *args, **kwargs):\n super(Asset, self).delete(*args, **kwargs)\n\n\n@receiver(models.signals.pre_delete, sender=Asset)\ndef asset_file_delete(sender, instance, **kwargs):\n instance.data.delete()\n\n\nif __name__ == \"__main__\":\n pass\n", "meta": {"content_hash": "85f7dee85ba6de3d5a267ea68a913604", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 88, "avg_line_length": 25.757009345794394, "alnum_prop": 0.6556603773584906, "repo_name": "pmeier82/spike_gnode", "id": "2411abbf4b4c2c62fd144aaa9261d587c405219b", "size": "2781", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "base/models.py", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "11360"}, {"name": "HTML", "bytes": "56070"}, {"name": "JavaScript", "bytes": "734"}, {"name": "Nginx", "bytes": "4758"}, {"name": "Python", "bytes": "37001"}, {"name": "Shell", "bytes": "2475"}]}} +{"text": "\npackage org.eclipse.lsp4j;\n\nimport java.util.List;\nimport org.eclipse.lsp4j.Position;\nimport org.eclipse.lsp4j.TextDocumentIdentifier;\nimport org.eclipse.lsp4j.WorkDoneProgressAndPartialResultParams;\nimport org.eclipse.lsp4j.jsonrpc.validation.NonNull;\nimport org.eclipse.lsp4j.util.Preconditions;\nimport org.eclipse.xtext.xbase.lib.Pure;\nimport org.eclipse.xtext.xbase.lib.util.ToStringBuilder;\n\n/**\n * A parameter literal used in selection range requests.\n * <p>\n * Since 3.15.0\n */\n@SuppressWarnings(\"all\")\npublic class SelectionRangeParams extends WorkDoneProgressAndPartialResultParams {\n /**\n * The text document.\n */\n @NonNull\n private TextDocumentIdentifier textDocument;\n \n /**\n * The positions inside the text document.\n */\n @NonNull\n private List<Position> positions;\n \n public SelectionRangeParams() {\n }\n \n public SelectionRangeParams(@NonNull final TextDocumentIdentifier textDocument, @NonNull final List<Position> positions) {\n this.textDocument = Preconditions.<TextDocumentIdentifier>checkNotNull(textDocument, \"textDocument\");\n this.positions = Preconditions.<List<Position>>checkNotNull(positions, \"positions\");\n }\n \n /**\n * The text document.\n */\n @Pure\n @NonNull\n public TextDocumentIdentifier getTextDocument() {\n return this.textDocument;\n }\n \n /**\n * The text document.\n */\n public void setTextDocument(@NonNull final TextDocumentIdentifier textDocument) {\n this.textDocument = Preconditions.checkNotNull(textDocument, \"textDocument\");\n }\n \n /**\n * The positions inside the text document.\n */\n @Pure\n @NonNull\n public List<Position> getPositions() {\n return this.positions;\n }\n \n /**\n * The positions inside the text document.\n */\n public void setPositions(@NonNull final List<Position> positions) {\n this.positions = Preconditions.checkNotNull(positions, \"positions\");\n }\n \n @Override\n @Pure\n public String toString() {\n ToStringBuilder b = new ToStringBuilder(this);\n b.add(\"textDocument\", this.textDocument);\n b.add(\"positions\", this.positions);\n b.add(\"workDoneToken\", getWorkDoneToken());\n b.add(\"partialResultToken\", getPartialResultToken());\n return b.toString();\n }\n \n @Override\n @Pure\n public boolean equals(final Object obj) {\n if (this == obj)\n return true;\n if (obj == null)\n return false;\n if (getClass() != obj.getClass())\n return false;\n if (!super.equals(obj))\n return false;\n SelectionRangeParams other = (SelectionRangeParams) obj;\n if (this.textDocument == null) {\n if (other.textDocument != null)\n return false;\n } else if (!this.textDocument.equals(other.textDocument))\n return false;\n if (this.positions == null) {\n if (other.positions != null)\n return false;\n } else if (!this.positions.equals(other.positions))\n return false;\n return true;\n }\n \n @Override\n @Pure\n public int hashCode() {\n final int prime = 31;\n int result = super.hashCode();\n result = prime * result + ((this.textDocument== null) ? 0 : this.textDocument.hashCode());\n return prime * result + ((this.positions== null) ? 0 : this.positions.hashCode());\n }\n}\n", "meta": {"content_hash": "1fc19c21c3959ccaf37336d3bc383346", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 124, "avg_line_length": 27.396551724137932, "alnum_prop": 0.6913152926368785, "repo_name": "smarr/SOMns-vscode", "id": "ca95621514251184457f1372dec09436068539dd", "size": "3598", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/org.eclipse.lsp4j-gen/org/eclipse/lsp4j/SelectionRangeParams.java", "mode": "33188", "license": "mit", "language": [{"name": "ANTLR", "bytes": "12820"}, {"name": "Java", "bytes": "1782848"}, {"name": "Shell", "bytes": "182"}, {"name": "Slash", "bytes": "241"}, {"name": "TypeScript", "bytes": "26804"}, {"name": "Vim Script", "bytes": "3730"}, {"name": "Xtend", "bytes": "197426"}]}} +{"text": "package com.github.mortido.extra.behavioral.nullObject;\n\npublic class NullUser extends User {\n @Override\n public String getName() {\n return \"User doesn't exist\";\n }\n\n @Override\n public int getId() {\n return -1;\n }\n}\n", "meta": {"content_hash": "13680e8fb0ec1fd4f5088b9f8c0ac55a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 55, "avg_line_length": 19.076923076923077, "alnum_prop": 0.625, "repo_name": "mortido/DesignPatterns-Java", "id": "56cf92ed5e528869f70fcc4d8bd985ba8f3b2836", "size": "248", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/github/mortido/extra/behavioral/nullObject/NullUser.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "72591"}]}} +{"text": "import { Arr, Optional } from '@ephox/katamari';\nimport { SugarElement } from '@ephox/sugar';\n\nimport * as Structs from '../api/Structs';\nimport * as GridRow from '../model/GridRow';\nimport { CellElement, CompElm } from '../util/TableTypes';\n\ntype Subst = () => SugarElement<HTMLTableCellElement>;\n\n// substitution: () -> item\nconst merge = (grid: Structs.RowCells[], bounds: Structs.Bounds, comparator: CompElm, substitution: Subst): Structs.RowCells[] => {\n const rows = GridRow.extractGridDetails(grid).rows;\n // Mutating. Do we care about the efficiency gain?\n if (rows.length === 0) {\n return grid;\n }\n for (let i = bounds.startRow; i <= bounds.finishRow; i++) {\n for (let j = bounds.startCol; j <= bounds.finishCol; j++) {\n // We can probably simplify this again now that we aren't reusing merge.\n const row = rows[i];\n const isLocked = GridRow.getCell(row, j).isLocked;\n GridRow.mutateCell(row, j, Structs.elementnew(substitution(), false, isLocked));\n }\n }\n return grid;\n};\n\n// substitution: () -> item\nconst unmerge = (grid: Structs.RowCells[], target: SugarElement<HTMLElement>, comparator: CompElm, substitution: Subst): Structs.RowCells[] => {\n const rows = GridRow.extractGridDetails(grid).rows;\n // Mutating. Do we care about the efficiency gain?\n let first = true;\n // tslint:disable-next-line:prefer-for-of\n for (let i = 0; i < rows.length; i++) {\n for (let j = 0; j < GridRow.cellLength(rows[0]); j++) {\n const row = rows[i];\n const currentCell = GridRow.getCell(row, j);\n const currentCellElm = currentCell.element;\n const isToReplace = comparator(currentCellElm, target);\n\n if (isToReplace && !first) {\n GridRow.mutateCell(row, j, Structs.elementnew(substitution(), true, currentCell.isLocked));\n } else if (isToReplace) {\n first = false;\n }\n }\n }\n return grid;\n};\n\nconst uniqueCells = <T extends CellElement>(row: Structs.ElementNew<T>[], comparator: CompElm): Structs.ElementNew<T>[] => {\n return Arr.foldl(row, (rest, cell) => {\n return Arr.exists(rest, (currentCell) => {\n return comparator(currentCell.element, cell.element);\n }) ? rest : rest.concat([ cell ]);\n }, [] as Structs.ElementNew<T>[]);\n};\n\nconst splitCols = (grid: Structs.RowCells[], index: number, comparator: CompElm, substitution: Subst): Structs.RowCells[] => {\n // We don't need to split rows if we're inserting at the first or last row of the old table\n if (index > 0 && index < grid[0].cells.length) {\n Arr.each(grid, (row) => {\n const prevCell = row.cells[index - 1];\n let offset = 0;\n const substitute = substitution();\n\n while (row.cells.length > index + offset && comparator(prevCell.element, row.cells[index + offset].element)) {\n GridRow.mutateCell(row, index + offset, Structs.elementnew(substitute, true, row.cells[index + offset].isLocked));\n offset++;\n }\n });\n }\n\n return grid;\n};\n\nconst splitRows = (grid: Structs.RowCells[], index: number, comparator: CompElm, substitution: Subst): Structs.RowCells[] => {\n // We don't need to split rows if we're inserting at the first or last row of the old table\n const rows = GridRow.extractGridDetails(grid).rows;\n if (index > 0 && index < rows.length) {\n const rowPrevCells = rows[index - 1].cells;\n const cells = uniqueCells(rowPrevCells, comparator);\n Arr.each(cells, (cell) => {\n // only make a sub when we have to\n let replacement = Optional.none<SugarElement<HTMLTableCellElement>>();\n for (let i = index; i < rows.length; i++) {\n for (let j = 0; j < GridRow.cellLength(rows[0]); j++) {\n const row = rows[i];\n const current = GridRow.getCell(row, j);\n const isToReplace = comparator(current.element, cell.element);\n\n if (isToReplace) {\n if (replacement.isNone()) {\n replacement = Optional.some(substitution());\n }\n replacement.each((sub) => {\n GridRow.mutateCell(row, j, Structs.elementnew(sub, true, current.isLocked));\n });\n }\n }\n }\n });\n }\n\n return grid;\n};\n\nexport {\n merge,\n unmerge,\n splitCols,\n splitRows\n};\n", "meta": {"content_hash": "ca65adc511ae0aedbdd6e75bf700d63b", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 144, "avg_line_length": 37.13274336283186, "alnum_prop": 0.6348903717826502, "repo_name": "tinymce/tinymce", "id": "98e0abc2909ea0a3267c1a8d7d87f92f13e3584d", "size": "4196", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "modules/snooker/src/main/ts/ephox/snooker/operate/MergingOperations.ts", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "9733"}, {"name": "HTML", "bytes": "183264"}, {"name": "JavaScript", "bytes": "117530"}, {"name": "Less", "bytes": "182379"}, {"name": "TypeScript", "bytes": "11764279"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<config version=\"1\" xmlns=\"http://skynav.com/ns/ttv\"/>\n", "meta": {"content_hash": "6b3dadea3ba647025bc678e04d6487e0", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 54, "avg_line_length": 47.0, "alnum_prop": 0.648936170212766, "repo_name": "RBMHTechnology/ttt", "id": "af62bb6ae91ead9584202716b1b01ca7703b5c03", "size": "94", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "ttt-ttv/src/main/resources/com/skynav/ttv/app/config.xml", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "CSS", "bytes": "22996"}, {"name": "HTML", "bytes": "2348"}, {"name": "Java", "bytes": "2833329"}, {"name": "Shell", "bytes": "2808"}, {"name": "XSLT", "bytes": "5232"}]}} +{"text": "from __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import division\n\nimport json\n\nfrom django.conf import settings\nfrom django.contrib.gis.geos import Polygon\nfrom django.core.urlresolvers import reverse\nfrom django.db import transaction\nfrom django.db.models import Q\nfrom django.http import HttpResponseRedirect, HttpResponseForbidden, Http404\nfrom django.shortcuts import get_object_or_404\nfrom django.utils.timezone import now\n\nfrom libs.data import merge\nfrom libs.formatters import humanize_bytes\nfrom libs.pdf_maps import create_event_map_pdf\nfrom libs.sql import get_group_tree_count\n\nfrom apps.core.helpers import (user_is_group_admin,\n user_is_eligible_to_become_trusted_mapper)\nfrom apps.core.decorators import group_request\nfrom apps.core.models import Group\n\nfrom apps.mail.views import notify_group_mapping_approved\n\nfrom apps.users.models import Follow, TrustedMapper\nfrom apps.users.forms import GroupSettingsForm\n\nfrom apps.survey.models import Territory, Survey, Blockface\nfrom apps.survey.layer_context import (get_context_for_territory_layer,\n get_context_for_territory_admin_layer)\n\nfrom apps.event.models import Event, EventRegistration\nfrom apps.event.event_list import EventList\n\nGROUP_EVENTS_ID = 'group-events'\nGROUP_EDIT_EVENTS_TAB_ID = 'events'\n\n\ndef group_list_page(request):\n # TODO: pagination\n groups = Group.objects.filter(is_active=True).order_by('name')\n group_ids = Follow.objects.filter(user_id=request.user.id) \\\n .values_list('group_id', flat=True)\n user_is_following = [group.id in group_ids for group in groups]\n\n group_infos = zip(groups, user_is_following)\n return {\n 'groups': group_infos,\n 'groups_count': len(group_infos),\n }\n\n\n@group_request\ndef _group_events(request):\n qs = Event.objects.filter(group=request.group, is_private=False)\n user_can_edit_group = user_is_group_admin(request.user,\n request.group)\n extra_context = {'user_can_edit_group': user_can_edit_group,\n 'group_slug': request.group.slug}\n return qs, extra_context\n\n\ngroup_detail_events = EventList(\n _group_events,\n name=\"group_detail_events\",\n template_path='groups/partials/detail_event_list.html')\n\n\ngroup_edit_events = EventList(\n _group_events,\n name=\"group_edit_events\",\n template_path='groups/partials/edit_event_list.html')\n\n\ndef group_detail(request):\n user = request.user\n group = request.group\n\n if not user_is_group_admin(user, group) and not request.group.is_active:\n raise Http404('Must be a group admin to view an inactive group')\n\n event_list = (group_detail_events\n .configure(chunk_size=2,\n active_filter=EventList.Filters.CURRENT,\n filterset_name=EventList.chronoFilters)\n .as_context(request, group_slug=group.slug))\n user_is_following = Follow.objects.filter(user_id=request.user.id,\n group=group).exists()\n\n show_mapper_request = user_is_eligible_to_become_trusted_mapper(user,\n group)\n\n follow_count = Follow.objects.filter(group=group).count()\n tree_count = get_group_tree_count(group)\n\n group_blocks = Territory.objects \\\n .filter(group=group) \\\n .values_list('blockface_id', flat=True)\n\n group_blocks_count = group_blocks.count()\n\n if group_blocks_count > 0:\n completed_blocks = Survey.objects \\\n .filter(blockface_id__in=group_blocks) \\\n .distinct('blockface')\n block_percent = \"{:.1%}\".format(\n float(completed_blocks.count()) / float(group_blocks.count()))\n else:\n block_percent = \"0.0%\"\n\n events_held = Event.objects.filter(group=group, ends_at__lt=now())\n num_events_held = events_held.count()\n\n num_event_attendees = EventRegistration.objects \\\n .filter(event__in=events_held) \\\n .filter(did_attend=True) \\\n .count()\n\n return {\n 'group': group,\n 'event_list': event_list,\n 'user_is_following': user_is_following,\n 'edit_url': reverse('group_edit', kwargs={'group_slug': group.slug}),\n 'show_mapper_request': show_mapper_request,\n 'counts': {\n 'tree': tree_count,\n 'block': block_percent,\n 'event': num_events_held,\n 'attendees': num_event_attendees,\n 'follows': follow_count\n },\n 'group_events_id': GROUP_EVENTS_ID,\n 'layer': get_context_for_territory_layer(request, request.group.id),\n 'territory_bounds': _group_territory_bounds(request.group),\n 'render_follow_button_without_count': request.POST.get(\n 'render_follow_button_without_count', False)\n }\n\n\ndef redirect_to_group_detail(request):\n return HttpResponseRedirect(\n reverse('group_detail', kwargs={\n 'group_slug': request.group.slug\n }))\n\n\ndef _group_territory_bounds(group):\n blockfaces = Blockface.objects \\\n .filter(territory__group=group) \\\n .collect()\n\n if blockfaces:\n return list(blockfaces.extent)\n else:\n return None\n\n\ndef edit_group(request, form=None):\n group = request.group\n if not form:\n form = GroupSettingsForm(instance=request.group, label_suffix='')\n event_list = (group_edit_events\n .configure(chunk_size=2,\n active_filter=EventList.Filters.CURRENT,\n filterset_name=EventList.chronoFilters)\n .as_context(request, group_slug=group.slug))\n pending_mappers = TrustedMapper.objects.filter(group=request.group,\n is_approved__isnull=True)\n all_mappers = TrustedMapper.objects.filter(group=request.group,\n is_approved__isnull=False)\n return {\n 'group': group,\n 'event_list': event_list,\n 'form': form,\n 'group_slug': group.slug,\n 'max_image_size': humanize_bytes(\n settings.MAX_GROUP_IMAGE_SIZE_IN_BYTES, 0),\n 'pending_mappers': pending_mappers,\n 'all_mappers': all_mappers,\n 'group_edit_events_tab_id': GROUP_EDIT_EVENTS_TAB_ID,\n }\n\n\ndef update_group_settings(request):\n form = GroupSettingsForm(request.POST, request.FILES,\n instance=request.group)\n if form.is_valid():\n form.save()\n return HttpResponseRedirect(request.group.get_absolute_url())\n else:\n return edit_group(request, form=form)\n\n\ndef follow_group(request):\n Follow.objects.get_or_create(user_id=request.user.id, group=request.group)\n return group_detail(request)\n\n\ndef unfollow_group(request):\n Follow.objects.filter(user_id=request.user.id, group=request.group) \\\n .delete()\n return group_detail(request)\n\n\ndef start_group_map_print_job(request):\n # TODO: implement\n pass\n\n\ndef give_user_mapping_priveleges(request, username):\n mapper_context = _grant_mapping_access(request.group, username,\n is_approved=True)\n mail_context = notify_group_mapping_approved(request, request.group,\n username)\n return merge(mapper_context, mail_context)\n\n\ndef remove_user_mapping_priveleges(request, username):\n return _grant_mapping_access(request.group, username, is_approved=False)\n\n\ndef _grant_mapping_access(group, username, is_approved):\n mapper, created = TrustedMapper.objects.update_or_create(\n group=group,\n user__username=username,\n defaults={'is_approved': is_approved})\n return {\n 'mapper': mapper\n }\n\n\ndef request_mapper_status(request):\n user, group = request.user, request.group\n if not user_is_eligible_to_become_trusted_mapper(user, group):\n return HttpResponseForbidden()\n mapper, created = TrustedMapper.objects.update_or_create(\n group=group, user=user)\n return {\n 'success': True\n }\n\n\ndef group_unmapped_territory_geojson(request, group_id):\n # Get unmapped blockfaces\n blockfaces = Blockface.objects.filter(is_available=True)\n\n my_territory_q = Q(territory__group_id=group_id)\n\n if request.body:\n # Get potentially selectable blockfaces in polygon\n # (those in my territory or unclaimed)\n point_list = json.loads(request.body)\n point_list.append(point_list[0]) # Close the polygon\n polygon = Polygon((point_list))\n\n no_reservations_q = \\\n Q(blockfacereservation__isnull=True) \\\n | Q(blockfacereservation__canceled_at__isnull=False) \\\n | Q(blockfacereservation__expires_at__lt=now())\n nobodys_territory_q = Q(territory__group_id=None)\n unclaimed_q = no_reservations_q & nobodys_territory_q\n\n blockfaces = blockfaces \\\n .filter(geom__within=polygon) \\\n .filter(my_territory_q | unclaimed_q) \\\n .distinct()\n\n # Return just blockface data\n # (skipping expensive queries to make tiler URLs)\n return _make_blockface_data_result(blockfaces)\n\n else:\n # Get all blockfaces in group's territory\n blockfaces = blockfaces.filter(my_territory_q)\n return _make_blockface_and_tiler_urls_result(\n request, blockfaces, group_id)\n\n\ndef group_update_territory(request, group_id):\n group = get_object_or_404(Group, id=group_id)\n\n _update_territory(group, request)\n\n # Recreate PDF maps to show updated group territory\n _update_event_maps(request, group)\n\n result_blockfaces = Blockface.objects.filter(territory__group=group)\n return _make_blockface_and_tiler_urls_result(\n request, result_blockfaces, group_id)\n\n\n@transaction.atomic\ndef _update_territory(group, request):\n new_block_ids = set([int(id) for id in json.loads(request.body)])\n old_block_ids = set(Territory.objects\n .filter(group=group)\n .values_list('blockface_id', flat=True))\n ids_to_add = new_block_ids - old_block_ids\n ids_to_kill = old_block_ids - new_block_ids\n # Make sure no unavailable or already-assigned blocks slipped in\n filtered_ids_to_add = Blockface.objects \\\n .filter(id__in=ids_to_add) \\\n .filter(is_available=True) \\\n .filter(territory=None) \\\n .values_list('id', flat=True)\n new_territory = [Territory(group=group, blockface_id=id)\n for id in filtered_ids_to_add]\n Territory.objects.bulk_create(new_territory)\n Territory.objects \\\n .filter(blockface_id__in=ids_to_kill) \\\n .delete()\n\n\ndef _update_event_maps(request, group):\n events = Event.objects \\\n .filter(group_id=group.id, begins_at__gt=now()) \\\n .select_related('group')\n for event in events:\n create_event_map_pdf(request, event)\n\n\ndef _make_blockface_and_tiler_urls_result(request, blockfaces, group_id):\n result = {\n 'blockDataList': _make_blockface_data_result(blockfaces),\n 'tilerUrls': get_context_for_territory_admin_layer(request, group_id)\n }\n return result\n\n\ndef _make_blockface_data_result(blockfaces):\n block_data_list = [{'id': bf.id, 'geojson': bf.geom.json}\n for bf in blockfaces]\n return block_data_list\n", "meta": {"content_hash": "245a3f944cd4eac948a49263f01aee37", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 78, "avg_line_length": 34.25595238095238, "alnum_prop": 0.635881841876629, "repo_name": "RickMohr/nyc-trees", "id": "0430d00d3c50a470409f54b8f021ae97848c2ee7", "size": "11534", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/nyc_trees/apps/users/views/group.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "171372"}, {"name": "CartoCSS", "bytes": "878"}, {"name": "HTML", "bytes": "157969"}, {"name": "JavaScript", "bytes": "286316"}, {"name": "Makefile", "bytes": "1524"}, {"name": "PLpgSQL", "bytes": "3210"}, {"name": "Python", "bytes": "404021"}, {"name": "Shell", "bytes": "23399"}]}} +{"text": "function configure() {\n # List n-application using most space\n # @param $1|size number of biggest application to list\n # @return void\n function du-app() {\n size=\"${1:-10}\"\n dpkg-query --show --showformat=\"\\${Package;-50}\\t\\${Installed-Size}\\n\" \\\n | sort -k 2 -n \\\n | grep -v deinstall \\\n | awk '{printf \"%.1f MB \\t %s\\n\", $2/(1024), $1}' \\\n | tail -n \"$size\"\n }\n\n # human-readable sizes\n function df() { \n command df \\\n --human-readable \\\n --print-type \\\n --exclude-type squashfs \\\n --exclude-type tmpfs \\\n --exclude-type devtmpfs \\\n \"$@\"\n }\n\n # show sizes in MB\n function free() { command free -m; }\n}\nconfigure\n", "meta": {"content_hash": "73da57189a7a28882b91e1fe9a32a92a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 80, "avg_line_length": 27.357142857142858, "alnum_prop": 0.49216710182767626, "repo_name": "edouard-lopez/dotfiles", "id": "4d9fd2c0bf074292bae2b10a9a53a4d841befd56", "size": "787", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "includes/posix/monitoring.bash", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "63"}, {"name": "Shell", "bytes": "38660"}, {"name": "Vim Script", "bytes": "5525"}]}} +{"text": "\npackage org.ops4j.pax.exam.sample2.model;\n\nimport javax.persistence.Entity;\nimport javax.persistence.GeneratedValue;\nimport javax.persistence.GenerationType;\nimport javax.persistence.Id;\nimport javax.persistence.Lob;\nimport javax.persistence.ManyToOne;\nimport javax.persistence.Table;\n\n@Entity\n@Table(name = \"rating\")\npublic class Rating {\n\n @Id\n @GeneratedValue(strategy = GenerationType.AUTO)\n private int id;\n\n private int stars;\n\n @Lob\n private String comment;\n\n @ManyToOne\n private User user;\n @ManyToOne\n private Movie movie;\n\n /**\n * @return the id\n */\n public int getId() {\n return id;\n }\n\n /**\n * @param id\n * the id to set\n */\n public void setId(int id) {\n this.id = id;\n }\n\n /**\n * @return the stars\n */\n public int getStars() {\n return stars;\n }\n\n /**\n * @param stars\n * the stars to set\n */\n public void setStars(int stars) {\n this.stars = stars;\n }\n\n /**\n * @return the comment\n */\n public String getComment() {\n return comment;\n }\n\n /**\n * @param comment\n * the comment to set\n */\n public void setComment(String comment) {\n this.comment = comment;\n }\n\n /**\n * @return the user\n */\n public User getUser() {\n return user;\n }\n\n /**\n * @param user\n * the user to set\n */\n public void setUser(User user) {\n this.user = user;\n }\n\n /**\n * @return the movie\n */\n public Movie getMovie() {\n return movie;\n }\n\n /**\n * @param movie\n * the movie to set\n */\n public void setMovie(Movie movie) {\n this.movie = movie;\n }\n}\n", "meta": {"content_hash": "4901789fd2534feffdc9e9d6efb0ceb9", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 51, "avg_line_length": 17.009615384615383, "alnum_prop": 0.5313736574335783, "repo_name": "bimargulies/org.ops4j.pax.exam2", "id": "0188ac1c47c0896fbf7d103e1a14246e8d489d25", "size": "2379", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "samples/pax-exam-sample2-model/src/main/java/org/ops4j/pax/exam/sample2/model/Rating.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "1271799"}, {"name": "Shell", "bytes": "198"}]}} +{"text": "\n//\n// MODULE: JdbcDebug.cpp\n//\n#include \"org_apache_trafodion_jdbc_t2_JdbcDebug.h\"\n#include \"Debug.h\"\n\n/*\n * Class: org_apache_trafodion_jdbc_t2_JdbcDebug\n * Method: getDebugHandle\n * Signature: (I)I\n */\nJNIEXPORT jlong JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_getDebugHandle(JNIEnv *jenv, jclass jcls,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t jlong method_name_handle)\n{\n\tjlong handle = 0;\n#if defined(_BENCHMARK)\n\thandle = (jlong) new Benchmark((const char *) method_name_handle);\n#endif /* _BENCHMARK */\n\treturn(handle);\n}\n\n/*\n * Class: org_apache_trafodion_jdbc_t2_JdbcDebug\n * Method: getMethodNameHandle\n * Signature: (Ljava/lang/String;)I\n */\nJNIEXPORT jlong JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_getMethodNameHandle(JNIEnv *jenv, jclass jcls,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t jstring method_name)\n{\n\tjlong rc = 0;\n#if defined(_DEBUG) || defined(_BENCHMARK)\n\tif (method_name) rc = (jlong) jenv->GetStringUTFChars(method_name,NULL);\n\tif (rc==0) rc = (jlong) \"Unknown\";\n#endif /* _DEBUG || _BENCHMARK */\n\treturn(rc);\n}\n\n/*\n * Class: org_apache_trafodion_jdbc_t2_JdbcDebug\n * Method: methodEntry\n * Signature: (III)V\n */\nJNIEXPORT void JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_methodEntry(JNIEnv *jenv, jclass jcls,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t jlong debug_handle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t jint debug_level,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t jlong method_name_handle)\n{\n#if defined(_DEBUG)\n\tDebugFunctionEntry((const char *) method_name_handle, debug_level, NULL , NULL, 0);\n#endif /* _DEBUG */\n#if defined(_BENCHMARK)\n\t((Benchmark *) debug_handle)->Entry();\n#endif /* _BENCHMARK */\n}\n\n/*\n * Class: org_apache_trafodion_jdbc_t2_JdbcDebug\n * Method: methodReturn\n * Signature: (ILjava/lang/String;)V\n */\nJNIEXPORT void JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_methodReturn(JNIEnv *jenv, jclass jcls,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjlong debug_handle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjstring comment)\n{\n#if defined(_DEBUG)\n\tconst char *commentStr;\n\tif (comment) commentStr = jenv->GetStringUTFChars(comment,NULL);\n\telse commentStr = NULL;\n\tDebugFunctionReturn(\"JAVA\", commentStr, false, \"RETURNING\", NULL, 0);\n\tif (commentStr) jenv->ReleaseStringUTFChars(comment,commentStr);\n#endif /* _DEBUG */\n}\n\n/*\n * Class: org_apache_trafodion_jdbc_t2_JdbcDebug\n * Method: methodExit\n * Signature: (I)V\n */\nJNIEXPORT void JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_methodExit(JNIEnv *jenv, jclass jcls,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t jlong debug_handle)\n{\n#if defined(_DEBUG)\n\tDebugFunctionReturn(\"JAVA\", NULL, true, \"EXITING\", NULL, 0);\n#endif /* _DEBUG */\n\n#if defined(_BENCHMARK)\n\t((Benchmark *) debug_handle)->Exit();\n#endif /* _BENCHMARK */\n}\n\n/*\n * Class: org_apache_trafodion_jdbc_t2_JdbcDebug\n * Method: traceOut\n * Signature: (IILjava/lang/String;)V\n */\nJNIEXPORT void JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_traceOut(JNIEnv *jenv, jclass jcls,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjlong debug_handle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjint debug_level,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjstring comment)\n{\n#if defined(_DEBUG)\n\tconst char *commentStr;\n\tif (comment) commentStr = jenv->GetStringUTFChars(comment,NULL);\n\telse commentStr = NULL;\n\tif (DebugActive(debug_level,NULL,0)) DebugOutput(commentStr , NULL, 0);\n\tif (commentStr) jenv->ReleaseStringUTFChars(comment,commentStr);\n#endif /* _DEBUG */\n}\n", "meta": {"content_hash": "1abd718dce3bc752ab0955f9348f9b61", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 114, "avg_line_length": 29.853211009174313, "alnum_prop": 0.6717885679164106, "repo_name": "mashengchen/incubator-trafodion", "id": "25ae2a001185445481545ef9e80b702621cbfedb", "size": "4264", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "core/conn/jdbc_type2/native/JdbcDebug.cpp", "mode": "33188", "license": "apache-2.0", "language": [{"name": "1C Enterprise", "bytes": "27762"}, {"name": "Awk", "bytes": "20971"}, {"name": "Batchfile", "bytes": "27013"}, {"name": "C", "bytes": "18877152"}, {"name": "C++", "bytes": "68786466"}, {"name": "CSS", "bytes": "99092"}, {"name": "GDB", "bytes": "62692"}, {"name": "Groff", "bytes": "46673"}, {"name": "HTML", "bytes": "4618"}, {"name": "Inno Setup", "bytes": "14579"}, {"name": "Java", "bytes": "12232679"}, {"name": "JavaScript", "bytes": "883279"}, {"name": "LLVM", "bytes": "42952"}, {"name": "Makefile", "bytes": "321639"}, {"name": "Objective-C", "bytes": "637659"}, {"name": "PHP", "bytes": "8438"}, {"name": "PLpgSQL", "bytes": "197622"}, {"name": "Perl", "bytes": "549860"}, {"name": "Protocol Buffer", "bytes": "121282"}, {"name": "Python", "bytes": "330201"}, {"name": "QMake", "bytes": "3622"}, {"name": "Ruby", "bytes": "8053"}, {"name": "SQLPL", "bytes": "60330"}, {"name": "Shell", "bytes": "1999068"}, {"name": "Tcl", "bytes": "2763"}, {"name": "XSLT", "bytes": "6100"}, {"name": "Yacc", "bytes": "1368077"}]}} +{"text": "\npackage com.alibaba.dubbo.common.serialize.support.java;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\n\nimport com.alibaba.dubbo.common.URL;\nimport com.alibaba.dubbo.common.serialize.ObjectInput;\nimport com.alibaba.dubbo.common.serialize.ObjectOutput;\nimport com.alibaba.dubbo.common.serialize.Serialization;\n\n/**\n * @author ding.lid\n */\npublic class CompactedJavaSerialization implements Serialization {\n\n public byte getContentTypeId() {\n return 4;\n }\n\n public String getContentType() {\n return \"x-application/compactedjava\";\n }\n\n public ObjectOutput serialize(URL url, OutputStream out) throws IOException {\n return new JavaObjectOutput(out, true);\n }\n\n public ObjectInput deserialize(URL url, InputStream is) throws IOException {\n return new JavaObjectInput(is, true);\n }\n\n}", "meta": {"content_hash": "51165a6abb524dd739da671e283beb68", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 81, "avg_line_length": 25.61764705882353, "alnum_prop": 0.7416762342135477, "repo_name": "kaven12/dubboo", "id": "f0a0f0a249f804c6984b2925e343fb0702f0600c", "size": "1480", "binary": false, "copies": "20", "ref": "refs/heads/master", "path": "dubbo-common/src/main/java/com/alibaba/dubbo/common/serialize/support/java/CompactedJavaSerialization.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "3343"}, {"name": "CSS", "bytes": "18582"}, {"name": "Java", "bytes": "5237817"}, {"name": "JavaScript", "bytes": "63151"}, {"name": "Lex", "bytes": "2077"}, {"name": "Shell", "bytes": "7011"}, {"name": "Thrift", "bytes": "668"}]}} +{"text": "package com.jxd.android.bookinventtory.bean;\n\nimport io.realm.RealmModel;\nimport io.realm.RealmObject;\nimport io.realm.annotations.RealmClass;\n\n/**\n * \u56fe\u4e66\u76d8\u70b9\n * Created by Administrator on 2017/10/17.\n */\n@RealmClass\npublic class ShelfBookScanBean implements RealmModel {\n\n private String title;\n private String barcode;\n private String shelfno;\n private String updatetime;\n private String uid;\n private String callno;\n private int inshelf;\n private String status;\n private String machine_mac;\n\n /**\n * \u76d8\u70b9\u72b6\u6001\n */\n private String scanStatus;\n\n public String getTitle() {\n return title;\n }\n\n public void setTitle(String title) {\n this.title = title;\n }\n\n public String getBarcode() {\n return barcode;\n }\n\n public void setBarcode(String barcode) {\n this.barcode = barcode;\n }\n\n public String getShelfno() {\n return shelfno;\n }\n\n public void setShelfno(String shelfno) {\n this.shelfno = shelfno;\n }\n\n public String getUpdatetime() {\n return updatetime;\n }\n\n public void setUpdatetime(String updatetime) {\n this.updatetime = updatetime;\n }\n\n public String getUid() {\n return uid;\n }\n\n public void setUid(String uid) {\n this.uid = uid;\n }\n\n public String getCallno() {\n return callno;\n }\n\n public void setCallno(String callno) {\n this.callno = callno;\n }\n\n public int getInshelf() {\n return inshelf;\n }\n\n public void setInshelf(int inshelf) {\n this.inshelf = inshelf;\n }\n\n public String getMachine_mac() {\n return machine_mac;\n }\n\n public void setMachine_mac(String machine_mac) {\n this.machine_mac = machine_mac;\n }\n\n public String getStatus() {\n return status;\n }\n\n public void setStatus(String status) {\n this.status = status;\n }\n\n public String getScanStatus() {\n return scanStatus;\n }\n\n public void setScanStatus(String scanStatus) {\n this.scanStatus = scanStatus;\n }\n\n public void transfor(BookBean bookBean){\n this.setBarcode( bookBean.getBarcode() );\n this.setCallno(bookBean.getCallno());\n this.setInshelf(bookBean.getInshelf());\n this.setMachine_mac(bookBean.getMachine_mac());\n this.setTitle(bookBean.getTitle());\n this.setUid(bookBean.getUid());\n this.setShelfno(bookBean.getShelfno());\n this.setStatus( bookBean.getStatus() );\n this.setUpdatetime(bookBean.getUpdatetime());\n }\n\n @Override\n public int hashCode() {\n return super.hashCode();\n }\n\n @Override\n public boolean equals(Object obj) {\n return super.equals(obj);\n }\n}\n", "meta": {"content_hash": "1cc8e2853ac762829180de45eeec8132", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 55, "avg_line_length": 21.0, "alnum_prop": 0.6201465201465202, "repo_name": "jxdong1013/bookinventory", "id": "577e0a27b8901851282783433ef072283019b34b", "size": "2746", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/android/bookinventory/app/src/main/java/com/jxd/android/bookinventtory/bean/ShelfBookScanBean.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ASP", "bytes": "98"}, {"name": "C#", "bytes": "199875"}, {"name": "CSS", "bytes": "21629"}, {"name": "HTML", "bytes": "6682"}, {"name": "Java", "bytes": "261073"}, {"name": "JavaScript", "bytes": "438316"}, {"name": "PowerShell", "bytes": "112665"}]}} +{"text": "\n\n#include \"../../inc/MarlinConfig.h\"\n\n#if HAS_M206_COMMAND\n\n#include \"../gcode.h\"\n#include \"../../module/motion.h\"\n#include \"../../lcd/marlinui.h\"\n#include \"../../libs/buzzer.h\"\n#include \"../../MarlinCore.h\"\n\nvoid M206_report() {\n SERIAL_ECHOLNPAIR_P(\n LIST_N(DOUBLE(LINEAR_AXES),\n PSTR(\"M206 X\"), home_offset.x,\n SP_Y_STR, home_offset.y,\n SP_Z_STR, home_offset.z,\n SP_I_STR, home_offset.i,\n SP_J_STR, home_offset.j,\n SP_K_STR, home_offset.k,\n )\n );\n}\n\n/**\n * M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y\n *\n * *** @thinkyhead: I recommend deprecating M206 for SCARA in favor of M665.\n * *** M206 for SCARA will remain enabled in 1.1.x for compatibility.\n * *** In the 2.0 release, it will simply be disabled by default.\n */\nvoid GcodeSuite::M206() {\n LOOP_LINEAR_AXES(i)\n if (parser.seen(AXIS_CHAR(i)))\n set_home_offset((AxisEnum)i, parser.value_linear_units());\n\n #if ENABLED(MORGAN_SCARA)\n if (parser.seen('T')) set_home_offset(A_AXIS, parser.value_float()); // Theta\n if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_float()); // Psi\n #endif\n\n if (!parser.seen(LINEAR_AXIS_GANG(\"X\", \"Y\", \"Z\", \"I\", \"J\", \"K\")))\n M206_report();\n else\n report_current_position();\n}\n\n/**\n * M428: Set home_offset based on the distance between the\n * current_position and the nearest \"reference point.\"\n * If an axis is past center its endstop position\n * is the reference-point. Otherwise it uses 0. This allows\n * the Z offset to be set near the bed when using a max endstop.\n *\n * M428 can't be used more than 2cm away from 0 or an endstop.\n *\n * Use M206 to set these values directly.\n */\nvoid GcodeSuite::M428() {\n if (homing_needed_error()) return;\n\n xyz_float_t diff;\n LOOP_LINEAR_AXES(i) {\n diff[i] = base_home_pos((AxisEnum)i) - current_position[i];\n if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0)\n diff[i] = -current_position[i];\n if (!WITHIN(diff[i], -20, 20)) {\n SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR);\n LCD_ALERTMESSAGEPGM_P(PSTR(\"Err: Too far!\"));\n BUZZ(200, 40);\n return;\n }\n }\n\n LOOP_LINEAR_AXES(i) set_home_offset((AxisEnum)i, diff[i]);\n report_current_position();\n LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED);\n BUZZ(100, 659);\n BUZZ(100, 698);\n}\n\n#endif // HAS_M206_COMMAND\n", "meta": {"content_hash": "d5f7b1a89aaf43eebda85cc3e0a7bc6e", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 82, "avg_line_length": 28.771084337349397, "alnum_prop": 0.6134840871021775, "repo_name": "limtbk/3dprinting", "id": "51f3e7c14c049e582236c468f1a1c40acf5e4c5a", "size": "3249", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Firmware/src/Marlin/src/gcode/geometry/M206_M428.cpp", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "16427042"}, {"name": "C++", "bytes": "1508812"}, {"name": "Makefile", "bytes": "58317"}, {"name": "Objective-C", "bytes": "195319"}, {"name": "Processing", "bytes": "407203"}, {"name": "Python", "bytes": "11892"}, {"name": "Scilab", "bytes": "10211"}]}} +{"text": "/*\n\n A helper function to diagram all routes in a `fluid.express` instance.\n\n */\n\n\"use strict\";\nvar fluid = fluid || require(\"infusion\");\n\nfluid.registerNamespace(\"fluid.test.express\");\n\n/**\n *\n * Diagram all routes within an express instance.\n *\n * @param {Object} expressComponent - A `fluid.express` component.\n * @return {Object} A JSON Object representing all routes within a `fluid.express` instance.\n *\n */\nfluid.test.express.diagramAllRoutes = function (expressComponent) {\n return fluid.test.express.diagramOneLevel(expressComponent, expressComponent.router._router);\n};\n\n/**\n *\n * Diagram the routes for a single component. To preserve the routing order of the stack, each level's children\n * are represented in a `children` Array.\n *\n * @param {Object} component - A `fluid.express.middleware` component.\n * @param {Object} router - The router instance within the component (if there is one).\n * @return {Object} A JSON Object representing the routes from this level down as well as the method and path for this level.\n */\nfluid.test.express.diagramOneLevel = function (component, router) {\n var thisLevel = fluid.filterKeys(component.options, [\"method\", \"path\"]);\n thisLevel.typeName = component.typeName;\n\n if (router) {\n thisLevel.children = fluid.transform(router.stack, function (layer) {\n // This is a `fluid.express.router` instance\n if (layer.handle && layer.handle.that) {\n return fluid.test.express.diagramOneLevel(layer.handle.that, layer.handle.that.router);\n }\n // This is a `fluid.express.middleware` instance\n else if (layer.route) {\n var wrapper = fluid.filterKeys(layer.route, [\"path\", \"methods\"]);\n wrapper.children = fluid.transform(layer.route.stack, function (middlewareLayer) {\n return fluid.test.express.diagramOneLevel(middlewareLayer.handle.that, middlewareLayer.handle.that.router);\n });\n return wrapper;\n }\n // This is something outside of our scope (i.e. native middleware).\n else {\n return \"Native middleware '\" + (layer.name || \"unknown\") + \"'\";\n }\n });\n }\n\n return thisLevel;\n};\n", "meta": {"content_hash": "1e7085b56a339027cd32730d523f680f", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 127, "avg_line_length": 38.389830508474574, "alnum_prop": 0.6512141280353201, "repo_name": "GPII/gpii-express", "id": "34a60008e12253be09206b56a5d1c3b76b4d7c29", "size": "2265", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "tests/js/lib/diagramAllRoutes.js", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "HTML", "bytes": "214"}, {"name": "JavaScript", "bytes": "208501"}]}} +{"text": "package com.lru.memory.disk.cache;\n\n/**\n *\n * @author sathayeg\n */\npublic interface DirLocate {\n public String getPathToFile(String key) throws Exception;\n public boolean isDiskPersistent();\n}\n", "meta": {"content_hash": "3f8be3bb0d892f5fdc57eeeaa392bc41", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 61, "avg_line_length": 20.0, "alnum_prop": 0.72, "repo_name": "gaurangsathaye/JavaSimpleCache", "id": "00f1f658cb5c38b6e518eccef7f979c9316fdd38", "size": "200", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/com/lru/memory/disk/cache/DirLocate.java", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "<!DOCTYPE html>\n<html>\n<head>\n\t<meta charset=\"UTF-8\" />\n<style> \n\n \n \n \n.button {\n background-color: #FA58F4; \n border: none;\n color: white;\n padding: 15px 32px;\n text-align: center;\n text-decoration: none;\n display: inline-block;\n font-size: 16px;\n margin: 4px 2px;\n cursor: pointer;\n}\n\n.button1 {background-color: #D315BC ;} \n.button2 {background-color: #EA4ED7 ;} \n.button3 {background-color: #D315BC ; color: black;} \n.button4 {background-color: #EA4ED7 ;} \n.button5{background-color: #D315BC ; color: black;} \n.button6{background-color: #EA4ED7 ;} \n.button7{background-color: #D315BC ;} \n.button8{background-color: #EA4ED7 ;}\n.button9{background-color: #D315BC ;}\n\n</style>\n\n<title>\u041a\u043b\u0430\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0458\u0430</title>\n\n</head>\n<body>\n\n<div id=\"fb-root\"></div>\n<script>(function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/mk_MK/sdk.js#xfbml=1&version=v2.9\";\n fjs.parentNode.insertBefore(js, fjs);\n}(document, 'script', 'facebook-jssdk'));</script>\n\n<div class=\"fenster\">\n\n <a href=\"./klasifikacija.html\"><img src=\"klasss Kopie.jpg\" height=\"500\" width=\"100%\" style=\"float:left\"></a> \n\n </div>\n \n \n\n\n\n<button class=\"button button1\"><a href=\"./pochetna.html\"><font color=\"black\">\u041f\u043e\u0447\u0435\u0442\u043d\u0430</font></a></button>\n<button class=\"button button2\"><a href=\"./zakancerot.html\"><font color=\"black\">\u0417\u0430 \u043a\u0430\u043d\u0446\u0435\u0440\u043e\u0442</font></a></button>\n<button class=\"button button3\"><a href=\"./stadiumi.html\"><font color=\"black\">\u0425\u0435\u043c\u043e\u0442\u0435\u0440\u0430\u043f\u0438\u0458\u0430</font></a></button>\n<button class=\"button button4\"><a href=\"./recepti.html\"><font color=\"black\">\u0420\u0435\u0446\u0435\u043f\u0442\u0438</font></a></button>\n<button class=\"button button5\"><a href=\"./dieti.html\"><font color=\"black\">\u0418\u0441\u0445\u0440\u0430\u043d\u0430</font></a></button>\n<button class=\"button button6\"><a href=\"./soveti.html\"><font color=\"black\">\u0421\u043e\u0432\u0435\u0442\u0438</font></a></button>\n<button class=\"button button7\"><a href=\"./bolnici.html\"><font color=\"black\"</font>\u0411\u043e\u043b\u043d\u0438\u0446\u0438</a></button>\n<button class=\"button button8\"><a href=\"./Donacii.html\"><font color=\"black\">\u0414\u043e\u043d\u0430\u0446\u0438\u0438</font></a></button>\n<button class=\"button button9\"><a href=\"./lekovi.html\"><font color=\"black\">\u041b\u0435\u043a\u043e\u0432\u0438</font></a></button>\n\n\n<p><i><font size=\"4\" color=\"black\"><b>\u0412\u0438\u0434\u043e\u0432\u0438\u0442\u0435 \u043d\u0430 \u0440\u0430\u043a \u0441\u0435 \u043a\u043b\u0430\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0430\u0430\u0442 \u0441\u043f\u043e\u0440\u0435\u0434 \u0432\u0438\u0434\u043e\u0442 \u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0438 \u043a\u043e\u0438 \u043d\u0430\u043b\u0438\u043a\u0443\u0432\u0430\u0430\u0442 \u043d\u0430 \u0442\u0443\u043c\u043e\u0440, \u0438 \u0441\u043f\u043e\u0440\u0435\u0434 \u0442\u043e\u0430, \n\t\u043d\u0430 \u0442\u043a\u0438\u0432\u043e\u0442\u043e \u0437\u0430 \u043a\u043e\u0435 \u0441\u0435 \u043f\u0440\u0435\u0442\u043f\u043e\u0441\u0442\u0430\u0432\u0443\u0432\u0430 \u0434\u0435\u043a\u0430 \u0435 \u0437\u0430\u0447\u0435\u0442\u043e\u043a \u043d\u0430 \u0442\u0443\u043c\u043e\u0440\u043e\u0442. \u041f\u043e\u0434\u043e\u043b\u0443 \u0435 \u0445\u0438\u0441\u0442\u043e\u043b\u043e\u0433\u0438\u0458\u0430\u0442\u0430 \u0438 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0431\u0430\u0442\u0430 \u043d\u0430 \u0432\u0438\u0434\u043e\u0432\u0438\u0442\u0435 \u0440\u0430\u043a. \u041f\u0440\u0438\u043c\u0435\u0440\u0438 \u0437\u0430 \u043d\u0435\u043a\u043e\u043b\u043a\u0443 \n\t\u043e\u043f\u0448\u0442\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0441\u0435: \u041a\u0430\u0440\u0446\u0438\u043d\u043e\u043c: \u041c\u0430\u043b\u0438\u0433\u043d\u0438 \u0442\u0443\u043c\u043e\u0440\u0438 \u043a\u043e\u0438 \u043f\u043e\u0442\u0435\u043a\u043d\u0443\u0432\u0430\u0430\u0442 \u043e\u0434 \u0435\u043f\u0438\u0442\u0435\u043b\u043d\u0438 \u043a\u043b\u0435\u0442\u043a\u0438. \u0412\u043e \u043e\u0432\u0430\u0430 \u0433\u0440\u0443\u043f\u0430 \u043f\u0440\u0438\u043f\u0430\u0453\u0430\u0430\u0442 \u043d\u0430\u0458\u0447\u0435\u0441\u0442\u0438\u0442\u0435 \u0432\u0438\u0434\u043e\u0432\u0438 \u043d\u0430 \u0440\u0430\u043a, \n\t\u0432\u043a\u043b\u0443\u0447\u0443\u0432\u0430\u0458\u045c\u0438 \u0433\u0438 \u0440\u0430\u043a\u043e\u0442 \u043d\u0430 \u0434\u043e\u0458\u043a\u0430\u0442\u0430, \u043f\u0440\u043e\u0441\u0442\u0430\u0442\u0430\u0442\u0430, \u0431\u0435\u043b\u0438\u0442\u0435 \u0434\u0440\u043e\u0431\u043e\u0432\u0438 \u0438 \u0434\u0435\u0431\u0435\u043b\u043e\u0442\u043e \u0446\u0440\u0435\u0432\u043e. \u0421\u0430\u0440\u043a\u043e\u043c: \u041c\u0430\u043b\u0438\u0433\u043d\u0438 \u0442\u0443\u043c\u043e\u0440\u0438 \u043a\u043e\u0438 \u043f\u043e\u0442\u0435\u043a\u043d\u0443\u0432\u0430\u0430\u0442 \u043e\u0434 \u0441\u0432\u0440\u0437\u043d\u0438\u0442\u0435 \u0442\u043a\u0438\u0432\u0430,\n\t \u0438\u043b\u0438 \u043c\u0435\u0437\u0435\u043d\u0445\u0438\u043c\u0430\u043b\u043d\u0438\u0442\u0435 \u043a\u043b\u0435\u0442\u043a\u0438. \u041b\u0438\u043c\u0444\u043e\u043c \u0438 \u043b\u0435\u0443\u043a\u0435\u043c\u0438\u0458\u0430: \u041c\u0430\u043b\u0438\u0433\u043d\u043e\u043c\u0438 \u043a\u043e\u0438 \u043f\u043e\u0442\u0435\u043a\u043d\u0443\u0432\u0430\u0430\u0442 \u043e\u0434 \u0445\u0435\u043c\u0430\u0442\u043e\u043f\u043e\u0435\u0442\u0441\u043a\u0438\u0442\u0435 (\u043a\u0440\u0432\u043e\u0442\u0432\u043e\u0440\u043d\u0438\u0442\u0435) \u043a\u043b\u0435\u0442\u043a\u0438 \u0411\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u043a\u0438 \u0440\u0430\u043a: \n\t \u0422\u0443\u043c\u043e\u0440\u0438 \u043a\u043e\u0438 \u043f\u043e\u0442\u0435\u043a\u043d\u0443\u0432\u0430\u0430\u0442 \u043e\u0434 \u0442\u043e\u0442\u0438\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u0438\u0442\u0435 \u043a\u043b\u0435\u0442\u043a\u0438. \u041a\u0430\u0458 \u0432\u043e\u0437\u0440\u0430\u0441\u043d\u0438\u0442\u0435 \u043d\u0430\u0458\u0447\u0435\u0441\u0442\u043e \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u043d\u0430\u0458\u0434\u0435 \u0432\u043e \u0442\u0435\u0441\u0442\u0438\u0441\u0438\u0442\u0435 \u0438 \u0458\u0430\u0458\u0447\u043d\u0438\u0446\u0438\u0442\u0435, \u0434\u043e\u0434\u0435\u043a\u0430 \u043a\u0430\u0458 \u0444\u0435\u0442\u0443\u0441\u0438\u0442\u0435, \n\t \u0431\u0435\u0431\u0438\u045a\u0430\u0442\u0430 \u0438 \u043c\u0430\u043b\u0438\u0442\u0435 \u0434\u0435\u0446\u0430 \u043d\u0430\u0458\u0447\u0435\u0441\u0442\u043e \u0441\u0435 \u043d\u0430\u043e\u0453\u0430\u0430\u0442 \u0432\u043e \u0441\u0440\u0435\u0434\u0438\u0448\u043d\u0438\u043e\u0442 \u0434\u0435\u043b \u043d\u0430 \u0442\u0435\u043b\u043e\u0442\u043e, \u043d\u0430 \u0432\u0440\u0432\u043e\u0442 \u043d\u0430 \u043e\u043f\u0430\u0448\u043d\u0430\u0442\u0430 \u043a\u043e\u0441\u043a\u0430, \u0430 \u043a\u0430\u0458 \u043a\u043e\u045a\u0438\u0442\u0435 \u0432\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u0442\u0430 \u043d\u0430 \u0447\u0435\u0440\u0435\u043f\u043e\u0442. \n\t \u0411\u043b\u0430\u0441\u0442\u0435\u043d \u0442\u0443\u043c\u043e\u0440 \u0438\u043b\u0438 \u0431\u043b\u0430\u0441\u0442\u043e\u043c: \u0422\u0443\u043c\u043e\u0440 (\u043e\u0431\u0438\u0447\u043d\u043e \u043c\u0430\u043b\u0438\u0433\u043d\u0435\u043d) \u043a\u043e\u0458 \u043d\u0430\u043b\u0438\u043a\u0443\u0432\u0430 \u043d\u0430 \u043d\u0435\u0437\u0440\u0435\u043b\u043e \u0438\u043b\u0438 \u0435\u043c\u0431\u0440\u0438\u043e\u043d\u0441\u043a\u043e \u0442\u043a\u0438\u0432\u043e. \u041e\u0432\u0438\u0435 \u0442\u0443\u043c\u043e\u0440\u0438 \u0441\u0435 \u043d\u0430\u0458\u0447\u0435\u0441\u0442\u0438 \u043a\u0430\u0458 \u0434\u0435\u0446\u0430\u0442\u0430. \n \u0442\u0443\u043c\u043e\u0440\u0438 (\u0432\u0438\u0434\u043e\u0432\u0438 \u0440\u0430\u043a) \u043e\u0431\u0438\u0447\u043d\u043e \u0441\u0435 \u0438\u043c\u0435\u043d\u0443\u0432\u0430\u0430\u0442 \u043a\u043e\u0440\u0438\u0441\u0442\u0435\u0458\u045c\u0438 \u2013\u043a\u0430\u0440\u0446\u0438\u043d\u043e\u043c, -\u0441\u0430\u0440\u043a\u043e\u043c \u0438\u043b\u0438 \u2013\u0431\u043b\u0430\u0441\u0442\u043e\u043c \u043a\u0430\u043a\u043e \u0441\u0443\u0444\u0438\u043a\u0441, \u0438 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u0438\u043e\u0442 \u0438\u043b\u0438 \u0433\u0440\u0447\u043a\u0438\u043e\u0442 \u0437\u0431\u043e\u0440 \u0437\u0430 \u043e\u0440\u0433\u0430\u043d\u043e\u0442\n \u043e\u0434 \u043a\u043e\u0458 \u043f\u043e\u0442\u0435\u043a\u043d\u0443\u0432\u0430\u0430\u0442 \u043a\u0430\u043a\u043e \u043a\u043e\u0440\u0435\u043d \u043d\u0430 \u0438\u043c\u0435\u0442\u043e. \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u043a\u043e\u0442 \u043d\u0430 \u0446\u0440\u043d\u0438\u043e\u0442 \u0434\u0440\u043e\u0431 \u0441\u0435 \u043d\u0430\u0440\u0435\u043a\u0443\u0432\u0430 \u0445\u0435\u043f\u0430\u0442\u043e\u043a\u0430\u0440\u0446\u0438\u043d\u043e\u043c, \u0440\u0430\u043a\u043e\u0442 \u043d\u0430 \u043c\u0430\u0441\u043d\u0438\u0442\u0435 \u043a\u043b\u0435\u0442\u043a\u0438- \u043b\u0438\u043f\u043e\u0441\u0430\u0440\u043a\u043e\u043c\n \u0438\u0442\u043d. \u0411\u0435\u043d\u0438\u0433\u043d\u0438\u0442\u0435 \u0442\u0443\u043c\u043e\u0440\u0438 (\u043a\u043e\u0438 \u043d\u0435 \u0441\u0435 \u0440\u0430\u043a) \u0441\u0435 \u0438\u043c\u0435\u043d\u0443\u0432\u0430\u0430\u0442 \u043a\u043e\u0440\u0438\u0441\u0442\u0435\u0458\u045c\u0438 \u2013\u043e\u043c \u043a\u0430\u043a\u043e \u0441\u0443\u0444\u0438\u043a\u0441, \u0438 \u0438\u043c\u0435\u0442\u043e \u043d\u0430 \u043e\u0440\u0433\u0430\u043d\u043e\u0442 \u043a\u0430\u043a\u043e \u043a\u043e\u0440\u0435\u043d. \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u0435\u043d\u0438\u0433\u043d\u0435\u043d \u0442\u0443\u043c\u043e\u0440 \n \u043d\u0430 \u043c\u0430\u0437\u043d\u0430\u0442\u0430 \u043c\u0443\u0441\u043a\u0443\u043b\u0430\u0442\u0443\u0440\u0430 \u043d\u0430 \u043c\u0430\u0442\u043a\u0430\u0442\u0430 \u0441\u0435 \u043d\u0430\u0440\u0435\u043a\u0443\u0432\u0430 \u043b\u0435\u0438\u043e\u043c\u0438\u043e\u043c (\u043f\u043e\u0447\u0435\u0441\u0442 \u0438\u0437\u0440\u0430\u0437 \u0437\u0430 \u043e\u0432\u043e\u0458 \u0432\u0438\u0434 \u0442\u0443\u043c\u043e\u0440 \u0435 \u0444\u0438\u0431\u0440\u043e\u0438\u0434). \u0417\u0430 \u0436\u0430\u043b, \n\t\u0438 \u043d\u0435\u043a\u043e\u0438 \u0432\u0438\u0434\u043e\u0432\u0438 \u0440\u0430\u043a \u0433\u043e \u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442 \u0441\u0443\u0444\u0438\u043a\u0441\u043e\u0442 \u2013\u043e\u043c, \u043a\u0430\u043a\u043e \u0448\u0442\u043e \u0435 \u0441\u043b\u0443\u0447\u0430\u0458\u043e\u0442 \u0441\u043e \u043c\u0435\u043b\u0430\u043d\u043e\u043c \u0438 \u0441\u0435\u043c\u0438\u043d\u043e\u043c\n\t\t</font></i></p></b>\n\n<iframe width=\"70%\" height=\"500\" src=\"https://www.youtube.com/embed/72-2Bumwyh0\" frameborder=\"0\" allowfullscreen></iframe>\n\t \n\n<div class=\"fb-comments\" data-href=\"http://127.0.0.1:8020/borbaprotivkancerot/klasifikacija.html\" data-numposts=\"5\"></div>\n\n\n</body>\n</html>", "meta": {"content_hash": "5fe8f5d153cd27a362025ba442a3f87d", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 140, "avg_line_length": 45.84782608695652, "alnum_prop": 0.7159791370317686, "repo_name": "majaradichevich/majaradichevich.github.io", "id": "7ed025a1c9e8db3faad7a92693291f6f197a9621", "size": "5642", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "klasifikacija.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "6042"}, {"name": "HTML", "bytes": "185244"}, {"name": "JavaScript", "bytes": "11231"}]}} +{"text": "<h2>Installing XFramework Generator</h2>\n\n<p>You don't need to download the source code from the repo, create all the necessary files for the web app, writing two thousands line of code just to create a <code>Hello world!</code> app. XFramework Generator can make everything for you.</p>\n\n<p>XF Generator has a number of dependencies such as:</p>\n\n<ul>\n<li><a href=\"http://nodejs.org\">node.js</a></li>\n<li><a href=\"https://npmjs.org\">NPM</a></li>\n<li><a href=\"http://yeoman.io\">Yeoman</a></li>\n</ul>\n\n<p>To install first two of them on Mac OS X or Windows computers you just need to download a package from <a href=\"http://nodejs.org/download/\">nodejs.org/download/</a>. For other platforms see the <a href=\"https://npmjs.org/doc/README.html\">readme</a>.</p>\n\n<p>After installing node.js and npm go to terminal and install Yeoman writing <code>npm install -g yo</code> (with <code>sudo</code> if necessary).</p>\n\n<p>Almost there! After these steps you need to install XF Generator with <code>npm install -g generator-xf</code>.</p>", "meta": {"content_hash": "7ec5a698f2b1bcd09b1e097b90fbd031", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 257, "avg_line_length": 60.705882352941174, "alnum_prop": 0.7199612403100775, "repo_name": "epam/xframework", "id": "4127893e601400216714eb907402287b68e38251", "size": "1032", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/data/installing_xframework_generator.html", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "275950"}, {"name": "JavaScript", "bytes": "730289"}]}} +{"text": "namespace Azure.ResourceManager.EdgeOrder.Models\n{\n /// <summary> Represents subscription registered features. </summary>\n public partial class CustomerSubscriptionRegisteredFeatures\n {\n /// <summary> Initializes a new instance of CustomerSubscriptionRegisteredFeatures. </summary>\n public CustomerSubscriptionRegisteredFeatures()\n {\n }\n\n /// <summary> Name of subscription registered feature. </summary>\n public string Name { get; set; }\n /// <summary> State of subscription registered feature. </summary>\n public string State { get; set; }\n }\n}\n", "meta": {"content_hash": "ac471d3f33987dd6c7e35e349847293a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 102, "avg_line_length": 38.4375, "alnum_prop": 0.6813008130081301, "repo_name": "Azure/azure-sdk-for-net", "id": "1888fb1a8203597c021c5a97aa4c2106984a672a", "size": "753", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/CustomerSubscriptionRegisteredFeatures.cs", "mode": "33188", "license": "mit", "language": []}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc (1.8.0_151) on Sat Mar 16 04:11:58 MST 2019 -->\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>Uses of Interface org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer (BOM: * : All 2.3.1.Final-SNAPSHOT API)</title>\n<meta name=\"date\" content=\"2019-03-16\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../../../../../stylesheet.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"../../../../../../../../script.js\"></script>\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n try {\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"Uses of Interface org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer (BOM: * : All 2.3.1.Final-SNAPSHOT API)\";\n }\n }\n catch(err) {\n }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar.top\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.top.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"../package-summary.html\">Package</a></li>\n<li><a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">Class</a></li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../../../../../../../../overview-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../../../../help-doc.html\">Help</a></li>\n</ul>\n<div class=\"aboutLanguage\">Thorntail API, 2.3.1.Final-SNAPSHOT</div>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/server/class-use/BindingsDirectoryPathConsumer.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"BindingsDirectoryPathConsumer.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip.navbar.top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h2 title=\"Uses of Interface org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer\" class=\"title\">Uses of Interface<br>org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer</h2>\n</div>\n<div class=\"classUseContainer\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use table, listing packages, and an explanation\">\n<caption><span>Packages that use <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a></span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Package</th>\n<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a href=\"#org.wildfly.swarm.config.messaging.activemq\">org.wildfly.swarm.config.messaging.activemq</a></td>\n<td class=\"colLast\"> </td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a href=\"#org.wildfly.swarm.config.messaging.activemq.server\">org.wildfly.swarm.config.messaging.activemq.server</a></td>\n<td class=\"colLast\"> </td>\n</tr>\n</tbody>\n</table>\n</li>\n<li class=\"blockList\">\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"org.wildfly.swarm.config.messaging.activemq\">\n<!-- -->\n</a>\n<h3>Uses of <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a> in <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html\">org.wildfly.swarm.config.messaging.activemq</a></h3>\n<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use table, listing methods, and an explanation\">\n<caption><span>Methods in <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html\">org.wildfly.swarm.config.messaging.activemq</a> with parameters of type <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a></span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code><a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/Server.html\" title=\"type parameter in Server\">T</a></code></td>\n<td class=\"colLast\"><span class=\"typeNameLabel\">Server.</span><code><span class=\"memberNameLink\"><a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/Server.html#bindingsDirectoryPath-org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer-\">bindingsDirectoryPath</a></span>(<a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a> consumer)</code>\n<div class=\"block\">A filesystem path pointing to one of the locations where ActiveMQ stores\n persistent data.</div>\n</td>\n</tr>\n</tbody>\n</table>\n</li>\n<li class=\"blockList\"><a name=\"org.wildfly.swarm.config.messaging.activemq.server\">\n<!-- -->\n</a>\n<h3>Uses of <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a> in <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/package-summary.html\">org.wildfly.swarm.config.messaging.activemq.server</a></h3>\n<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use table, listing methods, and an explanation\">\n<caption><span>Methods in <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/package-summary.html\">org.wildfly.swarm.config.messaging.activemq.server</a> that return <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a></span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>default <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a><<a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"type parameter in BindingsDirectoryPathConsumer\">T</a>></code></td>\n<td class=\"colLast\"><span class=\"typeNameLabel\">BindingsDirectoryPathConsumer.</span><code><span class=\"memberNameLink\"><a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html#andThen-org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer-\">andThen</a></span>(<a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a><<a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"type parameter in BindingsDirectoryPathConsumer\">T</a>> after)</code> </td>\n</tr>\n</tbody>\n</table>\n<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use table, listing methods, and an explanation\">\n<caption><span>Methods in <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/package-summary.html\">org.wildfly.swarm.config.messaging.activemq.server</a> with parameters of type <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a></span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>default <a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a><<a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"type parameter in BindingsDirectoryPathConsumer\">T</a>></code></td>\n<td class=\"colLast\"><span class=\"typeNameLabel\">BindingsDirectoryPathConsumer.</span><code><span class=\"memberNameLink\"><a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html#andThen-org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer-\">andThen</a></span>(<a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">BindingsDirectoryPathConsumer</a><<a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"type parameter in BindingsDirectoryPathConsumer\">T</a>> after)</code> </td>\n</tr>\n</tbody>\n</table>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar.bottom\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.bottom.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"../package-summary.html\">Package</a></li>\n<li><a href=\"../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html\" title=\"interface in org.wildfly.swarm.config.messaging.activemq.server\">Class</a></li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../../../../../../../../overview-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../../../../help-doc.html\">Help</a></li>\n</ul>\n<div class=\"aboutLanguage\">Thorntail API, 2.3.1.Final-SNAPSHOT</div>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/server/class-use/BindingsDirectoryPathConsumer.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"BindingsDirectoryPathConsumer.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip.navbar.bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n<p class=\"legalCopy\"><small>Copyright © 2019 <a href=\"http://www.jboss.org\">JBoss by Red Hat</a>. All rights reserved.</small></p>\n</body>\n</html>\n", "meta": {"content_hash": "9d4a959a17bfed5d67d358e525d7f8e4", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 793, "avg_line_length": 64.10194174757281, "alnum_prop": 0.6843619840969329, "repo_name": "wildfly-swarm/wildfly-swarm-javadocs", "id": "1e14ac35a7c49488433c20a72a70ed6f7111d9be", "size": "13205", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "2.3.1.Final-SNAPSHOT/apidocs/org/wildfly/swarm/config/messaging/activemq/server/class-use/BindingsDirectoryPathConsumer.html", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\n\nimport ReactSharedInternals from 'shared/ReactSharedInternals';\nimport type {Transition} from './ReactFiberTracingMarkerComponent.new';\n\nconst {ReactCurrentBatchConfig} = ReactSharedInternals;\n\nexport const NoTransition = null;\n\nexport function requestCurrentTransition(): Transition | null {\n return ReactCurrentBatchConfig.transition;\n}\n", "meta": {"content_hash": "dace65b4e7262d44f7cf8c5ddcea517a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 71, "avg_line_length": 28.5, "alnum_prop": 0.8216374269005848, "repo_name": "camsong/react", "id": "d63b99a1862ef22435389d30a9298476688a7c25", "size": "542", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "packages/react-reconciler/src/ReactFiberTransition.js", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "5225"}, {"name": "C++", "bytes": "44278"}, {"name": "CSS", "bytes": "64729"}, {"name": "CoffeeScript", "bytes": "16826"}, {"name": "HTML", "bytes": "119964"}, {"name": "JavaScript", "bytes": "6161428"}, {"name": "Makefile", "bytes": "189"}, {"name": "Python", "bytes": "259"}, {"name": "Shell", "bytes": "2306"}, {"name": "TypeScript", "bytes": "20868"}]}} +{"text": "\n\n/*!\n * Copyright (c) 2019 by Contributors\n * \\file moments-inl.h\n * \\brief Moments operator\n * \\author Hao Jin\n*/\n\n#ifndef MXNET_OPERATOR_NN_MOMENTS_INL_H_\n#define MXNET_OPERATOR_NN_MOMENTS_INL_H_\n\n#include <vector>\n#include \"../tensor/broadcast_reduce_op.h\"\n\nnamespace mxnet {\nnamespace op {\n\nstruct MomentsParam : public dmlc::Parameter<MomentsParam> {\n dmlc::optional<mxnet::TShape> axes;\n bool keepdims;\n DMLC_DECLARE_PARAMETER(MomentsParam) {\n DMLC_DECLARE_FIELD(axes).set_default(dmlc::optional<mxnet::TShape>())\n .describe(\"Array of ints. Axes along which to compute mean and variance.\");\n DMLC_DECLARE_FIELD(keepdims).set_default(false)\n .describe(\"produce moments with the same dimensionality as the input.\");\n }\n};\n\ninline bool MomentsShape(const nnvm::NodeAttrs& attrs,\n mxnet::ShapeVector* in_attrs,\n mxnet::ShapeVector* out_attrs) {\n const MomentsParam& param = nnvm::get<MomentsParam>(attrs.parsed);\n CHECK_EQ(in_attrs->size(), 1U);\n CHECK_EQ(out_attrs->size(), 2U);\n\n mxnet::TShape out_shape =\n ReduceAxesShapeImpl((*in_attrs)[0], param.axes, param.keepdims, false);\n if (!param.axes.has_value() || param.axes.value().ndim() == 0) {\n LOG(FATAL) << \"Empty axes is not supported, if you would like to do global moments, \"\n << \"please pass all axes to axes argument\";\n }\n SHAPE_ASSIGN_CHECK(*out_attrs, 0, out_shape);\n SHAPE_ASSIGN_CHECK(*out_attrs, 1, out_shape);\n return true;\n}\n\ninline bool MomentsType(const nnvm::NodeAttrs& attrs,\n std::vector<int>* in_attrs,\n std::vector<int>* out_attrs) {\n CHECK_EQ(in_attrs->size(), 1U);\n CHECK_EQ(out_attrs->size(), 2U);\n\n TYPE_ASSIGN_CHECK(*out_attrs, 0, in_attrs->at(0));\n TYPE_ASSIGN_CHECK(*out_attrs, 1, in_attrs->at(0));\n TYPE_ASSIGN_CHECK(*in_attrs, 0, out_attrs->at(0));\n TYPE_ASSIGN_CHECK(*in_attrs, 0, out_attrs->at(1));\n return out_attrs->at(0) != -1 && out_attrs->at(1) != -1;\n}\n\nstruct VarBroadcastKernel {\n template<typename DType>\n MSHADOW_XINLINE static void Map(int i,\n DType *out,\n const DType *data,\n const DType *mean,\n mshadow::Shape<6> data_shape,\n mshadow::Shape<6> mean_shape) {\n size_t data_idx = i;\n size_t mean_idx = i;\n size_t data_stride = 1;\n size_t mean_stride = 1;\n for (int axis = 5; axis >= 0; --axis) {\n size_t axis_idx = data_idx % data_shape[axis];\n mean_idx -= axis_idx * data_stride;\n if (mean_shape[axis] != 1) {\n mean_idx += axis_idx * mean_stride;\n }\n data_idx /= data_shape[axis];\n data_stride *= data_shape[axis];\n mean_stride *= mean_shape[axis];\n }\n DType res = (data[i] - mean[mean_idx]);\n out[i] = res * res;\n }\n};\n\ntemplate<typename xpu>\ninline void MomentsForwardImpl(const OpContext& ctx,\n const std::vector<TBlob>& inputs,\n const std::vector<OpReqType>& req,\n const std::vector<TBlob>& outputs,\n const dmlc::optional<mxnet::TShape>& axes,\n const bool keepdims) {\n using namespace mshadow;\n using namespace mshadow_op;\n using namespace mxnet_op;\n\n Stream<xpu> *s = ctx.get_stream<xpu>();\n\n const TBlob& data = inputs[0];\n const TBlob& mean = outputs[0];\n const TBlob& var = outputs[1];\n\n mxnet::TShape small;\n if (keepdims) {\n small = outputs[0].shape_;\n } else {\n small = ReduceAxesShapeImpl(inputs[0].shape_, axes, true, false);\n }\n\n ReduceAxesComputeImpl<xpu, mshadow_op::sum, true, true>(ctx, {data}, {req[0]}, {mean}, small);\n MSHADOW_TYPE_SWITCH(data.type_flag_, DType, {\n Shape<6> data_shape, mean_shape;\n for (int i = 0; i < 6; ++i) {\n data_shape[i] = (i < data.shape_.ndim()) ? data.shape_[i] : 1;\n mean_shape[i] = (i < small.ndim()) ? small[i] : 1;\n }\n Tensor<xpu, 1, DType> temp_data =\n ctx.requested[0].get_space_typed<xpu, 1, DType>(Shape1(data.shape_.Size()), s);;\n Kernel<VarBroadcastKernel, xpu>::Launch(s, data.shape_.Size(), temp_data.dptr_,\n data.dptr<DType>(), mean.dptr<DType>(), data_shape, mean_shape);\n ReduceAxesComputeImpl<xpu, mshadow_op::sum, true, true>(\n ctx, {TBlob(temp_data).reshape(data.shape_)}, {kWriteTo}, {var}, small);\n });\n}\n\ntemplate<typename xpu>\ninline void MomentsForward(const nnvm::NodeAttrs& attrs,\n const OpContext& ctx,\n const std::vector<TBlob>& inputs,\n const std::vector<OpReqType>& req,\n const std::vector<TBlob>& outputs) {\n using namespace mshadow;\n using namespace mshadow_op;\n using namespace mxnet_op;\n\n CHECK_EQ(inputs.size(), 1U);\n CHECK_EQ(outputs.size(), 2U);\n\n const MomentsParam& param = nnvm::get<MomentsParam>(attrs.parsed);\n\n MomentsForwardImpl<xpu>(ctx, inputs, req, outputs, param.axes, param.keepdims);\n}\n\ntemplate<int req>\nstruct VarBackwardKernel {\n template<typename DType>\n MSHADOW_XINLINE static void Map(int i,\n DType *igrad,\n const DType *ograd,\n const DType *data,\n const DType *mean,\n mshadow::Shape<6> data_shape,\n mshadow::Shape<6> mean_shape,\n const float N,\n const float ddof = 0.0f) {\n size_t data_idx = i;\n size_t mean_idx = i;\n size_t data_stride = 1;\n size_t mean_stride = 1;\n for (int axis = 5; axis >= 0; --axis) {\n size_t axis_idx = data_idx % data_shape[axis];\n mean_idx -= axis_idx * data_stride;\n if (mean_shape[axis] != 1) {\n mean_idx += axis_idx * mean_stride;\n }\n data_idx /= data_shape[axis];\n data_stride *= data_shape[axis];\n mean_stride *= mean_shape[axis];\n }\n KERNEL_ASSIGN(igrad[i], req, ograd[mean_idx] * (data[i] - mean[mean_idx]) * 2 / (N - ddof));\n }\n};\n\ntemplate<typename xpu>\ninline void MomentsBackwardImpl(const nnvm::NodeAttrs& attrs,\n const OpContext& ctx,\n const std::vector<TBlob>& inputs,\n const std::vector<OpReqType>& req,\n const std::vector<TBlob>& outputs,\n const dmlc::optional<mxnet::TShape>& axes) {\n using namespace mshadow;\n using namespace mshadow::expr;\n using namespace mshadow_op;\n using namespace mxnet_op;\n\n Stream<xpu> *s = ctx.get_stream<xpu>();\n\n const TBlob& mean_grad = inputs[0];\n const TBlob& var_grad = inputs[1];\n const TBlob& data = inputs[2];\n const TBlob& mean = inputs[3];\n const TBlob& var = inputs[4];\n const TBlob& data_grad = outputs[0];\n\n mxnet::TShape small = ReduceAxesShapeImpl(data.shape_, axes, true, false);\n BroadcastComputeImpl<xpu>(attrs, ctx, {mean_grad}, req, outputs, small);\n MSHADOW_TYPE_SWITCH(outputs[0].type_flag_, DType, {\n Tensor<xpu, 1, DType> igrad = outputs[0].FlatTo1D<xpu, DType>(s);\n igrad /= scalar<DType>(outputs[0].Size()/inputs[0].Size());\n });\n\n Shape<6> data_shape, var_shape;\n float N = data_grad.Size() / var.Size();\n for (int i = 0; i < 6; ++i) {\n data_shape[i] = (i < data.shape_.ndim()) ? data.shape_[i] : 1;\n var_shape[i] = (i < small.ndim()) ? small[i] : 1;\n }\n MSHADOW_TYPE_SWITCH(data_grad.type_flag_, DType, {\n Kernel<VarBackwardKernel<kAddTo>, xpu>::Launch(\n s, data_grad.shape_.Size(), data_grad.dptr<DType>(), var_grad.dptr<DType>(),\n data.dptr<DType>(), mean.dptr<DType>(), data_shape, var_shape, N);\n });\n}\n\ntemplate<typename xpu>\ninline void MomentsBackward(const nnvm::NodeAttrs& attrs,\n const OpContext& ctx,\n const std::vector<TBlob>& inputs,\n const std::vector<OpReqType>& req,\n const std::vector<TBlob>& outputs) {\n using namespace mshadow;\n using namespace mshadow_op;\n using namespace mxnet_op;\n\n CHECK_EQ(inputs.size(), 5U);\n CHECK_EQ(outputs.size(), 1U);\n\n const MomentsParam& param = nnvm::get<MomentsParam>(attrs.parsed);\n\n MomentsBackwardImpl<xpu>(attrs, ctx, inputs, req, outputs, param.axes);\n}\n\n} // namespace op\n} // namespace mxnet\n#endif // MXNET_OPERATOR_NN_MOMENTS_INL_H_\n", "meta": {"content_hash": "1379c25c73b10bf4cbf94d1e3e5177af", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 96, "avg_line_length": 36.08438818565401, "alnum_prop": 0.5748362956033677, "repo_name": "reminisce/mxnet", "id": "6a9bdc54b9059e922e80bdd01e6bde06bf84326b", "size": "9359", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "src/operator/nn/moments-inl.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ANTLR", "bytes": "1731"}, {"name": "Batchfile", "bytes": "13130"}, {"name": "C", "bytes": "215572"}, {"name": "C++", "bytes": "7680259"}, {"name": "CMake", "bytes": "99958"}, {"name": "Clojure", "bytes": "622688"}, {"name": "Cuda", "bytes": "970884"}, {"name": "Dockerfile", "bytes": "85151"}, {"name": "Groovy", "bytes": "122800"}, {"name": "HTML", "bytes": "40277"}, {"name": "Java", "bytes": "205196"}, {"name": "Julia", "bytes": "436326"}, {"name": "Jupyter Notebook", "bytes": "3660387"}, {"name": "MATLAB", "bytes": "34903"}, {"name": "Makefile", "bytes": "201597"}, {"name": "Perl", "bytes": "1550163"}, {"name": "Perl 6", "bytes": "7280"}, {"name": "PowerShell", "bytes": "13786"}, {"name": "Python", "bytes": "7842403"}, {"name": "R", "bytes": "357807"}, {"name": "Scala", "bytes": "1305036"}, {"name": "Shell", "bytes": "427407"}, {"name": "Smalltalk", "bytes": "3497"}]}} +{"text": "class DeviceSettingListener < AsakusaSatellite::Hook::Listener\n render_on :account_setting_item, :partial => \"device_setting\"\nend\n\n", "meta": {"content_hash": "46ad3aa3b2c9fc525d06733f4de789d0", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 63, "avg_line_length": 33.0, "alnum_prop": 0.7803030303030303, "repo_name": "mallowlabs/AsakusaSatellite", "id": "fc863576a1861c4131cf2c1c604d62a735622fb0", "size": "132", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "plugins/as_device_setting/lib/device_setting_listener.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "4295"}, {"name": "JavaScript", "bytes": "70132"}, {"name": "Ruby", "bytes": "176805"}, {"name": "Shell", "bytes": "1621"}]}} +{"text": "require_relative '../../spec_helper'\n\nVALID_UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i\nUUID_STRING1 = 'de305d54-75b4-431b-adb2-eb6b9e546014'\nUUID_STRING2 = 'de305d54-75b4-431b-adb2-eb6b9e546020'\nUUID_PACKED_STRING1 = \"\\xde\\x30\\x5d\\x54\\x75\\xb4\\x43\\x1b\\xad\\xb2\\xeb\\x6b\\x9e\\x54\\x60\\x14\"\nUUID_PACKED_STRING2 = \"\\xde\\x30\\x5d\\x54\\x75\\xb4\\x43\\x1b\\xad\\xb2\\xeb\\x6b\\x9e\\x54\\x60\\x20\"\n\nRSpec.describe Lobster::Uuid do\n\n describe '::DEFAULT' do\n subject { Lobster::Uuid::DEFAULT }\n\n it 'is all zeroes' do\n expect(subject).to eq(\"\\x0\" * 16)\n end\n\n it 'is frozen' do\n is_expected.to be_frozen\n end\n end\n \n describe '#new' do\n context 'with a valid value' do\n subject(:uuid) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n\n describe 'the value' do\n subject { uuid.value }\n\n it 'is stored' do\n is_expected.to eq UUID_PACKED_STRING1\n end\n end\n end\n\n context 'with an invalid value' do\n it 'rejects a malformed string' do\n expect { Lobster::Uuid.new('foobar') }.to raise_error(ArgumentError)\n end\n end\n\n end\n\n context '.generate' do\n subject(:uuid) { Lobster::Uuid.generate }\n\n describe 'the value' do\n subject { uuid.value }\n\n # The chances of a randomly generated empty UUID is virtually impossible.\n # Besides, the UUID standards don't allow generated UUID to be all zeroes.\n it 'is random' do\n is_expected.not_to eq(\"\\x0\" * 16)\n end\n end\n\n describe 'the string' do\n subject { uuid.to_s }\n\n it 'is valid' do\n is_expected.to match VALID_UUID_REGEX\n end\n end\n end\n\n describe '.parse' do\n\n context 'with a valid UUID' do\n subject { Lobster::Uuid.parse(UUID_STRING1) }\n\n it 'parses correctly' do\n expect(subject.to_s).to eq(UUID_STRING1)\n end\n end\n\n context 'with a malformed string' do\n it 'returns nil' do\n expect(Lobster::Uuid.parse('foobar')).to be_nil\n end\n end\n\n context 'with an invalid argument' do\n it 'rejects a non-string' do\n expect { Lobster::Uuid.parse(5) }.to raise_error(ArgumentError)\n end\n end\n end\n\n describe '#value' do\n subject(:uuid) { Lobster::Uuid.new(UUID_PACKED_STRING1).value }\n\n it 'is a string' do\n is_expected.to be_a(String)\n end\n\n it 'is frozen' do\n is_expected.to be_frozen\n end\n\n describe '.length' do\n subject { uuid.length }\n\n it 'is 16 bytes' do\n is_expected.to be 16\n end\n end\n end\n\n describe '#eql?' do\n subject(:uuid) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n subject { uuid.eql?(other) }\n\n context 'with two identical UUIDs' do\n let(:other) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n\n it 'returns true' do\n is_expected.to eq true\n end\n end\n\n context 'with two different UUIDs' do\n let(:other) { Lobster::Uuid.new(UUID_PACKED_STRING2) }\n\n it 'returns false' do\n is_expected.to eq false\n end\n end\n\n context 'without a UUID' do\n let(:other) { 'foobar' }\n\n it 'returns false' do\n is_expected.to eq false\n end\n end\n end\n\n describe '#==' do\n subject { first == second }\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n\n context 'with equal UUIDs' do\n let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n it 'is true' do\n is_expected.to be true\n end\n end\n\n context 'with the same instance' do\n let(:second) { first }\n it 'is true' do\n is_expected.to be true\n end\n end\n\n context 'with unequal UUIDs' do\n let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING2) }\n it 'is false' do\n is_expected.to be false\n end\n end\n\n context 'with nil' do\n let(:second) { nil }\n it 'is false' do\n is_expected.to be false\n end\n end\n\n context 'with a malformed string' do\n let(:second) { 'foobar' }\n it 'is false' do\n is_expected.to be false\n end\n end\n\n context 'with a non-string' do\n let(:second) { 5 }\n it 'is false' do\n is_expected.to be false\n end\n end\n\n context 'with identical value' do\n let(:second) { first.value }\n it 'is true' do\n is_expected.to be true\n end\n end\n\n context 'with identical string' do\n let(:second) { first.to_s }\n it 'is true' do\n is_expected.to be true\n end\n end\n end\n\n describe '#<=>' do\n subject { first <=> second }\n\n context 'with an equal UUID' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n it 'is 0' do\n is_expected.to eq 0\n end\n end\n\n context 'with the same instance' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n let(:second) { first }\n it 'is 0' do\n is_expected.to eq 0\n end\n end\n\n context 'with a lesser UUID' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING2) }\n let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n it 'is 1' do\n is_expected.to eq 1\n end\n end\n\n context 'with a greater UUID' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING2) }\n it 'is -1' do\n is_expected.to eq(-1)\n end\n end\n\n context 'with nil' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n let(:second) { nil }\n it 'is nil' do\n is_expected.to be_nil\n end\n end\n\n context 'with a number' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n let(:second) { 500 }\n it 'is nil' do\n is_expected.to be_nil\n end\n end\n\n context 'with an identical value' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n let(:second) { UUID_PACKED_STRING1 }\n it 'is 0' do\n is_expected.to eq 0\n end\n end\n\n context 'with a lesser value' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING2) }\n let(:second) { UUID_PACKED_STRING1 }\n it 'is 1' do\n is_expected.to eq 1\n end\n end\n\n context 'with a greater value' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n let(:second) { UUID_PACKED_STRING2 }\n it 'is -1' do\n is_expected.to eq(-1)\n end\n end\n\n context 'with an equal string' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n let(:second) { UUID_STRING1 }\n it 'is 0' do\n is_expected.to eq 0\n end\n end\n\n context 'with a lesser string' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING2) }\n let(:second) { UUID_STRING1 }\n it 'is 1' do\n is_expected.to eq 1\n end\n end\n\n context 'with a greater string' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) }\n let(:second) { UUID_STRING2 }\n it 'is -1' do\n is_expected.to eq(-1)\n end\n end\n\n context 'with an invalid string' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING2) }\n let(:second) { 'foobar' }\n it 'is nil' do\n is_expected.to be_nil\n end\n end\n end\n\n describe '#hash' do\n subject { Lobster::Uuid.new(UUID_PACKED_STRING1).hash }\n\n it 'is a Fixnum' do\n is_expected.to be_a(Fixnum)\n end\n\n context 'with identical UUIDs' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1).hash }\n let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING1).hash }\n\n it 'returns identical values' do\n expect(first).to eq(second)\n end\n end\n\n context 'with different UUIDs' do\n let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1).hash }\n let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING2).hash }\n\n it 'returns different values' do\n expect(first).to_not eq(second)\n end\n end\n end\n\n describe '#to_s' do\n subject { Lobster::Uuid.new(UUID_PACKED_STRING1).to_s }\n\n it 'is a String' do\n is_expected.to be_a String\n end\n\n it 'is a valid UUID string' do\n is_expected.to match(VALID_UUID_REGEX)\n end\n\n it 'equals the initial value' do\n is_expected.to eq(UUID_STRING1)\n end\n\n context 'with bytes less than 16' do\n subject { Lobster::Uuid.new(\"\\x05\\x30\\x5d\\x54\\x75\\x02\\x43\\x1b\\xad\\xb2\\xeb\\x6b\\x9e\\x54\\x60\\x00\").to_s }\n\n it 'pads with zeroes' do\n is_expected.to eq('05305d54-7502-431b-adb2-eb6b9e546000')\n end\n end\n end\n\nend\n", "meta": {"content_hash": "1642c878d4fcdc5ebd2a9e8b8905586d", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 108, "avg_line_length": 23.946778711484594, "alnum_prop": 0.5853316177330682, "repo_name": "gachapon/lobster-common", "id": "ed5b0f0b607bf7c015be4f064dfa501f5129bfd2", "size": "8549", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "spec/lib/lobster/uuid_spec.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "44314"}]}} +{"text": "package com.asksunny.schema.parser;\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\nimport java.util.Set;\r\n\r\npublic class KeywordDictionary extends HashMap<String, Keyword> {\r\n\r\n\t/**\r\n\t * \r\n\t */\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n\tpublic KeywordDictionary() {\r\n\t\tthis.put(\"CREATE\", Keyword.CREATE);\r\n\t\tthis.put(\"TABLE\", Keyword.TABLE);\r\n\t\tthis.put(\"NOT\", Keyword.NOT);\r\n\t\tthis.put(\"NULL\", Keyword.NULL);\r\n\t\tthis.put(\"PRIMARY\", Keyword.PRIMARY);\r\n\t\tthis.put(\"KEY\", Keyword.KEY);\r\n\t\tthis.put(\"VARCHAR\", Keyword.VARCHAR);\r\n\t\tthis.put(\"NUMBER\", Keyword.NUMBER);\r\n\t\tthis.put(\"INT\", Keyword.INT);\r\n\t\tthis.put(\"BIGINT\", Keyword.BIGINT);\r\n\t\tthis.put(\"INTEGER\", Keyword.INTEGER);\r\n\t\tthis.put(\"DOUBLE\", Keyword.DOUBLE);\r\n\t\tthis.put(\"VARCHAR2\", Keyword.VARCHAR);\r\n\t\tthis.put(\"BINARY\", Keyword.BINARY);\r\n\t\tthis.put(\"LONG\", Keyword.LONG);\r\n\t\tthis.put(\"DATE\", Keyword.DATE);\r\n\t\tthis.put(\"TIME\", Keyword.TIME);\r\n\t\tthis.put(\"TIMESTAMP\", Keyword.TIMESTAMP);\r\n\t\tthis.put(\"ALTER\", Keyword.ALTER);\r\n\t\tthis.put(\"ADD\", Keyword.ADD);\r\n\t\tthis.put(\"CHAR\", Keyword.CHAR);\r\n\t\tthis.put(\"CONSTRAINT\", Keyword.CONSTRAINT);\r\n\t\tthis.put(\"FOREIGN\", Keyword.FOREIGN);\r\n\t\tthis.put(\"REFERENCES\", Keyword.REFERENCES);\r\n\t\tthis.put(\"UNIQUE\", Keyword.UNIQUE);\r\n\t\tthis.put(\"INDEX\", Keyword.INDEX);\r\n\t\tthis.put(\"BYTE\", Keyword.BYTE);\r\n\t\tthis.put(\"NOPARALLELCREATE\", Keyword.CREATE);\r\n\t\tthis.put(\"NOPARALLEL\", Keyword.NOPARALLEL);\r\n\t\tthis.put(\"PARALLEL\", Keyword.PARALLEL);\r\n\t\tthis.put(\"*\", Keyword.ASTERISK);\r\n\t\tthis.put(\"IMAGE\", Keyword.IMAGE);\r\n\t\tthis.put(\"TEXT\", Keyword.TEXT);\r\n\t\tthis.put(\"IDENTITY\", Keyword.IDENTITY);\r\n\t\tthis.put(\"AUTOINCREMENT\", Keyword.IDENTITY);\r\n\t\tthis.put(\"AUTO_INCREMENT\", Keyword.IDENTITY);\r\n\t\tthis.put(\"DEFAULT\", Keyword.DEFAULT);\r\n\t\tthis.put(\"COLUMN_FORMAT\", Keyword.FORMAT);\r\n\t\tthis.put(\"FORMAT\", Keyword.FORMAT);\t\t\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\r\n\t@Override\r\n\tpublic Keyword get(Object key) {\r\n\t\t\r\n\t\treturn super.get(key.toString().toUpperCase());\r\n\t}\r\n\r\n\t@Override\r\n\tpublic Keyword put(String key, Keyword value) {\r\n\t\treturn super.put(key.toUpperCase(), value);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void putAll(Map<? extends String, ? extends Keyword> m) {\r\n\t\tSet<? extends String> keys = m.keySet();\r\n\t\tfor (String string : keys) {\r\n\t\t\tsuper.put(string.toUpperCase(), m.get(string));\r\n\t\t}\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean containsKey(Object key) {\r\n\t\t\r\n\t\treturn super.containsKey(key.toString().toUpperCase());\r\n\t}\r\n\r\n}\r\n", "meta": {"content_hash": "17e0844e355090632f0e6aef8dd4ab5e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 65, "avg_line_length": 28.75, "alnum_prop": 0.6650103519668737, "repo_name": "devsunny/jscaffold", "id": "0e5042958a41441b8acf16b22b7e71f333e3239b", "size": "2415", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/asksunny/schema/parser/KeywordDictionary.java", "mode": "33188", "license": "mit", "language": [{"name": "FreeMarker", "bytes": "37206"}, {"name": "Java", "bytes": "312644"}]}} +{"text": "\n#include \"arm_math.h\"\n\n/** \n * @ingroup groupMath \n */\n\n/** \n * @defgroup offset Vector Offset \n * \n * Adds a constant offset to each element of a vector. \n * \n * <pre> \n * pDst[n] = pSrc[n] + offset, 0 <= n < blockSize. \n * </pre> \n * \n * There are separate functions for floating-point, Q7, Q15, and Q31 data types. \n */\n\n/** \n * @addtogroup offset \n * @{ \n */\n\n/** \n * @brief Adds a constant offset to a floating-point vector. \n * @param[in] *pSrc points to the input vector \n * @param[in] offset is the offset to be added \n * @param[out] *pDst points to the output vector \n * @param[in] blockSize number of samples in the vector \n * @return none. \n */\n\n\nvoid arm_offset_f32(\n float32_t * pSrc,\n float32_t offset,\n float32_t * pDst,\n uint32_t blockSize)\n{\n uint32_t blkCnt; /* loop counter */\n\n#ifndef ARM_MATH_CM0\n\n/* Run the below code for Cortex-M4 and Cortex-M3 */\n float32_t in1, in2, in3, in4;\n\n /*loop Unrolling */\n blkCnt = blockSize >> 2u;\n\n /* First part of the processing with loop unrolling. Compute 4 outputs at a time. \n ** a second loop below computes the remaining 1 to 3 samples. */\n while(blkCnt > 0u)\n {\n /* C = A + offset */\n /* Add offset and then store the results in the destination buffer. */\n /* read samples from source */\n in1 = *pSrc;\n in2 = *(pSrc + 1);\n\n /* add offset to input */\n in1 = in1 + offset;\n\n /* read samples from source */\n in3 = *(pSrc + 2);\n\n /* add offset to input */\n in2 = in2 + offset;\n\n /* read samples from source */\n in4 = *(pSrc + 3);\n\n /* add offset to input */\n in3 = in3 + offset;\n\n /* store result to destination */\n *pDst = in1;\n\n /* add offset to input */\n in4 = in4 + offset;\n\n /* store result to destination */\n *(pDst + 1) = in2;\n\n /* store result to destination */\n *(pDst + 2) = in3;\n\n /* store result to destination */\n *(pDst + 3) = in4;\n\n /* update pointers to process next samples */\n pSrc += 4u;\n pDst += 4u;\n\n /* Decrement the loop counter */\n blkCnt--;\n }\n\n /* If the blockSize is not a multiple of 4, compute any remaining output samples here. \n ** No loop unrolling is used. */\n blkCnt = blockSize % 0x4u;\n\n#else\n\n /* Run the below code for Cortex-M0 */\n\n /* Initialize blkCnt with number of samples */\n blkCnt = blockSize;\n\n#endif /* #ifndef ARM_MATH_CM0 */\n\n while(blkCnt > 0u)\n {\n /* C = A + offset */\n /* Add offset and then store the result in the destination buffer. */\n *pDst++ = (*pSrc++) + offset;\n\n /* Decrement the loop counter */\n blkCnt--;\n }\n}\n\n/** \n * @} end of offset group \n */\n", "meta": {"content_hash": "f2b978d8b36fff3a0eae28c44484593c", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 96, "avg_line_length": 22.592, "alnum_prop": 0.5439093484419264, "repo_name": "jys0305/highspeedlogger", "id": "d7ca663bbddb46767e61f4c926942e9b5892f6e8", "size": "3945", "binary": false, "copies": "56", "ref": "refs/heads/master", "path": "sw/libs/STM32F4xx_DSP_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/BasicMathFunctions/arm_offset_f32.c", "mode": "33188", "license": "mit", "language": [{"name": "Assembly", "bytes": "280928"}, {"name": "C", "bytes": "21114329"}, {"name": "C++", "bytes": "100991"}, {"name": "HTML", "bytes": "455966"}, {"name": "LSL", "bytes": "47664"}, {"name": "Makefile", "bytes": "4331"}, {"name": "Objective-C", "bytes": "1718"}]}} +{"text": "\n\npackage javassist.bytecode.stackmap;\n\nimport javassist.bytecode.*;\nimport java.util.HashMap;\nimport java.util.ArrayList;\n\n/**\n * A basic block is a sequence of bytecode that does not contain jump/branch\n * instructions except at the last bytecode.\n * Since Java7 or later does not allow JSR, this class throws an exception when\n * it finds JSR.\n */\npublic class BasicBlock {\n static class JsrBytecode extends BadBytecode {\n JsrBytecode() { super(\"JSR\"); }\n }\n\n protected int position, length;\n protected int incoming; // the number of incoming branches.\n protected BasicBlock[] exit; // null if the block is a leaf.\n protected boolean stop; // true if the block ends with an unconditional jump. \n protected Catch toCatch;\n\n protected BasicBlock(int pos) {\n position = pos;\n length = 0;\n incoming = 0;\n }\n\n public static BasicBlock find(BasicBlock[] blocks, int pos)\n throws BadBytecode\n {\n for (int i = 0; i < blocks.length; i++) {\n int iPos = blocks[i].position;\n if (iPos <= pos && pos < iPos + blocks[i].length)\n return blocks[i];\n }\n\n throw new BadBytecode(\"no basic block at \" + pos);\n }\n\n public static class Catch {\n public Catch next;\n public BasicBlock body;\n public int typeIndex;\n Catch(BasicBlock b, int i, Catch c) {\n body = b;\n typeIndex = i;\n next = c;\n }\n }\n\n public String toString() {\n StringBuffer sbuf = new StringBuffer();\n String cname = this.getClass().getName();\n int i = cname.lastIndexOf('.');\n sbuf.append(i < 0 ? cname : cname.substring(i + 1));\n sbuf.append(\"[\");\n toString2(sbuf);\n sbuf.append(\"]\");\n return sbuf.toString();\n }\n\n protected void toString2(StringBuffer sbuf) {\n sbuf.append(\"pos=\").append(position).append(\", len=\")\n .append(length).append(\", in=\").append(incoming)\n .append(\", exit{\");\n if (exit != null) {\n for (int i = 0; i < exit.length; i++)\n sbuf.append(exit[i].position).append(\",\");\n }\n\n sbuf.append(\"}, {\");\n Catch th = toCatch;\n while (th != null) {\n sbuf.append(\"(\").append(th.body.position).append(\", \")\n .append(th.typeIndex).append(\"), \");\n th = th.next;\n }\n\n sbuf.append(\"}\");\n }\n\n static class Mark implements Comparable {\n int position;\n BasicBlock block;\n BasicBlock[] jump;\n boolean alwaysJmp; // true if an unconditional branch.\n int size; // 0 unless the mark indicates RETURN etc. \n Catch catcher;\n\n Mark(int p) {\n position = p;\n block = null;\n jump = null;\n alwaysJmp = false;\n size = 0;\n catcher = null;\n }\n\n public int compareTo(Object obj) {\n if (obj instanceof Mark) {\n int pos = ((Mark)obj).position;\n return position - pos;\n }\n\n return -1;\n }\n\n void setJump(BasicBlock[] bb, int s, boolean always) {\n jump = bb;\n size = s;\n alwaysJmp = always;\n }\n }\n\n public static class Maker {\n /* Override these two methods if a subclass of BasicBlock must be\n * instantiated.\n */\n protected BasicBlock makeBlock(int pos) {\n return new BasicBlock(pos);\n }\n\n protected BasicBlock[] makeArray(int size) {\n return new BasicBlock[size];\n }\n\n private BasicBlock[] makeArray(BasicBlock b) {\n BasicBlock[] array = makeArray(1);\n array[0] = b;\n return array;\n }\n\n private BasicBlock[] makeArray(BasicBlock b1, BasicBlock b2) {\n BasicBlock[] array = makeArray(2);\n array[0] = b1;\n array[1] = b2;\n return array;\n }\n\n public BasicBlock[] make(MethodInfo minfo) throws BadBytecode {\n CodeAttribute ca = minfo.getCodeAttribute();\n if (ca == null)\n return null;\n\n CodeIterator ci = ca.iterator();\n return make(ci, 0, ci.getCodeLength(), ca.getExceptionTable());\n }\n\n public BasicBlock[] make(CodeIterator ci, int begin, int end,\n ExceptionTable et)\n throws BadBytecode\n {\n HashMap marks = makeMarks(ci, begin, end, et);\n BasicBlock[] bb = makeBlocks(marks);\n addCatchers(bb, et);\n return bb;\n }\n\n /* Branch target\n */\n private Mark makeMark(HashMap table, int pos) {\n return makeMark0(table, pos, true, true);\n }\n\n /* Branch instruction.\n * size > 0\n */\n private Mark makeMark(HashMap table, int pos, BasicBlock[] jump,\n int size, boolean always) {\n Mark m = makeMark0(table, pos, false, false);\n m.setJump(jump, size, always);\n return m;\n }\n\n private Mark makeMark0(HashMap table, int pos,\n boolean isBlockBegin, boolean isTarget) {\n Integer p = new Integer(pos);\n Mark m = (Mark)table.get(p);\n if (m == null) {\n m = new Mark(pos);\n table.put(p, m);\n }\n\n if (isBlockBegin) {\n if (m.block == null)\n m.block = makeBlock(pos);\n\n if (isTarget)\n m.block.incoming++;\n }\n\n return m;\n }\n\n private HashMap makeMarks(CodeIterator ci, int begin, int end,\n ExceptionTable et)\n throws BadBytecode\n {\n ci.begin();\n ci.move(begin);\n HashMap marks = new HashMap();\n while (ci.hasNext()) {\n int index = ci.next();\n if (index >= end)\n break;\n\n int op = ci.byteAt(index);\n if ((Opcode.IFEQ <= op && op <= Opcode.IF_ACMPNE)\n || op == Opcode.IFNULL || op == Opcode.IFNONNULL) {\n Mark to = makeMark(marks, index + ci.s16bitAt(index + 1));\n Mark next = makeMark(marks, index + 3);\n makeMark(marks, index, makeArray(to.block, next.block), 3, false);\n }\n else if (Opcode.GOTO <= op && op <= Opcode.LOOKUPSWITCH)\n switch (op) {\n case Opcode.GOTO :\n makeGoto(marks, index, index + ci.s16bitAt(index + 1), 3);\n break;\n case Opcode.JSR :\n makeJsr(marks, index, index + ci.s16bitAt(index + 1), 3);\n break;\n case Opcode.RET :\n makeMark(marks, index, null, 2, true);\n break;\n case Opcode.TABLESWITCH : {\n int pos = (index & ~3) + 4;\n int low = ci.s32bitAt(pos + 4);\n int high = ci.s32bitAt(pos + 8);\n int ncases = high - low + 1;\n BasicBlock[] to = makeArray(ncases + 1);\n to[0] = makeMark(marks, index + ci.s32bitAt(pos)).block; // default branch target\n int p = pos + 12;\n int n = p + ncases * 4;\n int k = 1;\n while (p < n) {\n to[k++] = makeMark(marks, index + ci.s32bitAt(p)).block;\n p += 4;\n }\n makeMark(marks, index, to, n - index, true);\n break; }\n case Opcode.LOOKUPSWITCH : {\n int pos = (index & ~3) + 4;\n int ncases = ci.s32bitAt(pos + 4);\n BasicBlock[] to = makeArray(ncases + 1);\n to[0] = makeMark(marks, index + ci.s32bitAt(pos)).block; // default branch target\n int p = pos + 8 + 4;\n int n = p + ncases * 8 - 4;\n int k = 1;\n while (p < n) {\n to[k++] = makeMark(marks, index + ci.s32bitAt(p)).block;\n p += 8;\n }\n makeMark(marks, index, to, n - index, true);\n break; }\n }\n else if ((Opcode.IRETURN <= op && op <= Opcode.RETURN) || op == Opcode.ATHROW)\n makeMark(marks, index, null, 1, true);\n else if (op == Opcode.GOTO_W)\n makeGoto(marks, index, index + ci.s32bitAt(index + 1), 5);\n else if (op == Opcode.JSR_W)\n makeJsr(marks, index, index + ci.s32bitAt(index + 1), 5);\n else if (op == Opcode.WIDE && ci.byteAt(index + 1) == Opcode.RET)\n makeMark(marks, index, null, 4, true);\n }\n\n if (et != null) {\n int i = et.size();\n while (--i >= 0) {\n makeMark0(marks, et.startPc(i), true, false);\n makeMark(marks, et.handlerPc(i));\n }\n }\n\n return marks;\n }\n\n private void makeGoto(HashMap marks, int pos, int target, int size) {\n Mark to = makeMark(marks, target);\n BasicBlock[] jumps = makeArray(to.block);\n makeMark(marks, pos, jumps, size, true);\n }\n\n /*\n * We could ignore JSR since Java 7 or later does not allow it.\n * See The JVM Spec. Sec. 4.10.2.5.\n */\n protected void makeJsr(HashMap marks, int pos, int target, int size) throws BadBytecode {\n /*\n Mark to = makeMark(marks, target);\n Mark next = makeMark(marks, pos + size);\n BasicBlock[] jumps = makeArray(to.block, next.block);\n makeMark(marks, pos, jumps, size, false);\n */\n throw new JsrBytecode();\n }\n\n private BasicBlock[] makeBlocks(HashMap markTable) {\n Mark[] marks = (Mark[])markTable.values()\n .toArray(new Mark[markTable.size()]);\n java.util.Arrays.sort(marks);\n ArrayList blocks = new ArrayList();\n int i = 0;\n BasicBlock prev;\n if (marks.length > 0 && marks[0].position == 0 && marks[0].block != null)\n prev = getBBlock(marks[i++]);\n else\n prev = makeBlock(0);\n\n blocks.add(prev);\n while (i < marks.length) {\n Mark m = marks[i++];\n BasicBlock bb = getBBlock(m);\n if (bb == null) {\n // the mark indicates a branch instruction\n if (prev.length > 0) {\n // the previous mark already has exits.\n prev = makeBlock(prev.position + prev.length);\n blocks.add(prev);\n }\n\n prev.length = m.position + m.size - prev.position;\n prev.exit = m.jump;\n prev.stop = m.alwaysJmp;\n }\n else {\n // the mark indicates a branch target\n if (prev.length == 0) {\n prev.length = m.position - prev.position;\n bb.incoming++;\n prev.exit = makeArray(bb);\n }\n else {\n // the previous mark already has exits.\n int prevPos = prev.position;\n if (prevPos + prev.length < m.position) {\n prev = makeBlock(prevPos + prev.length);\n prev.length = m.position - prevPos;\n // the incoming flow from dead code is not counted\n // bb.incoming++;\n prev.exit = makeArray(bb);\n }\n }\n\n blocks.add(bb);\n prev = bb;\n }\n }\n\n return (BasicBlock[])blocks.toArray(makeArray(blocks.size()));\n }\n\n private static BasicBlock getBBlock(Mark m) {\n BasicBlock b = m.block;\n if (b != null && m.size > 0) {\n b.exit = m.jump;\n b.length = m.size;\n b.stop = m.alwaysJmp;\n }\n\n return b;\n }\n\n private void addCatchers(BasicBlock[] blocks, ExceptionTable et)\n throws BadBytecode\n {\n if (et == null)\n return;\n\n int i = et.size();\n while (--i >= 0) {\n BasicBlock handler = find(blocks, et.handlerPc(i));\n int start = et.startPc(i);\n int end = et.endPc(i);\n int type = et.catchType(i);\n handler.incoming--;\n for (int k = 0; k < blocks.length; k++) {\n BasicBlock bb = blocks[k];\n int iPos = bb.position;\n if (start <= iPos && iPos < end) {\n bb.toCatch = new Catch(handler, type, bb.toCatch);\n handler.incoming++;\n }\n }\n }\n }\n }\n}\n", "meta": {"content_hash": "f1a0cceb83de5d2bb6046c9fcb64b93d", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 107, "avg_line_length": 35.18414322250639, "alnum_prop": 0.4474085919895326, "repo_name": "oneliang/third-party-lib", "id": "6213e22a64b2b627e9be31e387205d826fb1866d", "size": "14461", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "javassist/javassist/bytecode/stackmap/BasicBlock.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "31084"}, {"name": "Java", "bytes": "14382753"}]}} +{"text": "/* System calls. */\n#define SEND\t\t 1\t/* function code for sending messages */\n#define RECEIVE\t\t 2\t/* function code for receiving messages */\n#define BOTH\t\t 3\t/* function code for SEND + RECEIVE */\n#define ANY (NR_PROCS+100)\t/* receive(ANY, buf) accepts from any source */\n\n/* Task numbers, function codes and reply codes. */\n\n#define TTY -NR_TASKS\t/* terminal I/O class */\n#\tdefine TTY_READ\t 3\t/* fcn code for reading from tty */\n#\tdefine TTY_WRITE 4\t/* fcn code for writing to tty */\n#\tdefine TTY_IOCTL 5\t/* fcn code for ioctl */\n#\tdefine TTY_SETPGRP 6\t/* fcn code for setpgrp */\n#\tdefine TTY_OPEN 7\t/* fcn code for opening tty */\n#\tdefine TTY_CLOSE 8\t/* fcn code for closing tty */\n#\tdefine SUSPEND\t -998\t/* used in interrupts when tty has no data */\n\n#ifdef AM_KERNEL\n#define\tAMOEBA\n#endif\n\n#ifdef AMOEBA\n\n/* There are AM_NTASK copies of the amoeba kernel task.\n * If you change AM_NTASKS be sure to adjust kernel/table.c and fs/table.c\n */\n#define AM_NTASKS\t 4\t/* number of kernel tasks of this class */\n\n#define\tAMINT_CLASS\t (TTY+1)\t/* Amoeba event handler */\n#define AMOEBA_CLASS \t (AMINT_CLASS+AM_NTASKS) /* transaction handlers */\n#\tdefine ETHER_ARRIV 1\t/* fcn code for packet arrival */\n#\tdefine AM_TRANS 2\t/* amoeba transaction */\t\t\n#\tdefine AM_GETREQ 3\t/* amoeba getrequest */\n#\tdefine AM_PUTREP 4\t/* amoeba putrep */\n#\tdefine AM_REVIVE 6\t/* used by kernel task to revive luser task */\n#\tdefine AM_TIMEOUT 8\t/* used to talk to clock task */\n#\tdefine AM_PUTSIG 9\t/* when the luser hits the DEL ! */\n#\tdefine AM_TASK_DIED 10 /* sent if task died during a transaction */\n\n#else\t/* if AMOEBA not defined */\n\n#define\tAMOEBA_CLASS\tTTY\n\n#endif /* AMOEBA */\n\n/*\n * New class definitions should go here and should be defined relative\n * to AMOEBA_CLASS (ie. as AMOEBA_CLASS+n, for the nth task added).\n */\n\n#define IDLE (AMOEBA_CLASS+1)\t/* task to run when there's nothing to run */\n\n#define PRINTER -7\t\t/* printer I/O class */\n/* The printer uses the same commands as TTY. */\n\n#define WINCHESTER -6\t/* winchester (hard) disk class */\n#define FLOPPY -5\t/* floppy disk class */\n#\tdefine DISK_READ 3\t/* fcn code to DISK (must equal TTY_READ) */\n#\tdefine DISK_WRITE 4\t/* fcn code to DISK (must equal TTY_WRITE) */\n#\tdefine DISK_IOCTL 5\t/* fcn code for setting up RAM disk */\n#\tdefine SCATTERED_IO 6\t/* fcn code for multiple reads/writes */\n#\tdefine OPTIONAL_IO 16\t/* modifier to DISK_* codes within vector */\n\n#define MEM -4\t/* /dev/ram, /dev/(k)mem and /dev/null class */\n#\tdefine RAM_DEV 0\t/* minor device for /dev/ram */\n#\tdefine MEM_DEV 1\t/* minor device for /dev/mem */\n#\tdefine KMEM_DEV 2\t/* minor device for /dev/kmem */\n#\tdefine NULL_DEV 3\t/* minor device for /dev/null */\n#if (CHIP == INTEL)\n#\tdefine PORT_DEV 4\t/* minor device for /dev/port */\n#endif\n\n#define CLOCK -3\t/* clock class */\n#\tdefine SET_ALARM 1\t/* fcn code to CLOCK, set up alarm */\n#\tdefine GET_TIME\t 3\t/* fcn code to CLOCK, get real time */\n#\tdefine SET_TIME\t 4\t/* fcn code to CLOCK, set real time */\n#\tdefine REAL_TIME 1\t/* reply from CLOCK: here is real time */\n\n#define SYSTASK -2\t/* internal functions */\n#\tdefine SYS_XIT 1\t/* fcn code for sys_xit(parent, proc) */\n#\tdefine SYS_GETSP 2\t/* fcn code for sys_sp(proc, &new_sp) */\n#\tdefine SYS_SIG 3\t/* fcn code for sys_sig(proc, sig) */\n#\tdefine SYS_FORK 4\t/* fcn code for sys_fork(parent, child) */\n#\tdefine SYS_NEWMAP 5\t/* fcn code for sys_newmap(procno, map_ptr) */\n#\tdefine SYS_COPY 6\t/* fcn code for sys_copy(ptr) */\n#\tdefine SYS_EXEC 7\t/* fcn code for sys_exec(procno, new_sp) */\n#\tdefine SYS_TIMES 8\t/* fcn code for sys_times(procno, bufptr) */\n#\tdefine SYS_ABORT 9\t/* fcn code for sys_abort() */\n#\tdefine SYS_FRESH 10\t/* fcn code for sys_fresh() (Atari only) */\n#\tdefine SYS_KILL 11\t/* fcn code for sys_kill(proc, sig) */\n#\tdefine SYS_GBOOT 12\t/* fcn code for sys_gboot(procno, bootptr) */\n#\tdefine SYS_UMAP 13\t/* fcn code for sys_umap(procno, etc) */\n#\tdefine SYS_MEM 14\t/* fcn code for sys_mem() */\n#\tdefine SYS_TRACE 15\t/* fcn code for sys_trace(req,pid,addr,data) */\n\n#define HARDWARE -1\t/* used as source on interrupt generated msgs*/\n\n/* Names of message fields for messages to CLOCK task. */\n#define DELTA_TICKS m6_l1\t/* alarm interval in clock ticks */\n#define FUNC_TO_CALL m6_f1\t/* pointer to function to call */\n#define NEW_TIME m6_l1\t/* value to set clock to (SET_TIME) */\n#define CLOCK_PROC_NR m6_i1\t/* which proc (or task) wants the alarm? */\n#define SECONDS_LEFT m6_l1\t/* how many seconds were remaining */\n\n/* Names of message fields used for messages to block and character tasks. */\n#define DEVICE m2_i1\t/* major-minor device */\n#define PROC_NR m2_i2\t/* which (proc) wants I/O? */\n#define COUNT m2_i3\t/* how many bytes to transfer */\n#define POSITION m2_l1\t/* file offset */\n#define ADDRESS m2_p1\t/* core buffer address */\n\n/* Names of message fields for messages to TTY task. */\n#define TTY_LINE m2_i1\t/* message parameter: terminal line */\n#define TTY_REQUEST m2_i3\t/* message parameter: ioctl request code */\n#define TTY_SPEK m2_l1\t/* message parameter: ioctl speed, erasing */\n#define TTY_FLAGS m2_l2\t/* message parameter: ioctl tty mode */\n#define TTY_PGRP m2_i3 /* message parameter: process group */\n\n/* Names of messages fields used in reply messages from tasks. */\n#define REP_PROC_NR m2_i1\t/* # of proc on whose behalf I/O was done */\n#define REP_STATUS m2_i2\t/* bytes transferred or error number */\n\n/* Names of fields for copy message to SYSTASK. */\n#define SRC_SPACE m5_c1\t/* T or D space (stack is also D) */\n#define SRC_PROC_NR m5_i1\t/* process to copy from */\n#define SRC_BUFFER m5_l1\t/* virtual address where data come from */\n#define DST_SPACE m5_c2\t/* T or D space (stack is also D) */\n#define DST_PROC_NR m5_i2\t/* process to copy to */\n#define DST_BUFFER m5_l2\t/* virtual address where data go to */\n#define COPY_BYTES m5_l3\t/* number of bytes to copy */\n\n/* Field names for accounting, SYSTASK and miscellaneous. */\n#define USER_TIME m4_l1\t/* user time consumed by process */\n#define SYSTEM_TIME m4_l2\t/* system time consumed by process */\n#define CHILD_UTIME m4_l3\t/* user time consumed by process' children */\n#define CHILD_STIME m4_l4\t/* sys time consumed by process' children */\n\n#define PROC1 m1_i1\t/* indicates a process */\n#define PROC2 m1_i2\t/* indicates a process */\n#define PID m1_i3\t/* process id passed from MM to kernel */\n#define STACK_PTR m1_p1\t/* used for stack ptr in sys_exec, sys_getsp */\n#define PR m6_i1\t/* process number for sys_sig */\n#define SIGNUM m6_i2\t/* signal number for sys_sig */\n#define FUNC m6_f1\t/* function pointer for sys_sig */\n#define MEM_PTR m1_p1\t/* tells where memory map is for sys_newmap */\n#define CANCEL 0 /* general request to force a task to cancel */\n#define SIG_MAP m1_i2\t/* used by kernel for passing signal bit map */\n\n#ifdef AMOEBA\n\n/* Names of message fields for amoeba tasks */\n#define\tAM_OP\t\tm2_i1\t/* one of the above operators */\n#define\tAM_PROC_NR\tm2_i2\t/* process # of proc doing operation */\n#define\tAM_COUNT\tm2_i3\t/* size of buffer for operation */\n#define\tAM_ADDRESS\tm2_p1\t/* address of buffer for operation */\n\n/* For communication between MM and AMOEBA_CLASS kernel tasks */\n#define\tAM_STATUS\tm2_i3\t/* same use as REP_STATUS but for amoeba */\n#define\tAM_FREE_IT\tm2_l1\t/* 1=not a getreq, 0=is a getreq */\n\n/* Special for passing a physical address from the ethernet driver */\n#define\tAM_PADDR\tm2_l1\t/* to the transaction layer */\n\n#endif /* AMOEBA */\n\n#define HARD_INT 2\t/* fcn code for all hardware interrupts */\n", "meta": {"content_hash": "f9df1ef6dac46637021009afd24c97de", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 79, "avg_line_length": 47.506024096385545, "alnum_prop": 0.6505199086989601, "repo_name": "macminix/MacMinix", "id": "2096f8ba765448daed32f1f58c71692b6eaa5fdd", "size": "7886", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "include/minix/com.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Assembly", "bytes": "360566"}, {"name": "C", "bytes": "3820041"}, {"name": "C++", "bytes": "18889"}, {"name": "IDL", "bytes": "54"}, {"name": "Smalltalk", "bytes": "3572"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item android:color=\"@color/colorAccent\">\n <shape android:shape=\"rectangle\">\n <corners android:radius=\"4dp\"/>\n <solid android:color=\"@android:color/white\"/>\n </shape>\n </item>\n</selector>\n", "meta": {"content_hash": "0c5c532741b17d9555e504f006cb4d6f", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 69, "avg_line_length": 37.77777777777778, "alnum_prop": 0.6176470588235294, "repo_name": "coderwjq/ZhaZhaShop", "id": "18d9057e931dc1eec93e181d35fb48d50721ab45", "size": "340", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "shop/src/main/res/drawable/bg_tv_indicator.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "942134"}]}} +{"text": "\ufeff#region Mr. Advice MVVM\n// // Mr. Advice MVVM\n// // A simple MVVM package using Mr. Advice aspect weaver\n// // https://github.com/ArxOne/MrAdvice.MVVM\n// // Released under MIT license http://opensource.org/licenses/mit-license.php\n#endregion\n\nnamespace ArxOne.MrAdvice.MVVM.Properties\n{\n /// <summary>\n /// Marks a simple auto property to be bound to a DependencyProperty\n /// Note: use <see cref=\"Dependency\"/>, this class will be deprecated soon\n /// </summary>\n public class DependencyProperty : Dependency\n {\n }\n}\n", "meta": {"content_hash": "e6f968f6bcaa02164d63a014a40698b9", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 79, "avg_line_length": 31.764705882352942, "alnum_prop": 0.6888888888888889, "repo_name": "ArxOne/MrAdvice.MVVM", "id": "44988b339a9dae3106bd24bb29f525eac790a6ff", "size": "542", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MrAdvice.MVVM/MVVM/Properties/DependencyProperty.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "174074"}]}} +{"text": "package org.ringojs.util;\n\nimport org.mozilla.javascript.Context;\nimport org.mozilla.javascript.Scriptable;\nimport org.mozilla.javascript.ContextFactory;\nimport org.mozilla.javascript.debug.DebugFrame;\nimport org.mozilla.javascript.debug.DebuggableScript;\nimport org.mozilla.javascript.debug.Debugger;\n\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\n\n/**\n * A base class for Debuggers and Profilers implemented in Javascript.\n * This allows to exclude the debugger/profiler module and all modules\n * it uses to be excluded from debugging/profiling.\n */\npublic abstract class DebuggerBase implements Debugger {\n\n String debuggerScript;\n int debuggerScriptDepth = 0;\n final Logger log = Logger.getLogger(DebuggerBase.class.getName());\n\n public abstract DebuggerBase createDebugger();\n\n public abstract Object createContextData();\n\n public abstract void handleCompilationDone(Context cx, DebuggableScript fnOrScript, String source);\n\n public abstract DebugFrame getScriptFrame(Context cx, DebuggableScript fnOrScript);\n\n public void attach() {\n attach(createContextData());\n }\n\n public void setDebuggerScript(String path) {\n debuggerScript = path;\n }\n\n public void install() {\n ContextFactory factory = Context.getCurrentContext().getFactory();\n factory.addListener(new ContextFactory.Listener() {\n public void contextCreated(Context cx) {\n DebuggerBase debugger = createDebugger();\n if (debugger != null) {\n debugger.attach(createContextData());\n }\n }\n public void contextReleased(Context cx) {\n }\n });\n }\n\n public void attach(Object contextData) {\n Context cx = Context.getCurrentContext();\n cx.setDebugger(this, contextData);\n cx.setOptimizationLevel(-1);\n cx.setGeneratingDebug(true);\n }\n\n public void detach() {\n Context cx = Context.getCurrentContext();\n cx.setDebugger(null, null);\n }\n\n public Object getContextData() {\n return Context.getCurrentContext().getDebuggerContextData();\n }\n\n public synchronized void suspend() {\n try {\n wait();\n } catch (InterruptedException ir) {\n Thread.currentThread().interrupt();\n }\n }\n\n public synchronized void resume() {\n notify();\n }\n\n public DebugFrame getFrame(Context cx, DebuggableScript fnOrScript) {\n String path = fnOrScript.getSourceName();\n if (log.isLoggable(Level.FINE)) {\n log.fine(\"Getting Frame for \" + path +\n \", debugger script depth is \" + debuggerScriptDepth);\n }\n if (debuggerScriptDepth > 0 || path.equals(debuggerScript)) {\n return new DebuggerScriptFrame();\n } else {\n return getScriptFrame(cx, fnOrScript);\n }\n }\n\n /**\n * Get a string representation for the given script\n * @param script a function or script\n * @return the file and/or function name of the script\n */\n static String getScriptName(DebuggableScript script) {\n if (script.isFunction()) {\n return script.getSourceName() + \": \" + script.getFunctionName();\n } else {\n return script.getSourceName();\n }\n }\n\n class DebuggerScriptFrame implements DebugFrame {\n\n public void onEnter(Context cx, Scriptable activation, Scriptable thisObj, Object[] args) {\n log.fine(\"Entering debugger script frame\");\n debuggerScriptDepth ++;\n }\n\n public void onExit(Context cx, boolean byThrow, Object resultOrException) {\n log.fine(\"Exiting debugger script frame\");\n debuggerScriptDepth --;\n }\n\n public void onLineChange(Context cx, int lineNumber) {}\n\n public void onExceptionThrown(Context cx, Throwable ex) {}\n\n public void onDebuggerStatement(Context cx) {}\n }\n\n}\n", "meta": {"content_hash": "7bc72a3b9cca751d9857aa4ea38a39f2", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 103, "avg_line_length": 31.275590551181104, "alnum_prop": 0.6467774420946626, "repo_name": "ringo/ringojs", "id": "28b86371965cce8c9e11aa1af139908c3c679f4d", "size": "3972", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/org/ringojs/util/DebuggerBase.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "141"}, {"name": "CSS", "bytes": "613"}, {"name": "Dockerfile", "bytes": "1007"}, {"name": "HTML", "bytes": "2026"}, {"name": "Java", "bytes": "363438"}, {"name": "JavaScript", "bytes": "913850"}, {"name": "Shell", "bytes": "2989"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>Facecat</title>\n\n <!-- Bootstrap -->\n <link href=\"/static/css/bootstrap.min.css\" rel=\"stylesheet\">\n\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js\"></script>\n <script src=\"https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js\"></script>\n <![endif]-->\n <link href=\"/static/css/facecat.css\" rel=\"stylesheet\">\n </head>\n <body>\n \n <div id=\"main\" class=\"container\">\n\n<!-- Navbar -->\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n <a class=\"navbar-brand\" href=\"/\">Facecat</a>\n </div>\n <div class=\"navbar-collapse collapse\">\n <ul class=\"nav navbar-nav navbar-right\">\n <li class=\"active\"><a href=\"/\"><span class=\"glyphicon glyphicon-big glyphicon-cloud-upload\"></span> Upload</a></li>\n <li><a href=\"/all\"><span class=\"glyphicon glyphicon-big glyphicon-picture\"></span> Generated</a></li>\n </ul>\n </div><!--/.nav-collapse -->\n </div><!--/.container-fluid -->\n </div>\n<!-- /Navbar -->\n\n<!-- Content -->\n % if 'error' in locals():\n <div class=\"alert alert-danger\">An error happend while processing your request.</div>\n % end\n <div>\n <h1>Upload a picture <small> It's more fun if it's the picture of someone.</small></h1>\n\n <form id=\"form-upload\" class=\"padded\" role=\"form\" action=\"/upload\" method=\"post\" enctype=\"multipart/form-data\">\n \n <div class=\"row\">\n <div class=\"col-sm-12 col-md-5 center-block\">\n <div class=\"input-group\">\n <span class=\"input-group-btn\">\n <span class=\"btn btn-primary btn-file\">\n Browse… <input name=\"upload\" id=\"upload\" type=\"file\">\n </span>\n </span>\n <input type=\"text\" class=\"form-control\" readonly>\n </div>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-sm-12 col-md-5 center-block\">\n <button type=\"submit\" class=\"form-control btn btn-primary\" id=\"submit\" role=\"button\">Upload</button>\n </div>\n </div>\n\n </form>\n\n </div>\n<!-- /Content -->\n\n </div><!--/.container -->\n\n <script src=\"/static/js/jquery-1.11.0.min.js\"></script>\n <script src=\"/static/js/bootstrap.min.js\"></script>\n <script type=\"text/javascript\">\n $(document).on('change', '.btn-file :file', function() {\n var input = $(this),\n numFiles = input.get(0).files ? input.get(0).files.length : 1,\n label = input.val().replace(/\\\\/g, '/').replace(/.*\\//, '');\n input.trigger('fileselect', [numFiles, label]);\n });\n\n $(document).ready( function() {\n $('.btn-file :file').on('fileselect', function(event, numFiles, label) {\n \n var input = $(this).parents('.input-group').find(':text'),\n log = numFiles > 1 ? numFiles + ' files selected' : label;\n \n if( input.length ) {\n input.val(log);\n } else {\n if( log ) alert(log);\n }\n \n });\n }); \n </script>\n\n\n </body>\n</html>\n\n", "meta": {"content_hash": "0ff5431891cb2864bd51ef0adfd0e451", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 129, "avg_line_length": 36.68181818181818, "alnum_prop": 0.5241635687732342, "repo_name": "NicolasLM/python-runabove", "id": "c289353c9893e03aa4228b58f31f19256ca86a72", "size": "4035", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "examples/facecat/views/index.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "\ufeffnamespace AH.ModuleController.UI.DIET.Forms\n{\n partial class frmPatientListDietAssign\n {\n /// <summary>\n /// Required designer variable.\n /// </summary>\n private System.ComponentModel.IContainer components = null;\n\n /// <summary>\n /// Clean up any resources being used.\n /// </summary>\n /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n protected override void Dispose(bool disposing)\n {\n if (disposing && (components != null))\n {\n components.Dispose();\n }\n base.Dispose(disposing);\n }\n\n #region Windows Form Designer generated code\n\n /// <summary>\n /// Required method for Designer support - do not modify\n /// the contents of this method with the code editor.\n /// </summary>\n private void InitializeComponent()\n {\n System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\n System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();\n System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();\n System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();\n System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();\n System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();\n this.groupBox4 = new System.Windows.Forms.GroupBox();\n this.btnShow = new System.Windows.Forms.Button();\n this.smartLabel4 = new AtiqsControlLibrary.SmartLabel();\n this.cboReceivingNurseStation = new AtiqsControlLibrary.SmartComboBox();\n this.dgvDietList = new AtiqsControlLibrary.SmartDataGridView();\n this.dgvPatientList = new AtiqsControlLibrary.SmartDataGridView();\n this.txtAdmissionID = new System.Windows.Forms.TextBox();\n this.txtDeitID = new System.Windows.Forms.TextBox();\n this.pnlMain.SuspendLayout();\n this.pnlTop.SuspendLayout();\n this.groupBox4.SuspendLayout();\n ((System.ComponentModel.ISupportInitialize)(this.dgvDietList)).BeginInit();\n ((System.ComponentModel.ISupportInitialize)(this.dgvPatientList)).BeginInit();\n this.SuspendLayout();\n // \n // btnTopClose\n // \n this.btnTopClose.Location = new System.Drawing.Point(1128, 12);\n // \n // frmLabel\n // \n this.frmLabel.Location = new System.Drawing.Point(393, 9);\n this.frmLabel.Size = new System.Drawing.Size(406, 33);\n this.frmLabel.Text = \"Assign Diet For Admitted Patient \";\n // \n // pnlMain\n // \n this.pnlMain.Controls.Add(this.dgvDietList);\n this.pnlMain.Controls.Add(this.groupBox4);\n this.pnlMain.Controls.Add(this.dgvPatientList);\n this.pnlMain.Location = new System.Drawing.Point(0, 58);\n this.pnlMain.Size = new System.Drawing.Size(1260, 606);\n // \n // pnlTop\n // \n this.pnlTop.Controls.Add(this.txtDeitID);\n this.pnlTop.Controls.Add(this.txtAdmissionID);\n this.pnlTop.Size = new System.Drawing.Size(1260, 58);\n this.pnlTop.Controls.SetChildIndex(this.frmLabel, 0);\n this.pnlTop.Controls.SetChildIndex(this.btnTopClose, 0);\n this.pnlTop.Controls.SetChildIndex(this.txtAdmissionID, 0);\n this.pnlTop.Controls.SetChildIndex(this.txtDeitID, 0);\n // \n // btnEdit\n // \n this.btnEdit.Location = new System.Drawing.Point(110, 673);\n this.btnEdit.Size = new System.Drawing.Size(19, 27);\n this.btnEdit.Visible = false;\n // \n // btnSave\n // \n this.btnSave.Location = new System.Drawing.Point(135, 681);\n this.btnSave.Size = new System.Drawing.Size(33, 17);\n this.btnSave.Visible = false;\n // \n // btnDelete\n // \n this.btnDelete.Location = new System.Drawing.Point(50, 673);\n this.btnDelete.Size = new System.Drawing.Size(21, 27);\n this.btnDelete.Visible = false;\n // \n // btnNew\n // \n this.btnNew.Location = new System.Drawing.Point(1026, 670);\n this.btnNew.Click += new System.EventHandler(this.btnNew_Click);\n // \n // btnClose\n // \n this.btnClose.Location = new System.Drawing.Point(1140, 670);\n this.btnClose.TabIndex = 3;\n // \n // btnPrint\n // \n this.btnPrint.Location = new System.Drawing.Point(77, 673);\n this.btnPrint.Size = new System.Drawing.Size(27, 27);\n this.btnPrint.Visible = false;\n // \n // groupBox1\n // \n this.groupBox1.Location = new System.Drawing.Point(0, 709);\n this.groupBox1.Size = new System.Drawing.Size(1260, 25);\n // \n // groupBox4\n // \n this.groupBox4.BackColor = System.Drawing.Color.PaleTurquoise;\n this.groupBox4.Controls.Add(this.btnShow);\n this.groupBox4.Controls.Add(this.smartLabel4);\n this.groupBox4.Controls.Add(this.cboReceivingNurseStation);\n this.groupBox4.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n this.groupBox4.ForeColor = System.Drawing.Color.DarkBlue;\n this.groupBox4.Location = new System.Drawing.Point(3, 2);\n this.groupBox4.Name = \"groupBox4\";\n this.groupBox4.Size = new System.Drawing.Size(1256, 104);\n this.groupBox4.TabIndex = 5;\n this.groupBox4.TabStop = false;\n this.groupBox4.MouseHover += new System.EventHandler(this.groupBox4_MouseHover);\n // \n // btnShow\n // \n this.btnShow.BackColor = System.Drawing.Color.DarkSalmon;\n this.btnShow.Location = new System.Drawing.Point(540, 40);\n this.btnShow.Name = \"btnShow\";\n this.btnShow.Size = new System.Drawing.Size(238, 30);\n this.btnShow.TabIndex = 158;\n this.btnShow.Text = \"Click Patient List to Add Diet\";\n this.btnShow.UseVisualStyleBackColor = false;\n this.btnShow.Click += new System.EventHandler(this.btnShow_Click);\n // \n // smartLabel4\n // \n this.smartLabel4.AutoSize = true;\n this.smartLabel4.BackColor = System.Drawing.Color.PaleTurquoise;\n this.smartLabel4.Font = new System.Drawing.Font(\"Times New Roman\", 9.75F, System.Drawing.FontStyle.Bold);\n this.smartLabel4.Location = new System.Drawing.Point(42, 46);\n this.smartLabel4.Name = \"smartLabel4\";\n this.smartLabel4.Size = new System.Drawing.Size(120, 15);\n this.smartLabel4.TabIndex = 157;\n this.smartLabel4.Text = \"Select Nurse Station\";\n // \n // cboReceivingNurseStation\n // \n this.cboReceivingNurseStation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\n this.cboReceivingNurseStation.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n this.cboReceivingNurseStation.ForeColor = System.Drawing.Color.Blue;\n this.cboReceivingNurseStation.FormattingEnabled = true;\n this.cboReceivingNurseStation.Items.AddRange(new object[] {\n \"1\",\n \"2\"});\n this.cboReceivingNurseStation.Location = new System.Drawing.Point(168, 43);\n this.cboReceivingNurseStation.Name = \"cboReceivingNurseStation\";\n this.cboReceivingNurseStation.Size = new System.Drawing.Size(356, 26);\n this.cboReceivingNurseStation.TabIndex = 156;\n // \n // dgvDietList\n // \n this.dgvDietList.AllowUserToAddRows = false;\n this.dgvDietList.AllowUserToDeleteRows = false;\n this.dgvDietList.AllowUserToOrderColumns = true;\n this.dgvDietList.AllowUserToResizeColumns = false;\n this.dgvDietList.AllowUserToResizeRows = false;\n this.dgvDietList.BackgroundColor = System.Drawing.Color.White;\n this.dgvDietList.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;\n dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\n dataGridViewCellStyle1.BackColor = System.Drawing.Color.LightGreen;\n dataGridViewCellStyle1.Font = new System.Drawing.Font(\"Tahoma\", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n dataGridViewCellStyle1.ForeColor = System.Drawing.Color.Black;\n dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;\n this.dgvDietList.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;\n this.dgvDietList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;\n dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\n dataGridViewCellStyle2.BackColor = System.Drawing.Color.White;\n dataGridViewCellStyle2.Font = new System.Drawing.Font(\"Tahoma\", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n dataGridViewCellStyle2.ForeColor = System.Drawing.Color.Black;\n dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.Lavender;\n dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Crimson;\n dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\n this.dgvDietList.DefaultCellStyle = dataGridViewCellStyle2;\n this.dgvDietList.Location = new System.Drawing.Point(865, 75);\n this.dgvDietList.MultiSelect = false;\n this.dgvDietList.Name = \"dgvDietList\";\n this.dgvDietList.RowHeadersVisible = false;\n dataGridViewCellStyle3.BackColor = System.Drawing.Color.White;\n this.dgvDietList.RowsDefaultCellStyle = dataGridViewCellStyle3;\n this.dgvDietList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;\n this.dgvDietList.Size = new System.Drawing.Size(272, 395);\n this.dgvDietList.TabIndex = 159;\n this.dgvDietList.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvDietList_CellMouseDoubleClick);\n // \n // dgvPatientList\n // \n this.dgvPatientList.AllowUserToAddRows = false;\n this.dgvPatientList.AllowUserToDeleteRows = false;\n this.dgvPatientList.AllowUserToOrderColumns = true;\n this.dgvPatientList.AllowUserToResizeColumns = false;\n this.dgvPatientList.AllowUserToResizeRows = false;\n this.dgvPatientList.BackgroundColor = System.Drawing.Color.White;\n this.dgvPatientList.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;\n dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\n dataGridViewCellStyle4.BackColor = System.Drawing.Color.LightGreen;\n dataGridViewCellStyle4.Font = new System.Drawing.Font(\"Tahoma\", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n dataGridViewCellStyle4.ForeColor = System.Drawing.Color.Black;\n dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;\n this.dgvPatientList.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;\n this.dgvPatientList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;\n dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\n dataGridViewCellStyle5.BackColor = System.Drawing.Color.White;\n dataGridViewCellStyle5.Font = new System.Drawing.Font(\"Tahoma\", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n dataGridViewCellStyle5.ForeColor = System.Drawing.Color.Black;\n dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.Lavender;\n dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.Crimson;\n dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\n this.dgvPatientList.DefaultCellStyle = dataGridViewCellStyle5;\n this.dgvPatientList.Location = new System.Drawing.Point(2, 106);\n this.dgvPatientList.MultiSelect = false;\n this.dgvPatientList.Name = \"dgvPatientList\";\n this.dgvPatientList.RowHeadersVisible = false;\n dataGridViewCellStyle6.BackColor = System.Drawing.Color.White;\n this.dgvPatientList.RowsDefaultCellStyle = dataGridViewCellStyle6;\n this.dgvPatientList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;\n this.dgvPatientList.Size = new System.Drawing.Size(1253, 497);\n this.dgvPatientList.TabIndex = 6;\n this.dgvPatientList.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPatientList_CellClick);\n // \n // txtAdmissionID\n // \n this.txtAdmissionID.Location = new System.Drawing.Point(916, 9);\n this.txtAdmissionID.Name = \"txtAdmissionID\";\n this.txtAdmissionID.Size = new System.Drawing.Size(100, 20);\n this.txtAdmissionID.TabIndex = 161;\n this.txtAdmissionID.Visible = false;\n // \n // txtDeitID\n // \n this.txtDeitID.Location = new System.Drawing.Point(1022, 7);\n this.txtDeitID.Name = \"txtDeitID\";\n this.txtDeitID.Size = new System.Drawing.Size(100, 20);\n this.txtDeitID.TabIndex = 162;\n this.txtDeitID.Visible = false;\n // \n // frmPatientListDietAssign\n // \n this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n this.ClientSize = new System.Drawing.Size(1260, 734);\n this.isEnterTabAllow = true;\n this.Name = \"frmPatientListDietAssign\";\n this.Load += new System.EventHandler(this.frmPatientList_Load);\n this.pnlMain.ResumeLayout(false);\n this.pnlTop.ResumeLayout(false);\n this.pnlTop.PerformLayout();\n this.groupBox4.ResumeLayout(false);\n this.groupBox4.PerformLayout();\n ((System.ComponentModel.ISupportInitialize)(this.dgvDietList)).EndInit();\n ((System.ComponentModel.ISupportInitialize)(this.dgvPatientList)).EndInit();\n this.ResumeLayout(false);\n\n }\n\n #endregion\n\n private System.Windows.Forms.GroupBox groupBox4;\n private AtiqsControlLibrary.SmartDataGridView dgvPatientList;\n private AtiqsControlLibrary.SmartLabel smartLabel4;\n private AtiqsControlLibrary.SmartComboBox cboReceivingNurseStation;\n private System.Windows.Forms.Button btnShow;\n public System.Windows.Forms.TextBox txtAdmissionID;\n public System.Windows.Forms.TextBox txtDeitID;\n private AtiqsControlLibrary.SmartDataGridView dgvDietList;\n\n }\n}\n", "meta": {"content_hash": "7577a20e44e72cb7e2da2aed635be20c", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 184, "avg_line_length": 56.45454545454545, "alnum_prop": 0.6495726495726496, "repo_name": "atiq-shumon/DotNetProjects", "id": "63424a60f594df942497663d5c4bfb6bbaeb0f9a", "size": "16148", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Hospital_ERP_VS13-WCF_WF/AH.ModuleController/UI/DIET/Forms/frmPatientListDietAssign.Designer.cs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ASP", "bytes": "1059021"}, {"name": "C#", "bytes": "39389238"}, {"name": "CSS", "bytes": "683218"}, {"name": "HTML", "bytes": "44772"}, {"name": "JavaScript", "bytes": "1343054"}, {"name": "PLpgSQL", "bytes": "340074"}, {"name": "Pascal", "bytes": "81971"}, {"name": "PowerShell", "bytes": "175142"}, {"name": "Puppet", "bytes": "2111"}, {"name": "Smalltalk", "bytes": "9"}, {"name": "XSLT", "bytes": "12347"}]}} +{"text": "\npackage org.medipi.clinical.dao;\n\nimport java.util.List;\nimport org.medipi.clinical.entities.PatientGroup;\nimport org.springframework.stereotype.Repository;\n\n/**\n * Implementation of Data Access Object for Patient\n * @author rick@robinsonhq.com\n */\n@Repository\npublic class PatientGroupDAOImpl extends GenericDAOImpl<PatientGroup> implements PatientGroupDAO {\n @Override\n public List<PatientGroup> getAllGroups() {\n return this.getEntityManager().createNamedQuery(\"PatientGroup.findAll\", PatientGroup.class)\n .getResultList();\n }\n}", "meta": {"content_hash": "3bf94388278a7d76abcb340256e75471", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 99, "avg_line_length": 29.63157894736842, "alnum_prop": 0.7602131438721137, "repo_name": "Samuel789/MediPi", "id": "33522f5a6540bd8fb6f89dd443207ac049bb383a", "size": "1167", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Clinician/MediPiClinical/src/main/java/org/medipi/clinical/dao/PatientGroupDAOImpl.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "10012"}, {"name": "CSS", "bytes": "847678"}, {"name": "HTML", "bytes": "4238145"}, {"name": "Java", "bytes": "1942198"}, {"name": "JavaScript", "bytes": "2308166"}, {"name": "PHP", "bytes": "1684"}, {"name": "Python", "bytes": "66091"}, {"name": "Ruby", "bytes": "1183"}, {"name": "Shell", "bytes": "17053"}]}} +{"text": "package enums;\n\npublic enum GameStatusType {\n\tGAME_WAITING,\n\tGAME_READY,\n\tGAME_PAUSE,\n\tGAME_RUNNING,\n\tGAME_END\n}\n", "meta": {"content_hash": "f493082fa8f2d360462e63e43976d837", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 28, "avg_line_length": 12.555555555555555, "alnum_prop": 0.7345132743362832, "repo_name": "ptutak/Warcaby", "id": "b49884d68c81fb001a43a5b878b7d5aac2c17e36", "size": "701", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/enums/GameStatusType.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "103900"}]}} +{"text": "package com.taotao.model;\n\nimport java.util.Date;\n\n/**\n * TITLE:\u5e7f\u544a\u7684model\n * USER:TAOTK\n * DATA:2016/9/14\n * TIME:10:48\n * COMPANY:www.51pjia.com\n */\npublic class PjPoster {\n\n private Integer id; //int(11) NOT NULL,\n private Integer category_id;// int(11) DEFAULT NULL,\n private String category_name; //varchar(32) DEFAULT NULL,\n private Integer poster_sort; //int(11) DEFAULT NULL,\n private String poster_url; //varchar(50) DEFAULT NULL,\n private String poster_size; //varchar(32) DEFAULT NULL,\n private Date create_time;//datetime DEFAULT NULL,\n private Integer poster_status; //int(11) DEFAULT NULL,\n private Integer poster_address;\n private String categoryName;\n private String poster_small_url;//\u5c0f\u56fe\u7247\n\n public String getPoster_small_url() {\n return poster_small_url;\n }\n public void setPoster_small_url(String poster_small_url) {\n this.poster_small_url = poster_small_url;\n }\n public String getCategoryName() {\n return categoryName;\n }\n\n public void setCategoryName(String categoryName) {\n this.categoryName = categoryName;\n }\n\n public Integer getPoster_address() {\n return poster_address;\n }\n\n public void setPoster_address(Integer poster_address) {\n this.poster_address = poster_address;\n }\n\n public Integer getId() {\n return id;\n }\n\n public void setId(Integer id) {\n this.id = id;\n }\n\n public Integer getCategory_id() {\n return category_id;\n }\n\n public void setCategory_id(Integer category_id) {\n this.category_id = category_id;\n }\n\n public String getCategory_name() {\n return category_name;\n }\n\n public void setCategory_name(String category_name) {\n this.category_name = category_name;\n }\n\n public Integer getPoster_sort() {\n return poster_sort;\n }\n\n public void setPoster_sort(Integer poster_sort) {\n this.poster_sort = poster_sort;\n }\n\n public String getPoster_url() {\n return poster_url;\n }\n\n public void setPoster_url(String poster_url) {\n this.poster_url = poster_url;\n }\n\n public String getPoster_size() {\n return poster_size;\n }\n\n public void setPoster_size(String poster_size) {\n this.poster_size = poster_size;\n }\n\n public Date getCreate_time() {\n return create_time;\n }\n\n public void setCreate_time(Date create_time) {\n this.create_time = create_time;\n }\n\n public Integer getPoster_status() {\n return poster_status;\n }\n\n public void setPoster_status(Integer poster_status) {\n this.poster_status = poster_status;\n }\n\n\n @Override\n public String toString() {\n return \"PjPoster{\" +\n \"id=\" + id +\n \", category_id=\" + category_id +\n \", category_name='\" + category_name + '\\'' +\n \", poster_sort=\" + poster_sort +\n \", poster_url='\" + poster_url + '\\'' +\n \", poster_size='\" + poster_size + '\\'' +\n \", create_time=\" + create_time +\n \", poster_status=\" + poster_status +\n \", poster_address=\" + poster_address +\n \", categoryName='\" + categoryName + '\\'' +\n \", poster_small_url='\" + poster_small_url + '\\'' +\n '}';\n }\n}\n", "meta": {"content_hash": "7ab49f595d4875b5c338cb3b1ae66c93", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 66, "avg_line_length": 25.88372093023256, "alnum_prop": 0.5882000598981731, "repo_name": "17755332301/Tao-", "id": "c90f72f6b45864fc59a103913265bc15df0b29bc", "size": "3351", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "taotao-web/src/main/java/com/taotao/model/PjPoster.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ASP", "bytes": "31784"}, {"name": "C#", "bytes": "16030"}, {"name": "CSS", "bytes": "625671"}, {"name": "HTML", "bytes": "558187"}, {"name": "Java", "bytes": "280551"}, {"name": "JavaScript", "bytes": "4548934"}, {"name": "PHP", "bytes": "32951"}]}} +{"text": "'use strict';\nvar $;\nvar _default = {\n\t'emission': '-',\n\t'qte': '-',\n\t'dist': '-'\n};\n\nfunction toggleCentre(type) {\n\tvar selector = ['.from-', ', .to-', ''].join(type + ' circle');\n\t$(selector).attr('r', function (idx, old) {return !old; })\n\t.toggleClass('highlight')\n\t;\n}\n\n/**\n * Toggle visibility of given route type. If 'type' is 'route' then display all types\n * @param {[type]} type of routes to display.\n * @param {[type]} state of input (checked or not)\n */\nfunction toggleRoute(type, state) {\n\tvar routeSet;\n\trouteSet = (type === 'route' ? $('.route')\n\t\t\t\t\t: $('.route.from-' + type + ', .route.to-' + type)\n\t\t\t\t);\n\n\trouteSet\n\t\t.attr('marker-mid', function (i, val) {return state ? 'url(#arw-mid)' : ''; })\n\t\t.attr('marker-end', function (i, val) {return state ? 'url(#arw-end)' : ''; })\n\t\t.toggleClass('show')\n\t;\n}\n\n/**\n * Sum values from 'selector' items list\n * @param {string} selector selector\n * @return {int} sum\n*/\nfunction sumData(selector) {\n\tvar sum = 0;\n\tvar formatNumber = d3.format(',.0f');\n\n\t$(selector).each(function () {\n\t\tsum += +$(this).text().replace(/(k[gm]| t)/i, '');\n\t});\n\treturn formatNumber(Math.round(sum)).replace(/,/, ' ');\n}\n\n\nfunction updateTotal() {\n\n}\n\n$('input.route').change(function () {\n\tvar type = $(this).attr('id').replace('centre-', '');\n\t$('path.route').toggleClass('show');\n\ttoggleRoute(type, $(this).prop('checked'));\n\t$('#centre-epci, #centre-transfert, #centre-traitement')\n\t\t.attr('disabled', function (idx, old) {\n\t\t\treturn !old;\n\t\t});\n});\n$('input.emission').change(function () {\n\t$('text.emission').toggleClass('show');\n\t$('.emission .value').text(function (idx, old) {\n\t\treturn (old === _default.emission ? sumData('svg text.emission'): _default.emission);\n\t});\n});\n$('input.qte').change(function () {\n\t$('text.qte').toggleClass('show');\n\t$('.qte .value').text(function (idx, old) {\n\t\treturn (old === _default.qte ? sumData('svg text.qte'): _default.qte);\n\t});\n});\n$('input.dist').change(function () {\n\t$('text.dist').toggleClass('show');\n\t$('.dist .value').text(function (idx, old) {\n\t\treturn (old === _default.dist ? sumData('svg text.dist'): _default.dist);\n\t});\n});\n\n$('input').change(function () {\n\tvar type = $(this).attr('id').replace('centre-', '');\n\ttoggleCentre(type);\n\ttoggleRoute(type, $(this).prop('checked'));\n});\n\n\n/**\n * Update counter with data from given entity\n * @param {string} id entity id (used as selector)\n * @return {void} directly update UI\n */\nfunction updateCounter(id) {\n\t$('.emission .value').text(function () {\n\t\treturn sumData('svg text' + '.' + idify(id) + '.emission');\n\t});\n\t$('.qte .value').text(function () {\n\t\treturn sumData('svg text' + '.' + idify(id) + '.qte');\n\t});\n\t$('.dist .value').text(function () {\n\t\treturn sumData('svg text' + '.' + idify(id) + '.dist');\n\t});\n}\n\n/**\n * Highlight entity's area\n * @param {string} eid entity's id\n * @return {void} directly update UI\n */\nfunction highlightEntity(eid) {\n\t// reset style on others elements\n\td3.selectAll('.entity').classed('active', false);\n\n\t// apply style to element(s)\n\td3.select('.entity.' + eid).classed('active', true);\n}\n\n/**\n * Show entity's *label*\n * @param {string} eid entity's id\n * @return {void} directly update UI\n */\nfunction showEntityLabel(eid) {\n\td3.selectAll('.entity-label').classed('show', false);\n\td3.selectAll('.entity-label.' + eid).classed('show', true);\n}\n\n/**\n * Show entity's *routes*\n * @param {string} eid entity's id\n * @return {void} directly update UI\n */\nfunction showEntityRoute(eid) {\n\td3.selectAll('.route')\n\t\t.classed('show', false)\n\t\t.attr('marker-mid', null)\n\t\t.attr('marker-end', null)\n\t;\n\td3.selectAll('.route.' + eid)\n\t\t.classed('show', true)\n\t\t.attr('marker-mid', 'url(#arw-mid)')\n\t\t.attr('marker-end', 'url(#arw-end)')\n\t;\n}", "meta": {"content_hash": "7f49a82e511dfbb1990e3eb35005e8a0", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 87, "avg_line_length": 25.917241379310344, "alnum_prop": 0.6003193187865886, "repo_name": "edouard-lopez/ECV-IJBA", "id": "b277ac6769c9e9281f4a5287b6adb9dffac04376", "size": "3758", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/scripts/ui.utils.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "30095"}, {"name": "JavaScript", "bytes": "24947"}]}} +{"text": "package org.radargun.stages.cache.generators;\n\nimport java.io.Serializable;\nimport java.lang.annotation.Annotation;\nimport java.lang.reflect.Constructor;\nimport java.util.Random;\n\nimport org.radargun.config.DefinitionElement;\nimport org.radargun.config.Init;\nimport org.radargun.config.Property;\nimport org.radargun.logging.Log;\nimport org.radargun.logging.LogFactory;\n\n/**\n * @author Radim Vansa <rvansa@redhat.com>\n */\n@DefinitionElement(name = \"jpa\", doc = \"Instantiates JPA entities. The constructor for the entities must match to the generateValue() method.\")\npublic class JpaValueGenerator implements ValueGenerator {\n protected static Log log = LogFactory.getLog(JpaValueGenerator.class);\n\n @Property(name = \"class\", doc = \"Fully qualified name of the value class.\", optional = false)\n private String clazzName;\n\n private Class<?> clazz;\n private Class<? extends Annotation> entityClazz;\n private Constructor<?> ctor;\n\n @Init\n public void init() {\n try {\n entityClazz = (Class<? extends Annotation>) Class.forName(\"javax.persistence.Entity\");\n clazz = Class.forName(clazzName);\n if (!clazz.isAnnotationPresent(entityClazz)) {\n throw new IllegalArgumentException(\"Class \" + clazz.getName() + \" is not an entity - no @Entity present\");\n }\n ctor = clazz.getConstructor(Object.class, int.class, Random.class);\n } catch (Exception e) {\n // trace as this can happen on master node\n log.trace(\"Could not initialize generator \" + this, e);\n }\n }\n\n @Override\n public Object generateValue(Object key, int size, Random random) {\n if (ctor == null) throw new IllegalStateException(\"The generator was not properly initialized\");\n try {\n return ctor.newInstance(key, size, random);\n } catch (Exception e) {\n throw new IllegalStateException(e);\n }\n }\n\n @Override\n public int sizeOf(Object value) {\n if (value instanceof JpaValue) {\n return ((JpaValue) value).size();\n } else {\n throw new IllegalArgumentException();\n }\n }\n\n @Override\n public boolean checkValue(Object value, Object key, int expectedSize) {\n if (clazz == null) throw new IllegalStateException(\"The generator was not properly initialized\");\n return clazz.isInstance(value) && ((JpaValue) value).check(expectedSize);\n }\n\n public static String getRandomString(int size, Random random) {\n StringBuilder sb = new StringBuilder(size);\n for (int i = 0; i < size; ++i) {\n sb.append((char) (random.nextInt(26) + 'A'));\n }\n return sb.toString();\n }\n\n public abstract static class JpaValue implements Serializable {\n public int size() {\n throw new UnsupportedOperationException();\n }\n\n public boolean check(int expectedSize) {\n return true;\n }\n }\n\n}\n", "meta": {"content_hash": "c5f03379a0c571b80855feb4f6da4571", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 143, "avg_line_length": 33.372093023255815, "alnum_prop": 0.6721254355400696, "repo_name": "rmacor/radargun", "id": "f132c47f96782b6dc7cb7cbe91a98983f4bdbf73", "size": "2870", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "extensions/cache/src/main/java/org/radargun/stages/cache/generators/JpaValueGenerator.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "1168"}, {"name": "FreeMarker", "bytes": "31553"}, {"name": "Java", "bytes": "1681217"}, {"name": "JavaScript", "bytes": "1900"}, {"name": "Protocol Buffer", "bytes": "809"}, {"name": "Python", "bytes": "625"}, {"name": "Shell", "bytes": "33354"}]}} +{"text": "\n\n\n#include \"mitkGeometry2D.h\"\n#include <vtkTransform.h>\n\n\nmitk::Geometry2D::Geometry2D()\n : m_ScaleFactorMMPerUnitX( 1.0 ),\n m_ScaleFactorMMPerUnitY( 1.0 ),\n m_ReferenceGeometry( NULL )\n{\n}\n\nmitk::Geometry2D::Geometry2D(const Geometry2D& other)\n : Geometry3D(other), m_ScaleFactorMMPerUnitX( other.m_ScaleFactorMMPerUnitX),\n m_ScaleFactorMMPerUnitY( other.m_ScaleFactorMMPerUnitY),\n m_ReferenceGeometry( other.m_ReferenceGeometry )\n{\n}\n\n\n\nmitk::Geometry2D::~Geometry2D()\n{\n}\n\n\nvoid\nmitk::Geometry2D::SetIndexToWorldTransform(\n mitk::AffineTransform3D* transform)\n{\n Superclass::SetIndexToWorldTransform(transform);\n\n m_ScaleFactorMMPerUnitX=GetExtentInMM(0)/GetExtent(0);\n m_ScaleFactorMMPerUnitY=GetExtentInMM(1)/GetExtent(1);\n\n assert(m_ScaleFactorMMPerUnitX<ScalarTypeNumericTraits::infinity());\n assert(m_ScaleFactorMMPerUnitY<ScalarTypeNumericTraits::infinity());\n}\n\n\nvoid\nmitk::Geometry2D::SetExtentInMM(int direction, ScalarType extentInMM)\n{\n Superclass::SetExtentInMM(direction, extentInMM);\n\n m_ScaleFactorMMPerUnitX=GetExtentInMM(0)/GetExtent(0);\n m_ScaleFactorMMPerUnitY=GetExtentInMM(1)/GetExtent(1);\n\n assert(m_ScaleFactorMMPerUnitX<ScalarTypeNumericTraits::infinity());\n assert(m_ScaleFactorMMPerUnitY<ScalarTypeNumericTraits::infinity());\n}\n\n\nbool\nmitk::Geometry2D::Map(\n const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const\n{\n assert(m_BoundingBox.IsNotNull());\n\n Point3D pt3d_units;\n BackTransform(pt3d_mm, pt3d_units);\n pt2d_mm[0]=pt3d_units[0]*m_ScaleFactorMMPerUnitX;\n pt2d_mm[1]=pt3d_units[1]*m_ScaleFactorMMPerUnitY;\n pt3d_units[2]=0;\n return const_cast<BoundingBox*>(m_BoundingBox.GetPointer())->IsInside(pt3d_units);\n}\n\n\nvoid\nmitk::Geometry2D::Map(const mitk::Point2D &pt2d_mm, mitk::Point3D &pt3d_mm) const\n{\n Point3D pt3d_units;\n pt3d_units[0]=pt2d_mm[0]/m_ScaleFactorMMPerUnitX;\n pt3d_units[1]=pt2d_mm[1]/m_ScaleFactorMMPerUnitY;\n pt3d_units[2]=0;\n pt3d_mm = GetParametricTransform()->TransformPoint(pt3d_units);\n}\n\n\nvoid\nmitk::Geometry2D::IndexToWorld(\n const mitk::Point2D &/*pt_units*/, mitk::Point2D &/*pt_mm*/) const\n{\n itkExceptionMacro(<< \"No general transform possible (only affine) ==> no general\" \\\n \" IndexToWorld(const mitk::Point2D &pt_mm, mitk::Point2D &pt_units)\" \\\n \" possible. Has to be implemented in sub-class.\");\n}\n\n\nvoid\nmitk::Geometry2D::WorldToIndex(\n const mitk::Point2D &/*pt_mm*/, mitk::Point2D &/*pt_units*/) const\n{\n itkExceptionMacro(<< \"No general back transform possible (only affine) ==> no general\" \\\n \" WorldToIndex(const mitk::Point2D &pt_mm, mitk::Point2D &pt_units)\" \\\n \" possible. Has to be implemented in sub-class.\");\n}\n\n\nvoid\nmitk::Geometry2D::IndexToWorld(const mitk::Point2D &/*atPt2d_units*/,\n const mitk::Vector2D &/*vec_units*/, mitk::Vector2D &/*vec_mm*/) const\n{\n itkExceptionMacro(<< \"No general transform possible (only affine) ==> no general\" \\\n \" IndexToWorld(const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units)\" \\\n \" possible. Has to be implemented in sub-class.\");\n}\n\n\nvoid\nmitk::Geometry2D::WorldToIndex(const mitk::Point2D &/*atPt2d_mm*/,\n const mitk::Vector2D &/*vec_mm*/, mitk::Vector2D &/*vec_units*/) const\n{\n itkExceptionMacro(<< \"No general back transform possible (only affine) ==> no general\" \\\n \" WorldToIndex(const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units)\" \\\n \" possible. Has to be implemented in sub-class.\");\n}\n\nvoid\nmitk::Geometry2D::SetSizeInUnits(mitk::ScalarType width, mitk::ScalarType height)\n{\n ScalarType bounds[6]={0, width, 0, height, 0, 1};\n ScalarType extent, newextentInMM;\n if(GetExtent(0)>0)\n {\n extent = GetExtent(0);\n if(width>extent)\n newextentInMM = GetExtentInMM(0)/width*extent;\n else\n newextentInMM = GetExtentInMM(0)*extent/width;\n SetExtentInMM(0, newextentInMM);\n }\n if(GetExtent(1)>0)\n {\n extent = GetExtent(1);\n if(width>extent)\n newextentInMM = GetExtentInMM(1)/height*extent;\n else\n newextentInMM = GetExtentInMM(1)*extent/height;\n SetExtentInMM(1, newextentInMM);\n }\n SetBounds(bounds);\n}\n\n\nbool\nmitk::Geometry2D::Project(\n const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm) const\n{\n assert(m_BoundingBox.IsNotNull());\n\n Point3D pt3d_units;\n BackTransform(pt3d_mm, pt3d_units);\n pt3d_units[2] = 0;\n projectedPt3d_mm = GetParametricTransform()->TransformPoint(pt3d_units);\n return const_cast<BoundingBox*>(m_BoundingBox.GetPointer())->IsInside(pt3d_units);\n}\n\nbool\nmitk::Geometry2D::Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const\n{\n assert(m_BoundingBox.IsNotNull());\n\n Vector3D vec3d_units;\n BackTransform(vec3d_mm, vec3d_units);\n vec3d_units[2] = 0;\n projectedVec3d_mm = GetParametricTransform()->TransformVector(vec3d_units);\n return true;\n}\n\nbool\nmitk::Geometry2D::Project(const mitk::Point3D & atPt3d_mm,\n const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const\n{\n MITK_WARN << \"Deprecated function! Call Project(vec3D,vec3D) instead.\";\n assert(m_BoundingBox.IsNotNull());\n\n Vector3D vec3d_units;\n BackTransform(atPt3d_mm, vec3d_mm, vec3d_units);\n vec3d_units[2] = 0;\n projectedVec3d_mm = GetParametricTransform()->TransformVector(vec3d_units);\n\n Point3D pt3d_units;\n BackTransform(atPt3d_mm, pt3d_units);\n return const_cast<BoundingBox*>(m_BoundingBox.GetPointer())->IsInside(pt3d_units);\n}\n\n\nbool\nmitk::Geometry2D::Map(const mitk::Point3D & atPt3d_mm,\n const mitk::Vector3D &vec3d_mm, mitk::Vector2D &vec2d_mm) const\n{\n Point2D pt2d_mm_start, pt2d_mm_end;\n Point3D pt3d_mm_end;\n bool inside=Map(atPt3d_mm, pt2d_mm_start);\n pt3d_mm_end = atPt3d_mm+vec3d_mm;\n inside&=Map(pt3d_mm_end, pt2d_mm_end);\n vec2d_mm=pt2d_mm_end-pt2d_mm_start;\n return inside;\n}\n\n\nvoid\nmitk::Geometry2D::Map(const mitk::Point2D &/*atPt2d_mm*/,\n const mitk::Vector2D &/*vec2d_mm*/, mitk::Vector3D &/*vec3d_mm*/) const\n{\n //@todo implement parallel to the other Map method!\n assert(false);\n}\n\n\nmitk::ScalarType\nmitk::Geometry2D::SignedDistance(const mitk::Point3D& pt3d_mm) const\n{\n Point3D projectedPoint;\n Project(pt3d_mm, projectedPoint);\n Vector3D direction = pt3d_mm-projectedPoint;\n ScalarType distance = direction.GetNorm();\n\n if(IsAbove(pt3d_mm) == false)\n distance*=-1.0;\n\n return distance;\n}\n\nbool\nmitk::Geometry2D::IsAbove(const mitk::Point3D& pt3d_mm) const\n{\n Point3D pt3d_units;\n Geometry3D::WorldToIndex(pt3d_mm, pt3d_units);\n return (pt3d_units[2] > m_BoundingBox->GetBounds()[4]);\n}\n\nitk::LightObject::Pointer\nmitk::Geometry2D::InternalClone() const\n{\n Self::Pointer newGeometry = new Geometry2D(*this);\n newGeometry->UnRegister();\n return newGeometry.GetPointer();\n}\n\nvoid\nmitk::Geometry2D::PrintSelf(std::ostream& os, itk::Indent indent) const\n{\n Superclass::PrintSelf(os,indent);\n os << indent << \" ScaleFactorMMPerUnitX: \"\n << m_ScaleFactorMMPerUnitX << std::endl;\n os << indent << \" ScaleFactorMMPerUnitY: \"\n << m_ScaleFactorMMPerUnitY << std::endl;\n}\n\nvoid\nmitk::Geometry2D::SetReferenceGeometry( mitk::Geometry3D *geometry )\n{\n m_ReferenceGeometry = geometry;\n}\n\nmitk::Geometry3D *\nmitk::Geometry2D::GetReferenceGeometry() const\n{\n return m_ReferenceGeometry;\n}\n\nbool\nmitk::Geometry2D::HasReferenceGeometry() const\n{\n return ( m_ReferenceGeometry != NULL );\n}\n", "meta": {"content_hash": "d76ad4d788fa7a514bf6dab0c34c7577", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 98, "avg_line_length": 27.02962962962963, "alnum_prop": 0.7158125513839408, "repo_name": "nocnokneo/MITK", "id": "6f23c9171007a8f9826011462cd9b16b7117cf21", "size": "7796", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Core/Code/DataManagement/mitkGeometry2D.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "5991982"}, {"name": "C++", "bytes": "29934042"}, {"name": "CSS", "bytes": "52056"}, {"name": "IDL", "bytes": "5583"}, {"name": "Java", "bytes": "350330"}, {"name": "JavaScript", "bytes": "287054"}, {"name": "Objective-C", "bytes": "606620"}, {"name": "Perl", "bytes": "982"}, {"name": "Python", "bytes": "7545"}, {"name": "Shell", "bytes": "5438"}, {"name": "TeX", "bytes": "1204"}, {"name": "XSLT", "bytes": "30684"}]}} +{"text": "<?php\n\n\n/**\n * csv import class for the addressbook\n * \n * @package Addressbook\n * @subpackage Import\n */\nclass Addressbook_Import_Csv extends Tinebase_Import_Csv_Abstract\n{\n /**\n * additional config options\n * \n * @var array\n */\n protected $_additionalOptions = array(\n 'container_id' => '',\n );\n \n /**\n * creates a new importer from an importexport definition\n * \n * @param Tinebase_Model_ImportExportDefinition $_definition\n * @param array $_options\n * @return Calendar_Import_Ical\n * \n * @todo move this to abstract when we no longer need to be php 5.2 compatible\n */\n public static function createFromDefinition(Tinebase_Model_ImportExportDefinition $_definition, array $_options = array())\n {\n return new Addressbook_Import_Csv(self::getOptionsArrayFromDefinition($_definition, $_options));\n }\n\n /**\n * constructs a new importer from given config\n * \n * @param array $_options\n */\n public function __construct(array $_options = array())\n {\n parent::__construct($_options);\n \n // don't set geodata for imported contacts as this is too much traffic for the nominatim server\n $this->_controller->setGeoDataForContacts(FALSE);\n \n // get container id from default container if not set\n if (empty($this->_options['container_id'])) {\n $defaultContainer = $this->_controller->getDefaultAddressbook();\n $this->_options['container_id'] = $defaultContainer->getId();\n if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Setting default container id: ' . $this->_options['container_id']);\n }\n }\n \n /**\n * add some more values (container id)\n *\n * @return array\n */\n protected function _addData()\n {\n $result['container_id'] = $this->_options['container_id'];\n return $result;\n }\n \n /**\n * do conversions\n * -> sanitize account_id\n *\n * @param array $_data\n * @return array\n */\n protected function _doConversions($_data)\n {\n $result = parent::_doConversions($_data);\n \n // unset account id\n if (isset($result['account_id']) && empty($result['account_id'])) {\n unset($result['account_id']);\n }\n \n if (empty($result['n_family']) && empty($result['org_name'])) {\n if (isset($result['n_fn'])) {\n $result['n_family'] = $result['n_fn'];\n } else {\n $result['n_family'] = 'imported';\n }\n } \n \n return $result;\n }\n}\n", "meta": {"content_hash": "4692399acf338869828c25c6dbb75132", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 194, "avg_line_length": 29.76086956521739, "alnum_prop": 0.5525931336742148, "repo_name": "jodier/tmpdddf", "id": "b468cdaf95d593eab1dca2ab0396388e72686c02", "size": "3028", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/private/tine20/Addressbook/Import/Csv.php", "mode": "33188", "license": "mit", "language": [{"name": "PHP", "bytes": "44010"}, {"name": "Perl", "bytes": "794"}, {"name": "Shell", "bytes": "286"}]}} +{"text": "\npackage org.wildfly.swarm.cdi.jaxrsapi;\n\nimport org.wildfly.swarm.spi.api.Fraction;\nimport org.wildfly.swarm.spi.api.annotations.DeploymentModule;\n\n/**\n * @author Ken Finnigan\n */\n@DeploymentModule(name = \"org.wildfly.swarm.cdi.jaxrsapi\", slot = \"deployment\", export = true)\npublic class CDIJAXRSFraction implements Fraction<CDIJAXRSFraction> {\n}\n", "meta": {"content_hash": "7a285bf3ec4fc8c88860717e8f563c37", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 94, "avg_line_length": 29.0, "alnum_prop": 0.7758620689655172, "repo_name": "kenfinnigan/wildfly-swarm", "id": "c5af1c743f752005e3e18535b7ffaf281e618ee6", "size": "975", "binary": false, "copies": "14", "ref": "refs/heads/master", "path": "fractions/cdi-extensions/cdi-jaxrsapi/src/main/java/org/wildfly/swarm/cdi/jaxrsapi/CDIJAXRSFraction.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "5821"}, {"name": "HTML", "bytes": "7818"}, {"name": "Java", "bytes": "3295457"}, {"name": "JavaScript", "bytes": "13301"}, {"name": "Ruby", "bytes": "5349"}, {"name": "Shell", "bytes": "8275"}, {"name": "XSLT", "bytes": "20396"}]}} +{"text": "// REFACTOR IF POSSIBLE\n/**\n * Within Viewport\n *\n * @description Determines whether an element is completely\n * within the browser viewport\n * @author Craig Patik, http://patik.com/\n * @version 0.0.4\n * @date 2014-07-05\n */\n;(function() {\n /**\n * Determines whether an element is within the viewport\n * @param {Object} elem DOM Element (required)\n * @param {Object} options Optional settings\n * @return {Boolean} Whether the element was completely within the viewport\n */\n var withinViewport = function _withinViewport(elem, options) {\n var result = false,\n metadata = {},\n config = {},\n settings, useHtmlElem, isWithin, scrollOffset, elemOffset, arr, i, side;\n\n if (typeof jQuery !== 'undefined' && elem instanceof jQuery) {\n elem = elem.get(0);\n }\n\n if (typeof elem !== 'object' || elem.nodeType !== 1) {\n throw new Error('First argument must be an element');\n }\n\n if (elem.getAttribute('data-withinviewport-settings') && window.JSON) {\n metadata = JSON.parse(elem.getAttribute('data-withinviewport-settings'));\n }\n\n // Settings argument may be a simple string (`top`, `right`, etc)\n if (typeof options === 'string') {\n settings = {sides: options};\n }\n else {\n settings = options || {};\n }\n\n // Build configuration from defaults and given settings\n config.container = settings.container || metadata.container || withinViewport.defaults.container || document.body;\n config.sides = settings.sides || metadata.sides || withinViewport.defaults.sides || 'all';\n config.top = settings.top || metadata.top || withinViewport.defaults.top || 0;\n config.right = settings.right || metadata.right || withinViewport.defaults.right || 0;\n config.bottom = settings.bottom || metadata.bottom || withinViewport.defaults.bottom || 0;\n config.left = settings.left || metadata.left || withinViewport.defaults.left || 0;\n\n // Whether we can use the `<html`> element for `scrollTop`\n // Unfortunately at the moment I can't find a way to do this without UA-sniffing\n useHtmlElem = !/Chrome/.test(navigator.userAgent);\n\n // Element testing methods\n isWithin = {\n // Element is below the top edge of the viewport\n top: function _isWithin_top() {\n return elemOffset[1] >= scrollOffset[1] + config.top;\n },\n\n // Element is to the left of the right edge of the viewport\n right: function _isWithin_right() {\n var container = (config.container === document.body) ? window : config.container;\n\n return elemOffset[0] + elem.offsetWidth <= container.innerWidth + scrollOffset[0] - config.right;\n },\n\n // Element is above the bottom edge of the viewport\n bottom: function _isWithin_bottom() {\n var container = (config.container === document.body) ? window : config.container;\n\n return elemOffset[1] + elem.offsetHeight <= scrollOffset[1] + container.innerHeight - config.bottom;\n },\n\n // Element is to the right of the left edge of the viewport\n left: function _isWithin_left() {\n return elemOffset[0] >= scrollOffset[0] + config.left;\n },\n\n all: function _isWithin_all() {\n return (isWithin.top() && isWithin.right() && isWithin.bottom() && isWithin.left());\n }\n };\n\n // Current offset values\n scrollOffset = (function _scrollOffset() {\n var x = config.container.scrollLeft,\n y = config.container.scrollTop;\n\n if (y === 0) {\n if (config.container.pageYOffset) {\n y = config.container.pageYOffset;\n }\n else if (window.pageYOffset) {\n y = window.pageYOffset;\n }\n else {\n if (config.container === document.body) {\n if (useHtmlElem) {\n y = (config.container.parentElement) ? config.container.parentElement.scrollTop : 0;\n }\n else {\n y = (config.container.parentElement) ? config.container.parentElement.scrollTop : 0;\n }\n }\n else {\n y = (config.container.parentElement) ? config.container.parentElement.scrollTop : 0;\n }\n }\n }\n\n if (x === 0) {\n if (config.container.pageXOffset) {\n x = config.container.pageXOffset;\n }\n else if (window.pageXOffset) {\n x = window.pageXOffset;\n }\n else {\n if (config.container === document.body) {\n x = (config.container.parentElement) ? config.container.parentElement.scrollLeft : 0;\n }\n else {\n x = (config.container.parentElement) ? config.container.parentElement.scrollLeft : 0;\n }\n }\n }\n\n return [x, y];\n }());\n\n elemOffset = (function _elemOffset() {\n var el = elem,\n x = 0,\n y = 0;\n\n if (el.parentNode) {\n x = el.offsetLeft;\n y = el.offsetTop;\n\n el = el.parentNode;\n while (el) {\n if (el == config.container) {\n break;\n }\n\n x += el.offsetLeft;\n y += el.offsetTop;\n\n el = el.parentNode;\n }\n }\n\n return [x, y];\n })();\n\n // Test the element against each side of the viewport that was requested\n arr = config.sides.split(' ');\n i = arr.length;\n while (i--) {\n side = arr[i].toLowerCase();\n if (/top|right|bottom|left|all/.test(side)) {\n if (isWithin[side]()) {\n result = true;\n }\n else {\n result = false;\n // Quit as soon as the first failure is found\n break;\n }\n }\n }\n\n return result;\n }; // end of `withinViewport()`\n\n // Default settings\n withinViewport.prototype.defaults = {\n container: document.body,\n sides: 'all',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n\n withinViewport.defaults = withinViewport.prototype.defaults;\n\n // Make function available globally\n window.withinViewport = withinViewport;\n\n /**\n * Optional enhancements and shortcuts\n *\n * @description Uncomment or comment these pieces as they apply to your project and coding preferences\n */\n\n // Shortcut methods for each side of the viewport\n // Ex: withinViewport.top(elem) is the same as withinViewport(elem, 'top')\n withinViewport.prototype.top = function _withinViewport_top(element) {\n return withinViewport(element, 'top');\n };\n\n withinViewport.prototype.right = function _withinViewport_right(element) {\n return withinViewport(element, 'right');\n };\n\n withinViewport.prototype.bottom = function _withinViewport_bottom(element) {\n return withinViewport(element, 'bottom');\n };\n\n withinViewport.prototype.left = function _withinViewport_left(element) {\n return withinViewport(element, 'left');\n };\n}());", "meta": {"content_hash": "ebdf763bbe85efd426f5ce70a7d12c49", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 118, "avg_line_length": 31.387096774193548, "alnum_prop": 0.601673763030392, "repo_name": "clarat-org/clarat", "id": "bd811615e8745b7b69dd1e85a63e09b3efa74330", "size": "6811", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "app/assets/javascripts/vendor/inviewport.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "152114"}, {"name": "CoffeeScript", "bytes": "84489"}, {"name": "HTML", "bytes": "835592"}, {"name": "JavaScript", "bytes": "33443"}, {"name": "Ruby", "bytes": "216461"}, {"name": "Shell", "bytes": "373"}]}} +{"text": "\n\npackage com.microsoft.azure.management.network.v2019_08_01;\n\nimport java.util.List;\nimport com.microsoft.azure.management.network.v2019_08_01.implementation.SecurityRuleInner;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\n/**\n * Subnet and it's custom security rules.\n */\npublic class SubnetAssociation {\n /**\n * Subnet ID.\n */\n @JsonProperty(value = \"id\", access = JsonProperty.Access.WRITE_ONLY)\n private String id;\n\n /**\n * Collection of custom security rules.\n */\n @JsonProperty(value = \"securityRules\")\n private List<SecurityRuleInner> securityRules;\n\n /**\n * Get subnet ID.\n *\n * @return the id value\n */\n public String id() {\n return this.id;\n }\n\n /**\n * Get collection of custom security rules.\n *\n * @return the securityRules value\n */\n public List<SecurityRuleInner> securityRules() {\n return this.securityRules;\n }\n\n /**\n * Set collection of custom security rules.\n *\n * @param securityRules the securityRules value to set\n * @return the SubnetAssociation object itself.\n */\n public SubnetAssociation withSecurityRules(List<SecurityRuleInner> securityRules) {\n this.securityRules = securityRules;\n return this;\n }\n\n}\n", "meta": {"content_hash": "6e2519276d259d6f4c460690ffc2b435", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 91, "avg_line_length": 23.703703703703702, "alnum_prop": 0.6546875, "repo_name": "navalev/azure-sdk-for-java", "id": "17de1a8a17b3a29564b43b54bddcf28ccd71fc84", "size": "1510", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "sdk/network/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/network/v2019_08_01/SubnetAssociation.java", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "7230"}, {"name": "CSS", "bytes": "5411"}, {"name": "Groovy", "bytes": "1570436"}, {"name": "HTML", "bytes": "29221"}, {"name": "Java", "bytes": "250218562"}, {"name": "JavaScript", "bytes": "15605"}, {"name": "PowerShell", "bytes": "30924"}, {"name": "Python", "bytes": "42119"}, {"name": "Shell", "bytes": "1408"}]}} +{"text": "require 'active_record'\n\n# establish connection\nActiveRecord::Base.configurations = App.config.database_yml\nActiveRecord::Base.establish_connection App.config.database_settings\n\nif ActiveRecord::VERSION::MAJOR == 2\n\n class RubyAppDumpLogger\n def method_missing(method, *args)\n end\n end\n\n ActiveRecord::Base.logger = RubyAppDumpLogger.new\nend\n", "meta": {"content_hash": "a4201f433fc4e8a8bc513fb025509435", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 68, "avg_line_length": 23.4, "alnum_prop": 0.7806267806267806, "repo_name": "kostya/ruby-app-ar", "id": "c09bd03a50abd449f66f05c1ebd805ba095acc56", "size": "379", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/init-activerecord.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "21278"}]}} +{"text": "\r\n\r\n/**\r\n* Create a new `Particle` object. Particles are extended Sprites that are emitted by a particle emitter such as Phaser.Particles.Arcade.Emitter.\r\n* \r\n* @class Phaser.Particle\r\n* @constructor\r\n* @extends Phaser.Sprite\r\n* @param {Phaser.Game} game - A reference to the currently running game.\r\n* @param {number} x - The x coordinate (in world space) to position the Particle at.\r\n* @param {number} y - The y coordinate (in world space) to position the Particle at.\r\n* @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the Particle during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.\r\n* @param {string|number} frame - If this Particle is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.\r\n*/\r\nPhaser.Particle = function (game, x, y, key, frame) {\r\n\r\n Phaser.Sprite.call(this, game, x, y, key, frame);\r\n\r\n /**\r\n * @property {boolean} autoScale - If this Particle automatically scales this is set to true by Particle.setScaleData.\r\n * @protected\r\n */\r\n this.autoScale = false;\r\n\r\n /**\r\n * @property {array} scaleData - A reference to the scaleData array owned by the Emitter that emitted this Particle.\r\n * @protected\r\n */\r\n this.scaleData = null;\r\n\r\n /**\r\n * @property {number} _s - Internal cache var for tracking auto scale.\r\n * @private\r\n */\r\n this._s = 0;\r\n\r\n /**\r\n * @property {boolean} autoAlpha - If this Particle automatically changes alpha this is set to true by Particle.setAlphaData.\r\n * @protected\r\n */\r\n this.autoAlpha = false;\r\n\r\n /**\r\n * @property {array} alphaData - A reference to the alphaData array owned by the Emitter that emitted this Particle.\r\n * @protected\r\n */\r\n this.alphaData = null;\r\n\r\n /**\r\n * @property {number} _a - Internal cache var for tracking auto alpha.\r\n * @private\r\n */\r\n this._a = 0;\r\n\r\n};\r\n\r\nPhaser.Particle.prototype = Object.create(Phaser.Sprite.prototype);\r\nPhaser.Particle.prototype.constructor = Phaser.Particle;\r\n\r\n/**\r\n* Updates the Particle scale or alpha if autoScale and autoAlpha are set.\r\n*\r\n* @method Phaser.Particle#update\r\n* @memberof Phaser.Particle\r\n*/\r\nPhaser.Particle.prototype.update = function() {\r\n\r\n if (this.autoScale)\r\n {\r\n this._s--;\r\n\r\n if (this._s)\r\n {\r\n this.scale.set(this.scaleData[this._s].x, this.scaleData[this._s].y);\r\n }\r\n else\r\n {\r\n this.autoScale = false;\r\n }\r\n }\r\n\r\n if (this.autoAlpha)\r\n {\r\n this._a--;\r\n\r\n if (this._a)\r\n {\r\n this.alpha = this.alphaData[this._a].v;\r\n }\r\n else\r\n {\r\n this.autoAlpha = false;\r\n }\r\n }\r\n\r\n};\r\n\r\n/**\r\n* Called by the Emitter when this particle is emitted. Left empty for you to over-ride as required.\r\n*\r\n* @method Phaser.Particle#onEmit\r\n* @memberof Phaser.Particle\r\n*/\r\nPhaser.Particle.prototype.onEmit = function() {\r\n};\r\n\r\n/**\r\n* Called by the Emitter if autoAlpha has been enabled. Passes over the alpha ease data and resets the alpha counter.\r\n*\r\n* @method Phaser.Particle#setAlphaData\r\n* @memberof Phaser.Particle\r\n*/\r\nPhaser.Particle.prototype.setAlphaData = function(data) {\r\n\r\n this.alphaData = data;\r\n this._a = data.length - 1;\r\n this.alpha = this.alphaData[this._a].v;\r\n this.autoAlpha = true;\r\n\r\n};\r\n\r\n/**\r\n* Called by the Emitter if autoScale has been enabled. Passes over the scale ease data and resets the scale counter.\r\n*\r\n* @method Phaser.Particle#setScaleData\r\n* @memberof Phaser.Particle\r\n*/\r\nPhaser.Particle.prototype.setScaleData = function(data) {\r\n\r\n this.scaleData = data;\r\n this._s = data.length - 1;\r\n this.scale.set(this.scaleData[this._s].x, this.scaleData[this._s].y);\r\n this.autoScale = true;\r\n\r\n};\r\n\r\n/**\r\n* Resets the Particle. This places the Particle at the given x/y world coordinates and then\r\n* sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state and health values.\r\n* If the Particle has a physics body that too is reset.\r\n*\r\n* @method Phaser.Particle#reset\r\n* @memberof Phaser.Particle\r\n* @param {number} x - The x coordinate (in world space) to position the Particle at.\r\n* @param {number} y - The y coordinate (in world space) to position the Particle at.\r\n* @param {number} [health=1] - The health to give the Particle.\r\n* @return {Phaser.Particle} This instance.\r\n*/\r\nPhaser.Particle.prototype.reset = function(x, y, health) {\r\n\r\n Phaser.Component.Reset.prototype.reset.call(this, x, y, health);\r\n\r\n this.alpha = 1;\r\n this.scale.set(1);\r\n\r\n this.autoScale = false;\r\n this.autoAlpha = false;\r\n\r\n return this;\r\n\r\n};\r\n", "meta": {"content_hash": "24edaa06ce46fb9dbca9b7593e4e267c", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 254, "avg_line_length": 29.93167701863354, "alnum_prop": 0.6480597634363976, "repo_name": "Jufebrown/mech-combat", "id": "1e141255b39b7afd2cdf54a3fdf62c0d83149b56", "size": "5019", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "node_modules/phaser-ce/src/gameobjects/Particle.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "77"}, {"name": "HTML", "bytes": "1479"}, {"name": "JavaScript", "bytes": "34303"}]}} +{"text": "/**\n * Array reduceRight\n */\nfunction reduceRight(arr, fn, initVal) {\n // check for args.length since initVal might be \"undefined\" see #gh-57\n var hasInit = arguments.length > 2;\n\n if (arr == null || !arr.length) {\n if (hasInit) {\n return initVal;\n } else {\n throw new Error('reduce of empty array with no initial value');\n }\n }\n\n var i = arr.length, result = initVal, value;\n while (--i >= 0) {\n // we iterate over sparse items since there is no way to make it\n // work properly on IE 7-8. see #64\n value = arr[i];\n if (!hasInit) {\n result = value;\n hasInit = true;\n } else {\n result = fn(result, value, i, arr);\n }\n }\n return result;\n}\n\nmodule.exports = reduceRight;\n\n", "meta": {"content_hash": "8593925d98048fd6aa86361d02759e51", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 75, "avg_line_length": 25.375, "alnum_prop": 0.5320197044334976, "repo_name": "ionutbarau/petstore", "id": "7bd3e6b7829862d599317c23473b5b8f37856980", "size": "812", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "petstore-app/src/main/resources/static/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/reduceRight.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "5006"}, {"name": "CSS", "bytes": "344"}, {"name": "HTML", "bytes": "10564"}, {"name": "Java", "bytes": "40634"}, {"name": "JavaScript", "bytes": "11738"}, {"name": "Roff", "bytes": "52499364"}, {"name": "Shell", "bytes": "7058"}]}} +{"text": "require_relative 'spec_helper'\n\nmodule LetsCert\n\n describe IOPlugin do\n\n it '.empty_data always returns the same hash' do\n hsh = IOPlugin.empty_data\n\n expect(hsh.keys.size).to eq(4)\n [:account_key, :key, :cert, :chain].each do |key|\n expect(hsh.keys).to include(key)\n expect(hsh[key]).to be_nil\n end\n end\n\n it '.register registers known subclasses' do\n names = %w(account_key.json key.pem key.der chain.pem fullchain.pem)\n names += %w(cert.pem cert.der)\n\n names.each do |name|\n expect(IOPlugin.registered.keys).to include(name)\n end\n end\n\n it '.register may register new classes' do\n class NewIO < IOPlugin;end\n IOPlugin.register(NewIO, 'newio')\n\n expect(IOPlugin.registered.keys).to include('newio')\n expect(IOPlugin.registered['newio']).to be_a(NewIO)\n end\n\n it '.register raises when plugin name contains a path' do\n class NewIO2 < IOPlugin; end\n expect { IOPlugin.register(NewIO2, 'new/io') }.to raise_error(LetsCert::Error)\n end\n\n it '#load raises NotImplementedError' do\n expect { IOPlugin.new('a').load }.to raise_error(NotImplementedError)\n end\n\n it '#save raises NotImplementedError' do\n expect { IOPlugin.new('a').save }.to raise_error(NotImplementedError)\n end\n\n end\n\nend\n", "meta": {"content_hash": "d115b0fbd557578dc93ce84fe7ad578b", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 84, "avg_line_length": 26.979591836734695, "alnum_prop": 0.6527987897125568, "repo_name": "sdaubert/letscert", "id": "0eb2f856b0e2f8ef602c3dfa0b92fc5a862992b8", "size": "1322", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/io_plugin_spec.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "103056"}]}} +{"text": "extern \"Java\"\n{\n namespace gnu\n {\n namespace java\n {\n namespace net\n {\n namespace protocol\n {\n namespace jar\n {\n class Handler;\n }\n }\n }\n }\n }\n namespace java\n {\n namespace net\n {\n class URL;\n class URLConnection;\n }\n }\n}\n\nclass gnu::java::net::protocol::jar::Handler : public ::java::net::URLStreamHandler\n{\n\npublic:\n Handler();\npublic: // actually protected\n virtual ::java::net::URLConnection * openConnection(::java::net::URL *);\n virtual void parseURL(::java::net::URL *, ::java::lang::String *, jint, jint);\nprivate:\n static ::java::lang::String * flat(::java::lang::String *);\npublic: // actually protected\n virtual ::java::lang::String * toExternalForm(::java::net::URL *);\npublic:\n static ::java::lang::Class class$;\n};\n\n#endif // __gnu_java_net_protocol_jar_Handler__\n", "meta": {"content_hash": "9fa4241a43d907d9ac8bc6d70a93f4f6", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 83, "avg_line_length": 19.955555555555556, "alnum_prop": 0.5734966592427617, "repo_name": "the-linix-project/linix-kernel-source", "id": "b5fb6b66e640689c067a515654c8dea5f97f2b13", "size": "1114", "binary": false, "copies": "160", "ref": "refs/heads/master", "path": "gccsrc/gcc-4.7.2/libjava/gnu/java/net/protocol/jar/Handler.h", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Ada", "bytes": "38139979"}, {"name": "Assembly", "bytes": "3723477"}, {"name": "Awk", "bytes": "83739"}, {"name": "C", "bytes": "103607293"}, {"name": "C#", "bytes": "55726"}, {"name": "C++", "bytes": "38577421"}, {"name": "CLIPS", "bytes": "6933"}, {"name": "CSS", "bytes": "32588"}, {"name": "Emacs Lisp", "bytes": "13451"}, {"name": "FORTRAN", "bytes": "4294984"}, {"name": "GAP", "bytes": "13089"}, {"name": "Go", "bytes": "11277335"}, {"name": "Haskell", "bytes": "2415"}, {"name": "Java", "bytes": "45298678"}, {"name": "JavaScript", "bytes": "6265"}, {"name": "Matlab", "bytes": "56"}, {"name": "OCaml", "bytes": "148372"}, {"name": "Objective-C", "bytes": "995127"}, {"name": "Objective-C++", "bytes": "436045"}, {"name": "PHP", "bytes": "12361"}, {"name": "Pascal", "bytes": "40318"}, {"name": "Perl", "bytes": "358808"}, {"name": "Python", "bytes": "60178"}, {"name": "SAS", "bytes": "1711"}, {"name": "Scilab", "bytes": "258457"}, {"name": "Shell", "bytes": "2610907"}, {"name": "Tcl", "bytes": "17983"}, {"name": "TeX", "bytes": "1455571"}, {"name": "XSLT", "bytes": "156419"}]}} +{"text": "namespace content_settings {\n\nclass WebsiteSettingsRegistryTest : public testing::Test {\n protected:\n WebsiteSettingsRegistry* registry() { return ®istry_; }\n\n private:\n WebsiteSettingsRegistry registry_;\n};\n\nTEST_F(WebsiteSettingsRegistryTest, Get) {\n // CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE should be registered.\n const WebsiteSettingsInfo* info =\n registry()->Get(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE);\n ASSERT_TRUE(info);\n EXPECT_EQ(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, info->type());\n EXPECT_EQ(\"auto-select-certificate\", info->name());\n}\n\nTEST_F(WebsiteSettingsRegistryTest, GetByName) {\n // Random string shouldn't be registered.\n EXPECT_FALSE(registry()->GetByName(\"abc\"));\n\n // \"auto-select-certificate\" should be registered.\n const WebsiteSettingsInfo* info =\n registry()->GetByName(\"auto-select-certificate\");\n ASSERT_TRUE(info);\n EXPECT_EQ(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, info->type());\n EXPECT_EQ(\"auto-select-certificate\", info->name());\n EXPECT_EQ(registry()->Get(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE),\n info);\n\n // Register a new setting.\n registry()->Register(static_cast<ContentSettingsType>(10), \"test\", nullptr,\n WebsiteSettingsInfo::UNSYNCABLE,\n WebsiteSettingsInfo::LOSSY,\n WebsiteSettingsInfo::TOP_LEVEL_ORIGIN_ONLY_SCOPE,\n WebsiteSettingsRegistry::ALL_PLATFORMS,\n WebsiteSettingsInfo::INHERIT_IN_INCOGNITO);\n info = registry()->GetByName(\"test\");\n ASSERT_TRUE(info);\n EXPECT_EQ(10, info->type());\n EXPECT_EQ(\"test\", info->name());\n EXPECT_EQ(registry()->Get(static_cast<ContentSettingsType>(10)), info);\n}\n\nTEST_F(WebsiteSettingsRegistryTest, GetPlatformDependent) {\n#if defined(OS_IOS)\n // App banner shouldn't be registered on iOS.\n EXPECT_FALSE(registry()->Get(CONTENT_SETTINGS_TYPE_APP_BANNER));\n#else\n // App banner should be registered on other platforms.\n EXPECT_TRUE(registry()->Get(CONTENT_SETTINGS_TYPE_APP_BANNER));\n#endif\n\n // Auto select certificate is registered on all platforms.\n EXPECT_TRUE(registry()->Get(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE));\n}\n\nTEST_F(WebsiteSettingsRegistryTest, Properties) {\n // \"auto-select-certificate\" should be registered.\n const WebsiteSettingsInfo* info =\n registry()->Get(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE);\n ASSERT_TRUE(info);\n EXPECT_EQ(\"profile.content_settings.exceptions.auto_select_certificate\",\n info->pref_name());\n EXPECT_EQ(\"profile.default_content_setting_values.auto_select_certificate\",\n info->default_value_pref_name());\n ASSERT_FALSE(info->initial_default_value());\n EXPECT_EQ(PrefRegistry::NO_REGISTRATION_FLAGS,\n info->GetPrefRegistrationFlags());\n\n // Register a new setting.\n registry()->Register(static_cast<ContentSettingsType>(10), \"test\",\n base::WrapUnique(new base::FundamentalValue(999)),\n WebsiteSettingsInfo::SYNCABLE,\n WebsiteSettingsInfo::LOSSY,\n WebsiteSettingsInfo::TOP_LEVEL_ORIGIN_ONLY_SCOPE,\n WebsiteSettingsRegistry::ALL_PLATFORMS,\n WebsiteSettingsInfo::INHERIT_IN_INCOGNITO);\n info = registry()->Get(static_cast<ContentSettingsType>(10));\n ASSERT_TRUE(info);\n EXPECT_EQ(\"profile.content_settings.exceptions.test\", info->pref_name());\n EXPECT_EQ(\"profile.default_content_setting_values.test\",\n info->default_value_pref_name());\n int setting;\n ASSERT_TRUE(info->initial_default_value()->GetAsInteger(&setting));\n EXPECT_EQ(999, setting);\n#if defined(OS_IOS)\n EXPECT_EQ(PrefRegistry::LOSSY_PREF, info->GetPrefRegistrationFlags());\n#else\n EXPECT_EQ(PrefRegistry::LOSSY_PREF |\n user_prefs::PrefRegistrySyncable::SYNCABLE_PREF,\n info->GetPrefRegistrationFlags());\n#endif\n EXPECT_EQ(WebsiteSettingsInfo::TOP_LEVEL_ORIGIN_ONLY_SCOPE,\n info->scoping_type());\n EXPECT_EQ(WebsiteSettingsInfo::INHERIT_IN_INCOGNITO,\n info->incognito_behavior());\n}\n\nTEST_F(WebsiteSettingsRegistryTest, Iteration) {\n registry()->Register(static_cast<ContentSettingsType>(10), \"test\",\n base::WrapUnique(new base::FundamentalValue(999)),\n WebsiteSettingsInfo::SYNCABLE,\n WebsiteSettingsInfo::LOSSY,\n WebsiteSettingsInfo::TOP_LEVEL_ORIGIN_ONLY_SCOPE,\n WebsiteSettingsRegistry::ALL_PLATFORMS,\n WebsiteSettingsInfo::INHERIT_IN_INCOGNITO);\n\n bool found = false;\n for (const WebsiteSettingsInfo* info : *registry()) {\n EXPECT_EQ(registry()->Get(info->type()), info);\n if (info->type() == 10) {\n EXPECT_FALSE(found);\n found = true;\n }\n }\n\n EXPECT_TRUE(found);\n}\n\n} // namespace content_settings\n", "meta": {"content_hash": "79a080a21e9aacd0ed464a6b6425897c", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 78, "avg_line_length": 39.89430894308943, "alnum_prop": 0.6723048705930303, "repo_name": "danakj/chromium", "id": "5e3630c0a84f4fdb7104f1a6dedfd1e6ffe9d708", "size": "5614", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "components/content_settings/core/browser/website_settings_registry_unittest.cc", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "import * as React from \"react\";\nimport ReactModal from \"react-modal\";\n\nimport { Config } from \"../../../data/Config\";\n\nimport { OnMobile, OnMobileTablet, OnDesktop, OnTablet } from \"../../../helpers/Breakpoints\";\nimport { smoothScrollTo } from \"../../../helpers/smoothScrollTo\";\nimport { formatNumber } from \"../../../helpers/formatNumber\";\nimport { translate } from \"../../../helpers/translate\";\n\nimport { TransformAnimation } from \"../../Animations/Interactive/TransformAnimation\";\nimport { getCorners, getLabel, CloseButton, SubmitButton } from \"../../Buttons\";\nimport { SocialLinks } from \"../../Layout/Partials\";\nimport { PartnershipPageState } from \"./PartnershipPageState\";\nimport { MapIcon } from \"../../Icons/MapIcon\";\nimport { ContactForm } from \"./ContactForm\";\nimport { BasePage } from \"../BasePage\";\n\nexport class PartnershipPage extends BasePage<{}, PartnershipPageState> {\n public state: PartnershipPageState = {\n isModalOpen: false,\n };\n\n public shouldComponentUpdate(nextProps: undefined, nextState: PartnershipPageState, nextContext: any): boolean {\n return super.shouldComponentUpdate(nextProps, nextState, nextContext)\n || this.state.isModalOpen !== nextState.isModalOpen;\n }\n\n public render(): JSX.Element {\n const modalProps = {\n className: {\n base: \"modal\",\n afterOpen: \"\",\n beforeClose: \"\",\n },\n overlayClassName: {\n base: \"modal-overlay\",\n afterOpen: \"modal-opened\",\n beforeClose: \"modal-close\",\n },\n closeTimeoutMS: 500\n };\n\n const transformAnimationProps = {\n transformedComponent: <ContactForm/>,\n staticComponent: getCorners(),\n initialComponent: getLabel(),\n className: \"btn btn_transform\",\n onEvent() {\n const { className, duration } = this as any;\n smoothScrollTo(\n document.getElementsByClassName(className)[ 0 ] as HTMLElement,\n -105,\n \"top\",\n duration,\n 0\n );\n },\n duration: 1000,\n event: \"onClick\"\n };\n\n return (\n <section className=\"section section-partnership\">\n <div className=\"align-container\">\n <h2 className=\"section__title\">{translate(\"contactPage.title\")}</h2>\n <div className=\"section__half half_first\">\n <OnDesktop>\n <ContactForm/>\n </OnDesktop>\n </div>\n <div className=\"section__half half_second\">\n <div className=\"contact-info\">\n <OnDesktop>\n <a href={`tel:+${Config.phone}`} className=\"contact-info__link\">\n {formatNumber(Config.phone, \"+xxx xx xxx-xx-xx\")}\n </a>\n <a href={`mailto:${Config.mail}`} className=\"contact-info__link\">{Config.mail}</a>\n <p className=\"contact-info__text contact-info__text_indented\">\n <span className=\"text_regular\">{translate(\"contactPage.support.title\")}</span>\n {translate(\"contactPage.support.subTitle\")}\n <span className=\"contact-info__text_increased\">24\n <span className=\"separator\">/</span>7\n </span>\n </p>\n <p className=\"contact-info__text\">\n <span className=\"text_regular\">{translate(\"contactPage.location.title\")}</span>\n {translate(Config.location.country)} \n <span className=\"separator\">/</span>\n {translate(Config.location.city)}\n </p>\n </OnDesktop>\n <OnTablet>\n <p className=\"contact-info__text contact-info__text_indented\">\n <span className=\"text_regular\">{translate(\"contactPage.support.title\")}</span>\n {translate(\"contactPage.support.subTitle\")}\n <span className=\"contact-info__text_increased\">24/7</span>\n </p>\n <div className=\"align-container\">\n <a href={`tel:+${Config.phone}`} className=\"contact-info__link\">\n {formatNumber(Config.phone, \"+xxx xx xxx-xx-xx\")}\n </a>\n <a href={`mailto:${Config.mail}`} className=\"contact-info__link\">{Config.mail}</a>\n </div>\n <SubmitButton\n type=\"button\"\n onClick={this.handleOpenModal}\n label={translate(\"buttons.cooperate\")}\n />\n <p className=\"contact-info__text\">\n <span className=\"text_regular\">{translate(\"contactPage.location.title\")}</span>\n {translate(Config.location.country)} / {translate(Config.location.city)}\n </p>\n </OnTablet>\n <OnMobile>\n <p className=\"contact-info__text contact-info__text_indented\">\n <span className=\"text_regular\">{translate(\"contactPage.support.title\")}</span>\n {translate(\"contactPage.support.subTitle\")}\n <span className=\"contact-info__text_increased\">24/7</span>\n </p>\n <p className=\"contact-info__text\">\n <span className=\"text_regular\">{translate(\"contactPage.location.title\")}</span>\n {translate(Config.location.country)} / {translate(Config.location.city)}\n </p>\n <div className=\"align-container\">\n <a href={`tel:+${Config.phone}`} className=\"contact-info__link\">\n {formatNumber(Config.phone, \"+xxx xx xxx-xx-xx\")} \n </a>\n <a href={`mailto:${Config.mail}`} className=\"contact-info__link\">{Config.mail}</a>\n </div>\n <TransformAnimation {...transformAnimationProps}/>\n <SocialLinks/>\n </OnMobile>\n </div>\n </div>\n <OnMobileTablet>\n <ReactModal\n isOpen={this.state.isModalOpen}\n contentLabel=\"Modal-partnership\"\n {...modalProps}\n >\n <div className=\"modal__header\">\n <a href=\"#\" className=\"logo\">\n <i className=\"icon icon_logo\"/>\n </a>\n <CloseButton className=\"btn btn_close\" onClick={this.handleCloseModal}/>\n <h3 className=\"modal__title\">{translate(\"contactPage.form.title\")}</h3>\n </div>\n <div className=\"modal__body\">\n <ContactForm onClose={this.handleCloseModal}/>\n </div>\n </ReactModal>\n </OnMobileTablet>\n <div className=\"map-container\">\n <MapIcon/>\n <div className=\"slider\">\n <div className=\"slider__body\">\n <div className=\"slider__bar\"/>\n <div className=\"slider__dot\"/>\n </div>\n <div className=\"slider__description\">\n <span className=\"slider__location\">\n {Config.location.country} / {Config.location.city}\n </span>\n <span className=\"slider__coordinates\">\n {Config.location.coordinates.lat}° \n {Config.location.coordinates.lng}°\n </span>\n </div>\n </div>\n </div>\n </div>\n </section>\n );\n }\n\n protected handleCloseModal = () => {\n this.setState({ isModalOpen: false });\n };\n\n protected handleOpenModal = () => {\n this.setState({ isModalOpen: true });\n };\n}\n", "meta": {"content_hash": "c80d081dd615ce08644f050956bfc6e3", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 118, "avg_line_length": 51.56521739130435, "alnum_prop": 0.4267495784148398, "repo_name": "wearesho-team/wearesho-site", "id": "fd2e5a37cc3f947a11a44e2e702332375fc1dbcf", "size": "9488", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/Pages/PartnershipPage/PartnershipPage.tsx", "mode": "33188", "license": "mit", "language": [{"name": "Dockerfile", "bytes": "354"}, {"name": "Groovy", "bytes": "778"}, {"name": "HTML", "bytes": "3074"}, {"name": "JavaScript", "bytes": "10809"}, {"name": "SCSS", "bytes": "128541"}, {"name": "TypeScript", "bytes": "331858"}]}} +{"text": "'use strict';\n\n/**\n * @ngdoc directive\n * @name izzyposWebApp.directive:adminPosHeader\n * @description\n * # adminPosHeader\n */\nangular.module('sbAdminApp')\n\t.directive('siteheader',function(){\n\t\treturn {\n templateUrl:'scripts/directives/header/siteheader.html',\n restrict: 'E',\n replace: true\n \t}\n\t}).directive('dashboardheader',function(){\n\t\treturn {\n templateUrl:'scripts/directives/header/dashboard_header.html',\n restrict: 'E',\n replace: true\n \t}\n\t}).directive('cpdashboardheader',function(){\n return {\n templateUrl:'scripts/directives/header/cp_dashboard_header.html',\n restrict: 'E',\n replace: true\n }\n }).directive('vendordashboardheader',function(){\n return {\n templateUrl:'scripts/directives/header/vendor_dashboard_header.html',\n restrict: 'E',\n replace: true\n }\n }).directive('admindashboardheader',function(){\n return {\n templateUrl:'scripts/directives/header/admin_dashboard_header.html',\n restrict: 'E',\n replace: true\n }\n });\n\n\n\n\n\n", "meta": {"content_hash": "2dc593900bc99f05643f2e599332ceae", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 81, "avg_line_length": 25.42222222222222, "alnum_prop": 0.5961538461538461, "repo_name": "kodebees/testing-sandbox", "id": "922b7a66ec6d6c65857d24e550d04489b4c7e45d", "size": "1144", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/scripts/directives/header/header.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ApacheConf", "bytes": "24139"}, {"name": "CSS", "bytes": "16010"}, {"name": "HTML", "bytes": "275958"}, {"name": "JavaScript", "bytes": "62897"}]}} +{"text": "const express = require('express');\nconst router = express.Router();\n\n// const Note = require('../models/note.model'); // need this for below router.params\nconst note = require('../controllers/note.ctrl');\n\n// router.params('id', (req, res, next, id) => { // if an id parameter is present, this grabs it so we dont need\n// Note.findById(id, (err, note) => { // multiple \".findById()\" methods in the controller\n// if(err) throw err;\n// req.note = note;\n// next();\n// });\n// });\n\nrouter.get('/notes', note.index);\nrouter.get('/notes/new', note.newNote);\nrouter.get('/notes/:id', note.show);\nrouter.get('/notes/:id/edit', note.edit);\nrouter.put('/notes/:id', note.update);\nrouter.delete('/notes/:id', note.destroy);\nrouter.post('/notes', note.create);\n\nmodule.exports = router;\n", "meta": {"content_hash": "8c26a0a30648e8179e27b55b7bcd7451", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 112, "avg_line_length": 34.78260869565217, "alnum_prop": 0.63375, "repo_name": "ldougher06/c11_evernode", "id": "56216058d1e93026de87b3dd5e466ccfb5da8af7", "size": "800", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "routes/note.route.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "989"}, {"name": "JavaScript", "bytes": "4648"}]}} +{"text": "\n\npackage org.springframework.boot.actuate.autoconfigure.metrics.test;\n\nimport java.util.Collections;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.concurrent.CyclicBarrier;\n\nimport javax.servlet.DispatcherType;\n\nimport io.micrometer.core.instrument.MeterRegistry;\nimport io.micrometer.core.instrument.MockClock;\nimport io.micrometer.core.instrument.binder.MeterBinder;\nimport io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics;\nimport io.micrometer.core.instrument.binder.logging.LogbackMetrics;\nimport io.micrometer.core.instrument.simple.SimpleConfig;\nimport io.micrometer.core.instrument.simple.SimpleMeterRegistry;\nimport org.junit.jupiter.api.Test;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.actuate.autoconfigure.metrics.JvmMetricsAutoConfiguration;\nimport org.springframework.boot.actuate.autoconfigure.metrics.LogbackMetricsAutoConfiguration;\nimport org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;\nimport org.springframework.boot.actuate.autoconfigure.metrics.SystemMetricsAutoConfiguration;\nimport org.springframework.boot.actuate.autoconfigure.metrics.amqp.RabbitMetricsAutoConfiguration;\nimport org.springframework.boot.actuate.autoconfigure.metrics.cache.CacheMetricsAutoConfiguration;\nimport org.springframework.boot.actuate.autoconfigure.metrics.jdbc.DataSourcePoolMetricsAutoConfiguration;\nimport org.springframework.boot.actuate.autoconfigure.metrics.orm.jpa.HibernateMetricsAutoConfiguration;\nimport org.springframework.boot.actuate.autoconfigure.metrics.web.client.HttpClientMetricsAutoConfiguration;\nimport org.springframework.boot.actuate.autoconfigure.metrics.web.reactive.WebFluxMetricsAutoConfiguration;\nimport org.springframework.boot.actuate.autoconfigure.metrics.web.servlet.WebMvcMetricsAutoConfiguration;\nimport org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter;\nimport org.springframework.boot.autoconfigure.ImportAutoConfiguration;\nimport org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;\nimport org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;\nimport org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;\nimport org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;\nimport org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration;\nimport org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.boot.test.context.SpringBootTest.WebEnvironment;\nimport org.springframework.boot.test.web.client.TestRestTemplate;\nimport org.springframework.boot.web.client.RestTemplateBuilder;\nimport org.springframework.boot.web.servlet.FilterRegistrationBean;\nimport org.springframework.context.ApplicationContext;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.context.annotation.Import;\nimport org.springframework.context.annotation.Primary;\nimport org.springframework.http.HttpMethod;\nimport org.springframework.http.MediaType;\nimport org.springframework.test.util.ReflectionTestUtils;\nimport org.springframework.test.web.client.MockRestServiceServer;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.client.RestTemplate;\n\nimport static org.assertj.core.api.Assertions.assertThat;\nimport static org.springframework.test.web.client.ExpectedCount.once;\nimport static org.springframework.test.web.client.match.MockRestRequestMatchers.method;\nimport static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;\nimport static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;\n\n/**\n * Integration tests for Metrics.\n *\n * @author Jon Schneider\n */\n@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT,\n\t\tclasses = MetricsIntegrationTests.MetricsApp.class,\n\t\tproperties = \"management.metrics.use-global-registry=false\")\npublic class MetricsIntegrationTests {\n\n\t@Autowired\n\tprivate ApplicationContext context;\n\n\t@Autowired\n\tprivate RestTemplate external;\n\n\t@Autowired\n\tprivate TestRestTemplate loopback;\n\n\t@Autowired\n\tprivate MeterRegistry registry;\n\n\t@SuppressWarnings(\"unchecked\")\n\t@Test\n\tpublic void restTemplateIsInstrumented() {\n\t\tMockRestServiceServer server = MockRestServiceServer.bindTo(this.external)\n\t\t\t\t.build();\n\t\tserver.expect(once(), requestTo(\"/api/external\"))\n\t\t\t\t.andExpect(method(HttpMethod.GET)).andRespond(withSuccess(\n\t\t\t\t\t\t\"{\\\"message\\\": \\\"hello\\\"}\", MediaType.APPLICATION_JSON));\n\t\tassertThat(this.external.getForObject(\"/api/external\", Map.class))\n\t\t\t\t.containsKey(\"message\");\n\t\tassertThat(this.registry.get(\"http.client.requests\").timer().count())\n\t\t\t\t.isEqualTo(1);\n\t}\n\n\t@Test\n\tpublic void requestMappingIsInstrumented() {\n\t\tthis.loopback.getForObject(\"/api/people\", Set.class);\n\t\tassertThat(this.registry.get(\"http.server.requests\").timer().count())\n\t\t\t\t.isEqualTo(1);\n\t}\n\n\t@Test\n\tpublic void automaticallyRegisteredBinders() {\n\t\tassertThat(this.context.getBeansOfType(MeterBinder.class).values())\n\t\t\t\t.hasAtLeastOneElementOfType(LogbackMetrics.class)\n\t\t\t\t.hasAtLeastOneElementOfType(JvmMemoryMetrics.class);\n\t}\n\n\t@Test\n\t@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tpublic void metricsFilterRegisteredForAsyncDispatches() {\n\t\tMap<String, FilterRegistrationBean> filterRegistrations = this.context\n\t\t\t\t.getBeansOfType(FilterRegistrationBean.class);\n\t\tassertThat(filterRegistrations).containsKey(\"webMvcMetricsFilter\");\n\t\tFilterRegistrationBean registration = filterRegistrations\n\t\t\t\t.get(\"webMvcMetricsFilter\");\n\t\tassertThat(registration.getFilter()).isInstanceOf(WebMvcMetricsFilter.class);\n\t\tassertThat((Set<DispatcherType>) ReflectionTestUtils.getField(registration,\n\t\t\t\t\"dispatcherTypes\")).containsExactlyInAnyOrder(DispatcherType.REQUEST,\n\t\t\t\t\t\tDispatcherType.ASYNC);\n\t}\n\n\t@Configuration(proxyBeanMethods = false)\n\t@ImportAutoConfiguration({ MetricsAutoConfiguration.class,\n\t\t\tJvmMetricsAutoConfiguration.class, LogbackMetricsAutoConfiguration.class,\n\t\t\tSystemMetricsAutoConfiguration.class, RabbitMetricsAutoConfiguration.class,\n\t\t\tCacheMetricsAutoConfiguration.class,\n\t\t\tDataSourcePoolMetricsAutoConfiguration.class,\n\t\t\tHibernateMetricsAutoConfiguration.class,\n\t\t\tHttpClientMetricsAutoConfiguration.class,\n\t\t\tWebFluxMetricsAutoConfiguration.class, WebMvcMetricsAutoConfiguration.class,\n\t\t\tJacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class,\n\t\t\tRestTemplateAutoConfiguration.class, WebMvcAutoConfiguration.class,\n\t\t\tDispatcherServletAutoConfiguration.class,\n\t\t\tServletWebServerFactoryAutoConfiguration.class })\n\t@Import(PersonController.class)\n\tstatic class MetricsApp {\n\n\t\t@Primary\n\t\t@Bean\n\t\tpublic MeterRegistry registry() {\n\t\t\treturn new SimpleMeterRegistry(SimpleConfig.DEFAULT, new MockClock());\n\t\t}\n\n\t\t@Bean\n\t\tpublic RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) {\n\t\t\treturn restTemplateBuilder.build();\n\t\t}\n\n\t\t@Bean\n\t\tpublic CyclicBarrier cyclicBarrier() {\n\t\t\treturn new CyclicBarrier(2);\n\t\t}\n\n\t}\n\n\t@RestController\n\tstatic class PersonController {\n\n\t\t@GetMapping(\"/api/people\")\n\t\tSet<String> personName() {\n\t\t\treturn Collections.singleton(\"Jon\");\n\t\t}\n\n\t}\n\n}\n", "meta": {"content_hash": "71bc690cf69ccb97014ef702ae5dae8a", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 108, "avg_line_length": 42.820809248554916, "alnum_prop": 0.8353131749460043, "repo_name": "lburgazzoli/spring-boot", "id": "e98552b7ebf86f23ce82fed374d90e3b26640e1a", "size": "8029", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/test/MetricsIntegrationTests.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "6954"}, {"name": "CSS", "bytes": "5769"}, {"name": "FreeMarker", "bytes": "2134"}, {"name": "Groovy", "bytes": "49512"}, {"name": "HTML", "bytes": "69689"}, {"name": "Java", "bytes": "11602150"}, {"name": "JavaScript", "bytes": "37789"}, {"name": "Ruby", "bytes": "1307"}, {"name": "Shell", "bytes": "27916"}, {"name": "Smarty", "bytes": "3276"}, {"name": "XSLT", "bytes": "34105"}]}} +{"text": "<?php\ndefined('BASEPATH') OR exit('No direct script access allowed');\n\nclass Views extends Application\n{\n public function index()\n {\n $this->data['pagetitle'] = 'Ordered TODO List';\n $tasks = $this->tasks->all(); // get all the tasks\n $this->data['content'] = 'Ok'; // so we don't need pagebody\n $this->data['leftside'] = $this->makePrioritizedPanel($tasks);\n $this->data['rightside'] = $this->makeCategorizedPanel($tasks);\n $this->render('template_secondary'); \n }\n \n function makePrioritizedPanel($tasks) \n {\n foreach ($tasks as $task)\n {\n if ($task->status != 2)\n $undone[] = $task;\n }\n usort($undone, \"orderByPriority\");\n foreach ($undone as $task)\n $task->priority = $this->priorities->get($task->priority)->name;\n \n foreach ($undone as $task)\n $converted[] = (array) $task;\n \n $parms = ['display_tasks' => $converted];\n \n $role = $this->session->userdata('userrole');\n $parms['completer'] = ($role == ROLE_OWNER) ? '/views/complete' : '#';\n return $this->parser->parse('by_priority', $parms, true);\n }\n \n function makeCategorizedPanel($tasks) \n {\n $parms = ['display_tasks' => $this->tasks->getCategorizedTasks()];\n \n $role = $this->session->userdata('userrole');\n $parms['completer'] = ($role == ROLE_OWNER) ? '/views/complete' : '#';\n \n return $this->parser->parse('by_category',$parms,true);\n }\n \n function complete(){\n $role = $this->session->userdata('userrole');\n if ($role != ROLE_OWNER) redirect('/work');\n \n foreach($this->input->post() as $key=>$value){\n if(substr($key,0,4) == 'task'){\n $taskid = substr($key,4);\n $task = $this->tasks->get($taskid);\n $task->status = 2; \n $this->tasks->update($task);\n }\n }\n $this->index();\n }\n}\n\nfunction orderByPriority($a, $b)\n{\n if ($a->priority > $b->priority)\n return -1;\n elseif ($a->priority < $b->priority)\n return 1;\n else\n return 0;\n} ", "meta": {"content_hash": "cace378dfe7f31a84e026385520da689", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 78, "avg_line_length": 31.140845070422536, "alnum_prop": 0.5133423790140208, "repo_name": "Comp4711Lab5-Carmen-Hanuk/lab5", "id": "47267265ba278d4d389c32546da0ab59f900a73c", "size": "2211", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "application/controllers/Views.php", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "602"}, {"name": "CSS", "bytes": "1235"}, {"name": "HTML", "bytes": "5633"}, {"name": "PHP", "bytes": "1815269"}]}} +{"text": "package edu.cs4730.mywatchface;\n\n\nimport android.annotation.SuppressLint;\nimport android.content.res.Resources;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Rect;\nimport android.graphics.Typeface;\nimport android.content.Context;\nimport android.view.SurfaceHolder;\n\nimport java.time.ZonedDateTime;\nimport java.util.Calendar;\n\nimport androidx.annotation.NonNull;\nimport androidx.annotation.Nullable;\nimport androidx.core.content.ContextCompat;\nimport androidx.wear.watchface.CanvasType;\nimport androidx.wear.watchface.ComplicationSlotsManager;\nimport androidx.wear.watchface.DrawMode;\nimport androidx.wear.watchface.RenderParameters;\nimport androidx.wear.watchface.Renderer;\nimport androidx.wear.watchface.WatchFace;\nimport androidx.wear.watchface.WatchFaceService;\nimport androidx.wear.watchface.WatchFaceType;\nimport androidx.wear.watchface.WatchState;\nimport androidx.wear.watchface.style.CurrentUserStyleRepository;\nimport kotlin.coroutines.Continuation;\n\nimport static android.graphics.Color.*;\n\n/**\n * this code is based off google's original example, but updated to point, it is likely\n * no longer recognizable.\n */\n\npublic class myWatchFaceService extends WatchFaceService {\n\n private static final String TAG = \"myWatchFaceService\";\n\n private static final Typeface BOLD_TYPEFACE =\n Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD);\n private static final Typeface NORMAL_TYPEFACE =\n Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL);\n\n @Nullable\n @Override\n protected WatchFace createWatchFace(@NonNull SurfaceHolder surfaceHolder,\n @NonNull WatchState watchState,\n @NonNull ComplicationSlotsManager complicationSlotsManager,\n @NonNull CurrentUserStyleRepository currentUserStyleRepository,\n @NonNull Continuation<? super WatchFace> continuation) {\n\n\n return new WatchFace(\n WatchFaceType.DIGITAL,\n new myWatchFaceService.myCanvasRender(getApplicationContext(), surfaceHolder, watchState, complicationSlotsManager, currentUserStyleRepository, CanvasType.HARDWARE)\n );\n\n }\n\n class myCanvasRender extends Renderer.CanvasRenderer2<myWatchFaceService.myCanvasRender.myShareAssets> {\n static private final long FRAME_PERIOD_MS_DEFAULT = 16L;\n final boolean clearWithBackgroundTintBeforeRenderingHighlightLayer = false;\n\n Context context;\n SurfaceHolder surfaceHolder;\n WatchState watchState;\n ComplicationSlotsManager complicationSlotsManager;\n CurrentUserStyleRepository currentUserStyleRepository;\n int canvasType;\n\n Paint mBackgroundPaint;\n Paint mHourPaint;\n Paint mMinutePaint;\n Paint mSecondPaint;\n Paint mAmPmPaint;\n Paint mColonPaint;\n float mColonWidth;\n\n Calendar mTime;\n boolean mShouldDrawColons;\n float mXOffset;\n float mYOffset;\n String mAmString;\n String mPmString;\n int mInteractiveBackgroundColor = Color.BLACK;//parseColor(\"black\");\n int mInteractiveHourDigitsColor = parseColor(\"white\");\n int mInteractiveMinuteDigitsColor = parseColor(\"white\");\n int mInteractiveSecondDigitsColor = parseColor(\"gray\");\n boolean mAmbient;\n\n static final String COLON_STRING = \":\";\n\n @Override\n public void render(@NonNull Canvas canvas, @NonNull Rect bounds, @NonNull ZonedDateTime zonedDateTime, @NonNull myWatchFaceService.myCanvasRender.myShareAssets myShareAssets) {\n\n RenderParameters renderParameters = getRenderParameters();\n mAmbient = renderParameters.getDrawMode() == DrawMode.AMBIENT;\n // Calendar cal = new Calendar(getSystemTimeProvider().getSystemTimeMillis());\n mTime = Calendar.getInstance();\n\n /* draw your watch face */\n\n // Show colons for the first half of each second so the colons blink on when the time\n // updates.\n mShouldDrawColons = (System.currentTimeMillis() % 1000) < 500;\n\n // Draw the background.\n canvas.drawRect(0, 0, bounds.width(), bounds.height(), mBackgroundPaint);\n\n // Draw the hours.\n float x = mXOffset;\n String hourString = String.valueOf(convertTo12Hour(mTime.get(Calendar.HOUR)));\n canvas.drawText(hourString, x, mYOffset, mHourPaint);\n x += mHourPaint.measureText(hourString);\n\n\n // In ambient and mute modes, always draw the first colon. Otherwise, draw the\n // first colon for the first half of each second.\n if (mAmbient || mShouldDrawColons) {\n canvas.drawText(COLON_STRING, x, mYOffset, mColonPaint);\n }\n x += mColonWidth;\n\n // Draw the minutes.\n String minuteString = formatTwoDigitNumber(mTime.get(Calendar.MINUTE));\n canvas.drawText(minuteString, x, mYOffset, mMinutePaint);\n x += mMinutePaint.measureText(minuteString);\n\n // In ambient and mute modes, draw AM/PM. Otherwise, draw a second blinking\n // colon followed by the seconds.\n if (mAmbient) {\n x += mColonWidth;\n canvas.drawText(getAmPmString(mTime.get(Calendar.HOUR)), x, mYOffset, mAmPmPaint);\n } else {\n if (mShouldDrawColons) {\n canvas.drawText(COLON_STRING, x, mYOffset, mColonPaint);\n }\n x += mColonWidth;\n canvas.drawText(formatTwoDigitNumber(mTime.get(Calendar.SECOND)), x, mYOffset,\n mSecondPaint);\n\n }\n }\n\n\n @Override\n public void renderHighlightLayer(@NonNull Canvas canvas, @NonNull Rect rect, @NonNull ZonedDateTime zonedDateTime, @NonNull myShareAssets myShareAssets) {\n ///what does this do?? no documentation as to it use.\n\n }\n\n class myShareAssets implements SharedAssets {\n @Override\n public void onDestroy() {\n\n }\n\n }\n\n @Nullable\n @Override\n public myWatchFaceService.myCanvasRender.myShareAssets createSharedAssets(@NonNull Continuation completion) {\n return new myWatchFaceService.myCanvasRender.myShareAssets();\n }\n\n private Paint createTextPaint(int defaultInteractiveColor) {\n return createTextPaint(defaultInteractiveColor, NORMAL_TYPEFACE);\n }\n\n private Paint createTextPaint(int defaultInteractiveColor, Typeface typeface) {\n Paint paint = new Paint();\n paint.setColor(defaultInteractiveColor);\n paint.setTypeface(typeface);\n paint.setAntiAlias(true);\n return paint;\n }\n\n @SuppressLint(\"DefaultLocale\")\n private String formatTwoDigitNumber(int hour) {\n return String.format(\"%02d\", hour);\n }\n\n private int convertTo12Hour(int hour) {\n int result = hour % 12;\n return (result == 0) ? 12 : result;\n }\n\n private String getAmPmString(int hour) {\n return (hour < 12) ? mAmString : mPmString;\n }\n\n public myCanvasRender(@NonNull Context mcontext, @NonNull SurfaceHolder msurfaceHolder, @NonNull WatchState mwatchState, @NonNull ComplicationSlotsManager mcomplicationSlotsManager, @NonNull final CurrentUserStyleRepository mcurrentUserStyleRepository, int mcanvasType) {\n super(msurfaceHolder, mcurrentUserStyleRepository, mwatchState, mcanvasType, FRAME_PERIOD_MS_DEFAULT, false);\n\n context = mcontext;\n surfaceHolder = msurfaceHolder;\n watchState = mwatchState;\n complicationSlotsManager = mcomplicationSlotsManager;\n currentUserStyleRepository = mcurrentUserStyleRepository;\n canvasType = mcanvasType;\n\n //setup initial Paint colors.\n mBackgroundPaint = new Paint();\n mBackgroundPaint.setColor(Color.BLACK);\n mBackgroundPaint.setAntiAlias(true);\n\n Resources resources = myWatchFaceService.this.getResources();\n //setup variables.\n mYOffset = resources.getDimension(R.dimen.digital_y_offset);\n mAmString = resources.getString(R.string.digital_am);\n mPmString = resources.getString(R.string.digital_pm);\n\n mBackgroundPaint = new Paint();\n mBackgroundPaint.setColor(mInteractiveBackgroundColor);\n mHourPaint = createTextPaint(mInteractiveHourDigitsColor, BOLD_TYPEFACE);\n mMinutePaint = createTextPaint(mInteractiveMinuteDigitsColor);\n mSecondPaint = createTextPaint(mInteractiveSecondDigitsColor);\n mAmPmPaint = createTextPaint(ContextCompat.getColor(getApplicationContext(), R.color.digital_am_pm));\n mColonPaint = createTextPaint(ContextCompat.getColor(getApplicationContext(), R.color.digital_colons));\n\n\n surfaceHolder.getSurfaceFrame();\n\n boolean isRound = true; //how determine it's round or not?\n mXOffset = resources.getDimension(isRound ? R.dimen.digital_x_offset_round : R.dimen.digital_x_offset);\n float textSize = resources.getDimension(isRound ? R.dimen.digital_text_size_round : R.dimen.digital_text_size);\n float amPmSize = resources.getDimension(isRound ? R.dimen.digital_am_pm_size_round : R.dimen.digital_am_pm_size);\n\n mHourPaint.setTextSize(textSize);\n mMinutePaint.setTextSize(textSize);\n mSecondPaint.setTextSize(textSize);\n mAmPmPaint.setTextSize(amPmSize);\n mColonPaint.setTextSize(textSize);\n\n mColonWidth = mColonPaint.measureText(COLON_STRING);\n\n }\n }\n\n\n}\n", "meta": {"content_hash": "662289d194fa0dc24681026778ef4ff9", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 279, "avg_line_length": 40.4, "alnum_prop": 0.669529197817741, "repo_name": "JimSeker/wearable", "id": "abfa747f133f1cd01d61ecddfafdfe7a860b8f13", "size": "9898", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wear3/myWatchFace/wear/src/main/java/edu/cs4730/mywatchface/myWatchFaceService.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "206738"}]}} +{"text": "\n\npackage android.net;\n\n/**\n * Thrown when parsing a URL fails.\n */\n// See non-public class {@link WebAddress}.\npublic class ParseException extends RuntimeException {\n public String response;\n\n ParseException(String response) {\n this.response = response;\n }\n}\n", "meta": {"content_hash": "ae4c16d0b0593890cfc31e9b836bc7dd", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 54, "avg_line_length": 18.4, "alnum_prop": 0.6884057971014492, "repo_name": "haikuowuya/android_system_code", "id": "68b209b6d81ba3aaa6c7d1047002a99a36863e93", "size": "895", "binary": false, "copies": "16", "ref": "refs/heads/master", "path": "src/android/net/ParseException.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "182432"}, {"name": "Java", "bytes": "124952631"}]}} +{"text": "\ufeff// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.\n// See the LICENCE file in the repository root for full licence text.\n\nusing System;\n\nnamespace osu.Game.Database\n{\n /// <summary>\n /// Represents a model manager that publishes events when <typeparamref name=\"TModel\"/>s are added or removed.\n /// </summary>\n /// <typeparam name=\"TModel\">The model type.</typeparam>\n public interface IModelManager<out TModel>\n where TModel : class\n {\n event Action<TModel> ItemAdded;\n\n event Action<TModel> ItemRemoved;\n }\n}\n", "meta": {"content_hash": "87745d719286916d2f08eb1280091505", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 114, "avg_line_length": 30.63157894736842, "alnum_prop": 0.6752577319587629, "repo_name": "EVAST9919/osu", "id": "1bdbbb48e6fd1e0ad490e51500a5b4b4f818bca8", "size": "584", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "osu.Game/Database/IModelManager.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "6595208"}, {"name": "PowerShell", "bytes": "936"}, {"name": "Ruby", "bytes": "7983"}]}} +{"text": "package streaming_mysql_backup_tool \n/*\n* File Generated by enaml generator\n* !!! Please do not edit this file !!!\n*/\ntype BackupServer struct {\n\n\t/*Port - Descr: Port number used for listening for backup requests Default: 8081\n*/\n\tPort interface{} `yaml:\"port,omitempty\"`\n\n}", "meta": {"content_hash": "b02fed02f45e12ec0b36e42ef9c22b02", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 81, "avg_line_length": 22.916666666666668, "alnum_prop": 0.72, "repo_name": "enaml-ops/ert-plugin", "id": "719c1e482e14dbdb6461ccc5f649da60a8bf2e08", "size": "275", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "enaml-gen/streaming-mysql-backup-tool/backupserver.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Go", "bytes": "862257"}, {"name": "Shell", "bytes": "521"}]}} +{"text": "<!DOCTYPE html>\n\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /><meta name=\"generator\" content=\"Docutils 0.19: https://docutils.sourceforge.io/\" />\n\n \n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n <meta http-equiv=\"x-ua-compatible\" content=\"ie=edge\">\n <meta name=\"lang:clipboard.copy\" content=\"Copy to clipboard\">\n <meta name=\"lang:clipboard.copied\" content=\"Copied to clipboard\">\n <meta name=\"lang:search.language\" content=\"en\">\n <meta name=\"lang:search.pipeline.stopwords\" content=\"True\">\n <meta name=\"lang:search.pipeline.trimmer\" content=\"True\">\n <meta name=\"lang:search.result.none\" content=\"No matching documents\">\n <meta name=\"lang:search.result.one\" content=\"1 matching document\">\n <meta name=\"lang:search.result.other\" content=\"# matching documents\">\n <meta name=\"lang:search.tokenizer\" content=\"[\\s\\-]+\">\n\n \n <link href=\"https://fonts.gstatic.com/\" rel=\"preconnect\" crossorigin>\n <link href=\"https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback\" rel=\"stylesheet\">\n\n <style>\n body,\n input {\n font-family: \"Roboto\", \"Helvetica Neue\", Helvetica, Arial, sans-serif\n }\n\n code,\n kbd,\n pre {\n font-family: \"Roboto Mono\", \"Courier New\", Courier, monospace\n }\n </style>\n \n\n <link rel=\"stylesheet\" href=\"../_static/stylesheets/application.css\"/>\n <link rel=\"stylesheet\" href=\"../_static/stylesheets/application-palette.css\"/>\n <link rel=\"stylesheet\" href=\"../_static/stylesheets/application-fixes.css\"/>\n \n <link rel=\"stylesheet\" href=\"../_static/fonts/material-icons.css\"/>\n \n <meta name=\"theme-color\" content=\"#3f51b5\">\n <script src=\"../_static/javascripts/modernizr.js\"></script>\n \n \n \n <title>statsmodels.discrete.conditional_models.ConditionalLogit.information — statsmodels</title>\n <link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"../_static/icons/favicon-32x32.png\">\n <link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"../_static/icons/favicon-16x16.png\">\n <link rel=\"manifest\" href=\"../_static/icons/site.webmanifest\">\n <link rel=\"mask-icon\" href=\"../_static/icons/safari-pinned-tab.svg\" color=\"#919191\">\n <meta name=\"msapplication-TileColor\" content=\"#2b5797\">\n <meta name=\"msapplication-config\" content=\"../_static/icons/browserconfig.xml\">\n <link rel=\"stylesheet\" href=\"../_static/stylesheets/examples.css\">\n <link rel=\"stylesheet\" href=\"../_static/stylesheets/deprecation.css\">\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../_static/pygments.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../_static/material.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../_static/graphviz.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../_static/plot_directive.css\" />\n <script data-url_root=\"../\" id=\"documentation_options\" src=\"../_static/documentation_options.js\"></script>\n <script src=\"../_static/jquery.js\"></script>\n <script src=\"../_static/underscore.js\"></script>\n <script src=\"../_static/_sphinx_javascript_frameworks_compat.js\"></script>\n <script src=\"../_static/doctools.js\"></script>\n <script src=\"../_static/sphinx_highlight.js\"></script>\n <script crossorigin=\"anonymous\" integrity=\"sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=\" src=\"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js\"></script>\n <link rel=\"shortcut icon\" href=\"../_static/favicon.ico\"/>\n <link rel=\"author\" title=\"About these documents\" href=\"../about.html\" />\n <link rel=\"index\" title=\"Index\" href=\"../genindex.html\" />\n <link rel=\"search\" title=\"Search\" href=\"../search.html\" />\n <link rel=\"next\" title=\"statsmodels.discrete.conditional_models.ConditionalLogit.initialize\" href=\"statsmodels.discrete.conditional_models.ConditionalLogit.initialize.html\" />\n <link rel=\"prev\" title=\"statsmodels.discrete.conditional_models.ConditionalLogit.hessian\" href=\"statsmodels.discrete.conditional_models.ConditionalLogit.hessian.html\" />\n \n \n\n </head>\n <body dir=ltr\n data-md-color-primary=indigo data-md-color-accent=blue>\n \n <svg class=\"md-svg\">\n <defs data-children-count=\"0\">\n \n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"416\" height=\"448\" viewBox=\"0 0 416 448\" id=\"__github\"><path fill=\"currentColor\" d=\"M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z\"/></svg>\n \n </defs>\n </svg>\n \n <input class=\"md-toggle\" data-md-toggle=\"drawer\" type=\"checkbox\" id=\"__drawer\">\n <input class=\"md-toggle\" data-md-toggle=\"search\" type=\"checkbox\" id=\"__search\">\n <label class=\"md-overlay\" data-md-component=\"overlay\" for=\"__drawer\"></label>\n <a href=\"#generated/statsmodels.discrete.conditional_models.ConditionalLogit.information\" tabindex=\"1\" class=\"md-skip\"> Skip to content </a>\n <header class=\"md-header\" data-md-component=\"header\">\n <nav class=\"md-header-nav md-grid\">\n <div class=\"md-flex navheader\">\n <div class=\"md-flex__cell md-flex__cell--shrink\">\n <a href=\"../index.html\" title=\"statsmodels\"\n class=\"md-header-nav__button md-logo\">\n \n <img src=\"../_static/statsmodels-logo-v2-bw.svg\" height=\"26\"\n alt=\"statsmodels logo\">\n \n </a>\n </div>\n <div class=\"md-flex__cell md-flex__cell--shrink\">\n <label class=\"md-icon md-icon--menu md-header-nav__button\" for=\"__drawer\"></label>\n </div>\n <div class=\"md-flex__cell md-flex__cell--stretch\">\n <div class=\"md-flex__ellipsis md-header-nav__title\" data-md-component=\"title\">\n <span class=\"md-header-nav__topic\">statsmodels 0.13.5</span>\n <span class=\"md-header-nav__topic\"> statsmodels.discrete.conditional_models.ConditionalLogit.information </span>\n </div>\n </div>\n <div class=\"md-flex__cell md-flex__cell--shrink\">\n <label class=\"md-icon md-icon--search md-header-nav__button\" for=\"__search\"></label>\n \n<div class=\"md-search\" data-md-component=\"search\" role=\"dialog\">\n <label class=\"md-search__overlay\" for=\"__search\"></label>\n <div class=\"md-search__inner\" role=\"search\">\n <form class=\"md-search__form\" action=\"../search.html\" method=\"get\" name=\"search\">\n <input type=\"text\" class=\"md-search__input\" name=\"q\" placeholder=\"Search\"\n autocapitalize=\"off\" autocomplete=\"off\" spellcheck=\"false\"\n data-md-component=\"query\" data-md-state=\"active\">\n <label class=\"md-icon md-search__icon\" for=\"__search\"></label>\n <button type=\"reset\" class=\"md-icon md-search__icon\" data-md-component=\"reset\" tabindex=\"-1\">\n \n </button>\n </form>\n <div class=\"md-search__output\">\n <div class=\"md-search__scrollwrap\" data-md-scrollfix>\n <div class=\"md-search-result\" data-md-component=\"result\">\n <div class=\"md-search-result__meta\">\n Type to start searching\n </div>\n <ol class=\"md-search-result__list\"></ol>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n </div>\n \n <div class=\"md-flex__cell md-flex__cell--shrink\">\n <div class=\"md-header-nav__source\">\n <a href=\"https://github.com/statsmodels/statsmodels\" title=\"Go to repository\" class=\"md-source\" data-md-source=\"github\">\n\n <div class=\"md-source__icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 24 24\" width=\"28\" height=\"28\">\n <use xlink:href=\"#__github\" width=\"24\" height=\"24\"></use>\n </svg>\n </div>\n \n <div class=\"md-source__repository\">\n statsmodels\n </div>\n</a>\n </div>\n </div>\n \n \n \n <script src=\"../_static/javascripts/version_dropdown.js\"></script>\n <script>\n var json_loc = \"../../versions-v2.json\",\n target_loc = \"../../\",\n text = \"Versions\";\n $( document ).ready( add_version_dropdown(json_loc, target_loc, text));\n </script>\n \n\n </div>\n </nav>\n</header>\n\n \n <div class=\"md-container\">\n \n \n \n <nav class=\"md-tabs\" data-md-component=\"tabs\">\n <div class=\"md-tabs__inner md-grid\">\n <ul class=\"md-tabs__list\">\n <li class=\"md-tabs__item\"><a href=\"../user-guide.html\" class=\"md-tabs__link\">User Guide</a></li>\n <li class=\"md-tabs__item\"><a href=\"../discretemod.html\" class=\"md-tabs__link\">Regression with Discrete Dependent Variable</a></li>\n <li class=\"md-tabs__item\"><a href=\"statsmodels.discrete.conditional_models.ConditionalLogit.html\" class=\"md-tabs__link\">statsmodels.discrete.conditional_models.ConditionalLogit</a></li>\n </ul>\n </div>\n </nav>\n <main class=\"md-main\">\n <div class=\"md-main__inner md-grid\" data-md-component=\"container\">\n \n <div class=\"md-sidebar md-sidebar--primary\" data-md-component=\"navigation\">\n <div class=\"md-sidebar__scrollwrap\">\n <div class=\"md-sidebar__inner\">\n <nav class=\"md-nav md-nav--primary\" data-md-level=\"0\">\n <label class=\"md-nav__title md-nav__title--site\" for=\"__drawer\">\n <a href=\"../index.html\" title=\"statsmodels\" class=\"md-nav__button md-logo\">\n \n <img src=\"../_static/statsmodels-logo-v2-bw.svg\" alt=\" logo\" width=\"48\" height=\"48\">\n \n </a>\n <a href=\"../index.html\"\n title=\"statsmodels\">statsmodels 0.13.5</a>\n </label>\n <div class=\"md-nav__source\">\n <a href=\"https://github.com/statsmodels/statsmodels\" title=\"Go to repository\" class=\"md-source\" data-md-source=\"github\">\n\n <div class=\"md-source__icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 24 24\" width=\"28\" height=\"28\">\n <use xlink:href=\"#__github\" width=\"24\" height=\"24\"></use>\n </svg>\n </div>\n \n <div class=\"md-source__repository\">\n statsmodels\n </div>\n</a>\n </div>\n \n \n\n \n <ul class=\"md-nav__list\">\n <li class=\"md-nav__item\">\n \n \n <a href=\"../install.html\" class=\"md-nav__link\">Installing statsmodels</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../gettingstarted.html\" class=\"md-nav__link\">Getting started</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html\" class=\"md-nav__link\">User Guide</a>\n <ul class=\"md-nav__list\"> \n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#background\" class=\"md-nav__link\">Background</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#regression-and-linear-models\" class=\"md-nav__link\">Regression and Linear Models</a>\n <ul class=\"md-nav__list\"> \n <li class=\"md-nav__item\">\n \n \n <a href=\"../regression.html\" class=\"md-nav__link\">Linear Regression</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../glm.html\" class=\"md-nav__link\">Generalized Linear Models</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../gee.html\" class=\"md-nav__link\">Generalized Estimating Equations</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../gam.html\" class=\"md-nav__link\">Generalized Additive Models (GAM)</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../rlm.html\" class=\"md-nav__link\">Robust Linear Models</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../mixed_linear.html\" class=\"md-nav__link\">Linear Mixed Effects Models</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../discretemod.html\" class=\"md-nav__link\">Regression with Discrete Dependent Variable</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../mixed_glm.html\" class=\"md-nav__link\">Generalized Linear Mixed Effects Models</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../anova.html\" class=\"md-nav__link\">ANOVA</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../other_models.html\" class=\"md-nav__link\">Other Models <code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">othermod</span></code></a>\n \n \n </li></ul>\n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#time-series-analysis\" class=\"md-nav__link\">Time Series Analysis</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#other-models\" class=\"md-nav__link\">Other Models</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#statistics-and-tools\" class=\"md-nav__link\">Statistics and Tools</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#data-sets\" class=\"md-nav__link\">Data Sets</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#sandbox\" class=\"md-nav__link\">Sandbox</a>\n \n \n </li></ul>\n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../examples/index.html\" class=\"md-nav__link\">Examples</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../api.html\" class=\"md-nav__link\">API Reference</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../about.html\" class=\"md-nav__link\">About statsmodels</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../dev/index.html\" class=\"md-nav__link\">Developer Page</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../release/index.html\" class=\"md-nav__link\">Release Notes</a>\n \n \n </li>\n </ul>\n \n\n</nav>\n </div>\n </div>\n </div>\n <div class=\"md-sidebar md-sidebar--secondary\" data-md-component=\"toc\">\n <div class=\"md-sidebar__scrollwrap\">\n <div class=\"md-sidebar__inner\">\n \n<nav class=\"md-nav md-nav--secondary\">\n <label class=\"md-nav__title\" for=\"__toc\">Contents</label>\n <ul class=\"md-nav__list\" data-md-scrollfix=\"\">\n <li class=\"md-nav__item\"><a href=\"#generated-statsmodels-discrete-conditional-models-conditionallogit-information--page-root\" class=\"md-nav__link\">statsmodels.discrete.conditional_models.ConditionalLogit.information</a><nav class=\"md-nav\">\n <ul class=\"md-nav__list\">\n <li class=\"md-nav__item\"><a href=\"#statsmodels.discrete.conditional_models.ConditionalLogit.information\" class=\"md-nav__link\"><code class=\"docutils literal notranslate\"><span class=\"pre\">ConditionalLogit.information</span></code></a>\n </li></ul>\n </nav>\n </li>\n \n<li class=\"md-nav__item\"><a class=\"md-nav__extra_link\" href=\"../_sources/generated/statsmodels.discrete.conditional_models.ConditionalLogit.information.rst.txt\">Show Source</a> </li>\n\n<li id=\"searchbox\" class=\"md-nav__item\"></li>\n\n </ul>\n</nav>\n </div>\n </div>\n </div>\n \n <div class=\"md-content\">\n <article class=\"md-content__inner md-typeset\" role=\"main\">\n \n <section id=\"statsmodels-discrete-conditional-models-conditionallogit-information\">\n<h1 id=\"generated-statsmodels-discrete-conditional-models-conditionallogit-information--page-root\">statsmodels.discrete.conditional_models.ConditionalLogit.information<a class=\"headerlink\" href=\"#generated-statsmodels-discrete-conditional-models-conditionallogit-information--page-root\" title=\"Permalink to this heading\">\u00b6</a></h1>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"statsmodels.discrete.conditional_models.ConditionalLogit.information\">\n<span class=\"sig-prename descclassname\"><span class=\"pre\">ConditionalLogit.</span></span><span class=\"sig-name descname\"><span class=\"pre\">information</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">params</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#statsmodels.discrete.conditional_models.ConditionalLogit.information\" title=\"Permalink to this definition\">\u00b6</a></dt>\n<dd><p>Fisher information matrix of model.</p>\n<p>Returns -1 * Hessian of the log-likelihood evaluated at params.</p>\n<dl class=\"field-list\">\n<dt class=\"field-odd\">Parameters<span class=\"colon\">:</span></dt>\n<dd class=\"field-odd\"><dl>\n<dt><strong>params</strong><span class=\"classifier\"><a class=\"reference external\" href=\"https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray\" title=\"(in NumPy v1.23)\"><code class=\"xref py py-obj docutils literal notranslate\"><span class=\"pre\">ndarray</span></code></a></span></dt><dd><p>The model parameters.</p>\n</dd>\n</dl>\n</dd>\n</dl>\n</dd></dl>\n</section>\n\n\n </article>\n </div>\n </div>\n </main>\n </div>\n <footer class=\"md-footer\">\n <div class=\"md-footer-nav\">\n <nav class=\"md-footer-nav__inner md-grid\">\n \n <a href=\"statsmodels.discrete.conditional_models.ConditionalLogit.hessian.html\" title=\"statsmodels.discrete.conditional_models.ConditionalLogit.hessian\"\n class=\"md-flex md-footer-nav__link md-footer-nav__link--prev\"\n rel=\"prev\">\n <div class=\"md-flex__cell md-flex__cell--shrink\">\n <i class=\"md-icon md-icon--arrow-back md-footer-nav__button\"></i>\n </div>\n <div class=\"md-flex__cell md-flex__cell--stretch md-footer-nav__title\">\n <span class=\"md-flex__ellipsis\">\n <span\n class=\"md-footer-nav__direction\"> Previous </span> statsmodels.discrete.conditional_models.ConditionalLogit.hessian </span>\n </div>\n </a>\n \n \n <a href=\"statsmodels.discrete.conditional_models.ConditionalLogit.initialize.html\" title=\"statsmodels.discrete.conditional_models.ConditionalLogit.initialize\"\n class=\"md-flex md-footer-nav__link md-footer-nav__link--next\"\n rel=\"next\">\n <div class=\"md-flex__cell md-flex__cell--stretch md-footer-nav__title\"><span\n class=\"md-flex__ellipsis\"> <span\n class=\"md-footer-nav__direction\"> Next </span> statsmodels.discrete.conditional_models.ConditionalLogit.initialize </span>\n </div>\n <div class=\"md-flex__cell md-flex__cell--shrink\"><i\n class=\"md-icon md-icon--arrow-forward md-footer-nav__button\"></i>\n </div>\n \n </a>\n \n </nav>\n </div>\n <div class=\"md-footer-meta md-typeset\">\n <div class=\"md-footer-meta__inner md-grid\">\n <div class=\"md-footer-copyright\">\n <div class=\"md-footer-copyright__highlight\">\n © Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.\n \n </div>\n Last updated on\n Nov 02, 2022.\n <br/>\n Created using\n <a href=\"http://www.sphinx-doc.org/\">Sphinx</a> 5.3.0.\n and\n <a href=\"https://github.com/bashtage/sphinx-material/\">Material for\n Sphinx</a>\n </div>\n </div>\n </div>\n </footer>\n <script src=\"../_static/javascripts/application.js\"></script>\n <script>app.initialize({version: \"1.0.4\", url: {base: \"..\"}})</script>\n </body>\n</html>", "meta": {"content_hash": "65f322fdc20f8e09ace6d084bb6570eb", "timestamp": "", "source": "github", "line_count": 515, "max_line_length": 999, "avg_line_length": 39.15339805825243, "alnum_prop": 0.6077167228724459, "repo_name": "statsmodels/statsmodels.github.io", "id": "cce2ec1c243b5a1471de2a0740b55c02c09838c2", "size": "20168", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "stable/generated/statsmodels.discrete.conditional_models.ConditionalLogit.information.html", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "'use strict';\n\nconst async = require(`async`);\nconst Router = require(`express`).Router;\nconst router = new Router();\nconst jwtAuth = require(`./authentication`);\nconst sqlite3 = require(`../lib/sqlite3`).getInstance();\nconst bcrypt = require(`bcrypt`);\n\nconst nmcli = require(`../lib/nmcli`);\n\nrouter.get(`/access_points`, jwtAuth.authorizeRequest, (req, res, next) => {\n nmcli.listAp((err, result) => {\n if (err) {\n return next(err);\n }\n\n return res.json({ error: false, result });\n });\n});\n\nrouter.get(`/wireless_devices`, (req, res) =>\n res.json(nmcli.listWirelessDevice())\n);\n\nrouter.get(`/wifi_active_connections`, jwtAuth.authorizeRequest, (req, res, next) => {\n const devices = nmcli.listWirelessDevice()\n .filter(dev => dev.state === `connected`)\n .map(dev => dev.device);\n\n async.map(devices, (device, done) => {\n nmcli.activeConnectionOnIface(device, (err, connection) => {\n if (err) return done(err);\n return done(null, connection);\n });\n },\n\n (err, result) => {\n if (err) {\n return next(err);\n }\n\n return res.json({ active_connections: result });\n });\n});\n\nrouter.post(`/connect`, jwtAuth.authorizeRequest, (req, res, next) => {\n nmcli.connect(req.body.ssid, req.body.password, req.body.force, (err) => {\n if (err) {\n return next(new Error(`Failed to connect to AP. Try force connect & change the password`));\n }\n\n return res.json({ error: false, connected: true });\n });\n});\n\nrouter.post(`/disconnect`, jwtAuth.authorizeRequest, (req, res, next) => {\n nmcli.disconnect(req.body.iface, (err) => {\n if (err) {\n return next(new Error(`Failed to disconnect interface ${req.body.iface}`));\n }\n\n return res.json({ error: false, disconnected: true });\n });\n});\n\nrouter.post(`/login`, jwtAuth.authenticate);\n\nrouter.post(`/change_pass`, jwtAuth.authorizeRequest, (req, res, next) => {\n sqlite3.serialize(() => {\n const payload = {\n oldPassword: req.body.oldPassword,\n newPassword: req.body.newPassword,\n confirmNewPassword: req.body.confirmNewPassword,\n };\n\n const username = req.jwt_token.username;\n\n if (payload.newPassword !== payload.confirmNewPassword) {\n const error = new Error(`Password & confirm password do not match`);\n error.status = 401;\n\n return next(error);\n }\n\n return sqlite3.get(`SELECT * FROM account WHERE username = \"${username}\"`, (getErr, user) => {\n if (getErr) {\n return next(new Error(`Failed to verify old password`));\n }\n\n if (!user) {\n return next(new Error(`User is not found`));\n }\n\n if (!bcrypt.compareSync(payload.oldPassword, user.password)) {\n return next(new Error(`Old password mismatch`));\n }\n\n const hashed = bcrypt.hashSync(payload.newPassword, 8);\n\n return sqlite3.run(`UPDATE account SET password = \"${hashed}\" WHERE username = \"${username}\"`, (updateErr) => {\n if (updateErr) {\n return next(new Error(`Failed to update password`));\n }\n\n return res.json({ error: false, updated: true });\n });\n });\n });\n});\n\nmodule.exports = router;\n", "meta": {"content_hash": "9d681df44e78a1ab31ca293242bfe497", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 117, "avg_line_length": 27.857142857142858, "alnum_prop": 0.6198717948717949, "repo_name": "alwint3r/wlanturn", "id": "f77c6510c0270c95e3b25bab1b88678466f0b439", "size": "3120", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "middlewares/api.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "473"}, {"name": "HTML", "bytes": "1135"}, {"name": "JavaScript", "bytes": "45407"}]}} +{"text": "<?php\n\nnamespace Diside\\SecurityBundle\\Controller;\n\nuse Diside\\SecurityBundle\\Form\\Processor\\CompanyFormProcessor;\nuse Diside\\SecurityBundle\\Presenter\\CompaniesPresenter;\nuse Diside\\SecurityBundle\\Presenter\\CompanyPresenter;\nuse Diside\\SecurityComponent\\Interactor\\Request\\DeleteCompanyRequest;\nuse Diside\\SecurityComponent\\Interactor\\Request\\FindCompaniesRequest;\nuse Diside\\SecurityComponent\\Interactor\\SecurityInteractorRegister;\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Route;\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Security;\nuse Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Template;\nuse Symfony\\Component\\HttpFoundation\\Request;\n\n/**\n * @Route(\"/companies\")\n * @Security(\"has_role('ROLE_SUPERADMIN')\")\n */\nclass CompanyController extends BaseController\n{\n\n /**\n * @Route(\"\", name=\"companies\")\n * @Template\n */\n public function indexAction(Request $request)\n {\n $page = $request->get('page', 1);\n $pageSize = $this->container->getParameter('page_size');\n\n $user = $this->getAuthenticatedUser();\n\n $interactor = $this->getInteractor(SecurityInteractorRegister::FIND_COMPANIES);\n\n $request = new FindCompaniesRequest($user ? $user->getId() : null, $page - 1, $pageSize);\n $presenter = new CompaniesPresenter();\n\n $interactor->process($request, $presenter);\n\n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate(\n $presenter,\n $page,\n $pageSize\n );\n\n return array(\n 'pagination' => $pagination\n );\n }\n\n /**\n * @Route(\"/new\", name=\"company_new\")\n * @Template\n */\n public function newAction(Request $request)\n {\n return $this->processForm($request);\n }\n\n /**\n * @Route(\"/{id}/edit\", name=\"company_edit\")\n * @Template\n */\n public function editAction(Request $request, $id)\n {\n return $this->processForm($request, $id);\n }\n\n /**\n * @Route(\"/{id}/delete\", name=\"company_delete\")\n * @Template\n */\n public function deleteAction($id)\n {\n $user = $this->getAuthenticatedUser();\n\n $interactor = $this->getInteractor(SecurityInteractorRegister::DELETE_COMPANY);\n\n $request = new DeleteCompanyRequest($user ? $user->getId() : null, $id);\n $presenter = new CompanyPresenter();\n\n $interactor->process($request, $presenter);\n\n $this->addFlash('success', 'flash.company.deleted', array('%company%' => $presenter->getCompany()));\n\n return $this->redirect($this->generateUrl('companies'));\n }\n\n private function processForm(Request $request, $id = null)\n {\n /** @var CompanyFormProcessor $processor */\n $processor = $this->get('company_form_processor');\n\n $processor->process($request, $id);\n\n if ($processor->isValid()) {\n $this->addFlash('success', $id ? 'flash.company.updated' : 'flash.company.created', array('%company%' => $processor->getCompany()));\n\n if ($processor->isRedirectingTo(CompanyFormProcessor::REDIRECT_TO_LIST))\n return $this->redirect($this->generateUrl('companies'));\n\n return $this->redirect($this->generateUrl('company_edit', array(\n 'id' => $processor->getCompany()->getId())\n ));\n }\n\n $form = $processor->getForm();\n\n return array(\n 'errors' => $processor->getErrors(),\n 'form' => $form->createView()\n );\n }\n\n}\n\n", "meta": {"content_hash": "c73eb0d1cfd83ea266131a48e8cdf63f", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 144, "avg_line_length": 29.915254237288135, "alnum_prop": 0.6235127478753542, "repo_name": "disider/SecurityBundle", "id": "451c1df457eb7ff27577bc6e320f240d860c52aa", "size": "3530", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Controller/CompanyController.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "18720"}, {"name": "JavaScript", "bytes": "9957"}, {"name": "PHP", "bytes": "216649"}]}} +{"text": "ACCEPTED\n\n#### According to\nInternational Plant Names Index\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "f5a3c452b05a7614736653083fefe29c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "b490a36887c9a685310c1056bd603f62162dbe9c", "size": "183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Dryopteridaceae/Elaphoglossum/Elaphoglossum heterochroum/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "local require = require\nlocal rawget = rawget\nlocal pairs = pairs\n\nlocal table = require \"loop.table\"\n\nmodule \"loop.simple\"\n--------------------------------------------------------------------------------\nlocal ObjectCache = require \"loop.collection.ObjectCache\"\nlocal base = require \"loop.base\"\n--------------------------------------------------------------------------------\ntable.copy(base, _M)\n--------------------------------------------------------------------------------\nlocal DerivedClass = ObjectCache {\n\tretrieve = function(self, super)\n\t\treturn base.class { __index = super, __call = new }\n\tend,\n}\nfunction class(class, super)\n\tif super\n\t\tthen return DerivedClass[super](initclass(class))\n\t\telse return base.class(class)\n\tend\nend\n--------------------------------------------------------------------------------\nfunction isclass(class)\n\tlocal metaclass = classof(class)\n\tif metaclass then\n\t\treturn metaclass == rawget(DerivedClass, metaclass.__index) or\n\t\t base.isclass(class)\n\tend\nend\n--------------------------------------------------------------------------------\nfunction superclass(class)\n\tlocal metaclass = classof(class)\n\tif metaclass then return metaclass.__index end\nend\n--------------------------------------------------------------------------------\nfunction subclassof(class, super)\n\twhile class do\n\t\tif class == super then return true end\n\t\tclass = superclass(class)\n\tend\n\treturn false\nend\n--------------------------------------------------------------------------------\nfunction instanceof(object, class)\n\treturn subclassof(classof(object), class)\nend\n", "meta": {"content_hash": "92c9464c88325b9093a2d18d6d8a1997", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 80, "avg_line_length": 32.51020408163265, "alnum_prop": 0.4783427495291902, "repo_name": "ld-test/oil", "id": "860cc17ce076c7b8731a1509b1b938499d445657", "size": "3619", "binary": false, "copies": "13", "ref": "refs/heads/master", "path": "lua/loop/simple.lua", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "159816"}, {"name": "Lua", "bytes": "1003003"}, {"name": "Makefile", "bytes": "13314"}, {"name": "Shell", "bytes": "6060"}]}} +{"text": "\nnamespace tpp {\n\n/*! \\file assert.hpp\n \\brief Implements a better 'Assert'\n */\n\n#ifndef REVIVER_ASSERT_HPP\n#define REVIVER_ASSERT_HPP\n\n\n/*! \\def MyAssertFunction\n \\brief Function used by 'Assert' function in _DEBUG mode.\n \n Details.\n*/\n//Fix for Visual Studio C++ needing full definition of MyAssertFunction\n#if defined _MSC_VER\n\textern bool MyAssertFunction( bool b, char* desc, int line, char* file) {return 1;};\n#else\n\textern bool MyAssertFunction( bool b, char* desc, int line, char* file);\n#endif\n\n#if defined( _DEBUG )\n#define Assert( exp, description ) tpp::MyAssertFunction( (int)(exp), description, __LINE__, __FILE__ )\n#else\n#define Assert( exp, description )\n#endif\n\n\n#endif\n\n}\n", "meta": {"content_hash": "eceac01f903f7e9daf6addf84a373a83", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 103, "avg_line_length": 21.363636363636363, "alnum_prop": 0.6921985815602837, "repo_name": "HellicarAndLewis/Stripes", "id": "45bb0a006ca4f7a7ca641634f5cd59a865485f42", "size": "705", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "addons/ofxContourAnalysis/triangle/assert.hpp", "mode": "33261", "license": "mit", "language": [{"name": "C", "bytes": "52546"}, {"name": "C++", "bytes": "809884"}]}} +{"text": "struct TripAlight {\n edgepayload_t type;\n long external_id;\n State* (*walk)(struct EdgePayload*, struct State*, struct WalkOptions*);\n State* (*walkBack)(struct EdgePayload*, struct State*, struct WalkOptions*);\n \n int n;\n int* arrivals;\n char** trip_ids;\n int* stop_sequences;\n \n ServiceCalendar* calendar;\n Timezone* timezone;\n int agency;\n ServiceId service_id;\n \n int overage; //number of seconds schedules past midnight of the last departure. If it's at 12:00:00, the overage is 0.\n} ;\n\nTripAlight*\nalNew( ServiceId service_id, ServiceCalendar* calendar, Timezone* timezone, int agency );\n\nvoid\nalDestroy(TripAlight* this);\n\nServiceCalendar*\nalGetCalendar( TripAlight* this );\n\nTimezone*\nalGetTimezone( TripAlight* this );\n\nint\nalGetAgency( TripAlight* this );\n\nServiceId\nalGetServiceId( TripAlight* this );\n\nint\nalGetNumAlightings(TripAlight* this);\n\nvoid\nalAddAlighting(TripAlight* this, char* trip_id, int arrival, int stop_sequence);\n\nchar*\nalGetAlightingTripId(TripAlight* this, int i);\n\nint\nalGetAlightingArrival(TripAlight* this, int i);\n\nint\nalGetAlightingStopSequence(TripAlight* this, int i);\n\nint\nalSearchAlightingsList(TripAlight* this, int time);\n\nint\nalGetLastAlightingIndex(TripAlight* this, int time);\n\nint\nalGetOverage(TripAlight* this);\n\nint\nalGetAlightingIndexByTripId(TripAlight* this, char* trip_id);\n\ninline State*\nalWalk(EdgePayload* this, State* state, WalkOptions* options);\n\ninline State*\nalWalkBack(EdgePayload* this, State* state, WalkOptions* options);\n\n#endif\n", "meta": {"content_hash": "bbbd05b15f5d4e44d24a877f66fe0ae6", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 122, "avg_line_length": 21.732394366197184, "alnum_prop": 0.7414128321451717, "repo_name": "bmander/graphserver", "id": "524859f6a63259fe3437164cb8b3ac3074a2bc9a", "size": "1675", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "core/edgetypes/tripalight.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "200078"}, {"name": "Python", "bytes": "428337"}]}} +{"text": "<?xml version=\"1.0\" ?><!DOCTYPE TS><TS language=\"fi\" version=\"2.0\">\n<defaultcodec>UTF-8</defaultcodec>\n<context>\n <name>AboutDialog</name>\n <message>\n <location filename=\"../forms/aboutdialog.ui\" line=\"14\"/>\n <source>About Bitcoin</source>\n <translation>Tietoa Bitcoinista</translation>\n </message>\n <message>\n <location filename=\"../forms/aboutdialog.ui\" line=\"53\"/>\n <source><b>Bitcoin</b> version</source>\n <translation><b>Bitcoin</b> versio</translation>\n </message>\n <message>\n <location filename=\"../forms/aboutdialog.ui\" line=\"97\"/>\n <source>Copyright \u00a9 2009-2012 Bitcoin Developers\n\nThis is experimental software.\n\nDistributed under the MIT/X11 software license, see the accompanying file license.txt or http://www.opensource.org/licenses/mit-license.php.\n\nThis product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>\n <translation>Copyright \u00a9 2009-2012 Bitcoin Developers\n\nThis is experimental software.\n\nDistributed under the MIT/X11 software license, see the accompanying file license.txt or http://www.opensource.org/licenses/mit-license.php.\n\nThis product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</translation>\n </message>\n</context>\n<context>\n <name>AddressBookPage</name>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"14\"/>\n <source>Address Book</source>\n <translation>Osoitekirja</translation>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"20\"/>\n <source>These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>\n <translation>N\u00e4m\u00e4 ovat sinun Bitcoin-osoitteesi suoritusten vastaanottamiseen. Voit halutessasi antaa kullekin l\u00e4hett\u00e4j\u00e4lle eri osoitteen, jotta voit seurata kuka sinulle maksaa.</translation>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"36\"/>\n <source>Double-click to edit address or label</source>\n <translation>Kaksoisnapauta muokataksesi osoitetta tai nime\u00e4</translation>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"63\"/>\n <source>Create a new address</source>\n <translation>Luo uusi osoite</translation>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"77\"/>\n <source>Copy the currently selected address to the system clipboard</source>\n <translation>Kopioi valittu osoite leikep\u00f6yd\u00e4lle</translation>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"66\"/>\n <source>&New Address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"80\"/>\n <source>&Copy Address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"91\"/>\n <source>Show &QR Code</source>\n <translation>N\u00e4yt\u00e4 &QR-koodi</translation>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"102\"/>\n <source>Sign a message to prove you own this address</source>\n <translation>Allekirjoita viesti mill\u00e4 todistat omistavasi t\u00e4m\u00e4n osoitteen</translation>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"105\"/>\n <source>&Sign Message</source>\n <translation>&Allekirjoita viesti</translation>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"116\"/>\n <source>Delete the currently selected address from the list. Only sending addresses can be deleted.</source>\n <translation>Poista valittuna oleva osoite listasta. Vain l\u00e4hett\u00e4miseen k\u00e4ytett\u00e4vi\u00e4 osoitteita voi poistaa.</translation>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"119\"/>\n <source>&Delete</source>\n <translation>&Poista</translation>\n </message>\n <message>\n <location filename=\"../addressbookpage.cpp\" line=\"63\"/>\n <source>Copy &Label</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../addressbookpage.cpp\" line=\"65\"/>\n <source>&Edit</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../addressbookpage.cpp\" line=\"292\"/>\n <source>Export Address Book Data</source>\n <translation>Vie osoitekirja</translation>\n </message>\n <message>\n <location filename=\"../addressbookpage.cpp\" line=\"293\"/>\n <source>Comma separated file (*.csv)</source>\n <translation>Comma separated file (*.csv)</translation>\n </message>\n <message>\n <location filename=\"../addressbookpage.cpp\" line=\"306\"/>\n <source>Error exporting</source>\n <translation>Virhe viedess\u00e4 osoitekirjaa</translation>\n </message>\n <message>\n <location filename=\"../addressbookpage.cpp\" line=\"306\"/>\n <source>Could not write to file %1.</source>\n <translation>Ei voida kirjoittaa tiedostoon %1.</translation>\n </message>\n</context>\n<context>\n <name>AddressTableModel</name>\n <message>\n <location filename=\"../addresstablemodel.cpp\" line=\"142\"/>\n <source>Label</source>\n <translation>Nimi</translation>\n </message>\n <message>\n <location filename=\"../addresstablemodel.cpp\" line=\"142\"/>\n <source>Address</source>\n <translation>Osoite</translation>\n </message>\n <message>\n <location filename=\"../addresstablemodel.cpp\" line=\"178\"/>\n <source>(no label)</source>\n <translation>(ei nime\u00e4)</translation>\n </message>\n</context>\n<context>\n <name>AskPassphraseDialog</name>\n <message>\n <location filename=\"../forms/askpassphrasedialog.ui\" line=\"26\"/>\n <source>Passphrase Dialog</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/askpassphrasedialog.ui\" line=\"47\"/>\n <source>Enter passphrase</source>\n <translation>Anna tunnuslause</translation>\n </message>\n <message>\n <location filename=\"../forms/askpassphrasedialog.ui\" line=\"61\"/>\n <source>New passphrase</source>\n <translation>Uusi tunnuslause</translation>\n </message>\n <message>\n <location filename=\"../forms/askpassphrasedialog.ui\" line=\"75\"/>\n <source>Repeat new passphrase</source>\n <translation>Toista uusi tunnuslause</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"33\"/>\n <source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>\n <translation>Anna lompakolle uusi tunnuslause.<br/>K\u00e4yt\u00e4 tunnuslausetta, jossa on ainakin <b>10 satunnaista mekki\u00e4</b> tai <b>kahdeksan sanaa</b>.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"34\"/>\n <source>Encrypt wallet</source>\n <translation>Salaa lompakko</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"37\"/>\n <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n <translation>T\u00e4t\u00e4 toimintoa varten sinun t\u00e4ytyy antaa lompakon tunnuslause sen avaamiseksi.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"42\"/>\n <source>Unlock wallet</source>\n <translation>Avaa lompakko</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"45\"/>\n <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n <translation>T\u00e4t\u00e4 toimintoa varten sinun t\u00e4ytyy antaa lompakon tunnuslause salauksen purkuun.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"50\"/>\n <source>Decrypt wallet</source>\n <translation>Pura lompakon salaus</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"53\"/>\n <source>Change passphrase</source>\n <translation>Vaihda tunnuslause</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"54\"/>\n <source>Enter the old and new passphrase to the wallet.</source>\n <translation>Anna vanha ja uusi tunnuslause.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"100\"/>\n <source>Confirm wallet encryption</source>\n <translation>Hyv\u00e4ksy lompakon salaus</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"101\"/>\n <source>WARNING: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!\nAre you sure you wish to encrypt your wallet?</source>\n <translation>VAROITUS: Mik\u00e4li salaat lompakkosi ja unohdat tunnuslauseen, <b>MENET\u00c4T LOMPAKON KOKO SIS\u00c4LL\u00d6N</b>!\nTahdotko varmasti salata lompakon?</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"110\"/>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"159\"/>\n <source>Wallet encrypted</source>\n <translation>Lompakko salattu</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"111\"/>\n <source>Bitcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n <translation>Bitcoin sulkeutuu lopettaakseen salausprosessin. Muista, ett\u00e4 salattu lompakko ei t\u00e4ysin suojaa sit\u00e4 haittaohjelmien aiheuttamilta varkauksilta.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"207\"/>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"231\"/>\n <source>Warning: The Caps Lock key is on.</source>\n <translation>Varoitus: Caps Lock on p\u00e4\u00e4ll\u00e4.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"116\"/>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"123\"/>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"165\"/>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"171\"/>\n <source>Wallet encryption failed</source>\n <translation>Lompakon salaus ep\u00e4onnistui</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"117\"/>\n <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n <translation>Lompakon salaaminen ep\u00e4onnistui sis\u00e4isen virheen vuoksi. Lompakkoa ei salattu.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"124\"/>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"172\"/>\n <source>The supplied passphrases do not match.</source>\n <translation>Annetut tunnuslauseet eiv\u00e4t t\u00e4sm\u00e4\u00e4.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"135\"/>\n <source>Wallet unlock failed</source>\n <translation>Lompakon avaaminen ep\u00e4onnistui.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"136\"/>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"147\"/>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"166\"/>\n <source>The passphrase entered for the wallet decryption was incorrect.</source>\n <translation>Annettu tunnuslause oli v\u00e4\u00e4r\u00e4.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"146\"/>\n <source>Wallet decryption failed</source>\n <translation>Lompakon salauksen purku ep\u00e4onnistui.</translation>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"160\"/>\n <source>Wallet passphrase was succesfully changed.</source>\n <translation>Lompakon tunnuslause on vaihdettu.</translation>\n </message>\n</context>\n<context>\n <name>BitcoinGUI</name>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"73\"/>\n <source>Bitcoin Wallet</source>\n <translation>Bitcoin-lompakko</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"215\"/>\n <source>Sign &message...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"248\"/>\n <source>Show/Hide &Bitcoin</source>\n <translation>N\u00e4yt\u00e4/K\u00e4tke &Bitcoin</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"515\"/>\n <source>Synchronizing with network...</source>\n <translation>Synkronoidaan verkon kanssa...</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"185\"/>\n <source>&Overview</source>\n <translation>&Yleisn\u00e4kym\u00e4</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"186\"/>\n <source>Show general overview of wallet</source>\n <translation>N\u00e4ytt\u00e4\u00e4 kokonaiskatsauksen lompakon tilanteesta</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"191\"/>\n <source>&Transactions</source>\n <translation>&Rahansiirrot</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"192\"/>\n <source>Browse transaction history</source>\n <translation>Selaa rahansiirtohistoriaa</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"197\"/>\n <source>&Address Book</source>\n <translation>&Osoitekirja</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"198\"/>\n <source>Edit the list of stored addresses and labels</source>\n <translation>Muokkaa tallennettujen nimien ja osoitteiden listaa</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"203\"/>\n <source>&Receive coins</source>\n <translation>&Vastaanota Bitcoineja</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"204\"/>\n <source>Show the list of addresses for receiving payments</source>\n <translation>N\u00e4yt\u00e4 Bitcoinien vastaanottamiseen k\u00e4ytetyt osoitteet</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"209\"/>\n <source>&Send coins</source>\n <translation>&L\u00e4het\u00e4 Bitcoineja</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"216\"/>\n <source>Prove you control an address</source>\n <translation>Todista ett\u00e4 hallitset osoitetta</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"235\"/>\n <source>E&xit</source>\n <translation>L&opeta</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"236\"/>\n <source>Quit application</source>\n <translation>Lopeta ohjelma</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"239\"/>\n <source>&About %1</source>\n <translation>&Tietoja %1</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"240\"/>\n <source>Show information about Bitcoin</source>\n <translation>N\u00e4yt\u00e4 tietoa Bitcoin-projektista</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"242\"/>\n <source>About &Qt</source>\n <translation>Tietoja &Qt</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"243\"/>\n <source>Show information about Qt</source>\n <translation>N\u00e4yt\u00e4 tietoja QT:ta</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"245\"/>\n <source>&Options...</source>\n <translation>&Asetukset...</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"252\"/>\n <source>&Encrypt Wallet...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"255\"/>\n <source>&Backup Wallet...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"257\"/>\n <source>&Change Passphrase...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message numerus=\"yes\">\n <location filename=\"../bitcoingui.cpp\" line=\"517\"/>\n <source>~%n block(s) remaining</source>\n <translation><numerusform>~%n lohko j\u00e4ljell\u00e4</numerusform><numerusform>~%n lohkoja j\u00e4ljell\u00e4</numerusform></translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"528\"/>\n <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>\n <translation>Ladattu %1 / %2 lohkoista rahansiirtohistoriasta (%3% suoritettu).</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"250\"/>\n <source>&Export...</source>\n <translation>&Vie...</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"210\"/>\n <source>Send coins to a Bitcoin address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"246\"/>\n <source>Modify configuration options for Bitcoin</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"249\"/>\n <source>Show or hide the Bitcoin window</source>\n <translation>N\u00e4yt\u00e4 tai piillota Bitcoin-ikkuna</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"251\"/>\n <source>Export the data in the current tab to a file</source>\n <translation>Vie auki olevan v\u00e4lilehden tiedot tiedostoon</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"253\"/>\n <source>Encrypt or decrypt wallet</source>\n <translation>Salaa tai poista salaus lompakosta</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"256\"/>\n <source>Backup wallet to another location</source>\n <translation>Varmuuskopioi lompakko toiseen sijaintiin</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"258\"/>\n <source>Change the passphrase used for wallet encryption</source>\n <translation>Vaihda lompakon salaukseen k\u00e4ytett\u00e4v\u00e4 tunnuslause</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"259\"/>\n <source>&Debug window</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"260\"/>\n <source>Open debugging and diagnostic console</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"261\"/>\n <source>&Verify message...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"262\"/>\n <source>Verify a message signature</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"286\"/>\n <source>&File</source>\n <translation>&Tiedosto</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"296\"/>\n <source>&Settings</source>\n <translation>&Asetukset</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"302\"/>\n <source>&Help</source>\n <translation>&Apua</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"311\"/>\n <source>Tabs toolBHC</source>\n <translation>V\u00e4lilehtipalkki</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"322\"/>\n <source>Actions toolBHC</source>\n <translation>Toimintopalkki</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"334\"/>\n <location filename=\"../bitcoingui.cpp\" line=\"343\"/>\n <source>[testnet]</source>\n <translation>[testnet]</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"343\"/>\n <location filename=\"../bitcoingui.cpp\" line=\"399\"/>\n <source>Bitcoin client</source>\n <translation>Bitcoin-asiakas</translation>\n </message>\n <message numerus=\"yes\">\n <location filename=\"../bitcoingui.cpp\" line=\"492\"/>\n <source>%n active connection(s) to Bitcoin network</source>\n <translation><numerusform>%n aktiivinen yhteys Bitcoin-verkkoon</numerusform><numerusform>%n aktiivista yhteytt\u00e4 Bitcoin-verkkoon</numerusform></translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"540\"/>\n <source>Downloaded %1 blocks of transaction history.</source>\n <translation>Ladattu %1 lohkoa rahansiirron historiasta.</translation>\n </message>\n <message numerus=\"yes\">\n <location filename=\"../bitcoingui.cpp\" line=\"555\"/>\n <source>%n second(s) ago</source>\n <translation><numerusform>%n sekunti sitten</numerusform><numerusform>%n sekuntia sitten</numerusform></translation>\n </message>\n <message numerus=\"yes\">\n <location filename=\"../bitcoingui.cpp\" line=\"559\"/>\n <source>%n minute(s) ago</source>\n <translation><numerusform>%n minuutti sitten</numerusform><numerusform>%n minuuttia sitten</numerusform></translation>\n </message>\n <message numerus=\"yes\">\n <location filename=\"../bitcoingui.cpp\" line=\"563\"/>\n <source>%n hour(s) ago</source>\n <translation><numerusform>%n tunti sitten</numerusform><numerusform>%n tuntia sitten</numerusform></translation>\n </message>\n <message numerus=\"yes\">\n <location filename=\"../bitcoingui.cpp\" line=\"567\"/>\n <source>%n day(s) ago</source>\n <translation><numerusform>%n p\u00e4iv\u00e4 sitten</numerusform><numerusform>%n p\u00e4iv\u00e4\u00e4 sitten</numerusform></translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"573\"/>\n <source>Up to date</source>\n <translation>Rahansiirtohistoria on ajan tasalla</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"580\"/>\n <source>Catching up...</source>\n <translation>Kurotaan kiinni...</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"590\"/>\n <source>Last received block was generated %1.</source>\n <translation>Viimeisin vastaanotettu lohko tuotettu %1.</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"649\"/>\n <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>\n <translation>T\u00e4m\u00e4 rahansiirto ylitt\u00e4\u00e4 kokorajoituksen. Voit siit\u00e4 huolimatta l\u00e4hett\u00e4\u00e4 sen %1 siirtopalkkion mik\u00e4 menee solmuille jotka k\u00e4sittelev\u00e4t rahansiirtosi t\u00e4m\u00e4 auttaa my\u00f6s verkostoa. Haluatko maksaa siirtopalkkion? </translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"654\"/>\n <source>Confirm transaction fee</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"681\"/>\n <source>Sent transaction</source>\n <translation>L\u00e4hetetyt rahansiirrot</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"682\"/>\n <source>Incoming transaction</source>\n <translation>Saapuva rahansiirto</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"683\"/>\n <source>Date: %1\nAmount: %2\nType: %3\nAddress: %4\n</source>\n <translation>P\u00e4iv\u00e4: %1\nM\u00e4\u00e4r\u00e4: %2\nTyyppi: %3\nOsoite: %4</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"804\"/>\n <source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>\n <translation>Lompakko on <b>salattu</b> ja t\u00e4ll\u00e4 hetkell\u00e4 <b>avoinna</b></translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"812\"/>\n <source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>\n <translation>Lompakko on <b>salattu</b> ja t\u00e4ll\u00e4 hetkell\u00e4 <b>lukittuna</b></translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"835\"/>\n <source>Backup Wallet</source>\n <translation>Varmuuskopioi lompakko</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"835\"/>\n <source>Wallet Data (*.dat)</source>\n <translation>Lompakkodata (*.dat)</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"838\"/>\n <source>Backup Failed</source>\n <translation>Varmuuskopio ep\u00e4onnistui</translation>\n </message>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"838\"/>\n <source>There was an error trying to save the wallet data to the new location.</source>\n <translation>Virhe tallennettaessa lompakkodataa uuteen sijaintiin.</translation>\n </message>\n <message>\n <location filename=\"../bitcoin.cpp\" line=\"112\"/>\n <source>A fatal error occured. Bitcoin can no longer continue safely and will quit.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>ClientModel</name>\n <message>\n <location filename=\"../clientmodel.cpp\" line=\"84\"/>\n <source>Network Alert</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>DisplayOptionsPage</name>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"246\"/>\n <source>Display</source>\n <translation>N\u00e4ytt\u00f6</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"257\"/>\n <source>default</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"263\"/>\n <source>The user interface language can be set here. This setting will only take effect after restarting Bitcoin.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"252\"/>\n <source>User Interface &Language:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"273\"/>\n <source>&Unit to show amounts in:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"277\"/>\n <source>Choose the default subdivision unit to show in the interface, and when sending coins</source>\n <translation>Valitse oletus lis\u00e4m\u00e4\u00e4re mik\u00e4 n\u00e4kyy k\u00e4ytt\u00f6liittym\u00e4ss\u00e4 ja kun l\u00e4het\u00e4t kolikoita</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"284\"/>\n <source>&Display addresses in transaction list</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"285\"/>\n <source>Whether to show Bitcoin addresses in the transaction list</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"303\"/>\n <source>Warning</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"303\"/>\n <source>This setting will take effect after restarting Bitcoin.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>EditAddressDialog</name>\n <message>\n <location filename=\"../forms/editaddressdialog.ui\" line=\"14\"/>\n <source>Edit Address</source>\n <translation>Muokkaa osoitetta</translation>\n </message>\n <message>\n <location filename=\"../forms/editaddressdialog.ui\" line=\"25\"/>\n <source>&Label</source>\n <translation>&Nimi</translation>\n </message>\n <message>\n <location filename=\"../forms/editaddressdialog.ui\" line=\"35\"/>\n <source>The label associated with this address book entry</source>\n <translation>T\u00e4h\u00e4n osoitteeseen liitetty nimi</translation>\n </message>\n <message>\n <location filename=\"../forms/editaddressdialog.ui\" line=\"42\"/>\n <source>&Address</source>\n <translation>&Osoite</translation>\n </message>\n <message>\n <location filename=\"../forms/editaddressdialog.ui\" line=\"52\"/>\n <source>The address associated with this address book entry. This can only be modified for sending addresses.</source>\n <translation>Osoite, joka liittyy t\u00e4m\u00e4n osoitekirjan merkint\u00e4\u00e4n. T\u00e4t\u00e4 voidaan muuttaa vain l\u00e4hteviss\u00e4 osoitteissa.</translation>\n </message>\n <message>\n <location filename=\"../editaddressdialog.cpp\" line=\"20\"/>\n <source>New receiving address</source>\n <translation>Uusi vastaanottava osoite</translation>\n </message>\n <message>\n <location filename=\"../editaddressdialog.cpp\" line=\"24\"/>\n <source>New sending address</source>\n <translation>Uusi l\u00e4hett\u00e4v\u00e4 osoite</translation>\n </message>\n <message>\n <location filename=\"../editaddressdialog.cpp\" line=\"27\"/>\n <source>Edit receiving address</source>\n <translation>Muokkaa vastaanottajan osoitetta</translation>\n </message>\n <message>\n <location filename=\"../editaddressdialog.cpp\" line=\"31\"/>\n <source>Edit sending address</source>\n <translation>Muokkaa l\u00e4htev\u00e4\u00e4 osoitetta</translation>\n </message>\n <message>\n <location filename=\"../editaddressdialog.cpp\" line=\"91\"/>\n <source>The entered address "%1" is already in the address book.</source>\n <translation>Osoite "%1" on jo osoitekirjassa.</translation>\n </message>\n <message>\n <location filename=\"../editaddressdialog.cpp\" line=\"96\"/>\n <source>The entered address "%1" is not a valid Bitcoin address.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../editaddressdialog.cpp\" line=\"101\"/>\n <source>Could not unlock wallet.</source>\n <translation>Lompakkoa ei voitu avata.</translation>\n </message>\n <message>\n <location filename=\"../editaddressdialog.cpp\" line=\"106\"/>\n <source>New key generation failed.</source>\n <translation>Uuden avaimen luonti ep\u00e4onnistui.</translation>\n </message>\n</context>\n<context>\n <name>HelpMessageBox</name>\n <message>\n <location filename=\"../bitcoin.cpp\" line=\"133\"/>\n <location filename=\"../bitcoin.cpp\" line=\"143\"/>\n <source>Bitcoin-Qt</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoin.cpp\" line=\"133\"/>\n <source>version</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoin.cpp\" line=\"135\"/>\n <source>Usage:</source>\n <translation>K\u00e4ytt\u00f6:</translation>\n </message>\n <message>\n <location filename=\"../bitcoin.cpp\" line=\"136\"/>\n <source>options</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoin.cpp\" line=\"138\"/>\n <source>UI options</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoin.cpp\" line=\"139\"/>\n <source>Set language, for example "de_DE" (default: system locale)</source>\n <translation>Set language, for example "de_DE" (default: system locale)</translation>\n </message>\n <message>\n <location filename=\"../bitcoin.cpp\" line=\"140\"/>\n <source>Start minimized</source>\n <translation>K\u00e4ynnist\u00e4 pienennettyn\u00e4</translation>\n </message>\n <message>\n <location filename=\"../bitcoin.cpp\" line=\"141\"/>\n <source>Show splash screen on startup (default: 1)</source>\n <translation>N\u00e4yt\u00e4 aloitusruutu k\u00e4ynnistett\u00e4ess\u00e4 (oletus: 1)</translation>\n </message>\n</context>\n<context>\n <name>MainOptionsPage</name>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"227\"/>\n <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"212\"/>\n <source>Pay transaction &fee</source>\n <translation>Maksa rahansiirtopalkkio</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"204\"/>\n <source>Main</source>\n <translation>Yleiset</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"206\"/>\n <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>\n <translation>Vapaaehtoinen rahansiirtopalkkio per kB auttaa nopeuttamaan siirtoja. Useimmat rahansiirrot ovat 1 kB. 0.01 palkkio on suositeltava.</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"222\"/>\n <source>&Start Bitcoin on system login</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"223\"/>\n <source>Automatically start Bitcoin after logging in to the system</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"226\"/>\n <source>&Detach databases at shutdown</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>MessagePage</name>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"14\"/>\n <source>Sign Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"20\"/>\n <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n <translation>Voit allekirjoittaa viestit omalla osoitteellasi todistaaksesi ett\u00e4 omistat ne. Ole huolellinen, ett\u00e4 et allekirjoita mit\u00e4\u00e4n ep\u00e4m\u00e4\u00e4r\u00e4ist\u00e4, phishing-hy\u00f6kk\u00e4\u00e4j\u00e4t voivat huijata sinua allekirjoittamaan luovuttamalla henkil\u00f6llisyytesi. Allekirjoita selvitys t\u00e4ysin yksityiskohtaisesti mihin olet sitoutunut.</translation>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"38\"/>\n <source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>\n <translation>Osoite mill\u00e4 viesti allekirjoitetaan (esim. \n1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"48\"/>\n <source>Choose adress from address book</source>\n <translation>Valitse osoite osoitekirjasta</translation>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"58\"/>\n <source>Alt+A</source>\n <translation>Alt+A</translation>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"71\"/>\n <source>Paste address from clipboard</source>\n <translation>Liit\u00e4 osoite leikep\u00f6yd\u00e4lt\u00e4</translation>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"81\"/>\n <source>Alt+P</source>\n <translation>Alt+P</translation>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"93\"/>\n <source>Enter the message you want to sign here</source>\n <translation>Kirjoita t\u00e4h\u00e4n viesti mink\u00e4 haluat allekirjoittaa</translation>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"128\"/>\n <source>Copy the current signature to the system clipboard</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"131\"/>\n <source>&Copy Signature</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"142\"/>\n <source>Reset all sign message fields</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"145\"/>\n <source>Clear &All</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../messagepage.cpp\" line=\"31\"/>\n <source>Click "Sign Message" to get signature</source>\n <translation>Klikkaa "Allekirjoita viesti" saadaksesi allekirjoituksen</translation>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"114\"/>\n <source>Sign a message to prove you own this address</source>\n <translation>Allekirjoita viesti mill\u00e4 todistat omistavasi t\u00e4m\u00e4n osoitteen</translation>\n </message>\n <message>\n <location filename=\"../forms/messagepage.ui\" line=\"117\"/>\n <source>&Sign Message</source>\n <translation>&Allekirjoita viesti</translation>\n </message>\n <message>\n <location filename=\"../messagepage.cpp\" line=\"30\"/>\n <source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>\n <translation>Anna Bitcoin-osoite (esim. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>\n </message>\n <message>\n <location filename=\"../messagepage.cpp\" line=\"83\"/>\n <location filename=\"../messagepage.cpp\" line=\"90\"/>\n <location filename=\"../messagepage.cpp\" line=\"105\"/>\n <location filename=\"../messagepage.cpp\" line=\"117\"/>\n <source>Error signing</source>\n <translation>Virhe allekirjoitettaessa</translation>\n </message>\n <message>\n <location filename=\"../messagepage.cpp\" line=\"83\"/>\n <source>%1 is not a valid address.</source>\n <translation>%1 ei ole kelvollinen osoite.</translation>\n </message>\n <message>\n <location filename=\"../messagepage.cpp\" line=\"90\"/>\n <source>%1 does not refer to a key.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../messagepage.cpp\" line=\"105\"/>\n <source>Private key for %1 is not available.</source>\n <translation>Yksityisavain %1 :lle ei ole saatavilla.</translation>\n </message>\n <message>\n <location filename=\"../messagepage.cpp\" line=\"117\"/>\n <source>Sign failed</source>\n <translation>Allekirjoittaminen ep\u00e4onnistui</translation>\n </message>\n</context>\n<context>\n <name>NetworkOptionsPage</name>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"345\"/>\n <source>Network</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"347\"/>\n <source>Map port using &UPnP</source>\n <translation>Portin uudelleenohjaus &UPnP:ll\u00e4</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"348\"/>\n <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n <translation>Avaa Bitcoin-asiakasohjelman portti reitittimell\u00e4 automaattisesti. T\u00e4m\u00e4 toimii vain, jos reitittimesi tukee UPnP:t\u00e4 ja se on k\u00e4yt\u00f6ss\u00e4.</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"351\"/>\n <source>&Connect through SOCKS4 proxy:</source>\n <translation>&Yhdist\u00e4 SOCKS4-v\u00e4lityspalvelimen kautta:</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"352\"/>\n <source>Connect to the Bitcon network through a SOCKS4 proxy (e.g. when connecting through Tor)</source>\n <translation>Yhdist\u00e4 Bitcoin-verkkoon SOCKS4-v\u00e4lityspalvelimen kautta (esimerkiksi k\u00e4ytt\u00e4ess\u00e4 Tor:ia)</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"357\"/>\n <source>Proxy &IP:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"366\"/>\n <source>&Port:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"363\"/>\n <source>IP address of the proxy (e.g. 127.0.0.1)</source>\n <translation>V\u00e4lityspalvelimen IP-osoite (esim. 127.0.0.1)</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"372\"/>\n <source>Port of the proxy (e.g. 1234)</source>\n <translation>Portti, johon Bitcoin-asiakasohjelma yhdist\u00e4\u00e4 (esim. 1234)</translation>\n </message>\n</context>\n<context>\n <name>OptionsDialog</name>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"135\"/>\n <source>Options</source>\n <translation>Asetukset</translation>\n </message>\n</context>\n<context>\n <name>OverviewPage</name>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Lomake</translation>\n </message>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"47\"/>\n <location filename=\"../forms/overviewpage.ui\" line=\"204\"/>\n <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"89\"/>\n <source>Balance:</source>\n <translation>Saldo:</translation>\n </message>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"147\"/>\n <source>Number of transactions:</source>\n <translation>Rahansiirtojen lukum\u00e4\u00e4r\u00e4:</translation>\n </message>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"118\"/>\n <source>Unconfirmed:</source>\n <translation>Vahvistamatta:</translation>\n </message>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"40\"/>\n <source>Wallet</source>\n <translation>Lompakko</translation>\n </message>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"197\"/>\n <source><b>Recent transactions</b></source>\n <translation><b>Viimeisimm\u00e4t rahansiirrot</b></translation>\n </message>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"105\"/>\n <source>Your current balance</source>\n <translation>Tilill\u00e4si t\u00e4ll\u00e4 hetkell\u00e4 olevien Bitcoinien m\u00e4\u00e4r\u00e4</translation>\n </message>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"134\"/>\n <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>\n <translation>Niiden saapuvien rahansiirtojen m\u00e4\u00e4r\u00e4, joita Bitcoin-verkko ei viel\u00e4 ole ehtinyt vahvistaa ja siten eiv\u00e4t viel\u00e4 n\u00e4y saldossa.</translation>\n </message>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"154\"/>\n <source>Total number of transactions in wallet</source>\n <translation>Lompakolla tehtyjen rahansiirtojen yhteism\u00e4\u00e4r\u00e4</translation>\n </message>\n <message>\n <location filename=\"../overviewpage.cpp\" line=\"110\"/>\n <location filename=\"../overviewpage.cpp\" line=\"111\"/>\n <source>out of sync</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>QRCodeDialog</name>\n <message>\n <location filename=\"../forms/qrcodedialog.ui\" line=\"14\"/>\n <source>QR Code Dialog</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/qrcodedialog.ui\" line=\"32\"/>\n <source>QR Code</source>\n <translation>QR-koodi</translation>\n </message>\n <message>\n <location filename=\"../forms/qrcodedialog.ui\" line=\"55\"/>\n <source>Request Payment</source>\n <translation>Vastaanota maksu</translation>\n </message>\n <message>\n <location filename=\"../forms/qrcodedialog.ui\" line=\"70\"/>\n <source>Amount:</source>\n <translation>M\u00e4\u00e4r\u00e4:</translation>\n </message>\n <message>\n <location filename=\"../forms/qrcodedialog.ui\" line=\"105\"/>\n <source>BTC</source>\n <translation>BTC</translation>\n </message>\n <message>\n <location filename=\"../forms/qrcodedialog.ui\" line=\"121\"/>\n <source>Label:</source>\n <translation>Tunniste:</translation>\n </message>\n <message>\n <location filename=\"../forms/qrcodedialog.ui\" line=\"144\"/>\n <source>Message:</source>\n <translation>Viesti:</translation>\n </message>\n <message>\n <location filename=\"../forms/qrcodedialog.ui\" line=\"186\"/>\n <source>&Save As...</source>\n <translation>&Tallenna nimell\u00e4...</translation>\n </message>\n <message>\n <location filename=\"../qrcodedialog.cpp\" line=\"45\"/>\n <source>Error encoding URI into QR Code.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../qrcodedialog.cpp\" line=\"63\"/>\n <source>Resulting URI too long, try to reduce the text for label / message.</source>\n <translation>Tuloksen URI liian pitk\u00e4, yrit\u00e4 lyhent\u00e4\u00e4 otsikon teksti\u00e4 / viesti\u00e4.</translation>\n </message>\n <message>\n <location filename=\"../qrcodedialog.cpp\" line=\"120\"/>\n <source>Save QR Code</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../qrcodedialog.cpp\" line=\"120\"/>\n <source>PNG Images (*.png)</source>\n <translation>PNG kuvat (*png)</translation>\n </message>\n</context>\n<context>\n <name>RPCConsole</name>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"14\"/>\n <source>Bitcoin debug window</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"46\"/>\n <source>Client name</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"56\"/>\n <location filename=\"../forms/rpcconsole.ui\" line=\"79\"/>\n <location filename=\"../forms/rpcconsole.ui\" line=\"102\"/>\n <location filename=\"../forms/rpcconsole.ui\" line=\"125\"/>\n <location filename=\"../forms/rpcconsole.ui\" line=\"161\"/>\n <location filename=\"../forms/rpcconsole.ui\" line=\"214\"/>\n <location filename=\"../forms/rpcconsole.ui\" line=\"237\"/>\n <location filename=\"../forms/rpcconsole.ui\" line=\"260\"/>\n <location filename=\"../rpcconsole.cpp\" line=\"245\"/>\n <source>N/A</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"69\"/>\n <source>Client version</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"24\"/>\n <source>&Information</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"39\"/>\n <source>Client</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"115\"/>\n <source>Startup time</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"144\"/>\n <source>Network</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"151\"/>\n <source>Number of connections</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"174\"/>\n <source>On testnet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"197\"/>\n <source>Block chain</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"204\"/>\n <source>Current number of blocks</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"227\"/>\n <source>Estimated total blocks</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"250\"/>\n <source>Last block time</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"292\"/>\n <source>Debug logfile</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"299\"/>\n <source>Open the Bitcoin debug logfile from the current data directory. This can take a few seconds for large logfiles.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"302\"/>\n <source>&Open</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"323\"/>\n <source>&Console</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"92\"/>\n <source>Build date</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"372\"/>\n <source>Clear console</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../rpcconsole.cpp\" line=\"212\"/>\n <source>Welcome to the Bitcoin RPC console.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../rpcconsole.cpp\" line=\"213\"/>\n <source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../rpcconsole.cpp\" line=\"214\"/>\n <source>Type <b>help</b> for an overview of available commands.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>SendCoinsDialog</name>\n <message>\n <location filename=\"../forms/sendcoinsdialog.ui\" line=\"14\"/>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"122\"/>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"127\"/>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"132\"/>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"137\"/>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"143\"/>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"148\"/>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"153\"/>\n <source>Send Coins</source>\n <translation>L\u00e4het\u00e4 Bitcoineja</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsdialog.ui\" line=\"64\"/>\n <source>Send to multiple recipients at once</source>\n <translation>L\u00e4het\u00e4 monelle vastaanottajalle</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsdialog.ui\" line=\"67\"/>\n <source>&Add Recipient</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsdialog.ui\" line=\"84\"/>\n <source>Remove all transaction fields</source>\n <translation>Poista kaikki rahansiirtokent\u00e4t</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsdialog.ui\" line=\"87\"/>\n <source>Clear &All</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsdialog.ui\" line=\"106\"/>\n <source>Balance:</source>\n <translation>Saldo:</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsdialog.ui\" line=\"113\"/>\n <source>123.456 BTC</source>\n <translation>123,456 BTC</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsdialog.ui\" line=\"144\"/>\n <source>Confirm the send action</source>\n <translation>Vahvista l\u00e4hetys</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsdialog.ui\" line=\"147\"/>\n <source>&Send</source>\n <translation>&L\u00e4het\u00e4</translation>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"94\"/>\n <source><b>%1</b> to %2 (%3)</source>\n <translation><b>%1</b> to %2 (%3)</translation>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"99\"/>\n <source>Confirm send coins</source>\n <translation>Hyv\u00e4ksy Bitcoinien l\u00e4hett\u00e4minen</translation>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"100\"/>\n <source>Are you sure you want to send %1?</source>\n <translation>Haluatko varmasti l\u00e4hett\u00e4\u00e4 %1?</translation>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"100\"/>\n <source> and </source>\n <translation> ja </translation>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"123\"/>\n <source>The recepient address is not valid, please recheck.</source>\n <translation>Vastaanottajan osoite ei kelpaa, ole hyv\u00e4 ja tarkista</translation>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"128\"/>\n <source>The amount to pay must be larger than 0.</source>\n <translation>Maksettavan summan tulee olla suurempi kuin 0 Bitcoinia.</translation>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"133\"/>\n <source>The amount exceeds your balance.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"138\"/>\n <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"144\"/>\n <source>Duplicate address found, can only send to each address once per send operation.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"149\"/>\n <source>Error: Transaction creation failed.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"154\"/>\n <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>SendCoinsEntry</name>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"14\"/>\n <source>Form</source>\n <translation>Lomake</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"29\"/>\n <source>A&mount:</source>\n <translation>M&\u00e4\u00e4r\u00e4:</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"42\"/>\n <source>Pay &To:</source>\n <translation>Maksun saaja:</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"66\"/>\n <location filename=\"../sendcoinsentry.cpp\" line=\"25\"/>\n <source>Enter a label for this address to add it to your address book</source>\n <translation>Anna nimi t\u00e4lle osoitteelle, jos haluat lis\u00e4t\u00e4 sen osoitekirjaan</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"75\"/>\n <source>&Label:</source>\n <translation>&Nimi:</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"93\"/>\n <source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>\n <translation>Osoite, johon Bitcoinit l\u00e4hetet\u00e4\u00e4n (esim. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"103\"/>\n <source>Choose address from address book</source>\n <translation>Valitse osoite osoitekirjasta</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"113\"/>\n <source>Alt+A</source>\n <translation>Alt+A</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"120\"/>\n <source>Paste address from clipboard</source>\n <translation>Liit\u00e4 osoite leikep\u00f6yd\u00e4lt\u00e4</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"130\"/>\n <source>Alt+P</source>\n <translation>Alt+P</translation>\n </message>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"137\"/>\n <source>Remove this recipient</source>\n <translation>Poista </translation>\n </message>\n <message>\n <location filename=\"../sendcoinsentry.cpp\" line=\"26\"/>\n <source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>\n <translation>Anna Bitcoin-osoite (esim. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>\n </message>\n</context>\n<context>\n <name>TransactionDesc</name>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"21\"/>\n <source>Open for %1 blocks</source>\n <translation>Avoinna %1 lohkolle</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"23\"/>\n <source>Open until %1</source>\n <translation>Avoinna %1 asti</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"29\"/>\n <source>%1/offline?</source>\n <translation>%1/ei linjalla?</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"31\"/>\n <source>%1/unconfirmed</source>\n <translation>%1/vahvistamaton</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"33\"/>\n <source>%1 confirmations</source>\n <translation>%1 vahvistusta</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"51\"/>\n <source><b>Status:</b> </source>\n <translation><b>Tila:</b> </translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"56\"/>\n <source>, has not been successfully broadcast yet</source>\n <translation>, ei ole viel\u00e4 onnistuneesti l\u00e4hetetty</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"58\"/>\n <source>, broadcast through %1 node</source>\n <translation>, l\u00e4hetet\u00e4\u00e4n %1 solmun kautta</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"60\"/>\n <source>, broadcast through %1 nodes</source>\n <translation>, l\u00e4hetet\u00e4\u00e4n %1 solmun kautta</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"64\"/>\n <source><b>Date:</b> </source>\n <translation><b>P\u00e4iv\u00e4:</b> </translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"71\"/>\n <source><b>Source:</b> Generated<br></source>\n <translation><b>L\u00e4hde:</b> Generoitu<br></translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"77\"/>\n <location filename=\"../transactiondesc.cpp\" line=\"94\"/>\n <source><b>From:</b> </source>\n <translation><b>L\u00e4hett\u00e4j\u00e4:</b> </translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"94\"/>\n <source>unknown</source>\n <translation>tuntematon</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"95\"/>\n <location filename=\"../transactiondesc.cpp\" line=\"118\"/>\n <location filename=\"../transactiondesc.cpp\" line=\"178\"/>\n <source><b>To:</b> </source>\n <translation><b>Vast. ott.:</b></translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"98\"/>\n <source> (yours, label: </source>\n <translation>(sinun, tunniste: </translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"100\"/>\n <source> (yours)</source>\n <translation>(sinun)</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"136\"/>\n <location filename=\"../transactiondesc.cpp\" line=\"150\"/>\n <location filename=\"../transactiondesc.cpp\" line=\"195\"/>\n <location filename=\"../transactiondesc.cpp\" line=\"212\"/>\n <source><b>Credit:</b> </source>\n <translation><b>Krediitti:</b> </translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"138\"/>\n <source>(%1 matures in %2 more blocks)</source>\n <translation>(%1 er\u00e4\u00e4ntyy %2 useammassa lohkossa)</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"142\"/>\n <source>(not accepted)</source>\n <translation>(ei hyv\u00e4ksytty)</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"186\"/>\n <location filename=\"../transactiondesc.cpp\" line=\"194\"/>\n <location filename=\"../transactiondesc.cpp\" line=\"209\"/>\n <source><b>Debit:</b> </source>\n <translation><b>Debit:</b> </translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"200\"/>\n <source><b>Transaction fee:</b> </source>\n <translation><b>Rahansiirtomaksu:</b> </translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"216\"/>\n <source><b>Net amount:</b> </source>\n <translation><b>Nettom\u00e4\u00e4r\u00e4:</b> </translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"222\"/>\n <source>Message:</source>\n <translation>Viesti:</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"224\"/>\n <source>Comment:</source>\n <translation>Kommentti:</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"226\"/>\n <source>Transaction ID:</source>\n <translation>Rahansiirron ID:</translation>\n </message>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"229\"/>\n <source>Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to "not accepted" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n <translation>Luotujen kolikoiden on odotettava 120 lohkoa ennen kuin ne voidaan k\u00e4ytt\u00e4\u00e4. Kun loit t\u00e4m\u00e4n lohkon, se l\u00e4hetettiin verkkoon lis\u00e4tt\u00e4v\u00e4ksi lohkoketjuun. Jos se ep\u00e4onnistuu ketjuun liittymisess\u00e4, sen tila muuttuu "ei hyv\u00e4ksytty" eik\u00e4 sit\u00e4 voi k\u00e4ytt\u00e4\u00e4. T\u00e4t\u00e4 voi silloin t\u00e4ll\u00f6in esiinty\u00e4 jos toinen solmu luo lohkon muutamia sekunteja omastasi.</translation>\n </message>\n</context>\n<context>\n <name>TransactionDescDialog</name>\n <message>\n <location filename=\"../forms/transactiondescdialog.ui\" line=\"14\"/>\n <source>Transaction details</source>\n <translation>Rahansiirron yksityiskohdat</translation>\n </message>\n <message>\n <location filename=\"../forms/transactiondescdialog.ui\" line=\"20\"/>\n <source>This pane shows a detailed description of the transaction</source>\n <translation>T\u00e4m\u00e4 ruutu n\u00e4ytt\u00e4\u00e4 yksityiskohtaisen tiedon rahansiirrosta</translation>\n </message>\n</context>\n<context>\n <name>TransactionTableModel</name>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"226\"/>\n <source>Date</source>\n <translation>P\u00e4iv\u00e4m\u00e4\u00e4r\u00e4</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"226\"/>\n <source>Type</source>\n <translation>Laatu</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"226\"/>\n <source>Address</source>\n <translation>Osoite</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"226\"/>\n <source>Amount</source>\n <translation>M\u00e4\u00e4r\u00e4</translation>\n </message>\n <message numerus=\"yes\">\n <location filename=\"../transactiontablemodel.cpp\" line=\"281\"/>\n <source>Open for %n block(s)</source>\n <translation><numerusform>Auki %n lohkolle</numerusform><numerusform>Auki %n lohkoille</numerusform></translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"284\"/>\n <source>Open until %1</source>\n <translation>Avoinna %1 asti</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"287\"/>\n <source>Offline (%1 confirmations)</source>\n <translation>Ei yhteytt\u00e4 verkkoon (%1 vahvistusta)</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"290\"/>\n <source>Unconfirmed (%1 of %2 confirmations)</source>\n <translation>Vahvistamatta (%1/%2 vahvistusta)</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"293\"/>\n <source>Confirmed (%1 confirmations)</source>\n <translation>Vahvistettu (%1 vahvistusta)</translation>\n </message>\n <message numerus=\"yes\">\n <location filename=\"../transactiontablemodel.cpp\" line=\"301\"/>\n <source>Mined balance will be available in %n more blocks</source>\n <translation><numerusform>Louhittu saldo tulee saataville %n lohkossa</numerusform><numerusform>Louhittu saldo tulee saataville %n lohkossa</numerusform></translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"307\"/>\n <source>This block was not received by any other nodes and will probably not be accepted!</source>\n <translation>T\u00e4t\u00e4 lohkoa ei vastaanotettu mist\u00e4\u00e4n muusta solmusta ja sit\u00e4 ei mahdollisesti hyv\u00e4ksyt\u00e4!</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"310\"/>\n <source>Generated but not accepted</source>\n <translation>Generoitu mutta ei hyv\u00e4ksytty</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"353\"/>\n <source>Received with</source>\n <translation>Vastaanotettu osoitteella</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"355\"/>\n <source>Received from</source>\n <translation>Vastaanotettu</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"358\"/>\n <source>Sent to</source>\n <translation>Saaja</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"360\"/>\n <source>Payment to yourself</source>\n <translation>Maksu itsellesi</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"362\"/>\n <source>Mined</source>\n <translation>Louhittu</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"400\"/>\n <source>(n/a)</source>\n <translation>(ei saatavilla)</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"599\"/>\n <source>Transaction status. Hover over this field to show number of confirmations.</source>\n <translation>Rahansiirron tila. Siirr\u00e4 osoitin kent\u00e4n p\u00e4\u00e4lle n\u00e4hd\u00e4ksesi vahvistusten lukum\u00e4\u00e4r\u00e4.</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"601\"/>\n <source>Date and time that the transaction was received.</source>\n <translation>Rahansiirron vastaanottamisen p\u00e4iv\u00e4m\u00e4\u00e4r\u00e4 ja aika.</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"603\"/>\n <source>Type of transaction.</source>\n <translation>Rahansiirron laatu.</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"605\"/>\n <source>Destination address of transaction.</source>\n <translation>Rahansiirron kohteen Bitcoin-osoite</translation>\n </message>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"607\"/>\n <source>Amount removed from or added to balance.</source>\n <translation>Saldoon lis\u00e4tty tai siit\u00e4 v\u00e4hennetty m\u00e4\u00e4r\u00e4.</translation>\n </message>\n</context>\n<context>\n <name>TransactionView</name>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"55\"/>\n <location filename=\"../transactionview.cpp\" line=\"71\"/>\n <source>All</source>\n <translation>Kaikki</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"56\"/>\n <source>Today</source>\n <translation>T\u00e4n\u00e4\u00e4n</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"57\"/>\n <source>This week</source>\n <translation>T\u00e4ll\u00e4 viikolla</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"58\"/>\n <source>This month</source>\n <translation>T\u00e4ss\u00e4 kuussa</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"59\"/>\n <source>Last month</source>\n <translation>Viime kuussa</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"60\"/>\n <source>This year</source>\n <translation>T\u00e4n\u00e4 vuonna</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"61\"/>\n <source>Range...</source>\n <translation>Alue...</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"72\"/>\n <source>Received with</source>\n <translation>Vastaanotettu osoitteella</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"74\"/>\n <source>Sent to</source>\n <translation>Saaja</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"76\"/>\n <source>To yourself</source>\n <translation>Itsellesi</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"77\"/>\n <source>Mined</source>\n <translation>Louhittu</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"78\"/>\n <source>Other</source>\n <translation>Muu</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"85\"/>\n <source>Enter address or label to search</source>\n <translation>Anna etsitt\u00e4v\u00e4 osoite tai tunniste</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"92\"/>\n <source>Min amount</source>\n <translation>Minimim\u00e4\u00e4r\u00e4</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"126\"/>\n <source>Copy address</source>\n <translation>Kopioi osoite</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"127\"/>\n <source>Copy label</source>\n <translation>Kopioi nimi</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"128\"/>\n <source>Copy amount</source>\n <translation>Kopioi m\u00e4\u00e4r\u00e4</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"129\"/>\n <source>Edit label</source>\n <translation>Muokkaa nime\u00e4</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"130\"/>\n <source>Show transaction details</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"270\"/>\n <source>Export Transaction Data</source>\n <translation>Vie rahansiirron tiedot</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"271\"/>\n <source>Comma separated file (*.csv)</source>\n <translation>Comma separated file (*.csv)</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"279\"/>\n <source>Confirmed</source>\n <translation>Vahvistettu</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"280\"/>\n <source>Date</source>\n <translation>Aika</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"281\"/>\n <source>Type</source>\n <translation>Laatu</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"282\"/>\n <source>Label</source>\n <translation>Nimi</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"283\"/>\n <source>Address</source>\n <translation>Osoite</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"284\"/>\n <source>Amount</source>\n <translation>M\u00e4\u00e4r\u00e4</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"285\"/>\n <source>ID</source>\n <translation>ID</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"289\"/>\n <source>Error exporting</source>\n <translation>Virhe tietojen vienniss\u00e4</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"289\"/>\n <source>Could not write to file %1.</source>\n <translation>Ei voida kirjoittaa tiedostoon %1.</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"384\"/>\n <source>Range:</source>\n <translation>Alue:</translation>\n </message>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"392\"/>\n <source>to</source>\n <translation>kenelle</translation>\n </message>\n</context>\n<context>\n <name>VerifyMessageDialog</name>\n <message>\n <location filename=\"../forms/verifymessagedialog.ui\" line=\"14\"/>\n <source>Verify Signed Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/verifymessagedialog.ui\" line=\"20\"/>\n <source>Enter the message and signature below (be careful to correctly copy newlines, spaces, tabs and other invisible characters) to obtain the Bitcoin address used to sign the message.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/verifymessagedialog.ui\" line=\"62\"/>\n <source>Verify a message and obtain the Bitcoin address used to sign the message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/verifymessagedialog.ui\" line=\"65\"/>\n <source>&Verify Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/verifymessagedialog.ui\" line=\"79\"/>\n <source>Copy the currently selected address to the system clipboard</source>\n <translation>Kopioi valittu osoite leikep\u00f6yd\u00e4lle</translation>\n </message>\n <message>\n <location filename=\"../forms/verifymessagedialog.ui\" line=\"82\"/>\n <source>&Copy Address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/verifymessagedialog.ui\" line=\"93\"/>\n <source>Reset all verify message fields</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../forms/verifymessagedialog.ui\" line=\"96\"/>\n <source>Clear &All</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../verifymessagedialog.cpp\" line=\"28\"/>\n <source>Enter Bitcoin signature</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../verifymessagedialog.cpp\" line=\"29\"/>\n <source>Click "Verify Message" to obtain address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../verifymessagedialog.cpp\" line=\"55\"/>\n <location filename=\"../verifymessagedialog.cpp\" line=\"62\"/>\n <source>Invalid Signature</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../verifymessagedialog.cpp\" line=\"55\"/>\n <source>The signature could not be decoded. Please check the signature and try again.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../verifymessagedialog.cpp\" line=\"62\"/>\n <source>The signature did not match the message digest. Please check the signature and try again.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../verifymessagedialog.cpp\" line=\"72\"/>\n <source>Address not found in address book.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../verifymessagedialog.cpp\" line=\"72\"/>\n <source>Address found in address book: %1</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>WalletModel</name>\n <message>\n <location filename=\"../walletmodel.cpp\" line=\"158\"/>\n <source>Sending...</source>\n <translation>L\u00e4hetet\u00e4\u00e4n...</translation>\n </message>\n</context>\n<context>\n <name>WindowOptionsPage</name>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"313\"/>\n <source>Window</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"316\"/>\n <source>&Minimize to the tray instead of the taskBHC</source>\n <translation>&Pienenn\u00e4 ilmaisinalueelle ty\u00f6kalurivin sijasta</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"317\"/>\n <source>Show only a tray icon after minimizing the window</source>\n <translation>N\u00e4yt\u00e4 ainoastaan pikkukuvake ikkunan pienent\u00e4misen j\u00e4lkeen</translation>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"320\"/>\n <source>M&inimize on close</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"321\"/>\n <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>\n <translation>Ikkunaa suljettaessa vain pienent\u00e4\u00e4 Bitcoin-ohjelman ikkunan lopettamatta itse ohjelmaa. Kun t\u00e4m\u00e4 asetus on valittuna, ohjelman voi sulkea vain valitsemalla Lopeta ohjelman valikosta.</translation>\n </message>\n</context>\n<context>\n <name>bitcoin-core</name>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"43\"/>\n <source>Bitcoin version</source>\n <translation>Bitcoinin versio</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"44\"/>\n <source>Usage:</source>\n <translation>K\u00e4ytt\u00f6:</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"45\"/>\n <source>Send command to -server or bitcoind</source>\n <translation>L\u00e4het\u00e4 k\u00e4sky palvelimelle tai bitcoind:lle</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"46\"/>\n <source>List commands</source>\n <translation>Lista komennoista</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"47\"/>\n <source>Get help for a command</source>\n <translation>Hanki apua k\u00e4skyyn</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"49\"/>\n <source>Options:</source>\n <translation>Asetukset:</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"50\"/>\n <source>Specify configuration file (default: bitcoin.conf)</source>\n <translation>M\u00e4\u00e4rit\u00e4 asetustiedosto (oletus: bitcoin.conf)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"51\"/>\n <source>Specify pid file (default: bitcoind.pid)</source>\n <translation>M\u00e4\u00e4rit\u00e4 pid-tiedosto (oletus: bitcoin.pid)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"52\"/>\n <source>Generate coins</source>\n <translation>Generoi kolikoita</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"53\"/>\n <source>Don't generate coins</source>\n <translation>\u00c4l\u00e4 generoi kolikoita</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"54\"/>\n <source>Specify data directory</source>\n <translation>M\u00e4\u00e4rit\u00e4 data-hakemisto</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"55\"/>\n <source>Set database cache size in megabytes (default: 25)</source>\n <translation>Aseta tietokannan v\u00e4limuistin koko megatavuina (oletus: 25)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"56\"/>\n <source>Set database disk log size in megabytes (default: 100)</source>\n <translation>Aseta tietokannan lokitiedoston koko megatavuina (oletus: 100)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"57\"/>\n <source>Specify connection timeout (in milliseconds)</source>\n <translation>M\u00e4\u00e4rit\u00e4 yhteyden aikakatkaisu (millisekunneissa)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"63\"/>\n <source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source>\n <translation>Kuuntele yhteyksi\u00e4 portista <port> (oletus: 8333 tai testnet: 18333)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"64\"/>\n <source>Maintain at most <n> connections to peers (default: 125)</source>\n <translation>Pid\u00e4 enint\u00e4\u00e4n <n> yhteytt\u00e4 verkkoihin (oletus: 125)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"66\"/>\n <source>Connect only to the specified node</source>\n <translation>Muodosta yhteys vain tiettyyn solmuun</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"67\"/>\n <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"68\"/>\n <source>Specify your own public address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"69\"/>\n <source>Only connect to nodes in network <net> (IPv4 or IPv6)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"70\"/>\n <source>Try to discover public IP address (default: 1)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"73\"/>\n <source>Bind to given address. Use [host]:port notation for IPv6</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"75\"/>\n <source>Threshold for disconnecting misbehaving peers (default: 100)</source>\n <translation>Kynnysarvo aikakatkaisulle heikosti toimiville verkoille (oletus: 100)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"76\"/>\n <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>\n <translation>Sekuntien m\u00e4\u00e4r\u00e4, kuinka kauan uudelleenkytkeydyt\u00e4\u00e4n verkkoihin (oletus: 86400)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"79\"/>\n <source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 10000)</source>\n <translation>Maksimi verkkoyhteyden vastaanottopuskuri, <n>*1000 tavua (oletus: 10000)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"80\"/>\n <source>Maximum per-connection send buffer, <n>*1000 bytes (default: 10000)</source>\n <translation>Maksimi verkkoyhteyden l\u00e4hetyspuskuri, <n>*1000 tavua (oletus: 10000)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"83\"/>\n <source>Detach block and address databases. Increases shutdown time (default: 0)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"86\"/>\n <source>Accept command line and JSON-RPC commands</source>\n <translation>Hyv\u00e4ksy merkkipohjaiset- ja JSON-RPC-k\u00e4skyt</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"87\"/>\n <source>Run in the background as a daemon and accept commands</source>\n <translation>Aja taustalla daemonina ja hyv\u00e4ksy komennot</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"88\"/>\n <source>Use the test network</source>\n <translation>K\u00e4yt\u00e4 test -verkkoa</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"89\"/>\n <source>Output extra debugging information</source>\n <translation>Tulosta ylim\u00e4\u00e4r\u00e4ist\u00e4 debuggaustietoa</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"90\"/>\n <source>Prepend debug output with timestamp</source>\n <translation>Lis\u00e4\u00e4 debuggaustiedon tulostukseen aikaleima</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"91\"/>\n <source>Send trace/debug info to console instead of debug.log file</source>\n <translation>L\u00e4het\u00e4 j\u00e4ljitys/debug-tieto konsoliin, debug.log-tiedoston sijaan</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"92\"/>\n <source>Send trace/debug info to debugger</source>\n <translation>L\u00e4het\u00e4 j\u00e4ljitys/debug-tieto debuggeriin</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"93\"/>\n <source>Username for JSON-RPC connections</source>\n <translation>K\u00e4ytt\u00e4j\u00e4tunnus JSON-RPC-yhteyksille</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"94\"/>\n <source>Password for JSON-RPC connections</source>\n <translation>Salasana JSON-RPC-yhteyksille</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"95\"/>\n <source>Listen for JSON-RPC connections on <port> (default: 8332)</source>\n <translation>Kuuntele JSON-RPC -yhteyksi\u00e4 portista <port> (oletus: 8332)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"96\"/>\n <source>Allow JSON-RPC connections from specified IP address</source>\n <translation>Salli JSON-RPC yhteydet tietyst\u00e4 ip-osoitteesta</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"97\"/>\n <source>Send commands to node running on <ip> (default: 127.0.0.1)</source>\n <translation>L\u00e4het\u00e4 k\u00e4skyj\u00e4 solmuun osoitteessa <ip> (oletus: 127.0.0.1)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"98\"/>\n <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n <translation>Suorita k\u00e4sky kun paras lohko muuttuu (%s cmd on vaihdettu block hashin kanssa)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"101\"/>\n <source>Upgrade wallet to latest format</source>\n <translation>P\u00e4ivit\u00e4 lompakko uusimpaan formaattiin</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"102\"/>\n <source>Set key pool size to <n> (default: 100)</source>\n <translation>Aseta avainpoolin koko arvoon <n> (oletus: 100)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"103\"/>\n <source>Rescan the block chain for missing wallet transactions</source>\n <translation>Skannaa uudelleen lohkoketju lompakon puuttuvien rahasiirtojen vuoksi</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"104\"/>\n <source>How many blocks to check at startup (default: 2500, 0 = all)</source>\n <translation>Kuinka monta lohkoa tarkistetaan k\u00e4ynnistett\u00e4ess\u00e4 (oletus: 2500, 0 = kaikki)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"105\"/>\n <source>How thorough the block verification is (0-6, default: 1)</source>\n <translation>Kuinka tiukka lohkovarmistus on (0-6, oletus: 1)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"106\"/>\n <source>Imports blocks from external blk000?.dat file</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"108\"/>\n <source>\nSSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>\n <translation>SSL-asetukset: (lis\u00e4tietoja Bitcoin-Wikist\u00e4)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"111\"/>\n <source>Use OpenSSL (https) for JSON-RPC connections</source>\n <translation>K\u00e4yt\u00e4 OpenSSL:\u00e4\u00e4 (https) JSON-RPC-yhteyksille</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"112\"/>\n <source>Server certificate file (default: server.cert)</source>\n <translation>Palvelimen sertifikaatti-tiedosto (oletus: server.cert)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"113\"/>\n <source>Server private key (default: server.pem)</source>\n <translation>Palvelimen yksityisavain (oletus: server.pem)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"114\"/>\n <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>\n <translation>Hyv\u00e4ksytt\u00e4v\u00e4 salaus (oletus:\nTLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"145\"/>\n <source>Warning: Disk space is low</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"107\"/>\n <source>This help message</source>\n <translation>T\u00e4m\u00e4 ohjeviesti</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"121\"/>\n <source>Cannot obtain a lock on data directory %s. Bitcoin is probably already running.</source>\n <translation>En p\u00e4\u00e4se k\u00e4siksi data-hakemiston lukitukseen %s. Bitcoin on todenn\u00e4k\u00f6isesti jo k\u00e4ynnistetty.</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"48\"/>\n <source>Bitcoin</source>\n <translation>Bitcoin</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"30\"/>\n <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"58\"/>\n <source>Connect through socks proxy</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"59\"/>\n <source>Select the version of socks proxy to use (4 or 5, 5 is default)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"60\"/>\n <source>Do not use proxy for connections to network <net> (IPv4 or IPv6)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"61\"/>\n <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"62\"/>\n <source>Pass DNS requests to (SOCKS5) proxy</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"142\"/>\n <source>Loading addresses...</source>\n <translation>Ladataan osoitteita...</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"132\"/>\n <source>Error loading blkindex.dat</source>\n <translation>Virhe ladattaessa blkindex.dat-tiedostoa</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"134\"/>\n <source>Error loading wallet.dat: Wallet corrupted</source>\n <translation>Virhe ladattaessa wallet.dat-tiedostoa: Lompakko vioittunut</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"135\"/>\n <source>Error loading wallet.dat: Wallet requires newer version of Bitcoin</source>\n <translation>Virhe ladattaessa wallet.dat-tiedostoa: Tarvitset uudemman version Bitcoinista</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"136\"/>\n <source>Wallet needed to be rewritten: restart Bitcoin to complete</source>\n <translation>Lompakko tarvitsee uudelleenkirjoittaa: k\u00e4ynnist\u00e4 Bitcoin uudelleen</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"137\"/>\n <source>Error loading wallet.dat</source>\n <translation>Virhe ladattaessa wallet.dat-tiedostoa</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"124\"/>\n <source>Invalid -proxy address: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"125\"/>\n <source>Unknown network specified in -noproxy: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"127\"/>\n <source>Unknown network specified in -onlynet: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"126\"/>\n <source>Unknown -socks proxy version requested: %i</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"128\"/>\n <source>Cannot resolve -bind address: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"129\"/>\n <source>Not listening on any port</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"130\"/>\n <source>Cannot resolve -externalip address: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"117\"/>\n <source>Invalid amount for -paytxfee=<amount>: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"143\"/>\n <source>Error: could not start node</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"31\"/>\n <source>Error: Wallet locked, unable to create transaction </source>\n <translation>Virhe: Lompakko on lukittu, rahansiirtoa ei voida luoda</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"32\"/>\n <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>\n <translation>Virhe: T\u00e4m\u00e4 rahansiirto vaatii rahansiirtopalkkion v\u00e4hint\u00e4\u00e4n %s johtuen sen m\u00e4\u00e4r\u00e4st\u00e4, monimutkaisuudesta tai hiljattain vastaanotettujen summien k\u00e4yt\u00f6st\u00e4</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"35\"/>\n <source>Error: Transaction creation failed </source>\n <translation>Virhe: Rahansiirron luonti ep\u00e4onnistui</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"36\"/>\n <source>Sending...</source>\n <translation>L\u00e4hetet\u00e4\u00e4n...</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"37\"/>\n <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>\n <translation>Virhe: Rahansiirto hyl\u00e4ttiin. T\u00e4m\u00e4 voi tapahtua jos jotkin bitcoineistasi on jo k\u00e4ytetty, esimerkiksi jos olet k\u00e4ytt\u00e4nyt kopiota wallet.dat-lompakkotiedostosta ja bitcoinit on merkitty k\u00e4ytetyksi vain kopiossa.</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"41\"/>\n <source>Invalid amount</source>\n <translation>Virheellinen m\u00e4\u00e4r\u00e4</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"42\"/>\n <source>Insufficient funds</source>\n <translation>Lompakon saldo ei riit\u00e4</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"131\"/>\n <source>Loading block index...</source>\n <translation>Ladataan lohkoindeksi\u00e4...</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"65\"/>\n <source>Add a node to connect to and attempt to keep the connection open</source>\n <translation>Lin\u00e4\u00e4 solmu mihin liitty\u00e4 pit\u00e4\u00e4ksesi yhteyden auki</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"28\"/>\n <source>Unable to bind to %s on this computer. Bitcoin is probably already running.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"71\"/>\n <source>Find peers using internet relay chat (default: 0)</source>\n <translation>Etsi solmuja k\u00e4ytt\u00e4en internet relay chatia (oletus: 0)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"72\"/>\n <source>Accept connections from outside (default: 1)</source>\n <translation>Hyv\u00e4ksyt\u00e4\u00e4n ulkopuoliset yhteydet (oletus: 1)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"74\"/>\n <source>Find peers using DNS lookup (default: 1)</source>\n <translation>Etsi solmuja k\u00e4ytt\u00e4m\u00e4ll\u00e4 DNS hakua (oletus: 1)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"81\"/>\n <source>Use Universal Plug and Play to map the listening port (default: 1)</source>\n <translation>K\u00e4yt\u00e4 Plug and Play kartoitusta kuunnellaksesi porttia (oletus: 1)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"82\"/>\n <source>Use Universal Plug and Play to map the listening port (default: 0)</source>\n <translation>K\u00e4yt\u00e4 Plug and Play kartoitusta kuunnellaksesi porttia (oletus: 0)</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"85\"/>\n <source>Fee per KB to add to transactions you send</source>\n <translation>Rahansiirtopalkkio per KB lis\u00e4t\u00e4\u00e4n l\u00e4hett\u00e4m\u00e4\u00e4si rahansiirtoon</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"118\"/>\n <source>Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"133\"/>\n <source>Loading wallet...</source>\n <translation>Ladataan lompakkoa...</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"138\"/>\n <source>Cannot downgrade wallet</source>\n <translation>Et voi p\u00e4ivitt\u00e4\u00e4 lompakkoasi vanhempaan versioon</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"139\"/>\n <source>Cannot initialize keypool</source>\n <translation>Avainvarastoa ei voi alustaa</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"140\"/>\n <source>Cannot write default address</source>\n <translation>Oletusosoitetta ei voi kirjoittaa</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"141\"/>\n <source>Rescanning...</source>\n <translation>Skannataan uudelleen...</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"144\"/>\n <source>Done loading</source>\n <translation>Lataus on valmis</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"8\"/>\n <source>To use the %s option</source>\n <translation>K\u00e4yt\u00e4 %s optiota</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"9\"/>\n <source>%s, you must set a rpcpassword in the configuration file:\n %s\nIt is recommended you use the following random password:\nrpcuser=bitcoinrpc\nrpcpassword=%s\n(you do not need to remember this password)\nIf the file does not exist, create it with owner-readable-only file permissions.\n</source>\n <translation>%s, sinun t\u00e4ytyy asettaa rpcpassword asetustiedostoon:\n%s\nOn suositeltavaa k\u00e4ytt\u00e4\u00e4 seuraavaan satunnaista salasanaa:\nrpcuser=bitcoinrpc\nrpcpassword=%s\n(sinun ei tarvitse muistaa t\u00e4t\u00e4 salasanaa)\nJos tiedostoa ei ole, niin luo se ainoastaan omistajan kirjoitusoikeuksin.\n</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"18\"/>\n <source>Error</source>\n <translation>Virhe</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"19\"/>\n <source>An error occured while setting up the RPC port %i for listening: %s</source>\n <translation>Virhe asetettaessa RCP-porttia %i kuunteluun: %s</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"20\"/>\n <source>You must set rpcpassword=<password> in the configuration file:\n%s\nIf the file does not exist, create it with owner-readable-only file permissions.</source>\n <translation>Sinun t\u00e4ytyy asettaa rpcpassword=<password> asetustiedostoon:\n%s\nJos tiedostoa ei ole, niin luo se ainoastaan omistajan kirjoitusoikeuksin.</translation>\n </message>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"25\"/>\n <source>Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly.</source>\n <translation>Varoitus: Tarkista, ovatko tietokoneesi p\u00e4iv\u00e4m\u00e4\u00e4r\u00e4 ja aika oikein. Mik\u00e4li aika on v\u00e4\u00e4rin, Bitcoin-ohjelma ei toimi oikein.</translation>\n </message>\n</context>\n</TS>", "meta": {"content_hash": "9d19f82a369d9fc9870815d3fb970aa3", "timestamp": "", "source": "github", "line_count": 2520, "max_line_length": 383, "avg_line_length": 43.58015873015873, "alnum_prop": 0.6466737083644443, "repo_name": "IeuanG/BHC", "id": "9008c1e3b5004ce446d6ca674ab85e7de1315c92", "size": "110359", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_fi.ts", "mode": "33261", "license": "mit", "language": [{"name": "C", "bytes": "14758"}, {"name": "C++", "bytes": "1432339"}, {"name": "Erlang", "bytes": "6839"}, {"name": "JavaScript", "bytes": "12"}, {"name": "Makefile", "bytes": "79169"}, {"name": "Objective-C++", "bytes": "2463"}, {"name": "PHP", "bytes": "1948"}, {"name": "Perl", "bytes": "16929"}, {"name": "Python", "bytes": "47538"}, {"name": "Shell", "bytes": "2615"}]}} +{"text": "<?xml version=\"1.0\"?>\n<!DOCTYPE resource-action-mapping PUBLIC \"-//Liferay//DTD Resource Action Mapping 6.2.0//EN\" \"http://www.liferay.com/dtd/liferay-resource-action-mapping_6_2_0.dtd\">\n\n<resource-action-mapping>\n\t<model-resource>\n\t\t<model-name>org.oep.dossiermgt.model.PaymentFile</model-name>\n\t\t<portlet-ref>\n\t\t\t<portlet-name>oep-core-dossiermgt</portlet-name>\n\t\t</portlet-ref>\n\t\t<weight>2</weight>\n\t\t<permissions>\n\t\t\t<supports>\n\t\t\t\t<action-key>CREATE_PAYMENTFILE</action-key>\n\t\t\t\t<action-key>PERMISSIONS</action-key>\n\t\t\t\t<action-key>UPDATE_PAYMENTFILE</action-key>\n\t\t\t</supports>\n\t\t\t<site-member-defaults>\n\t\t\t\t<action-key>CREATE_PAYMENTFILE</action-key>\n\t\t\t</site-member-defaults>\n\t\t\t<guest-defaults />\n\t\t\t<guest-unsupported>\n\t\t\t\t<action-key>PERMISSIONS</action-key>\n\t\t\t\t<action-key>UPDATE_PAYMENTFILE</action-key>\n\t\t\t</guest-unsupported>\n\t\t</permissions>\n\t</model-resource>\n</resource-action-mapping>", "meta": {"content_hash": "02252013d43c2c9c5b20a71b33db9d63", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 164, "avg_line_length": 33.51851851851852, "alnum_prop": 0.7104972375690608, "repo_name": "openegovplatform/OEPv2", "id": "716a8f0e5568373e411e3cfd99858f2a9edf919e", "size": "905", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "oep-dossier-portlet/docroot/WEB-INF/src/resource-actions/paymentfile.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "5166"}, {"name": "Java", "bytes": "45541534"}]}} +{"text": "package com.tutorialspoint.abstraction;\r\n\r\npublic class AbstractDemo {\r\n public static void main(String[] args) {\r\n /* Following is not allowed and would raise error */\r\n // Employee e = new Employee(\"George W.\", \"Houston, TX\", 43); // Compile time error\r\n Salary s = new Salary(\"Mohd Mohtashim\", \"Ambehta, UP\", 3, 3600.00);\r\n Employee e = new Salary(\"John Adams\", \"Boston, MA\", 2, 2400.00);\r\n\r\n System.out.println(\"Call mailCheck using Salary reference --\");\r\n s.mailCheck();\r\n\r\n System.out.println(\"\\nCall mailCheck using Employee reference--\");\r\n e.mailCheck();\r\n }\r\n}\r\n", "meta": {"content_hash": "80d5c9815131d8a2c7aa85e80bd0ed61", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 87, "avg_line_length": 37.4375, "alnum_prop": 0.6494156928213689, "repo_name": "antalpeti/Java-Tutorial", "id": "cb1a626739250ab543710691a5f0585ff9890a70", "size": "599", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/tutorialspoint/abstraction/AbstractDemo.java", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "549"}, {"name": "HTML", "bytes": "1147"}, {"name": "Java", "bytes": "409438"}]}} +{"text": "\ufeffusing System;\nusing System.Net;\nusing System.Net.Fakes;\nusing System.Net.Http;\nusing System.Net.Http.Fakes;\nusing System.Threading.Tasks;\nusing Microsoft.QualityTools.Testing.Fakes;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing Newtonsoft.Json;\nusing Xciles.Uncommon.Net;\n\nnamespace Xciles.Uncommon.Tests.Net\n{\n [TestClass]\n public class UncommonRequestHelperExceptionTests\n {\n private readonly Person _person = new Person\n {\n DateOfBirth = DateTime.Now.Subtract(new TimeSpan(800, 1, 1, 1)),\n Firstname = \"First\",\n Lastname = \"Person\",\n PhoneNumber = \"0123456789\",\n SomeString = \"This is just a string\"\n };\n\n [TestMethod]\n public void ProcessGetRequestWebExceptionTest()\n {\n ProcessGetRequestWebExceptionTestAsync().Wait();\n }\n\n private async Task ProcessGetRequestWebExceptionTestAsync()\n {\n var exceptionObject = new ExceptionObject()\n {\n Description = \"This is a test Exception Description\",\n Message = \"This is a test Exception Message\",\n Type = EType.WrongHeaders\n };\n\n using (ShimsContext.Create())\n {\n\n ShimHttpClient.AllInstances.SendAsyncHttpRequestMessageCancellationToken = (client, message, arg3) =>\n {\n return Task.FromResult(new HttpResponseMessage()\n {\n Content = new StringContent(JsonConvert.SerializeObject(exceptionObject)),\n StatusCode = HttpStatusCode.BadRequest\n });\n };\n\n try\n {\n var result = await UncommonRequestHelper.ProcessGetRequestAsync<Person>(\"http://www.xciles.com/\");\n Assert.Fail(\"Should not be able to be here...\");\n }\n catch (UncommonRequestException ex)\n {\n Assert.IsTrue(ex.RequestExceptionStatus == EUncommonRequestExceptionStatus.ServiceError);\n Assert.IsTrue(ex.StatusCode == HttpStatusCode.BadRequest);\n\n var responseResult = ex.ConvertExceptionResponseToObject<ExceptionObject>();\n Assert.IsTrue(responseResult != null);\n Assert.IsTrue(responseResult.Description == exceptionObject.Description);\n Assert.IsTrue(responseResult.Message == exceptionObject.Message);\n Assert.IsTrue(responseResult.Type == exceptionObject.Type);\n }\n }\n }\n\n\n\n [TestMethod]\n public void ProcessGetRequestHttpRequestExceptionTest()\n {\n ProcessGetRequestHttpRequestExceptionTestAsync().Wait();\n }\n\n private async Task ProcessGetRequestHttpRequestExceptionTestAsync()\n {\n var exceptionObject = new ExceptionObject()\n {\n Description = \"This is a test Exception Description\",\n Message = \"This is a test Exception Message\",\n Type = EType.WrongHeaders\n };\n\n using (ShimsContext.Create())\n {\n\n ShimHttpClient.AllInstances.SendAsyncHttpRequestMessageCancellationToken = (client, message, arg3) =>\n {\n //var webEx = new WebException(\"\", WebExceptionStatus.UnknownError, )\n throw new HttpRequestException();\n };\n\n ShimHttpWebResponse.AllInstances.ResponseStreamGet = (response) =>\n {\n return ShimsContext.ExecuteWithoutShims(() => response.GetResponseStream());\n };\n\n try\n {\n var result = await UncommonRequestHelper.ProcessGetRequestAsync<Person>(\"http://www.xciles.com/\");\n Assert.Fail(\"Should not be able to be here...\");\n }\n catch (UncommonRequestException ex)\n {\n Assert.IsTrue(ex.RequestExceptionStatus == EUncommonRequestExceptionStatus.ServiceError);\n Assert.IsTrue(ex.StatusCode == HttpStatusCode.BadRequest);\n\n //var responseResult = ex.ConvertExceptionResponseToObject<ExceptionObject>();\n //Assert.IsTrue(responseResult != null);\n //Assert.IsTrue(responseResult.Description == exceptionObject.Description);\n //Assert.IsTrue(responseResult.Message == exceptionObject.Message);\n //Assert.IsTrue(responseResult.Type == exceptionObject.Type);\n }\n }\n }\n }\n}\n", "meta": {"content_hash": "e0f5a5e28a0b96215ea75c8f58fcba13", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 118, "avg_line_length": 38.80327868852459, "alnum_prop": 0.5701309674693705, "repo_name": "Xciles/Uncommon", "id": "599c1d78c23361960cd716ebf69cb66d00433506", "size": "4736", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Uncommon.Tests/Net/UncommonRequestHelperExceptionTests.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "109"}, {"name": "C#", "bytes": "146892"}, {"name": "CSS", "bytes": "315"}, {"name": "HTML", "bytes": "5125"}, {"name": "JavaScript", "bytes": "19032"}, {"name": "Pascal", "bytes": "525"}]}} +{"text": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\"\n android:padding=\"20dp\"\n android:gravity=\"center\"\n android:background=\"#333\"\n android:orientation=\"vertical\">\n \n\n <TextView android:id=\"@+id/textview_alias_input\" \n android:layout_marginTop=\"10dp\"\n android:layout_width=\"200dp\"\n android:layout_height=\"wrap_content\"\n android:text=\"@string/alias\"\n android:textColor=\"#fff\"\n android:textSize=\"18dp\"\n />\n\n <EditText android:id=\"@+id/edittext_alias_input\"\n android:layout_marginTop=\"10dp\"\n android:layout_width=\"200dp\"\n android:layout_height=\"44dp\"\n />\n\n</LinearLayout>\n", "meta": {"content_hash": "a5e928b2b29f2548ce086e3527b3f0bb", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 72, "avg_line_length": 31.384615384615383, "alnum_prop": 0.6519607843137255, "repo_name": "p2plab/Nxt-Client-For-Android", "id": "9718894353d3d5ce987d2d2ff7677a5897fbd02c", "size": "816", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "res/layout/alias_input.xml", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "531831"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"utf-8\">\n\t<title>jQuery UI Datepicker Demos</title>\n\t<link rel=\"stylesheet\" href=\"../demos.css\">\n</head>\n<body>\n\n<div class=\"demos-nav\">\n\t<h4>Examples</h4>\n\t<ul>\n\t\t<li class=\"demo-config-on\"><a href=\"default.html\">Default functionality</a></li>\n\t\t<li><a href=\"date-formats.html\">Format date</a></li>\n\t\t<li><a href=\"min-max.html\">Restrict date range</a></li>\n\t\t<li><a href=\"localization.html\">Localize calendar</a></li>\n\t\t<li><a href=\"alt-field.html\">Populate alternate field</a></li>\n\t\t<li><a href=\"inline.html\">Display inline</a></li>\n\t\t<li><a href=\"buttonbar.html\">Display button bar</a></li>\n\t\t<li><a href=\"dropdown-month-year.html\">Display month & year menus</a></li>\t\t\n\t\t<li><a href=\"other-months.html\">Dates in other months</a></li>\t\t\n\t\t<li><a href=\"show-week.html\">Show week of the year</a></li>\t\t\n\t\t<li><a href=\"multiple-calendars.html\">Display multiple months</a></li>\t\t\n\t\t<li><a href=\"icon-trigger.html\">Icon trigger</a></li>\n\t\t<li><a href=\"animation.html\">Animations</a></li>\n\t\t<li><a href=\"event-search.html\">Event Search</a></li>\n\t</ul>\n</div>\n\n</body>\n</html>\n", "meta": {"content_hash": "011e5fa1504454cdbee214ef0cdcefd2", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 82, "avg_line_length": 36.54838709677419, "alnum_prop": 0.6487202118270079, "repo_name": "PhillyPUG/phillypug", "id": "37c8ef7148c7d46d3a6b916355ee6d0566bbf534", "size": "1133", "binary": false, "copies": "34", "ref": "refs/heads/master", "path": "media/development-bundle/demos/datepicker/index.html", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "package dilawar\n\ntype Type string\n\nconst (\n\tTypeCredit Type = \"credit\"\n\tTypeDebit Type = \"debit\"\n)\n\ntype Storable interface {\n\tCreate(*Transaction) error\n\tRead(int) *Transaction\n\tList() []Transaction\n}\n", "meta": {"content_hash": "8bf48ee2048fbe4af9d0dfa38a110c95", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 27, "avg_line_length": 14.5, "alnum_prop": 0.7241379310344828, "repo_name": "umayr/dilawar", "id": "31ea7e27bc18ed5652752d47e84a35bcf92ff53c", "size": "203", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dilawar.go", "mode": "33188", "license": "mit", "language": [{"name": "Go", "bytes": "6636"}, {"name": "Makefile", "bytes": "1874"}]}} +{"text": "extern \"C\" {\n#include \"third_party/py/scipy/optimize/Zeros/zeros.h\"\n}\n\nnamespace logistic_hd {\n\n// Integrands for the equations defined in Eq. 5 from Sur and Cand\u00e8s\n// (PNAS, 2019). These are called by the bivariate integration over Z1 and Z2\n// in `asymp_system_solve.py`.\ndouble integrand(double Z1, double Z2, double kappa, double gamma, double b0,\n double alpha, double lambda, double sigma, double beta0,\n int eq_num);\n\n// Computes the derivative of the objective that defines the proximal operator.\n// The prox operator is the value of z that makes this zero.\ndouble prox_deriv(double z, void *args);\n\ndouble sigmoid(double z);\n\n// Computes the derivative of the prox operator for the logistic regression\n// log likelihood.\ndouble prox_impl(double lambda, double x, double xtol = 1e-8,\n double rtol = 1e-8, int maxiters = 1000);\n\n// Computes the pdf of the bivariate normal without any input validation\n// because this is called many times during optimization.\ndouble pdf(double x1, double x2);\n\n// Helper function to pass values between our code and the scipy.optimize API.\ndouble scipy_zeros_functions_func(double x, void *params);\n\ntypedef struct prox_params {\n double lambda;\n double x;\n} prox_params;\n\n} // namespace logistic_hd\n\n#endif // MLE_PARAM_INTEGRANDS_H_\n", "meta": {"content_hash": "591be7b34b1395ac2119351a1f2e218f", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 79, "avg_line_length": 34.02564102564103, "alnum_prop": 0.720422004521477, "repo_name": "google-research/sloe-logistic", "id": "f3d13ad1d3b57092c932b7a4ba6143cec5890cae", "size": "2016", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "mle_param_integrands.h", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\r\n// Protocol Buffers - Google's data interchange format\r\n// Copyright 2008 Google Inc. All rights reserved.\r\n// http://github.com/jskeet/dotnet-protobufs/\r\n// Original C++/Java/Python code:\r\n// http://code.google.com/p/protobuf/\r\n//\r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are\r\n// met:\r\n//\r\n// * Redistributions of source code must retain the above copyright\r\n// notice, this list of conditions and the following disclaimer.\r\n// * Redistributions in binary form must reproduce the above\r\n// copyright notice, this list of conditions and the following disclaimer\r\n// in the documentation and/or other materials provided with the\r\n// distribution.\r\n// * Neither the name of Google Inc. nor the names of its\r\n// contributors may be used to endorse or promote products derived from\r\n// this software without specific prior written permission.\r\n//\r\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n\r\n#endregion\r\n\r\nusing System;\r\nusing System.Collections;\r\nusing System.Collections.Generic;\r\nusing Google.ProtocolBuffers.Descriptors;\r\n\r\n//Disable warning CS3010: CLS-compliant interfaces must have only CLS-compliant members\r\n#pragma warning disable 3010\r\n\r\nnamespace Google.ProtocolBuffers\r\n{\r\n /// <summary>\r\n /// Provides an interface that is used write a message. Most often proto buffers are written\r\n /// in their binary form by creating a instance via the CodedOutputStream.CreateInstance\r\n /// static factory.\r\n /// </summary>\r\n public interface ICodedOutputStream\r\n {\r\n /// <summary>\r\n /// Writes any message initialization data needed to the output stream\r\n /// </summary>\r\n /// <remarks>\r\n /// This is primarily used by text formats and unnecessary for protobuffers' own\r\n /// binary format. The API for MessageStart/End was added for consistent handling\r\n /// of output streams regardless of the actual writer implementation.\r\n /// </remarks>\r\n void WriteMessageStart();\r\n /// <summary>\r\n /// Writes any message finalization data needed to the output stream\r\n /// </summary>\r\n /// <remarks>\r\n /// This is primarily used by text formats and unnecessary for protobuffers' own\r\n /// binary format. The API for MessageStart/End was added for consistent handling\r\n /// of output streams regardless of the actual writer implementation.\r\n /// </remarks>\r\n void WriteMessageEnd();\r\n /// <summary>\r\n /// Indicates that all temporary buffers be written to the final output.\r\n /// </summary>\r\n void Flush();\r\n /// <summary>\r\n /// Writes an unknown message as a group\r\n /// </summary>\r\n [Obsolete]\r\n void WriteUnknownGroup(int fieldNumber, IMessageLite value);\r\n /// <summary>\r\n /// Writes an unknown field value of bytes\r\n /// </summary>\r\n void WriteUnknownBytes(int fieldNumber, ByteString value);\r\n /// <summary>\r\n /// Writes an unknown field of a primitive type\r\n /// </summary>\r\n [CLSCompliant(false)]\r\n void WriteUnknownField(int fieldNumber, WireFormat.WireType wireType, ulong value);\r\n /// <summary>\r\n /// Writes an extension as a message-set group\r\n /// </summary>\r\n void WriteMessageSetExtension(int fieldNumber, string fieldName, IMessageLite value);\r\n /// <summary>\r\n /// Writes an unknown extension as a message-set group\r\n /// </summary>\r\n void WriteMessageSetExtension(int fieldNumber, string fieldName, ByteString value);\r\n\r\n /// <summary>\r\n /// Writes a field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteField(FieldType fieldType, int fieldNumber, string fieldName, object value);\r\n\r\n /// <summary>\r\n /// Writes a double field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteDouble(int fieldNumber, string fieldName, double value);\r\n\r\n /// <summary>\r\n /// Writes a float field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteFloat(int fieldNumber, string fieldName, float value);\r\n\r\n /// <summary>\r\n /// Writes a uint64 field value, including tag, to the stream.\r\n /// </summary>\r\n [CLSCompliant(false)]\r\n void WriteUInt64(int fieldNumber, string fieldName, ulong value);\r\n\r\n /// <summary>\r\n /// Writes an int64 field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteInt64(int fieldNumber, string fieldName, long value);\r\n\r\n /// <summary>\r\n /// Writes an int32 field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteInt32(int fieldNumber, string fieldName, int value);\r\n\r\n /// <summary>\r\n /// Writes a fixed64 field value, including tag, to the stream.\r\n /// </summary>\r\n [CLSCompliant(false)]\r\n void WriteFixed64(int fieldNumber, string fieldName, ulong value);\r\n\r\n /// <summary>\r\n /// Writes a fixed32 field value, including tag, to the stream.\r\n /// </summary>\r\n [CLSCompliant(false)]\r\n void WriteFixed32(int fieldNumber, string fieldName, uint value);\r\n\r\n /// <summary>\r\n /// Writes a bool field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteBool(int fieldNumber, string fieldName, bool value);\r\n\r\n /// <summary>\r\n /// Writes a string field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteString(int fieldNumber, string fieldName, string value);\r\n\r\n /// <summary>\r\n /// Writes a group field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteGroup(int fieldNumber, string fieldName, IMessageLite value);\r\n\r\n /// <summary>\r\n /// Writes a message field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteMessage(int fieldNumber, string fieldName, IMessageLite value);\r\n\r\n /// <summary>\r\n /// Writes a byte array field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteBytes(int fieldNumber, string fieldName, ByteString value);\r\n\r\n /// <summary>\r\n /// Writes a UInt32 field value, including tag, to the stream.\r\n /// </summary>\r\n [CLSCompliant(false)]\r\n void WriteUInt32(int fieldNumber, string fieldName, uint value);\r\n\r\n /// <summary>\r\n /// Writes an enum field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteEnum(int fieldNumber, string fieldName, int value, object rawValue);\r\n\r\n /// <summary>\r\n /// Writes a fixed 32-bit field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteSFixed32(int fieldNumber, string fieldName, int value);\r\n\r\n /// <summary>\r\n /// Writes a signed fixed 64-bit field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteSFixed64(int fieldNumber, string fieldName, long value);\r\n\r\n /// <summary>\r\n /// Writes a signed 32-bit field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteSInt32(int fieldNumber, string fieldName, int value);\r\n\r\n /// <summary>\r\n /// Writes a signed 64-bit field value, including tag, to the stream.\r\n /// </summary>\r\n void WriteSInt64(int fieldNumber, string fieldName, long value);\r\n\r\n /// <summary>\r\n /// Writes a repeated field value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list);\r\n\r\n /// <summary>\r\n /// Writes a repeated group value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteGroupArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)\r\n where T : IMessageLite;\r\n\r\n /// <summary>\r\n /// Writes a repeated message value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteMessageArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)\r\n where T : IMessageLite;\r\n\r\n /// <summary>\r\n /// Writes a repeated string value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteStringArray(int fieldNumber, string fieldName, IEnumerable<string> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated ByteString value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteBytesArray(int fieldNumber, string fieldName, IEnumerable<ByteString> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated boolean value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteBoolArray(int fieldNumber, string fieldName, IEnumerable<bool> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated Int32 value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated SInt32 value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteSInt32Array(int fieldNumber, string fieldName, IEnumerable<int> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated UInt32 value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteUInt32Array(int fieldNumber, string fieldName, IEnumerable<uint> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated Fixed32 value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteFixed32Array(int fieldNumber, string fieldName, IEnumerable<uint> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated SFixed32 value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteSFixed32Array(int fieldNumber, string fieldName, IEnumerable<int> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated Int64 value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated SInt64 value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteSInt64Array(int fieldNumber, string fieldName, IEnumerable<long> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated UInt64 value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteUInt64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated Fixed64 value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteFixed64Array(int fieldNumber, string fieldName, IEnumerable<ulong> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated SFixed64 value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteSFixed64Array(int fieldNumber, string fieldName, IEnumerable<long> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated Double value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteDoubleArray(int fieldNumber, string fieldName, IEnumerable<double> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated Float value, including tag(s), to the stream.\r\n /// </summary>\r\n void WriteFloatArray(int fieldNumber, string fieldName, IEnumerable<float> list);\r\n\r\n /// <summary>\r\n /// Writes a repeated enumeration value of type T, including tag(s), to the stream.\r\n /// </summary>\r\n [CLSCompliant(false)]\r\n void WriteEnumArray<T>(int fieldNumber, string fieldName, IEnumerable<T> list)\r\n where T : struct, IComparable, IFormattable;\r\n\r\n /// <summary>\r\n /// Writes a packed repeated primitive, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedArray(FieldType fieldType, int fieldNumber, string fieldName, IEnumerable list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated boolean, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedBoolArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<bool> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated Int32, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated SInt32, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedSInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated UInt32, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedUInt32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated Fixed32, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<uint> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated SFixed32, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedSFixed32Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<int> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated Int64, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated SInt64, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedSInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated UInt64, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedUInt64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated Fixed64, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<ulong> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated SFixed64, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedSFixed64Array(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<long> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated Double, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedDoubleArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<double> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated Float, including tag and length, to the stream.\r\n /// </summary>\r\n void WritePackedFloatArray(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<float> list);\r\n\r\n /// <summary>\r\n /// Writes a packed repeated enumeration of type T, including tag and length, to the stream.\r\n /// </summary>\r\n [CLSCompliant(false)]\r\n void WritePackedEnumArray<T>(int fieldNumber, string fieldName, int calculatedSize, IEnumerable<T> list)\r\n where T : struct, IComparable, IFormattable;\r\n }\r\n}", "meta": {"content_hash": "28a175106a29d8ad5a090d313dcec3d0", "timestamp": "", "source": "github", "line_count": 373, "max_line_length": 117, "avg_line_length": 44.49061662198391, "alnum_prop": 0.6294667068394094, "repo_name": "plutoo/protobuf-csharp-port", "id": "64c8065321ff09d8602f07ced65b1c176b33458e", "size": "16633", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "src/ProtocolBuffers/ICodedOutputStream.cs", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ApacheConf", "bytes": "1911"}, {"name": "C#", "bytes": "7562639"}, {"name": "HTML", "bytes": "6297"}, {"name": "Protocol Buffer", "bytes": "395806"}, {"name": "Python", "bytes": "8912"}, {"name": "Shell", "bytes": "4628"}]}} +{"text": "\n\n#include <linux/firmware.h>\n#include <linux/module.h>\n#include <linux/bitrev.h>\n#include <linux/kernel.h>\n\n#include \"firmware.h\"\n#include \"chip.h\"\n\nMODULE_FIRMWARE(\"6fire/dmx6firel2.ihx\");\nMODULE_FIRMWARE(\"6fire/dmx6fireap.ihx\");\nMODULE_FIRMWARE(\"6fire/dmx6firecf.bin\");\n\nenum {\n\tFPGA_BUFSIZE = 512, FPGA_EP = 2\n};\n\n/*\n * wMaxPacketSize of pcm endpoints.\n * keep synced with rates_in_packet_size and rates_out_packet_size in pcm.c\n * fpp: frames per isopacket\n *\n * CAUTION: keep sizeof <= buffer[] in usb6fire_fw_init\n */\nstatic const u8 ep_w_max_packet_size[] = {\n\t0xe4, 0x00, 0xe4, 0x00, /* alt 1: 228 EP2 and EP6 (7 fpp) */\n\t0xa4, 0x01, 0xa4, 0x01, /* alt 2: 420 EP2 and EP6 (13 fpp)*/\n\t0x94, 0x01, 0x5c, 0x02 /* alt 3: 404 EP2 and 604 EP6 (25 fpp) */\n};\n\nstatic const u8 known_fw_versions[][2] = {\n\t{ 0x03, 0x01 }\n};\n\nstruct ihex_record {\n\tu16 address;\n\tu8 len;\n\tu8 data[256];\n\tchar error; /* true if an error occurred parsing this record */\n\n\tu8 max_len; /* maximum record length in whole ihex */\n\n\t/* private */\n\tconst char *txt_data;\n\tunsigned int txt_length;\n\tunsigned int txt_offset; /* current position in txt_data */\n};\n\nstatic u8 usb6fire_fw_ihex_hex(const u8 *data, u8 *crc)\n{\n\tu8 val = 0;\n\tint hval;\n\n\thval = hex_to_bin(data[0]);\n\tif (hval >= 0)\n\t\tval |= (hval << 4);\n\n\thval = hex_to_bin(data[1]);\n\tif (hval >= 0)\n\t\tval |= hval;\n\n\t*crc += val;\n\treturn val;\n}\n\n/*\n * returns true if record is available, false otherwise.\n * iff an error occurred, false will be returned and record->error will be true.\n */\nstatic bool usb6fire_fw_ihex_next_record(struct ihex_record *record)\n{\n\tu8 crc = 0;\n\tu8 type;\n\tint i;\n\n\trecord->error = false;\n\n\t/* find begin of record (marked by a colon) */\n\twhile (record->txt_offset < record->txt_length\n\t\t\t&& record->txt_data[record->txt_offset] != ':')\n\t\trecord->txt_offset++;\n\tif (record->txt_offset == record->txt_length)\n\t\treturn false;\n\n\t/* number of characters needed for len, addr and type entries */\n\trecord->txt_offset++;\n\tif (record->txt_offset + 8 > record->txt_length) {\n\t\trecord->error = true;\n\t\treturn false;\n\t}\n\n\trecord->len = usb6fire_fw_ihex_hex(record->txt_data +\n\t\t\trecord->txt_offset, &crc);\n\trecord->txt_offset += 2;\n\trecord->address = usb6fire_fw_ihex_hex(record->txt_data +\n\t\t\trecord->txt_offset, &crc) << 8;\n\trecord->txt_offset += 2;\n\trecord->address |= usb6fire_fw_ihex_hex(record->txt_data +\n\t\t\trecord->txt_offset, &crc);\n\trecord->txt_offset += 2;\n\ttype = usb6fire_fw_ihex_hex(record->txt_data +\n\t\t\trecord->txt_offset, &crc);\n\trecord->txt_offset += 2;\n\n\t/* number of characters needed for data and crc entries */\n\tif (record->txt_offset + 2 * (record->len + 1) > record->txt_length) {\n\t\trecord->error = true;\n\t\treturn false;\n\t}\n\tfor (i = 0; i < record->len; i++) {\n\t\trecord->data[i] = usb6fire_fw_ihex_hex(record->txt_data\n\t\t\t\t+ record->txt_offset, &crc);\n\t\trecord->txt_offset += 2;\n\t}\n\tusb6fire_fw_ihex_hex(record->txt_data + record->txt_offset, &crc);\n\tif (crc) {\n\t\trecord->error = true;\n\t\treturn false;\n\t}\n\n\tif (type == 1 || !record->len) /* eof */\n\t\treturn false;\n\telse if (type == 0)\n\t\treturn true;\n\telse {\n\t\trecord->error = true;\n\t\treturn false;\n\t}\n}\n\nstatic int usb6fire_fw_ihex_init(const struct firmware *fw,\n\t\tstruct ihex_record *record)\n{\n\trecord->txt_data = fw->data;\n\trecord->txt_length = fw->size;\n\trecord->txt_offset = 0;\n\trecord->max_len = 0;\n\t/* read all records, if loop ends, record->error indicates,\n\t * whether ihex is valid. */\n\twhile (usb6fire_fw_ihex_next_record(record))\n\t\trecord->max_len = max(record->len, record->max_len);\n\tif (record->error)\n\t\treturn -EINVAL;\n\trecord->txt_offset = 0;\n\treturn 0;\n}\n\nstatic int usb6fire_fw_ezusb_write(struct usb_device *device,\n\t\tint type, int value, char *data, int len)\n{\n\tint ret;\n\n\tret = usb_control_msg(device, usb_sndctrlpipe(device, 0), type,\n\t\t\tUSB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,\n\t\t\tvalue, 0, data, len, HZ);\n\tif (ret < 0)\n\t\treturn ret;\n\telse if (ret != len)\n\t\treturn -EIO;\n\treturn 0;\n}\n\nstatic int usb6fire_fw_ezusb_read(struct usb_device *device,\n\t\tint type, int value, char *data, int len)\n{\n\tint ret = usb_control_msg(device, usb_rcvctrlpipe(device, 0), type,\n\t\t\tUSB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, value,\n\t\t\t0, data, len, HZ);\n\tif (ret < 0)\n\t\treturn ret;\n\telse if (ret != len)\n\t\treturn -EIO;\n\treturn 0;\n}\n\nstatic int usb6fire_fw_fpga_write(struct usb_device *device,\n\t\tchar *data, int len)\n{\n\tint actual_len;\n\tint ret;\n\n\tret = usb_bulk_msg(device, usb_sndbulkpipe(device, FPGA_EP), data, len,\n\t\t\t&actual_len, HZ);\n\tif (ret < 0)\n\t\treturn ret;\n\telse if (actual_len != len)\n\t\treturn -EIO;\n\treturn 0;\n}\n\nstatic int usb6fire_fw_ezusb_upload(\n\t\tstruct usb_interface *intf, const char *fwname,\n\t\tunsigned int postaddr, u8 *postdata, unsigned int postlen)\n{\n\tint ret;\n\tu8 data;\n\tstruct usb_device *device = interface_to_usbdev(intf);\n\tconst struct firmware *fw = NULL;\n\tstruct ihex_record *rec = kmalloc(sizeof(struct ihex_record),\n\t\t\tGFP_KERNEL);\n\n\tif (!rec)\n\t\treturn -ENOMEM;\n\n\tret = request_firmware(&fw, fwname, &device->dev);\n\tif (ret < 0) {\n\t\tkfree(rec);\n\t\tsnd_printk(KERN_ERR PREFIX \"error requesting ezusb \"\n\t\t\t\t\"firmware %s.\\n\", fwname);\n\t\treturn ret;\n\t}\n\tret = usb6fire_fw_ihex_init(fw, rec);\n\tif (ret < 0) {\n\t\tkfree(rec);\n\t\trelease_firmware(fw);\n\t\tsnd_printk(KERN_ERR PREFIX \"error validating ezusb \"\n\t\t\t\t\"firmware %s.\\n\", fwname);\n\t\treturn ret;\n\t}\n\t/* upload firmware image */\n\tdata = 0x01; /* stop ezusb cpu */\n\tret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1);\n\tif (ret < 0) {\n\t\tkfree(rec);\n\t\trelease_firmware(fw);\n\t\tsnd_printk(KERN_ERR PREFIX \"unable to upload ezusb \"\n\t\t\t\t\"firmware %s: begin message.\\n\", fwname);\n\t\treturn ret;\n\t}\n\n\twhile (usb6fire_fw_ihex_next_record(rec)) { /* write firmware */\n\t\tret = usb6fire_fw_ezusb_write(device, 0xa0, rec->address,\n\t\t\t\trec->data, rec->len);\n\t\tif (ret < 0) {\n\t\t\tkfree(rec);\n\t\t\trelease_firmware(fw);\n\t\t\tsnd_printk(KERN_ERR PREFIX \"unable to upload ezusb \"\n\t\t\t\t\t\"firmware %s: data urb.\\n\", fwname);\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\trelease_firmware(fw);\n\tkfree(rec);\n\tif (postdata) { /* write data after firmware has been uploaded */\n\t\tret = usb6fire_fw_ezusb_write(device, 0xa0, postaddr,\n\t\t\t\tpostdata, postlen);\n\t\tif (ret < 0) {\n\t\t\tsnd_printk(KERN_ERR PREFIX \"unable to upload ezusb \"\n\t\t\t\t\t\"firmware %s: post urb.\\n\", fwname);\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tdata = 0x00; /* resume ezusb cpu */\n\tret = usb6fire_fw_ezusb_write(device, 0xa0, 0xe600, &data, 1);\n\tif (ret < 0) {\n\t\tsnd_printk(KERN_ERR PREFIX \"unable to upload ezusb \"\n\t\t\t\t\"firmware %s: end message.\\n\", fwname);\n\t\treturn ret;\n\t}\n\treturn 0;\n}\n\nstatic int usb6fire_fw_fpga_upload(\n\t\tstruct usb_interface *intf, const char *fwname)\n{\n\tint ret;\n\tint i;\n\tstruct usb_device *device = interface_to_usbdev(intf);\n\tu8 *buffer = kmalloc(FPGA_BUFSIZE, GFP_KERNEL);\n\tconst char *c;\n\tconst char *end;\n\tconst struct firmware *fw;\n\n\tif (!buffer)\n\t\treturn -ENOMEM;\n\n\tret = request_firmware(&fw, fwname, &device->dev);\n\tif (ret < 0) {\n\t\tsnd_printk(KERN_ERR PREFIX \"unable to get fpga firmware %s.\\n\",\n\t\t\t\tfwname);\n\t\tkfree(buffer);\n\t\treturn -EIO;\n\t}\n\n\tc = fw->data;\n\tend = fw->data + fw->size;\n\n\tret = usb6fire_fw_ezusb_write(device, 8, 0, NULL, 0);\n\tif (ret < 0) {\n\t\tkfree(buffer);\n\t\trelease_firmware(fw);\n\t\tsnd_printk(KERN_ERR PREFIX \"unable to upload fpga firmware: \"\n\t\t\t\t\"begin urb.\\n\");\n\t\treturn ret;\n\t}\n\n\twhile (c != end) {\n\t\tfor (i = 0; c != end && i < FPGA_BUFSIZE; i++, c++)\n\t\t\tbuffer[i] = byte_rev_table[(u8) *c];\n\n\t\tret = usb6fire_fw_fpga_write(device, buffer, i);\n\t\tif (ret < 0) {\n\t\t\trelease_firmware(fw);\n\t\t\tkfree(buffer);\n\t\t\tsnd_printk(KERN_ERR PREFIX \"unable to upload fpga \"\n\t\t\t\t\t\"firmware: fw urb.\\n\");\n\t\t\treturn ret;\n\t\t}\n\t}\n\trelease_firmware(fw);\n\tkfree(buffer);\n\n\tret = usb6fire_fw_ezusb_write(device, 9, 0, NULL, 0);\n\tif (ret < 0) {\n\t\tsnd_printk(KERN_ERR PREFIX \"unable to upload fpga firmware: \"\n\t\t\t\t\"end urb.\\n\");\n\t\treturn ret;\n\t}\n\treturn 0;\n}\n\n/* check, if the firmware version the devices has currently loaded\n * is known by this driver. 'version' needs to have 4 bytes version\n * info data. */\nstatic int usb6fire_fw_check(u8 *version)\n{\n\tint i;\n\n\tfor (i = 0; i < ARRAY_SIZE(known_fw_versions); i++)\n\t\tif (!memcmp(version, known_fw_versions + i, 2))\n\t\t\treturn 0;\n\n\tsnd_printk(KERN_ERR PREFIX \"invalid fimware version in device: %*ph. \"\n\t\t\t\"please reconnect to power. if this failure \"\n\t\t\t\"still happens, check your firmware installation.\",\n\t\t\t4, version);\n\treturn -EINVAL;\n}\n\nint usb6fire_fw_init(struct usb_interface *intf)\n{\n\tint i;\n\tint ret;\n\tstruct usb_device *device = interface_to_usbdev(intf);\n\t/* buffer: 8 receiving bytes from device and\n\t * sizeof(EP_W_MAX_PACKET_SIZE) bytes for non-const copy */\n\tu8 buffer[12];\n\n\tret = usb6fire_fw_ezusb_read(device, 1, 0, buffer, 8);\n\tif (ret < 0) {\n\t\tsnd_printk(KERN_ERR PREFIX \"unable to receive device \"\n\t\t\t\t\"firmware state.\\n\");\n\t\treturn ret;\n\t}\n\tif (buffer[0] != 0xeb || buffer[1] != 0xaa || buffer[2] != 0x55) {\n\t\tsnd_printk(KERN_ERR PREFIX \"unknown device firmware state \"\n\t\t\t\t\"received from device: \");\n\t\tfor (i = 0; i < 8; i++)\n\t\t\tsnd_printk(\"%02x \", buffer[i]);\n\t\tsnd_printk(\"\\n\");\n\t\treturn -EIO;\n\t}\n\t/* do we need fpga loader ezusb firmware? */\n\tif (buffer[3] == 0x01) {\n\t\tret = usb6fire_fw_ezusb_upload(intf,\n\t\t\t\t\"6fire/dmx6firel2.ihx\", 0, NULL, 0);\n\t\tif (ret < 0)\n\t\t\treturn ret;\n\t\treturn FW_NOT_READY;\n\t}\n\t/* do we need fpga firmware and application ezusb firmware? */\n\telse if (buffer[3] == 0x02) {\n\t\tret = usb6fire_fw_check(buffer + 4);\n\t\tif (ret < 0)\n\t\t\treturn ret;\n\t\tret = usb6fire_fw_fpga_upload(intf, \"6fire/dmx6firecf.bin\");\n\t\tif (ret < 0)\n\t\t\treturn ret;\n\t\tmemcpy(buffer, ep_w_max_packet_size,\n\t\t\t\tsizeof(ep_w_max_packet_size));\n\t\tret = usb6fire_fw_ezusb_upload(intf, \"6fire/dmx6fireap.ihx\",\n\t\t\t\t0x0003,\tbuffer, sizeof(ep_w_max_packet_size));\n\t\tif (ret < 0)\n\t\t\treturn ret;\n\t\treturn FW_NOT_READY;\n\t}\n\t/* all fw loaded? */\n\telse if (buffer[3] == 0x03)\n\t\treturn usb6fire_fw_check(buffer + 4);\n\t/* unknown data? */\n\telse {\n\t\tsnd_printk(KERN_ERR PREFIX \"unknown device firmware state \"\n\t\t\t\t\"received from device: \");\n\t\tfor (i = 0; i < 8; i++)\n\t\t\tsnd_printk(\"%02x \", buffer[i]);\n\t\tsnd_printk(\"\\n\");\n\t\treturn -EIO;\n\t}\n\treturn 0;\n}\n\n", "meta": {"content_hash": "15d745cdbedbb969c8d9c35a1595961a", "timestamp": "", "source": "github", "line_count": 404, "max_line_length": 80, "avg_line_length": 24.95049504950495, "alnum_prop": 0.645436507936508, "repo_name": "Ant-OS/android_kernel_moto_shamu", "id": "b9defcdeb7ef805af05a6453ce309a2eb64bdb18", "size": "10519", "binary": false, "copies": "2121", "ref": "refs/heads/master", "path": "sound/usb/6fire/firmware.c", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ASP", "bytes": "4528"}, {"name": "Assembly", "bytes": "9738337"}, {"name": "Awk", "bytes": "18681"}, {"name": "C", "bytes": "467488098"}, {"name": "C++", "bytes": "3473858"}, {"name": "Clojure", "bytes": "547"}, {"name": "Groff", "bytes": "22012"}, {"name": "Lex", "bytes": "40805"}, {"name": "Makefile", "bytes": "1342678"}, {"name": "Objective-C", "bytes": "1121986"}, {"name": "Perl", "bytes": "461504"}, {"name": "Python", "bytes": "33978"}, {"name": "Scilab", "bytes": "21433"}, {"name": "Shell", "bytes": "138789"}, {"name": "SourcePawn", "bytes": "4687"}, {"name": "UnrealScript", "bytes": "6113"}, {"name": "Yacc", "bytes": "83091"}]}} +{"text": "\n\n/**\n * @file\n * @brief\n * This file defines the OpenThread crypto C APIs.\n */\n\n#ifndef OPENTHREAD_CRYPTO_H_\n#define OPENTHREAD_CRYPTO_H_\n\n#include <stdbool.h>\n#include <stdint.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/**\n * @addtogroup api-crypto\n *\n * @brief\n * This module includes cryptographic functions.\n *\n * @{\n *\n */\n\n#define OT_CRYPTO_HMAC_SHA_HASH_SIZE 32 ///< Length of HMAC SHA (in bytes).\n\n/**\n * This function performs HMAC computation.\n *\n * @param[in] aKey A pointer to the key.\n * @param[in] aKeyLength The key length in bytes.\n * @param[in] aBuf A pointer to the input buffer.\n * @param[in] aBufLength The length of @p aBuf in bytes.\n * @param[out] aHash A pointer to the output hash buffer.\n *\n */\nvoid otCryptoHmacSha256(\n const uint8_t *aKey, uint16_t aKeyLength,\n const uint8_t *aBuf, uint16_t aBufLength,\n uint8_t *aHash);\n\n/**\n * This method performs AES CCM computation.\n *\n * @param[in] aKey A pointer to the key.\n * @param[in] aKeyLength Length of the key in bytes.\n * @param[in] aTagLength Length of tag in bytes.\n * @param[in] aNonce A pointer to the nonce.\n * @param[in] aNonceLength Length of nonce in bytes.\n *\n * @param[in] aHeader A pointer to the header.\n * @param[in] aHeaderLength Length of header in bytes.\n *\n * @param[inout] aPlainText A pointer to the plaintext.\n * @param[inout] aCipherText A pointer to the ciphertext.\n * @param[in] aLength Plaintext length in bytes.\n * @param[in] aEncrypt `true` on encrypt and `false` on decrypt.\n *\n * @param[out] aTag A pointer to the tag.\n *\n */\nvoid otCryptoAesCcm(\n const uint8_t *aKey, uint16_t aKeyLength,\n uint8_t aTagLength,\n const void *aNonce, uint8_t aNonceLength,\n const void *aHeader, uint32_t aHeaderLength,\n void *aPlainText, void *aCipherText, uint32_t aLength, bool aEncrypt,\n void *aTag);\n\n/**\n * @}\n *\n */\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n#endif // OPENTHREAD_CRYPTO_H_\n", "meta": {"content_hash": "e9706e9d8632e56471be3249fed671f8", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 79, "avg_line_length": 25.10843373493976, "alnum_prop": 0.6228406909788867, "repo_name": "fbsder/openthread", "id": "d80a45af879bf664b492b6300da0961dd367f192", "size": "3692", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "include/openthread/crypto.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Batchfile", "bytes": "10128"}, {"name": "C", "bytes": "574131"}, {"name": "C#", "bytes": "18077"}, {"name": "C++", "bytes": "3369485"}, {"name": "M4", "bytes": "47539"}, {"name": "Makefile", "bytes": "81726"}, {"name": "Python", "bytes": "1050179"}, {"name": "Ruby", "bytes": "3397"}, {"name": "Shell", "bytes": "26917"}]}} +{"text": "<!DOCTYPE html>\r\n<html lang=\"en-us\" dir=\"ltr\" itemscope itemtype=\"http://schema.org/Article\">\r\n\r\n <head>\r\n <meta charset=\"utf-8\" />\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\r\n\r\n <title>Eterno Amor</title>\r\n <meta name=\"author\" content=\"\" />\r\n <meta name=\"description\"\r\n content=\"Um misto de remorso pelas agruras da guerra com a energia de uma investiga\u00e7\u00e3o guiada unicamente pela f\u00e9 (ou pelo amor). A beleza da fotografia fria e triste do front se contrap\u00f5e aos horizontes...\"/>\r\n\r\n <meta name=\"yandex-verification\" content=\"48a8210fc043c5e8\" />\r\n\r\n <meta name=\"generator\" content=\"Hugo 0.54.0\" />\r\n\r\n \r\n <meta itemprop=\"name\" content=\"Eterno Amor\"/>\r\n <meta itemprop=\"description\"\r\n content=\"Um misto de remorso pelas agruras da guerra com a energia de uma investiga\u00e7\u00e3o guiada unicamente pela f\u00e9 (ou pelo amor). A beleza da fotografia fria e triste do front se contrap\u00f5e aos horizontes...\"/>\r\n <meta itemprop=\"image\"\r\n content=\"/img/logo.svg\"/>\r\n\r\n \r\n <meta property=\"og:title\" content=\"Eterno Amor\"/>\r\n <meta property=\"og:type\"\r\n content=\"article\"/>\r\n <meta property=\"og:url\" content=\"http://www.cinetenisverde.com.br/eterno-amor/\"/>\r\n <meta property=\"og:image\"\r\n content=\"/img/logo.svg\"/>\r\n <meta property=\"og:description\"\r\n content=\"Um misto de remorso pelas agruras da guerra com a energia de uma investiga\u00e7\u00e3o guiada unicamente pela f\u00e9 (ou pelo amor). A beleza da fotografia fria e triste do front se contrap\u00f5e aos horizontes...\"/>\r\n <meta property=\"og:site_name\" content=\"Cine T\u00eanis Verde\"/>\r\n <meta property=\"article:published_time\"\r\n content=\"2016-01-06T00:00:00+00:00\"/>\r\n <meta property=\"article:section\" content=\"post\"/>\r\n\r\n \r\n \r\n <meta name=\"twitter:card\" content=\"summary\"/>\r\n <meta name=\"twitter:site\"\r\n content=\"\"/>\r\n <meta name=\"twitter:title\" content=\"Eterno Amor\"/>\r\n <meta name=\"twitter:description\"\r\n content=\"Um misto de remorso pelas agruras da guerra com a energia de uma investiga\u00e7\u00e3o guiada unicamente pela f\u00e9 (ou pelo amor). A beleza da fotografia fria e triste do front se contrap\u00f5e aos horizontes...\"/>\r\n <meta name=\"twitter:creator\"\r\n content=\"\"/>\r\n <meta name=\"twitter:image:src\"\r\n content=\"/img/logo.svg\"/>\r\n\r\n \r\n\r\n \r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/css/capsule.min.css\"/>\r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/css/custom.css\"/>\r\n\r\n \r\n \r\n <script>\r\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\r\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\r\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\r\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\r\n\r\n ga('create', 'UA-50557403-1', 'auto');\r\n ga('send', 'pageview');\r\n </script>\r\n\r\n \r\n <link rel=\"apple-touch-icon\" href=\"/img/apple-touch-icon.png\"/>\r\n <link rel=\"icon\" href=\"/img/favicon.ico\"/>\r\n </head>\r\n\r\n\r\n <body style=\"min-height:100vh;display:flex;flex-direction:column\">\r\n\r\n <nav class=\"navbar has-shadow is-white\"\r\n role=\"navigation\" aria-label=\"main navigation\">\r\n <div class=\"container\">\r\n\r\n <div class=\"navbar-brand\">\r\n <a class=\"navbar-item\" href=\"/\">\r\n <img alt=\"Brand\" src=\"/img/brand.svg\">\r\n <div class=\"title is-4\"> Cine T\u00eanis Verde</div>\r\n </a>\r\n\r\n \r\n <label class=\"button navbar-burger is-white\" for=\"navbar-burger-state\">\r\n <span></span> \r\n <span></span>\r\n <span></span>\r\n </label>\r\n </div>\r\n\r\n \r\n <input type=\"checkbox\" id=\"navbar-burger-state\"/>\r\n\r\n <div class=\"navbar-menu\">\r\n <div class=\"navbar-end\">\r\n <a href=\"/post\"\r\n class=\"navbar-item\r\n \">search\r\n </a>\r\n <a href=\"https://twitter.com/cinetenisverde\"\r\n class=\"navbar-item\r\n \">twitter\r\n </a>\r\n <a href=\"/index.xml\"\r\n class=\"navbar-item\r\n \">rss\r\n </a>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</nav>\r\n\r\n\r\n <section class=\"section\" style=\"flex:1\">\r\n\r\n \r\n <div class=\"container\">\r\n <p class=\"title\">Eterno Amor</p>\r\n\r\n <p class=\"subtitle\"><span class=\"entry-sidebar-stars\">\r\n \r\n ★★★★☆\r\n \r\n</span>\r\n Wanderley Caloni, <a href=\"https://github.com/Caloni/cinetenisverde/commits/master/content/post/eterno-amor.md\">January 6, 2016</a></p>\r\n<p><p>\r\n\r\n\r\n \r\n\r\n \r\n <div class=\"content\">\r\n <p>Um misto de remorso pelas agruras da guerra com a energia de uma investiga\u00e7\u00e3o guiada unicamente pela f\u00e9 (ou pelo amor). A beleza da fotografia fria e triste do front se contrap\u00f5e aos horizontes on\u00edricos do presente nost\u00e1lgico, que clama pela elucida\u00e7\u00e3o completa de um passado nebuloso que separou um casal apaixonado prestes a se casar. Eterno Amor \u00e9 pura poesia na forma de criatividade narrativa. Um Pierre Jeunet que retrabalha sua Am\u00e9lie Poulain em tra\u00e7os mais cru\u00e9is e menos esperan\u00e7osos, e que tenta soar como um romance \u00e9pico em torno de personagens com pouca alma e muita persist\u00eancia.</p>\n\n<p>Utilizando novamente Audrey Tautou, a namoradinha da Fran\u00e7a, o diretor Jean-Pierre Jeunet mais uma vez aplica a bel\u00edssima fotografia de seu colaborador Bruno Delbonnel (Harry Potter e o Enigma do Pr\u00edncipe, Inside Llewyn Davis: Balada de um Homem Comum, Am\u00e9lie Poulain) e a din\u00e2mica e inventiva montagem de seu editor Herv\u00e9 Schneid (Micmacs - Um Plano Complicado) para contar uma hist\u00f3ria cheia de poder criativo, mas que encontra em seu n\u00facleo um drama intranspon\u00edvel para o estilo do diretor.</p>\n\n<p>Sua busca incessante, no entanto, em tentar juntar todas as pistas que a bela mas manca Mathilde (Tatou) vai acumulando, testemunho ap\u00f3s testemunho, em busca da verdade definitiva a respeito do paradeiro de seu amor, Manech (Gaspard Ulliel), \u00e9 t\u00e3o contagiante que o mundo que se cria em torno acaba compensando a total falta de realismo nesse conto quase-surrealista.</p>\n\n<p>Com aspectos t\u00e9cnicos impressionantes a cada cena – exceto talvez pela m\u00fasica de Angelo Badalamenti, repetitiva e mon\u00f3tona, mas ainda assim condizente com a proposta do filme – e com um ritmo que vai se formando pela repeti\u00e7\u00e3o (a insist\u00eancia do carteiro em espalhar o cascalho da entrada da casa de Mathilde, s\u00f3 pelo bem da “entrada triunfal”), o roteiro da dupla Guillaume Laurant e do pr\u00f3prio Pierre Jeunet, baseados no romance de S\u00e9bastien Japrisot, n\u00e3o consegue se desvencilhar da sua complexidade em utilizar diferentes personagens que se parecem em situa\u00e7\u00f5es que se embaralham, o que se por um lado acaba contribuindo para a atmosfera de desorienta\u00e7\u00e3o de Mathilde, vai aos poucos se tornando uma distra\u00e7\u00e3o inc\u00f4moda para o espectador, que j\u00e1 n\u00e3o espera encontrar qualquer conex\u00e3o memor\u00e1vel entre as pistas.</p>\n\n<p>At\u00e9 mesmo a dualidade de cores frias da guerra com as cores sempre aquecidas do presente da protagonista, fascinante no come\u00e7o, tamb\u00e9m vai se esvaecendo com a cada vez mais distante capacidade de atribuir significado naquele emaranhado de s\u00edmbolos. Jeunet se deixa sabotar pela sua pr\u00f3pria obsess\u00e3o de detalhes, e assim como seu mais recente trabalho, Uma Viagem Extraordin\u00e1ria, se esquece das emo\u00e7\u00f5es prim\u00e1rias de seus personagens para focar unicamente nas idiossincrasias de sua complexa hist\u00f3ria.</p>\n\n<p>O que acaba por fim em tornar tudo aquilo uma imensa espiral de eventos que revela uma estrutura tal qual as escadas do farol onde o casal se encontrava: aparentemente infinita, mas se encarada com dedica\u00e7\u00e3o e empenho, alcan\u00e7\u00e1vel at\u00e9 por uma manca que deseja enxergar al\u00e9m de suas limita\u00e7\u00f5es f\u00edsicas. \u00c9 o metaf\u00edsico celebrado em vida. A m\u00e1gica de usar o cinema como cornuc\u00f3pia de simbolismos visuais.</p>\n\r\n <a href=\"https://www.imdb.com/title/tt0344510/mediaviewer/\" target=\"ctvimg\">Imagens</a> e cr\u00e9ditos no <a title=\"IMDB: Internet Movie DataBase\" href=\"http://www.imdb.com/title/tt0344510\">IMDB</a>.\r\n\r\n </div>\r\n\r\n <span class=\"entry-sidebar-stars\">\r\n \r\n ★★★★☆\r\n \r\n</span>\r\n Eterno Amor ● Eterno Amor. Un long dimanche de fian\u00e7ailles (France, 2004). Dirigido por Jean-Pierre Jeunet. Escrito por S\u00e9bastien Japrisot, Jean-Pierre Jeunet, Guillaume Laurant, Guillaume Laurant. Com Audrey Tautou, Gaspard Ulliel, Dominique Pinon, Chantal Neuwirth, Andr\u00e9 Dussollier, Ticky Holgado, Marion Cotillard, Dominique Bettenfeld, Jodie Foster. ● Nota: 4/5. Categoria: movies. Publicado em 2016-01-06. Texto escrito por Wanderley Caloni.\r\n\r\n<p><br>Quer <a href=\"https://twitter.com/search?q=@cinetenisverde Eterno%20Amor\">comentar</a>?<br></p>\r\n\r\n\r\n </div>\r\n\r\n </section>\r\n\r\n <section class=\"section\">\r\n \r\n\r\n <br>\r\n\r\n \r\n <div class=\"container\">\r\n <div class=\"is-flex\">\r\n <span>\r\n <a class=\"button\">Share</a>\r\n </span>\r\n\r\n \r\n\r\n <span>\r\n \r\n <a class=\"button\"\r\n href=\"https://www.facebook.com/sharer/sharer.php?u=http%3a%2f%2fwww.cinetenisverde.com.br%2feterno-amor%2f\">\r\n <span class=\"icon\"><i class=\"fa fa-facebook\"></i></span>\r\n </a>\r\n\r\n \r\n <a class=\"button\"\r\n href=\"https://twitter.com/intent/tweet?url=http%3a%2f%2fwww.cinetenisverde.com.br%2feterno-amor%2f&text=Eterno%20Amor\">\r\n <span class=\"icon\"><i class=\"fa fa-twitter\"></i></span>\r\n </a>\r\n\r\n \r\n <a class=\"button\"\r\n href=\"https://news.ycombinator.com/submitlink?u=http%3a%2f%2fwww.cinetenisverde.com.br%2feterno-amor%2f\">\r\n <span class=\"icon\"><i class=\"fa fa-hacker-news\"></i></span>\r\n </a>\r\n\r\n \r\n <a class=\"button\"\r\n href=\"https://reddit.com/submit?url=http%3a%2f%2fwww.cinetenisverde.com.br%2feterno-amor%2f&title=Eterno%20Amor\">\r\n <span class=\"icon\"><i class=\"fa fa-reddit\"></i></span>\r\n </a>\r\n\r\n \r\n <a class=\"button\"\r\n href=\"https://plus.google.com/share?url=http%3a%2f%2fwww.cinetenisverde.com.br%2feterno-amor%2f\">\r\n <span class=\"icon\"><i class=\"fa fa-google-plus\"></i></span>\r\n </a>\r\n\r\n \r\n <a class=\"button\"\r\n href=\"https://www.linkedin.com/shareArticle?url=http%3a%2f%2fwww.cinetenisverde.com.br%2feterno-amor%2f&title=Eterno%20Amor\">\r\n <span class=\"icon\"><i class=\"fa fa-linkedin\"></i></span>\r\n </a>\r\n\r\n \r\n <a class=\"button\"\r\n href=\"https://www.tumblr.com/widgets/share/tool?canonicalUrl=http%3a%2f%2fwww.cinetenisverde.com.br%2feterno-amor%2f&title=Eterno%20Amor&caption=\">\r\n <span class=\"icon\"><i class=\"fa fa-tumblr\"></i></span>\r\n </a>\r\n\r\n \r\n <a class=\"button\"\r\n href=\"https://pinterest.com/pin/create/bookmarklet/?media=%2fimg%2flogo.svg&url=http%3a%2f%2fwww.cinetenisverde.com.br%2feterno-amor%2f&description=Eterno%20Amor\">\r\n <span class=\"icon\"><i class=\"fa fa-pinterest\"></i></span>\r\n </a>\r\n\r\n \r\n <a class=\"button\"\r\n href=\"whatsapp://send?text=http%3a%2f%2fwww.cinetenisverde.com.br%2feterno-amor%2f\">\r\n <span class=\"icon\"><i class=\"fa fa-whatsapp\"></i></span>\r\n </a>\r\n\r\n \r\n <a class=\"button\"\r\n href=\"https://web.skype.com/share?url=http%3a%2f%2fwww.cinetenisverde.com.br%2feterno-amor%2f\">\r\n <span class=\"icon\"><i class=\"fa fa-skype\"></i></span>\r\n </a>\r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n </span>\r\n </div>\r\n</div>\r\n\r\n\r\n <br>\r\n\r\n \r\n \r\n </section>\r\n\r\n <footer class=\"footer\">\r\n <div class=\"container\">\r\n\r\n <nav class=\"level\">\r\n\r\n <div class=\"level-right has-text-centered\">\r\n <div class=\"level-item\">\r\n\r\n <a class=\"button\" href=\"http://www.cinetenisverde.com.br/\">\r\n <span class=\"icon\"><i class=\"fa fa-home\"></i></span>\r\n </a> \r\n <a class=\"button\" href=\"/post\">\r\n <span class=\"icon\"><i class=\"fa fa-search\"></i></span>\r\n </a> \r\n <a class=\"button\" href=\"https://twitter.com/cinetenisverde\">\r\n <span class=\"icon\"><i class=\"fa fa-twitter\"></i></span>\r\n </a> \r\n <a class=\"button\" href=\"/index.xml\">\r\n <span class=\"icon\"><i class=\"fa fa-rss\"></i></span>\r\n </a> \r\n\r\n </div>\r\n </div>\r\n\r\n </nav>\r\n </div>\r\n</footer>\r\n\r\n </body>\r\n\r\n</html>\r\n", "meta": {"content_hash": "5750f5fb43c3be1ac0ed645741172b4e", "timestamp": "", "source": "github", "line_count": 296, "max_line_length": 842, "avg_line_length": 41.986486486486484, "alnum_prop": 0.6437882201480528, "repo_name": "cinetenisverde/cinetenisverde.github.io", "id": "50eb0e0d692d60f0129f5cd086d6384190bc5365", "size": "12522", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "eterno-amor/index.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "533"}, {"name": "HTML", "bytes": "31113501"}, {"name": "JavaScript", "bytes": "3266"}, {"name": "Python", "bytes": "2943"}]}} +{"text": "function toggle_visibility(id) {\n\t\t\t\t\tvar e = document.getElementById(id);\n\t\t\t\t\tif(e.style.display == 'block')\n\t\t\t\t\t\te.style.display = 'none';\n\t\t\t\t\telse\n\t\t\t\t\t\te.style.display = 'block';\n}\n \n \njQuery(document).ready(function($) {\n \n $(\".scroll\").click(function(event){\t\t\n \tevent.preventDefault();\n $('body').animate({scrollTop:$(this.hash).offset().top}, 1500);\n });\n});", "meta": {"content_hash": "7d199aa600dde168b96b11fead6cf842", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 91, "avg_line_length": 33.1875, "alnum_prop": 0.4218455743879473, "repo_name": "regravity/ThreadCSS", "id": "65450d0d0e315646c520802a73cde60b56721649", "size": "531", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/function.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "42847"}, {"name": "HTML", "bytes": "5902"}, {"name": "JavaScript", "bytes": "531"}]}} +{"text": "\npackage com.intellij.refactoring.move.moveInstanceMethod;\n\nimport com.intellij.openapi.actionSystem.DataContext;\nimport com.intellij.openapi.editor.Editor;\nimport com.intellij.openapi.project.Project;\nimport com.intellij.psi.*;\nimport com.intellij.refactoring.move.MoveCallback;\nimport com.intellij.refactoring.move.MoveHandlerDelegate;\nimport com.intellij.refactoring.move.moveClassesOrPackages.JavaMoveClassesOrPackagesHandler;\nimport org.jetbrains.annotations.Nullable;\n\npublic class MoveInstanceMethodHandlerDelegate extends MoveHandlerDelegate {\n @Override\n public boolean canMove(final PsiElement[] elements, @Nullable final PsiElement targetContainer) {\n if (elements.length != 1) return false;\n PsiElement element = elements [0];\n if (!(element instanceof PsiMethod)) return false;\n if (element instanceof SyntheticElement) return false;\n PsiMethod method = (PsiMethod) element;\n if (method.hasModifierProperty(PsiModifier.STATIC)) return false;\n return targetContainer == null || super.canMove(elements, targetContainer);\n }\n\n @Override\n public boolean isValidTarget(final PsiElement targetElement, PsiElement[] sources) {\n for (PsiElement source : sources) {\n if (JavaMoveClassesOrPackagesHandler.invalid4Move(source)) return false;\n }\n return targetElement instanceof PsiClass && !(targetElement instanceof PsiAnonymousClass);\n }\n\n @Override\n public boolean tryToMove(final PsiElement element, final Project project, final DataContext dataContext, final PsiReference reference,\n final Editor editor) {\n if (element instanceof PsiMethod) {\n PsiMethod method = (PsiMethod) element;\n if (!method.hasModifierProperty(PsiModifier.STATIC)) {\n new MoveInstanceMethodHandler().invoke(project, new PsiElement[]{method}, dataContext);\n return true;\n }\n }\n return false;\n }\n\n @Override\n public void doMove(final Project project, final PsiElement[] elements, final PsiElement targetContainer, final MoveCallback callback) {\n new MoveInstanceMethodHandler().invoke(project, elements, null);\n }\n}\n", "meta": {"content_hash": "258b6a6fd63e3565e06b0802904c7518", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 137, "avg_line_length": 42.2, "alnum_prop": 0.762085308056872, "repo_name": "xfournet/intellij-community", "id": "baeb4deb8b2b865eafb7fa19f7003296554b0a91", "size": "2710", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "java/java-impl/src/com/intellij/refactoring/move/moveInstanceMethod/MoveInstanceMethodHandlerDelegate.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "AMPL", "bytes": "20665"}, {"name": "AspectJ", "bytes": "182"}, {"name": "Batchfile", "bytes": "60827"}, {"name": "C", "bytes": "211454"}, {"name": "C#", "bytes": "1264"}, {"name": "C++", "bytes": "199030"}, {"name": "CMake", "bytes": "1675"}, {"name": "CSS", "bytes": "201445"}, {"name": "CoffeeScript", "bytes": "1759"}, {"name": "Erlang", "bytes": "10"}, {"name": "Groovy", "bytes": "3289024"}, {"name": "HLSL", "bytes": "57"}, {"name": "HTML", "bytes": "1901772"}, {"name": "J", "bytes": "5050"}, {"name": "Java", "bytes": "166392304"}, {"name": "JavaScript", "bytes": "570364"}, {"name": "Jupyter Notebook", "bytes": "93222"}, {"name": "Kotlin", "bytes": "4720744"}, {"name": "Lex", "bytes": "147486"}, {"name": "Makefile", "bytes": "2352"}, {"name": "NSIS", "bytes": "51061"}, {"name": "Objective-C", "bytes": "27861"}, {"name": "Perl", "bytes": "903"}, {"name": "Perl 6", "bytes": "26"}, {"name": "Protocol Buffer", "bytes": "6680"}, {"name": "Python", "bytes": "25477371"}, {"name": "Roff", "bytes": "37534"}, {"name": "Ruby", "bytes": "1217"}, {"name": "Shell", "bytes": "64141"}, {"name": "Smalltalk", "bytes": "338"}, {"name": "TeX", "bytes": "25473"}, {"name": "Thrift", "bytes": "1846"}, {"name": "TypeScript", "bytes": "9469"}, {"name": "Visual Basic", "bytes": "77"}, {"name": "XSLT", "bytes": "113040"}]}} +{"text": "/* A Bison parser, made by GNU Bison 3.0.4. */\n\n/* Bison interface for Yacc-like parsers in C\n\n Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>. */\n\n/* As a special exception, you may create a larger work that contains\n part or all of the Bison parser skeleton and distribute that work\n under terms of your choice, so long as that work isn't itself a\n parser generator using the skeleton or a modified version thereof\n as a parser skeleton. Alternatively, if you modify or redistribute\n the parser skeleton itself, you may (at your option) remove this\n special exception, which will cause the skeleton and the resulting\n Bison output files to be licensed under the GNU General Public\n License without this special exception.\n\n This special exception was added by the Free Software Foundation in\n version 2.2 of Bison. */\n\n#ifndef YY_YY_PARSE_H_INCLUDED\n# define YY_YY_PARSE_H_INCLUDED\n/* Debug traces. */\n#ifndef YYDEBUG\n# define YYDEBUG 0\n#endif\n#if YYDEBUG\nextern int yydebug;\n#endif\n\n/* Token type. */\n#ifndef YYTOKENTYPE\n# define YYTOKENTYPE\n enum yytokentype\n {\n CHAR = 258,\n NUMBER = 259,\n SECTEND = 260,\n SCDECL = 261,\n XSCDECL = 262,\n NAME = 263,\n PREVCCL = 264,\n EOF_OP = 265,\n OPTION_OP = 266,\n OPT_OUTFILE = 267,\n OPT_PREFIX = 268,\n OPT_YYCLASS = 269,\n OPT_HEADER = 270,\n OPT_EXTRA_TYPE = 271,\n OPT_TABLES = 272,\n CCE_ALNUM = 273,\n CCE_ALPHA = 274,\n CCE_BLANK = 275,\n CCE_CNTRL = 276,\n CCE_DIGIT = 277,\n CCE_GRAPH = 278,\n CCE_LOWER = 279,\n CCE_PRINT = 280,\n CCE_PUNCT = 281,\n CCE_SPACE = 282,\n CCE_UPPER = 283,\n CCE_XDIGIT = 284,\n CCE_NEG_ALNUM = 285,\n CCE_NEG_ALPHA = 286,\n CCE_NEG_BLANK = 287,\n CCE_NEG_CNTRL = 288,\n CCE_NEG_DIGIT = 289,\n CCE_NEG_GRAPH = 290,\n CCE_NEG_LOWER = 291,\n CCE_NEG_PRINT = 292,\n CCE_NEG_PUNCT = 293,\n CCE_NEG_SPACE = 294,\n CCE_NEG_UPPER = 295,\n CCE_NEG_XDIGIT = 296,\n CCL_OP_DIFF = 297,\n CCL_OP_UNION = 298,\n BEGIN_REPEAT_POSIX = 299,\n END_REPEAT_POSIX = 300,\n BEGIN_REPEAT_FLEX = 301,\n END_REPEAT_FLEX = 302\n };\n#endif\n/* Tokens. */\n#define CHAR 258\n#define NUMBER 259\n#define SECTEND 260\n#define SCDECL 261\n#define XSCDECL 262\n#define NAME 263\n#define PREVCCL 264\n#define EOF_OP 265\n#define OPTION_OP 266\n#define OPT_OUTFILE 267\n#define OPT_PREFIX 268\n#define OPT_YYCLASS 269\n#define OPT_HEADER 270\n#define OPT_EXTRA_TYPE 271\n#define OPT_TABLES 272\n#define CCE_ALNUM 273\n#define CCE_ALPHA 274\n#define CCE_BLANK 275\n#define CCE_CNTRL 276\n#define CCE_DIGIT 277\n#define CCE_GRAPH 278\n#define CCE_LOWER 279\n#define CCE_PRINT 280\n#define CCE_PUNCT 281\n#define CCE_SPACE 282\n#define CCE_UPPER 283\n#define CCE_XDIGIT 284\n#define CCE_NEG_ALNUM 285\n#define CCE_NEG_ALPHA 286\n#define CCE_NEG_BLANK 287\n#define CCE_NEG_CNTRL 288\n#define CCE_NEG_DIGIT 289\n#define CCE_NEG_GRAPH 290\n#define CCE_NEG_LOWER 291\n#define CCE_NEG_PRINT 292\n#define CCE_NEG_PUNCT 293\n#define CCE_NEG_SPACE 294\n#define CCE_NEG_UPPER 295\n#define CCE_NEG_XDIGIT 296\n#define CCL_OP_DIFF 297\n#define CCL_OP_UNION 298\n#define BEGIN_REPEAT_POSIX 299\n#define END_REPEAT_POSIX 300\n#define BEGIN_REPEAT_FLEX 301\n#define END_REPEAT_FLEX 302\n\n/* Value type. */\n#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED\ntypedef int YYSTYPE;\n# define YYSTYPE_IS_TRIVIAL 1\n# define YYSTYPE_IS_DECLARED 1\n#endif\n\n\nextern YYSTYPE yylval;\n\nint yyparse (void);\n\n#endif /* !YY_YY_PARSE_H_INCLUDED */\n", "meta": {"content_hash": "42ea53de0b18b9312c7c7ce32521c551", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 76, "avg_line_length": 26.733766233766232, "alnum_prop": 0.7002671848433325, "repo_name": "loki04/csibe", "id": "033f91974e11261d03432c8861554b8c22759016", "size": "4117", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/flex-2.6.0/src/parse.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Awk", "bytes": "2800"}, {"name": "C", "bytes": "1097132"}, {"name": "C++", "bytes": "8474"}, {"name": "CMake", "bytes": "15006"}, {"name": "CSS", "bytes": "1746"}, {"name": "Groff", "bytes": "26612"}, {"name": "HTML", "bytes": "128005"}, {"name": "LLVM", "bytes": "5737"}, {"name": "Lex", "bytes": "136350"}, {"name": "M4", "bytes": "99282"}, {"name": "Makefile", "bytes": "325456"}, {"name": "PHP", "bytes": "3703"}, {"name": "Perl", "bytes": "12320"}, {"name": "Prolog", "bytes": "430"}, {"name": "Python", "bytes": "17647"}, {"name": "Shell", "bytes": "427842"}, {"name": "TeX", "bytes": "323102"}, {"name": "XSLT", "bytes": "12288"}, {"name": "Yacc", "bytes": "34188"}]}} +{"text": "class CreateBodyParts < ActiveRecord::Migration\n def change\n create_table :body_parts do |t|\n t.string :name\n t.string :slug\n\n t.timestamps\n end\n end\nend\n", "meta": {"content_hash": "bcbb25f0fca33b6b77f093ac63fc8a3c", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 47, "avg_line_length": 17.7, "alnum_prop": 0.6497175141242938, "repo_name": "ericallfesta/kirarirenew", "id": "2c5397417d461fc527311a5c819eb20986940424", "size": "177", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "proto.git 2/db/migrate/20140103132455_create_body_parts.rb", "mode": "33261", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "170444"}, {"name": "CoffeeScript", "bytes": "2178"}, {"name": "JavaScript", "bytes": "99649"}, {"name": "Ruby", "bytes": "234345"}]}} +{"text": "Making a formula is easy. Just `brew create URL` and then `brew install $FORMULA` (perhaps with `--debug --verbose`). Basically, a formula is a Ruby file. You can place it anywhere you want (local or remote) and install it by pointing to the file or URL.\n\nWe want your formula to be awesome, and the cookbook will tell you how.\n\n## Terminology - Homebrew speak\n\n<table>\n <tbody>\n <tr>\n <th>Formula</th>\n <td>The package definition</td>\n <td><code>/usr/local/Library/Formula/foo.rb</code></td>\n </tr>\n <tr>\n <th>Keg</th>\n <td>The installation prefix of a Formula</td>\n <td><code>/usr/local/Cellar/foo/0.1</code></td>\n </tr>\n <tr>\n <th>opt prefix</th>\n <td>A symlink to the active version of a keg</td>\n <td><code>/usr/local/opt/foo</code></td>\n </tr>\n <tr>\n <th>Cellar</th>\n <td>All kegs are installed here</td>\n <td><code>/usr/local/Cellar</code></td>\n </tr>\n <tr>\n <th>Tap</th>\n <td>An optional repository (git) of Formulae</td>\n <td><code>/usr/local/Library/Taps</code></td>\n </tr>\n <tr>\n <th>Bottle</th>\n <td>Pre-built (binary) Keg that can be unpacked</td>\n <td><code>qt-4.8.4.mountain_lion.bottle.1.tar.gz</code></td>\n </tr>\n </tbody>\n</table>\n\n_More general: `brew --prefix` and `brew --repository` instead of `/usr/local` but lets KISS._\n\n\n## An Introduction\n\nDid you see `/usr/local/.git`? Homebrew is built on Git. This means you can just do your work in `/usr/local` and merge in upstream changes as you go.\n\nHomebrew installs to the `Cellar`, it then symlinks some of the installation into `/usr/local` so that other programs can see what's going on. We suggest you `brew ls` a few of the kegs in your Cellar to see how it is all arranged.\n\nPackages are installed according to their formulae, which live in `$(brew --repository)/Library/Formula`. Check some out. You can view any formula at anytime; e.g. `brew edit wget`.\n\n\n\n# Basic Instructions\n\nMake sure you run `brew update` before you start. This turns your Homebrew installation into a Git repository.\n\nBefore contributing, make sure your package:\n\n* meets all our [Acceptable Formulae](Acceptable-Formulae.md) requirements\n* isn't already in Homebrew (check `brew search $FORMULA`)\n* isn't in another [Homebrew tap](https://github.com/Homebrew)\n* isn't already waiting to be merged (check the [issue tracker](https://github.com/Homebrew/homebrew/issues))\n* is still supported by upstream\n* has a stable, tagged version (i.e. not just a GitHub repository with no versions). See [Interesting-Taps-&-Branches](Interesting-Taps-&-Branches.md) for where pre-release and head-only versions belong.\n\nMake sure you search thoroughly (all aliases!). We don\u2019t want you to waste your time.\n\nBe sure to look over the [contributing guidelines](https://github.com/Homebrew/homebrew/blob/master/CONTRIBUTING.md) as well.\n\n\n## Will we merge your formula?\n\nProbably. But we have rules to keep the quality and goals of Homebrew intact: Please read [Acceptable Formulae](Acceptable-Formulae.md).\n\n## Some Quick Examples Before You Get Started\n\nFormulae aren\u2019t that complicated. [etl](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/etl.rb) is as simple as it gets.\n\nAnd then [Git](https://github.com/Homebrew/homebrew/tree/master/Library/Formula/git.rb) and [flac](https://github.com/Homebrew/homebrew/tree/master/Library/Formula/flac.rb) show more advanced functionality.\n\nA more complete example-formula [cheat-sheet](https://github.com/Homebrew/homebrew/blob/master/Library/Contributions/example-formula.rb) shows almost all the stuff you can use in a Formula.\n\n## Grab the URL\n\nAll you need to make a formula is a URL to the tarball.\n\n brew create http://example.com/foo-0.1.tar.gz\n\nThis creates:\n\n`$HOMEBREW_REPOSITORY/Library/Formula/foo.rb`\n\nAnd opens it in your `$EDITOR`. It'll look like:\n\n```ruby\nclass Foo < Formula\n url \"http://example.com/foo-0.1.tar.gz\"\n homepage \"\"\n sha256 \"85cc828a96735bdafcf29eb6291ca91bac846579bcef7308536e0c875d6c81d7\"\n\n # depends_on \"cmake\" => :build\n\n def install\n system \"./configure\", \"--prefix=#{prefix}\", \"--disable-debug\", \"--disable-dependency-tracking\"\n# system \"cmake\", \".\", *std_cmake_args\n system \"make\", \"install\"\n end\nend\n```\n\n**Note:** If `brew` said `Warning: Version cannot be determined from URL` when doing the `create` step, you\u2019ll need to explicitly add the correct version to the formula with `version \"foo\"` **and then save the formula**. `brew install` should then proceed without any trouble.\n\n**Note:** If `brew` said `No formula found for \"php54-timezonedb\". Searching open pull requests...` and you are writing a Tap, you should run `brew tap --repair`.\n\n## Fill in the Homepage\n\n**We don\u2019t accept formulae without homepages!**\n\nHomebrew now has a description field (`desc`). Try and summarize this from the homepage.\n\n## Check the build system\n\n brew install -i foo\n\nYou\u2019re now at new prompt with the tarball extracted to a temporary sandbox.\n\nCheck the package\u2019s `README`. Does the package install with `autotools`, `cmake`, or something else? Delete the commented out cmake lines if the package uses autotools (i.e. if it has a `configure` script).\n\n\n## Check for dependencies\n\nThe `README` probably tells you about dependencies. Homebrew or OS X probably already has them. You can check for Homebrew deps with `brew search`. These are the common deps that OS X comes with:\n\n* `libexpat`\n* `libGL`\n* `libiconv`\n* `libpcap`\n* `libxml2`\n* `Python`\n* `Ruby`\n\nThere are plenty of others. Check `/usr/lib` to see.\n\nWe try to not duplicate libraries and complicated tools in core Homebrew. We dupe some common tools though. But generally, we avoid dupes because it\u2019s one of Homebrew\u2019s foundations. (And it causes build and usage problems!)\n\nThe one special exception is OpenSSL. Anything that uses OpenSSL *should* be built using Homebrew\u2019s shipped OpenSSL and our test bot's post-install audit will warn of this when it is detected. (*Of course, there are exceptions to the exception. Not everything can be forced onto our OpenSSL)*.\n\nBecause Homebrew\u2019s OpenSSL is `keg_only` to avoid conflicting with the system sometimes formulae need to have environmental variables set or special configuration flags passed to locate our preferred OpenSSL; you can see this mechanism in the [clamav](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/clamav.rb#L28) formula. Usually this is unnecessary because when OpenSSL is specified as a dependency Homebrew temporarily prepends the $PATH with that prefix.\n\nHomebrew maintains a special [tap that provides other useful dupes](https://github.com/Homebrew/homebrew-dupes).\n\n*Important:* Since the introduction of `superenv`, `brew --prefix`/bin is NOT on the `$PATH` during formula installation. If you have dependencies at build time, you must specify them and brew will add them to the `$PATH`. You can test around this with `--env=std`.\n\n\n## Specifying other formulae as dependencies\n\n```ruby\nclass Foo < Formula\n depends_on \"jpeg\"\n depends_on \"gtk+\" => :optional\n depends_on \"readline\" => :recommended\n depends_on \"boost\" => \"with-icu\"\n depends_on :x11 => :optional\nend\n```\n\nA String specifies a formula dependency.\n\nA Symbol specifies a special conditional dependency, such as X11.\n\nA Hash specifies a formula dependency with some additional information. Given a single string key, the value can take several forms:\n* a Symbol (currently one of `:build`, `:optional`, `:recommended`).\n - `:build` tags that dependency as a build-time only dependency, meaning it can be safely ignored\n when installing from a bottle and when listing missing dependencies using `brew missing`.\n - `:optional` generates an implicit `with-foo` option for the formula. This means that, given\n `depends_on \"foo\" => :optional`, the user must pass `--with-foo` in order to enable the dependency.\n - `:recommended` generates an implicit `without-foo` option, meaning that the dependency is enabled\n by default and the user must pass `--without-foo` to disable this dependency. The default\n description can be overridden using the normal option syntax (in this case, the option declaration must precede the dependency):\n\n ```ruby\n option \"with-foo\", \"Compile with foo bindings\" # This overrides the generated description if you want to\n depends_on \"foo\" => :optional # Generated description is \"Build with foo support\"\n ```\n\n* a String or an Array\n String values are interpreted as options to be passed to the dependency. You can also pass\n an array of strings, or an array of symbols and strings, in which case the symbols are\n interpreted as described above, and the strings are passed to the dependency as options.\n\n ```ruby\n depends_on \"foo\" => \"with-bar\"\n depends_on \"foo\" => %w{with-bar with-baz}\n depends_on \"foo\" => [:optional, \"with-bar\"]\n ```\n\n\n## Specifying other formulae as conflicts\n\nSometimes there\u2019s hard conflict between formulae, and it can\u2019t be avoided or circumvented with `keg_only`.\n\nPolarSSL is a good [example](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/polarssl.rb#L36-L37) formula for minor conflict.\n\nPolarSSL ship GNU\u2019s Hello, and compiles a `hello` binary. This is obviously non-essential to PolarSSL\u2019s functionality, and conflict with the `hello` formula would be overkill, so we just remove it.\n\nHowever, also in the PolarSSL formulae is a [firm conflict](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/polarssl.rb#L19) with `md5sha1sum`, because both `md5sha1sum` and `polarssl` compile identically-named binaries that *are* important for core functionality.\n\nAs a general rule, `conflicts_with` should be a last-resort option. It\u2019s a fairly blunt instrument.\n\nThe syntax for conflict that can\u2019t be worked around is\n\n```ruby\nconflicts_with \"blueduck\", :because => \"yellowduck also ships a duck binary\"\n```\n\n## Formulae Revisions\n\nIn Homebrew we sometimes accept formulae updates that don\u2019t include a version bump. These include homepage changes, resource updates, new patches or fixing a security issue with a formula.\n\nOccasionally, these updates require a forced-recompile of the formula itself or its dependents to either ensure formulae continue to function as expected or to close a security issue. This forced-recompile is known as a `revision` and inserted underneath the homepage/url/sha block.\n\nWhere a dependent of a formula fails against a new version of that dependency it must receive a `revision`. An example of such failure can be seen [here](https://github.com/Homebrew/homebrew/issues/31195) and the fix [here](https://github.com/Homebrew/homebrew/pull/31207).\n\n`Revisions` are also used for formulae that move from the system OpenSSL to the Homebrew-shipped OpenSSL without any other changes to that formula. This ensures users aren\u2019t left exposed to the potential security issues of the outdated OpenSSL. An example of this can be seen in [this commit](https://github.com/Homebrew/homebrew/commit/6b9d60d474d72b1848304297d91adc6120ea6f96).\n\n## Double-check for dependencies\n\nWhen you already have a lot of brews installed, its easy to miss a common dependency like `glib` or `gettext`.\n\nYou can double-check which libraries a binary links to with the `otool` command (perhaps you need to use `xcrun otool`):\n\n $ otool -L /usr/local/bin/ldapvi\n /usr/local/bin/ldapvi:\n\t/usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)\n\t/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)\n\t/usr/local/lib/libglib-2.0.0.dylib (compatibility version 4201.0.0, current version 4201.0.0)\n\t/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.2.0)\n\t/usr/local/opt/readline/lib/libreadline.6.dylib (compatibility version 6.0.0, current version 6.3.0)\n\t/usr/local/lib/libpopt.0.dylib (compatibility version 1.0.0, current version 1.0.0)\n\t/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)\n\t/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0)\n\t/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)\n\t/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)\n\n\n## Specifying gems, Python modules, Go projects, etc. as dependencies\n\nHomebrew doesn\u2019t package already packaged language-specific libraries. These should be installed directly from `gem`/`cpan`/`pip` etc.\n\nIf you're installing an application then please locally vendor all the language-specific dependencies:\n\n```ruby\nclass Foo < Formula\n resource \"pycrypto\" do\n url \"https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.tar.gz\"\n sha256 \"85cc828a96735bdafcf29eb6291ca91bac846579bcef7308536e0c875d6c81d7\"\n end\n\n def install\n resource(\"pycrypto\").stage { system \"python\", *Language::Python.setup_install_args(libexec/\"vendor\") }\n end\nend\n```\n\n[jrnl](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/jrnl.rb) is an example of a formula that does this well. The end-result means the user doesn't have to faff with `pip` or Python and can just run `jrnl`.\n\n[homebrew-pypi-poet](https://github.com/tdsmith/homebrew-pypi-poet) can help you generate resource stanzas for the dependencies of your Python application.\n\nSimilarly, [homebrew-go-resources](https://github.com/samertm/homebrew-go-resources) can help you generate go\\_resource stanzas for the dependencies of your go application.\n\nIf your formula needs a gem or python module and it can't be made into a resource you\u2019ll need to check for these external dependencies:\n\n```ruby\nclass Foo < Formula\n depends_on \"mg\" => :ruby\n depends_on \"json\" => :python\n depends_on \"Authen::NTLM\" => :perl\nend\n```\n\nNote that we probably won't accept the formulae in this case; it's a far worse user experience than vendoring libraries with resources.\n\n## Test the formula\n\nExit out of the interactive shell.\n\n brew install --verbose --debug foo\n\nDebug will ask you to open an interactive shell when the build fails so you can try to figure out what went wrong.\n\nCheck the top of the `./configure` output (if applicable)! Some configure scripts do not recognize `--disable-debug`. If you see a warning about it, remove the option from the formula.\n\n## Add a test to the formula\n\nPlease add a `test do` block to the formula. This will be run by `brew test foo` and the [Brew Test Bot](Brew-Test-Bot.md).\n\nThe `test do` block automatically creates and changes to a temporary directory which is deleted after run. You can access this Pathname with the `testpath` function.\n\nWe want tests that don't require any user input and test the basic functionality of the application. For example `foo build-foo input.foo` is a good test and (despite their widespread use) `foo --version` and `foo --help` are bad tests. However, a bad test is better than no test at all.\n\nSee [cmake](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/cmake.rb) for an example of a formula with a good test. A basic `CMakeLists.txt` file is written CMake uses it to generate Makefiles. This test checks that CMake doesn't e.g. segfault during basic operation.\n\n## Manuals\n\nHomebrew expects to find man pages in `[prefix]/share/man/...`, and not in `[prefix]/man/...`.\n\nSome software installs to man instead of `share/man`, so check the output and add a `\"--mandir=#{man}\"` to the `./configure` line if needed.\n\n\n## A Quick Word on Naming\n\n**THE NAME IS VERY IMPORTANT!**\n\nName the formula like the project markets the product. So it\u2019s `pkg-config`, not `pkgconfig`; `sdl_mixer`, not `sdl-mixer` or `sdlmixer`.\n\nThe only exception is stuff like \u201cApache Ant\u201d. Apache sticks \u201cApache\u201d in front of everything, but we use the formula name `ant`. We only include the prefix in cases like *GNUplot* (because it\u2019s part of the name) and *GNU Go* (because everyone calls it \u201cGNU go\u201d\u2014nobody just calls it \u201cGo\u201d). The word \u201cGo\u201d is too common and there are too many implementations of it.\n\nIf you\u2019re not sure about the name check the homepage, and check the Wikipedia page.\n\n[ALSO CHECK WHAT DEBIAN CALLS IT!](https://www.debian.org/distrib/packages)\n\nWhere Homebrew already has a formula called `foo` we typically do not accept requests to replace that formula with something else also named `foo`. This is to avoid both confusing and surprising users\u2019 expectation.\n\nWhen two formulae share an upstream name, e.g. [`AESCrypt`](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/aescrypt.rb) and [`AESCrypt`](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/aescrypt-packetizer.rb) the newer formula must typically adapt the name to avoid conflict with the current formula.\n\nIf you\u2019re *still* not sure, just commit. We\u2019ll apply some arbitrary rule and make a decision ;)\n\nWhen importing classes, Homebrew will require the formula and then create an instance of the class. It does this by assuming the formula name can be directly converted to the class name using a `regexp`. The rules are simple:\n\n* `foo-bar.rb` => `FooBar`\n* `foobar.rb` => `Foobar`\n\nThus, if you change the name of the class, you must also rename the file. Filenames should be all lowercase.\n\nAdd aliases by creating symlinks in `Library/Aliases`.\n\n\n## Audit the formula\n\nYou can run `brew audit` to test formulae for adherence to Homebrew house style. This includes warnings for trailing whitespace, preferred URLs for certain source hosts, and a lot of other style issues. Fixing these warnings before committing will make the process a lot smoother for us.\n\nUse `brew info` and check if the version guessed by Homebrew from the URL is\ncorrect. Add an explicit `version` if not.\n\n## Commit\n\nEverything is built on Git, so contribution is easy:\n\n brew install git # if you already have git installed, skip this command\n brew update # required in more ways than you think (initializes the brew git repository if you don't already have it)\n cd `brew --repository`\n # Create a new git branch for your formula so your pull request is easy to\n # modify if any changes come up during review.\n git checkout -b <some-descriptive-name>\n git add Library/Formula/foo.rb\n git commit\n\nThe established standard for Git commit messages is:\n\n* the first line is a commit summary of *50 characters or less*, then\n* two (2) newlines, then\n* explain the commit throughly\n\nAt Homebrew, we like to put the name of the formula upfront like so \"foobar 7.3 (new formula)\".\nThis may seem crazy short, but you\u2019ll find that forcing yourself to summarise the commit encourages you to be atomic and concise. If you can\u2019t summarise it in 50-80 characters, you\u2019re probably trying to commit two commits as one. For a more thorough explanation, please read Tim Pope\u2019s excellent blog post, [A Note About Git Commit Messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).\n\nThe preferred commit message format for simple version updates is \"foobar 7.3\".\n\nEnsure you reference any relevant GitHub issue `#12345` in the commit message. Homebrew\u2019s history is the first thing future contributors will look to when trying to understand the current state of formulae they\u2019re interested in.\n\n\n## Push\n\nNow you just need to push back to GitHub.\n\nIf you haven\u2019t forked Homebrew yet, [go to the repo and hit the fork button](https://github.com/Homebrew/homebrew).\n\nIf you have already forked Homebrew on GitHub, then you can manually push (just make sure you have been pulling from the Homebrew/homebrew master):\n\n git push git@github.com:myname/homebrew.git <what-you-called-your-branch>\n\nNow, please open a Pull Request (on your GitHub repo page) for new and updated brews.\n\n* One formula per commit; one commit per formula\n* Keep merge commits out of the request\n* If you have any merge or mixup commits, please [squash](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) them.\n\nIf a commit touches multiple files, or isn\u2019t one logical bug fix, or a file is touched in multiple commits, we\u2019ll probably ask you to `rebase` and `squash` your commits. For this reason, you should avoid pushing to your `master` branch. Note, after rebase and/or squash, you'll need to push with `--force` to your remote.\n\n\n# Overview of the Formula Install Process\n<!-- TODO rewrite this. It is outdated, there are more layers now, and the implementation details discussed here are not relevant or useful to most users anyway. -->\n\n* The result of `Formula.download_strategy` is instantiated.\n* `DownloadStrategy.fetch` is called (downloads tarball, checks out git repository, etc.)\n* A temporary sandbox is created in `/tmp/$formulaname`\n* `DownloadStrategy.stage` is called (extracts tarball to above sandbox, exports git repository to sandbox, etc.)\n* Patches are applied\n* Current directory is changed to the stage root (so when you `system make`, it works)\n* `Formula.install` is called\n* Anything installed to the keg is cleaned (see later)\n* The keg is symlinked into Homebrew\u2019s prefix\n* Caveats are displayed\n\n\n# Convenience Tools\n\n## Messaging\n\nThree commands are provided for displaying informational messages to the user:\n\n* `ohai` for general info\n* `opoo` for warning messages\n* `onoe` for error messages\n\nIn particular, when a test needs to be performed before installation use `onoe` to bail out gracefully. For example:\n\n```ruby\nif some_test?\n system \"make\", \"install\"\nelse\n onoe \"Error! Something is wrong.\"\nend\n```\n\n\n## bin.install \"foo\"\n\nYou\u2019ll see stuff like that in other formulae. This installs the file foo into the Formula\u2019s `bin` directory (`/usr/local/Cellar/pkg/0.1/bin`) and makes it executable (`chmod 0555 foo`).\n\n## inreplace\n\nA convenience function that can edit files in-place. For example:\n\n`inreplace \"path\", before, after`\n\n`before` and `after` can be strings or regexps. You can also use the block form:\n\n```ruby\ninreplace \"path\" do |s|\n s.gsub! /foo/, \"bar\"\nend\n```\n\nMake sure you modify `s`! This block ignores the returned value.\n\n`inreplace` should be used instead of patches when it is patching something that will never be accepted upstream e.g. make the software\u2019s build system respect Homebrew\u2019s installation hierarchy. If it's Homebrew and MacPorts or OS X specific it should be turned into a patch instead.\n\nIf you need modify variables in a Makefile, rather than using `inreplace`, pass them as arguments to make:\n\n```rb\nsystem \"make\", \"target\", \"VAR2=value1\", \"VAR2=value2\", \"VAR3=values can have spaces\"\n```\n\n```rb\nargs = %W[\n CC=#{ENV.cc}\n PREFIX=#{prefix}\n]\n\nsystem \"make\", *args\n```\n\nNote that values *can* contain unescaped spaces if you use the multiple-argument form of `system`.\n\n## Patches\n\nWhile patches should generally be avoided, sometimes they are necessary.\n\nWhen patching (i.e. fixing header file inclusion, fixing compiler warnings, etc.) the first thing to do is check whether or not the upstream project is aware of the issue. If not, file a bug report and/or submit your patch for inclusion. We may sometimes still accept your patch before it was submitted upstream but by getting the ball rolling on fixing the upstream issue you reduce the length of time we have to carry the patch around.\n\n*Always, always, always justify a patch with a code comment!* Otherwise, nobody will know when it is safe to remove the patch, or safe to leave it in when updating the formula. The comment should include a link to the relevant upstream issue(s).\n\nExternal patches can be declared using resource-style blocks:\n\n```rb\npatch do\n url \"https://example.com/example_patch.diff\"\n sha256 \"85cc828a96735bdafcf29eb6291ca91bac846579bcef7308536e0c875d6c81d7\"\nend\n```\n\nA strip level of -p1 is assumed. It can be overridden using a symbol argument:\n\n```rb\npatch :p0 do\n url \"https://example.com/example_patch.diff\"\n sha256 \"85cc828a96735bdafcf29eb6291ca91bac846579bcef7308536e0c875d6c81d7\"\nend\n```\n\nPatches can be declared in stable, devel, and head blocks. NOTE: always use a block instead of a conditional, i.e. `stable do ... end` instead of `if build.stable? then ... end`.\n\n```rb\nstable do\n # some other things...\n\n patch do\n url \"https://example.com/example_patch.diff\"\n sha256 \"85cc828a96735bdafcf29eb6291ca91bac846579bcef7308536e0c875d6c81d7\"\n end\nend\n```\n\nEmbedded (__END__) patches can be declared like so:\n\n```rb\npatch :DATA\npatch :p0, :DATA\n```\n\nwith the patch data included at the end of the file:\n\n```\n__END__\ndiff --git a/foo/showfigfonts b/foo/showfigfonts\nindex 643c60b..543379c 100644\n--- a/foo/showfigfonts\n+++ b/foo/showfigfonts\n@@ -14,6 +14,7 @@\n\u2026\n```\n\nPatches can also be embedded by passing a string. This makes it possible to provide multiple embedded patches while making only some of them conditional.\n```rb\npatch :p0, \"...\"\n```\n\nIn embedded patches, the string `HOMEBREW_PREFIX` is replaced with the value of the constant `HOMEBREW_PREFIX` before the patch is applied.\n\n\n## Creating the diff\n\n brew install --interactive --git foo\n \u2026\n (make some edits)\n \u2026\n git diff | pbcopy\n brew edit foo\n\nNow just paste into the formula after `__END__`.\nInstead of `git diff | pbcopy`, for some editors `git diff >> path/to/your/formula/foo.rb` might help you that the diff is not touched (e.g. white space removal, indentation, etc.)\n\n\n\n# Advanced Formula Tricks\n\nIf anything isn\u2019t clear, you can usually figure it out with some `grep` and the `Library/Formula` directory. Please amend this document if you think it will help!\n\n\n## Unstable versions (`HEAD`, `devel`)\n\nFormulae can specify alternate downloads for the upstream project\u2019s `devel` release (unstable but not `trunk`) or `HEAD` (`master/trunk`).\n\n### HEAD\n\nHEAD URLs (activated by passing `--HEAD`) build the development cutting edge. Specifying it is easy:\n\n```ruby\nclass Foo < Formula\n head \"https://github.com/mxcl/lastfm-cocoa.git\"\nend\n```\n\nHomebrew understands `git`, `svn`, and `hg` URLs, and has a way to specify `cvs` repositories as a URL as well. You can test whether the `HEAD` is being built with `build.head?`.\n\nTo use a specific commit, tag, or branch from a repository, specify head with the `:tag` and `:revision`, `:revision`, or `:branch` option, like so:\n\n```ruby\nclass Foo < Formula\n head \"https://github.com/some/package.git\", :revision => \"090930930295adslfknsdfsdaffnasd13\"\n # or :branch => \"develop\"\n # or :tag => \"1_0_release\",\n # :revision => \"090930930295adslfknsdfsdaffnasd13\"\nend\n```\n\nFormulae that only have `head` versions should be submitted to [homebrew/headonly](https://github.com/Homebrew/homebrew-headonly) instead of Homebrew/homebrew.\n\n### devel\n\nThe \"devel\" spec (activated by passing `--devel`) is used for a project\u2019s unstable releases. It is specified in a block:\n\n```ruby\ndevel do\n url \"https://foo.com/foo-0.1.tar.gz\"\n sha256 \"85cc828a96735bdafcf29eb6291ca91bac846579bcef7308536e0c875d6c81d7\"\nend\n```\n\nYou can test if the \"devel\" spec is in use with `build.devel?`.\n\n## Compiler selection\n\nSometimes a package fails to build when using a certain compiler. Since recent Xcode no longer includes a GCC compiler, we cannot simply force the use of GCC. Instead, the correct way to declare this is the `fails_with` DSL method. A properly constructed `fails_with` block documents the latest compiler build version known to cause compilation to fail, and the cause of the failure. For example:\n\n```ruby\nfails_with :llvm do\n build 2335\n cause <<-EOS.undent\n The \"cause\" field should include a short summary of the error. Include\n the URLs of any relevant information, such as upstream bug reports. Wrap\n the text at a sensible boundary (~72-80 characters), but do not break\n URLs over multiple lines.\n EOS\nend\n```\n\n`build` takes a Fixnum (you can find this number in your `brew --config` output). `cause` takes a string, and the use of heredocs is encouraged to improve readability and allow for more comprehensive documentation.\n\n`fails_with` declarations can be used with any of `:gcc`, `:llvm`, and `:clang`. Homebrew will use this information to select a working compiler (if one is available).\n\n\n## Specifying the Download Strategy explicitly\n\nTo use one of Homebrew\u2019s built-in download strategies, specify the `:using =>` flag on a `url` or `head`. For example:\n\n```ruby\nclass Sip < Formula\n url \"http://www.riverbankcomputing.co.uk/hg/sip/archive/4.11\"\n md5 \"dbafd7101a4e7caee6f529912a1356e5\"\n head \"http://www.riverbankcomputing.co.uk/hg/sip\", :using => :hg\n homepage \"http://www.riverbankcomputing.co.uk/software/sip\"\n```\n\nThe downloaders offered by Homebrew are:\n\n<table>\n <thead>\n <tr>\n <th>Value of <code>:using</code></th>\n <th>Corresponds To</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><code>:bzr</code></td>\n <td><code>BazaarDownloadStrategy</code></td>\n </tr>\n <tr>\n <td><code>:curl</code></td>\n <td><code>CurlDownloadStrategy</code></td>\n </tr>\n <tr>\n <td><code>:cvs</code></td>\n <td><code>CVSDownloadStrategy</code></td>\n </tr>\n <tr>\n <td><code>:git</code></td>\n <td><code>GitDownloadStrategy</code></td>\n </tr>\n <tr>\n <td><code>:hg</code></td>\n <td><code>MercurialDownloadStrategy</code></td>\n </tr>\n <tr>\n <td><code>:nounzip</code></td>\n <td><code>NoUnzipCurlDownloadStrategy</code></td>\n </tr>\n <tr>\n <td><code>:post</code></td>\n <td><code>CurlPostDownloadStrategy</code></td>\n </tr>\n <tr>\n <td><code>:svn</code></td>\n <td><code>SubversionDownloadStrategy</code></td>\n </tr>\n </tbody>\n</table>\n\n\nIf you need more control over the way files are downloaded and staged, you can create a custom download strategy and specify it using the `url` method's `:using` option:\n\n\n```ruby\nclass MyDownloadStrategy < SomeHomebrewDownloadStrategy\n # Does something cool\nend\n\nclass Foo < Formula\n url \"something\", :using => MyDownloadStrategy\nend\n```\n\nSpecifying download strategies can be useful when used with a local repo, where a plain URL would not let you specify how to access it. For example:\n\n```ruby\nclass Bar < Formula\n head \"/users/abc/src/git.git\", :using => :git\nend\n```\n\n\n## Just copying some files\n\nWhen your code in the install function is run, the current working directory is set to the extracted tarball.\n\nSo it is easy to just copy some files:\n\n```ruby\nprefix.install \"file1\", \"file2\"\n```\n\nOr everything:\n\n```ruby\nprefix.install Dir[\"output/*\"]\n```\n\nGenerally we'd rather you were specific about what files or directories need to be installed rather than installing everything.\n\n### Variables for directory locations\n\n<table>\n <thead>\n <tr>\n <th>Name</th>\n <th>Default</th>\n <th>Example</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th><code>HOMEBREW_PREFIX</code></th>\n <td><code>/usr/local</code></td>\n <td></td>\n </tr>\n <tr>\n <th><code>prefix</code></th>\n <td><code>#{HOMEBREW_PREFIX}/Cellar/#{name}/#{version}</code></td>\n <td><code>/usr/local/Cellar/foo/0.1</code></td>\n </tr>\n <tr>\n <th><code>opt_prefix</code></th>\n <td><code>#{HOMEBREW_PREFIX}/opt/#{name}</code></td>\n <td><code>/usr/local/opt/foo</code></td>\n </tr>\n <tr>\n <th><code>bin</code></th>\n <td><code>#{prefix}/bin</code></td>\n <td><code>/usr/local/Cellar/foo/0.1/bin</code></td>\n </tr>\n <tr>\n <th><code>doc</code></th>\n <td><code>#{prefix}/share/doc/foo</code></td>\n <td><code>/usr/local/Cellar/foo/0.1/share/doc/foo</code></td>\n </tr>\n <tr>\n <th><code>include</code></th>\n <td><code>#{prefix}/include</code></td>\n <td><code>/usr/local/Cellar/foo/0.1/include</code></td>\n </tr>\n <tr>\n <th><code>info</code></th>\n <td><code>#{prefix}/share/info</code></td>\n <td><code>/usr/local/Cellar/foo/0.1/share/info</code></td>\n </tr>\n <tr>\n <th><code>lib</code></th>\n <td><code>#{prefix}/lib</code></td>\n <td><code>/usr/local/Cellar/foo/0.1/lib</code></td>\n </tr>\n <tr>\n <th><code>libexec</code></th>\n <td><code>#{prefix}/libexec</code></td>\n <td><code>/usr/local/Cellar/foo/0.1/libexec</code></td>\n </tr>\n <tr>\n <th><code>man</code></th>\n <td><code>#{prefix}/share/man</code></td>\n <td><code>/usr/local/Cellar/foo/0.1/share/man</code></td>\n </tr>\n <tr>\n <th><code>man[1-8]</code></th>\n <td><code>#{prefix}/share/man/man[1-8]</code></td>\n <td><code>/usr/local/Cellar/foo/0.1/share/man/man[1-8]</code></td>\n </tr>\n <tr>\n <th><code>sbin</code></th>\n <td><code>#{prefix}/sbin</code></td>\n <td><code>/usr/local/Cellar/foo/0.1/sbin</code></td>\n </tr>\n <tr>\n <th><code>share</code></th>\n <td><code>#{prefix}/share</code></td>\n <td><code>/usr/local/Cellar/foo/0.1/share</code></td>\n </tr>\n <tr>\n <th><code>etc</code></th>\n <td><code>#{HOMEBREW_PREFIX}/etc</code></td>\n <td><code>/usr/local/etc</code></td>\n </tr>\n <tr>\n <th><code>var</code></th>\n <td><code>#{HOMEBREW_PREFIX}/var</code></td>\n <td><code>/usr/local/var</code></td>\n </tr>\n <tr>\n <th><code>buildpath</code></th>\n <td>A temporary dir somewhere on your system</td>\n <td><code>/private/tmp/[formula-name]-0q2b/[formula-name]</code></td>\n </tr>\n </tbody>\n</table>\n\nThese can be used, for instance, in code such as\n\n```ruby\nbin.install Dir[\"output/*\"]\n```\n\nto install binaries into their correct location into the cellar, and\n\n```ruby\nman.mkpath\n```\n\nto create the directory structure to the man location.\n\nTo install man pages into specific locations, use `man1.install \"foo.1\", \"bar.1\"`, `man2.install \"foo.2\"`, etc.\n\nNote that in the context of Homebrew, `libexec` is reserved for private use by the formula and therefore is not symlinked into `HOMEBREW_PREFIX`.\n\n### Installation without linking into `/usr/local` (keg-only)\n\nIf you only need a program for a dependency and it does not need to be linked for public use in `/usr/local`, specify\n\n```ruby\nkeg_only \"This is my rationale.\"\n```\n\nin the Formula class.\n\n\n## Adding optional steps\n\nIf you want to add an option:\n\n```ruby\nclass Yourformula < Formula\n ...\n option \"with-ham\", \"Description of the option\"\n option \"without-spam\", \"Another description\"\n depends_on \"foo\" => :optional # will automatically add a with-foo option\n ...\n```\n\nAnd then to define the effects the options have:\n\n```ruby\nif build.with? \"ham\"\n # note, no \"with\" in the option name (it is added by the build.with? method)\nend\n\nif build.without? \"ham\"\n # works as you'd expect. True if `--without-ham` was given.\nend\n\nif build.include? \"enable-ham\"\n # the deprecated style, only useful for options other than `with`/`without` style\nend\n```\n\nOption names should be prefixed with one of the words `with`, `without`, `no`, or a verb in the imperative tense describing the action to be taken. For example, an option to run a test suite should be named `--with-test` or `--with-check` rather than `--test`, and an option to enable a shared library should be named `--enable-shared` rather than `--shared`.\n\nNote that options that aren\u2019t ` build.with? ` or ` build.without? ` should be actively deprecated where possible. See [wget](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/wget.rb#L27-L31) for an example.\n\nSee the [graphviz](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/graphviz.rb) formula for an example.\n\n\n## File level operations\n\nYou can use the file utilities provided by Ruby (`FileUtils`). These are included in the `Formula` class, so you do not need the `FileUtils.` prefix to use them. They are documented [here](http://www.ruby-doc.org/stdlib/libdoc/fileutils/rdoc/index.html).\n\nWhen creating symlinks, take special care to ensure they are *relative* symlinks. This makes it easier to create a relocatable bottle. For example, to create a symlink in `bin` to an executable in `libexec`, use\n\n```rb\nbin.install_symlink libexec/\"name\"\n```\n\n*not*\n\n```rb\nln_s libexec/\"name\", bin\n```\n\nThe symlinks created by `install_symlink` are guaranteed to be relative. `ln_s` will only produce a relative symlink when given a relative path.\n\n## Handling files that should persist over formula upgrades\n\nFor example, Ruby 1.9\u2019s gems should be installed to `var/lib/ruby/` so that gems don\u2019t need to be reinstalled when upgrading Ruby. You can usually do this with symlink trickery, or *better* a configure option.\n\n### launchd plist files\n\nHomebrew provides two Formula methods for launchd plist files. `plist_name` will return `homebrew.mxcl.<formula>`, and `plist_path` will return, for example, `/usr/local/Cellar/foo/0.1/homebrew.mxcl.foo.plist`.\n\n## Updating formulae\n\nEventually a new version of the software will be released. In this case you should update the `url` and `sha256`. Please leave the `bottle do ... end` block as-is; our CI system will update it when we pull your change.\n\nCheck if the formula you are updating is a dependency for any other formulae by running `brew uses UPDATED_FORMULA`. If it is a dependency please `brew reinstall` all the dependencies after it is installed and verify they work correctly.\n\n# Style guide\n\nHomebrew wants to maintain a consistent Ruby style across all formulae based on [Ruby Style Guide](https://github.com/styleguide/ruby). Other formulae may not have been updated to match this guide yet but all new ones should. Also:\n\n* The order of methods in a formula should be consistent with other formulae (e.g.: `def patches` goes before `def install`)\n* An empty line is required before the `__END__` line\n\n\n\n# Troubleshooting for people writing new formulae\n\n### Version detection fails\n\nHomebrew tries to automatically determine the version from the URL in order to save on duplication. If the tarball has a funny name though, you may have to assign the version number:\n\n```ruby\nclass Foobar\n version \"0.7\"\nend\n```\n\n## Bad Makefiles\n\nNot all projects have makefiles that will run in parallel so try to deparallelize:\n\n brew edit foo\n\nAdd all this to the formula (so there will already be a class line, don\u2019t add another or change that, and there\u2019s already an install function, don't add another one, add the lines in the install function below to the top of the problem formula\u2019s install function).\n\n```ruby\nclass Foo < Formula\n skip_clean :all\n def install\n ENV.deparallelize\n ENV.no_optimization\n system \"make\" # separate make and make install steps\n system \"make\", \"install\"\n end\nend\n```\n\nIf that fixes it, please open an [issue](https://github.com/Homebrew/homebrew/issues) so that we can fix it for everyone.\n\n## Still won\u2019t work?\n\nCheck out what MacPorts and Fink do:\n\n`brew -S --macports foo`\n\n`brew -S --fink foo`\n\n\n\n# Superenv Notes\n\n`superenv` is a \"super\" environment that tries to improve reliability for the general case. But it does make making formula harder.\n\nTo not use `superenv`, install with `--env=std`.\n\nSuperenv isolates builds by removing `/usr/local/bin` and all user-PATHs that are not determined to be essential to the build. It does this because other PATHs are full of stuff that breaks builds. (We have 15,000 tickets as testament!)\n\n`superenv` tries to remove bad-flags from the commands passed to `clang`/`gcc` and injects others (for example all `keg_only` dependencies are added to the `-I` and `-L` flags. If superenv troubles you, try to `brew install --env=std` and report to us if that fixes it.\n\n# Fortran\n\nSome software requires a Fortran compiler. This can be declared by adding `depends_on :fortran` to a formula. `:fortran` is a special dependency that does several things.\n\nFirst, it looks to see if you have set the `FC` environment variable. If it is set, Homebrew will use this value during compilation. If it is not set, it will check to see if `gfortran` is found in `PATH`. If it is, Homebrew will use its location as the value of `FC`. Otherwise, the `gcc` formula will be treated as a dependency and installed prior to compilation.\n\nIf you have set `FC` to a custom Fortran compiler, you may additionally set `FCFLAGS` and `FFLAGS`. Alternatively, you can pass `--default-fortran-flags` to `brew install` to use Homebrew's standard `CFLAGS`.\n\nWhen using Homebrew's own gfortran compiler, the standard `CFLAGS` are used and user-supplied values of `FCFLAGS` and `FFLAGS` are ignored for consistency and reproducibility reasons.\n\n\n# How to start over (reset to `master`)?\n\nHave you created a real mess in git which paralyzes you to create the commit you just want to push?\nThen you might consider start from scratch.\nYour changes will be discarded in favour of the `master` branch:\n\n`git checkout master`\n\n`git reset --hard FETCH_HEAD`\n", "meta": {"content_hash": "8d53a5d3ee66b814a3acde6349ddb05c", "timestamp": "", "source": "github", "line_count": 987, "max_line_length": 476, "avg_line_length": 41.4822695035461, "alnum_prop": 0.7218816403292382, "repo_name": "tylerball/homebrew", "id": "ca05738ca5b42bfeaae355e1ddbf5fd7b6a3e0b1", "size": "41092", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "share/doc/homebrew/Formula-Cookbook.md", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "C++", "bytes": "5889"}, {"name": "Groff", "bytes": "26137"}, {"name": "JavaScript", "bytes": "18"}, {"name": "Perl", "bytes": "547"}, {"name": "PostScript", "bytes": "485"}, {"name": "Ruby", "bytes": "4617578"}, {"name": "Shell", "bytes": "19080"}]}} +{"text": "package gr.demokritos.iit.ydsapi.model;\n\nimport com.google.gson.Gson;\nimport com.google.gson.GsonBuilder;\nimport com.google.gson.JsonArray;\nimport com.google.gson.JsonDeserializationContext;\nimport com.google.gson.JsonDeserializer;\nimport com.google.gson.JsonElement;\nimport com.google.gson.JsonObject;\nimport com.google.gson.JsonParseException;\nimport com.google.gson.JsonSerializationContext;\nimport com.google.gson.JsonSerializer;\nimport java.lang.reflect.Type;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.LinkedHashSet;\nimport java.util.List;\nimport java.util.Objects;\nimport java.util.Set;\nimport org.bson.types.ObjectId;\n\n/**\n *\n * @author George K. <gkiom@iit.demokritos.gr>\n */\npublic class BasketItem {\n\n private final String userID;\n private final String componentParentUUID;\n private final String title;\n private final ObjectId basketItemID;\n private final Set<String> tags;\n private final Set<BFilter> filters;\n private final String compType;\n private final String contentType;\n private final BasketType type;\n private final boolean priv;\n private final String lang;\n\n private BasketItem(Builder builder) {\n this.userID = builder.user_id;\n this.componentParentUUID = builder.component_parent_UUID;\n this.title = builder.title;\n this.basketItemID = builder.basket_item_id;\n this.tags = builder.tags;\n this.filters = builder.filters;\n this.compType = builder.component_type;\n this.contentType = builder.content_type;\n this.type = builder.type;\n this.priv = builder.isPrivate;\n this.lang = builder.lang;\n }\n\n /**\n * obtain json request, utilizes {@link Builder} for safety\n *\n * @param jsonBasketItem\n */\n public BasketItem(String jsonBasketItem) {\n BasketItem bi\n = new GsonBuilder()\n .registerTypeAdapter(BasketItem.class, new BasketItemDeserializer())\n .create()\n .fromJson(jsonBasketItem, getClass());\n this.userID = bi.userID;\n this.componentParentUUID = bi.componentParentUUID;\n this.title = bi.title;\n this.basketItemID = bi.basketItemID;\n this.tags = bi.tags;\n this.filters = bi.filters;\n this.compType = bi.compType;\n this.contentType = bi.contentType;\n this.type = bi.type;\n this.priv = bi.priv;\n this.lang = bi.lang;\n }\n\n public String getUserID() {\n return userID;\n }\n\n public String getComponentParentUUID() {\n return componentParentUUID;\n }\n\n public String getTitle() {\n return title;\n }\n\n public ObjectId getBasketItemID() {\n return basketItemID;\n }\n\n public Set<String> getTags() {\n return tags;\n }\n\n public Set<BFilter> getFilters() {\n return filters;\n }\n\n public String getComponentType() {\n return compType;\n }\n\n public String getContentType() {\n return contentType;\n }\n\n public BasketType getType() {\n return type;\n }\n\n public boolean isPrivate() {\n return priv;\n }\n\n public String getLang() {\n return lang;\n }\n\n @Override\n public String toString() {\n return \"BasketItem{\" + \"user_id=\" + userID\n + \", component_parent_UUID=\" + componentParentUUID\n + \", title=\" + title\n + \", basket_item_id=\" + basketItemID\n + \", tags=\" + tags\n + \", filters=\" + filters\n + \", component_type=\" + compType\n + \", content_type=\" + contentType\n + \", type=\" + type\n + \", priv=\" + priv\n + \", lang=\" + lang + '}';\n }\n\n public String toJSON() {\n GsonBuilder gsonBuilder = new GsonBuilder();\n gsonBuilder\n .registerTypeAdapter(BasketItem.class, new BasketItemSerializer())\n .disableHtmlEscaping()\n .setPrettyPrinting();\n Gson gson = gsonBuilder.create();\n return gson.toJson(this);\n }\n\n public JsonElement toJSONElement() {\n GsonBuilder gsonBuilder = new GsonBuilder();\n gsonBuilder\n .registerTypeAdapter(BasketItem.class, new BasketItemSerializer())\n .disableHtmlEscaping()\n .setPrettyPrinting();\n Gson gson = gsonBuilder.create();\n return gson.toJsonTree(this);\n }\n\n /**\n * we want only these specific fields to uniquely identify a\n * {@link BasketItem}\n *\n * @return\n */\n @Override\n public int hashCode() {\n int hash = 3;\n hash = 17 * hash + Objects.hashCode(this.componentParentUUID);\n hash = 17 * hash + Objects.hashCode(this.title);\n hash = 17 * hash + Objects.hashCode(this.compType);\n hash = 17 * hash + Objects.hashCode(this.contentType);\n hash = 17 * hash + Objects.hashCode(this.type);\n hash = 17 * hash + Objects.hashCode(this.lang);\n return hash;\n }\n\n @Override\n public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n final BasketItem other = (BasketItem) obj;\n if (!Objects.equals(this.componentParentUUID, other.componentParentUUID)) {\n return false;\n }\n if (!Objects.equals(this.title, other.title)) {\n return false;\n }\n if (!Objects.equals(this.compType, other.compType)) {\n return false;\n }\n if (!Objects.equals(this.contentType, other.contentType)) {\n return false;\n }\n if (this.type != other.type) {\n return false;\n }\n return Objects.equals(this.lang, other.lang);\n }\n\n /**\n * custom builder class for {@link BasketItem}\n */\n public static class Builder {\n\n private final String user_id;\n private final String component_parent_UUID;\n private final String title;\n private ObjectId basket_item_id;\n private Set<String> tags;\n private Set<BFilter> filters;\n private String component_type;\n private String content_type;\n private BasketType type;\n private Boolean isPrivate;//\n private String lang;\n\n public Builder(String userIDArg, String compParentUUIDArg, String titleArg) {\n this.user_id = userIDArg;\n this.component_parent_UUID = compParentUUIDArg;\n this.title = titleArg;\n }\n\n /**\n *\n * @param lang\n * @return\n */\n public Builder withLang(String lang) {\n this.lang = lang;\n return this;\n }\n\n /**\n *\n * @param tagsArg\n * @return\n */\n public Builder withTags(Collection<String> tagsArg) {\n if (tagsArg == null) {\n this.tags = new LinkedHashSet(0);\n } else {\n this.tags = new LinkedHashSet(tagsArg);\n }\n return this;\n }\n\n /**\n *\n * @param filtersArg\n * @return\n */\n public Builder withFilters(Collection<BFilter> filtersArg) {\n if (filtersArg == null) {\n this.filters = new LinkedHashSet(0);\n } else {\n this.filters = new LinkedHashSet(filtersArg);\n }\n return this;\n }\n\n /**\n *\n * @param compTarg\n * @return\n */\n public Builder withComponentType(String compTarg) {\n String compTargLower = compTarg.toLowerCase();\n if (!ComponentType.ACCEPTED.contains(compTargLower)) {\n throw new IllegalArgumentException(String.format(\"'%s' not accepted as a valid component type\", compTarg));\n } else {\n this.component_type = compTargLower;\n }\n return this;\n }\n\n /**\n *\n * @param contTarg\n * @return\n */\n public Builder withContentType(String contTarg) {\n this.content_type = contTarg;\n return this;\n }\n\n /**\n *\n * @param id\n * @return\n */\n public Builder withID(ObjectId id) {\n this.basket_item_id = id;\n return this;\n }\n\n /**\n *\n * @param typeArg\n * @return\n */\n public Builder withType(BasketType typeArg) {\n this.type = typeArg;\n return this;\n }\n\n /**\n *\n * @param typeArg\n * @return\n */\n public Builder withType(String typeArg) throws IllegalArgumentException {\n if (typeArg.equalsIgnoreCase(BasketType.DATASET.getDecl())) {\n this.type = BasketType.DATASET;\n } else if (typeArg.equalsIgnoreCase(BasketType.VISUALISATION.getDecl())) {\n this.type = BasketType.VISUALISATION;\n } else {\n throw new IllegalArgumentException(\"type must be one of \"\n + Arrays.asList(\n new String[]{\n BasketType.DATASET.getDecl(),\n BasketType.VISUALISATION.getDecl()\n }\n ).toString());\n }\n return this;\n }\n\n /**\n *\n * @param isPrivateArg\n * @return\n */\n public Builder withIsPrivate(boolean isPrivateArg) {\n this.isPrivate = isPrivateArg;\n return this;\n }\n\n public BasketItem build() {\n if (this.lang == null || this.lang.trim().isEmpty()) {\n this.lang = \"en\";\n }\n // default is 'private'\n if (this.isPrivate == null) {\n this.isPrivate = Boolean.TRUE;\n }\n // mandatory fields\n if (this.type == null) {\n throw new IllegalArgumentException(\"declare basket type\");\n }\n if (this.content_type == null) {\n throw new IllegalArgumentException(\"declare content type\");\n }\n if (this.component_type == null) {\n throw new IllegalArgumentException(\"declare component type\");\n }\n return new BasketItem(this);\n }\n }\n\n /**\n * basket types: dataset/visualization, 'ALL' is used to override call\n */\n public enum BasketType {\n\n DATASET(\"dataset\"), VISUALISATION(\"visualisation\"), ALL(\"all\");\n private final String type;\n\n private BasketType(String type) {\n this.type = type;\n }\n\n public String getDecl() {\n return type;\n }\n }\n\n public static final String FLD_USERID = \"user_id\";\n public static final String FLD_BASKET_ITEM_ID = \"basket_item_id\";\n public static final String FLD_OBJ_ID = \"_id\";\n public static final String FLD_COMPONENT_PARENT_UUID = \"component_parent_uuid\";\n public static final String FLD_TITLE = \"title\";\n public static final String FLD_TAGS = \"tags\";\n public static final String FLD_FILTERS = \"filters\";\n public static final String FLD_COMPONENT_TYPE = \"component_type\";\n public static final String FLD_CONTENT_TYPE = \"content_type\";\n public static final String FLD_TYPE = \"type\";\n public static final String FLD_IS_PRIVATE = \"is_private\";\n public static final String FLD_LANG = \"lang\";\n\n /**\n * Helper class to serialize as needed in the API\n */\n class BasketItemSerializer implements JsonSerializer<BasketItem> {\n\n @Override\n public JsonElement serialize(BasketItem t, Type type, JsonSerializationContext jsc) {\n final JsonObject jsonObject = new JsonObject();\n jsonObject.addProperty(BasketItem.FLD_USERID, t.getUserID());\n if (t.getBasketItemID() != null) {\n jsonObject.addProperty(BasketItem.FLD_BASKET_ITEM_ID, t.getBasketItemID().toString());\n }\n jsonObject.addProperty(BasketItem.FLD_COMPONENT_PARENT_UUID, t.getComponentParentUUID());\n jsonObject.addProperty(BasketItem.FLD_TITLE, t.getTitle());\n jsonObject.addProperty(BasketItem.FLD_COMPONENT_TYPE, t.getComponentType());\n jsonObject.addProperty(BasketItem.FLD_CONTENT_TYPE, t.getContentType());\n jsonObject.addProperty(BasketItem.FLD_TYPE, t.getType().getDecl());\n jsonObject.addProperty(BasketItem.FLD_IS_PRIVATE, t.isPrivate());\n jsonObject.addProperty(BasketItem.FLD_LANG, t.getLang());\n\n final JsonElement jsonTags = jsc.serialize(t.getTags());\n jsonObject.add(BasketItem.FLD_TAGS, jsonTags);\n\n // add filters\n final JsonArray jsonFilters = new JsonArray();\n for (final BFilter filt : t.getFilters()) {\n final JsonElement jsonfil = filt.toJSONElement();\n jsonFilters.add(jsonfil);\n }\n jsonObject.add(BasketItem.FLD_FILTERS, jsonFilters);\n return jsonObject;\n }\n }\n\n class BasketItemDeserializer implements JsonDeserializer<BasketItem> {\n\n @Override\n public BasketItem deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {\n final JsonObject jsonObject = json.getAsJsonObject();\n // initial\n final String user_id = jsonObject.get(BasketItem.FLD_USERID).getAsString();\n final String component_parent_uuid = jsonObject.get(BasketItem.FLD_COMPONENT_PARENT_UUID).getAsString();\n final String title = jsonObject.get(BasketItem.FLD_TITLE).getAsString();\n // init builder object\n Builder b = new Builder(user_id, component_parent_uuid, title);\n // other\n JsonElement jsonbitemID = jsonObject.get(BasketItem.FLD_OBJ_ID);\n if (jsonbitemID != null) {\n ObjectId id = new ObjectId(jsonbitemID.getAsString());\n b = b.withID(id);\n }\n // tags\n final JsonArray jsonTags = jsonObject.get(BasketItem.FLD_TAGS).getAsJsonArray();\n final List<String> lTags = new ArrayList(jsonTags.size());\n for (int i = 0; i < jsonTags.size(); i++) {\n final JsonElement jsonTag = jsonTags.get(i);\n lTags.add(jsonTag.getAsString());\n }\n // add tags\n b = b.withTags(lTags);\n // filters\n final JsonArray jsonFilters = jsonObject.get(BasketItem.FLD_FILTERS).getAsJsonArray();\n final List<BFilter> lFilters = new ArrayList(jsonFilters.size());\n for (int i = 0; i < jsonFilters.size(); i++) {\n final JsonElement jsonFilt = jsonFilters.get(i);\n BFilter bf = new Gson().fromJson(jsonFilt, BFilter.class);\n lFilters.add(bf);\n }\n // add filters \n b = b.withFilters(lFilters);\n // add rest items\n final String component_type = jsonObject.get(BasketItem.FLD_COMPONENT_TYPE).getAsString();\n final String content_type = jsonObject.get(BasketItem.FLD_CONTENT_TYPE).getAsString();\n final String type = jsonObject.get(BasketItem.FLD_TYPE).getAsString();\n final boolean isPrivate = jsonObject.get(BasketItem.FLD_IS_PRIVATE).getAsBoolean();\n final String lang = jsonObject.get(BasketItem.FLD_LANG).getAsString();\n\n b = b.withComponentType(component_type)\n .withContentType(content_type)\n .withType(type)\n .withIsPrivate(isPrivate)\n .withLang(lang);\n\n return b.build();\n }\n }\n}\n", "meta": {"content_hash": "ff8352d76a1d05d222bfa1cf7aa871a5", "timestamp": "", "source": "github", "line_count": 479, "max_line_length": 133, "avg_line_length": 33.292275574112736, "alnum_prop": 0.5690098451119333, "repo_name": "YourDataStories/components-visualisation", "id": "d6b2924d122ec177734768bbab917638cd5222c2", "size": "15947", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "BackendUtilities/src/main/java/gr/demokritos/iit/ydsapi/model/BasketItem.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "42030"}, {"name": "HTML", "bytes": "353801"}, {"name": "Java", "bytes": "164739"}, {"name": "JavaScript", "bytes": "881627"}]}} +{"text": "#!/usr/bin/env node\n\nvar sys = require('sys')\n\t, fs = require('fs')\n\t, M = require('./Mustache')\n\t, compressor = require('node-minify');\n\nvar package = require('../package.json');\nvar code = '';\nvar docs = {};\n\ndocs.main = '';\ndocs.API = '';\ndocs.copyrightYear = new Date().getFullYear();\n\n// read in the the main.js file as our main boilerplate code\ncode += fs.readFileSync('./main.js', encoding = 'utf8');\ncode = M.Mustache.to_html(code, {'today': new Date().getTime(), 'version': package.version});\n\ndocs.main += fs.readFileSync('./docs.js', encoding = 'utf8');\n\n// parse entire lib directory and concat it into one file for the browser\nvar lib = paths('./lib');\n\nvar faker = require('../index');\n\n// generate bundle for code on the browser\nfor (var module in faker) {\n\tcode += ( '\\n' + 'faker.' + module + ' = {};');\n\tfor (var method in faker[module]) {\n\t\tcode += ( '\\n' + 'faker.' + module);\n\t\tcode += ( '.' + method + ' = ');\n\n\t\t// serialize arrays as JSON, otherwise use simple string conversion\n\t\tvar methodValue = faker[module][method];\n\t\tif (Array.isArray(methodValue)) {\n\t\t\tcode += JSON.stringify(methodValue) + ';\\n';\n\t\t} else {\n\t\t\tcode += (methodValue.toString() + ';\\n');\n\t\t}\n\t}\n}\n\n// generate nice tree of api for docs\ndocs.API += '<ul>';\nfor (var module in faker) {\n\tdocs.API += '<li>' + module;\n\tdocs.API += '<ul>';\n\tfor (var method in faker[module]) {\n\t\tdocs.API += '<li>' + method + '</li>';\n\t}\n\tdocs.API += '</ul>';\n\tdocs.API += '</li>';\n}\ndocs.API += '</ul>';\n\n// definitions hack\ncode += 'var definitions = faker.definitions;\\n';\ncode += 'var Helpers = faker.Helpers;\\n';\n\n// if we are running in a CommonJS env, export everything out\ncode +=[\"\\nif (typeof define == 'function'){\",\n\" define(function(){\",\n\"\t\treturn faker;\",\n\" });\",\n\"}\",\n\"else if(typeof module !== 'undefined' && module.exports) {\",\n\"\tmodule.exports = faker;\",\n\"}\",\n\"else {\",\n\"\twindow.faker = faker;\",\n\"}\",\n\"\",\n\"}()); // end faker closure\"].join('\\n');\n\n// generate core library\nfs.writeFile('../faker.js', code, function() {\n\tsys.puts(\"faker.js generated successfully!\");\n});\n\n// generate example js file as well\nfs.writeFile('../examples/js/faker.js', code, function() {\n\tsys.puts(\"faker.js generated successfully!\");\n});\n\nvar docOutput = M.Mustache.to_html(docs.main, {\"API\": docs.API, \"copyrightYear\": docs.copyrightYear});\n\n// generate some samples sets (move this code to another section)\nfs.writeFile('../Readme.md', docOutput, function() {\n\tsys.puts(\"Docs generated successfully!\");\n});\n\n// generates minified version Using Google Closure\nnew compressor.minify({\n type: 'gcc',\n fileIn: '../faker.js',\n fileOut: '../minfaker.js',\n callback: function(err){\n\t\t\tif(err) {\n console.log(err);\n }\n else sys.puts(\"Minified version generated successfully!\");\n }\n});\n\n\n/*********************** BUILD HELPER METHODS *********************/\n\n\t// Recursively traverse a hierarchy, returning a list of all relevant .js files.\nfunction paths(dir) {\n\tvar paths = [];\n\n\ttry {\n\t\tfs.statSync(dir);\n\t}\n\tcatch (e) {\n\t\treturn e;\n\t}\n\n\t(function traverse(dir, stack) {\n\t\tstack.push(dir);\n\t\tfs.readdirSync(stack.join('/')).forEach(function(file) {\n\t\t\tvar path = stack.concat([file]).join('/'),\n\t\t\t\tstat = fs.statSync(path);\n\n\t\t\tif (file[0] == '.' || file === 'vendor') {\n\t\t\t\treturn;\n\t\t\t} else if (stat.isFile() && /\\.js$/.test(file)) {\n\t\t\t\tpaths.push(path);\n\t\t\t} else if (stat.isDirectory()) {\n\t\t\t\tpaths.push(path);\n\t\t\t\ttraverse(file, stack);\n\t\t\t}\n\t\t});\n\t\tstack.pop();\n\t})(dir || '.', []);\n\n\treturn paths;\n}\n", "meta": {"content_hash": "76dc6e97bafea63b4e7ab27aa325fcb2", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 102, "avg_line_length": 25.280575539568346, "alnum_prop": 0.601593625498008, "repo_name": "kentcdodds/kcd-angular", "id": "08a408fea1ded05047142521e3df8106504dd89e", "size": "3514", "binary": false, "copies": "4", "ref": "refs/heads/main", "path": "resources/bower_components/Faker/BUILD/BUILD.js", "mode": "33261", "license": "mit", "language": [{"name": "CSS", "bytes": "9738"}, {"name": "HTML", "bytes": "37638"}, {"name": "JavaScript", "bytes": "37691"}]}} +{"text": "class GroupList\n{\npublic:\n\tGroupList(void);\n\t~GroupList(void);\n\t\n\tGroupData *AddGroup(const char *name);\n\tvoid RemoveGroup(GroupData *data);\n\tbool HasGroup(const char *item);\n\n\tGroupData *FindGroup(const char *name);\n\n\tGroupItem *ItemForGroup(const char *name);\n\tGroupItem *ItemForGroup(GroupData *data);\n};\n\n#endif", "meta": {"content_hash": "8e7fe41f8a29b2686eb7e0795e42f2fe", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 43, "avg_line_length": 18.529411764705884, "alnum_prop": 0.7396825396825397, "repo_name": "HaikuArchives/MrPeeps", "id": "b439962109fd869b64676a5cf89d1db7822481ae", "size": "402", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/GroupList.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "9728"}, {"name": "C++", "bytes": "245568"}, {"name": "Makefile", "bytes": "5308"}]}} +{"text": "package org.cgfalcon.myprolang.antlr.graphics;// Generated from Graphics.g4 by ANTLR 4.1\nimport org.antlr.v4.runtime.misc.NotNull;\nimport org.antlr.v4.runtime.tree.ParseTreeListener;\n\n/**\n * This interface defines a complete listener for a parse tree produced by\n * {@link GraphicsParser}.\n */\npublic interface GraphicsListener extends ParseTreeListener {\n\t/**\n\t * Enter a parse tree produced by {@link GraphicsParser#point}.\n\t * @param ctx the parse tree\n\t */\n\tvoid enterPoint(@NotNull GraphicsParser.PointContext ctx);\n\t/**\n\t * Exit a parse tree produced by {@link GraphicsParser#point}.\n\t * @param ctx the parse tree\n\t */\n\tvoid exitPoint(@NotNull GraphicsParser.PointContext ctx);\n\n\t/**\n\t * Enter a parse tree produced by {@link GraphicsParser#file}.\n\t * @param ctx the parse tree\n\t */\n\tvoid enterFile(@NotNull GraphicsParser.FileContext ctx);\n\t/**\n\t * Exit a parse tree produced by {@link GraphicsParser#file}.\n\t * @param ctx the parse tree\n\t */\n\tvoid exitFile(@NotNull GraphicsParser.FileContext ctx);\n\n\t/**\n\t * Enter a parse tree produced by {@link GraphicsParser#command}.\n\t * @param ctx the parse tree\n\t */\n\tvoid enterCommand(@NotNull GraphicsParser.CommandContext ctx);\n\t/**\n\t * Exit a parse tree produced by {@link GraphicsParser#command}.\n\t * @param ctx the parse tree\n\t */\n\tvoid exitCommand(@NotNull GraphicsParser.CommandContext ctx);\n}", "meta": {"content_hash": "87223a5ec1d56c43446b988da0d71696", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 88, "avg_line_length": 32.11904761904762, "alnum_prop": 0.7346182357301705, "repo_name": "cgfalcon/myprolang", "id": "aafe2f0572f6db9325e9b005570456535f134cc4", "size": "1349", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/cgfalcon/myprolang/antlr/graphics/GraphicsListener.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ANTLR", "bytes": "385"}, {"name": "Java", "bytes": "30673"}]}} +{"text": "<#\n Suppress PSAvoidUsingConvertToSecureStringWithPlainText since SecureString\n objects are used for test passwords.\n#>\n[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]\nparam ()\n\n$testJobPrefix = 'MsiPackageTestJob'\n\n<#\n .SYNOPSIS\n Tests if the package with the given Id is installed.\n\n .PARAMETER ProductId\n The ID of the package to test for.\n#>\nfunction Test-PackageInstalledById\n{\n [OutputType([System.Boolean])]\n [CmdletBinding()]\n param\n (\n [Parameter()]\n [System.String]\n $ProductId\n )\n\n $uninstallRegistryKey = 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall'\n $uninstallRegistryKeyWow64 = 'HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall'\n\n $productEntry = $null\n\n if (-not [System.String]::IsNullOrEmpty($ProductId))\n {\n $productEntryKeyLocation = Join-Path -Path $uninstallRegistryKey -ChildPath $ProductId\n $productEntry = Get-Item -Path $productEntryKeyLocation -ErrorAction 'SilentlyContinue'\n\n if ($null -eq $productEntry)\n {\n $productEntryKeyLocation = Join-Path -Path $uninstallRegistryKeyWow64 -ChildPath $ProductId\n $productEntry = Get-Item $productEntryKeyLocation -ErrorAction 'SilentlyContinue'\n }\n }\n\n return ($null -ne $productEntry)\n}\n\n<#\n .SYNOPSIS\n Starts a simple mock http or https file server. Server will stay on and continue to be able\n to receive requests until the client calls Stop-Server. The server returns the job object\n and an EventWaitHandle object that the client will need to dispose of (by calling Stop-Server)\n once it is done sending requests.\n\n .PARAMETER FilePath\n The path to the file to add on to the mock file server. Should be an MSI file.\n\n .PARAMETER LogPath\n The path to the log file to write output to. This is important for debugging since\n most of the work of this function is done within a separate process. Default value\n will be in PSScriptRoot.\n\n .PARAMETER Https\n Indicates whether the server should use Https. If True then the file server will use Https\n and listen on port 'https://localhost:HttpsPort'. Otherwise the file server will use Http and\n listen on port 'http://localhost:HttpPort'\n Default value is False (Http).\n\n .PARAMETER HttpPort\n Specifies the TCP port to register an Http based HttpListener on.\n\n .PARAMETER HttspPort\n Specifies the TCP port to register an Https based HttpListener on.\n#>\nfunction Start-Server\n{\n [OutputType([System.Collections.Hashtable])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [System.String]\n $FilePath,\n\n [Parameter()]\n [System.String]\n $LogPath = (Join-Path -Path $PSScriptRoot -ChildPath 'PackageTestLogFile.txt'),\n\n [Parameter()]\n [System.Boolean]\n $Https = $false,\n\n [Parameter(Mandatory = $true)]\n [ValidateScript({$_ -gt 0})]\n [System.UInt16]\n $HttpPort,\n\n [Parameter(Mandatory = $true)]\n [ValidateScript({$_ -gt 0})]\n [System.UInt16]\n $HttpsPort\n )\n\n # Create an event object to let the client know when the server is ready to begin receiving requests.\n $fileServerStarted = New-Object -TypeName 'System.Threading.EventWaitHandle' -ArgumentList @($false, [System.Threading.EventResetMode]::ManualReset,\n 'HttpIntegrationTest.FileServerStarted')\n $null = $fileServerStarted.Reset()\n\n <#\n The server is run on a separate process so that it can receive requests\n while the tests continue to run. It takes in the same parameterss that are passed\n in to this function. All helper functions that the server uses have to be\n defined within the scope of this script.\n #>\n $server =\n {\n param (\n [Parameter()]\n $FilePath,\n\n [Parameter()]\n $LogPath,\n\n [Parameter()]\n $Https,\n\n [Parameter()]\n $HttpPort,\n\n [Parameter()]\n $HttpsPort\n )\n\n <#\n .SYNOPSIS\n Stops the listener, removes the SSL binding if applicable, and closes the listener.\n\n .PARAMETER HttpListener\n The listner to stop and close.\n\n .PARAMETER Https\n Indicates whether https was used and if so, removes the SSL binding.\n\n .PARAMETER HttspPort\n Specifies the TCP port to de-register an Https based HttpListener from.\n #>\n function Stop-Listener\n {\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [System.Net.HttpListener]\n $HttpListener,\n\n [Parameter(Mandatory = $true)]\n [System.Boolean]\n $Https,\n\n [Parameter(Mandatory = $true)]\n [ValidateScript({$_ -gt 0})]\n [System.UInt16]\n $HttpsPort\n )\n\n Write-Log -LogFile $LogPath -Message 'Finished listening for requests. Shutting down HTTP server.'\n\n $ipPort = \"0.0.0.0:$HttpsPort\"\n\n if ($null -eq $HttpListener)\n {\n $errorMessage = 'HttpListener was null when trying to close'\n Write-Log -LogFile $LogPath -Message $errorMessage\n\n if ($Https)\n {\n Invoke-ConsoleCommand -Target $ipPort -Action 'removing SSL certificate binding' -ScriptBlock {\n netsh http delete sslcert ipPort=\"$ipPort\"\n }\n }\n\n throw $errorMessage\n }\n\n if ($HttpListener.IsListening)\n {\n Write-Log -LogFile $LogPath -Message 'HttpListener is about to be stopped'\n $HttpListener.Stop()\n }\n\n if ($Https)\n {\n Write-Log -LogFile $LogPath -Message 'Removing SSL binding'\n # Remove SSL Binding\n Invoke-ConsoleCommand -Target $ipPort -Action 'removing SSL certificate binding' -ScriptBlock {\n netsh http delete sslcert ipPort=\"$ipPort\"\n }\n }\n\n Write-Log -LogFile $LogPath -Message 'Closing listener'\n $HttpListener.Close()\n\n $null = netsh advfirewall set allprofiles state on\n }\n\n <#\n .SYNOPSIS\n Creates and registers an SSL certificate for Https connections.\n\n .PARAMETER HttspPort\n Specifies the TCP port to register an Https based HttpListener on.\n #>\n function Register-Ssl\n {\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateScript({$_ -gt 0})]\n [System.UInt16]\n $HttpsPort\n )\n\n # Create certificate\n $certificate = New-SelfSignedCertificate -CertStoreLocation 'Cert:\\LocalMachine\\My' -DnsName localhost\n Write-Log -LogFile $LogPath -Message 'Created certificate'\n\n $hash = $certificate.Thumbprint\n $certPassword = ConvertTo-SecureString -String 'password12345' -AsPlainText -Force\n $tempPath = 'C:\\certForTesting'\n\n $null = Export-PfxCertificate -Cert $certificate -FilePath $tempPath -Password $certPassword\n $null = Import-PfxCertificate -CertStoreLocation 'Cert:\\LocalMachine\\Root' -FilePath 'C:\\certForTesting' -Password $certPassword\n Remove-Item -Path $tempPath\n\n Write-Log -LogFile $LogPath -Message 'Finished importing certificate into root. About to bind it to port.'\n\n # Use net shell command to directly bind certificate to designated testing port\n $null = netsh http add sslcert ipport=0.0.0.0:$HttpsPort certhash=$hash appid='{833f13c2-319a-4799-9d1a-5b267a0c3593}' clientcertnegotiation=enable\n }\n\n <#\n .SYNOPSIS\n Defines the callback function required for BeginGetContext.\n\n .PARAMETER Callback\n The callback script - in this case the requestListener script defined below.\n #>\n function New-ScriptBlockCallback\n {\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [System.Management.Automation.ScriptBlock]\n $Callback\n )\n\n # Add the CallbackEventBridge type if it's not already defined\n if (-not ('CallbackEventBridge' -as [System.Type]))\n {\n Add-Type @'\n using System;\n\n public sealed class CallbackEventBridge {\n public event AsyncCallback CallbackComplete = delegate { };\n\n private CallbackEventBridge() {}\n\n private void CallbackInternal(IAsyncResult result)\n {\n CallbackComplete(result);\n }\n\n public AsyncCallback Callback\n {\n get { return new AsyncCallback(CallbackInternal); }\n }\n\n public static CallbackEventBridge Create()\n {\n return new CallbackEventBridge();\n }\n }\n'@\n }\n\n $bridge = [CallbackEventBridge]::Create()\n Register-ObjectEvent -InputObject $bridge -EventName 'CallbackComplete' -Action $Callback -MessageData $args > $null\n $bridge.Callback\n\n Write-Log -LogFile $LogPath -Message 'Finished callback function'\n }\n\n <#\n .SYNOPSIS\n Invokes a console command and captures the exit code.\n\n .PARAMETER Target\n Where the command is being executed.\n\n .PARAMETER Action\n A description of the action being performed.\n\n .PARAMETER ScriptBlock\n The code to execute.\n\n #>\n function Invoke-ConsoleCommand\n {\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [System.String]\n $Target,\n\n [Parameter(Mandatory = $true)]\n [System.String]\n $Action,\n\n [Parameter(Mandatory = $true)]\n [System.Management.Automation.ScriptBlock]\n $ScriptBlock\n )\n\n $output = Invoke-Command -ScriptBlock $ScriptBlock\n\n if ($LASTEXITCODE)\n {\n $output = $output -join [Environment]::NewLine\n $message = ('Failed action ''{0}'' on target ''{1}'' (exit code {2}): {3}' -f $Action,$Target,$LASTEXITCODE,$output)\n Write-Error -Message $message\n Write-Log -LogFile $LogPath -Message \"Error from Invoke-ConsoleCommand: $message\"\n }\n else\n {\n $nonNullOutput = $output | Where-Object { $_ -ne $null }\n Write-Log -LogFile $LogPath -Message \"Output from Invoke-ConsoleCommand: $nonNullOutput\"\n }\n }\n\n <#\n .SYNOPSIS\n Writes the specified message to the specified log file.\n Does NOT overwrite what is already written there.\n\n .PARAMETER LogFile\n The path to the file to write to.\n\n .PARAMETER Message\n The message to write to the file.\n #>\n function Write-Log\n {\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [System.String]\n $LogFile,\n\n [Parameter(Mandatory = $true)]\n [System.String]\n $Message\n )\n\n $Message >> $LogFile\n }\n\n # End of function declarations - Beginning of function execution\n\n if ($null -eq (Get-NetFirewallRule -DisplayName 'UnitTestRule' -ErrorAction 'SilentlyContinue'))\n {\n $null = New-NetFirewallRule -DisplayName 'UnitTestRule' -Direction 'Inbound' -Program \"$PSHome\\powershell.exe\" -Authentication 'NotRequired' -Action 'Allow'\n }\n\n $null = netsh advfirewall set allprofiles state off\n\n Write-Log -LogFile $LogPath -Message (Get-Date)\n\n $HttpListener = New-Object 'System.Net.HttpListener'\n $fileServerStarted = $null\n\n try\n {\n # Set up the listener\n if ($Https)\n {\n $HttpListener.Prefixes.Add([Uri] \"https://localhost:$HttpsPort\")\n\n try\n {\n Register-SSL -HttpsPort $HttpsPort\n }\n catch\n {\n $errorMessage = \"Unable to bind SSL certificate to port. Error: $_\"\n Write-Log -LogFile $LogPath -Message $errorMessage\n throw $errorMessage\n }\n\n Write-Log -LogFile $LogPath -Message 'Certificate is registered'\n }\n else\n {\n $HttpListener.Prefixes.Add([Uri] \"http://localhost:$HttpPort\")\n }\n\n Write-Log -LogFile $LogPath -Message 'Finished listener setup - about to start listener'\n\n $HttpListener.Start()\n\n # Cue the tests that the listener is started and can begin receiving requests\n $fileServerStarted = New-Object -TypeName 'System.Threading.EventWaitHandle' `\n -ArgumentList @($false,\n [System.Threading.EventResetMode]::AutoReset,\n 'HttpIntegrationTest.FileServerStarted'\n )\n $fileServerStarted.Set()\n\n Write-Log -LogFile $LogPath -Message 'Listener is started'\n\n <#\n .SYNOPSIS\n Script block called by the callback function for BeginGetContext.\n Ends the current BeginGetContext, copies the response, and calls BeginGetContext again\n to continue receiving requests.\n\n .PARAMETER Result\n th IAsyncResult containing the listener object and path to the MSI file.\n\n #>\n $requestListener =\n {\n [CmdletBinding()]\n param\n (\n [Parameter()]\n [IAsyncResult]\n $Result\n )\n\n Write-Log -LogFile $LogPath -Message 'Starting request listener'\n\n $asyncState = $Result.AsyncState\n [System.Net.HttpListener] $listener = $asyncState.Listener\n $filepath = $asyncState.FilePath\n\n Write-Log -LogFile $LogPath -Message (ConvertTo-Json $asyncState)\n\n # Call EndGetContext to complete the asynchronous operation.\n $context = $listener.EndGetContext($Result)\n\n $response = $null\n\n try\n {\n # Prepare binary buffer for http/https response\n $fileInfo = New-Object -TypeName 'System.IO.FileInfo' -ArgumentList @( $filePath )\n $numBytes = $fileInfo.Length\n $fileStream = New-Object -TypeName 'System.IO.FileStream' -ArgumentList @( $filePath, 'Open' )\n $binaryReader = New-Object -TypeName 'System.IO.BinaryReader' -ArgumentList @( $fileStream )\n [System.Byte[]] $buf = $binaryReader.ReadBytes($numBytes)\n $fileStream.Close()\n\n Write-Log -LogFile $LogPath -Message 'Buffer prepared for response'\n\n $response = $context.Response\n $response.ContentType = 'application/octet-stream'\n $response.ContentLength64 = $buf.Length\n $response.OutputStream.Write($buf, 0, $buf.Length)\n\n Write-Log -LogFile $LogPath -Message 'Response written'\n\n $response.OutputStream.Flush()\n\n # Open the response stream again to receive more requests\n $listener.BeginGetContext((New-ScriptBlockCallback -Callback $requestListener), $asyncState)\n }\n catch\n {\n $errorMessage = \"error writing response: $_\"\n Write-Log -LogFile $LogPath -Message $errorMessage\n throw $errorMessage\n }\n finally\n {\n if ($null -ne $response)\n {\n $response.Dispose()\n }\n }\n }\n\n # Register the request listener scriptblock as the async callback\n $HttpListener.BeginGetContext((New-ScriptBlockCallback -Callback $requestListener), @{\n Listener = $Httplistener\n FilePath = $FilePath\n }) | Out-Null\n Write-Log -LogFile $LogPath -Message 'First BeginGetContext called'\n\n # Ensure that the request listener stays on until the server is done receiving responses - client is responsible for stopping the server.\n while ($true)\n {\n Start-Sleep -Milliseconds 100\n }\n }\n catch\n {\n $errorMessage = \"There were problems setting up the HTTP(s) listener. Error: $_\"\n\n Write-Log -LogFile $LogPath -Message $errorMessage\n\n 'Error Record Info' >> $LogPath\n $_ | ConvertTo-Xml -As String >> $LogPath\n\n 'Exception Info' >> $LogPath\n $_.Exception | ConvertTo-Xml -As String >> $LogPath\n\n 'Running Process Info' >> $LogPath\n Get-Process | Format-List | Out-String >> $LogPath\n\n 'Open TCP Connections Info' >> $LogPath\n Get-NetTCPConnection | Format-List | Out-String >> $LogPath\n\n throw $_\n }\n finally\n {\n if ($fileServerStarted)\n {\n $fileServerStarted.Dispose()\n }\n\n Write-Log -LogFile $LogPath -Message 'Stopping the Server'\n Stop-Listener -HttpListener $HttpListener -Https $Https -HttpsPort $HttpsPort\n }\n }\n\n if ($Https)\n {\n $jobName = $testJobPrefix + 'Https'\n }\n else\n {\n $jobName = $testJobPrefix + 'Http'\n }\n\n $job = Start-Job -ScriptBlock $server -Name $jobName -ArgumentList @( $FilePath, $LogPath, $Https, $HttpPort, $HttpsPort )\n\n # Verify that the job is receivable and does not contain an exception. If it does, re-throw it.\n try\n {\n $null = $job | Receive-Job\n }\n catch\n {\n Write-Error -Message 'Failed to setup HTTP(S) listener for MsiPackage Tests'\n throw $_\n }\n\n <#\n Return the event object so that client knows when it can start sending requests and\n the job object so that the client can stop the job once it is done sending requests.\n #>\n return @{\n FileServerStarted = $fileServerStarted\n Job = $job\n }\n}\n\n<#\n .SYNOPSIS\n Disposes the EventWaitHandle object and stops and removes the job to ensure that proper\n cleanup is done for the listener. If this function is not called after Start-Server then\n the listening port will remain open until the job is stopped or the machine is rebooted.\n\n .PARAMETER FileServerStarted\n The EventWaitHandle object returned by Start-Server to let the client know that it is ready\n to receive requests. The client is responsible for calling this function to ensure that\n this object is disposed of once the client is done sending requests.\n\n .PARAMETER Job\n The job object returned by Start-Server that needs to be stopped so that the server will\n close the listening port.\n#>\nfunction Stop-Server\n{\n [CmdletBinding()]\n param\n (\n [Parameter()]\n [System.Threading.EventWaitHandle]\n $FileServerStarted,\n\n [Parameter()]\n [System.Management.Automation.Job]\n $Job\n )\n\n if ($null -ne $FileServerStarted)\n {\n $FileServerStarted.Dispose()\n }\n\n if ($null -ne $Job)\n {\n Stop-Job -Job $Job\n Remove-Job -Job $Job\n }\n}\n\n<#\n .SYNOPSIS\n Removes any jobs associated with HTTP(S) servers that were created\n for MsiPackage tests.\n#>\nfunction Stop-EveryTestServerInstance\n{\n [CmdletBinding()]\n param ()\n\n Get-Job -Name \"$($testJobPrefix)*\" | Stop-Job\n Get-Job -Name \"$($testJobPrefix)*\" | Remove-Job\n}\n\n<#\n .SYNOPSIS\n Creates a new MSI package for testing.\n\n .PARAMETER DestinationPath\n The path at which to create the test msi file.\n#>\nfunction New-TestMsi\n{\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [System.String]\n $DestinationPath\n )\n\n #region msiContentInBase64\n $msiContentInBase64 = '0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgAEAP7/DAAGAAAAAAAAAAEAAAABAAAAAQA' + `\n 'AAAAAAAAAEAAAAgAAAAEAAAD+////AAAAAAAAAAD/////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP3////+/////v///wYAAAD+////BAAAAP7////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '////////////////////////////////////////////////////////////9SAG8AbwB0ACAARQBuAHQAcgB' + `\n '5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFgAFAP//////////CQAAAIQQ' + `\n 'DAAAAAAAwAAAAAAAAEYAAAAAAAAAAAAAAADwRqG1qh/OAQMAAAAAEwAAAAAAAAUAUwB1AG0AbQBhAHIAeQBJA' + `\n 'G4AZgBvAHIAbQBhAHQAaQBvAG4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAIA////////////////AA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwCAAAAAAAAQEj/P+RD7EHkRaxEMUgAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAgETAAAABAAAAP////8A' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAOAcAAAAAAABASMpBMEOxOztCJkY3QhxCN' + `\n 'EZoRCZCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAACAQsAAAAKAAAA/////w' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYAAAAwAAAAAAAAAEBIykEwQ7E/Ej8oRThCsUE' + `\n 'oSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAIBDAAAAP//////////' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJwAAABgAAAAAAAAAQEjKQflFzkaoQfhFKD8oR' + `\n 'ThCsUEoSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAgD///////////////' + `\n '8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAKgAAAAAAAABASIxE8ERyRGhEN0gAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgACAP//////////////' + `\n '/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACkAAAAMAAAAAAAAAEBIDUM1QuZFckU8SAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAIADgAAAAIAAAD///' + `\n '//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKgAAABIAAAAAAAAAQEgPQuRFeEUoSAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAgD/////////////' + `\n '//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArAAAAEAAAAAAAAABASA9C5EV4RSg7MkSzR' + `\n 'DFC8UU2SAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFgACAQcAAAADAAAA//' + `\n '///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAEAAAAAAAAAEBIUkT2ReRDrzs7QiZ' + `\n 'GN0IcQjRGaEQmQgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAIBBQAAAAEAAAD/' + `\n '////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALQAAAHIAAAAAAAAAQEhSRPZF5EOvPxI/K' + `\n 'EU4QrFBKEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYAAgH///////////' + `\n '////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvAAAAMAAAAAAAAABASBVBeETmQoxE8UH' + `\n 'sRaxEMUgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAACAP//////////' + `\n '/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAEAAAAAAAAAEBIWUXyRGhFN0cAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAIBDwAAAP////' + `\n '//////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMQAAACQAAAAAAAAAQEgbQipD9kU1RwA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAgEQAAAADQAA' + `\n 'AP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAAAADAAAAAAAAABASN5EakXkQShIA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAACAP////////' + `\n '///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADMAAAAgAAAAAAAAAEBIfz9kQS9CNkg' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAIBEQAAAAgA' + `\n 'AAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAACAAAAAAAAAAQEg/O/JDOESxR' + `\n 'QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAgD///////' + `\n '////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1AAAAWAIAAAAAAABASD8/d0VsRGo' + `\n '+skQvSAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAACAP//////' + `\n '/////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAAYAwAAAAAAAEBIPz93RWxEa' + `\n 'jvkRSRIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAIBBgAAAB' + `\n 'IAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAFAaAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////' + `\n '//////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////' + `\n '///////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////' + `\n '////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///' + `\n '////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//' + `\n '/////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//' + `\n '//////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/' + `\n '//////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP' + `\n '///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n '////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'D///////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AP///////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AA////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQA' + `\n 'AAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAD+////CgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEA' + `\n 'AAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAACAAAAAhA' + `\n 'AAAIgAAACMAAAAkAAAAJQAAAP7////+/////v////7////+/////v////7////+////LgAAAP7////+/////v' + `\n '////7////+/////v////7///82AAAANwAAADgAAAA5AAAAOgAAADsAAAA8AAAAPQAAAD4AAAD+////QAAAAEE' + `\n 'AAABCAAAAQwAAAEQAAABFAAAARgAAAEcAAABIAAAASQAAAEoAAABLAAAA/v//////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '/////////////////////////////////////////////////////////////////////////////////////' + `\n '///////////////////7/AAAGAQIAAAAAAAAAAAAAAAAAAAAAAAEAAADghZ/y+U9oEKuRCAArJ7PZMAAAAAwC' + `\n 'AAAOAAAAAQAAAHgAAAACAAAAgAAAAAMAAACgAAAABAAAAMQAAAAFAAAA9AAAAAYAAAAIAQAABwAAAGwBAAAJA' + `\n 'AAAgAEAAAwAAACwAQAADQAAALwBAAAOAAAAyAEAAA8AAADQAQAAEgAAANgBAAATAAAABAIAAAIAAADkBAAAHg' + `\n 'AAABYAAABJbnN0YWxsYXRpb24gRGF0YWJhc2UAAAAeAAAAGwAAAEEgcGFja2FnZSBmb3IgdW5pdCB0ZXN0aW5' + `\n 'nAAAeAAAAKAAAAE1pY3Jvc29mdCBVbml0IFRlc3RpbmcgR3VpbGQgb2YgQW1lcmljYQAeAAAACgAAAEluc3Rh' + `\n 'bGxlcgAAAB4AAABcAAAAVGhpcyBpbnN0YWxsZXIgZGF0YWJhc2UgY29udGFpbnMgdGhlIGxvZ2ljIGFuZCBkY' + `\n 'XRhIHJlcXVpcmVkIHRvIGluc3RhbGwgRFNDVW5pdFRlc3RQYWNrYWdlLgAeAAAACwAAAEludGVsOzEwMzMAAB' + `\n '4AAAAnAAAAe0YxN0FGREExLUREMEItNDRFNi1CNDczLTlFQkUyREJEOUVBOX0AAEAAAAAAAOO0qh/OAUAAAAA' + `\n 'AAOO0qh/OAQMAAADIAAAAAwAAAAIAAAAeAAAAIwAAAFdpbmRvd3MgSW5zdGFsbGVyIFhNTCAoMy43LjEyMDQu' + `\n 'MCkAAAMAAAACAAAAAAAAAAYABgAGAAYABgAGAAYABgAGAAYACgAKACIAIgAiACkAKQApACoAKgAqACsAKwArA' + `\n 'CsAKwArADEAMQAxAD4APgA+AD4APgA+AD4APgBNAE0AUgBSAFIAUgBSAFIAUgBSAGAAYABgAGEAYQBhAGIAYg' + `\n 'BmAGYAZgBmAGYAZgByAHIAdgB2AHYAdgB2AHYAgACAAIAAgACAAIAAgAACAAUACwAMAA0ADgAPABAAEQASAAc' + `\n 'ACQAjACUAJwAjACUAJwAjACUAJwAlACsALQAwADMANgAxADoAPAALADAAMwA+AEAAQgBFAEcATgBQACcAMwBQ' + `\n 'AFIAVQBYAFoAXAAjACUAJwAjACUAJwALACUAZwBpAGsAbQBvAHEABwByAAEABwBQAHYAeAB6ADMAXACBAIMAh' + `\n 'QCJAIsACAAIABgAGAAYABgAGAAIABgAGAAIAAgACAAYABgACAAYABgACAAYABgAGAAIABgACAAIABgACAAYAA' + `\n 'gAGAAYAAgACAAYABgAGAAIAAgACAAIABgACAAIAAgACAAYABgACAAYABgACAAYABgACAAIAAgACAAYABgAGAA' + `\n 'YAAgACAAYABgACAAIAAgACAAIABgACAAYABgAGAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAgAEAAAAAAAAA' + `\n 'AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAA/P//fwAAAAAAAAAA/P//fwAAAAAAAAAA/P//fwAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAA' + `\n 'ABAACAAAAAgAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAA/P//fwAAAAAAAAAA/P//fwAAAAAAAAA' + `\n 'AAQAAgAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////fwAAAAAAAACAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAACA/////wAAAAAAAAAA/////wAAA' + `\n 'AAAAAAAAAAAAAAAAAD/fwCAAAAAAAAAAAD/fwCAAAAAAAAAAAD/fwCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/38AgP9/AIAAAAAAAAAAAP//////fwCAAAA' + `\n 'AAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAD/fwCAAAAAAAAAAAD/fwCAAAAAAAAAAAD/fwCA/////wAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAACAAAAAAP////8AAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAxAAAANw' + `\n 'AAADEAAAAAADEAAAAAAD4AAAAAAAAAPgArAAAAAAArAAAAAAAAAFIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAArAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAGAAAABgAAAAAABgAAAAAABgAAAAAAAAAGAAYAAAAAAAYAAAAAAA' + `\n 'AABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAB' + `\n 'MAEwAfAB8AAAAAAAAAAAATAAAAAAAAABMAJQAAABMAJQAAABMAJQAAACUAEwAuABMAAAATABMAEwA8AB8ASQA' + `\n 'AABMAEwAfAAAAAAATABMAAAAAABMAEwBWAAAAWgBcABMAJQAAABMAJQAAAGQAJQAAAAAAHwBtAB8AcgAfABMA' + `\n 'ZABkABMAEwAAAHsAAABcAC4AHwAfAGQASQAAAAAAAAAAAB0AAAAAABYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAVACEAIAAeABw' + `\n 'AGgAXABsAGQAAAAAAJAAmACgAJAAmACgAJAAmACgANQAsAC8AMgA0ADgAOQA7AD0ARABKAEwAPwBBAEMARgBI' + `\n 'AE8AUQBfAF4AVABTAFcAWQBbAF0AJAAmACgAJAAmACgAZQBjAGgAagBsAG4AcABzAHUAdAB9AH4AfwB3AHkAf' + `\n 'ACIAIcAggCEAIYAigCMAAAAAAAAAAAAjQCOAI8AkACRAJIAkwCUAAAAAAAAAAAAAAAAAAAAAAAgg4SD6IN4hd' + `\n 'yFPI+gj8iZAAAAAAAAAAAAAAAAAAAAAI0AjgCPAJUAAAAAAAAAAAAgg4SD6IMUhQAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACNAI8AkACRAJQAlgCXAAAAAAAAAAAAAAAAAAAAIIPog3iF3IXImZyY' + `\n 'AJkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmACZAJoABIAAAJsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJoAnACeAJwAngAAAJ0AnwCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAChAAAAogAAAAKAAYAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoQCYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI0AjgCPAJAAkQCUAJYAlwCjAKQApQCmAKcAqACpAKoAqwCsAK0AA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgg4SD6IN4hdyFyJmcmACZGYBkgLyCsIRAhg' + `\n 'iHKIqIk3CX1Jd5hQAAAAAAAAAAAAAAAAAAjQCOAI8AlQCjAKQApQCmAAAAAAAAAAAAAAAAAAAAAAAgg4SD6IM' + `\n 'UhRmAZIC8grCEAAAAAAAAAAAAAAAAAAAAAK4ArwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACBALAAsgC0ALYAuAC6AL0AvwC8ALEAswC1ALcAuQC7AL4AwAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmwACgMEAwgDDAJgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwAvAAAALsAuwAAAAAAAAABAACAAgAAgAAAAADEAMUAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGACIAKQAqACsAMQA+AE0AUgBgAGEAYgBmAHIAdgCAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAGAAYABgAGAAYABgAGAAYABgAiACIAIgApACkAKQAqACoAK' + `\n 'gArACsAKwArACsAKwAxADEAMQA+AD4APgA+AD4APgA+AD4ATQBNAFIAUgBSAFIAUgBSAFIAUgBgAGAAYABhAG' + `\n 'EAYQBiAGIAZgBmAGYAZgBmAGYAcgByAHYAdgB2AHYAdgB2AIAAgACAAIAAgACAAIAAAYACgAOABIAFgAaAB4A' + `\n 'IgAmACoABgAKAA4ABgAKAA4ABgAKAA4ABgAKAA4AEgAWABoABgAKAA4ABgAKAA4AEgAWABoAHgAiAAYACgAGA' + `\n 'AoADgASABYAGgAeACIABgAKAA4ABgAKAA4ABgAKAAYACgAOABIAFgAaAAYACgAGAAoADgASABYAGgAGAAoADg' + `\n 'ASABYAGgAeAAgAFABAAEgAPABEADgANAAwACwAjACUAJwAjACUAJwAjACUAJwArAC0AMAAzACUANgAxADoAPA' + `\n 'A+AEAAQgALAEUARwAwADMATgBQAFIAUABVAFgAWgBcADMAJwAjACUAJwAjACUAJwAlAAsAZwBpAGsAbQBvAHE' + `\n 'AcgAHAHYAeAB6AAEABwBQAIEAgwCFAFwAMwCJAIsAIK0grQSNBJEEkf+dApUgnf+d/51Irf+dApVIrf+dApVI' + `\n 'rf+dApVIrSadSI0Chf+dSJ1IrUid/48mrSadQJ//nwKVAoVInQKFJq1IrUitSI3/jwSBSJ0UnQKVBIFIrf+dA' + `\n 'pVIrf+dApX/rf+PAqUEgUCf/50gnUidSK0Aj0itAoX/j/+fAJ9IjSatFL0Uvf+9BKH/nUiNAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAIABQACAAAAAAAAAAAABgACAAsAFQAFAAUAAQA' + `\n 'mAAoAAQATAAIACwAGAAMAAgAIAAIACQACAAgAAgBudGVnZXIgdG8gZGV0ZXJtaW5lIHNvcnQgb3JkZXIgZm9y' + `\n 'IHRhYmxlLkxhc3RTZXF1ZW5jZUZpbGUgc2VxdWVuY2UgbnVtYmVyIGZvciB0aGUgbGFzdCBmaWxlIGZvciB0a' + `\n 'GlzIG1lZGlhLkRpc2tQcm9tcHREaXNrIG5hbWU6IHRoZSB2aXNpYmxlIHRleHQgYWN0dWFsbHkgcHJpbnRlZC' + `\n 'BvbiB0aGUgZGlzay4gIFRoaXMgd2lsbCBiZSB1c2VkIHRvIHByb21wdCB0aGUgdXNlciB3aGVuIHRoaXMgZGl' + `\n 'zayBuZWVkcyB0byBiZSBpbnNlcnRlZC5DYWJpbmV0SWYgc29tZSBvciBhbGwgb2YgdGhlIGZpbGVzIHN0b3Jl' + `\n 'ZCBvbiB0aGUgbWVkaWEgYXJlIGNvbXByZXNzZWQgaW4gYSBjYWJpbmV0LCB0aGUgbmFtZSBvZiB0aGF0IGNhY' + `\n 'mluZXQuVm9sdW1lTGFiZWxUaGUgbGFiZWwgYXR0cmlidXRlZCB0byB0aGUgdm9sdW1lLlNvdXJjZVByb3Blcn' + `\n 'R5VGhlIHByb3BlcnR5IGRlZmluaW5nIHRoZSBsb2NhdGlvbiBvZiB0aGUgY2FiaW5ldCBmaWxlLk5hbWUgb2Y' + `\n 'gcHJvcGVydHksIHVwcGVyY2FzZSBpZiBzZXR0YWJsZSBieSBsYXVuY2hlciBvciBsb2FkZXIuU3RyaW5nIHZh' + `\n 'bHVlIGZvciBwcm9wZXJ0eS4gIE5ldmVyIG51bGwgb3IgZW1wdHkuUmVnaXN0cnlQcmltYXJ5IGtleSwgbm9uL' + `\n 'WxvY2FsaXplZCB0b2tlbi5Sb290VGhlIHByZWRlZmluZWQgcm9vdCBrZXkgZm9yIHRoZSByZWdpc3RyeSB2YW' + `\n 'x1ZSwgb25lIG9mIHJya0VudW0uS2V5UmVnUGF0aFRoZSBrZXkgZm9yIHRoZSByZWdpc3RyeSB2YWx1ZS5UaGU' + `\n 'gcmVnaXN0cnkgdmFsdWUgbmFtZS5UaGUgcmVnaXN0cnkgdmFsdWUuRm9yZWlnbiBrZXkgaW50byB0aGUgQ29t' + `\n 'cG9uZW50IHRhYmxlIHJlZmVyZW5jaW5nIGNvbXBvbmVudCB0aGF0IGNvbnRyb2xzIHRoZSBpbnN0YWxsaW5nI' + `\n 'G9mIHRoZSByZWdpc3RyeSB2YWx1ZS5VcGdyYWRlVXBncmFkZUNvZGVUaGUgVXBncmFkZUNvZGUgR1VJRCBiZW' + `\n 'xvbmdpbmcgdG8gdGhlIHByb2R1Y3RzIGluIHRoaXMgc2V0LlZlcnNpb25NaW5UaGUgbWluaW11bSBQcm9kdWN' + `\n '0VmVyc2lvbiBvZiB0aGUgcHJvZHVjdHMgaW4gdGhpcyBzZXQuICBUaGUgc2V0IG1heSBvciBtYXkgbm90IGlu' + `\n 'Y2x1ZGUgcHJvZHVjdHMgd2l0aCB0aGlzIHBhcnRpY3VsYXIgdmVyc2lvbi5WZXJzaW9uTWF4VGhlIG1heGltd' + `\n 'W0gUHJvZHVjdFZlcnNpb24gb2YgdGhlIHByb2R1Y3RzIGluIHRoaXMgc2V0LiAgVGhlIHNldCBtYXkgb3IgbW' + `\n 'F5IG5vdCBpbmNsdWRlIHByb2R1Y3RzIHdpdGggdGhpcyBwYXJ0aWN1bGFyIHZlcnNpb24uQSBjb21tYS1zZXB' + `\n 'hcmF0ZWQgbGlzdCBvZiBsYW5ndWFnZXMgZm9yIGVpdGhlciBwcm9kdWN0cyBpbiB0aGlzIHNldCBvciBwcm9k' + `\n 'dWN0cyBub3QgaW4gdGhpcyBzZXQuVGhlIGF0dHJpYnV0ZXMgb2YgdGhpcyBwcm9kdWN0IHNldC5SZW1vdmVUa' + `\n 'GUgbGlzdCBvZiBmZWF0dXJlcyB0byByZW1vdmUgd2hlbiB1bmluc3RhbGxpbmcgYSBwcm9kdWN0IGZyb20gdG' + `\n 'hpcyBzZXQuICBUaGUgZGVmYXVsdCBpcyAiQUxMIi5BY3Rpb25Qcm9wZXJ0eVRoZSBwcm9wZXJ0eSB0byBzZXQ' + `\n 'gd2hlbiBhIHByb2R1Y3QgaW4gdGhpcyBzZXQgaXMgZm91bmQuQ29zdEluaXRpYWxpemVGaWxlQ29zdENvc3RG' + `\n 'aW5hbGl6ZUluc3RhbGxWYWxpZGF0ZUluc3RhbGxJbml0aWFsaXplSW5zdGFsbEFkbWluUGFja2FnZUluc3Rhb' + `\n 'GxGaWxlc0luc3RhbGxGaW5hbGl6ZUV4ZWN1dGVBY3Rpb25QdWJsaXNoRmVhdHVyZXNQdWJsaXNoUHJvZHVjdF' + `\n 'Byb2R1Y3RDb21wb25lbnR7OTg5QjBFRDgtREVBRC01MjhELUI4RTMtN0NBRTQxODYyNEQ1fUlOU1RBTExGT0x' + `\n 'ERVJEdW1teUZsYWdWYWx1ZVByb2dyYW1GaWxlc0ZvbGRlcnE0cGZqNHo3fERTQ1NldHVwUHJvamVjdFRBUkdF' + `\n 'VERJUi5Tb3VyY2VEaXJQcm9kdWN0RmVhdHVyZURTQ1NldHVwUHJvamVjdEZpbmRSZWxhdGVkUHJvZHVjdHNMY' + `\n 'XVuY2hDb25kaXRpb25zVmFsaWRhdGVQcm9kdWN0SURNaWdyYXRlRmVhdHVyZVN0YXRlc1Byb2Nlc3NDb21wb2' + `\n '5lbnRzVW5wdWJsaXNoRmVhdHVyZXNSZW1vdmVSZWdpc3RyeVZhbHVlc1dyaXRlUmVnaXN0cnlWYWx1ZXNSZWd' + `\n 'pc3RlclVzZXJSZWdpc3RlclByb2R1Y3RSZW1vdmVFeGlzdGluZ1Byb2R1Y3RzTk9UIFdJWF9ET1dOR1JBREVf' + `\n 'REVURUNURURBIG5ld2VyIHZlcnNpb24gb2YgW1Byb2R1Y3ROYW1lXSBpcyBhbHJlYWR5IGluc3RhbGxlZC5BT' + `\n 'ExVU0VSUzFNYW51ZmFjdHVyZXJNaWNyb3NvZnQgVW5pdCBUZXN0aW5nIEd1aWxkIG9mIEFtZXJpY2FQcm9kdW' + `\n 'N0Q29kZXtERUFEQkVFRi04MEM2LTQxRTYtQTFCOS04QkRCOEEwNTAyN0Z9UHJvZHVjdExhbmd1YWdlMTAzM1B' + `\n 'yb2R1Y3ROYW1lRFNDVW5pdFRlc3RQYWNrYWdlUHJvZHVjdFZlcnNpb24xLjIuMy40ezgzQkMzNzkyLTgwQzYt' + `\n 'NDFFNi1BMUI5LThCREI4QTA1MDI3Rn1TZWN1cmVDdXN0b21Qcm9wZXJ0aWVzV0lYX0RPV05HUkFERV9ERVRFQ' + `\n '1RFRDtXSVhfVVBHUkFERV9ERVRFQ1RFRFdpeFBkYlBhdGhDOlxVc2Vyc1xiZWNhcnJcRG9jdW1lbnRzXFZpc3' + `\n 'VhbCBTdHVkaW8gMjAxMFxQcm9qZWN0c1xEU0NTZXR1cFByb2plY3RcRFNDU2V0dXBQcm9qZWN0XGJpblxEZWJ' + `\n '1Z1xEU0NTZXR1cFByb2plY3Qud2l4cGRiU29mdHdhcmVcRFNDVGVzdERlYnVnRW50cnlbfl1EVU1NWUZMQUc9' + `\n 'W0RVTU1ZRkxBR11bfl1XSVhfVVBHUkFERV9ERVRFQ1RFRFdJWF9ET1dOR1JBREVfREVURUNURURzZWQgdG8gZ' + `\n 'm9yY2UgYSBzcGVjaWZpYyBkaXNwbGF5IG9yZGVyaW5nLkxldmVsVGhlIGluc3RhbGwgbGV2ZWwgYXQgd2hpY2' + `\n 'ggcmVjb3JkIHdpbGwgYmUgaW5pdGlhbGx5IHNlbGVjdGVkLiBBbiBpbnN0YWxsIGxldmVsIG9mIDAgd2lsbCB' + `\n 'kaXNhYmxlIGFuIGl0ZW0gYW5kIHByZXZlbnQgaXRzIGRpc3BsYXkuVXBwZXJDYXNlVGhlIG5hbWUgb2YgdGhl' + `\n 'IERpcmVjdG9yeSB0aGF0IGNhbiBiZSBjb25maWd1cmVkIGJ5IHRoZSBVSS4gQSBub24tbnVsbCB2YWx1ZSB3a' + `\n 'WxsIGVuYWJsZSB0aGUgYnJvd3NlIGJ1dHRvbi4wOzE7Mjs0OzU7Njs4Ozk7MTA7MTY7MTc7MTg7MjA7MjE7Mj' + `\n 'I7MjQ7MjU7MjY7MzI7MzM7MzQ7MzY7Mzc7Mzg7NDg7NDk7NTA7NTI7NQAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATmFtZVRhYmxlQ29sdW1uX1Zh' + `\n 'bGlkYXRpb25WYWx1ZU5Qcm9wZXJ0eUlkX1N1bW1hcnlJbmZvcm1hdGlvbkRlc2NyaXB0aW9uU2V0Q2F0ZWdvc' + `\n 'nlLZXlDb2x1bW5NYXhWYWx1ZU51bGxhYmxlS2V5VGFibGVNaW5WYWx1ZUlkZW50aWZpZXJOYW1lIG9mIHRhYm' + `\n 'xlTmFtZSBvZiBjb2x1bW5ZO05XaGV0aGVyIHRoZSBjb2x1bW4gaXMgbnVsbGFibGVZTWluaW11bSB2YWx1ZSB' + `\n 'hbGxvd2VkTWF4aW11bSB2YWx1ZSBhbGxvd2VkRm9yIGZvcmVpZ24ga2V5LCBOYW1lIG9mIHRhYmxlIHRvIHdo' + `\n 'aWNoIGRhdGEgbXVzdCBsaW5rQ29sdW1uIHRvIHdoaWNoIGZvcmVpZ24ga2V5IGNvbm5lY3RzVGV4dDtGb3JtY' + `\n 'XR0ZWQ7VGVtcGxhdGU7Q29uZGl0aW9uO0d1aWQ7UGF0aDtWZXJzaW9uO0xhbmd1YWdlO0lkZW50aWZpZXI7Qm' + `\n 'luYXJ5O1VwcGVyQ2FzZTtMb3dlckNhc2U7RmlsZW5hbWU7UGF0aHM7QW55UGF0aDtXaWxkQ2FyZEZpbGVuYW1' + `\n 'lO1JlZ1BhdGg7Q3VzdG9tU291cmNlO1Byb3BlcnR5O0NhYmluZXQ7U2hvcnRjdXQ7Rm9ybWF0dGVkU0RETFRl' + `\n 'eHQ7SW50ZWdlcjtEb3VibGVJbnRlZ2VyO1RpbWVEYXRlO0RlZmF1bHREaXJTdHJpbmcgY2F0ZWdvcnlUZXh0U' + `\n '2V0IG9mIHZhbHVlcyB0aGF0IGFyZSBwZXJtaXR0ZWREZXNjcmlwdGlvbiBvZiBjb2x1bW5BZG1pbkV4ZWN1dG' + `\n 'VTZXF1ZW5jZUFjdGlvbk5hbWUgb2YgYWN0aW9uIHRvIGludm9rZSwgZWl0aGVyIGluIHRoZSBlbmdpbmUgb3I' + `\n 'gdGhlIGhhbmRsZXIgRExMLkNvbmRpdGlvbk9wdGlvbmFsIGV4cHJlc3Npb24gd2hpY2ggc2tpcHMgdGhlIGFj' + `\n 'dGlvbiBpZiBldmFsdWF0ZXMgdG8gZXhwRmFsc2UuSWYgdGhlIGV4cHJlc3Npb24gc3ludGF4IGlzIGludmFsa' + `\n 'WQsIHRoZSBlbmdpbmUgd2lsbCB0ZXJtaW5hdGUsIHJldHVybmluZyBpZXNCYWRBY3Rpb25EYXRhLlNlcXVlbm' + `\n 'NlTnVtYmVyIHRoYXQgZGV0ZXJtaW5lcyB0aGUgc29ydCBvcmRlciBpbiB3aGljaCB0aGUgYWN0aW9ucyBhcmU' + `\n 'gdG8gYmUgZXhlY3V0ZWQuICBMZWF2ZSBibGFuayB0byBzdXBwcmVzcyBhY3Rpb24uQWRtaW5VSVNlcXVlbmNl' + `\n 'QWR2dEV4ZWN1dGVTZXF1ZW5jZUNvbXBvbmVudFByaW1hcnkga2V5IHVzZWQgdG8gaWRlbnRpZnkgYSBwYXJ0a' + `\n 'WN1bGFyIGNvbXBvbmVudCByZWNvcmQuQ29tcG9uZW50SWRHdWlkQSBzdHJpbmcgR1VJRCB1bmlxdWUgdG8gdG' + `\n 'hpcyBjb21wb25lbnQsIHZlcnNpb24sIGFuZCBsYW5ndWFnZS5EaXJlY3RvcnlfRGlyZWN0b3J5UmVxdWlyZWQ' + `\n 'ga2V5IG9mIGEgRGlyZWN0b3J5IHRhYmxlIHJlY29yZC4gVGhpcyBpcyBhY3R1YWxseSBhIHByb3BlcnR5IG5h' + `\n 'bWUgd2hvc2UgdmFsdWUgY29udGFpbnMgdGhlIGFjdHVhbCBwYXRoLCBzZXQgZWl0aGVyIGJ5IHRoZSBBcHBTZ' + `\n 'WFyY2ggYWN0aW9uIG9yIHdpdGggdGhlIGRlZmF1bHQgc2V0dGluZyBvYnRhaW5lZCBmcm9tIHRoZSBEaXJlY3' + `\n 'RvcnkgdGFibGUuQXR0cmlidXRlc1JlbW90ZSBleGVjdXRpb24gb3B0aW9uLCBvbmUgb2YgaXJzRW51bUEgY29' + `\n 'uZGl0aW9uYWwgc3RhdGVtZW50IHRoYXQgd2lsbCBkaXNhYmxlIHRoaXMgY29tcG9uZW50IGlmIHRoZSBzcGVj' + `\n 'aWZpZWQgY29uZGl0aW9uIGV2YWx1YXRlcyB0byB0aGUgJ1RydWUnIHN0YXRlLiBJZiBhIGNvbXBvbmVudCBpc' + `\n 'yBkaXNhYmxlZCwgaXQgd2lsbCBub3QgYmUgaW5zdGFsbGVkLCByZWdhcmRsZXNzIG9mIHRoZSAnQWN0aW9uJy' + `\n 'BzdGF0ZSBhc3NvY2lhdGVkIHdpdGggdGhlIGNvbXBvbmVudC5LZXlQYXRoRmlsZTtSZWdpc3RyeTtPREJDRGF' + `\n '0YVNvdXJjZUVpdGhlciB0aGUgcHJpbWFyeSBrZXkgaW50byB0aGUgRmlsZSB0YWJsZSwgUmVnaXN0cnkgdGFi' + `\n 'bGUsIG9yIE9EQkNEYXRhU291cmNlIHRhYmxlLiBUaGlzIGV4dHJhY3QgcGF0aCBpcyBzdG9yZWQgd2hlbiB0a' + `\n 'GUgY29tcG9uZW50IGlzIGluc3RhbGxlZCwgYW5kIGlzIHVzZWQgdG8gZGV0ZWN0IHRoZSBwcmVzZW5jZSBvZi' + `\n 'B0aGUgY29tcG9uZW50IGFuZCB0byByZXR1cm4gdGhlIHBhdGggdG8gaXQuVW5pcXVlIGlkZW50aWZpZXIgZm9' + `\n 'yIGRpcmVjdG9yeSBlbnRyeSwgcHJpbWFyeSBrZXkuIElmIGEgcHJvcGVydHkgYnkgdGhpcyBuYW1lIGlzIGRl' + `\n 'ZmluZWQsIGl0IGNvbnRhaW5zIHRoZSBmdWxsIHBhdGggdG8gdGhlIGRpcmVjdG9yeS5EaXJlY3RvcnlfUGFyZ' + `\n 'W50UmVmZXJlbmNlIHRvIHRoZSBlbnRyeSBpbiB0aGlzIHRhYmxlIHNwZWNpZnlpbmcgdGhlIGRlZmF1bHQgcG' + `\n 'FyZW50IGRpcmVjdG9yeS4gQSByZWNvcmQgcGFyZW50ZWQgdG8gaXRzZWxmIG9yIHdpdGggYSBOdWxsIHBhcmV' + `\n 'udCByZXByZXNlbnRzIGEgcm9vdCBvZiB0aGUgaW5zdGFsbCB0cmVlLkRlZmF1bHREaXJUaGUgZGVmYXVsdCBz' + `\n 'dWItcGF0aCB1bmRlciBwYXJlbnQncyBwYXRoLkZlYXR1cmVQcmltYXJ5IGtleSB1c2VkIHRvIGlkZW50aWZ5I' + `\n 'GEgcGFydGljdWxhciBmZWF0dXJlIHJlY29yZC5GZWF0dXJlX1BhcmVudE9wdGlvbmFsIGtleSBvZiBhIHBhcm' + `\n 'VudCByZWNvcmQgaW4gdGhlIHNhbWUgdGFibGUuIElmIHRoZSBwYXJlbnQgaXMgbm90IHNlbGVjdGVkLCB0aGV' + `\n 'uIHRoZSByZWNvcmQgd2lsbCBub3QgYmUgaW5zdGFsbGVkLiBOdWxsIGluZGljYXRlcyBhIHJvb3QgaXRlbS5U' + `\n 'aXRsZVNob3J0IHRleHQgaWRlbnRpZnlpbmcgYSB2aXNpYmxlIGZlYXR1cmUgaXRlbS5Mb25nZXIgZGVzY3Jpc' + `\n 'HRpdmUgdGV4dCBkZXNjcmliaW5nIGEgdmlzaWJsZSBmZWF0dXJlIGl0ZW0uRGlzcGxheU51bWVyaWMgc29ydC' + `\n 'BvcmRlciwgdXNlZCB0byBmb3JjZSBhIHNwZWNpZmljIGRpc3BsYXkgb3JkZXJpbmcuTGV2ZWxUaGUgaW5zdGF' + `\n 'sbCBsZXZlbCBhdCB3aGljaCByZWNvcmQgd2lsbCBiZSBpbml0aWFsbHkgc2VsZWN0ZWQuIEFuIGluc3RhbGwg' + `\n 'bGV2ZWwgb2YgMCB3aWxsIGRpc2FibGUgYW4gaXRlbSBhbmQgcHJldmVudCBpdHMgZGlzcGxheS5VcHBlckNhc' + `\n '2VUaGUgbmFtZSBvZiB0aGUgRGlyZWN0b3J5IHRoYXQgY2FuIGJlIGNvbmZpZ3VyZWQgYnkgdGhlIFVJLiBBIG' + `\n '5vbi1udWxsIHZhbHVlIHdpbGwgZW5hYmxlIHRoZSBicm93c2UgYnV0dG9uLjA7MTsyOzQ7NTs2Ozg7OTsxMDs' + `\n 'xNjsxNzsxODsyMDsyMTsyMjsyNDsyNTsyNjszMjszMzszNDszNjszNzszODs0ODs0OTs1MDs1Mjs1Mzs1NEZl' + `\n 'YXR1cmUgYXR0cmlidXRlc0ZlYXR1cmVDb21wb25lbnRzRmVhdHVyZV9Gb3JlaWduIGtleSBpbnRvIEZlYXR1c' + `\n 'mUgdGFibGUuQ29tcG9uZW50X0ZvcmVpZ24ga2V5IGludG8gQ29tcG9uZW50IHRhYmxlLkZpbGVQcmltYXJ5IG' + `\n 'tleSwgbm9uLWxvY2FsaXplZCB0b2tlbiwgbXVzdCBtYXRjaCBpZGVudGlmaWVyIGluIGNhYmluZXQuICBGb3I' + `\n 'gdW5jb21wcmVzc2VkIGZpbGVzLCB0aGlzIGZpZWxkIGlzIGlnbm9yZWQuRm9yZWlnbiBrZXkgcmVmZXJlbmNp' + `\n 'bmcgQ29tcG9uZW50IHRoYXQgY29udHJvbHMgdGhlIGZpbGUuRmlsZU5hbWVGaWxlbmFtZUZpbGUgbmFtZSB1c' + `\n '2VkIGZvciBpbnN0YWxsYXRpb24sIG1heSBiZSBsb2NhbGl6ZWQuICBUaGlzIG1heSBjb250YWluIGEgInNob3' + `\n 'J0IG5hbWV8bG9uZyBuYW1lIiBwYWlyLkZpbGVTaXplU2l6ZSBvZiBmaWxlIGluIGJ5dGVzIChsb25nIGludGV' + `\n 'nZXIpLlZlcnNpb25WZXJzaW9uIHN0cmluZyBmb3IgdmVyc2lvbmVkIGZpbGVzOyAgQmxhbmsgZm9yIHVudmVy' + `\n 'c2lvbmVkIGZpbGVzLkxhbmd1YWdlTGlzdCBvZiBkZWNpbWFsIGxhbmd1YWdlIElkcywgY29tbWEtc2VwYXJhd' + `\n 'GVkIGlmIG1vcmUgdGhhbiBvbmUuSW50ZWdlciBjb250YWluaW5nIGJpdCBmbGFncyByZXByZXNlbnRpbmcgZm' + `\n 'lsZSBhdHRyaWJ1dGVzICh3aXRoIHRoZSBkZWNpbWFsIHZhbHVlIG9mIGVhY2ggYml0IHBvc2l0aW9uIGluIHB' + `\n 'hcmVudGhlc2VzKVNlcXVlbmNlIHdpdGggcmVzcGVjdCB0byB0aGUgbWVkaWEgaW1hZ2VzOyBvcmRlciBtdXN0' + `\n 'IHRyYWNrIGNhYmluZXQgb3JkZXIuSW5zdGFsbEV4ZWN1dGVTZXF1ZW5jZUluc3RhbGxVSVNlcXVlbmNlTGF1b' + `\n 'mNoQ29uZGl0aW9uRXhwcmVzc2lvbiB3aGljaCBtdXN0IGV2YWx1YXRlIHRvIFRSVUUgaW4gb3JkZXIgZm9yIG' + `\n 'luc3RhbGwgdG8gY29tbWVuY2UuRm9ybWF0dGVkTG9jYWxpemFibGUgdGV4dCB0byBkaXNwbGF5IHdoZW4gY29' + `\n 'uZGl0aW9uIGZhaWxzIGFuZCBpbnN0YWxsIG11c3QgYWJvcnQuTWVkaWFEaXNrSWRQcmltYXJ5IGtleSwgaQgA' + `\n 'AgAIAAIACAACAAoAFgANAAEADgABAAMAAQAeAAEAAQAnABUAAQAVAAEANgABACQAAQD1AAEADwABAAQACQAgA' + `\n 'AEAFQABABQABwAGAAoAQgAFAAkAFQCfAAUACAAMAG8ABQAPAAcAEwAHAAkAEgA7AAEACwACAAQAAgA+AAEACg' + `\n 'AEAAkADADSAAEACgAIACcAAQDoAAEABwACABwAAQDjAAEAhgABABAAAgCmAAEACgADACkAAQAHABUAOQABAA4' + `\n 'AAgCUAAEABQACAC4AAQA6AAEABwACAD4AAQAFAAIAgQABAAkAAgBrAAEAUQABABIAAQARAAUACAACAB8AAQAK' + `\n 'AAYAIQABAAQAFABzAAEAOQABAAgAAgAIAAEAYwABAAgAAgAlAAEABwADAEEAAQAIAAYAPwABAHYAAQBKAAEAF' + `\n 'gAHABEABwAPAAUASAABAAkABABIAAEABQANAAYAAgA3AAEADAACADYAAQAKAAIAhAABAAcAAwBmAAEACwACAC' + `\n 'MAAQAGAAIACAAIADcAAQA+AAEAMAABAAgADwAhAAEABAACAD8AAQADAAIABwABAB8AAQAYAAEAEwABAG4AAQA' + `\n 'HAA8ACwADADsAAQAKAAIAfgABAAoAAgB+AAEAYAABACMAAQAGAAIAYAABAA4AAgA4AAEADgAFAAgABAAMAAUA' + `\n 'DwADABEAAwATAAEADAABAA8AAwANAAIADwACAA4AAgAQAAMAJgABAA0AAgAOAAIAEgACABgAAQAJAAIAAQABA' + `\n 'AkAAQAOAAIADwABABMAAgAQAAIAEQACABQAAgARAAEAEQABABQAAQATAAEADAABAA8AAQAWAAEAGgABADYAAQ' + `\n 'AIAAEAAQABAAwAAQAnAAEACwABACYAAQAPAAEABAABAAsAAQASAAEADgABAAcAAwAmAAMAFgABACsAAQAKAAE' + `\n 'AdgABABAAAQAKAAEAGwABABQAAQAWAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + `\n 'AAAAAAAAAAAAAAAAAAA='\n #endregion\n\n $msiContentInBytes = [System.Convert]::FromBase64String($msiContentInBase64)\n\n Set-Content -Path $DestinationPath -Value $msiContentInBytes -Encoding 'Byte' | Out-Null\n}\n\n<#\n .SYNOPSIS\n Clears the Package cache where files are downloaded from the file server when applicable.\n#>\nfunction Clear-PackageCache\n{\n [CmdletBinding()]\n param ()\n\n $packageCacheLocation = \"$env:ProgramData\\Microsoft\\Windows\\PowerShell\\Configuration\\\" + `\n 'BuiltinProvCache\\MSFT_xPackageResource'\n\n Remove-Item -Path $packageCacheLocation -ErrorAction 'SilentlyContinue' -Recurse\n}\n\n<#\n .SYNOPSIS\n Tests if the package with the given name is installed.\n\n .PARAMETER Name\n The name of the package to test for.\n#>\nfunction Test-PackageInstalledByName\n{\n [OutputType([System.Boolean])]\n [CmdletBinding()]\n param\n (\n [Parameter()]\n [System.String]\n $Name\n )\n\n $uninstallRegistryKey = 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall'\n $uninstallRegistryKeyWow64 = 'HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall'\n\n $productEntry = $null\n\n foreach ($registryKeyEntry in (Get-ChildItem -Path @( $uninstallRegistryKey, $uninstallRegistryKeyWow64) -ErrorAction 'Ignore' ))\n {\n if ($Name -eq (Get-LocalizedRegistryKeyValue -RegistryKey $registryKeyEntry -ValueName 'DisplayName'))\n {\n $productEntry = $registryKeyEntry\n break\n }\n }\n\n return ($null -ne $productEntry)\n}\n\n<#\n .SYNOPSIS\n Retrieves a localized registry key value.\n\n .PARAMETER RegistryKey\n The registry key to retrieve the value from.\n\n .PARAMETER ValueName\n The name of the value to retrieve.\n#>\nfunction Get-LocalizedRegistryKeyValue\n{\n [CmdletBinding()]\n param\n (\n [Parameter()]\n [System.Object]\n $RegistryKey,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [System.String]\n $ValueName\n )\n\n $localizedRegistryKeyValue = $RegistryKey.GetValue('{0}_Localized' -f $ValueName)\n\n if ($null -eq $localizedRegistryKeyValue)\n {\n $localizedRegistryKeyValue = $RegistryKey.GetValue($ValueName)\n }\n\n return $localizedRegistryKeyValue\n}\n\n<#\n .SYNOPSIS\n Creates a new test executable.\n\n .PARAMETER DestinationPath\n The path at which to create the test executable.\n#>\nfunction New-TestExecutable\n{\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [System.String]\n $DestinationPath\n )\n\n if (Test-Path -Path $DestinationPath)\n {\n Write-Verbose -Message \"Removing old executable at $DestinationPath...\"\n Remove-Item -Path $DestinationPath -Force\n }\n\n $testExecutableCode = @'\n using System;\n using System.Collections.Generic;\n using System.Linq;\n using System.Management;\n using System.Text;\n using System.Threading.Tasks;\n using System.Management.Automation;\n using System.Management.Automation.Runspaces;\n using System.Runtime.InteropServices;\n namespace Providers.Package.UnitTests.MySuite\n {\n class ExeTestClass\n {\n public static void Main(string[] args)\n {\n string cmdline = System.Environment.CommandLine;\n Console.WriteLine(\"Cmdline was \" + cmdline);\n int endIndex = cmdline.IndexOf(\"\\\"\", 1);\n string self = cmdline.Substring(0, endIndex);\n string other = cmdline.Substring(self.Length + 1);\n string msiexecpath = System.IO.Path.Combine(System.Environment.SystemDirectory, \"msiexec.exe\");\n\n self = self.Replace(\"\\\"\", \"\");\n string packagePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(self), \"DSCSetupProject.msi\");\n\n string msiexecargs = String.Format(\"/i \\\"{0}\\\" {1}\", packagePath, other);\n System.Diagnostics.Process.Start(msiexecpath, msiexecargs).WaitForExit();\n }\n }\n }\n'@\n\n Add-Type -TypeDefinition $testExecutableCode -OutputAssembly $DestinationPath -OutputType 'ConsoleApplication'\n}\n\nExport-ModuleMember -Function `\n New-TestMsi, `\n Clear-PackageCache, `\n New-TestExecutable, `\n Start-Server, `\n Stop-Server, `\n Test-PackageInstalledByName, `\n Test-PackageInstalledById, `\n Stop-EveryTestServerInstance\n", "meta": {"content_hash": "85d124a5a34af959d579a0150b1aa61a", "timestamp": "", "source": "github", "line_count": 1324, "max_line_length": 168, "avg_line_length": 58.58459214501511, "alnum_prop": 0.6052265167728128, "repo_name": "PowerShell/xPSDesiredStateConfiguration", "id": "e340a9674f367714b38aef81eb9ad5725d0b06ac", "size": "77566", "binary": false, "copies": "1", "ref": "refs/heads/Issue-729", "path": "tests/TestHelpers/DSC_xPackageResource.TestHelper.psm1", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "7766"}, {"name": "PowerShell", "bytes": "2735024"}]}} +{"text": "local GUI = {\n\t-- GUI Survival\n\t{type = 'header', text = 'Survival', align = 'center'},\n\t{type = 'checkbox', text = 'Enable Lay on Hands', key = 'S_LOHE', default = true},\n\t{type = 'spinner', text = '', key = 'S_LOH', default = 10},\n\t{type = 'checkbox', text = 'Enable Flash of Light', key = 'S_FOLE', default = true},\n\t{type = 'spinner', text = '', key = 'S_FOL', default = 40},\n\t{type = 'checkbox', text = 'Enable Shield of Vengeance', key = 'S_SOVE', default = true},\n\t{type = 'spinner', text = '', key = 'S_SOV', default = 75},\n\t{type = 'checkbox', text = 'Enable Eye for an Eye', key = 'S_EFAEE', default = true},\n\t{type = 'spinner', text = '', key = 'S_EFAE', default = 90},\n\t--{type = 'checkbox', text = 'Enable Every Man for Himself (Stun)', key = 'S_EMFHSE', default = true},\n\t--{type = 'checkbox', text = 'Enable Blessing of Freedom (Root)', key = 'S_BOFRE', default = true},\n\t--{type = 'checkbox', text = 'Enable Blessing of Freedom (Snare)', key = 'S_BOFSE', default = true},\n\t{type = 'checkbox', text = 'Enable Gift of the Naaru', key = 'S_GOTNE', default = true},\n\t{type = 'spinner', text = '', key = 'S_GOTN', default = 40},\n\t{type = 'checkbox', text = 'Enable Healthstone', key = 'S_HSE', default = true},\n\t{type = 'spinner', text = '', key = 'S_HS', default = 20},\n\t{type = 'checkbox', text = 'Enable Ancient Healing Potion', key = 'S_AHPE', default = true},\n\t{type = 'spinner', text = '', key = 'S_AHP', default = 20},\n\t{type = 'ruler'},{type = 'spacer'},\n\n\t-- GUI Emergency Group Assistance\n\t{type = 'header', text = 'Emergency Group Assistance', align = 'center'},\n\t{type = 'checkbox', text = 'Enable Emergency Group Assistance', key = 'E_GAE', default = false},\n\t{type = 'text', text = 'Flash of Light'},\n\t{type = 'spinner', text = '', key = 'E_FOL', default = 35},\n\t{type = 'text', text = 'Lay on Hands'},\n\t{type = 'spinner', text = '', key = 'E_LOH', default = 10},\n\t{type = 'text', text = 'Blessing of Protection'},\n\t{type = 'spinner', text = '', key = 'E_BOP', default = 10},\n\t{type = 'ruler'},{type = 'spacer'},\n\n\t-- GUI Blessings\n\t{type = 'header', text = 'Blessings', align = 'center'},\n\t{type = 'text', text = 'Check to enable blessings on yourself'},\n\t{type = 'checkbox', text = 'Blessing of Kings', key = 'B_BOKP', default = false},\n\t{type = 'checkbox', text = 'Blessing of Wisdom', key = 'B_BOWP', default = false},\n\t{type = 'ruler'},{type = 'spacer'},\n}\n\nlocal exeOnLoad = function()\n\t-- Rotation loaded message.\n\tprint('|cfff58cba ----------------------------------------------------------------------|r')\n\tprint('|cfff58cba --- |rPaladin: |cfff58cbaRETRIBUTION|r')\n\tprint('|cfff58cba --- |rTalents: 1/2 - 2/2 - 3/1 - 4/2 - 5/2 - 6/1 - 7/2|r')\n\tprint('|cfff58cba --- |rNo Multitarget (AoE) enabled settings|r')\n\tprint('|cfff58cba ----------------------------------------------------------------------|r')\n\tprint('|cffff0000 Configuration: |rRight-click the MasterToggle and go to Combat Routines Settings|r')\n\n\tNeP.Interface:AddToggle({\n\t\t-- Cleanse Toxin\n\t\tkey = 'yuCT',\n\t\tname = 'Cleanse Toxin',\n\t\ttext = 'Enable/Disable: Automatic removal of Poison and Diseases',\n\t\ticon = 'Interface\\\\ICONS\\\\spell_holy_renew',\n\t})\n\tNeP.Interface:AddToggle({\n\t\t-- Emergency Group Assistance\n\t\tkey = 'yuEGA',\n\t\tname = 'Emergency Group Assistance',\n\t\ttext = 'Enable/Disable: Automatic LoH/BoP/FoL on group members',\n\t\ticon = 'Interface\\\\ICONS\\\\ability_fiegndead',\n\t})\nend\n\nlocal Survival = {\n\t-- Lay on Hands usage if enabled in UI.\n\t{'&Lay on Hands', 'UI(S_LOHE)&{!player.debuff(Ignite Soul)}&player.health<=UI(S_LOH)'},\n\t-- Shield of Vengeance usage if enabled in UI.\n\t{'&Shield of Vengeance', 'UI(S_SOVE)&player.health<=UI(S_SOV)'},\n\t-- Eye for an Eye usage if enabled in UI.\n\t{'Eye for an Eye', 'talent(5,2)&UI(S_EFAEE)&player.health<=UI(S_EFAE)'},\n\t-- Every Man for Himself usage if enabled in UI.\n\t--{'&Every Man for Himself', 'UI(S_EMFHSE)&player.state(stun)'},\n\t-- Blessing of Freedom usage if enabled in UI.\n\t--{'!Blessing of Freedom', 'UI(S_BOFRE)&player.state(root)'},\n\t-- Blessing of Freedom usage if enabled in UI.\n\t--{'!Blessing of Freedom', 'UI(S_BOFSE)&player.state(snare)'},\n\t-- Gift of the Naaru usage if enabled in UI.\n\t{'&Gift of the Naaru', 'UI(S_GOTNE)&{!player.debuff(Ignite Soul)}&player.health<=UI(S_GOTN)'},\n\t-- Healthstone usage if enabled in UI.\n\t{'#5512', 'UI(S_HSE)&{!player.debuff(Ignite Soul)}&player.health<=UI(S_HS)'},\n\t-- Ancient Healing Potion usage if enabled in UI.\n\t{'#127834', 'UI(S_AHPE)&{!player.debuff(Ignite Soul)}&player.health<=UI(S_AHP)'},\n}\n\nlocal Player = {\n\t-- Flash of Light usage if enabled in UI.\n\t{'!Flash of Light', 'UI(S_FOLE)&{!player.debuff(Ignite Soul)}&player.health<=UI(S_FOL)', 'player'},\n}\n\nlocal Emergency = {\n\t-- Flash of Light usage if enabled in UI.\n\t{'!Flash of Light', 'UI(E_GAE)&{!lowest.debuff(Ignite Soul)}&lowest.health<=UI(E_FOL)', 'lowest'},\n\t-- Lay on Hands usage if enabled in UI.\n\t{'!Lay on Hands', 'UI(E_GAE)&{!lowest.debuff(Ignite Soul)}&lowest.health<=UI(E_LOH)', 'lowest'},\n\t-- Blessing of Protection usage if enabled in UI.\n\t{'!Blessing of Protection', 'UI(E_GAE)&{!lowest.debuff(Ignite Soul)}&lowest.health<=UI(E_BOP)', 'lowest'},\n}\n\nlocal Interrupts = {\n\t{'&Rebuke', 'target.range<=5'},\n\t{'Hammer of Justice', '!equipped(Justice Gaze)&target.range<=10&spell(Rebuke).cooldown>gcd&!lastgcd(Rebuke)'},\n\t{'Hammer of Justice', 'equipped(Justice Gaze)&target.health>=75&target.range<=10&spell(Rebuke).cooldown>gcd&!lastgcd(Rebuke)'},\n\t{'Blinding Light', 'talent(3,3)&target.range<=10&spell(Rebuke).cooldown>gcd&!lastgcd(Rebuke)'},\n\t{'&Arcane Torrent', 'target.range<=8&spell(Rebuke).cooldown>gcd&!lastgcd(Rebuke)'},\n}\n\nlocal Dispel = {\n\t{'%dispelself'},\n}\n\nlocal Blessings = {\n\t{'Greater Blessing of Kings', 'UI(B_BOKP)&!player.buff(Greater Blessing of Kings)', 'player'},\n\t{'Greater Blessing of Wisdom', 'UI(B_BOWP)&!player.buff(Greater Blessing of Wisdom)', 'player'},\n}\n\n-- ####################################################################################\n-- Primairly sourced from legion-dev SimC.\n-- Updates to rotations from sources are considered for implementation.\n-- ####################################################################################\n\n-- SimC APL 4/20/2017\n-- https://github.com/simulationcraft/simc/blob/legion-dev/profiles/Tier19M/Paladin_Retribution_T19M.simc\n\nlocal Cooldowns = {\n\t--actions+=/arcane_torrent,if=holy_power<5&(buff.crusade.up|buff.avenging_wrath.up|time<2)\n\t{'&Arcane Torrent', 'holypower<5&{player.buff(Crusade)||player.buff(Avenging Wrath)||combat(player).time<2}'},\n\t--actions+=/holy_wrath\n\t{'Holy Wrath', 'talent(7,3)'},\n\t--actions+=/avenging_wrath\n\t{'&Avenging Wrath', '!talent(7,2)'},\n\t--actions+=/crusade,if=holy_power>=5&!equipped.137048|((equipped.137048|race.blood_elf)&holy_power>=2)\n\t{'&Crusade', 'talent(7,2)&{holypower>=5&!equipped(Liadrin\\'s Fury Unleashed)||{equipped(Liadrin\\'s Fury Unleashed)&holypower>=2}}'},\n}\n\nlocal Combat = {\n\t{'/startattack', '!isattacking'},\n\t--actions+=/judgment,if=time<2\n\t{'Judgment', 'combat(player).time<2'},\n\t--actions+=/blade_of_justice,if=time<2&(equipped.137048|race.blood_elf)\n\t{'Blade of Justice', 'combat(player).time<2&equipped(Liadrin\\'s Fury Unleashed)'},\n\t--actions+=/divine_hammer,if=time<2&(equipped.137048|race.blood_elf)\n\t{'Divine Hammer', 'talent(4,3)&combat(player).time<2&equipped(Liadrin\\'s Fury Unleashed)'},\n\t--actions+=/wake_of_ashes,if=holy_power<=1&time<2\n\t{'Wake of Ashes', 'holypower<=1&combat(player).time<2'},\n\t--actions+=/execution_sentence,if=spell_targets.divine_storm<=3&(cooldown.judgment.remains<gcd*4.5|debuff.judgment.remains>gcd*4.5)&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*2)\n\t{'Execution Sentence','talent(1,2)&player.area(8).enemies<=3&{spell(Judgment).cooldown<gcd*4.5||target.debuff(judgment).duration>gcd*4.5}&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*2}'},\n\t--actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&buff.divine_purpose.up&buff.divine_purpose.remains<gcd*2\n\t{'Divine Storm', 'target.debuff(Judgment)&player.area(8).enemies>=2&player.buff(Divine Purpose).duration<gcd*2'},\n\t--actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&holy_power>=5&buff.divine_purpose.react\n\t{'Divine Storm', 'target.debuff(Judgment)&player.area(8).enemies>=2&holypower>=5&player.buff(Divine Purpose)'},\n\t--actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&holy_power>=3&(buff.crusade.up&(buff.crusade.stack<15|buff.bloodlust.up)|buff.liadrins_fury_unleashed.up)\n\t{'Divine Storm', 'target.debuff(Judgment)&player.area(8).enemies>=2&holypower>=3&{player.buff(Crusade)&{player.buff(Crusade).count<15||hashero}||player.buff(Liadrin\\'s Fury Unleashed)}'},\n\t--actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&holy_power>=5&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*3)\n\t{'Divine Storm', 'target.debuff(Judgment)&player.area(8).enemies>=2&holypower>=5&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*3}'},\n\t--actions+=/templars_verdict,if=debuff.judgment.up&buff.divine_purpose.up&buff.divine_purpose.remains<gcd*2\n\t{'Templar\\'s Verdict', 'target.debuff(Judgment)&player.buff(Divine Purpose).duration<gcd*2'},\n\t--actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=5&buff.divine_purpose.react\n\t{'Templar\\'s Verdict', 'target.debuff(Judgment)&holypower>=5&player.buff(Divine Purpose)'},\n\t--actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=3&(buff.crusade.up&(buff.crusade.stack<15|buff.bloodlust.up)|buff.liadrins_fury_unleashed.up)\n\t{'Templar\\'s Verdict', 'target.debuff(Judgment)&holypower>=3&{player.buff(Crusade)&{player.buff(Crusade).count<15||hashero}||player.buff(Liadrin\\'s Fury Unleashed)}'},\n\t--actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=5&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*3)&(!talent.execution_sentence.enabled|cooldown.execution_sentence.remains>gcd)\n\t{'Templar\\'s Verdict', 'target.debuff(Judgment)&holypower>=5&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*3}&{!talent(1,2)||spell(Execution Sentence).cooldown>gcd}'},\n\t--actions+=/divine_storm,if=debuff.judgment.up&holy_power>=3&spell_targets.divine_storm>=2&(cooldown.wake_of_ashes.remains<gcd*2&artifact.wake_of_ashes.enabled|buff.whisper_of_the_nathrezim.up&buff.whisper_of_the_nathrezim.remains<gcd)&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*4)\n\t{'Divine Storm', 'target.debuff(Judgment)&holypower>=3&player.area(8).enemies>=2&{spell(Wake of Ashes).cooldown<gcd*2&artifact(Wake of Ashes).enabled||player.buff(Whisper of the Nathrezim).duration<gcd}&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*4}'},\n\t--actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=3&(cooldown.wake_of_ashes.remains<gcd*2&artifact.wake_of_ashes.enabled|buff.whisper_of_the_nathrezim.up&buff.whisper_of_the_nathrezim.remains<gcd)&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*4)\n\t{'Templar\\'s Verdict', 'target.debuff(Judgment)&holypower>=3&{spell(Wake of Ashes).cooldown<gcd*2&artifact(Wake of Ashes).enabled||player.buff(Whisper of the Nathrezim).duration<gcd}&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*4}'},\n\t--actions+=/judgment,if=dot.execution_sentence.ticking&dot.execution_sentence.remains<gcd*2&debuff.judgment.remains<gcd*2\n\t{'Judgment', 'target.debuff(Execution Sentence).duration<gcd*2&target.debuff(Judgment).duration<gcd*2'},\n\t--actions+=/wake_of_ashes,if=(!raid_event.adds.exists|raid_event.adds.in>15)&(holy_power=0|holy_power=1&(cooldown.blade_of_justice.remains>gcd|cooldown.divine_hammer.remains>gcd)|holy_power=2&(cooldown.zeal.charges_fractional<=0.65|cooldown.crusader_strike.charges_fractional<=0.65))\n\t{'Wake of Ashes', 'holypower=0||holypower=1&{spell(Blade of Justice).cooldown>gcd||spell(Divine Hammer).cooldown>gcd}||holypower=2&{spell(Zeal).charges<=0.65||spell(Crusader Strike).charges<=0.65}'},\n\t--actions+=/blade_of_justice,if=(holy_power<=2&set_bonus.tier20_2pc=1|holy_power<=3&set_bonus.tier20_2pc=0)\n\t{'Blade of Justice', 'holypower<=2&set_bonus(T20)>=2||holypower<=3&set_bonus(T20)=0'},\n\t--actions+=/divine_hammer,if=(holy_power<=2&set_bonus.tier20_2pc=1|holy_power<=3&set_bonus.tier20_2pc=0)\n\t{'Divine Hammer', 'holypower<=2&set_bonus(T20)>=2||holypower<=3&set_bonus(T20)=0'},\n\t--actions+=/hammer_of_justice,if=equipped.137065&target.health.pct>=75&holy_power<=4\n\t{'Hammer of Justice', 'equipped(Justice Gaze)&target.health>=75&holypower<=4'},\n\t--actions+=/judgment\n\t{'Judgment'},\n\t--actions+=/zeal,if=charges=2&(set_bonus.tier20_2pc=0&holy_power<=2|(holy_power<=4&(cooldown.divine_hammer.remains>gcd*2|cooldown.blade_of_justice.remains>gcd*2)&cooldown.judgment.remains>gcd*2))|(set_bonus.tier20_2pc=1&holy_power<=1|(holy_power<=4&(cooldown.divine_hammer.remains>gcd*2|cooldown.blade_of_justice.remains>gcd*2)&cooldown.judgment.remains>gcd*2))\n\t{'Zeal', 'talent(2,2)&spell(Zeal).charges=2&{set_bonus(T20)=0&holypower<=2||{holypower<=4&{spell(Divine Hammer).cooldown>gcd*2||spell(Blade of Justice).cooldown>gcd*2}&spell(Judgment).cooldown>gcd*2}}||{set_bonus(T20)>=2&holypower<=1||{holypower<=4&{spell(Divine Hammer).cooldown>gcd*2||spell(Blade of Justice).cooldown>gcd*2}&spell(Judgment).cooldown>gcd*2}}'},\n\t--actions+=/crusader_strike,if=charges=2&(set_bonus.tier20_2pc=0&holy_power<=2|(holy_power<=4&(cooldown.divine_hammer.remains>gcd*2|cooldown.blade_of_justice.remains>gcd*2)&cooldown.judgment.remains>gcd*2))|(set_bonus.tier20_2pc=1&holy_power<=1|(holy_power<=4&(cooldown.divine_hammer.remains>gcd*2|cooldown.blade_of_justice.remains>gcd*2)&cooldown.judgment.remains>gcd*2))\n\t{'Crusader Strike', '!talent(2,2)&spell(Crusader Strike).charges=2&{set_bonus(T20)=0&holypower<=2||{holypower<=4&{spell(Divine Hammer).cooldown>gcd*2||spell(Blade of Justice).cooldown>gcd*2}&spell(Judgment).cooldown>gcd*2}}||{set_bonus(T20)>=2&holypower<=1||{holypower<=4&{spell(Divine Hammer).cooldown>gcd*2||spell(Blade of Justice).cooldown>gcd*2}&spell(Judgment).cooldown>gcd*2}}'},\n\t--actions+=/consecration\n\t{'Consecration', 'talent(1,3)'},\n\t--actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&buff.divine_purpose.react\n\t{'Divine Storm', 'target.debuff(Judgment)&player.area(8).enemies>=2&player.buff(Divine Purpose)'},\n\t--actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&buff.the_fires_of_justice.react&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*3)\n\t{'Divine Storm', 'target.debuff(Judgment)&player.area(8).enemies>=2&player.buff(The Fires of Justice)&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*3}'},\n\t--actions+=/divine_storm,if=debuff.judgment.up&spell_targets.divine_storm>=2&holy_power>=4&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*4)\n\t{'Divine Storm', 'target.debuff(Judgment)&player.area(8).enemies>=2&holypower>=4&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*4}'},\n\t--actions+=/templars_verdict,if=debuff.judgment.up&buff.divine_purpose.react\n\t{'Templar\\'s Verdict', 'target.debuff(Judgment)&player.buff(Divine Purpose)'},\n\t--actions+=/templars_verdict,if=debuff.judgment.up&buff.the_fires_of_justice.react&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*3)\n\t{'Templar\\'s Verdict', 'target.debuff(Judgment)&player.buff(The Fires of Justice)&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*3}'},\n\t--actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=4&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*4)&(!talent.execution_sentence.enabled|cooldown.execution_sentence.remains>gcd*2)\n\t{'Templar\\'s Verdict', 'target.debuff(Judgment)&holypower>=4&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*4}&{!talent(1,2)||spell(Execution Sentence).cooldown>gcd*2}'},\n\t--actions+=/zeal,if=holy_power<=4\n\t{'Zeal', 'talent(2,2)&holypower<=4'},\n\t--actions+=/crusader_strike,if=holy_power<=4\n\t{'Crusader Strike', '!talent(2,2)&holypower<=4'},\n\t--actions+=/divine_storm,if=debuff.judgment.up&holy_power>=3&spell_targets.divine_storm>=2&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*5)\n\t{'Divine Storm', 'target.debuff(Judgment)&holypower>=3&player.area(8).enemies>=2&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*5}'},\n\t--actions+=/templars_verdict,if=debuff.judgment.up&holy_power>=3&(!talent.crusade.enabled|cooldown.crusade.remains>gcd*5)\n\t{'Templar\\'s Verdict', 'target.debuff(Judgment)&holypower>=3&{!talent(7,2)||talent(7,2)&!toggle(cooldowns)||spell(Crusade).cooldown>gcd*5}'},\n}\n\nlocal inCombat = {\n\t{Dispel, '{!moving||moving}&toggle(yuCT)&spell(Cleanse Toxins).cooldown=0'},\n\t{Survival, '{!moving||moving}'},\n\t{Blessings, '{!moving||moving}'},\n\t{Player, '!moving&{!ingroup||ingroup}'},\n\t{Emergency, '!moving&ingroup&toggle(yuEGA)'},\n\t{Interrupts, '{!moving||moving}&toggle(interrupts)&target.interruptAt(70)&target.infront'},\n\t{Cooldowns, '{!moving||moving}&toggle(cooldowns)'},\n\t{Combat, '{!moving||moving}&target.infront&target.range<=8'},\n}\n\nlocal outCombat = {\n\t{Dispel, '{!moving||moving}&toggle(yuCT)&spell(Cleanse Toxins).cooldown=0'},\n\t{Interrupts, '{!moving||moving}&toggle(interrupts)&target.interruptAt(70)&target.infront'},\n\t{Blessings, '{!moving||moving}'},\n\t{Emergency, '!moving&ingroup&toggle(yuEGA)'},\n\t{'Flash of Light', '!moving&player.health<=70', 'player'},\n}\n\nNeP.CR:Add(70, {\n\tname = '|r[|cff00fff0Yumad|r] |cfff58cbaPaladin|r - |cfff58cbaRETRIBUTION|r',\n\tic = inCombat,\n\tooc = outCombat,\n\tgui = GUI,\n\tload = exeOnLoad\n})\n", "meta": {"content_hash": "c7616b79a3240f3cbe1e3df5e9f507c4", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 386, "avg_line_length": 74.63404255319149, "alnum_prop": 0.6929699526768915, "repo_name": "damuY/NerdPack-Yumad", "id": "98f0d77faae8519aed20647b8c750d214e2ff153", "size": "17539", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rotations/paladin/retribution.lua", "mode": "33188", "license": "mit", "language": [{"name": "Lua", "bytes": "105029"}]}} +{"text": "import time\n\nimport game\nimport instances\nimport palette\nimport registry\n\nfrom entities import entity\nfrom entities.creatures import player\nfrom statuses import hastestatus\n\n\nclass TwitchChatManager(entity.Entity):\n special_viewers = []\n\n def __init__(self):\n super().__init__(' ')\n self.hidden = True\n self.time_since_last_help_message = 0\n TwitchChatManager.special_viewers = [viewer.lower() for viewer in game.Game.config['TWITCH']['SpecialViewers'].split('\\n') if viewer]\n\n def get_config_color(self, key):\n return tuple([int(d) for d in game.Game.config['TWITCH'][key].strip(' ').split(',')])\n\n def handle_events(self, event):\n current_scene = instances.scene_root\n\n if event.type == 'TWITCHCHATMESSAGE':\n if event.message:\n if event.message.upper() == '!JOIN':\n player_names = [e.name for e in current_scene.children if hasattr(e, 'name')]\n\n bonus = None\n\n if not event.nickname in player_names:\n # Set player color\n if 'broadcaster' in event.tags['badges']:\n try:\n player_color = self.get_config_color('BroadcasterColor')\n\n except:\n player_color = palette.get_nearest((255, 163, 0))\n\n elif event.tags['subscriber'] != '0':\n try:\n player_color = self.get_config_color('SubscriberColor')\n\n except:\n player_color = palette.BRIGHT_BLUE\n\n bonus = registry.Registry.get('weapon')()\n\n elif event.nickname.lower() in TwitchChatManager.special_viewers:\n try:\n player_color = self.get_config_color('SpecialViewerColor')\n\n except:\n player_color = palette.BRIGHT_RED\n\n else:\n try:\n player_color = self.get_config_color('ViewerColor')\n\n except:\n player_color = palette.get_nearest((255, 163, 0))\n\n # Add player\n pos = current_scene.get_location_near_stairs()\n p = player.Player(event.nickname[0], pos, fg=player_color)\n p.name = event.nickname\n\n if bonus:\n p.equip_weapon(bonus)\n\n current_scene.append(p)\n instances.console.print('{} has joined!'.format(p.display_string))\n\n elif event.message.upper() == '!LEAVE':\n for e in current_scene.children:\n if not e.isinstance('Player'):\n continue\n\n if e.name == event.nickname:\n e.die()\n instances.console.print('{} has left.'.format(e.display_string))\n\n elif event.message.upper().startswith('!CHEER'):\n s = event.message.split(' ')\n if len(s) <= 1:\n return\n\n player_names = [p.name for p in instances.scene_root.players if p.state != 'PlayerExitedState']\n if event.nickname in player_names:\n return\n\n player_name = s[1].lower()\n if player_name[0] == '@':\n player_name = player_name[1:]\n\n target_player = [p for p in instances.scene_root.players if p.state != 'PlayerExitedState' and p.name == player_name]\n target_player = target_player[0] if target_player else None\n if target_player:\n target_player.add_status(hastestatus.HasteStatus(target_player))\n\n elif event.message.upper() == '!HELP':\n current_time = time.time()\n if current_time - self.time_since_last_help_message > 30:\n help_message = 'Available commands: !join !leave !move [uldr] !move @username !stop !attack [uldr] !throw [uldr] !drop !cheer @username'\n instances.game.observer.send_message(help_message, instances.game.channel)\n self.time_since_last_help_message = current_time\n\n", "meta": {"content_hash": "eca08351fb6487a47772453eacbb8a2c", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 160, "avg_line_length": 41.2972972972973, "alnum_prop": 0.48276614310645727, "repo_name": "JoshuaSkelly/lunch-break-rl", "id": "ef49018a54b21a5b06d0e69a64e788b92e4ecddc", "size": "4584", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "twitchchatmanager.py", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "69311"}]}} +{"text": "namespace {\n\nusing google_breakpad::Minidump;\nusing google_breakpad::MinidumpContext;\nusing google_breakpad::MinidumpException;\nusing google_breakpad::MinidumpMemoryInfo;\nusing google_breakpad::MinidumpMemoryInfoList;\nusing google_breakpad::MinidumpMemoryList;\nusing google_breakpad::MinidumpMemoryRegion;\nusing google_breakpad::MinidumpModule;\nusing google_breakpad::MinidumpModuleList;\nusing google_breakpad::MinidumpSystemInfo;\nusing google_breakpad::MinidumpThread;\nusing google_breakpad::MinidumpThreadList;\nusing google_breakpad::SynthMinidump::Context;\nusing google_breakpad::SynthMinidump::Dump;\nusing google_breakpad::SynthMinidump::Exception;\nusing google_breakpad::SynthMinidump::Memory;\nusing google_breakpad::SynthMinidump::Module;\nusing google_breakpad::SynthMinidump::Stream;\nusing google_breakpad::SynthMinidump::String;\nusing google_breakpad::SynthMinidump::SystemInfo;\nusing google_breakpad::SynthMinidump::Thread;\nusing google_breakpad::test_assembler::kBigEndian;\nusing google_breakpad::test_assembler::kLittleEndian;\nusing std::ifstream;\nusing std::istringstream;\nusing std::vector;\nusing ::testing::Return;\n\nclass MinidumpTest : public ::testing::Test {\npublic:\n void SetUp() {\n minidump_file_ = string(getenv(\"srcdir\") ? getenv(\"srcdir\") : \".\") +\n \"/src/processor/testdata/minidump2.dmp\";\n }\n string minidump_file_;\n};\n\nTEST_F(MinidumpTest, TestMinidumpFromFile) {\n Minidump minidump(minidump_file_);\n ASSERT_EQ(minidump.path(), minidump_file_);\n ASSERT_TRUE(minidump.Read());\n const MDRawHeader* header = minidump.header();\n ASSERT_NE(header, (MDRawHeader*)NULL);\n ASSERT_EQ(header->signature, u_int32_t(MD_HEADER_SIGNATURE));\n //TODO: add more checks here\n}\n\nTEST_F(MinidumpTest, TestMinidumpFromStream) {\n // read minidump contents into memory, construct a stringstream around them\n ifstream file_stream(minidump_file_.c_str(), std::ios::in);\n ASSERT_TRUE(file_stream.good());\n vector<char> bytes;\n file_stream.seekg(0, std::ios_base::end);\n ASSERT_TRUE(file_stream.good());\n bytes.resize(file_stream.tellg());\n file_stream.seekg(0, std::ios_base::beg);\n ASSERT_TRUE(file_stream.good());\n file_stream.read(&bytes[0], bytes.size());\n ASSERT_TRUE(file_stream.good());\n string str(&bytes[0], bytes.size());\n istringstream stream(str);\n ASSERT_TRUE(stream.good());\n\n // now read minidump from stringstream\n Minidump minidump(stream);\n ASSERT_EQ(minidump.path(), \"\");\n ASSERT_TRUE(minidump.Read());\n const MDRawHeader* header = minidump.header();\n ASSERT_NE(header, (MDRawHeader*)NULL);\n ASSERT_EQ(header->signature, u_int32_t(MD_HEADER_SIGNATURE));\n //TODO: add more checks here\n}\n\nTEST(Dump, ReadBackEmpty) {\n Dump dump(0);\n dump.Finish();\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n istringstream stream(contents);\n Minidump minidump(stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(0U, minidump.GetDirectoryEntryCount());\n}\n\nTEST(Dump, ReadBackEmptyBigEndian) {\n Dump big_minidump(0, kBigEndian);\n big_minidump.Finish();\n string contents;\n ASSERT_TRUE(big_minidump.GetContents(&contents));\n istringstream stream(contents);\n Minidump minidump(stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(0U, minidump.GetDirectoryEntryCount());\n}\n\nTEST(Dump, OneStream) {\n Dump dump(0, kBigEndian);\n Stream stream(dump, 0xfbb7fa2bU);\n stream.Append(\"stream contents\");\n dump.Add(&stream);\n dump.Finish();\n \n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());\n\n const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);\n ASSERT_TRUE(dir != NULL);\n EXPECT_EQ(0xfbb7fa2bU, dir->stream_type);\n\n u_int32_t stream_length;\n ASSERT_TRUE(minidump.SeekToStreamType(0xfbb7fa2bU, &stream_length));\n ASSERT_EQ(15U, stream_length);\n char stream_contents[15];\n ASSERT_TRUE(minidump.ReadBytes(stream_contents, sizeof(stream_contents)));\n EXPECT_EQ(string(\"stream contents\"),\n string(stream_contents, sizeof(stream_contents)));\n\n EXPECT_FALSE(minidump.GetThreadList());\n EXPECT_FALSE(minidump.GetModuleList());\n EXPECT_FALSE(minidump.GetMemoryList());\n EXPECT_FALSE(minidump.GetException());\n EXPECT_FALSE(minidump.GetAssertion());\n EXPECT_FALSE(minidump.GetSystemInfo());\n EXPECT_FALSE(minidump.GetMiscInfo());\n EXPECT_FALSE(minidump.GetBreakpadInfo());\n}\n\nTEST(Dump, OneMemory) {\n Dump dump(0, kBigEndian);\n Memory memory(dump, 0x309d68010bd21b2cULL);\n memory.Append(\"memory contents\");\n dump.Add(&memory);\n dump.Finish();\n\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());\n\n const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);\n ASSERT_TRUE(dir != NULL);\n EXPECT_EQ((u_int32_t) MD_MEMORY_LIST_STREAM, dir->stream_type);\n\n MinidumpMemoryList *memory_list = minidump.GetMemoryList();\n ASSERT_TRUE(memory_list != NULL);\n ASSERT_EQ(1U, memory_list->region_count());\n\n MinidumpMemoryRegion *region1 = memory_list->GetMemoryRegionAtIndex(0);\n ASSERT_EQ(0x309d68010bd21b2cULL, region1->GetBase());\n ASSERT_EQ(15U, region1->GetSize());\n const u_int8_t *region1_bytes = region1->GetMemory();\n ASSERT_TRUE(memcmp(\"memory contents\", region1_bytes, 15) == 0);\n}\n\n// One thread --- and its requisite entourage.\nTEST(Dump, OneThread) {\n Dump dump(0, kLittleEndian);\n Memory stack(dump, 0x2326a0fa);\n stack.Append(\"stack for thread\");\n\n MDRawContextX86 raw_context;\n const u_int32_t kExpectedEIP = 0x6913f540;\n raw_context.context_flags = MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL;\n raw_context.edi = 0x3ecba80d;\n raw_context.esi = 0x382583b9;\n raw_context.ebx = 0x7fccc03f;\n raw_context.edx = 0xf62f8ec2;\n raw_context.ecx = 0x46a6a6a8;\n raw_context.eax = 0x6a5025e2;\n raw_context.ebp = 0xd9fabb4a;\n raw_context.eip = kExpectedEIP;\n raw_context.cs = 0xbffe6eda;\n raw_context.eflags = 0xb2ce1e2d;\n raw_context.esp = 0x659caaa4;\n raw_context.ss = 0x2e951ef7;\n Context context(dump, raw_context);\n \n Thread thread(dump, 0xa898f11b, stack, context,\n 0x9e39439f, 0x4abfc15f, 0xe499898a, 0x0d43e939dcfd0372ULL);\n \n dump.Add(&stack);\n dump.Add(&context);\n dump.Add(&thread);\n dump.Finish();\n\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());\n\n MinidumpMemoryList *md_memory_list = minidump.GetMemoryList();\n ASSERT_TRUE(md_memory_list != NULL);\n ASSERT_EQ(1U, md_memory_list->region_count());\n\n MinidumpMemoryRegion *md_region = md_memory_list->GetMemoryRegionAtIndex(0);\n ASSERT_EQ(0x2326a0faU, md_region->GetBase());\n ASSERT_EQ(16U, md_region->GetSize());\n const u_int8_t *region_bytes = md_region->GetMemory();\n ASSERT_TRUE(memcmp(\"stack for thread\", region_bytes, 16) == 0);\n\n MinidumpThreadList *thread_list = minidump.GetThreadList();\n ASSERT_TRUE(thread_list != NULL);\n ASSERT_EQ(1U, thread_list->thread_count());\n\n MinidumpThread *md_thread = thread_list->GetThreadAtIndex(0);\n ASSERT_TRUE(md_thread != NULL);\n u_int32_t thread_id;\n ASSERT_TRUE(md_thread->GetThreadID(&thread_id));\n ASSERT_EQ(0xa898f11bU, thread_id);\n MinidumpMemoryRegion *md_stack = md_thread->GetMemory();\n ASSERT_TRUE(md_stack != NULL);\n ASSERT_EQ(0x2326a0faU, md_stack->GetBase());\n ASSERT_EQ(16U, md_stack->GetSize());\n const u_int8_t *md_stack_bytes = md_stack->GetMemory();\n ASSERT_TRUE(memcmp(\"stack for thread\", md_stack_bytes, 16) == 0);\n\n MinidumpContext *md_context = md_thread->GetContext();\n ASSERT_TRUE(md_context != NULL);\n ASSERT_EQ((u_int32_t) MD_CONTEXT_X86, md_context->GetContextCPU());\n\n u_int64_t eip;\n ASSERT_TRUE(md_context->GetInstructionPointer(&eip));\n EXPECT_EQ(kExpectedEIP, eip);\n\n const MDRawContextX86 *md_raw_context = md_context->GetContextX86();\n ASSERT_TRUE(md_raw_context != NULL);\n ASSERT_EQ((u_int32_t) (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL),\n (md_raw_context->context_flags\n & (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL)));\n EXPECT_EQ(0x3ecba80dU, raw_context.edi);\n EXPECT_EQ(0x382583b9U, raw_context.esi);\n EXPECT_EQ(0x7fccc03fU, raw_context.ebx);\n EXPECT_EQ(0xf62f8ec2U, raw_context.edx);\n EXPECT_EQ(0x46a6a6a8U, raw_context.ecx);\n EXPECT_EQ(0x6a5025e2U, raw_context.eax);\n EXPECT_EQ(0xd9fabb4aU, raw_context.ebp);\n EXPECT_EQ(kExpectedEIP, raw_context.eip);\n EXPECT_EQ(0xbffe6edaU, raw_context.cs);\n EXPECT_EQ(0xb2ce1e2dU, raw_context.eflags);\n EXPECT_EQ(0x659caaa4U, raw_context.esp);\n EXPECT_EQ(0x2e951ef7U, raw_context.ss);\n}\n\nTEST(Dump, ThreadMissingMemory) {\n Dump dump(0, kLittleEndian);\n Memory stack(dump, 0x2326a0fa);\n // Stack has no contents.\n\n MDRawContextX86 raw_context;\n memset(&raw_context, 0, sizeof(raw_context));\n raw_context.context_flags = MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL;\n Context context(dump, raw_context);\n\n Thread thread(dump, 0xa898f11b, stack, context,\n 0x9e39439f, 0x4abfc15f, 0xe499898a, 0x0d43e939dcfd0372ULL);\n\n dump.Add(&stack);\n dump.Add(&context);\n dump.Add(&thread);\n dump.Finish();\n\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());\n\n // This should succeed even though the thread has no stack memory.\n MinidumpThreadList* thread_list = minidump.GetThreadList();\n ASSERT_TRUE(thread_list != NULL);\n ASSERT_EQ(1U, thread_list->thread_count());\n\n MinidumpThread* md_thread = thread_list->GetThreadAtIndex(0);\n ASSERT_TRUE(md_thread != NULL);\n\n u_int32_t thread_id;\n ASSERT_TRUE(md_thread->GetThreadID(&thread_id));\n ASSERT_EQ(0xa898f11bU, thread_id);\n\n MinidumpContext* md_context = md_thread->GetContext();\n ASSERT_NE(reinterpret_cast<MinidumpContext*>(NULL), md_context);\n\n MinidumpMemoryRegion* md_stack = md_thread->GetMemory();\n ASSERT_EQ(reinterpret_cast<MinidumpMemoryRegion*>(NULL), md_stack);\n}\n\nTEST(Dump, ThreadMissingContext) {\n Dump dump(0, kLittleEndian);\n Memory stack(dump, 0x2326a0fa);\n stack.Append(\"stack for thread\");\n\n // Context is empty.\n Context context(dump);\n\n Thread thread(dump, 0xa898f11b, stack, context,\n 0x9e39439f, 0x4abfc15f, 0xe499898a, 0x0d43e939dcfd0372ULL);\n\n dump.Add(&stack);\n dump.Add(&context);\n dump.Add(&thread);\n dump.Finish();\n\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());\n\n // This should succeed even though the thread has no stack memory.\n MinidumpThreadList* thread_list = minidump.GetThreadList();\n ASSERT_TRUE(thread_list != NULL);\n ASSERT_EQ(1U, thread_list->thread_count());\n\n MinidumpThread* md_thread = thread_list->GetThreadAtIndex(0);\n ASSERT_TRUE(md_thread != NULL);\n\n u_int32_t thread_id;\n ASSERT_TRUE(md_thread->GetThreadID(&thread_id));\n ASSERT_EQ(0xa898f11bU, thread_id);\n MinidumpMemoryRegion* md_stack = md_thread->GetMemory();\n ASSERT_NE(reinterpret_cast<MinidumpMemoryRegion*>(NULL), md_stack);\n\n MinidumpContext* md_context = md_thread->GetContext();\n ASSERT_EQ(reinterpret_cast<MinidumpContext*>(NULL), md_context);\n}\n\nTEST(Dump, OneModule) {\n static const MDVSFixedFileInfo fixed_file_info = {\n 0xb2fba33a, // signature\n 0x33d7a728, // struct_version\n 0x31afcb20, // file_version_hi\n 0xe51cdab1, // file_version_lo\n 0xd1ea6907, // product_version_hi\n 0x03032857, // product_version_lo\n 0x11bf71d7, // file_flags_mask\n 0x5fb8cdbf, // file_flags\n 0xe45d0d5d, // file_os\n 0x107d9562, // file_type\n 0x5a8844d4, // file_subtype\n 0xa8d30b20, // file_date_hi\n 0x651c3e4e // file_date_lo\n };\n\n Dump dump(0, kBigEndian);\n String module_name(dump, \"single module\");\n Module module(dump, 0xa90206ca83eb2852ULL, 0xada542bd,\n module_name,\n 0xb1054d2a,\n 0x34571371,\n fixed_file_info, // from synth_minidump_unittest_data.h\n NULL, NULL);\n\n dump.Add(&module);\n dump.Add(&module_name);\n dump.Finish();\n \n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());\n\n const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);\n ASSERT_TRUE(dir != NULL);\n EXPECT_EQ((u_int32_t) MD_MODULE_LIST_STREAM, dir->stream_type);\n\n MinidumpModuleList *md_module_list = minidump.GetModuleList();\n ASSERT_TRUE(md_module_list != NULL);\n ASSERT_EQ(1U, md_module_list->module_count());\n\n const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);\n ASSERT_TRUE(md_module != NULL);\n ASSERT_EQ(0xa90206ca83eb2852ULL, md_module->base_address());\n ASSERT_EQ(0xada542bd, md_module->size());\n ASSERT_EQ(\"single module\", md_module->code_file());\n\n const MDRawModule *md_raw_module = md_module->module();\n ASSERT_TRUE(md_raw_module != NULL);\n ASSERT_EQ(0xb1054d2aU, md_raw_module->time_date_stamp);\n ASSERT_EQ(0x34571371U, md_raw_module->checksum);\n ASSERT_TRUE(memcmp(&md_raw_module->version_info, &fixed_file_info,\n sizeof(fixed_file_info)) == 0);\n}\n\nTEST(Dump, OneSystemInfo) {\n Dump dump(0, kLittleEndian);\n String csd_version(dump, \"Petulant Pierogi\");\n SystemInfo system_info(dump, SystemInfo::windows_x86, csd_version);\n\n dump.Add(&system_info);\n dump.Add(&csd_version);\n dump.Finish();\n \n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());\n\n const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);\n ASSERT_TRUE(dir != NULL);\n EXPECT_EQ((u_int32_t) MD_SYSTEM_INFO_STREAM, dir->stream_type);\n\n MinidumpSystemInfo *md_system_info = minidump.GetSystemInfo();\n ASSERT_TRUE(md_system_info != NULL);\n ASSERT_EQ(\"windows\", md_system_info->GetOS());\n ASSERT_EQ(\"x86\", md_system_info->GetCPU());\n ASSERT_EQ(\"Petulant Pierogi\", *md_system_info->GetCSDVersion());\n ASSERT_EQ(\"GenuineIntel\", *md_system_info->GetCPUVendor());\n}\n\nTEST(Dump, BigDump) {\n Dump dump(0, kLittleEndian);\n\n // A SystemInfo stream.\n String csd_version(dump, \"Munificent Macaque\");\n SystemInfo system_info(dump, SystemInfo::windows_x86, csd_version);\n dump.Add(&csd_version);\n dump.Add(&system_info);\n\n // Five threads!\n Memory stack0(dump, 0x70b9ebfc);\n stack0.Append(\"stack for thread zero\");\n MDRawContextX86 raw_context0;\n raw_context0.context_flags = MD_CONTEXT_X86_INTEGER;\n raw_context0.eip = 0xaf0709e4;\n Context context0(dump, raw_context0);\n Thread thread0(dump, 0xbbef4432, stack0, context0,\n 0xd0377e7b, 0xdb8eb0cf, 0xd73bc314, 0x09d357bac7f9a163ULL);\n dump.Add(&stack0);\n dump.Add(&context0);\n dump.Add(&thread0);\n\n Memory stack1(dump, 0xf988cc45);\n stack1.Append(\"stack for thread one\");\n MDRawContextX86 raw_context1;\n raw_context1.context_flags = MD_CONTEXT_X86_INTEGER;\n raw_context1.eip = 0xe4f56f81;\n Context context1(dump, raw_context1);\n Thread thread1(dump, 0x657c3f58, stack1, context1,\n 0xa68fa182, 0x6f3cf8dd, 0xe3a78ccf, 0x78cc84775e4534bbULL);\n dump.Add(&stack1);\n dump.Add(&context1);\n dump.Add(&thread1);\n\n Memory stack2(dump, 0xc8a92e7c);\n stack2.Append(\"stack for thread two\");\n MDRawContextX86 raw_context2;\n raw_context2.context_flags = MD_CONTEXT_X86_INTEGER;\n raw_context2.eip = 0xb336a438;\n Context context2(dump, raw_context2);\n Thread thread2(dump, 0xdf4b8a71, stack2, context2,\n 0x674c26b6, 0x445d7120, 0x7e700c56, 0xd89bf778e7793e17ULL);\n dump.Add(&stack2);\n dump.Add(&context2);\n dump.Add(&thread2);\n\n Memory stack3(dump, 0x36d08e08);\n stack3.Append(\"stack for thread three\");\n MDRawContextX86 raw_context3;\n raw_context3.context_flags = MD_CONTEXT_X86_INTEGER;\n raw_context3.eip = 0xdf99a60c;\n Context context3(dump, raw_context3);\n Thread thread3(dump, 0x86e6c341, stack3, context3,\n 0x32dc5c55, 0x17a2aba8, 0xe0cc75e7, 0xa46393994dae83aeULL);\n dump.Add(&stack3);\n dump.Add(&context3);\n dump.Add(&thread3);\n\n Memory stack4(dump, 0x1e0ab4fa);\n stack4.Append(\"stack for thread four\");\n MDRawContextX86 raw_context4;\n raw_context4.context_flags = MD_CONTEXT_X86_INTEGER;\n raw_context4.eip = 0xaa646267;\n Context context4(dump, raw_context4);\n Thread thread4(dump, 0x261a28d4, stack4, context4,\n 0x6ebd389e, 0xa0cd4759, 0x30168846, 0x164f650a0cf39d35ULL);\n dump.Add(&stack4);\n dump.Add(&context4);\n dump.Add(&thread4);\n\n // Three modules!\n String module1_name(dump, \"module one\");\n Module module1(dump, 0xeb77da57b5d4cbdaULL, 0x83cd5a37, module1_name);\n dump.Add(&module1_name);\n dump.Add(&module1);\n\n String module2_name(dump, \"module two\");\n Module module2(dump, 0x8675884adfe5ac90ULL, 0xb11e4ea3, module2_name);\n dump.Add(&module2_name);\n dump.Add(&module2);\n\n String module3_name(dump, \"module three\");\n Module module3(dump, 0x95fc1544da321b6cULL, 0x7c2bf081, module3_name);\n dump.Add(&module3_name);\n dump.Add(&module3);\n\n // Add one more memory region, on top of the five stacks.\n Memory memory5(dump, 0x61979e828040e564ULL);\n memory5.Append(\"contents of memory 5\");\n dump.Add(&memory5);\n\n dump.Finish();\n\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(4U, minidump.GetDirectoryEntryCount());\n\n // Check the threads.\n MinidumpThreadList *thread_list = minidump.GetThreadList();\n ASSERT_TRUE(thread_list != NULL);\n ASSERT_EQ(5U, thread_list->thread_count());\n u_int32_t thread_id;\n ASSERT_TRUE(thread_list->GetThreadAtIndex(0)->GetThreadID(&thread_id));\n ASSERT_EQ(0xbbef4432U, thread_id);\n ASSERT_EQ(0x70b9ebfcU,\n thread_list->GetThreadAtIndex(0)->GetMemory()->GetBase());\n ASSERT_EQ(0xaf0709e4U,\n thread_list->GetThreadAtIndex(0)->GetContext()->GetContextX86()\n ->eip);\n\n ASSERT_TRUE(thread_list->GetThreadAtIndex(1)->GetThreadID(&thread_id));\n ASSERT_EQ(0x657c3f58U, thread_id);\n ASSERT_EQ(0xf988cc45U,\n thread_list->GetThreadAtIndex(1)->GetMemory()->GetBase());\n ASSERT_EQ(0xe4f56f81U,\n thread_list->GetThreadAtIndex(1)->GetContext()->GetContextX86()\n ->eip);\n\n ASSERT_TRUE(thread_list->GetThreadAtIndex(2)->GetThreadID(&thread_id));\n ASSERT_EQ(0xdf4b8a71U, thread_id);\n ASSERT_EQ(0xc8a92e7cU,\n thread_list->GetThreadAtIndex(2)->GetMemory()->GetBase());\n ASSERT_EQ(0xb336a438U,\n thread_list->GetThreadAtIndex(2)->GetContext()->GetContextX86()\n ->eip);\n\n ASSERT_TRUE(thread_list->GetThreadAtIndex(3)->GetThreadID(&thread_id));\n ASSERT_EQ(0x86e6c341U, thread_id);\n ASSERT_EQ(0x36d08e08U,\n thread_list->GetThreadAtIndex(3)->GetMemory()->GetBase());\n ASSERT_EQ(0xdf99a60cU,\n thread_list->GetThreadAtIndex(3)->GetContext()->GetContextX86()\n ->eip);\n\n ASSERT_TRUE(thread_list->GetThreadAtIndex(4)->GetThreadID(&thread_id));\n ASSERT_EQ(0x261a28d4U, thread_id);\n ASSERT_EQ(0x1e0ab4faU,\n thread_list->GetThreadAtIndex(4)->GetMemory()->GetBase());\n ASSERT_EQ(0xaa646267U,\n thread_list->GetThreadAtIndex(4)->GetContext()->GetContextX86()\n ->eip);\n\n // Check the modules.\n MinidumpModuleList *md_module_list = minidump.GetModuleList();\n ASSERT_TRUE(md_module_list != NULL);\n ASSERT_EQ(3U, md_module_list->module_count());\n EXPECT_EQ(0xeb77da57b5d4cbdaULL,\n md_module_list->GetModuleAtIndex(0)->base_address());\n EXPECT_EQ(0x8675884adfe5ac90ULL,\n md_module_list->GetModuleAtIndex(1)->base_address());\n EXPECT_EQ(0x95fc1544da321b6cULL,\n md_module_list->GetModuleAtIndex(2)->base_address());\n}\n\nTEST(Dump, OneMemoryInfo) {\n Dump dump(0, kBigEndian);\n Stream stream(dump, MD_MEMORY_INFO_LIST_STREAM);\n\n // Add the MDRawMemoryInfoList header.\n const u_int64_t kNumberOfEntries = 1;\n stream.D32(sizeof(MDRawMemoryInfoList)) // size_of_header\n .D32(sizeof(MDRawMemoryInfo)) // size_of_entry\n .D64(kNumberOfEntries); // number_of_entries\n\n \n // Now add a MDRawMemoryInfo entry.\n const u_int64_t kBaseAddress = 0x1000;\n const u_int64_t kRegionSize = 0x2000;\n stream.D64(kBaseAddress) // base_address\n .D64(kBaseAddress) // allocation_base\n .D32(MD_MEMORY_PROTECT_EXECUTE_READWRITE) // allocation_protection\n .D32(0) // __alignment1\n .D64(kRegionSize) // region_size\n .D32(MD_MEMORY_STATE_COMMIT) // state\n .D32(MD_MEMORY_PROTECT_EXECUTE_READWRITE) // protection\n .D32(MD_MEMORY_TYPE_PRIVATE) // type\n .D32(0); // __alignment2\n\n dump.Add(&stream);\n dump.Finish();\n\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());\n\n const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);\n ASSERT_TRUE(dir != NULL);\n EXPECT_EQ((u_int32_t) MD_MEMORY_INFO_LIST_STREAM, dir->stream_type);\n\n MinidumpMemoryInfoList *info_list = minidump.GetMemoryInfoList();\n ASSERT_TRUE(info_list != NULL);\n ASSERT_EQ(1U, info_list->info_count());\n\n const MinidumpMemoryInfo *info1 = info_list->GetMemoryInfoAtIndex(0);\n ASSERT_EQ(kBaseAddress, info1->GetBase());\n ASSERT_EQ(kRegionSize, info1->GetSize());\n ASSERT_TRUE(info1->IsExecutable());\n ASSERT_TRUE(info1->IsWritable());\n\n // Should get back the same memory region here.\n const MinidumpMemoryInfo *info2 =\n info_list->GetMemoryInfoForAddress(kBaseAddress + kRegionSize / 2);\n ASSERT_EQ(kBaseAddress, info2->GetBase());\n ASSERT_EQ(kRegionSize, info2->GetSize());\n}\n\nTEST(Dump, OneExceptionX86) {\n Dump dump(0, kLittleEndian);\n\n MDRawContextX86 raw_context;\n raw_context.context_flags = MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL;\n raw_context.edi = 0x3ecba80d;\n raw_context.esi = 0x382583b9;\n raw_context.ebx = 0x7fccc03f;\n raw_context.edx = 0xf62f8ec2;\n raw_context.ecx = 0x46a6a6a8;\n raw_context.eax = 0x6a5025e2;\n raw_context.ebp = 0xd9fabb4a;\n raw_context.eip = 0x6913f540;\n raw_context.cs = 0xbffe6eda;\n raw_context.eflags = 0xb2ce1e2d;\n raw_context.esp = 0x659caaa4;\n raw_context.ss = 0x2e951ef7;\n Context context(dump, raw_context);\n\n Exception exception(dump, context,\n 0x1234abcd, // thread id\n 0xdcba4321, // exception code\n 0xf0e0d0c0, // exception flags\n 0x0919a9b9c9d9e9f9ULL); // exception address\n \n dump.Add(&context);\n dump.Add(&exception);\n dump.Finish();\n\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());\n\n MinidumpException *md_exception = minidump.GetException();\n ASSERT_TRUE(md_exception != NULL);\n\n u_int32_t thread_id;\n ASSERT_TRUE(md_exception->GetThreadID(&thread_id));\n ASSERT_EQ(0x1234abcdU, thread_id);\n\n const MDRawExceptionStream* raw_exception = md_exception->exception();\n ASSERT_TRUE(raw_exception != NULL);\n EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);\n EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);\n EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,\n raw_exception->exception_record.exception_address);\n\n MinidumpContext *md_context = md_exception->GetContext();\n ASSERT_TRUE(md_context != NULL);\n ASSERT_EQ((u_int32_t) MD_CONTEXT_X86, md_context->GetContextCPU());\n const MDRawContextX86 *md_raw_context = md_context->GetContextX86();\n ASSERT_TRUE(md_raw_context != NULL);\n ASSERT_EQ((u_int32_t) (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL),\n (md_raw_context->context_flags\n & (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL)));\n EXPECT_EQ(0x3ecba80dU, raw_context.edi);\n EXPECT_EQ(0x382583b9U, raw_context.esi);\n EXPECT_EQ(0x7fccc03fU, raw_context.ebx);\n EXPECT_EQ(0xf62f8ec2U, raw_context.edx);\n EXPECT_EQ(0x46a6a6a8U, raw_context.ecx);\n EXPECT_EQ(0x6a5025e2U, raw_context.eax);\n EXPECT_EQ(0xd9fabb4aU, raw_context.ebp);\n EXPECT_EQ(0x6913f540U, raw_context.eip);\n EXPECT_EQ(0xbffe6edaU, raw_context.cs);\n EXPECT_EQ(0xb2ce1e2dU, raw_context.eflags);\n EXPECT_EQ(0x659caaa4U, raw_context.esp);\n EXPECT_EQ(0x2e951ef7U, raw_context.ss);\n}\n\nTEST(Dump, OneExceptionX86XState) {\n Dump dump(0, kLittleEndian);\n\n MDRawContextX86 raw_context;\n raw_context.context_flags = MD_CONTEXT_X86_INTEGER |\n MD_CONTEXT_X86_CONTROL | MD_CONTEXT_X86_XSTATE;\n raw_context.edi = 0x3ecba80d;\n raw_context.esi = 0x382583b9;\n raw_context.ebx = 0x7fccc03f;\n raw_context.edx = 0xf62f8ec2;\n raw_context.ecx = 0x46a6a6a8;\n raw_context.eax = 0x6a5025e2;\n raw_context.ebp = 0xd9fabb4a;\n raw_context.eip = 0x6913f540;\n raw_context.cs = 0xbffe6eda;\n raw_context.eflags = 0xb2ce1e2d;\n raw_context.esp = 0x659caaa4;\n raw_context.ss = 0x2e951ef7;\n Context context(dump, raw_context);\n\n Exception exception(dump, context,\n 0x1234abcd, // thread id\n 0xdcba4321, // exception code\n 0xf0e0d0c0, // exception flags\n 0x0919a9b9c9d9e9f9ULL); // exception address\n \n dump.Add(&context);\n dump.Add(&exception);\n dump.Finish();\n\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());\n\n MinidumpException *md_exception = minidump.GetException();\n ASSERT_TRUE(md_exception != NULL);\n\n u_int32_t thread_id;\n ASSERT_TRUE(md_exception->GetThreadID(&thread_id));\n ASSERT_EQ(0x1234abcdU, thread_id);\n\n const MDRawExceptionStream* raw_exception = md_exception->exception();\n ASSERT_TRUE(raw_exception != NULL);\n EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);\n EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);\n EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,\n raw_exception->exception_record.exception_address);\n\n MinidumpContext *md_context = md_exception->GetContext();\n ASSERT_TRUE(md_context != NULL);\n ASSERT_EQ((u_int32_t) MD_CONTEXT_X86, md_context->GetContextCPU());\n const MDRawContextX86 *md_raw_context = md_context->GetContextX86();\n ASSERT_TRUE(md_raw_context != NULL);\n ASSERT_EQ((u_int32_t) (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL),\n (md_raw_context->context_flags\n & (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL)));\n EXPECT_EQ(0x3ecba80dU, raw_context.edi);\n EXPECT_EQ(0x382583b9U, raw_context.esi);\n EXPECT_EQ(0x7fccc03fU, raw_context.ebx);\n EXPECT_EQ(0xf62f8ec2U, raw_context.edx);\n EXPECT_EQ(0x46a6a6a8U, raw_context.ecx);\n EXPECT_EQ(0x6a5025e2U, raw_context.eax);\n EXPECT_EQ(0xd9fabb4aU, raw_context.ebp);\n EXPECT_EQ(0x6913f540U, raw_context.eip);\n EXPECT_EQ(0xbffe6edaU, raw_context.cs);\n EXPECT_EQ(0xb2ce1e2dU, raw_context.eflags);\n EXPECT_EQ(0x659caaa4U, raw_context.esp);\n EXPECT_EQ(0x2e951ef7U, raw_context.ss);\n}\n\nTEST(Dump, OneExceptionARM) {\n Dump dump(0, kLittleEndian);\n\n MDRawContextARM raw_context;\n raw_context.context_flags = MD_CONTEXT_ARM_INTEGER;\n raw_context.iregs[0] = 0x3ecba80d;\n raw_context.iregs[1] = 0x382583b9;\n raw_context.iregs[2] = 0x7fccc03f;\n raw_context.iregs[3] = 0xf62f8ec2;\n raw_context.iregs[4] = 0x46a6a6a8;\n raw_context.iregs[5] = 0x6a5025e2;\n raw_context.iregs[6] = 0xd9fabb4a;\n raw_context.iregs[7] = 0x6913f540;\n raw_context.iregs[8] = 0xbffe6eda;\n raw_context.iregs[9] = 0xb2ce1e2d;\n raw_context.iregs[10] = 0x659caaa4;\n raw_context.iregs[11] = 0xf0e0d0c0;\n raw_context.iregs[12] = 0xa9b8c7d6;\n raw_context.iregs[13] = 0x12345678;\n raw_context.iregs[14] = 0xabcd1234;\n raw_context.iregs[15] = 0x10203040;\n raw_context.cpsr = 0x2e951ef7;\n Context context(dump, raw_context);\n\n Exception exception(dump, context,\n 0x1234abcd, // thread id\n 0xdcba4321, // exception code\n 0xf0e0d0c0, // exception flags\n 0x0919a9b9c9d9e9f9ULL); // exception address\n \n dump.Add(&context);\n dump.Add(&exception);\n dump.Finish();\n\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());\n\n MinidumpException *md_exception = minidump.GetException();\n ASSERT_TRUE(md_exception != NULL);\n\n u_int32_t thread_id;\n ASSERT_TRUE(md_exception->GetThreadID(&thread_id));\n ASSERT_EQ(0x1234abcdU, thread_id);\n\n const MDRawExceptionStream* raw_exception = md_exception->exception();\n ASSERT_TRUE(raw_exception != NULL);\n EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);\n EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);\n EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,\n raw_exception->exception_record.exception_address);\n\n MinidumpContext *md_context = md_exception->GetContext();\n ASSERT_TRUE(md_context != NULL);\n ASSERT_EQ((u_int32_t) MD_CONTEXT_ARM, md_context->GetContextCPU());\n const MDRawContextARM *md_raw_context = md_context->GetContextARM();\n ASSERT_TRUE(md_raw_context != NULL);\n ASSERT_EQ((u_int32_t) MD_CONTEXT_ARM_INTEGER,\n (md_raw_context->context_flags\n & MD_CONTEXT_ARM_INTEGER));\n EXPECT_EQ(0x3ecba80dU, raw_context.iregs[0]);\n EXPECT_EQ(0x382583b9U, raw_context.iregs[1]);\n EXPECT_EQ(0x7fccc03fU, raw_context.iregs[2]);\n EXPECT_EQ(0xf62f8ec2U, raw_context.iregs[3]);\n EXPECT_EQ(0x46a6a6a8U, raw_context.iregs[4]);\n EXPECT_EQ(0x6a5025e2U, raw_context.iregs[5]);\n EXPECT_EQ(0xd9fabb4aU, raw_context.iregs[6]);\n EXPECT_EQ(0x6913f540U, raw_context.iregs[7]);\n EXPECT_EQ(0xbffe6edaU, raw_context.iregs[8]);\n EXPECT_EQ(0xb2ce1e2dU, raw_context.iregs[9]);\n EXPECT_EQ(0x659caaa4U, raw_context.iregs[10]);\n EXPECT_EQ(0xf0e0d0c0U, raw_context.iregs[11]);\n EXPECT_EQ(0xa9b8c7d6U, raw_context.iregs[12]);\n EXPECT_EQ(0x12345678U, raw_context.iregs[13]);\n EXPECT_EQ(0xabcd1234U, raw_context.iregs[14]);\n EXPECT_EQ(0x10203040U, raw_context.iregs[15]);\n EXPECT_EQ(0x2e951ef7U, raw_context.cpsr);\n}\n\nTEST(Dump, OneExceptionARMOldFlags) {\n Dump dump(0, kLittleEndian);\n\n MDRawContextARM raw_context;\n // MD_CONTEXT_ARM_INTEGER, but with _OLD\n raw_context.context_flags = MD_CONTEXT_ARM_OLD | 0x00000002;\n raw_context.iregs[0] = 0x3ecba80d;\n raw_context.iregs[1] = 0x382583b9;\n raw_context.iregs[2] = 0x7fccc03f;\n raw_context.iregs[3] = 0xf62f8ec2;\n raw_context.iregs[4] = 0x46a6a6a8;\n raw_context.iregs[5] = 0x6a5025e2;\n raw_context.iregs[6] = 0xd9fabb4a;\n raw_context.iregs[7] = 0x6913f540;\n raw_context.iregs[8] = 0xbffe6eda;\n raw_context.iregs[9] = 0xb2ce1e2d;\n raw_context.iregs[10] = 0x659caaa4;\n raw_context.iregs[11] = 0xf0e0d0c0;\n raw_context.iregs[12] = 0xa9b8c7d6;\n raw_context.iregs[13] = 0x12345678;\n raw_context.iregs[14] = 0xabcd1234;\n raw_context.iregs[15] = 0x10203040;\n raw_context.cpsr = 0x2e951ef7;\n Context context(dump, raw_context);\n\n Exception exception(dump, context,\n 0x1234abcd, // thread id\n 0xdcba4321, // exception code\n 0xf0e0d0c0, // exception flags\n 0x0919a9b9c9d9e9f9ULL); // exception address\n \n dump.Add(&context);\n dump.Add(&exception);\n dump.Finish();\n\n string contents;\n ASSERT_TRUE(dump.GetContents(&contents));\n\n istringstream minidump_stream(contents);\n Minidump minidump(minidump_stream);\n ASSERT_TRUE(minidump.Read());\n ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());\n\n MinidumpException *md_exception = minidump.GetException();\n ASSERT_TRUE(md_exception != NULL);\n\n u_int32_t thread_id;\n ASSERT_TRUE(md_exception->GetThreadID(&thread_id));\n ASSERT_EQ(0x1234abcdU, thread_id);\n\n const MDRawExceptionStream* raw_exception = md_exception->exception();\n ASSERT_TRUE(raw_exception != NULL);\n EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);\n EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);\n EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,\n raw_exception->exception_record.exception_address);\n\n MinidumpContext *md_context = md_exception->GetContext();\n ASSERT_TRUE(md_context != NULL);\n ASSERT_EQ((u_int32_t) MD_CONTEXT_ARM, md_context->GetContextCPU());\n const MDRawContextARM *md_raw_context = md_context->GetContextARM();\n ASSERT_TRUE(md_raw_context != NULL);\n ASSERT_EQ((u_int32_t) MD_CONTEXT_ARM_INTEGER,\n (md_raw_context->context_flags\n & MD_CONTEXT_ARM_INTEGER));\n EXPECT_EQ(0x3ecba80dU, raw_context.iregs[0]);\n EXPECT_EQ(0x382583b9U, raw_context.iregs[1]);\n EXPECT_EQ(0x7fccc03fU, raw_context.iregs[2]);\n EXPECT_EQ(0xf62f8ec2U, raw_context.iregs[3]);\n EXPECT_EQ(0x46a6a6a8U, raw_context.iregs[4]);\n EXPECT_EQ(0x6a5025e2U, raw_context.iregs[5]);\n EXPECT_EQ(0xd9fabb4aU, raw_context.iregs[6]);\n EXPECT_EQ(0x6913f540U, raw_context.iregs[7]);\n EXPECT_EQ(0xbffe6edaU, raw_context.iregs[8]);\n EXPECT_EQ(0xb2ce1e2dU, raw_context.iregs[9]);\n EXPECT_EQ(0x659caaa4U, raw_context.iregs[10]);\n EXPECT_EQ(0xf0e0d0c0U, raw_context.iregs[11]);\n EXPECT_EQ(0xa9b8c7d6U, raw_context.iregs[12]);\n EXPECT_EQ(0x12345678U, raw_context.iregs[13]);\n EXPECT_EQ(0xabcd1234U, raw_context.iregs[14]);\n EXPECT_EQ(0x10203040U, raw_context.iregs[15]);\n EXPECT_EQ(0x2e951ef7U, raw_context.cpsr);\n}\n\n} // namespace\n", "meta": {"content_hash": "f94f54cb89eb0e4ea499942621181f06", "timestamp": "", "source": "github", "line_count": 955, "max_line_length": 78, "avg_line_length": 36.30994764397906, "alnum_prop": 0.6985234744491867, "repo_name": "mhoran/google-breakpad", "id": "1faf169d5c2a5128982dd28aecbfcbf57613fd52", "size": "36710", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/processor/minidump_unittest.cc", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Assembly", "bytes": "7921"}, {"name": "C", "bytes": "1701689"}, {"name": "C++", "bytes": "6143738"}, {"name": "Objective-C", "bytes": "455134"}, {"name": "Perl", "bytes": "125"}, {"name": "Prolog", "bytes": "3262"}, {"name": "Python", "bytes": "447592"}, {"name": "Ruby", "bytes": "107"}, {"name": "Shell", "bytes": "565789"}]}} +{"text": "//====================================================================================================================//\n// File: qcan_server_memeory.hpp //\n// Description: QCAN classes - CAN server //\n// //\n// Copyright (C) MicroControl GmbH & Co. KG //\n// 53844 Troisdorf - Germany //\n// www.microcontrol.net //\n// //\n//--------------------------------------------------------------------------------------------------------------------//\n// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the //\n// following conditions are met: //\n// 1. Redistributions of source code must retain the above copyright notice, this list of conditions, the following //\n// disclaimer and the referenced file 'LICENSE'. //\n// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the //\n// following disclaimer in the documentation and/or other materials provided with the distribution. //\n// 3. Neither the name of MicroControl nor the names of its contributors may be used to endorse or promote products //\n// derived from this software without specific prior written permission. //\n// //\n// Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance //\n// with the License. You may obtain a copy of the License at //\n// //\n// http://www.apache.org/licenses/LICENSE-2.0 //\n// //\n// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed //\n// on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for //\n// the specific language governing permissions and limitations under the License. //\n// //\n//====================================================================================================================//\n\n\n/*--------------------------------------------------------------------------------------------------------------------*\\\n** Include files **\n** **\n\\*--------------------------------------------------------------------------------------------------------------------*/\n\n#include \"qcan_defs.hpp\"\n\n/*--------------------------------------------------------------------------------------------------------------------*\\\n** Definitions **\n** **\n\\*--------------------------------------------------------------------------------------------------------------------*/\n\n#define QCAN_MEMORY_KEY \"QCAN_SERVER_SHARED_KEY\"\n\n/*--------------------------------------------------------------------------------------------------------------------*\\\n** Structures **\n** **\n\\*--------------------------------------------------------------------------------------------------------------------*/\n\ntypedef struct Server_s {\n uint32_t ulVersionMajor;\n uint32_t ulVersionMinor;\n} Server_ts;\n\ntypedef struct Network_s {\n uint32_t ulVersionMajor;\n uint32_t ulVersionMinor;\n} Network_ts;\n\ntypedef struct ServerSettings_s {\n Server_ts tsServer;\n Network_ts atsNetwork[QCAN_NETWORK_MAX];\n} ServerSettings_ts;\n\n", "meta": {"content_hash": "788a0242d048df14435187c11527b5aa", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 120, "avg_line_length": 82.03125, "alnum_prop": 0.27390476190476193, "repo_name": "JoTid/CANpie", "id": "4f6e40cb83b578d82ad00dca3ad4767a7bcfa101", "size": "5250", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "source/qcan/qcan_server_memory.hpp", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "1816"}, {"name": "C", "bytes": "580757"}, {"name": "C++", "bytes": "1054376"}, {"name": "Makefile", "bytes": "16403"}, {"name": "Objective-C", "bytes": "47189"}, {"name": "Prolog", "bytes": "1153"}, {"name": "QMake", "bytes": "55893"}, {"name": "Shell", "bytes": "848"}]}} +{"text": "[react-babylonjs](../README.md) / [Exports](../modules.md) / loaders\n\n# Module: loaders\n\n## Table of contents\n\n### Enumerations\n\n- [LoaderStatus](../enums/loaders.loaderstatus.md)\n- [TaskType](../enums/loaders.tasktype.md)\n\n### Classes\n\n- [LoadedModel](../classes/loaders.loadedmodel.md)\n\n### Interfaces\n\n- [ILoadedModel](../interfaces/loaders.iloadedmodel.md)\n\n### Type aliases\n\n- [AssetManagerContextProviderProps](loaders.md#assetmanagercontextproviderprops)\n- [AssetManagerContextType](loaders.md#assetmanagercontexttype)\n- [AssetManagerOptions](loaders.md#assetmanageroptions)\n- [AssetManagerProgressType](loaders.md#assetmanagerprogresstype)\n- [BinaryTask](loaders.md#binarytask)\n- [MeshTask](loaders.md#meshtask)\n- [SceneLoaderContextProviderProps](loaders.md#sceneloadercontextproviderprops)\n- [SceneLoaderContextType](loaders.md#sceneloadercontexttype)\n- [SceneLoaderOptions](loaders.md#sceneloaderoptions)\n- [Task](loaders.md#task)\n- [TextureTask](loaders.md#texturetask)\n\n### Variables\n\n- [AssetManagerContext](loaders.md#assetmanagercontext)\n- [AssetManagerContextProvider](loaders.md#assetmanagercontextprovider)\n- [SceneLoaderContext](loaders.md#sceneloadercontext)\n- [SceneLoaderContextProvider](loaders.md#sceneloadercontextprovider)\n\n### Functions\n\n- [useAssetManager](loaders.md#useassetmanager)\n- [useSceneLoader](loaders.md#usesceneloader)\n\n## Type aliases\n\n### AssetManagerContextProviderProps\n\n\u01ac **AssetManagerContextProviderProps**: { `children`: React.ReactNode ; `startProgress?`: [*AssetManagerProgressType*](loaders_useassetmanager.md#assetmanagerprogresstype) }\n\n#### Type declaration:\n\nName | Type |\n------ | ------ |\n`children` | React.ReactNode |\n`startProgress?` | [*AssetManagerProgressType*](loaders_useassetmanager.md#assetmanagerprogresstype) |\n\nDefined in: [loaders/useAssetManager.tsx:48](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L48)\n\n___\n\n### AssetManagerContextType\n\n\u01ac **AssetManagerContextType**: { `lastProgress?`: [*AssetManagerProgressType*](loaders_useassetmanager.md#assetmanagerprogresstype) ; `updateProgress`: (`progress`: [*AssetManagerProgressType*](loaders_useassetmanager.md#assetmanagerprogresstype)) => *void* } \\| *undefined*\n\nDefined in: [loaders/useAssetManager.tsx:36](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L36)\n\n___\n\n### AssetManagerOptions\n\n\u01ac **AssetManagerOptions**: { `reportProgress?`: *boolean* ; `scene?`: Scene ; `useDefaultLoadingScreen?`: *boolean* }\n\n#### Type declaration:\n\nName | Type |\n------ | ------ |\n`reportProgress?` | *boolean* |\n`scene?` | Scene |\n`useDefaultLoadingScreen?` | *boolean* |\n\nDefined in: [loaders/useAssetManager.tsx:61](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L61)\n\n___\n\n### AssetManagerProgressType\n\n\u01ac **AssetManagerProgressType**: { `eventData`: IAssetsProgressEvent ; `eventState`: EventState } \\| *undefined*\n\nDefined in: [loaders/useAssetManager.tsx:43](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L43)\n\n___\n\n### BinaryTask\n\n\u01ac **BinaryTask**: { `name`: *string* ; `taskType`: [*Binary*](../enums/loaders/useassetmanager.tasktype.md#binary) ; `url`: *string* }\n\n#### Type declaration:\n\nName | Type |\n------ | ------ |\n`name` | *string* |\n`taskType` | [*Binary*](../enums/loaders/useassetmanager.tasktype.md#binary) |\n`url` | *string* |\n\nDefined in: [loaders/useAssetManager.tsx:11](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L11)\n\n___\n\n### MeshTask\n\n\u01ac **MeshTask**: { `meshesNames?`: *any* ; `name`: *string* ; `rootUrl`: *string* ; `sceneFilename`: *string* ; `taskType`: [*Mesh*](../enums/loaders/useassetmanager.tasktype.md#mesh) }\n\n#### Type declaration:\n\nName | Type |\n------ | ------ |\n`meshesNames?` | *any* |\n`name` | *string* |\n`rootUrl` | *string* |\n`sceneFilename` | *string* |\n`taskType` | [*Mesh*](../enums/loaders/useassetmanager.tasktype.md#mesh) |\n\nDefined in: [loaders/useAssetManager.tsx:17](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L17)\n\n___\n\n### SceneLoaderContextProviderProps\n\n\u01ac **SceneLoaderContextProviderProps**: { `children`: React.ReactNode ; `startProgress?`: ISceneLoaderProgressEvent }\n\n#### Type declaration:\n\nName | Type |\n------ | ------ |\n`children` | React.ReactNode |\n`startProgress?` | ISceneLoaderProgressEvent |\n\nDefined in: [loaders/useSceneLoader.tsx:14](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useSceneLoader.tsx#L14)\n\n___\n\n### SceneLoaderContextType\n\n\u01ac **SceneLoaderContextType**: { `lastProgress?`: *Nullable*<ISceneLoaderProgressEvent\\> ; `updateProgress`: (`progress`: ISceneLoaderProgressEvent) => *void* } \\| *undefined*\n\nDefined in: [loaders/useSceneLoader.tsx:7](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useSceneLoader.tsx#L7)\n\n___\n\n### SceneLoaderOptions\n\n\u01ac **SceneLoaderOptions**: { `alwaysSelectAsActiveMesh?`: *boolean* ; `onModelLoaded?`: (`loadedModel`: [*ILoadedModel*](../interfaces/loaders/loadedmodel.iloadedmodel.md)) => *void* ; `receiveShadows?`: *boolean* ; `reportProgress?`: *boolean* ; `scaleToDimension?`: *number* ; `scene?`: Scene }\n\n#### Type declaration:\n\nName | Type | Description |\n------ | ------ | ------ |\n`alwaysSelectAsActiveMesh?` | *boolean* | Always select root mesh as active. Defaults to false. |\n`onModelLoaded?` | (`loadedModel`: [*ILoadedModel*](../interfaces/loaders/loadedmodel.iloadedmodel.md)) => *void* | Access to loaded model as soon as it is loaded, so it provides a way to hide or scale the meshes before the first render. |\n`receiveShadows?` | *boolean* | set that all meshes receive shadows. Defaults to false. |\n`reportProgress?` | *boolean* | SceneLoader progress events are set on context provider (when available). Defaults to false. |\n`scaleToDimension?` | *number* | Scale entire model within these square bounds Defaults to no scaling. |\n`scene?` | Scene | - |\n\nDefined in: [loaders/useSceneLoader.tsx:27](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useSceneLoader.tsx#L27)\n\n___\n\n### Task\n\n\u01ac **Task**: [*BinaryTask*](loaders_useassetmanager.md#binarytask) \\| [*MeshTask*](loaders_useassetmanager.md#meshtask) \\| [*TextureTask*](loaders_useassetmanager.md#texturetask)\n\nDefined in: [loaders/useAssetManager.tsx:34](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L34)\n\n___\n\n### TextureTask\n\n\u01ac **TextureTask**: { `invertY?`: *boolean* ; `name`: *string* ; `noMipmap?`: *boolean* ; `samplingMode?`: *number* ; `taskType`: [*Texture*](../enums/loaders/useassetmanager.tasktype.md#texture) ; `url`: *string* }\n\n#### Type declaration:\n\nName | Type |\n------ | ------ |\n`invertY?` | *boolean* |\n`name` | *string* |\n`noMipmap?` | *boolean* |\n`samplingMode?` | *number* |\n`taskType` | [*Texture*](../enums/loaders/useassetmanager.tasktype.md#texture) |\n`url` | *string* |\n\nDefined in: [loaders/useAssetManager.tsx:25](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L25)\n\n## Variables\n\n### AssetManagerContext\n\n\u2022 `Const` **AssetManagerContext**: *Context*<[*AssetManagerContextType*](loaders_useassetmanager.md#assetmanagercontexttype)\\>\n\nDefined in: [loaders/useAssetManager.tsx:41](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L41)\n\n___\n\n### AssetManagerContextProvider\n\n\u2022 `Const` **AssetManagerContextProvider**: *React.FC*<[*AssetManagerContextProviderProps*](loaders_useassetmanager.md#assetmanagercontextproviderprops)\\>\n\nDefined in: [loaders/useAssetManager.tsx:53](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L53)\n\n___\n\n### SceneLoaderContext\n\n\u2022 `Const` **SceneLoaderContext**: *Context*<[*SceneLoaderContextType*](loaders_usesceneloader.md#sceneloadercontexttype)\\>\n\nDefined in: [loaders/useSceneLoader.tsx:12](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useSceneLoader.tsx#L12)\n\n___\n\n### SceneLoaderContextProvider\n\n\u2022 `Const` **SceneLoaderContextProvider**: *React.FC*<[*SceneLoaderContextProviderProps*](loaders_usesceneloader.md#sceneloadercontextproviderprops)\\>\n\nDefined in: [loaders/useSceneLoader.tsx:19](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useSceneLoader.tsx#L19)\n\n## Functions\n\n### useAssetManager\n\n\u25b8 `Const`**useAssetManager**(`tasks`: [*Task*](loaders_useassetmanager.md#task)[], `options?`: [*AssetManagerOptions*](loaders_useassetmanager.md#assetmanageroptions)): AssetManagerResult\n\n#### Parameters:\n\nName | Type |\n------ | ------ |\n`tasks` | [*Task*](loaders_useassetmanager.md#task)[] |\n`options?` | [*AssetManagerOptions*](loaders_useassetmanager.md#assetmanageroptions) |\n\n**Returns:** AssetManagerResult\n\nDefined in: [loaders/useAssetManager.tsx:249](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useAssetManager.tsx#L249)\n\n___\n\n### useSceneLoader\n\n\u25b8 `Const`**useSceneLoader**(`rootUrl`: *string*, `sceneFilename`: *string*, `pluginExtension?`: *string*, `options?`: [*SceneLoaderOptions*](loaders_usesceneloader.md#sceneloaderoptions)): [*LoadedModel*](../classes/loaders/loadedmodel.loadedmodel.md)\n\n#### Parameters:\n\nName | Type |\n------ | ------ |\n`rootUrl` | *string* |\n`sceneFilename` | *string* |\n`pluginExtension?` | *string* |\n`options?` | [*SceneLoaderOptions*](loaders_usesceneloader.md#sceneloaderoptions) |\n\n**Returns:** [*LoadedModel*](../classes/loaders/loadedmodel.loadedmodel.md)\n\nDefined in: [loaders/useSceneLoader.tsx:202](https://github.com/brianzinn/react-babylonjs/blob/eba7b00/src/hooks/loaders/useSceneLoader.tsx#L202)\n", "meta": {"content_hash": "efc4b738c896959586b0276690520833", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 296, "avg_line_length": 37.48091603053435, "alnum_prop": 0.7344195519348269, "repo_name": "brianzinn/react-babylonJS", "id": "dec1387e403e9efd81620c5642b04ed3df2913ea", "size": "9843", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/hooks/modules/loaders.md", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "1014"}, {"name": "TypeScript", "bytes": "24537"}]}} +{"text": "function SendChatMessage(...)\nend;\n\nfunction SendAddonMessage(...)\nend;\n\nfunction GetDefaultLanguage()\n\treturn \"Common\";\nend;\n", "meta": {"content_hash": "b7f92922f981fb3896a0311358c8fdcc", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 30, "avg_line_length": 14.0, "alnum_prop": 0.746031746031746, "repo_name": "Thonik/FritoMod", "id": "752bbbd9051336f91963032e6e76ff3befa68dc4", "size": "126", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wow/api/Chat.lua", "mode": "33188", "license": "mit", "language": []}} +{"text": "package com.intellij.java.codeInsight.daemon;\n\nimport com.intellij.JavaTestUtil;\nimport com.intellij.codeInsight.daemon.DaemonAnalyzerTestCase;\nimport com.intellij.codeInsight.daemon.impl.HighlightInfo;\nimport com.intellij.codeInsight.intention.IntentionAction;\nimport com.intellij.codeInspection.redundantCast.RedundantCastInspection;\nimport com.intellij.lang.annotation.HighlightSeverity;\nimport com.intellij.lang.java.JavaDocumentationProvider;\nimport com.intellij.openapi.editor.Document;\nimport com.intellij.openapi.editor.Editor;\nimport com.intellij.openapi.editor.EditorFactory;\nimport com.intellij.openapi.progress.EmptyProgressIndicator;\nimport com.intellij.openapi.progress.ProgressManager;\nimport com.intellij.openapi.project.Project;\nimport com.intellij.openapi.util.Disposer;\nimport com.intellij.psi.*;\nimport com.intellij.psi.infos.CandidateInfo;\nimport com.intellij.psi.search.searches.ReferencesSearch;\nimport com.intellij.psi.util.PsiTreeUtil;\nimport com.intellij.psi.util.TypeConversionUtil;\nimport com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;\nimport com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl;\nimport com.intellij.util.ArrayUtilRt;\n\nimport java.util.List;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class LightAdvHighlightingFixtureTest extends LightJavaCodeInsightFixtureTestCase {\n \n\n @Override\n protected String getBasePath() {\n return JavaTestUtil.getRelativeJavaTestDataPath() + \"/codeInsight/daemonCodeAnalyzer/advFixture\";\n }\n\n public void testHidingOnDemandImports() {\n //noinspection StaticNonFinalField\n myFixture.addClass(\"package foo; public class Foo {\" +\n \" public static String foo;\" +\n \"}\");\n myFixture.addClass(\"package foo; public class Bar {\" +\n \" public static void foo(String s) {}\" +\n \"}\");\n myFixture.configureByFile(getTestName(false) + \".java\");\n myFixture.checkHighlighting(false, false, false);\n }\n\n public void testFilteredCandidates() {\n PsiFile file = myFixture.configureByText(\"a.java\", \"class a {{new StringBuilder().ap<caret>pend();}}\");\n PsiCallExpression callExpression =\n PsiTreeUtil.getParentOfType(file.findElementAt(myFixture.getEditor().getCaretModel().getOffset()), PsiCallExpression.class);\n assertNotNull(callExpression);\n CandidateInfo[] candidates =\n PsiResolveHelper.getInstance(myFixture.getProject()).getReferencedMethodCandidates(callExpression, false);\n assertSize(27, candidates);\n String generateDoc = new JavaDocumentationProvider().generateDoc(callExpression, callExpression);\n assertEquals(\"<html>Candidates for method call <b>new StringBuilder().append()</b> are:<br><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(java.lang.Object)\\\">StringBuilder append(Object)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(java.lang.String)\\\">StringBuilder append(String)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(java.lang.StringBuilder)\\\">StringBuilder append(StringBuilder)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(java.lang.StringBuffer)\\\">StringBuilder append(StringBuffer)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(java.lang.CharSequence)\\\">StringBuilder append(CharSequence)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(java.lang.CharSequence, int, int)\\\">StringBuilder append(CharSequence, int, int)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(char[])\\\">StringBuilder append(char[])</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(char[], int, int)\\\">StringBuilder append(char[], int, int)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(boolean)\\\">StringBuilder append(boolean)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(char)\\\">StringBuilder append(char)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(int)\\\">StringBuilder append(int)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(long)\\\">StringBuilder append(long)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(float)\\\">StringBuilder append(float)</a><br> \" +\n \"<a href=\\\"psi_element://java.lang.StringBuilder#append(double)\\\">StringBuilder append(double)</a><br></html>\", generateDoc);\n }\n\n public void testPackageNamedAsClassInDefaultPackage() {\n myFixture.addClass(\"package test; public class A {}\");\n PsiClass aClass = myFixture.addClass(\"public class test {}\");\n doTest();\n assertNull(ProgressManager.getInstance().runProcess(() -> ReferencesSearch.search(aClass).findFirst(), new EmptyProgressIndicator()));\n }\n\n public void testPackageNameAsClassFQName() {\n myFixture.addClass(\"package foo.Bar; class A {}\");\n myFixture.addClass(\"package foo; public class Bar { public static class Inner {}}\");\n doTest();\n }\n\n public void testInaccessibleFunctionalTypeParameter() {\n myFixture.addClass(\"package test; class A {}\");\n myFixture.addClass(\"package test; public interface I { void m(A a);}\");\n myFixture.addClass(\"package test; public interface J { A m();}\");\n doTest();\n }\n\n public void testBoundsPromotionWithCapturedWildcards() {\n myFixture.addClass(\"package a; public interface Provider<A> {}\");\n myFixture.addClass(\"package b; public interface Provider<B> {}\");\n doTest();\n }\n\n public void testStaticImportCompoundWithInheritance() {\n myFixture.addClass(\"package a; public interface A { static void foo(Object o){} static void foo(String str) {}}\");\n doTest();\n }\n\n public void testSuppressedInGenerated() {\n myFixture.enableInspections(new RedundantCastInspection());\n myFixture.addClass(\"package javax.annotation; public @interface Generated {}\");\n doTest();\n }\n\n public void testReferenceThroughInheritance() {\n myFixture.addClass(\"package test;\\n\" +\n \"public class A {\\n\" +\n \" public static class B {}\\n\" +\n \"}\");\n doTest();\n }\n\n public void testReferenceThroughInheritance1() {\n //noinspection UnnecessaryInterfaceModifier\n myFixture.addClass(\"package me;\\n\" +\n \"import me.Serializer.Format;\\n\" +\n \"public interface Serializer<F extends Format> {\\n\" +\n \" public static interface Format {}\\n\" +\n \"}\\n\");\n doTest();\n }\n\n public void testUsageOfProtectedAnnotationOutsideAPackage() {\n myFixture.addClass(\"package a;\\n\" +\n \"import java.lang.annotation.ElementType;\\n\" +\n \"import java.lang.annotation.Target;\\n\" +\n \"\\n\" +\n \"public class A {\\n\" +\n \" @Target( { ElementType.METHOD, ElementType.TYPE } )\\n\" +\n \" protected @interface Test{\\n\" +\n \" }\\n\" +\n \"}\");\n doTest();\n }\n\n public void testPackageLocalClassUsedInArrayTypeOutsidePackage() {\n myFixture.addClass(\"package a; class A {}\");\n myFixture.addClass(\"package a; public class B {public static A[] getAs() {return null;}}\");\n doTest();\n }\n\n public void testProtectedFieldUsedInAnnotationParameterOfInheritor() {\n myFixture.addClass(\"package a; public class A {protected final static String A_FOO = \\\"A\\\";}\");\n doTest();\n }\n\n public void testStaticImportClassConflictingWithPackageName() {\n myFixture.addClass(\"package p.P1; class Unrelated {}\");\n myFixture.addClass(\"package p; public class P1 {public static final int FOO = 1;}\");\n doTest();\n }\n\n public void testAmbiguousMethodCallWhenStaticImported() {\n myFixture.addClass(\"package p;\" +\n \"class A<K> {\\n\" +\n \" static <T> A<T> of(T t) {\\n\" +\n \" return null;\\n\" +\n \" }\\n\" +\n \"}\\n\" +\n \"class B<K> {\\n\" +\n \" static <T> B<T> of(T t) {\\n\" +\n \" return null;\\n\" +\n \" }\\n\" +\n \" static <T> B<T> of(T... t) {\\n\" +\n \" return null;\\n\" +\n \" }\\n\" +\n \"}\\n\");\n doTest();\n }\n\n public void testClassPackageConflict() {\n myFixture.addClass(\"package a; public class b {}\");\n myFixture.addClass(\"package c; public class a {}\");\n doTest();\n }\n\n public void testClassPackageConflict1() {\n myFixture.addClass(\"package a; public class b {}\");\n myFixture.addClass(\"package c.d; public class a {}\");\n doTest();\n }\n\n public void testTypeAnnotations() {\n myFixture.addClass(\"import java.lang.annotation.ElementType;\\n\" +\n \"import java.lang.annotation.Target;\\n\" +\n \"@Target({ElementType.TYPE_USE})\\n\" +\n \"@interface Nullable {}\\n\");\n myFixture.addClass(\"class Middle<R> extends Base<@Nullable R, String>{}\");\n myFixture.addClass(\"class Child<R> extends Middle<R>{}\");\n PsiClass baseClass = myFixture.addClass(\"class Base<R, C> {}\");\n PsiClass fooClass = myFixture.addClass(\"class Foo {\\n\" +\n \" Child<String> field;\\n\" +\n \"}\");\n PsiField fooField = fooClass.findFieldByName(\"field\", false);\n PsiType substituted =\n TypeConversionUtil.getSuperClassSubstitutor(baseClass, (PsiClassType)fooField.getType()).substitute(baseClass.getTypeParameters()[0]);\n assertEquals(1, substituted.getAnnotations().length);\n }\n\n public void testCodeFragmentMayAccessDefaultPackage() {\n myFixture.addClass(\"public class MainClass { }\");\n\n Project project = getProject();\n PsiElement context = JavaPsiFacade.getInstance(project).findPackage(\"\");\n JavaCodeFragment fragment = JavaCodeFragmentFactory.getInstance(project).createReferenceCodeFragment(\"MainClass\", context, true, true);\n Document document = PsiDocumentManager.getInstance(project).getDocument(fragment);\n Editor editor = EditorFactory.getInstance().createViewer(document, project);\n Disposer.register(myFixture.getTestRootDisposable(), () -> EditorFactory.getInstance().releaseEditor(editor));\n\n List<HighlightInfo> highlights = CodeInsightTestFixtureImpl.instantiateAndRun(fragment, editor, ArrayUtilRt.EMPTY_INT_ARRAY, false);\n List<HighlightInfo> problems = DaemonAnalyzerTestCase.filter(highlights, HighlightSeverity.WARNING);\n assertThat(problems).isEmpty();\n }\n\n public void testImplicitConstructorAccessibility() {\n myFixture.addClass(\"package a; public class Base {\" +\n \"private Base() {}\\n\" +\n \"protected Base(int... i) {}\\n\" +\n \"}\");\n doTest();\n }\n\n public void testDiamondsWithAnonymousProtectedConstructor() {\n myFixture.addClass(\"package a; public class Base<T> { protected Base() {}}\");\n doTest();\n }\n \n public void testDiamondsWithProtectedCallInConstruction() {\n myFixture.addClass(\"package a; public class Base { \" +\n \" protected String createString() {return null;}\" +\n \"}\");\n doTest();\n }\n\n public void testDefaultAnnotationsApplicability() {\n myFixture.addClass(\"package foo; public @interface A {}\");\n myFixture.configureByFile(\"module-info.java\");\n myFixture.checkHighlighting();\n }\n\n public void testAlwaysFalseForLoop() {\n doTest();\n IntentionAction action = myFixture.findSingleIntention(\"Remove 'for' statement\");\n myFixture.launchAction(action);\n myFixture.checkResultByFile(getTestName(false) + \"_after.java\");\n }\n\n public void testProtectedInnerClass() {\n myFixture.addClass(\"package a;\\n\" +\n \"public class Outer {\\n\" +\n \" public Object get(Inner key) {\\n\" +\n \" return null;\\n\" +\n \" }\\n\" +\n \" public Inner get1() {return null;} \\n\" +\n \" public Inner f; \\n\" +\n \" protected class Inner {}\\n\" +\n \"}\");\n doTest();\n }\n \n public void testProtectedInnerClass1() {\n myFixture.addClass(\"package a;\\n\" +\n \"public class A<T> {\\n\" +\n \" public T getData() {return null;}\\n\" +\n \"}\");\n myFixture.addClass(\"package a;\\n\" +\n \"public class Outer extends A<Outer.Inner> {\\n\" +\n \" protected class Inner {}\\n\" +\n \"}\");\n doTest();\n }\n\n private void doTest() {\n myFixture.configureByFile(getTestName(false) + \".java\");\n myFixture.checkHighlighting();\n }\n}", "meta": {"content_hash": "ef7d91961df677bfcbca9006a8fcdde5", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 176, "avg_line_length": 46.435087719298245, "alnum_prop": 0.6320840259936528, "repo_name": "google/intellij-community", "id": "913fb7ace30ea2c7bbdb34897f4ae4c15628b887", "size": "13355", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/LightAdvHighlightingFixtureTest.java", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "// Copyright 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n// Unit tests for the SyncApi. Note that a lot of the underlying\n// functionality is provided by the Syncable layer, which has its own\n// unit tests. We'll test SyncApi specific things in this harness.\n\n#include <cstddef>\n#include <map>\n\n#include \"base/basictypes.h\"\n#include \"base/callback.h\"\n#include \"base/compiler_specific.h\"\n#include \"base/files/scoped_temp_dir.h\"\n#include \"base/format_macros.h\"\n#include \"base/location.h\"\n#include \"base/memory/scoped_ptr.h\"\n#include \"base/message_loop.h\"\n#include \"base/message_loop/message_loop_proxy.h\"\n#include \"base/strings/string_number_conversions.h\"\n#include \"base/strings/stringprintf.h\"\n#include \"base/strings/utf_string_conversions.h\"\n#include \"base/test/values_test_util.h\"\n#include \"base/values.h\"\n#include \"sync/engine/sync_scheduler.h\"\n#include \"sync/internal_api/public/base/model_type_test_util.h\"\n#include \"sync/internal_api/public/change_record.h\"\n#include \"sync/internal_api/public/engine/model_safe_worker.h\"\n#include \"sync/internal_api/public/engine/polling_constants.h\"\n#include \"sync/internal_api/public/http_post_provider_factory.h\"\n#include \"sync/internal_api/public/http_post_provider_interface.h\"\n#include \"sync/internal_api/public/read_node.h\"\n#include \"sync/internal_api/public/read_transaction.h\"\n#include \"sync/internal_api/public/test/test_entry_factory.h\"\n#include \"sync/internal_api/public/test/test_internal_components_factory.h\"\n#include \"sync/internal_api/public/test/test_user_share.h\"\n#include \"sync/internal_api/public/write_node.h\"\n#include \"sync/internal_api/public/write_transaction.h\"\n#include \"sync/internal_api/sync_encryption_handler_impl.h\"\n#include \"sync/internal_api/sync_manager_impl.h\"\n#include \"sync/internal_api/syncapi_internal.h\"\n#include \"sync/js/js_arg_list.h\"\n#include \"sync/js/js_backend.h\"\n#include \"sync/js/js_event_handler.h\"\n#include \"sync/js/js_reply_handler.h\"\n#include \"sync/js/js_test_util.h\"\n#include \"sync/notifier/fake_invalidation_handler.h\"\n#include \"sync/notifier/fake_invalidator.h\"\n#include \"sync/notifier/invalidation_handler.h\"\n#include \"sync/notifier/invalidator.h\"\n#include \"sync/protocol/bookmark_specifics.pb.h\"\n#include \"sync/protocol/encryption.pb.h\"\n#include \"sync/protocol/extension_specifics.pb.h\"\n#include \"sync/protocol/password_specifics.pb.h\"\n#include \"sync/protocol/preference_specifics.pb.h\"\n#include \"sync/protocol/proto_value_conversions.h\"\n#include \"sync/protocol/sync.pb.h\"\n#include \"sync/sessions/sync_session.h\"\n#include \"sync/syncable/directory.h\"\n#include \"sync/syncable/entry.h\"\n#include \"sync/syncable/mutable_entry.h\"\n#include \"sync/syncable/nigori_util.h\"\n#include \"sync/syncable/syncable_id.h\"\n#include \"sync/syncable/syncable_read_transaction.h\"\n#include \"sync/syncable/syncable_util.h\"\n#include \"sync/syncable/syncable_write_transaction.h\"\n#include \"sync/test/callback_counter.h\"\n#include \"sync/test/engine/fake_sync_scheduler.h\"\n#include \"sync/test/engine/test_id_factory.h\"\n#include \"sync/test/fake_encryptor.h\"\n#include \"sync/test/fake_extensions_activity_monitor.h\"\n#include \"sync/util/cryptographer.h\"\n#include \"sync/util/extensions_activity_monitor.h\"\n#include \"sync/util/test_unrecoverable_error_handler.h\"\n#include \"sync/util/time.h\"\n#include \"testing/gmock/include/gmock/gmock.h\"\n#include \"testing/gtest/include/gtest/gtest.h\"\n\nusing base::ExpectDictStringValue;\nusing testing::_;\nusing testing::DoAll;\nusing testing::InSequence;\nusing testing::Return;\nusing testing::SaveArg;\nusing testing::StrictMock;\n\nnamespace syncer {\n\nusing sessions::SyncSessionSnapshot;\nusing syncable::GET_BY_HANDLE;\nusing syncable::IS_DEL;\nusing syncable::IS_UNSYNCED;\nusing syncable::NON_UNIQUE_NAME;\nusing syncable::SPECIFICS;\nusing syncable::kEncryptedString;\n\nnamespace {\n\nconst char kTestChromeVersion[] = \"test chrome version\";\n\nvoid ExpectInt64Value(int64 expected_value,\n const base::DictionaryValue& value,\n const std::string& key) {\n std::string int64_str;\n EXPECT_TRUE(value.GetString(key, &int64_str));\n int64 val = 0;\n EXPECT_TRUE(base::StringToInt64(int64_str, &val));\n EXPECT_EQ(expected_value, val);\n}\n\nvoid ExpectTimeValue(const base::Time& expected_value,\n const base::DictionaryValue& value,\n const std::string& key) {\n std::string time_str;\n EXPECT_TRUE(value.GetString(key, &time_str));\n EXPECT_EQ(GetTimeDebugString(expected_value), time_str);\n}\n\n// Makes a non-folder child of the root node. Returns the id of the\n// newly-created node.\nint64 MakeNode(UserShare* share,\n ModelType model_type,\n const std::string& client_tag) {\n WriteTransaction trans(FROM_HERE, share);\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n WriteNode node(&trans);\n WriteNode::InitUniqueByCreationResult result =\n node.InitUniqueByCreation(model_type, root_node, client_tag);\n EXPECT_EQ(WriteNode::INIT_SUCCESS, result);\n node.SetIsFolder(false);\n return node.GetId();\n}\n\n// Makes a folder child of a non-root node. Returns the id of the\n// newly-created node.\nint64 MakeFolderWithParent(UserShare* share,\n ModelType model_type,\n int64 parent_id,\n BaseNode* predecessor) {\n WriteTransaction trans(FROM_HERE, share);\n ReadNode parent_node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, parent_node.InitByIdLookup(parent_id));\n WriteNode node(&trans);\n EXPECT_TRUE(node.InitBookmarkByCreation(parent_node, predecessor));\n node.SetIsFolder(true);\n return node.GetId();\n}\n\nint64 MakeBookmarkWithParent(UserShare* share,\n int64 parent_id,\n BaseNode* predecessor) {\n WriteTransaction trans(FROM_HERE, share);\n ReadNode parent_node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, parent_node.InitByIdLookup(parent_id));\n WriteNode node(&trans);\n EXPECT_TRUE(node.InitBookmarkByCreation(parent_node, predecessor));\n return node.GetId();\n}\n\n// Creates the \"synced\" root node for a particular datatype. We use the syncable\n// methods here so that the syncer treats these nodes as if they were already\n// received from the server.\nint64 MakeServerNodeForType(UserShare* share,\n ModelType model_type) {\n sync_pb::EntitySpecifics specifics;\n AddDefaultFieldValue(model_type, &specifics);\n syncable::WriteTransaction trans(\n FROM_HERE, syncable::UNITTEST, share->directory.get());\n // Attempt to lookup by nigori tag.\n std::string type_tag = ModelTypeToRootTag(model_type);\n syncable::Id node_id = syncable::Id::CreateFromServerId(type_tag);\n syncable::MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM,\n node_id);\n EXPECT_TRUE(entry.good());\n entry.Put(syncable::BASE_VERSION, 1);\n entry.Put(syncable::SERVER_VERSION, 1);\n entry.Put(syncable::IS_UNAPPLIED_UPDATE, false);\n entry.Put(syncable::SERVER_PARENT_ID, syncable::GetNullId());\n entry.Put(syncable::SERVER_IS_DIR, true);\n entry.Put(syncable::IS_DIR, true);\n entry.Put(syncable::SERVER_SPECIFICS, specifics);\n entry.Put(syncable::UNIQUE_SERVER_TAG, type_tag);\n entry.Put(syncable::NON_UNIQUE_NAME, type_tag);\n entry.Put(syncable::IS_DEL, false);\n entry.Put(syncable::SPECIFICS, specifics);\n return entry.Get(syncable::META_HANDLE);\n}\n\n// Simulates creating a \"synced\" node as a child of the root datatype node.\nint64 MakeServerNode(UserShare* share, ModelType model_type,\n const std::string& client_tag,\n const std::string& hashed_tag,\n const sync_pb::EntitySpecifics& specifics) {\n syncable::WriteTransaction trans(\n FROM_HERE, syncable::UNITTEST, share->directory.get());\n syncable::Entry root_entry(&trans, syncable::GET_BY_SERVER_TAG,\n ModelTypeToRootTag(model_type));\n EXPECT_TRUE(root_entry.good());\n syncable::Id root_id = root_entry.Get(syncable::ID);\n syncable::Id node_id = syncable::Id::CreateFromServerId(client_tag);\n syncable::MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM,\n node_id);\n EXPECT_TRUE(entry.good());\n entry.Put(syncable::BASE_VERSION, 1);\n entry.Put(syncable::SERVER_VERSION, 1);\n entry.Put(syncable::IS_UNAPPLIED_UPDATE, false);\n entry.Put(syncable::SERVER_PARENT_ID, root_id);\n entry.Put(syncable::PARENT_ID, root_id);\n entry.Put(syncable::SERVER_IS_DIR, false);\n entry.Put(syncable::IS_DIR, false);\n entry.Put(syncable::SERVER_SPECIFICS, specifics);\n entry.Put(syncable::NON_UNIQUE_NAME, client_tag);\n entry.Put(syncable::UNIQUE_CLIENT_TAG, hashed_tag);\n entry.Put(syncable::IS_DEL, false);\n entry.Put(syncable::SPECIFICS, specifics);\n return entry.Get(syncable::META_HANDLE);\n}\n\n} // namespace\n\nclass SyncApiTest : public testing::Test {\n public:\n virtual void SetUp() {\n test_user_share_.SetUp();\n }\n\n virtual void TearDown() {\n test_user_share_.TearDown();\n }\n\n protected:\n base::MessageLoop message_loop_;\n TestUserShare test_user_share_;\n};\n\nTEST_F(SyncApiTest, SanityCheckTest) {\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n EXPECT_TRUE(trans.GetWrappedTrans());\n }\n {\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n EXPECT_TRUE(trans.GetWrappedTrans());\n }\n {\n // No entries but root should exist\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode node(&trans);\n // Metahandle 1 can be root, sanity check 2\n EXPECT_EQ(BaseNode::INIT_FAILED_ENTRY_NOT_GOOD, node.InitByIdLookup(2));\n }\n}\n\nTEST_F(SyncApiTest, BasicTagWrite) {\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n EXPECT_EQ(root_node.GetFirstChildId(), 0);\n }\n\n ignore_result(MakeNode(test_user_share_.user_share(),\n BOOKMARKS, \"testtag\"));\n\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, \"testtag\"));\n\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n EXPECT_NE(node.GetId(), 0);\n EXPECT_EQ(node.GetId(), root_node.GetFirstChildId());\n }\n}\n\nTEST_F(SyncApiTest, ModelTypesSiloed) {\n {\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n EXPECT_EQ(root_node.GetFirstChildId(), 0);\n }\n\n ignore_result(MakeNode(test_user_share_.user_share(),\n BOOKMARKS, \"collideme\"));\n ignore_result(MakeNode(test_user_share_.user_share(),\n PREFERENCES, \"collideme\"));\n ignore_result(MakeNode(test_user_share_.user_share(),\n AUTOFILL, \"collideme\"));\n\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n\n ReadNode bookmarknode(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n bookmarknode.InitByClientTagLookup(BOOKMARKS,\n \"collideme\"));\n\n ReadNode prefnode(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n prefnode.InitByClientTagLookup(PREFERENCES,\n \"collideme\"));\n\n ReadNode autofillnode(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n autofillnode.InitByClientTagLookup(AUTOFILL,\n \"collideme\"));\n\n EXPECT_NE(bookmarknode.GetId(), prefnode.GetId());\n EXPECT_NE(autofillnode.GetId(), prefnode.GetId());\n EXPECT_NE(bookmarknode.GetId(), autofillnode.GetId());\n }\n}\n\nTEST_F(SyncApiTest, ReadMissingTagsFails) {\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_FAILED_ENTRY_NOT_GOOD,\n node.InitByClientTagLookup(BOOKMARKS,\n \"testtag\"));\n }\n {\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_FAILED_ENTRY_NOT_GOOD,\n node.InitByClientTagLookup(BOOKMARKS,\n \"testtag\"));\n }\n}\n\n// TODO(chron): Hook this all up to the server and write full integration tests\n// for update->undelete behavior.\nTEST_F(SyncApiTest, TestDeleteBehavior) {\n int64 node_id;\n int64 folder_id;\n std::string test_title(\"test1\");\n\n {\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n\n // we'll use this spare folder later\n WriteNode folder_node(&trans);\n EXPECT_TRUE(folder_node.InitBookmarkByCreation(root_node, NULL));\n folder_id = folder_node.GetId();\n\n WriteNode wnode(&trans);\n WriteNode::InitUniqueByCreationResult result =\n wnode.InitUniqueByCreation(BOOKMARKS, root_node, \"testtag\");\n EXPECT_EQ(WriteNode::INIT_SUCCESS, result);\n wnode.SetIsFolder(false);\n wnode.SetTitle(UTF8ToWide(test_title));\n\n node_id = wnode.GetId();\n }\n\n // Ensure we can delete something with a tag.\n {\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n WriteNode wnode(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n wnode.InitByClientTagLookup(BOOKMARKS,\n \"testtag\"));\n EXPECT_FALSE(wnode.GetIsFolder());\n EXPECT_EQ(wnode.GetTitle(), test_title);\n\n wnode.Tombstone();\n }\n\n // Lookup of a node which was deleted should return failure,\n // but have found some data about the node.\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_FAILED_ENTRY_IS_DEL,\n node.InitByClientTagLookup(BOOKMARKS,\n \"testtag\"));\n // Note that for proper function of this API this doesn't need to be\n // filled, we're checking just to make sure the DB worked in this test.\n EXPECT_EQ(node.GetTitle(), test_title);\n }\n\n {\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode folder_node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, folder_node.InitByIdLookup(folder_id));\n\n WriteNode wnode(&trans);\n // This will undelete the tag.\n WriteNode::InitUniqueByCreationResult result =\n wnode.InitUniqueByCreation(BOOKMARKS, folder_node, \"testtag\");\n EXPECT_EQ(WriteNode::INIT_SUCCESS, result);\n EXPECT_EQ(wnode.GetIsFolder(), false);\n EXPECT_EQ(wnode.GetParentId(), folder_node.GetId());\n EXPECT_EQ(wnode.GetId(), node_id);\n EXPECT_NE(wnode.GetTitle(), test_title); // Title should be cleared\n wnode.SetTitle(UTF8ToWide(test_title));\n }\n\n // Now look up should work.\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS,\n \"testtag\"));\n EXPECT_EQ(node.GetTitle(), test_title);\n EXPECT_EQ(node.GetModelType(), BOOKMARKS);\n }\n}\n\nTEST_F(SyncApiTest, WriteAndReadPassword) {\n KeyParams params = {\"localhost\", \"username\", \"passphrase\"};\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n trans.GetCryptographer()->AddKey(params);\n }\n {\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n\n WriteNode password_node(&trans);\n WriteNode::InitUniqueByCreationResult result =\n password_node.InitUniqueByCreation(PASSWORDS,\n root_node, \"foo\");\n EXPECT_EQ(WriteNode::INIT_SUCCESS, result);\n sync_pb::PasswordSpecificsData data;\n data.set_password_value(\"secret\");\n password_node.SetPasswordSpecifics(data);\n }\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n\n ReadNode password_node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n password_node.InitByClientTagLookup(PASSWORDS, \"foo\"));\n const sync_pb::PasswordSpecificsData& data =\n password_node.GetPasswordSpecifics();\n EXPECT_EQ(\"secret\", data.password_value());\n }\n}\n\nTEST_F(SyncApiTest, WriteEncryptedTitle) {\n KeyParams params = {\"localhost\", \"username\", \"passphrase\"};\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n trans.GetCryptographer()->AddKey(params);\n }\n test_user_share_.encryption_handler()->EnableEncryptEverything();\n int bookmark_id;\n {\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n\n WriteNode bookmark_node(&trans);\n ASSERT_TRUE(bookmark_node.InitBookmarkByCreation(root_node, NULL));\n bookmark_id = bookmark_node.GetId();\n bookmark_node.SetTitle(UTF8ToWide(\"foo\"));\n\n WriteNode pref_node(&trans);\n WriteNode::InitUniqueByCreationResult result =\n pref_node.InitUniqueByCreation(PREFERENCES, root_node, \"bar\");\n ASSERT_EQ(WriteNode::INIT_SUCCESS, result);\n pref_node.SetTitle(UTF8ToWide(\"bar\"));\n }\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n\n ReadNode bookmark_node(&trans);\n ASSERT_EQ(BaseNode::INIT_OK, bookmark_node.InitByIdLookup(bookmark_id));\n EXPECT_EQ(\"foo\", bookmark_node.GetTitle());\n EXPECT_EQ(kEncryptedString,\n bookmark_node.GetEntry()->Get(syncable::NON_UNIQUE_NAME));\n\n ReadNode pref_node(&trans);\n ASSERT_EQ(BaseNode::INIT_OK,\n pref_node.InitByClientTagLookup(PREFERENCES,\n \"bar\"));\n EXPECT_EQ(kEncryptedString, pref_node.GetTitle());\n }\n}\n\nTEST_F(SyncApiTest, BaseNodeSetSpecifics) {\n int64 child_id = MakeNode(test_user_share_.user_share(),\n BOOKMARKS, \"testtag\");\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(child_id));\n\n sync_pb::EntitySpecifics entity_specifics;\n entity_specifics.mutable_bookmark()->set_url(\"http://www.google.com\");\n\n EXPECT_NE(entity_specifics.SerializeAsString(),\n node.GetEntitySpecifics().SerializeAsString());\n node.SetEntitySpecifics(entity_specifics);\n EXPECT_EQ(entity_specifics.SerializeAsString(),\n node.GetEntitySpecifics().SerializeAsString());\n}\n\nTEST_F(SyncApiTest, BaseNodeSetSpecificsPreservesUnknownFields) {\n int64 child_id = MakeNode(test_user_share_.user_share(),\n BOOKMARKS, \"testtag\");\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(child_id));\n EXPECT_TRUE(node.GetEntitySpecifics().unknown_fields().empty());\n\n sync_pb::EntitySpecifics entity_specifics;\n entity_specifics.mutable_bookmark()->set_url(\"http://www.google.com\");\n entity_specifics.mutable_unknown_fields()->AddFixed32(5, 100);\n node.SetEntitySpecifics(entity_specifics);\n EXPECT_FALSE(node.GetEntitySpecifics().unknown_fields().empty());\n\n entity_specifics.mutable_unknown_fields()->Clear();\n node.SetEntitySpecifics(entity_specifics);\n EXPECT_FALSE(node.GetEntitySpecifics().unknown_fields().empty());\n}\n\nnamespace {\n\nvoid CheckNodeValue(const BaseNode& node, const base::DictionaryValue& value,\n bool is_detailed) {\n size_t expected_field_count = 4;\n\n ExpectInt64Value(node.GetId(), value, \"id\");\n {\n bool is_folder = false;\n EXPECT_TRUE(value.GetBoolean(\"isFolder\", &is_folder));\n EXPECT_EQ(node.GetIsFolder(), is_folder);\n }\n ExpectDictStringValue(node.GetTitle(), value, \"title\");\n\n ModelType expected_model_type = node.GetModelType();\n std::string type_str;\n EXPECT_TRUE(value.GetString(\"type\", &type_str));\n if (expected_model_type >= FIRST_REAL_MODEL_TYPE) {\n ModelType model_type = ModelTypeFromString(type_str);\n EXPECT_EQ(expected_model_type, model_type);\n } else if (expected_model_type == TOP_LEVEL_FOLDER) {\n EXPECT_EQ(\"Top-level folder\", type_str);\n } else if (expected_model_type == UNSPECIFIED) {\n EXPECT_EQ(\"Unspecified\", type_str);\n } else {\n ADD_FAILURE();\n }\n\n if (is_detailed) {\n {\n scoped_ptr<base::DictionaryValue> expected_entry(\n node.GetEntry()->ToValue(NULL));\n const base::Value* entry = NULL;\n EXPECT_TRUE(value.Get(\"entry\", &entry));\n EXPECT_TRUE(base::Value::Equals(entry, expected_entry.get()));\n }\n\n ExpectInt64Value(node.GetParentId(), value, \"parentId\");\n ExpectTimeValue(node.GetModificationTime(), value, \"modificationTime\");\n ExpectInt64Value(node.GetExternalId(), value, \"externalId\");\n expected_field_count += 4;\n\n if (value.HasKey(\"predecessorId\")) {\n ExpectInt64Value(node.GetPredecessorId(), value, \"predecessorId\");\n expected_field_count++;\n }\n if (value.HasKey(\"successorId\")) {\n ExpectInt64Value(node.GetSuccessorId(), value, \"successorId\");\n expected_field_count++;\n }\n if (value.HasKey(\"firstChildId\")) {\n ExpectInt64Value(node.GetFirstChildId(), value, \"firstChildId\");\n expected_field_count++;\n }\n }\n\n EXPECT_EQ(expected_field_count, value.size());\n}\n\n} // namespace\n\nTEST_F(SyncApiTest, BaseNodeGetSummaryAsValue) {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode node(&trans);\n node.InitByRootLookup();\n scoped_ptr<base::DictionaryValue> details(node.GetSummaryAsValue());\n if (details) {\n CheckNodeValue(node, *details, false);\n } else {\n ADD_FAILURE();\n }\n}\n\nTEST_F(SyncApiTest, BaseNodeGetDetailsAsValue) {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode node(&trans);\n node.InitByRootLookup();\n scoped_ptr<base::DictionaryValue> details(node.GetDetailsAsValue());\n if (details) {\n CheckNodeValue(node, *details, true);\n } else {\n ADD_FAILURE();\n }\n}\n\nTEST_F(SyncApiTest, EmptyTags) {\n WriteTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n WriteNode node(&trans);\n std::string empty_tag;\n WriteNode::InitUniqueByCreationResult result =\n node.InitUniqueByCreation(TYPED_URLS, root_node, empty_tag);\n EXPECT_NE(WriteNode::INIT_SUCCESS, result);\n EXPECT_EQ(BaseNode::INIT_FAILED_PRECONDITION,\n node.InitByTagLookup(empty_tag));\n}\n\n// Test counting nodes when the type's root node has no children.\nTEST_F(SyncApiTest, GetTotalNodeCountEmpty) {\n int64 type_root = MakeServerNodeForType(test_user_share_.user_share(),\n BOOKMARKS);\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode type_root_node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n type_root_node.InitByIdLookup(type_root));\n EXPECT_EQ(1, type_root_node.GetTotalNodeCount());\n }\n}\n\n// Test counting nodes when there is one child beneath the type's root.\nTEST_F(SyncApiTest, GetTotalNodeCountOneChild) {\n int64 type_root = MakeServerNodeForType(test_user_share_.user_share(),\n BOOKMARKS);\n int64 parent = MakeFolderWithParent(test_user_share_.user_share(),\n BOOKMARKS,\n type_root,\n NULL);\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode type_root_node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n type_root_node.InitByIdLookup(type_root));\n EXPECT_EQ(2, type_root_node.GetTotalNodeCount());\n ReadNode parent_node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n parent_node.InitByIdLookup(parent));\n EXPECT_EQ(1, parent_node.GetTotalNodeCount());\n }\n}\n\n// Test counting nodes when there are multiple children beneath the type root,\n// and one of those children has children of its own.\nTEST_F(SyncApiTest, GetTotalNodeCountMultipleChildren) {\n int64 type_root = MakeServerNodeForType(test_user_share_.user_share(),\n BOOKMARKS);\n int64 parent = MakeFolderWithParent(test_user_share_.user_share(),\n BOOKMARKS,\n type_root,\n NULL);\n ignore_result(MakeFolderWithParent(test_user_share_.user_share(),\n BOOKMARKS,\n type_root,\n NULL));\n int64 child1 = MakeFolderWithParent(\n test_user_share_.user_share(),\n BOOKMARKS,\n parent,\n NULL);\n ignore_result(MakeBookmarkWithParent(\n test_user_share_.user_share(),\n parent,\n NULL));\n ignore_result(MakeBookmarkWithParent(\n test_user_share_.user_share(),\n child1,\n NULL));\n\n {\n ReadTransaction trans(FROM_HERE, test_user_share_.user_share());\n ReadNode type_root_node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n type_root_node.InitByIdLookup(type_root));\n EXPECT_EQ(6, type_root_node.GetTotalNodeCount());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByIdLookup(parent));\n EXPECT_EQ(4, node.GetTotalNodeCount());\n }\n}\n\nnamespace {\n\nclass TestHttpPostProviderInterface : public HttpPostProviderInterface {\n public:\n virtual ~TestHttpPostProviderInterface() {}\n\n virtual void SetExtraRequestHeaders(const char* headers) OVERRIDE {}\n virtual void SetURL(const char* url, int port) OVERRIDE {}\n virtual void SetPostPayload(const char* content_type,\n int content_length,\n const char* content) OVERRIDE {}\n virtual bool MakeSynchronousPost(int* error_code, int* response_code)\n OVERRIDE {\n return false;\n }\n virtual int GetResponseContentLength() const OVERRIDE {\n return 0;\n }\n virtual const char* GetResponseContent() const OVERRIDE {\n return \"\";\n }\n virtual const std::string GetResponseHeaderValue(\n const std::string& name) const OVERRIDE {\n return std::string();\n }\n virtual void Abort() OVERRIDE {}\n};\n\nclass TestHttpPostProviderFactory : public HttpPostProviderFactory {\n public:\n virtual ~TestHttpPostProviderFactory() {}\n virtual HttpPostProviderInterface* Create() OVERRIDE {\n return new TestHttpPostProviderInterface();\n }\n virtual void Destroy(HttpPostProviderInterface* http) OVERRIDE {\n delete static_cast<TestHttpPostProviderInterface*>(http);\n }\n};\n\nclass SyncManagerObserverMock : public SyncManager::Observer {\n public:\n MOCK_METHOD1(OnSyncCycleCompleted,\n void(const SyncSessionSnapshot&)); // NOLINT\n MOCK_METHOD4(OnInitializationComplete,\n void(const WeakHandle<JsBackend>&,\n const WeakHandle<DataTypeDebugInfoListener>&,\n bool,\n syncer::ModelTypeSet)); // NOLINT\n MOCK_METHOD1(OnConnectionStatusChange, void(ConnectionStatus)); // NOLINT\n MOCK_METHOD0(OnStopSyncingPermanently, void()); // NOLINT\n MOCK_METHOD1(OnUpdatedToken, void(const std::string&)); // NOLINT\n MOCK_METHOD1(OnActionableError,\n void(const SyncProtocolError&)); // NOLINT\n};\n\nclass SyncEncryptionHandlerObserverMock\n : public SyncEncryptionHandler::Observer {\n public:\n MOCK_METHOD2(OnPassphraseRequired,\n void(PassphraseRequiredReason,\n const sync_pb::EncryptedData&)); // NOLINT\n MOCK_METHOD0(OnPassphraseAccepted, void()); // NOLINT\n MOCK_METHOD2(OnBootstrapTokenUpdated,\n void(const std::string&, BootstrapTokenType type)); // NOLINT\n MOCK_METHOD2(OnEncryptedTypesChanged,\n void(ModelTypeSet, bool)); // NOLINT\n MOCK_METHOD0(OnEncryptionComplete, void()); // NOLINT\n MOCK_METHOD1(OnCryptographerStateChanged, void(Cryptographer*)); // NOLINT\n MOCK_METHOD2(OnPassphraseTypeChanged, void(PassphraseType,\n base::Time)); // NOLINT\n};\n\n} // namespace\n\nclass SyncManagerTest : public testing::Test,\n public SyncManager::ChangeDelegate {\n protected:\n enum NigoriStatus {\n DONT_WRITE_NIGORI,\n WRITE_TO_NIGORI\n };\n\n enum EncryptionStatus {\n UNINITIALIZED,\n DEFAULT_ENCRYPTION,\n FULL_ENCRYPTION\n };\n\n SyncManagerTest()\n : fake_invalidator_(NULL),\n sync_manager_(\"Test sync manager\") {\n switches_.encryption_method =\n InternalComponentsFactory::ENCRYPTION_KEYSTORE;\n }\n\n virtual ~SyncManagerTest() {\n EXPECT_FALSE(fake_invalidator_);\n }\n\n // Test implementation.\n void SetUp() {\n ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());\n\n SyncCredentials credentials;\n credentials.email = \"foo@bar.com\";\n credentials.sync_token = \"sometoken\";\n\n fake_invalidator_ = new FakeInvalidator();\n\n sync_manager_.AddObserver(&manager_observer_);\n EXPECT_CALL(manager_observer_, OnInitializationComplete(_, _, _, _)).\n WillOnce(SaveArg<0>(&js_backend_));\n\n EXPECT_FALSE(js_backend_.IsInitialized());\n\n std::vector<ModelSafeWorker*> workers;\n ModelSafeRoutingInfo routing_info;\n GetModelSafeRoutingInfo(&routing_info);\n\n // Takes ownership of |fake_invalidator_|.\n sync_manager_.Init(\n temp_dir_.path(),\n WeakHandle<JsEventHandler>(),\n \"bogus\",\n 0,\n false,\n scoped_ptr<HttpPostProviderFactory>(new TestHttpPostProviderFactory()),\n workers,\n &extensions_activity_monitor_,\n this,\n credentials,\n scoped_ptr<Invalidator>(fake_invalidator_),\n \"fake_invalidator_client_id\",\n std::string(),\n std::string(), // bootstrap tokens\n scoped_ptr<InternalComponentsFactory>(GetFactory()),\n &encryptor_,\n &handler_,\n NULL,\n false);\n\n sync_manager_.GetEncryptionHandler()->AddObserver(&encryption_observer_);\n\n EXPECT_TRUE(js_backend_.IsInitialized());\n\n for (ModelSafeRoutingInfo::iterator i = routing_info.begin();\n i != routing_info.end(); ++i) {\n type_roots_[i->first] = MakeServerNodeForType(\n sync_manager_.GetUserShare(), i->first);\n }\n PumpLoop();\n\n EXPECT_TRUE(fake_invalidator_->IsHandlerRegistered(&sync_manager_));\n }\n\n void TearDown() {\n sync_manager_.RemoveObserver(&manager_observer_);\n sync_manager_.ShutdownOnSyncThread();\n // We can't assert that |sync_manager_| isn't registered with\n // |fake_invalidator_| anymore because |fake_invalidator_| is now\n // destroyed.\n fake_invalidator_ = NULL;\n PumpLoop();\n }\n\n void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) {\n (*out)[NIGORI] = GROUP_PASSIVE;\n (*out)[DEVICE_INFO] = GROUP_PASSIVE;\n (*out)[EXPERIMENTS] = GROUP_PASSIVE;\n (*out)[BOOKMARKS] = GROUP_PASSIVE;\n (*out)[THEMES] = GROUP_PASSIVE;\n (*out)[SESSIONS] = GROUP_PASSIVE;\n (*out)[PASSWORDS] = GROUP_PASSIVE;\n (*out)[PREFERENCES] = GROUP_PASSIVE;\n (*out)[PRIORITY_PREFERENCES] = GROUP_PASSIVE;\n }\n\n virtual void OnChangesApplied(\n ModelType model_type,\n int64 model_version,\n const BaseTransaction* trans,\n const ImmutableChangeRecordList& changes) OVERRIDE {}\n\n virtual void OnChangesComplete(ModelType model_type) OVERRIDE {}\n\n // Helper methods.\n bool SetUpEncryption(NigoriStatus nigori_status,\n EncryptionStatus encryption_status) {\n UserShare* share = sync_manager_.GetUserShare();\n\n // We need to create the nigori node as if it were an applied server update.\n int64 nigori_id = GetIdForDataType(NIGORI);\n if (nigori_id == kInvalidId)\n return false;\n\n // Set the nigori cryptographer information.\n if (encryption_status == FULL_ENCRYPTION)\n sync_manager_.GetEncryptionHandler()->EnableEncryptEverything();\n\n WriteTransaction trans(FROM_HERE, share);\n Cryptographer* cryptographer = trans.GetCryptographer();\n if (!cryptographer)\n return false;\n if (encryption_status != UNINITIALIZED) {\n KeyParams params = {\"localhost\", \"dummy\", \"foobar\"};\n cryptographer->AddKey(params);\n } else {\n DCHECK_NE(nigori_status, WRITE_TO_NIGORI);\n }\n if (nigori_status == WRITE_TO_NIGORI) {\n sync_pb::NigoriSpecifics nigori;\n cryptographer->GetKeys(nigori.mutable_encryption_keybag());\n share->directory->GetNigoriHandler()->UpdateNigoriFromEncryptedTypes(\n &nigori,\n trans.GetWrappedTrans());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(nigori_id));\n node.SetNigoriSpecifics(nigori);\n }\n return cryptographer->is_ready();\n }\n\n int64 GetIdForDataType(ModelType type) {\n if (type_roots_.count(type) == 0)\n return 0;\n return type_roots_[type];\n }\n\n void PumpLoop() {\n message_loop_.RunUntilIdle();\n }\n\n void SendJsMessage(const std::string& name, const JsArgList& args,\n const WeakHandle<JsReplyHandler>& reply_handler) {\n js_backend_.Call(FROM_HERE, &JsBackend::ProcessJsMessage,\n name, args, reply_handler);\n PumpLoop();\n }\n\n void SetJsEventHandler(const WeakHandle<JsEventHandler>& event_handler) {\n js_backend_.Call(FROM_HERE, &JsBackend::SetJsEventHandler,\n event_handler);\n PumpLoop();\n }\n\n // Looks up an entry by client tag and resets IS_UNSYNCED value to false.\n // Returns true if entry was previously unsynced, false if IS_UNSYNCED was\n // already false.\n bool ResetUnsyncedEntry(ModelType type,\n const std::string& client_tag) {\n UserShare* share = sync_manager_.GetUserShare();\n syncable::WriteTransaction trans(\n FROM_HERE, syncable::UNITTEST, share->directory.get());\n const std::string hash = syncable::GenerateSyncableHash(type, client_tag);\n syncable::MutableEntry entry(&trans, syncable::GET_BY_CLIENT_TAG,\n hash);\n EXPECT_TRUE(entry.good());\n if (!entry.Get(IS_UNSYNCED))\n return false;\n entry.Put(IS_UNSYNCED, false);\n return true;\n }\n\n virtual InternalComponentsFactory* GetFactory() {\n return new TestInternalComponentsFactory(GetSwitches(), STORAGE_IN_MEMORY);\n }\n\n // Returns true if we are currently encrypting all sync data. May\n // be called on any thread.\n bool EncryptEverythingEnabledForTest() {\n return sync_manager_.GetEncryptionHandler()->EncryptEverythingEnabled();\n }\n\n // Gets the set of encrypted types from the cryptographer\n // Note: opens a transaction. May be called from any thread.\n ModelTypeSet GetEncryptedTypes() {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n return GetEncryptedTypesWithTrans(&trans);\n }\n\n ModelTypeSet GetEncryptedTypesWithTrans(BaseTransaction* trans) {\n return trans->GetDirectory()->GetNigoriHandler()->\n GetEncryptedTypes(trans->GetWrappedTrans());\n }\n\n void SimulateInvalidatorStateChangeForTest(InvalidatorState state) {\n DCHECK(sync_manager_.thread_checker_.CalledOnValidThread());\n sync_manager_.OnInvalidatorStateChange(state);\n }\n\n void TriggerOnIncomingNotificationForTest(ModelTypeSet model_types) {\n DCHECK(sync_manager_.thread_checker_.CalledOnValidThread());\n ModelTypeInvalidationMap invalidation_map =\n ModelTypeSetToInvalidationMap(model_types, std::string());\n sync_manager_.OnIncomingInvalidation(\n ModelTypeInvalidationMapToObjectIdInvalidationMap(\n invalidation_map));\n }\n\n void SetProgressMarkerForType(ModelType type, bool set) {\n if (set) {\n sync_pb::DataTypeProgressMarker marker;\n marker.set_token(\"token\");\n marker.set_data_type_id(GetSpecificsFieldNumberFromModelType(type));\n sync_manager_.directory()->SetDownloadProgress(type, marker);\n } else {\n sync_pb::DataTypeProgressMarker marker;\n sync_manager_.directory()->SetDownloadProgress(type, marker);\n }\n }\n\n InternalComponentsFactory::Switches GetSwitches() const {\n return switches_;\n }\n\n private:\n // Needed by |sync_manager_|.\n base::MessageLoop message_loop_;\n // Needed by |sync_manager_|.\n base::ScopedTempDir temp_dir_;\n // Sync Id's for the roots of the enabled datatypes.\n std::map<ModelType, int64> type_roots_;\n FakeExtensionsActivityMonitor extensions_activity_monitor_;\n\n protected:\n FakeEncryptor encryptor_;\n TestUnrecoverableErrorHandler handler_;\n FakeInvalidator* fake_invalidator_;\n SyncManagerImpl sync_manager_;\n WeakHandle<JsBackend> js_backend_;\n StrictMock<SyncManagerObserverMock> manager_observer_;\n StrictMock<SyncEncryptionHandlerObserverMock> encryption_observer_;\n InternalComponentsFactory::Switches switches_;\n};\n\nTEST_F(SyncManagerTest, UpdateEnabledTypes) {\n ModelSafeRoutingInfo routes;\n GetModelSafeRoutingInfo(&routes);\n const ModelTypeSet enabled_types = GetRoutingInfoTypes(routes);\n sync_manager_.UpdateEnabledTypes(enabled_types);\n EXPECT_EQ(ModelTypeSetToObjectIdSet(enabled_types),\n fake_invalidator_->GetRegisteredIds(&sync_manager_));\n}\n\nTEST_F(SyncManagerTest, RegisterInvalidationHandler) {\n FakeInvalidationHandler fake_handler;\n sync_manager_.RegisterInvalidationHandler(&fake_handler);\n EXPECT_TRUE(fake_invalidator_->IsHandlerRegistered(&fake_handler));\n\n const ObjectIdSet& ids =\n ModelTypeSetToObjectIdSet(ModelTypeSet(BOOKMARKS, PREFERENCES));\n sync_manager_.UpdateRegisteredInvalidationIds(&fake_handler, ids);\n EXPECT_EQ(ids, fake_invalidator_->GetRegisteredIds(&fake_handler));\n\n sync_manager_.UnregisterInvalidationHandler(&fake_handler);\n EXPECT_FALSE(fake_invalidator_->IsHandlerRegistered(&fake_handler));\n}\n\nTEST_F(SyncManagerTest, ProcessJsMessage) {\n const JsArgList kNoArgs;\n\n StrictMock<MockJsReplyHandler> reply_handler;\n\n base::ListValue disabled_args;\n disabled_args.Append(new base::StringValue(\"TRANSIENT_INVALIDATION_ERROR\"));\n\n EXPECT_CALL(reply_handler,\n HandleJsReply(\"getNotificationState\",\n HasArgsAsList(disabled_args)));\n\n // This message should be dropped.\n SendJsMessage(\"unknownMessage\", kNoArgs, reply_handler.AsWeakHandle());\n\n SendJsMessage(\"getNotificationState\", kNoArgs, reply_handler.AsWeakHandle());\n}\n\nTEST_F(SyncManagerTest, ProcessJsMessageGetRootNodeDetails) {\n const JsArgList kNoArgs;\n\n StrictMock<MockJsReplyHandler> reply_handler;\n\n JsArgList return_args;\n\n EXPECT_CALL(reply_handler,\n HandleJsReply(\"getRootNodeDetails\", _))\n .WillOnce(SaveArg<1>(&return_args));\n\n SendJsMessage(\"getRootNodeDetails\", kNoArgs, reply_handler.AsWeakHandle());\n\n EXPECT_EQ(1u, return_args.Get().GetSize());\n const base::DictionaryValue* node_info = NULL;\n EXPECT_TRUE(return_args.Get().GetDictionary(0, &node_info));\n if (node_info) {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode node(&trans);\n node.InitByRootLookup();\n CheckNodeValue(node, *node_info, true);\n } else {\n ADD_FAILURE();\n }\n}\n\nvoid CheckGetNodesByIdReturnArgs(SyncManager* sync_manager,\n const JsArgList& return_args,\n int64 id,\n bool is_detailed) {\n EXPECT_EQ(1u, return_args.Get().GetSize());\n const base::ListValue* nodes = NULL;\n ASSERT_TRUE(return_args.Get().GetList(0, &nodes));\n ASSERT_TRUE(nodes);\n EXPECT_EQ(1u, nodes->GetSize());\n const base::DictionaryValue* node_info = NULL;\n EXPECT_TRUE(nodes->GetDictionary(0, &node_info));\n ASSERT_TRUE(node_info);\n ReadTransaction trans(FROM_HERE, sync_manager->GetUserShare());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(id));\n CheckNodeValue(node, *node_info, is_detailed);\n}\n\nclass SyncManagerGetNodesByIdTest : public SyncManagerTest {\n protected:\n virtual ~SyncManagerGetNodesByIdTest() {}\n\n void RunGetNodesByIdTest(const char* message_name, bool is_detailed) {\n int64 root_id = kInvalidId;\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n root_id = root_node.GetId();\n }\n\n int64 child_id =\n MakeNode(sync_manager_.GetUserShare(), BOOKMARKS, \"testtag\");\n\n StrictMock<MockJsReplyHandler> reply_handler;\n\n JsArgList return_args;\n\n const int64 ids[] = { root_id, child_id };\n\n EXPECT_CALL(reply_handler,\n HandleJsReply(message_name, _))\n .Times(arraysize(ids)).WillRepeatedly(SaveArg<1>(&return_args));\n\n for (size_t i = 0; i < arraysize(ids); ++i) {\n base::ListValue args;\n base::ListValue* id_values = new base::ListValue();\n args.Append(id_values);\n id_values->Append(new base::StringValue(base::Int64ToString(ids[i])));\n SendJsMessage(message_name,\n JsArgList(&args), reply_handler.AsWeakHandle());\n\n CheckGetNodesByIdReturnArgs(&sync_manager_, return_args,\n ids[i], is_detailed);\n }\n }\n\n void RunGetNodesByIdFailureTest(const char* message_name) {\n StrictMock<MockJsReplyHandler> reply_handler;\n\n base::ListValue empty_list_args;\n empty_list_args.Append(new base::ListValue());\n\n EXPECT_CALL(reply_handler,\n HandleJsReply(message_name,\n HasArgsAsList(empty_list_args)))\n .Times(6);\n\n {\n base::ListValue args;\n SendJsMessage(message_name,\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n {\n base::ListValue args;\n args.Append(new base::ListValue());\n SendJsMessage(message_name,\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n {\n base::ListValue args;\n base::ListValue* ids = new base::ListValue();\n args.Append(ids);\n ids->Append(new base::StringValue(std::string()));\n SendJsMessage(\n message_name, JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n {\n base::ListValue args;\n base::ListValue* ids = new base::ListValue();\n args.Append(ids);\n ids->Append(new base::StringValue(\"nonsense\"));\n SendJsMessage(message_name,\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n {\n base::ListValue args;\n base::ListValue* ids = new base::ListValue();\n args.Append(ids);\n ids->Append(new base::StringValue(\"0\"));\n SendJsMessage(message_name,\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n {\n base::ListValue args;\n base::ListValue* ids = new base::ListValue();\n args.Append(ids);\n ids->Append(new base::StringValue(\"9999\"));\n SendJsMessage(message_name,\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n }\n};\n\nTEST_F(SyncManagerGetNodesByIdTest, GetNodeSummariesById) {\n RunGetNodesByIdTest(\"getNodeSummariesById\", false);\n}\n\nTEST_F(SyncManagerGetNodesByIdTest, GetNodeDetailsById) {\n RunGetNodesByIdTest(\"getNodeDetailsById\", true);\n}\n\nTEST_F(SyncManagerGetNodesByIdTest, GetNodeSummariesByIdFailure) {\n RunGetNodesByIdFailureTest(\"getNodeSummariesById\");\n}\n\nTEST_F(SyncManagerGetNodesByIdTest, GetNodeDetailsByIdFailure) {\n RunGetNodesByIdFailureTest(\"getNodeDetailsById\");\n}\n\nTEST_F(SyncManagerTest, GetChildNodeIds) {\n StrictMock<MockJsReplyHandler> reply_handler;\n\n JsArgList return_args;\n\n EXPECT_CALL(reply_handler,\n HandleJsReply(\"getChildNodeIds\", _))\n .Times(1).WillRepeatedly(SaveArg<1>(&return_args));\n\n {\n base::ListValue args;\n args.Append(new base::StringValue(\"1\"));\n SendJsMessage(\"getChildNodeIds\",\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n EXPECT_EQ(1u, return_args.Get().GetSize());\n const base::ListValue* nodes = NULL;\n ASSERT_TRUE(return_args.Get().GetList(0, &nodes));\n ASSERT_TRUE(nodes);\n EXPECT_EQ(9u, nodes->GetSize());\n}\n\nTEST_F(SyncManagerTest, GetChildNodeIdsFailure) {\n StrictMock<MockJsReplyHandler> reply_handler;\n\n base::ListValue empty_list_args;\n empty_list_args.Append(new base::ListValue());\n\n EXPECT_CALL(reply_handler,\n HandleJsReply(\"getChildNodeIds\",\n HasArgsAsList(empty_list_args)))\n .Times(5);\n\n {\n base::ListValue args;\n SendJsMessage(\"getChildNodeIds\",\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n {\n base::ListValue args;\n args.Append(new base::StringValue(std::string()));\n SendJsMessage(\n \"getChildNodeIds\", JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n {\n base::ListValue args;\n args.Append(new base::StringValue(\"nonsense\"));\n SendJsMessage(\"getChildNodeIds\",\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n {\n base::ListValue args;\n args.Append(new base::StringValue(\"0\"));\n SendJsMessage(\"getChildNodeIds\",\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n {\n base::ListValue args;\n args.Append(new base::StringValue(\"9999\"));\n SendJsMessage(\"getChildNodeIds\",\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n}\n\nTEST_F(SyncManagerTest, GetAllNodesTest) {\n StrictMock<MockJsReplyHandler> reply_handler;\n JsArgList return_args;\n\n EXPECT_CALL(reply_handler,\n HandleJsReply(\"getAllNodes\", _))\n .Times(1).WillRepeatedly(SaveArg<1>(&return_args));\n\n {\n base::ListValue args;\n SendJsMessage(\"getAllNodes\",\n JsArgList(&args), reply_handler.AsWeakHandle());\n }\n\n // There's not much value in verifying every attribute on every node here.\n // Most of the value of this test has already been achieved: we've verified we\n // can call the above function without crashing or leaking memory.\n //\n // Let's just check the list size and a few of its elements. Anything more\n // would make this test brittle without greatly increasing our chances of\n // catching real bugs.\n\n const base::ListValue* node_list;\n const base::DictionaryValue* first_result;\n\n // The resulting argument list should have one argument, a list of nodes.\n ASSERT_EQ(1U, return_args.Get().GetSize());\n ASSERT_TRUE(return_args.Get().GetList(0, &node_list));\n\n // The database creation logic depends on the routing info.\n // Refer to setup methods for more information.\n ModelSafeRoutingInfo routes;\n GetModelSafeRoutingInfo(&routes);\n size_t directory_size = routes.size() + 1;\n\n ASSERT_EQ(directory_size, node_list->GetSize());\n ASSERT_TRUE(node_list->GetDictionary(0, &first_result));\n EXPECT_TRUE(first_result->HasKey(\"ID\"));\n EXPECT_TRUE(first_result->HasKey(\"NON_UNIQUE_NAME\"));\n}\n\n// Simulate various invalidator state changes. Those should propagate\n// JS events.\nTEST_F(SyncManagerTest, OnInvalidatorStateChangeJsEvents) {\n StrictMock<MockJsEventHandler> event_handler;\n\n base::DictionaryValue enabled_details;\n enabled_details.SetString(\"state\", \"INVALIDATIONS_ENABLED\");\n base::DictionaryValue credentials_rejected_details;\n credentials_rejected_details.SetString(\n \"state\", \"INVALIDATION_CREDENTIALS_REJECTED\");\n base::DictionaryValue transient_error_details;\n transient_error_details.SetString(\"state\", \"TRANSIENT_INVALIDATION_ERROR\");\n base::DictionaryValue auth_error_details;\n auth_error_details.SetString(\"status\", \"CONNECTION_AUTH_ERROR\");\n\n EXPECT_CALL(manager_observer_,\n OnConnectionStatusChange(CONNECTION_AUTH_ERROR));\n\n EXPECT_CALL(\n event_handler,\n HandleJsEvent(\"onConnectionStatusChange\",\n HasDetailsAsDictionary(auth_error_details)));\n\n EXPECT_CALL(event_handler,\n HandleJsEvent(\"onNotificationStateChange\",\n HasDetailsAsDictionary(enabled_details)));\n\n EXPECT_CALL(\n event_handler,\n HandleJsEvent(\"onNotificationStateChange\",\n HasDetailsAsDictionary(credentials_rejected_details)))\n .Times(2);\n\n EXPECT_CALL(event_handler,\n HandleJsEvent(\"onNotificationStateChange\",\n HasDetailsAsDictionary(transient_error_details)));\n\n // Test needs to simulate INVALIDATION_CREDENTIALS_REJECTED with event handler\n // attached because this is the only time when CONNECTION_AUTH_ERROR\n // notification will be generated, therefore the only chance to verify that\n // \"onConnectionStatusChange\" event is delivered\n SetJsEventHandler(event_handler.AsWeakHandle());\n SimulateInvalidatorStateChangeForTest(INVALIDATION_CREDENTIALS_REJECTED);\n SetJsEventHandler(WeakHandle<JsEventHandler>());\n\n SimulateInvalidatorStateChangeForTest(INVALIDATIONS_ENABLED);\n SimulateInvalidatorStateChangeForTest(INVALIDATION_CREDENTIALS_REJECTED);\n SimulateInvalidatorStateChangeForTest(TRANSIENT_INVALIDATION_ERROR);\n\n SetJsEventHandler(event_handler.AsWeakHandle());\n SimulateInvalidatorStateChangeForTest(INVALIDATIONS_ENABLED);\n SimulateInvalidatorStateChangeForTest(INVALIDATION_CREDENTIALS_REJECTED);\n SimulateInvalidatorStateChangeForTest(TRANSIENT_INVALIDATION_ERROR);\n SetJsEventHandler(WeakHandle<JsEventHandler>());\n\n SimulateInvalidatorStateChangeForTest(INVALIDATIONS_ENABLED);\n SimulateInvalidatorStateChangeForTest(INVALIDATION_CREDENTIALS_REJECTED);\n SimulateInvalidatorStateChangeForTest(TRANSIENT_INVALIDATION_ERROR);\n\n // Should trigger the replies.\n PumpLoop();\n}\n\n// Simulate the invalidator's credentials being rejected. That should\n// also clear the sync token.\nTEST_F(SyncManagerTest, OnInvalidatorStateChangeCredentialsRejected) {\n EXPECT_CALL(manager_observer_,\n OnConnectionStatusChange(CONNECTION_AUTH_ERROR));\n\n EXPECT_FALSE(sync_manager_.GetHasInvalidAuthTokenForTest());\n\n SimulateInvalidatorStateChangeForTest(INVALIDATION_CREDENTIALS_REJECTED);\n\n EXPECT_TRUE(sync_manager_.GetHasInvalidAuthTokenForTest());\n\n // Should trigger the replies.\n PumpLoop();\n}\n\nTEST_F(SyncManagerTest, OnIncomingNotification) {\n StrictMock<MockJsEventHandler> event_handler;\n\n const ModelTypeSet empty_model_types;\n const ModelTypeSet model_types(\n BOOKMARKS, THEMES);\n\n // Build expected_args to have a single argument with the string\n // equivalents of model_types.\n base::DictionaryValue expected_details;\n {\n base::ListValue* model_type_list = new base::ListValue();\n expected_details.SetString(\"source\", \"REMOTE_INVALIDATION\");\n expected_details.Set(\"changedTypes\", model_type_list);\n for (ModelTypeSet::Iterator it = model_types.First();\n it.Good(); it.Inc()) {\n model_type_list->Append(\n new base::StringValue(ModelTypeToString(it.Get())));\n }\n }\n\n EXPECT_CALL(event_handler,\n HandleJsEvent(\"onIncomingNotification\",\n HasDetailsAsDictionary(expected_details)));\n\n TriggerOnIncomingNotificationForTest(empty_model_types);\n TriggerOnIncomingNotificationForTest(model_types);\n\n SetJsEventHandler(event_handler.AsWeakHandle());\n TriggerOnIncomingNotificationForTest(model_types);\n SetJsEventHandler(WeakHandle<JsEventHandler>());\n\n TriggerOnIncomingNotificationForTest(empty_model_types);\n TriggerOnIncomingNotificationForTest(model_types);\n\n // Should trigger the replies.\n PumpLoop();\n}\n\nTEST_F(SyncManagerTest, RefreshEncryptionReady) {\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_, OnEncryptedTypesChanged(_, false));\n\n sync_manager_.GetEncryptionHandler()->Init();\n PumpLoop();\n\n const ModelTypeSet encrypted_types = GetEncryptedTypes();\n EXPECT_TRUE(encrypted_types.Has(PASSWORDS));\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByIdLookup(GetIdForDataType(NIGORI)));\n sync_pb::NigoriSpecifics nigori = node.GetNigoriSpecifics();\n EXPECT_TRUE(nigori.has_encryption_keybag());\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n EXPECT_TRUE(cryptographer->CanDecrypt(nigori.encryption_keybag()));\n }\n}\n\n// Attempt to refresh encryption when nigori not downloaded.\nTEST_F(SyncManagerTest, RefreshEncryptionNotReady) {\n // Don't set up encryption (no nigori node created).\n\n // Should fail. Triggers an OnPassphraseRequired because the cryptographer\n // is not ready.\n EXPECT_CALL(encryption_observer_, OnPassphraseRequired(_, _)).Times(1);\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_, OnEncryptedTypesChanged(_, false));\n sync_manager_.GetEncryptionHandler()->Init();\n PumpLoop();\n\n const ModelTypeSet encrypted_types = GetEncryptedTypes();\n EXPECT_TRUE(encrypted_types.Has(PASSWORDS)); // Hardcoded.\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n}\n\n// Attempt to refresh encryption when nigori is empty.\nTEST_F(SyncManagerTest, RefreshEncryptionEmptyNigori) {\n EXPECT_TRUE(SetUpEncryption(DONT_WRITE_NIGORI, DEFAULT_ENCRYPTION));\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete()).Times(1);\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_, OnEncryptedTypesChanged(_, false));\n\n // Should write to nigori.\n sync_manager_.GetEncryptionHandler()->Init();\n PumpLoop();\n\n const ModelTypeSet encrypted_types = GetEncryptedTypes();\n EXPECT_TRUE(encrypted_types.Has(PASSWORDS)); // Hardcoded.\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByIdLookup(GetIdForDataType(NIGORI)));\n sync_pb::NigoriSpecifics nigori = node.GetNigoriSpecifics();\n EXPECT_TRUE(nigori.has_encryption_keybag());\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n EXPECT_TRUE(cryptographer->CanDecrypt(nigori.encryption_keybag()));\n }\n}\n\nTEST_F(SyncManagerTest, EncryptDataTypesWithNoData) {\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n EXPECT_CALL(encryption_observer_,\n OnEncryptedTypesChanged(\n HasModelTypes(EncryptableUserTypes()), true));\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n sync_manager_.GetEncryptionHandler()->EnableEncryptEverything();\n EXPECT_TRUE(EncryptEverythingEnabledForTest());\n}\n\nTEST_F(SyncManagerTest, EncryptDataTypesWithData) {\n size_t batch_size = 5;\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n\n // Create some unencrypted unsynced data.\n int64 folder = MakeFolderWithParent(sync_manager_.GetUserShare(),\n BOOKMARKS,\n GetIdForDataType(BOOKMARKS),\n NULL);\n // First batch_size nodes are children of folder.\n size_t i;\n for (i = 0; i < batch_size; ++i) {\n MakeBookmarkWithParent(sync_manager_.GetUserShare(), folder, NULL);\n }\n // Next batch_size nodes are a different type and on their own.\n for (; i < 2*batch_size; ++i) {\n MakeNode(sync_manager_.GetUserShare(), SESSIONS,\n base::StringPrintf(\"%\" PRIuS \"\", i));\n }\n // Last batch_size nodes are a third type that will not need encryption.\n for (; i < 3*batch_size; ++i) {\n MakeNode(sync_manager_.GetUserShare(), THEMES,\n base::StringPrintf(\"%\" PRIuS \"\", i));\n }\n\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n EXPECT_TRUE(GetEncryptedTypesWithTrans(&trans).Equals(\n SyncEncryptionHandler::SensitiveTypes()));\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n BOOKMARKS,\n false /* not encrypted */));\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n SESSIONS,\n false /* not encrypted */));\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n THEMES,\n false /* not encrypted */));\n }\n\n EXPECT_CALL(encryption_observer_,\n OnEncryptedTypesChanged(\n HasModelTypes(EncryptableUserTypes()), true));\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n sync_manager_.GetEncryptionHandler()->EnableEncryptEverything();\n EXPECT_TRUE(EncryptEverythingEnabledForTest());\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n EXPECT_TRUE(GetEncryptedTypesWithTrans(&trans).Equals(\n EncryptableUserTypes()));\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n BOOKMARKS,\n true /* is encrypted */));\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n SESSIONS,\n true /* is encrypted */));\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n THEMES,\n true /* is encrypted */));\n }\n\n // Trigger's a ReEncryptEverything with new passphrase.\n testing::Mock::VerifyAndClearExpectations(&encryption_observer_);\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_,\n OnPassphraseTypeChanged(CUSTOM_PASSPHRASE, _));\n sync_manager_.GetEncryptionHandler()->SetEncryptionPassphrase(\n \"new_passphrase\", true);\n EXPECT_TRUE(EncryptEverythingEnabledForTest());\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n EXPECT_TRUE(GetEncryptedTypesWithTrans(&trans).Equals(\n EncryptableUserTypes()));\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n BOOKMARKS,\n true /* is encrypted */));\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n SESSIONS,\n true /* is encrypted */));\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n THEMES,\n true /* is encrypted */));\n }\n // Calling EncryptDataTypes with an empty encrypted types should not trigger\n // a reencryption and should just notify immediately.\n testing::Mock::VerifyAndClearExpectations(&encryption_observer_);\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN)).Times(0);\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted()).Times(0);\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete()).Times(0);\n sync_manager_.GetEncryptionHandler()->EnableEncryptEverything();\n}\n\n// Test that when there are no pending keys and the cryptographer is not\n// initialized, we add a key based on the current GAIA password.\n// (case 1 in SyncManager::SyncInternal::SetEncryptionPassphrase)\nTEST_F(SyncManagerTest, SetInitialGaiaPass) {\n EXPECT_FALSE(SetUpEncryption(DONT_WRITE_NIGORI, UNINITIALIZED));\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n sync_manager_.GetEncryptionHandler()->SetEncryptionPassphrase(\n \"new_passphrase\",\n false);\n EXPECT_EQ(IMPLICIT_PASSPHRASE,\n sync_manager_.GetEncryptionHandler()->GetPassphraseType());\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByTagLookup(kNigoriTag));\n sync_pb::NigoriSpecifics nigori = node.GetNigoriSpecifics();\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n EXPECT_TRUE(cryptographer->CanDecrypt(nigori.encryption_keybag()));\n }\n}\n\n// Test that when there are no pending keys and we have on the old GAIA\n// password, we update and re-encrypt everything with the new GAIA password.\n// (case 1 in SyncManager::SyncInternal::SetEncryptionPassphrase)\nTEST_F(SyncManagerTest, UpdateGaiaPass) {\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n Cryptographer verifier(&encryptor_);\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n std::string bootstrap_token;\n cryptographer->GetBootstrapToken(&bootstrap_token);\n verifier.Bootstrap(bootstrap_token);\n }\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n sync_manager_.GetEncryptionHandler()->SetEncryptionPassphrase(\n \"new_passphrase\",\n false);\n EXPECT_EQ(IMPLICIT_PASSPHRASE,\n sync_manager_.GetEncryptionHandler()->GetPassphraseType());\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n // Verify the default key has changed.\n sync_pb::EncryptedData encrypted;\n cryptographer->GetKeys(&encrypted);\n EXPECT_FALSE(verifier.CanDecrypt(encrypted));\n }\n}\n\n// Sets a new explicit passphrase. This should update the bootstrap token\n// and re-encrypt everything.\n// (case 2 in SyncManager::SyncInternal::SetEncryptionPassphrase)\nTEST_F(SyncManagerTest, SetPassphraseWithPassword) {\n Cryptographer verifier(&encryptor_);\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n // Store the default (soon to be old) key.\n Cryptographer* cryptographer = trans.GetCryptographer();\n std::string bootstrap_token;\n cryptographer->GetBootstrapToken(&bootstrap_token);\n verifier.Bootstrap(bootstrap_token);\n\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n\n WriteNode password_node(&trans);\n WriteNode::InitUniqueByCreationResult result =\n password_node.InitUniqueByCreation(PASSWORDS,\n root_node, \"foo\");\n EXPECT_EQ(WriteNode::INIT_SUCCESS, result);\n sync_pb::PasswordSpecificsData data;\n data.set_password_value(\"secret\");\n password_node.SetPasswordSpecifics(data);\n }\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_,\n OnPassphraseTypeChanged(CUSTOM_PASSPHRASE, _));\n sync_manager_.GetEncryptionHandler()->SetEncryptionPassphrase(\n \"new_passphrase\",\n true);\n EXPECT_EQ(CUSTOM_PASSPHRASE,\n sync_manager_.GetEncryptionHandler()->GetPassphraseType());\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n // Verify the default key has changed.\n sync_pb::EncryptedData encrypted;\n cryptographer->GetKeys(&encrypted);\n EXPECT_FALSE(verifier.CanDecrypt(encrypted));\n\n ReadNode password_node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n password_node.InitByClientTagLookup(PASSWORDS,\n \"foo\"));\n const sync_pb::PasswordSpecificsData& data =\n password_node.GetPasswordSpecifics();\n EXPECT_EQ(\"secret\", data.password_value());\n }\n}\n\n// Manually set the pending keys in the cryptographer/nigori to reflect the data\n// being encrypted with a new (unprovided) GAIA password, then supply the\n// password.\n// (case 7 in SyncManager::SyncInternal::SetDecryptionPassphrase)\nTEST_F(SyncManagerTest, SupplyPendingGAIAPass) {\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n Cryptographer other_cryptographer(&encryptor_);\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n std::string bootstrap_token;\n cryptographer->GetBootstrapToken(&bootstrap_token);\n other_cryptographer.Bootstrap(bootstrap_token);\n\n // Now update the nigori to reflect the new keys, and update the\n // cryptographer to have pending keys.\n KeyParams params = {\"localhost\", \"dummy\", \"passphrase2\"};\n other_cryptographer.AddKey(params);\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByTagLookup(kNigoriTag));\n sync_pb::NigoriSpecifics nigori;\n other_cryptographer.GetKeys(nigori.mutable_encryption_keybag());\n cryptographer->SetPendingKeys(nigori.encryption_keybag());\n EXPECT_TRUE(cryptographer->has_pending_keys());\n node.SetNigoriSpecifics(nigori);\n }\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n sync_manager_.GetEncryptionHandler()->SetDecryptionPassphrase(\"passphrase2\");\n EXPECT_EQ(IMPLICIT_PASSPHRASE,\n sync_manager_.GetEncryptionHandler()->GetPassphraseType());\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n // Verify we're encrypting with the new key.\n sync_pb::EncryptedData encrypted;\n cryptographer->GetKeys(&encrypted);\n EXPECT_TRUE(other_cryptographer.CanDecrypt(encrypted));\n }\n}\n\n// Manually set the pending keys in the cryptographer/nigori to reflect the data\n// being encrypted with an old (unprovided) GAIA password. Attempt to supply\n// the current GAIA password and verify the bootstrap token is updated. Then\n// supply the old GAIA password, and verify we re-encrypt all data with the\n// new GAIA password.\n// (cases 4 and 5 in SyncManager::SyncInternal::SetEncryptionPassphrase)\nTEST_F(SyncManagerTest, SupplyPendingOldGAIAPass) {\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n Cryptographer other_cryptographer(&encryptor_);\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n std::string bootstrap_token;\n cryptographer->GetBootstrapToken(&bootstrap_token);\n other_cryptographer.Bootstrap(bootstrap_token);\n\n // Now update the nigori to reflect the new keys, and update the\n // cryptographer to have pending keys.\n KeyParams params = {\"localhost\", \"dummy\", \"old_gaia\"};\n other_cryptographer.AddKey(params);\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByTagLookup(kNigoriTag));\n sync_pb::NigoriSpecifics nigori;\n other_cryptographer.GetKeys(nigori.mutable_encryption_keybag());\n node.SetNigoriSpecifics(nigori);\n cryptographer->SetPendingKeys(nigori.encryption_keybag());\n\n // other_cryptographer now contains all encryption keys, and is encrypting\n // with the newest gaia.\n KeyParams new_params = {\"localhost\", \"dummy\", \"new_gaia\"};\n other_cryptographer.AddKey(new_params);\n }\n // The bootstrap token should have been updated. Save it to ensure it's based\n // on the new GAIA password.\n std::string bootstrap_token;\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN))\n .WillOnce(SaveArg<0>(&bootstrap_token));\n EXPECT_CALL(encryption_observer_, OnPassphraseRequired(_,_));\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n sync_manager_.GetEncryptionHandler()->SetEncryptionPassphrase(\n \"new_gaia\",\n false);\n EXPECT_EQ(IMPLICIT_PASSPHRASE,\n sync_manager_.GetEncryptionHandler()->GetPassphraseType());\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n testing::Mock::VerifyAndClearExpectations(&encryption_observer_);\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_initialized());\n EXPECT_FALSE(cryptographer->is_ready());\n // Verify we're encrypting with the new key, even though we have pending\n // keys.\n sync_pb::EncryptedData encrypted;\n other_cryptographer.GetKeys(&encrypted);\n EXPECT_TRUE(cryptographer->CanDecrypt(encrypted));\n }\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n sync_manager_.GetEncryptionHandler()->SetEncryptionPassphrase(\n \"old_gaia\",\n false);\n EXPECT_EQ(IMPLICIT_PASSPHRASE,\n sync_manager_.GetEncryptionHandler()->GetPassphraseType());\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n\n // Verify we're encrypting with the new key.\n sync_pb::EncryptedData encrypted;\n other_cryptographer.GetKeys(&encrypted);\n EXPECT_TRUE(cryptographer->CanDecrypt(encrypted));\n\n // Verify the saved bootstrap token is based on the new gaia password.\n Cryptographer temp_cryptographer(&encryptor_);\n temp_cryptographer.Bootstrap(bootstrap_token);\n EXPECT_TRUE(temp_cryptographer.CanDecrypt(encrypted));\n }\n}\n\n// Manually set the pending keys in the cryptographer/nigori to reflect the data\n// being encrypted with an explicit (unprovided) passphrase, then supply the\n// passphrase.\n// (case 9 in SyncManager::SyncInternal::SetDecryptionPassphrase)\nTEST_F(SyncManagerTest, SupplyPendingExplicitPass) {\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n Cryptographer other_cryptographer(&encryptor_);\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n std::string bootstrap_token;\n cryptographer->GetBootstrapToken(&bootstrap_token);\n other_cryptographer.Bootstrap(bootstrap_token);\n\n // Now update the nigori to reflect the new keys, and update the\n // cryptographer to have pending keys.\n KeyParams params = {\"localhost\", \"dummy\", \"explicit\"};\n other_cryptographer.AddKey(params);\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByTagLookup(kNigoriTag));\n sync_pb::NigoriSpecifics nigori;\n other_cryptographer.GetKeys(nigori.mutable_encryption_keybag());\n cryptographer->SetPendingKeys(nigori.encryption_keybag());\n EXPECT_TRUE(cryptographer->has_pending_keys());\n nigori.set_keybag_is_frozen(true);\n node.SetNigoriSpecifics(nigori);\n }\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_,\n OnPassphraseTypeChanged(CUSTOM_PASSPHRASE, _));\n EXPECT_CALL(encryption_observer_, OnPassphraseRequired(_, _));\n EXPECT_CALL(encryption_observer_, OnEncryptedTypesChanged(_, false));\n sync_manager_.GetEncryptionHandler()->Init();\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n sync_manager_.GetEncryptionHandler()->SetDecryptionPassphrase(\"explicit\");\n EXPECT_EQ(CUSTOM_PASSPHRASE,\n sync_manager_.GetEncryptionHandler()->GetPassphraseType());\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n // Verify we're encrypting with the new key.\n sync_pb::EncryptedData encrypted;\n cryptographer->GetKeys(&encrypted);\n EXPECT_TRUE(other_cryptographer.CanDecrypt(encrypted));\n }\n}\n\n// Manually set the pending keys in the cryptographer/nigori to reflect the data\n// being encrypted with a new (unprovided) GAIA password, then supply the\n// password as a user-provided password.\n// This is the android case 7/8.\nTEST_F(SyncManagerTest, SupplyPendingGAIAPassUserProvided) {\n EXPECT_FALSE(SetUpEncryption(DONT_WRITE_NIGORI, UNINITIALIZED));\n Cryptographer other_cryptographer(&encryptor_);\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n // Now update the nigori to reflect the new keys, and update the\n // cryptographer to have pending keys.\n KeyParams params = {\"localhost\", \"dummy\", \"passphrase\"};\n other_cryptographer.AddKey(params);\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByTagLookup(kNigoriTag));\n sync_pb::NigoriSpecifics nigori;\n other_cryptographer.GetKeys(nigori.mutable_encryption_keybag());\n node.SetNigoriSpecifics(nigori);\n cryptographer->SetPendingKeys(nigori.encryption_keybag());\n EXPECT_FALSE(cryptographer->is_ready());\n }\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n sync_manager_.GetEncryptionHandler()->SetEncryptionPassphrase(\n \"passphrase\",\n false);\n EXPECT_EQ(IMPLICIT_PASSPHRASE,\n sync_manager_.GetEncryptionHandler()->GetPassphraseType());\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n }\n}\n\nTEST_F(SyncManagerTest, SetPassphraseWithEmptyPasswordNode) {\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n int64 node_id = 0;\n std::string tag = \"foo\";\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode root_node(&trans);\n root_node.InitByRootLookup();\n\n WriteNode password_node(&trans);\n WriteNode::InitUniqueByCreationResult result =\n password_node.InitUniqueByCreation(PASSWORDS, root_node, tag);\n EXPECT_EQ(WriteNode::INIT_SUCCESS, result);\n node_id = password_node.GetId();\n }\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_,\n OnPassphraseTypeChanged(CUSTOM_PASSPHRASE, _));\n sync_manager_.GetEncryptionHandler()->SetEncryptionPassphrase(\n \"new_passphrase\",\n true);\n EXPECT_EQ(CUSTOM_PASSPHRASE,\n sync_manager_.GetEncryptionHandler()->GetPassphraseType());\n EXPECT_FALSE(EncryptEverythingEnabledForTest());\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode password_node(&trans);\n EXPECT_EQ(BaseNode::INIT_FAILED_DECRYPT_IF_NECESSARY,\n password_node.InitByClientTagLookup(PASSWORDS,\n tag));\n }\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode password_node(&trans);\n EXPECT_EQ(BaseNode::INIT_FAILED_DECRYPT_IF_NECESSARY,\n password_node.InitByIdLookup(node_id));\n }\n}\n\nTEST_F(SyncManagerTest, NudgeDelayTest) {\n EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(BOOKMARKS),\n base::TimeDelta::FromMilliseconds(\n SyncManagerImpl::GetDefaultNudgeDelay()));\n\n EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(AUTOFILL),\n base::TimeDelta::FromSeconds(\n kDefaultShortPollIntervalSeconds));\n\n EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(PREFERENCES),\n base::TimeDelta::FromMilliseconds(\n SyncManagerImpl::GetPreferencesNudgeDelay()));\n}\n\n// Friended by WriteNode, so can't be in an anonymouse namespace.\nTEST_F(SyncManagerTest, EncryptBookmarksWithLegacyData) {\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n std::string title;\n SyncAPINameToServerName(\"Google\", &title);\n std::string url = \"http://www.google.com\";\n std::string raw_title2 = \"..\"; // An invalid cosmo title.\n std::string title2;\n SyncAPINameToServerName(raw_title2, &title2);\n std::string url2 = \"http://www.bla.com\";\n\n // Create a bookmark using the legacy format.\n int64 node_id1 = MakeNode(sync_manager_.GetUserShare(),\n BOOKMARKS,\n \"testtag\");\n int64 node_id2 = MakeNode(sync_manager_.GetUserShare(),\n BOOKMARKS,\n \"testtag2\");\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(node_id1));\n\n sync_pb::EntitySpecifics entity_specifics;\n entity_specifics.mutable_bookmark()->set_url(url);\n node.SetEntitySpecifics(entity_specifics);\n\n // Set the old style title.\n syncable::MutableEntry* node_entry = node.entry_;\n node_entry->Put(syncable::NON_UNIQUE_NAME, title);\n\n WriteNode node2(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node2.InitByIdLookup(node_id2));\n\n sync_pb::EntitySpecifics entity_specifics2;\n entity_specifics2.mutable_bookmark()->set_url(url2);\n node2.SetEntitySpecifics(entity_specifics2);\n\n // Set the old style title.\n syncable::MutableEntry* node_entry2 = node2.entry_;\n node_entry2->Put(syncable::NON_UNIQUE_NAME, title2);\n }\n\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(node_id1));\n EXPECT_EQ(BOOKMARKS, node.GetModelType());\n EXPECT_EQ(title, node.GetTitle());\n EXPECT_EQ(title, node.GetBookmarkSpecifics().title());\n EXPECT_EQ(url, node.GetBookmarkSpecifics().url());\n\n ReadNode node2(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node2.InitByIdLookup(node_id2));\n EXPECT_EQ(BOOKMARKS, node2.GetModelType());\n // We should de-canonicalize the title in GetTitle(), but the title in the\n // specifics should be stored in the server legal form.\n EXPECT_EQ(raw_title2, node2.GetTitle());\n EXPECT_EQ(title2, node2.GetBookmarkSpecifics().title());\n EXPECT_EQ(url2, node2.GetBookmarkSpecifics().url());\n }\n\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n BOOKMARKS,\n false /* not encrypted */));\n }\n\n EXPECT_CALL(encryption_observer_,\n OnEncryptedTypesChanged(\n HasModelTypes(EncryptableUserTypes()), true));\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n sync_manager_.GetEncryptionHandler()->EnableEncryptEverything();\n EXPECT_TRUE(EncryptEverythingEnabledForTest());\n\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n EXPECT_TRUE(GetEncryptedTypesWithTrans(&trans).Equals(\n EncryptableUserTypes()));\n EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest(\n trans.GetWrappedTrans(),\n BOOKMARKS,\n true /* is encrypted */));\n\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(node_id1));\n EXPECT_EQ(BOOKMARKS, node.GetModelType());\n EXPECT_EQ(title, node.GetTitle());\n EXPECT_EQ(title, node.GetBookmarkSpecifics().title());\n EXPECT_EQ(url, node.GetBookmarkSpecifics().url());\n\n ReadNode node2(&trans);\n EXPECT_EQ(BaseNode::INIT_OK, node2.InitByIdLookup(node_id2));\n EXPECT_EQ(BOOKMARKS, node2.GetModelType());\n // We should de-canonicalize the title in GetTitle(), but the title in the\n // specifics should be stored in the server legal form.\n EXPECT_EQ(raw_title2, node2.GetTitle());\n EXPECT_EQ(title2, node2.GetBookmarkSpecifics().title());\n EXPECT_EQ(url2, node2.GetBookmarkSpecifics().url());\n }\n}\n\n// Create a bookmark and set the title/url, then verify the data was properly\n// set. This replicates the unique way bookmarks have of creating sync nodes.\n// See BookmarkChangeProcessor::PlaceSyncNode(..).\nTEST_F(SyncManagerTest, CreateLocalBookmark) {\n std::string title = \"title\";\n std::string url = \"url\";\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode bookmark_root(&trans);\n ASSERT_EQ(BaseNode::INIT_OK,\n bookmark_root.InitByTagLookup(ModelTypeToRootTag(BOOKMARKS)));\n WriteNode node(&trans);\n ASSERT_TRUE(node.InitBookmarkByCreation(bookmark_root, NULL));\n node.SetIsFolder(false);\n node.SetTitle(UTF8ToWide(title));\n\n sync_pb::BookmarkSpecifics bookmark_specifics(node.GetBookmarkSpecifics());\n bookmark_specifics.set_url(url);\n node.SetBookmarkSpecifics(bookmark_specifics);\n }\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode bookmark_root(&trans);\n ASSERT_EQ(BaseNode::INIT_OK,\n bookmark_root.InitByTagLookup(ModelTypeToRootTag(BOOKMARKS)));\n int64 child_id = bookmark_root.GetFirstChildId();\n\n ReadNode node(&trans);\n ASSERT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(child_id));\n EXPECT_FALSE(node.GetIsFolder());\n EXPECT_EQ(title, node.GetTitle());\n EXPECT_EQ(url, node.GetBookmarkSpecifics().url());\n }\n}\n\n// Verifies WriteNode::UpdateEntryWithEncryption does not make unnecessary\n// changes.\nTEST_F(SyncManagerTest, UpdateEntryWithEncryption) {\n std::string client_tag = \"title\";\n sync_pb::EntitySpecifics entity_specifics;\n entity_specifics.mutable_bookmark()->set_url(\"url\");\n entity_specifics.mutable_bookmark()->set_title(\"title\");\n MakeServerNode(sync_manager_.GetUserShare(), BOOKMARKS, client_tag,\n syncable::GenerateSyncableHash(BOOKMARKS,\n client_tag),\n entity_specifics);\n // New node shouldn't start off unsynced.\n EXPECT_FALSE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n // Manually change to the same data. Should not set is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n node.SetEntitySpecifics(entity_specifics);\n }\n EXPECT_FALSE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n\n // Encrypt the datatatype, should set is_unsynced.\n EXPECT_CALL(encryption_observer_,\n OnEncryptedTypesChanged(\n HasModelTypes(EncryptableUserTypes()), true));\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, FULL_ENCRYPTION));\n\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_, OnEncryptedTypesChanged(_, true));\n sync_manager_.GetEncryptionHandler()->Init();\n PumpLoop();\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n const syncable::Entry* node_entry = node.GetEntry();\n const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS);\n EXPECT_TRUE(specifics.has_encrypted());\n EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME));\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n EXPECT_TRUE(cryptographer->CanDecryptUsingDefaultKey(\n specifics.encrypted()));\n }\n EXPECT_TRUE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n\n // Set a new passphrase. Should set is_unsynced.\n testing::Mock::VerifyAndClearExpectations(&encryption_observer_);\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_,\n OnPassphraseTypeChanged(CUSTOM_PASSPHRASE, _));\n sync_manager_.GetEncryptionHandler()->SetEncryptionPassphrase(\n \"new_passphrase\",\n true);\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n const syncable::Entry* node_entry = node.GetEntry();\n const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS);\n EXPECT_TRUE(specifics.has_encrypted());\n EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME));\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->is_ready());\n EXPECT_TRUE(cryptographer->CanDecryptUsingDefaultKey(\n specifics.encrypted()));\n }\n EXPECT_TRUE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n\n // Force a re-encrypt everything. Should not set is_unsynced.\n testing::Mock::VerifyAndClearExpectations(&encryption_observer_);\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_, OnEncryptedTypesChanged(_, true));\n\n sync_manager_.GetEncryptionHandler()->Init();\n PumpLoop();\n\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n const syncable::Entry* node_entry = node.GetEntry();\n const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS);\n EXPECT_TRUE(specifics.has_encrypted());\n EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME));\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->CanDecryptUsingDefaultKey(\n specifics.encrypted()));\n }\n EXPECT_FALSE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n\n // Manually change to the same data. Should not set is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n node.SetEntitySpecifics(entity_specifics);\n const syncable::Entry* node_entry = node.GetEntry();\n const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS);\n EXPECT_TRUE(specifics.has_encrypted());\n EXPECT_FALSE(node_entry->Get(IS_UNSYNCED));\n EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME));\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->CanDecryptUsingDefaultKey(\n specifics.encrypted()));\n }\n EXPECT_FALSE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n\n // Manually change to different data. Should set is_unsynced.\n {\n entity_specifics.mutable_bookmark()->set_url(\"url2\");\n entity_specifics.mutable_bookmark()->set_title(\"title2\");\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n node.SetEntitySpecifics(entity_specifics);\n const syncable::Entry* node_entry = node.GetEntry();\n const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS);\n EXPECT_TRUE(specifics.has_encrypted());\n EXPECT_TRUE(node_entry->Get(IS_UNSYNCED));\n EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME));\n Cryptographer* cryptographer = trans.GetCryptographer();\n EXPECT_TRUE(cryptographer->CanDecryptUsingDefaultKey(\n specifics.encrypted()));\n }\n}\n\n// Passwords have their own handling for encryption. Verify it does not result\n// in unnecessary writes via SetEntitySpecifics.\nTEST_F(SyncManagerTest, UpdatePasswordSetEntitySpecificsNoChange) {\n std::string client_tag = \"title\";\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n sync_pb::EntitySpecifics entity_specifics;\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n sync_pb::PasswordSpecificsData data;\n data.set_password_value(\"secret\");\n cryptographer->Encrypt(\n data,\n entity_specifics.mutable_password()->\n mutable_encrypted());\n }\n MakeServerNode(sync_manager_.GetUserShare(), PASSWORDS, client_tag,\n syncable::GenerateSyncableHash(PASSWORDS,\n client_tag),\n entity_specifics);\n // New node shouldn't start off unsynced.\n EXPECT_FALSE(ResetUnsyncedEntry(PASSWORDS, client_tag));\n\n // Manually change to the same data via SetEntitySpecifics. Should not set\n // is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(PASSWORDS, client_tag));\n node.SetEntitySpecifics(entity_specifics);\n }\n EXPECT_FALSE(ResetUnsyncedEntry(PASSWORDS, client_tag));\n}\n\n// Passwords have their own handling for encryption. Verify it does not result\n// in unnecessary writes via SetPasswordSpecifics.\nTEST_F(SyncManagerTest, UpdatePasswordSetPasswordSpecifics) {\n std::string client_tag = \"title\";\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n sync_pb::EntitySpecifics entity_specifics;\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n sync_pb::PasswordSpecificsData data;\n data.set_password_value(\"secret\");\n cryptographer->Encrypt(\n data,\n entity_specifics.mutable_password()->\n mutable_encrypted());\n }\n MakeServerNode(sync_manager_.GetUserShare(), PASSWORDS, client_tag,\n syncable::GenerateSyncableHash(PASSWORDS,\n client_tag),\n entity_specifics);\n // New node shouldn't start off unsynced.\n EXPECT_FALSE(ResetUnsyncedEntry(PASSWORDS, client_tag));\n\n // Manually change to the same data via SetPasswordSpecifics. Should not set\n // is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(PASSWORDS, client_tag));\n node.SetPasswordSpecifics(node.GetPasswordSpecifics());\n }\n EXPECT_FALSE(ResetUnsyncedEntry(PASSWORDS, client_tag));\n\n // Manually change to different data. Should set is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(PASSWORDS, client_tag));\n Cryptographer* cryptographer = trans.GetCryptographer();\n sync_pb::PasswordSpecificsData data;\n data.set_password_value(\"secret2\");\n cryptographer->Encrypt(\n data,\n entity_specifics.mutable_password()->mutable_encrypted());\n node.SetPasswordSpecifics(data);\n const syncable::Entry* node_entry = node.GetEntry();\n EXPECT_TRUE(node_entry->Get(IS_UNSYNCED));\n }\n}\n\n// Passwords have their own handling for encryption. Verify setting a new\n// passphrase updates the data.\nTEST_F(SyncManagerTest, UpdatePasswordNewPassphrase) {\n std::string client_tag = \"title\";\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n sync_pb::EntitySpecifics entity_specifics;\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n sync_pb::PasswordSpecificsData data;\n data.set_password_value(\"secret\");\n cryptographer->Encrypt(\n data,\n entity_specifics.mutable_password()->mutable_encrypted());\n }\n MakeServerNode(sync_manager_.GetUserShare(), PASSWORDS, client_tag,\n syncable::GenerateSyncableHash(PASSWORDS,\n client_tag),\n entity_specifics);\n // New node shouldn't start off unsynced.\n EXPECT_FALSE(ResetUnsyncedEntry(PASSWORDS, client_tag));\n\n // Set a new passphrase. Should set is_unsynced.\n testing::Mock::VerifyAndClearExpectations(&encryption_observer_);\n EXPECT_CALL(encryption_observer_,\n OnBootstrapTokenUpdated(_, PASSPHRASE_BOOTSTRAP_TOKEN));\n EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_,\n OnPassphraseTypeChanged(CUSTOM_PASSPHRASE, _));\n sync_manager_.GetEncryptionHandler()->SetEncryptionPassphrase(\n \"new_passphrase\",\n true);\n EXPECT_EQ(CUSTOM_PASSPHRASE,\n sync_manager_.GetEncryptionHandler()->GetPassphraseType());\n EXPECT_TRUE(ResetUnsyncedEntry(PASSWORDS, client_tag));\n}\n\n// Passwords have their own handling for encryption. Verify it does not result\n// in unnecessary writes via ReencryptEverything.\nTEST_F(SyncManagerTest, UpdatePasswordReencryptEverything) {\n std::string client_tag = \"title\";\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n sync_pb::EntitySpecifics entity_specifics;\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* cryptographer = trans.GetCryptographer();\n sync_pb::PasswordSpecificsData data;\n data.set_password_value(\"secret\");\n cryptographer->Encrypt(\n data,\n entity_specifics.mutable_password()->mutable_encrypted());\n }\n MakeServerNode(sync_manager_.GetUserShare(), PASSWORDS, client_tag,\n syncable::GenerateSyncableHash(PASSWORDS,\n client_tag),\n entity_specifics);\n // New node shouldn't start off unsynced.\n EXPECT_FALSE(ResetUnsyncedEntry(PASSWORDS, client_tag));\n\n // Force a re-encrypt everything. Should not set is_unsynced.\n testing::Mock::VerifyAndClearExpectations(&encryption_observer_);\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_, OnEncryptedTypesChanged(_, false));\n sync_manager_.GetEncryptionHandler()->Init();\n PumpLoop();\n EXPECT_FALSE(ResetUnsyncedEntry(PASSWORDS, client_tag));\n}\n\n// Verify SetTitle(..) doesn't unnecessarily set IS_UNSYNCED for bookmarks\n// when we write the same data, but does set it when we write new data.\nTEST_F(SyncManagerTest, SetBookmarkTitle) {\n std::string client_tag = \"title\";\n sync_pb::EntitySpecifics entity_specifics;\n entity_specifics.mutable_bookmark()->set_url(\"url\");\n entity_specifics.mutable_bookmark()->set_title(\"title\");\n MakeServerNode(sync_manager_.GetUserShare(), BOOKMARKS, client_tag,\n syncable::GenerateSyncableHash(BOOKMARKS,\n client_tag),\n entity_specifics);\n // New node shouldn't start off unsynced.\n EXPECT_FALSE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n\n // Manually change to the same title. Should not set is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n node.SetTitle(UTF8ToWide(client_tag));\n }\n EXPECT_FALSE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n\n // Manually change to new title. Should set is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n node.SetTitle(UTF8ToWide(\"title2\"));\n }\n EXPECT_TRUE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n}\n\n// Verify SetTitle(..) doesn't unnecessarily set IS_UNSYNCED for encrypted\n// bookmarks when we write the same data, but does set it when we write new\n// data.\nTEST_F(SyncManagerTest, SetBookmarkTitleWithEncryption) {\n std::string client_tag = \"title\";\n sync_pb::EntitySpecifics entity_specifics;\n entity_specifics.mutable_bookmark()->set_url(\"url\");\n entity_specifics.mutable_bookmark()->set_title(\"title\");\n MakeServerNode(sync_manager_.GetUserShare(), BOOKMARKS, client_tag,\n syncable::GenerateSyncableHash(BOOKMARKS,\n client_tag),\n entity_specifics);\n // New node shouldn't start off unsynced.\n EXPECT_FALSE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n\n // Encrypt the datatatype, should set is_unsynced.\n EXPECT_CALL(encryption_observer_,\n OnEncryptedTypesChanged(\n HasModelTypes(EncryptableUserTypes()), true));\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, FULL_ENCRYPTION));\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_, OnEncryptedTypesChanged(_, true));\n sync_manager_.GetEncryptionHandler()->Init();\n PumpLoop();\n EXPECT_TRUE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n\n // Manually change to the same title. Should not set is_unsynced.\n // NON_UNIQUE_NAME should be kEncryptedString.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n node.SetTitle(UTF8ToWide(client_tag));\n const syncable::Entry* node_entry = node.GetEntry();\n const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS);\n EXPECT_TRUE(specifics.has_encrypted());\n EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME));\n }\n EXPECT_FALSE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n\n // Manually change to new title. Should set is_unsynced. NON_UNIQUE_NAME\n // should still be kEncryptedString.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n node.SetTitle(UTF8ToWide(\"title2\"));\n const syncable::Entry* node_entry = node.GetEntry();\n const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS);\n EXPECT_TRUE(specifics.has_encrypted());\n EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME));\n }\n EXPECT_TRUE(ResetUnsyncedEntry(BOOKMARKS, client_tag));\n}\n\n// Verify SetTitle(..) doesn't unnecessarily set IS_UNSYNCED for non-bookmarks\n// when we write the same data, but does set it when we write new data.\nTEST_F(SyncManagerTest, SetNonBookmarkTitle) {\n std::string client_tag = \"title\";\n sync_pb::EntitySpecifics entity_specifics;\n entity_specifics.mutable_preference()->set_name(\"name\");\n entity_specifics.mutable_preference()->set_value(\"value\");\n MakeServerNode(sync_manager_.GetUserShare(),\n PREFERENCES,\n client_tag,\n syncable::GenerateSyncableHash(PREFERENCES,\n client_tag),\n entity_specifics);\n // New node shouldn't start off unsynced.\n EXPECT_FALSE(ResetUnsyncedEntry(PREFERENCES, client_tag));\n\n // Manually change to the same title. Should not set is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(PREFERENCES, client_tag));\n node.SetTitle(UTF8ToWide(client_tag));\n }\n EXPECT_FALSE(ResetUnsyncedEntry(PREFERENCES, client_tag));\n\n // Manually change to new title. Should set is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(PREFERENCES, client_tag));\n node.SetTitle(UTF8ToWide(\"title2\"));\n }\n EXPECT_TRUE(ResetUnsyncedEntry(PREFERENCES, client_tag));\n}\n\n// Verify SetTitle(..) doesn't unnecessarily set IS_UNSYNCED for encrypted\n// non-bookmarks when we write the same data or when we write new data\n// data (should remained kEncryptedString).\nTEST_F(SyncManagerTest, SetNonBookmarkTitleWithEncryption) {\n std::string client_tag = \"title\";\n sync_pb::EntitySpecifics entity_specifics;\n entity_specifics.mutable_preference()->set_name(\"name\");\n entity_specifics.mutable_preference()->set_value(\"value\");\n MakeServerNode(sync_manager_.GetUserShare(),\n PREFERENCES,\n client_tag,\n syncable::GenerateSyncableHash(PREFERENCES,\n client_tag),\n entity_specifics);\n // New node shouldn't start off unsynced.\n EXPECT_FALSE(ResetUnsyncedEntry(PREFERENCES, client_tag));\n\n // Encrypt the datatatype, should set is_unsynced.\n EXPECT_CALL(encryption_observer_,\n OnEncryptedTypesChanged(\n HasModelTypes(EncryptableUserTypes()), true));\n EXPECT_CALL(encryption_observer_, OnEncryptionComplete());\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, FULL_ENCRYPTION));\n EXPECT_CALL(encryption_observer_, OnCryptographerStateChanged(_));\n EXPECT_CALL(encryption_observer_, OnEncryptedTypesChanged(_, true));\n sync_manager_.GetEncryptionHandler()->Init();\n PumpLoop();\n EXPECT_TRUE(ResetUnsyncedEntry(PREFERENCES, client_tag));\n\n // Manually change to the same title. Should not set is_unsynced.\n // NON_UNIQUE_NAME should be kEncryptedString.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(PREFERENCES, client_tag));\n node.SetTitle(UTF8ToWide(client_tag));\n const syncable::Entry* node_entry = node.GetEntry();\n const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS);\n EXPECT_TRUE(specifics.has_encrypted());\n EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME));\n }\n EXPECT_FALSE(ResetUnsyncedEntry(PREFERENCES, client_tag));\n\n // Manually change to new title. Should not set is_unsynced because the\n // NON_UNIQUE_NAME should still be kEncryptedString.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(PREFERENCES, client_tag));\n node.SetTitle(UTF8ToWide(\"title2\"));\n const syncable::Entry* node_entry = node.GetEntry();\n const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS);\n EXPECT_TRUE(specifics.has_encrypted());\n EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME));\n EXPECT_FALSE(node_entry->Get(IS_UNSYNCED));\n }\n}\n\n// Ensure that titles are truncated to 255 bytes, and attempting to reset\n// them to their longer version does not set IS_UNSYNCED.\nTEST_F(SyncManagerTest, SetLongTitle) {\n const int kNumChars = 512;\n const std::string kClientTag = \"tag\";\n std::string title(kNumChars, '0');\n sync_pb::EntitySpecifics entity_specifics;\n entity_specifics.mutable_preference()->set_name(\"name\");\n entity_specifics.mutable_preference()->set_value(\"value\");\n MakeServerNode(sync_manager_.GetUserShare(),\n PREFERENCES,\n \"short_title\",\n syncable::GenerateSyncableHash(PREFERENCES,\n kClientTag),\n entity_specifics);\n // New node shouldn't start off unsynced.\n EXPECT_FALSE(ResetUnsyncedEntry(PREFERENCES, kClientTag));\n\n // Manually change to the long title. Should set is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(PREFERENCES, kClientTag));\n node.SetTitle(UTF8ToWide(title));\n EXPECT_EQ(node.GetTitle(), title.substr(0, 255));\n }\n EXPECT_TRUE(ResetUnsyncedEntry(PREFERENCES, kClientTag));\n\n // Manually change to the same title. Should not set is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(PREFERENCES, kClientTag));\n node.SetTitle(UTF8ToWide(title));\n EXPECT_EQ(node.GetTitle(), title.substr(0, 255));\n }\n EXPECT_FALSE(ResetUnsyncedEntry(PREFERENCES, kClientTag));\n\n // Manually change to new title. Should set is_unsynced.\n {\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(PREFERENCES, kClientTag));\n node.SetTitle(UTF8ToWide(\"title2\"));\n }\n EXPECT_TRUE(ResetUnsyncedEntry(PREFERENCES, kClientTag));\n}\n\n// Create an encrypted entry when the cryptographer doesn't think the type is\n// marked for encryption. Ensure reads/writes don't break and don't unencrypt\n// the data.\nTEST_F(SyncManagerTest, SetPreviouslyEncryptedSpecifics) {\n std::string client_tag = \"tag\";\n std::string url = \"url\";\n std::string url2 = \"new_url\";\n std::string title = \"title\";\n sync_pb::EntitySpecifics entity_specifics;\n EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION));\n {\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n Cryptographer* crypto = trans.GetCryptographer();\n sync_pb::EntitySpecifics bm_specifics;\n bm_specifics.mutable_bookmark()->set_title(\"title\");\n bm_specifics.mutable_bookmark()->set_url(\"url\");\n sync_pb::EncryptedData encrypted;\n crypto->Encrypt(bm_specifics, &encrypted);\n entity_specifics.mutable_encrypted()->CopyFrom(encrypted);\n AddDefaultFieldValue(BOOKMARKS, &entity_specifics);\n }\n MakeServerNode(sync_manager_.GetUserShare(), BOOKMARKS, client_tag,\n syncable::GenerateSyncableHash(BOOKMARKS,\n client_tag),\n entity_specifics);\n\n {\n // Verify the data.\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n EXPECT_EQ(title, node.GetTitle());\n EXPECT_EQ(url, node.GetBookmarkSpecifics().url());\n }\n\n {\n // Overwrite the url (which overwrites the specifics).\n WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n WriteNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n\n sync_pb::BookmarkSpecifics bookmark_specifics(node.GetBookmarkSpecifics());\n bookmark_specifics.set_url(url2);\n node.SetBookmarkSpecifics(bookmark_specifics);\n }\n\n {\n // Verify it's still encrypted and it has the most recent url.\n ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare());\n ReadNode node(&trans);\n EXPECT_EQ(BaseNode::INIT_OK,\n node.InitByClientTagLookup(BOOKMARKS, client_tag));\n EXPECT_EQ(title, node.GetTitle());\n EXPECT_EQ(url2, node.GetBookmarkSpecifics().url());\n const syncable::Entry* node_entry = node.GetEntry();\n EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME));\n const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS);\n EXPECT_TRUE(specifics.has_encrypted());\n }\n}\n\n// Verify transaction version of a model type is incremented when node of\n// that type is updated.\nTEST_F(SyncManagerTest, IncrementTransactionVersion) {\n ModelSafeRoutingInfo routing_info;\n GetModelSafeRoutingInfo(&routing_info);\n\n {\n ReadTransaction read_trans(FROM_HERE, sync_manager_.GetUserShare());\n for (ModelSafeRoutingInfo::iterator i = routing_info.begin();\n i != routing_info.end(); ++i) {\n // Transaction version is incremented when SyncManagerTest::SetUp()\n // creates a node of each type.\n EXPECT_EQ(1,\n sync_manager_.GetUserShare()->directory->\n GetTransactionVersion(i->first));\n }\n }\n\n // Create bookmark node to increment transaction version of bookmark model.\n std::string client_tag = \"title\";\n sync_pb::EntitySpecifics entity_specifics;\n entity_specifics.mutable_bookmark()->set_url(\"url\");\n entity_specifics.mutable_bookmark()->set_title(\"title\");\n MakeServerNode(sync_manager_.GetUserShare(), BOOKMARKS, client_tag,\n syncable::GenerateSyncableHash(BOOKMARKS,\n client_tag),\n entity_specifics);\n\n {\n ReadTransaction read_trans(FROM_HERE, sync_manager_.GetUserShare());\n for (ModelSafeRoutingInfo::iterator i = routing_info.begin();\n i != routing_info.end(); ++i) {\n EXPECT_EQ(i->first == BOOKMARKS ? 2 : 1,\n sync_manager_.GetUserShare()->directory->\n GetTransactionVersion(i->first));\n }\n }\n}\n\nclass MockSyncScheduler : public FakeSyncScheduler {\n public:\n MockSyncScheduler() : FakeSyncScheduler() {}\n virtual ~MockSyncScheduler() {}\n\n MOCK_METHOD1(Start, void(SyncScheduler::Mode));\n MOCK_METHOD1(ScheduleConfiguration, bool(const ConfigurationParams&));\n};\n\nclass ComponentsFactory : public TestInternalComponentsFactory {\n public:\n ComponentsFactory(const Switches& switches,\n SyncScheduler* scheduler_to_use,\n sessions::SyncSessionContext** session_context)\n : TestInternalComponentsFactory(switches, syncer::STORAGE_IN_MEMORY),\n scheduler_to_use_(scheduler_to_use),\n session_context_(session_context) {}\n virtual ~ComponentsFactory() {}\n\n virtual scoped_ptr<SyncScheduler> BuildScheduler(\n const std::string& name,\n sessions::SyncSessionContext* context) OVERRIDE {\n *session_context_ = context;\n return scheduler_to_use_.Pass();\n }\n\n private:\n scoped_ptr<SyncScheduler> scheduler_to_use_;\n sessions::SyncSessionContext** session_context_;\n};\n\nclass SyncManagerTestWithMockScheduler : public SyncManagerTest {\n public:\n SyncManagerTestWithMockScheduler() : scheduler_(NULL) {}\n virtual InternalComponentsFactory* GetFactory() OVERRIDE {\n scheduler_ = new MockSyncScheduler();\n return new ComponentsFactory(GetSwitches(), scheduler_, &session_context_);\n }\n\n MockSyncScheduler* scheduler() { return scheduler_; }\n sessions::SyncSessionContext* session_context() {\n return session_context_;\n }\n\n private:\n MockSyncScheduler* scheduler_;\n sessions::SyncSessionContext* session_context_;\n};\n\n// Test that the configuration params are properly created and sent to\n// ScheduleConfigure. No callback should be invoked. Any disabled datatypes\n// should be purged.\nTEST_F(SyncManagerTestWithMockScheduler, BasicConfiguration) {\n ConfigureReason reason = CONFIGURE_REASON_RECONFIGURATION;\n ModelTypeSet types_to_download(BOOKMARKS, PREFERENCES);\n ModelSafeRoutingInfo new_routing_info;\n GetModelSafeRoutingInfo(&new_routing_info);\n ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info);\n ModelTypeSet disabled_types = Difference(ModelTypeSet::All(), enabled_types);\n\n ConfigurationParams params;\n EXPECT_CALL(*scheduler(), Start(SyncScheduler::CONFIGURATION_MODE));\n EXPECT_CALL(*scheduler(), ScheduleConfiguration(_)).\n WillOnce(DoAll(SaveArg<0>(¶ms), Return(true)));\n\n // Set data for all types.\n ModelTypeSet protocol_types = ProtocolTypes();\n for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good();\n iter.Inc()) {\n SetProgressMarkerForType(iter.Get(), true);\n }\n\n CallbackCounter ready_task_counter, retry_task_counter;\n sync_manager_.ConfigureSyncer(\n reason,\n types_to_download,\n ModelTypeSet(),\n ModelTypeSet(),\n ModelTypeSet(),\n new_routing_info,\n base::Bind(&CallbackCounter::Callback,\n base::Unretained(&ready_task_counter)),\n base::Bind(&CallbackCounter::Callback,\n base::Unretained(&retry_task_counter)));\n EXPECT_EQ(0, ready_task_counter.times_called());\n EXPECT_EQ(0, retry_task_counter.times_called());\n EXPECT_EQ(sync_pb::GetUpdatesCallerInfo::RECONFIGURATION,\n params.source);\n EXPECT_TRUE(types_to_download.Equals(params.types_to_download));\n EXPECT_EQ(new_routing_info, params.routing_info);\n\n // Verify all the disabled types were purged.\n EXPECT_TRUE(sync_manager_.InitialSyncEndedTypes().Equals(\n enabled_types));\n EXPECT_TRUE(sync_manager_.GetTypesWithEmptyProgressMarkerToken(\n ModelTypeSet::All()).Equals(disabled_types));\n}\n\n// Test that on a reconfiguration (configuration where the session context\n// already has routing info), only those recently disabled types are purged.\nTEST_F(SyncManagerTestWithMockScheduler, ReConfiguration) {\n ConfigureReason reason = CONFIGURE_REASON_RECONFIGURATION;\n ModelTypeSet types_to_download(BOOKMARKS, PREFERENCES);\n ModelTypeSet disabled_types = ModelTypeSet(THEMES, SESSIONS);\n ModelSafeRoutingInfo old_routing_info;\n ModelSafeRoutingInfo new_routing_info;\n GetModelSafeRoutingInfo(&old_routing_info);\n new_routing_info = old_routing_info;\n new_routing_info.erase(THEMES);\n new_routing_info.erase(SESSIONS);\n ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info);\n\n ConfigurationParams params;\n EXPECT_CALL(*scheduler(), Start(SyncScheduler::CONFIGURATION_MODE));\n EXPECT_CALL(*scheduler(), ScheduleConfiguration(_)).\n WillOnce(DoAll(SaveArg<0>(¶ms), Return(true)));\n\n // Set data for all types except those recently disabled (so we can verify\n // only those recently disabled are purged) .\n ModelTypeSet protocol_types = ProtocolTypes();\n for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good();\n iter.Inc()) {\n if (!disabled_types.Has(iter.Get())) {\n SetProgressMarkerForType(iter.Get(), true);\n } else {\n SetProgressMarkerForType(iter.Get(), false);\n }\n }\n\n // Set the context to have the old routing info.\n session_context()->set_routing_info(old_routing_info);\n\n CallbackCounter ready_task_counter, retry_task_counter;\n sync_manager_.ConfigureSyncer(\n reason,\n types_to_download,\n ModelTypeSet(),\n ModelTypeSet(),\n ModelTypeSet(),\n new_routing_info,\n base::Bind(&CallbackCounter::Callback,\n base::Unretained(&ready_task_counter)),\n base::Bind(&CallbackCounter::Callback,\n base::Unretained(&retry_task_counter)));\n EXPECT_EQ(0, ready_task_counter.times_called());\n EXPECT_EQ(0, retry_task_counter.times_called());\n EXPECT_EQ(sync_pb::GetUpdatesCallerInfo::RECONFIGURATION,\n params.source);\n EXPECT_TRUE(types_to_download.Equals(params.types_to_download));\n EXPECT_EQ(new_routing_info, params.routing_info);\n\n // Verify only the recently disabled types were purged.\n EXPECT_TRUE(sync_manager_.GetTypesWithEmptyProgressMarkerToken(\n ProtocolTypes()).Equals(disabled_types));\n}\n\n// Test that the retry callback is invoked on configuration failure.\nTEST_F(SyncManagerTestWithMockScheduler, ConfigurationRetry) {\n ConfigureReason reason = CONFIGURE_REASON_RECONFIGURATION;\n ModelTypeSet types_to_download(BOOKMARKS, PREFERENCES);\n ModelSafeRoutingInfo new_routing_info;\n GetModelSafeRoutingInfo(&new_routing_info);\n\n ConfigurationParams params;\n EXPECT_CALL(*scheduler(), Start(SyncScheduler::CONFIGURATION_MODE));\n EXPECT_CALL(*scheduler(), ScheduleConfiguration(_)).\n WillOnce(DoAll(SaveArg<0>(¶ms), Return(false)));\n\n CallbackCounter ready_task_counter, retry_task_counter;\n sync_manager_.ConfigureSyncer(\n reason,\n types_to_download,\n ModelTypeSet(),\n ModelTypeSet(),\n ModelTypeSet(),\n new_routing_info,\n base::Bind(&CallbackCounter::Callback,\n base::Unretained(&ready_task_counter)),\n base::Bind(&CallbackCounter::Callback,\n base::Unretained(&retry_task_counter)));\n EXPECT_EQ(0, ready_task_counter.times_called());\n EXPECT_EQ(1, retry_task_counter.times_called());\n EXPECT_EQ(sync_pb::GetUpdatesCallerInfo::RECONFIGURATION,\n params.source);\n EXPECT_TRUE(types_to_download.Equals(params.types_to_download));\n EXPECT_EQ(new_routing_info, params.routing_info);\n}\n\n// Test that PurgePartiallySyncedTypes purges only those types that have not\n// fully completed their initial download and apply.\nTEST_F(SyncManagerTest, PurgePartiallySyncedTypes) {\n ModelSafeRoutingInfo routing_info;\n GetModelSafeRoutingInfo(&routing_info);\n ModelTypeSet enabled_types = GetRoutingInfoTypes(routing_info);\n\n UserShare* share = sync_manager_.GetUserShare();\n\n // The test harness automatically initializes all types in the routing info.\n // Check that autofill is not among them.\n ASSERT_FALSE(enabled_types.Has(AUTOFILL));\n\n // Further ensure that the test harness did not create its root node.\n {\n syncable::ReadTransaction trans(FROM_HERE, share->directory.get());\n syncable::Entry autofill_root_node(&trans, syncable::GET_BY_SERVER_TAG,\n ModelTypeToRootTag(AUTOFILL));\n ASSERT_FALSE(autofill_root_node.good());\n }\n\n // One more redundant check.\n ASSERT_FALSE(sync_manager_.InitialSyncEndedTypes().Has(AUTOFILL));\n\n // Give autofill a progress marker.\n sync_pb::DataTypeProgressMarker autofill_marker;\n autofill_marker.set_data_type_id(\n GetSpecificsFieldNumberFromModelType(AUTOFILL));\n autofill_marker.set_token(\"token\");\n share->directory->SetDownloadProgress(AUTOFILL, autofill_marker);\n\n // Also add a pending autofill root node update from the server.\n TestEntryFactory factory_(share->directory.get());\n int autofill_meta = factory_.CreateUnappliedRootNode(AUTOFILL);\n\n // Preferences is an enabled type. Check that the harness initialized it.\n ASSERT_TRUE(enabled_types.Has(PREFERENCES));\n ASSERT_TRUE(sync_manager_.InitialSyncEndedTypes().Has(PREFERENCES));\n\n // Give preferencse a progress marker.\n sync_pb::DataTypeProgressMarker prefs_marker;\n prefs_marker.set_data_type_id(\n GetSpecificsFieldNumberFromModelType(PREFERENCES));\n prefs_marker.set_token(\"token\");\n share->directory->SetDownloadProgress(PREFERENCES, prefs_marker);\n\n // Add a fully synced preferences node under the root.\n std::string pref_client_tag = \"prefABC\";\n std::string pref_hashed_tag = \"hashXYZ\";\n sync_pb::EntitySpecifics pref_specifics;\n AddDefaultFieldValue(PREFERENCES, &pref_specifics);\n int pref_meta = MakeServerNode(\n share, PREFERENCES, pref_client_tag, pref_hashed_tag, pref_specifics);\n\n // And now, the purge.\n EXPECT_TRUE(sync_manager_.PurgePartiallySyncedTypes());\n\n // Ensure that autofill lost its progress marker, but preferences did not.\n ModelTypeSet empty_tokens =\n sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All());\n EXPECT_TRUE(empty_tokens.Has(AUTOFILL));\n EXPECT_FALSE(empty_tokens.Has(PREFERENCES));\n\n // Ensure that autofill lots its node, but preferences did not.\n {\n syncable::ReadTransaction trans(FROM_HERE, share->directory.get());\n syncable::Entry autofill_node(&trans, GET_BY_HANDLE, autofill_meta);\n syncable::Entry pref_node(&trans, GET_BY_HANDLE, pref_meta);\n EXPECT_FALSE(autofill_node.good());\n EXPECT_TRUE(pref_node.good());\n }\n}\n\n// Test CleanupDisabledTypes properly purges all disabled types as specified\n// by the previous and current enabled params.\nTEST_F(SyncManagerTest, PurgeDisabledTypes) {\n ModelSafeRoutingInfo routing_info;\n GetModelSafeRoutingInfo(&routing_info);\n ModelTypeSet enabled_types = GetRoutingInfoTypes(routing_info);\n ModelTypeSet disabled_types = Difference(ModelTypeSet::All(), enabled_types);\n\n // The harness should have initialized the enabled_types for us.\n EXPECT_TRUE(enabled_types.Equals(sync_manager_.InitialSyncEndedTypes()));\n\n // Set progress markers for all types.\n ModelTypeSet protocol_types = ProtocolTypes();\n for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good();\n iter.Inc()) {\n SetProgressMarkerForType(iter.Get(), true);\n }\n\n // Verify all the enabled types remain after cleanup, and all the disabled\n // types were purged.\n sync_manager_.PurgeDisabledTypes(ModelTypeSet::All(),\n enabled_types,\n ModelTypeSet(),\n ModelTypeSet());\n EXPECT_TRUE(enabled_types.Equals(sync_manager_.InitialSyncEndedTypes()));\n EXPECT_TRUE(disabled_types.Equals(\n sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All())));\n\n // Disable some more types.\n disabled_types.Put(BOOKMARKS);\n disabled_types.Put(PREFERENCES);\n ModelTypeSet new_enabled_types =\n Difference(ModelTypeSet::All(), disabled_types);\n\n // Verify only the non-disabled types remain after cleanup.\n sync_manager_.PurgeDisabledTypes(enabled_types,\n new_enabled_types,\n ModelTypeSet(),\n ModelTypeSet());\n EXPECT_TRUE(new_enabled_types.Equals(sync_manager_.InitialSyncEndedTypes()));\n EXPECT_TRUE(disabled_types.Equals(\n sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All())));\n}\n\n// Test PurgeDisabledTypes properly unapplies types by deleting their local data\n// and preserving their server data and progress marker.\nTEST_F(SyncManagerTest, PurgeUnappliedTypes) {\n ModelSafeRoutingInfo routing_info;\n GetModelSafeRoutingInfo(&routing_info);\n ModelTypeSet unapplied_types = ModelTypeSet(BOOKMARKS, PREFERENCES);\n ModelTypeSet enabled_types = GetRoutingInfoTypes(routing_info);\n ModelTypeSet disabled_types = Difference(ModelTypeSet::All(), enabled_types);\n\n // The harness should have initialized the enabled_types for us.\n EXPECT_TRUE(enabled_types.Equals(sync_manager_.InitialSyncEndedTypes()));\n\n // Set progress markers for all types.\n ModelTypeSet protocol_types = ProtocolTypes();\n for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good();\n iter.Inc()) {\n SetProgressMarkerForType(iter.Get(), true);\n }\n\n // Add the following kinds of items:\n // 1. Fully synced preference.\n // 2. Locally created preference, server unknown, unsynced\n // 3. Locally deleted preference, server known, unsynced\n // 4. Server deleted preference, locally known.\n // 5. Server created preference, locally unknown, unapplied.\n // 6. A fully synced bookmark (no unique_client_tag).\n UserShare* share = sync_manager_.GetUserShare();\n sync_pb::EntitySpecifics pref_specifics;\n AddDefaultFieldValue(PREFERENCES, &pref_specifics);\n sync_pb::EntitySpecifics bm_specifics;\n AddDefaultFieldValue(BOOKMARKS, &bm_specifics);\n int pref1_meta = MakeServerNode(\n share, PREFERENCES, \"pref1\", \"hash1\", pref_specifics);\n int64 pref2_meta = MakeNode(share, PREFERENCES, \"pref2\");\n int pref3_meta = MakeServerNode(\n share, PREFERENCES, \"pref3\", \"hash3\", pref_specifics);\n int pref4_meta = MakeServerNode(\n share, PREFERENCES, \"pref4\", \"hash4\", pref_specifics);\n int pref5_meta = MakeServerNode(\n share, PREFERENCES, \"pref5\", \"hash5\", pref_specifics);\n int bookmark_meta = MakeServerNode(\n share, BOOKMARKS, \"bookmark\", \"\", bm_specifics);\n\n {\n syncable::WriteTransaction trans(FROM_HERE,\n syncable::SYNCER,\n share->directory.get());\n // Pref's 1 and 2 are already set up properly.\n // Locally delete pref 3.\n syncable::MutableEntry pref3(&trans, GET_BY_HANDLE, pref3_meta);\n pref3.Put(IS_DEL, true);\n pref3.Put(IS_UNSYNCED, true);\n // Delete pref 4 at the server.\n syncable::MutableEntry pref4(&trans, GET_BY_HANDLE, pref4_meta);\n pref4.Put(syncable::SERVER_IS_DEL, true);\n pref4.Put(syncable::IS_UNAPPLIED_UPDATE, true);\n pref4.Put(syncable::SERVER_VERSION, 2);\n // Pref 5 is an new unapplied update.\n syncable::MutableEntry pref5(&trans, GET_BY_HANDLE, pref5_meta);\n pref5.Put(syncable::IS_UNAPPLIED_UPDATE, true);\n pref5.Put(syncable::IS_DEL, true);\n pref5.Put(syncable::BASE_VERSION, -1);\n // Bookmark is already set up properly\n }\n\n // Take a snapshot to clear all the dirty bits.\n share->directory.get()->SaveChanges();\n\n // Now request a purge for the unapplied types.\n disabled_types.PutAll(unapplied_types);\n ModelTypeSet new_enabled_types =\n Difference(ModelTypeSet::All(), disabled_types);\n sync_manager_.PurgeDisabledTypes(enabled_types,\n new_enabled_types,\n ModelTypeSet(),\n unapplied_types);\n\n // Verify the unapplied types still have progress markers and initial sync\n // ended after cleanup.\n EXPECT_TRUE(sync_manager_.InitialSyncEndedTypes().HasAll(unapplied_types));\n EXPECT_TRUE(\n sync_manager_.GetTypesWithEmptyProgressMarkerToken(unapplied_types).\n Empty());\n\n // Ensure the items were unapplied as necessary.\n {\n syncable::ReadTransaction trans(FROM_HERE, share->directory.get());\n syncable::Entry pref_node(&trans, GET_BY_HANDLE, pref1_meta);\n ASSERT_TRUE(pref_node.good());\n EXPECT_TRUE(pref_node.GetKernelCopy().is_dirty());\n EXPECT_FALSE(pref_node.Get(syncable::IS_UNSYNCED));\n EXPECT_TRUE(pref_node.Get(syncable::IS_UNAPPLIED_UPDATE));\n EXPECT_TRUE(pref_node.Get(IS_DEL));\n EXPECT_GT(pref_node.Get(syncable::SERVER_VERSION), 0);\n EXPECT_EQ(pref_node.Get(syncable::BASE_VERSION), -1);\n\n // Pref 2 should just be locally deleted.\n syncable::Entry pref2_node(&trans, GET_BY_HANDLE, pref2_meta);\n ASSERT_TRUE(pref2_node.good());\n EXPECT_TRUE(pref2_node.GetKernelCopy().is_dirty());\n EXPECT_FALSE(pref2_node.Get(syncable::IS_UNSYNCED));\n EXPECT_TRUE(pref2_node.Get(syncable::IS_DEL));\n EXPECT_FALSE(pref2_node.Get(syncable::IS_UNAPPLIED_UPDATE));\n EXPECT_TRUE(pref2_node.Get(IS_DEL));\n EXPECT_EQ(pref2_node.Get(syncable::SERVER_VERSION), 0);\n EXPECT_EQ(pref2_node.Get(syncable::BASE_VERSION), -1);\n\n syncable::Entry pref3_node(&trans, GET_BY_HANDLE, pref3_meta);\n ASSERT_TRUE(pref3_node.good());\n EXPECT_TRUE(pref3_node.GetKernelCopy().is_dirty());\n EXPECT_FALSE(pref3_node.Get(syncable::IS_UNSYNCED));\n EXPECT_TRUE(pref3_node.Get(syncable::IS_UNAPPLIED_UPDATE));\n EXPECT_TRUE(pref3_node.Get(IS_DEL));\n EXPECT_GT(pref3_node.Get(syncable::SERVER_VERSION), 0);\n EXPECT_EQ(pref3_node.Get(syncable::BASE_VERSION), -1);\n\n syncable::Entry pref4_node(&trans, GET_BY_HANDLE, pref4_meta);\n ASSERT_TRUE(pref4_node.good());\n EXPECT_TRUE(pref4_node.GetKernelCopy().is_dirty());\n EXPECT_FALSE(pref4_node.Get(syncable::IS_UNSYNCED));\n EXPECT_TRUE(pref4_node.Get(syncable::IS_UNAPPLIED_UPDATE));\n EXPECT_TRUE(pref4_node.Get(IS_DEL));\n EXPECT_GT(pref4_node.Get(syncable::SERVER_VERSION), 0);\n EXPECT_EQ(pref4_node.Get(syncable::BASE_VERSION), -1);\n\n // Pref 5 should remain untouched.\n syncable::Entry pref5_node(&trans, GET_BY_HANDLE, pref5_meta);\n ASSERT_TRUE(pref5_node.good());\n EXPECT_FALSE(pref5_node.GetKernelCopy().is_dirty());\n EXPECT_FALSE(pref5_node.Get(syncable::IS_UNSYNCED));\n EXPECT_TRUE(pref5_node.Get(syncable::IS_UNAPPLIED_UPDATE));\n EXPECT_TRUE(pref5_node.Get(IS_DEL));\n EXPECT_GT(pref5_node.Get(syncable::SERVER_VERSION), 0);\n EXPECT_EQ(pref5_node.Get(syncable::BASE_VERSION), -1);\n\n syncable::Entry bookmark_node(&trans, GET_BY_HANDLE, bookmark_meta);\n ASSERT_TRUE(bookmark_node.good());\n EXPECT_TRUE(bookmark_node.GetKernelCopy().is_dirty());\n EXPECT_FALSE(bookmark_node.Get(syncable::IS_UNSYNCED));\n EXPECT_TRUE(bookmark_node.Get(syncable::IS_UNAPPLIED_UPDATE));\n EXPECT_TRUE(bookmark_node.Get(IS_DEL));\n EXPECT_GT(bookmark_node.Get(syncable::SERVER_VERSION), 0);\n EXPECT_EQ(bookmark_node.Get(syncable::BASE_VERSION), -1);\n }\n}\n\n// A test harness to exercise the code that processes and passes changes from\n// the \"SYNCER\"-WriteTransaction destructor, through the SyncManager, to the\n// ChangeProcessor.\nclass SyncManagerChangeProcessingTest : public SyncManagerTest {\n public:\n virtual void OnChangesApplied(\n ModelType model_type,\n int64 model_version,\n const BaseTransaction* trans,\n const ImmutableChangeRecordList& changes) OVERRIDE {\n last_changes_ = changes;\n }\n\n virtual void OnChangesComplete(ModelType model_type) OVERRIDE {}\n\n const ImmutableChangeRecordList& GetRecentChangeList() {\n return last_changes_;\n }\n\n UserShare* share() {\n return sync_manager_.GetUserShare();\n }\n\n // Set some flags so our nodes reasonably approximate the real world scenario\n // and can get past CheckTreeInvariants.\n //\n // It's never going to be truly accurate, since we're squashing update\n // receipt, processing and application into a single transaction.\n void SetNodeProperties(syncable::MutableEntry *entry) {\n entry->Put(syncable::ID, id_factory_.NewServerId());\n entry->Put(syncable::BASE_VERSION, 10);\n entry->Put(syncable::SERVER_VERSION, 10);\n }\n\n // Looks for the given change in the list. Returns the index at which it was\n // found. Returns -1 on lookup failure.\n size_t FindChangeInList(int64 id, ChangeRecord::Action action) {\n SCOPED_TRACE(id);\n for (size_t i = 0; i < last_changes_.Get().size(); ++i) {\n if (last_changes_.Get()[i].id == id\n && last_changes_.Get()[i].action == action) {\n return i;\n }\n }\n ADD_FAILURE() << \"Failed to find specified change\";\n return -1;\n }\n\n // Returns the current size of the change list.\n //\n // Note that spurious changes do not necessarily indicate a problem.\n // Assertions on change list size can help detect problems, but it may be\n // necessary to reduce their strictness if the implementation changes.\n size_t GetChangeListSize() {\n return last_changes_.Get().size();\n }\n\n protected:\n ImmutableChangeRecordList last_changes_;\n TestIdFactory id_factory_;\n};\n\n// Test creation of a folder and a bookmark.\nTEST_F(SyncManagerChangeProcessingTest, AddBookmarks) {\n int64 type_root = GetIdForDataType(BOOKMARKS);\n int64 folder_id = kInvalidId;\n int64 child_id = kInvalidId;\n\n // Create a folder and a bookmark under it.\n {\n syncable::WriteTransaction trans(\n FROM_HERE, syncable::SYNCER, share()->directory.get());\n syncable::Entry root(&trans, syncable::GET_BY_HANDLE, type_root);\n ASSERT_TRUE(root.good());\n\n syncable::MutableEntry folder(&trans, syncable::CREATE,\n BOOKMARKS, root.Get(syncable::ID), \"folder\");\n ASSERT_TRUE(folder.good());\n SetNodeProperties(&folder);\n folder.Put(syncable::IS_DIR, true);\n folder_id = folder.Get(syncable::META_HANDLE);\n\n syncable::MutableEntry child(&trans, syncable::CREATE,\n BOOKMARKS, folder.Get(syncable::ID), \"child\");\n ASSERT_TRUE(child.good());\n SetNodeProperties(&child);\n child_id = child.Get(syncable::META_HANDLE);\n }\n\n // The closing of the above scope will delete the transaction. Its processed\n // changes should be waiting for us in a member of the test harness.\n EXPECT_EQ(2UL, GetChangeListSize());\n\n // We don't need to check these return values here. The function will add a\n // non-fatal failure if these changes are not found.\n size_t folder_change_pos =\n FindChangeInList(folder_id, ChangeRecord::ACTION_ADD);\n size_t child_change_pos =\n FindChangeInList(child_id, ChangeRecord::ACTION_ADD);\n\n // Parents are delivered before children.\n EXPECT_LT(folder_change_pos, child_change_pos);\n}\n\n// Test moving a bookmark into an empty folder.\nTEST_F(SyncManagerChangeProcessingTest, MoveBookmarkIntoEmptyFolder) {\n int64 type_root = GetIdForDataType(BOOKMARKS);\n int64 folder_b_id = kInvalidId;\n int64 child_id = kInvalidId;\n\n // Create two folders. Place a child under folder A.\n {\n syncable::WriteTransaction trans(\n FROM_HERE, syncable::SYNCER, share()->directory.get());\n syncable::Entry root(&trans, syncable::GET_BY_HANDLE, type_root);\n ASSERT_TRUE(root.good());\n\n syncable::MutableEntry folder_a(&trans, syncable::CREATE,\n BOOKMARKS, root.Get(syncable::ID), \"folderA\");\n ASSERT_TRUE(folder_a.good());\n SetNodeProperties(&folder_a);\n folder_a.Put(syncable::IS_DIR, true);\n\n syncable::MutableEntry folder_b(&trans, syncable::CREATE,\n BOOKMARKS, root.Get(syncable::ID), \"folderB\");\n ASSERT_TRUE(folder_b.good());\n SetNodeProperties(&folder_b);\n folder_b.Put(syncable::IS_DIR, true);\n folder_b_id = folder_b.Get(syncable::META_HANDLE);\n\n syncable::MutableEntry child(&trans, syncable::CREATE,\n BOOKMARKS, folder_a.Get(syncable::ID),\n \"child\");\n ASSERT_TRUE(child.good());\n SetNodeProperties(&child);\n child_id = child.Get(syncable::META_HANDLE);\n }\n\n // Close that transaction. The above was to setup the initial scenario. The\n // real test starts now.\n\n // Move the child from folder A to folder B.\n {\n syncable::WriteTransaction trans(\n FROM_HERE, syncable::SYNCER, share()->directory.get());\n\n syncable::Entry folder_b(&trans, syncable::GET_BY_HANDLE, folder_b_id);\n syncable::MutableEntry child(&trans, syncable::GET_BY_HANDLE, child_id);\n\n child.Put(syncable::PARENT_ID, folder_b.Get(syncable::ID));\n }\n\n EXPECT_EQ(1UL, GetChangeListSize());\n\n // Verify that this was detected as a real change. An early version of the\n // UniquePosition code had a bug where moves from one folder to another were\n // ignored unless the moved node's UniquePosition value was also changed in\n // some way.\n FindChangeInList(child_id, ChangeRecord::ACTION_UPDATE);\n}\n\n// Test moving a bookmark into a non-empty folder.\nTEST_F(SyncManagerChangeProcessingTest, MoveIntoPopulatedFolder) {\n int64 type_root = GetIdForDataType(BOOKMARKS);\n int64 child_a_id = kInvalidId;\n int64 child_b_id = kInvalidId;\n\n // Create two folders. Place one child each under folder A and folder B.\n {\n syncable::WriteTransaction trans(\n FROM_HERE, syncable::SYNCER, share()->directory.get());\n syncable::Entry root(&trans, syncable::GET_BY_HANDLE, type_root);\n ASSERT_TRUE(root.good());\n\n syncable::MutableEntry folder_a(&trans, syncable::CREATE,\n BOOKMARKS, root.Get(syncable::ID), \"folderA\");\n ASSERT_TRUE(folder_a.good());\n SetNodeProperties(&folder_a);\n folder_a.Put(syncable::IS_DIR, true);\n\n syncable::MutableEntry folder_b(&trans, syncable::CREATE,\n BOOKMARKS, root.Get(syncable::ID), \"folderB\");\n ASSERT_TRUE(folder_b.good());\n SetNodeProperties(&folder_b);\n folder_b.Put(syncable::IS_DIR, true);\n\n syncable::MutableEntry child_a(&trans, syncable::CREATE,\n BOOKMARKS, folder_a.Get(syncable::ID),\n \"childA\");\n ASSERT_TRUE(child_a.good());\n SetNodeProperties(&child_a);\n child_a_id = child_a.Get(syncable::META_HANDLE);\n\n syncable::MutableEntry child_b(&trans, syncable::CREATE,\n BOOKMARKS, folder_b.Get(syncable::ID),\n \"childB\");\n SetNodeProperties(&child_b);\n child_b_id = child_b.Get(syncable::META_HANDLE);\n\n }\n\n // Close that transaction. The above was to setup the initial scenario. The\n // real test starts now.\n\n {\n syncable::WriteTransaction trans(\n FROM_HERE, syncable::SYNCER, share()->directory.get());\n\n syncable::MutableEntry child_a(&trans, syncable::GET_BY_HANDLE, child_a_id);\n syncable::MutableEntry child_b(&trans, syncable::GET_BY_HANDLE, child_b_id);\n\n // Move child A from folder A to folder B and update its position.\n child_a.Put(syncable::PARENT_ID, child_b.Get(syncable::PARENT_ID));\n child_a.PutPredecessor(child_b.Get(syncable::ID));\n }\n\n EXPECT_EQ(1UL, GetChangeListSize());\n\n // Verify that only child a is in the change list.\n // (This function will add a failure if the lookup fails.)\n FindChangeInList(child_a_id, ChangeRecord::ACTION_UPDATE);\n}\n\n// Tests the ordering of deletion changes.\nTEST_F(SyncManagerChangeProcessingTest, DeletionsAndChanges) {\n int64 type_root = GetIdForDataType(BOOKMARKS);\n int64 folder_a_id = kInvalidId;\n int64 folder_b_id = kInvalidId;\n int64 child_id = kInvalidId;\n\n // Create two folders. Place a child under folder A.\n {\n syncable::WriteTransaction trans(\n FROM_HERE, syncable::SYNCER, share()->directory.get());\n syncable::Entry root(&trans, syncable::GET_BY_HANDLE, type_root);\n ASSERT_TRUE(root.good());\n\n syncable::MutableEntry folder_a(&trans, syncable::CREATE,\n BOOKMARKS, root.Get(syncable::ID), \"folderA\");\n ASSERT_TRUE(folder_a.good());\n SetNodeProperties(&folder_a);\n folder_a.Put(syncable::IS_DIR, true);\n folder_a_id = folder_a.Get(syncable::META_HANDLE);\n\n syncable::MutableEntry folder_b(&trans, syncable::CREATE,\n BOOKMARKS, root.Get(syncable::ID), \"folderB\");\n ASSERT_TRUE(folder_b.good());\n SetNodeProperties(&folder_b);\n folder_b.Put(syncable::IS_DIR, true);\n folder_b_id = folder_b.Get(syncable::META_HANDLE);\n\n syncable::MutableEntry child(&trans, syncable::CREATE,\n BOOKMARKS, folder_a.Get(syncable::ID),\n \"child\");\n ASSERT_TRUE(child.good());\n SetNodeProperties(&child);\n child_id = child.Get(syncable::META_HANDLE);\n }\n\n // Close that transaction. The above was to setup the initial scenario. The\n // real test starts now.\n\n {\n syncable::WriteTransaction trans(\n FROM_HERE, syncable::SYNCER, share()->directory.get());\n\n syncable::MutableEntry folder_a(\n &trans, syncable::GET_BY_HANDLE, folder_a_id);\n syncable::MutableEntry folder_b(\n &trans, syncable::GET_BY_HANDLE, folder_b_id);\n syncable::MutableEntry child(&trans, syncable::GET_BY_HANDLE, child_id);\n\n // Delete folder B and its child.\n child.Put(syncable::IS_DEL, true);\n folder_b.Put(syncable::IS_DEL, true);\n\n // Make an unrelated change to folder A.\n folder_a.Put(syncable::NON_UNIQUE_NAME, \"NewNameA\");\n }\n\n EXPECT_EQ(3UL, GetChangeListSize());\n\n size_t folder_a_pos =\n FindChangeInList(folder_a_id, ChangeRecord::ACTION_UPDATE);\n size_t folder_b_pos =\n FindChangeInList(folder_b_id, ChangeRecord::ACTION_DELETE);\n size_t child_pos = FindChangeInList(child_id, ChangeRecord::ACTION_DELETE);\n\n // Deletes should appear before updates.\n EXPECT_LT(child_pos, folder_a_pos);\n EXPECT_LT(folder_b_pos, folder_a_pos);\n}\n\n} // namespace\n", "meta": {"content_hash": "c1554cd8ff509d8b3221f1b041f94392", "timestamp": "", "source": "github", "line_count": 3580, "max_line_length": 80, "avg_line_length": 38.94469273743017, "alnum_prop": 0.6963606891308401, "repo_name": "hujiajie/pa-chromium", "id": "7ef301466ed7613529d1f598226b23acca6881da", "size": "139422", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "sync/internal_api/sync_manager_impl_unittest.cc", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ASP", "bytes": "853"}, {"name": "AppleScript", "bytes": "6973"}, {"name": "Arduino", "bytes": "464"}, {"name": "Assembly", "bytes": "1176000"}, {"name": "Awk", "bytes": "9519"}, {"name": "C", "bytes": "74909991"}, {"name": "C#", "bytes": "1132"}, {"name": "C++", "bytes": "174451678"}, {"name": "DOT", "bytes": "1559"}, {"name": "F#", "bytes": "381"}, {"name": "Java", "bytes": "3787983"}, {"name": "JavaScript", "bytes": "19649328"}, {"name": "Logos", "bytes": "4517"}, {"name": "M", "bytes": "2190"}, {"name": "Matlab", "bytes": "3044"}, {"name": "Objective-C", "bytes": "7600008"}, {"name": "PHP", "bytes": "97817"}, {"name": "Perl", "bytes": "1473407"}, {"name": "Python", "bytes": "10022969"}, {"name": "R", "bytes": "262"}, {"name": "Shell", "bytes": "1590292"}, {"name": "Tcl", "bytes": "277077"}, {"name": "XSLT", "bytes": "13493"}]}} +{"text": "\r\n// Copyright (c) 2014, Oracle and/or its affiliates.\r\n\r\n// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle\r\n\r\n// Licensed under the Boost Software License version 1.0.\r\n// http://www.boost.org/users/license.html\r\n\r\n#include <test_geometries/custom_lon_lat_point.hpp>\r\n\r\n#include <boost/geometry/core/cs.hpp>\r\n#include <boost/geometry/geometries/point.hpp>\r\n#include <boost/geometry/geometries/concepts/check.hpp>\r\n\r\n\r\nnamespace bg = boost::geometry;\r\n\r\n\r\ntemplate <typename CoordinateSystem>\r\ninline void test_coordinate_system()\r\n{\r\n typedef bg::model::point<double, 2, CoordinateSystem> bg_double_point;\r\n typedef bg::model::point<int, 2, CoordinateSystem> bg_int_point;\r\n\r\n typedef rw_lon_lat_point<double, CoordinateSystem> rw_double_point;\r\n typedef ro_lon_lat_point<double, CoordinateSystem> ro_double_point;\r\n\r\n typedef rw_lon_lat_point<int, CoordinateSystem> rw_int_point;\r\n typedef ro_lon_lat_point<int, CoordinateSystem> ro_int_point;\r\n\r\n bg::concept::check<bg_int_point>();\r\n bg::concept::check<bg_int_point const>();\r\n\r\n bg::concept::check<bg_double_point>();\r\n bg::concept::check<bg_double_point const>();\r\n\r\n bg::concept::check<rw_int_point>();\r\n bg::concept::check<rw_int_point const>();\r\n bg::concept::check<ro_int_point const>();\r\n\r\n bg::concept::check<rw_double_point>();\r\n bg::concept::check<rw_double_point const>();\r\n bg::concept::check<ro_double_point const>();\r\n}\r\n\r\n\r\nint main()\r\n{\r\n test_coordinate_system<bg::cs::geographic<bg::degree> >();\r\n test_coordinate_system<bg::cs::geographic<bg::radian> >();\r\n\r\n test_coordinate_system<bg::cs::spherical<bg::degree> >();\r\n test_coordinate_system<bg::cs::spherical<bg::radian> >();\r\n\r\n test_coordinate_system<bg::cs::spherical_equatorial<bg::degree> >();\r\n test_coordinate_system<bg::cs::spherical_equatorial<bg::radian> >();\r\n\r\n test_coordinate_system<bg::cs::polar<bg::degree> >();\r\n test_coordinate_system<bg::cs::polar<bg::radian> >();\r\n\r\n return 0;\r\n}\r\n", "meta": {"content_hash": "098700a3746a729e8eaeea9345ae0414", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 74, "avg_line_length": 32.67741935483871, "alnum_prop": 0.6742349457058243, "repo_name": "Franky666/programmiersprachen-raytracer", "id": "36166d85b5049516033bb9b4da8d0b3e7e0752d1", "size": "2095", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "external/boost_1_59_0/libs/geometry/test/concepts/point_well_formed_non_cartesian.cpp", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "905071"}, {"name": "C++", "bytes": "46207"}, {"name": "CMake", "bytes": "4419"}]}} +{"text": "package com.kerchin.yellownote.data.event;\n\n/**\n * Created by hkq325800 on 2016/12/7.\n */\n\npublic class NoteDeleteErrorEvent {\n public String getStr() {\n return str;\n }\n\n public void setStr(String str) {\n this.str = str;\n }\n\n private String str;\n\n public NoteDeleteErrorEvent(String str) {\n this.str = str;\n }\n}\n", "meta": {"content_hash": "3afe4b0d3020a8947953f1436713aeae", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 45, "avg_line_length": 16.857142857142858, "alnum_prop": 0.6129943502824858, "repo_name": "hkq325800/YellowNote", "id": "51bc5dab46fe49e839ca24f808fa1a2a3157ebef", "size": "354", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/kerchin/yellownote/data/event/NoteDeleteErrorEvent.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "959303"}]}} +{"text": "class Room\n\n attr_accessor :name, :description, :paths\n\n def initialize(name, description)\n @name = name\n @description = description\n @paths = {}\n end\n\n def go(direction)\n @paths[direction]\n end\n\n def add_paths(paths)\n @paths.update(paths)\n end\n\nend\n\ncentral_corridor = Room.new(\"Central Corridor\",\n%q{\nThe Gothons of Planet Percal #25 have invaded your ship and destroyed\nyour entire crew. You are the last surviving member and your last\nmission is to get the neutron destruct bomb from the Weapons Armory,\nput it in the bridge, and blow the ship up after getting into an \nescape pod.\n\nYou're running down the central corridor to the Weapons Armory when\na Gothon jumps out, red scaly skin, dark grimy teeth, and evil clown costume\nflowing around his hate filled body. He's blocking the door to the\nArmory and about to pull a weapon to blast you.\n})\n\nlaser_weapon_armory = Room.new(\"Laser Weapon Armory\", \n%q{\n Lucky for you they made you learn Gothon insults in the academy.\nYou tell the one Gothon joke you know:\nLbhe zbgure vf fb sng, jura fur fvgf nebhaq gur ubhfr, fur fvgf nebhaq gur ubhfr.\nThe Gothon stops, tries not to laugh, then busts out laughing and can't move.\nWhile he's laughing you run up and shoot him square in the head\nputting him down, then jump through the Weapon Armory door.\n\nYou do a dive roll into the Weapon Armory, crouch and scan the room\nfor more Gothons that might be hiding. It's dead quiet, too quiet.\nYou stand up and run to the far side of the room and find the\nneutron bomb in its container. There's a keypad lock on the box\nand you need the code to get the bomb out. If you get the code\nwrong 10 times then the lock closes forever and you can't\nget the bomb. The code is 3 digits.\n})\n\nthe_bridge = Room.new(\"The Bridge\",\n%q{\nThe container clicks open and the seal breaks, letting gas out.\nYou grab the neutron bomb and run as fast as you can to the\nbridge where you must place it in the right spot.\n\nYou burst onto the Bridge with the neutron destruct bomb\nunder your arm and surprise 5 Gothons who are trying to\ntake control of the ship. Each of them has an even uglier\nclown costume than the last. They haven't pulled their\nweapons out yet, as they see the active bomb under your\narm and don't want to set it off.\n})\n\nescape_pod = Room.new(\"Escape Pod\",\n%q{\nYou point your blaster at the bomb under your arm\nand the Gothons put their hands up and start to sweat.\nYou inch backward to the door, open it, and then carefully\nplace the bomb on the floor, pointing your blaster at it.\nYou then jump back through the door, punch the close button\nand blast the lock so the Gothons can't get out.\nNow that the bomb is placed you run to the escape pod to\nget off this tin can.\n\nYou rush through the ship desperately trying to make it to\nthe escape pod before the whole ship explodes. It seems like\nhardly any Gothons are on the ship, so your run is clear of\ninterference. You get to the chamber with the escape pods, and\nnow need to pick one to take. Some of them could be damaged\nbut you don't have time to look. There's 5 pods, which one\ndo you take?\n})\n\nthe_end_winner = Room.new(\"The End\",\n%q{\nYou jump into pod 2 and hit the eject button.\nThe pod easily slides out into space heading to\nthe planet below. As it flies to the planet, you look\nback and see your ship implode then explode like a\nbright star, taking out the Gothon ship at the same\ntime. You won!\n})\n\nthe_end_loser = Room.new(\"The End\",\n%q{\nYou jump into a random pod and hit the eject button.\nThe pod escapes out into the void of space, then\nimplodes as the hull ruptures, crushing your body\ninto jam jelly.\n})\n\nescape_pod.add_paths({\n '2' => the_end_winner,\n '*' => the_end_loser\n})\n\ncentral_corridor_shoot = Room.new(\"Death\",\n%q{\nQuick on the draw you yank out your blaster and fire it at the Gothon.\nHis clown costume is flowing and moving around his body, which throws\noff your aim. Your laser hits his costume but misses him entirely. This\ncompletely ruins his brand new costume his mother bought him, which makes\nhim fly into an insane rage and blast you repeatedly in the face unitl you\nare dead. Then he eats you.\n})\n\ncentral_corridor_dodge = Room.new(\"Death\",\n%q{\nLike a world class boxer you dodge, weave, slip and slide right as the Gothon's\nblaster cranks a laser past your head. In the middle of your artful dodge\nyour foot slips and you bang your head on the metal wall and pass out. You wake up\nshortly after only to die as the Gothon stomps on your head and eats you.\n})\n\nthe_bridge_bomb = Room.new(\"Death\",\n%q{\nIn a panic you throw the bomb at the group of Gothons and make a leap for the\ndoor. Right as you drop it a Gothon shoots you right in hte back killing you.\nAs you die you see another Gothon frantically tyr to disarm the bomb. You die\nknowing they will probably blow up when it goes off.\n})\n\nlaser_weapon_armory_fail = Room.new(\"Death\",\n%q{\nThe lock buzzes one last time and then you hear a sickening melting sound\nas the mechanism is fused together. You decide to sit there, and finally\nthe Gothons blow up the ship from their ship and you die.\n})\n\nthe_bridge.add_paths({\n 'throw the bomb' => the_bridge_bomb,\n 'slowly place the bomb' => escape_pod\n})\n\nlaser_weapon_armory.add_paths({\n '0132' => the_bridge,\n '*' => laser_weapon_armory_fail\n})\n\ncentral_corridor.add_paths({\n 'shoot!' => central_corridor_shoot,\n 'dodge!' => central_corridor_dodge,\n 'tell a joke' => laser_weapon_armory\n})\n\nSTART = central_corridor\n\nROOMS = { \"central_corridor\" => central_corridor,\n \"central_corridor_shoot\" => central_corridor_shoot,\n \"central_corridor_dodge\" => central_corridor_dodge, \n \"laser_weapon_armory\" => laser_weapon_armory,\n \"laser_weapon_armory_fail\" => laser_weapon_armory_fail,\n \"the_bridge\" => the_bridge,\n \"the_bridge_bomb\" => the_bridge_bomb,\n \"escape_pod\" => escape_pod,\n \"the_end_winner\" => the_end_winner,\n \"the_end_loser\" => the_end_loser }", "meta": {"content_hash": "79bdf1f5afb031f0b6f0d47bc5dbb008", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 82, "avg_line_length": 35.72941176470588, "alnum_prop": 0.724399078037537, "repo_name": "j0rgy/gothonweb", "id": "0a5521729c53f049e097cae019927020d7ab463a", "size": "6074", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/map.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "11917"}]}} +{"text": "var startgame = function(){\n\t location.href = \"http:localhost:8080/play\";\n};", "meta": {"content_hash": "7385feb6712caa9db6b09603d43682d3", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 45, "avg_line_length": 25.333333333333332, "alnum_prop": 0.6973684210526315, "repo_name": "abhilash-dev/professor-X", "id": "2c2bb6a20688dd06c71cf99437e2c413400839d7", "size": "76", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Professor-X/src/main/resources/static/js/start.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "47246"}, {"name": "HTML", "bytes": "22208"}, {"name": "Java", "bytes": "69219"}, {"name": "JavaScript", "bytes": "17123"}]}} +{"text": "export interface Middleware<T> {\n (context: T, next: ContinuationMiddleware<T>): any\n}\nexport interface ContinuationMiddleware<T> {\n (context?: T, next?: Middleware<T>): any\n}\n\nconst flatten = <T>(values: Array<T | Array<T>>) => ([] as any).concat(...values) as T[],\n noop = function noop() {\n return Promise.resolve()\n }\n\nfunction throwIfHasBeenCalled(fn: any) {\n if (fn.__appbuildercalled) {\n throw new Error('Cannot call next more than once')\n }\n return (fn.__appbuildercalled = true)\n}\n\nfunction tryInvokeMiddleware<T>(context: T, middleware: Middleware<T>, next: ContinuationMiddleware<T> = noop) {\n try {\n return Promise.resolve(middleware ? middleware(context, next) : context)\n } catch (error) {\n return Promise.reject(error)\n }\n}\n\nexport function functionList<T = any>(list: Function | Function[], ...args: any[]): Middleware<T>[] {\n const arrayList = Symbol.iterator in list ? Array.from(list as Function[]) : [list as Function]\n return arrayList.map((x) => {\n return (_: any, next: any) => Promise.resolve(x(...args)).then(next)\n })\n}\n\n/**\n * Create a function to invoke all passed middleware functions\n * with a single argument <T>context\n * @param middleware\n */\nexport function compose<T = any>(...middleware: (Middleware<T> | Middleware<T>[])[]): ContinuationMiddleware<T> {\n return flatten(middleware)\n .filter((x) => {\n if ('function' !== typeof x) {\n throw new TypeError(`${x}, must be a middleware function accpeting (context, next) arguments`)\n }\n return x\n })\n .reduceRight((composed: Middleware<T>, mw: Middleware<T>) => {\n return function (context: T, nextFn: ContinuationMiddleware<T>) {\n const next = () => throwIfHasBeenCalled(next) && composed(context, nextFn)\n return tryInvokeMiddleware(context, mw, next)\n }\n }, tryInvokeMiddleware) as ContinuationMiddleware<T>\n}\n", "meta": {"content_hash": "6ae61642b7c58194f1728c38a9412b57", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 113, "avg_line_length": 34.833333333333336, "alnum_prop": 0.6634768740031898, "repo_name": "calebboyd/app-builder", "id": "3d2827115e8ff8387651397c026eedf9eed49bbd", "size": "1881", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/compose.ts", "mode": "33188", "license": "mit", "language": [{"name": "TypeScript", "bytes": "6288"}]}} +{"text": "/**\n * A simple custom row expander that does not add a \"+\" / \"-\" column.\n */\nExt.define('ExecDashboard.ux.plugin.RowExpander', {\n extend: 'Ext.grid.plugin.RowExpander',\n\n alias: 'plugin.ux-rowexpander',\n\n rowBodyTpl: [\n '<div class=\"text-wrapper\">',\n '<div class=\"news-data\">',\n '<div class=\"news-paragraph\">{paragraph}</div>',\n '<div class=\"news-toggle collapse\"><span>COLLAPSE</span><img src=\"https://static.rasc.ch/ext-6.5.2/build/examples/classic/executive-dashboard/resources/icons/collapse-news.png\"></div>',\n '</div>',\n '</div>'\n ],\n\n // don't add the expander +/- because we will use a custom one instead\n addExpander: Ext.emptyFn,\n\n addCollapsedCls: {\n fn: function(out, values, parent) {\n var me = this.rowExpander;\n\n if (!me.recordsExpanded[values.record.internalId]) {\n values.itemClasses.push(me.rowCollapsedCls);\n } else {\n values.itemClasses.push('x-grid-row-expanded');\n }\n this.nextTpl.applyOut(values, out, parent);\n },\n\n syncRowHeights: function(lockedItem, normalItem) {\n this.rowExpander.syncRowHeights(lockedItem, normalItem);\n },\n\n // We need a high priority to get in ahead of the outerRowTpl\n // so we can setup row data\n priority: 20000\n }\n});\n", "meta": {"content_hash": "9423061655f413b2039420abbaea9703", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 201, "avg_line_length": 34.292682926829265, "alnum_prop": 0.5839260312944523, "repo_name": "ralscha/extdirectspring-demo", "id": "37024e5bb022671dcdaff7954f911359cbec2c0f", "size": "1406", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/resources/static/extjs6classic/executive-dashboard/app/ux/plugin/RowExpander.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "683"}, {"name": "CSS", "bytes": "17363"}, {"name": "HTML", "bytes": "136892"}, {"name": "Java", "bytes": "370333"}, {"name": "JavaScript", "bytes": "1171254"}]}} +{"text": "using System;\nusing NUnit.Framework;\nusing osu.Framework.Allocation;\nusing osu.Framework.Bindables;\nusing osu.Framework.Graphics;\nusing osu.Framework.Graphics.Containers;\nusing osu.Game.Online.Rooms;\nusing osu.Game.Screens.OnlinePlay;\n\nnamespace osu.Game.Tests.Visual.OnlinePlay\n{\n /// <summary>\n /// A base test scene for all online play components and screens.\n /// </summary>\n public abstract class OnlinePlayTestScene : ScreenTestScene, IOnlinePlayTestSceneDependencies\n {\n public Bindable<Room> SelectedRoom => OnlinePlayDependencies?.SelectedRoom;\n public IRoomManager RoomManager => OnlinePlayDependencies?.RoomManager;\n public OngoingOperationTracker OngoingOperationTracker => OnlinePlayDependencies?.OngoingOperationTracker;\n public OnlinePlayBeatmapAvailabilityTracker AvailabilityTracker => OnlinePlayDependencies?.AvailabilityTracker;\n\n /// <summary>\n /// All dependencies required for online play components and screens.\n /// </summary>\n protected OnlinePlayTestSceneDependencies OnlinePlayDependencies => dependencies?.OnlinePlayDependencies;\n\n private DelegatedDependencyContainer dependencies;\n\n protected override Container<Drawable> Content => content;\n private readonly Container content;\n private readonly Container drawableDependenciesContainer;\n\n protected OnlinePlayTestScene()\n {\n base.Content.AddRange(new Drawable[]\n {\n drawableDependenciesContainer = new Container { RelativeSizeAxes = Axes.Both },\n content = new Container { RelativeSizeAxes = Axes.Both },\n });\n }\n\n protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)\n {\n dependencies = new DelegatedDependencyContainer(base.CreateChildDependencies(parent));\n return dependencies;\n }\n\n [SetUp]\n public void Setup() => Schedule(() =>\n {\n // Reset the room dependencies to a fresh state.\n drawableDependenciesContainer.Clear();\n dependencies.OnlinePlayDependencies = CreateOnlinePlayDependencies();\n drawableDependenciesContainer.AddRange(OnlinePlayDependencies.DrawableComponents);\n });\n\n /// <summary>\n /// Creates the room dependencies. Called every <see cref=\"Setup\"/>.\n /// </summary>\n /// <remarks>\n /// Any custom dependencies required for online play sub-classes should be added here.\n /// </remarks>\n protected virtual OnlinePlayTestSceneDependencies CreateOnlinePlayDependencies() => new OnlinePlayTestSceneDependencies();\n\n /// <summary>\n /// A <see cref=\"IReadOnlyDependencyContainer\"/> providing a mutable lookup source for online play dependencies.\n /// </summary>\n private class DelegatedDependencyContainer : IReadOnlyDependencyContainer\n {\n /// <summary>\n /// The online play dependencies.\n /// </summary>\n public OnlinePlayTestSceneDependencies OnlinePlayDependencies { get; set; }\n\n private readonly IReadOnlyDependencyContainer parent;\n private readonly DependencyContainer injectableDependencies;\n\n /// <summary>\n /// Creates a new <see cref=\"DelegatedDependencyContainer\"/>.\n /// </summary>\n /// <param name=\"parent\">The fallback <see cref=\"IReadOnlyDependencyContainer\"/> to use when <see cref=\"OnlinePlayDependencies\"/> cannot satisfy a dependency.</param>\n public DelegatedDependencyContainer(IReadOnlyDependencyContainer parent)\n {\n this.parent = parent;\n injectableDependencies = new DependencyContainer(this);\n }\n\n public object Get(Type type)\n => OnlinePlayDependencies?.Get(type) ?? parent.Get(type);\n\n public object Get(Type type, CacheInfo info)\n => OnlinePlayDependencies?.Get(type, info) ?? parent.Get(type, info);\n\n public void Inject<T>(T instance)\n where T : class\n => injectableDependencies.Inject(instance);\n }\n }\n}\n", "meta": {"content_hash": "736eb04da0b759ce60643001076f0352", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 178, "avg_line_length": 42.90909090909091, "alnum_prop": 0.6664312617702448, "repo_name": "peppy/osu-new", "id": "87166460747311eea3c23459cf12a782158c8427", "size": "4398", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "osu.Game/Tests/Visual/OnlinePlay/OnlinePlayTestScene.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "281779"}]}} +{"text": "\r\n/*\r\n * Created on May 6, 2005\r\n *\r\n */\r\nnamespace NPOI.SS.Formula.Functions\r\n{\r\n using System;\r\n using NPOI.SS.Formula.Eval;\r\n\r\n /**\r\n * @author Amol S. Deshmukh < amolweb at ya hoo dot com >\r\n * \r\n */\r\n internal class True : Fixed0ArgFunction\r\n {\r\n public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex)\r\n {\r\n return BoolEval.TRUE;\r\n }\r\n\r\n }\r\n}", "meta": {"content_hash": "3dac27e2d71e747a523afb589cf0a7f3", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 79, "avg_line_length": 18.82608695652174, "alnum_prop": 0.5496535796766744, "repo_name": "treenew/sofire", "id": "891d8a2a05c1ed4945d09ab5bed7a8831ebb4580", "size": "1234", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Core/Sofire.Extends/Excel/NPOI/SS/Formula/Functions/Boolean/True.cs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C#", "bytes": "17254659"}, {"name": "Shell", "bytes": "682"}]}} +{"text": "\n\n#include \"BaseLibInternals.h\"\n\n/**\n Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and\n generates a 64-bit unsigned result.\n\n This function multiples the 64-bit unsigned value Multiplicand by the 32-bit\n unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\n bit unsigned result is returned.\n\n @param Multiplicand A 64-bit unsigned value.\n @param Multiplier A 32-bit unsigned value.\n\n @return Multiplicand * Multiplier\n\n**/\nUINT64\nEFIAPI\nGlueMultU64x32 (\n IN UINT64 Multiplicand,\n IN UINT32 Multiplier\n )\n{\n UINT64 Result;\n\n Result = InternalMathMultU64x32 (Multiplicand, Multiplier);\n\n return Result;\n}\n", "meta": {"content_hash": "882efd20bf0166267fbdc1bda59412dd", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 78, "avg_line_length": 23.870967741935484, "alnum_prop": 0.6716216216216216, "repo_name": "tianocore/edk", "id": "93b1411b1ea2179ef002c4168005e2e517b3fdf8", "size": "1550", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultU64x32.c", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Assembly", "bytes": "947898"}, {"name": "C", "bytes": "18163757"}, {"name": "C++", "bytes": "1437397"}, {"name": "GAP", "bytes": "256118"}, {"name": "Objective-C", "bytes": "2657772"}, {"name": "Shell", "bytes": "60476"}]}} +{"text": "import Notifications from './Notifications.js';\nexport default Notifications;\n", "meta": {"content_hash": "23bf4d090837565ef76e7fb1c41a3b01", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 47, "avg_line_length": 39.0, "alnum_prop": 0.8205128205128205, "repo_name": "Axivity/openmovement-axsys-client", "id": "1d62ec7049974c62d8ccd4cb2c158a52ddce63ae", "size": "78", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/react-notifications/src/index.js", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "CSS", "bytes": "3987"}, {"name": "HTML", "bytes": "2091"}, {"name": "JavaScript", "bytes": "150611"}]}} +{"text": ".class public Lcom/android/server/pm/PersistentPreferredIntentResolver;\n.super Lcom/android/server/IntentResolver;\n.source \"PersistentPreferredIntentResolver.java\"\n\n\n# annotations\n.annotation system Ldalvik/annotation/Signature;\n value = {\n \"Lcom/android/server/IntentResolver\",\n \"<\",\n \"Lcom/android/server/pm/PersistentPreferredActivity;\",\n \"Lcom/android/server/pm/PersistentPreferredActivity;\",\n \">;\"\n }\n.end annotation\n\n\n# direct methods\n.method public constructor <init>()V\n .locals 0\n\n .prologue\n .line 23\n invoke-direct {p0}, Lcom/android/server/IntentResolver;-><init>()V\n\n return-void\n.end method\n\n\n# virtual methods\n.method protected bridge synthetic isPackageForFilter(Ljava/lang/String;Landroid/content/IntentFilter;)Z\n .locals 1\n .param p1, \"x0\" # Ljava/lang/String;\n .param p2, \"x1\" # Landroid/content/IntentFilter;\n\n .prologue\n .line 23\n check-cast p2, Lcom/android/server/pm/PersistentPreferredActivity;\n\n .end local p2 # \"x1\":Landroid/content/IntentFilter;\n invoke-virtual {p0, p1, p2}, Lcom/android/server/pm/PersistentPreferredIntentResolver;->isPackageForFilter(Ljava/lang/String;Lcom/android/server/pm/PersistentPreferredActivity;)Z\n\n move-result v0\n\n return v0\n.end method\n\n.method protected isPackageForFilter(Ljava/lang/String;Lcom/android/server/pm/PersistentPreferredActivity;)Z\n .locals 1\n .param p1, \"packageName\" # Ljava/lang/String;\n .param p2, \"filter\" # Lcom/android/server/pm/PersistentPreferredActivity;\n\n .prologue\n .line 32\n iget-object v0, p2, Lcom/android/server/pm/PersistentPreferredActivity;->mComponent:Landroid/content/ComponentName;\n\n invoke-virtual {v0}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;\n\n move-result-object v0\n\n invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z\n\n move-result v0\n\n return v0\n.end method\n\n.method protected bridge synthetic newArray(I)[Landroid/content/IntentFilter;\n .locals 1\n .param p1, \"x0\" # I\n\n .prologue\n .line 23\n invoke-virtual {p0, p1}, Lcom/android/server/pm/PersistentPreferredIntentResolver;->newArray(I)[Lcom/android/server/pm/PersistentPreferredActivity;\n\n move-result-object v0\n\n return-object v0\n.end method\n\n.method protected newArray(I)[Lcom/android/server/pm/PersistentPreferredActivity;\n .locals 1\n .param p1, \"size\" # I\n\n .prologue\n .line 27\n new-array v0, p1, [Lcom/android/server/pm/PersistentPreferredActivity;\n\n return-object v0\n.end method\n", "meta": {"content_hash": "f0dbbe5a7aa396ea4f36b943cfe29952", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 182, "avg_line_length": 28.5, "alnum_prop": 0.7228070175438597, "repo_name": "hexiaoshuai/Flyme_device_ZTE_A1", "id": "7d0c6cd70cf586abf4521839e05ebd3f5c60f508", "size": "2565", "binary": false, "copies": "2", "ref": "refs/heads/C880AV1.0.0B06", "path": "services.jar.out/smali/com/android/server/pm/PersistentPreferredIntentResolver.smali", "mode": "33188", "license": "apache-2.0", "language": [{"name": "GLSL", "bytes": "1500"}, {"name": "HTML", "bytes": "10195"}, {"name": "Makefile", "bytes": "11258"}, {"name": "Python", "bytes": "924"}, {"name": "Shell", "bytes": "2734"}, {"name": "Smali", "bytes": "234274633"}]}} +{"text": "export * from \"./from-exports\";\n", "meta": {"content_hash": "943b6e87d11b9904fa19cc67ed91983c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 31, "avg_line_length": 32.0, "alnum_prop": 0.65625, "repo_name": "stealjs/steal-tools", "id": "f1addbd36840c6b3da5f8b37ec36dc17800f36d5", "size": "33", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/treeshake/disabled/reexports.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "454"}, {"name": "HTML", "bytes": "26153"}, {"name": "JavaScript", "bytes": "1116049"}, {"name": "Less", "bytes": "1521"}]}} +{"text": "@interface demoUITests : XCTestCase\n\n@end\n\n@implementation demoUITests\n\n- (void)setUp {\n [super setUp];\n \n // Put setup code here. This method is called before the invocation of each test method in the class.\n \n // In UI tests it is usually best to stop immediately when a failure occurs.\n self.continueAfterFailure = NO;\n // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.\n [[[XCUIApplication alloc] init] launch];\n \n // In UI tests it\u2019s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.\n}\n\n- (void)tearDown {\n // Put teardown code here. This method is called after the invocation of each test method in the class.\n [super tearDown];\n}\n\n- (void)testExample {\n // Use recording to get started writing UI tests.\n // Use XCTAssert and related functions to verify your tests produce the correct results.\n}\n\n@end\n", "meta": {"content_hash": "fbde17640562b01554a7d611a5455993", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 178, "avg_line_length": 34.3, "alnum_prop": 0.7152575315840622, "repo_name": "zhangjie579/ZJPhotoBrower", "id": "9493072379a33bdd01fcb5f60093a36b19cdf6a7", "size": "1191", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "demoUITests/demoUITests.m", "mode": "33261", "license": "mit", "language": [{"name": "Objective-C", "bytes": "2073"}, {"name": "Ruby", "bytes": "647"}]}} +{"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.11\"/>\n<title>Lua-API++: Class Index</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"resize.js\"></script>\n<script type=\"text/javascript\" src=\"navtreedata.js\"></script>\n<script type=\"text/javascript\" src=\"navtree.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(initResizable);\n $(window).load(resizeHeight);\n</script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/searchdata.js\"></script>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(function() { init_search(); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n <td id=\"projectlogo\"><img alt=\"Logo\" src=\"lpp_logo.png\"/></td>\n <td id=\"projectalign\" style=\"padding-left: 0.5em;\">\n <div id=\"projectname\">Lua-API++\n  <span id=\"projectnumber\">2015-02-12-3</span>\n </div>\n <div id=\"projectbrief\">Lua-API++ library</div>\n </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.11 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n <div id=\"navrow1\" class=\"tabs\">\n <ul class=\"tablist\">\n <li><a href=\"index.html\"><span>Main Page</span></a></li>\n <li><a href=\"pages.html\"><span>Related Pages</span></a></li>\n <li class=\"current\"><a href=\"annotated.html\"><span>Classes</span></a></li>\n <li><a href=\"files.html\"><span>Files</span></a></li>\n <li>\n <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n <span class=\"left\">\n <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n alt=\"\"/>\n <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n onblur=\"searchBox.OnSearchFieldFocus(false)\" \n onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n </span><span class=\"right\">\n <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n </span>\n </div>\n </li>\n </ul>\n </div>\n <div id=\"navrow2\" class=\"tabs2\">\n <ul class=\"tablist\">\n <li><a href=\"annotated.html\"><span>Class List</span></a></li>\n <li class=\"current\"><a href=\"classes.html\"><span>Class Index</span></a></li>\n <li><a href=\"hierarchy.html\"><span>Class Hierarchy</span></a></li>\n <li><a href=\"functions.html\"><span>Class Members</span></a></li>\n </ul>\n </div>\n</div><!-- top -->\n<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n <div id=\"nav-tree\">\n <div id=\"nav-tree-contents\">\n <div id=\"nav-sync\" class=\"sync\"></div>\n </div>\n </div>\n <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n class=\"ui-resizable-handle\">\n </div>\n</div>\n<script type=\"text/javascript\">\n$(document).ready(function(){initNavTree('classes.html','');});\n</script>\n<div id=\"doc-content\">\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n</div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n <div class=\"headertitle\">\n<div class=\"title\">Class Index</div> </div>\n</div><!--header-->\n<div class=\"contents\">\n<div class=\"qindex\"><a class=\"qindex\" href=\"#letter_C\">C</a> | <a class=\"qindex\" href=\"#letter_N\">N</a> | <a class=\"qindex\" href=\"#letter_R\">R</a> | <a class=\"qindex\" href=\"#letter_S\">S</a> | <a class=\"qindex\" href=\"#letter_T\">T</a> | <a class=\"qindex\" href=\"#letter_V\">V</a></div>\n<table class=\"classindex\">\n<tr><td rowspan=\"2\" valign=\"bottom\"><a name=\"letter_C\"></a><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><div class=\"ah\">  C  </div></td></tr></table>\n</td><td rowspan=\"2\" valign=\"bottom\"><a name=\"letter_R\"></a><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><div class=\"ah\">  R  </div></td></tr></table>\n</td><td rowspan=\"2\" valign=\"bottom\"><a name=\"letter_T\"></a><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><div class=\"ah\">  T  </div></td></tr></table>\n</td><td valign=\"top\"><a class=\"el\" href=\"classlua_1_1_valref.html\">Valref</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td></tr>\n<tr><td valign=\"top\"><a class=\"el\" href=\"classlua_1_1_valset.html\">Valset</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td></tr>\n<tr><td valign=\"top\"><a class=\"el\" href=\"namespacelua.html#structlua_1_1_closure_info\">ClosureInfo</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td valign=\"top\"><a class=\"el\" href=\"classlua_1_1_context_1_1_registry.html\">Context::Registry</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td valign=\"top\"><a class=\"el\" href=\"classlua_1_1_table.html\">Table</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td valign=\"top\"><a class=\"el\" href=\"classlua_1_1_value.html\">Value</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td></tr>\n<tr><td valign=\"top\"><a class=\"el\" href=\"classlua_1_1_context.html\">Context</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td valign=\"top\"><a class=\"el\" href=\"classlua_1_1_registry_key.html\">RegistryKey</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td valign=\"top\"><a class=\"el\" href=\"namespacelua.html#classlua_1_1_temporary\">Temporary</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td></td></tr>\n<tr><td rowspan=\"2\" valign=\"bottom\"><a name=\"letter_N\"></a><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><div class=\"ah\">  N  </div></td></tr></table>\n</td><td valign=\"top\"><a class=\"el\" href=\"classlua_1_1_retval.html\">Retval</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td valign=\"top\"><a class=\"el\" href=\"structlua_1_1_type_i_d.html\">TypeID</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td></td></tr>\n<tr><td rowspan=\"2\" valign=\"bottom\"><a name=\"letter_S\"></a><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><div class=\"ah\">  S  </div></td></tr></table>\n</td><td rowspan=\"2\" valign=\"bottom\"><a name=\"letter_V\"></a><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><div class=\"ah\">  V  </div></td></tr></table>\n</td><td></td></tr>\n<tr><td valign=\"top\"><a class=\"el\" href=\"namespacelua.html#classlua_1_1_nil\">Nil</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td></td></tr>\n<tr><td></td><td valign=\"top\"><a class=\"el\" href=\"classlua_1_1_state.html\">State</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td valign=\"top\"><a class=\"el\" href=\"namespacelua.html#classlua_1_1_valobj\">Valobj</a> (<a class=\"el\" href=\"namespacelua.html\">lua</a>)   </td><td></td></tr>\n<tr><td></td><td></td><td></td><td></td></tr>\n</table>\n<div class=\"qindex\"><a class=\"qindex\" href=\"#letter_C\">C</a> | <a class=\"qindex\" href=\"#letter_N\">N</a> | <a class=\"qindex\" href=\"#letter_R\">R</a> | <a class=\"qindex\" href=\"#letter_S\">S</a> | <a class=\"qindex\" href=\"#letter_T\">T</a> | <a class=\"qindex\" href=\"#letter_V\">V</a></div>\n</div><!-- contents -->\n</div><!-- doc-content -->\n<!-- start footer part -->\n<div id=\"nav-path\" class=\"navpath\"><!-- id is needed for treeview function! -->\n <ul>\n <li class=\"footer\">Generated by\n <a href=\"http://www.doxygen.org/index.html\">\n <img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/></a> 1.8.11 </li>\n </ul>\n</div>\n</body>\n</html>\n", "meta": {"content_hash": "82adb62672427a69ba38bee4f7010e5a", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 635, "avg_line_length": 62.04137931034483, "alnum_prop": 0.630057803468208, "repo_name": "tnovits-d2d/luapp", "id": "1958466a8b2e57a52274b9d635d6c3e0f7b20dc7", "size": "8996", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/html/classes.html", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "918"}, {"name": "C++", "bytes": "317526"}, {"name": "Objective-C", "bytes": "511"}]}} +{"text": "package com.lithiumsheep.jacketapp;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n @Test\n public void addition_isCorrect() throws Exception {\n assertEquals(4, 2 + 2);\n }\n}", "meta": {"content_hash": "07d6825d0c75c153af3253ecc3a8a832", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 81, "avg_line_length": 24.41176470588235, "alnum_prop": 0.7060240963855422, "repo_name": "lolsheeplol/jacketapp", "id": "dca56c0a239fb244077f7d789a21d3506278e552", "size": "415", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/test/java/com/lithiumsheep/jacketapp/ExampleUnitTest.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "59431"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n <modelVersion>4.0.0</modelVersion>\n <parent>\n <groupId>org.kie.server</groupId>\n <artifactId>kie-server-parent</artifactId>\n <version>7.0.0-SNAPSHOT</version>\n </parent>\n\n <artifactId>kie-server-controller</artifactId>\n <name>KIE :: Execution Server :: Controller</name>\n <description>KIE Execution Server Controller</description>\n <packaging>pom</packaging>\n\n <modules>\n <module>kie-server-controller-api</module>\n <module>kie-server-controller-impl</module>\n <module>kie-server-controller-rest</module>\n <module>kie-server-controller-test-war</module>\n </modules>\n\n</project>", "meta": {"content_hash": "300c41f75effbe997a0100e753cd1dc0", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 108, "avg_line_length": 36.25, "alnum_prop": 0.6988505747126437, "repo_name": "murador/droolsjbpm-integration", "id": "41a9dcfee9bcbcba77722e45a66d081de28bd73e", "size": "870", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "kie-server-parent/kie-server-controller/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2569"}, {"name": "CSS", "bytes": "7748"}, {"name": "HTML", "bytes": "2654"}, {"name": "Java", "bytes": "5623797"}, {"name": "JavaScript", "bytes": "32051"}, {"name": "Shell", "bytes": "3525"}, {"name": "XSLT", "bytes": "2865"}]}} +{"text": "package com.unnamed.b.atv.sample.holder;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.widget.CheckBox;\nimport android.widget.CompoundButton;\nimport android.widget.TextView;\n\nimport com.github.johnkil.print.PrintView;\nimport com.unnamed.b.atv.model.TreeNode;\nimport com.unnamed.b.atv.sample.R;\n\n/**\n * Created by Bogdan Melnychuk on 2/15/15, modified by Szigeti Peter 2/2/16.\n */\npublic class ArrowExpandSelectableHeaderHolder extends TreeNode.BaseNodeViewHolder<IconTreeItemHolder.IconTreeItem> {\n private TextView tvValue;\n private PrintView arrowView;\n private CheckBox nodeSelector;\n\n public ArrowExpandSelectableHeaderHolder(Context context) {\n super(context);\n }\n\n @Override\n public View createNodeView(final TreeNode node, IconTreeItemHolder.IconTreeItem value) {\n final LayoutInflater inflater = LayoutInflater.from(context);\n final View view = inflater.inflate(R.layout.layout_selectable_header, null, false);\n\n tvValue = (TextView) view.findViewById(R.id.node_value);\n tvValue.setText(value.text);\n\n final PrintView iconView = (PrintView) view.findViewById(R.id.icon);\n iconView.setIconText(context.getResources().getString(value.icon));\n\n arrowView = (PrintView) view.findViewById(R.id.arrow_icon);\n arrowView.setPadding(20,10,10,10);\n if (node.isLeaf()) {\n arrowView.setVisibility(View.GONE);\n }\n arrowView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n tView.toggleNode(node);\n }\n });\n\n nodeSelector = (CheckBox) view.findViewById(R.id.node_selector);\n nodeSelector.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n node.setSelected(isChecked);\n for (TreeNode n : node.getChildren()) {\n getTreeView().selectNode(n, isChecked);\n }\n }\n });\n nodeSelector.setChecked(node.isSelected());\n\n return view;\n }\n\n @Override\n public void toggle(boolean active) {\n arrowView.setIconText(context.getResources().getString(active ? R.string.ic_keyboard_arrow_down : R.string.ic_keyboard_arrow_right));\n }\n\n @Override\n public void toggleSelectionMode(boolean editModeEnabled) {\n nodeSelector.setVisibility(editModeEnabled ? View.VISIBLE : View.GONE);\n nodeSelector.setChecked(mNode.isSelected());\n }\n}\n", "meta": {"content_hash": "e9aafb0eae131a7ebffe799aa7bd4f78", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 141, "avg_line_length": 36.054054054054056, "alnum_prop": 0.6829085457271364, "repo_name": "yehe01/AndroidTreeView", "id": "c58d0842a856a86b7196b5357d9f09d0dc2c06db", "size": "2668", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/src/main/java/com/unnamed/b/atv/sample/holder/ArrowExpandSelectableHeaderHolder.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "120189"}]}} +{"text": "\ufeffusing LmpClient.Base;\nusing LmpClient.Base.Interface;\nusing LmpClient.Extensions;\nusing LmpCommon.Enums;\nusing LmpCommon.Message.Data.Kerbal;\nusing LmpCommon.Message.Interface;\nusing LmpCommon.Message.Types;\nusing System.Collections.Concurrent;\n\nnamespace LmpClient.Systems.KerbalSys\n{\n public class KerbalMessageHandler : SubSystem<KerbalSystem>, IMessageHandler\n {\n public ConcurrentQueue<IServerMessageBase> IncomingMessages { get; set; } = new ConcurrentQueue<IServerMessageBase>();\n\n public void HandleMessage(IServerMessageBase msg)\n {\n if (!(msg.Data is KerbalBaseMsgData msgData)) return;\n\n switch (msgData.KerbalMessageType)\n {\n case KerbalMessageType.Remove:\n System.KerbalsToRemove.Enqueue(((KerbalRemoveMsgData)msgData).KerbalName);\n break;\n case KerbalMessageType.Reply:\n HandleKerbalReply(msgData as KerbalReplyMsgData);\n break;\n case KerbalMessageType.Proto:\n HandleKerbalProto(msgData as KerbalProtoMsgData);\n break;\n default:\n LunaLog.LogError(\"[LMP]: Invalid Kerbal message type\");\n break;\n }\n }\n\n /// <summary>\n /// Just load the received kerbal into game and refresh dialogs\n /// </summary>\n private static void HandleKerbalProto(KerbalProtoMsgData messageData)\n {\n ProcessKerbal(messageData.Kerbal.KerbalData, messageData.Kerbal.NumBytes);\n }\n\n /// <summary>\n /// Appends the received kerbal to the dictionary\n /// </summary>\n private static void ProcessKerbal(byte[] kerbalData, int numBytes)\n {\n var kerbalNode = kerbalData.DeserializeToConfigNode(numBytes);\n if (kerbalNode != null)\n {\n System.KerbalsToProcess.Enqueue(kerbalNode);\n }\n else\n LunaLog.LogError(\"[LMP]: Failed to load kerbal!\");\n }\n\n /// <summary>\n /// We store all the kerbals in the KerbalProtoQueue dictionary so later once the game starts we load them\n /// </summary>\n /// <param name=\"messageData\"></param>\n private static void HandleKerbalReply(KerbalReplyMsgData messageData)\n {\n for (var i = 0; i < messageData.KerbalsCount; i++)\n {\n ProcessKerbal(messageData.Kerbals[i].KerbalData, messageData.Kerbals[i].NumBytes);\n }\n\n LunaLog.Log(\"[LMP]: Kerbals Synced!\");\n MainSystem.NetworkState = ClientState.KerbalsSynced;\n }\n }\n}\n", "meta": {"content_hash": "2a1675195d29087b473ac18426494fdc", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 126, "avg_line_length": 36.648648648648646, "alnum_prop": 0.6010324483775811, "repo_name": "gavazquez/LunaMultiPlayer", "id": "8fcb7fdfb64dfb91f1784867c3f456374d3cd524", "size": "2714", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "LmpClient/Systems/KerbalSys/KerbalMessageHandler.cs", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "3648"}, {"name": "C#", "bytes": "2055657"}, {"name": "CSS", "bytes": "1100"}, {"name": "HTML", "bytes": "484"}, {"name": "JavaScript", "bytes": "1252"}, {"name": "Smalltalk", "bytes": "15844"}]}} +{"text": "import sys\nfrom conftest import rvo_output, rvo_err\nfrom click.testing import CliRunner\nfrom rvo import cli\n\ndef test_add_all_parameters(isatty_true):\n options = ['add', '-t', 'test', '-c', 'test', '--content', 'test']\n output = ['Document \"test\" created.']\n rvo_output(options,output)\n\ndef test_add_tags(isatty_true):\n options = ['add', '-t', 'test', '--content', 'test']\n output = ['Document \"test\" created.']\n rvo_output(options,output)\n\ndef test_add_title_test(isatty_true):\n options = ['add', '-t', 'test', '--content', 'THIS IS A TITLE']\n output = ['Document \"THIS IS A TITLE\" created.']\n rvo_output(options,output)\n\ndef test_add_title_test_gnarf(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-c', 't\u00f6stc\u00e4t', '-x', 'gnarf'])\n assert not result.exception\n assert result.output.strip().endswith('Document \"gnarf\" created.')\n\ndef test_add_title_test_gnarf(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-c', 't\u00f6stc\u00e4t', '-x', 'gnarf\\nfoo'])\n assert not result.exception\n assert result.output.strip().endswith('Document \"gnarf\" created.')\n\ndef test_add_title_test_hashtag(isatty_true):\n options = ['add', '-t', 'test', '--content', '# THIS IS A TITLE']\n output = ['Document \"THIS IS A TITLE\" created.']\n rvo_output(options,output)\n\ndef test_add_title_test_hashtag(isatty_true):\n options = ['add', '-t', 'test', '--content', '# THIS IS A TITLE\\nmutliline']\n output = ['Document \"THIS IS A TITLE\" created.']\n rvo_output(options,output)\n\ndef test_add_very_long_title(isatty_true):\n options = ['add', '-t', 'test', '--content', '# THIS IS A VERY VERY LONG NEVER ENDING TITLE THAT EXCEEDS LIMITS']\n output = ['Document \"THIS IS A VERY VERY LONG NEVER ENDING TITLE THAT E\" created.']\n rvo_output(options,output)\n\ndef test_add_no_parameters(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add'])\n assert result.output.strip().endswith('Document \"TEST\" created.')\n assert not result.exception\n\ndef test_add_one_parameters_tag(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-t', 'testtag'])\n assert result.output.strip().endswith('Document \"TEST\" created.')\n assert not result.exception\n\ndef test_add_utf8_cat(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-c', 't\u00f6stc\u00e4t'])\n assert result.output.strip().endswith('Document \"TEST\" created.')\n assert not result.exception\n\ndef test_add_utf8_cat_multi(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-c', 't\u00fc\u00fct\u00fc\u00fc', '-c', 't\u00f6stc\u00e4t'])\n assert result.output.strip().endswith('Document \"TEST\" created.')\n assert not result.exception\n\ndef test_add_utf8_tag(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-t', 't\u00f6stc\u00e4t'])\n assert result.output.strip().endswith('Document \"TEST\" created.')\n assert not result.exception\n\ndef test_add_utf8_tag_multi(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-t', 't\u00fc\u00fct\u00fc\u00fc', '-t', 't\u00f6stc\u00e4t'])\n assert result.output.strip().endswith('Document \"TEST\" created.')\n assert not result.exception\n\ndef test_add_encrypt_by_parameter_wrong_pw(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-e', '-p', 'thispasswordistotallywrong', '-t', 'encryption', '-c', 'test'])\n assert result.output.strip().endswith('Invalid Password')\n assert result.exception\n\ndef test_add_encrypt_by_parameter(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-e', '-p', 'test123', '-t', 'encryption', '-c', 'test'])\n assert result.output.strip().endswith('Document \"TEST\" created.')\n assert not result.exception\n\ndef test_add_encrypt_by_input(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-e', '-t', 'encryption', '-c', 'test'], input=\"test123\\n\")\n assert result.output.strip().endswith('Document \"TEST\" created.')\n assert not result.exception\n\ndef test_add_encrypt_by_input_with_content(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-e', '-t', 'encryption', '-x', 'TEST', '-c', 'test'], input=\"test123\\n\")\n assert result.output.strip().endswith('Document \"TEST\" created.')\n assert not result.exception\n\ndef test_add_encrypt_by_input_wrong_pw(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-e', '-t', 'encryption', '-c', 'test'], input=\"test2123\\n\")\n assert result.output.strip().endswith('Invalid Password')\n assert result.exception\n\ndef test_add_read_from_stdin(isatty_false):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add'], input=\"Schwifty\\nSchwifty..lol\\nMorty\\n\\n\")\n assert result.output.strip().endswith('Document \"Schwifty\" created.')\n assert not result.exception\n\ndef test_add_read_from_stdin_with_cat(isatty_false):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-c', 'test'], input=\"Schwifty\\nSchwifty..lol\\nMorty\\n\\n\")\n assert result.output.strip().endswith('Document \"Schwifty\" created.')\n assert not result.exception\n\ndef test_add_read_from_stdin_with_tag(isatty_false):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-t', 'tag'], input=\"Schwifty\\nSchwifty..lol\\nMorty\\n\\n\")\n assert not result.exception\n assert result.output.strip().endswith('Document \"Schwifty\" created.')\n\ndef test_add_conflicting_stdin_reading(isatty_false):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-e'], input=\"Schwifty\\nSchwifty..lol\\nMorty\\n\\n\")\n assert result.exception\n assert result.output.strip().endswith('Invalid Password')\n\ndef test_add_location_germany(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-l', 'Nuremberg', '-c', 'test'])\n assert result.output.strip().endswith('Document \"TEST\" created.')\n assert not result.exception\n\ndef test_add_location_invalid(isatty_true):\n runner = CliRunner()\n result = runner.invoke(cli.cli, ['add', '-l', 'DOESNOTEXISTTOWNATLEASTIHOPE', '-c', 'test'])\n assert result.exception\n", "meta": {"content_hash": "f3c656fac22c9e8bb6d3154d825ff145", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 120, "avg_line_length": 42.31972789115646, "alnum_prop": 0.6651663719659219, "repo_name": "noqqe/rvo", "id": "27e97720b7f7607b81cff91683a91c7ab63ddf6f", "size": "6288", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/test_add.py", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "96671"}, {"name": "Shell", "bytes": "724"}]}} +{"text": "package com.charlesbishop.webrest.util;\n\nimport java.io.Serializable;\n\nimport org.springframework.context.support.ClassPathXmlApplicationContext;\nimport org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;\n\nimport com.charlesbishop.webrest.dao.AppUserDAO;\nimport com.charlesbishop.webrest.model.AppUser;\n\n/**\n * @author charlie\n * This utility class contains helper methods that can assist in the creation of an AppUser object\n */\npublic class UserCreationUtil {\n\n\tprivate final static String ROLE_USER = \"USER\";\n\tprivate static BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();\n\t\n\tpublic static AppUser createUser(String username, String rawPassword){\n\t\tClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(\"spring.xml\");\t\t\n\t\t\n\t\tAppUser user = new AppUser();\n\t\tuser.setUsername(username);\n\t\tuser.setPassword(encoder.encode(rawPassword));\n\t\tuser.setUserRole(ROLE_USER);\n\t\t\n\t\tAppUserDAO userDAO = context.getBean(AppUserDAO.class);\n\t\tSerializable id = userDAO.save(user);\n\t\tcontext.close();\n\n\t\ttry {\n\t\t\treturn (id != null) ? user: null;\n\t\t}\n\t\tcatch (Exception e){\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\t// Check if a password is valid or not\n\tpublic static boolean passwordIsValid(String password){\n\t\tboolean validLength = (password.length() >= 8 && password.length() <= 14);\n\t\tboolean hasSpecial = !password.matches(\"[A-Za-z0-9 ]*\");\n\t\tboolean hasUppercase = !password.equals(password.toLowerCase());\n\t\tboolean hasLowercase = !password.equals(password.toUpperCase());\n\t\t\n\t\treturn validLength & hasSpecial & hasUppercase & hasLowercase;\n\t}\n}\n", "meta": {"content_hash": "204af6d29650b4f2e1595826ea1b235e", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 98, "avg_line_length": 32.183673469387756, "alnum_prop": 0.7564996829422955, "repo_name": "charleshb417/webrest", "id": "1577cffa3fe00991c89ef2d990185cc0f979338b", "size": "1577", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/charlesbishop/webrest/util/UserCreationUtil.java", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "2155"}, {"name": "HTML", "bytes": "4177"}, {"name": "Java", "bytes": "55582"}, {"name": "JavaScript", "bytes": "22330"}]}} +{"text": "\n\n#import \"GPAppDelegate.h\"\n\nint main(int argc, char *argv[]) {\n @autoreleasepool {\n return UIApplicationMain(argc, argv, nil, NSStringFromClass([GPAppDelegate class]));\n }\n}\n", "meta": {"content_hash": "0638b209ea0d2dc6d4b80cac9bc7c7e3", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 92, "avg_line_length": 20.88888888888889, "alnum_prop": 0.6702127659574468, "repo_name": "Gi-lo/AboutMe-WWDC", "id": "5e37e4c2232e423af3bde3ea29df85af2e3ef2e7", "size": "1545", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Giulio Petek/Giulio Petek/Supporting Files/main.m", "mode": "33188", "license": "mit", "language": [{"name": "Objective-C", "bytes": "134726"}]}} +{"text": "\npackage io.aeron.samples;\n\nimport io.aeron.*;\nimport io.aeron.driver.*;\nimport io.aeron.logbuffer.*;\nimport org.agrona.*;\nimport org.agrona.concurrent.*;\n\nimport java.nio.ByteBuffer;\nimport java.util.concurrent.atomic.AtomicBoolean;\nimport java.util.concurrent.locks.LockSupport;\n\nimport static org.agrona.BitUtil.CACHE_LINE_LENGTH;\nimport static org.agrona.SystemUtil.loadPropertiesFiles;\nimport static org.agrona.UnsafeAccess.UNSAFE;\n\npublic class EmbeddedIpcThroughput\n{\n public static final int BURST_LENGTH = 1_000_000;\n public static final int MESSAGE_LENGTH = SampleConfiguration.MESSAGE_LENGTH;\n public static final int MESSAGE_COUNT_LIMIT = SampleConfiguration.FRAGMENT_COUNT_LIMIT;\n public static final String CHANNEL = CommonContext.IPC_CHANNEL;\n public static final int STREAM_ID = SampleConfiguration.STREAM_ID;\n\n public static void main(final String[] args) throws Exception\n {\n loadPropertiesFiles(args);\n\n final AtomicBoolean running = new AtomicBoolean(true);\n SigInt.register(() -> running.set(false));\n\n final MediaDriver.Context ctx = new MediaDriver.Context()\n .threadingMode(ThreadingMode.SHARED)\n .sharedIdleStrategy(new NoOpIdleStrategy());\n\n try (MediaDriver ignore = MediaDriver.launch(ctx);\n Aeron aeron = Aeron.connect();\n Publication publication = aeron.addPublication(CHANNEL, STREAM_ID);\n Subscription subscription = aeron.addSubscription(CHANNEL, STREAM_ID))\n {\n final Subscriber subscriber = new Subscriber(running, subscription);\n final Thread subscriberThread = new Thread(subscriber);\n subscriberThread.setName(\"subscriber\");\n final Thread publisherThread = new Thread(new Publisher(running, publication));\n publisherThread.setName(\"publisher\");\n final Thread rateReporterThread = new Thread(new RateReporter(running, subscriber));\n rateReporterThread.setName(\"rate-reporter\");\n\n rateReporterThread.start();\n subscriberThread.start();\n publisherThread.start();\n\n subscriberThread.join();\n publisherThread.join();\n rateReporterThread.join();\n }\n }\n\n public static final class RateReporter implements Runnable\n {\n private final AtomicBoolean running;\n private final Subscriber subscriber;\n\n public RateReporter(final AtomicBoolean running, final Subscriber subscriber)\n {\n this.running = running;\n this.subscriber = subscriber;\n }\n\n public void run()\n {\n long lastTimeStamp = System.currentTimeMillis();\n long lastTotalBytes = subscriber.totalBytes();\n\n while (running.get())\n {\n LockSupport.parkNanos(1_000_000_000);\n\n final long newTimeStamp = System.currentTimeMillis();\n final long newTotalBytes = subscriber.totalBytes();\n\n final long duration = newTimeStamp - lastTimeStamp;\n final long bytesTransferred = newTotalBytes - lastTotalBytes;\n\n System.out.format(\n \"Duration %dms - %,d messages - %,d payload bytes%n\",\n duration, bytesTransferred / MESSAGE_LENGTH, bytesTransferred);\n\n lastTimeStamp = newTimeStamp;\n lastTotalBytes = newTotalBytes;\n }\n }\n }\n\n public static final class Publisher implements Runnable\n {\n private final AtomicBoolean running;\n private final Publication publication;\n\n public Publisher(final AtomicBoolean running, final Publication publication)\n {\n this.running = running;\n this.publication = publication;\n }\n\n public void run()\n {\n final Publication publication = this.publication;\n final ByteBuffer byteBuffer = BufferUtil.allocateDirectAligned(\n publication.maxMessageLength(), CACHE_LINE_LENGTH);\n final UnsafeBuffer buffer = new UnsafeBuffer(byteBuffer);\n long backPressureCount = 0;\n long totalMessageCount = 0;\n\n outputResults:\n while (running.get())\n {\n for (int i = 0; i < BURST_LENGTH; i++)\n {\n while (publication.offer(buffer, 0, MESSAGE_LENGTH) <= 0)\n {\n ++backPressureCount;\n if (!running.get())\n {\n break outputResults;\n }\n }\n\n ++totalMessageCount;\n }\n }\n\n final double backPressureRatio = backPressureCount / (double)totalMessageCount;\n System.out.format(\"Publisher back pressure ratio: %f%n\", backPressureRatio);\n }\n }\n\n public static final class Subscriber implements Runnable, FragmentHandler\n {\n private static final long TOTAL_BYTES_OFFSET;\n\n static\n {\n try\n {\n TOTAL_BYTES_OFFSET = UNSAFE.objectFieldOffset(Subscriber.class.getDeclaredField(\"totalBytes\"));\n }\n catch (final Exception ex)\n {\n throw new RuntimeException(ex);\n }\n }\n\n private final AtomicBoolean running;\n private final Subscription subscription;\n\n private volatile long totalBytes = 0;\n\n public Subscriber(final AtomicBoolean running, final Subscription subscription)\n {\n this.running = running;\n this.subscription = subscription;\n }\n\n public long totalBytes()\n {\n return totalBytes;\n }\n\n public void run()\n {\n while (!subscription.isConnected())\n {\n Thread.yield();\n }\n\n final Image image = subscription.imageAtIndex(0);\n\n long failedPolls = 0;\n long successfulPolls = 0;\n\n while (running.get())\n {\n final int fragmentsRead = image.poll(this, MESSAGE_COUNT_LIMIT);\n if (0 == fragmentsRead)\n {\n ++failedPolls;\n }\n else\n {\n ++successfulPolls;\n }\n }\n\n final double failureRatio = failedPolls / (double)(successfulPolls + failedPolls);\n System.out.format(\"Subscriber poll failure ratio: %f%n\", failureRatio);\n }\n\n public void onFragment(final DirectBuffer buffer, final int offset, final int length, final Header header)\n {\n UNSAFE.putOrderedLong(this, TOTAL_BYTES_OFFSET, totalBytes + length);\n }\n }\n}\n", "meta": {"content_hash": "c7579036649a7a0f90a8c95aaeaa261d", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 114, "avg_line_length": 33.40487804878049, "alnum_prop": 0.5867406542056075, "repo_name": "galderz/Aeron", "id": "e6115c3fc747af9ffe07efd3185e1fe055665939", "size": "7447", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aeron-samples/src/main/java/io/aeron/samples/EmbeddedIpcThroughput.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "28890"}, {"name": "C", "bytes": "955025"}, {"name": "C++", "bytes": "1444914"}, {"name": "CMake", "bytes": "41954"}, {"name": "Java", "bytes": "3802252"}, {"name": "Shell", "bytes": "35251"}]}} +{"text": "\n\npackage io.fabric8.activemq.facade;\n\nimport org.apache.activemq.command.ActiveMQDestination;\n\nimport java.util.Collection;\n\n/**\n * A facade for either a local in JVM broker or a remote broker over JMX\n *\n * \n * \n */\npublic interface BrokerFacade {\n\n /**\n * @return a unique id for this resource, typically a JMX ObjectName\n * @throws Exception\n */\n String getId() throws Exception;\n\n /**\n * Returns all the available brokers.\n *\n * @return not <code>null</code>\n * @throws Exception\n */\n public BrokerFacade[] getBrokers() throws Exception;\n\n\t/**\n\t * The name of the active broker (f.e. 'localhost' or 'my broker').\n\t * \n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tString getBrokerName() throws Exception;\n\n\t/**\n\t * Admin view of the broker.\n\t * \n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tBrokerViewFacade getBrokerAdmin() throws Exception;\n\n\t/**\n\t * All queues known to the broker.\n\t * \n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tCollection<QueueViewFacade> getQueues() throws Exception;\n\n\t/**\n\t * All topics known to the broker.\n\t * \n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tCollection<TopicViewFacade> getTopics() throws Exception;\n\n\t/**\n\t * All active consumers of a queue.\n\t * \n\t * @param queueName\n\t * the name of the queue, not <code>null</code>\n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tCollection<SubscriptionViewFacade> getQueueConsumers(String queueName)\n\t\t\tthrows Exception;\n\n /**\n * Returns the consumers available on the given topic\n */\n\tCollection<SubscriptionViewFacade> getTopicConsumers(String topicName) throws Exception;\n\n /**\n * Returns the durable consumers available on the given topic\n */\n Collection<DurableSubscriptionViewFacade> getTopicDurableConsumers(String topicName) throws Exception;\n\n\n /**\n * Returns the producers available on the given queue\n */\n Collection<ProducerViewFacade> getQueueProducers(String queueName) throws Exception;\n\n /**\n * Returns the producers available on the given topic\n */\n Collection<ProducerViewFacade> getTopicProducers(String topicName) throws Exception;\n\n\t/**\n\t * Active durable subscribers to topics of the broker.\n\t * \n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tCollection<DurableSubscriptionViewFacade> getDurableTopicSubscribers()\n\t\t\tthrows Exception;\n\n\n\t/**\n\t * Inactive durable subscribers to topics of the broker.\n\t *\n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tCollection<DurableSubscriptionViewFacade> getInactiveDurableTopicSubscribers()\n\t\t\tthrows Exception;\n\n\t/**\n\t * The names of all transport connectors of the broker (f.e. openwire, ssl)\n\t * \n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tCollection<String> getConnectors() throws Exception;\n\n\t/**\n\t * A transport connectors.\n\t * \n\t * @param name\n\t * name of the connector (f.e. openwire)\n\t * @return <code>null</code> if not found\n\t * @throws Exception\n\t */\n\tConnectorViewFacade getConnector(String name) throws Exception;\n\n\t/**\n\t * All connections to all transport connectors of the broker.\n\t * \n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tCollection<ConnectionViewFacade> getConnections() throws Exception;\n\n\t/**\n\t * The names of all connections to a specific transport connectors of the\n\t * broker.\n\t * \n\t * @see #getConnection(String)\n\t * @param connectorName\n\t * not <code>null</code>\n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tCollection<String> getConnections(String connectorName) throws Exception;\n\n\t/**\n\t * A specific connection to the broker.\n\t * \n\t * @param connectionName\n\t * the name of the connection, not <code>null</code>\n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tConnectionViewFacade getConnection(String connectionName) throws Exception;\n\t/**\n\t * Returns all consumers of a connection.\n\t * \n\t * @param connectionName\n\t * the name of the connection, not <code>null</code>\n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tCollection<SubscriptionViewFacade> getConsumersOnConnection(\n\t\t\tString connectionName) throws Exception;\n\t/**\n\t * The brokers network connectors.\n\t * \n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n\tCollection<NetworkConnectorViewFacade> getNetworkConnectors()\n\t\t\tthrows Exception;\n\n\n\t/**\n\t * The brokers network bridges.\n\t *\n\t * @return not <code>null</code>\n\t * @throws Exception\n\t */\n Collection<NetworkBridgeViewFacade> getNetworkBridges()\n throws Exception;\n\n /**\n\t * Purges the given destination\n\t * \n\t * @param destination\n\t * @throws Exception\n\t */\n\tvoid purgeQueue(ActiveMQDestination destination) throws Exception;\n\t/**\n\t * Get the view of the queue with the specified name.\n\t * \n\t * @param name\n\t * not <code>null</code>\n\t * @return <code>null</code> if no queue with this name exists\n\t * @throws Exception\n\t */\n\tQueueViewFacade getQueue(String name) throws Exception;\n\t/**\n\t * Get the view of the topic with the specified name.\n\t * \n\t * @param name\n\t * not <code>null</code>\n\t * @return <code>null</code> if no topic with this name exists\n\t * @throws Exception\n\t */\n\tTopicViewFacade getTopic(String name) throws Exception;\n\t\n\t/**\n\t * Get the JobScheduler MBean\n\t * @return the jobScheduler or null if not configured\n\t * @throws Exception\n\t */\n\tJobSchedulerViewFacade getJobScheduler() throws Exception;\n\t\n\t/**\n * Get the JobScheduler MBean\n * @return the jobScheduler or null if not configured\n * @throws Exception\n */\n Collection<JobFacade> getScheduledJobs() throws Exception;\n\n boolean isJobSchedulerStarted();\n}\n", "meta": {"content_hash": "721459e845a5da7add68a4a701a66ffa", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 106, "avg_line_length": 24.874458874458874, "alnum_prop": 0.6801253045596937, "repo_name": "alexeev/jboss-fuse-mirror", "id": "a2ecf4d144d92f3c59a9453b2d7247ad73d2fba7", "size": "6377", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tooling/tooling-activemq-facade/src/main/java/io/fabric8/activemq/facade/BrokerFacade.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "313969"}, {"name": "CoffeeScript", "bytes": "278706"}, {"name": "Java", "bytes": "8498768"}, {"name": "JavaScript", "bytes": "2483260"}, {"name": "Kotlin", "bytes": "14282"}, {"name": "Scala", "bytes": "484151"}, {"name": "Shell", "bytes": "11547"}, {"name": "XSLT", "bytes": "26098"}]}} +{"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.11\"/>\n<title>Arch Game Engine: Class Members - Functions</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/searchdata.js\"></script>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(function() { init_search(); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n <td id=\"projectalign\" style=\"padding-left: 0.5em;\">\n <div id=\"projectname\">Arch Game Engine\n  <span id=\"projectnumber\">0.2</span>\n </div>\n </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.11 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n <div id=\"navrow1\" class=\"tabs\">\n <ul class=\"tablist\">\n <li><a href=\"index.html\"><span>Main Page</span></a></li>\n <li class=\"current\"><a href=\"annotated.html\"><span>Classes</span></a></li>\n <li><a href=\"files.html\"><span>Files</span></a></li>\n <li>\n <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n <span class=\"left\">\n <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n alt=\"\"/>\n <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n onblur=\"searchBox.OnSearchFieldFocus(false)\" \n onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n </span><span class=\"right\">\n <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n </span>\n </div>\n </li>\n </ul>\n </div>\n <div id=\"navrow2\" class=\"tabs2\">\n <ul class=\"tablist\">\n <li><a href=\"annotated.html\"><span>Class List</span></a></li>\n <li><a href=\"classes.html\"><span>Class Index</span></a></li>\n <li><a href=\"inherits.html\"><span>Class Hierarchy</span></a></li>\n <li class=\"current\"><a href=\"functions.html\"><span>Class Members</span></a></li>\n </ul>\n </div>\n <div id=\"navrow3\" class=\"tabs2\">\n <ul class=\"tablist\">\n <li><a href=\"functions.html\"><span>All</span></a></li>\n <li class=\"current\"><a href=\"functions_func.html\"><span>Functions</span></a></li>\n <li><a href=\"functions_vars.html\"><span>Variables</span></a></li>\n </ul>\n </div>\n <div id=\"navrow4\" class=\"tabs3\">\n <ul class=\"tablist\">\n <li><a href=\"functions_func.html#index_a\"><span>a</span></a></li>\n <li><a href=\"functions_func_b.html#index_b\"><span>b</span></a></li>\n <li><a href=\"functions_func_c.html#index_c\"><span>c</span></a></li>\n <li><a href=\"functions_func_d.html#index_d\"><span>d</span></a></li>\n <li><a href=\"functions_func_f.html#index_f\"><span>f</span></a></li>\n <li><a href=\"functions_func_g.html#index_g\"><span>g</span></a></li>\n <li><a href=\"functions_func_h.html#index_h\"><span>h</span></a></li>\n <li><a href=\"functions_func_i.html#index_i\"><span>i</span></a></li>\n <li><a href=\"functions_func_k.html#index_k\"><span>k</span></a></li>\n <li><a href=\"functions_func_l.html#index_l\"><span>l</span></a></li>\n <li class=\"current\"><a href=\"functions_func_m.html#index_m\"><span>m</span></a></li>\n <li><a href=\"functions_func_o.html#index_o\"><span>o</span></a></li>\n <li><a href=\"functions_func_r.html#index_r\"><span>r</span></a></li>\n <li><a href=\"functions_func_s.html#index_s\"><span>s</span></a></li>\n <li><a href=\"functions_func_u.html#index_u\"><span>u</span></a></li>\n <li><a href=\"functions_func_0x7e.html#index_0x7e\"><span>~</span></a></li>\n </ul>\n </div>\n</div><!-- top -->\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n</div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"contents\">\n \n\n<h3><a class=\"anchor\" id=\"index_m\"></a>- m -</h3><ul>\n<li>move()\n: <a class=\"el\" href=\"classLevel.html#a9184b25173fbf468a63a633bd3510bd6\">Level</a>\n, <a class=\"el\" href=\"classObject.html#af4133db64f4051294dc103a2f3553a6a\">Object</a>\n</li>\n<li>moveTowards()\n: <a class=\"el\" href=\"classPhysics.html#a8e53f9bf088c0d4f208b3c2029d69ab2\">Physics</a>\n</li>\n<li>moveX()\n: <a class=\"el\" href=\"classObject.html#a43f3220cb27a282c28afaea57ac9a098\">Object</a>\n</li>\n<li>moveY()\n: <a class=\"el\" href=\"classObject.html#a58bab6e78efd8282996d742530c98034\">Object</a>\n</li>\n</ul>\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by  <a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.11\n</small></address>\n</body>\n</html>\n", "meta": {"content_hash": "6d609a8ae85150b0d0ec24c54e903aa2", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 154, "avg_line_length": 42.78260869565217, "alnum_prop": 0.6321138211382114, "repo_name": "jarreed0/ArchGE", "id": "de8855bacfd51d6ab2de6ce2b10b6c15f14e1de5", "size": "5904", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/html/functions_func_m.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C++", "bytes": "232681"}, {"name": "Shell", "bytes": "10667"}]}} +{"text": "\ufeffusing System;\n\npublic interface IExecutionScope : IDisposable\n#if NATIVE_ASYNC\n\t, IAsyncDisposable\n#endif\n{\n}\n", "meta": {"content_hash": "dba4eb24c8b66c72fb0856faf979ff42", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 46, "avg_line_length": 13.875, "alnum_prop": 0.7747747747747747, "repo_name": "linq2db/linq2db", "id": "8fe6042321283fe54eb99b53ef62ef9ba0ca4fb8", "size": "113", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Source/LinqToDB/DataProvider/IExecutionScope.cs", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "29203"}, {"name": "C#", "bytes": "18569855"}, {"name": "F#", "bytes": "15865"}, {"name": "PLSQL", "bytes": "29278"}, {"name": "PLpgSQL", "bytes": "15809"}, {"name": "PowerShell", "bytes": "5130"}, {"name": "SQLPL", "bytes": "10530"}, {"name": "Shell", "bytes": "29373"}, {"name": "Smalltalk", "bytes": "11"}, {"name": "TSQL", "bytes": "104099"}, {"name": "Visual Basic .NET", "bytes": "3871"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.Design;\nusing Cirrious.MvvmCross.Plugins.Email;\nusing Cirrious.MvvmCross.Plugins.WebBrowser;\nusing codestuffers.MvvmCross.Plugins.FeedbackDialog.OpenCriteria;\nusing codestuffers.MvvmCross.Plugins.UserInteraction;\nusing FluentAssertions;\nusing Moq;\nusing NUnit.Framework;\n\nnamespace codestuffers.MvvmCross.Plugins.FeedbackDialog.Tests\n{\n [TestFixture]\n public class MvxFeedbackDialogTests\n {\n private Mock<IMvxUserInteraction> _userInteraction;\n private Mock<IFeedbackDataService> _dataService;\n private Mock<IMvxComposeEmailTask> _emailTask;\n private Mock<IMvxWebBrowserTask> _webBrowser;\n private Mock<FeedbackData> _data;\n private FeedbackDialogConfiguration _configuration;\n private List<IOpenDialogCriteria> _criteria;\n private MvxFeedbackDialog _testObject;\n\n [SetUp]\n public void Setup()\n {\n _criteria = new List<IOpenDialogCriteria>();\n _data = new Mock<FeedbackData>();\n _data.SetupProperty(x => x.DialogWasShown);\n\n _userInteraction = new Mock<IMvxUserInteraction>();\n _dataService = new Mock<IFeedbackDataService>();\n _dataService.Setup(x => x.GetData()).Returns(() => _data.Object);\n\n _emailTask = new Mock<IMvxComposeEmailTask>();\n _webBrowser = new Mock<IMvxWebBrowserTask>();\n _configuration = new FeedbackDialogConfiguration {OpenCriteria = _criteria};\n\n _testObject = new MvxFeedbackDialog(_userInteraction.Object, \n _dataService.Object, _emailTask.Object, _webBrowser.Object);\n _testObject.SetConfiguration(_configuration);\n }\n\n [Test]\n public void RecordAppStart_ShouldNotRecordAppStart_WhenDialogHasAlreadyBeenOpened()\n {\n _data.Setup(x => x.DialogWasShown).Returns(true);\n _testObject.RecordAppStart();\n _data.Verify(x => x.AppHasOpened(), Times.Never());\n }\n\n [Test]\n public void RecordAppStart_ShouldRecordAppStart_WhenDialogHasNotBeenOpened()\n {\n _data.Setup(x => x.DialogWasShown).Returns(false);\n _testObject.RecordAppStart();\n _data.Verify(x => x.AppHasOpened(), Times.Once());\n }\n\n [Test]\n public void RecordAppStart_ShouldMarkDialogAsOpened_WhenAllCriteriaIsTrue()\n {\n var criteria1 = new Mock<IOpenDialogCriteria>();\n criteria1.Setup(x => x.ShouldOpen(It.IsAny<FeedbackData>())).Returns(true);\n var criteria2 = new Mock<IOpenDialogCriteria>();\n criteria2.Setup(x => x.ShouldOpen(It.IsAny<FeedbackData>())).Returns(true);\n\n _criteria.Add(criteria1.Object);\n _criteria.Add(criteria2.Object);\n\n _data.SetupSet(x => x.DialogWasShown = true);\n _testObject.RecordAppStart();\n _data.VerifySet(x => x.DialogWasShown = true);\n }\n\n [TestCase(false, true)]\n [TestCase(true, false)]\n [TestCase(false, false)]\n public void RecordAppStart_ShouldNotMarkDialogAsOpened_WhenAnyCriteriaIsFalse(bool crit1, bool crit2)\n {\n var criteria1 = new Mock<IOpenDialogCriteria>();\n criteria1.Setup(x => x.ShouldOpen(It.IsAny<FeedbackData>())).Returns(crit1);\n var criteria2 = new Mock<IOpenDialogCriteria>();\n criteria2.Setup(x => x.ShouldOpen(It.IsAny<FeedbackData>())).Returns(crit2);\n\n _criteria.Add(criteria1.Object);\n _criteria.Add(criteria2.Object);\n\n _data.SetupSet(x => x.DialogWasShown = false);\n _testObject.RecordAppStart();\n _data.VerifySet(x => x.DialogWasShown = false);\n }\n\n [Test]\n public void RecordAppStart_ShouldNotMarkDialogAsOpened_WhenThereAreNoCriteria()\n {\n _data.SetupProperty(x => x.DialogWasShown, false);\n _testObject.RecordAppStart();\n _data.Object.DialogWasShown.Should().BeFalse();\n }\n\n [Test]\n public void RecordAppStart_ShouldSaveData_WhenDialogHasNotBeenOpened()\n {\n _data.Setup(x => x.DialogWasShown).Returns(false);\n _testObject.RecordAppStart();\n _dataService.Verify(x => x.SaveData(_data.Object), Times.Once());\n }\n\n [Test]\n public void RecordAppStart_ShouldOpenDialog_WhenAllCriteriaIsTrue()\n {\n var criteria1 = new Mock<IOpenDialogCriteria>();\n criteria1.Setup(x => x.ShouldOpen(It.IsAny<FeedbackData>())).Returns(true);\n _criteria.Add(criteria1.Object);\n\n _testObject.RecordAppStart();\n _userInteraction.Verify(x => x.ShowDialog(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<Action>(), It.IsAny<Action>()));\n }\n }\n}\n", "meta": {"content_hash": "02e350f8aaf8f3dc50af6531bac879ca", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 175, "avg_line_length": 39.8780487804878, "alnum_prop": 0.6332313965341488, "repo_name": "codestuffers/MvvmCrossPlugins", "id": "5f6368e674642a4bf1562e9743ab9f29696b71a6", "size": "4907", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/FeedbackDialog/Tests/codestuffers.MvvmCross.Plugins.FeedbackDialog.Tests/MvxFeedbackDialogTests.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "124864"}, {"name": "PowerShell", "bytes": "203"}, {"name": "Puppet", "bytes": "906"}]}} +{"text": "/*\n * cs170 -- Rich wolski\n * producer-consumer example using kthreads\n * uses condition variables for full/empty conditions\n * uses condition variable to fulfill order\n * uses separate lock for each stock\n */\n#include <unistd.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"c-timer.h\"\n#include \"kt.h\"\n\n#define RAND() (drand48())\n\nstruct order\n{\n\tint stock_id;\n\tint quantity;\n\tint action;\t/* buy or sell */\n\tkt_sem fulfilled;\t\n};\n\nstruct order_que\n{\n\tstruct order **orders;\n\tint size;\n\tint head;\n\tint tail;\n\tkt_sem full;\n\tkt_sem empty;\n};\n\nstruct stock\n{\n\tint quantity;\n};\n\nstruct market\n{\n\tstruct stock *stocks;\n\tint count;\n};\n\nstruct order *InitOrder(int id, int quantity, int action)\n{\n\tstruct order *order;\n\n\torder = (struct order *)malloc(sizeof(struct order));\n\tif(order == NULL) {\n\t\treturn(NULL);\n\t}\n\torder->stock_id = id;\n\torder->quantity = quantity;\n\torder->action = action;\n\torder->fulfilled = make_kt_sem(0);\n\treturn(order);\n}\n\nvoid FreeOrder(struct order *order)\n{\n\tkill_kt_sem(order->fulfilled);\n\tfree(order);\n}\n\nstruct order_que *InitOrderQue(int size)\n{\n\tstruct order_que *oq;\n\n\toq = (struct order_que *)malloc(sizeof(struct order_que));\n\tif(oq == NULL) {\n\t\treturn(NULL);\n\t}\n\tmemset(oq,0,sizeof(struct order_que));\n\n\toq->size = size+1; /* empty condition burns a slot */\n\toq->orders = (struct order **)malloc(size*sizeof(struct order *));\n\tif(oq->orders == NULL) {\n\t\tfree(oq);\n\t\treturn(NULL);\n\t}\n\tmemset(oq->orders,0,size*sizeof(struct order *));\n\n\toq->full = make_kt_sem(size);\n\toq->empty = make_kt_sem(0);\n\n\treturn(oq);\n}\n\nvoid FreeOrderQue(struct order_que *oq)\n{\n\twhile(oq->head != oq->tail) {\n\t\tFreeOrder(oq->orders[oq->tail]);\n\t\toq->tail = (oq->tail + 1) % oq->size;\n\t}\n\n\tkill_kt_sem(oq->full);\n\tkill_kt_sem(oq->empty);\n\tfree(oq->orders);\n\tfree(oq);\n\treturn;\n}\n\nstruct market *InitMarket(int stock_count, int init_quantity)\n{\n\tstruct market *m;\n\tint i;\n\n\tm = (struct market *)malloc(sizeof(struct market));\n\tif(m == NULL) {\n\t\treturn(NULL);\n\t}\n\tm->count = stock_count;\n\n\tm->stocks = (struct stock *)malloc(stock_count*sizeof(struct stock));\n\tif(m->stocks == NULL) {\n\t\tfree(m);\n\t\treturn(NULL);\n\t}\n\n\tfor(i=0; i < stock_count; i++) {\n\t\tm->stocks[i].quantity = init_quantity;\n\t}\n\n\treturn(m);\n}\n\nvoid FreeMarket(struct market *m)\n{\n\tfree(m->stocks);\n\tfree(m);\n\treturn;\n}\n\nvoid PrintMarket(struct market *m)\n{\n\tint i;\n\tfor(i=0; i < m->count; i++) {\n\t\tprintf(\"stock: %d, quantity: %d\\n\",\n\t\t\ti,m->stocks[i].quantity);\n\t}\n\n\treturn;\n}\n\nstruct client_arg\n{\n\tint id;\n\tint order_count;\n\tstruct order_que *order_que;\n\tint max_stock_id;\n\tint max_quantity;\n\tint verbose;\n};\n\nstruct trader_arg\n{\n\tint id;\n\tstruct order_que *order_que;\n\tstruct market *market;\n\tint *done;\n\tint verbose;\n};\n\nvoid ClientThread(void *arg)\n{\n\tstruct client_arg *ca = (struct client_arg *)arg;\n\tint i;\n\tint next;\n\tstruct order *order;\n\tint stock_id;\n\tint quantity;\n\tint action;\n\tint queued;\n\tdouble now;\n\t\n\n\tfor(i=0; i < ca->order_count; i++) {\n\t\t/*\n\t\t * create an order for a random stock\n\t\t */\n\t\tstock_id = (int)(RAND() * ca->max_stock_id);\n\t\tquantity = (int)(RAND() * ca->max_quantity);\n\t\tif(RAND() > 0.5) {\n\t\t\taction = 0; /* 0 => buy */\n\t\t} else {\n\t\t\taction = 1; /* 1 => sell */\n\t\t}\n\t\torder = InitOrder(stock_id,quantity,action);\n\t\tif(order == NULL) {\n\t\t\tfprintf(stderr,\"no space for order\\n\");\n\t\t\texit(1);\n\t\t}\n\t\t/*\n\t\t * queue it for the traders\n\t\t */\n\t\tP_kt_sem(ca->order_que->full);\n\t\tnext = (ca->order_que->head + 1) % ca->order_que->size;\n\t\t/*\n\t\t * there is space in the queue, add the order and bump\n\t\t * the head\n\t\t */\n\t\tif(ca->verbose == 1) {\n\t\t\tnow = CTimer();\n\t\t\tprintf(\"%10.0f client %d: \",now,ca->id);\n\t\t\tprintf(\"queued stock %d, for %d, %s\\n\",\n\t\t\t\torder->stock_id,\n\t\t\t\torder->quantity,\n\t\t\t\t(order->action ? \"SELL\" : \"BUY\")); \n\t\t}\n\t\tca->order_que->orders[next] = order;\n\t\tca->order_que->head = next;\n\t\t/*\n\t\t * signal traders that there is another order\n\t\t */\n\t\tV_kt_sem(ca->order_que->empty);\n\t\t/*\n\t\t * wait until the order is fulfilled\n\t\t */\n\t\tP_kt_sem(order->fulfilled);\n\t\t/*\n\t\t * done, free the order and repeat\n\t\t */\n\t\tFreeOrder(order);\n\t}\n\n\treturn;\n}\n\nvoid TraderThread(void *arg)\n{\n\tstruct trader_arg *ta = (struct trader_arg *)arg;\n\tint dequeued;\n\tstruct order *order;\n\tint tail;\n\tdouble now;\n\tint next;\n\tstruct stock *stock;\n\n\twhile(1) {\n\t\t/*\n\t\t * wait until there is a new order\n\t\t */\n\t\tP_kt_sem(ta->order_que->empty);\n\t\t/*\n\t\t * are we done? Tell the next trader and exit\n\t\t */\n\t\tif(*(ta->done) == 1) {\n\t\t\tV_kt_sem(ta->order_que->empty);\n\t\t\tkt_exit();\n\t\t}\n\t\t/*\n\t\t * get the next order\n\t\t */\n\t\tnext = (ta->order_que->tail + 1) % ta->order_que->size;\n\t\torder = ta->order_que->orders[next];\n\t\tta->order_que->tail = next;\n\t\t/*\n\t\t * tell the clients there is another free slot\n\t\t */\n\t\tV_kt_sem(ta->order_que->full);\n\t\t/*\n\t\t * have an order to process\n\t\t */\n\t\tstock = &(ta->market->stocks[order->stock_id]);\n\t\tif(order->action == 1) { /* BUY */\n\t\t\tstock->quantity -= order->quantity;\n\t\t\tif(stock->quantity < 0) {\n\t\t\t\tstock->quantity = 0;\n\t\t\t}\n\t\t} else {\n\t\t\tstock->quantity += order->quantity;\n\t\t}\n\t\tif(ta->verbose == 1) {\n\t\t\tnow = CTimer();\n\t\t\tprintf(\"%10.0f trader: %d \",now,ta->id);\n\t\t\tprintf(\"fulfilled stock %d for %d\\n\",\n\t\t\t\torder->stock_id,\n\t\t\t\torder->quantity);\n\t\t}\n\t\t/*\n\t\t * tell the client the order is done\n\t\t */\n\t\tV_kt_sem(order->fulfilled);\n\t}\n\n\treturn;\n}\n\n#define ARGS \"c:t:o:q:s:V\"\nchar *Usage = \"market1 -c clients -t traders -o orders -q queue-size -s stock-count -V <verbose on>\\n\";\n\n#define INIT_COUNT 5000\n\nint main(int argc, char **argv)\n{\n\tint c;\n\tint client_threads;\n\tint trader_threads;\n\tint orders_per_client;\n\tint que_size;\n\tint max_stock;\n\tint verbose;\n\tstruct client_arg *ca;\n\tstruct trader_arg *ta;\n\tvoid **client_ids;\n\tvoid **trader_ids;\n\tstruct order_que *order_que;\n\tstruct market *market;\n\tint i;\n\tint done;\n\tint err;\n\tdouble start;\n\tdouble end;\n\t\n\n\t/*\n\t * defaults\n\t */\n\tclient_threads = 1;\n\ttrader_threads = 1;\n\torders_per_client = 1;\n\tverbose = 0;\n\tque_size = 1;\n\tmax_stock = 1;\n\n\twhile((c = getopt(argc,argv,ARGS)) != EOF) {\n\t\tswitch(c) {\n\t\t\tcase 'c':\n\t\t\t\tclient_threads = atoi(optarg);\n\t\t\t\tbreak;\n\t\t\tcase 't':\n\t\t\t\ttrader_threads = atoi(optarg);\n\t\t\t\tbreak;\n\t\t\tcase 'o':\n\t\t\t\torders_per_client = atoi(optarg);\n\t\t\t\tbreak;\n\t\t\tcase 'q':\n\t\t\t\tque_size = atoi(optarg);\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\tmax_stock = atoi(optarg);\n\t\t\t\tbreak;\n\t\t\tcase 'V':\n\t\t\t\tverbose = 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfprintf(stderr,\n\t\t\t\t\t\"unrecognized command %c\\n\",\n\t\t\t\t\t\t(char)c);\n\t\t\t\tfprintf(stderr,\"usage: %s\",Usage);\n\t\t\t\texit(1);\n\t\t}\n\t}\n\n\tclient_ids = (void **)malloc(client_threads*sizeof(void *));\n\tif(client_ids == NULL) {\n\t\texit(1);\n\t}\n\n\tca = (struct client_arg *)malloc(client_threads*sizeof(struct client_arg));\n\tif(ca == NULL) {\n\t\texit(1);\n\t}\n\n\ttrader_ids = (void **)malloc(trader_threads*sizeof(void *));\n\tif(trader_ids == NULL) {\n\t\texit(1);\n\t}\n\n\tta = (struct trader_arg *)malloc(trader_threads*sizeof(struct trader_arg));\n\tif(ta == NULL) {\n\t\texit(1);\n\t}\n\n\torder_que = InitOrderQue(que_size);\n\tif(order_que == NULL) {\n\t\texit(1);\n\t}\n\n\tmarket = InitMarket(max_stock,INIT_COUNT);\n\tif(market == NULL) {\n\t\texit(1);\n\t}\n\n\tstart = CTimer();\n\tfor(i=0; i < client_threads; i++) {\n\t\tca[i].id = i;\n\t\tca[i].order_count = orders_per_client;\n\t\tca[i].max_stock_id = max_stock;\n\t\tca[i].max_quantity = INIT_COUNT;\n\t\tca[i].order_que = order_que;\n\t\tca[i].verbose = verbose;\n\t\tclient_ids[i] = kt_fork(ClientThread,(void *)&ca[i]);\n\t\tif(client_ids[i] == NULL) {\n\t\t\tfprintf(stderr,\"client thread create %d failed\\n\",i);\n\t\t\texit(1);\n\t\t}\n\t}\n\n\tdone = 0;\n\tfor(i=0; i < trader_threads; i++) {\n\t\tta[i].id = i;\n\t\tta[i].order_que = order_que;\n\t\tta[i].market = market;\n\t\tta[i].done = &done;\n\t\tta[i].verbose = verbose;\n\t\ttrader_ids[i] = kt_fork(TraderThread,(void *)&ta[i]);\n\t\tif(trader_ids[i] == NULL) {\n\t\t\tfprintf(stderr,\"trader thread create %d failed\\n\",i);\n\t\t\texit(1);\n\t\t}\n\t}\n\n\t/*\n\t * wait for the clients to finish\n\t */\n\tfor(i=0; i < client_threads; i++) {\n\t\tkt_join(client_ids[i]);\n\t}\n\n\t/*\n\t * tell the traders we are done\n\t */\n\tdone = 1;\n\tV_kt_sem(order_que->empty);\n\n\tfor(i=0; i < trader_threads; i++) {\n\t\tkt_join(trader_ids[i]);\n\t}\n\tend = CTimer();\n\n\tif(verbose == 1) {\n\t\tPrintMarket(market);\n\t}\n\n\tprintf(\"%f transactions / sec\\n\",\n\t\t(double)(orders_per_client*client_threads) / (end-start));\n\n\tfree(ca);\n\tfree(ta);\n\tfree(client_ids);\n\tfree(trader_ids);\n\tFreeMarket(market);\n\tFreeOrderQue(order_que);\n\n\treturn(0);\n}\n\t\t\n\n\n\t\t\n\t\t\n\t\t\n\n\t\n\t\n\n\n\n\t\n\t\n\n", "meta": {"content_hash": "abcc4e4038574450a3e9091fa1b259aa", "timestamp": "", "source": "github", "line_count": 465, "max_line_length": 103, "avg_line_length": 17.974193548387095, "alnum_prop": 0.6057669298875329, "repo_name": "SeraphRoy/SeraphRoy.github.io", "id": "8a8573a8be750ca694d05a0824a8b9b82f9f346f", "size": "8358", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "assets/market-kthreads.c", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "96402"}, {"name": "HTML", "bytes": "36"}, {"name": "Ruby", "bytes": "8813"}]}} +{"text": "package client\n\nconst (\n\tStatefulSetSpecType = \"statefulSetSpec\"\n\tStatefulSetSpecFieldActiveDeadlineSeconds = \"activeDeadlineSeconds\"\n\tStatefulSetSpecFieldAutomountServiceAccountToken = \"automountServiceAccountToken\"\n\tStatefulSetSpecFieldContainers = \"containers\"\n\tStatefulSetSpecFieldDNSConfig = \"dnsConfig\"\n\tStatefulSetSpecFieldDNSPolicy = \"dnsPolicy\"\n\tStatefulSetSpecFieldEnableServiceLinks = \"enableServiceLinks\"\n\tStatefulSetSpecFieldEphemeralContainers = \"ephemeralContainers\"\n\tStatefulSetSpecFieldFSGroupChangePolicy = \"fsGroupChangePolicy\"\n\tStatefulSetSpecFieldFsgid = \"fsgid\"\n\tStatefulSetSpecFieldGids = \"gids\"\n\tStatefulSetSpecFieldHostAliases = \"hostAliases\"\n\tStatefulSetSpecFieldHostIPC = \"hostIPC\"\n\tStatefulSetSpecFieldHostNetwork = \"hostNetwork\"\n\tStatefulSetSpecFieldHostPID = \"hostPID\"\n\tStatefulSetSpecFieldHostname = \"hostname\"\n\tStatefulSetSpecFieldImagePullSecrets = \"imagePullSecrets\"\n\tStatefulSetSpecFieldNodeID = \"nodeId\"\n\tStatefulSetSpecFieldObjectMeta = \"metadata\"\n\tStatefulSetSpecFieldOverhead = \"overhead\"\n\tStatefulSetSpecFieldPreemptionPolicy = \"preemptionPolicy\"\n\tStatefulSetSpecFieldReadinessGates = \"readinessGates\"\n\tStatefulSetSpecFieldRestartPolicy = \"restartPolicy\"\n\tStatefulSetSpecFieldRunAsGroup = \"runAsGroup\"\n\tStatefulSetSpecFieldRunAsNonRoot = \"runAsNonRoot\"\n\tStatefulSetSpecFieldRuntimeClassName = \"runtimeClassName\"\n\tStatefulSetSpecFieldScale = \"scale\"\n\tStatefulSetSpecFieldScheduling = \"scheduling\"\n\tStatefulSetSpecFieldSeccompProfile = \"seccompProfile\"\n\tStatefulSetSpecFieldSelector = \"selector\"\n\tStatefulSetSpecFieldServiceAccountName = \"serviceAccountName\"\n\tStatefulSetSpecFieldSetHostnameAsFQDN = \"setHostnameAsFQDN\"\n\tStatefulSetSpecFieldShareProcessNamespace = \"shareProcessNamespace\"\n\tStatefulSetSpecFieldStatefulSetConfig = \"statefulSetConfig\"\n\tStatefulSetSpecFieldSubdomain = \"subdomain\"\n\tStatefulSetSpecFieldSysctls = \"sysctls\"\n\tStatefulSetSpecFieldTerminationGracePeriodSeconds = \"terminationGracePeriodSeconds\"\n\tStatefulSetSpecFieldTopologySpreadConstraints = \"topologySpreadConstraints\"\n\tStatefulSetSpecFieldUid = \"uid\"\n\tStatefulSetSpecFieldVolumes = \"volumes\"\n\tStatefulSetSpecFieldWindowsOptions = \"windowsOptions\"\n)\n\ntype StatefulSetSpec struct {\n\tActiveDeadlineSeconds *int64 `json:\"activeDeadlineSeconds,omitempty\" yaml:\"activeDeadlineSeconds,omitempty\"`\n\tAutomountServiceAccountToken *bool `json:\"automountServiceAccountToken,omitempty\" yaml:\"automountServiceAccountToken,omitempty\"`\n\tContainers []Container `json:\"containers,omitempty\" yaml:\"containers,omitempty\"`\n\tDNSConfig *PodDNSConfig `json:\"dnsConfig,omitempty\" yaml:\"dnsConfig,omitempty\"`\n\tDNSPolicy string `json:\"dnsPolicy,omitempty\" yaml:\"dnsPolicy,omitempty\"`\n\tEnableServiceLinks *bool `json:\"enableServiceLinks,omitempty\" yaml:\"enableServiceLinks,omitempty\"`\n\tEphemeralContainers []EphemeralContainer `json:\"ephemeralContainers,omitempty\" yaml:\"ephemeralContainers,omitempty\"`\n\tFSGroupChangePolicy string `json:\"fsGroupChangePolicy,omitempty\" yaml:\"fsGroupChangePolicy,omitempty\"`\n\tFsgid *int64 `json:\"fsgid,omitempty\" yaml:\"fsgid,omitempty\"`\n\tGids []int64 `json:\"gids,omitempty\" yaml:\"gids,omitempty\"`\n\tHostAliases []HostAlias `json:\"hostAliases,omitempty\" yaml:\"hostAliases,omitempty\"`\n\tHostIPC bool `json:\"hostIPC,omitempty\" yaml:\"hostIPC,omitempty\"`\n\tHostNetwork bool `json:\"hostNetwork,omitempty\" yaml:\"hostNetwork,omitempty\"`\n\tHostPID bool `json:\"hostPID,omitempty\" yaml:\"hostPID,omitempty\"`\n\tHostname string `json:\"hostname,omitempty\" yaml:\"hostname,omitempty\"`\n\tImagePullSecrets []LocalObjectReference `json:\"imagePullSecrets,omitempty\" yaml:\"imagePullSecrets,omitempty\"`\n\tNodeID string `json:\"nodeId,omitempty\" yaml:\"nodeId,omitempty\"`\n\tObjectMeta *ObjectMeta `json:\"metadata,omitempty\" yaml:\"metadata,omitempty\"`\n\tOverhead map[string]string `json:\"overhead,omitempty\" yaml:\"overhead,omitempty\"`\n\tPreemptionPolicy string `json:\"preemptionPolicy,omitempty\" yaml:\"preemptionPolicy,omitempty\"`\n\tReadinessGates []PodReadinessGate `json:\"readinessGates,omitempty\" yaml:\"readinessGates,omitempty\"`\n\tRestartPolicy string `json:\"restartPolicy,omitempty\" yaml:\"restartPolicy,omitempty\"`\n\tRunAsGroup *int64 `json:\"runAsGroup,omitempty\" yaml:\"runAsGroup,omitempty\"`\n\tRunAsNonRoot *bool `json:\"runAsNonRoot,omitempty\" yaml:\"runAsNonRoot,omitempty\"`\n\tRuntimeClassName string `json:\"runtimeClassName,omitempty\" yaml:\"runtimeClassName,omitempty\"`\n\tScale *int64 `json:\"scale,omitempty\" yaml:\"scale,omitempty\"`\n\tScheduling *Scheduling `json:\"scheduling,omitempty\" yaml:\"scheduling,omitempty\"`\n\tSeccompProfile *SeccompProfile `json:\"seccompProfile,omitempty\" yaml:\"seccompProfile,omitempty\"`\n\tSelector *LabelSelector `json:\"selector,omitempty\" yaml:\"selector,omitempty\"`\n\tServiceAccountName string `json:\"serviceAccountName,omitempty\" yaml:\"serviceAccountName,omitempty\"`\n\tSetHostnameAsFQDN *bool `json:\"setHostnameAsFQDN,omitempty\" yaml:\"setHostnameAsFQDN,omitempty\"`\n\tShareProcessNamespace *bool `json:\"shareProcessNamespace,omitempty\" yaml:\"shareProcessNamespace,omitempty\"`\n\tStatefulSetConfig *StatefulSetConfig `json:\"statefulSetConfig,omitempty\" yaml:\"statefulSetConfig,omitempty\"`\n\tSubdomain string `json:\"subdomain,omitempty\" yaml:\"subdomain,omitempty\"`\n\tSysctls []Sysctl `json:\"sysctls,omitempty\" yaml:\"sysctls,omitempty\"`\n\tTerminationGracePeriodSeconds *int64 `json:\"terminationGracePeriodSeconds,omitempty\" yaml:\"terminationGracePeriodSeconds,omitempty\"`\n\tTopologySpreadConstraints []TopologySpreadConstraint `json:\"topologySpreadConstraints,omitempty\" yaml:\"topologySpreadConstraints,omitempty\"`\n\tUid *int64 `json:\"uid,omitempty\" yaml:\"uid,omitempty\"`\n\tVolumes []Volume `json:\"volumes,omitempty\" yaml:\"volumes,omitempty\"`\n\tWindowsOptions *WindowsSecurityContextOptions `json:\"windowsOptions,omitempty\" yaml:\"windowsOptions,omitempty\"`\n}\n", "meta": {"content_hash": "2c8148bdf5839f1bfa3f8340ae67bd26", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 157, "avg_line_length": 89.73863636363636, "alnum_prop": 0.609725212105863, "repo_name": "rancherio/rancher", "id": "f6c34d4ef8c3521031a7be0be14f8c275599d81f", "size": "7897", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "pkg/client/generated/project/v3/zz_generated_stateful_set_spec.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Python", "bytes": "6795"}, {"name": "Shell", "bytes": "25328"}]}} +{"text": "$LOAD_PATH.unshift './lib'\n\nrequire 'tilia/dav'\nrequire 'rack'\n\nTime.zone = 'Berlin'\n\ntestserver_root = File.join(File.dirname(__FILE__), 'testserver_root')\nDir.mkdir(testserver_root) unless File.exist?(testserver_root)\n\nfail \"could not create root directory #{testserver_root}\" unless File.directory?(testserver_root)\n\napp = proc do |env|\n root = Tilia::Dav::Fs::Directory.new(testserver_root)\n server = Tilia::Dav::Server.new(env, [root])\n\n server.add_plugin(Tilia::Dav::Browser::Plugin.new)\n\n server.exec\nend\n\nRack::Handler::WEBrick.run app\n", "meta": {"content_hash": "cc738eb13c043629a7de5cdba34238a4", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 97, "avg_line_length": 24.90909090909091, "alnum_prop": 0.7226277372262774, "repo_name": "tilia/tilia-dav", "id": "5777ca23fc049c5001c704b5f1a705f423fa19ca", "size": "627", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/minimal.rb", "mode": "33261", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "17084"}, {"name": "Ruby", "bytes": "1797621"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing iTextSharp.text;\nusing iTextSharp.text.pdf;\nusing SysAgropec.Class;\nusing SysAgropec.Models;\n\nnamespace SysAgropec.Class\n{\n public class Relatorio : RelatorioHelper\n {\n\n public override void MontaCorpoDados()\n {\n base.MontaCorpoDados();\n \n PdfPTable table = new PdfPTable(5);\n BaseColor preto = new BaseColor(0, 0, 0);\n BaseColor fundo = new BaseColor(200, 200, 200);\n Font font = FontFactory.GetFont(\"Verdana\", 8, Font.NORMAL, preto);\n Font titulo = FontFactory.GetFont(\"Verdana\", 8, Font.BOLD, preto);\n\n float[] colsW = { 10, 10, 10, 10, 10 };\n table.SetWidths(colsW);\n table.HeaderRows = 1;\n table.WidthPercentage = 100f;\n\n table.DefaultCell.Border = PdfPCell.BOTTOM_BORDER;\n table.DefaultCell.BorderColor = preto;\n table.DefaultCell.BorderColorBottom = new BaseColor(255, 255, 255);\n table.DefaultCell.Padding = 10;\n\n \n if (TipoRelatorio == 0) {\n\n table.AddCell(getNewCell(\"Animal\", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"Registro\", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"Tatuagem\", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"Sexo\", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"Cadastrado Em:\", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER, preto, fundo));\n\n\n AnimalViewModel a = new AnimalViewModel();\n\n HttpContext httpContext = HttpContext.Current;\n\n int idfazenda =Convert.ToInt16( httpContext.ApplicationInstance.Session[\"idfazenda\"].ToString());\n\n var animais = a.RelatorioAnimais(idfazenda, datIni, datFin);\n\n var animalOLD = 0;\n\n foreach(var an in animais)\n {\n\n if (an.Raca_ID != animalOLD)\n {\n var cell = getNewCell(\"Ra\u00e7a: \" + an.nomeraca, titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER);\n cell.Colspan = 5;\n table.AddCell(cell);\n animalOLD = an.Raca_ID;\n }\n\n table.AddCell(getNewCell(an.Descricao, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(an.Registro, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(an.Tatuagem, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(an.descriSexo, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(an.Datacadastro.ToString(\"dd/MM/yyyy\"), font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n\n }\n\n var cell2 = getNewCell(\"Filtros de Pesquisa \" + Filtros, titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER);\n cell2.Colspan = 5;\n table.AddCell(cell2);\n\n\n }\n else if(TipoRelatorio == 1)\n {\n table.AddCell(getNewCell(\"Medicamento\", titulo, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"Qtd M\u00ednima\", titulo, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"Qtd Atual\", titulo, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"Estocado Em:\", titulo, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"\", titulo, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER, preto, fundo));\n\n Estoque_MedicamentoViewModel a = new Estoque_MedicamentoViewModel();\n\n var es = a.RelatorioEstoque(datIni, datFin);\n \n foreach (var an in es)\n {\n \n table.AddCell(getNewCell(an.nomeMedicamento, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(Convert.ToString(an.Quantidademinima), font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(Convert.ToString(an.Quantidadeatual), font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(an.Data_Estocado.ToString(\"dd/MM/yyyy\"), font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(\"\", font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n \n }\n\n var cell2 = getNewCell(\"Filtros de Pesquisa \" + Filtros, titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER);\n cell2.Colspan = 5;\n table.AddCell(cell2);\n }\n else\n {\n table.AddCell(getNewCell(\"Data de Produ\u00e7\u00e3o\", titulo, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"Qtd (KG)\", titulo, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"Observa\u00e7\u00e3o\", titulo, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"\", titulo, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER, preto, fundo));\n table.AddCell(getNewCell(\"\", titulo, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER, preto, fundo));\n\n ProducaoViewModel prod = new ProducaoViewModel();\n\n var prods = prod.RelatorioAnimais(datIni, datFin);\n\n var prodOLD = 0;\n\n double totalProduzido = 0;\n double totalGeral = 0;\n int contador = 0;\n foreach (var pr in prods)\n {\n int quantidadeRegistros = prods.Count;\n contador++;\n\n if (pr.Animail_ID != prodOLD)\n {\n if (totalProduzido > 0)\n {\n var cell1 = getNewCell(\"Total produzido: \" + totalProduzido + \" KG\", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER);\n cell1.Colspan = 5;\n table.AddCell(cell1);\n totalGeral = totalGeral + totalProduzido;\n\n }\n\n var cell = getNewCell(\"Animal: \" + pr.nomeAnimal, titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER);\n cell.Colspan = 5;\n table.AddCell(cell);\n prodOLD = pr.Animail_ID;\n\n totalProduzido = 0;\n }\n\n table.AddCell(getNewCell(pr.Datarealizada.ToShortDateString(), font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(Convert.ToString(pr.Quantidade), font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(pr.Observacao, font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(\"\", font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n table.AddCell(getNewCell(\"\", font, Element.ALIGN_LEFT, 5, PdfPCell.BOTTOM_BORDER));\n totalProduzido = totalProduzido + pr.Quantidade;\n\n if (contador == quantidadeRegistros)\n {\n var cell1 = getNewCell(\"Total produzido: \" + totalProduzido + \" KG\", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER);\n cell1.Colspan = 5;\n table.AddCell(cell1);\n\n totalGeral = totalGeral + totalProduzido;\n }\n\n }\n\n var cell2 = getNewCell(\"Total Geral: \" + totalGeral + \" KG\", titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER);\n cell2.Colspan = 5;\n table.AddCell(cell2);\n\n var cell3 = getNewCell(\"Filtros de Pesquisa \" + Filtros, titulo, Element.ALIGN_LEFT, 10, PdfPCell.BOTTOM_BORDER);\n cell3.Colspan = 5;\n table.AddCell(cell3);\n \n }\n \n doc.Add(table);\n }\n\n \n }\n}", "meta": {"content_hash": "72caf857cf70fdea2f0fc8a19565d814", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 153, "avg_line_length": 48.049723756906076, "alnum_prop": 0.5604231344141658, "repo_name": "ThamiresMancilio/TCC", "id": "e9583029604166bff26f1623faab440c4cf337f6", "size": "8705", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SysAgropec/SysAgropec/Class/Relatorio.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "202"}, {"name": "C#", "bytes": "456820"}, {"name": "CSS", "bytes": "289439"}, {"name": "JavaScript", "bytes": "1398046"}, {"name": "PowerShell", "bytes": "177592"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!--NewPage-->\n<HTML>\n<HEAD>\n<!-- Generated by javadoc (build 1.6.0_29) on Sat Mar 17 18:06:03 MSK 2012 -->\n<TITLE>\nUses of Class org.apache.poi.hwpf.model.types.TBDAbstractType (POI API Documentation)\n</TITLE>\n\n<META NAME=\"date\" CONTENT=\"2012-03-17\">\n\n<LINK REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"../../../../../../../stylesheet.css\" TITLE=\"Style\">\n\n<SCRIPT type=\"text/javascript\">\nfunction windowTitle()\n{\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"Uses of Class org.apache.poi.hwpf.model.types.TBDAbstractType (POI API Documentation)\";\n }\n}\n</SCRIPT>\n<NOSCRIPT>\n</NOSCRIPT>\n\n</HEAD>\n\n<BODY BGCOLOR=\"white\" onload=\"windowTitle();\">\n<HR>\n\n\n<!-- ========= START OF TOP NAVBAR ======= -->\n<A NAME=\"navbar_top\"><!-- --></A>\n<A HREF=\"#skip-navbar_top\" title=\"Skip navigation links\"></A>\n<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"1\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR>\n<TD COLSPAN=2 BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\">\n<A NAME=\"navbar_top_firstrow\"><!-- --></A>\n<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\" SUMMARY=\"\">\n <TR ALIGN=\"center\" VALIGN=\"top\">\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../../overview-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../package-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Package</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../../org/apache/poi/hwpf/model/types/TBDAbstractType.html\" title=\"class in org.apache.poi.hwpf.model.types\"><FONT CLASS=\"NavBarFont1\"><B>Class</B></FONT></A> </TD>\n <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Use</B></FONT> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../package-tree.html\"><FONT CLASS=\"NavBarFont1\"><B>Tree</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../../deprecated-list.html\"><FONT CLASS=\"NavBarFont1\"><B>Deprecated</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../../index-all.html\"><FONT CLASS=\"NavBarFont1\"><B>Index</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../../help-doc.html\"><FONT CLASS=\"NavBarFont1\"><B>Help</B></FONT></A> </TD>\n </TR>\n</TABLE>\n</TD>\n<TD ALIGN=\"right\" VALIGN=\"top\" ROWSPAN=3><EM>\n</EM>\n</TD>\n</TR>\n\n<TR>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n PREV \n NEXT</FONT></TD>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n <A HREF=\"../../../../../../../index.html?org/apache/poi/hwpf/model/types/\\class-useTBDAbstractType.html\" target=\"_top\"><B>FRAMES</B></A> \n <A HREF=\"TBDAbstractType.html\" target=\"_top\"><B>NO FRAMES</B></A> \n <SCRIPT type=\"text/javascript\">\n <!--\n if(window==top) {\n document.writeln('<A HREF=\"../../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>');\n }\n //-->\n</SCRIPT>\n<NOSCRIPT>\n <A HREF=\"../../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>\n</NOSCRIPT>\n\n\n</FONT></TD>\n</TR>\n</TABLE>\n<A NAME=\"skip-navbar_top\"></A>\n<!-- ========= END OF TOP NAVBAR ========= -->\n\n<HR>\n<CENTER>\n<H2>\n<B>Uses of Class<br>org.apache.poi.hwpf.model.types.TBDAbstractType</B></H2>\n</CENTER>\n\n<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR BGCOLOR=\"#CCCCFF\" CLASS=\"TableHeadingColor\">\n<TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\">\nPackages that use <A HREF=\"../../../../../../../org/apache/poi/hwpf/model/types/TBDAbstractType.html\" title=\"class in org.apache.poi.hwpf.model.types\">TBDAbstractType</A></FONT></TH>\n</TR>\n<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">\n<TD><A HREF=\"#org.apache.poi.hwpf.model\"><B>org.apache.poi.hwpf.model</B></A></TD>\n<TD> </TD>\n</TR>\n</TABLE>\n \n<P>\n<A NAME=\"org.apache.poi.hwpf.model\"><!-- --></A>\n<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR BGCOLOR=\"#CCCCFF\" CLASS=\"TableHeadingColor\">\n<TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\">\nUses of <A HREF=\"../../../../../../../org/apache/poi/hwpf/model/types/TBDAbstractType.html\" title=\"class in org.apache.poi.hwpf.model.types\">TBDAbstractType</A> in <A HREF=\"../../../../../../../org/apache/poi/hwpf/model/package-summary.html\">org.apache.poi.hwpf.model</A></FONT></TH>\n</TR>\n</TABLE>\n \n<P>\n\n<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR BGCOLOR=\"#CCCCFF\" CLASS=\"TableSubHeadingColor\">\n<TH ALIGN=\"left\" COLSPAN=\"2\">Subclasses of <A HREF=\"../../../../../../../org/apache/poi/hwpf/model/types/TBDAbstractType.html\" title=\"class in org.apache.poi.hwpf.model.types\">TBDAbstractType</A> in <A HREF=\"../../../../../../../org/apache/poi/hwpf/model/package-summary.html\">org.apache.poi.hwpf.model</A></FONT></TH>\n</TR>\n<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">\n<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">\n<CODE> class</CODE></FONT></TD>\n<TD><CODE><B><A HREF=\"../../../../../../../org/apache/poi/hwpf/model/TabDescriptor.html\" title=\"class in org.apache.poi.hwpf.model\">TabDescriptor</A></B></CODE>\n\n<BR>\n Tab descriptor.</TD>\n</TR>\n</TABLE>\n \n<P>\n<HR>\n\n\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<A NAME=\"navbar_bottom\"><!-- --></A>\n<A HREF=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></A>\n<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"1\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR>\n<TD COLSPAN=2 BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\">\n<A NAME=\"navbar_bottom_firstrow\"><!-- --></A>\n<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\" SUMMARY=\"\">\n <TR ALIGN=\"center\" VALIGN=\"top\">\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../../overview-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../package-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Package</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../../org/apache/poi/hwpf/model/types/TBDAbstractType.html\" title=\"class in org.apache.poi.hwpf.model.types\"><FONT CLASS=\"NavBarFont1\"><B>Class</B></FONT></A> </TD>\n <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Use</B></FONT> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../package-tree.html\"><FONT CLASS=\"NavBarFont1\"><B>Tree</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../../deprecated-list.html\"><FONT CLASS=\"NavBarFont1\"><B>Deprecated</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../../index-all.html\"><FONT CLASS=\"NavBarFont1\"><B>Index</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../../help-doc.html\"><FONT CLASS=\"NavBarFont1\"><B>Help</B></FONT></A> </TD>\n </TR>\n</TABLE>\n</TD>\n<TD ALIGN=\"right\" VALIGN=\"top\" ROWSPAN=3><EM>\n</EM>\n</TD>\n</TR>\n\n<TR>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n PREV \n NEXT</FONT></TD>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n <A HREF=\"../../../../../../../index.html?org/apache/poi/hwpf/model/types/\\class-useTBDAbstractType.html\" target=\"_top\"><B>FRAMES</B></A> \n <A HREF=\"TBDAbstractType.html\" target=\"_top\"><B>NO FRAMES</B></A> \n <SCRIPT type=\"text/javascript\">\n <!--\n if(window==top) {\n document.writeln('<A HREF=\"../../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>');\n }\n //-->\n</SCRIPT>\n<NOSCRIPT>\n <A HREF=\"../../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>\n</NOSCRIPT>\n\n\n</FONT></TD>\n</TR>\n</TABLE>\n<A NAME=\"skip-navbar_bottom\"></A>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n\n<HR>\n\n <i>Copyright 2012 The Apache Software Foundation or\n its licensors, as applicable.</i>\n \n</BODY>\n</HTML>\n", "meta": {"content_hash": "a5471c70fcd296c6061c079a61600013", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 318, "avg_line_length": 44.43715846994535, "alnum_prop": 0.6158386620757501, "repo_name": "Stephania16/ProductDesignGame", "id": "d17b86608108f73dd5441560fa2b281c0fad0e56", "size": "8132", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MinimaxAlgorithm/poi-3.8/docs/apidocs/org/apache/poi/hwpf/model/types/class-use/TBDAbstractType.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "15337"}, {"name": "HTML", "bytes": "74071650"}, {"name": "Java", "bytes": "37924"}]}} +{"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.11\"/>\n<title>V8 API Reference Guide for node.js v8.6.0: Member List</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/searchdata.js\"></script>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(function() { init_search(); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n <td id=\"projectalign\" style=\"padding-left: 0.5em;\">\n <div id=\"projectname\">V8 API Reference Guide for node.js v8.6.0\n </div>\n </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.11 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n <div id=\"navrow1\" class=\"tabs\">\n <ul class=\"tablist\">\n <li><a href=\"index.html\"><span>Main Page</span></a></li>\n <li><a href=\"namespaces.html\"><span>Namespaces</span></a></li>\n <li class=\"current\"><a href=\"annotated.html\"><span>Classes</span></a></li>\n <li><a href=\"files.html\"><span>Files</span></a></li>\n <li><a href=\"examples.html\"><span>Examples</span></a></li>\n <li>\n <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n <span class=\"left\">\n <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n alt=\"\"/>\n <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n onblur=\"searchBox.OnSearchFieldFocus(false)\" \n onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n </span><span class=\"right\">\n <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n </span>\n </div>\n </li>\n </ul>\n </div>\n <div id=\"navrow2\" class=\"tabs2\">\n <ul class=\"tablist\">\n <li><a href=\"annotated.html\"><span>Class List</span></a></li>\n <li><a href=\"classes.html\"><span>Class Index</span></a></li>\n <li><a href=\"inherits.html\"><span>Class Hierarchy</span></a></li>\n <li><a href=\"functions.html\"><span>Class Members</span></a></li>\n </ul>\n </div>\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n</div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div id=\"nav-path\" class=\"navpath\">\n <ul>\n<li class=\"navelem\"><a class=\"el\" href=\"namespacev8.html\">v8</a></li><li class=\"navelem\"><a class=\"el\" href=\"classv8_1_1Task.html\">Task</a></li> </ul>\n</div>\n</div><!-- top -->\n<div class=\"header\">\n <div class=\"headertitle\">\n<div class=\"title\">v8::Task Member List</div> </div>\n</div><!--header-->\n<div class=\"contents\">\n\n<p>This is the complete list of members for <a class=\"el\" href=\"classv8_1_1Task.html\">v8::Task</a>, including all inherited members.</p>\n<table class=\"directory\">\n <tr bgcolor=\"#f0f0f0\" class=\"even\"><td class=\"entry\"><b>Run</b>()=0 (defined in <a class=\"el\" href=\"classv8_1_1Task.html\">v8::Task</a>)</td><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Task.html\">v8::Task</a></td><td class=\"entry\"><span class=\"mlabel\">pure virtual</span></td></tr>\n <tr bgcolor=\"#f0f0f0\"><td class=\"entry\"><b>~Task</b>()=default (defined in <a class=\"el\" href=\"classv8_1_1Task.html\">v8::Task</a>)</td><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Task.html\">v8::Task</a></td><td class=\"entry\"><span class=\"mlabel\">virtual</span></td></tr>\n</table></div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by  <a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.11\n</small></address>\n</body>\n</html>\n", "meta": {"content_hash": "39c70ece54199c42a55df6c4f32976e1", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 287, "avg_line_length": 45.583333333333336, "alnum_prop": 0.6416819012797075, "repo_name": "v8-dox/v8-dox.github.io", "id": "deb53b715e952cd65334a43479530468d409c8ba", "size": "4923", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "2e75ac0/html/classv8_1_1Task-members.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "title: Telerik.Web.UI.BreadcrumbClientEvents\npage_title: Telerik.Web.UI.BreadcrumbClientEvents\ndescription: Telerik.Web.UI.BreadcrumbClientEvents\n---\n\n# Telerik.Web.UI.BreadcrumbClientEvents\n\nDefines the client events handlers.\n\n## Inheritance Hierarchy\n\n* System.Object\n* Telerik.Web.StateManager : IMarkableStateManager, IStateManager\n* Telerik.Web.UI.BreadcrumbClientEvents : IDefaultCheck\n\n## Properties\n\n### OnChange `String`\n\nFires when the value of the Breadcrumb is changed.\n\n### OnClick `String`\n\nFires when an item or a rootitem is clicked.\n\n### OnInitialize `String`\n\nFired when the control is initialized.\n\n### OnLoad `String`\n\nFired when the control is loaded on the page.\n\n", "meta": {"content_hash": "539d82a9eace8e95fd39b98e2a7a51de", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 65, "avg_line_length": 20.939393939393938, "alnum_prop": 0.7771345875542692, "repo_name": "telerik/ajax-docs", "id": "9ed81c353cab7bd85a80dae4e117517da68b1dcc", "size": "695", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "api/server/Telerik.Web.UI/BreadcrumbClientEvents.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ASP.NET", "bytes": "2253"}, {"name": "C#", "bytes": "6026"}, {"name": "HTML", "bytes": "2240"}, {"name": "JavaScript", "bytes": "3052"}, {"name": "Ruby", "bytes": "3275"}]}} +{"text": "<div class=\"mdl-grid\">\n <div class=\"mdl-layout-spacer\">\n </div>\n <div class=\"mdl-cell mdl-cell--4-col\">\n <div class=\"mdl-card mdl-shadow--2dp\">\n <form name=\"confirmFulfillment\" novalidate>\n <h3>Confirm Alumni Request Fulfillment for {{ orgName }}</h3>\n <div class=\"mdl-textfield mdl-js-textfield\">\n <textarea class=\"mdl-textfield__input\" type=\"text\" ng-model=\"alumniNames\" placeholder=\"Names of alumni that you have chosen (each on a different line)\" required>\n </textarea>\n </div>\n <div class=\"mdl-textfield mdl-js-textfield\">\n <textarea class=\"mdl-textfield__input\" type=\"text\" ng-model=\"alumniEmails\" placeholder=\"Their emails in same order (each on a different line)\" required>\n </textarea>\n </div>\n <button ng-disabled=\"confirmFulfillment.$invalid || numAlumni == 0\" class=\"mdl-button mdl-shadow--2dp\" ng-click=\"fulfill()\">Fulfill!</button>\n </form>\n </div>\n </div>\n <div class=\"mdl-layout-spacer\"></div>\n</div>", "meta": {"content_hash": "37b1b71329d7140fa7e3398826ce9590", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 181, "avg_line_length": 54.333333333333336, "alnum_prop": 0.5705521472392638, "repo_name": "Srokit/UMStudentOrgAlumniRequestGW", "id": "f30aa6f95d353d63fd15f114f38adc2643c62c84", "size": "1141", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ng_app/comps/fulfillrequest/fulfillrequest.view.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "185"}, {"name": "HTML", "bytes": "34247"}, {"name": "JavaScript", "bytes": "52993"}]}} +{"text": "package site.zhangqun.lanagina;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n @Test\n public void addition_isCorrect() throws Exception {\n assertEquals(4, 2 + 2);\n }\n}", "meta": {"content_hash": "e86e6b6ab3a8a1123bf2670896f0a35a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 81, "avg_line_length": 23.529411764705884, "alnum_prop": 0.6925, "repo_name": "uffuff/LSMS", "id": "9f5f92f824d0df4c8377375ec92eb1f17b931b70", "size": "400", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/test/java/site/zhangqun/lanagina/ExampleUnitTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "61834"}, {"name": "Groovy", "bytes": "11701"}, {"name": "HTML", "bytes": "255867"}, {"name": "Java", "bytes": "149374"}, {"name": "JavaScript", "bytes": "186353"}, {"name": "PHP", "bytes": "2333"}]}} +{"text": "\"\"\"\n relief.schema.meta\n ~~~~~~~~~~~~~~~~~~\n\n :copyright: 2013 by Daniel Neuh\u00e4user\n :license: BSD, see LICENSE.rst for details\n\"\"\"\nfrom relief.utils import class_cloner\nfrom relief.constants import Unspecified\nfrom relief.schema.core import BaseElement\n\n\nclass Maybe(BaseElement):\n \"\"\"\n A meta element that represents an element that is optional. The value of\n this element will be `None` unless the contained element's value is not\n `Unspecified`.\n\n >>> from relief import Unicode\n >>> Maybe.of(Unicode)().value\n None\n >>> Maybe.of(Unicode)(u'foobar').value\n u'foobar\n\n .. versionadded:: 2.1.0\n \"\"\"\n member_schema = None\n\n @class_cloner\n def of(cls, schema):\n cls.member_schema = schema\n return cls\n\n def __init__(self, value=Unspecified):\n self.member = self.member_schema()\n super(Maybe, self).__init__(value)\n if self.member_schema is None:\n raise TypeError('member_schema is unknown')\n\n @property\n def value(self):\n return None if self.member.value is Unspecified else self.member.value\n\n @value.setter\n def value(self, new_value):\n if new_value is not Unspecified:\n raise AttributeError(\"can't set attribute\")\n\n def serialize(self, value):\n if value is None:\n return Unspecified\n return self.member.serialize(value)\n\n def unserialize(self, raw_value):\n value = self.member.unserialize(raw_value)\n return None if value is Unspecified else value\n\n def set_from_raw(self, raw_value):\n self.raw_value = raw_value\n value = self.unserialize(raw_value)\n if value is None:\n self.member.set_from_raw(Unspecified)\n else:\n self.member.set_from_raw(raw_value)\n self.is_valid = None\n\n def set_from_native(self, value):\n self.member.set_from_native(value)\n self.raw_value = self.member.raw_value\n self.is_valid = None\n\n def validate(self, context=None):\n if context is None:\n context = {}\n self.is_valid = self.member.validate() or self.value is None\n return self.is_valid\n", "meta": {"content_hash": "bbc965975be60db1f6c19f3ada479c22", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 78, "avg_line_length": 28.539473684210527, "alnum_prop": 0.6251728907330567, "repo_name": "DasIch/relief", "id": "3587702365831b464512bf75714095614e3c9290", "size": "2186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "relief/schema/meta.py", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Python", "bytes": "117437"}, {"name": "Shell", "bytes": "6701"}]}} +{"text": "package serialization\n\nimport (\n\t\"github.com/cloudfoundry-incubator/receptor\"\n\t\"github.com/cloudfoundry-incubator/runtime-schema/models\"\n)\n\nfunc ActualLRPToResponse(actualLRP models.ActualLRP, evacuating bool) receptor.ActualLRPResponse {\n\treturn receptor.ActualLRPResponse{\n\t\tProcessGuid: actualLRP.ProcessGuid,\n\t\tInstanceGuid: actualLRP.InstanceGuid,\n\t\tCellID: actualLRP.CellID,\n\t\tDomain: actualLRP.Domain,\n\t\tIndex: actualLRP.Index,\n\t\tAddress: actualLRP.Address,\n\t\tPorts: PortMappingFromModel(actualLRP.Ports),\n\t\tState: actualLRPStateToResponseState(actualLRP.State),\n\t\tPlacementError: actualLRP.PlacementError,\n\t\tSince: actualLRP.Since,\n\t\tCrashCount: actualLRP.CrashCount,\n\t\tCrashReason: actualLRP.CrashReason,\n\t\tEvacuating: evacuating,\n\t\tModificationTag: actualLRPModificationTagToResponseModificationTag(actualLRP.ModificationTag),\n\t}\n}\n\nfunc actualLRPStateToResponseState(state models.ActualLRPState) receptor.ActualLRPState {\n\tswitch state {\n\tcase models.ActualLRPStateUnclaimed:\n\t\treturn receptor.ActualLRPStateUnclaimed\n\tcase models.ActualLRPStateClaimed:\n\t\treturn receptor.ActualLRPStateClaimed\n\tcase models.ActualLRPStateRunning:\n\t\treturn receptor.ActualLRPStateRunning\n\tcase models.ActualLRPStateCrashed:\n\t\treturn receptor.ActualLRPStateCrashed\n\tdefault:\n\t\treturn receptor.ActualLRPStateInvalid\n\t}\n}\n\nfunc actualLRPModificationTagToResponseModificationTag(modificationTag models.ModificationTag) receptor.ModificationTag {\n\treturn receptor.ModificationTag{\n\t\tEpoch: modificationTag.Epoch,\n\t\tIndex: modificationTag.Index,\n\t}\n}\n", "meta": {"content_hash": "081f0633d2a532b022420bf0e8d0a3ee", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 121, "avg_line_length": 34.59574468085106, "alnum_prop": 0.7878228782287823, "repo_name": "mikegehard/lattice", "id": "f902410a95f756fb23089e415597384a13835119", "size": "1626", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ltc/Godeps/_workspace/src/github.com/cloudfoundry-incubator/receptor/serialization/actual_lrps.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Go", "bytes": "345389"}, {"name": "Shell", "bytes": "43093"}]}} +{"text": "\n\npackage org.apache.webapp.admin.realm;\n\nimport java.io.IOException;\nimport java.net.URLEncoder;\nimport java.util.Locale;\nimport java.util.ArrayList;\nimport javax.servlet.ServletException;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport javax.servlet.http.HttpSession;\nimport org.apache.struts.action.Action;\nimport org.apache.struts.action.ActionErrors;\nimport org.apache.struts.action.ActionForm;\nimport org.apache.struts.action.ActionForward;\nimport org.apache.struts.action.ActionMapping;\nimport org.apache.struts.util.MessageResources;\nimport org.apache.webapp.admin.LabelValueBean;\nimport org.apache.webapp.admin.Lists;\n\n/**\n * The <code>Action</code> that sets up <em>Add Realm</em> transactions.\n *\n * @author Manveen Kaur\n * @version $Revision: 1.5 $ $Date: 2002/08/13 22:35:20 $\n */\n\npublic class AddRealmAction extends Action {\n\n /**\n * The MessageResources we will be retrieving messages from.\n */\n private MessageResources resources = null;\n\n // the list for types of realms\n private ArrayList types = null;\n\n // --------------------------------------------------------- Public Methods\n\n /**\n * Process the specified HTTP request, and create the corresponding HTTP\n * response (or forward to another web component that will create it).\n * Return an <code>ActionForward</code> instance describing where and how\n * control should be forwarded, or <code>null</code> if the response has\n * already been completed.\n *\n * @param mapping The ActionMapping used to select this instance\n * @param actionForm The optional ActionForm bean for this request (if any)\n * @param request The HTTP request we are processing\n * @param response The HTTP response we are creating\n *\n * @exception IOException if an input/output error occurs\n * @exception ServletException if a servlet exception occurs\n */\n public ActionForward perform(ActionMapping mapping,\n ActionForm form,\n HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n\n // Acquire the resources that we need\n HttpSession session = request.getSession();\n Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);\n if (resources == null) {\n resources = getServlet().getResources();\n }\n\n // Fill in the form values for display and editing\n\n String realmTypes[] = new String[4];\n realmTypes[0] = \"UserDatabaseRealm\";\n realmTypes[1] = \"JNDIRealm\";\n realmTypes[2] = \"MemoryRealm\";\n realmTypes[3] = \"JDBCRealm\";\n\n String parent = request.getParameter(\"parent\");\n String type = request.getParameter(\"type\");\n if (type == null)\n type = \"UserDatabaseRealm\"; // default type is UserDatabaseRealm\n\n types = new ArrayList();\n // the first element in the select list should be the type selected\n types.add(new LabelValueBean(type,\n \"/admin/AddRealm.do?parent=\" + URLEncoder.encode(parent)\n + \"&type=\" + type));\n for (int i=0; i< realmTypes.length; i++) {\n if (!type.equalsIgnoreCase(realmTypes[i])) {\n types.add(new LabelValueBean(realmTypes[i],\n \"/admin/AddRealm.do?parent=\" + URLEncoder.encode(parent)\n + \"&type=\" + realmTypes[i]));\n }\n }\n\n if (\"UserDatabaseRealm\".equalsIgnoreCase(type)) {\n createUserDatabaseRealm(session, parent);\n } else if (\"JNDIRealm\".equalsIgnoreCase(type)) {\n createJNDIRealm(session, parent);\n } else if (\"MemoryRealm\".equalsIgnoreCase(type)) {\n createMemoryRealm(session, parent);\n } else {\n //JDBC\n createJDBCRealm(session, parent);\n }\n // Forward to the realm display page\n return (mapping.findForward(type));\n\n }\n\n private void createUserDatabaseRealm(HttpSession session, String parent) {\n\n UserDatabaseRealmForm realmFm = new UserDatabaseRealmForm();\n session.setAttribute(\"userDatabaseRealmForm\", realmFm);\n realmFm.setAdminAction(\"Create\");\n realmFm.setObjectName(\"\");\n realmFm.setParentObjectName(parent);\n String realmType = \"UserDatabaseRealm\";\n realmFm.setNodeLabel(\"Realm (\" + realmType + \")\");\n realmFm.setRealmType(realmType);\n realmFm.setDebugLvl(\"0\");\n realmFm.setResource(\"\");\n realmFm.setDebugLvlVals(Lists.getDebugLevels());\n realmFm.setRealmTypeVals(types);\n }\n\n private void createJNDIRealm(HttpSession session, String parent) {\n\n JNDIRealmForm realmFm = new JNDIRealmForm();\n session.setAttribute(\"jndiRealmForm\", realmFm);\n realmFm.setAdminAction(\"Create\");\n realmFm.setObjectName(\"\");\n realmFm.setParentObjectName(parent);\n String realmType = \"JNDIRealm\";\n realmFm.setNodeLabel(\"Realm (\" + realmType + \")\");\n realmFm.setRealmType(realmType);\n realmFm.setDebugLvl(\"0\");\n realmFm.setDigest(\"\");\n realmFm.setRoleBase(\"\");\n realmFm.setUserSubtree(\"false\");\n realmFm.setRoleSubtree(\"false\");\n realmFm.setRolePattern(\"\");\n realmFm.setUserRoleName(\"\");\n realmFm.setRoleName(\"\");\n realmFm.setRoleBase(\"\");\n realmFm.setContextFactory(\"\");\n realmFm.setUserBase(\"\");\n realmFm.setUserPattern(\"\");\n realmFm.setUserSearch(\"\");\n realmFm.setUserPassword(\"\");\n realmFm.setConnectionName(\"\");\n realmFm.setConnectionPassword(\"\");\n realmFm.setConnectionURL(\"\");\n realmFm.setDebugLvlVals(Lists.getDebugLevels());\n realmFm.setSearchVals(Lists.getBooleanValues());\n realmFm.setRealmTypeVals(types);\n }\n\n private void createMemoryRealm(HttpSession session, String parent) {\n\n MemoryRealmForm realmFm = new MemoryRealmForm();\n session.setAttribute(\"memoryRealmForm\", realmFm);\n realmFm.setAdminAction(\"Create\");\n realmFm.setObjectName(\"\");\n realmFm.setParentObjectName(parent);\n String realmType = \"MemoryRealm\";\n realmFm.setNodeLabel(\"Realm (\" + realmType + \")\");\n realmFm.setRealmType(realmType);\n realmFm.setDebugLvl(\"0\");\n realmFm.setPathName(\"\");\n realmFm.setDebugLvlVals(Lists.getDebugLevels());\n realmFm.setRealmTypeVals(types);\n }\n\n private void createJDBCRealm(HttpSession session, String parent) {\n\n JDBCRealmForm realmFm = new JDBCRealmForm();\n session.setAttribute(\"jdbcRealmForm\", realmFm);\n realmFm.setAdminAction(\"Create\");\n realmFm.setObjectName(\"\");\n realmFm.setParentObjectName(parent);\n String realmType = \"JDBCRealm\";\n realmFm.setNodeLabel(\"Realm (\" + realmType + \")\");\n realmFm.setRealmType(realmType);\n realmFm.setDebugLvl(\"0\");\n realmFm.setDigest(\"\");\n realmFm.setDriver(\"\");\n realmFm.setRoleNameCol(\"\");\n realmFm.setPasswordCol(\"\");\n realmFm.setUserTable(\"\");\n realmFm.setRoleTable(\"\");\n realmFm.setConnectionName(\"\");\n realmFm.setConnectionPassword(\"\");\n realmFm.setConnectionURL(\"\");\n realmFm.setDebugLvlVals(Lists.getDebugLevels());\n realmFm.setRealmTypeVals(types);\n }\n\n\n\n}\n", "meta": {"content_hash": "9f59cebd16b0faf2a91280e5b5d50f57", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 79, "avg_line_length": 37.285, "alnum_prop": 0.6403379375083814, "repo_name": "devjin24/howtomcatworks", "id": "f653b9093fbad4c95195360a324d63168ce11c8e", "size": "10327", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "bookrefer/jakarta-tomcat-4.1.12-src/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/AddRealmAction.java", "mode": "33261", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "52224"}, {"name": "C", "bytes": "2123859"}, {"name": "C++", "bytes": "5454"}, {"name": "CSS", "bytes": "4762"}, {"name": "HTML", "bytes": "232523"}, {"name": "Java", "bytes": "25349050"}, {"name": "Makefile", "bytes": "2331"}, {"name": "NSIS", "bytes": "25933"}, {"name": "Perl", "bytes": "100975"}, {"name": "Shell", "bytes": "49871"}, {"name": "Visual Basic", "bytes": "9998"}, {"name": "XSLT", "bytes": "27566"}]}} +{"text": "<TS language=\"nl\" version=\"2.0\">\n<defaultcodec>UTF-8</defaultcodec>\n<context>\n <name>AboutDialog</name>\n <message>\n <source>About Lambocoin</source>\n <translation>Over Lambocoin</translation>\n </message>\n <message>\n <source><b>Lambocoin</b> version</source>\n <translation><html><head/><body><p><span style=\" font-weight:600;\">Lambocoin</span></p></body></html></translation>\n </message>\n </context>\n<context>\n <name>AddressBookPage</name>\n <message>\n <source>Address Book</source>\n <translation>Adresboek</translation>\n </message>\n <message>\n <source>These are your Lambocoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>\n <translation>Dit zijn je Lambocoin adressen om bedragen te ontvangen. Je kan een verschillend adres opgeven voor iedere geaddresseerde zodat je kan achterhalen wie jouw betaalt.</translation>\n </message>\n <message>\n <source>Double-click to edit address or label</source>\n <translation>Dubbelklik om adres of label te wijzigen</translation>\n </message>\n <message>\n <source>Create a new address</source>\n <translation>Maak een nieuw adres aan</translation>\n </message>\n <message>\n <source>Copy the currently selected address to the system clipboard</source>\n <translation>Kopieer het huidig geselecteerde adres naar het klembord</translation>\n </message>\n <message>\n <source>&New Address</source>\n <translation>&Nieuw Adres</translation>\n </message>\n <message>\n <source>&Copy Address</source>\n <translation>&Kopieer Adres</translation>\n </message>\n <message>\n <source>Show &QR Code</source>\n <translation>Toon &QR-Code</translation>\n </message>\n <message>\n <source>Sign a message to prove you own this address</source>\n <translation>Onderteken een bericht om te bewijzen dat u dit adres bezit</translation>\n </message>\n <message>\n <source>&Sign Message</source>\n <translation>&Onderteken Bericht</translation>\n </message>\n <message>\n <source>Delete the currently selected address from the list. Only sending addresses can be deleted.</source>\n <translation>Verwijder het huidige geselecteerde adres van de lijst. Alleen verzend-adressen kunnen verwijderd worden, niet uw ontvangstadressen.</translation>\n </message>\n <message>\n <source>&Delete</source>\n <translation>&Verwijder</translation>\n </message>\n <message>\n <source>Copy &Label</source>\n <translation>Kopieer &Label</translation>\n </message>\n <message>\n <source>&Edit</source>\n <translation>&Bewerken</translation>\n </message>\n <message>\n <source>Export Address Book Data</source>\n <translation>Exporteer Gegevens van het Adresboek</translation>\n </message>\n <message>\n <source>Comma separated file (*.csv)</source>\n <translation>Kommagescheiden bestand (*.csv)</translation>\n </message>\n <message>\n <source>Error exporting</source>\n <translation>Fout bij exporteren</translation>\n </message>\n <message>\n <source>Could not write to file %1.</source>\n <translation>Kon niet schrijven naar bestand %1.</translation>\n </message>\n</context>\n<context>\n <name>AddressTableModel</name>\n <message>\n <source>Label</source>\n <translation>Label</translation>\n </message>\n <message>\n <source>Address</source>\n <translation>Adres</translation>\n </message>\n <message>\n <source>(no label)</source>\n <translation>(geen label)</translation>\n </message>\n </context>\n<context>\n <name>AskPassphraseDialog</name>\n <message>\n <source>Enter passphrase</source>\n <translation>Huidige wachtwoordzin</translation>\n </message>\n <message>\n <source>New passphrase</source>\n <translation>Nieuwe wachtwoordzin</translation>\n </message>\n <message>\n <source>Repeat new passphrase</source>\n <translation>Herhaal wachtwoordzin</translation>\n </message>\n <message>\n <source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>\n <translation>Vul een nieuw wachtwoord in voor uw portemonnee. <br/> Gebruik een wachtwoord van <b>10 of meer lukrake karakters</b>, of <b> acht of meer woorden</b> . </translation>\n </message>\n <message>\n <source>Encrypt wallet</source>\n <translation>Versleutel portemonnee</translation>\n </message>\n <message>\n <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n <translation>Deze operatie vereist uw portemonnee wachtwoordzin om de portemonnee te openen.</translation>\n </message>\n <message>\n <source>Unlock wallet</source>\n <translation>Open portemonnee</translation>\n </message>\n <message>\n <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n <translation>Deze operatie vereist uw portemonnee wachtwoordzin om de portemonnee te ontsleutelen</translation>\n </message>\n <message>\n <source>Decrypt wallet</source>\n <translation>Ontsleutel portemonnee</translation>\n </message>\n <message>\n <source>Change passphrase</source>\n <translation>Wijzig de wachtwoordzin</translation>\n </message>\n <message>\n <source>Confirm wallet encryption</source>\n <translation>Bevestig versleuteling van de portemonnee</translation>\n </message>\n <message>\n <source>Wallet encrypted</source>\n <translation>Portemonnee versleuteld</translation>\n </message>\n <message>\n <source>Warning: The Caps Lock key is on.</source>\n <translation>Waarschuwing: De Caps-Lock-toets staat aan.</translation>\n </message>\n <message>\n <source>Wallet encryption failed</source>\n <translation>Portemonneeversleuteling mislukt</translation>\n </message>\n <message>\n <source>WARNING: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR PAYCOINS</b>!\nAre you sure you wish to encrypt your wallet?</source>\n <translation>WAARSCHUWING: Indien je de portemonnee versleutelt en je wachtwoordzin verliest, dan verlies je <b> AL JE PAYCOINS</b>!\nWeet je zeker dat je de portemonee wilt versleutelen?</translation>\n </message>\n <message>\n <source>Lambocoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Lambocoins from being stolen by malware infecting your computer.</source>\n <translation>Lambocoin sluit nu af om het versleutelings proces te beeindigen. Onthoud dat het versleutelen van de portemonnee je Lambocoins niet volledig kan beschermen tegen schadelijke software op een geinfecteerde computer</translation>\n </message>\n <message>\n <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n <translation>Portemonneeversleuteling mislukt door een interne fout. Uw portemonnee is niet versleuteld.</translation>\n </message>\n <message>\n <source>The supplied passphrases do not match.</source>\n <translation>De opgegeven wachtwoordzin is niet correct</translation>\n </message>\n <message>\n <source>Wallet unlock failed</source>\n <translation>Portemonnee openen mislukt</translation>\n </message>\n <message>\n <source>The passphrase entered for the wallet decryption was incorrect.</source>\n <translation>De opgegeven wachtwoordzin voor de portemonnee-ontsleuteling is niet correct.</translation>\n </message>\n <message>\n <source>Wallet decryption failed</source>\n <translation>Portemonnee-ontsleuteling mislukt</translation>\n </message>\n <message>\n <source>Wallet passphrase was successfully changed.</source>\n <translation>Portemonnee wachtwoordzin is succesvol gewijzigd</translation>\n </message>\n</context>\n<context>\n <name>BitcoinGUI</name>\n <message>\n <source>&Overview</source>\n <translation>&Overzicht</translation>\n </message>\n <message>\n <source>Show general overview of wallet</source>\n <translation>Toon algemeen overzicht van de portemonnee</translation>\n </message>\n <message>\n <source>&Transactions</source>\n <translation>&Transacties</translation>\n </message>\n <message>\n <source>Browse transaction history</source>\n <translation>Blader door transactieverleden</translation>\n </message>\n <message>\n <source>&Address Book</source>\n <translation>&Adresboek</translation>\n </message>\n <message>\n <source>Edit the list of stored addresses and labels</source>\n <translation>Bewerk de lijst van opgeslagen adressen en labels</translation>\n </message>\n <message>\n <source>&Receive coins</source>\n <translation>&Ontvang munten</translation>\n </message>\n <message>\n <source>Show the list of addresses for receiving payments</source>\n <translation>Toon lijst van betalingsadressen</translation>\n </message>\n <message>\n <source>&Send coins</source>\n <translation>&Verstuur munten</translation>\n </message>\n <message>\n <source>Prove you control an address</source>\n <translation>Bewijs dat u een adres bezit</translation>\n </message>\n <message>\n <source>E&xit</source>\n <translation>&Afsluiten</translation>\n </message>\n <message>\n <source>Quit application</source>\n <translation>Programma afsluiten</translation>\n </message>\n <message>\n <source>Show information about Lambocoin</source>\n <translation>Toon informatie over Lambocoin</translation>\n </message>\n <message>\n <source>About &Qt</source>\n <translation>Over &Qt</translation>\n </message>\n <message>\n <source>Show information about Qt</source>\n <translation>Toon informatie over Qt</translation>\n </message>\n <message>\n <source>&Options...</source>\n <translation>&Opties...</translation>\n </message>\n <message>\n <source>&Export...</source>\n <translation>&Exporteer...</translation>\n </message>\n <message>\n <source>Export the data in the current tab to a file</source>\n <translation>Exporteer de data in de huidige tab naar een bestand</translation>\n </message>\n <message>\n <source>Encrypt or decrypt wallet</source>\n <translation>Versleutel of ontsleutel portemonnee</translation>\n </message>\n <message>\n <source>&Unlock Wallet for Minting Only</source>\n <translation>&Ontsleutel portemonnee alleen om te minten</translation>\n </message>\n <message>\n <source>Unlock wallet only for minting. Sending coins will still require the passphrase.</source>\n <translation>Ontsleutel portemonnee alleen om te minten. Voor het versturen van munten is nog een wachtwoordzin nodig</translation>\n </message>\n <message>\n <source>Backup wallet to another location</source>\n <translation>&Backup portemonnee naar een andere locatie</translation>\n </message>\n <message>\n <source>Change the passphrase used for wallet encryption</source>\n <translation>Wijzig de wachtwoordzin voor uw portemonneversleuteling</translation>\n </message>\n <message>\n <source>&Debug window</source>\n <translation>&Debug scherm</translation>\n </message>\n <message>\n <source>Open debugging and diagnostic console</source>\n <translation>Open debugging en diagnostische console</translation>\n </message>\n <message>\n <source>&File</source>\n <translation>&Bestand</translation>\n </message>\n <message>\n <source>&Settings</source>\n <translation>&Instellingen</translation>\n </message>\n <message>\n <source>&Help</source>\n <translation>&Hulp</translation>\n </message>\n <message>\n <source>Tabs toolbar</source>\n <translation>Tab-werkbalk</translation>\n </message>\n <message>\n <source>Actions toolbar</source>\n <translation>Actie-werkbalk</translation>\n </message>\n <message>\n <source>[testnet]</source>\n <translation>[testnetwerk]</translation>\n </message>\n <message>\n <source>Lambocoin Wallet</source>\n <translation>Lambocoin portemonnee</translation>\n </message>\n <message>\n <source>Send coins to a Lambocoin address</source>\n <translation>Zend munten naar een Lambocoin adres</translation>\n </message>\n <message>\n <source>&About Lambocoin</source>\n <translation>Over Lambocoin</translation>\n </message>\n <message>\n <source>Modify configuration options for Lambocoin</source>\n <translation>Wijzig configuratie opties voor Lambocoin</translation>\n </message>\n <message>\n <source>Show/Hide &Lambocoin</source>\n <translation>Toon/Verberg &Lambocoin</translation>\n </message>\n <message>\n <source>Show or hide the Lambocoin window</source>\n <translation>Toon of verberg het Lambocoin scherm</translation>\n </message>\n <message>\n <source>&Encrypt Wallet...</source>\n <translation>&Versleutel Portemonnee</translation>\n </message>\n <message>\n <source>&Backup Wallet...</source>\n <translation>&Backup Portemonnee</translation>\n </message>\n <message>\n <source>Lambocoin client</source>\n <translation>Lambocoin client</translation>\n </message>\n <message>\n <source>Synchronizing with network...</source>\n <translation>Synchroniseren met netwerk...</translation>\n </message>\n <message>\n <source>Downloaded %1 blocks of transaction history.</source>\n <translation>%1 blokken van transactiehistorie opgehaald.</translation>\n </message>\n <message numerus=\"yes\">\n <source>%n second(s) ago</source>\n <translation><numerusform>%n seconde geleden</numerusform><numerusform>%n seconde geleden</numerusform></translation>\n </message>\n <message numerus=\"yes\">\n <source>%n minute(s) ago</source>\n <translation><numerusform>%n minuut geleden</numerusform><numerusform>%n minuten geleden</numerusform></translation>\n </message>\n <message numerus=\"yes\">\n <source>%n hour(s) ago</source>\n <translation><numerusform>%n uur geleden</numerusform><numerusform>%n uur geleden</numerusform></translation>\n </message>\n <message numerus=\"yes\">\n <source>%n day(s) ago</source>\n <translation><numerusform>%n dag geleden</numerusform><numerusform>%n dagen geleden</numerusform></translation>\n </message>\n <message>\n <source>Up to date</source>\n <translation>Bijgewerkt</translation>\n </message>\n <message>\n <source>Catching up...</source>\n <translation>Aan het bijwerken...</translation>\n </message>\n <message>\n <source>Last received block was generated %1.</source>\n <translation>Laatst ontvangen blok is %1 gegenereerd.</translation>\n </message>\n <message>\n <source>Sent transaction</source>\n <translation>Verzonden transactie</translation>\n </message>\n <message>\n <source>Incoming transaction</source>\n <translation>Binnenkomende transactie</translation>\n </message>\n <message>\n <source>Date: %1\nAmount: %2\nType: %3\nAddress: %4\n</source>\n <translation>Datum: %1\nBedrag: %2\nType: %3\nAdres: %4\n</translation>\n </message>\n <message>\n <source>Wallet is <b>encrypted</b> and currently <b>unlocked for block minting only</b></source>\n <translation>Portemonnee is <b>versleuteld</b> en momenteel <b>geopend om blokken te minten</b></translation>\n </message>\n <message>\n <source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>\n <translation>Portemonnee is <b>versleuteld</b> en momenteel <b>geopend</b></translation>\n </message>\n <message>\n <source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>\n <translation>Portemonnee is <b>versleuteld</b> en momenteel <b>gesloten</b></translation>\n </message>\n <message>\n <source>Backup Wallet</source>\n <translation>Backup Portemonnee</translation>\n </message>\n <message>\n <source>Wallet Data (*.dat)</source>\n <translation>Portemonnee-data (*.dat)</translation>\n </message>\n <message>\n <source>Backup Failed</source>\n <translation>Backup Mislukt</translation>\n </message>\n <message>\n <source>There was an error trying to save the wallet data to the new location.</source>\n <translation>Er is een fout opgetreden bij het wegschrijven van de portemonnee-data naar de nieuwe locatie.</translation>\n </message>\n <message>\n <source>A fatal error occurred. Lambocoin can no longer continue safely and will quit.</source>\n <translation>Een fatale fout heeft plaatsgevonden. Lambocoin kan niet langer veilig doorgaan en zal afsluiten.</translation>\n </message>\n </context>\n<context>\n <name>CoinControlDialog</name>\n <message>\n <source>Coin Control</source>\n <translation>Munt Controle</translation>\n </message>\n <message>\n <source>Quantity:</source>\n <translation>Aantal:</translation>\n </message>\n <message>\n <source>0</source>\n <translation>0</translation>\n </message>\n <message>\n <source>Bytes:</source>\n <translation>Bytes:</translation>\n </message>\n <message>\n <source>Amount:</source>\n <translation>Bedrag:</translation>\n </message>\n <message>\n <source>0.00 BTC</source>\n <translation>123.456 BTC {0.00 ?}</translation>\n </message>\n <message>\n <source>Priority:</source>\n <translation>Prioriteit:</translation>\n </message>\n <message>\n <source>Fee:</source>\n <translation>Transactiekosten:</translation>\n </message>\n <message>\n <source>Low Output:</source>\n <translation>Kopieer lage uitvoer</translation>\n </message>\n <message>\n <source>no</source>\n <translation>nee</translation>\n </message>\n <message>\n <source>After Fee:</source>\n <translation>Na aftrek kosten:</translation>\n </message>\n <message>\n <source>Change:</source>\n <translation>Teruggave:</translation>\n </message>\n <message>\n <source>(un)select all</source>\n <translation>Alles (de)selecteren</translation>\n </message>\n <message>\n <source>Tree mode</source>\n <translation>Toon boomstructuur</translation>\n </message>\n <message>\n <source>List mode</source>\n <translation>Lijst modus</translation>\n </message>\n <message>\n <source>Amount</source>\n <translation>Bedrag</translation>\n </message>\n <message>\n <source>Address</source>\n <translation>Adres</translation>\n </message>\n <message>\n <source>Date</source>\n <translation>Datum</translation>\n </message>\n <message>\n <source>Confirmations</source>\n <translation>Bevestigingen</translation>\n </message>\n <message>\n <source>Confirmed</source>\n <translation>Bevestigd</translation>\n </message>\n <message>\n <source>Priority</source>\n <translation>Prioriteit</translation>\n </message>\n <message>\n <source>Copy address</source>\n <translation>Kopieer adres</translation>\n </message>\n <message>\n <source>Copy label</source>\n <translation>Kopieer label</translation>\n </message>\n <message>\n <source>Copy amount</source>\n <translation>Kopieer bedrag</translation>\n </message>\n <message>\n <source>Copy transaction ID</source>\n <translation>Kopieer transactie ID</translation>\n </message>\n <message>\n <source>Copy quantity</source>\n <translation>Kopieer aantal</translation>\n </message>\n <message>\n <source>Copy fee</source>\n <translation>Kopieer kosten</translation>\n </message>\n <message>\n <source>Copy after fee</source>\n <translation>Kopieer na kosten</translation>\n </message>\n <message>\n <source>Copy bytes</source>\n <translation>Kopieer bytes</translation>\n </message>\n <message>\n <source>Copy priority</source>\n <translation>Kopieer prioriteit</translation>\n </message>\n <message>\n <source>Copy low output</source>\n <translation>Kopieer lage uitvoer</translation>\n </message>\n <message>\n <source>Copy change</source>\n <translation>Kopieer teruggave</translation>\n </message>\n <message>\n <source>highest</source>\n <translation>hoogste</translation>\n </message>\n <message>\n <source>high</source>\n <translation>Hoogste</translation>\n </message>\n <message>\n <source>medium-high</source>\n <translation>medium-hoog</translation>\n </message>\n <message>\n <source>medium</source>\n <translation>medium</translation>\n </message>\n <message>\n <source>low-medium</source>\n <translation>laag-medium</translation>\n </message>\n <message>\n <source>low</source>\n <translation>laag</translation>\n </message>\n <message>\n <source>lowest</source>\n <translation>laagste</translation>\n </message>\n <message>\n <source>DUST</source>\n <translation>STOF</translation>\n </message>\n <message>\n <source>yes</source>\n <translation>ja</translation>\n </message>\n <message>\n <source>(no label)</source>\n <translation>(geen label)</translation>\n </message>\n <message>\n <source>change from %1 (%2)</source>\n <translation>gewijzigd van %1 (%2)</translation>\n </message>\n <message>\n <source>(change)</source>\n <translation>(wijzig)</translation>\n </message>\n </context>\n<context>\n <name>DisplayOptionsPage</name>\n <message>\n <source>&Unit to show amounts in: </source>\n <translation>&Eenheid om bedrag in te tonen:</translation>\n </message>\n <message>\n <source>Choose the default subdivision unit to show in the interface, and when sending coins</source>\n <translation>Kies de standaard onderverdelingseenheid om weer te geven in uw programma, en voor het versturen van munten</translation>\n </message>\n <message>\n <source>&Display addresses in transaction list</source>\n <translation>Toon adressen in transactielijst</translation>\n </message>\n <message>\n <source>Whether to show Lambocoin addresses in the transaction list</source>\n <translation>Toon Lambocoinadressen in transactielijst</translation>\n </message>\n <message>\n <source>Display coin control features (experts only!)</source>\n <translation>Laat muntcontrole functies zien (alleen voor experts!)</translation>\n </message>\n <message>\n <source>Whether to show coin control features or not</source>\n <translation>Munt controle mogelijkheden of niet</translation>\n </message>\n <message>\n <source>Warning</source>\n <translation>Waarschuwing</translation>\n </message>\n </context>\n<context>\n <name>EditAddressDialog</name>\n <message>\n <source>Edit Address</source>\n <translation>Bewerk Adres</translation>\n </message>\n <message>\n <source>&Label</source>\n <translation>&Label</translation>\n </message>\n <message>\n <source>The label associated with this address book entry</source>\n <translation>Het label dat geassocieerd is met dit adres</translation>\n </message>\n <message>\n <source>&Address</source>\n <translation>&Adres</translation>\n </message>\n <message>\n <source>The address associated with this address book entry. This can only be modified for sending addresses.</source>\n <translation>Het adres dat geassocieerd is met deze adresboek-opgave. Dit kan alleen worden veranderd voor zend-adressen.</translation>\n </message>\n <message>\n <source>New receiving address</source>\n <translation>Nieuw ontvangstadres</translation>\n </message>\n <message>\n <source>New sending address</source>\n <translation>Nieuw adres om naar te versturen</translation>\n </message>\n <message>\n <source>Edit receiving address</source>\n <translation>Bewerk ontvangstadres</translation>\n </message>\n <message>\n <source>Edit sending address</source>\n <translation>Bewerk verzendadres</translation>\n </message>\n <message>\n <source>The entered address \"%1\" is already in the address book.</source>\n <translation>Het opgegeven adres \"%1\" bestaat al in uw adresboek.</translation>\n </message>\n <message>\n <source>The entered address \"%1\" is not a valid Lambocoin address.</source>\n <translation>Het ingevoerde adres \"%1\" is geen geldig Lambocoin adres.</translation>\n </message>\n <message>\n <source>Could not unlock wallet.</source>\n <translation>Kon de portemonnee niet openen.</translation>\n </message>\n <message>\n <source>New key generation failed.</source>\n <translation>Genereren nieuwe sleutel mislukt.</translation>\n </message>\n</context>\n<context>\n <name>GUIUtil::HelpMessageBox</name>\n </context>\n<context>\n <name>MainOptionsPage</name>\n <message>\n <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>\n <translation>Ontkoppel blok en adres database tijdens afsluiten. Dit betekent dat ze kunnen worden verplaatst naar een andere bestandslokatie, maar het afsluiten is daardoor langzamer. De portomonnee is altijd ontkoppeld.</translation>\n </message>\n </context>\n<context>\n <name>MintingTableModel</name>\n <message>\n <source>Transaction</source>\n <translation>Transactie</translation>\n </message>\n <message>\n <source>Address</source>\n <translation>Adres</translation>\n </message>\n <message>\n <source>Age</source>\n <translation>Leeftijd</translation>\n </message>\n <message>\n <source>Balance</source>\n <translation>Balans</translation>\n </message>\n <message>\n <source>minutes</source>\n <translation>minuten</translation>\n </message>\n <message>\n <source>hours</source>\n <translation>uren</translation>\n </message>\n <message>\n <source>days</source>\n <translation>dagen</translation>\n </message>\n </context>\n<context>\n <name>MintingView</name>\n <message>\n <source>10 min</source>\n <translation>10 min</translation>\n </message>\n <message>\n <source>24 hours</source>\n <translation>24 uur</translation>\n </message>\n <message>\n <source>30 days</source>\n <translation>30 dagen</translation>\n </message>\n <message>\n <source>90 days</source>\n <translation>90 dagen</translation>\n </message>\n <message>\n <source>Comma separated file (*.csv)</source>\n <translation>Kommagescheiden bestand (*.csv)</translation>\n </message>\n <message>\n <source>Address</source>\n <translation>Adres</translation>\n </message>\n <message>\n <source>Transaction</source>\n <translation>Transactie</translation>\n </message>\n <message>\n <source>Age</source>\n <translation>Leeftijd</translation>\n </message>\n <message>\n <source>Balance</source>\n <translation>Balans</translation>\n </message>\n <message>\n <source>Error exporting</source>\n <translation>Fout bij exporteren</translation>\n </message>\n <message>\n <source>Could not write to file %1.</source>\n <translation>Kon niet schrijven naar bestand %1.</translation>\n </message>\n </context>\n<context>\n <name>MultisigAddressEntry</name>\n <message>\n <source>Form</source>\n <translation>Vorm</translation>\n </message>\n <message>\n <source>Alt+P</source>\n <translation>Alt+P</translation>\n </message>\n <message>\n <source>&Address:</source>\n <translation>&Adres</translation>\n </message>\n <message>\n <source>Choose address from address book</source>\n <translation>Kies adres uit adresboek</translation>\n </message>\n <message>\n <source>Alt+A</source>\n <translation>Alt+A</translation>\n </message>\n <message>\n <source>Label:</source>\n <translation>Label:</translation>\n </message>\n</context>\n<context>\n <name>MultisigDialog</name>\n <message>\n <source>Clear all</source>\n <translation>Verwijder alles</translation>\n </message>\n <message>\n <source>Fee:</source>\n <translation>Transactiekosten:</translation>\n </message>\n <message>\n <source>Paste address from clipboard</source>\n <translation>Plak adres vanuit klembord</translation>\n </message>\n <message>\n <source>Alt+P</source>\n <translation>Alt+P</translation>\n </message>\n </context>\n<context>\n <name>MultisigInputEntry</name>\n <message>\n <source>Form</source>\n <translation>Vorm</translation>\n </message>\n <message>\n <source>Alt+P</source>\n <translation>Alt+P</translation>\n </message>\n <message>\n <source>Alt+A</source>\n <translation>Alt+A</translation>\n </message>\n</context>\n<context>\n <name>NetworkOptionsPage</name>\n <message>\n <source>Network</source>\n <translation>Netwerk</translation>\n </message>\n </context>\n<context>\n <name>OptionsDialog</name>\n <message>\n <source>Options</source>\n <translation>Opties</translation>\n </message>\n</context>\n<context>\n <name>OverviewPage</name>\n <message>\n <source>Form</source>\n <translation>Vorm</translation>\n </message>\n <message>\n <source>Balance:</source>\n <translation>Saldo:</translation>\n </message>\n <message>\n <source>Number of transactions:</source>\n <translation>Aantal transacties:</translation>\n </message>\n <message>\n <source>Unconfirmed:</source>\n <translation>Onbevestigd:</translation>\n </message>\n <message>\n <source>Stake:</source>\n <translation>Inzet:</translation>\n </message>\n <message>\n <source>Wallet</source>\n <translation>Portemonnee</translation>\n </message>\n <message>\n <source><b>Recent transactions</b></source>\n <translation><b>Recente transacties</b></translation>\n </message>\n <message>\n <source>Your current balance</source>\n <translation>Uw huidige saldo</translation>\n </message>\n <message>\n <source>Your current stake</source>\n <translation>Huidige inzet</translation>\n </message>\n <message>\n <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>\n <translation>Totaal aantal transacties dat nog moet worden bevestigd, en nog niet is meegeteld in uw huidige saldo </translation>\n </message>\n <message>\n <source>Total number of transactions in wallet</source>\n <translation>Totaal aantal transacties in uw portemonnee</translation>\n </message>\n </context>\n<context>\n <name>QRCodeDialog</name>\n <message>\n <source>QR Code</source>\n <translation>QR-code</translation>\n </message>\n <message>\n <source>Request Payment</source>\n <translation>Vraag betaling aan</translation>\n </message>\n <message>\n <source>Amount:</source>\n <translation>Bedrag:</translation>\n </message>\n <message>\n <source>Label:</source>\n <translation>Label:</translation>\n </message>\n <message>\n <source>Message:</source>\n <translation>Bericht:</translation>\n </message>\n <message>\n <source>&Save As...</source>\n <translation>&Opslaan Als...</translation>\n </message>\n <message>\n <source>Error encoding URI into QR Code.</source>\n <translation>Fout in codering URI naar QR-code</translation>\n </message>\n <message>\n <source>Resulting URI too long, try to reduce the text for label / message.</source>\n <translation>Resultaat URI te lang, probeer de tekst in te korten.</translation>\n </message>\n <message>\n <source>PNG Images (*.png)</source>\n <translation>PNG-Afbeeldingen (*.png)</translation>\n </message>\n</context>\n<context>\n <name>RPCConsole</name>\n <message>\n <source>Client name</source>\n <translation>Client naam</translation>\n </message>\n <message>\n <source>N/A</source>\n <translation>N.v.t.</translation>\n </message>\n <message>\n <source>Client version</source>\n <translation>Client versie</translation>\n </message>\n <message>\n <source>Network</source>\n <translation>Netwerk</translation>\n </message>\n <message>\n <source>Number of connections</source>\n <translation>Aantal connecties</translation>\n </message>\n <message>\n <source>On testnet</source>\n <translation>Op testnetwerk</translation>\n </message>\n <message>\n <source>Block chain</source>\n <translation>Blokkenketen</translation>\n </message>\n <message>\n <source>Current number of blocks</source>\n <translation>Huidig aantal blokken</translation>\n </message>\n <message>\n <source>Estimated total blocks</source>\n <translation>Geschat aantal blokken</translation>\n </message>\n <message>\n <source>Last block time</source>\n <translation>Laaste bloktijd</translation>\n </message>\n <message>\n <source>Build date</source>\n <translation>Bouwdatum</translation>\n </message>\n <message>\n <source>Clear console</source>\n <translation>Console opschonen</translation>\n </message>\n <message>\n <source>Welcome to the Lambocoin RPC console.<br>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.<br>Type <b>help</b> for an overview of available commands.</source>\n <translation>Welkom bij de Lambocoin RPC console. <br>Gebruik pijltjes naar boven en naar beneden om de geschiedenis te navigeren, en <b>Ctrl-L</b> om het scherm te wissen.<br>Typ <b>help</b> voor een overzicht met commandos.</translation>\n </message>\n </context>\n<context>\n <name>SendCoinsDialog</name>\n <message>\n <source>Send Coins</source>\n <translation>Verstuur munten</translation>\n </message>\n <message>\n <source>Coin Control Features</source>\n <translation>Munt controle opties</translation>\n </message>\n <message>\n <source>Inputs...</source>\n <translation>Toevoer...</translation>\n </message>\n <message>\n <source>automatically selected</source>\n <translation>automatisch geselecteerd</translation>\n </message>\n <message>\n <source>Insufficient funds!</source>\n <translation>Onvoldoende fondsen!</translation>\n </message>\n <message>\n <source>Quantity:</source>\n <translation>Aantal:</translation>\n </message>\n <message>\n <source>0</source>\n <translation>0</translation>\n </message>\n <message>\n <source>Bytes:</source>\n <translation>Bytes:</translation>\n </message>\n <message>\n <source>Amount:</source>\n <translation>Bedrag:</translation>\n </message>\n <message>\n <source>0.00 BTC</source>\n <translation>123.456 BTC {0.00 ?}</translation>\n </message>\n <message>\n <source>Priority:</source>\n <translation>Prioriteit:</translation>\n </message>\n <message>\n <source>medium</source>\n <translation>medium</translation>\n </message>\n <message>\n <source>Fee:</source>\n <translation>Transactiekosten:</translation>\n </message>\n <message>\n <source>Low Output:</source>\n <translation>Kopieer lage uitvoer</translation>\n </message>\n <message>\n <source>no</source>\n <translation>nee</translation>\n </message>\n <message>\n <source>After Fee:</source>\n <translation>Na aftrek kosten:</translation>\n </message>\n <message>\n <source>Change</source>\n <translation>Teruggave</translation>\n </message>\n <message>\n <source>custom change address</source>\n <translation>zelfopgegeven teruggaveadres</translation>\n </message>\n <message>\n <source>Send to multiple recipients at once</source>\n <translation>Verstuur aan verschillende ontvangers tegelijkertijd</translation>\n </message>\n <message>\n <source>Remove all transaction fields</source>\n <translation>Verwijder alle transactievelden</translation>\n </message>\n <message>\n <source>Balance:</source>\n <translation>Saldo:</translation>\n </message>\n <message>\n <source>123.456 BTC</source>\n <translation>123.456 BTC</translation>\n </message>\n <message>\n <source>Confirm the send action</source>\n <translation>Bevestig de verstuuractie</translation>\n </message>\n <message>\n <source>&Send</source>\n <translation>&Verstuur</translation>\n </message>\n <message>\n <source>Copy quantity</source>\n <translation>Kopieer aantal</translation>\n </message>\n <message>\n <source>Copy amount</source>\n <translation>Kopieer bedrag</translation>\n </message>\n <message>\n <source>Copy fee</source>\n <translation>Kopieer kosten</translation>\n </message>\n <message>\n <source>Copy after fee</source>\n <translation>Kopieer na kosten</translation>\n </message>\n <message>\n <source>Copy bytes</source>\n <translation>Kopieer bytes</translation>\n </message>\n <message>\n <source>Copy priority</source>\n <translation>Kopieer prioriteit</translation>\n </message>\n <message>\n <source>Copy low output</source>\n <translation>Kopieer lage uitvoer</translation>\n </message>\n <message>\n <source>Copy change</source>\n <translation>Kopieer teruggave</translation>\n </message>\n <message>\n <source><b>%1</b> to %2 (%3)</source>\n <translation><b>%1</b> aan %2 (%3)</translation>\n </message>\n <message>\n <source>Confirm send coins</source>\n <translation>Bevestig versturen munten</translation>\n </message>\n <message>\n <source>Are you sure you want to send %1?</source>\n <translation>Weet u zeker dat u %1 wil versturen?</translation>\n </message>\n <message>\n <source> and </source>\n <translation> en </translation>\n </message>\n <message>\n <source>The amount to pay must be at least one cent (0.01).</source>\n <translation>Het te betalen bedrag moet minimaal een cent zijn (0.01).</translation>\n </message>\n <message>\n <source>Warning: Invalid Lambocoin address</source>\n <translation>Waarschuwing: Ongeldig Lambocoin adres</translation>\n </message>\n <message>\n <source>Warning: Unknown change address</source>\n <translation>Waarschuwing: onbekend teruggave adres</translation>\n </message>\n <message>\n <source>(no label)</source>\n <translation>(geen label)</translation>\n </message>\n <message>\n <source>Enter a Lambocoin address</source>\n <translation>Voer een Lambocoin adres in</translation>\n </message>\n </context>\n<context>\n <name>SendCoinsEntry</name>\n <message>\n <source>Form</source>\n <translation>Vorm</translation>\n </message>\n <message>\n <source>A&mount:</source>\n <translation>Bedra&g:</translation>\n </message>\n <message>\n <source>Pay &To:</source>\n <translation>Betaal &Aan:</translation>\n </message>\n <message>\n <source>Enter a label for this address to add it to your address book</source>\n <translation>Vul een label in voor dit adres om het toe te voegen aan uw adresboek</translation>\n </message>\n <message>\n <source>&Label:</source>\n <translation>&Label:</translation>\n </message>\n <message>\n <source>The address to send the payment to</source>\n <translation>Het verzendadres voor de betaling</translation>\n </message>\n <message>\n <source>Choose address from address book</source>\n <translation>Kies adres uit adresboek</translation>\n </message>\n <message>\n <source>Alt+A</source>\n <translation>Alt+A</translation>\n </message>\n <message>\n <source>Paste address from clipboard</source>\n <translation>Plak adres vanuit klembord</translation>\n </message>\n <message>\n <source>Alt+P</source>\n <translation>Alt+P</translation>\n </message>\n <message>\n <source>Remove this recipient</source>\n <translation>Verwijder deze ontvanger</translation>\n </message>\n</context>\n<context>\n <name>SignVerifyMessageDialog</name>\n <message>\n <source>Signatures - Sign / Verify a Message</source>\n <translation>Ondertekeningen - Onderteken / verifieer een bericht</translation>\n </message>\n <message>\n <source>&Sign Message</source>\n <translation>&Onderteken Bericht</translation>\n </message>\n <message>\n <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n <translation>U kunt berichten ondertekenen met een van uw adressen om te bewijzen dat u dit adres bezit. Pas op dat u geen onduidelijke dingen ondertekent, want phishingaanvallen zouden u voor de gek kunnen houden om zo uw identiteit te stelen. Onderteken alleen berichten waarmee u het volledig eens bent.</translation>\n </message>\n <message>\n <source>The address to sign the message with</source>\n <translation>Het ondertekenings adres voor het bericht</translation>\n </message>\n <message>\n <source>Choose previously used address</source>\n <translation>Kies eerder gebruikt adres</translation>\n </message>\n <message>\n <source>Alt+A</source>\n <translation>Alt+A</translation>\n </message>\n <message>\n <source>Paste address from clipboard</source>\n <translation>Plak adres vanuit klembord</translation>\n </message>\n <message>\n <source>Alt+P</source>\n <translation>Alt+P</translation>\n </message>\n <message>\n <source>Enter the message you want to sign here</source>\n <translation>Typ hier het bericht dat u wilt ondertekenen</translation>\n </message>\n <message>\n <source>Signature</source>\n <translation>Ondertekening</translation>\n </message>\n <message>\n <source>Copy the current signature to the system clipboard</source>\n <translation>Kopieer de huidige onderteking naar het systeem klembord</translation>\n </message>\n <message>\n <source>Sign the message to prove you own this Lambocoin address</source>\n <translation>Bewijs dat je dit Lambocoin adres bezit door het te ondertekenen </translation>\n </message>\n <message>\n <source>Sign &Message</source>\n <translation>Onderteken &Bericht</translation>\n </message>\n <message>\n <source>Reset all sign message fields</source>\n <translation>Herinitialiseer alle ondertekende bericht velden</translation>\n </message>\n <message>\n <source>Clear &All</source>\n <translation>&Alles wissen</translation>\n </message>\n <message>\n <source>&Verify Message</source>\n <translation>&Verifieer bericht</translation>\n </message>\n <message>\n <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>\n <translation>Voer hieronder het ondertekeningsadres in, het bericht (vergeet niet precies alle regelafbrekingen, spaties, tabulaties, etc. in te voeren) en ondertekening om het bericht te verifieren. Wees voorzichtig om verder te lezen waar de tekst niet deel uitmaakt van het ondertekende bericht, dit om te voorkomen dat je verleid wordt door een man-in-het-midden aanval.</translation>\n </message>\n <message>\n <source>The address the message was signed with</source>\n <translation>Het adres waarmee het bericht getekend was</translation>\n </message>\n <message>\n <source>Verify the message to ensure it was signed with the specified Lambocoin address</source>\n <translation>Verifieer het bericht om vast te stellen dat het bericht ondertekend was met het gespecificeerde Lambocoin adres</translation>\n </message>\n <message>\n <source>Verify &Message</source>\n <translation>&Verifieer bericht</translation>\n </message>\n <message>\n <source>Reset all verify message fields</source>\n <translation>Herinitialiseer alle geverifieerde bericht velden</translation>\n </message>\n <message>\n <source>Click \"Sign Message\" to generate signature</source>\n <translation>Klik 'Onderteken bericht' om te ondertekenen</translation>\n </message>\n <message>\n <source>Enter the signature of the message</source>\n <translation>Voer de ondertekening in voor het bericht</translation>\n </message>\n <message>\n <source>Enter a Lambocoin address</source>\n <translation>Voer een Lambocoin adres in</translation>\n </message>\n <message>\n <source>The entered address is invalid.</source>\n <translation>Het ingevoerde adres is onjuist</translation>\n </message>\n <message>\n <source>Please check the address and try again.</source>\n <translation>Controleer het adres and probeer opnieuw.</translation>\n </message>\n <message>\n <source>The entered address does not refer to a key.</source>\n <translation>Het ingevoerde adres refereert niet naar een sleutel</translation>\n </message>\n <message>\n <source>Wallet unlock was cancelled.</source>\n <translation>Portemonnee ontsleuteling is afgebroken.</translation>\n </message>\n <message>\n <source>Private key for the entered address is not available.</source>\n <translation>Geheime sleutel voor het ingevoerde adres is niet beschikbaar.</translation>\n </message>\n <message>\n <source>Message signing failed.</source>\n <translation>Bericht ondertekening mislukt.</translation>\n </message>\n <message>\n <source>Message signed.</source>\n <translation>Bericht ontedertekend.</translation>\n </message>\n <message>\n <source>The signature could not be decoded.</source>\n <translation>De ondertekeing kan niet worden ontcijferd.</translation>\n </message>\n <message>\n <source>Please check the signature and try again.</source>\n <translation>Controleer de ondertekening and probeer opnieuw.</translation>\n </message>\n <message>\n <source>The signature did not match the message digest.</source>\n <translation>De ondertekening komt niet overeen met de bericht samenvatting.</translation>\n </message>\n <message>\n <source>Message verification failed.</source>\n <translation>Bericht verficatie mislukt.</translation>\n </message>\n <message>\n <source>Message verified.</source>\n <translation>Bericht geverifieerd.</translation>\n </message>\n</context>\n<context>\n <name>SplashScreen</name>\n <message>\n <source>[testnet]</source>\n <translation>[testnetwerk]</translation>\n </message>\n</context>\n<context>\n <name>TransactionDesc</name>\n <message>\n <source>Open until %1</source>\n <translation>Open tot %1</translation>\n </message>\n <message>\n <source>%1/unconfirmed</source>\n <translation>%1/onbevestigd</translation>\n </message>\n <message>\n <source>%1 confirmations</source>\n <translation>%1 bevestigingen</translation>\n </message>\n <message>\n <source>Date</source>\n <translation>Datum</translation>\n </message>\n <message>\n <source>Transaction</source>\n <translation>Transactie</translation>\n </message>\n <message>\n <source>Amount</source>\n <translation>Bedrag</translation>\n </message>\n <message>\n <source>, has not been successfully broadcast yet</source>\n <translation>, is nog niet succesvol uitgezonden</translation>\n </message>\n <message>\n <source>unknown</source>\n <translation>onbekend</translation>\n </message>\n</context>\n<context>\n <name>TransactionDescDialog</name>\n <message>\n <source>Transaction details</source>\n <translation>Transactiedetails</translation>\n </message>\n <message>\n <source>This pane shows a detailed description of the transaction</source>\n <translation>Dit venster laat een uitgebreide beschrijving van de transactie zien</translation>\n </message>\n</context>\n<context>\n <name>TransactionTableModel</name>\n <message>\n <source>Date</source>\n <translation>Datum</translation>\n </message>\n <message>\n <source>Type</source>\n <translation>Type</translation>\n </message>\n <message>\n <source>Address</source>\n <translation>Adres</translation>\n </message>\n <message>\n <source>Amount</source>\n <translation>Bedrag</translation>\n </message>\n <message numerus=\"yes\">\n <source>Open for %n block(s)</source>\n <translation><numerusform>Open gedurende %n blok</numerusform><numerusform>Open gedurende %n blokken</numerusform></translation>\n </message>\n <message>\n <source>Open until %1</source>\n <translation>Open tot %1</translation>\n </message>\n <message>\n <source>Offline (%1 confirmations)</source>\n <translation>Niet verbonden (%1 bevestigingen)</translation>\n </message>\n <message>\n <source>Unconfirmed (%1 of %2 confirmations)</source>\n <translation>Onbevestigd (%1 van %2 bevestigd)</translation>\n </message>\n <message>\n <source>Confirmed (%1 confirmations)</source>\n <translation>Bevestigd (%1 bevestigingen)</translation>\n </message>\n <message numerus=\"yes\">\n <source>Mined balance will be available in %n more blocks</source>\n <translation><numerusform>Ontgonnen saldo komt beschikbaar na %n blok</numerusform><numerusform>Ontgonnen saldo komt beschikbaar na %n blokken</numerusform></translation>\n </message>\n <message>\n <source>This block was not received by any other nodes and will probably not be accepted!</source>\n <translation>Dit blok is niet ontvangen bij andere nodes en zal waarschijnlijk niet worden geaccepteerd!</translation>\n </message>\n <message>\n <source>Generated but not accepted</source>\n <translation>Gegenereerd maar niet geaccepteerd</translation>\n </message>\n <message>\n <source>Received with</source>\n <translation>Ontvangen met</translation>\n </message>\n <message>\n <source>Received from</source>\n <translation>Ontvangen van</translation>\n </message>\n <message>\n <source>Sent to</source>\n <translation>Verzonden aan</translation>\n </message>\n <message>\n <source>Payment to yourself</source>\n <translation>Betaling aan uzelf</translation>\n </message>\n <message>\n <source>Mined</source>\n <translation>Ontgonnen</translation>\n </message>\n <message>\n <source>Mint by stake</source>\n <translation>Minten met inzet</translation>\n </message>\n <message>\n <source>(n/a)</source>\n <translation>(nvt)</translation>\n </message>\n <message>\n <source>Transaction status. Hover over this field to show number of confirmations.</source>\n <translation>Transactiestatus. Houd de muiscursor boven dit veld om het aantal bevestigingen te laten zien.</translation>\n </message>\n <message>\n <source>Date and time that the transaction was received.</source>\n <translation>Datum en tijd waarop deze transactie is ontvangen.</translation>\n </message>\n <message>\n <source>Type of transaction.</source>\n <translation>Type transactie.</translation>\n </message>\n <message>\n <source>Destination address of transaction.</source>\n <translation>Ontvangend adres van transactie</translation>\n </message>\n <message>\n <source>Amount removed from or added to balance.</source>\n <translation>Bedrag verwijderd van of toegevoegd aan saldo</translation>\n </message>\n </context>\n<context>\n <name>TransactionView</name>\n <message>\n <source>All</source>\n <translation>Alles</translation>\n </message>\n <message>\n <source>Today</source>\n <translation>Vandaag</translation>\n </message>\n <message>\n <source>This week</source>\n <translation>Deze week</translation>\n </message>\n <message>\n <source>This month</source>\n <translation>Deze maand</translation>\n </message>\n <message>\n <source>Last month</source>\n <translation>Vorige maand</translation>\n </message>\n <message>\n <source>This year</source>\n <translation>Dit jaar</translation>\n </message>\n <message>\n <source>Range...</source>\n <translation>Bereik...</translation>\n </message>\n <message>\n <source>Received with</source>\n <translation>Ontvangen met</translation>\n </message>\n <message>\n <source>Sent to</source>\n <translation>Verzonden aan</translation>\n </message>\n <message>\n <source>To yourself</source>\n <translation>Aan uzelf</translation>\n </message>\n <message>\n <source>Mined</source>\n <translation>Ontgonnen</translation>\n </message>\n <message>\n <source>Mint by stake</source>\n <translation>Minten met inzet</translation>\n </message>\n <message>\n <source>Other</source>\n <translation>Anders</translation>\n </message>\n <message>\n <source>Enter address or label to search</source>\n <translation>Vul adres of label in om te zoeken</translation>\n </message>\n <message>\n <source>Min amount</source>\n <translation>Min. bedrag</translation>\n </message>\n <message>\n <source>Copy address</source>\n <translation>Kopieer adres</translation>\n </message>\n <message>\n <source>Copy label</source>\n <translation>Kopieer label</translation>\n </message>\n <message>\n <source>Copy amount</source>\n <translation>Kopieer bedrag</translation>\n </message>\n <message>\n <source>Edit label</source>\n <translation>Bewerk label</translation>\n </message>\n <message>\n <source>Export Transaction Data</source>\n <translation>Exporteer transactiegegevens</translation>\n </message>\n <message>\n <source>Comma separated file (*.csv)</source>\n <translation>Kommagescheiden bestand (*.csv)</translation>\n </message>\n <message>\n <source>Confirmed</source>\n <translation>Bevestigd</translation>\n </message>\n <message>\n <source>Date</source>\n <translation>Datum</translation>\n </message>\n <message>\n <source>Type</source>\n <translation>Type</translation>\n </message>\n <message>\n <source>Label</source>\n <translation>Label</translation>\n </message>\n <message>\n <source>Address</source>\n <translation>Adres</translation>\n </message>\n <message>\n <source>Amount</source>\n <translation>Bedrag</translation>\n </message>\n <message>\n <source>ID</source>\n <translation>ID</translation>\n </message>\n <message>\n <source>Error exporting</source>\n <translation>Fout bij exporteren</translation>\n </message>\n <message>\n <source>Could not write to file %1.</source>\n <translation>Kon niet schrijven naar bestand %1.</translation>\n </message>\n <message>\n <source>Range:</source>\n <translation>Bereik:</translation>\n </message>\n <message>\n <source>to</source>\n <translation>naar</translation>\n </message>\n</context>\n<context>\n <name>WalletModel</name>\n <message>\n <source>Sending...</source>\n <translation>Versturen...</translation>\n </message>\n</context>\n<context>\n <name>WindowOptionsPage</name>\n </context>\n<context>\n <name>bitcoin-core</name>\n <message>\n <source>Usage:</source>\n <translation>Gebruik:</translation>\n </message>\n <message>\n <source>Lambocoin version</source>\n <translation>Lambocoin versie</translation>\n </message>\n <message>\n <source>List commands</source>\n <translation>List van commando's\n</translation>\n </message>\n <message>\n <source>Get help for a command</source>\n <translation>Toon hulp voor een commando\n</translation>\n </message>\n <message>\n <source>Options:</source>\n <translation>Opties:\n</translation>\n </message>\n <message>\n <source>Specify configuration file (default: Lambocoin.conf)</source>\n <translation>Configuratiebestand specificeren (standaard: Lambocoin.conf)</translation>\n </message>\n <message>\n <source>Specify pid file (default: Lambocoind.pid)</source>\n <translation>Specifieer pid-bestand (standaard: Lambocoind.pid)\n</translation>\n </message>\n <message>\n <source>Generate coins</source>\n <translation>Genereer munten\n</translation>\n </message>\n <message>\n <source>Don't generate coins</source>\n <translation>Genereer geen munten</translation>\n </message>\n <message>\n <source>Specify data directory</source>\n <translation>Stel datamap in\n</translation>\n </message>\n <message>\n <source>Set database cache size in megabytes (default: 25)</source>\n <translation>Database cache instellen in Mb (standaard: 25)</translation>\n </message>\n <message>\n <source>Set database disk log size in megabytes (default: 100)</source>\n <translation>Database logbestandgrootte instellen in Mb (standaard: 100)</translation>\n </message>\n <message>\n <source>Specify connection timeout (in milliseconds)</source>\n <translation>Specificeer de time-out tijd (in milliseconden)\n</translation>\n </message>\n <message>\n <source>Maintain at most <n> connections to peers (default: 125)</source>\n <translation>Onderhoud maximaal <n> verbindingen naar peers (standaard: 125)</translation>\n </message>\n <message>\n <source>Add a node to connect to and attempt to keep the connection open</source>\n <translation>Maak connectie met een node en houd deze open</translation>\n </message>\n <message>\n <source>Connect only to the specified node</source>\n <translation>Verbind alleen met deze node\n</translation>\n </message>\n <message>\n <source>Accept connections from outside (default: 1)</source>\n <translation>Connecties van buiten accepteren (standaard: 1)</translation>\n </message>\n <message>\n <source>Find peers using DNS lookup (default: 1)</source>\n <translation>Zoek anderen via DNS (standaard: 1)</translation>\n </message>\n <message>\n <source>Threshold for disconnecting misbehaving peers (default: 100)</source>\n <translation>Drempel om verbinding te verbreken naar zich misdragende peers (standaard: 100)</translation>\n </message>\n <message>\n <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>\n <translation>Aantal seconden dat zich misdragende peers niet opnieuw mogen verbinden (standaard: 86400)</translation>\n </message>\n <message>\n <source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 10000)</source>\n <translation>Maximale ontvangstbuffer per connectie, <n>*1000 bytes (standaard: 10000)</translation>\n </message>\n <message>\n <source>Maximum per-connection send buffer, <n>*1000 bytes (default: 10000)</source>\n <translation>Maximale zendbuffer per connectie, <n>*1000 bytes (standaard: 10000)</translation>\n </message>\n <message>\n <source>Use Universal Plug and Play to map the listening port (default: 1)</source>\n <translation>Gebruik uPNP om de netwerk poort in te delen (standaard 1)</translation>\n </message>\n <message>\n <source>Use Universal Plug and Play to map the listening port (default: 0)</source>\n <translation>Gebruik uPNP om de netwerkpoort in te delen (standaard 0)</translation>\n </message>\n <message>\n <source>Fee per KB to add to transactions you send</source>\n <translation>Kosten per kB voor te versturen transacties</translation>\n </message>\n <message>\n <source>Run in the background as a daemon and accept commands</source>\n <translation>Draai in de achtergrond als daemon en aanvaard commando's\n</translation>\n </message>\n <message>\n <source>Use the test network</source>\n <translation>Gebruik het testnetwerk\n</translation>\n </message>\n <message>\n <source>Prepend debug output with timestamp</source>\n <translation>Voorzie de debuggingsuitvoer van een tijdsaanduiding</translation>\n </message>\n <message>\n <source>Send trace/debug info to console instead of debug.log file</source>\n <translation>Stuur opsporing/debug-info naar de console in plaats van het debug.log bestand</translation>\n </message>\n <message>\n <source>Send trace/debug info to debugger</source>\n <translation>Stuur opsporings/debug-info naar debugger</translation>\n </message>\n <message>\n <source>Username for JSON-RPC connections</source>\n <translation>Gebruikersnaam voor JSON-RPC verbindingen\n</translation>\n </message>\n <message>\n <source>Password for JSON-RPC connections</source>\n <translation>Wachtwoord voor JSON-RPC verbindingen\n</translation>\n </message>\n <message>\n <source>Allow JSON-RPC connections from specified IP address</source>\n <translation>Sta JSON-RPC verbindingen van opgegeven IP adres toe\n</translation>\n </message>\n <message>\n <source>Send commands to node running on <ip> (default: 127.0.0.1)</source>\n <translation>Verstuur commando's naar proces dat op <ip> draait (standaard: 127.0.0.1)\n</translation>\n </message>\n <message>\n <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n <translation>Voer commando uit indien het hoogste blok verandert (%s in cmd is herplaats met blok hash)</translation>\n </message>\n <message>\n <source>Upgrade wallet to latest format</source>\n <translation>Opwaardeer portemonnee naar laatste formaat</translation>\n </message>\n <message>\n <source>Set key pool size to <n> (default: 100)</source>\n <translation>Stel sleutelpoelgrootte in op <n> (standaard: 100)\n</translation>\n </message>\n <message>\n <source>Rescan the block chain for missing wallet transactions</source>\n <translation>Doorzoek de blokkenketen op ontbrekende portemonnee-transacties</translation>\n </message>\n <message>\n <source>How many blocks to check at startup (default: 2500, 0 = all)</source>\n <translation>Aantal blokken bij opstarten controleren (standaard: 2500, 0 = alle)</translation>\n </message>\n <message>\n <source>How thorough the block verification is (0-6, default: 1)</source>\n <translation>Grondigheid blok verificatie (0-6, standaard: 1)</translation>\n </message>\n <message>\n <source>Use OpenSSL (https) for JSON-RPC connections</source>\n <translation>Gebruik OpenSSL (https) voor JSON-RPC verbindingen\n</translation>\n </message>\n <message>\n <source>Server certificate file (default: server.cert)</source>\n <translation>Certificaat-bestand voor server (standaard: server.cert)\n</translation>\n </message>\n <message>\n <source>Server private key (default: server.pem)</source>\n <translation>Geheime sleutel voor server (standaard: server.pem)\n</translation>\n </message>\n <message>\n <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>\n <translation>Aanvaardbare sleuteltypen (standaard: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>\n </message>\n <message>\n <source>Cannot obtain a lock on data directory %s. Lambocoin is probably already running.</source>\n <translation>Blokkeren van data folder %s is niet gelukt. Lambocoin is mogelijk al opgestart.</translation>\n </message>\n <message>\n <source>Lambocoin</source>\n <translation>Lambocoin</translation>\n </message>\n <message>\n <source>Error loading wallet.dat: Wallet requires newer version of Lambocoin</source>\n <translation>Fout geconstateerd bij het laden van wallet.dat: Portemonnee vereist een nieuwere versie van Lambocoin</translation>\n </message>\n <message>\n <source>Wallet needed to be rewritten: restart Lambocoin to complete</source>\n <translation>Portemonnee dient opnieuw bewerkt te worden: start Lambocoin opnieuw op om te voltooien</translation>\n </message>\n <message>\n <source>Warning: Please check that your computer's date and time are correct. If your clock is wrong Lambocoin will not work properly.</source>\n <translation>Waarschuwing: controleer of de datum en tijd op uw computer correct zijn. Indien uw klok verkeerd staat, zal Lambocoin niet goed werken</translation>\n </message>\n <message>\n <source>Loading addresses...</source>\n <translation>Adressen aan het laden...</translation>\n </message>\n <message>\n <source>Loading block index...</source>\n <translation>Blokindex aan het laden...</translation>\n </message>\n <message>\n <source>Error loading blkindex.dat</source>\n <translation>Fout bij laden blkindex.dat</translation>\n </message>\n <message>\n <source>Loading wallet...</source>\n <translation>Portemonnee aan het laden...</translation>\n </message>\n <message>\n <source>Error loading wallet.dat: Wallet corrupted</source>\n <translation>Fout bij laden wallet.dat: Portemonnee corrupt</translation>\n </message>\n <message>\n <source>Error loading wallet.dat</source>\n <translation>Fout bij laden wallet.dat</translation>\n </message>\n <message>\n <source>Cannot downgrade wallet</source>\n <translation>Kan portemonnee niet degraderen</translation>\n </message>\n <message>\n <source>Cannot initialize keypool</source>\n <translation>Kan sleutelpoel niet initaliseren</translation>\n </message>\n <message>\n <source>Cannot write default address</source>\n <translation>Kan niet schrijven naar standaard adres</translation>\n </message>\n <message>\n <source>Rescanning...</source>\n <translation>Opnieuw aan het scannen ...</translation>\n </message>\n <message>\n <source>Done loading</source>\n <translation>Klaar met laden</translation>\n </message>\n <message>\n <source>Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction.</source>\n <translation>Waarschuwing: -paytxfee is zeer hoog ingesteld. Dit zijn de transactiekosten die u betaalt bij het versturen van een transactie.</translation>\n </message>\n <message>\n <source>To use the %s option</source>\n <translation>Gebruik de %s optie</translation>\n </message>\n <message>\n <source>Error</source>\n <translation>Fout</translation>\n </message>\n <message>\n <source>An error occurred while setting up the RPC port %i for listening: %s</source>\n <translation>Een fout geconstateerd met het opzetten van RPC port %i om te luisteren: %s</translation>\n </message>\n <message>\n <source>You must set rpcpassword=<password> in the configuration file:\n%s\nIf the file does not exist, create it with owner-readable-only file permissions.</source>\n <translation>Je moet rpcpassword=<password> in het configuratie bestand instellen:\n%s\nIndien het bestand niet bestaat, maak het aan met alleen gebruikers leesrechten op het bestand.</translation>\n </message>\n <message>\n <source>Error: Wallet locked, unable to create transaction </source>\n <translation>Fout: Portemonnee is gesloten, kan geen nieuwe transactie aanmaken</translation>\n </message>\n <message>\n <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>\n <translation>Fout: Deze transactie vereist minstens %s transactie kosten vanwege het bedrag, moeilijkheid, of recent ontvangen fondsen</translation>\n </message>\n <message>\n <source>Error: Transaction creation failed </source>\n <translation>Fout: Aanmaak transactie mislukt</translation>\n </message>\n <message>\n <source>Sending...</source>\n <translation>Versturen...</translation>\n </message>\n <message>\n <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>\n <translation>Fout: De transactie was afgewezen. Dit kan gebeuren als u eerder uitgegeven munten opnieuw wilt versturen, zoals wanneer u een kopie van uw wallet.dat heeft gebruikt en in de kopie deze munten zijn gemarkeerd als uitgegeven, maar in de huidige nog niet.</translation>\n </message>\n <message>\n <source>Invalid amount</source>\n <translation>Onjuist bedrag</translation>\n </message>\n <message>\n <source>Insufficient funds</source>\n <translation>Onvoldoende fondsen</translation>\n </message>\n</context>\n</TS>\n", "meta": {"content_hash": "e67a53e9ce08617135ab53d1810ab78b", "timestamp": "", "source": "github", "line_count": 1984, "max_line_length": 396, "avg_line_length": 36.482358870967744, "alnum_prop": 0.6512897030988796, "repo_name": "LambocoinFoundation/Lambocoin", "id": "606708bd1411301b8af658afd71f1adb0d717194", "size": "72381", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/paycoin_nl.ts", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "5537"}, {"name": "C++", "bytes": "2381407"}, {"name": "Makefile", "bytes": "9025"}, {"name": "NSIS", "bytes": "6629"}, {"name": "Objective-C", "bytes": "858"}, {"name": "Objective-C++", "bytes": "3537"}, {"name": "Python", "bytes": "54574"}, {"name": "QMake", "bytes": "11762"}, {"name": "Roff", "bytes": "12841"}, {"name": "Shell", "bytes": "5118"}]}} +{"text": "\n\n#import <Foundation/Foundation.h>\n\n#import <WebDriverAgentLib/FBCommandStatus.h>\n#import <WebDriverAgentLib/FBResponsePayload.h>\n#import <WebDriverAgentLib/FBRoute.h>\n#import <WebDriverAgentLib/FBResponsePayload.h>\n\nNS_ASSUME_NONNULL_BEGIN\n\n/**\n Protocol for Classes to declare intent to implement responses to commands\n */\n@protocol FBCommandHandler <NSObject>\n\n/**\n * Should return map of FBRouteCommandHandler block with keys as supported routes\n *\n * @return map an NSArray<FBRoute *> of routes.\n */\n+ (NSArray *)routes;\n\n@optional\n/**\n * @return BOOL deciding if class should be added to route handlers automatically, default (if not implemented) is YES\n */\n+ (BOOL)shouldRegisterAutomatically;\n\n@end\n\nNS_ASSUME_NONNULL_END\n", "meta": {"content_hash": "059fc37c5e0ef04073302605c3d61e3a", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 118, "avg_line_length": 22.84375, "alnum_prop": 0.7688098495212038, "repo_name": "calabash/WebDriverAgent", "id": "bde028d68b01d9668b9ea11664fe07bfcf31d522", "size": "1039", "binary": false, "copies": "13", "ref": "refs/heads/master", "path": "WebDriverAgentLib/Routing/FBCommandHandler.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "2413"}, {"name": "HTML", "bytes": "191"}, {"name": "JavaScript", "bytes": "17764"}, {"name": "Objective-C", "bytes": "446149"}, {"name": "Shell", "bytes": "3516"}]}} +{"text": "package io.budgetapp.configuration;\n\nimport com.bazaarvoice.dropwizard.assets.AssetsBundleConfiguration;\nimport com.bazaarvoice.dropwizard.assets.AssetsConfiguration;\nimport com.fasterxml.jackson.annotation.JsonProperty;\nimport io.budgetapp.model.Budget;\nimport io.budgetapp.model.Category;\nimport io.dropwizard.Configuration;\nimport io.dropwizard.db.DataSourceFactory;\n\nimport javax.validation.Valid;\nimport javax.validation.constraints.NotNull;\nimport java.util.ArrayList;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.Map;\n\n/**\n *\n */\npublic class AppConfiguration extends Configuration implements AssetsBundleConfiguration {\n\n @Valid\n @NotNull\n private DataSourceFactory database = new DataSourceFactory();\n\n @Valid\n @NotNull\n private final AssetsConfiguration assets = new AssetsConfiguration();\n\n @Valid\n @NotNull\n private List<Category> categories = new ArrayList<>();\n\n @Valid\n @NotNull\n @JsonProperty(\"budgets\")\n private Map<String, List<Budget>> budgets = new LinkedHashMap<>();\n\n public DataSourceFactory getDataSourceFactory() {\n return database;\n }\n\n @Override\n public AssetsConfiguration getAssetsConfiguration() {\n return assets;\n }\n\n @JsonProperty(\"assets\")\n public AssetsConfiguration getAssets() {\n return assets;\n }\n\n @JsonProperty(\"database\")\n public void setDatabase(DataSourceFactory database) {\n this.database = database;\n }\n\n @JsonProperty(\"categories\")\n public void setCategories(List<Category> categories) {\n this.categories = categories;\n }\n\n public void setBudgets(Map<String, List<Budget>> budgets) {\n this.budgets = budgets;\n }\n\n public List<Category> getCategories() {\n return categories;\n }\n\n public Map<String, List<Budget>> getBudgets() {\n return budgets;\n }\n}", "meta": {"content_hash": "6ac792ce4188a0e6b9d778c0cd448972", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 90, "avg_line_length": 25.0, "alnum_prop": 0.7168, "repo_name": "navneetkarnani/budgetapp", "id": "1728522cce034a4b84e09529b2528e03d9cc1287", "size": "1875", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/io/budgetapp/configuration/AppConfiguration.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "86255"}, {"name": "HTML", "bytes": "53279"}, {"name": "Java", "bytes": "154498"}, {"name": "JavaScript", "bytes": "61073"}, {"name": "Shell", "bytes": "174"}]}} +{"text": "Usage Examples\n==============\n\nPika has various methods of use, between the synchronous BlockingConnection adapter and the various asynchronous connection adapter. The following examples illustrate the various ways that you can use Pika in your projects.\n\nPika\u6709\u5f88\u591a\u79cd\u4f7f\u7528\u65b9\u6cd5\uff0c\u5305\u62ecBlockingConnection\u9002\u914d\u5668\u548c\u5404\u79cd\u5f02\u6b65\u8fde\u63a5\u9002\u914d\u5668\u4e4b\u95f4\u3002\u4e0b\u9762\u7684\u4f8b\u5b50\u8bf4\u660e\uff0c\u4f60\u53ef\u4ee5\u5728\u4f60\u7684\u9879\u76ee\u4e2d\u4f7f\u7528Pika\u7684\u5404\u79cd\u65b9\u6cd5\u3002\n\n.. toctree::\n :glob:\n :maxdepth: 1\n\n examples/using_urlparameters\n examples/connecting_async\n examples/blocking_basic_get\n examples/blocking_consume\n examples/blocking_consumer_generator\n examples/comparing_publishing_sync_async\n examples/blocking_delivery_confirmations\n examples/blocking_publish_mandatory\n examples/asynchronous_consumer_example\n examples/asynchronous_publisher_example\n examples/twisted_example\n examples/tornado_consumer\n", "meta": {"content_hash": "784056a4f2ea0648a9a07b9fabd915e1", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 223, "avg_line_length": 35.04347826086956, "alnum_prop": 0.8014888337468983, "repo_name": "zixiliuyue/pika", "id": "1505adedff05b78446494407599aca3a2773def9", "size": "910", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/examples.rst", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Python", "bytes": "842302"}]}} +{"text": "## m\n\n---\n\n- [Usage](#usage)\n- [Binding to data](#binding-to-data)\n- [Using HTML entities](#using-html-entities)\n- [Accessing the real DOM element](#accessing-the-real-dom-element)\n- [Persisting config data](#persisting-config-data)\n- [Destructors](#destructors)\n- [Persisting DOM elements across route changes](#persisting-dom-elements-across-route-changes)\n- [SVG](#svg)\n- [Dealing with focus](#dealing-with-focus)\n- [Dealing with sorting and deleting in lists](#dealing-with-sorting-and-deleting-in-lists)\n- [Component shorthand](#component-shorthand)\n- [Signature](#signature)\n- [The `config` attribute](#the-config-attribute)\n---\n\nThis is a convenience method to compose virtual elements that can be rendered via [`m.render()`](mithril.render.md).\n\nYou are encouraged to use CSS selectors to define virtual elements. See \"Signature\" section for details.\n\n---\n\n### Usage\n\nYou can use simple tag selectors to make templates resemble HTML:\n\n```javascript\nm(\"br\"); //yields a virtual element that represents <br>\n\nm(\"div\", \"Hello\"); //yields <div>Hello</div>\n\nm(\"div\", {class: \"container\"}, \"Hello\"); //yields <div class=\"container\">Hello</div>\n```\n\nNote that the output value from `m()` is not an actual DOM element. In order to turn the virtual element into a real DOM element, you must call [`m.render()`](mithril.render.md).\n\n```javascript\nm.render(document.body, m(\"br\")); //puts a <br> in <body>\n```\n\nYou can also use more complex CSS selectors:\n\n```javascript\nm(\".container\"); //yields <div class=\"container\"></div>\n\nm(\"#layout\"); //yields <div id=\"layout\"></div>\n\nm(\"a[name=top]\"); //yields <a name=\"top\"></a>\n\nm(\"[contenteditable]\"); //yields <div contenteditable></div>\n\nm(\"a#google.external[href='http://google.com']\", \"Google\"); //yields <a id=\"google\" class=\"external\" href=\"http://google.com\">Google</a>\n```\n\nEach `m()` call creates a virtual DOM element, that is, a Javascript object that represents a DOM element, and which is eventually converted into one.\n\nYou can, of course, nest virtual elements:\n\n```javascript\nm(\"ul\", [\n\tm(\"li\", \"item 1\"),\n\tm(\"li\", \"item 2\"),\n]);\n\n/*\nyields\n<ul>\n\t<li>item 1</li>\n\t<li>item 2</li>\n</ul>\n*/\n```\n\n---\n\nThe CSS selector syntax (e.g. `a#google.external[href='http://google.com']`) is meant to be used for declaring static attributes in the element, i.e. attribute values that don't change dynamically when the user interacts with the app.\n\nThe `attributes` argument (i.e. the second parameter in the `m(\"div\", {class: \"container\"}, \"Hello\")` example) is meant to be used for attributes whose values we want to dynamically populate.\n\nFor example, let's say that you're generating a link from an entry that comes from a web service:\n\n```javascript\n//assume the variable `link` came from a web service\nvar link = {url: \"http://google.com\", title: \"Google\"}\n\nm(\"a\", {href: link.url}, link.title); //yields <a href=\"http://google.com\">Google</a>\n```\n\nHere's a less trivial example:\n\n```javascript\nvar links = [\n {title: \"item 1\", url: \"/item1\"},\n {title: \"item 2\", url: \"/item2\"},\n {title: \"item 3\", url: \"/item3\"}\n];\n\nm.render(document.body, [\n m(\"ul.nav\", \n links.map(function(link) {\n return m(\"li\",\n m(\"a\", {href: link.url}, link.title) \n );\n })\n )\n]);\n```\n\nyields:\n\n```markup\n<body>\n <ul class=\"nav\">\n <li><a href=\"/item1\">item 1</a></li>\n <li><a href=\"/item2\">item 2</a></li>\n <li><a href=\"/item3\">item 3</a></li>\n </ul>\n</body>\n```\n\nAs you can see, flow control is done with vanilla Javascript. This allows the developer to abstract away any aspect of the template at will.\n\n---\n\nNote that you can use both Javascript property names and HTML attribute names to set values in the `attributes` argument, but you should pass a value of appropriate type. If an attribute has the same name in Javascript and in HTML, then Mithril assumes you're setting the Javascript property.\n\n```javascript\nm(\"div\", {class: \"widget\"}); //yields <div class=\"widget\"></div>\n\nm(\"div\", {className: \"widget\"}); //yields <div class=\"widget\"></div>\n\nm(\"button\", {onclick: alert}); //yields <button></button>, which alerts its event argument when clicked\n\n//note this uses the Javascript syntax (uppercase \"O\") for `readonly`\n//in order to set the boolean javascript property instead of the HTML attribute\nm(\"input\", {readOnly: true}); //yields <input readonly />\n\n//using the HTML attribute name will call `setAttribute`, which may not be what you want\nm(\"input\", {readonly: false}); //yields <input readonly=\"false\" />, which is still readonly\n```\n\n---\n\nNote that you can use JSON syntax if the attribute name you are setting has non-alphanumeric characters:\n\n```javascript\nm(\"div\", {\"data-index\": 1}); //yields <div data-index=\"1\"></div>\n```\n\nYou can set inline styles like this:\n\n```javascript\nm(\"div\", {style: {border: \"1px solid red\"}}); //yields <div style=\"border:1px solid red;\"></div>\n```\n\nNote that in order to keep the framework lean, Mithril does not auto-append units like `px` or `%` to any values. Typically, you should not even be using inline styles to begin with (unless you are dynamically changing them).\n\nMithril also does not auto-camel-case CSS properties on inline style attributes, so you should use the Javascript syntax when setting them via Javascript objects:\n\n```javascript\nm(\"div\", {style: {textAlign: \"center\"}}); //yields <div style=\"text-align:center;\"></div>\nm(\"div\", {style: {cssFloat: \"left\"}}); //yields <div style=\"float:left;\"></div>\n\n//this does not work\nm(\"div\", {style: {\"text-align\": \"center\"}});\nm(\"div\", {style: {float: \"left\"}});\n```\n\nYou can find the [Javascript syntax for all the CSS rules here](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Properties_Reference).\n\nYou can, however, use CSS syntax when defining style rules as inline strings:\n\n```javascript\nm(\"div[style='text-align:center']\"); //yields <div style=\"text-align:center;\"></div>\n```\n\nOne caveat of using the CSS syntax is that it clobbers the `style` attribute in the DOM element on redraws, so this syntax is not appropriate if you need to use it in conjunction with 3rd party tools that modify the element's style outside of Mithril's templates (e.g. via `config`, which is explained below)\n\n---\n\n### Binding to data\n\nIn order to stay flexible, Mithril doesn't provide helpers for bi-directional bindings out of the box. However, bindings can be implemented easily:\n\n```javascript\n//a data store\nvar name = m.prop(\"\")\n\n//binding the data store in a view\nm(\"input\", {oninput: m.withAttr(\"value\", name), value: name()})\n```\n\nIn the code above, the `oninput` event handler updates the `name` getter-setter, and the Mithril auto-redrawing system redraws the template in order to update the displayed value. You can read more about the [`m.prop` getter-setter utility here](mithril.prop.md) and the [`m.withAttr` event handler factory here](mithril.withAttr.md). You can also [learn how the redrawing system works here](auto-redrawing.md).\n\nNote that Mithril always considers the model layer data to be canonical. This means that in the code below, the input on screen will overwritten by the model data any time a redraw happens:\n\n```javascript\n//note that we are not updating the value of the `name` getter-setter via an event handler\n//redraws will always overwrite the current UI value with the value of `name()`\nm(\"input\", {value: name()})\n```\n\nExpressiveness can be achieved using standard refactoring techniques:\n\n```javascript\n//refactor the binding to a simple helper\nvar binds = function(prop) {\n\treturn {oninput: m.withAttr(\"value\", prop), value: prop()}\n}\n\n//a data store\nvar name = m.prop(\"\")\n\n//binding the data store in a view\nm(\"input\", binds(name))\n```\n\nHere's an example of a more aggressive refactor:\n\n```javascript\n//refactor the binding to a simple helper\nvar input = function(prop) {\n\treturn m(\"input\", {oninput: m.withAttr(\"value\", prop), value: prop()})\n}\n\n//a data store\nvar name = m.prop(\"\")\n\n//binding the data store in a view\ninput(name)\n```\n\nAlternatively, you can also explore other techniques in order to achieve better [performance](http://lhorie.github.io/mithril-blog/asymmetrical-data-bindings.html) and [expressiveness](http://lhorie.github.io/mithril-blog/extending-the-view-language.html).\n\n---\n\n### Using HTML entities\n\nBy default, Mithril escapes HTML strings in order to help prevent XSS attacks.\n\n```javascript\nm(\"div\", \"×\") //becomes <div>&times;</div>\n```\n\nYou can unescape trusted HTML strings by using [`m.trust`](mithril.trust.md)\n\n```javascript\nm(\"div\", m.trust(\"×\")) //becomes <div>×</div>\n```\n\n---\n\n#### Accessing the real DOM element\n\nYou can define a non-HTML-standard attribute called `config`. This special parameter allows you to call methods on the DOM element after it gets created.\n\nThis is useful, for example, if you declare a `canvas` element and want to use the Javascript API to draw:\n\n```javascript\nfunction draw(element, isInitialized, context) {\n\t//don't redraw if we did once already\n\tif (isInitialized) return;\n\n\tvar ctx = element.getContext(\"2d\");\n\t/* draws stuff */\n}\n\nvar view = [\n\tm(\"canvas\", {config: draw})\n]\n\n//this creates the canvas element, and therefore, `isInitialized` is false\nm.render(document.body, view);\n\n//here, isInitialized is `true`\nm.render(document.body, view);\n```\n\nOne common way of using `config` is in conjunction with [`m.route`](mithril.route.md), which is an unobtrusive extension to links that allow Mithril's routing system to work transparently regardless of which routing mode is used.\n\n```javascript\n//this link can use any of Mithril's routing system modes\n//(i.e. it can use either the hash, the querystring or the pathname as the router implementation)\n//without needing to hard-code any syntax (`#` or `?`) in the `href` attribute.\nm(\"a[href='/dashboard']\", {config: m.route}, \"Dashboard\");\n```\n\nThe `config` mechanism can also be used to put focus on form inputs, and call methods that would not be possible to execute via the regular attribute syntax.\n\nAlso note that the `config` callback only runs after a rendering lifecycle is done. Therefore, you should not use `config` to modify controller and model values, if you expect these changes to render immediately. Changes to controller and model values in this fashion will only render on the next `m.render` or `m.mount` call.\n\nYou can use this mechanism to attach custom event listeners to controller methods (for example, when integrating with third party libraries), but you are responsible for making sure the integration with Mithril's autoredrawing system is in place. See the [integration guide](integration.md) for more information.\n\nYou can also use it to attach events to other elements (for example, `window.onresize`), but you should remove such event handlers via `ctx.onunload` to avoid surprises.\n\n---\n\n#### Persisting config data\n\nThe third argument for `config` allows you to map data to a virtual DOM element in a way that persists across redraws. This is useful when a `config` instantiates 3rd party classes and accesses the instance on redraws.\n\nThe example below shows a contrived redraw counter. In it, the count is stored in the context object and re-accessed on each redraw.\n\n```javascript\nfunction alertsRedrawCount(element, isInit, context) {\n\tif (!isInit) context.count = 0\n\talert(++context.count)\n}\n\nm(\"div\", {config: alertsRedrawCount})\n```\n\n---\n\n#### Destructors\n\nIf the `context` object that is passed to a `config` function has a property called `onunload`, this function will be called when the element gets detached from the document by Mithril's diff engine.\n\nThis is useful if there are cleanup tasks that need to be run when an element is destroyed (e.g. clearing `setTimeout`'s, etc)\n\n```javascript\nfunction unloadable(element, isInit, context) {\n\tcontext.timer = setTimeout(function() {\n\t\talert(\"timed out!\");\n\t}, 1000);\n\n\tcontext.onunload = function() {\n\t\tclearTimeout(context.timer);\n\t\tconsole.log(\"unloaded the div\");\n\t}\n};\n\nm.render(document, m(\"div\", {config: unloadable}));\n\nm.render(document, m(\"a\")); //logs `unloaded the div` and `alert` never gets called\n```\n\n---\n\n#### Persisting DOM elements across route changes\n\nWhen using the [router](mithril.route.md), a route change recreates the DOM tree from scratch in order to unload plugins from the previous page. If you want to keep a DOM element intact across a route change, you can set the `retain` flag in the config's context object.\n\nIn the example below, there are two routes, each of which loads a component when a user navigates to their respective URLs. Both components use a `menu` template, which contains links for navigation between the two components, and an expensive-to-reinitialize element. Setting `context.retain = true` in the element's config function allows the span to stay intact after a route change.\n\n```javascript\n//a menu template\nvar menu = function() {\n\treturn m(\"div\", [\n\t\tm(\"a[href='/']\", {config: m.route}, \"Home\"),\n\t\tm(\"a[href='/contact']\", {config: m.route}, \"Contact\"),\n\t\t//an expensive-to-initialize DOM element\n\t\tm(\"span\", {config: persistent})\n\t])\n}\n//a configuration that persists across route changes\nfunction persistent(el, isInit, context) {\n\tcontext.retain = true\n\t\n\tif (!isInit) {\n\t\t//only runs once, even if you move back and forth between `/` and `/contact`\n\t\tdoSomethingExpensive(el)\n\t}\n}\n\n//components that use the menu above\nvar Home = {\n\tcontroller: function() {},\n\tview: function() {\n\t\treturn m(\"div\", [\n\t\t\tmenu(),\n\t\t\tm(\"h1\", \"Home\")\n\t\t])\n\t}\n}\nvar Contact = {\n\tview: function() {\n\t\treturn m(\"div\", [\n\t\t\tmenu(),\n\t\t\tm(\"h2\", \"Contact\")\n\t\t])\n\t}\n}\n\nm.route(document.body, \"/\", {\n\t\"/\": Home,\n\t\"/contact\": Contact\n})\n```\n\nNote that even if you set `context.retain = true`, the element will still be destroyed and recreated if it is different enough from the existing element. An element is considered \"different enough\" if:\n\n- the tag name changes, or\n- the list of HTML attributes changes, or\n- the value of the element's id attribute changes\n\nIn addition, setting `context.retain = false` will also cause the element to be recreated, even if it is not considered different enough.\n\n---\n\n#### SVG\n\nYou can use Mithril to create SVG documents (as long as you don't need to support browsers that don't support SVG natively).\n\nMithril automatically figures out the correct XML namespaces when it sees an SVG island in the virtual DOM tree.\n\n```javascript\nm(\"svg[height='200px'][width='200px']\", [\n\tm(\"image[href='foo.jpg'][height='200px'][width='200px']\")\n])\n```\n\n---\n\n#### Dealing with focus\n\nThe virtual DOM diffing algorithm has a weakness: a naive diff is not aware of the identity of DOM elements. In practice, this means performing operations like shifting an item from the beginning of a list would cause every element in the list to be diffed and potentially recreated. Another side-effect is that UI state like input focus is not tracked correctly if the focused element moves around, and likewise, state for 3rd party plugins that are added via `config` can also end up in the wrong element.\n\nFortunately, with Mithril, it's possible for developers to attach an identity key to elements so that array operations like shift, splice and sort only affect the minimum amount of elements required, leaving the rest of the DOM elements untouched when a redraw happens. This allows us to maintain input focus and plugin state correctly.\n\nTo maintain the identities of DOM elements, you need to add a `key` property to the direct children of the array that you're planning to modify. The key for each child must be unique among a list of sibling DOM elements, but it does not need to be globally unique. Also, keys must be either strings or numbers.\n\n```javascript\nm(\"ul\", [\n\titems.map(function(item) {\n\t\treturn m(\"li\", {key: item.id}, [\n\t\t\tm(\"input\")\n\t\t]);\n\t})\n]);\n```\n\nIn the example above, input focus would be maintained correctly after a redraw even if `items` got sorted or reversed. The key is defined in the `li`, which is the closest element to the `items` array, not directly on the `input`, even though we want to track focus on the input.\n\nNote that in addition to the presence of the `key` attribute, diffing rules also apply in determining whether an element is recreated. Elements are recreated if either their node name changes, or if the list of attribute names change, or if the ID attribute changes. To avoid surprises, be sure to change only attribute values, using `undefined` or `null` as values if appropriate, rather than conditionally substituting attribute dictionaries altogether.\n\n```javascript\n//avoid using this idiom\nm(\"li\", selected ? {class: \"active\"} : {})\n\n//use this idiom instead\nm(\"li\", {class: selected ? \"active\" : \"\"})\n```\n\n---\n\n### Dealing with sorting and deleting in lists\n\nAs with input focus, we can maintain referential integrity between data in a list and the respective DOM representation by using keys.\n\n```javascript\nm(\"ul\", [\n\titems.map(function(item) {\n\t\treturn m(\"li\", {key: item.id}, [\n\t\t\tm(\"input\")\n\t\t]);\n\t})\n]);\n```\n\nYou should always use keys if you need to sort lists, remove items from them or splice them in any way.\n\n---\n\n### Component Shorthand\n\nIf the first argument to `m()` is a component, it acts as an alias of `m.component()`\n\n```javascript\nvar MyComponent = {\n\tcontroller: function() {\n\t\treturn {greeting: \"hello\"}\n\t},\n\tview: function(ctrl, args) {\n\t\treturn m(\"h1\", ctrl.greeting + \" \" + args.data)\n\t}\n}\n\nm.render(document.body, [\n\t//the two lines below are equivalent\n\tm(MyComponent, {data: \"world\"}),\n\tm.component(MyComponent, {data: \"world\"})\n])\n```\n\nSee [components](mithril.component.md) for more information.\n\n---\n\n### Signature\n\n[How to read signatures](how-to-read-signatures.md)\n\n```clike\nVirtualElement m(String selector [, Attributes attributes] [, Children... children])\n\nwhere:\n\tVirtualElement :: Object { String tag, Attributes attributes, Children children }\n Attributes :: Object<any | void config(DOMElement element, Boolean isInitialized, Object context, VirtualElement vdom)>\n\tChildren :: String text | VirtualElement virtualElement | Component | SubtreeDirective directive | Array<Children children>\n\tComponent :: Object { Function? controller, Function view }\n\tSubtreeDirective :: Object { String subtree }\n```\n\n-\t**String selector**\n\n\tThis string should be a CSS rule that represents a DOM element.\n\n\tOnly tag, id, class and attribute selectors are supported.\n\n\tIf the tag selector is omitted, it defaults to `div`.\n\n\tNote that if the same attribute is defined in the both `selector` and `attributes` parameters, the value in `attributes` is used.\n\n\tFor developer convenience, Mithril makes an exception for the `class` attribute: if there are classes defined in both parameters, they are concatenated as a space separated list. It does not, however, de-dupe classes if the same class is declared twice.\n\n\t*Examples:*\n\n\t`\"div\"`\n\n\t`\"#container\"`\n\n\t`\".active\"`\n\n\t`\"[title='Application']\"`\n\n\t`\"div#container.active[title='Application']\"`\n\n\t`\".active#container\"`\n\n-\t**Attributes attributes** (optional)\n\n\tThis key-value map should define a list of HTML attributes and their respective values.\n\n\tYou can use both HTML and Javascript attribute names. For example, both `class` and `className` are valid.\n\n\tValues' types should match the expected type for the respective attribute.\n\n\tFor example, the value for `className` should be a string.\n\n\tWhen a attribute name expects different types for the value in HTML and Javascript, the Javascript type should be used.\n\n\tFor example, the value for the `onclick` attribute should be a function.\n\n\tSimilar, setting the value of attribute `readonly` to `false` is equivalent to removing the attribute in HTML.\n\n\tIt's also possible to set values to Javascript-only properties, such as `hash` in a `<a>` element.\n\n\tNote that if the same attribute is defined in the both `selector` and `attributes` parameters, the value in `attributes` is used.\n\n\tFor developer convenience, Mithril makes an exception for the `class` attribute: if there are classes defined in both parameters, they are concatenated as a space separated list. It does not, however, de-dupe classes if the same class is declared twice.\n\n\t*Examples:*\n\n\t`{ title: \"Application\" }`\n\n\t`{ onclick: function(e) { /*do stuff*/ } }`\n\n\t`{ style: {border: \"1px solid red\"} }`\n\n-\t#### The `config` attribute\n\n\t**void config(DOMElement element, Boolean isInitialized, Object context, VirtualElement vdom)** (optional)\n\n\tYou can define a non-HTML-standard attribute called `config`. This special parameter allows you to call methods on the DOM element after it gets created.\n\n\tThis is useful, for example, if you declare a `canvas` element and want to use the Javascript API to draw:\n\n\t```javascript\n\tfunction draw(element, isInitialized) {\n\t\t//don't redraw if we did once already\n\t\tif (isInitialized) return;\n\n\t\tvar ctx = element.getContext(\"2d\");\n\t\t/* draws stuff */\n\t}\n\n\tvar view = [\n\t\tm(\"canvas\", {config: draw})\n\t]\n\n\t//this creates the canvas element, and therefore, `isInitialized` is false\n\tm.render(document.body, view);\n\n\t//here, isInitialized is `true`\n\tm.render(document.body, view);\n\t```\n\n\tOne common way of using `config` is in conjunction with [`m.route`](mithril.route.md), which is an unobtrusive extension to links that allow Mithril's routing system to work transparently regardless of which routing mode is used.\n\n\t```javascript\n\t//this link can use any of Mithril's routing system modes\n\t//(i.e. it can use either the hash, the querystring or the pathname as the router implementation)\n\t//without needing to hard-code any syntax (`#` or `?`) in the `href` attribute.\n\tm(\"a[href='/dashboard']\", {config: m.route}, \"Dashboard\");\n\t```\n\n\tThe `config` mechanism can also be used to put focus on form inputs, and call methods that would not be possible to execute via the regular attribute syntax.\n\n\tAlso note that the `config` callback only runs after a rendering lifecycle is done. Therefore, you should not use `config` to modify controller and model values, if you expect these changes to render immediately. Changes to controller and model values in this fashion will only render on the next `m.render` or `m.mount` call.\n\n\tYou can use this mechanism to attach custom event listeners to controller methods (for example, when integrating with third party libraries), but you are responsible for making sure the integration with Mithril's autoredrawing system is in place. See the [integration guide](integration.md) for more information.\n\t\n\tYou can also use it to attach events to other elements (for example, `window.onresize`), but you should remove such event handlers via `ctx.onunload` to avoid surprises.\n\n\t-\t**DOMElement element**\n\n\tThe DOM element that corresponds to virtual element defined by the `m()` call.\n\n\t-\t**Boolean isInitialized**\n\n\tWhether this is the first time we are running this function on this element. This flag is false the first time it runs on an element, and true on redraws that happen after the element has been created.\n\n\t-\t**Object context**\n\n\tAn object that retains its state across redraws. It can be used to store instances of 3rd party classes that need to be accessed more than one time throughout the lifecycle of a page.\n\n\tThe example below shows a contrived redraw counter. In it, the count is stored in the context object and re-accessed on each redraw.\n\n\t```javascript\n\tfunction alertsRedrawCount(element, isInit, context) {\n\t\tif (!isInit) context.count = 0\n\t\talert(++context.count)\n\t}\n\n\tm(\"div\", {config: alertsRedrawCount})\n\t```\n\n\tIf the `context` object that is passed to a `config` function has a property called `onunload`, this function will be called when the element gets detached from the document by Mithril's diff engine.\n\n\tThis is useful if there are cleanup tasks that need to be run when an element is destroyed (e.g. clearing `setTimeout`'s, etc)\n\n\t```javascript\n\tfunction unloadable(element, isInit, context) {\n\t\tcontext.timer = setTimeout(function() {\n\t\t\talert(\"timed out!\");\n\t\t}, 1000);\n\n\t\tcontext.onunload = function() {\n\t\t\tclearTimeout(context.timer);\n\t\t\tconsole.log(\"unloaded the div\");\n\t\t}\n\t};\n\n\tm.render(document, m(\"div\", {config: unloadable}));\n\n\tm.render(document, m(\"a\")); //logs `unloaded the div` and `alert` never gets called\n\t```\n\t\n\t-\t**VirtualElement vdom**\n\t\n\tThe virtual DOM element to which the `config` function is attached\n\n-\t**Children children** (optional)\n\n\tIf this argument is a string, it will be rendered as a text node. To render a string as HTML, see [`m.trust`](mithril.trust.md)\n\n\tIf it's a VirtualElement, it will be rendered as a DOM Element.\n\n\tIf it's a [component](mithril.component.md), the component will be instantiated and managed internally by Mithril\n\t\n\tIf it's a list, its contents will recursively be rendered as appropriate and appended as children of the element being created.\n\n\tIf it's a SubtreeDirective with the value \"retain\", it will retain the existing DOM tree in place, if any. See [subtree directives.md](mithril.render.md#subtree-directives) for more information.\n\n-\t**returns** VirtualElement\n\n\tThe returned VirtualElement is a Javascript data structure that represents the DOM element to be rendered by [`m.render`](mithril.render.md)\n", "meta": {"content_hash": "019c130827cf9dff2398348ed5027c90", "timestamp": "", "source": "github", "line_count": 671, "max_line_length": 507, "avg_line_length": 37.58867362146051, "alnum_prop": 0.7245262072793592, "repo_name": "futurist/mithril_0.2.x", "id": "10fa215b7b93b08321e418fc6db337e613bbfb72", "size": "25222", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/mithril.md", "mode": "33261", "license": "mit", "language": [{"name": "CSS", "bytes": "36786"}, {"name": "HTML", "bytes": "2914489"}, {"name": "JavaScript", "bytes": "925918"}]}} +{"text": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Application Environment\n |--------------------------------------------------------------------------\n |\n | This value determines the \"environment\" your application is currently\n | running in. This may determine how you prefer to configure various\n | services your application utilizes. Set this in your \".env\" file.\n |\n */\n\n 'env' => env('APP_ENV', 'production'),\n\n /*\n |--------------------------------------------------------------------------\n | Application Debug Mode\n |--------------------------------------------------------------------------\n |\n | When your application is in debug mode, detailed error messages with\n | stack traces will be shown on every error that occurs within your\n | application. If disabled, a simple generic error page is shown.\n |\n */\n\n 'debug' => env('APP_DEBUG', true),\n\n /*\n |--------------------------------------------------------------------------\n | Application URL\n |--------------------------------------------------------------------------\n |\n | This URL is used by the console to properly generate URLs when using\n | the Artisan command line tool. You should set this to the root of\n | your application so that it is used when running Artisan tasks.\n |\n */\n\n 'url' => env('APP_URL', 'http://localhost'),\n\n /*\n |--------------------------------------------------------------------------\n | Application Timezone\n |--------------------------------------------------------------------------\n |\n | Here you may specify the default timezone for your application, which\n | will be used by the PHP date and date-time functions. We have gone\n | ahead and set this to a sensible default for you out of the box.\n |\n */\n\n 'timezone' => 'UTC',\n\n /*\n |--------------------------------------------------------------------------\n | Application Locale Configuration\n |--------------------------------------------------------------------------\n |\n | The application locale determines the default locale that will be used\n | by the translation service provider. You are free to set this value\n | to any of the locales which will be supported by the application.\n |\n */\n\n 'locale' => 'en',\n\n /*\n |--------------------------------------------------------------------------\n | Application Fallback Locale\n |--------------------------------------------------------------------------\n |\n | The fallback locale determines the locale to use when the current one\n | is not available. You may change the value to correspond to any of\n | the language folders that are provided through your application.\n |\n */\n\n 'fallback_locale' => 'en',\n\n /*\n |--------------------------------------------------------------------------\n | Encryption Key\n |--------------------------------------------------------------------------\n |\n | This key is used by the Illuminate encrypter service and should be set\n | to a random, 32 character string, otherwise these encrypted strings\n | will not be safe. Please do this before deploying an application!\n |\n */\n\n 'key' => env('APP_KEY'),\n\n 'cipher' => 'AES-256-CBC',\n\n /*\n |--------------------------------------------------------------------------\n | Logging Configuration\n |--------------------------------------------------------------------------\n |\n | Here you may configure the log settings for your application. Out of\n | the box, Laravel uses the Monolog PHP logging library. This gives\n | you a variety of powerful log handlers / formatters to utilize.\n |\n | Available Settings: \"single\", \"daily\", \"syslog\", \"errorlog\"\n |\n */\n\n 'log' => env('APP_LOG', 'daily'),\n\n /*\n |--------------------------------------------------------------------------\n | Autoloaded Service Providers\n |--------------------------------------------------------------------------\n |\n | The service providers listed here will be automatically loaded on the\n | request to your application. Feel free to add your own services to\n | this array to grant expanded functionality to your applications.\n |\n */\n\n 'providers' => [\n\n /*\n * Laravel Framework Service Providers...\n */\n Illuminate\\Auth\\AuthServiceProvider::class,\n Illuminate\\Broadcasting\\BroadcastServiceProvider::class,\n Illuminate\\Bus\\BusServiceProvider::class,\n Illuminate\\Cache\\CacheServiceProvider::class,\n Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider::class,\n Illuminate\\Cookie\\CookieServiceProvider::class,\n Illuminate\\Database\\DatabaseServiceProvider::class,\n Illuminate\\Encryption\\EncryptionServiceProvider::class,\n Illuminate\\Filesystem\\FilesystemServiceProvider::class,\n Illuminate\\Foundation\\Providers\\FoundationServiceProvider::class,\n Illuminate\\Hashing\\HashServiceProvider::class,\n Illuminate\\Mail\\MailServiceProvider::class,\n Illuminate\\Pagination\\PaginationServiceProvider::class,\n Illuminate\\Pipeline\\PipelineServiceProvider::class,\n Illuminate\\Queue\\QueueServiceProvider::class,\n Illuminate\\Redis\\RedisServiceProvider::class,\n Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider::class,\n Illuminate\\Session\\SessionServiceProvider::class,\n Illuminate\\Translation\\TranslationServiceProvider::class,\n Illuminate\\Validation\\ValidationServiceProvider::class,\n Illuminate\\View\\ViewServiceProvider::class,\n\n /*\n * Application Service Providers...\n */\n App\\Providers\\AppServiceProvider::class,\n App\\Providers\\AuthServiceProvider::class,\n App\\Providers\\EventServiceProvider::class,\n App\\Providers\\RouteServiceProvider::class,\n\n /*\n * Entrust Service Provider\n */\n Zizaco\\Entrust\\EntrustServiceProvider::class,\n\n /*\n * LaravelCollective Html Form & Html\n */\n Collective\\Html\\HtmlServiceProvider::class,\n Laravel\\Socialite\\SocialiteServiceProvider::class,\n ],\n\n /*\n |--------------------------------------------------------------------------\n | Class Aliases\n |--------------------------------------------------------------------------\n |\n | This array of class aliases will be registered when this application\n | is started. However, feel free to register as many as you wish as\n | the aliases are \"lazy\" loaded so they don't hinder performance.\n |\n */\n\n 'aliases' => [\n\n 'App' => Illuminate\\Support\\Facades\\App::class,\n 'Artisan' => Illuminate\\Support\\Facades\\Artisan::class,\n 'Auth' => Illuminate\\Support\\Facades\\Auth::class,\n 'Blade' => Illuminate\\Support\\Facades\\Blade::class,\n 'Cache' => Illuminate\\Support\\Facades\\Cache::class,\n 'Config' => Illuminate\\Support\\Facades\\Config::class,\n 'Cookie' => Illuminate\\Support\\Facades\\Cookie::class,\n 'Crypt' => Illuminate\\Support\\Facades\\Crypt::class,\n 'DB' => Illuminate\\Support\\Facades\\DB::class,\n 'Eloquent' => Illuminate\\Database\\Eloquent\\Model::class,\n 'Event' => Illuminate\\Support\\Facades\\Event::class,\n 'File' => Illuminate\\Support\\Facades\\File::class,\n 'Gate' => Illuminate\\Support\\Facades\\Gate::class,\n 'Hash' => Illuminate\\Support\\Facades\\Hash::class,\n 'Lang' => Illuminate\\Support\\Facades\\Lang::class,\n 'Log' => Illuminate\\Support\\Facades\\Log::class,\n 'Mail' => Illuminate\\Support\\Facades\\Mail::class,\n 'Password' => Illuminate\\Support\\Facades\\Password::class,\n 'Queue' => Illuminate\\Support\\Facades\\Queue::class,\n 'Redirect' => Illuminate\\Support\\Facades\\Redirect::class,\n 'Redis' => Illuminate\\Support\\Facades\\Redis::class,\n 'Request' => Illuminate\\Support\\Facades\\Request::class,\n 'Response' => Illuminate\\Support\\Facades\\Response::class,\n 'Route' => Illuminate\\Support\\Facades\\Route::class,\n 'Schema' => Illuminate\\Support\\Facades\\Schema::class,\n 'Session' => Illuminate\\Support\\Facades\\Session::class,\n 'Storage' => Illuminate\\Support\\Facades\\Storage::class,\n 'URL' => Illuminate\\Support\\Facades\\URL::class,\n 'Validator' => Illuminate\\Support\\Facades\\Validator::class,\n 'View' => Illuminate\\Support\\Facades\\View::class,\n\n /*\n * Entrust alias\n */\n 'Entrust' => Zizaco\\Entrust\\EntrustFacade::class,\n\n /*\n * LaravelCollective Html Form & Html\n */\n 'Form' => Collective\\Html\\FormFacade::class,\n 'Html' => Collective\\Html\\HtmlFacade::class,\n\n 'Socialite' => Laravel\\Socialite\\Facades\\Socialite::class,\n\n ],\n];\n", "meta": {"content_hash": "2d5ee0dc643fd6d7e0737c071b27f42b", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 79, "avg_line_length": 38.88209606986899, "alnum_prop": 0.5367250673854448, "repo_name": "pviswanath/New-Cassel-first-code-base", "id": "b273d4c18f15bc1087bbb33b74a20ef06029c369", "size": "8904", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/app.php", "mode": "33261", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "553"}, {"name": "CSS", "bytes": "4027"}, {"name": "HTML", "bytes": "67156"}, {"name": "JavaScript", "bytes": "15056"}, {"name": "PHP", "bytes": "162829"}]}} +{"text": "<?php\n\n\nApp::uses('ShellDispatcher', 'Console');\nApp::uses('TestShell', 'Console/Command');\n\n/**\n * TestTestShell\n *\n * @package Cake.Test.Case.Console.Command\n */\nclass TestTestShell extends TestShell {\n\n\tpublic function mapFileToCase($file, $category, $throwOnMissingFile = true) {\n\t\treturn $this->_mapFileToCase($file, $category, $throwOnMissingFile);\n\t}\n\n\tpublic function mapFileToCategory($file) {\n\t\treturn $this->_mapFileToCategory($file);\n\t}\n\n}\n\n/**\n * TestShellTest\n *\n * @package Cake.Test.Case.Console.Command\n */\nclass TestShellTest extends CakeTestCase {\n\n/**\n * setUp test case\n *\n * @return void\n */\n\tpublic function setUp() {\n\t\tparent::setUp();\n\t\t$out = $this->getMock('ConsoleOutput', array(), array(), '', false);\n\t\t$in = $this->getMock('ConsoleInput', array(), array(), '', false);\n\n\t\t$this->Shell = $this->getMock(\n\t\t\t'TestTestShell',\n\t\t\tarray('in', 'out', 'hr', 'help', 'error', 'err', '_stop', 'initialize', '_run', 'clear'),\n\t\t\tarray($out, $out, $in)\n\t\t);\n\t\t$this->Shell->OptionParser = $this->getMock('ConsoleOptionParser', array(), array(null, false));\n\t}\n\n/**\n * tearDown method\n *\n * @return void\n */\n\tpublic function tearDown() {\n\t\tparent::tearDown();\n\t\tunset($this->Dispatch, $this->Shell);\n\t}\n\n/**\n * testMapCoreFileToCategory\n *\n * @return void\n */\n\tpublic function testMapCoreFileToCategory() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/basics.php');\n\t\t$this->assertSame('core', $return);\n\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/Core/App.php');\n\t\t$this->assertSame('core', $return);\n\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/Some/Deeply/Nested/Structure.php');\n\t\t$this->assertSame('core', $return);\n\t}\n\n/**\n * testMapCoreFileToCase\n *\n * basics.php is a slightly special case - it's the only file in the core with a test that isn't Capitalized\n *\n * @return void\n */\n\tpublic function testMapCoreFileToCase() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/basics.php', 'core');\n\t\t$this->assertSame('Basics', $return);\n\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/Core/App.php', 'core');\n\t\t$this->assertSame('Core/App', $return);\n\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/Some/Deeply/Nested/Structure.php', 'core', false);\n\t\t$this->assertSame('Some/Deeply/Nested/Structure', $return);\n\t}\n\n/**\n * testMapAppFileToCategory\n *\n * @return void\n */\n\tpublic function testMapAppFileToCategory() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Controller/ExampleController.php');\n\t\t$this->assertSame('app', $return);\n\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'My/File/Is/Here.php');\n\t\t$this->assertSame('app', $return);\n\t}\n\n/**\n * testMapAppFileToCase\n *\n * @return void\n */\n\tpublic function testMapAppFileToCase() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Controller/ExampleController.php', 'app', false);\n\t\t$this->assertSame('Controller/ExampleController', $return);\n\n\t\t$return = $this->Shell->mapFileToCase(APP . 'My/File/Is/Here.php', 'app', false);\n\t\t$this->assertSame('My/File/Is/Here', $return);\n\t}\n\n/**\n * testMapPluginFileToCategory\n *\n * @return void\n */\n\tpublic function testMapPluginFileToCategory() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Plugin/awesome/Controller/ExampleController.php');\n\t\t$this->assertSame('awesome', $return);\n\n\t\t$return = $this->Shell->mapFileToCategory(dirname(CAKE) . 'plugins/awesome/Controller/ExampleController.php');\n\t\t$this->assertSame('awesome', $return);\n\t}\n\n/**\n * testMapPluginFileToCase\n *\n * @return void\n */\n\tpublic function testMapPluginFileToCase() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Plugin/awesome/Controller/ExampleController.php', 'awesome', false);\n\t\t$this->assertSame('Controller/ExampleController', $return);\n\n\t\t$return = $this->Shell->mapFileToCase(dirname(CAKE) . 'plugins/awesome/Controller/ExampleController.php', 'awesome', false);\n\t\t$this->assertSame('Controller/ExampleController', $return);\n\t}\n\n/**\n * testMapCoreTestToCategory\n *\n * @return void\n */\n\tpublic function testMapCoreTestToCategory() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/Test/Case/BasicsTest.php');\n\t\t$this->assertSame('core', $return);\n\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/Test/Case/BasicsTest.php');\n\t\t$this->assertSame('core', $return);\n\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/Test/Case/Some/Deeply/Nested/StructureTest.php');\n\t\t$this->assertSame('core', $return);\n\t}\n\n/**\n * testMapCoreTestToCase\n *\n * basics.php is a slightly special case - it's the only file in the core with a test that isn't Capitalized\n *\n * @return void\n */\n\tpublic function testMapCoreTestToCase() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/Test/Case/BasicsTest.php', 'core');\n\t\t$this->assertSame('Basics', $return);\n\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/Test/Case/Core/AppTest.php', 'core');\n\t\t$this->assertSame('Core/App', $return);\n\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/Test/Case/Some/Deeply/Nested/StructureTest.php', 'core', false);\n\t\t$this->assertSame('Some/Deeply/Nested/Structure', $return);\n\t}\n\n/**\n * testMapAppTestToCategory\n *\n * @return void\n */\n\tpublic function testMapAppTestToCategory() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Test/Case/Controller/ExampleControllerTest.php');\n\t\t$this->assertSame('app', $return);\n\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Test/Case/My/File/Is/HereTest.php');\n\t\t$this->assertSame('app', $return);\n\t}\n\n/**\n * testMapAppTestToCase\n *\n * @return void\n */\n\tpublic function testMapAppTestToCase() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Test/Case/Controller/ExampleControllerTest.php', 'app', false);\n\t\t$this->assertSame('Controller/ExampleController', $return);\n\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Test/Case/My/File/Is/HereTest.php', 'app', false);\n\t\t$this->assertSame('My/File/Is/Here', $return);\n\t}\n\n/**\n * testMapPluginTestToCategory\n *\n * @return void\n */\n\tpublic function testMapPluginTestToCategory() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Plugin/awesome/Test/Case/Controller/ExampleControllerTest.php');\n\t\t$this->assertSame('awesome', $return);\n\n\t\t$return = $this->Shell->mapFileToCategory(dirname(CAKE) . 'plugins/awesome/Test/Case/Controller/ExampleControllerTest.php');\n\t\t$this->assertSame('awesome', $return);\n\t}\n\n/**\n * testMapPluginTestToCase\n *\n * @return void\n */\n\tpublic function testMapPluginTestToCase() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Plugin/awesome/Test/Case/Controller/ExampleControllerTest.php', 'awesome', false);\n\t\t$this->assertSame('Controller/ExampleController', $return);\n\n\t\t$return = $this->Shell->mapFileToCase(dirname(CAKE) . 'plugins/awesome/Test/Case/Controller/ExampleControllerTest.php', 'awesome', false);\n\t\t$this->assertSame('Controller/ExampleController', $return);\n\t}\n\n/**\n * testMapNotTestToNothing\n *\n * @return void\n */\n\tpublic function testMapNotTestToNothing() {\n\t\t$this->Shell->startup();\n\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Test/Case/NotATestFile.php');\n\t\t$this->assertSame('app', $return);\n\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Test/Case/NotATestFile.php', false, false);\n\t\t$this->assertFalse($return);\n\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Test/Fixture/SomeTest.php');\n\t\t$this->assertSame('app', $return);\n\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Test/Fixture/SomeTest.php', false, false);\n\t\t$this->assertFalse($return);\n\t}\n\n/**\n * test available list of test cases for an empty category\n *\n * @return void\n */\n\tpublic function testAvailableWithEmptyList() {\n\t\t$this->Shell->startup();\n\t\t$this->Shell->args = array('unexistant-category');\n\t\t$this->Shell->expects($this->at(0))->method('out')->with(__d('cake_console', \"No test cases available \\n\\n\"));\n\t\t$this->Shell->OptionParser->expects($this->once())->method('help');\n\t\t$this->Shell->available();\n\t}\n\n/**\n * test available list of test cases for core category\n *\n * @return void\n */\n\tpublic function testAvailableCoreCategory() {\n\t\t$this->Shell->startup();\n\t\t$this->Shell->args = array('core');\n\t\t$this->Shell->expects($this->at(0))->method('out')->with('Core Test Cases:');\n\t\t$this->Shell->expects($this->at(1))->method('out')\n\t\t\t->with($this->stringContains('[1]'));\n\t\t$this->Shell->expects($this->at(2))->method('out')\n\t\t\t->with($this->stringContains('[2]'));\n\n\t\t$this->Shell->expects($this->once())->method('in')\n\t\t\t->with(__d('cake_console', 'What test case would you like to run?'), null, 'q')\n\t\t\t->will($this->returnValue('1'));\n\n\t\t$this->Shell->expects($this->once())->method('_run');\n\t\t$this->Shell->available();\n\t\t$this->assertEquals(array('core', 'AllBehaviors'), $this->Shell->args);\n\t}\n\n/**\n * Tests that correct option for test runner are passed\n *\n * @return void\n */\n\tpublic function testRunnerOptions() {\n\t\t$this->Shell->startup();\n\t\t$this->Shell->args = array('core', 'Basics');\n\t\t$this->Shell->params = array('filter' => 'myFilter', 'colors' => true, 'verbose' => true);\n\n\t\t$this->Shell->expects($this->once())->method('_run')\n\t\t\t->with(\n\t\t\t\tarray('app' => false, 'plugin' => null, 'core' => true, 'output' => 'text', 'case' => 'Basics'),\n\t\t\t\tarray('--filter', 'myFilter', '--colors', '--verbose')\n\t\t\t);\n\t\t$this->Shell->main();\n\t}\n\n/**\n * Tests that the 'quiet' parameter gets swallowed before calling PHPUnit\n *\n * @return void\n */\n\tpublic function testRunnerOptionsQuiet() {\n\t\t$this->Shell->startup();\n\t\t$this->Shell->args = array('core', 'Basics');\n\t\t$this->Shell->params = array('quiet' => true);\n\n\t\t$this->Shell->expects($this->once())->method('_run')\n\t\t\t->with(\n\t\t\t\tarray('app' => false, 'plugin' => null, 'core' => true, 'output' => 'text', 'case' => 'Basics'),\n\t\t\t\tarray('--colors')\n\t\t\t);\n\t\t$this->Shell->main();\n\t}\n\n/**\n * Tests that the '--directive' parameter change to '-d' before calling PHPUnit\n *\n * @return void\n */\n\tpublic function testRunnerOptionsDirective() {\n\t\t$this->Shell->startup();\n\t\t$this->Shell->args = array('core', 'Basics');\n\t\t$this->Shell->params = array('directive' => 'memory_limit=128M');\n\n\t\t$this->Shell->expects($this->once())->method('_run')\n\t\t\t->with(\n\t\t\t\tarray('app' => false, 'plugin' => null, 'core' => true, 'output' => 'text', 'case' => 'Basics'),\n\t\t\t\tarray('-d', 'memory_limit=128M', '--colors')\n\t\t\t);\n\t\t$this->Shell->main();\n\t}\n}\n", "meta": {"content_hash": "6a24b1b49f2293b93258f70726a16841", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 140, "avg_line_length": 28.854794520547944, "alnum_prop": 0.66473604253703, "repo_name": "ibrsp/comanage-registry", "id": "7dfe63c27f2aa80931528d4553f4728ad271f522", "size": "11209", "binary": false, "copies": "25", "ref": "refs/heads/master", "path": "lib/Cake/Test/Case/Console/Command/TestShellTest.php", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2824"}, {"name": "CSS", "bytes": "480345"}, {"name": "HTML", "bytes": "32588"}, {"name": "JavaScript", "bytes": "267012"}, {"name": "PHP", "bytes": "13272572"}, {"name": "Shell", "bytes": "5430"}, {"name": "XSLT", "bytes": "808"}]}} +{"text": "<?php\n/**\n * EventManager.php\n * 2013 Petr Dvorak, petr-dvorak.cz / 15.4.13 20:21\n */\n\nnamespace ITILSimulator\\Runtime\\Events;\n\nuse ITILSimulator\\Runtime\\Training\\ActiveConfigurationItem;\n\n/**\n * EventManager for publishing and subscribing to events of various types.\n * Events are fired by workflow or UI.\n * @package ITILSimulator\\Runtime\\Events\n */\nclass EventManager\n{\n\t/**\n\t * Event channel listeners\n\t * @var array\n\t */\n\tprotected $listeners = array('*' => array());\n\n\t/**\n\t * IO channel listeners\n\t * @var array\n\t */\n\tprotected $ioListeners = array();\n\n\t#region \"Event channel\"\n\n\t/**\n\t * Dispatch new event through Event channel\n\t * @param $eventName\n\t * @param Event $event\n\t */\n\tpublic function dispatch($eventName, Event $event) {\n\t\t$listeners = $this->listeners['*'];\n\n\t\tif (array_key_exists($eventName, $this->listeners)) {\n\t\t\t$listeners = array_merge($listeners, $this->listeners[$eventName]);\n\t\t}\n\n\t\tif (!$listeners)\n\t\t\treturn;\n\n\t\t$event->setName($eventName);\n\n\t\tforeach ($listeners as $listener) {\n\t\t\tcall_user_func($listener, $event);\n\n\t\t\tif ($event->isPropagationStopped()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Add new listener to Event channel\n\t * @param $eventName\n\t * @param $callback\n\t */\n\tpublic function addListener($eventName, $callback) {\n\t\t$eventName = (string) $eventName;\n\t\tif (!array_key_exists($eventName, $this->listeners))\n\t\t\t$this->listeners[$eventName] = array();\n\n\t\t$this->listeners[$eventName][] = $callback;\n\t}\n\n\t#endregion\n\n\t#region \"IO channel\"\n\n\t/**\n\t * Dispatch event through IO channel\n\t * @param $ioId\n\t */\n\tpublic function dispatchIO($ioId) {\n\t\tif (!isset($this->ioListeners[$ioId]))\n\t\t\treturn;\n\n\t\tforeach($this->ioListeners[$ioId] as $item) {\n\t\t\t/** @var $item ActiveConfigurationItem */\n\t\t\t$item->receiveInput($ioId);\n\t\t}\n\t}\n\n\t/**\n\t * Add new listener to IO channel\n\t * @param $ioId\n\t * @param ActiveConfigurationItem $item\n\t */\n\tpublic function addIOListener($ioId, ActiveConfigurationItem $item) {\n\t\tif (!isset($this->ioListeners[$ioId]))\n\t\t\t$this->ioListeners[$ioId] = array();\n\n\t\t$this->ioListeners[$ioId][] = $item;\n\t}\n\n\t#endregion\n}", "meta": {"content_hash": "430c779bfaabb90858ed23d6b6db9551", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 74, "avg_line_length": 20.41176470588235, "alnum_prop": 0.6575408261287223, "repo_name": "petrolep/itilsimulator", "id": "610590efe72606475569b94a8140a9b99b1b66e9", "size": "2082", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/app/model/Runtime/Events/EventManager.php", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "JavaScript", "bytes": "1336953"}, {"name": "PHP", "bytes": "697825"}, {"name": "Shell", "bytes": "68"}]}} +{"text": "/*\n * This file is derived from various .h and .c files from the zlib-1.0.4\n * distribution by Jean-loup Gailly and Mark Adler, with some additions\n * by Paul Mackerras to aid in implementing Deflate compression and\n * decompression for PPP packets. See zlib.h for conditions of\n * distribution and use.\n *\n * Changes that have been made include:\n * - added Z_PACKET_FLUSH (see zlib.h for details)\n * - added inflateIncomp and deflateOutputPending\n * - allow strm->next_out to be NULL, meaning discard the output\n *\n * $FreeBSD: soc2013/dpl/head/sys/net/zlib.c 246301 2013-01-06 14:59:59Z peter $\n */\n\n/* \n * ==FILEVERSION 971210==\n *\n * This marker is used by the Linux installation script to determine\n * whether an up-to-date version of this file is already installed.\n */\n\n#define NO_DUMMY_DECL\n#define NO_ZCFUNCS\n#define MY_ZCALLOC\n\n#if defined(__FreeBSD__) && defined(_KERNEL)\n#define\t_tr_init\t\t_zlib104_tr_init\n#define\t_tr_align\t\t_zlib104_tr_align\n#define\t_tr_tally\t\t_zlib104_tr_tally\n#define\t_tr_flush_block\t\t_zlib104_tr_flush_block\n#define\t_tr_stored_block\t_zlib104_tr_stored_block\n#define\tinflate_fast\t\t_zlib104_inflate_fast\n#define\tinflate\t\t\t_zlib104_inflate\n#define\tzlibVersion\t\t_zlib104_Version\n#endif\n\n\n/* +++ zutil.h */\n/*-\n * zutil.h -- internal interface and configuration of the compression library\n * Copyright (C) 1995-1996 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n part of the implementation of the compression library and is\n subject to change. Applications should only use zlib.h.\n */\n\n/* From: zutil.h,v 1.16 1996/07/24 13:41:13 me Exp $ */\n\n#ifndef _Z_UTIL_H\n#define _Z_UTIL_H\n\n#ifdef _KERNEL\n#include <net/zlib.h>\n#else\n#include \"zlib.h\"\n#endif\n\n#ifdef _KERNEL\n/* Assume this is a *BSD or SVR4 kernel */\n#include <sys/types.h>\n#include <sys/time.h>\n#include <sys/systm.h>\n#include <sys/param.h>\n#include <sys/kernel.h>\n#include <sys/module.h>\n# define HAVE_MEMCPY\n\n#else\n#if defined(__KERNEL__)\n/* Assume this is a Linux kernel */\n#include <linux/string.h>\n#define HAVE_MEMCPY\n\n#else /* not kernel */\n\n#if defined(MSDOS)||defined(VMS)||defined(CRAY)||defined(WIN32)||defined(RISCOS)\n# include <stddef.h>\n# include <errno.h>\n#else\n extern int errno;\n#endif\n#ifdef STDC\n# include <string.h>\n# include <stdlib.h>\n#endif\n#endif /* __KERNEL__ */\n#endif /* _KERNEL */\n\n#ifndef local\n# define local static\n#endif\n/* compile with -Dlocal if your debugger can't find static symbols */\n\ntypedef unsigned char uch;\ntypedef uch FAR uchf;\ntypedef unsigned short ush;\ntypedef ush FAR ushf;\ntypedef unsigned long ulg;\n\nstatic const char *z_errmsg[10]; /* indexed by 2-zlib_error */\n/* (size given to avoid silly warnings with Visual C++) */\n\n#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]\n\n#define ERR_RETURN(strm,err) \\\n return (strm->msg = (const char*)ERR_MSG(err), (err))\n/* To be used only when the state is known to be valid */\n\n /* common constants */\n\n#ifndef DEF_WBITS\n# define DEF_WBITS MAX_WBITS\n#endif\n/* default windowBits for decompression. MAX_WBITS is for compression only */\n\n#if MAX_MEM_LEVEL >= 8\n# define DEF_MEM_LEVEL 8\n#else\n# define DEF_MEM_LEVEL MAX_MEM_LEVEL\n#endif\n/* default memLevel */\n\n#define STORED_BLOCK 0\n#define STATIC_TREES 1\n#define DYN_TREES 2\n/* The three kinds of block type */\n\n#define MIN_MATCH 3\n#define MAX_MATCH 258\n/* The minimum and maximum match lengths */\n\n#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */\n\n /* target dependencies */\n\n#ifdef MSDOS\n# define OS_CODE 0x00\n# ifdef __TURBOC__\n# include <alloc.h>\n# else /* MSC or DJGPP */\n# include <malloc.h>\n# endif\n#endif\n\n#ifdef OS2\n# define OS_CODE 0x06\n#endif\n\n#ifdef WIN32 /* Window 95 & Windows NT */\n# define OS_CODE 0x0b\n#endif\n\n#if defined(VAXC) || defined(VMS)\n# define OS_CODE 0x02\n# define FOPEN(name, mode) \\\n fopen((name), (mode), \"mbc=60\", \"ctx=stm\", \"rfm=fix\", \"mrs=512\")\n#endif\n\n#ifdef AMIGA\n# define OS_CODE 0x01\n#endif\n\n#if defined(ATARI) || defined(atarist)\n# define OS_CODE 0x05\n#endif\n\n#ifdef MACOS\n# define OS_CODE 0x07\n#endif\n\n#ifdef __50SERIES /* Prime/PRIMOS */\n# define OS_CODE 0x0F\n#endif\n\n#ifdef TOPS20\n# define OS_CODE 0x0a\n#endif\n\n#if defined(_BEOS_) || defined(RISCOS)\n# define fdopen(fd,mode) NULL /* No fdopen() */\n#endif\n\n /* Common defaults */\n\n#ifndef OS_CODE\n# define OS_CODE 0x03 /* assume Unix */\n#endif\n\n#ifndef FOPEN\n# define FOPEN(name, mode) fopen((name), (mode))\n#endif\n\n /* functions */\n\n#ifdef HAVE_STRERROR\n extern char *strerror OF((int));\n# define zstrerror(errnum) strerror(errnum)\n#else\n# define zstrerror(errnum) \"\"\n#endif\n\n#if defined(pyr)\n# define NO_MEMCPY\n#endif\n#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(_MSC_VER)\n /* Use our own functions for small and medium model with MSC <= 5.0.\n * You may have to use the same strategy for Borland C (untested).\n */\n# define NO_MEMCPY\n#endif\n#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)\n# define HAVE_MEMCPY\n#endif\n#ifdef HAVE_MEMCPY\n# ifdef SMALL_MEDIUM /* MSDOS small or medium model */\n# define zmemcpy _fmemcpy\n# define zmemcmp _fmemcmp\n# define zmemzero(dest, len) _fmemset(dest, 0, len)\n# else\n# define zmemcpy memcpy\n# define zmemcmp memcmp\n# define zmemzero(dest, len) memset(dest, 0, len)\n# endif\n#else\n extern void zmemcpy OF((Bytef* dest, Bytef* source, uInt len));\n extern int zmemcmp OF((Bytef* s1, Bytef* s2, uInt len));\n extern void zmemzero OF((Bytef* dest, uInt len));\n#endif\n\n/* Diagnostic functions */\n#ifdef DEBUG_ZLIB\n# include <stdio.h>\n# ifndef verbose\n# define verbose 0\n# endif\n extern void z_error OF((char *m));\n# define Assert(cond,msg) {if(!(cond)) z_error(msg);}\n# define Trace(x) fprintf x\n# define Tracev(x) {if (verbose) fprintf x ;}\n# define Tracevv(x) {if (verbose>1) fprintf x ;}\n# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}\n# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}\n#else\n# define Assert(cond,msg)\n# define Trace(x)\n# define Tracev(x)\n# define Tracevv(x)\n# define Tracec(c,x)\n# define Tracecv(c,x)\n#endif\n\n\ntypedef uLong (*check_func) OF((uLong check, const Bytef *buf, uInt len));\n\nvoidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));\nvoid zcfree OF((voidpf opaque, voidpf ptr));\n\n#define ZALLOC(strm, items, size) \\\n (*((strm)->zalloc))((strm)->opaque, (items), (size))\n#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))\n#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}\n\n#endif /* _Z_UTIL_H */\n/* --- zutil.h */\n\n/* +++ deflate.h */\n/* deflate.h -- internal compression state\n * Copyright (C) 1995-1996 Jean-loup Gailly\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* WARNING: this file should *not* be used by applications. It is\n part of the implementation of the compression library and is\n subject to change. Applications should only use zlib.h.\n */\n\n/* From: deflate.h,v 1.10 1996/07/02 12:41:00 me Exp $ */\n\n#ifndef _DEFLATE_H\n#define _DEFLATE_H\n\n/* #include \"zutil.h\" */\n\n/* ===========================================================================\n * Internal compression state.\n */\n\n#define LENGTH_CODES 29\n/* number of length codes, not counting the special END_BLOCK code */\n\n#define LITERALS 256\n/* number of literal bytes 0..255 */\n\n#define L_CODES (LITERALS+1+LENGTH_CODES)\n/* number of Literal or Length codes, including the END_BLOCK code */\n\n#define D_CODES 30\n/* number of distance codes */\n\n#define BL_CODES 19\n/* number of codes used to transfer the bit lengths */\n\n#define HEAP_SIZE (2*L_CODES+1)\n/* maximum heap size */\n\n#define MAX_BITS 15\n/* All codes must not exceed MAX_BITS bits */\n\n#define INIT_STATE 42\n#define BUSY_STATE 113\n#define FINISH_STATE 666\n/* Stream status */\n\n\n/* Data structure describing a single value and its code string. */\ntypedef struct ct_data_s {\n union {\n ush freq; /* frequency count */\n ush code; /* bit string */\n } fc;\n union {\n ush dad; /* father node in Huffman tree */\n ush len; /* length of bit string */\n } dl;\n} FAR ct_data;\n\n#define Freq fc.freq\n#define Code fc.code\n#define Dad dl.dad\n#define Len dl.len\n\ntypedef struct static_tree_desc_s static_tree_desc;\n\ntypedef struct tree_desc_s {\n ct_data *dyn_tree; /* the dynamic tree */\n int max_code; /* largest code with non zero frequency */\n static_tree_desc *stat_desc; /* the corresponding static tree */\n} FAR tree_desc;\n\ntypedef ush Pos;\ntypedef Pos FAR Posf;\ntypedef unsigned IPos;\n\n/* A Pos is an index in the character window. We use short instead of int to\n * save space in the various tables. IPos is used only for parameter passing.\n */\n\ntypedef struct deflate_state {\n z_streamp strm; /* pointer back to this zlib stream */\n int status; /* as the name implies */\n Bytef *pending_buf; /* output still pending */\n ulg pending_buf_size; /* size of pending_buf */\n Bytef *pending_out; /* next pending byte to output to the stream */\n int pending; /* nb of bytes in the pending buffer */\n int noheader; /* suppress zlib header and adler32 */\n Byte data_type; /* UNKNOWN, BINARY or ASCII */\n Byte method; /* STORED (for zip only) or DEFLATED */\n int last_flush; /* value of flush param for previous deflate call */\n\n /* used by deflate.c: */\n\n uInt w_size; /* LZ77 window size (32K by default) */\n uInt w_bits; /* log2(w_size) (8..16) */\n uInt w_mask; /* w_size - 1 */\n\n Bytef *window;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size. Also, it limits\n * the window size to 64K, which is quite useful on MSDOS.\n * To do: use the user input buffer as sliding window.\n */\n\n ulg window_size;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n Posf *prev;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n Posf *head; /* Heads of the hash chains or NIL. */\n\n uInt ins_h; /* hash index of string to be inserted */\n uInt hash_size; /* number of elements in hash table */\n uInt hash_bits; /* log2(hash_size) */\n uInt hash_mask; /* hash_size-1 */\n\n uInt hash_shift;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n long block_start;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n uInt match_length; /* length of best match */\n IPos prev_match; /* previous match */\n int match_available; /* set if previous match exists */\n uInt strstart; /* start of string to insert */\n uInt match_start; /* start of matching string */\n uInt lookahead; /* number of valid bytes ahead in window */\n\n uInt prev_length;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n uInt max_chain_length;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n uInt max_lazy_match;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n# define max_insert_length max_lazy_match\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n int level; /* compression level (1..9) */\n int strategy; /* favor or force Huffman coding*/\n\n uInt good_match;\n /* Use a faster search when the previous match is longer than this */\n\n int nice_match; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n /* Didn't use ct_data typedef below to supress compiler warning */\n struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n struct tree_desc_s l_desc; /* desc. for literal tree */\n struct tree_desc_s d_desc; /* desc. for distance tree */\n struct tree_desc_s bl_desc; /* desc. for bit length tree */\n\n ush bl_count[MAX_BITS+1];\n /* number of codes at each bit length for an optimal tree */\n\n int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n int heap_len; /* number of elements in the heap */\n int heap_max; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n uch depth[2*L_CODES+1];\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n uchf *l_buf; /* buffer for literals or lengths */\n\n uInt lit_bufsize;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n uInt last_lit; /* running index in l_buf */\n\n ushf *d_buf;\n /* Buffer for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n ulg opt_len; /* bit length of current block with optimal trees */\n ulg static_len; /* bit length of current block with static trees */\n ulg compressed_len; /* total bit length of compressed file */\n uInt matches; /* number of string matches in current block */\n int last_eob_len; /* bit length of EOB code for last block */\n\n#ifdef DEBUG_ZLIB\n ulg bits_sent; /* bit length of the compressed data */\n#endif\n\n ush bi_buf;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n int bi_valid;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n} FAR deflate_state;\n\n/* Output a byte on the stream.\n * IN assertion: there is enough room in pending_buf.\n */\n#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}\n\n\n#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)\n/* Minimum amount of lookahead, except at the end of the input file.\n * See deflate.c for comments about the MIN_MATCH+1.\n */\n\n#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)\n/* In order to simplify the code, particularly on 16 bit machines, match\n * distances are limited to MAX_DIST instead of WSIZE.\n */\n\n /* in trees.c */\nvoid _tr_init OF((deflate_state *s));\nint _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));\nulg _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,\n\t\t\t int eof));\nvoid _tr_align OF((deflate_state *s));\nvoid _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,\n int eof));\nvoid _tr_stored_type_only OF((deflate_state *));\n\n#endif\n/* --- deflate.h */\n\n/* +++ deflate.c */\n/* deflate.c -- compress data using the deflation algorithm\n * Copyright (C) 1995-1996 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/*\n * ALGORITHM\n *\n * The \"deflation\" process depends on being able to identify portions\n * of the input text which are identical to earlier input (within a\n * sliding window trailing behind the input currently being processed).\n *\n * The most straightforward technique turns out to be the fastest for\n * most input files: try all possible matches and select the longest.\n * The key feature of this algorithm is that insertions into the string\n * dictionary are very simple and thus fast, and deletions are avoided\n * completely. Insertions are performed at each input character, whereas\n * string matches are performed only when the previous match ends. So it\n * is preferable to spend more time in matches to allow very fast string\n * insertions and avoid deletions. The matching algorithm for small\n * strings is inspired from that of Rabin & Karp. A brute force approach\n * is used to find longer strings when a small match has been found.\n * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze\n * (by Leonid Broukhis).\n * A previous version of this file used a more sophisticated algorithm\n * (by Fiala and Greene) which is guaranteed to run in linear amortized\n * time, but has a larger average cost, uses more memory and is patented.\n * However the F&G algorithm may be faster for some highly redundant\n * files if the parameter max_chain_length (described below) is too large.\n *\n * ACKNOWLEDGEMENTS\n *\n * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and\n * I found it in 'freeze' written by Leonid Broukhis.\n * Thanks to many people for bug reports and testing.\n *\n * REFERENCES\n *\n * Deutsch, L.P.,\"DEFLATE Compressed Data Format Specification\".\n * Available in ftp://ds.internic.net/rfc/rfc1951.txt\n *\n * A description of the Rabin and Karp algorithm is given in the book\n * \"Algorithms\" by R. Sedgewick, Addison-Wesley, p252.\n *\n * Fiala,E.R., and Greene,D.H.\n * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595\n *\n */\n\n/* From: deflate.c,v 1.15 1996/07/24 13:40:58 me Exp $ */\n\n/* #include \"deflate.h\" */\n\nchar deflate_copyright[] = \" deflate 1.0.4 Copyright 1995-1996 Jean-loup Gailly \";\n/*\n If you use the zlib library in a product, an acknowledgment is welcome\n in the documentation of your product. If for some reason you cannot\n include such an acknowledgment, I would appreciate that you keep this\n copyright string in the executable of your product.\n */\n\n/* ===========================================================================\n * Function prototypes.\n */\ntypedef enum {\n need_more, /* block not completed, need more input or more output */\n block_done, /* block flush performed */\n finish_started, /* finish started, need only more output at next deflate */\n finish_done /* finish done, accept no more input or output */\n} block_state;\n\ntypedef block_state (*compress_func) OF((deflate_state *s, int flush));\n/* Compression function. Returns the block state after the call. */\n\nlocal void fill_window OF((deflate_state *s));\nlocal block_state deflate_stored OF((deflate_state *s, int flush));\nlocal block_state deflate_fast OF((deflate_state *s, int flush));\nlocal block_state deflate_slow OF((deflate_state *s, int flush));\nlocal void lm_init OF((deflate_state *s));\nlocal void putShortMSB OF((deflate_state *s, uInt b));\nlocal void flush_pending OF((z_streamp strm));\nlocal int read_buf OF((z_streamp strm, charf *buf, unsigned size));\n#ifdef ASMV\n void match_init OF((void)); /* asm code initialization */\n uInt longest_match OF((deflate_state *s, IPos cur_match));\n#else\nlocal uInt longest_match OF((deflate_state *s, IPos cur_match));\n#endif\n\n#ifdef DEBUG_ZLIB\nlocal void check_match OF((deflate_state *s, IPos start, IPos match,\n int length));\n#endif\n\n/* ===========================================================================\n * Local data\n */\n\n#define NIL 0\n/* Tail of hash chains */\n\n#ifndef TOO_FAR\n# define TOO_FAR 4096\n#endif\n/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */\n\n#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)\n/* Minimum amount of lookahead, except at the end of the input file.\n * See deflate.c for comments about the MIN_MATCH+1.\n */\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\ntypedef struct config_s {\n ush good_length; /* reduce lazy search above this match length */\n ush max_lazy; /* do not perform lazy search above this match length */\n ush nice_length; /* quit search above this match length */\n ush max_chain;\n compress_func func;\n} config;\n\nlocal config configuration_table[10] = {\n/* good lazy nice chain */\n/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */\n/* 1 */ {4, 4, 8, 4, deflate_fast}, /* maximum speed, no lazy matches */\n/* 2 */ {4, 5, 16, 8, deflate_fast},\n/* 3 */ {4, 6, 32, 32, deflate_fast},\n\n/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */\n/* 5 */ {8, 16, 32, 32, deflate_slow},\n/* 6 */ {8, 16, 128, 128, deflate_slow},\n/* 7 */ {8, 32, 128, 256, deflate_slow},\n/* 8 */ {32, 128, 258, 1024, deflate_slow},\n/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* maximum compression */\n\n/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4\n * For deflate_fast() (levels <= 3) good is ignored and lazy has a different\n * meaning.\n */\n\n#define EQUAL 0\n/* result of memcmp for equal strings */\n\n#ifndef NO_DUMMY_DECL\nstruct static_tree_desc_s {int dummy;}; /* for buggy compilers */\n#endif\n\n/* ===========================================================================\n * Update a hash value with the given input byte\n * IN assertion: all calls to to UPDATE_HASH are made with consecutive\n * input characters, so that a running hash key can be computed from the\n * previous key instead of complete recalculation each time.\n */\n#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)\n\n\n/* ===========================================================================\n * Insert string str in the dictionary and set match_head to the previous head\n * of the hash chain (the most recent string with same hash key). Return\n * the previous length of the hash chain.\n * IN assertion: all calls to to INSERT_STRING are made with consecutive\n * input characters and the first MIN_MATCH bytes of str are valid\n * (except for the last MIN_MATCH-1 bytes of the input file).\n */\n#define INSERT_STRING(s, str, match_head) \\\n (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \\\n s->prev[(str) & s->w_mask] = match_head = s->head[s->ins_h], \\\n s->head[s->ins_h] = (Pos)(str))\n\n/* ===========================================================================\n * Initialize the hash table (avoiding 64K overflow for 16 bit systems).\n * prev[] will be initialized on the fly.\n */\n#define CLEAR_HASH(s) \\\n s->head[s->hash_size-1] = NIL; \\\n zmemzero((charf *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));\n\n/* ========================================================================= */\nint deflateInit_(strm, level, version, stream_size)\n z_streamp strm;\n int level;\n const char *version;\n int stream_size;\n{\n return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,\n\t\t\t Z_DEFAULT_STRATEGY, version, stream_size);\n /* To do: ignore strm->next_in if we use it as window */\n}\n\n/* ========================================================================= */\nint deflateInit2_(strm, level, method, windowBits, memLevel, strategy,\n\t\t version, stream_size)\n z_streamp strm;\n int level;\n int method;\n int windowBits;\n int memLevel;\n int strategy;\n const char *version;\n int stream_size;\n{\n deflate_state *s;\n int noheader = 0;\n static char* my_version = ZLIB_VERSION;\n\n ushf *overlay;\n /* We overlay pending_buf and d_buf+l_buf. This works since the average\n * output size for (length,distance) codes is <= 24 bits.\n */\n\n if (version == Z_NULL || version[0] != my_version[0] ||\n stream_size != sizeof(z_stream)) {\n\treturn Z_VERSION_ERROR;\n }\n if (strm == Z_NULL) return Z_STREAM_ERROR;\n\n strm->msg = Z_NULL;\n#ifndef NO_ZCFUNCS\n if (strm->zalloc == Z_NULL) {\n\tstrm->zalloc = zcalloc;\n\tstrm->opaque = (voidpf)0;\n }\n if (strm->zfree == Z_NULL) strm->zfree = zcfree;\n#endif\n\n if (level == Z_DEFAULT_COMPRESSION) level = 6;\n\n if (windowBits < 0) { /* undocumented feature: suppress zlib header */\n noheader = 1;\n windowBits = -windowBits;\n }\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||\n windowBits < 9 || windowBits > 15 || level < 0 || level > 9 ||\n\tstrategy < 0 || strategy > Z_HUFFMAN_ONLY) {\n return Z_STREAM_ERROR;\n }\n s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));\n if (s == Z_NULL) return Z_MEM_ERROR;\n strm->state = (struct internal_state FAR *)s;\n s->strm = strm;\n\n s->noheader = noheader;\n s->w_bits = windowBits;\n s->w_size = 1 << s->w_bits;\n s->w_mask = s->w_size - 1;\n\n s->hash_bits = memLevel + 7;\n s->hash_size = 1 << s->hash_bits;\n s->hash_mask = s->hash_size - 1;\n s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);\n\n s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));\n s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));\n s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));\n\n s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n s->pending_buf = (uchf *) overlay;\n s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);\n\n if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||\n s->pending_buf == Z_NULL) {\n strm->msg = (const char*)ERR_MSG(Z_MEM_ERROR);\n deflateEnd (strm);\n return Z_MEM_ERROR;\n }\n s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n\n s->level = level;\n s->strategy = strategy;\n s->method = (Byte)method;\n\n return deflateReset(strm);\n}\n\n/* ========================================================================= */\nint deflateSetDictionary (strm, dictionary, dictLength)\n z_streamp strm;\n const Bytef *dictionary;\n uInt dictLength;\n{\n deflate_state *s;\n uInt length = dictLength;\n uInt n;\n IPos hash_head = 0;\n\n if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL)\n\treturn Z_STREAM_ERROR;\n\n s = (deflate_state *) strm->state;\n if (s->status != INIT_STATE) return Z_STREAM_ERROR;\n\n strm->adler = adler32(strm->adler, dictionary, dictLength);\n\n if (length < MIN_MATCH) return Z_OK;\n if (length > MAX_DIST(s)) {\n\tlength = MAX_DIST(s);\n#ifndef USE_DICT_HEAD\n\tdictionary += dictLength - length; /* use the tail of the dictionary */\n#endif\n }\n zmemcpy((charf *)s->window, dictionary, length);\n s->strstart = length;\n s->block_start = (long)length;\n\n /* Insert all strings in the hash table (except for the last two bytes).\n * s->lookahead stays null, so s->ins_h will be recomputed at the next\n * call of fill_window.\n */\n s->ins_h = s->window[0];\n UPDATE_HASH(s, s->ins_h, s->window[1]);\n for (n = 0; n <= length - MIN_MATCH; n++) {\n\tINSERT_STRING(s, n, hash_head);\n }\n if (hash_head) hash_head = 0; /* to make compiler happy */\n return Z_OK;\n}\n\n/* ========================================================================= */\nint deflateReset (strm)\n z_streamp strm;\n{\n deflate_state *s;\n \n if (strm == Z_NULL || strm->state == Z_NULL ||\n strm->zalloc == Z_NULL || strm->zfree == Z_NULL) return Z_STREAM_ERROR;\n\n strm->total_in = strm->total_out = 0;\n strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */\n strm->data_type = Z_UNKNOWN;\n\n s = (deflate_state *)strm->state;\n s->pending = 0;\n s->pending_out = s->pending_buf;\n\n if (s->noheader < 0) {\n s->noheader = 0; /* was set to -1 by deflate(..., Z_FINISH); */\n }\n s->status = s->noheader ? BUSY_STATE : INIT_STATE;\n strm->adler = 1;\n s->last_flush = Z_NO_FLUSH;\n\n _tr_init(s);\n lm_init(s);\n\n return Z_OK;\n}\n\n/* ========================================================================= */\nint deflateParams(strm, level, strategy)\n z_streamp strm;\n int level;\n int strategy;\n{\n deflate_state *s;\n compress_func func;\n int err = Z_OK;\n\n if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n s = (deflate_state *) strm->state;\n\n if (level == Z_DEFAULT_COMPRESSION) {\n\tlevel = 6;\n }\n if (level < 0 || level > 9 || strategy < 0 || strategy > Z_HUFFMAN_ONLY) {\n\treturn Z_STREAM_ERROR;\n }\n func = configuration_table[s->level].func;\n\n if (func != configuration_table[level].func && strm->total_in != 0) {\n\t/* Flush the last buffer: */\n\terr = deflate(strm, Z_PARTIAL_FLUSH);\n }\n if (s->level != level) {\n\ts->level = level;\n\ts->max_lazy_match = configuration_table[level].max_lazy;\n\ts->good_match = configuration_table[level].good_length;\n\ts->nice_match = configuration_table[level].nice_length;\n\ts->max_chain_length = configuration_table[level].max_chain;\n }\n s->strategy = strategy;\n return err;\n}\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nlocal void putShortMSB (s, b)\n deflate_state *s;\n uInt b;\n{\n put_byte(s, (Byte)(b >> 8));\n put_byte(s, (Byte)(b & 0xff));\n} \n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->next_out buffer and copying into it.\n * (See also read_buf()).\n */\nlocal void flush_pending(strm)\n z_streamp strm;\n{\n deflate_state *s = (deflate_state *) strm->state;\n unsigned len = s->pending;\n\n if (len > strm->avail_out) len = strm->avail_out;\n if (len == 0) return;\n\n if (strm->next_out != Z_NULL) {\n\tzmemcpy(strm->next_out, s->pending_out, len);\n\tstrm->next_out += len;\n }\n s->pending_out += len;\n strm->total_out += len;\n strm->avail_out -= len;\n s->pending -= len;\n if (s->pending == 0) {\n s->pending_out = s->pending_buf;\n }\n}\n\n/* ========================================================================= */\nint deflate (strm, flush)\n z_streamp strm;\n int flush;\n{\n int old_flush; /* value of flush param for previous deflate call */\n deflate_state *s;\n\n if (strm == Z_NULL || strm->state == Z_NULL ||\n\tflush > Z_FINISH || flush < 0) {\n return Z_STREAM_ERROR;\n }\n s = (deflate_state *) strm->state;\n\n if ((strm->next_in == Z_NULL && strm->avail_in != 0) ||\n\t(s->status == FINISH_STATE && flush != Z_FINISH)) {\n ERR_RETURN(strm, Z_STREAM_ERROR);\n }\n if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);\n\n s->strm = strm; /* just in case */\n old_flush = s->last_flush;\n s->last_flush = flush;\n\n /* Write the zlib header */\n if (s->status == INIT_STATE) {\n\n uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;\n uInt level_flags = (s->level-1) >> 1;\n\n if (level_flags > 3) level_flags = 3;\n header |= (level_flags << 6);\n\tif (s->strstart != 0) header |= PRESET_DICT;\n header += 31 - (header % 31);\n\n s->status = BUSY_STATE;\n putShortMSB(s, header);\n\n\t/* Save the adler32 of the preset dictionary: */\n\tif (s->strstart != 0) {\n\t putShortMSB(s, (uInt)(strm->adler >> 16));\n\t putShortMSB(s, (uInt)(strm->adler & 0xffff));\n\t}\n\tstrm->adler = 1L;\n }\n\n /* Flush as much pending output as possible */\n if (s->pending != 0) {\n flush_pending(strm);\n if (strm->avail_out == 0) {\n\t /* Since avail_out is 0, deflate will be called again with\n\t * more output space, but possibly with both pending and\n\t * avail_in equal to zero. There won't be anything to do,\n\t * but this is not an error situation so make sure we\n\t * return OK instead of BUF_ERROR at next call of deflate:\n */\n\t s->last_flush = -1;\n\t return Z_OK;\n\t}\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUFF_ERROR.\n */\n } else if (strm->avail_in == 0 && flush <= old_flush &&\n\t flush != Z_FINISH) {\n ERR_RETURN(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s->status == FINISH_STATE && strm->avail_in != 0) {\n ERR_RETURN(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm->avail_in != 0 || s->lookahead != 0 ||\n (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {\n block_state bstate;\n\n\tbstate = (*(configuration_table[s->level].func))(s, flush);\n\n if (bstate == finish_started || bstate == finish_done) {\n s->status = FINISH_STATE;\n }\n if (bstate == need_more || bstate == finish_started) {\n\t if (strm->avail_out == 0) {\n\t s->last_flush = -1; /* avoid BUF_ERROR next call, see above */\n\t }\n\t return Z_OK;\n\t /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n\t * of deflate should use the same flush parameter to make sure\n\t * that the flush is complete. So we don't have to output an\n\t * empty block here, this will be done at next call. This also\n\t * ensures that for a very small output buffer, we emit at most\n\t * one empty block.\n\t */\n\t}\n if (bstate == block_done) {\n if (flush == Z_PARTIAL_FLUSH) {\n _tr_align(s);\n\t } else if (flush == Z_PACKET_FLUSH) {\n\t\t/* Output just the 3-bit `stored' block type value,\n\t\t but not a zero length. */\n\t\t_tr_stored_type_only(s);\n } else { /* FULL_FLUSH or SYNC_FLUSH */\n _tr_stored_block(s, (char*)0, 0L, 0);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush == Z_FULL_FLUSH) {\n CLEAR_HASH(s); /* forget history */\n }\n }\n flush_pending(strm);\n\t if (strm->avail_out == 0) {\n\t s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n\t return Z_OK;\n\t }\n }\n }\n Assert(strm->avail_out > 0, \"bug2\");\n\n if (flush != Z_FINISH) return Z_OK;\n if (s->noheader) return Z_STREAM_END;\n\n /* Write the zlib trailer (adler32) */\n putShortMSB(s, (uInt)(strm->adler >> 16));\n putShortMSB(s, (uInt)(strm->adler & 0xffff));\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n s->noheader = -1; /* write the trailer only once! */\n return s->pending != 0 ? Z_OK : Z_STREAM_END;\n}\n\n/* ========================================================================= */\nint deflateEnd (strm)\n z_streamp strm;\n{\n int status;\n deflate_state *s;\n\n if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n s = (deflate_state *) strm->state;\n\n status = s->status;\n if (status != INIT_STATE && status != BUSY_STATE &&\n\tstatus != FINISH_STATE) {\n return Z_STREAM_ERROR;\n }\n\n /* Deallocate in reverse order of allocations: */\n TRY_FREE(strm, s->pending_buf);\n TRY_FREE(strm, s->head);\n TRY_FREE(strm, s->prev);\n TRY_FREE(strm, s->window);\n\n ZFREE(strm, s);\n strm->state = Z_NULL;\n\n return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;\n}\n\n/* =========================================================================\n * Copy the source state to the destination state.\n */\nint deflateCopy (dest, source)\n z_streamp dest;\n z_streamp source;\n{\n deflate_state *ds;\n deflate_state *ss;\n ushf *overlay;\n\n if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL)\n return Z_STREAM_ERROR;\n ss = (deflate_state *) source->state;\n\n zmemcpy(dest, source, sizeof(*dest));\n\n ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));\n if (ds == Z_NULL) return Z_MEM_ERROR;\n dest->state = (struct internal_state FAR *) ds;\n zmemcpy(ds, ss, sizeof(*ds));\n ds->strm = dest;\n\n ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));\n ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));\n ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));\n overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);\n ds->pending_buf = (uchf *) overlay;\n\n if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||\n ds->pending_buf == Z_NULL) {\n deflateEnd (dest);\n return Z_MEM_ERROR;\n }\n /* ??? following zmemcpy doesn't work for 16-bit MSDOS */\n zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));\n zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));\n zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));\n zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);\n\n ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);\n ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);\n ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;\n\n ds->l_desc.dyn_tree = ds->dyn_ltree;\n ds->d_desc.dyn_tree = ds->dyn_dtree;\n ds->bl_desc.dyn_tree = ds->bl_tree;\n\n return Z_OK;\n}\n\n/* ===========================================================================\n * Return the number of bytes of output which are immediately available\n * for output from the decompressor.\n */\nint deflateOutputPending (strm)\n z_streamp strm;\n{\n if (strm == Z_NULL || strm->state == Z_NULL) return 0;\n \n return ((deflate_state *)(strm->state))->pending;\n}\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->next_in buffer and copying from it.\n * (See also flush_pending()).\n */\nlocal int read_buf(strm, buf, size)\n z_streamp strm;\n charf *buf;\n unsigned size;\n{\n unsigned len = strm->avail_in;\n\n if (len > size) len = size;\n if (len == 0) return 0;\n\n strm->avail_in -= len;\n\n if (!((deflate_state *)(strm->state))->noheader) {\n strm->adler = adler32(strm->adler, strm->next_in, len);\n }\n zmemcpy(buf, strm->next_in, len);\n strm->next_in += len;\n strm->total_in += len;\n\n return (int)len;\n}\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nlocal void lm_init (s)\n deflate_state *s;\n{\n s->window_size = (ulg)2L*s->w_size;\n\n CLEAR_HASH(s);\n\n /* Set the default configuration parameters:\n */\n s->max_lazy_match = configuration_table[s->level].max_lazy;\n s->good_match = configuration_table[s->level].good_length;\n s->nice_match = configuration_table[s->level].nice_length;\n s->max_chain_length = configuration_table[s->level].max_chain;\n\n s->strstart = 0;\n s->block_start = 0L;\n s->lookahead = 0;\n s->match_length = s->prev_length = MIN_MATCH-1;\n s->match_available = 0;\n s->ins_h = 0;\n#ifdef ASMV\n match_init(); /* initialize the asm code */\n#endif\n}\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\n#ifndef ASMV\n/* For 80x86 and 680x0, an optimized version will be provided in match.asm or\n * match.S. The code will be functionally equivalent.\n */\nlocal uInt longest_match(s, cur_match)\n deflate_state *s;\n IPos cur_match; /* current match */\n{\n unsigned chain_length = s->max_chain_length;/* max hash chain length */\n register Bytef *scan = s->window + s->strstart; /* current string */\n register Bytef *match; /* matched string */\n register int len; /* length of current match */\n int best_len = s->prev_length; /* best match length so far */\n int nice_match = s->nice_match; /* stop if match long enough */\n IPos limit = s->strstart > (IPos)MAX_DIST(s) ?\n s->strstart - (IPos)MAX_DIST(s) : NIL;\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n Posf *prev = s->prev;\n uInt wmask = s->w_mask;\n\n#ifdef UNALIGNED_OK\n /* Compare two bytes at a time. Note: this is not always beneficial.\n * Try with and without -DUNALIGNED_OK to check.\n */\n register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;\n register ush scan_start = *(ushf*)scan;\n register ush scan_end = *(ushf*)(scan+best_len-1);\n#else\n register Bytef *strend = s->window + s->strstart + MAX_MATCH;\n register Byte scan_end1 = scan[best_len-1];\n register Byte scan_end = scan[best_len];\n#endif\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s->prev_length >= s->good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;\n\n Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n Assert(cur_match < s->strstart, \"no future\");\n match = s->window + cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2:\n */\n#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)\n /* This code assumes sizeof(unsigned short) == 2. Do not use\n * UNALIGNED_OK if your compiler uses a different size.\n */\n if (*(ushf*)(match+best_len-1) != scan_end ||\n *(ushf*)match != scan_start) continue;\n\n /* It is not necessary to compare scan[2] and match[2] since they are\n * always equal when the other bytes match, given that the hash keys\n * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at\n * strstart+3, +5, ... up to strstart+257. We check for insufficient\n * lookahead only every 4th comparison; the 128th check will be made\n * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is\n * necessary to put more guard bytes at the end of the window, or\n * to check more often for insufficient lookahead.\n */\n Assert(scan[2] == match[2], \"scan[2]?\");\n scan++, match++;\n do {\n } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&\n *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&\n *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&\n *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&\n scan < strend);\n /* The funny \"do {}\" generates better code on most compilers */\n\n /* Here, scan <= window+strstart+257 */\n Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n if (*scan == *match) scan++;\n\n len = (MAX_MATCH - 1) - (int)(strend-scan);\n scan = strend - (MAX_MATCH-1);\n\n#else /* UNALIGNED_OK */\n\n if (match[best_len] != scan_end ||\n match[best_len-1] != scan_end1 ||\n *match != *scan ||\n *++match != scan[1]) continue;\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2, match++;\n Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n } while (*++scan == *++match && *++scan == *++match &&\n *++scan == *++match && *++scan == *++match &&\n *++scan == *++match && *++scan == *++match &&\n *++scan == *++match && *++scan == *++match &&\n scan < strend);\n\n Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (int)(strend - scan);\n scan = strend - MAX_MATCH;\n\n#endif /* UNALIGNED_OK */\n\n if (len > best_len) {\n s->match_start = cur_match;\n best_len = len;\n if (len >= nice_match) break;\n#ifdef UNALIGNED_OK\n scan_end = *(ushf*)(scan+best_len-1);\n#else\n scan_end1 = scan[best_len-1];\n scan_end = scan[best_len];\n#endif\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit\n && --chain_length != 0);\n\n if ((uInt)best_len <= s->lookahead) return best_len;\n return s->lookahead;\n}\n#endif /* ASMV */\n\n#ifdef DEBUG_ZLIB\n/* ===========================================================================\n * Check that the match at match_start is indeed a match.\n */\nlocal void check_match(s, start, match, length)\n deflate_state *s;\n IPos start, match;\n int length;\n{\n /* check that the match is indeed a match */\n if (zmemcmp((charf *)s->window + match,\n (charf *)s->window + start, length) != EQUAL) {\n fprintf(stderr, \" start %u, match %u, length %d\\n\",\n\t\tstart, match, length);\n do {\n\t fprintf(stderr, \"%c%c\", s->window[match++], s->window[start++]);\n\t} while (--length != 0);\n z_error(\"invalid match\");\n }\n if (z_verbose > 1) {\n fprintf(stderr,\"\\\\[%d,%d]\", start-match, length);\n do { putc(s->window[start++], stderr); } while (--length != 0);\n }\n}\n#else\n# define check_match(s, start, match, length)\n#endif\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nlocal void fill_window(s)\n deflate_state *s;\n{\n register unsigned n, m;\n register Posf *p;\n unsigned more; /* Amount of free space at the end of the window. */\n uInt wsize = s->w_size;\n\n do {\n more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);\n\n /* Deal with !@#$% 64K limit: */\n if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n more = wsize;\n\n } else if (more == (unsigned)(-1)) {\n /* Very unlikely, but possible on 16 bit machine if strstart == 0\n * and lookahead == 1 (input done one byte at time)\n */\n more--;\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n } else if (s->strstart >= wsize+MAX_DIST(s)) {\n\n zmemcpy((charf *)s->window, (charf *)s->window+wsize,\n (unsigned)wsize);\n s->match_start -= wsize;\n s->strstart -= wsize; /* we now have strstart >= MAX_DIST */\n s->block_start -= (long) wsize;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n n = s->hash_size;\n p = &s->head[n];\n do {\n m = *--p;\n *p = (Pos)(m >= wsize ? m-wsize : NIL);\n } while (--n);\n\n n = wsize;\n p = &s->prev[n];\n do {\n m = *--p;\n *p = (Pos)(m >= wsize ? m-wsize : NIL);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n more += wsize;\n }\n if (s->strm->avail_in == 0) return;\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n Assert(more >= 2, \"more < 2\");\n\n n = read_buf(s->strm, (charf *)s->window + s->strstart + s->lookahead,\n more);\n s->lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s->lookahead >= MIN_MATCH) {\n s->ins_h = s->window[s->strstart];\n UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);\n#if MIN_MATCH != 3\n Call UPDATE_HASH() MIN_MATCH-3 more times\n#endif\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);\n}\n\n/* ===========================================================================\n * Flush the current block, with given end-of-file flag.\n * IN assertion: strstart is set to the end of the current match.\n */\n#define FLUSH_BLOCK_ONLY(s, eof) { \\\n _tr_flush_block(s, (s->block_start >= 0L ? \\\n (charf *)&s->window[(unsigned)s->block_start] : \\\n (charf *)Z_NULL), \\\n\t\t(ulg)((long)s->strstart - s->block_start), \\\n\t\t(eof)); \\\n s->block_start = s->strstart; \\\n flush_pending(s->strm); \\\n Tracev((stderr,\"[FLUSH]\")); \\\n}\n\n/* Same but force premature exit if necessary. */\n#define FLUSH_BLOCK(s, eof) { \\\n FLUSH_BLOCK_ONLY(s, eof); \\\n if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \\\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nlocal block_state deflate_stored(s, flush)\n deflate_state *s;\n int flush;\n{\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n ulg max_block_size = 0xffff;\n ulg max_start;\n\n if (max_block_size > s->pending_buf_size - 5) {\n max_block_size = s->pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s->lookahead <= 1) {\n\n Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n\t\t s->block_start >= (long)s->w_size, \"slide too late\");\n\n fill_window(s);\n if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;\n\n if (s->lookahead == 0) break; /* flush the current block */\n }\n\tAssert(s->block_start >= 0L, \"block gone\");\n\n\ts->strstart += s->lookahead;\n\ts->lookahead = 0;\n\n\t/* Emit a stored block if pending_buf will be full: */\n \tmax_start = s->block_start + max_block_size;\n if (s->strstart == 0 || (ulg)s->strstart >= max_start) {\n\t /* strstart == 0 is possible when wraparound on 16-bit machine */\n\t s->lookahead = (uInt)(s->strstart - max_start);\n\t s->strstart = (uInt)max_start;\n FLUSH_BLOCK(s, 0);\n\t}\n\t/* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {\n FLUSH_BLOCK(s, 0);\n\t}\n }\n FLUSH_BLOCK(s, flush == Z_FINISH);\n return flush == Z_FINISH ? finish_done : block_done;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nlocal block_state deflate_fast(s, flush)\n deflate_state *s;\n int flush;\n{\n IPos hash_head = NIL; /* head of the hash chain */\n int bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s->lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t return need_more;\n\t }\n if (s->lookahead == 0) break; /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n if (s->lookahead >= MIN_MATCH) {\n INSERT_STRING(s, s->strstart, hash_head);\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n if (s->strategy != Z_HUFFMAN_ONLY) {\n s->match_length = longest_match (s, hash_head);\n }\n /* longest_match() sets match_start */\n }\n if (s->match_length >= MIN_MATCH) {\n check_match(s, s->strstart, s->match_start, s->match_length);\n\n bflush = _tr_tally(s, s->strstart - s->match_start,\n s->match_length - MIN_MATCH);\n\n s->lookahead -= s->match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s->match_length <= s->max_insert_length &&\n s->lookahead >= MIN_MATCH) {\n s->match_length--; /* string at strstart already in hash table */\n do {\n s->strstart++;\n INSERT_STRING(s, s->strstart, hash_head);\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s->match_length != 0);\n s->strstart++; \n } else {\n s->strstart += s->match_length;\n s->match_length = 0;\n s->ins_h = s->window[s->strstart];\n UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);\n#if MIN_MATCH != 3\n Call UPDATE_HASH() MIN_MATCH-3 more times\n#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n Tracevv((stderr,\"%c\", s->window[s->strstart]));\n bflush = _tr_tally (s, 0, s->window[s->strstart]);\n s->lookahead--;\n s->strstart++; \n }\n if (bflush) FLUSH_BLOCK(s, 0);\n }\n FLUSH_BLOCK(s, flush == Z_FINISH);\n return flush == Z_FINISH ? finish_done : block_done;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nlocal block_state deflate_slow(s, flush)\n deflate_state *s;\n int flush;\n{\n IPos hash_head = NIL; /* head of hash chain */\n int bflush; /* set if current block must be flushed */\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s->lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t return need_more;\n\t }\n if (s->lookahead == 0) break; /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n if (s->lookahead >= MIN_MATCH) {\n INSERT_STRING(s, s->strstart, hash_head);\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s->prev_length = s->match_length, s->prev_match = s->match_start;\n s->match_length = MIN_MATCH-1;\n\n if (hash_head != NIL && s->prev_length < s->max_lazy_match &&\n s->strstart - hash_head <= MAX_DIST(s)) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n if (s->strategy != Z_HUFFMAN_ONLY) {\n s->match_length = longest_match (s, hash_head);\n }\n /* longest_match() sets match_start */\n\n if (s->match_length <= 5 && (s->strategy == Z_FILTERED ||\n (s->match_length == MIN_MATCH &&\n s->strstart - s->match_start > TOO_FAR))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s->match_length = MIN_MATCH-1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {\n uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n check_match(s, s->strstart-1, s->prev_match, s->prev_length);\n\n bflush = _tr_tally(s, s->strstart -1 - s->prev_match,\n s->prev_length - MIN_MATCH);\n\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s->lookahead -= s->prev_length-1;\n s->prev_length -= 2;\n do {\n if (++s->strstart <= max_insert) {\n INSERT_STRING(s, s->strstart, hash_head);\n }\n } while (--s->prev_length != 0);\n s->match_available = 0;\n s->match_length = MIN_MATCH-1;\n s->strstart++;\n\n if (bflush) FLUSH_BLOCK(s, 0);\n\n } else if (s->match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n if (_tr_tally (s, 0, s->window[s->strstart-1])) {\n FLUSH_BLOCK_ONLY(s, 0);\n }\n s->strstart++;\n s->lookahead--;\n if (s->strm->avail_out == 0) return need_more;\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s->match_available = 1;\n s->strstart++;\n s->lookahead--;\n }\n }\n Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s->match_available) {\n Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n _tr_tally (s, 0, s->window[s->strstart-1]);\n s->match_available = 0;\n }\n FLUSH_BLOCK(s, flush == Z_FINISH);\n return flush == Z_FINISH ? finish_done : block_done;\n}\n/* --- deflate.c */\n\n/* +++ trees.c */\n/* trees.c -- output deflated data using Huffman coding\n * Copyright (C) 1995-1996 Jean-loup Gailly\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/*\n * ALGORITHM\n *\n * The \"deflation\" process uses several Huffman trees. The more\n * common source values are represented by shorter bit sequences.\n *\n * Each code tree is stored in a compressed form which is itself\n * a Huffman encoding of the lengths of all the code strings (in\n * ascending order by source values). The actual code strings are\n * reconstructed from the lengths in the inflate process, as described\n * in the deflate specification.\n *\n * REFERENCES\n *\n * Deutsch, L.P.,\"'Deflate' Compressed Data Format Specification\".\n * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc\n *\n * Storer, James A.\n * Data Compression: Methods and Theory, pp. 49-50.\n * Computer Science Press, 1988. ISBN 0-7167-8156-5.\n *\n * Sedgewick, R.\n * Algorithms, p290.\n * Addison-Wesley, 1983. ISBN 0-201-06672-6.\n */\n\n/* From: trees.c,v 1.11 1996/07/24 13:41:06 me Exp $ */\n\n/* #include \"deflate.h\" */\n\n#ifdef DEBUG_ZLIB\n# include <ctype.h>\n#endif\n\n/* ===========================================================================\n * Constants\n */\n\n#define MAX_BL_BITS 7\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\n#define END_BLOCK 256\n/* end of block literal code */\n\n#define REP_3_6 16\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\n#define REPZ_3_10 17\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\n#define REPZ_11_138 18\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\nlocal int extra_lbits[LENGTH_CODES] /* extra bits for each length code */\n = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};\n\nlocal int extra_dbits[D_CODES] /* extra bits for each distance code */\n = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};\n\nlocal int extra_blbits[BL_CODES]/* extra bits for each bit length code */\n = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};\n\nlocal uch bl_order[BL_CODES]\n = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n#define Buf_size (8 * 2*sizeof(char))\n/* Number of bits used within bi_buf. (bi_buf might be implemented on\n * more than 16 bits on some systems.)\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\nlocal ct_data static_ltree[L_CODES+2];\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nlocal ct_data static_dtree[D_CODES];\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nlocal uch dist_code[512];\n/* distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nlocal uch length_code[MAX_MATCH-MIN_MATCH+1];\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nlocal int base_length[LENGTH_CODES];\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nlocal int base_dist[D_CODES];\n/* First normalized distance for each code (0 = distance of 1) */\n\nstruct static_tree_desc_s {\n ct_data *static_tree; /* static tree or NULL */\n intf *extra_bits; /* extra bits for each code or NULL */\n int extra_base; /* base index for extra_bits */\n int elems; /* max number of elements in the tree */\n int max_length; /* max bit length for the codes */\n};\n\nlocal static_tree_desc static_l_desc =\n{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};\n\nlocal static_tree_desc static_d_desc =\n{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};\n\nlocal static_tree_desc static_bl_desc =\n{(ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};\n\n/* ===========================================================================\n * Local (static) routines in this file.\n */\n\nlocal void tr_static_init OF((void));\nlocal void init_block OF((deflate_state *s));\nlocal void pqdownheap OF((deflate_state *s, ct_data *tree, int k));\nlocal void gen_bitlen OF((deflate_state *s, tree_desc *desc));\nlocal void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count));\nlocal void build_tree OF((deflate_state *s, tree_desc *desc));\nlocal void scan_tree OF((deflate_state *s, ct_data *tree, int max_code));\nlocal void send_tree OF((deflate_state *s, ct_data *tree, int max_code));\nlocal int build_bl_tree OF((deflate_state *s));\nlocal void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,\n int blcodes));\nlocal void compress_block OF((deflate_state *s, ct_data *ltree,\n ct_data *dtree));\nlocal void set_data_type OF((deflate_state *s));\nlocal unsigned bi_reverse OF((unsigned value, int length));\nlocal void bi_windup OF((deflate_state *s));\nlocal void bi_flush OF((deflate_state *s));\nlocal void copy_block OF((deflate_state *s, charf *buf, unsigned len,\n int header));\n\n#ifndef DEBUG_ZLIB\n# define send_code(s, c, tree) send_bits(s, tree[(c)].Code, tree[(c)].Len)\n /* Send a code of the given tree. c and tree must not have side effects */\n\n#else /* DEBUG_ZLIB */\n# define send_code(s, c, tree) \\\n { if (verbose>2) fprintf(stderr,\"\\ncd %3d \",(c)); \\\n send_bits(s, tree[c].Code, tree[c].Len); }\n#endif\n\n#define d_code(dist) \\\n ((dist) < 256 ? dist_code[dist] : dist_code[256+((dist)>>7)])\n/* Mapping from a distance to a distance code. dist is the distance - 1 and\n * must not have side effects. dist_code[256] and dist_code[257] are never\n * used.\n */\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\n#define put_short(s, w) { \\\n put_byte(s, (uch)((w) & 0xff)); \\\n put_byte(s, (uch)((ush)(w) >> 8)); \\\n}\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\n#ifdef DEBUG_ZLIB\nlocal void send_bits OF((deflate_state *s, int value, int length));\n\nlocal void send_bits(s, value, length)\n deflate_state *s;\n int value; /* value to send */\n int length; /* number of bits */\n{\n Tracevv((stderr,\" l %2d v %4x \", length, value));\n Assert(length > 0 && length <= 15, \"invalid length\");\n s->bits_sent += (ulg)length;\n\n /* If not enough room in bi_buf, use (valid) bits from bi_buf and\n * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))\n * unused bits in value.\n */\n if (s->bi_valid > (int)Buf_size - length) {\n s->bi_buf |= (value << s->bi_valid);\n put_short(s, s->bi_buf);\n s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);\n s->bi_valid += length - Buf_size;\n } else {\n s->bi_buf |= value << s->bi_valid;\n s->bi_valid += length;\n }\n}\n#else /* !DEBUG_ZLIB */\n\n#define send_bits(s, value, length) \\\n{ int len = (length);\\\n if ((s)->bi_valid > (int)Buf_size - len) {\\\n int val = (value);\\\n (s)->bi_buf |= (val << (s)->bi_valid);\\\n put_short((s), (s)->bi_buf);\\\n (s)->bi_buf = (ush)val >> (Buf_size - (s)->bi_valid);\\\n (s)->bi_valid += len - Buf_size;\\\n } else {\\\n (s)->bi_buf |= (value) << (s)->bi_valid;\\\n (s)->bi_valid += len;\\\n }\\\n}\n#endif /* DEBUG_ZLIB */\n\n/* the arguments must not have side effects */\n\n/* ===========================================================================\n * Initialize the various 'constant' tables. In a multi-threaded environment,\n * this function may be called by two threads concurrently, but this is\n * harmless since both invocations do exactly the same thing.\n */\nlocal void tr_static_init()\n{\n static int static_init_done = 0;\n int n; /* iterates over tree elements */\n int bits; /* bit counter */\n int length; /* length value */\n int code; /* code value */\n int dist; /* distance index */\n ush bl_count[MAX_BITS+1];\n /* number of codes at each bit length for an optimal tree */\n\n if (static_init_done) return;\n\n /* Initialize the mapping length (0..255) -> length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES-1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1<<extra_lbits[code]); n++) {\n length_code[length++] = (uch)code;\n }\n }\n Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n length_code[length-1] = (uch)code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0 ; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1<<extra_dbits[code]); n++) {\n dist_code[dist++] = (uch)code;\n }\n }\n Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for ( ; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {\n dist_code[256 + dist++] = (uch)code;\n }\n }\n Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;\n n = 0;\n while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;\n while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;\n while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;\n while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n].Len = 5;\n static_dtree[n].Code = bi_reverse((unsigned)n, 5);\n }\n static_init_done = 1;\n}\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nvoid _tr_init(s)\n deflate_state *s;\n{\n tr_static_init();\n\n s->compressed_len = 0L;\n\n s->l_desc.dyn_tree = s->dyn_ltree;\n s->l_desc.stat_desc = &static_l_desc;\n\n s->d_desc.dyn_tree = s->dyn_dtree;\n s->d_desc.stat_desc = &static_d_desc;\n\n s->bl_desc.dyn_tree = s->bl_tree;\n s->bl_desc.stat_desc = &static_bl_desc;\n\n s->bi_buf = 0;\n s->bi_valid = 0;\n s->last_eob_len = 8; /* enough lookahead for inflate */\n#ifdef DEBUG_ZLIB\n s->bits_sent = 0L;\n#endif\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n/* ===========================================================================\n * Initialize a new block.\n */\nlocal void init_block(s)\n deflate_state *s;\n{\n int n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;\n for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;\n for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;\n\n s->dyn_ltree[END_BLOCK].Freq = 1;\n s->opt_len = s->static_len = 0L;\n s->last_lit = s->matches = 0;\n}\n\n#define SMALLEST 1\n/* Index within the heap array of least frequent node in the Huffman tree */\n\n\n/* ===========================================================================\n * Remove the smallest element from the heap and recreate the heap with\n * one less element. Updates heap and heap_len.\n */\n#define pqremove(s, tree, top) \\\n{\\\n top = s->heap[SMALLEST]; \\\n s->heap[SMALLEST] = s->heap[s->heap_len--]; \\\n pqdownheap(s, tree, SMALLEST); \\\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\n#define smaller(tree, n, m, depth) \\\n (tree[n].Freq < tree[m].Freq || \\\n (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nlocal void pqdownheap(s, tree, k)\n deflate_state *s;\n ct_data *tree; /* the tree to restore */\n int k; /* node to move down */\n{\n int v = s->heap[k];\n int j = k << 1; /* left son of k */\n while (j <= s->heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s->heap_len &&\n smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s->heap[j], s->depth)) break;\n\n /* Exchange v with the smallest son */\n s->heap[k] = s->heap[j]; k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s->heap[k] = v;\n}\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nlocal void gen_bitlen(s, desc)\n deflate_state *s;\n tree_desc *desc; /* the tree descriptor */\n{\n ct_data *tree = desc->dyn_tree;\n int max_code = desc->max_code;\n ct_data *stree = desc->stat_desc->static_tree;\n intf *extra = desc->stat_desc->extra_bits;\n int base = desc->stat_desc->extra_base;\n int max_length = desc->stat_desc->max_length;\n int h; /* heap index */\n int n, m; /* iterate over the tree elements */\n int bits; /* bit length */\n int xbits; /* extra bits */\n ush f; /* frequency */\n int overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */\n\n for (h = s->heap_max+1; h < HEAP_SIZE; h++) {\n n = s->heap[h];\n bits = tree[tree[n].Dad].Len + 1;\n if (bits > max_length) bits = max_length, overflow++;\n tree[n].Len = (ush)bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) continue; /* not a leaf node */\n\n s->bl_count[bits]++;\n xbits = 0;\n if (n >= base) xbits = extra[n-base];\n f = tree[n].Freq;\n s->opt_len += (ulg)f * (bits + xbits);\n if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);\n }\n if (overflow == 0) return;\n\n Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length-1;\n while (s->bl_count[bits] == 0) bits--;\n s->bl_count[bits]--; /* move one leaf down the tree */\n s->bl_count[bits+1] += 2; /* move one overflow item as its brother */\n s->bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits != 0; bits--) {\n n = s->bl_count[bits];\n while (n != 0) {\n m = s->heap[--h];\n if (m > max_code) continue;\n if (tree[m].Len != (unsigned) bits) {\n Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s->opt_len += ((long)bits - (long)tree[m].Len)\n *(long)tree[m].Freq;\n tree[m].Len = (ush)bits;\n }\n n--;\n }\n }\n}\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nlocal void gen_codes (tree, max_code, bl_count)\n ct_data *tree; /* the tree to decorate */\n int max_code; /* largest code with non zero frequency */\n ushf *bl_count; /* number of codes at each bit length */\n{\n ush next_code[MAX_BITS+1]; /* next code value for each bit length */\n ush code = 0; /* running code value */\n int bits; /* bit index */\n int n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits-1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n \"inconsistent bit counts\");\n Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n int len = tree[n].Len;\n if (len == 0) continue;\n /* Now reverse the bits */\n tree[n].Code = bi_reverse(next_code[len]++, len);\n\n Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nlocal void build_tree(s, desc)\n deflate_state *s;\n tree_desc *desc; /* the tree descriptor */\n{\n ct_data *tree = desc->dyn_tree;\n ct_data *stree = desc->stat_desc->static_tree;\n int elems = desc->stat_desc->elems;\n int n, m; /* iterate over heap elements */\n int max_code = -1; /* largest code with non zero frequency */\n int node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s->heap_len = 0, s->heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n].Freq != 0) {\n s->heap[++(s->heap_len)] = max_code = n;\n s->depth[n] = 0;\n } else {\n tree[n].Len = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s->heap_len < 2) {\n node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);\n tree[node].Freq = 1;\n s->depth[node] = 0;\n s->opt_len--; if (stree) s->static_len -= stree[node].Len;\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc->max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n pqremove(s, tree, n); /* n = node of least frequency */\n m = s->heap[SMALLEST]; /* m = node of next least frequency */\n\n s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */\n s->heap[--(s->heap_max)] = m;\n\n /* Create a new node father of n and m */\n tree[node].Freq = tree[n].Freq + tree[m].Freq;\n s->depth[node] = (uch) (MAX(s->depth[n], s->depth[m]) + 1);\n tree[n].Dad = tree[m].Dad = (ush)node;\n#ifdef DUMP_BL_TREE\n if (tree == s->bl_tree) {\n fprintf(stderr,\"\\nnode %d(%d), sons %d(%d) %d(%d)\",\n node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);\n }\n#endif\n /* and insert the new node in the heap */\n s->heap[SMALLEST] = node++;\n pqdownheap(s, tree, SMALLEST);\n\n } while (s->heap_len >= 2);\n\n s->heap[--(s->heap_max)] = s->heap[SMALLEST];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, (tree_desc *)desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes ((ct_data *)tree, max_code, s->bl_count);\n}\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nlocal void scan_tree (s, tree, max_code)\n deflate_state *s;\n ct_data *tree; /* the tree to be scanned */\n int max_code; /* and its largest code of non zero frequency */\n{\n int n; /* iterates over all tree elements */\n int prevlen = -1; /* last emitted length */\n int curlen; /* length of current code */\n int nextlen = tree[0].Len; /* length of next code */\n int count = 0; /* repeat count of the current code */\n int max_count = 7; /* max repeat count */\n int min_count = 4; /* min repeat count */\n\n if (nextlen == 0) max_count = 138, min_count = 3;\n tree[max_code+1].Len = (ush)0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen; nextlen = tree[n+1].Len;\n if (++count < max_count && curlen == nextlen) {\n continue;\n } else if (count < min_count) {\n s->bl_tree[curlen].Freq += count;\n } else if (curlen != 0) {\n if (curlen != prevlen) s->bl_tree[curlen].Freq++;\n s->bl_tree[REP_3_6].Freq++;\n } else if (count <= 10) {\n s->bl_tree[REPZ_3_10].Freq++;\n } else {\n s->bl_tree[REPZ_11_138].Freq++;\n }\n count = 0; prevlen = curlen;\n if (nextlen == 0) {\n max_count = 138, min_count = 3;\n } else if (curlen == nextlen) {\n max_count = 6, min_count = 3;\n } else {\n max_count = 7, min_count = 4;\n }\n }\n}\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nlocal void send_tree (s, tree, max_code)\n deflate_state *s;\n ct_data *tree; /* the tree to be scanned */\n int max_code; /* and its largest code of non zero frequency */\n{\n int n; /* iterates over all tree elements */\n int prevlen = -1; /* last emitted length */\n int curlen; /* length of current code */\n int nextlen = tree[0].Len; /* length of next code */\n int count = 0; /* repeat count of the current code */\n int max_count = 7; /* max repeat count */\n int min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen == 0) max_count = 138, min_count = 3;\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen; nextlen = tree[n+1].Len;\n if (++count < max_count && curlen == nextlen) {\n continue;\n } else if (count < min_count) {\n do { send_code(s, curlen, s->bl_tree); } while (--count != 0);\n\n } else if (curlen != 0) {\n if (curlen != prevlen) {\n send_code(s, curlen, s->bl_tree); count--;\n }\n Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);\n }\n count = 0; prevlen = curlen;\n if (nextlen == 0) {\n max_count = 138, min_count = 3;\n } else if (curlen == nextlen) {\n max_count = 6, min_count = 3;\n } else {\n max_count = 7, min_count = 4;\n }\n }\n}\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nlocal int build_bl_tree(s)\n deflate_state *s;\n{\n int max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);\n scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, (tree_desc *)(&(s->bl_desc)));\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {\n if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;\n }\n /* Update opt_len to include the bit length tree and counts */\n s->opt_len += 3*(max_blindex+1) + 5+5+4;\n Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nlocal void send_all_trees(s, lcodes, dcodes, blcodes)\n deflate_state *s;\n int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n int rank; /* index in bl_order */\n\n Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n \"too many codes\");\n Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes-1, 5);\n send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);\n }\n Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */\n Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */\n Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n/* ===========================================================================\n * Send a stored block\n */\nvoid _tr_stored_block(s, buf, stored_len, eof)\n deflate_state *s;\n charf *buf; /* input block */\n ulg stored_len; /* length of input block */\n int eof; /* true if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */\n s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;\n s->compressed_len += (stored_len + 4) << 3;\n\n copy_block(s, buf, (unsigned)stored_len, 1); /* with header */\n}\n\n/* Send just the `stored block' type code without any length bytes or data.\n */\nvoid _tr_stored_type_only(s)\n deflate_state *s;\n{\n send_bits(s, (STORED_BLOCK << 1), 3);\n bi_windup(s);\n s->compressed_len = (s->compressed_len + 3) & ~7L;\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n * The current inflate code requires 9 bits of lookahead. If the\n * last two codes for the previous block (real code plus EOB) were coded\n * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode\n * the last real code. In this case we send two empty static blocks instead\n * of one. (There are no problems if the previous block is stored or fixed.)\n * To simplify the code, we assume the worst case of last real code encoded\n * on one bit only.\n */\nvoid _tr_align(s)\n deflate_state *s;\n{\n send_bits(s, STATIC_TREES<<1, 3);\n send_code(s, END_BLOCK, static_ltree);\n s->compressed_len += 10L; /* 3 for block type, 7 for EOB */\n bi_flush(s);\n /* Of the 10 bits for the empty block, we have already sent\n * (10 - bi_valid) bits. The lookahead for the last real code (before\n * the EOB of the previous block) was thus at least one plus the length\n * of the EOB plus what we have just sent of the empty static block.\n */\n if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {\n send_bits(s, STATIC_TREES<<1, 3);\n send_code(s, END_BLOCK, static_ltree);\n s->compressed_len += 10L;\n bi_flush(s);\n }\n s->last_eob_len = 7;\n}\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file. This function\n * returns the total compressed length for the file so far.\n */\nulg _tr_flush_block(s, buf, stored_len, eof)\n deflate_state *s;\n charf *buf; /* input block, or NULL if too old */\n ulg stored_len; /* length of input block */\n int eof; /* true if this is the last block for a file */\n{\n ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n int max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s->level > 0) {\n\n\t /* Check if the file is ascii or binary */\n\tif (s->data_type == Z_UNKNOWN) set_data_type(s);\n\n\t/* Construct the literal and distance trees */\n\tbuild_tree(s, (tree_desc *)(&(s->l_desc)));\n\tTracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n\t\ts->static_len));\n\n\tbuild_tree(s, (tree_desc *)(&(s->d_desc)));\n\tTracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n\t\ts->static_len));\n\t/* At this point, opt_len and static_len are the total bit lengths of\n\t * the compressed block data, excluding the tree representations.\n\t */\n\n\t/* Build the bit length tree for the above two trees, and get the index\n\t * in bl_order of the last bit length code to send.\n\t */\n\tmax_blindex = build_bl_tree(s);\n\n\t/* Determine the best encoding. Compute first the block length in bytes*/\n\topt_lenb = (s->opt_len+3+7)>>3;\n\tstatic_lenb = (s->static_len+3+7)>>3;\n\n\tTracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n\t\topt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n\t\ts->last_lit));\n\n\tif (static_lenb <= opt_lenb) opt_lenb = static_lenb;\n\n } else {\n Assert(buf != (char*)0, \"lost buf\");\n\topt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n /* If compression failed and this is the first and last block,\n * and if the .zip file can be seeked (to rewrite the local header),\n * the whole file is transformed into a stored file:\n */\n#ifdef STORED_FILE_OK\n# ifdef FORCE_STORED_FILE\n if (eof && s->compressed_len == 0L) { /* force stored file */\n# else\n if (stored_len <= opt_lenb && eof && s->compressed_len==0L && seekable()) {\n# endif\n /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */\n if (buf == (charf*)0) error (\"block vanished\");\n\n copy_block(s, buf, (unsigned)stored_len, 0); /* without header */\n s->compressed_len = stored_len << 3;\n s->method = STORED;\n } else\n#endif /* STORED_FILE_OK */\n\n#ifdef FORCE_STORED\n if (buf != (char*)0) { /* force stored block */\n#else\n if (stored_len+4 <= opt_lenb && buf != (char*)0) {\n /* 4: two words for the lengths */\n#endif\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, eof);\n\n#ifdef FORCE_STATIC\n } else if (static_lenb >= 0) { /* force static trees */\n#else\n } else if (static_lenb == opt_lenb) {\n#endif\n send_bits(s, (STATIC_TREES<<1)+eof, 3);\n compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);\n s->compressed_len += 3 + s->static_len;\n } else {\n send_bits(s, (DYN_TREES<<1)+eof, 3);\n send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,\n max_blindex+1);\n compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);\n s->compressed_len += 3 + s->opt_len;\n }\n Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n init_block(s);\n\n if (eof) {\n bi_windup(s);\n s->compressed_len += 7; /* align on byte boundary */\n }\n Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n s->compressed_len-7*eof));\n\n return s->compressed_len >> 3;\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nint _tr_tally (s, dist, lc)\n deflate_state *s;\n unsigned dist; /* distance of matched string */\n unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n s->d_buf[s->last_lit] = (ush)dist;\n s->l_buf[s->last_lit++] = (uch)lc;\n if (dist == 0) {\n /* lc is the unmatched char */\n s->dyn_ltree[lc].Freq++;\n } else {\n s->matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n Assert((ush)dist < (ush)MAX_DIST(s) &&\n (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s->dyn_ltree[length_code[lc]+LITERALS+1].Freq++;\n s->dyn_dtree[d_code(dist)].Freq++;\n }\n\n /* Try to guess if it is profitable to stop the current block here */\n if (s->level > 2 && (s->last_lit & 0xfff) == 0) {\n /* Compute an upper bound for the compressed length */\n ulg out_length = (ulg)s->last_lit*8L;\n ulg in_length = (ulg)((long)s->strstart - s->block_start);\n int dcode;\n for (dcode = 0; dcode < D_CODES; dcode++) {\n out_length += (ulg)s->dyn_dtree[dcode].Freq *\n (5L+extra_dbits[dcode]);\n }\n out_length >>= 3;\n Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n s->last_lit, in_length, out_length,\n 100L - out_length*100L/in_length));\n if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;\n }\n return (s->last_lit == s->lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nlocal void compress_block(s, ltree, dtree)\n deflate_state *s;\n ct_data *ltree; /* literal tree */\n ct_data *dtree; /* distance tree */\n{\n unsigned dist; /* distance of matched string */\n int lc; /* match length or unmatched char (if dist == 0) */\n unsigned lx = 0; /* running index in l_buf */\n unsigned code; /* the code to send */\n int extra; /* number of extra bits to send */\n\n if (s->last_lit != 0) do {\n dist = s->d_buf[lx];\n lc = s->l_buf[lx++];\n if (dist == 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = length_code[lc];\n send_code(s, code+LITERALS+1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra != 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra != 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n Assert(s->pending < s->lit_bufsize + 2*lx, \"pendingBuf overflow\");\n\n } while (lx < s->last_lit);\n\n send_code(s, END_BLOCK, ltree);\n s->last_eob_len = ltree[END_BLOCK].Len;\n}\n\n/* ===========================================================================\n * Set the data type to ASCII or BINARY, using a crude approximation:\n * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise.\n * IN assertion: the fields freq of dyn_ltree are set and the total of all\n * frequencies does not exceed 64K (to fit in an int on 16 bit machines).\n */\nlocal void set_data_type(s)\n deflate_state *s;\n{\n int n = 0;\n unsigned ascii_freq = 0;\n unsigned bin_freq = 0;\n while (n < 7) bin_freq += s->dyn_ltree[n++].Freq;\n while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq;\n while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq;\n s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII);\n}\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nlocal unsigned bi_reverse(code, len)\n unsigned code; /* the value to invert */\n int len; /* its bit length */\n{\n register unsigned res = 0;\n do {\n res |= code & 1;\n code >>= 1, res <<= 1;\n } while (--len > 0);\n return res >> 1;\n}\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nlocal void bi_flush(s)\n deflate_state *s;\n{\n if (s->bi_valid == 16) {\n put_short(s, s->bi_buf);\n s->bi_buf = 0;\n s->bi_valid = 0;\n } else if (s->bi_valid >= 8) {\n put_byte(s, (Byte)s->bi_buf);\n s->bi_buf >>= 8;\n s->bi_valid -= 8;\n }\n}\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nlocal void bi_windup(s)\n deflate_state *s;\n{\n if (s->bi_valid > 8) {\n put_short(s, s->bi_buf);\n } else if (s->bi_valid > 0) {\n put_byte(s, (Byte)s->bi_buf);\n }\n s->bi_buf = 0;\n s->bi_valid = 0;\n#ifdef DEBUG_ZLIB\n s->bits_sent = (s->bits_sent+7) & ~7;\n#endif\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nlocal void copy_block(s, buf, len, header)\n deflate_state *s;\n charf *buf; /* the input data */\n unsigned len; /* its length */\n int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n s->last_eob_len = 8; /* enough lookahead for inflate */\n\n if (header) {\n put_short(s, (ush)len); \n put_short(s, (ush)~len);\n#ifdef DEBUG_ZLIB\n s->bits_sent += 2*16;\n#endif\n }\n#ifdef DEBUG_ZLIB\n s->bits_sent += (ulg)len<<3;\n#endif\n /* bundle up the put_byte(s, *buf++) calls */\n zmemcpy(&s->pending_buf[s->pending], buf, len);\n s->pending += len;\n}\n/* --- trees.c */\n\n/* +++ inflate.c */\n/* inflate.c -- zlib interface to inflate modules\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* #include \"zutil.h\" */\n\n/* +++ infblock.h */\n/* infblock.h -- header to use infblock.c\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* WARNING: this file should *not* be used by applications. It is\n part of the implementation of the compression library and is\n subject to change. Applications should only use zlib.h.\n */\n\nstruct inflate_blocks_state;\ntypedef struct inflate_blocks_state FAR inflate_blocks_statef;\n\nextern inflate_blocks_statef * inflate_blocks_new OF((\n z_streamp z,\n check_func c, /* check function */\n uInt w)); /* window size */\n\nextern int inflate_blocks OF((\n inflate_blocks_statef *,\n z_streamp ,\n int)); /* initial return code */\n\nextern void inflate_blocks_reset OF((\n inflate_blocks_statef *,\n z_streamp ,\n uLongf *)); /* check value on output */\n\nextern int inflate_blocks_free OF((\n inflate_blocks_statef *,\n z_streamp ,\n uLongf *)); /* check value on output */\n\nextern void inflate_set_dictionary OF((\n inflate_blocks_statef *s,\n const Bytef *d, /* dictionary */\n uInt n)); /* dictionary length */\n\nextern int inflate_addhistory OF((\n inflate_blocks_statef *,\n z_streamp));\n\nextern int inflate_packet_flush OF((\n inflate_blocks_statef *));\n/* --- infblock.h */\n\n#ifndef NO_DUMMY_DECL\nstruct inflate_blocks_state {int dummy;}; /* for buggy compilers */\n#endif\n\n/* inflate private state */\nstruct internal_state {\n\n /* mode */\n enum {\n METHOD, /* waiting for method byte */\n FLAG, /* waiting for flag byte */\n DICT4, /* four dictionary check bytes to go */\n DICT3, /* three dictionary check bytes to go */\n DICT2, /* two dictionary check bytes to go */\n DICT1, /* one dictionary check byte to go */\n DICT0, /* waiting for inflateSetDictionary */\n BLOCKS, /* decompressing blocks */\n CHECK4, /* four check bytes to go */\n CHECK3, /* three check bytes to go */\n CHECK2, /* two check bytes to go */\n CHECK1, /* one check byte to go */\n DONE, /* finished check, done */\n BAD} /* got an error--stay here */\n mode; /* current inflate mode */\n\n /* mode dependent information */\n union {\n uInt method; /* if FLAGS, method byte */\n struct {\n uLong was; /* computed check value */\n uLong need; /* stream check value */\n } check; /* if CHECK, check values to compare */\n uInt marker; /* if BAD, inflateSync's marker bytes count */\n } sub; /* submode */\n\n /* mode independent information */\n int nowrap; /* flag for no wrapper */\n uInt wbits; /* log2(window size) (8..15, defaults to 15) */\n inflate_blocks_statef \n *blocks; /* current inflate_blocks state */\n\n};\n\n\nint inflateReset(z)\nz_streamp z;\n{\n uLong c;\n\n if (z == Z_NULL || z->state == Z_NULL)\n return Z_STREAM_ERROR;\n z->total_in = z->total_out = 0;\n z->msg = Z_NULL;\n z->state->mode = z->state->nowrap ? BLOCKS : METHOD;\n inflate_blocks_reset(z->state->blocks, z, &c);\n Trace((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\n\nint inflateEnd(z)\nz_streamp z;\n{\n uLong c;\n\n if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)\n return Z_STREAM_ERROR;\n if (z->state->blocks != Z_NULL)\n inflate_blocks_free(z->state->blocks, z, &c);\n ZFREE(z, z->state);\n z->state = Z_NULL;\n Trace((stderr, \"inflate: end\\n\"));\n return Z_OK;\n}\n\n\nint inflateInit2_(z, w, version, stream_size)\nz_streamp z;\nint w;\nconst char *version;\nint stream_size;\n{\n if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||\n stream_size != sizeof(z_stream))\n return Z_VERSION_ERROR;\n\n /* initialize state */\n if (z == Z_NULL)\n return Z_STREAM_ERROR;\n z->msg = Z_NULL;\n#ifndef NO_ZCFUNCS\n if (z->zalloc == Z_NULL)\n {\n z->zalloc = zcalloc;\n z->opaque = (voidpf)0;\n }\n if (z->zfree == Z_NULL) z->zfree = zcfree;\n#endif\n if ((z->state = (struct internal_state FAR *)\n ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)\n return Z_MEM_ERROR;\n z->state->blocks = Z_NULL;\n\n /* handle undocumented nowrap option (no zlib header or check) */\n z->state->nowrap = 0;\n if (w < 0)\n {\n w = - w;\n z->state->nowrap = 1;\n }\n\n /* set window size */\n if (w < 8 || w > 15)\n {\n inflateEnd(z);\n return Z_STREAM_ERROR;\n }\n z->state->wbits = (uInt)w;\n\n /* create inflate_blocks state */\n if ((z->state->blocks =\n inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w))\n == Z_NULL)\n {\n inflateEnd(z);\n return Z_MEM_ERROR;\n }\n Trace((stderr, \"inflate: allocated\\n\"));\n\n /* reset state */\n inflateReset(z);\n return Z_OK;\n}\n\n\nint inflateInit_(z, version, stream_size)\nz_streamp z;\nconst char *version;\nint stream_size;\n{\n return inflateInit2_(z, DEF_WBITS, version, stream_size);\n}\n\n\n#define NEEDBYTE {if(z->avail_in==0)goto empty;r=Z_OK;}\n#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)\n\nint inflate(z, f)\nz_streamp z;\nint f;\n{\n int r;\n uInt b;\n\n if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL || f < 0)\n return Z_STREAM_ERROR;\n r = Z_BUF_ERROR;\n while (1) switch (z->state->mode)\n {\n case METHOD:\n NEEDBYTE\n if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED)\n {\n z->state->mode = BAD;\n z->msg = (char*)\"unknown compression method\";\n z->state->sub.marker = 5; /* can't try inflateSync */\n break;\n }\n if ((z->state->sub.method >> 4) + 8 > z->state->wbits)\n {\n z->state->mode = BAD;\n z->msg = (char*)\"invalid window size\";\n z->state->sub.marker = 5; /* can't try inflateSync */\n break;\n }\n z->state->mode = FLAG;\n case FLAG:\n NEEDBYTE\n b = NEXTBYTE;\n if (((z->state->sub.method << 8) + b) % 31)\n {\n z->state->mode = BAD;\n z->msg = (char*)\"incorrect header check\";\n z->state->sub.marker = 5; /* can't try inflateSync */\n break;\n }\n Trace((stderr, \"inflate: zlib header ok\\n\"));\n if (!(b & PRESET_DICT))\n {\n z->state->mode = BLOCKS;\n\tbreak;\n }\n z->state->mode = DICT4;\n case DICT4:\n NEEDBYTE\n z->state->sub.check.need = (uLong)NEXTBYTE << 24;\n z->state->mode = DICT3;\n case DICT3:\n NEEDBYTE\n z->state->sub.check.need += (uLong)NEXTBYTE << 16;\n z->state->mode = DICT2;\n case DICT2:\n NEEDBYTE\n z->state->sub.check.need += (uLong)NEXTBYTE << 8;\n z->state->mode = DICT1;\n case DICT1:\n NEEDBYTE\n z->state->sub.check.need += (uLong)NEXTBYTE;\n z->adler = z->state->sub.check.need;\n z->state->mode = DICT0;\n return Z_NEED_DICT;\n case DICT0:\n z->state->mode = BAD;\n z->msg = (char*)\"need dictionary\";\n z->state->sub.marker = 0; /* can try inflateSync */\n return Z_STREAM_ERROR;\n case BLOCKS:\n r = inflate_blocks(z->state->blocks, z, r);\n if (f == Z_PACKET_FLUSH && z->avail_in == 0 && z->avail_out != 0)\n\t r = inflate_packet_flush(z->state->blocks);\n if (r == Z_DATA_ERROR)\n {\n z->state->mode = BAD;\n z->state->sub.marker = 0; /* can try inflateSync */\n break;\n }\n if (r != Z_STREAM_END)\n return r;\n r = Z_OK;\n inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);\n if (z->state->nowrap)\n {\n z->state->mode = DONE;\n break;\n }\n z->state->mode = CHECK4;\n case CHECK4:\n NEEDBYTE\n z->state->sub.check.need = (uLong)NEXTBYTE << 24;\n z->state->mode = CHECK3;\n case CHECK3:\n NEEDBYTE\n z->state->sub.check.need += (uLong)NEXTBYTE << 16;\n z->state->mode = CHECK2;\n case CHECK2:\n NEEDBYTE\n z->state->sub.check.need += (uLong)NEXTBYTE << 8;\n z->state->mode = CHECK1;\n case CHECK1:\n NEEDBYTE\n z->state->sub.check.need += (uLong)NEXTBYTE;\n\n if (z->state->sub.check.was != z->state->sub.check.need)\n {\n z->state->mode = BAD;\n z->msg = (char*)\"incorrect data check\";\n z->state->sub.marker = 5; /* can't try inflateSync */\n break;\n }\n Trace((stderr, \"inflate: zlib check ok\\n\"));\n z->state->mode = DONE;\n case DONE:\n return Z_STREAM_END;\n case BAD:\n return Z_DATA_ERROR;\n default:\n return Z_STREAM_ERROR;\n }\n\n empty:\n if (f != Z_PACKET_FLUSH)\n return r;\n z->state->mode = BAD;\n z->msg = (char *)\"need more for packet flush\";\n z->state->sub.marker = 0; /* can try inflateSync */\n return Z_DATA_ERROR;\n}\n\n\nint inflateSetDictionary(z, dictionary, dictLength)\nz_streamp z;\nconst Bytef *dictionary;\nuInt dictLength;\n{\n uInt length = dictLength;\n\n if (z == Z_NULL || z->state == Z_NULL || z->state->mode != DICT0)\n return Z_STREAM_ERROR;\n\n if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR;\n z->adler = 1L;\n\n if (length >= ((uInt)1<<z->state->wbits))\n {\n length = (1<<z->state->wbits)-1;\n dictionary += dictLength - length;\n }\n inflate_set_dictionary(z->state->blocks, dictionary, length);\n z->state->mode = BLOCKS;\n return Z_OK;\n}\n\n/*\n * This subroutine adds the data at next_in/avail_in to the output history\n * without performing any output. The output buffer must be \"caught up\";\n * i.e. no pending output (hence s->read equals s->write), and the state must\n * be BLOCKS (i.e. we should be willing to see the start of a series of\n * BLOCKS). On exit, the output will also be caught up, and the checksum\n * will have been updated if need be.\n */\n\nint inflateIncomp(z)\nz_stream *z;\n{\n if (z->state->mode != BLOCKS)\n\treturn Z_DATA_ERROR;\n return inflate_addhistory(z->state->blocks, z);\n}\n\n\nint inflateSync(z)\nz_streamp z;\n{\n uInt n; /* number of bytes to look at */\n Bytef *p; /* pointer to bytes */\n uInt m; /* number of marker bytes found in a row */\n uLong r, w; /* temporaries to save total_in and total_out */\n\n /* set up */\n if (z == Z_NULL || z->state == Z_NULL)\n return Z_STREAM_ERROR;\n if (z->state->mode != BAD)\n {\n z->state->mode = BAD;\n z->state->sub.marker = 0;\n }\n if ((n = z->avail_in) == 0)\n return Z_BUF_ERROR;\n p = z->next_in;\n m = z->state->sub.marker;\n\n /* search */\n while (n && m < 4)\n {\n if (*p == (Byte)(m < 2 ? 0 : 0xff))\n m++;\n else if (*p)\n m = 0;\n else\n m = 4 - m;\n p++, n--;\n }\n\n /* restore */\n z->total_in += p - z->next_in;\n z->next_in = p;\n z->avail_in = n;\n z->state->sub.marker = m;\n\n /* return no joy or set up to restart on a new block */\n if (m != 4)\n return Z_DATA_ERROR;\n r = z->total_in; w = z->total_out;\n inflateReset(z);\n z->total_in = r; z->total_out = w;\n z->state->mode = BLOCKS;\n return Z_OK;\n}\n\n#undef NEEDBYTE\n#undef NEXTBYTE\n/* --- inflate.c */\n\n/* +++ infblock.c */\n/* infblock.c -- interpret and process block types to last block\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* #include \"zutil.h\" */\n/* #include \"infblock.h\" */\n\n/* +++ inftrees.h */\n/* inftrees.h -- header to use inftrees.c\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* WARNING: this file should *not* be used by applications. It is\n part of the implementation of the compression library and is\n subject to change. Applications should only use zlib.h.\n */\n\n/* Huffman code lookup table entry--this entry is four bytes for machines\n that have 16-bit pointers (e.g. PC's in the small or medium model). */\n\ntypedef struct inflate_huft_s FAR inflate_huft;\n\nstruct inflate_huft_s {\n union {\n struct {\n Byte Exop; /* number of extra bits or operation */\n Byte Bits; /* number of bits in this code or subcode */\n } what;\n Bytef *pad; /* pad structure to a power of 2 (4 bytes for */\n } word; /* 16-bit, 8 bytes for 32-bit machines) */\n union {\n uInt Base; /* literal, length base, or distance base */\n inflate_huft *Next; /* pointer to next level of table */\n } more;\n};\n\n#ifdef DEBUG_ZLIB\n extern uInt inflate_hufts;\n#endif\n\nextern int inflate_trees_bits OF((\n uIntf *, /* 19 code lengths */\n uIntf *, /* bits tree desired/actual depth */\n inflate_huft * FAR *, /* bits tree result */\n z_streamp )); /* for zalloc, zfree functions */\n\nextern int inflate_trees_dynamic OF((\n uInt, /* number of literal/length codes */\n uInt, /* number of distance codes */\n uIntf *, /* that many (total) code lengths */\n uIntf *, /* literal desired/actual bit depth */\n uIntf *, /* distance desired/actual bit depth */\n inflate_huft * FAR *, /* literal/length tree result */\n inflate_huft * FAR *, /* distance tree result */\n z_streamp )); /* for zalloc, zfree functions */\n\nextern int inflate_trees_fixed OF((\n uIntf *, /* literal desired/actual bit depth */\n uIntf *, /* distance desired/actual bit depth */\n inflate_huft * FAR *, /* literal/length tree result */\n inflate_huft * FAR *)); /* distance tree result */\n\nextern int inflate_trees_free OF((\n inflate_huft *, /* tables to free */\n z_streamp )); /* for zfree function */\n\n/* --- inftrees.h */\n\n/* +++ infcodes.h */\n/* infcodes.h -- header to use infcodes.c\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* WARNING: this file should *not* be used by applications. It is\n part of the implementation of the compression library and is\n subject to change. Applications should only use zlib.h.\n */\n\nstruct inflate_codes_state;\ntypedef struct inflate_codes_state FAR inflate_codes_statef;\n\nextern inflate_codes_statef *inflate_codes_new OF((\n uInt, uInt,\n inflate_huft *, inflate_huft *,\n z_streamp ));\n\nextern int inflate_codes OF((\n inflate_blocks_statef *,\n z_streamp ,\n int));\n\nextern void inflate_codes_free OF((\n inflate_codes_statef *,\n z_streamp ));\n\n/* --- infcodes.h */\n\n/* +++ infutil.h */\n/* infutil.h -- types and macros common to blocks and codes\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* WARNING: this file should *not* be used by applications. It is\n part of the implementation of the compression library and is\n subject to change. Applications should only use zlib.h.\n */\n\n#ifndef _INFUTIL_H\n#define _INFUTIL_H\n\ntypedef enum {\n TYPE, /* get type bits (3, including end bit) */\n LENS, /* get lengths for stored */\n STORED, /* processing stored block */\n TABLE, /* get table lengths */\n BTREE, /* get bit lengths tree for a dynamic block */\n DTREE, /* get length, distance trees for a dynamic block */\n CODES, /* processing fixed or dynamic block */\n DRY, /* output remaining window bytes */\n DONEB, /* finished last block, done */\n BADB} /* got a data error--stuck here */\ninflate_block_mode;\n\n/* inflate blocks semi-private state */\nstruct inflate_blocks_state {\n\n /* mode */\n inflate_block_mode mode; /* current inflate_block mode */\n\n /* mode dependent information */\n union {\n uInt left; /* if STORED, bytes left to copy */\n struct {\n uInt table; /* table lengths (14 bits) */\n uInt index; /* index into blens (or border) */\n uIntf *blens; /* bit lengths of codes */\n uInt bb; /* bit length tree depth */\n inflate_huft *tb; /* bit length decoding tree */\n } trees; /* if DTREE, decoding info for trees */\n struct {\n inflate_huft *tl;\n inflate_huft *td; /* trees to free */\n inflate_codes_statef \n *codes;\n } decode; /* if CODES, current state */\n } sub; /* submode */\n uInt last; /* true if this block is the last block */\n\n /* mode independent information */\n uInt bitk; /* bits in bit buffer */\n uLong bitb; /* bit buffer */\n Bytef *window; /* sliding window */\n Bytef *end; /* one byte after sliding window */\n Bytef *read; /* window read pointer */\n Bytef *write; /* window write pointer */\n check_func checkfn; /* check function */\n uLong check; /* check on output */\n\n};\n\n\n/* defines for inflate input/output */\n/* update pointers and return */\n#define UPDBITS {s->bitb=b;s->bitk=k;}\n#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}\n#define UPDOUT {s->write=q;}\n#define UPDATE {UPDBITS UPDIN UPDOUT}\n#define LEAVE {UPDATE return inflate_flush(s,z,r);}\n/* get bytes and bits */\n#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}\n#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}\n#define NEXTBYTE (n--,*p++)\n#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}\n#define DUMPBITS(j) {b>>=(j);k-=(j);}\n/* output bytes */\n#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)\n#define LOADOUT {q=s->write;m=(uInt)WAVAIL;}\n#define WWRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}\n#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}\n#define NEEDOUT {if(m==0){WWRAP if(m==0){FLUSH WWRAP if(m==0) LEAVE}}r=Z_OK;}\n#define OUTBYTE(a) {*q++=(Byte)(a);m--;}\n/* load local pointers */\n#define LOAD {LOADIN LOADOUT}\n\n/* masks for lower bits (size given to avoid silly warnings with Visual C++) */\nextern uInt inflate_mask[17];\n\n/* copy as much as possible from the sliding window to the output area */\nextern int inflate_flush OF((\n inflate_blocks_statef *,\n z_streamp ,\n int));\n\n#ifndef NO_DUMMY_DECL\nstruct internal_state {int dummy;}; /* for buggy compilers */\n#endif\n\n#endif\n/* --- infutil.h */\n\n#ifndef NO_DUMMY_DECL\nstruct inflate_codes_state {int dummy;}; /* for buggy compilers */\n#endif\n\n/* Table for deflate from PKZIP's appnote.txt. */\nlocal const uInt border[] = { /* Order of the bit length code lengths */\n 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};\n\n/*\n Notes beyond the 1.93a appnote.txt:\n\n 1. Distance pointers never point before the beginning of the output\n stream.\n 2. Distance pointers can point back across blocks, up to 32k away.\n 3. There is an implied maximum of 7 bits for the bit length table and\n 15 bits for the actual data.\n 4. If only one code exists, then it is encoded using one bit. (Zero\n would be more efficient, but perhaps a little confusing.) If two\n codes exist, they are coded using one bit each (0 and 1).\n 5. There is no way of sending zero distance codes--a dummy must be\n sent if there are none. (History: a pre 2.0 version of PKZIP would\n store blocks with no distance codes, but this was discovered to be\n too harsh a criterion.) Valid only for 1.93a. 2.04c does allow\n zero distance codes, which is sent as one code of zero bits in\n length.\n 6. There are up to 286 literal/length codes. Code 256 represents the\n end-of-block. Note however that the static length tree defines\n 288 codes just to fill out the Huffman codes. Codes 286 and 287\n cannot be used though, since there is no length base or extra bits\n defined for them. Similarily, there are up to 30 distance codes.\n However, static trees define 32 codes (all 5 bits) to fill out the\n Huffman codes, but the last two had better not show up in the data.\n 7. Unzip can check dynamic Huffman blocks for complete code sets.\n The exception is that a single code would not be complete (see #4).\n 8. The five bits following the block type is really the number of\n literal codes sent minus 257.\n 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits\n (1+6+6). Therefore, to output three times the length, you output\n three codes (1+1+1), whereas to output four times the same length,\n you only need two codes (1+3). Hmm.\n 10. In the tree reconstruction algorithm, Code = Code + Increment\n only if BitLength(i) is not zero. (Pretty obvious.)\n 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)\n 12. Note: length code 284 can represent 227-258, but length code 285\n really is 258. The last length deserves its own, short code\n since it gets used a lot in very redundant files. The length\n 258 is special since 258 - 3 (the min match length) is 255.\n 13. The literal/length and distance code bit lengths are read as a\n single stream of lengths. It is possible (and advantageous) for\n a repeat code (16, 17, or 18) to go across the boundary between\n the two sets of lengths.\n */\n\n\nvoid inflate_blocks_reset(s, z, c)\ninflate_blocks_statef *s;\nz_streamp z;\nuLongf *c;\n{\n if (s->checkfn != Z_NULL)\n *c = s->check;\n if (s->mode == BTREE || s->mode == DTREE)\n ZFREE(z, s->sub.trees.blens);\n if (s->mode == CODES)\n {\n inflate_codes_free(s->sub.decode.codes, z);\n inflate_trees_free(s->sub.decode.td, z);\n inflate_trees_free(s->sub.decode.tl, z);\n }\n s->mode = TYPE;\n s->bitk = 0;\n s->bitb = 0;\n s->read = s->write = s->window;\n if (s->checkfn != Z_NULL)\n z->adler = s->check = (*s->checkfn)(0L, Z_NULL, 0);\n Trace((stderr, \"inflate: blocks reset\\n\"));\n}\n\n\ninflate_blocks_statef *inflate_blocks_new(z, c, w)\nz_streamp z;\ncheck_func c;\nuInt w;\n{\n inflate_blocks_statef *s;\n\n if ((s = (inflate_blocks_statef *)ZALLOC\n (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)\n return s;\n if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)\n {\n ZFREE(z, s);\n return Z_NULL;\n }\n s->end = s->window + w;\n s->checkfn = c;\n s->mode = TYPE;\n Trace((stderr, \"inflate: blocks allocated\\n\"));\n inflate_blocks_reset(s, z, &s->check);\n return s;\n}\n\n\n#ifdef DEBUG_ZLIB\n extern uInt inflate_hufts;\n#endif\nint inflate_blocks(s, z, r)\ninflate_blocks_statef *s;\nz_streamp z;\nint r;\n{\n uInt t; /* temporary storage */\n uLong b; /* bit buffer */\n uInt k; /* bits in bit buffer */\n Bytef *p; /* input data pointer */\n uInt n; /* bytes available there */\n Bytef *q; /* output window write pointer */\n uInt m; /* bytes to end of window or read pointer */\n\n /* copy input/output information to locals (UPDATE macro restores) */\n LOAD\n\n /* process input based on current state */\n while (1) switch (s->mode)\n {\n case TYPE:\n NEEDBITS(3)\n t = (uInt)b & 7;\n s->last = t & 1;\n switch (t >> 1)\n {\n case 0: /* stored */\n Trace((stderr, \"inflate: stored block%s\\n\",\n s->last ? \" (last)\" : \"\"));\n DUMPBITS(3)\n t = k & 7; /* go to byte boundary */\n DUMPBITS(t)\n s->mode = LENS; /* get length of stored block */\n break;\n case 1: /* fixed */\n Trace((stderr, \"inflate: fixed codes block%s\\n\",\n s->last ? \" (last)\" : \"\"));\n {\n uInt bl, bd;\n inflate_huft *tl, *td;\n\n inflate_trees_fixed(&bl, &bd, &tl, &td);\n s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);\n if (s->sub.decode.codes == Z_NULL)\n {\n r = Z_MEM_ERROR;\n LEAVE\n }\n s->sub.decode.tl = Z_NULL; /* don't try to free these */\n s->sub.decode.td = Z_NULL;\n }\n DUMPBITS(3)\n s->mode = CODES;\n break;\n case 2: /* dynamic */\n Trace((stderr, \"inflate: dynamic codes block%s\\n\",\n s->last ? \" (last)\" : \"\"));\n DUMPBITS(3)\n s->mode = TABLE;\n break;\n case 3: /* illegal */\n DUMPBITS(3)\n s->mode = BADB;\n z->msg = (char*)\"invalid block type\";\n r = Z_DATA_ERROR;\n LEAVE\n }\n break;\n case LENS:\n NEEDBITS(32)\n if ((((~b) >> 16) & 0xffff) != (b & 0xffff))\n {\n s->mode = BADB;\n z->msg = (char*)\"invalid stored block lengths\";\n r = Z_DATA_ERROR;\n LEAVE\n }\n s->sub.left = (uInt)b & 0xffff;\n b = k = 0; /* dump bits */\n Tracev((stderr, \"inflate: stored length %u\\n\", s->sub.left));\n s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);\n break;\n case STORED:\n if (n == 0)\n LEAVE\n NEEDOUT\n t = s->sub.left;\n if (t > n) t = n;\n if (t > m) t = m;\n zmemcpy(q, p, t);\n p += t; n -= t;\n q += t; m -= t;\n if ((s->sub.left -= t) != 0)\n break;\n Tracev((stderr, \"inflate: stored end, %lu total out\\n\",\n z->total_out + (q >= s->read ? q - s->read :\n (s->end - s->read) + (q - s->window))));\n s->mode = s->last ? DRY : TYPE;\n break;\n case TABLE:\n NEEDBITS(14)\n s->sub.trees.table = t = (uInt)b & 0x3fff;\n#ifndef PKZIP_BUG_WORKAROUND\n if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)\n {\n s->mode = BADB;\n z->msg = (char*)\"too many length or distance symbols\";\n r = Z_DATA_ERROR;\n LEAVE\n }\n#endif\n t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);\n if (t < 19)\n t = 19;\n if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)\n {\n r = Z_MEM_ERROR;\n LEAVE\n }\n DUMPBITS(14)\n s->sub.trees.index = 0;\n Tracev((stderr, \"inflate: table sizes ok\\n\"));\n s->mode = BTREE;\n case BTREE:\n while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))\n {\n NEEDBITS(3)\n s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;\n DUMPBITS(3)\n }\n while (s->sub.trees.index < 19)\n s->sub.trees.blens[border[s->sub.trees.index++]] = 0;\n s->sub.trees.bb = 7;\n t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,\n &s->sub.trees.tb, z);\n if (t != Z_OK)\n {\n r = t;\n if (r == Z_DATA_ERROR) {\n ZFREE(z, s->sub.trees.blens);\n s->mode = BADB;\n }\n LEAVE\n }\n s->sub.trees.index = 0;\n Tracev((stderr, \"inflate: bits tree ok\\n\"));\n s->mode = DTREE;\n case DTREE:\n while (t = s->sub.trees.table,\n s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))\n {\n inflate_huft *h;\n uInt i, j, c;\n\n t = s->sub.trees.bb;\n NEEDBITS(t)\n h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);\n t = h->word.what.Bits;\n c = h->more.Base;\n if (c < 16)\n {\n DUMPBITS(t)\n s->sub.trees.blens[s->sub.trees.index++] = c;\n }\n else /* c == 16..18 */\n {\n i = c == 18 ? 7 : c - 14;\n j = c == 18 ? 11 : 3;\n NEEDBITS(t + i)\n DUMPBITS(t)\n j += (uInt)b & inflate_mask[i];\n DUMPBITS(i)\n i = s->sub.trees.index;\n t = s->sub.trees.table;\n if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||\n (c == 16 && i < 1))\n {\n inflate_trees_free(s->sub.trees.tb, z);\n ZFREE(z, s->sub.trees.blens);\n s->mode = BADB;\n z->msg = (char*)\"invalid bit length repeat\";\n r = Z_DATA_ERROR;\n LEAVE\n }\n c = c == 16 ? s->sub.trees.blens[i - 1] : 0;\n do {\n s->sub.trees.blens[i++] = c;\n } while (--j);\n s->sub.trees.index = i;\n }\n }\n inflate_trees_free(s->sub.trees.tb, z);\n s->sub.trees.tb = Z_NULL;\n {\n uInt bl, bd;\n inflate_huft *tl, *td;\n inflate_codes_statef *c;\n\n bl = 9; /* must be <= 9 for lookahead assumptions */\n bd = 6; /* must be <= 9 for lookahead assumptions */\n t = s->sub.trees.table;\n#ifdef DEBUG_ZLIB\n inflate_hufts = 0;\n#endif\n t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),\n s->sub.trees.blens, &bl, &bd, &tl, &td, z);\n if (t != Z_OK)\n {\n if (t == (uInt)Z_DATA_ERROR) {\n ZFREE(z, s->sub.trees.blens);\n s->mode = BADB;\n }\n r = t;\n LEAVE\n }\n Tracev((stderr, \"inflate: trees ok, %d * %d bytes used\\n\",\n inflate_hufts, sizeof(inflate_huft)));\n if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)\n {\n inflate_trees_free(td, z);\n inflate_trees_free(tl, z);\n r = Z_MEM_ERROR;\n LEAVE\n }\n\t/*\n\t * this ZFREE must occur *BEFORE* we mess with sub.decode, because\n\t * sub.trees is union'd with sub.decode.\n\t */\n ZFREE(z, s->sub.trees.blens);\n s->sub.decode.codes = c;\n s->sub.decode.tl = tl;\n s->sub.decode.td = td;\n }\n s->mode = CODES;\n case CODES:\n UPDATE\n if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)\n return inflate_flush(s, z, r);\n r = Z_OK;\n inflate_codes_free(s->sub.decode.codes, z);\n inflate_trees_free(s->sub.decode.td, z);\n inflate_trees_free(s->sub.decode.tl, z);\n LOAD\n Tracev((stderr, \"inflate: codes end, %lu total out\\n\",\n z->total_out + (q >= s->read ? q - s->read :\n (s->end - s->read) + (q - s->window))));\n if (!s->last)\n {\n s->mode = TYPE;\n break;\n }\n if (k > 7) /* return unused byte, if any */\n {\n Assert(k < 16, \"inflate_codes grabbed too many bytes\")\n k -= 8;\n n++;\n p--; /* can always return one */\n }\n s->mode = DRY;\n case DRY:\n FLUSH\n if (s->read != s->write)\n LEAVE\n s->mode = DONEB;\n case DONEB:\n r = Z_STREAM_END;\n LEAVE\n case BADB:\n r = Z_DATA_ERROR;\n LEAVE\n default:\n r = Z_STREAM_ERROR;\n LEAVE\n }\n}\n\n\nint inflate_blocks_free(s, z, c)\ninflate_blocks_statef *s;\nz_streamp z;\nuLongf *c;\n{\n inflate_blocks_reset(s, z, c);\n ZFREE(z, s->window);\n ZFREE(z, s);\n Trace((stderr, \"inflate: blocks freed\\n\"));\n return Z_OK;\n}\n\n\nvoid inflate_set_dictionary(s, d, n)\ninflate_blocks_statef *s;\nconst Bytef *d;\nuInt n;\n{\n zmemcpy((charf *)s->window, d, n);\n s->read = s->write = s->window + n;\n}\n\n/*\n * This subroutine adds the data at next_in/avail_in to the output history\n * without performing any output. The output buffer must be \"caught up\";\n * i.e. no pending output (hence s->read equals s->write), and the state must\n * be BLOCKS (i.e. we should be willing to see the start of a series of\n * BLOCKS). On exit, the output will also be caught up, and the checksum\n * will have been updated if need be.\n */\nint inflate_addhistory(s, z)\ninflate_blocks_statef *s;\nz_stream *z;\n{\n uLong b; /* bit buffer */ /* NOT USED HERE */\n uInt k; /* bits in bit buffer */ /* NOT USED HERE */\n uInt t; /* temporary storage */\n Bytef *p; /* input data pointer */\n uInt n; /* bytes available there */\n Bytef *q; /* output window write pointer */\n uInt m; /* bytes to end of window or read pointer */\n\n if (s->read != s->write)\n\treturn Z_STREAM_ERROR;\n if (s->mode != TYPE)\n\treturn Z_DATA_ERROR;\n\n /* we're ready to rock */\n LOAD\n /* while there is input ready, copy to output buffer, moving\n * pointers as needed.\n */\n while (n) {\n\tt = n; /* how many to do */\n\t/* is there room until end of buffer? */\n\tif (t > m) t = m;\n\t/* update check information */\n\tif (s->checkfn != Z_NULL)\n\t s->check = (*s->checkfn)(s->check, q, t);\n\tzmemcpy(q, p, t);\n\tq += t;\n\tp += t;\n\tn -= t;\n\tz->total_out += t;\n\ts->read = q; /* drag read pointer forward */\n/* WWRAP */ \t/* expand WWRAP macro by hand to handle s->read */\n\tif (q == s->end) {\n\t s->read = q = s->window;\n\t m = WAVAIL;\n\t}\n }\n UPDATE\n return Z_OK;\n}\n\n\n/*\n * At the end of a Deflate-compressed PPP packet, we expect to have seen\n * a `stored' block type value but not the (zero) length bytes.\n */\nint inflate_packet_flush(s)\n inflate_blocks_statef *s;\n{\n if (s->mode != LENS)\n\treturn Z_DATA_ERROR;\n s->mode = TYPE;\n return Z_OK;\n}\n/* --- infblock.c */\n\n/* +++ inftrees.c */\n/* inftrees.c -- generate Huffman trees for efficient decoding\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* #include \"zutil.h\" */\n/* #include \"inftrees.h\" */\n\nchar inflate_copyright[] = \" inflate 1.0.4 Copyright 1995-1996 Mark Adler \";\n/*\n If you use the zlib library in a product, an acknowledgment is welcome\n in the documentation of your product. If for some reason you cannot\n include such an acknowledgment, I would appreciate that you keep this\n copyright string in the executable of your product.\n */\n\n#ifndef NO_DUMMY_DECL\nstruct internal_state {int dummy;}; /* for buggy compilers */\n#endif\n\n/* simplify the use of the inflate_huft type with some defines */\n#define base more.Base\n#define next more.Next\n#define exop word.what.Exop\n#define bits word.what.Bits\n\n\nlocal int huft_build OF((\n uIntf *, /* code lengths in bits */\n uInt, /* number of codes */\n uInt, /* number of \"simple\" codes */\n const uIntf *, /* list of base values for non-simple codes */\n const uIntf *, /* list of extra bits for non-simple codes */\n inflate_huft * FAR*,/* result: starting table */\n uIntf *, /* maximum lookup bits (returns actual) */\n z_streamp )); /* for zalloc function */\n\nlocal voidpf falloc OF((\n voidpf, /* opaque pointer (not used) */\n uInt, /* number of items */\n uInt)); /* size of item */\n\n/* Tables for deflate from PKZIP's appnote.txt. */\nlocal const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};\n /* see note #13 above about 258 */\nlocal const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */\n 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,\n 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */\nlocal const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577};\nlocal const uInt cpdext[30] = { /* Extra bits for distance codes */\n 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,\n 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,\n 12, 12, 13, 13};\n\n/*\n Huffman code decoding is performed using a multi-level table lookup.\n The fastest way to decode is to simply build a lookup table whose\n size is determined by the longest code. However, the time it takes\n to build this table can also be a factor if the data being decoded\n is not very long. The most common codes are necessarily the\n shortest codes, so those codes dominate the decoding time, and hence\n the speed. The idea is you can have a shorter table that decodes the\n shorter, more probable codes, and then point to subsidiary tables for\n the longer codes. The time it costs to decode the longer codes is\n then traded against the time it takes to make longer tables.\n\n This results of this trade are in the variables lbits and dbits\n below. lbits is the number of bits the first level table for literal/\n length codes can decode in one step, and dbits is the same thing for\n the distance codes. Subsequent tables are also less than or equal to\n those sizes. These values may be adjusted either when all of the\n codes are shorter than that, in which case the longest code length in\n bits is used, or when the shortest code is *longer* than the requested\n table size, in which case the length of the shortest code in bits is\n used.\n\n There are two different values for the two tables, since they code a\n different number of possibilities each. The literal/length table\n codes 286 possible values, or in a flat code, a little over eight\n bits. The distance table codes 30 possible values, or a little less\n than five bits, flat. The optimum values for speed end up being\n about one bit more than those, so lbits is 8+1 and dbits is 5+1.\n The optimum values may differ though from machine to machine, and\n possibly even between compilers. Your mileage may vary.\n */\n\n\n/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */\n#define BMAX 15 /* maximum bit length of any code */\n#define N_MAX 288 /* maximum number of codes in any set */\n\n#ifdef DEBUG_ZLIB\n uInt inflate_hufts;\n#endif\n\nlocal int huft_build(b, n, s, d, e, t, m, zs)\nuIntf *b; /* code lengths in bits (all assumed <= BMAX) */\nuInt n; /* number of codes (assumed <= N_MAX) */\nuInt s; /* number of simple-valued codes (0..s-1) */\nconst uIntf *d; /* list of base values for non-simple codes */\nconst uIntf *e; /* list of extra bits for non-simple codes */\ninflate_huft * FAR *t; /* result: starting table */\nuIntf *m; /* maximum lookup bits, returns actual */\nz_streamp zs; /* for zalloc function */\n/* Given a list of code lengths and a maximum table size, make a set of\n tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR\n if the given code set is incomplete (the tables are still built in this\n case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of\n lengths), or Z_MEM_ERROR if not enough memory. */\n{\n\n uInt a; /* counter for codes of length k */\n uInt c[BMAX+1]; /* bit length count table */\n uInt f; /* i repeats in table every f entries */\n int g; /* maximum code length */\n int h; /* table level */\n register uInt i; /* counter, current code */\n register uInt j; /* counter */\n register int k; /* number of bits in current code */\n int l; /* bits per table (returned in m) */\n register uIntf *p; /* pointer into c[], b[], or v[] */\n inflate_huft *q; /* points to current table */\n struct inflate_huft_s r; /* table entry for structure assignment */\n inflate_huft *u[BMAX]; /* table stack */\n uInt v[N_MAX]; /* values in order of bit length */\n register int w; /* bits before this table == (l * h) */\n uInt x[BMAX+1]; /* bit offsets, then code stack */\n uIntf *xp; /* pointer into x */\n int y; /* number of dummy codes added */\n uInt z; /* number of entries in current table */\n\n\n /* Generate counts for each bit length */\n p = c;\n#define C0 *p++ = 0;\n#define C2 C0 C0 C0 C0\n#define C4 C2 C2 C2 C2\n C4 /* clear c[]--assume BMAX+1 is 16 */\n p = b; i = n;\n do {\n c[*p++]++; /* assume all entries <= BMAX */\n } while (--i);\n if (c[0] == n) /* null input--all zero length codes */\n {\n *t = (inflate_huft *)Z_NULL;\n *m = 0;\n return Z_OK;\n }\n\n\n /* Find minimum and maximum length, bound *m by those */\n l = *m;\n for (j = 1; j <= BMAX; j++)\n if (c[j])\n break;\n k = j; /* minimum code length */\n if ((uInt)l < j)\n l = j;\n for (i = BMAX; i; i--)\n if (c[i])\n break;\n g = i; /* maximum code length */\n if ((uInt)l > i)\n l = i;\n *m = l;\n\n\n /* Adjust last length count to fill out codes, if needed */\n for (y = 1 << j; j < i; j++, y <<= 1)\n if ((y -= c[j]) < 0)\n return Z_DATA_ERROR;\n if ((y -= c[i]) < 0)\n return Z_DATA_ERROR;\n c[i] += y;\n\n\n /* Generate starting offsets into the value table for each length */\n x[1] = j = 0;\n p = c + 1; xp = x + 2;\n while (--i) { /* note that i == g from above */\n *xp++ = (j += *p++);\n }\n\n\n /* Make a table of values in order of bit lengths */\n p = b; i = 0;\n do {\n if ((j = *p++) != 0)\n v[x[j]++] = i;\n } while (++i < n);\n n = x[g]; /* set n to length of v */\n\n\n /* Generate the Huffman codes and for each, make the table entries */\n x[0] = i = 0; /* first Huffman code is zero */\n p = v; /* grab values in bit order */\n h = -1; /* no tables yet--level -1 */\n w = -l; /* bits decoded == (l * h) */\n u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */\n q = (inflate_huft *)Z_NULL; /* ditto */\n z = 0; /* ditto */\n\n /* go through the bit lengths (k already is bits in shortest code) */\n for (; k <= g; k++)\n {\n a = c[k];\n while (a--)\n {\n /* here i is the Huffman code of length k bits for value *p */\n /* make tables up to required level */\n while (k > w + l)\n {\n h++;\n w += l; /* previous table always l bits */\n\n /* compute minimum size table less than or equal to l bits */\n z = g - w;\n z = z > (uInt)l ? l : z; /* table size upper limit */\n if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */\n { /* too few codes for k-w bit table */\n f -= a + 1; /* deduct codes from patterns left */\n xp = c + k;\n if (j < z)\n while (++j < z) /* try smaller tables up to z bits */\n {\n if ((f <<= 1) <= *++xp)\n break; /* enough codes to use up j bits */\n f -= *xp; /* else deduct codes from patterns */\n }\n }\n z = 1 << j; /* table entries for j-bit table */\n\n /* allocate and link in new table */\n if ((q = (inflate_huft *)ZALLOC\n (zs,z + 1,sizeof(inflate_huft))) == Z_NULL)\n {\n if (h)\n inflate_trees_free(u[0], zs);\n return Z_MEM_ERROR; /* not enough memory */\n }\n#ifdef DEBUG_ZLIB\n inflate_hufts += z + 1;\n#endif\n *t = q + 1; /* link to list for huft_free() */\n *(t = &(q->next)) = Z_NULL;\n u[h] = ++q; /* table starts after link */\n\n /* connect to last table, if there is one */\n if (h)\n {\n x[h] = i; /* save pattern for backing up */\n r.bits = (Byte)l; /* bits to dump before this table */\n r.exop = (Byte)j; /* bits in this table */\n r.next = q; /* pointer to this table */\n j = i >> (w - l); /* (get around Turbo C bug) */\n u[h-1][j] = r; /* connect to last table */\n }\n }\n\n /* set up table entry in r */\n r.bits = (Byte)(k - w);\n if (p >= v + n)\n r.exop = 128 + 64; /* out of values--invalid code */\n else if (*p < s)\n {\n r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */\n r.base = *p++; /* simple code is just the value */\n }\n else\n {\n r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */\n r.base = d[*p++ - s];\n }\n\n /* fill code-like entries with r */\n f = 1 << (k - w);\n for (j = i >> w; j < z; j += f)\n q[j] = r;\n\n /* backwards increment the k-bit code i */\n for (j = 1 << (k - 1); i & j; j >>= 1)\n i ^= j;\n i ^= j;\n\n /* backup over finished tables */\n while ((i & ((1 << w) - 1)) != x[h])\n {\n h--; /* don't need to update q */\n w -= l;\n }\n }\n }\n\n\n /* Return Z_BUF_ERROR if we were given an incomplete table */\n return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;\n}\n\n\nint inflate_trees_bits(c, bb, tb, z)\nuIntf *c; /* 19 code lengths */\nuIntf *bb; /* bits tree desired/actual depth */\ninflate_huft * FAR *tb; /* bits tree result */\nz_streamp z; /* for zfree function */\n{\n int r;\n\n r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, tb, bb, z);\n if (r == Z_DATA_ERROR)\n z->msg = (char*)\"oversubscribed dynamic bit lengths tree\";\n else if (r == Z_BUF_ERROR || *bb == 0)\n {\n inflate_trees_free(*tb, z);\n z->msg = (char*)\"incomplete dynamic bit lengths tree\";\n r = Z_DATA_ERROR;\n }\n return r;\n}\n\n\nint inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, z)\nuInt nl; /* number of literal/length codes */\nuInt nd; /* number of distance codes */\nuIntf *c; /* that many (total) code lengths */\nuIntf *bl; /* literal desired/actual bit depth */\nuIntf *bd; /* distance desired/actual bit depth */\ninflate_huft * FAR *tl; /* literal/length tree result */\ninflate_huft * FAR *td; /* distance tree result */\nz_streamp z; /* for zfree function */\n{\n int r;\n\n /* build literal/length tree */\n r = huft_build(c, nl, 257, cplens, cplext, tl, bl, z);\n if (r != Z_OK || *bl == 0)\n {\n if (r == Z_DATA_ERROR)\n z->msg = (char*)\"oversubscribed literal/length tree\";\n else if (r != Z_MEM_ERROR)\n {\n inflate_trees_free(*tl, z);\n z->msg = (char*)\"incomplete literal/length tree\";\n r = Z_DATA_ERROR;\n }\n return r;\n }\n\n /* build distance tree */\n r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, z);\n if (r != Z_OK || (*bd == 0 && nl > 257))\n {\n if (r == Z_DATA_ERROR)\n z->msg = (char*)\"oversubscribed distance tree\";\n else if (r == Z_BUF_ERROR) {\n#ifdef PKZIP_BUG_WORKAROUND\n r = Z_OK;\n }\n#else\n inflate_trees_free(*td, z);\n z->msg = (char*)\"incomplete distance tree\";\n r = Z_DATA_ERROR;\n }\n else if (r != Z_MEM_ERROR)\n {\n z->msg = (char*)\"empty distance tree with lengths\";\n r = Z_DATA_ERROR;\n }\n inflate_trees_free(*tl, z);\n return r;\n#endif\n }\n\n /* done */\n return Z_OK;\n}\n\n\n/* build fixed tables only once--keep them here */\nlocal int fixed_built = 0;\n#define FIXEDH 530 /* number of hufts used by fixed tables */\nlocal inflate_huft fixed_mem[FIXEDH];\nlocal uInt fixed_bl;\nlocal uInt fixed_bd;\nlocal inflate_huft *fixed_tl;\nlocal inflate_huft *fixed_td;\n\n\nlocal voidpf falloc(q, n, s)\nvoidpf q; /* opaque pointer */\nuInt n; /* number of items */\nuInt s; /* size of item */\n{\n Assert(s == sizeof(inflate_huft) && n <= *(intf *)q,\n \"inflate_trees falloc overflow\");\n *(intf *)q -= n+s-s; /* s-s to avoid warning */\n return (voidpf)(fixed_mem + *(intf *)q);\n}\n\n\nint inflate_trees_fixed(bl, bd, tl, td)\nuIntf *bl; /* literal desired/actual bit depth */\nuIntf *bd; /* distance desired/actual bit depth */\ninflate_huft * FAR *tl; /* literal/length tree result */\ninflate_huft * FAR *td; /* distance tree result */\n{\n /* build fixed tables if not already (multiple overlapped executions ok) */\n if (!fixed_built)\n {\n int k; /* temporary variable */\n unsigned c[288]; /* length list for huft_build */\n z_stream z; /* for falloc function */\n int f = FIXEDH; /* number of hufts left in fixed_mem */\n\n /* set up fake z_stream for memory routines */\n z.zalloc = falloc;\n z.zfree = Z_NULL;\n z.opaque = (voidpf)&f;\n\n /* literal table */\n for (k = 0; k < 144; k++)\n c[k] = 8;\n for (; k < 256; k++)\n c[k] = 9;\n for (; k < 280; k++)\n c[k] = 7;\n for (; k < 288; k++)\n c[k] = 8;\n fixed_bl = 7;\n huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, &z);\n\n /* distance table */\n for (k = 0; k < 30; k++)\n c[k] = 5;\n fixed_bd = 5;\n huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd, &z);\n\n /* done */\n Assert(f == 0, \"invalid build of fixed tables\");\n fixed_built = 1;\n }\n *bl = fixed_bl;\n *bd = fixed_bd;\n *tl = fixed_tl;\n *td = fixed_td;\n return Z_OK;\n}\n\n\nint inflate_trees_free(t, z)\ninflate_huft *t; /* table to free */\nz_streamp z; /* for zfree function */\n/* Free the malloc'ed tables built by huft_build(), which makes a linked\n list of the tables it made, with the links in a dummy first entry of\n each table. */\n{\n register inflate_huft *p, *q, *r;\n\n /* Reverse linked list */\n p = Z_NULL;\n q = t;\n while (q != Z_NULL)\n {\n r = (q - 1)->next;\n (q - 1)->next = p;\n p = q;\n q = r;\n }\n /* Go through linked list, freeing from the malloced (t[-1]) address. */\n while (p != Z_NULL)\n {\n q = (--p)->next;\n ZFREE(z,p);\n p = q;\n } \n return Z_OK;\n}\n/* --- inftrees.c */\n\n/* +++ infcodes.c */\n/* infcodes.c -- process literals and length/distance pairs\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* #include \"zutil.h\" */\n/* #include \"inftrees.h\" */\n/* #include \"infblock.h\" */\n/* #include \"infcodes.h\" */\n/* #include \"infutil.h\" */\n\n/* +++ inffast.h */\n/* inffast.h -- header to use inffast.c\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* WARNING: this file should *not* be used by applications. It is\n part of the implementation of the compression library and is\n subject to change. Applications should only use zlib.h.\n */\n\nextern int inflate_fast OF((\n uInt,\n uInt,\n inflate_huft *,\n inflate_huft *,\n inflate_blocks_statef *,\n z_streamp ));\n/* --- inffast.h */\n\n/* simplify the use of the inflate_huft type with some defines */\n#define base more.Base\n#define next more.Next\n#define exop word.what.Exop\n#define bits word.what.Bits\n\n/* inflate codes private state */\nstruct inflate_codes_state {\n\n /* mode */\n enum { /* waiting for \"i:\"=input, \"o:\"=output, \"x:\"=nothing */\n START, /* x: set up for LEN */\n LEN, /* i: get length/literal/eob next */\n LENEXT, /* i: getting length extra (have base) */\n DIST, /* i: get distance next */\n DISTEXT, /* i: getting distance extra */\n COPY, /* o: copying bytes in window, waiting for space */\n LIT, /* o: got literal, waiting for output space */\n WASH, /* o: got eob, possibly still output waiting */\n END, /* x: got eob and all data flushed */\n BADCODE} /* x: got error */\n mode; /* current inflate_codes mode */\n\n /* mode dependent information */\n uInt len;\n union {\n struct {\n inflate_huft *tree; /* pointer into tree */\n uInt need; /* bits needed */\n } code; /* if LEN or DIST, where in tree */\n uInt lit; /* if LIT, literal */\n struct {\n uInt get; /* bits to get for extra */\n uInt dist; /* distance back to copy from */\n } copy; /* if EXT or COPY, where and how much */\n } sub; /* submode */\n\n /* mode independent information */\n Byte lbits; /* ltree bits decoded per branch */\n Byte dbits; /* dtree bits decoder per branch */\n inflate_huft *ltree; /* literal/length/eob tree */\n inflate_huft *dtree; /* distance tree */\n\n};\n\n\ninflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z)\nuInt bl, bd;\ninflate_huft *tl;\ninflate_huft *td; /* need separate declaration for Borland C++ */\nz_streamp z;\n{\n inflate_codes_statef *c;\n\n if ((c = (inflate_codes_statef *)\n ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)\n {\n c->mode = START;\n c->lbits = (Byte)bl;\n c->dbits = (Byte)bd;\n c->ltree = tl;\n c->dtree = td;\n Tracev((stderr, \"inflate: codes new\\n\"));\n }\n return c;\n}\n\n\nint inflate_codes(s, z, r)\ninflate_blocks_statef *s;\nz_streamp z;\nint r;\n{\n uInt j; /* temporary storage */\n inflate_huft *t; /* temporary pointer */\n uInt e; /* extra bits or operation */\n uLong b; /* bit buffer */\n uInt k; /* bits in bit buffer */\n Bytef *p; /* input data pointer */\n uInt n; /* bytes available there */\n Bytef *q; /* output window write pointer */\n uInt m; /* bytes to end of window or read pointer */\n Bytef *f; /* pointer to copy strings from */\n inflate_codes_statef *c = s->sub.decode.codes; /* codes state */\n\n /* copy input/output information to locals (UPDATE macro restores) */\n LOAD\n\n /* process input and output based on current state */\n while (1) switch (c->mode)\n { /* waiting for \"i:\"=input, \"o:\"=output, \"x:\"=nothing */\n case START: /* x: set up for LEN */\n#ifndef SLOW\n if (m >= 258 && n >= 10)\n {\n UPDATE\n r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);\n LOAD\n if (r != Z_OK)\n {\n c->mode = r == Z_STREAM_END ? WASH : BADCODE;\n break;\n }\n }\n#endif /* !SLOW */\n c->sub.code.need = c->lbits;\n c->sub.code.tree = c->ltree;\n c->mode = LEN;\n case LEN: /* i: get length/literal/eob next */\n j = c->sub.code.need;\n NEEDBITS(j)\n t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);\n DUMPBITS(t->bits)\n e = (uInt)(t->exop);\n if (e == 0) /* literal */\n {\n c->sub.lit = t->base;\n Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?\n \"inflate: literal '%c'\\n\" :\n \"inflate: literal 0x%02x\\n\", t->base));\n c->mode = LIT;\n break;\n }\n if (e & 16) /* length */\n {\n c->sub.copy.get = e & 15;\n c->len = t->base;\n c->mode = LENEXT;\n break;\n }\n if ((e & 64) == 0) /* next table */\n {\n c->sub.code.need = e;\n c->sub.code.tree = t->next;\n break;\n }\n if (e & 32) /* end of block */\n {\n Tracevv((stderr, \"inflate: end of block\\n\"));\n c->mode = WASH;\n break;\n }\n c->mode = BADCODE; /* invalid code */\n z->msg = (char*)\"invalid literal/length code\";\n r = Z_DATA_ERROR;\n LEAVE\n case LENEXT: /* i: getting length extra (have base) */\n j = c->sub.copy.get;\n NEEDBITS(j)\n c->len += (uInt)b & inflate_mask[j];\n DUMPBITS(j)\n c->sub.code.need = c->dbits;\n c->sub.code.tree = c->dtree;\n Tracevv((stderr, \"inflate: length %u\\n\", c->len));\n c->mode = DIST;\n case DIST: /* i: get distance next */\n j = c->sub.code.need;\n NEEDBITS(j)\n t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);\n DUMPBITS(t->bits)\n e = (uInt)(t->exop);\n if (e & 16) /* distance */\n {\n c->sub.copy.get = e & 15;\n c->sub.copy.dist = t->base;\n c->mode = DISTEXT;\n break;\n }\n if ((e & 64) == 0) /* next table */\n {\n c->sub.code.need = e;\n c->sub.code.tree = t->next;\n break;\n }\n c->mode = BADCODE; /* invalid code */\n z->msg = (char*)\"invalid distance code\";\n r = Z_DATA_ERROR;\n LEAVE\n case DISTEXT: /* i: getting distance extra */\n j = c->sub.copy.get;\n NEEDBITS(j)\n c->sub.copy.dist += (uInt)b & inflate_mask[j];\n DUMPBITS(j)\n Tracevv((stderr, \"inflate: distance %u\\n\", c->sub.copy.dist));\n c->mode = COPY;\n case COPY: /* o: copying bytes in window, waiting for space */\n#ifndef __TURBOC__ /* Turbo C bug for following expression */\n f = (uInt)(q - s->window) < c->sub.copy.dist ?\n s->end - (c->sub.copy.dist - (q - s->window)) :\n q - c->sub.copy.dist;\n#else\n f = q - c->sub.copy.dist;\n if ((uInt)(q - s->window) < c->sub.copy.dist)\n f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));\n#endif\n while (c->len)\n {\n NEEDOUT\n OUTBYTE(*f++)\n if (f == s->end)\n f = s->window;\n c->len--;\n }\n c->mode = START;\n break;\n case LIT: /* o: got literal, waiting for output space */\n NEEDOUT\n OUTBYTE(c->sub.lit)\n c->mode = START;\n break;\n case WASH: /* o: got eob, possibly more output */\n FLUSH\n if (s->read != s->write)\n LEAVE\n c->mode = END;\n case END:\n r = Z_STREAM_END;\n LEAVE\n case BADCODE: /* x: got error */\n r = Z_DATA_ERROR;\n LEAVE\n default:\n r = Z_STREAM_ERROR;\n LEAVE\n }\n}\n\n\nvoid inflate_codes_free(c, z)\ninflate_codes_statef *c;\nz_streamp z;\n{\n ZFREE(z, c);\n Tracev((stderr, \"inflate: codes free\\n\"));\n}\n/* --- infcodes.c */\n\n/* +++ infutil.c */\n/* inflate_util.c -- data and routines common to blocks and codes\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* #include \"zutil.h\" */\n/* #include \"infblock.h\" */\n/* #include \"inftrees.h\" */\n/* #include \"infcodes.h\" */\n/* #include \"infutil.h\" */\n\n#ifndef NO_DUMMY_DECL\nstruct inflate_codes_state {int dummy;}; /* for buggy compilers */\n#endif\n\n/* And'ing with mask[n] masks the lower n bits */\nuInt inflate_mask[17] = {\n 0x0000,\n 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,\n 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff\n};\n\n\n/* copy as much as possible from the sliding window to the output area */\nint inflate_flush(s, z, r)\ninflate_blocks_statef *s;\nz_streamp z;\nint r;\n{\n uInt n;\n Bytef *p;\n Bytef *q;\n\n /* local copies of source and destination pointers */\n p = z->next_out;\n q = s->read;\n\n /* compute number of bytes to copy as far as end of window */\n n = (uInt)((q <= s->write ? s->write : s->end) - q);\n if (n > z->avail_out) n = z->avail_out;\n if (n && r == Z_BUF_ERROR) r = Z_OK;\n\n /* update counters */\n z->avail_out -= n;\n z->total_out += n;\n\n /* update check information */\n if (s->checkfn != Z_NULL)\n z->adler = s->check = (*s->checkfn)(s->check, q, n);\n\n /* copy as far as end of window */\n if (p != Z_NULL) {\n zmemcpy(p, q, n);\n p += n;\n }\n q += n;\n\n /* see if more to copy at beginning of window */\n if (q == s->end)\n {\n /* wrap pointers */\n q = s->window;\n if (s->write == s->end)\n s->write = s->window;\n\n /* compute bytes to copy */\n n = (uInt)(s->write - q);\n if (n > z->avail_out) n = z->avail_out;\n if (n && r == Z_BUF_ERROR) r = Z_OK;\n\n /* update counters */\n z->avail_out -= n;\n z->total_out += n;\n\n /* update check information */\n if (s->checkfn != Z_NULL)\n z->adler = s->check = (*s->checkfn)(s->check, q, n);\n\n /* copy */\n if (p != Z_NULL) {\n zmemcpy(p, q, n);\n p += n;\n }\n q += n;\n }\n\n /* update pointers */\n z->next_out = p;\n s->read = q;\n\n /* done */\n return r;\n}\n/* --- infutil.c */\n\n/* +++ inffast.c */\n/* inffast.c -- process literals and length/distance pairs fast\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* #include \"zutil.h\" */\n/* #include \"inftrees.h\" */\n/* #include \"infblock.h\" */\n/* #include \"infcodes.h\" */\n/* #include \"infutil.h\" */\n/* #include \"inffast.h\" */\n\n#ifndef NO_DUMMY_DECL\nstruct inflate_codes_state {int dummy;}; /* for buggy compilers */\n#endif\n\n/* simplify the use of the inflate_huft type with some defines */\n#define base more.Base\n#define next more.Next\n#define exop word.what.Exop\n#define bits word.what.Bits\n\n/* macros for bit input with no checking and for returning unused bytes */\n#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}\n#define UNGRAB {n+=(c=k>>3);p-=c;k&=7;}\n\n/* Called with number of bytes left to write in window at least 258\n (the maximum string length) and number of input bytes available\n at least ten. The ten bytes are six bytes for the longest length/\n distance pair plus four bytes for overloading the bit buffer. */\n\nint inflate_fast(bl, bd, tl, td, s, z)\nuInt bl, bd;\ninflate_huft *tl;\ninflate_huft *td; /* need separate declaration for Borland C++ */\ninflate_blocks_statef *s;\nz_streamp z;\n{\n inflate_huft *t; /* temporary pointer */\n uInt e; /* extra bits or operation */\n uLong b; /* bit buffer */\n uInt k; /* bits in bit buffer */\n Bytef *p; /* input data pointer */\n uInt n; /* bytes available there */\n Bytef *q; /* output window write pointer */\n uInt m; /* bytes to end of window or read pointer */\n uInt ml; /* mask for literal/length tree */\n uInt md; /* mask for distance tree */\n uInt c; /* bytes to copy */\n uInt d; /* distance back to copy from */\n Bytef *r; /* copy source pointer */\n\n /* load input, output, bit values */\n LOAD\n\n /* initialize masks */\n ml = inflate_mask[bl];\n md = inflate_mask[bd];\n\n /* do until not enough input or output space for fast loop */\n do { /* assume called with m >= 258 && n >= 10 */\n /* get literal/length code */\n GRABBITS(20) /* max bits for literal/length code */\n if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)\n {\n DUMPBITS(t->bits)\n Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?\n \"inflate: * literal '%c'\\n\" :\n \"inflate: * literal 0x%02x\\n\", t->base));\n *q++ = (Byte)t->base;\n m--;\n continue;\n }\n do {\n DUMPBITS(t->bits)\n if (e & 16)\n {\n /* get extra bits for length */\n e &= 15;\n c = t->base + ((uInt)b & inflate_mask[e]);\n DUMPBITS(e)\n Tracevv((stderr, \"inflate: * length %u\\n\", c));\n\n /* decode distance base of block to copy */\n GRABBITS(15); /* max bits for distance code */\n e = (t = td + ((uInt)b & md))->exop;\n do {\n DUMPBITS(t->bits)\n if (e & 16)\n {\n /* get extra bits to add to distance base */\n e &= 15;\n GRABBITS(e) /* get extra bits (up to 13) */\n d = t->base + ((uInt)b & inflate_mask[e]);\n DUMPBITS(e)\n Tracevv((stderr, \"inflate: * distance %u\\n\", d));\n\n /* do the copy */\n m -= c;\n if ((uInt)(q - s->window) >= d) /* offset before dest */\n { /* just copy */\n r = q - d;\n *q++ = *r++; c--; /* minimum count is three, */\n *q++ = *r++; c--; /* so unroll loop a little */\n }\n else /* else offset after destination */\n {\n e = d - (uInt)(q - s->window); /* bytes from offset to end */\n r = s->end - e; /* pointer to offset */\n if (c > e) /* if source crosses, */\n {\n c -= e; /* copy to end of window */\n do {\n *q++ = *r++;\n } while (--e);\n r = s->window; /* copy rest from start of window */\n }\n }\n do { /* copy all or what's left */\n *q++ = *r++;\n } while (--c);\n break;\n }\n else if ((e & 64) == 0)\n e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop;\n else\n {\n z->msg = (char*)\"invalid distance code\";\n UNGRAB\n UPDATE\n return Z_DATA_ERROR;\n }\n } while (1);\n break;\n }\n if ((e & 64) == 0)\n {\n if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0)\n {\n DUMPBITS(t->bits)\n Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?\n \"inflate: * literal '%c'\\n\" :\n \"inflate: * literal 0x%02x\\n\", t->base));\n *q++ = (Byte)t->base;\n m--;\n break;\n }\n }\n else if (e & 32)\n {\n Tracevv((stderr, \"inflate: * end of block\\n\"));\n UNGRAB\n UPDATE\n return Z_STREAM_END;\n }\n else\n {\n z->msg = (char*)\"invalid literal/length code\";\n UNGRAB\n UPDATE\n return Z_DATA_ERROR;\n }\n } while (1);\n } while (m >= 258 && n >= 10);\n\n /* not enough input or output--restore pointers and return */\n UNGRAB\n UPDATE\n return Z_OK;\n}\n/* --- inffast.c */\n\n/* +++ zutil.c */\n/* zutil.c -- target dependent utility functions for the compression library\n * Copyright (C) 1995-1996 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* From: zutil.c,v 1.17 1996/07/24 13:41:12 me Exp $ */\n\n#ifdef DEBUG_ZLIB\n#include <stdio.h>\n#endif\n\n/* #include \"zutil.h\" */\n\n#ifndef NO_DUMMY_DECL\nstruct internal_state {int dummy;}; /* for buggy compilers */\n#endif\n\n#ifndef STDC\nextern void exit OF((int));\n#endif\n\nstatic const char *z_errmsg[10] = {\n\"need dictionary\", /* Z_NEED_DICT 2 */\n\"stream end\", /* Z_STREAM_END 1 */\n\"\", /* Z_OK 0 */\n\"file error\", /* Z_ERRNO (-1) */\n\"stream error\", /* Z_STREAM_ERROR (-2) */\n\"data error\", /* Z_DATA_ERROR (-3) */\n\"insufficient memory\", /* Z_MEM_ERROR (-4) */\n\"buffer error\", /* Z_BUF_ERROR (-5) */\n\"incompatible version\",/* Z_VERSION_ERROR (-6) */\n\"\"};\n\n\nconst char *zlibVersion()\n{\n return ZLIB_VERSION;\n}\n\n#ifdef DEBUG_ZLIB\nvoid z_error (m)\n char *m;\n{\n fprintf(stderr, \"%s\\n\", m);\n exit(1);\n}\n#endif\n\n#ifndef HAVE_MEMCPY\n\nvoid zmemcpy(dest, source, len)\n Bytef* dest;\n Bytef* source;\n uInt len;\n{\n if (len == 0) return;\n do {\n *dest++ = *source++; /* ??? to be unrolled */\n } while (--len != 0);\n}\n\nint zmemcmp(s1, s2, len)\n Bytef* s1;\n Bytef* s2;\n uInt len;\n{\n uInt j;\n\n for (j = 0; j < len; j++) {\n if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;\n }\n return 0;\n}\n\nvoid zmemzero(dest, len)\n Bytef* dest;\n uInt len;\n{\n if (len == 0) return;\n do {\n *dest++ = 0; /* ??? to be unrolled */\n } while (--len != 0);\n}\n#endif\n\n#ifdef __TURBOC__\n#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__)\n/* Small and medium model in Turbo C are for now limited to near allocation\n * with reduced MAX_WBITS and MAX_MEM_LEVEL\n */\n# define MY_ZCALLOC\n\n/* Turbo C malloc() does not allow dynamic allocation of 64K bytes\n * and farmalloc(64K) returns a pointer with an offset of 8, so we\n * must fix the pointer. Warning: the pointer must be put back to its\n * original form in order to free it, use zcfree().\n */\n\n#define MAX_PTR 10\n/* 10*64K = 640K */\n\nlocal int next_ptr = 0;\n\ntypedef struct ptr_table_s {\n voidpf org_ptr;\n voidpf new_ptr;\n} ptr_table;\n\nlocal ptr_table table[MAX_PTR];\n/* This table is used to remember the original form of pointers\n * to large buffers (64K). Such pointers are normalized with a zero offset.\n * Since MSDOS is not a preemptive multitasking OS, this table is not\n * protected from concurrent access. This hack doesn't work anyway on\n * a protected system like OS/2. Use Microsoft C instead.\n */\n\nvoidpf zcalloc (voidpf opaque, unsigned items, unsigned size)\n{\n voidpf buf = opaque; /* just to make some compilers happy */\n ulg bsize = (ulg)items*size;\n\n /* If we allocate less than 65520 bytes, we assume that farmalloc\n * will return a usable pointer which doesn't have to be normalized.\n */\n if (bsize < 65520L) {\n buf = farmalloc(bsize);\n if (*(ush*)&buf != 0) return buf;\n } else {\n buf = farmalloc(bsize + 16L);\n }\n if (buf == NULL || next_ptr >= MAX_PTR) return NULL;\n table[next_ptr].org_ptr = buf;\n\n /* Normalize the pointer to seg:0 */\n *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;\n *(ush*)&buf = 0;\n table[next_ptr++].new_ptr = buf;\n return buf;\n}\n\nvoid zcfree (voidpf opaque, voidpf ptr)\n{\n int n;\n if (*(ush*)&ptr != 0) { /* object < 64K */\n farfree(ptr);\n return;\n }\n /* Find the original pointer */\n for (n = 0; n < next_ptr; n++) {\n if (ptr != table[n].new_ptr) continue;\n\n farfree(table[n].org_ptr);\n while (++n < next_ptr) {\n table[n-1] = table[n];\n }\n next_ptr--;\n return;\n }\n ptr = opaque; /* just to make some compilers happy */\n Assert(0, \"zcfree: ptr not found\");\n}\n#endif\n#endif /* __TURBOC__ */\n\n\n#if defined(M_I86) && !defined(__32BIT__)\n/* Microsoft C in 16-bit mode */\n\n# define MY_ZCALLOC\n\n#if (!defined(_MSC_VER) || (_MSC_VER < 600))\n# define _halloc halloc\n# define _hfree hfree\n#endif\n\nvoidpf zcalloc (voidpf opaque, unsigned items, unsigned size)\n{\n if (opaque) opaque = 0; /* to make compiler happy */\n return _halloc((long)items, size);\n}\n\nvoid zcfree (voidpf opaque, voidpf ptr)\n{\n if (opaque) opaque = 0; /* to make compiler happy */\n _hfree(ptr);\n}\n\n#endif /* MSC */\n\n\n#ifndef MY_ZCALLOC /* Any system without a special alloc function */\n\n#ifndef STDC\nextern voidp calloc OF((uInt items, uInt size));\nextern void free OF((voidpf ptr));\n#endif\n\nvoidpf zcalloc (opaque, items, size)\n voidpf opaque;\n unsigned items;\n unsigned size;\n{\n if (opaque) items += size - size; /* make compiler happy */\n return (voidpf)calloc(items, size);\n}\n\nvoid zcfree (opaque, ptr)\n voidpf opaque;\n voidpf ptr;\n{\n free(ptr);\n if (opaque) return; /* make compiler happy */\n}\n\n#endif /* MY_ZCALLOC */\n/* --- zutil.c */\n\n/* +++ adler32.c */\n/* adler32.c -- compute the Adler-32 checksum of a data stream\n * Copyright (C) 1995-1996 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h \n */\n\n/* From: adler32.c,v 1.10 1996/05/22 11:52:18 me Exp $ */\n\n/* #include \"zlib.h\" */\n\n#define BASE 65521L /* largest prime smaller than 65536 */\n#define NMAX 5552\n/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */\n\n#define DO1(buf,i) {s1 += buf[(i)]; s2 += s1;}\n#define DO2(buf,i) DO1(buf,i); DO1(buf,(i)+1);\n#define DO4(buf,i) DO2(buf,i); DO2(buf,(i)+2);\n#define DO8(buf,i) DO4(buf,i); DO4(buf,(i)+4);\n#define DO16(buf) DO8(buf,0); DO8(buf,8);\n\n/* ========================================================================= */\nuLong adler32(adler, buf, len)\n uLong adler;\n const Bytef *buf;\n uInt len;\n{\n unsigned long s1 = adler & 0xffff;\n unsigned long s2 = (adler >> 16) & 0xffff;\n int k;\n\n if (buf == Z_NULL) return 1L;\n\n while (len > 0) {\n k = len < NMAX ? len : NMAX;\n len -= k;\n while (k >= 16) {\n DO16(buf);\n\t buf += 16;\n k -= 16;\n }\n if (k != 0) do {\n s1 += *buf++;\n\t s2 += s1;\n } while (--k);\n s1 %= BASE;\n s2 %= BASE;\n }\n return (s2 << 16) | s1;\n}\n/* --- adler32.c */\n\n#ifdef _KERNEL\nstatic int\nzlib_modevent(module_t mod, int type, void *unused)\n{\n\tswitch (type) {\n\tcase MOD_LOAD:\n\t\treturn 0;\n\tcase MOD_UNLOAD:\n\t\treturn 0;\n\t}\n\treturn EINVAL;\n}\n\nstatic moduledata_t zlib_mod = {\n\t\"zlib\",\n\tzlib_modevent,\n\t0\n};\nDECLARE_MODULE(zlib, zlib_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);\nMODULE_VERSION(zlib, 1);\n#endif /* _KERNEL */\n", "meta": {"content_hash": "b0f3a46a1a836cf5cb7e6eddf1b1927c", "timestamp": "", "source": "github", "line_count": 5414, "max_line_length": 82, "avg_line_length": 33.080716660509786, "alnum_prop": 0.5529846621142497, "repo_name": "dplbsd/zcaplib", "id": "09511c11644e203f2f3d96f4637d08d335d5507f", "size": "179099", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "head/sys/net/zlib.c", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "AGS Script", "bytes": "62471"}, {"name": "Assembly", "bytes": "4478661"}, {"name": "Awk", "bytes": "278525"}, {"name": "Batchfile", "bytes": "20417"}, {"name": "C", "bytes": "383420305"}, {"name": "C++", "bytes": "72796771"}, {"name": "CSS", "bytes": "109748"}, {"name": "ChucK", "bytes": "39"}, {"name": "D", "bytes": "3784"}, {"name": "DIGITAL Command Language", "bytes": "10640"}, {"name": "DTrace", "bytes": "2311027"}, {"name": "Emacs Lisp", "bytes": "65902"}, {"name": "EmberScript", "bytes": "286"}, {"name": "Forth", "bytes": "184405"}, {"name": "GAP", "bytes": "72156"}, {"name": "Groff", "bytes": "32248806"}, {"name": "HTML", "bytes": "6749816"}, {"name": "IGOR Pro", "bytes": "6301"}, {"name": "Java", "bytes": "112547"}, {"name": "KRL", "bytes": "4950"}, {"name": "Lex", "bytes": "398817"}, {"name": "Limbo", "bytes": "3583"}, {"name": "Logos", "bytes": "187900"}, {"name": "Makefile", "bytes": "3551839"}, {"name": "Mathematica", "bytes": "9556"}, {"name": "Max", "bytes": "4178"}, {"name": "Module Management System", "bytes": "817"}, {"name": "NSIS", "bytes": "3383"}, {"name": "Objective-C", "bytes": "836351"}, {"name": "PHP", "bytes": "6649"}, {"name": "Perl", "bytes": "5530761"}, {"name": "Perl6", "bytes": "41802"}, {"name": "PostScript", "bytes": "140088"}, {"name": "Prolog", "bytes": "29514"}, {"name": "Protocol Buffer", "bytes": "61933"}, {"name": "Python", "bytes": "299247"}, {"name": "R", "bytes": "764"}, {"name": "Rebol", "bytes": "738"}, {"name": "Ruby", "bytes": "45958"}, {"name": "Scilab", "bytes": "197"}, {"name": "Shell", "bytes": "10501540"}, {"name": "SourcePawn", "bytes": "463194"}, {"name": "SuperCollider", "bytes": "80208"}, {"name": "Tcl", "bytes": "80913"}, {"name": "TeX", "bytes": "719821"}, {"name": "VimL", "bytes": "22201"}, {"name": "XS", "bytes": "25451"}, {"name": "XSLT", "bytes": "31488"}, {"name": "Yacc", "bytes": "1857830"}]}} +{"text": "#pragma once\n\n#include \"Actor/Material/Material.h\"\n\n#include <memory>\n\nnamespace ph\n{\n\nclass InputPacket;\nclass CookingContext;\nclass SurfaceMaterial;\nclass VolumeMaterial;\n\n// TODO: volume material\n\nclass FullMaterial final : public Material, public TCommandInterface<FullMaterial>\n{\npublic:\n\tFullMaterial();\n\tFullMaterial(const std::shared_ptr<SurfaceMaterial>& surfaceMaterial);\n\n\tvoid genBehaviors(CookingContext& context, PrimitiveMetadata& metadata) const override;\n\nprivate:\n\tstd::shared_ptr<SurfaceMaterial> m_surfaceMaterial;\n\tstd::shared_ptr<VolumeMaterial> m_interiorMaterial;\n\tstd::shared_ptr<VolumeMaterial> m_exteriorMaterial;\n\n// command interface\npublic:\n\texplicit FullMaterial(const InputPacket& packet);\n\tstatic SdlTypeInfo ciTypeInfo();\n\tstatic void ciRegister(CommandRegister& cmdRegister);\n};\n\n}// end namespace ph\n\n/*\n\t<SDL_interface>\n\n\t<category> material </category>\n\t<type_name> full </type_name>\n\t<extend> material.material </extend>\n\n\t<name> Full Material </name>\n\t<description>\n\t\tA material model that combines surface and volume properties.\n\t</description>\n\n\t<command type=\"creator\">\n\t\t<input name=\"surface\" type=\"material\">\n\t\t\t<description>A surface material.</description>\n\t\t</input>\n\t\t<input name=\"interior\" type=\"material\">\n\t\t\t<description>A volume material describing the inside of the surface.</description>\n\t\t</input>\n\t\t<input name=\"exterior\" type=\"material\">\n\t\t\t<description>A volume material describing the outside of the surface.</description>\n\t\t</input>\n\t</command>\n\n\t</SDL_interface>\n*/", "meta": {"content_hash": "683a356489491864c7ccfc956ac8d98b", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 88, "avg_line_length": 24.296875, "alnum_prop": 0.7434083601286173, "repo_name": "TzuChieh/Photon-v2", "id": "bb9c31840a3331eef3937829bf25e2d7ec23ecbb", "size": "1555", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Engine/Source/Actor/Material/FullMaterial.h", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "429"}, {"name": "C", "bytes": "7059"}, {"name": "C++", "bytes": "1572544"}, {"name": "CMake", "bytes": "7944"}, {"name": "Java", "bytes": "265901"}, {"name": "Objective-C", "bytes": "336"}, {"name": "Python", "bytes": "171368"}, {"name": "Shell", "bytes": "439"}]}} +{"text": "'use strict';\n\n/**\n * Module dependencies.\n */\nvar should = require('should'),\n\tmongoose = require('mongoose'),\n\tUser = mongoose.model('User'),\n\tPlayer = mongoose.model('Player');\n\n/**\n * Globals\n */\nvar user, player;\n\n/**\n * Unit tests\n */\ndescribe('Player Model Unit Tests:', function() {\n\tbeforeEach(function(done) {\n\t\tuser = new User({\n\t\t\tfirstName: 'Full',\n\t\t\tlastName: 'Name',\n\t\t\tdisplayName: 'Full Name',\n\t\t\temail: 'test@test.com',\n\t\t\tusername: 'username',\n\t\t\tpassword: 'password'\n\t\t});\n\n\t\tuser.save(function() { \n\t\t\tplayer = new Player({\n\t\t\t\tname: 'Player Name',\n\t\t\t\tuser: user\n\t\t\t});\n\n\t\t\tdone();\n\t\t});\n\t});\n\n\tdescribe('Method Save', function() {\n\t\tit('should be able to save without problems', function(done) {\n\t\t\treturn player.save(function(err) {\n\t\t\t\tshould.not.exist(err);\n\t\t\t\tdone();\n\t\t\t});\n\t\t});\n\n\t\tit('should be able to show an error when try to save without name', function(done) { \n\t\t\tplayer.name = '';\n\n\t\t\treturn player.save(function(err) {\n\t\t\t\tshould.exist(err);\n\t\t\t\tdone();\n\t\t\t});\n\t\t});\n\t});\n\n\tafterEach(function(done) { \n\t\tPlayer.remove().exec();\n\t\tUser.remove().exec();\n\n\t\tdone();\n\t});\n});", "meta": {"content_hash": "355913364d83c5a4285a66bb7279ba03", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 87, "avg_line_length": 17.359375, "alnum_prop": 0.5931593159315932, "repo_name": "oferlivny/iteammaker", "id": "4e7b56a0c36ea60489ae56d7564e561a216d2dc4", "size": "1111", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "app/tests/player.server.model.test.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "538"}, {"name": "HTML", "bytes": "27971"}, {"name": "JavaScript", "bytes": "133065"}, {"name": "Shell", "bytes": "414"}]}} +{"text": "var sys = require('sys');\n\nmodule.exports = function(id, bufferSize, maxBaseNicknameLength) {\n\tvar room = {};\n\tvar clientCount = 0;\n\tvar clients = {};\n\tvar nicknames = {};\n\tvar buffer = [];\n\n\tvar broadcast = function(message, sender) {\n\t\tfor (sessionId in clients) {\n\t\t\tvar client = clients[sessionId];\n\t\t\tif (buffer.length > bufferSize) buffer.shift();\n\n\t\t\tif (!sender || sender.sessionId != client.sessionId) {\n\t\t\t\tclient.send(message);\n\t\t\t}\n\t\t}\n\t};\n\n\tvar splitNickname = function(str) {\n\t\tvar reverse = parseInt(str.split('').reverse().join(''), 10);\n\t\tif (isNaN(reverse)) return {prefix: str, suffix: null};\n\t\tvar suffix = parseInt(String(reverse).split('').reverse().join(''), 10);\n\t\treturn {prefix: str.substring(0, str.length - String(suffix).length), suffix: suffix};\n\t};\n\n\n\tvar assignNickname = function(nickname, client) {\n\t\tnickname = nickname.substring(0, maxBaseNicknameLength);\n\t\tvar nicks = {};\n\t\tfor (sessionId in nicknames) {\n\t\t\tnicks[nicknames[sessionId]] = sessionId;\n\t\t}\n\n\t\tif (!(nickname in nicks)) {\n\t\t\tnicknames[client.sessionId] = nickname;\n\t\t\treturn;\n\t\t}\n\n\t\tvar nick = splitNickname(nickname);\n\t\tvar i = nick.suffix ? nick.suffix : 1;\n\t\twhile ((nick.prefix + i) in nicks && nicks[nick.prefix + i] != client.sessionId) {\n\t\t\ti++;\n\t\t}\n\n\t\tnicknames[client.sessionId] = nick.prefix + i;\n\t};\n\n\tvar getNickname = function(client) {\n\t\tif (!client) return null;\n\t\treturn nicknames[client.sessionId];\n\t};\n\n\troom.addClient = function(nickname, client) {\n\t\tclients[client.sessionId] = client;\n\t\tassignNickname(nickname, client);\n\t\tclientCount++;\n\t\tclient.send({\n\t\t\taction: 'init', \n\t\t\tvalue: {\n\t\t\t\tbuffer: buffer,\n\t\t\t\tnicknames: nicknames,\n\t\t\t\troomId: id\n\t\t\t}\n\t\t});\n\t\troom.broadcastAnnouncement(getNickname(client) + ' has joined.', client);\n\t\tbroadcast({action: 'nicknamesUpdated', value: nicknames});\n\t};\n\n\troom.removeClient = function(client) {\n\t\troom.broadcastAnnouncement(getNickname(client) + ' has left.', client);\n\t\tdelete clients[client.sessionId];\n\t\tdelete nicknames[client.sessionId];\n\t\tclientCount--;\n\t\tbroadcast({action: 'nicknamesUpdated', value: nicknames});\n\t};\n\n\troom.getClientCount = function() {\n\t\treturn clientCount;\n\t};\n\n\troom.getID = function() {\n\t\treturn id;\n\t};\n\n\troom.broadcastAnnouncement = function(message, sender) {\n\t\tbuffer.push({message: message, type: 'announcement', nickname: getNickname(sender)});\n\t\tbroadcast({action: 'announcement', value: {message: message, nickname: getNickname(sender)}}, sender);\n\t};\n\n\troom.broadcastStatus = function(status, sender) {\n\t\tstatus = getNickname(sender) + ' ' + status;\n\t\troom.broadcastAnnouncement(status);\n\t};\n\n\troom.broadcastMessage = function(message, sender) {\n\t\tbuffer.push({message: message, type: 'message', nickname: getNickname(sender)});\n\t\tbroadcast({action: 'message', value: {message: message, nickname: getNickname(sender)}}, sender);\n\t};\n\n\troom.changeNickname = function(nickname, client) {\n\t\tvar oldNick = getNickname(client);\n\t\tif (oldNick === nickname) {\n\t\t\treturn;\n\t\t}\n\t\tassignNickname(nickname, client);\n\t\tvar newNick = getNickname(client);\n\t\tif (oldNick === newNick) {\n\t\t\treturn;\n\t\t}\n\t\tbroadcast({action: 'nicknamesUpdated', value: nicknames});\n\t\troom.broadcastAnnouncement(oldNick + ' is now known as ' + newNick);\n\t};\n\n\treturn room;\n};\n", "meta": {"content_hash": "cd153d09951fec364460d7cb8c882bdd", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 104, "avg_line_length": 27.726495726495727, "alnum_prop": 0.6778668310727497, "repo_name": "ipartola/natchat", "id": "680c65dcc50099fb11bd46109372cf92eb45c2b7", "size": "3244", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chat-room.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "78785"}, {"name": "Python", "bytes": "655"}]}} +{"text": "'use strict';\n\nangular.module('myApp.register', ['ngRoute'])\n\n// Declared route\n.config(['$routeProvider', function($routeProvider) {\n $routeProvider.when('/register', {\n templateUrl: 'register/register.html',\n controller: 'RegisterCtrl'\n });\n}])\n\n// Register controller\n.controller('RegisterCtrl', [function() {\n\n}]);\n", "meta": {"content_hash": "b448e6505a990f4891411871b85109ea", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 53, "avg_line_length": 21.1875, "alnum_prop": 0.6519174041297935, "repo_name": "toshibakru/FinTech", "id": "8701eb275730a498179f35f7289721264dd44239", "size": "339", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/register/register.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1187"}, {"name": "HTML", "bytes": "16806"}, {"name": "JavaScript", "bytes": "14021"}]}} +{"text": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Page hosted, for webview sample</title>\n</head>\n<body>\n <p>This page is hosted at an external server. Observe how it interacts with the embedder application</p>\n <button id=\"sendmessage\">Send message to app</button><br>\n <button id=\"pointerlock\">Pointer lock</button><br>\n <button id=\"captureimage\">Capture image</button><br>\n <button id=\"geoloc\">Request geolocation</button><br>\n <a href=\"http://google.com\">Go to google.com</a><br>\n <div id=\"log\"></div><br>\n\n<script type=\"text/javascript\">\n\n(function() {\n\nvar log=document.getElementById(\"log\");\nvar appWindow, appOrigin;\n\nfunction onMessage(e) {\n appWindow = e.source;\n appOrigin = e.origin;\n console.log(e);\n}\n\nfunction doSendMessage() {\n log.innerText=\"\";\n if (appWindow && appOrigin) {\n appWindow.postMessage(\"this is a message from the page!\", appOrigin)\n log.innerText=\"message sent\";\n } else {\n log.innerText=\"ERROR: don't have app info - no initial message received\";\n }\n}\n\nfunction doPointerLock() {\n document.body.webkitRequestPointerLock();\n log.innerText=\"Pointer lock requested\";\n}\n\nfunction doCaptureImage() {\n var video = document.querySelector('video');\n if (!video) {\n video = document.createElement('video');\n video.style.width=\"200px\";\n video.autoplay = true;\n document.body.appendChild(video);\n }\n navigator.webkitGetUserMedia(\n {video: true, audio: true},\n function(stream) {\n video.src = window.URL.createObjectURL(stream);\n log.innerText=\"video running, enjoy!\";\n });\n}\n\nfunction doGeoloc() {\n log.innerText=\"requested position\";\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n log.innerText='position='+position;\n });\n }\n}\n\nwindow.addEventListener('message', onMessage);\n\ndocument.getElementById(\"sendmessage\").addEventListener('click', doSendMessage);\ndocument.getElementById(\"pointerlock\").addEventListener('click', doPointerLock);\ndocument.getElementById(\"captureimage\").addEventListener('click', doCaptureImage);\ndocument.getElementById(\"geoloc\").addEventListener('click', doGeoloc);\n\n})();\n\n</script>\n\n</body>\n</html>\n", "meta": {"content_hash": "468be6263b5582b61bb3ab2e9e89278a", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 106, "avg_line_length": 27.0, "alnum_prop": 0.7037037037037037, "repo_name": "hohanhb285/chrome-app-samples", "id": "8c5a5e1faf80d1ce395e205da79c73fd789ae65a", "size": "2187", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "webview/page_hosted_in_external_server.html", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "{% extends \"base.html\" %}\n{% block title%}{% endblock %}\n{% block header %}\n<link rel=\"stylesheet\" href=\"/static/css/chat.css?fs\">\n{% endblock %}\n{% block pager %}\n{% if paginator.page_count!=1 %}\n<div class=\"pager\">\n{{paginator.pager(format='~20~')}}\n</div>\n{% endif %}\n{% endblock %}\n{% block content %}\n\n{{ self.pager() }}\n\n<div id=\"archiveConversation\">\n{% if lines|length!=0 %}\n{% if mode=='normal': %}\n{% set last_date = None %}\n{% for line in lines %}\n{% set current_date = line['datetime'].date() %}\n{% if current_date!=last_date %}\n\t<h1>{{current_date.strftime(\"%A %d %B %Y\")}}</h1>\n{% set last_date = current_date %}\n{% endif %}\n\t<p style=\"color: #{{line['color']}}\" class=\"{% if line.counter==-1 %}system{% else %}user{{line['counter']}}{% endif %}\">{{line['line']}}<span class=\"timestamp\">{{line['datetime'].strftime('%X')}}</span></p>\n{% endfor %}\n\t<p><a href=\"{{url_for('view_log', chat=chat, page=current_page, mode='bbcode' )}}\">View as BBCode</a></p>\n{% elif mode=='bbcode': %}\n{% for line in lines %}\n\t<p>[color=#{{line.color}}]{{line.line}}[/color]</p>\n{% endfor %}\n\t<p><a href=\"{{url_for('view_log', chat=chat, page=current_page, mode='normal' )}}\">View as text</a></p>\n{% endif %}\n{% endif %}\n <p><a href=\"/chat/{{chat}}/export\">Export this log</a></p>\n</div>\n\n{{ self.pager() }}\n\n<script>\n function getURLParameter(name) {\n return decodeURI(\n (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]\n );\n }\n function linkify(inputText) {\n var replacedText, replacePattern1, replacePattern2;\n\n //URLs starting with http://, https://, or ftp://\n replacePattern1 = /]?=?https?:\\/\\/[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/gim;\n replacedText = inputText.replace(replacePattern1,\n function(m) {\n if (m.substr(0,1) == \"=\" || m.substr(0,1) == \"]\") {\n return m;\n } else {\n return \"[url]\"+m+\"[/url]\";\n }\n });\n\n //Change email addresses to mailto:: links.\n replacePattern2 = /(\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,6})/gim;\n replacedText = replacedText.replace(replacePattern2, '[email]$1[/email]');\n\n return replacedText;\n }\n\n if (getURLParameter('mode') == 'bbcode') {\n\n } else if (getURLParameter('mode') == 'plaintext') {\n $('#archiveConversation p').each(function() {\n line = htmlEncode(bbRemove($(this).html()));\n $(this).html(line);\n });\n } else {\n $('#archiveConversation p').each(function() {\n if ($(this).attr('class')) {\n linin = $(this).html();\n BS = linin.substr(linin.length-39);\n linin = linin.substr(0,linin.length-39);\n line = bbEncode(linkify(linin));\n $(this).html(line).append(BS);\n }\n });\n }\n\n $('.spoiler').live('click', function() {\n if ($(this).css('opacity') == '0') {\n $(this).css('opacity','1');\n } else {\n $(this).css('opacity','0');\n }\n });\n\t\n\tvar storage = (function() {\n\t var uid = new Date;\n\t var result;\n\t try {\n\t\tlocalStorage.setItem(uid, uid);\n\t\tresult = localStorage.getItem(uid) == uid;\n\t\tlocalStorage.removeItem(uid);\n\t\treturn result && localStorage;\n\t } catch (exception) {}\n\t}());\n\t\n\tif (storage){\n\t\tif (localStorage.creppy == 'creppy'){\n\t\t\t\t$('head').append('<link rel=\"stylesheet\" id=\"creppyid\" href=\"/static/css/mscreppy_chat.css?41031\" type=\"text/css\" />');\n\t\t\t}\n\t}\n\t\n</script>\n\n{% endblock %}\n", "meta": {"content_hash": "5fa4c19a9f7eac9a24e75f2475900373", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 208, "avg_line_length": 31.043478260869566, "alnum_prop": 0.5260504201680672, "repo_name": "MSPARP/MSPARP", "id": "85aca0cceee09ca8733a58efd72d245b736506c7", "size": "3570", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/log.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "51494"}, {"name": "HTML", "bytes": "77834"}, {"name": "JavaScript", "bytes": "98022"}, {"name": "Python", "bytes": "115220"}]}} +{"text": "@interface MenuViewController () <UITableViewDelegate>\n{\n \n}\n@property (weak, nonatomic) IBOutlet UITableView *menuTableVIew;\n@property (strong, nonatomic) MenuDataSource *menuDataSource;\n@end\n\n@implementation MenuViewController\n\n\n#pragma mark - Table View Delegate\n\n- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath\n{\n [tableView deselectRowAtIndexPath:indexPath animated:NO];\n \n// NSLog(@\"%@\", [self.menuDataSource menuDataWithIndexPath:indexPath]);\n\n [self.menuDrawerVC.appVC closeDrawerWithAnimation:YES\n completion:^(BOOL finished){\n \n NSLog(@\"%s\", __PRETTY_FUNCTION__);\n \n }];\n}\n\n\n#pragma mark - View Controller\n\n- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil\n{\n self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];\n if (self) {\n self.menuDataSource = [MenuDataSource new];\n }\n return self;\n}\n\n- (void)viewDidLoad\n{\n [super viewDidLoad];\n\n self.menuTableVIew.dataSource = self.menuDataSource;\n self.menuTableVIew.delegate = self;\n}\n\n- (void)didReceiveMemoryWarning\n{\n [super didReceiveMemoryWarning];\n // Dispose of any resources that can be recreated.\n}\n\n- (void)viewDidLayoutSubviews\n{\n [super viewDidLayoutSubviews];\n \n [self.view layoutSubviews];\n}\n\n@end\n", "meta": {"content_hash": "e44a1da2dc282a12d3cb6ccdff7262d5", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 91, "avg_line_length": 25.049180327868854, "alnum_prop": 0.6230366492146597, "repo_name": "ykmt/MovingView", "id": "ec762c70f6032f61ac6ad6410f91607e54abd0ab", "size": "1779", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MovingView/MenuViewController.m", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Objective-C", "bytes": "31187"}]}} +{"text": "require 'chefspec'\nrequire 'chefspec/berkshelf'\n\nRSpec.configure do |config|\n config.log_level = :fatal\n\n # Guard against people using deprecated RSpec syntax\n config.raise_errors_for_deprecations!\n\n # Why aren't these the defaults?\n config.filter_run focus: true\n config.run_all_when_everything_filtered = true\n\n # Set a default platform (this is overriden as needed)\n config.platform = 'freebsd'\n config.version = '12'\n\n # Be random!\n config.order = 'random'\nend\n", "meta": {"content_hash": "c6094ae385dd4921dc7808bd4def2a5c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 56, "avg_line_length": 23.95, "alnum_prop": 0.7265135699373695, "repo_name": "chef-cookbooks/freebsd", "id": "8a8ff7dedca28b8334763687ff3b27412ec97222", "size": "479", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "spec/spec_helper.rb", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Ruby", "bytes": "11492"}]}} +{"text": "\n\nimport com.google.common.collect.Lists;\nimport jetbrains.buildServer.BaseTestCase;\nimport jetbrains.buildServer.vsoRooms.notificator.VSOTeamRoomIdsCache;\nimport jetbrains.buildServer.vsoRooms.rest.TeamRoom;\nimport jetbrains.buildServer.vsoRooms.rest.VSOTeamRoomsAPIConnection;\nimport org.jmock.Expectations;\nimport org.jmock.Mockery;\nimport org.testng.annotations.BeforeMethod;\nimport org.testng.annotations.Test;\n\n/**\n * @author Evgeniy.Koshkin\n */\npublic class VSOTeamRoomIdsCacheTest extends BaseTestCase {\n\n private VSOTeamRoomIdsCache myCache;\n private Mockery myMockery;\n\n @Override\n @BeforeMethod\n public void setUp() throws Exception {\n super.setUp();\n myCache = new VSOTeamRoomIdsCache();\n myMockery = new Mockery();\n }\n\n @Test\n public void test_room_names_collision_in_separate_accounts() throws Exception {\n final VSOTeamRoomsAPIConnection apiConnection = myMockery.mock(VSOTeamRoomsAPIConnection.class);\n myMockery.checking(new Expectations() {{\n one(apiConnection).getListOfRooms(\"accountA\");\n will(returnValue(Lists.newArrayList(new TeamRoom(1L, \"room\", \"accountA room\"))));\n one(apiConnection).getListOfRooms(\"accountB\");\n will(returnValue(Lists.newArrayList(new TeamRoom(2L, \"room\", \"accountB room\"))));\n }});\n assertEquals(Long.valueOf(1), myCache.getOrResolveRoomId(\"accountA\", \"room\", apiConnection));\n assertEquals(Long.valueOf(2), myCache.getOrResolveRoomId(\"accountB\", \"room\", apiConnection));\n myMockery.assertIsSatisfied();\n }\n\n @Test\n public void should_be_case_insensitive_for_team_room_name() throws Exception {\n final VSOTeamRoomsAPIConnection apiConnection = myMockery.mock(VSOTeamRoomsAPIConnection.class);\n myMockery.checking(new Expectations() {{\n one(apiConnection).getListOfRooms(\"account\");\n will(returnValue(Lists.newArrayList(new TeamRoom(1L, \"Room\", \"account room\"))));\n }});\n assertEquals(Long.valueOf(1), myCache.getOrResolveRoomId(\"account\", \"ROOM\", apiConnection));\n assertEquals(Long.valueOf(1), myCache.getOrResolveRoomId(\"account\", \"room\", apiConnection));\n assertEquals(Long.valueOf(1), myCache.getOrResolveRoomId(\"account\", \"Room\", apiConnection));\n myMockery.assertIsSatisfied();\n }\n\n @Test\n public void should_be_case_insensitive_for_account() throws Exception {\n final VSOTeamRoomsAPIConnection apiConnection = myMockery.mock(VSOTeamRoomsAPIConnection.class);\n myMockery.checking(new Expectations() {{\n one(apiConnection).getListOfRooms(\"account\");\n will(returnValue(Lists.newArrayList(new TeamRoom(1L, \"room\", \"account room\"))));\n }});\n assertEquals(Long.valueOf(1), myCache.getOrResolveRoomId(\"account\", \"room\", apiConnection));\n assertEquals(Long.valueOf(1), myCache.getOrResolveRoomId(\"Account\", \"room\", apiConnection));\n assertEquals(Long.valueOf(1), myCache.getOrResolveRoomId(\"ACCOUNT\", \"room\", apiConnection));\n myMockery.assertIsSatisfied();\n }\n\n @Test\n public void should_resolve_all_account_room_ids_on_first_call() throws Exception {\n final VSOTeamRoomsAPIConnection apiConnection = myMockery.mock(VSOTeamRoomsAPIConnection.class);\n myMockery.checking(new Expectations() {{\n one(apiConnection).getListOfRooms(\"account\");\n will(returnValue(Lists.newArrayList(new TeamRoom(1L, \"room1\", \"account room 1\"), new TeamRoom(2L, \"room2\", \"account room 2\"))));\n }});\n assertEquals(Long.valueOf(1), myCache.getOrResolveRoomId(\"account\", \"room1\", apiConnection));\n assertEquals(Long.valueOf(2), myCache.getOrResolveRoomId(\"account\", \"room2\", apiConnection));\n }\n}\n", "meta": {"content_hash": "09b11d0e3e2514debcb8d378584bf1d1", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 134, "avg_line_length": 45.164556962025316, "alnum_prop": 0.7480381165919282, "repo_name": "JetBrains/tc-vso-rooms", "id": "05be5b05bf48c5fb274e46dac9aca6365229e087", "size": "4168", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/src/VSOTeamRoomIdsCacheTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "791"}, {"name": "FreeMarker", "bytes": "13486"}, {"name": "Java", "bytes": "90553"}, {"name": "JavaScript", "bytes": "3180"}]}} +{"text": "namespace device {\n\n// static\nbase::WeakPtr<BluetoothLocalGattService> BluetoothLocalGattService::Create(\n BluetoothAdapter* adapter,\n const BluetoothUUID& uuid,\n bool is_primary,\n BluetoothLocalGattService* included_service,\n BluetoothLocalGattService::Delegate* delegate) {\n bluez::BluetoothAdapterBlueZ* adapter_bluez =\n static_cast<bluez::BluetoothAdapterBlueZ*>(adapter);\n bluez::BluetoothLocalGattServiceBlueZ* service =\n new bluez::BluetoothLocalGattServiceBlueZ(adapter_bluez, uuid, is_primary,\n delegate);\n return service->weak_ptr_factory_.GetWeakPtr();\n}\n\n} // namespace device\n\nnamespace bluez {\n\nBluetoothLocalGattServiceBlueZ::BluetoothLocalGattServiceBlueZ(\n BluetoothAdapterBlueZ* adapter,\n const device::BluetoothUUID& uuid,\n bool is_primary,\n device::BluetoothLocalGattService::Delegate* delegate)\n : BluetoothGattServiceBlueZ(\n adapter,\n AddGuidToObjectPath(adapter->GetApplicationObjectPath().value() +\n \"/service\")),\n uuid_(uuid),\n is_primary_(is_primary),\n delegate_(delegate),\n weak_ptr_factory_(this) {\n VLOG(1) << \"Creating local GATT service with identifier: \" << GetIdentifier();\n adapter->AddLocalGattService(base::WrapUnique(this));\n}\n\nBluetoothLocalGattServiceBlueZ::~BluetoothLocalGattServiceBlueZ() {}\n\ndevice::BluetoothUUID BluetoothLocalGattServiceBlueZ::GetUUID() const {\n return uuid_;\n}\n\nbool BluetoothLocalGattServiceBlueZ::IsPrimary() const {\n return is_primary_;\n}\n\nvoid BluetoothLocalGattServiceBlueZ::Register(\n const base::Closure& callback,\n const ErrorCallback& error_callback) {\n GetAdapter()->RegisterGattService(this, callback, error_callback);\n}\n\nvoid BluetoothLocalGattServiceBlueZ::Unregister(\n const base::Closure& callback,\n const ErrorCallback& error_callback) {\n DCHECK(GetAdapter());\n GetAdapter()->UnregisterGattService(this, callback, error_callback);\n}\n\nbool BluetoothLocalGattServiceBlueZ::IsRegistered() {\n return GetAdapter()->IsGattServiceRegistered(this);\n}\n\nvoid BluetoothLocalGattServiceBlueZ::Delete() {\n weak_ptr_factory_.InvalidateWeakPtrs();\n GetAdapter()->RemoveLocalGattService(this);\n}\n\ndevice::BluetoothLocalGattCharacteristic*\nBluetoothLocalGattServiceBlueZ::GetCharacteristic(\n const std::string& identifier) {\n const auto& service = characteristics_.find(dbus::ObjectPath(identifier));\n return service == characteristics_.end() ? nullptr : service->second.get();\n};\n\nconst std::map<dbus::ObjectPath,\n std::unique_ptr<BluetoothLocalGattCharacteristicBlueZ>>&\nBluetoothLocalGattServiceBlueZ::GetCharacteristics() const {\n return characteristics_;\n}\n\n// static\ndbus::ObjectPath BluetoothLocalGattServiceBlueZ::AddGuidToObjectPath(\n const std::string& path) {\n std::string GuidString = base::GenerateGUID();\n base::RemoveChars(GuidString, \"-\", &GuidString);\n\n return dbus::ObjectPath(path + GuidString);\n}\n\nvoid BluetoothLocalGattServiceBlueZ::AddCharacteristic(\n std::unique_ptr<BluetoothLocalGattCharacteristicBlueZ> characteristic) {\n characteristics_[characteristic->object_path()] = std::move(characteristic);\n}\n\n} // namespace bluez\n", "meta": {"content_hash": "046c85ff169f4b53c3b1273284400a27", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 80, "avg_line_length": 32.88775510204081, "alnum_prop": 0.7381321749922433, "repo_name": "wuhengzhi/chromium-crosswalk", "id": "36fe94fe3691b8d344e81d8fafe18c2307e7e07d", "size": "3673", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "device/bluetooth/bluez/bluetooth_local_gatt_service_bluez.cc", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "\"\"\"\nTests For Cells Utility methods\n\"\"\"\nimport inspect\nimport random\n\nfrom nova.cells import utils as cells_utils\nfrom nova import db\nfrom nova import test\n\n\nclass CellsUtilsTestCase(test.TestCase):\n \"\"\"Test case for Cells utility methods.\"\"\"\n def test_get_instances_to_sync(self):\n fake_context = 'fake_context'\n\n call_info = {'get_all': 0, 'shuffle': 0}\n\n def random_shuffle(_list):\n call_info['shuffle'] += 1\n\n def instance_get_all_by_filters(context, filters,\n sort_key, sort_order):\n self.assertEqual(context, fake_context)\n self.assertEqual(sort_key, 'deleted')\n self.assertEqual(sort_order, 'asc')\n call_info['got_filters'] = filters\n call_info['get_all'] += 1\n return ['fake_instance1', 'fake_instance2', 'fake_instance3']\n\n self.stubs.Set(db, 'instance_get_all_by_filters',\n instance_get_all_by_filters)\n self.stubs.Set(random, 'shuffle', random_shuffle)\n\n instances = cells_utils.get_instances_to_sync(fake_context)\n self.assertTrue(inspect.isgenerator(instances))\n self.assertTrue(len([x for x in instances]), 3)\n self.assertEqual(call_info['get_all'], 1)\n self.assertEqual(call_info['got_filters'], {})\n self.assertEqual(call_info['shuffle'], 0)\n\n instances = cells_utils.get_instances_to_sync(fake_context,\n shuffle=True)\n self.assertTrue(inspect.isgenerator(instances))\n self.assertTrue(len([x for x in instances]), 3)\n self.assertEqual(call_info['get_all'], 2)\n self.assertEqual(call_info['got_filters'], {})\n self.assertEqual(call_info['shuffle'], 1)\n\n instances = cells_utils.get_instances_to_sync(fake_context,\n updated_since='fake-updated-since')\n self.assertTrue(inspect.isgenerator(instances))\n self.assertTrue(len([x for x in instances]), 3)\n self.assertEqual(call_info['get_all'], 3)\n self.assertEqual(call_info['got_filters'],\n {'changes-since': 'fake-updated-since'})\n self.assertEqual(call_info['shuffle'], 1)\n\n instances = cells_utils.get_instances_to_sync(fake_context,\n project_id='fake-project',\n updated_since='fake-updated-since', shuffle=True)\n self.assertTrue(inspect.isgenerator(instances))\n self.assertTrue(len([x for x in instances]), 3)\n self.assertEqual(call_info['get_all'], 4)\n self.assertEqual(call_info['got_filters'],\n {'changes-since': 'fake-updated-since',\n 'project_id': 'fake-project'})\n self.assertEqual(call_info['shuffle'], 2)\n\n def test_split_cell_and_item(self):\n path = 'australia', 'queensland', 'gold_coast'\n cell = cells_utils._PATH_CELL_SEP.join(path)\n item = 'host_5'\n together = cells_utils.cell_with_item(cell, item)\n self.assertEqual(cells_utils._CELL_ITEM_SEP.join([cell, item]),\n together)\n\n # Test normal usage\n result_cell, result_item = cells_utils.split_cell_and_item(together)\n self.assertEqual(cell, result_cell)\n self.assertEqual(item, result_item)\n\n # Test with no cell\n cell = None\n together = cells_utils.cell_with_item(cell, item)\n self.assertEqual(item, together)\n result_cell, result_item = cells_utils.split_cell_and_item(together)\n self.assertEqual(cell, result_cell)\n self.assertEqual(item, result_item)\n", "meta": {"content_hash": "04d15b8373e81751e0aadb6587a4cac3", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 76, "avg_line_length": 40.337078651685395, "alnum_prop": 0.6094707520891365, "repo_name": "sridevikoushik31/nova", "id": "337556282122659f0166cd5cd345b1b240a05fba", "size": "4226", "binary": false, "copies": "3", "ref": "refs/heads/port_id_in_vif_on_devide", "path": "nova/tests/cells/test_cells_utils.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "JavaScript", "bytes": "7403"}, {"name": "Python", "bytes": "9944606"}, {"name": "Ruby", "bytes": "782"}, {"name": "Shell", "bytes": "17522"}]}} +{"text": "namespace omaha {\n\nnamespace internal {\n\nvoid CommandLineParserArgs::Reset() {\n switch_arguments_.clear();\n}\n\n// Assumes switch_name is already lower case.\nHRESULT CommandLineParserArgs::AddSwitch(const CString& switch_name) {\n ASSERT1(CString(switch_name).MakeLower().Compare(switch_name) == 0);\n if (switch_arguments_.find(switch_name) != switch_arguments_.end()) {\n return E_INVALIDARG;\n }\n\n StringVector string_vector;\n switch_arguments_[switch_name] = string_vector;\n return S_OK;\n}\n\n// Assumes switch_name is already lower case.\nHRESULT CommandLineParserArgs::AddSwitchArgument(const CString& switch_name,\n const CString& value) {\n ASSERT1(CString(switch_name).MakeLower().Compare(switch_name) == 0);\n ASSERT1(!switch_name.IsEmpty());\n if (switch_name.IsEmpty()) {\n // We don't have a switch yet, so this is just a base argument.\n // Example command line: \"foo.exe myarg /someswitch\"\n // Here, myarg would be a base argument.\n // TODO(omaha): base_args_.push_back(switch_name_str);\n return E_INVALIDARG;\n }\n\n SwitchAndArgumentsMap::iterator iter = switch_arguments_.find(switch_name);\n if (iter == switch_arguments_.end()) {\n return E_UNEXPECTED;\n }\n (*iter).second.push_back(value);\n\n return S_OK;\n}\n\nint CommandLineParserArgs::GetSwitchCount() const {\n return switch_arguments_.size();\n}\n\nbool CommandLineParserArgs::HasSwitch(const CString& switch_name) const {\n CString switch_name_lower = switch_name;\n switch_name_lower.MakeLower();\n return switch_arguments_.find(switch_name_lower) != switch_arguments_.end();\n}\n\n// The value at a particular index may change if switch_names are added\n// since we're using a map underneath. But this keeps us from having to write\n// an interator and expose it externally.\nHRESULT CommandLineParserArgs::GetSwitchNameAtIndex(int index,\n CString* name) const {\n ASSERT1(name);\n\n if (index >= static_cast<int>(switch_arguments_.size())) {\n return E_INVALIDARG;\n }\n\n SwitchAndArgumentsMapIter iter = switch_arguments_.begin();\n for (int i = 0; i < index; ++i) {\n ++iter;\n }\n\n *name = (*iter).first;\n\n return S_OK;\n}\n\nHRESULT CommandLineParserArgs::GetSwitchArgumentCount(\n const CString& switch_name, int* count) const {\n ASSERT1(count);\n\n CString switch_name_lower = switch_name;\n switch_name_lower.MakeLower();\n\n SwitchAndArgumentsMapIter iter = switch_arguments_.find(switch_name_lower);\n if (iter == switch_arguments_.end()) {\n return E_INVALIDARG;\n }\n\n *count = (*iter).second.size();\n return S_OK;\n}\n\nHRESULT CommandLineParserArgs::GetSwitchArgumentValue(\n const CString& switch_name,\n int argument_index,\n CString* argument_value) const {\n ASSERT1(argument_value);\n\n CString switch_name_lower = switch_name;\n switch_name_lower.MakeLower();\n\n int count = 0;\n HRESULT hr = GetSwitchArgumentCount(switch_name_lower, &count);\n if (FAILED(hr)) {\n return hr;\n }\n\n if (argument_index >= count) {\n return E_INVALIDARG;\n }\n\n SwitchAndArgumentsMapIter iter = switch_arguments_.find(switch_name_lower);\n if (iter == switch_arguments_.end()) {\n return E_INVALIDARG;\n }\n\n *argument_value = (*iter).second[argument_index];\n return S_OK;\n}\n\n} // namespace internal\n\nCommandLineParser::CommandLineParser() {\n}\n\nCommandLineParser::~CommandLineParser() {\n}\n\nHRESULT CommandLineParser::ParseFromString(const wchar_t* command_line) {\n CString command_line_str(command_line);\n command_line_str.Trim(_T(\" \"));\n\n int argc = 0;\n wchar_t** argv = ::CommandLineToArgvW(command_line_str, &argc);\n if (!argv) {\n return HRESULTFromLastError();\n }\n\n HRESULT hr = ParseFromArgv(argc, argv);\n ::LocalFree(argv);\n return hr;\n}\n\n// TODO(Omaha): Move the rule parser into a separate class.\n// TODO(Omaha): Fail the regular command parser if [/ switch is passed.\n// ParseFromArgv parses either a rule or a command line.\n//\n// Rules have required and optional parameters. An example of a rule is:\n// \"gu.exe /install <extraargs> [/oem [/appargs <appargs> [/silent\"\n// This creates a rule for a command line that requires \"/install\" for the rule\n// to match. The other parameters are optional, indicated by prefixes of \"[/\".\n//\n// Command lines do not use \"[/\", and use \"/\" for all parameters.\n// A command line that looks like this:\n// \"gu.exe /install <extraargs> /oem /appargs <appargs>\"\n// will match the rule above.\nHRESULT CommandLineParser::ParseFromArgv(int argc, wchar_t** argv) {\n if (argc == 0 || !argv) {\n return E_INVALIDARG;\n }\n\n CORE_LOG(L5, (_T(\"[CommandLineParser::ParseFromArgv][argc=%d]\"), argc));\n\n Reset();\n\n if (argc == 1) {\n // We only have the program name. So, we're done parsing.\n ASSERT1(!IsSwitch(argv[0]));\n return S_OK;\n }\n\n CString current_switch_name;\n bool is_optional_switch = false;\n\n // Start parsing at the first argument after the program name (index 1).\n for (int i = 1; i < argc; ++i) {\n HRESULT hr = S_OK;\n CString token = argv[i];\n token.Trim(_T(\" \"));\n CORE_LOG(L5, (_T(\"[Parsing arg][i=%d][argv[i]=%s]\"), i, token));\n if (IsSwitch(token)) {\n hr = StripSwitchNameFromArgv(token, ¤t_switch_name);\n if (FAILED(hr)) {\n return hr;\n }\n hr = AddSwitch(current_switch_name);\n if (FAILED(hr)) {\n CORE_LOG(LE, (_T(\"[AddSwitch failed][%s][0x%x]\"),\n current_switch_name, hr));\n return hr;\n }\n is_optional_switch = false;\n } else if (IsOptionalSwitch(token)) {\n hr = StripOptionalSwitchNameFromArgv(token, ¤t_switch_name);\n if (FAILED(hr)) {\n return hr;\n }\n hr = AddOptionalSwitch(current_switch_name);\n if (FAILED(hr)) {\n CORE_LOG(LE, (_T(\"[AddOptionalSwitch failed][%s][0x%x]\"),\n current_switch_name, hr));\n return hr;\n }\n is_optional_switch = true;\n } else {\n hr = is_optional_switch ?\n AddOptionalSwitchArgument(current_switch_name, token) :\n AddSwitchArgument(current_switch_name, token);\n\n if (FAILED(hr)) {\n CORE_LOG(LE, (_T(\"[Adding switch argument failed][%d][%s][%s][0x%x]\"),\n is_optional_switch, current_switch_name, token, hr));\n return hr;\n }\n }\n }\n\n return S_OK;\n}\n\nbool CommandLineParser::IsSwitch(const CString& param) const {\n // Switches must have a prefix (/) or (-), and at least one character.\n if (param.GetLength() < 2) {\n return false;\n }\n\n // All switches must start with / or -, and not contain any spaces.\n // Since the argv parser strips out the enclosing quotes around an argument,\n // we need to handle the following cases properly:\n // * foo.exe /switch arg -- /switch is a switch, arg is an arg\n // * foo.exe /switch \"/x y\" -- /switch is a switch, '/x y' is an arg and it\n // will get here _without_ the quotes.\n // If param_str starts with / and contains no spaces, then it's a switch.\n return ((param[0] == _T('/')) || (param[0] == _T('-'))) &&\n (param.Find(_T(\" \")) == -1) &&\n (param.Find(_T(\"%20\")) == -1);\n}\n\nbool CommandLineParser::IsOptionalSwitch(const CString& param) const {\n // Optional switches must have a prefix ([/) or ([-), and at least one\n // character.\n return param[0] == _T('[') && IsSwitch(param.Right(param.GetLength() - 1));\n}\n\nHRESULT CommandLineParser::StripSwitchNameFromArgv(const CString& param,\n CString* switch_name) {\n ASSERT1(switch_name);\n\n if (!IsSwitch(param)) {\n return E_INVALIDARG;\n }\n\n *switch_name = param.Right(param.GetLength() - 1);\n switch_name->Trim(_T(\" \"));\n switch_name->MakeLower();\n return S_OK;\n}\n\nHRESULT CommandLineParser::StripOptionalSwitchNameFromArgv(const CString& param,\n CString* name) {\n ASSERT1(name);\n\n if (!IsOptionalSwitch(param)) {\n return E_INVALIDARG;\n }\n\n return StripSwitchNameFromArgv(param.Right(param.GetLength() - 1), name);\n}\n\nvoid CommandLineParser::Reset() {\n required_args_.Reset();\n optional_args_.Reset();\n}\n\nHRESULT CommandLineParser::AddSwitch(const CString& switch_name) {\n ASSERT1(switch_name == CString(switch_name).MakeLower());\n return required_args_.AddSwitch(switch_name);\n}\n\nHRESULT CommandLineParser::AddSwitchArgument(const CString& switch_name,\n const CString& argument_value) {\n ASSERT1(switch_name == CString(switch_name).MakeLower());\n return required_args_.AddSwitchArgument(switch_name, argument_value);\n}\n\nint CommandLineParser::GetSwitchCount() const {\n return required_args_.GetSwitchCount();\n}\n\nbool CommandLineParser::HasSwitch(const CString& switch_name) const {\n return required_args_.HasSwitch(switch_name);\n}\n\n// The value at a particular index may change if switch_names are added\n// since we're using a map underneath. But this keeps us from having to write\n// an interator and expose it externally.\nHRESULT CommandLineParser::GetSwitchNameAtIndex(int index,\n CString* switch_name) const {\n return required_args_.GetSwitchNameAtIndex(index, switch_name);\n}\n\nHRESULT CommandLineParser::GetSwitchArgumentCount(const CString& switch_name,\n int* count) const {\n return required_args_.GetSwitchArgumentCount(switch_name, count);\n}\n\nHRESULT CommandLineParser::GetSwitchArgumentValue(\n const CString& switch_name,\n int argument_index,\n CString* argument_value) const {\n return required_args_.GetSwitchArgumentValue(switch_name,\n argument_index,\n argument_value);\n}\n\nHRESULT CommandLineParser::AddOptionalSwitch(const CString& switch_name) {\n ASSERT1(switch_name == CString(switch_name).MakeLower());\n return optional_args_.AddSwitch(switch_name);\n}\n\nHRESULT CommandLineParser::AddOptionalSwitchArgument(const CString& switch_name,\n const CString& value) {\n ASSERT1(switch_name == CString(switch_name).MakeLower());\n return optional_args_.AddSwitchArgument(switch_name, value);\n}\n\nint CommandLineParser::GetOptionalSwitchCount() const {\n return optional_args_.GetSwitchCount();\n}\n\nbool CommandLineParser::HasOptionalSwitch(const CString& switch_name) const {\n return optional_args_.HasSwitch(switch_name);\n}\n\n// The value at a particular index may change if switch_names are added\n// since we're using a map underneath. But this keeps us from having to write\n// an interator and expose it externally.\nHRESULT CommandLineParser::GetOptionalSwitchNameAtIndex(int index,\n CString* name) const {\n return optional_args_.GetSwitchNameAtIndex(index, name);\n}\n\nHRESULT CommandLineParser::GetOptionalSwitchArgumentCount(const CString& name,\n int* count) const {\n return optional_args_.GetSwitchArgumentCount(name, count);\n}\n\nHRESULT CommandLineParser::GetOptionalSwitchArgumentValue(const CString& name,\n int argument_index,\n CString* val) const {\n return optional_args_.GetSwitchArgumentValue(name,\n argument_index,\n val);\n}\n\n} // namespace omaha\n\n", "meta": {"content_hash": "503ca43fc87a4d8178cc54a2b11a163e", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 80, "avg_line_length": 32.57344632768361, "alnum_prop": 0.6390599254184373, "repo_name": "taxilian/omaha", "id": "66e9d3fa6bed99af015749e8b1330c759c72bfed", "size": "12373", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "goopdate/command_line_parser.cc", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "1957"}, {"name": "C", "bytes": "2626743"}, {"name": "C#", "bytes": "2385"}, {"name": "C++", "bytes": "4634004"}, {"name": "Python", "bytes": "103638"}]}} +{"text": "const path = require('path')\nconst existsSync = require('exists-sync')\nconst httpProxy = require('http-proxy')\nconst proxy = httpProxy.createProxyServer()\n\nfunction createDevelopmentProxy(app) {\n // add error handling to avoid https://github.com/nodejitsu/node-http-proxy/issues/527\n proxy.on('error', require('./handleProxyError.js'))\n\n // eg /assets/*\n app.all(`${STATS.publicPath}*`, (req, res) => {\n // try to send the file from assets/*\n // if it doesn't exist, use the proxy instead\n const filename = path.join(__dirname, 'assets', path.basename(req.url))\n if (existsSync(filename)) {\n return res.sendFile(filename)\n }\n return proxy.web(req, res, { target: 'http://localhost:8080' })\n })\n}\n\nmodule.exports = createDevelopmentProxy\n", "meta": {"content_hash": "36456f5820120397d0b62f03f0fa11bb", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 88, "avg_line_length": 34.77272727272727, "alnum_prop": 0.6862745098039216, "repo_name": "dferber90/webapp-starter-pack", "id": "b30175a0e2c5a965b4ef2f08c353746a1a27b7b0", "size": "765", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/utils/createDevelopmentProxy.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "2591"}, {"name": "JavaScript", "bytes": "92712"}]}} +{"text": "<?php\n\n\n\nnamespace Integrated\\Common\\Channel\\Exporter\\Queue;\n\n/**\n * @author Jan Sanne Mulder <jansanne@e-active.nl>\n */\ninterface RequestSerializerInterface\n{\n /**\n * @param Request $data\n *\n * @return string\n */\n public function serialize(Request $data);\n\n /**\n * @param string $data\n *\n * @return Request\n */\n public function deserialize($data);\n}\n", "meta": {"content_hash": "e1ac5697344436a5e1556ef219259148", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 51, "avg_line_length": 15.8, "alnum_prop": 0.6050632911392405, "repo_name": "integratedfordevelopers/integrated", "id": "d05be5b615b237cf0de38ecb2f6fb2362c8b5ffe", "size": "628", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Common/Channel/Exporter/Queue/RequestSerializerInterface.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "4803"}, {"name": "HTML", "bytes": "1438"}, {"name": "JavaScript", "bytes": "64697"}, {"name": "PHP", "bytes": "3152918"}, {"name": "SCSS", "bytes": "48270"}, {"name": "Twig", "bytes": "540896"}]}} +{"text": "ACCEPTED\n\n#### According to\nInternational Plant Names Index\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "46d60a72238c32d606238c822de8be90", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "7f94d476203038d68eb8eae90ddd687e0e9b8753", "size": "175", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Apocynaceae/Plumeria/Plumeria stenophylla/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "var SecretHandshake = require('./secret_handshake');\n\ndescribe(\"Secret Handshake\", function() {\n it(\"1 is a wink\", function() {\n var handshake = new SecretHandshake(1);\n expect(handshake.commands()).toEqual([\"wink\"]);\n });\n\n xit(\"10 is a double blink\", function() {\n var handshake = new SecretHandshake(2);\n expect(handshake.commands()).toEqual([\"double blink\"]);\n });\n\n xit(\"100 is close your eyes\", function() {\n var handshake = new SecretHandshake(4);\n expect(handshake.commands()).toEqual([\"close your eyes\"]);\n });\n\n xit(\"1000 is jump\", function() {\n var handshake = new SecretHandshake(8);\n expect(handshake.commands()).toEqual([\"jump\"]);\n });\n\n xit(\"11 is wink and double blink\", function() {\n var handshake = new SecretHandshake(3);\n expect(handshake.commands()).toEqual([\"wink\",\"double blink\"]);\n });\n\n xit(\"10011 is double blink and wink\", function() {\n var handshake = new SecretHandshake(19);\n expect(handshake.commands()).toEqual([\"double blink\",\"wink\"]);\n });\n\n xit(\"11111 is jump, close your eyes, double blink, and wink\", function() {\n var handshake = new SecretHandshake(31);\n expect(handshake.commands()).toEqual([\"jump\",\"close your eyes\",\"double blink\",\"wink\"]);\n });\n\n xit(\"text is an invalid secret handshake\", function() {\n expect( function () {\n var handshake = new SecretHandshake(\"piggies\");\n }).toThrow(new Error(\"Handshake must be a number\"));\n });\n});\n", "meta": {"content_hash": "74dbebef1497961e89cb134722e3ef90", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 91, "avg_line_length": 32.93181818181818, "alnum_prop": 0.6487232574189096, "repo_name": "nicgallardo/xjavascript", "id": "37b4a27a56ba3a7c8dd004126a4a3f5fbce3e4d9", "size": "1449", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "secret-handshake/secret_handshake_test.spec.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "172436"}, {"name": "Makefile", "bytes": "1019"}, {"name": "Shell", "bytes": "640"}]}} +{"text": "\ufeff<!--\n Please leave this section at the top of the change log.\n\n Changes for the current release should go under the section titled \"Current Release\", and should adhere to the following format:\n\n ## Current Release\n * Overview of change #1\n - Additional information about change #1\n * Overview of change #2\n - Additional information about change #2\n - Additional information about change #2\n * Overview of change #3\n * Overview of change #4\n - Additional information about change #4\n\n ## YYYY.MM.DD - Version X.Y.Z (Previous Release)\n * Overview of change #1\n - Additional information about change #1\n-->\n## Current Release\n\n## Version 4.3.1\n\n## Version 4.3.0\n* Fix for issue: https://github.com/Azure/azure-powershell/issues/4323\n\n## Version 4.2.1\n\n## Version 4.2.0\n* Added support for user managed KeyVault key rotations in the Set-AzureRMDataLakeStoreAccount cmdlet\n* Added a quality of life update to automatically trigger an `enableKeyVault` call when a user managed KeyVault is added or a key is rotated.\n* Updated the token audience for job and catalog APIs to use the correct Data Lake specific audience instead of the Azure Resource audience.\n* Fixed a bug limiting the size of files created/appended using the following cmdlets:\n - New-AzureRmDataLakeStoreItem\n - Add-AzureRmDataLakeStoreItemContent\n\n## Version 4.1.0\n* Enable-AzureRmDataLakeStoreKeyVault (Enable-AdlStoreKeyVault)\n * Enable KeyVault managed encryption for a DataLake Store\n\n## Version 4.0.1\n\n## Version 4.0.0\n* For `Import-AzureRMDataLakeStoreItem` and `Export-AzureRMDataLakeStoreItem` trace logging has been disabled by default to improve performance. If trace logging is desired please use the `-DiagnosticLogLevel` and `-DiagnosticLogPath` parameters\n* Fixed a bug that would sometimes cause PowerShell to crash when uploading lots of small file to ADLS.\n\n## Version 3.6.0\n* Add support for head and tail to the `Get-AzureRMDataLakeStoreItemContent` cmdlet. This enables returning the top N or last N new line delimited rows to be displayed.\n\n## Version 3.5.0\n\n## Version 3.4.0\n* Update Upload and Download commands to use the new and improved Upload/Download helpers in the new DataLake.Store clients. This also gives better diagnostic logging, if enabled.\n* Default thread counts for Upload and download are now computed on a best effort basis based on the data being uploaded or downloaded. This should allow for good performance without specifying a thread count.\n* Update to Set-AzureRMDataLakeStoreAccount to allow for enabling and disabling Azure originating IPs through the firewall\n* Add warnings to Add and Set-AzureRMDataLakeStoreFirewallRule and AzureRMDataLakeStoreTrustedIdProvider if they are disabled\n* Remove explicit restrictions on resource locations. If Data Lake Store is not supported in a region, we will surface an error from the service.\n\n## Version 3.3.0\n* Updated help for all cmdlets to include output as well as more descriptions of parameters and the inclusion of aliases.\n* Update New-AdlStore and Set-AdlStore to support commitment tier options for the service.\n* Added OutputType mismatch warnings to all cmdlets with incorrect OutputType attributes. These will be fixed in a future breaking change release.\n* Add Diagnostic logging support to Import-AdlStoreItem and Export-AdlStoreItem. This can be enabled through the following parameters:\n * -Debug, enables full diagnostic logging as well as debug logging to the PowerShell console. Most verbose options\n * -DiagnosticLogLevel, allows finer control of the output than debug. If used with debug, this is ignored and debug logging is used.\n * -DiagnosticLogPath, optionally specify the file to write diagnostic logs to. By default it is written to a file under %LOCALAPPDATA%\\AdlDataTransfer\n* Added support to New-AdlStore to explicitly opt-out of account encryption. To do so, create the account with the -DisableEncryption flag.\n\n## Version 3.2.0\n* Introduction of deprecation warning for nested properties for all ARM resources. Nested properties will be removed in a future release and all properties will be moved one level up.\n* Removed the ability to set encryption in Set-AzureRMDataLakeStoreAccount (never was supported)\n* Added ability to enable/disable firewall rules and the trusted id providers during Set-AzureRMDataLakeStoreAccount\n* Added a new cmdlet: Set-AzureRMDataLakeStoreItemExpiry, which allows the user to set or remove the expiration for files (not folders) in their ADLS account.\n* Small fix for friendly date properties to pivot off UTC time instead of local time, ensuring standard time reporting.\n\n## Version 3.1.0\n* Improvements to import and export data cmdlets\n - Drastically increased performance for distributed download scenarios, where multiple sessions are running across many clients targeting the same ADLS account.\n - Better error handling and messaging for both upload and download scenarios.\n* Full Firewall rules management CRUD\n - The below cmdlets can be used to manage firewall rules for an ADLS account:\n - Add-AzureRMDataLakeStoreFirewallRule\n - Set-AzureRMDataLakeStoreFirewallRule\n - Get-AzureRMDataLakeStoreFirewallRule\n - Remove-AzureRMDataLakeStoreFirewallRule\n* Full Trusted ID provider management CRUD\n - The below cmdlets can be used to manage trusted identity providers for an ADLS account:\n - Add-AzureRMDataLakeStoreTrustedIdProvider\n - Set-AzureRMDataLakeStoreTrustedIdProvider\n - Get-AzureRMDataLakeStoreTrustedIdProvider\n - Remove-AzureRMDataLakeStoreTrustedIdProvider\n* Account Encryption Support\n - You can now encrypt newly created ADLS accounts as well as enable encryption on existing ADLS accounts using the New-AzureRMDataLakeStoreAccount and Set-AzureRMDataLakeStoreAccount cmdlets, respectively.", "meta": {"content_hash": "0a066b9b9ec7b8b29a51870d4e0209f8", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 245, "avg_line_length": 62.924731182795696, "alnum_prop": 0.7886192754613808, "repo_name": "hungmai-msft/azure-powershell", "id": "96b0ac4b9ca2dda18fc7669a13354a4628dd2fb3", "size": "5854", "binary": false, "copies": "2", "ref": "refs/heads/preview", "path": "src/ResourceManager/DataLakeStore/ChangeLog.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "16509"}, {"name": "C#", "bytes": "39328004"}, {"name": "HTML", "bytes": "209"}, {"name": "JavaScript", "bytes": "4979"}, {"name": "PHP", "bytes": "41"}, {"name": "PowerShell", "bytes": "3983165"}, {"name": "Ruby", "bytes": "265"}, {"name": "Shell", "bytes": "50"}, {"name": "XSLT", "bytes": "6114"}]}} +{"text": "/**\n * \\file\n * \\brief Implementation of the necessary initialization for the RadauII-A solver\n *\n * \\author Nicholas Curtis\n * \\date 03/09/2015\n *\n */\n\n#ifdef GENERATE_DOCS\nnamespace radau2a {\n#endif\n\n void initialize_solver() {\n }\n\n/*!\n \\fn char* solver_name()\n \\brief Returns a descriptive solver name\n*/\n const char* solver_name() {\n \tconst char* name = \"radau2a-int\";\n \treturn name;\n }\n\n void cleanup_solver() {\n \t//nothing to do\n }\n\n void init_solver_log() {\n\n }\n\n void solver_log() {\n\n }\n\n#ifdef GENERATE_DOCS\n}\n#endif", "meta": {"content_hash": "3a3425e943cf2b7a5e70198f55b8c6b8", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 81, "avg_line_length": 13.225, "alnum_prop": 0.6483931947069943, "repo_name": "SLACKHA/accelerInt", "id": "24ada842cfa2172e3141dbf1e75da8e1ed93cb80", "size": "529", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "radau2a/radau2a_init.c", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "144786"}, {"name": "C++", "bytes": "16646"}, {"name": "Cuda", "bytes": "183418"}, {"name": "Python", "bytes": "80505"}, {"name": "Shell", "bytes": "3317"}]}} +{"text": "var fork = require(\"child_process\").fork;\nvar path = require(\"path\");\n\nvar bin = \"./node_modules/.bin/istanbul\";\nvar cov = \"cover --report=lcov --dir=test/coverage/js _mocha --\".split(\" \");\n\nif (process.platform === 'win32') {\n bin = \"./node_modules/mocha/bin/mocha\";\n cov = [];\n}\n\nvar args = cov.concat([\n \"test/runner\",\n \"test/tests\",\n \"--expose-gc\",\n \"--timeout\",\n \"15000\"\n]);\n\nif (!process.env.APPVEYOR && !process.env.TRAVIS) {\n var local = path.join.bind(path, __dirname);\n var dummyPath = local(\"home\");\n process.env.HOME = dummyPath;\n process.env.USERPROFILE = dummyPath;\n}\n\nfork(bin, args, { cwd: path.join(__dirname, \"../\") }).on(\"close\", process.exit);\n", "meta": {"content_hash": "b90dc19d2f75e8fc7ca8f44b6b31a228", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 80, "avg_line_length": 25.0, "alnum_prop": 0.6207407407407407, "repo_name": "jdgarcia/nodegit", "id": "52cbff50ef10cbcd44564023d9eec225aab528d8", "size": "675", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/index.js", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "1789"}, {"name": "C++", "bytes": "128326"}, {"name": "JavaScript", "bytes": "439349"}, {"name": "Python", "bytes": "2142"}, {"name": "Shell", "bytes": "864"}]}} +{"text": "/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.addthis.hydra.data.query.engine;\n\nimport java.util.concurrent.ScheduledExecutorService;\nimport java.util.concurrent.ScheduledThreadPoolExecutor;\nimport java.util.concurrent.TimeUnit;\n\nimport com.addthis.basis.util.Parameter;\n\nimport com.google.common.base.Objects;\nimport com.google.common.cache.CacheBuilder;\nimport com.google.common.cache.LoadingCache;\nimport com.google.common.util.concurrent.MoreExecutors;\nimport com.google.common.util.concurrent.ThreadFactoryBuilder;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n/**\n * This class implements an LRU cache to keep our QueryEngines. It is instantiated only from MeshQuerySource.\n * <p/>\n * It uses guava's cache loader to do most of the work. We periodically check to see if new data is available for\n * a job, and if so, asynchronously prepare the new database before swapping it in. Multiple get or refresh attempts\n * will block and wait on the existing one to finish.\n * <p/>\n * As per guava's specs, it is not guaranteed that we will wait until we are at maximum capacity to evict engines.\n * Also, we are okay with evicting non-idle engines, but we do not force them to close. Rather, we set a flag and\n * trust the query using them to close it when it is finished. This means we may have a number of engines open equal\n * to the cache capacity + number of running queries. It is also possible for a few engines to be transiently open\n * while waiting for the eviction listener to close engines. This is somewhat balanced by guava's more aggressive\n * eviction policy, but in general we should not rely on the capacity as being an absolute hard max. In practice, it\n * should be more than sufficient though.\n * <p/>\n * Basic flow is :\n * Constructed from MQSource\n * MQSource calls getAndLease()\n * See if we have a suitable engine\n * If so, return it, if not, make one and return it\n */\npublic class QueryEngineCache {\n\n private static final Logger log = LoggerFactory.getLogger(QueryEngineCache.class);\n\n /**\n * 'soft cap' on the number of engines to have open. this + concurrent queries +/- a few should closely\n * resemble the real cap on open engines\n */\n private static final long DEFAULT_ENGINE_CACHE_SIZE = Parameter.longValue(\"queryEngineCache.engineCacheSize\", 5);\n\n /**\n * seconds to let an engine be in cache before attempting to refresh it. Refreshing it means checking whether\n * or not the job has finished running and has a new data directory; it does not force the reopening of the same\n * directory. It is important to note that this scheduled refresh is not checked unless a get is called on it,\n * and that even if the refresh returns the old engine, it resets the fail timer.\n */\n private static final long DEFAULT_REFRESH_INTERVAL = Parameter.longValue(\"queryEngineCache.refreshInterval\", 2 * 60);\n\n /**\n * seconds in between cache malongenance runs. This helps query sources and jobs in lower throughput environments.\n * It does the guava api clean up method which handles any pending expiration events, and also attempts to provoke\n * refresh attempts on cached keys by calling get on them. The latter is more important for our purposes. Without it,\n * relatively idle engines would become stale or subject to undesired eviction by the fail longerval. 0 disables it.\n */\n private static final long DEFAULT_MAINTENANCE_INTERVAL = Parameter.longValue(\"queryEngineCache.maintenanceInterval\", 20 * 60);\n\n /**\n * seconds to let an engine be in cache after the most recent write. This is longended only for situations\n * where re-opening that engine is failing, and thus while the refresh is not occuring. it might appear that\n * an engine is alive and up to date and this attempts to limit that disparity if desired. Note that by failing,\n * we mean that the refresh method is throwing exceptions.\n */\n private static final long DEFAULT_FAIL_INTERVAL = Parameter.longValue(\"queryEngineCache.failInterval\", 70 * 60);\n\n /**\n * thread pool for cache maintenance runs. Should only need one thread.\n */\n private final ScheduledExecutorService queryEngineCacheMaintainer = MoreExecutors\n .getExitingScheduledExecutorService(new ScheduledThreadPoolExecutor(1,\n new ThreadFactoryBuilder().setNameFormat(\"queryEngineCacheMaintainer=%d\").build()));\n\n /**\n * The {@link LoadingCache} that provides the backing data structure for this class.\n * Acts like an intelligent semi-persistent Map that has logic for loading and reloading complex objects.\n */\n protected final LoadingCache<String, QueryEngine> loadingEngineCache;\n\n private final long engineCacheSize;\n private final long refreshInterval;\n private final long failInterval;\n private final long maintenanceInterval;\n\n /**\n * Initialize a {@link LoadingCache} that is capable of loading and reloading\n * {@link QueryEngine}s. Reloads occur asynchronously to prevent blocking operations\n * during unrelated calls to the cache. When reload is called the current engine will be compared with the\n * newest available data directory. If the current engine is up to date it will be returned, otherwise a new\n * engine will be opened to replace the current engine with the latest available.\n * <p/>\n * On removal, we have a listener that will call closeWhenIdle on engines. It has a guard against removal events\n * generated by refreshes where we decide to keep the existing engine (no new job data is available). There is a\n * race condition where that test can be passed more than once so any clean up done there must be okay with that.\n * The race condition is such that the test will always be passed at least once, and never when the engine is still\n * available to new get calls. This meets our requirements.\n */\n public QueryEngineCache() {\n this(DEFAULT_ENGINE_CACHE_SIZE, DEFAULT_REFRESH_INTERVAL, DEFAULT_FAIL_INTERVAL, DEFAULT_MAINTENANCE_INTERVAL);\n }\n\n public QueryEngineCache(long engineCacheSize, long refreshInterval, long failInterval, long maintenanceInterval) {\n this(engineCacheSize, refreshInterval, failInterval, maintenanceInterval, new EngineLoader());\n }\n\n public QueryEngineCache(long engineCacheSize, long refreshInterval, long failInterval, long maintenanceInterval,\n EngineLoader engineLoader) {\n this.engineCacheSize = engineCacheSize;\n this.refreshInterval = refreshInterval;\n this.failInterval = failInterval;\n this.maintenanceInterval = maintenanceInterval;\n\n log.info(\"Initializing QueryEngineCache: {}\", this); //using 'this' is just more efficient\n\n // no easy way around escaping 'this' here, but at least it is more obvious what is going on now\n loadingEngineCache = CacheBuilder.newBuilder()\n .maximumWeight(engineCacheSize * 100)\n .<String, QueryEngine>weigher(\n (dir, engine) -> (int) (100 * engine.getTree().getAdvancedSettings().cacheWeight()))\n .refreshAfterWrite(refreshInterval, TimeUnit.SECONDS)\n .expireAfterWrite(failInterval, TimeUnit.SECONDS)\n .removalListener(new EngineRemovalListener(this))\n .build(engineLoader);\n\n //schedule maintenance runs\n maybeInitMaintenance();\n }\n\n\n /**\n * schedules maintenance for the cache using the maintenanceInterval parameter. Values less than 1\n * are treated as 'do not do maintenance'. Maintenance includes cache loader cleanUp() and an attempt\n * to trigger refreshes in relatively idle engines. This is done by the thread safe iterator from\n * the loading cache and performing getIfPresent calls on each entry. This will only trigger refreshes\n * if the refresh interval has passed, and avoids a potential race condition where doing refresh() could\n * end up re-loading an engine that was just evicted. This is important because in addition to being\n * incorrect cache behavior, refresh will block instead of being asynchronous while doing so -- possibly\n * leading to even more race conditions.\n * <p/>\n * since the thread safe iterator is weakly consistent, it is a good idea to configure the intervals so\n * that maintenance will be performed more than once before the fail interval occurs (if we do not desire\n * to evict and close 'relatively idle' engines). eg. maintenanceInterval * 2 < failInterval\n * <p/>\n * unfortunately, this somewhat confuses the eviction order heuristic because it considers these all to be\n * valid r/ws. This is one reason to keep this value relatively long. It is possible to optimize against this\n * somewhat, but probably at the cost of greatly increased complexity. It seems unlikely that it will have a\n * large impact if performed infrequently enough though, especially since the evictor is not a simple LRU.\n */\n private void maybeInitMaintenance() {\n if (maintenanceInterval > 0) {\n queryEngineCacheMaintainer.scheduleAtFixedRate(() -> {\n loadingEngineCache.cleanUp();\n loadingEngineCache.asMap().keySet().forEach(loadingEngineCache::getIfPresent);\n }, maintenanceInterval, maintenanceInterval, TimeUnit.SECONDS);\n }\n }\n\n /**\n * Takes an unresolved (usually the gold path) path to a bdb query directory. This is mostly a thin\n * layer between this class and the backing LoadingCache.\n * <p/>\n * Most importantly, it also attempts to lease the engine. This is because there is a rare race condition\n * where after acquiring the engine, but before leasing it ourselves, it is evicted from the cache. Probably\n * caused by refresh, since it is less likely that an engine we just acquired would be the target of size\n * eviction in most cases. It is relatively unlikely to happen even twice in a row, but we try three times\n * here anyway. I have never seen this exception but if we start to see it a lot, we can re-evaluate this approach.\n *\n * @param directoryPath The path of the engine directory\n * @return a QueryEngine from the cache or constructed on demand (constructing blocks this thread)\n * @throws Exception - any problem while getting the engine. Likely either an issue with leasing or with opening an engine\n */\n public QueryEngine getAndLease(String directoryPath) throws Exception {\n for (int i = 0; i < 3; i++) {\n QueryEngine qe = loadingEngineCache.get(directoryPath);\n if (qe.lease()) {\n return qe;\n }\n }\n log.warn(\"Tried three times but unable to get lease for engine with path: {}\", directoryPath);\n throw new RuntimeException(\"Can't lease engine\");\n }\n\n @Override\n public String toString() {\n return Objects.toStringHelper(this)\n .add(\"engineCacheSize\", engineCacheSize)\n .add(\"refreshInterval\", refreshInterval)\n .add(\"maintenanceInterval\", maintenanceInterval)\n .add(\"failInterval\", failInterval)\n .toString();\n }\n\n}\n", "meta": {"content_hash": "adc024dcbfaacae34001cd8e0682b7a5", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 130, "avg_line_length": 55.60849056603774, "alnum_prop": 0.7211807617270337, "repo_name": "mythguided/hydra", "id": "12e6ca02fa41c099d8300355623fa6ff8cc95be5", "size": "11789", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hydra-data/src/main/java/com/addthis/hydra/data/query/engine/QueryEngineCache.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "37939"}, {"name": "HTML", "bytes": "103283"}, {"name": "Java", "bytes": "4732762"}, {"name": "JavaScript", "bytes": "582863"}, {"name": "Shell", "bytes": "13923"}]}} +{"text": "{-# LANGUAGE CPP #-}\n{-# LANGUAGE ConstraintKinds #-}\n{-# LANGUAGE DataKinds #-}\n{-# LANGUAGE FlexibleContexts #-}\n{-# LANGUAGE FlexibleInstances #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE TypeFamilies #-}\n{-# LANGUAGE TypeOperators #-}\n{-# LANGUAGE UndecidableInstances #-}\n\nmodule Servant.Ruby.Internal where\n\nimport Servant.API\nimport Data.Proxy\nimport GHC.Exts (Constraint)\nimport GHC.TypeLits\n\ndata AjaxReq\n\nclass HasRB (layout :: *) where\n type RB layout :: *\n rubyFor :: Proxy layout -> AjaxReq -> RB layout\n", "meta": {"content_hash": "04fe634b44648e221b1026a823d617c6", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 51, "avg_line_length": 26.727272727272727, "alnum_prop": 0.6360544217687075, "repo_name": "parsonsmatt/servant-ruby", "id": "abcc508eb3facdd198c213260c073f31289f2906", "size": "588", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Servant/Ruby/Internal.hs", "mode": "33188", "license": "mit", "language": [{"name": "Haskell", "bytes": "1576"}]}} +{"text": "from msrest.serialization import Model\nfrom msrest.exceptions import HttpOperationError\n\n\nclass ErrorResponse(Model):\n \"\"\"The error object.\n\n :param error: Error.\n :type error: ~azure.mgmt.resource.managementgroups.models.ErrorDetails\n \"\"\"\n\n _attribute_map = {\n 'error': {'key': 'error', 'type': 'ErrorDetails'},\n }\n\n def __init__(self, error=None):\n super(ErrorResponse, self).__init__()\n self.error = error\n\n\nclass ErrorResponseException(HttpOperationError):\n \"\"\"Server responsed with exception of type: 'ErrorResponse'.\n\n :param deserialize: A deserializer\n :param response: Server response to be deserialized.\n \"\"\"\n\n def __init__(self, deserialize, response, *args):\n\n super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)\n", "meta": {"content_hash": "1cea87edd169f394f10b678c53ae0cc7", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 99, "avg_line_length": 27.633333333333333, "alnum_prop": 0.6755126658624849, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "d4af1d388d68ee2114db0e15d458065bc421a7b0", "size": "1303", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "azure-mgmt-resource/azure/mgmt/resource/managementgroups/models/error_response.py", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "34619070"}]}} +{"text": "function matrix(n) {\n const results = [];\n\n for (let i = 0; i < n; i++) {\n results.push([]);\n }\n\n let counter = 1;\n let startColumn = 0;\n let endColumn = n - 1;\n let startRow = 0;\n let endRow = n - 1;\n while (startColumn <= endColumn && startRow <= endRow) {\n // Top row\n for (let i = startColumn; i <= endColumn; i++) {\n results[startRow][i] = counter;\n counter++;\n }\n startRow++;\n\n // Right column\n for (let i = startRow; i <= endRow; i++) {\n results[i][endColumn] = counter;\n counter++;\n }\n endColumn--;\n\n // Bottom row\n for (let i = endColumn; i >= startColumn; i--) {\n results[endRow][i] = counter;\n counter++;\n }\n endRow--;\n\n // start column\n for (let i = endRow; i >= startRow; i--) {\n results[i][startColumn] = counter;\n counter++;\n }\n startColumn++;\n }\n\n return results;\n}\n\nmodule.exports = matrix;\n", "meta": {"content_hash": "6845853c2317bf025a109d0dc5d5a925", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 58, "avg_line_length": 19.782608695652176, "alnum_prop": 0.5274725274725275, "repo_name": "spiresd55/code-playground", "id": "f1d0651e482f080e54421cf74e0c08079627ac1c", "size": "1286", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "completed_exercises/matrix/index.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "899"}, {"name": "HTML", "bytes": "25468"}, {"name": "JavaScript", "bytes": "247128"}, {"name": "TypeScript", "bytes": "44268"}]}} +{"text": "\npackage com.wegas.app.jsf.controllers;\n\nimport com.wegas.core.ejb.GameFacade;\nimport com.wegas.core.ejb.PlayerFacade;\nimport com.wegas.core.exception.internal.WegasNoResultException;\nimport com.wegas.core.persistence.game.Game;\nimport com.wegas.core.persistence.game.GameModel;\nimport java.io.IOException;\nimport java.io.Serializable;\nimport javax.annotation.PostConstruct;\nimport javax.ejb.EJB;\nimport javax.enterprise.context.RequestScoped;\nimport javax.faces.bean.ManagedBean;\nimport javax.faces.bean.ManagedProperty;\nimport javax.faces.context.ExternalContext;\nimport javax.faces.context.FacesContext;\nimport javax.inject.Inject;\n\n/**\n *\n * @author Francois-Xavier Aeberhard (fx at red-agent.com)\n */\n@ManagedBean(name = \"singleLobbyController\")\n@RequestScoped\npublic class SingleLobbyController implements Serializable {\n\n /**\n *\n */\n @ManagedProperty(\"#{param.token}\")\n private String token;\n /**\n *\n */\n @EJB\n private GameFacade gameFacade;\n /**\n *\n */\n @EJB\n private PlayerFacade playerFacade;\n /**\n *\n */\n @Inject\n ErrorController errorController;\n /**\n *\n */\n private Game currentGame = null;\n\n /**\n *\n * @fixme rights management\n *\n */\n @PostConstruct\n public void init() {\n final ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();\n\n if (token != null) {\n currentGame = gameFacade.findByToken(token);\n if (currentGame != null) { // 1st case: token is associated with a game\n try {\n playerFacade.findCurrentPlayer(currentGame);\n try {\n externalContext.dispatch(\"game-play.xhtml?gameId=\" + currentGame.getId());// display game page\n } catch (IOException ex) {\n }\n } catch (WegasNoResultException e) {\n // Nothing to do. stay on current page so player will choose his team\n }\n\n //} else { // 2nd case: token is associated with a team\n // final Team currentTeam = teamFacade.findByToken(token);\n // if (currentTeam != null) {\n // try {\n // playerFacade.findCurrentPlayer(currentTeam.getGame());\n // } catch (NoResultException etp) { // Player has not joined yet\n // if (SecurityHelper.isAnyPermitted(currentTeam.getGame(), Arrays.asList(\"Token\", \"TeamToken\", \"View\"))) {\n // teamFacade.joinTeam(currentTeam, userFacade.getCurrentUser()); // so we join him\n // } else {\n // externalContext.dispatch(\"/wegas-app/view/error/accessdenied.xhtml\"); // not allowed\n // }\n // }\n // externalContext.dispatch(\"game-play.xhtml?gameId=\" + currentTeam.getGame().getId());// display game page\n // } else {\n // externalContext.dispatch(\"/wegas-app/view/error/accessdenied.xhtml\"); // no game\n // }\n //}\n } else {\n errorController.dispatch(\"The game you are looking for could not be found.\");\n }\n } else {\n errorController.dispatch(\"The game you are looking for could not be found.\");\n }\n }\n\n /**\n * @return the token\n */\n public String getToken() {\n return token;\n }\n\n /**\n * @param token the token to set\n */\n public void setToken(String token) {\n this.token = token;\n }\n\n /**\n * @return the currentGame\n */\n public Game getCurrentGame() {\n return currentGame;\n }\n\n /**\n * @param currentGame the currentGame to set\n */\n public void setCurrentGame(Game currentGame) {\n this.currentGame = currentGame;\n }\n\n /**\n * @return the current game model\n */\n public GameModel getCurrentGameModel() {\n return currentGame.getGameModel();\n }\n}\n", "meta": {"content_hash": "92e1ec893a8350c0391127422f011016", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 134, "avg_line_length": 31.71641791044776, "alnum_prop": 0.5510588235294117, "repo_name": "ghiringh/Wegas", "id": "2bfa7b5f89e99f28fe0b6e976de2f7ef822ed52f", "size": "4410", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wegas-app/src/main/java/com/wegas/app/jsf/controllers/SingleLobbyController.java", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "903473"}, {"name": "HTML", "bytes": "195241"}, {"name": "Java", "bytes": "1757507"}, {"name": "JavaScript", "bytes": "4366779"}]}} +{"text": "from datetime import timedelta\n\nfrom django.core.management import call_command\n\nfrom tests.test_case import AppTestCase\nfrom wagtailstreamforms.models import Form, FormSubmission\n\n\nclass Tests(AppTestCase):\n fixtures = [\"test\"]\n\n def test_command(self):\n form = Form.objects.get(pk=1)\n to_keep = FormSubmission.objects.create(form=form, form_data={})\n to_delete = FormSubmission.objects.create(form=form, form_data={})\n to_delete.submit_time = to_delete.submit_time - timedelta(days=2)\n to_delete.save()\n\n call_command(\"prunesubmissions\", 1)\n\n FormSubmission.objects.get(pk=to_keep.pk)\n\n with self.assertRaises(FormSubmission.DoesNotExist):\n FormSubmission.objects.get(pk=to_delete.pk)\n", "meta": {"content_hash": "4cca3b3599e9153138fb9bf4ae4582db", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 74, "avg_line_length": 31.666666666666668, "alnum_prop": 0.7, "repo_name": "AccentDesign/wagtailstreamforms", "id": "71bcb5296a3739d9e37fc034c60c318a915da6a2", "size": "760", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/management/test_prunesubmissions.py", "mode": "33188", "license": "mit", "language": [{"name": "Dockerfile", "bytes": "690"}, {"name": "HTML", "bytes": "14735"}, {"name": "JavaScript", "bytes": "213"}, {"name": "Makefile", "bytes": "438"}, {"name": "Python", "bytes": "189375"}, {"name": "SCSS", "bytes": "2257"}, {"name": "Shell", "bytes": "559"}]}} +{"text": "package proc\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"strings\"\n\n\t\"github.com/go-delve/delve/pkg/dwarf/op\"\n)\n\n// Registers is an interface for a generic register type. The\n// interface encapsulates the generic values / actions\n// we need independent of arch. The concrete register types\n// will be different depending on OS/Arch.\ntype Registers interface {\n\tPC() uint64\n\tSP() uint64\n\tBP() uint64\n\tLR() uint64\n\tTLS() uint64\n\t// GAddr returns the address of the G variable if it is known, 0 and false otherwise\n\tGAddr() (uint64, bool)\n\tSlice(floatingPoint bool) ([]Register, error)\n\t// Copy returns a copy of the registers that is guaranteed not to change\n\t// when the registers of the associated thread change.\n\tCopy() (Registers, error)\n}\n\n// Register represents a CPU register.\ntype Register struct {\n\tName string\n\tReg *op.DwarfRegister\n}\n\n// AppendUint64Register will create a new Register struct with the name and value\n// specified and append it to the `regs` slice.\nfunc AppendUint64Register(regs []Register, name string, value uint64) []Register {\n\treturn append(regs, Register{name, op.DwarfRegisterFromUint64(value)})\n}\n\n// AppendBytesRegister will create a new Register struct with the name and value\n// specified and append it to the `regs` slice.\nfunc AppendBytesRegister(regs []Register, name string, value []byte) []Register {\n\treturn append(regs, Register{name, op.DwarfRegisterFromBytes(value)})\n}\n\n// ErrUnknownRegister is returned when the value of an unknown\n// register is requested.\nvar ErrUnknownRegister = errors.New(\"unknown register\")\n\ntype flagRegisterDescr []flagDescr\ntype flagDescr struct {\n\tname string\n\tmask uint64\n}\n\nvar mxcsrDescription flagRegisterDescr = []flagDescr{\n\t{\"FZ\", 1 << 15},\n\t{\"RZ/RN\", 1<<14 | 1<<13},\n\t{\"PM\", 1 << 12},\n\t{\"UM\", 1 << 11},\n\t{\"OM\", 1 << 10},\n\t{\"ZM\", 1 << 9},\n\t{\"DM\", 1 << 8},\n\t{\"IM\", 1 << 7},\n\t{\"DAZ\", 1 << 6},\n\t{\"PE\", 1 << 5},\n\t{\"UE\", 1 << 4},\n\t{\"OE\", 1 << 3},\n\t{\"ZE\", 1 << 2},\n\t{\"DE\", 1 << 1},\n\t{\"IE\", 1 << 0},\n}\n\nvar eflagsDescription flagRegisterDescr = []flagDescr{\n\t{\"CF\", 1 << 0},\n\t{\"\", 1 << 1},\n\t{\"PF\", 1 << 2},\n\t{\"AF\", 1 << 4},\n\t{\"ZF\", 1 << 6},\n\t{\"SF\", 1 << 7},\n\t{\"TF\", 1 << 8},\n\t{\"IF\", 1 << 9},\n\t{\"DF\", 1 << 10},\n\t{\"OF\", 1 << 11},\n\t{\"IOPL\", 1<<12 | 1<<13},\n\t{\"NT\", 1 << 14},\n\t{\"RF\", 1 << 16},\n\t{\"VM\", 1 << 17},\n\t{\"AC\", 1 << 18},\n\t{\"VIF\", 1 << 19},\n\t{\"VIP\", 1 << 20},\n\t{\"ID\", 1 << 21},\n}\n\nfunc (descr flagRegisterDescr) Mask() uint64 {\n\tvar r uint64\n\tfor _, f := range descr {\n\t\tr = r | f.mask\n\t}\n\treturn r\n}\n\nfunc (descr flagRegisterDescr) Describe(reg uint64, bitsize int) string {\n\tvar r []string\n\tfor _, f := range descr {\n\t\tif f.name == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\t// rbm is f.mask with only the right-most bit set:\n\t\t// 0001 1100 -> 0000 0100\n\t\trbm := f.mask & -f.mask\n\t\tif rbm == f.mask {\n\t\t\tif reg&f.mask != 0 {\n\t\t\t\tr = append(r, f.name)\n\t\t\t}\n\t\t} else {\n\t\t\tx := (reg & f.mask) >> uint64(math.Log2(float64(rbm)))\n\t\t\tr = append(r, fmt.Sprintf(\"%s=%x\", f.name, x))\n\t\t}\n\t}\n\tif reg & ^descr.Mask() != 0 {\n\t\tr = append(r, fmt.Sprintf(\"unknown_flags=%x\", reg&^descr.Mask()))\n\t}\n\treturn fmt.Sprintf(\"%#0*x\\t[%s]\", bitsize/4, reg, strings.Join(r, \" \"))\n}\n", "meta": {"content_hash": "5fac7ad48d7df82fdd182c2e35a6f8f2", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 85, "avg_line_length": 24.511811023622048, "alnum_prop": 0.6174108576935432, "repo_name": "go-delve/delve", "id": "185d0615c5eb8fd881fef343a12ddc512255e5c1", "size": "3113", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pkg/proc/registers.go", "mode": "33188", "license": "mit", "language": [{"name": "Assembly", "bytes": "3179"}, {"name": "C", "bytes": "2657334"}, {"name": "Go", "bytes": "2792924"}, {"name": "Kotlin", "bytes": "7688"}, {"name": "Makefile", "bytes": "970"}, {"name": "PowerShell", "bytes": "3085"}, {"name": "Python", "bytes": "599"}, {"name": "Shell", "bytes": "5109"}, {"name": "Starlark", "bytes": "2024"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>riscv: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.7.1+1 / riscv - 0.0.3</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n riscv\n <small>\n 0.0.3\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-11-10 23:24:19 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-11-10 23:24:19 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-num base Num library distributed with the OCaml compiler\nbase-ocamlbuild base OCamlbuild binary and libraries distributed with the OCaml compiler\nbase-threads base\nbase-unix base\ncamlp5 7.14 Preprocessor-pretty-printer of OCaml\nconf-findutils 1 Virtual package relying on findutils\nconf-perl 2 Virtual package relying on perl\ncoq 8.7.1+1 Formal proof management system\nnum 0 The Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.02.3 The OCaml compiler (virtual package)\nocaml-base-compiler 4.02.3 Official 4.02.3 release\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.5 A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nauthors: [\n "Massachusetts Institute of Technology"\n]\nmaintainer: "Jason Gross <jgross@mit.edu>"\nhomepage: "https://github.com/mit-plv/riscv-coq"\nbug-reports: "https://github.com/mit-plv/riscv-coq/issues"\nlicense: "BSD-3-Clause"\nbuild: [\n [make "-j%{jobs}%" "EXTERNAL_DEPENDENCIES=1" "all"]\n]\ninstall: [make "EXTERNAL_DEPENDENCIES=1" "install"]\ndepends: [\n "coq" {>= "8.15~"}\n "coq-coqutil" {= "0.0.2"}\n "coq-record-update" {>= "0.3.0"}\n]\ndev-repo: "git+https://github.com/mit-plv/riscv-coq.git"\nsynopsis: "RISC-V Specification in Coq, somewhat experimental"\ntags: ["logpath:riscv"]\nurl {\n src: "https://github.com/mit-plv/riscv-coq/archive/refs/tags/v0.0.3.tar.gz"\n checksum: "sha512=55c6a2aa84c89b5b4224729ccad23504d906d174d8bab9b5e1ff62dd7e76efef4935978c3ba517870d25700a1e563e2b352bb3fba94936807561840f26af75e8"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-riscv.0.0.3 coq.8.7.1+1</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+1).\nThe following dependencies couldn't be met:\n - coq-riscv -> coq >= 8.15~ -> ocaml >= 4.05.0\n base of this switch (use `--unlock-base' to force)\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-riscv.0.0.3</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "500a50feebf1f5c4e792362c3876765f", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 159, "avg_line_length": 41.566265060240966, "alnum_prop": 0.5395652173913044, "repo_name": "coq-bench/coq-bench.github.io", "id": "a2d72cb16b363e6581ce4064c8dfafbe665c61e2", "size": "6925", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.02.3-2.0.6/released/8.7.1+1/riscv/0.0.3.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "<!doctype html>\n<html>\n <title>npm-stop</title>\n <meta http-equiv=\"content-type\" value=\"text/html;utf-8\">\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../../static/style.css\">\n <link rel=\"canonical\" href=\"https://www.npmjs.org/doc/cli/npm-stop.html\">\n <script async=true src=\"../../static/toc.js\"></script>\n\n <body>\n <div id=\"wrapper\">\n\n<h1><a href=\"../cli/npm-stop.html\">npm-stop</a></h1> <p>Stop a package</p>\n<h2 id=\"synopsis\">SYNOPSIS</h2>\n<pre><code>npm stop [-- <args>]\n</code></pre><h2 id=\"description\">DESCRIPTION</h2>\n<p>This runs a package's "stop" script, if one was provided.</p>\n<h2 id=\"see-also\">SEE ALSO</h2>\n<ul>\n<li><a href=\"../cli/npm-run-script.html\">npm-run-script(1)</a></li>\n<li><a href=\"../misc/npm-scripts.html\">npm-scripts(7)</a></li>\n<li><a href=\"../cli/npm-test.html\">npm-test(1)</a></li>\n<li><a href=\"../cli/npm-start.html\">npm-start(1)</a></li>\n<li><a href=\"../cli/npm-restart.html\">npm-restart(1)</a></li>\n</ul>\n\n</div>\n\n<table border=0 cellspacing=0 cellpadding=0 id=npmlogo>\n<tr><td style=\"width:180px;height:10px;background:rgb(237,127,127)\" colspan=18> </td></tr>\n<tr><td rowspan=4 style=\"width:10px;height:10px;background:rgb(237,127,127)\"> </td><td style=\"width:40px;height:10px;background:#fff\" colspan=4> </td><td style=\"width:10px;height:10px;background:rgb(237,127,127)\" rowspan=4> </td><td style=\"width:40px;height:10px;background:#fff\" colspan=4> </td><td rowspan=4 style=\"width:10px;height:10px;background:rgb(237,127,127)\"> </td><td colspan=6 style=\"width:60px;height:10px;background:#fff\"> </td><td style=\"width:10px;height:10px;background:rgb(237,127,127)\" rowspan=4> </td></tr>\n<tr><td colspan=2 style=\"width:20px;height:30px;background:#fff\" rowspan=3> </td><td style=\"width:10px;height:10px;background:rgb(237,127,127)\" rowspan=3> </td><td style=\"width:10px;height:10px;background:#fff\" rowspan=3> </td><td style=\"width:20px;height:10px;background:#fff\" rowspan=4 colspan=2> </td><td style=\"width:10px;height:20px;background:rgb(237,127,127)\" rowspan=2> </td><td style=\"width:10px;height:10px;background:#fff\" rowspan=3> </td><td style=\"width:20px;height:10px;background:#fff\" rowspan=3 colspan=2> </td><td style=\"width:10px;height:10px;background:rgb(237,127,127)\" rowspan=3> </td><td style=\"width:10px;height:10px;background:#fff\" rowspan=3> </td><td style=\"width:10px;height:10px;background:rgb(237,127,127)\" rowspan=3> </td></tr>\n<tr><td style=\"width:10px;height:10px;background:#fff\" rowspan=2> </td></tr>\n<tr><td style=\"width:10px;height:10px;background:#fff\"> </td></tr>\n<tr><td style=\"width:60px;height:10px;background:rgb(237,127,127)\" colspan=6> </td><td colspan=10 style=\"width:10px;height:10px;background:rgb(237,127,127)\"> </td></tr>\n<tr><td colspan=5 style=\"width:50px;height:10px;background:#fff\"> </td><td style=\"width:40px;height:10px;background:rgb(237,127,127)\" colspan=4> </td><td style=\"width:90px;height:10px;background:#fff\" colspan=9> </td></tr>\n</table>\n<p id=\"footer\">npm-stop — npm@2.14.7</p>\n\n", "meta": {"content_hash": "386a7305980a40b5670a511695fa9160", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 807, "avg_line_length": 82.39473684210526, "alnum_prop": 0.6940274672628554, "repo_name": "Tearund/stories", "id": "2047d8e85417b2232688c109156deec3acb98823", "size": "3131", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "node_modules/cordova/node_modules/cordova-lib/node_modules/npm/html/doc/cli/npm-stop.html", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "4027"}, {"name": "C", "bytes": "1025"}, {"name": "CSS", "bytes": "1028"}, {"name": "HTML", "bytes": "4766"}, {"name": "Java", "bytes": "6311"}, {"name": "JavaScript", "bytes": "24488"}, {"name": "Objective-C", "bytes": "221904"}, {"name": "Shell", "bytes": "2480"}]}} +{"text": "\"\"\"Implement operations for branch-based reviews.\"\"\"\n# =============================================================================\n# CONTENTS\n# -----------------------------------------------------------------------------\n# abdt_branch\n#\n# Public Classes:\n# Branch\n# .is_abandoned\n# .is_null\n# .is_new\n# .is_status_bad_pre_review\n# .is_status_bad_land\n# .is_status_bad_abandoned\n# .is_status_bad\n# .has_new_commits\n# .base_branch_name\n# .review_branch_hash\n# .review_branch_name\n# .review_id_or_none\n# .get_author_names_emails\n# .get_any_author_emails\n# .get_repo_name\n# .get_browse_url\n# .describe\n# .describe_new_commits\n# .make_message_digest\n# .make_raw_diff\n# .verify_review_branch_base\n# .get_commit_message_from_tip\n# .abandon\n# .remove\n# .clear_mark\n# .mark_bad_land\n# .mark_bad_abandoned\n# .mark_bad_in_review\n# .mark_new_bad_in_review\n# .mark_bad_pre_review\n# .mark_ok_in_review\n# .mark_ok_new_review\n# .land\n#\n# Public Functions:\n# calc_is_ok\n#\n# -----------------------------------------------------------------------------\n# (this contents block is generated, edits will be lost)\n# =============================================================================\n# TODO: write test driver\n\nfrom __future__ import absolute_import\n\nimport phlgit_checkout\nimport phlgit_log\nimport phlgit_push\nimport phlgit_revparse\nimport phlgitu_ref\nimport phlsys_textconvert\n\nimport abdt_differ\nimport abdt_errident\nimport abdt_exception\nimport abdt_lander\nimport abdt_naming\nimport abdt_tryloop\n\n# TODO: allow this to be passed in\n_MAX_DIFF_SIZE = int(1.5 * 1024 * 1024)\n\n\ndef calc_is_ok(branch):\n \"\"\"Return True if the supplied 'branch' is ok, False if bad, else None.\n\n Note that a branch can be 'null' in which case we return None.\n\n :branch: the Branch to examine\n :returns: bool status of the branch\n\n \"\"\"\n assert branch is not None\n if branch.is_null() or branch.is_new() or branch.is_abandoned():\n return None\n\n return not branch.is_status_bad()\n\n\nclass Branch(object):\n\n def __init__(\n self,\n repo,\n review_branch,\n review_hash,\n tracking_branch,\n tracking_hash,\n lander,\n repo_name,\n browse_url=None):\n \"\"\"Create a new relationship tracker for the supplied branch names.\n\n :repo: a callable supporting git commands, e.g. repo(\"status\")\n :review_branch: the abdt_gittypes.GitReviewBranch\n :review_hash: the commit hash of the branch or None\n :tracking_branch: the abdt_gittypes.GitWorkingBranch\n :tracking_hash: the commit hash of the branch or None\n :lander: a lander conformant to abdt_lander\n :repo_name: a short string to identify the repo to humans\n :browse_url: a URL to browse the branch or repo (may be None)\n\n \"\"\"\n self._repo = repo\n self._review_branch = review_branch\n self._review_hash = review_hash\n self._tracking_branch = tracking_branch\n self._tracking_hash = tracking_hash\n self._lander = lander\n assert self._review_branch_valid_or_none()\n assert self._tracking_branch_valid_or_none()\n self._repo_name = repo_name\n self._browse_url = browse_url\n assert self._repo_name is not None\n\n def _review_branch_valid_or_none(self):\n if not self._has_review_branch():\n return True\n else:\n return isinstance(\n self._review_branch,\n abdt_naming.ReviewBranch)\n\n def _tracking_branch_valid_or_none(self):\n if not self._has_tracking_branch():\n return True\n else:\n return isinstance(\n self._tracking_branch,\n abdt_naming.TrackerBranch)\n\n def _has_review_branch(self):\n return self._review_branch is not None\n\n def _has_tracking_branch(self):\n return self._tracking_branch is not None\n\n def is_abandoned(self):\n \"\"\"Return True if the author's branch no longer exists.\"\"\"\n return not self._has_review_branch() and self._has_tracking_branch()\n\n def is_null(self):\n \"\"\"Return True if we don't have any data.\"\"\"\n no_review_branch = not self._has_review_branch()\n no_tracking_branch = not self._has_tracking_branch()\n return no_review_branch and no_tracking_branch\n\n def is_new(self):\n \"\"\"Return True if we haven't marked the author's branch.\"\"\"\n return self._has_review_branch() and not self._has_tracking_branch()\n\n def is_status_bad_pre_review(self):\n \"\"\"Return True if the author's branch is marked 'bad pre-review'.\"\"\"\n if self._has_tracking_branch():\n return abdt_naming.isStatusBadPreReview(self._tracking_branch)\n else:\n return False\n\n def is_status_bad_land(self):\n \"\"\"Return True if the author's branch is marked 'bad land'.\"\"\"\n if self._has_tracking_branch():\n return abdt_naming.isStatusBadLand(self._tracking_branch)\n else:\n return False\n\n def is_status_bad_abandoned(self):\n \"\"\"Return True if the author's branch is marked 'bad abandoned'.\"\"\"\n if self._has_tracking_branch():\n branch = self._tracking_branch\n return branch.status == abdt_naming.WB_STATUS_BAD_ABANDONED\n else:\n return False\n\n def is_status_bad(self):\n \"\"\"Return True if the author's branch is marked any bad status.\"\"\"\n if self._has_tracking_branch():\n return abdt_naming.isStatusBad(self._tracking_branch)\n else:\n return False\n\n def has_new_commits(self):\n \"\"\"Return True if the author's branch is different since marked.\"\"\"\n if self.is_new():\n return True\n else:\n return self._review_hash != self._tracking_hash\n\n def base_branch_name(self):\n \"\"\"Return the string name of the branch the review will land on.\"\"\"\n if self._review_branch:\n return self._review_branch.base\n return self._tracking_branch.base\n\n def review_branch_hash(self):\n \"\"\"Return the string hash of the review branch or None.\"\"\"\n return self._review_hash\n\n def review_branch_name(self):\n \"\"\"Return the string name of the branch the review is based on.\"\"\"\n if self._review_branch:\n return self._review_branch.branch\n return self._tracking_branch.review_name\n\n def review_id_or_none(self):\n \"\"\"Return the int id of the review or 'None' if there isn't one.\"\"\"\n if not self._tracking_branch:\n return None\n\n review_id = None\n try:\n review_id = int(self._tracking_branch.id)\n except ValueError:\n pass\n\n return review_id\n\n def get_author_names_emails(self):\n \"\"\"Return a list of (name, email) tuples from the branch.\"\"\"\n hashes = self._get_commit_hashes()\n\n # names and emails are only mentioned once, in the order that they\n # appear. reverse the order so that the the most recent commit is\n # considered first.\n hashes.reverse()\n names_emails = phlgit_log.get_author_names_emails_from_hashes(\n self._repo, hashes)\n names_emails.reverse()\n\n return names_emails\n\n def get_any_author_emails(self):\n \"\"\"Return a list of emails from the branch.\n\n If the branch has an invalid base or has no history against the base\n then resort to using the whole history.\n\n Useful if 'get_author_names_emails' fails.\n\n \"\"\"\n if phlgit_revparse.get_sha1_or_none(\n self._repo, self._review_branch.remote_base) is None:\n hashes = phlgit_log.get_last_n_commit_hashes_from_ref(\n self._repo, 1, self._review_branch.remote_branch)\n else:\n hashes = self._get_commit_hashes()\n if not hashes:\n hashes = phlgit_log.get_last_n_commit_hashes_from_ref(\n self._repo, 1, self._review_branch.remote_branch)\n committers = phlgit_log.get_author_names_emails_from_hashes(\n self._repo, hashes)\n emails = [committer[1] for committer in committers]\n return emails\n\n def get_repo_name(self):\n \"\"\"Return the human name for the repo the branch came from.\"\"\"\n return self._repo_name\n\n def get_browse_url(self):\n \"\"\"Return the url to browse this branch, may be None.\"\"\"\n return self._browse_url\n\n def _get_commit_hashes(self):\n hashes = self._repo.get_range_hashes(\n self._review_branch.remote_base,\n self._review_branch.remote_branch)\n return hashes\n\n def describe(self):\n \"\"\"Return a string description of this branch for a human to read.\"\"\"\n branch_description = \"(null branch)\"\n if not self.is_null():\n branch_description = self.review_branch_name()\n if self.is_abandoned():\n branch_description += \" (abandoned)\"\n return \"{}, {}\".format(self.get_repo_name(), branch_description)\n\n def describe_new_commits(self):\n \"\"\"Return a string description of the new commits on the branch.\"\"\"\n hashes = None\n previous = None\n latest = self._review_branch.remote_branch\n\n if self.is_new():\n previous = self._review_branch.remote_base\n else:\n previous = self._tracking_branch.remote_branch\n\n hashes = self._repo.get_range_hashes(previous, latest)\n hashes.reverse()\n revisions = self._repo.make_revisions_from_hashes(hashes)\n\n message = \"\"\n for r in revisions:\n message += r.abbrev_hash + \" \" + r.subject + \"\\n\"\n return phlsys_textconvert.ensure_ascii(message)\n\n def make_message_digest(self):\n \"\"\"Return a string digest of the commit messages on the branch.\n\n The digest is comprised of the title from the earliest commit\n unique to the branch and all of the message bodies from the\n unique commits on the branch.\n\n \"\"\"\n hashes = self._get_commit_hashes()\n revisions = self._repo.make_revisions_from_hashes(hashes)\n message = revisions[0].subject + \"\\n\\n\"\n for r in revisions:\n message += r.message\n return phlsys_textconvert.ensure_ascii(message)\n\n def make_raw_diff(self):\n \"\"\"Return an abdt_differ.DiffResult of the changes on the branch.\n\n If the diff would exceed the pre-specified max diff size then take\n measures to reduce the diff.\n\n \"\"\"\n # checkout the 'to' branch, otherwise we won't take into account any\n # changes to .gitattributes files\n phlgit_checkout.branch(self._repo, self._review_branch.remote_branch)\n\n try:\n return abdt_differ.make_raw_diff(\n self._repo,\n self._review_branch.remote_base,\n self._review_branch.remote_branch,\n _MAX_DIFF_SIZE)\n except abdt_differ.NoDiffError:\n raise abdt_exception.NoDiffException(\n self.base_branch_name(),\n self.review_branch_name(),\n self.review_branch_hash())\n\n def _is_based_on(self, name, base):\n # TODO: actually do this\n return True\n\n def verify_review_branch_base(self):\n \"\"\"Raise exception if review branch has invalid base.\"\"\"\n if self._review_branch.base not in self._repo.get_remote_branches():\n raise abdt_exception.MissingBaseException(\n self._review_branch.branch,\n self._review_branch.description,\n self._review_branch.base)\n if not self._is_based_on(\n self._review_branch.branch, self._review_branch.base):\n raise abdt_exception.AbdUserException(\n \"'\" + self._review_branch.branch +\n \"' is not based on '\" + self._review_branch.base + \"'\")\n\n def get_commit_message_from_tip(self):\n \"\"\"Return string commit message from latest commit on branch.\"\"\"\n hashes = self._get_commit_hashes()\n revision = phlgit_log.make_revision_from_hash(self._repo, hashes[-1])\n message = revision.subject + \"\\n\"\n message += \"\\n\"\n message += revision.message + \"\\n\"\n return phlsys_textconvert.ensure_ascii(message)\n\n def _push_delete_review_branch(self):\n def action():\n self._repo.push_delete(self._review_branch.branch)\n\n self._tryloop(action, abdt_errident.PUSH_DELETE_REVIEW)\n\n def _push_delete_tracking_branch(self):\n def action():\n self._repo.push_delete(self._tracking_branch.branch)\n\n self._tryloop(action, abdt_errident.PUSH_DELETE_TRACKING)\n\n def abandon(self):\n \"\"\"Remove information associated with the abandoned review branch.\"\"\"\n # TODO: raise if the branch is not actually abandoned by the user\n self._push_delete_tracking_branch()\n self._tracking_branch = None\n self._tracking_hash = None\n\n def remove(self):\n \"\"\"Remove review branch and tracking branch.\"\"\"\n self._repo.archive_to_abandoned(\n self._review_hash,\n self.review_branch_name(),\n self._tracking_branch.base)\n\n # push the abandoned archive, don't escalate if it fails to push\n try:\n # XXX: oddly pylint complains if we call push_landed() directly:\n # \"Using method (_tryloop) as an attribute (not invoked)\"\n def push_abandoned():\n self._repo.push_abandoned()\n\n self._tryloop(\n push_abandoned,\n abdt_errident.PUSH_ABANDONED_ARCHIVE)\n except Exception:\n # XXX: don't worry if we can't push the landed, this is most\n # likely a permissioning issue but not a showstopper.\n # we should probably nag on the review instead.\n pass\n\n self._push_delete_review_branch()\n self._push_delete_tracking_branch()\n self._review_branch = None\n self._review_hash = None\n self._tracking_branch = None\n self._tracking_hash = None\n\n def clear_mark(self):\n \"\"\"Clear status and last commit associated with the review branch.\"\"\"\n self._push_delete_tracking_branch()\n self._tracking_branch = None\n self._tracking_hash = None\n\n def mark_bad_land(self):\n \"\"\"Mark the current version of the review branch as 'bad land'.\"\"\"\n assert self.review_id_or_none() is not None\n\n self._tryloop(\n lambda: self._push_status(abdt_naming.WB_STATUS_BAD_LAND),\n abdt_errident.MARK_BAD_LAND)\n\n def mark_bad_abandoned(self):\n \"\"\"Mark the current version of the review branch as 'bad abandoned'.\"\"\"\n assert self.review_id_or_none() is not None\n\n self._tryloop(\n lambda: self._push_status(abdt_naming.WB_STATUS_BAD_ABANDONED),\n abdt_errident.MARK_BAD_ABANDONED)\n\n def mark_bad_in_review(self):\n \"\"\"Mark the current version of the review branch as 'bad in review'.\"\"\"\n assert self.review_id_or_none() is not None\n\n self._tryloop(\n lambda: self._push_status(abdt_naming.WB_STATUS_BAD_INREVIEW),\n abdt_errident.MARK_BAD_IN_REVIEW)\n\n def mark_new_bad_in_review(self, revision_id):\n \"\"\"Mark the current version of the review branch as 'bad in review'.\"\"\"\n assert self.review_id_or_none() is None\n\n def action():\n if not self.is_new():\n # 'push_bad_new_in_review' wont clean up our existing tracker\n self._push_delete_tracking_branch()\n self._push_new(\n abdt_naming.WB_STATUS_BAD_INREVIEW,\n revision_id)\n\n self._tryloop(action, abdt_errident.MARK_NEW_BAD_IN_REVIEW)\n\n def mark_bad_pre_review(self):\n \"\"\"Mark this version of the review branch as 'bad pre review'.\"\"\"\n assert self.review_id_or_none() is None\n assert self.is_status_bad_pre_review() or self.is_new()\n\n # early out if this operation is redundant, pushing is expensive\n if self.is_status_bad_pre_review() and not self.has_new_commits():\n return\n\n def action():\n self._push_new(\n abdt_naming.WB_STATUS_BAD_PREREVIEW,\n None)\n\n self._tryloop(\n action, abdt_errident.MARK_BAD_PRE_REVIEW)\n\n def mark_ok_in_review(self):\n \"\"\"Mark this version of the review branch as 'ok in review'.\"\"\"\n assert self.review_id_or_none() is not None\n\n self._tryloop(\n lambda: self._push_status(abdt_naming.WB_STATUS_OK),\n abdt_errident.MARK_OK_IN_REVIEW)\n\n def mark_ok_new_review(self, revision_id):\n \"\"\"Mark this version of the review branch as 'ok in review'.\"\"\"\n assert self.review_id_or_none() is None\n\n def action():\n if not self.is_new():\n # 'push_bad_new_in_review' wont clean up our existing tracker\n self._push_delete_tracking_branch()\n self._push_new(\n abdt_naming.WB_STATUS_OK,\n revision_id)\n\n self._tryloop(action, abdt_errident.MARK_OK_NEW_REVIEW)\n\n def land(self, author_name, author_email, message):\n \"\"\"Integrate the branch into the base and remove the review branch.\"\"\"\n\n self._repo.checkout_forced_new_branch(\n self._tracking_branch.base,\n self._tracking_branch.remote_base)\n\n try:\n result = self._lander(\n self._repo,\n self._tracking_branch.remote_branch,\n author_name,\n author_email,\n message)\n except abdt_lander.LanderException as e:\n self._repo(\"reset\", \"--hard\") # fix the working copy\n raise abdt_exception.LandingException(\n str(e),\n self.review_branch_name(),\n self._tracking_branch.base)\n\n landing_hash = phlgit_revparse.get_sha1(\n self._repo, self._tracking_branch.base)\n\n # don't tryloop here as it's more expected that we can't push the base\n # due to permissioning or some other error\n try:\n self._repo.push(self._tracking_branch.base)\n except Exception as e:\n raise abdt_exception.LandingPushBaseException(\n str(e),\n self.review_branch_name(),\n self._tracking_branch.base)\n\n self._tryloop(\n lambda: self._repo.push_delete(\n self._tracking_branch.branch,\n self.review_branch_name()),\n abdt_errident.PUSH_DELETE_LANDED)\n\n self._repo.archive_to_landed(\n self._tracking_hash,\n self.review_branch_name(),\n self._tracking_branch.base,\n landing_hash,\n message)\n\n # push the landing archive, don't escalate if it fails to push\n try:\n # XXX: oddly pylint complains if we call push_landed() directly:\n # \"Using method (_tryloop) as an attribute (not invoked)\"\n def push_landed():\n self._repo.push_landed()\n\n self._tryloop(\n push_landed,\n abdt_errident.PUSH_LANDING_ARCHIVE)\n except Exception:\n # XXX: don't worry if we can't push the landed, this is most\n # likely a permissioning issue but not a showstopper.\n # we should probably nag on the review instead.\n pass\n\n self._review_branch = None\n self._review_hash = None\n self._tracking_branch = None\n self._tracking_hash = None\n\n return result\n\n def _push_status(self, status):\n old_branch = self._tracking_branch.branch\n\n self._tracking_branch.update_status(status)\n\n new_branch = self._tracking_branch.branch\n if old_branch == new_branch:\n phlgit_push.push_asymmetrical_force(\n self._repo,\n self._review_branch.remote_branch,\n phlgitu_ref.make_local(new_branch),\n self._tracking_branch.remote)\n else:\n phlgit_push.move_asymmetrical(\n self._repo,\n self._review_branch.remote_branch,\n phlgitu_ref.make_local(old_branch),\n phlgitu_ref.make_local(new_branch),\n self._repo.get_remote())\n\n self._tracking_hash = self._review_hash\n\n def _push_new(self, status, revision_id):\n tracking_branch = self._review_branch.make_tracker(\n status, revision_id)\n\n phlgit_push.push_asymmetrical_force(\n self._repo,\n self._review_branch.remote_branch,\n phlgitu_ref.make_local(tracking_branch.branch),\n tracking_branch.remote)\n\n self._tracking_branch = tracking_branch\n self._tracking_hash = self._review_hash\n\n def _tryloop(self, f, identifier):\n return abdt_tryloop.tryloop(f, identifier, self.describe())\n\n\n# -----------------------------------------------------------------------------\n# Copyright (C) 2013-2014 Bloomberg Finance L.P.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# ------------------------------ END-OF-FILE ----------------------------------\n", "meta": {"content_hash": "7e19f938becb8eca646b05639a647d32", "timestamp": "", "source": "github", "line_count": 623, "max_line_length": 79, "avg_line_length": 35.258426966292134, "alnum_prop": 0.5866794136392607, "repo_name": "valhallasw/phabricator-tools", "id": "14468f155655f4eca7646f095836170115a5608a", "size": "21966", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "py/abd/abdt_branch.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C++", "bytes": "342"}, {"name": "Puppet", "bytes": "4246"}, {"name": "Python", "bytes": "964066"}, {"name": "Ruby", "bytes": "2000"}, {"name": "Shell", "bytes": "128202"}]}} +{"text": "package com.eyeem.recyclerviewtools.adapter;\n\nimport android.support.v7.widget.RecyclerView;\nimport android.view.View;\n\nimport com.eyeem.recyclerviewtools.OnItemClickListener;\n\n/**\n * Created by budius on 01.04.15.\n * <p/>\n * Simple implementation of {@link android.widget.AdapterView.OnItemClickListener AdapterView.OnItemClickListener}\n * refactored to {@link android.support.v7.widget.RecyclerView RecyclerView}\n * <p/>\n * Just like original, this only catch clicks on the whole view.\n * For finer control on the target view for the click, you still must create a custom implementation.\n */\n/* package */ class OnItemClickListenerDetector implements View.OnClickListener {\n\n private final RecyclerView recyclerView;\n private final OnItemClickListener onItemClickListener;\n final boolean ignoreExtras;\n\n OnItemClickListenerDetector(\n RecyclerView recyclerView,\n OnItemClickListener onItemClickListener,\n boolean ignoreExtras) {\n this.recyclerView = recyclerView;\n this.onItemClickListener = onItemClickListener;\n this.ignoreExtras = ignoreExtras;\n }\n\n @Override\n public void onClick(View view) {\n\n RecyclerView.ViewHolder holder = recyclerView.getChildViewHolder(view);\n int position = holder.getAdapterPosition();\n long id = holder.getItemId();\n\n RecyclerView.Adapter adapter = recyclerView.getAdapter();\n\n if (ignoreExtras && adapter instanceof WrapAdapter) {\n WrapAdapter a = (WrapAdapter) adapter;\n position = a.recyclerToWrappedPosition.get(position);\n }\n\n // this can happen if data set is changing onItemClick and user clicks fast\n if (position < 0 || position >= adapter.getItemCount()) return;\n\n onItemClickListener.onItemClick(recyclerView, view, position, id, holder);\n }\n}\n", "meta": {"content_hash": "d121f2b06eb0026044323e30ba68d0ae", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 114, "avg_line_length": 35.470588235294116, "alnum_prop": 0.7357656163626313, "repo_name": "eyeem/RecyclerViewTools", "id": "1d76d2043cf44e1f946bdd4254b8ce8b6b43d2e6", "size": "1809", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/src/main/java/com/eyeem/recyclerviewtools/adapter/OnItemClickListenerDetector.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "54239"}]}} +{"text": "\n\npackage org.kaazing.gateway.service.cluster;\n\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.concurrent.locks.Lock;\n\nimport com.hazelcast.core.IdGenerator;\nimport org.kaazing.gateway.service.messaging.buffer.MessageBufferFactory;\nimport org.kaazing.gateway.service.messaging.collections.CollectionsFactory;\n\npublic interface ClusterContext {\n\n // initialization\n void start();\n \n // for gateway shutdown\n void dispose();\n \n // cluster participation\n MemberId getLocalMember();\n String getInstanceKey(MemberId memberId);\n \n String getClusterName();\n\n // Return a list of the memberIds of all current cluster members\n Collection<MemberId> getMemberIds();\n\n List<MemberId> getAccepts();\n List<MemberId> getConnects();\n ClusterConnectOptionsContext getConnectOptions();\n\n // cluster collections\n Lock getLock(Object obj);\n IdGenerator getIdGenerator(String name);\n\n // cluster messaging\n void addReceiveTopic(String name);\n void addReceiveQueue(String name);\n <T> T send(Object msg, MemberId member) throws Exception;\n <T> T send(Object msg, String name) throws Exception;\n void send(Object msg, final SendListener listener, MemberId member);\n void send(Object msg, final SendListener listener, String name);\n <T> void setReceiver(Class<T> type, ReceiveListener<T> receiveListener);\n <T> void removeReceiver(Class<T> type);\n\n // event listener\n void addMembershipEventListener(MembershipEventListener eventListener);\n void removeMembershipEventListener(MembershipEventListener eventListener);\n\n // instanceKey listener\n void addInstanceKeyListener(InstanceKeyListener instanceKeyListener);\n void removeInstanceKeyListener(InstanceKeyListener instanceKeyListener);\n\n // balancermap listener\n void addBalancerMapListener(BalancerMapListener balancerMapListener);\n void removeBalancerMapListener(BalancerMapListener balancerMapListener);\n\n MessageBufferFactory getMessageBufferFactory();\n CollectionsFactory getCollectionsFactory();\n\n void logClusterState();\n}\n", "meta": {"content_hash": "3e0340fc604a552d21e90c6fa23e5dd8", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 78, "avg_line_length": 32.78125, "alnum_prop": 0.7640610104861774, "repo_name": "biddyweb/gateway", "id": "921cdc3f28e19a42ed8fc680491cff33f873b20e", "size": "2981", "binary": false, "copies": "7", "ref": "refs/heads/develop", "path": "service/spi/src/main/java/org/kaazing/gateway/service/cluster/ClusterContext.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2250"}, {"name": "HTML", "bytes": "38948"}, {"name": "Java", "bytes": "10720288"}, {"name": "JavaScript", "bytes": "3868"}, {"name": "Shell", "bytes": "5534"}, {"name": "XSLT", "bytes": "5493"}]}} +{"text": "<?php\n\n\n/*\n *\t TODO:\tas this file was created from a BLUEPRINT file,\n *\t \tyou may want to change ports, paths and/or methods (e.g. for hub)\n *\t\tto meet your specific service/server needs\n */\nrequire_module('ui/page');\n\nclass BluePrintPage extends ServicePage {\n public function __construct(Service $service) {\n parent::__construct($service);\n $this->addJS('js/blueprint.js');\n }\n\n protected function renderRightMenu() {\n $links = LinkUI('manager log',\n 'viewlog.php?sid='.$this->service->getSID())->setExternal(true);\n\n if ($this->service->isRunning()) {\n $console_url = $this->service->getAccessLocation();\n $links .= ' · ' .LinkUI('hub', $console_url)->setExternal(true);\n }\n\n return '<div class=\"rightmenu\">'.$links.'</div>';\n }\n\n protected function renderInstanceActions() {\n return EditableTag()->setColor('purple')->setID('node')->setValue('0')->setText('BluePrint Nodes');\n }\n\n public function renderContent() {\n return $this->renderInstancesSection();\n }\n}\n?>\n", "meta": {"content_hash": "bebc9cb2a887f09c904012438273c80c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 107, "avg_line_length": 29.62162162162162, "alnum_prop": 0.6076642335766423, "repo_name": "ConPaaS-team/conpaas", "id": "15ec789be8fbe714aa6f691ae19aa487fff7c305", "size": "2737", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "conpaas-blueprints/conpaas-frontend/www/lib/ui/page/blueprint/__init__.php", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ApacheConf", "bytes": "79"}, {"name": "Batchfile", "bytes": "2136"}, {"name": "C", "bytes": "12346"}, {"name": "CSS", "bytes": "47680"}, {"name": "HTML", "bytes": "5494"}, {"name": "Java", "bytes": "404303"}, {"name": "JavaScript", "bytes": "164519"}, {"name": "M4", "bytes": "553"}, {"name": "Makefile", "bytes": "78772"}, {"name": "Nginx", "bytes": "1980"}, {"name": "PHP", "bytes": "1900634"}, {"name": "Python", "bytes": "2842443"}, {"name": "Shell", "bytes": "232043"}, {"name": "Smarty", "bytes": "15450"}]}} +{"text": "\npackage org.apache.hyracks.control.common.job.profiling.om;\n\nimport java.io.DataInput;\nimport java.io.DataOutput;\nimport java.io.IOException;\nimport java.io.Serializable;\n\nimport org.apache.hyracks.api.io.IWritable;\nimport org.apache.hyracks.api.partitions.PartitionId;\nimport org.apache.hyracks.control.common.job.profiling.counters.MultiResolutionEventProfiler;\n\npublic class PartitionProfile implements IWritable, Serializable {\n private static final long serialVersionUID = 1L;\n\n private PartitionId pid;\n\n private long openTime;\n\n private long closeTime;\n\n private MultiResolutionEventProfiler mrep;\n\n public static PartitionProfile create(DataInput dis) throws IOException {\n PartitionProfile partitionProfile = new PartitionProfile();\n partitionProfile.readFields(dis);\n return partitionProfile;\n }\n\n private PartitionProfile() {\n\n }\n\n public PartitionProfile(PartitionId pid, long openTime, long closeTime, MultiResolutionEventProfiler mrep) {\n this.pid = pid;\n this.openTime = openTime;\n this.closeTime = closeTime;\n this.mrep = mrep;\n }\n\n public PartitionId getPartitionId() {\n return pid;\n }\n\n public long getOpenTime() {\n return openTime;\n }\n\n public long getCloseTime() {\n return closeTime;\n }\n\n public MultiResolutionEventProfiler getSamples() {\n return mrep;\n }\n\n @Override\n public void writeFields(DataOutput output) throws IOException {\n output.writeLong(closeTime);\n output.writeLong(openTime);\n mrep.writeFields(output);\n pid.writeFields(output);\n }\n\n @Override\n public void readFields(DataInput input) throws IOException {\n closeTime = input.readLong();\n openTime = input.readLong();\n mrep = MultiResolutionEventProfiler.create(input);\n pid = PartitionId.create(input);\n }\n}", "meta": {"content_hash": "6d10aa221472af5036271db11282998d", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 112, "avg_line_length": 26.430555555555557, "alnum_prop": 0.7004729374671571, "repo_name": "kisskys/incubator-asterixdb-hyracks", "id": "b1cd16d58f67228830e159253ef64ef05f99a154", "size": "2710", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/job/profiling/om/PartitionProfile.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2606"}, {"name": "CSS", "bytes": "893"}, {"name": "HTML", "bytes": "8762"}, {"name": "Java", "bytes": "8406768"}, {"name": "JavaScript", "bytes": "24904"}, {"name": "Shell", "bytes": "16545"}]}} +{"text": "\ufeff// ----------------------------------------------------------------------------\n// <copyright file=\"Enums.cs\" company=\"Exit Games GmbH\">\n// PhotonNetwork Framework for Unity - Copyright (C) 2011 Exit Games GmbH\n// </copyright>\n// <summary>\n//\n// </summary>\n// <author>developer@exitgames.com</author>\n// ----------------------------------------------------------------------------\n\n#pragma warning disable 1587\n/// \\file\n/// <summary>Wraps up several of the commonly used enumerations. </summary>\n#pragma warning restore 1587\n\n\nusing System;\nusing ExitGames.Client.Photon;\n\n\n/// <summary>\n/// This enum defines the set of MonoMessages Photon Unity Networking is using as callbacks. Implemented by PunBehaviour.\n/// </summary>\n/// <remarks>\n/// Much like \"Update()\" in Unity, PUN will call methods in specific situations.\n/// Often, these methods are triggered when network operations complete (example: when joining a room).\n///\n/// All those methods are defined and described in this enum and implemented by PunBehaviour\n/// (which makes it easy to implement them as override).\n///\n/// Each entry is the name of such a method and the description tells you when it gets used by PUN.\n///\n/// Make sure to read the remarks per entry as some methods have optional parameters.\n/// </remarks>\n/// \\ingroup publicApi\npublic enum PhotonNetworkingMessage\n{\n /// <summary>\n /// Called when the initial connection got established but before you can use the server. OnJoinedLobby() or OnConnectedToMaster() are called when PUN is ready.\n /// </summary>\n /// <remarks>\n /// This callback is only useful to detect if the server can be reached at all (technically).\n /// Most often, it's enough to implement OnFailedToConnectToPhoton() and OnDisconnectedFromPhoton().\n ///\n /// <i>OnJoinedLobby() or OnConnectedToMaster() are called when PUN is ready.</i>\n ///\n /// When this is called, the low level connection is established and PUN will send your AppId, the user, etc in the background.\n /// This is not called for transitions from the masterserver to game servers.\n ///\n /// Example: void OnConnectedToPhoton() { ... }\n /// </remarks>\n OnConnectedToPhoton,\n\n /// <summary>\n /// Called when the local user/client left a room.\n /// </summary>\n /// <remarks>\n /// When leaving a room, PUN brings you back to the Master Server.\n /// Before you can use lobbies and join or create rooms, OnJoinedLobby() or OnConnectedToMaster() will get called again.\n ///\n /// Example: void OnLeftRoom() { ... }\n /// </remarks>\n OnLeftRoom,\n\n /// <summary>\n /// Called after switching to a new MasterClient when the current one leaves.\n /// </summary>\n /// <remarks>\n /// This is not called when this client enters a room.\n /// The former MasterClient is still in the player list when this method get called.\n ///\n /// Example: void OnMasterClientSwitched(PhotonPlayer newMasterClient) { ... }\n /// </remarks>\n OnMasterClientSwitched,\n\n /// <summary>\n /// Called when a CreateRoom() call failed. Optional parameters provide ErrorCode and message.\n /// </summary>\n /// <remarks>\n /// Most likely because the room name is already in use (some other client was faster than you).\n /// PUN logs some info if the PhotonNetwork.logLevel is >= PhotonLogLevel.Informational.\n ///\n /// Example: void OnPhotonCreateRoomFailed() { ... }\n ///\n /// Example: void OnPhotonCreateRoomFailed(object[] codeAndMsg) { // codeAndMsg[0] is short ErrorCode. codeAndMsg[1] is string debug msg. }\n /// </remarks>\n OnPhotonCreateRoomFailed,\n\n /// <summary>\n /// Called when a JoinRoom() call failed. Optional parameters provide ErrorCode and message.\n /// </summary>\n /// <remarks>\n /// Most likely error is that the room does not exist or the room is full (some other client was faster than you).\n /// PUN logs some info if the PhotonNetwork.logLevel is >= PhotonLogLevel.Informational.\n ///\n /// Example: void OnPhotonJoinRoomFailed() { ... }\n ///\n /// Example: void OnPhotonJoinRoomFailed(object[] codeAndMsg) { // codeAndMsg[0] is short ErrorCode. codeAndMsg[1] is string debug msg. }\n /// </remarks>\n OnPhotonJoinRoomFailed,\n\n /// <summary>\n /// Called when this client created a room and entered it. OnJoinedRoom() will be called as well.\n /// </summary>\n /// <remarks>\n /// This callback is only called on the client which created a room (see PhotonNetwork.CreateRoom).\n ///\n /// As any client might close (or drop connection) anytime, there is a chance that the\n /// creator of a room does not execute OnCreatedRoom.\n ///\n /// If you need specific room properties or a \"start signal\", it is safer to implement\n /// OnMasterClientSwitched() and to make the new MasterClient check the room's state.\n ///\n /// Example: void OnCreatedRoom() { ... }\n /// </remarks>\n OnCreatedRoom,\n\n /// <summary>\n /// Called on entering a lobby on the Master Server. The actual room-list updates will call OnReceivedRoomListUpdate().\n /// </summary>\n /// <remarks>\n /// Note: When PhotonNetwork.autoJoinLobby is false, OnConnectedToMaster() will be called and the room list won't become available.\n ///\n /// While in the lobby, the roomlist is automatically updated in fixed intervals (which you can't modify).\n /// The room list gets available when OnReceivedRoomListUpdate() gets called after OnJoinedLobby().\n ///\n /// Example: void OnJoinedLobby() { ... }\n /// </remarks>\n OnJoinedLobby,\n\n /// <summary>\n /// Called after leaving a lobby.\n /// </summary>\n /// <remarks>\n /// When you leave a lobby, [CreateRoom](@ref PhotonNetwork.CreateRoom) and [JoinRandomRoom](@ref PhotonNetwork.JoinRandomRoom)\n /// automatically refer to the default lobby.\n ///\n /// Example: void OnLeftLobby() { ... }\n /// </remarks>\n OnLeftLobby,\n\n /// <summary>\n /// Called after disconnecting from the Photon server.\n /// </summary>\n /// <remarks>\n /// In some cases, other callbacks are called before OnDisconnectedFromPhoton is called.\n /// Examples: OnConnectionFail() and OnFailedToConnectToPhoton().\n ///\n /// Example: void OnDisconnectedFromPhoton() { ... }\n /// </remarks>\n OnDisconnectedFromPhoton,\n\n /// <summary>\n /// Called when something causes the connection to fail (after it was established), followed by a call to OnDisconnectedFromPhoton().\n /// </summary>\n /// <remarks>\n /// If the server could not be reached in the first place, OnFailedToConnectToPhoton is called instead.\n /// The reason for the error is provided as StatusCode.\n ///\n /// Example: void OnConnectionFail(DisconnectCause cause) { ... }\n /// </remarks>\n OnConnectionFail,\n\n /// <summary>\n /// Called if a connect call to the Photon server failed before the connection was established, followed by a call to OnDisconnectedFromPhoton().\n /// </summary>\n /// <remarks>\n /// OnConnectionFail only gets called when a connection to a Photon server was established in the first place.\n ///\n /// Example: void OnFailedToConnectToPhoton(DisconnectCause cause) { ... }\n /// </remarks>\n OnFailedToConnectToPhoton,\n\n /// <summary>\n /// Called for any update of the room-listing while in a lobby (PhotonNetwork.insideLobby) on the Master Server.\n /// </summary>\n /// <remarks>\n /// PUN provides the list of rooms by PhotonNetwork.GetRoomList().<br/>\n /// Each item is a RoomInfo which might include custom properties (provided you defined those as lobby-listed when creating a room).\n ///\n /// Not all types of lobbies provide a listing of rooms to the client. Some are silent and specialized for server-side matchmaking.\n ///\n /// Example: void OnReceivedRoomListUpdate() { ... }\n /// </remarks>\n OnReceivedRoomListUpdate,\n\n /// <summary>\n /// Called when entering a room (by creating or joining it). Called on all clients (including the Master Client).\n /// </summary>\n /// <remarks>\n /// This method is commonly used to instantiate player characters.\n /// If a match has to be started \"actively\", you can instead call an [PunRPC](@ref PhotonView.RPC) triggered by a user's button-press or a timer.\n ///\n /// When this is called, you can usually already access the existing players in the room via PhotonNetwork.playerList.\n /// Also, all custom properties should be already available as Room.customProperties. Check Room.playerCount to find out if\n /// enough players are in the room to start playing.\n ///\n /// Example: void OnJoinedRoom() { ... }\n /// </remarks>\n OnJoinedRoom,\n\n /// <summary>\n /// Called when a remote player entered the room. This PhotonPlayer is already added to the playerlist at this time.\n /// </summary>\n /// <remarks>\n /// If your game starts with a certain number of players, this callback can be useful to check the\n /// Room.playerCount and find out if you can start.\n ///\n /// Example: void OnPhotonPlayerConnected(PhotonPlayer newPlayer) { ... }\n /// </remarks>\n OnPhotonPlayerConnected,\n\n /// <summary>\n /// Called when a remote player left the room. This PhotonPlayer is already removed from the playerlist at this time.\n /// </summary>\n /// <remarks>\n /// When your client calls PhotonNetwork.leaveRoom, PUN will call this method on the remaining clients.\n /// When a remote client drops connection or gets closed, this callback gets executed. after a timeout\n /// of several seconds.\n ///\n /// Example: void OnPhotonPlayerDisconnected(PhotonPlayer otherPlayer) { ... }\n /// </remarks>\n OnPhotonPlayerDisconnected,\n\n /// <summary>\n /// Called after a JoinRandom() call failed. Optional parameters provide ErrorCode and message.\n /// </summary>\n /// <remarks>\n /// Most likely all rooms are full or no rooms are available.\n /// When using multiple lobbies (via JoinLobby or TypedLobby), another lobby might have more/fitting rooms.\n /// PUN logs some info if the PhotonNetwork.logLevel is >= PhotonLogLevel.Informational.\n ///\n /// Example: void OnPhotonRandomJoinFailed() { ... }\n ///\n /// Example: void OnPhotonRandomJoinFailed(object[] codeAndMsg) { // codeAndMsg[0] is short ErrorCode. codeAndMsg[1] is string debug msg. }\n /// </remarks>\n OnPhotonRandomJoinFailed,\n\n /// <summary>\n /// Called after the connection to the master is established and authenticated but only when PhotonNetwork.autoJoinLobby is false.\n /// </summary>\n /// <remarks>\n /// If you set PhotonNetwork.autoJoinLobby to true, OnJoinedLobby() will be called instead of this.\n ///\n /// You can join rooms and create them even without being in a lobby. The default lobby is used in that case.\n /// The list of available rooms won't become available unless you join a lobby via PhotonNetwork.joinLobby.\n ///\n /// Example: void OnConnectedToMaster() { ... }\n /// </remarks>\n OnConnectedToMaster,\n\n /// <summary>\n /// Implement to customize the data a PhotonView regularly synchronizes. Called every 'network-update' when observed by PhotonView.\n /// </summary>\n /// <remarks>\n /// This method will be called in scripts that are assigned as Observed component of a PhotonView.\n /// PhotonNetwork.sendRateOnSerialize affects how often this method is called.\n /// PhotonNetwork.sendRate affects how often packages are sent by this client.\n ///\n /// Implementing this method, you can customize which data a PhotonView regularly synchronizes.\n /// Your code defines what is being sent (content) and how your data is used by receiving clients.\n ///\n /// Unlike other callbacks, <i>OnPhotonSerializeView only gets called when it is assigned\n /// to a PhotonView</i> as PhotonView.observed script.\n ///\n /// To make use of this method, the PhotonStream is essential. It will be in \"writing\" mode\" on the\n /// client that controls a PhotonView (PhotonStream.isWriting == true) and in \"reading mode\" on the\n /// remote clients that just receive that the controlling client sends.\n ///\n /// If you skip writing any value into the stream, PUN will skip the update. Used carefully, this can\n /// conserve bandwidth and messages (which have a limit per room/second).\n ///\n /// Note that OnPhotonSerializeView is not called on remote clients when the sender does not send\n /// any update. This can't be used as \"x-times per second Update()\".\n ///\n /// Example: void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) { ... }\n /// </remarks>\n OnPhotonSerializeView,\n\n /// <summary>\n /// Called on all scripts on a GameObject (and children) that have been Instantiated using PhotonNetwork.Instantiate.\n /// </summary>\n /// <remarks>\n /// PhotonMessageInfo parameter provides info about who created the object and when (based off PhotonNetworking.time).\n ///\n /// Example: void OnPhotonInstantiate(PhotonMessageInfo info) { ... }\n /// </remarks>\n OnPhotonInstantiate,\n\n /// <summary>\n /// Because the concurrent user limit was (temporarily) reached, this client is rejected by the server and disconnecting.\n /// </summary>\n /// <remarks>\n /// When this happens, the user might try again later. You can't create or join rooms in OnPhotonMaxCcuReached(), cause the client will be disconnecting.\n /// You can raise the CCU limits with a new license (when you host yourself) or extended subscription (when using the Photon Cloud).\n /// The Photon Cloud will mail you when the CCU limit was reached. This is also visible in the Dashboard (webpage).\n ///\n /// Example: void OnPhotonMaxCccuReached() { ... }\n /// </remarks>\n OnPhotonMaxCccuReached,\n\n /// <summary>\n /// Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties.\n /// </summary>\n /// <remarks>\n /// Since v1.25 this method has one parameter: Hashtable propertiesThatChanged.\n /// Changing properties must be done by Room.SetCustomProperties, which causes this callback locally, too.\n ///\n /// Example: void OnPhotonCustomRoomPropertiesChanged(Hashtable propertiesThatChanged) { ... }\n /// </remarks>\n OnPhotonCustomRoomPropertiesChanged,\n\n /// <summary>\n /// Called when custom player-properties are changed. Player and the changed properties are passed as object[].\n /// </summary>\n /// <remarks>\n /// Since v1.25 this method has one parameter: object[] playerAndUpdatedProps, which contains two entries.<br/>\n /// [0] is the affected PhotonPlayer.<br/>\n /// [1] is the Hashtable of properties that changed.<br/>\n ///\n /// We are using a object[] due to limitations of Unity's GameObject.SendMessage (which has only one optional parameter).\n ///\n /// Changing properties must be done by PhotonPlayer.SetCustomProperties, which causes this callback locally, too.\n ///\n /// Example:<pre>\n /// void OnPhotonPlayerPropertiesChanged(object[] playerAndUpdatedProps) {\n /// PhotonPlayer player = playerAndUpdatedProps[0] as PhotonPlayer;\n /// Hashtable props = playerAndUpdatedProps[1] as Hashtable;\n /// //...\n /// }</pre>\n /// </remarks>\n OnPhotonPlayerPropertiesChanged,\n\n /// <summary>\n /// Called when the server sent the response to a FindFriends request and updated PhotonNetwork.Friends.\n /// </summary>\n /// <remarks>\n /// The friends list is available as PhotonNetwork.Friends, listing name, online state and\n /// the room a user is in (if any).\n ///\n /// Example: void OnUpdatedFriendList() { ... }\n /// </remarks>\n OnUpdatedFriendList,\n\n /// <summary>\n /// Called when the custom authentication failed. Followed by disconnect!\n /// </summary>\n /// <remarks>\n /// Custom Authentication can fail due to user-input, bad tokens/secrets.\n /// If authentication is successful, this method is not called. Implement OnJoinedLobby() or OnConnectedToMaster() (as usual).\n ///\n /// During development of a game, it might also fail due to wrong configuration on the server side.\n /// In those cases, logging the debugMessage is very important.\n ///\n /// Unless you setup a custom authentication service for your app (in the [Dashboard](https://www.photonengine.com/dashboard)),\n /// this won't be called!\n ///\n /// Example: void OnCustomAuthenticationFailed(string debugMessage) { ... }\n /// </remarks>\n OnCustomAuthenticationFailed,\n\n /// <summary>\n /// Called when your Custom Authentication service responds with additional data.\n /// </summary>\n /// <remarks>\n /// Custom Authentication services can include some custom data in their response.\n /// When present, that data is made available in this callback as Dictionary.\n /// While the keys of your data have to be strings, the values can be either string or a number (in Json).\n /// You need to make extra sure, that the value type is the one you expect. Numbers become (currently) int64.\n ///\n /// Example: void OnCustomAuthenticationResponse(Dictionary<string, object> data) { ... }\n /// </remarks>\n /// <see cref=\"https://doc.photonengine.com/en/realtime/current/reference/custom-authentication\"/>\n OnCustomAuthenticationResponse,\n\n /// <summary>\n /// Called by PUN when the response to a WebRPC is available. See PhotonNetwork.WebRPC.\n /// </summary>\n /// <remarks>\n /// Important: The response.ReturnCode is 0 if Photon was able to reach your web-service.\n /// The content of the response is what your web-service sent. You can create a WebResponse instance from it.\n /// Example: WebRpcResponse webResponse = new WebRpcResponse(operationResponse);\n ///\n /// Please note: Class OperationResponse is in a namespace which needs to be \"used\":\n /// using ExitGames.Client.Photon; // includes OperationResponse (and other classes)\n ///\n /// The OperationResponse.ReturnCode by Photon is:\n /// 0 for \"OK\"\n /// -3 for \"Web-Service not configured\" (see Dashboard / WebHooks)\n /// -5 for \"Web-Service does now have RPC path/name\" (at least for Azure)\n ///\n /// Example: void OnWebRpcResponse(OperationResponse response) { ... }\n /// </remarks>\n OnWebRpcResponse,\n\n /// <summary>\n /// Called when another player requests ownership of a PhotonView from you (the current owner).\n /// </summary>\n /// <remarks>\n /// The parameter viewAndPlayer contains:\n ///\n /// PhotonView view = viewAndPlayer[0] as PhotonView;\n ///\n /// PhotonPlayer requestingPlayer = viewAndPlayer[1] as PhotonPlayer;\n /// </remarks>\n /// <example>void OnOwnershipRequest(object[] viewAndPlayer) {} //</example>\n OnOwnershipRequest,\n\n /// <summary>\n /// Called when the Master Server sent an update for the Lobby Statistics, updating PhotonNetwork.LobbyStatistics.\n /// </summary>\n /// <remarks>\n /// This callback has two preconditions:\n /// EnableLobbyStatistics must be set to true, before this client connects.\n /// And the client has to be connected to the Master Server, which is providing the info about lobbies.\n /// </remarks>\n OnLobbyStatisticsUpdate,\n\n\n\t/// <summary>\n\t/// Called when a remote Photon Player activity changed. This will be called ONLY is PlayerTtl is greater then 0.\n\t///\n\t/// Use PhotonPlayer.IsInactive to check the current activity state\n\t///\n\t/// Example: void OnPhotonPlayerActivityChanged(PhotonPlayer otherPlayer) {...}\n\t/// </summary>\n\t/// <remarks>\n\t/// This callback has precondition:\n\t/// PlayerTtl must be greater then 0\n\t/// </remarks>\n\tOnPhotonPlayerActivityChanged,\n\n\n\t/// <summary>\n\t/// Called when a PhotonView Owner is transfered to a Player.\n\t/// </summary>\n\t/// <remarks>\n\t/// The parameter viewAndPlayers contains:\n\t///\n\t/// PhotonView view = viewAndPlayers[0] as PhotonView;\n\t///\n\t/// PhotonPlayer newOwner = viewAndPlayers[1] as PhotonPlayer;\n\t///\n\t/// PhotonPlayer oldOwner = viewAndPlayers[2] as PhotonPlayer;\n\t/// </remarks>\n\t/// <example>void OnOwnershipTransfered(object[] viewAndPlayers) {} //</example>\n\tOnOwnershipTransfered,\n}\n\n\n/// <summary>Used to define the level of logging output created by the PUN classes. Either log errors, info (some more) or full.</summary>\n/// \\ingroup publicApi\npublic enum PhotonLogLevel\n{\n /// <summary>Show only errors. Minimal output. Note: Some might be \"runtime errors\" which you have to expect.</summary>\n ErrorsOnly,\n /// <summary>Logs some of the workflow, calls and results.</summary>\n Informational,\n /// <summary>Every available log call gets into the console/log. Only use for debugging.</summary>\n Full\n}\n\n\n/// <summary>Enum of \"target\" options for RPCs. These define which remote clients get your RPC call. </summary>\n/// \\ingroup publicApi\npublic enum PhotonTargets\n{\n /// <summary>Sends the RPC to everyone else and executes it immediately on this client. Player who join later will not execute this RPC.</summary>\n All,\n /// <summary>Sends the RPC to everyone else. This client does not execute the RPC. Player who join later will not execute this RPC.</summary>\n Others,\n /// <summary>Sends the RPC to MasterClient only. Careful: The MasterClient might disconnect before it executes the RPC and that might cause dropped RPCs.</summary>\n MasterClient,\n /// <summary>Sends the RPC to everyone else and executes it immediately on this client. New players get the RPC when they join as it's buffered (until this client leaves).</summary>\n AllBuffered,\n /// <summary>Sends the RPC to everyone. This client does not execute the RPC. New players get the RPC when they join as it's buffered (until this client leaves).</summary>\n OthersBuffered,\n /// <summary>Sends the RPC to everyone (including this client) through the server.</summary>\n /// <remarks>\n /// This client executes the RPC like any other when it received it from the server.\n /// Benefit: The server's order of sending the RPCs is the same on all clients.\n /// </remarks>\n AllViaServer,\n /// <summary>Sends the RPC to everyone (including this client) through the server and buffers it for players joining later.</summary>\n /// <remarks>\n /// This client executes the RPC like any other when it received it from the server.\n /// Benefit: The server's order of sending the RPCs is the same on all clients.\n /// </remarks>\n AllBufferedViaServer\n}\n\n\n/// <summary>Currently available <a href=\"http://doc.photonengine.com/en/pun/current/reference/regions\">Photon Cloud regions</a> as enum.</summary>\n/// <remarks>\n/// This is used in PhotonNetwork.ConnectToRegion.\n/// </remarks>\npublic enum CloudRegionCode\n{\n /// <summary>European servers in Amsterdam.</summary>\n eu = 0,\n /// <summary>US servers (East Coast).</summary>\n us = 1,\n /// <summary>Asian servers in Singapore.</summary>\n asia = 2,\n /// <summary>Japanese servers in Tokyo.</summary>\n jp = 3,\n /// <summary>Australian servers in Melbourne.</summary>\n au = 5,\n ///<summary>USA West, San Jos\u00e9, usw</summary>\n usw = 6,\n ///<summary>South America, Sao Paulo, sa</summary>\n sa = 7,\n ///<summary>Canada East, Montreal, cae</summary>\n cae = 8,\n ///<summary>South Korea, Seoul, kr</summary>\n kr = 9,\n ///<summary>India, Chennai, in</summary>\n @in = 10,\n /// <summary>Russia, ru</summary>\n ru = 11,\n\n /// <summary>No region selected.</summary>\n none = 4\n};\n\n\n/// <summary>\n/// Available regions as enum of flags. To be used as \"enabled\" flags for Best Region pinging.\n/// </summary>\n/// <remarks>Note that these enum values skip CloudRegionCode.none and their values are in strict order (power of 2).</remarks>\n[Flags]\npublic enum CloudRegionFlag\n{\n eu = 1 << 0,\n us = 1 << 1,\n asia = 1 << 2,\n jp = 1 << 3,\n au = 1 << 4,\n usw = 1 << 5,\n sa = 1 << 6,\n cae = 1 << 7,\n kr = 1 << 8,\n @in = 1 << 9,\n ru = 1 << 10\n};\n\n\n/// <summary>\n/// High level connection state of the client. Better use the more detailed <see cref=\"ClientState\"/>.\n/// </summary>\npublic enum ConnectionState\n{\n Disconnected,\n Connecting,\n Connected,\n Disconnecting,\n InitializingApplication\n}\n\n\n/// <summary>\n/// Defines how the communication gets encrypted.\n/// </summary>\npublic enum EncryptionMode\n{\n /// <summary>\n /// This is the default encryption mode: Messages get encrypted only on demand (when you send operations with the \"encrypt\" parameter set to true).\n /// </summary>\n PayloadEncryption,\n /// <summary>\n /// With this encryption mode for UDP, the connection gets setup and all further datagrams get encrypted almost entirely. On-demand message encryption (like in PayloadEncryption) is skipped.\n /// </summary>\n /// <remarks>\n /// This mode requires AuthOnce or AuthOnceWss as AuthMode!\n /// </remarks>\n DatagramEncryption = 10,\n}\n\n\npublic static class EncryptionDataParameters\n{\n /// <summary>\n /// Key for encryption mode\n /// </summary>\n public const byte Mode = 0;\n /// <summary>\n /// Key for first secret\n /// </summary>\n public const byte Secret1 = 1;\n /// <summary>\n /// Key for second secret\n /// </summary>\n public const byte Secret2 = 2;\n}", "meta": {"content_hash": "3dac8078c3a3ccd663352f86fb27aa45", "timestamp": "", "source": "github", "line_count": 594, "max_line_length": 194, "avg_line_length": 42.86531986531987, "alnum_prop": 0.6711570183017831, "repo_name": "mark818/VRGame", "id": "0f68e462b72e5de534ecc4f7025bf9413287b5ee", "size": "25465", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Assets/Photon Unity Networking/Plugins/PhotonNetwork/Enums.cs", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C#", "bytes": "2517881"}, {"name": "HLSL", "bytes": "11555"}, {"name": "JavaScript", "bytes": "43789"}, {"name": "Mask", "bytes": "305"}, {"name": "ShaderLab", "bytes": "27926"}]}} +{"text": "<?php\n/**\n * @runParallel\n */\nclass UnitTestInSubSubLevelTest extends PHPUnit_Framework_TestCase\n{\n /**\n * @group fixtures\n */\n public function testTruth()\n {\n $this->assertTrue(true);\n }\n\n /**\n * @group fixtures\n */\n public function testFalsehood()\n {\n $this->assertFalse(false);\n }\n\n /**\n * @group fixtures\n */\n public function testArrayLength()\n {\n $elems = array(1,2,3,4,5);\n $this->assertEquals(5, sizeof($elems));\n }\n}\n", "meta": {"content_hash": "ff6ab174255b36337e2c71021d233a4f", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 66, "avg_line_length": 16.548387096774192, "alnum_prop": 0.5341130604288499, "repo_name": "quizlet/paratest", "id": "04a48d88b9018142c2e4d3edeb0fdef88ee245a0", "size": "513", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "test/fixtures/passing-tests/level1/level2/UnitTestInSubSubLevelTest.php", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "70"}, {"name": "PHP", "bytes": "237507"}, {"name": "Ruby", "bytes": "270"}]}} +{"text": "@interface MyViewController () @end\n\n@implementation MyViewController {}\n\n@synthesize webView, baseURL, url;\n\n- (void)viewDidLoad\n{\n\t[super viewDidLoad];\n\tself.title = @\"Presented ViewController\";\n\t[self.webView setMainFrameURL:[self appURL]];\n}\n\n- (IBAction)dismiss:(id)sender\n{\n\tif (self.presentingViewController) {\n\t\t[self.presentingViewController dismissViewController:self];\n\t} else {\n\t\t// for the 'show' transition\n\t\t[self.view.window close];\n\t}\n}\n\n// Changes the greeting message by executing a function in JavaScript.\n// This is triggered from the Change Greeting menu item.\n- (IBAction)changeGreeting:(id)sender\n{\n\t[[webView windowScriptObject] evaluateWebScript:@\"changeGreeting('Hello from Objective-C!')\"];\n}\n\n// Here we grab the URL to the bundled index.html document.\n// Normally it would be the URL to your web app such as @\"http://example.com\".\n- (NSString *)appURL\n{\n\t// return [[[NSBundle mainBundle] URLForResource:@\"http://www.google\" withExtension:@\"html\"] absoluteString];\n\n//\tself.baseURL\t= [NSURL URLWithString:@\"file:///path/to/web_root/\"];\n//\tself.url\t\t= [NSURL URLWithString:@\"folder/file.html\" relativeToURL:self.baseURL];\n \n NSString *path = [[NSBundle mainBundle] pathForResource:@\"index\" ofType:@\"html\"];\n self.url = [NSURL fileURLWithPath:path];\n [[self.webView mainFrame] loadRequest:[NSURLRequest requestWithURL:self.url]];\n\n\tNSURL *absURL = [self.url absoluteURL];\n\tNSLog(@\"absURL = %@\", absURL);\n\tNSString *getURL = [NSString stringWithContentsOfURL:absURL encoding:1000 error:nil];\n\t// self.title = [NSString stringWithContentsOfURL:absURL encoding:1000 error:nil];;\n\n\treturn getURL;\n}\n\n// This delegate method gets triggered every time the page loads, but before the JavaScript runs\n- (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject\n{\n\t// Allow this class to be usable through the \"window.app\" object in JavaScript\n\t// This could be any Objective-C class\n\t[windowScriptObject setValue:self forKey:@\"app\"];\n}\n\n\n- (IBAction)resetSafari:(id)sender {\n \n \n\t[self openAppleScript:(NSString *)@\"SafariCloseAllWindows\"];\n [self openAppleScript:(NSString *)@\"ResetSafari\"];\n \n \n}\n\n#pragma mark ViewController openAppleScript\n\n- (void)openAppleScript:(NSString *)scriptName\n{\n NSLog(@\"%@\", NSStringFromSelector(_cmd));\n NSString\t\t*path\t\t\t= [[NSBundle mainBundle] pathForResource:scriptName ofType:@\"scpt\"];\n NSURL\t\t\t*openUrl\t\t\t= [NSURL fileURLWithPath:path]; NSDictionary *errors = [NSDictionary dictionary];\n NSAppleScript\t*appleScript\t= [[NSAppleScript alloc] initWithContentsOfURL:openUrl error:&errors];\n [appleScript executeAndReturnError:nil];\n}\n\n- (IBAction)openMyPayPal:(id)sender{\n\n [self openAppleScript:(NSString *)@\"OpenMyPaypal\"];\n\n}\n\n@end\n", "meta": {"content_hash": "99e5612dbe476b6b06200030baf9cded", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 110, "avg_line_length": 31.908045977011493, "alnum_prop": 0.7312680115273775, "repo_name": "RandyMcMillan/GoogleHacks", "id": "144dd413cccbd97fef34a8b9d66c3d468e7999ca", "size": "2951", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "osx/GoogleHacks/GoogleHacks/MyViewController.m", "mode": "33188", "license": "mit", "language": [{"name": "AppleScript", "bytes": "1208"}, {"name": "C", "bytes": "8953"}, {"name": "CSS", "bytes": "10163"}, {"name": "HTML", "bytes": "5058"}, {"name": "JavaScript", "bytes": "93489"}, {"name": "Objective-C", "bytes": "259798"}, {"name": "REALbasic", "bytes": "98880"}, {"name": "Shell", "bytes": "29131"}]}} +{"text": "/**\n * @author Toru Nagashima\n * See LICENSE file in root directory for full license.\n */\n\"use strict\"\n\nconst { READ } = require(\"eslint-utils\")\nconst checkForPreferGlobal = require(\"../../util/check-prefer-global\")\n\nconst trackMap = {\n globals: {\n process: { [READ]: true },\n },\n modules: {\n process: { [READ]: true },\n },\n}\n\nmodule.exports = {\n meta: {\n docs: {\n description: 'enforce either `process` or `require(\"process\")`',\n category: \"Stylistic Issues\",\n recommended: false,\n url:\n \"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/prefer-global/process.md\",\n },\n type: \"suggestion\",\n fixable: null,\n schema: [{ enum: [\"always\", \"never\"] }],\n messages: {\n preferGlobal:\n \"Unexpected use of 'require(\\\"process\\\")'. Use the global variable 'process' instead.\",\n preferModule:\n \"Unexpected use of the global variable 'process'. Use 'require(\\\"process\\\")' instead.\",\n },\n },\n\n create(context) {\n return {\n \"Program:exit\"() {\n checkForPreferGlobal(context, trackMap)\n },\n }\n },\n}\n", "meta": {"content_hash": "18574d225594fc58aa63fbcf4f99929f", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 116, "avg_line_length": 27.282608695652176, "alnum_prop": 0.5306772908366534, "repo_name": "BigBoss424/portfolio", "id": "05482f756ed77730071cda9a6d69ce7c696c4086", "size": "1255", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "v6/node_modules/eslint-plugin-node/lib/rules/prefer-global/process.js", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\ufeffusing System;\nusing System.Diagnostics;\n\n#pragma warning disable 1591\n// ReSharper disable UnusedMember.Global\n// ReSharper disable MemberCanBePrivate.Global\n// ReSharper disable UnusedAutoPropertyAccessor.Global\n// ReSharper disable IntroduceOptionalParameters.Global\n// ReSharper disable MemberCanBeProtected.Global\n// ReSharper disable InconsistentNaming\n\n// ReSharper disable once CheckNamespace\nnamespace StackingEntities.Model.Annotations\n{\n /// <summary>\n /// Indicates that the value of the marked element could be <c>null</c> sometimes,\n /// so the check for <c>null</c> is necessary before its usage\n /// </summary>\n /// <example><code>\n /// [CanBeNull] public object Test() { return null; }\n /// public void UseTest() {\n /// var p = Test();\n /// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'\n /// }\n /// </code></example>\n [AttributeUsage(\n AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |\n AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class CanBeNullAttribute : Attribute { }\n\n /// <summary>\n /// Indicates that the value of the marked element could never be <c>null</c>\n /// </summary>\n /// <example><code>\n /// [NotNull] public object Foo() {\n /// return null; // Warning: Possible 'null' assignment\n /// }\n /// </code></example>\n [AttributeUsage(\n AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |\n AttributeTargets.Delegate | AttributeTargets.Field | AttributeTargets.Event)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class NotNullAttribute : Attribute { }\n\n /// <summary>\n /// Indicates that collection or enumerable value does not contain null elements\n /// </summary>\n [AttributeUsage(\n AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |\n AttributeTargets.Delegate | AttributeTargets.Field)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class ItemNotNullAttribute : Attribute { }\n\n /// <summary>\n /// Indicates that collection or enumerable value can contain null elements\n /// </summary>\n [AttributeUsage(\n AttributeTargets.Method | AttributeTargets.Parameter | AttributeTargets.Property |\n AttributeTargets.Delegate | AttributeTargets.Field)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class ItemCanBeNullAttribute : Attribute { }\n\n /// <summary>\n /// Indicates that the marked method builds string by format pattern and (optional) arguments.\n /// Parameter, which contains format string, should be given in constructor. The format string\n /// should be in <see cref=\"string.Format(IFormatProvider,string,object[])\"/>-like form\n /// </summary>\n /// <example><code>\n /// [StringFormatMethod(\"message\")]\n /// public void ShowError(string message, params object[] args) { /* do something */ }\n /// public void Foo() {\n /// ShowError(\"Failed: {0}\"); // Warning: Non-existing argument in format string\n /// }\n /// </code></example>\n [AttributeUsage(\n AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Delegate)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class StringFormatMethodAttribute : Attribute\n {\n /// <param name=\"formatParameterName\">\n /// Specifies which parameter of an annotated method should be treated as format-string\n /// </param>\n public StringFormatMethodAttribute(string formatParameterName)\n {\n FormatParameterName = formatParameterName;\n }\n\n public string FormatParameterName { get; private set; }\n }\n\n /// <summary>\n /// For a parameter that is expected to be one of the limited set of values.\n /// Specify fields of which type should be used as values for this parameter.\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class ValueProviderAttribute : Attribute\n {\n public ValueProviderAttribute(string name)\n {\n Name = name;\n }\n\n [NotNull] public string Name { get; private set; }\n }\n\n /// <summary>\n /// Indicates that the function argument should be string literal and match one\n /// of the parameters of the caller function. For example, ReSharper annotates\n /// the parameter of <see cref=\"System.ArgumentNullException\"/>\n /// </summary>\n /// <example><code>\n /// public void Foo(string param) {\n /// if (param == null)\n /// throw new ArgumentNullException(\"par\"); // Warning: Cannot resolve symbol\n /// }\n /// </code></example>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class InvokerParameterNameAttribute : Attribute { }\n\n /// <summary>\n /// Indicates that the method is contained in a type that implements\n /// <c>System.ComponentModel.INotifyPropertyChanged</c> interface and this method\n /// is used to notify that some property value changed\n /// </summary>\n /// <remarks>\n /// The method should be non-static and conform to one of the supported signatures:\n /// <list>\n /// <item><c>NotifyChanged(string)</c></item>\n /// <item><c>NotifyChanged(params string[])</c></item>\n /// <item><c>NotifyChanged{T}(Expression{Func{T}})</c></item>\n /// <item><c>NotifyChanged{T,U}(Expression{Func{T,U}})</c></item>\n /// <item><c>SetProperty{T}(ref T, T, string)</c></item>\n /// </list>\n /// </remarks>\n /// <example><code>\n /// public class Foo : INotifyPropertyChanged {\n /// public event PropertyChangedEventHandler PropertyChanged;\n /// [NotifyPropertyChangedInvocator]\n /// protected virtual void NotifyChanged(string propertyName) { ... }\n ///\n /// private string _name;\n /// public string Name {\n /// get { return _name; }\n /// set { _name = value; NotifyChanged(\"LastName\"); /* Warning */ }\n /// }\n /// }\n /// </code>\n /// Examples of generated notifications:\n /// <list>\n /// <item><c>NotifyChanged(\"Property\")</c></item>\n /// <item><c>NotifyChanged(() => Property)</c></item>\n /// <item><c>NotifyChanged((VM x) => x.Property)</c></item>\n /// <item><c>SetProperty(ref myField, value, \"Property\")</c></item>\n /// </list>\n /// </example>\n [AttributeUsage(AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute\n {\n public NotifyPropertyChangedInvocatorAttribute() { }\n public NotifyPropertyChangedInvocatorAttribute(string parameterName)\n {\n ParameterName = parameterName;\n }\n\n public string ParameterName { get; private set; }\n }\n\n /// <summary>\n /// Describes dependency between method input and output\n /// </summary>\n /// <syntax>\n /// <p>Function Definition Table syntax:</p>\n /// <list>\n /// <item>FDT ::= FDTRow [;FDTRow]*</item>\n /// <item>FDTRow ::= Input => Output | Output <= Input</item>\n /// <item>Input ::= ParameterName: Value [, Input]*</item>\n /// <item>Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value}</item>\n /// <item>Value ::= true | false | null | notnull | canbenull</item>\n /// </list>\n /// If method has single input parameter, it's name could be omitted.<br/>\n /// Using <c>halt</c> (or <c>void</c>/<c>nothing</c>, which is the same)\n /// for method output means that the methos doesn't return normally.<br/>\n /// <c>canbenull</c> annotation is only applicable for output parameters.<br/>\n /// You can use multiple <c>[ContractAnnotation]</c> for each FDT row,\n /// or use single attribute with rows separated by semicolon.<br/>\n /// </syntax>\n /// <examples><list>\n /// <item><code>\n /// [ContractAnnotation(\"=> halt\")]\n /// public void TerminationMethod()\n /// </code></item>\n /// <item><code>\n /// [ContractAnnotation(\"halt <= condition: false\")]\n /// public void Assert(bool condition, string text) // regular assertion method\n /// </code></item>\n /// <item><code>\n /// [ContractAnnotation(\"s:null => true\")]\n /// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()\n /// </code></item>\n /// <item><code>\n /// // A method that returns null if the parameter is null,\n /// // and not null if the parameter is not null\n /// [ContractAnnotation(\"null => null; notnull => notnull\")]\n /// public object Transform(object data) \n /// </code></item>\n /// <item><code>\n /// [ContractAnnotation(\"s:null=>false; =>true,result:notnull; =>false, result:null\")]\n /// public bool TryParse(string s, out Person result)\n /// </code></item>\n /// </list></examples>\n [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class ContractAnnotationAttribute : Attribute\n {\n public ContractAnnotationAttribute([NotNull] string contract)\n : this(contract, false) { }\n\n public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStates)\n {\n Contract = contract;\n ForceFullStates = forceFullStates;\n }\n\n public string Contract { get; private set; }\n public bool ForceFullStates { get; private set; }\n }\n\n /// <summary>\n /// Indicates that marked element should be localized or not\n /// </summary>\n /// <example><code>\n /// [LocalizationRequiredAttribute(true)]\n /// public class Foo {\n /// private string str = \"my string\"; // Warning: Localizable string\n /// }\n /// </code></example>\n [AttributeUsage(AttributeTargets.All)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class LocalizationRequiredAttribute : Attribute\n {\n public LocalizationRequiredAttribute() : this(true) { }\n public LocalizationRequiredAttribute(bool required)\n {\n Required = required;\n }\n\n public bool Required { get; private set; }\n }\n\n /// <summary>\n /// Indicates that the value of the marked type (or its derivatives)\n /// cannot be compared using '==' or '!=' operators and <c>Equals()</c>\n /// should be used instead. However, using '==' or '!=' for comparison\n /// with <c>null</c> is always permitted.\n /// </summary>\n /// <example><code>\n /// [CannotApplyEqualityOperator]\n /// class NoEquality { }\n /// class UsesNoEquality {\n /// public void Test() {\n /// var ca1 = new NoEquality();\n /// var ca2 = new NoEquality();\n /// if (ca1 != null) { // OK\n /// bool condition = ca1 == ca2; // Warning\n /// }\n /// }\n /// }\n /// </code></example>\n [AttributeUsage(\n AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class CannotApplyEqualityOperatorAttribute : Attribute { }\n\n /// <summary>\n /// When applied to a target attribute, specifies a requirement for any type marked\n /// with the target attribute to implement or inherit specific type or types.\n /// </summary>\n /// <example><code>\n /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement\n /// public class ComponentAttribute : Attribute { }\n /// [Component] // ComponentAttribute requires implementing IComponent interface\n /// public class MyComponent : IComponent { }\n /// </code></example>\n [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]\n [BaseTypeRequired(typeof(Attribute))]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class BaseTypeRequiredAttribute : Attribute\n {\n public BaseTypeRequiredAttribute([NotNull] Type baseType)\n {\n BaseType = baseType;\n }\n\n [NotNull] public Type BaseType { get; private set; }\n }\n\n /// <summary>\n /// Indicates that the marked symbol is used implicitly\n /// (e.g. via reflection, in external library), so this symbol\n /// will not be marked as unused (as well as by other usage inspections)\n /// </summary>\n [AttributeUsage(AttributeTargets.All)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class UsedImplicitlyAttribute : Attribute\n {\n public UsedImplicitlyAttribute()\n : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { }\n\n public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags)\n : this(useKindFlags, ImplicitUseTargetFlags.Default) { }\n\n public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags)\n : this(ImplicitUseKindFlags.Default, targetFlags) { }\n\n public UsedImplicitlyAttribute(\n ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)\n {\n UseKindFlags = useKindFlags;\n TargetFlags = targetFlags;\n }\n\n public ImplicitUseKindFlags UseKindFlags { get; private set; }\n public ImplicitUseTargetFlags TargetFlags { get; private set; }\n }\n\n /// <summary>\n /// Should be used on attributes and causes ReSharper\n /// to not mark symbols marked with such attributes as unused\n /// (as well as by other usage inspections)\n /// </summary>\n [AttributeUsage(AttributeTargets.Class | AttributeTargets.GenericParameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class MeansImplicitUseAttribute : Attribute\n {\n public MeansImplicitUseAttribute() \n : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { }\n\n public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags)\n : this(useKindFlags, ImplicitUseTargetFlags.Default) { }\n\n public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags)\n : this(ImplicitUseKindFlags.Default, targetFlags) { }\n\n public MeansImplicitUseAttribute(\n ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags)\n {\n UseKindFlags = useKindFlags;\n TargetFlags = targetFlags;\n }\n\n [UsedImplicitly] public ImplicitUseKindFlags UseKindFlags { get; private set; }\n [UsedImplicitly] public ImplicitUseTargetFlags TargetFlags { get; private set; }\n }\n \n [Flags]\n public enum ImplicitUseKindFlags\n {\n Default = Access | Assign | InstantiatedWithFixedConstructorSignature,\n /// <summary>Only entity marked with attribute considered used</summary>\n Access = 1,\n /// <summary>Indicates implicit assignment to a member</summary>\n Assign = 2,\n /// <summary>\n /// Indicates implicit instantiation of a type with fixed constructor signature.\n /// That means any unused constructor parameters won't be reported as such.\n /// </summary>\n InstantiatedWithFixedConstructorSignature = 4,\n /// <summary>Indicates implicit instantiation of a type</summary>\n InstantiatedNoFixedConstructorSignature = 8,\n }\n\n /// <summary>\n /// Specify what is considered used implicitly when marked\n /// with <see cref=\"MeansImplicitUseAttribute\"/> or <see cref=\"UsedImplicitlyAttribute\"/>\n /// </summary>\n [Flags]\n public enum ImplicitUseTargetFlags\n {\n Default = Itself,\n Itself = 1,\n /// <summary>Members of entity marked with attribute are considered used</summary>\n Members = 2,\n /// <summary>Entity marked with attribute and all its members considered used</summary>\n WithMembers = Itself | Members\n }\n\n /// <summary>\n /// This attribute is intended to mark publicly available API\n /// which should not be removed and so is treated as used\n /// </summary>\n [MeansImplicitUse]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class PublicAPIAttribute : Attribute\n {\n public PublicAPIAttribute() { }\n public PublicAPIAttribute([NotNull] string comment)\n {\n Comment = comment;\n }\n\n public string Comment { get; private set; }\n }\n\n /// <summary>\n /// Tells code analysis engine if the parameter is completely handled\n /// when the invoked method is on stack. If the parameter is a delegate,\n /// indicates that delegate is executed while the method is executed.\n /// If the parameter is an enumerable, indicates that it is enumerated\n /// while the method is executed\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class InstantHandleAttribute : Attribute { }\n\n /// <summary>\n /// Indicates that a method does not make any observable state changes.\n /// The same as <c>System.Diagnostics.Contracts.PureAttribute</c>\n /// </summary>\n /// <example><code>\n /// [Pure] private int Multiply(int x, int y) { return x * y; }\n /// public void Foo() {\n /// const int a = 2, b = 2;\n /// Multiply(a, b); // Waring: Return value of pure method is not used\n /// }\n /// </code></example>\n [AttributeUsage(AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class PureAttribute : Attribute { }\n\n /// <summary>\n /// Indicates that a parameter is a path to a file or a folder within a web project.\n /// Path can be relative or absolute, starting from web root (~)\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public class PathReferenceAttribute : Attribute\n {\n public PathReferenceAttribute() { }\n public PathReferenceAttribute([PathReference] string basePath)\n {\n BasePath = basePath;\n }\n\n public string BasePath { get; private set; }\n }\n\n [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute\n {\n public AspMvcAreaMasterLocationFormatAttribute(string format)\n {\n Format = format;\n }\n\n public string Format { get; private set; }\n }\n\n [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute\n {\n public AspMvcAreaPartialViewLocationFormatAttribute(string format)\n {\n Format = format;\n }\n\n public string Format { get; private set; }\n }\n\n [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcAreaViewLocationFormatAttribute : Attribute\n {\n public AspMvcAreaViewLocationFormatAttribute(string format)\n {\n Format = format;\n }\n\n public string Format { get; private set; }\n }\n\n [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcMasterLocationFormatAttribute : Attribute\n {\n public AspMvcMasterLocationFormatAttribute(string format)\n {\n Format = format;\n }\n\n public string Format { get; private set; }\n }\n\n [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcPartialViewLocationFormatAttribute : Attribute\n {\n public AspMvcPartialViewLocationFormatAttribute(string format)\n {\n Format = format;\n }\n\n public string Format { get; private set; }\n }\n\n [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcViewLocationFormatAttribute : Attribute\n {\n public AspMvcViewLocationFormatAttribute(string format)\n {\n Format = format;\n }\n\n public string Format { get; private set; }\n }\n \n /// <summary>\n /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter\n /// is an MVC action. If applied to a method, the MVC action name is calculated\n /// implicitly from the context. Use this attribute for custom wrappers similar to\n /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcActionAttribute : Attribute\n {\n public AspMvcActionAttribute() { }\n public AspMvcActionAttribute(string anonymousProperty)\n {\n AnonymousProperty = anonymousProperty;\n }\n\n public string AnonymousProperty { get; private set; }\n }\n\n /// <summary>\n /// ASP.NET MVC attribute. Indicates that a parameter is an MVC area.\n /// Use this attribute for custom wrappers similar to\n /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcAreaAttribute : PathReferenceAttribute\n {\n public AspMvcAreaAttribute() { }\n public AspMvcAreaAttribute(string anonymousProperty)\n {\n AnonymousProperty = anonymousProperty;\n }\n\n public string AnonymousProperty { get; private set; }\n }\n\n /// <summary>\n /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is\n /// an MVC controller. If applied to a method, the MVC controller name is calculated\n /// implicitly from the context. Use this attribute for custom wrappers similar to\n /// <c>System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcControllerAttribute : Attribute\n {\n public AspMvcControllerAttribute() { }\n public AspMvcControllerAttribute(string anonymousProperty)\n {\n AnonymousProperty = anonymousProperty;\n }\n\n public string AnonymousProperty { get; private set; }\n }\n\n /// <summary>\n /// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. Use this attribute\n /// for custom wrappers similar to <c>System.Web.Mvc.Controller.View(String, String)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcMasterAttribute : Attribute { }\n\n /// <summary>\n /// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. Use this attribute\n /// for custom wrappers similar to <c>System.Web.Mvc.Controller.View(String, Object)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcModelTypeAttribute : Attribute { }\n\n /// <summary>\n /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC\n /// partial view. If applied to a method, the MVC partial view name is calculated implicitly\n /// from the context. Use this attribute for custom wrappers similar to\n /// <c>System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcPartialViewAttribute : PathReferenceAttribute { }\n\n /// <summary>\n /// ASP.NET MVC attribute. Allows disabling inspections for MVC views within a class or a method\n /// </summary>\n [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcSupressViewErrorAttribute : Attribute { }\n\n /// <summary>\n /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template.\n /// Use this attribute for custom wrappers similar to \n /// <c>System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcDisplayTemplateAttribute : Attribute { }\n\n /// <summary>\n /// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template.\n /// Use this attribute for custom wrappers similar to\n /// <c>System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcEditorTemplateAttribute : Attribute { }\n\n /// <summary>\n /// ASP.NET MVC attribute. Indicates that a parameter is an MVC template.\n /// Use this attribute for custom wrappers similar to\n /// <c>System.ComponentModel.DataAnnotations.UIHintAttribute(System.String)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcTemplateAttribute : Attribute { }\n\n /// <summary>\n /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter\n /// is an MVC view. If applied to a method, the MVC view name is calculated implicitly\n /// from the context. Use this attribute for custom wrappers similar to\n /// <c>System.Web.Mvc.Controller.View(Object)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcViewAttribute : PathReferenceAttribute { }\n\n /// <summary>\n /// ASP.NET MVC attribute. When applied to a parameter of an attribute,\n /// indicates that this parameter is an MVC action name\n /// </summary>\n /// <example><code>\n /// [ActionName(\"Foo\")]\n /// public ActionResult Login(string returnUrl) {\n /// ViewBag.ReturnUrl = Url.Action(\"Foo\"); // OK\n /// return RedirectToAction(\"Bar\"); // Error: Cannot resolve action\n /// }\n /// </code></example>\n [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AspMvcActionSelectorAttribute : Attribute { }\n\n [AttributeUsage(\n AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Field)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class HtmlElementAttributesAttribute : Attribute\n {\n public HtmlElementAttributesAttribute() { }\n public HtmlElementAttributesAttribute(string name)\n {\n Name = name;\n }\n\n public string Name { get; private set; }\n }\n\n [AttributeUsage(\n AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class HtmlAttributeValueAttribute : Attribute\n {\n public HtmlAttributeValueAttribute([NotNull] string name)\n {\n Name = name;\n }\n\n [NotNull] public string Name { get; private set; }\n }\n\n /// <summary>\n /// Razor attribute. Indicates that a parameter or a method is a Razor section.\n /// Use this attribute for custom wrappers similar to \n /// <c>System.Web.WebPages.WebPageBase.RenderSection(String)</c>\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class RazorSectionAttribute : Attribute { }\n\n /// <summary>\n /// Indicates how method invocation affects content of the collection\n /// </summary>\n [AttributeUsage(AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class CollectionAccessAttribute : Attribute\n {\n public CollectionAccessAttribute(CollectionAccessType collectionAccessType)\n {\n CollectionAccessType = collectionAccessType;\n }\n\n public CollectionAccessType CollectionAccessType { get; private set; }\n }\n\n [Flags]\n public enum CollectionAccessType\n {\n /// <summary>Method does not use or modify content of the collection</summary>\n None = 0,\n /// <summary>Method only reads content of the collection but does not modify it</summary>\n Read = 1,\n /// <summary>Method can change content of the collection but does not add new elements</summary>\n ModifyExistingContent = 2,\n /// <summary>Method can add new elements to the collection</summary>\n UpdatedContent = ModifyExistingContent | 4\n }\n\n /// <summary>\n /// Indicates that the marked method is assertion method, i.e. it halts control flow if\n /// one of the conditions is satisfied. To set the condition, mark one of the parameters with \n /// <see cref=\"AssertionConditionAttribute\"/> attribute\n /// </summary>\n [AttributeUsage(AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AssertionMethodAttribute : Attribute { }\n\n /// <summary>\n /// Indicates the condition parameter of the assertion method. The method itself should be\n /// marked by <see cref=\"AssertionMethodAttribute\"/> attribute. The mandatory argument of\n /// the attribute is the assertion type.\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class AssertionConditionAttribute : Attribute\n {\n public AssertionConditionAttribute(AssertionConditionType conditionType)\n {\n ConditionType = conditionType;\n }\n\n public AssertionConditionType ConditionType { get; private set; }\n }\n\n /// <summary>\n /// Specifies assertion type. If the assertion method argument satisfies the condition,\n /// then the execution continues. Otherwise, execution is assumed to be halted\n /// </summary>\n public enum AssertionConditionType\n {\n /// <summary>Marked parameter should be evaluated to true</summary>\n IS_TRUE = 0,\n /// <summary>Marked parameter should be evaluated to false</summary>\n IS_FALSE = 1,\n /// <summary>Marked parameter should be evaluated to null value</summary>\n IS_NULL = 2,\n /// <summary>Marked parameter should be evaluated to not null value</summary>\n IS_NOT_NULL = 3,\n }\n\n /// <summary>\n /// Indicates that the marked method unconditionally terminates control flow execution.\n /// For example, it could unconditionally throw exception\n /// </summary>\n [Obsolete(\"Use [ContractAnnotation('=> halt')] instead\")]\n [AttributeUsage(AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class TerminatesProgramAttribute : Attribute { }\n\n /// <summary>\n /// Indicates that method is pure LINQ method, with postponed enumeration (like Enumerable.Select,\n /// .Where). This annotation allows inference of [InstantHandle] annotation for parameters\n /// of delegate type by analyzing LINQ method chains.\n /// </summary>\n [AttributeUsage(AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class LinqTunnelAttribute : Attribute { }\n\n /// <summary>\n /// Indicates that IEnumerable, passed as parameter, is not enumerated.\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class NoEnumerationAttribute : Attribute { }\n\n /// <summary>\n /// XAML attribute. Indicates the type that has <c>ItemsSource</c> property and should be\n /// treated as <c>ItemsControl</c>-derived type, to enable inner items <c>DataContext</c>\n /// type resolve.\n /// </summary>\n [AttributeUsage(AttributeTargets.Class)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class XamlItemsControlAttribute : Attribute { }\n\n /// <summary>\n /// XAML attibute. Indicates the property of some <c>BindingBase</c>-derived type, that\n /// is used to bind some item of <c>ItemsControl</c>-derived type. This annotation will\n /// enable the <c>DataContext</c> type resolve for XAML bindings for such properties.\n /// </summary>\n /// <remarks>\n /// Property should have the tree ancestor of the <c>ItemsControl</c> type or\n /// marked with the <see cref=\"XamlItemsControlAttribute\"/> attribute.\n /// </remarks>\n [AttributeUsage(AttributeTargets.Property)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class XamlItemBindingOfItemsControlAttribute : Attribute { }\n\n [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public class AspChildControlTypeAttribute : Attribute\n {\n public AspChildControlTypeAttribute(string tagName, Type controlType)\n {\n TagName = tagName;\n ControlType = controlType;\n }\n\n public string TagName { get; private set; }\n public Type ControlType { get; private set; }\n }\n\n [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public class AspDataFieldAttribute : Attribute { }\n\n [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public class AspDataFieldsAttribute : Attribute { }\n\n [AttributeUsage(AttributeTargets.Property)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public class AspMethodPropertyAttribute : Attribute { }\n\n [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public class AspRequiredAttributeAttribute : Attribute\n {\n public AspRequiredAttributeAttribute([NotNull] string attribute)\n {\n Attribute = attribute;\n }\n\n public string Attribute { get; private set; }\n }\n\n [AttributeUsage(AttributeTargets.Property)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public class AspTypePropertyAttribute : Attribute\n {\n public bool CreateConstructorReferences { get; private set; }\n\n public AspTypePropertyAttribute(bool createConstructorReferences)\n {\n CreateConstructorReferences = createConstructorReferences;\n }\n }\n\n [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class RazorImportNamespaceAttribute : Attribute\n {\n public RazorImportNamespaceAttribute(string name)\n {\n Name = name;\n }\n\n public string Name { get; private set; }\n }\n\n [AttributeUsage(AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class RazorHelperCommonAttribute : Attribute { }\n\n [AttributeUsage(AttributeTargets.Property)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class RazorLayoutAttribute : Attribute { }\n\n [AttributeUsage(AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class RazorWriteLiteralMethodAttribute : Attribute { }\n\n [AttributeUsage(AttributeTargets.Method)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class RazorWriteMethodAttribute : Attribute { }\n\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class RazorWriteMethodParameterAttribute : Attribute { }\n\n /// <summary>\n /// Indicates that parameter is regular expression pattern.\n /// </summary>\n [AttributeUsage(AttributeTargets.Parameter)]\n [Conditional(\"JETBRAINS_ANNOTATIONS\")]\n public sealed class RegexPatternAttribute : Attribute { }\n\n}", "meta": {"content_hash": "5971dcb4d1b4e83d0efc46f35bf6e02c", "timestamp": "", "source": "github", "line_count": 906, "max_line_length": 100, "avg_line_length": 37.67439293598234, "alnum_prop": 0.7113936659537691, "repo_name": "Sidneys1/MinecraftMultitool", "id": "ea30d7cff35bf1fc06f85081954a6d11e0e98a7c", "size": "34135", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "StackingEntities.Model/Properties/Annotations.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "298077"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n <title>Class</title>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <link rel=\"stylesheet\" href=\"../css/reset.css\" type=\"text/css\" media=\"screen\" />\n<link rel=\"stylesheet\" href=\"../css/main.css\" type=\"text/css\" media=\"screen\" />\n<link rel=\"stylesheet\" href=\"../css/github.css\" type=\"text/css\" media=\"screen\" />\n<script src=\"../js/jquery-1.3.2.min.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n<script src=\"../js/jquery-effect.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n<script src=\"../js/main.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n<script src=\"../js/highlight.pack.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n\n</head>\n\n<body> \n <div class=\"banner\">\n \n <span>Ruby on Rails 4.1.8</span><br />\n \n <h1>\n <span class=\"type\">Class</span> \n Class \n \n <span class=\"parent\">< \n \n <a href=\"Object.html\">Object</a>\n \n </span>\n \n </h1>\n <ul class=\"files\">\n \n <li><a href=\"../files/__/_rvm/gems/ruby-2_2_0/gems/activesupport-4_1_8/lib/active_support/core_ext/class/attribute_rb.html\">/home/kristof/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/core_ext/class/attribute.rb</a></li>\n \n <li><a href=\"../files/__/_rvm/gems/ruby-2_2_0/gems/activesupport-4_1_8/lib/active_support/core_ext/class/delegating_attributes_rb.html\">/home/kristof/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/core_ext/class/delegating_attributes.rb</a></li>\n \n <li><a href=\"../files/__/_rvm/gems/ruby-2_2_0/gems/activesupport-4_1_8/lib/active_support/core_ext/class/subclasses_rb.html\">/home/kristof/.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/core_ext/class/subclasses.rb</a></li>\n \n </ul>\n </div>\n <div id=\"bodyContent\">\n <div id=\"content\">\n \n\n\n \n\n\n \n \n\n\n \n\n\n \n <!-- Method ref -->\n <div class=\"sectiontitle\">Methods</div>\n <dl class=\"methods\">\n \n <dt>C</dt>\n <dd>\n <ul>\n \n \n <li>\n <a href=\"#method-i-class_attribute\">class_attribute</a>\n </li>\n \n </ul>\n </dd>\n \n <dt>S</dt>\n <dd>\n <ul>\n \n \n <li>\n <a href=\"#method-i-subclasses\">subclasses</a>,\n </li>\n \n \n <li>\n <a href=\"#method-i-superclass_delegating_accessor\">superclass_delegating_accessor</a>\n </li>\n \n </ul>\n </dd>\n \n </dl>\n \n\n \n\n\n\n \n\n \n\n \n\n \n\n\n \n\n\n <!-- Methods -->\n \n <div class=\"sectiontitle\">Instance Public methods</div>\n \n <div class=\"method\">\n <div class=\"title method-title\" id=\"method-i-class_attribute\">\n \n <b>class_attribute</b>(*attrs)\n \n <a href=\"../classes/Class.html#method-i-class_attribute\" name=\"method-i-class_attribute\" class=\"permalink\">Link</a>\n </div>\n \n \n <div class=\"description\">\n <p>Declare a class-level attribute whose value is inheritable by subclasses.\nSubclasses can change their own value and it will not impact parent class.</p>\n\n<pre><code>class Base\n class_attribute :setting\nend\n\nclass Subclass < Base\nend\n\nBase.setting = true\nSubclass.setting # => true\nSubclass.setting = false\nSubclass.setting # => false\nBase.setting # => true\n</code></pre>\n\n<p>In the above case as long as Subclass does not assign a value to setting by\nperforming <code>Subclass.setting = <em>something</em> </code>,\n<code>Subclass.setting</code> would read value assigned to parent class.\nOnce Subclass assigns a value then the value assigned by Subclass would be\nreturned.</p>\n\n<p>This matches normal Ruby method inheritance: think of writing an attribute\non a subclass as overriding the reader method. However, you need to be\naware when using <code>class_attribute</code> with mutable structures as\n<code>Array</code> or <code>Hash</code>. In such cases, you don't want\nto do changes in places but use setters:</p>\n\n<pre><code>Base.setting = []\nBase.setting # => []\nSubclass.setting # => []\n\n# Appending in child changes both parent and child because it is the same object:\nSubclass.setting << :foo\nBase.setting # => [:foo]\nSubclass.setting # => [:foo]\n\n# Use setters to not propagate changes:\nBase.setting = []\nSubclass.setting += [:foo]\nBase.setting # => []\nSubclass.setting # => [:foo]\n</code></pre>\n\n<p>For convenience, an instance predicate method is defined as well. To skip\nit, pass <code>instance_predicate: false</code>.</p>\n\n<pre><code>Subclass.setting? # => false\n</code></pre>\n\n<p>Instances may overwrite the class value in the same way:</p>\n\n<pre><code>Base.setting = true\nobject = Base.new\nobject.setting # => true\nobject.setting = false\nobject.setting # => false\nBase.setting # => true\n</code></pre>\n\n<p>To opt out of the instance reader method, pass <code>instance_reader:\nfalse</code>.</p>\n\n<pre><code>object.setting # => NoMethodError\nobject.setting? # => NoMethodError\n</code></pre>\n\n<p>To opt out of the instance writer method, pass <code>instance_writer:\nfalse</code>.</p>\n\n<pre><code>object.setting = false # => NoMethodError\n</code></pre>\n\n<p>To opt out of both instance methods, pass <code>instance_accessor:\nfalse</code>.</p>\n </div>\n \n \n \n\n \n \n \n \n <div class=\"sourcecode\">\n \n <p class=\"source-link\">\n Source: \n <a href=\"javascript:toggleSource('method-i-class_attribute_source')\" id=\"l_method-i-class_attribute_source\">show</a>\n \n </p>\n <div id=\"method-i-class_attribute_source\" class=\"dyn-source\">\n <pre><span class=\"ruby-comment\"># File ../.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/core_ext/class/attribute.rb, line 71</span>\n<span class=\"ruby-keyword\">def</span> <span class=\"ruby-keyword ruby-title\">class_attribute</span>(<span class=\"ruby-operator\">*</span><span class=\"ruby-identifier\">attrs</span>)\n <span class=\"ruby-identifier\">options</span> = <span class=\"ruby-identifier\">attrs</span>.<span class=\"ruby-identifier\">extract_options!</span>\n <span class=\"ruby-identifier\">instance_reader</span> = <span class=\"ruby-identifier\">options</span>.<span class=\"ruby-identifier\">fetch</span>(<span class=\"ruby-value\">:instance_accessor</span>, <span class=\"ruby-keyword\">true</span>) <span class=\"ruby-operator\">&&</span> <span class=\"ruby-identifier\">options</span>.<span class=\"ruby-identifier\">fetch</span>(<span class=\"ruby-value\">:instance_reader</span>, <span class=\"ruby-keyword\">true</span>)\n <span class=\"ruby-identifier\">instance_writer</span> = <span class=\"ruby-identifier\">options</span>.<span class=\"ruby-identifier\">fetch</span>(<span class=\"ruby-value\">:instance_accessor</span>, <span class=\"ruby-keyword\">true</span>) <span class=\"ruby-operator\">&&</span> <span class=\"ruby-identifier\">options</span>.<span class=\"ruby-identifier\">fetch</span>(<span class=\"ruby-value\">:instance_writer</span>, <span class=\"ruby-keyword\">true</span>)\n <span class=\"ruby-identifier\">instance_predicate</span> = <span class=\"ruby-identifier\">options</span>.<span class=\"ruby-identifier\">fetch</span>(<span class=\"ruby-value\">:instance_predicate</span>, <span class=\"ruby-keyword\">true</span>)\n\n <span class=\"ruby-identifier\">attrs</span>.<span class=\"ruby-identifier\">each</span> <span class=\"ruby-keyword\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">name</span><span class=\"ruby-operator\">|</span>\n <span class=\"ruby-identifier\">define_singleton_method</span>(<span class=\"ruby-identifier\">name</span>) { <span class=\"ruby-keyword\">nil</span> }\n <span class=\"ruby-identifier\">define_singleton_method</span>(<span class=\"ruby-node\">"#{name}?"</span>) { <span class=\"ruby-operator\">!</span><span class=\"ruby-operator\">!</span><span class=\"ruby-identifier\">public_send</span>(<span class=\"ruby-identifier\">name</span>) } <span class=\"ruby-keyword\">if</span> <span class=\"ruby-identifier\">instance_predicate</span>\n\n <span class=\"ruby-identifier\">ivar</span> = <span class=\"ruby-node\">"@#{name}"</span>\n\n <span class=\"ruby-identifier\">define_singleton_method</span>(<span class=\"ruby-node\">"#{name}="</span>) <span class=\"ruby-keyword\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">val</span><span class=\"ruby-operator\">|</span>\n <span class=\"ruby-identifier\">singleton_class</span>.<span class=\"ruby-identifier\">class_eval</span> <span class=\"ruby-keyword\">do</span>\n <span class=\"ruby-identifier\">remove_possible_method</span>(<span class=\"ruby-identifier\">name</span>)\n <span class=\"ruby-identifier\">define_method</span>(<span class=\"ruby-identifier\">name</span>) { <span class=\"ruby-identifier\">val</span> }\n <span class=\"ruby-keyword\">end</span>\n\n <span class=\"ruby-keyword\">if</span> <span class=\"ruby-identifier\">singleton_class?</span>\n <span class=\"ruby-identifier\">class_eval</span> <span class=\"ruby-keyword\">do</span>\n <span class=\"ruby-identifier\">remove_possible_method</span>(<span class=\"ruby-identifier\">name</span>)\n <span class=\"ruby-identifier\">define_method</span>(<span class=\"ruby-identifier\">name</span>) <span class=\"ruby-keyword\">do</span>\n <span class=\"ruby-keyword\">if</span> <span class=\"ruby-identifier\">instance_variable_defined?</span> <span class=\"ruby-identifier\">ivar</span>\n <span class=\"ruby-identifier\">instance_variable_get</span> <span class=\"ruby-identifier\">ivar</span>\n <span class=\"ruby-keyword\">else</span>\n <span class=\"ruby-identifier\">singleton_class</span>.<span class=\"ruby-identifier\">send</span> <span class=\"ruby-identifier\">name</span>\n <span class=\"ruby-keyword\">end</span>\n <span class=\"ruby-keyword\">end</span>\n <span class=\"ruby-keyword\">end</span>\n <span class=\"ruby-keyword\">end</span>\n <span class=\"ruby-identifier\">val</span>\n <span class=\"ruby-keyword\">end</span>\n\n <span class=\"ruby-keyword\">if</span> <span class=\"ruby-identifier\">instance_reader</span>\n <span class=\"ruby-identifier\">remove_possible_method</span> <span class=\"ruby-identifier\">name</span>\n <span class=\"ruby-identifier\">define_method</span>(<span class=\"ruby-identifier\">name</span>) <span class=\"ruby-keyword\">do</span>\n <span class=\"ruby-keyword\">if</span> <span class=\"ruby-identifier\">instance_variable_defined?</span>(<span class=\"ruby-identifier\">ivar</span>)\n <span class=\"ruby-identifier\">instance_variable_get</span> <span class=\"ruby-identifier\">ivar</span>\n <span class=\"ruby-keyword\">else</span>\n <span class=\"ruby-keyword\">self</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">public_send</span> <span class=\"ruby-identifier\">name</span>\n <span class=\"ruby-keyword\">end</span>\n <span class=\"ruby-keyword\">end</span>\n <span class=\"ruby-identifier\">define_method</span>(<span class=\"ruby-node\">"#{name}?"</span>) { <span class=\"ruby-operator\">!</span><span class=\"ruby-operator\">!</span><span class=\"ruby-identifier\">public_send</span>(<span class=\"ruby-identifier\">name</span>) } <span class=\"ruby-keyword\">if</span> <span class=\"ruby-identifier\">instance_predicate</span>\n <span class=\"ruby-keyword\">end</span>\n\n <span class=\"ruby-identifier\">attr_writer</span> <span class=\"ruby-identifier\">name</span> <span class=\"ruby-keyword\">if</span> <span class=\"ruby-identifier\">instance_writer</span>\n <span class=\"ruby-keyword\">end</span>\n<span class=\"ruby-keyword\">end</span></pre>\n </div>\n </div>\n \n </div>\n \n <div class=\"method\">\n <div class=\"title method-title\" id=\"method-i-subclasses\">\n \n <b>subclasses</b>()\n \n <a href=\"../classes/Class.html#method-i-subclasses\" name=\"method-i-subclasses\" class=\"permalink\">Link</a>\n </div>\n \n \n <div class=\"description\">\n <p>Returns an array with the direct children of <code>self</code>.</p>\n\n<pre><code>Integer.subclasses # => [Fixnum, Bignum]\n\nclass Foo; end\nclass Bar < Foo; end\nclass Baz < Bar; end\n\nFoo.subclasses # => [Bar]\n</code></pre>\n </div>\n \n \n \n\n \n \n \n \n <div class=\"sourcecode\">\n \n <p class=\"source-link\">\n Source: \n <a href=\"javascript:toggleSource('method-i-subclasses_source')\" id=\"l_method-i-subclasses_source\">show</a>\n \n </p>\n <div id=\"method-i-subclasses_source\" class=\"dyn-source\">\n <pre><span class=\"ruby-comment\"># File ../.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/core_ext/class/subclasses.rb, line 35</span>\n<span class=\"ruby-keyword\">def</span> <span class=\"ruby-keyword ruby-title\">subclasses</span>\n <span class=\"ruby-identifier\">subclasses</span>, <span class=\"ruby-identifier\">chain</span> = [], <span class=\"ruby-identifier\">descendants</span>\n <span class=\"ruby-identifier\">chain</span>.<span class=\"ruby-identifier\">each</span> <span class=\"ruby-keyword\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">k</span><span class=\"ruby-operator\">|</span>\n <span class=\"ruby-identifier\">subclasses</span> <span class=\"ruby-operator\"><<</span> <span class=\"ruby-identifier\">k</span> <span class=\"ruby-keyword\">unless</span> <span class=\"ruby-identifier\">chain</span>.<span class=\"ruby-identifier\">any?</span> { <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">c</span><span class=\"ruby-operator\">|</span> <span class=\"ruby-identifier\">c</span> <span class=\"ruby-operator\">></span> <span class=\"ruby-identifier\">k</span> }\n <span class=\"ruby-keyword\">end</span>\n <span class=\"ruby-identifier\">subclasses</span>\n<span class=\"ruby-keyword\">end</span></pre>\n </div>\n </div>\n \n </div>\n \n <div class=\"method\">\n <div class=\"title method-title\" id=\"method-i-superclass_delegating_accessor\">\n \n <b>superclass_delegating_accessor</b>(name, options = {})\n \n <a href=\"../classes/Class.html#method-i-superclass_delegating_accessor\" name=\"method-i-superclass_delegating_accessor\" class=\"permalink\">Link</a>\n </div>\n \n \n <div class=\"description\">\n \n </div>\n \n \n \n\n \n \n \n \n <div class=\"sourcecode\">\n \n <p class=\"source-link\">\n Source: \n <a href=\"javascript:toggleSource('method-i-superclass_delegating_accessor_source')\" id=\"l_method-i-superclass_delegating_accessor_source\">show</a>\n \n </p>\n <div id=\"method-i-superclass_delegating_accessor_source\" class=\"dyn-source\">\n <pre><span class=\"ruby-comment\"># File ../.rvm/gems/ruby-2.2.0/gems/activesupport-4.1.8/lib/active_support/core_ext/class/delegating_attributes.rb, line 5</span>\n<span class=\"ruby-keyword\">def</span> <span class=\"ruby-keyword ruby-title\">superclass_delegating_accessor</span>(<span class=\"ruby-identifier\">name</span>, <span class=\"ruby-identifier\">options</span> = {})\n <span class=\"ruby-comment\"># Create private _name and _name= methods that can still be used if the public</span>\n <span class=\"ruby-comment\"># methods are overridden.</span>\n <span class=\"ruby-identifier\">_superclass_delegating_accessor</span>(<span class=\"ruby-node\">"_#{name}"</span>, <span class=\"ruby-identifier\">options</span>)\n\n <span class=\"ruby-comment\"># Generate the public methods name, name=, and name?.</span>\n <span class=\"ruby-comment\"># These methods dispatch to the private _name, and _name= methods, making them</span>\n <span class=\"ruby-comment\"># overridable.</span>\n <span class=\"ruby-identifier\">singleton_class</span>.<span class=\"ruby-identifier\">send</span>(<span class=\"ruby-value\">:define_method</span>, <span class=\"ruby-identifier\">name</span>) { <span class=\"ruby-identifier\">send</span>(<span class=\"ruby-node\">"_#{name}"</span>) }\n <span class=\"ruby-identifier\">singleton_class</span>.<span class=\"ruby-identifier\">send</span>(<span class=\"ruby-value\">:define_method</span>, <span class=\"ruby-node\">"#{name}?"</span>) { <span class=\"ruby-operator\">!</span><span class=\"ruby-operator\">!</span><span class=\"ruby-identifier\">send</span>(<span class=\"ruby-node\">"_#{name}"</span>) }\n <span class=\"ruby-identifier\">singleton_class</span>.<span class=\"ruby-identifier\">send</span>(<span class=\"ruby-value\">:define_method</span>, <span class=\"ruby-node\">"#{name}="</span>) { <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">value</span><span class=\"ruby-operator\">|</span> <span class=\"ruby-identifier\">send</span>(<span class=\"ruby-node\">"_#{name}="</span>, <span class=\"ruby-identifier\">value</span>) }\n\n <span class=\"ruby-comment\"># If an instance_reader is needed, generate public instance methods name and name?.</span>\n <span class=\"ruby-keyword\">if</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-value\">:instance_reader</span>] <span class=\"ruby-operator\">!=</span> <span class=\"ruby-keyword\">false</span>\n <span class=\"ruby-identifier\">define_method</span>(<span class=\"ruby-identifier\">name</span>) { <span class=\"ruby-identifier\">send</span>(<span class=\"ruby-node\">"_#{name}"</span>) }\n <span class=\"ruby-identifier\">define_method</span>(<span class=\"ruby-node\">"#{name}?"</span>) { <span class=\"ruby-operator\">!</span><span class=\"ruby-operator\">!</span><span class=\"ruby-identifier\">send</span>(<span class=\"ruby-node\">"#{name}"</span>) }\n <span class=\"ruby-keyword\">end</span>\n<span class=\"ruby-keyword\">end</span></pre>\n </div>\n </div>\n \n </div>\n </div>\n\n </div>\n </body>\n</html> ", "meta": {"content_hash": "70b72cfb262e58a9070a311e29611ac4", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 493, "avg_line_length": 50.55291005291005, "alnum_prop": 0.62033596734523, "repo_name": "kristoferrobin/p2p", "id": "0e6aba409bb7dad702c95b3e19a0a2a0d83ce133", "size": "19109", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/api/classes/Class.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1033"}, {"name": "CoffeeScript", "bytes": "422"}, {"name": "HTML", "bytes": "5432"}, {"name": "JavaScript", "bytes": "664"}, {"name": "Ruby", "bytes": "24321"}]}} +{"text": "<?php\n\n\nnamespace ZFTest\\Rest;\n\nuse PHPUnit_Framework_TestCase as TestCase;\nuse Zend\\Http\\Request as HttpRequest;\nuse Zend\\InputFilter\\InputFilter;\nuse Zend\\Mvc\\Router\\RouteMatch;\nuse Zend\\Stdlib\\Parameters;\nuse ZF\\MvcAuth\\Identity\\GuestIdentity;\nuse ZF\\Rest\\ResourceEvent;\n\nclass ResourceEventTest extends TestCase\n{\n public function setUp()\n {\n $this->matches = new RouteMatch(array(\n 'foo' => 'bar',\n 'baz' => 'inga',\n ));\n $this->query = new Parameters(array(\n 'foo' => 'bar',\n 'baz' => 'inga',\n ));\n\n $this->event = new ResourceEvent();\n }\n\n public function testRouteMatchIsNullByDefault()\n {\n $this->assertNull($this->event->getRouteMatch());\n }\n\n public function testQueryParamsAreNullByDefault()\n {\n $this->assertNull($this->event->getQueryParams());\n }\n\n public function testRouteMatchIsMutable()\n {\n $this->event->setRouteMatch($this->matches);\n $this->assertSame($this->matches, $this->event->getRouteMatch());\n return $this->event;\n }\n\n public function testQueryParamsAreMutable()\n {\n $this->event->setQueryParams($this->query);\n $this->assertSame($this->query, $this->event->getQueryParams());\n return $this->event;\n }\n\n public function testRequestIsNullByDefault()\n {\n $this->assertNull($this->event->getRequest());\n }\n\n public function testRequestIsMutable()\n {\n $request = new HttpRequest();\n $this->event->setRequest($request);\n $this->assertSame($request, $this->event->getRequest());\n return $this->event;\n }\n\n /**\n * @depends testRouteMatchIsMutable\n */\n public function testRouteMatchIsNullable(ResourceEvent $event)\n {\n $event->setRouteMatch(null);\n $this->assertNull($event->getRouteMatch());\n }\n\n /**\n * @depends testQueryParamsAreMutable\n */\n public function testQueryParamsAreNullable(ResourceEvent $event)\n {\n $event->setQueryParams(null);\n $this->assertNull($event->getQueryParams());\n }\n\n /**\n * @depends testRequestIsMutable\n */\n public function testRequestIsNullable(ResourceEvent $event)\n {\n $event->setRequest(null);\n $this->assertNull($event->getRequest());\n }\n\n public function testCanInjectRequestViaSetParams()\n {\n $request = new HttpRequest();\n $this->event->setParams(array('request' => $request));\n $this->assertSame($request, $this->event->getRequest());\n }\n\n public function testCanFetchIndividualRouteParameter()\n {\n $this->event->setRouteMatch($this->matches);\n $this->assertEquals('bar', $this->event->getRouteParam('foo'));\n $this->assertEquals('inga', $this->event->getRouteParam('baz'));\n }\n\n public function testCanFetchIndividualQueryParameter()\n {\n $this->event->setQueryParams($this->query);\n $this->assertEquals('bar', $this->event->getQueryParam('foo'));\n $this->assertEquals('inga', $this->event->getQueryParam('baz'));\n }\n\n public function testReturnsDefaultParameterWhenPullingUnknownRouteParameter()\n {\n $this->assertNull($this->event->getRouteParam('foo'));\n $this->assertEquals('bat', $this->event->getRouteParam('baz', 'bat'));\n }\n\n public function testReturnsDefaultParameterWhenPullingUnknownQueryParameter()\n {\n $this->assertNull($this->event->getQueryParam('foo'));\n $this->assertEquals('bat', $this->event->getQueryParam('baz', 'bat'));\n }\n\n public function testInputFilterIsUndefinedByDefault()\n {\n $this->assertNull($this->event->getInputFilter());\n }\n\n /**\n * @depends testInputFilterIsUndefinedByDefault\n */\n public function testCanComposeInputFilter()\n {\n $inputFilter = new InputFilter();\n $this->event->setInputFilter($inputFilter);\n $this->assertSame($inputFilter, $this->event->getInputFilter());\n }\n\n /**\n * @depends testCanComposeInputFilter\n */\n public function testCanNullifyInputFilter()\n {\n $this->event->setInputFilter(null);\n $this->assertNull($this->event->getInputFilter());\n }\n\n public function testIdentityIsUndefinedByDefault()\n {\n $this->assertNull($this->event->getIdentity());\n }\n\n /**\n * @depends testIdentityIsUndefinedByDefault\n */\n public function testCanComposeIdentity()\n {\n $identity = new GuestIdentity();\n $this->event->setIdentity($identity);\n $this->assertSame($identity, $this->event->getIdentity());\n }\n\n /**\n * @depends testCanComposeIdentity\n */\n public function testCanNullifyIdentity()\n {\n $this->event->setIdentity(null);\n $this->assertNull($this->event->getIdentity());\n }\n}\n", "meta": {"content_hash": "57c599ca684af99478622a283893fb6f", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 81, "avg_line_length": 27.804597701149426, "alnum_prop": 0.6242248863166597, "repo_name": "nocvp/zf-rest", "id": "3d3a6c0814ca8925fcb6a3fb7b864b16d86184fa", "size": "4998", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "test/ResourceEventTest.php", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "PHP", "bytes": "211249"}]}} +{"text": "package search\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/sebas7dk/go-recipes/config\"\n\t\"github.com/sebas7dk/go-recipes/models\"\n\telastigo \"github.com/mattbaird/elastigo/lib\"\n)\n\ntype Connection struct {\n\tConn *elastigo.Conn\n}\n\nvar index string\n\n//SetIndex set the index name\nfunc SetIndex(i string) {\n\tindex = i\n}\n\n//NewConnection create a new Elastic Search connection\nfunc NewConnection() (*Connection, error) {\n\tc := elastigo.NewConn()\n\tif c == nil {\n\t\treturn nil, errors.New(\"Unable to connect to Elastic Search\")\n\t}\n\n\tc.Domain = config.Get(\"ES_DOMAIN\")\n\tc.Port = config.Get(\"ES_PORT\")\n\n\tconn := &Connection{Conn: c}\n\n\treturn conn, nil\n}\n\n//Show all the docs in the index\nfunc (c *Connection) Show() ([]models.Recipe, error) {\n\tsearchJSON := `{\n \"query\" : {\n \"match_all\" : {}\n }\n }`\n\n\to, err := c.Conn.Search(index, \"recipe\", nil, searchJSON)\n\tr := BuildResults(o.Hits.Hits)\n\n\treturn r, err\n}\n\n//GetById show the doc by id\nfunc (c *Connection) GetById(id string) (*models.Recipe, error) {\n\tvar recipe *models.Recipe\n\n\to, err := c.Conn.Get(index, \"recipe\", id, nil)\n\n\tif err == nil {\n\t\tjson.Unmarshal(*o.Source, &recipe)\n\t\trecipe.Id = o.Id\n\t}\n\n\treturn recipe, err\n}\n\n//Create a new doc\nfunc (c *Connection) Create(r models.Recipe) (elastigo.BaseResponse, error) {\n\treturn c.Conn.Index(index, \"recipe\", \"\", nil, r)\n}\n\n//Update a doc by id\nfunc (c *Connection) Update(id string, r models.Recipe) (elastigo.BaseResponse, error) {\n\treturn c.Conn.Index(index, \"recipe\", id, nil, r)\n}\n\n//Query the index and match the search term\nfunc (c *Connection) Query(s string) ([]models.Recipe, error) {\n\tsearchJSON := fmt.Sprintf(`{\n\t \"query\" : {\n\t \"multi_match\": {\n\t \"query\" : \"%s\",\n\t \"fields\" : [\"title^50\", \"category^30\", \"instructions^25\", \"ingredients^20\"]\n\t }\n\t }\n\t}`, s)\n\n\to, err := c.Conn.Search(index, \"recipe\", nil, searchJSON)\n\tr := BuildResults(o.Hits.Hits)\n\n\treturn r, err\n}\n\n//Delete a doc from the index\nfunc (c *Connection) Delete(id string) (elastigo.BaseResponse, error) {\n\treturn c.Conn.Delete(index, \"recipe\", id, nil)\n}\n\n//DeleteIndex alll docs from the index\nfunc (c *Connection) DeleteIndex() (elastigo.BaseResponse, error) {\n\treturn c.Conn.DeleteIndex(index)\n}\n\n//BuildResults loop through the hits based on the total hits\nfunc BuildResults(recipes []elastigo.Hit) []models.Recipe {\n\tvar recipe models.Recipe\n\trs := make(models.Recipes, 0)\n\n\tfor _, r := range recipes {\n\t\tif err := json.Unmarshal(*r.Source, &recipe); err == nil {\n\t\t\trecipe.Id = r.Id\n\t\t\trs = append(rs, recipe)\n\t\t}\n\t}\n\n\treturn rs\n}\n", "meta": {"content_hash": "69827d11b5629dfd1a9c8eae8f826f3f", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 88, "avg_line_length": 22.102564102564102, "alnum_prop": 0.6550657385924207, "repo_name": "sebas7dk/go-recipes", "id": "1630cef66c4fa5730b0e0761ecea66022a7846a5", "size": "2586", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "search/search.go", "mode": "33188", "license": "mit", "language": [{"name": "Go", "bytes": "12353"}, {"name": "Makefile", "bytes": "277"}]}} +{"text": "(function() {\n var ArrayIterator, IteratorOutput, PairwiseArrayIterator, __assert_unfinished__, __throw_iterator_finished__;\n\n __throw_iterator_finished__ = function() {\n throw new Error(\"Iterator has already finished\");\n };\n\n __assert_unfinished__ = function(iteratorOutput) {\n if (iteratorOutput.done) {\n return __throw_iterator_finished__();\n }\n };\n\n IteratorOutput = (function() {\n function IteratorOutput(value) {\n this.value = value;\n this.done = false;\n }\n\n return IteratorOutput;\n\n })();\n\n ArrayIterator = (function() {\n function ArrayIterator(array) {\n this.array = array;\n this.index = 0;\n this.out = new IteratorOutput;\n }\n\n ArrayIterator.prototype.next = function() {\n var array, index, out;\n array = this.array, index = this.index, out = this.out;\n __assert_unfinished__(out);\n if (index < array.length) {\n out.value = array[index];\n } else {\n out.value = void 0;\n out.done = true;\n }\n this.index += 1;\n return out;\n };\n\n return ArrayIterator;\n\n })();\n\n PairwiseArrayIterator = (function() {\n function PairwiseArrayIterator(array) {\n this.array = array;\n if (array.length % 2) {\n throw new Error(\"Odd number of elements\");\n }\n this.index = 0;\n this.out = new IteratorOutput([]);\n }\n\n PairwiseArrayIterator.prototype.next = function() {\n var array, index, out;\n array = this.array, index = this.index, out = this.out;\n __assert_unfinished__(out);\n if (index < array.length) {\n out.value[0] = array[index];\n out.value[1] = array[index + 1];\n } else {\n out.value[0] = void 0;\n out.value[1] = void 0;\n out.done = true;\n }\n this.index += 2;\n return out;\n };\n\n return PairwiseArrayIterator;\n\n })();\n\n module.exports = {\n ArrayIterator: ArrayIterator,\n PairwiseArrayIterator: PairwiseArrayIterator\n };\n\n}).call(this);\n", "meta": {"content_hash": "dd30bf201b9e83f436ec53e5dfd58a61", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 111, "avg_line_length": 23.678571428571427, "alnum_prop": 0.5811965811965812, "repo_name": "nickfargo/pim", "id": "5104b9cd1fe9faaea965347c580d7c37e3c8142f", "size": "2024", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/array-iterators.js", "mode": "33188", "license": "mit", "language": [{"name": "Shell", "bytes": "471"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>projective-geometry: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.8.1 / projective-geometry - 8.5.0</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n projective-geometry\n <small>\n 8.5.0\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-04-08 16:37:15 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-04-08 16:37:15 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-threads base\nbase-unix base\ncamlp5 7.14 Preprocessor-pretty-printer of OCaml\nconf-findutils 1 Virtual package relying on findutils\nconf-perl 2 Virtual package relying on perl\ncoq 8.8.1 Formal proof management system\nnum 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.09.1 The OCaml compiler (virtual package)\nocaml-base-compiler 4.09.1 Official release 4.09.1\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.3 A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "matej.kosik@inria.fr"\nhomepage: "https://github.com/coq-contribs/projective-geometry"\nlicense: "Proprietary"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/ProjectiveGeometry"]\ndepends: [\n "ocaml"\n "coq" {>= "8.5" & < "8.6~"}\n]\ntags: [\n "keyword:geometry"\n "keyword:projective"\n "keyword:Fano"\n "keyword:homogeneous coordinates model"\n "keyword:flat"\n "keyword:rank"\n "keyword:Desargues"\n "keyword:Moulton"\n "category:Mathematics/Geometry/General"\n "date:2009-10"\n]\nauthors: [ "Nicolas Magaud <Nicolas.Magaud@lsiit-cnrs.unistra.fr>" "Julien Narboux <Julien.Narboux@lsiit-cnrs.unistra.fr>" "Pascal Schreck <Pascal.Schreck@lsiit-cnrs.unistra.fr>" ]\nbug-reports: "https://github.com/coq-contribs/projective-geometry/issues"\ndev-repo: "git+https://github.com/coq-contribs/projective-geometry.git"\nsynopsis: "Projective Geometry"\ndescription: """\nThis contributions contains elements of formalization of projective geometry.\nIn the plane:\nTwo axiom systems are shown equivalent. We prove some results about the\ndecidability of the the incidence and equality predicates. The classic\nnotion of duality between points and lines is formalized thanks to a\nfunctor. The notion of 'flat' is defined and flats are characterized.\nFano's plane, the smallest projective plane is defined. We show that Fano's plane is desarguesian.\nIn the space:\nWe prove Desargues' theorem."""\nflags: light-uninstall\nurl {\n src:\n "https://github.com/coq-contribs/projective-geometry/archive/v8.5.0.tar.gz"\n checksum: "md5=b538b6b3caec10362391436a1f91d9c9"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-projective-geometry.8.5.0 coq.8.8.1</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.8.1).\nThe following dependencies couldn't be met:\n - coq-projective-geometry -> coq < 8.6~ -> ocaml < 4.06.0\n base of this switch (use `--unlock-base' to force)\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-projective-geometry.8.5.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "43f99f6705bde8fc87362a78d175e415", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 228, "avg_line_length": 42.295081967213115, "alnum_prop": 0.5683462532299741, "repo_name": "coq-bench/coq-bench.github.io", "id": "f19569dc00d6c5044e14382b0c17dcdc35b073be", "size": "7765", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.8.1/projective-geometry/8.5.0.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "@interface DemoViewController ()\n\n@end\n\n@implementation DemoViewController\n\n- (void)viewDidLoad {\n [super viewDidLoad];\n}\n\n- (void)didReceiveMemoryWarning {\n [super didReceiveMemoryWarning];\n}\n\n- (IBAction)openCalendar:(id)sender {\n [self openCalendarVC:self];\n}\n\n\n- (void)openCalendarVC:(UIViewController *)vc {\n if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {\n UIViewController *viewController = [[UIStoryboard storyboardWithName:@\"main-iPad\" bundle:NULL] instantiateViewControllerWithIdentifier:@\"MainNav\"];\n viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;\n \n [vc presentViewController:viewController animated:YES completion:nil];\n } else {\n UIViewController *viewController = [[UIStoryboard storyboardWithName:@\"main-iPhone\" bundle:NULL] instantiateViewControllerWithIdentifier:@\"MainNav\"];\n viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;\n \n [vc presentViewController:viewController animated:YES completion:nil];\n }\n}\n\n\n@end\n", "meta": {"content_hash": "f9a06995cf8dd0234ef62d7a3c671a5f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 157, "avg_line_length": 30.571428571428573, "alnum_prop": 0.7439252336448599, "repo_name": "george-zergy/Calendar", "id": "f30b4bcd91848d3d3216afcc6ff06dd941ef9209", "size": "1251", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Demo/Other/DemoViewController.m", "mode": "33188", "license": "mit", "language": [{"name": "Objective-C", "bytes": "551753"}, {"name": "Ruby", "bytes": "1577"}]}} +{"text": "package club.zhcs.thunder.controller.admin.log;\n\nimport org.apache.shiro.authz.annotation.RequiresRoles;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.ui.Model;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport club.zhcs.thunder.biz.log.LoginLogService;\nimport club.zhcs.thunder.controller.base.BaseController;\nimport club.zhcs.thunder.domain.log.LoginLog;\nimport club.zhcs.titans.utils.db.Pager;\nimport club.zhcs.titans.utils.db.Result;\n\n/**\n * \n * @author admin\n *\n * @email kerbores@gmail.com\n *\n */\n@Controller\n@RequestMapping(\"login\")\npublic class LoginLogController extends BaseController {\n\n\t@Autowired\n\tLoginLogService loginLogService;\n\n\t@RequestMapping(\"list\")\n\t@RequiresRoles(\"admin\")\n\tpublic String list(@RequestParam(value = \"page\", defaultValue = \"1\") int page, Model model) {\n\t\tPager<LoginLog> pager = loginLogService.searchByPage(_fixPage(page));\n\t\tpager.setUrl(_base() + \"/login/list\");\n\t\tmodel.addAttribute(\"obj\", Result.success().addData(\"pager\", pager).setTitle(\" \u767b\u5f55\u65e5\u5fd7\u5217\u8868\"));\n\t\treturn \"pages/log/login/list\";\n\t}\n\n\t@RequestMapping(\"search\")\n\t@RequiresRoles(\"admin\")\n\tpublic String search(@RequestParam(value = \"page\", defaultValue = \"1\") int page, @RequestParam(\"key\") String key, Model model) {\n\t\tPager<LoginLog> pager = loginLogService.searchByKeyAndPage(_fixSearchKey(key), _fixPage(page), \"account\", \"ip\");\n\t\tpager.setUrl(_base() + \"/login/search\");\n\t\tpager.addParas(\"key\", key);\n\t\tmodel.addAttribute(\"obj\", Result.success().addData(\"pager\", pager).setTitle(\" \u767b\u5f55\u65e5\u5fd7\u5217\u8868\"));\n\t\treturn \"pages/log/login/list\";\n\t}\n\n}\n", "meta": {"content_hash": "df9921683263469faf05857387900681", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 129, "avg_line_length": 34.83673469387755, "alnum_prop": 0.7551259519625073, "repo_name": "Kerbores/spring-thunder", "id": "5e7f1b6c239cfc9c61ab48b1e68f6e67aa7a7765", "size": "1731", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spring-thunder/src/main/java/club/zhcs/thunder/controller/admin/log/LoginLogController.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "4136035"}, {"name": "CoffeeScript", "bytes": "83631"}, {"name": "HTML", "bytes": "1402832"}, {"name": "Java", "bytes": "157946"}, {"name": "JavaScript", "bytes": "18705408"}, {"name": "PHP", "bytes": "12187"}, {"name": "Shell", "bytes": "444"}]}} +{"text": "<?php\nclass ClassHelper\n{\n protected $origin;\n\n /** @var ReflectionClass */\n protected $target;\n\n /**\n * Creates and returns the wrapper.\n * Only objects are allowed to be passed, else an exception will be thrown.\n * Store the input object to the created wrapper.\n *\n * @param $object\n *\n * @return Helper\n */\n public static function instance($object)\n {\n if (!is_object($object)) {\n throw new \\InvalidArgumentException('Only objects are allowed to be passed to the helper.');\n }\n\n $response = new self();\n $response->origin = $object;\n $response->target = new ReflectionClass($object);\n return $response;\n }\n\n public function __get($name)\n {\n $property = $this->getProperty($name);\n $value = $property->getValue($this->origin);\n return $value;\n }\n\n public function __set($name, $value)\n {\n $property = $this->getProperty($name);\n $property->setValue($this->origin, $value);\n return true;\n }\n\n protected function getProperty($name)\n {\n if (!$this->target->hasProperty($name)) {\n $message = sprintf('Property not found on object %s.', get_class($this->origin));\n throw new OutOfBoundsException($message);\n }\n\n /** @var ReflectionProperty $property */\n $property = $this->target->getProperty($name);\n $property->setAccessible(true);\n\n return $property;\n }\n\n public function call($name, array $args = [])\n {\n if (!$this->target->hasMethod($name)) {\n $message = sprintf('Method not found on object %s.', get_class($this->origin));\n throw new BadMethodCallException($message);\n }\n\n $method = $this->target->getMethod($name);\n $method->setAccessible(true);\n $response = $method->invokeArgs($this->origin, $args);\n\n return $response;\n }\n}\n", "meta": {"content_hash": "355cce27bc3a0de459312cc06660848c", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 104, "avg_line_length": 27.380281690140844, "alnum_prop": 0.5720164609053497, "repo_name": "bogdananton/php-class-helper", "id": "cc9796b16242c263b39450bc72da0e6205c12628", "size": "1944", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ClassHelper.php", "mode": "33188", "license": "mit", "language": [{"name": "PHP", "bytes": "8106"}]}} +{"text": "'use strict';\n\nif (process.platform === 'darwin') {\n\tmodule.exports = require('./lib/osx');\n\tmodule.exports.sync = require('./lib/osx').sync;\n} else if (process.platform === 'win32') {\n\tmodule.exports = require('./lib/win');\n\tmodule.exports.sync = require('./lib/win').sync;\n} else {\n\tmodule.exports = require('./lib/linux');\n\tmodule.exports.sync = require('./lib/linux').sync;\n}\n", "meta": {"content_hash": "118d8353fb769b5443149d540d33898c", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 51, "avg_line_length": 31.666666666666668, "alnum_prop": 0.6473684210526316, "repo_name": "kevva/wifi-name", "id": "5052fd83072d797bf2c203ec5708d695982293e2", "size": "380", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "2717"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc (version 1.7.0_72) on Wed May 13 11:47:39 EDT 2015 -->\n<title>UntypedResultSet.Row (apache-cassandra API)</title>\n<meta name=\"date\" content=\"2015-05-13\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"UntypedResultSet.Row (apache-cassandra API)\";\n }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!-- -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"class-use/UntypedResultSet.Row.html\">Use</a></li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.html\" title=\"class in org.apache.cassandra.cql3\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../../org/apache/cassandra/cql3/UpdateParameters.html\" title=\"class in org.apache.cassandra.cql3\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../index.html?org/apache/cassandra/cql3/UntypedResultSet.Row.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"UntypedResultSet.Row.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary: </li>\n<li>Nested | </li>\n<li>Field | </li>\n<li><a href=\"#constructor_summary\">Constr</a> | </li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail: </li>\n<li>Field | </li>\n<li><a href=\"#constructor_detail\">Constr</a> | </li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.apache.cassandra.cql3</div>\n<h2 title=\"Class UntypedResultSet.Row\" class=\"title\">Class UntypedResultSet.Row</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li>java.lang.Object</li>\n<li>\n<ul class=\"inheritance\">\n<li>org.apache.cassandra.cql3.UntypedResultSet.Row</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<dl>\n<dt>Enclosing class:</dt>\n<dd><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.html\" title=\"class in org.apache.cassandra.cql3\">UntypedResultSet</a></dd>\n</dl>\n<hr>\n<br>\n<pre>public static class <span class=\"strong\">UntypedResultSet.Row</span>\nextends java.lang.Object</pre>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_summary\">\n<!-- -->\n</a>\n<h3>Constructor Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constructor Summary table, listing constructors, and an explanation\">\n<caption><span>Constructors</span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Constructor and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#UntypedResultSet.Row(java.util.List,%20java.util.List)\">UntypedResultSet.Row</a></strong>(java.util.List<<a href=\"../../../../org/apache/cassandra/cql3/ColumnSpecification.html\" title=\"class in org.apache.cassandra.cql3\">ColumnSpecification</a>> names,\n java.util.List<java.nio.ByteBuffer> columns)</code> </td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#UntypedResultSet.Row(java.util.Map)\">UntypedResultSet.Row</a></strong>(java.util.Map<java.lang.String,java.nio.ByteBuffer> data)</code> </td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_summary\">\n<!-- -->\n</a>\n<h3>Method Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Method Summary table, listing methods, and an explanation\">\n<caption><span>Methods</span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getBoolean(java.lang.String)\">getBoolean</a></strong>(java.lang.String column)</code> </td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>java.nio.ByteBuffer</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getBytes(java.lang.String)\">getBytes</a></strong>(java.lang.String column)</code> </td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>java.util.List<<a href=\"../../../../org/apache/cassandra/cql3/ColumnSpecification.html\" title=\"class in org.apache.cassandra.cql3\">ColumnSpecification</a>></code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getColumns()\">getColumns</a></strong>()</code> </td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>double</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getDouble(java.lang.String)\">getDouble</a></strong>(java.lang.String column)</code> </td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>java.net.InetAddress</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getInetAddress(java.lang.String)\">getInetAddress</a></strong>(java.lang.String column)</code> </td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getInt(java.lang.String)\">getInt</a></strong>(java.lang.String column)</code> </td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code><T> java.util.List<T></code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getList(java.lang.String,%20org.apache.cassandra.db.marshal.AbstractType)\">getList</a></strong>(java.lang.String column,\n <a href=\"../../../../org/apache/cassandra/db/marshal/AbstractType.html\" title=\"class in org.apache.cassandra.db.marshal\">AbstractType</a><T> type)</code> </td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>long</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getLong(java.lang.String)\">getLong</a></strong>(java.lang.String column)</code> </td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code><K,V> java.util.Map<K,V></code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getMap(java.lang.String,%20org.apache.cassandra.db.marshal.AbstractType,%20org.apache.cassandra.db.marshal.AbstractType)\">getMap</a></strong>(java.lang.String column,\n <a href=\"../../../../org/apache/cassandra/db/marshal/AbstractType.html\" title=\"class in org.apache.cassandra.db.marshal\">AbstractType</a><K> keyType,\n <a href=\"../../../../org/apache/cassandra/db/marshal/AbstractType.html\" title=\"class in org.apache.cassandra.db.marshal\">AbstractType</a><V> valueType)</code> </td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code><T> java.util.Set<T></code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getSet(java.lang.String,%20org.apache.cassandra.db.marshal.AbstractType)\">getSet</a></strong>(java.lang.String column,\n <a href=\"../../../../org/apache/cassandra/db/marshal/AbstractType.html\" title=\"class in org.apache.cassandra.db.marshal\">AbstractType</a><T> type)</code> </td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>java.lang.String</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getString(java.lang.String)\">getString</a></strong>(java.lang.String column)</code> </td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>java.util.Date</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getTimestamp(java.lang.String)\">getTimestamp</a></strong>(java.lang.String column)</code> </td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>java.util.UUID</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#getUUID(java.lang.String)\">getUUID</a></strong>(java.lang.String column)</code> </td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#has(java.lang.String)\">has</a></strong>(java.lang.String column)</code> </td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>java.lang.String</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.Row.html#toString()\">toString</a></strong>()</code> </td>\n</tr>\n</table>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.lang.Object\">\n<!-- -->\n</a>\n<h3>Methods inherited from class java.lang.Object</h3>\n<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ========= CONSTRUCTOR DETAIL ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_detail\">\n<!-- -->\n</a>\n<h3>Constructor Detail</h3>\n<a name=\"UntypedResultSet.Row(java.util.Map)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>UntypedResultSet.Row</h4>\n<pre>public UntypedResultSet.Row(java.util.Map<java.lang.String,java.nio.ByteBuffer> data)</pre>\n</li>\n</ul>\n<a name=\"UntypedResultSet.Row(java.util.List, java.util.List)\">\n<!-- -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>UntypedResultSet.Row</h4>\n<pre>public UntypedResultSet.Row(java.util.List<<a href=\"../../../../org/apache/cassandra/cql3/ColumnSpecification.html\" title=\"class in org.apache.cassandra.cql3\">ColumnSpecification</a>> names,\n java.util.List<java.nio.ByteBuffer> columns)</pre>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ============ METHOD DETAIL ========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_detail\">\n<!-- -->\n</a>\n<h3>Method Detail</h3>\n<a name=\"has(java.lang.String)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>has</h4>\n<pre>public boolean has(java.lang.String column)</pre>\n</li>\n</ul>\n<a name=\"getString(java.lang.String)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getString</h4>\n<pre>public java.lang.String getString(java.lang.String column)</pre>\n</li>\n</ul>\n<a name=\"getBoolean(java.lang.String)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getBoolean</h4>\n<pre>public boolean getBoolean(java.lang.String column)</pre>\n</li>\n</ul>\n<a name=\"getInt(java.lang.String)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getInt</h4>\n<pre>public int getInt(java.lang.String column)</pre>\n</li>\n</ul>\n<a name=\"getDouble(java.lang.String)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getDouble</h4>\n<pre>public double getDouble(java.lang.String column)</pre>\n</li>\n</ul>\n<a name=\"getBytes(java.lang.String)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getBytes</h4>\n<pre>public java.nio.ByteBuffer getBytes(java.lang.String column)</pre>\n</li>\n</ul>\n<a name=\"getInetAddress(java.lang.String)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getInetAddress</h4>\n<pre>public java.net.InetAddress getInetAddress(java.lang.String column)</pre>\n</li>\n</ul>\n<a name=\"getUUID(java.lang.String)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getUUID</h4>\n<pre>public java.util.UUID getUUID(java.lang.String column)</pre>\n</li>\n</ul>\n<a name=\"getTimestamp(java.lang.String)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getTimestamp</h4>\n<pre>public java.util.Date getTimestamp(java.lang.String column)</pre>\n</li>\n</ul>\n<a name=\"getLong(java.lang.String)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getLong</h4>\n<pre>public long getLong(java.lang.String column)</pre>\n</li>\n</ul>\n<a name=\"getSet(java.lang.String, org.apache.cassandra.db.marshal.AbstractType)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getSet</h4>\n<pre>public <T> java.util.Set<T> getSet(java.lang.String column,\n <a href=\"../../../../org/apache/cassandra/db/marshal/AbstractType.html\" title=\"class in org.apache.cassandra.db.marshal\">AbstractType</a><T> type)</pre>\n</li>\n</ul>\n<a name=\"getList(java.lang.String, org.apache.cassandra.db.marshal.AbstractType)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getList</h4>\n<pre>public <T> java.util.List<T> getList(java.lang.String column,\n <a href=\"../../../../org/apache/cassandra/db/marshal/AbstractType.html\" title=\"class in org.apache.cassandra.db.marshal\">AbstractType</a><T> type)</pre>\n</li>\n</ul>\n<a name=\"getMap(java.lang.String, org.apache.cassandra.db.marshal.AbstractType, org.apache.cassandra.db.marshal.AbstractType)\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getMap</h4>\n<pre>public <K,V> java.util.Map<K,V> getMap(java.lang.String column,\n <a href=\"../../../../org/apache/cassandra/db/marshal/AbstractType.html\" title=\"class in org.apache.cassandra.db.marshal\">AbstractType</a><K> keyType,\n <a href=\"../../../../org/apache/cassandra/db/marshal/AbstractType.html\" title=\"class in org.apache.cassandra.db.marshal\">AbstractType</a><V> valueType)</pre>\n</li>\n</ul>\n<a name=\"getColumns()\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getColumns</h4>\n<pre>public java.util.List<<a href=\"../../../../org/apache/cassandra/cql3/ColumnSpecification.html\" title=\"class in org.apache.cassandra.cql3\">ColumnSpecification</a>> getColumns()</pre>\n</li>\n</ul>\n<a name=\"toString()\">\n<!-- -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>toString</h4>\n<pre>public java.lang.String toString()</pre>\n<dl>\n<dt><strong>Overrides:</strong></dt>\n<dd><code>toString</code> in class <code>java.lang.Object</code></dd>\n</dl>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!-- -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"class-use/UntypedResultSet.Row.html\">Use</a></li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../../org/apache/cassandra/cql3/UntypedResultSet.html\" title=\"class in org.apache.cassandra.cql3\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../../org/apache/cassandra/cql3/UpdateParameters.html\" title=\"class in org.apache.cassandra.cql3\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../index.html?org/apache/cassandra/cql3/UntypedResultSet.Row.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"UntypedResultSet.Row.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary: </li>\n<li>Nested | </li>\n<li>Field | </li>\n<li><a href=\"#constructor_summary\">Constr</a> | </li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail: </li>\n<li>Field | </li>\n<li><a href=\"#constructor_detail\">Constr</a> | </li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n<p class=\"legalCopy\"><small>Copyright © 2015 The Apache Software Foundation</small></p>\n</body>\n</html>\n", "meta": {"content_hash": "ddfb199bf005eb9a6ee375accbe38991", "timestamp": "", "source": "github", "line_count": 469, "max_line_length": 369, "avg_line_length": 40.61620469083156, "alnum_prop": 0.660979578980524, "repo_name": "anuragkapur/cassandra-2.1.2-ak-skynet", "id": "8975ec467a0c2750dfff936bb29ea8033dbbcde8", "size": "19049", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "apache-cassandra-2.0.15/javadoc/org/apache/cassandra/cql3/UntypedResultSet.Row.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "59670"}, {"name": "PowerShell", "bytes": "37758"}, {"name": "Python", "bytes": "622552"}, {"name": "Shell", "bytes": "100474"}, {"name": "Thrift", "bytes": "78926"}]}} +{"text": "package com.orientechnologies.orient.server.distributed;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertTrue;\n\nimport com.orientechnologies.orient.core.config.OGlobalConfiguration;\nimport com.orientechnologies.orient.core.db.ODatabaseSession;\nimport com.orientechnologies.orient.core.db.OrientDB;\nimport com.orientechnologies.orient.core.db.OrientDBConfig;\nimport com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;\nimport com.orientechnologies.orient.core.metadata.schema.OClass;\nimport com.orientechnologies.orient.core.record.OVertex;\nimport com.orientechnologies.orient.core.sql.executor.OResult;\nimport com.orientechnologies.orient.core.sql.executor.OResultSet;\nimport com.orientechnologies.orient.setup.SetupConfig;\nimport com.orientechnologies.orient.setup.TestSetup;\nimport com.orientechnologies.orient.setup.TestSetupUtil;\nimport com.orientechnologies.orient.setup.configs.SimpleDServerConfig;\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\n\npublic class SimpleQueryDistributedIT {\n\n private TestSetup setup;\n private SetupConfig config;\n private String server0, server1, server2;\n\n private OrientDB remote;\n private ODatabaseSession session;\n\n @Before\n public void before() throws Exception {\n config = new SimpleDServerConfig();\n server0 = SimpleDServerConfig.SERVER0;\n server1 = SimpleDServerConfig.SERVER1;\n server2 = SimpleDServerConfig.SERVER2;\n setup = TestSetupUtil.create(config);\n setup.setup();\n\n remote = setup.createRemote(server0, \"root\", \"test\", OrientDBConfig.defaultConfig());\n remote.execute(\n \"create database ? plocal users(admin identified by 'admin' role admin)\", \"test\");\n session = remote.open(\"test\", \"admin\", \"admin\");\n }\n\n @Test\n public void test() {\n OVertex vertex = session.newVertex(\"V\");\n vertex.setProperty(\"name\", \"one\");\n session.save(vertex);\n\n // Query with SQL\n OResultSet res = session.query(\"select from V\");\n assertTrue(res.hasNext());\n assertEquals(res.next().getProperty(\"name\"), \"one\");\n\n // Query with script\n res = session.execute(\"sql\", \"select from V\");\n assertTrue(res.hasNext());\n assertEquals(res.next().getProperty(\"name\"), \"one\");\n\n // Query order by\n OClass v2 = session.createVertexClass(\"V2\");\n int records = (OGlobalConfiguration.QUERY_REMOTE_RESULTSET_PAGE_SIZE.getValueAsInteger() + 10);\n for (int i = 0; i < records; i++) {\n vertex = session.newVertex(\"V2\");\n vertex.setProperty(\"name\", \"one\");\n vertex.setProperty(\"pos\", i);\n session.save(vertex);\n }\n\n res = session.query(\"select from V2 order by pos\");\n for (int i = 0; i < records; i++) {\n assertTrue(res.hasNext());\n OResult ele = res.next();\n assertEquals((int) ele.getProperty(\"pos\"), i);\n assertEquals(ele.getProperty(\"name\"), \"one\");\n }\n }\n\n @After\n public void after() throws InterruptedException {\n System.out.println(\"Tearing down test setup.\");\n try {\n if (remote != null) {\n remote.drop(\"test\");\n remote.close();\n }\n } finally {\n setup.teardown();\n ODatabaseDocumentTx.closeAll();\n }\n }\n}\n", "meta": {"content_hash": "cb9f578fcbbed6ae08f8256a46d1f433", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 99, "avg_line_length": 33.56842105263158, "alnum_prop": 0.7118218877391032, "repo_name": "orientechnologies/orientdb", "id": "b700fbd44b868ed811e4a17f226b1c64c41391fc", "size": "3189", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "distributed/src/test/java/com/orientechnologies/orient/server/distributed/SimpleQueryDistributedIT.java", "mode": "33261", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "19302"}, {"name": "Dockerfile", "bytes": "705"}, {"name": "Gnuplot", "bytes": "1245"}, {"name": "Groovy", "bytes": "7913"}, {"name": "HTML", "bytes": "5750"}, {"name": "Java", "bytes": "26588383"}, {"name": "JavaScript", "bytes": "259"}, {"name": "PLpgSQL", "bytes": "54881"}, {"name": "Shell", "bytes": "33650"}]}} +{"text": "\npackage org.thymeleaf.spring6.processor;\n\nimport org.springframework.util.StringUtils;\nimport org.thymeleaf.context.ITemplateContext;\nimport org.thymeleaf.engine.AttributeDefinition;\nimport org.thymeleaf.engine.AttributeDefinitions;\nimport org.thymeleaf.engine.AttributeName;\nimport org.thymeleaf.engine.IAttributeDefinitionsAware;\nimport org.thymeleaf.exceptions.TemplateProcessingException;\nimport org.thymeleaf.model.IProcessableElementTag;\nimport org.thymeleaf.processor.element.AbstractAttributeTagProcessor;\nimport org.thymeleaf.processor.element.IElementTagStructureHandler;\nimport org.thymeleaf.spring6.context.IThymeleafBindStatus;\nimport org.thymeleaf.spring6.naming.SpringContextVariableNames;\nimport org.thymeleaf.spring6.util.FieldUtils;\nimport org.thymeleaf.templatemode.TemplateMode;\nimport org.thymeleaf.util.Validate;\n\n/**\n * Binds an input property with the value in the form's backing bean.\n * <p>\n * Values for {@code th:field} attributes must be selection expressions\n * {@code (*{...})}, as they will be evaluated on the form backing bean and not\n * on the context variables (model attributes in Spring MVC jargon).\n *\n * @author Daniel Fernández\n * @since 3.0.3\n */\npublic abstract class AbstractSpringFieldTagProcessor\n extends AbstractAttributeTagProcessor\n implements IAttributeDefinitionsAware {\n\n\n public static final int ATTR_PRECEDENCE = 1700;\n public static final String ATTR_NAME = \"field\";\n\n private static final TemplateMode TEMPLATE_MODE = TemplateMode.HTML;\n\n protected static final String INPUT_TAG_NAME = \"input\";\n protected static final String SELECT_TAG_NAME = \"select\";\n protected static final String OPTION_TAG_NAME = \"option\";\n protected static final String TEXTAREA_TAG_NAME = \"textarea\";\n\n protected static final String ID_ATTR_NAME = \"id\";\n protected static final String TYPE_ATTR_NAME = \"type\";\n protected static final String NAME_ATTR_NAME = \"name\";\n protected static final String VALUE_ATTR_NAME = \"value\";\n protected static final String CHECKED_ATTR_NAME = \"checked\";\n protected static final String SELECTED_ATTR_NAME = \"selected\";\n protected static final String DISABLED_ATTR_NAME = \"disabled\";\n protected static final String MULTIPLE_ATTR_NAME = \"multiple\";\n\n private AttributeDefinition discriminatorAttributeDefinition;\n protected AttributeDefinition idAttributeDefinition;\n protected AttributeDefinition typeAttributeDefinition;\n protected AttributeDefinition nameAttributeDefinition;\n protected AttributeDefinition valueAttributeDefinition;\n protected AttributeDefinition checkedAttributeDefinition;\n protected AttributeDefinition selectedAttributeDefinition;\n protected AttributeDefinition disabledAttributeDefinition;\n protected AttributeDefinition multipleAttributeDefinition;\n\n\n\n\n\n private final String discriminatorAttrName;\n private final String[] discriminatorAttrValues;\n private final boolean removeAttribute;\n\n\n public AbstractSpringFieldTagProcessor(\n final String dialectPrefix, final String elementName,\n final String discriminatorAttrName, final String[] discriminatorAttrValues,\n final boolean removeAttribute) {\n super(TEMPLATE_MODE, dialectPrefix, elementName, false, ATTR_NAME, true, ATTR_PRECEDENCE, false);\n this.discriminatorAttrName = discriminatorAttrName;\n this.discriminatorAttrValues = discriminatorAttrValues;\n this.removeAttribute = removeAttribute;\n }\n\n\n\n\n public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) {\n Validate.notNull(attributeDefinitions, \"Attribute Definitions cannot be null\");\n // We precompute the AttributeDefinitions in order to being able to use much\n // faster methods for setting/replacing attributes on the ElementAttributes implementation\n this.discriminatorAttributeDefinition =\n (this.discriminatorAttrName != null? attributeDefinitions.forName(TEMPLATE_MODE, this.discriminatorAttrName) : null);\n this.idAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, ID_ATTR_NAME);\n this.typeAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, TYPE_ATTR_NAME);\n this.nameAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, NAME_ATTR_NAME);\n this.valueAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, VALUE_ATTR_NAME);\n this.checkedAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, CHECKED_ATTR_NAME);\n this.selectedAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, SELECTED_ATTR_NAME);\n this.disabledAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, DISABLED_ATTR_NAME);\n this.multipleAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, MULTIPLE_ATTR_NAME);\n }\n\n\n\n\n private boolean matchesDiscriminator(final IProcessableElementTag tag) {\n\n if (this.discriminatorAttrName == null) {\n return true;\n }\n final boolean hasDiscriminatorAttr = tag.hasAttribute(this.discriminatorAttributeDefinition.getAttributeName());\n if (this.discriminatorAttrValues == null || this.discriminatorAttrValues.length == 0) {\n return hasDiscriminatorAttr;\n }\n final String discriminatorTagValue =\n (hasDiscriminatorAttr? tag.getAttributeValue(this.discriminatorAttributeDefinition.getAttributeName()) : null);\n for (int i = 0; i < this.discriminatorAttrValues.length; i++) {\n final String discriminatorAttrValue = this.discriminatorAttrValues[i];\n if (discriminatorAttrValue == null) {\n if (!hasDiscriminatorAttr || discriminatorTagValue == null) {\n return true;\n }\n } else if (discriminatorAttrValue.equals(discriminatorTagValue)) {\n return true;\n }\n }\n return false;\n\n }\n\n\n\n @Override\n protected void doProcess(\n final ITemplateContext context,\n final IProcessableElementTag tag,\n final AttributeName attributeName, final String attributeValue,\n final IElementTagStructureHandler structureHandler) {\n\n /*\n * First thing to check is whether this processor really matches, because so far we have asked the engine only\n * to match per attribute (th:field) and host tag (input, select, option...) but we still don't know if the\n * match is complete because we might still need to assess for example that the 'type' attribute has the\n * correct value. For example, the same processor will not be executing on <input type=\"text\" th:field=\"*{a}\"/>\n * and on <input type=\"checkbox\" th:field=\"*{a}\"/>\n */\n if (!matchesDiscriminator(tag)) {\n // Note in this case we do not have to remove the th:field attribute because the correct processor is still\n // to be executed!\n return;\n }\n\n if (this.removeAttribute) {\n structureHandler.removeAttribute(attributeName);\n }\n\n final IThymeleafBindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue);\n\n if (bindStatus == null) {\n throw new TemplateProcessingException(\n \"Cannot process attribute '\" + attributeName + \"': no associated BindStatus could be found for \" +\n \"the intended form binding operations. This can be due to the lack of a proper management of the \" +\n \"Spring RequestContext, which is usually done through the ThymeleafView or ThymeleafReactiveView\");\n }\n\n // We set the BindStatus into a local variable just in case we have more BindStatus-related processors to\n // be applied for the same tag, like for example a th:errorclass\n structureHandler.setLocalVariable(SpringContextVariableNames.THYMELEAF_FIELD_BIND_STATUS, bindStatus);\n\n doProcess(context, tag, attributeName, attributeValue, bindStatus, structureHandler);\n\n }\n\n\n\n\n protected abstract void doProcess(\n final ITemplateContext context,\n final IProcessableElementTag tag,\n final AttributeName attributeName,\n final String attributeValue,\n final IThymeleafBindStatus bindStatus,\n final IElementTagStructureHandler structureHandler);\n\n\n\n\n\n // This method is designed to be called from the diverse subclasses\n protected final String computeId(\n final ITemplateContext context,\n final IProcessableElementTag tag,\n final String name, final boolean sequence) {\n\n String id = tag.getAttributeValue(this.idAttributeDefinition.getAttributeName());\n if (!org.thymeleaf.util.StringUtils.isEmptyOrWhitespace(id)) {\n return (StringUtils.hasText(id) ? id : null);\n }\n\n id = FieldUtils.idFromName(name);\n if (sequence) {\n final Integer count = context.getIdentifierSequences().getAndIncrementIDSeq(id);\n return id + count.toString();\n }\n return id;\n\n }\n\n\n\n\n}\n", "meta": {"content_hash": "e583ddbb00545fad6c919b83b65d762a", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 133, "avg_line_length": 43.5260663507109, "alnum_prop": 0.7192944250871081, "repo_name": "thymeleaf/thymeleaf-spring", "id": "8ab55cd158f10b42c25bcdbda2c2cd664f5cc721", "size": "10010", "binary": false, "copies": "2", "ref": "refs/heads/3.1-master", "path": "thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/AbstractSpringFieldTagProcessor.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "1170794"}]}} +{"text": "\n\npackage org.apache.zookeeper.server;\n\nimport java.io.BufferedWriter;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.io.Writer;\nimport java.net.InetAddress;\nimport java.net.InetSocketAddress;\nimport java.nio.ByteBuffer;\nimport java.nio.channels.CancelledKeyException;\nimport java.nio.channels.SelectionKey;\nimport java.nio.channels.SocketChannel;\nimport java.security.cert.Certificate;\nimport java.util.Queue;\nimport java.util.concurrent.LinkedBlockingQueue;\nimport java.util.concurrent.atomic.AtomicBoolean;\nimport java.util.concurrent.atomic.AtomicInteger;\n\nimport org.apache.jute.BinaryInputArchive;\nimport org.apache.jute.BinaryOutputArchive;\nimport org.apache.jute.Record;\nimport org.apache.zookeeper.WatchedEvent;\nimport org.apache.zookeeper.data.Id;\nimport org.apache.zookeeper.proto.ReplyHeader;\nimport org.apache.zookeeper.proto.RequestHeader;\nimport org.apache.zookeeper.proto.WatcherEvent;\nimport org.apache.zookeeper.server.NIOServerCnxnFactory.SelectorThread;\nimport org.apache.zookeeper.server.command.CommandExecutor;\nimport org.apache.zookeeper.server.command.FourLetterCommands;\nimport org.apache.zookeeper.server.command.SetTraceMaskCommand;\nimport org.apache.zookeeper.server.command.NopCommand;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n/**\n * This class handles communication with clients using NIO. There is one per\n * client, but only one thread doing the communication.\n */\npublic class NIOServerCnxn extends ServerCnxn {\n private static final Logger LOG = LoggerFactory.getLogger(NIOServerCnxn.class);\n\n private final NIOServerCnxnFactory factory;\n\n private final SocketChannel sock;\n\n private final SelectorThread selectorThread;\n\n private final SelectionKey sk;\n\n private boolean initialized;\n\n private final ByteBuffer lenBuffer = ByteBuffer.allocate(4);\n\n private ByteBuffer incomingBuffer = lenBuffer;\n\n private final Queue<ByteBuffer> outgoingBuffers =\n new LinkedBlockingQueue<ByteBuffer>();\n\n private int sessionTimeout;\n\n private final ZooKeeperServer zkServer;\n\n /**\n * The number of requests that have been submitted but not yet responded to.\n */\n private final AtomicInteger outstandingRequests = new AtomicInteger(0);\n\n /**\n * This is the id that uniquely identifies the session of a client. Once\n * this session is no longer active, the ephemeral nodes will go away.\n */\n private long sessionId;\n\n private final int outstandingLimit;\n\n public NIOServerCnxn(ZooKeeperServer zk, SocketChannel sock,\n SelectionKey sk, NIOServerCnxnFactory factory,\n SelectorThread selectorThread) throws IOException {\n this.zkServer = zk;\n this.sock = sock;\n this.sk = sk;\n this.factory = factory;\n this.selectorThread = selectorThread;\n if (this.factory.login != null) {\n this.zooKeeperSaslServer = new ZooKeeperSaslServer(factory.login);\n }\n if (zk != null) {\n outstandingLimit = zk.getGlobalOutstandingLimit();\n } else {\n outstandingLimit = 1;\n }\n sock.socket().setTcpNoDelay(true);\n /* set socket linger to false, so that socket close does not block */\n sock.socket().setSoLinger(false, -1);\n InetAddress addr = ((InetSocketAddress) sock.socket()\n .getRemoteSocketAddress()).getAddress();\n addAuthInfo(new Id(\"ip\", addr.getHostAddress()));\n this.sessionTimeout = factory.sessionlessCnxnTimeout;\n }\n\n /* Send close connection packet to the client, doIO will eventually\n * close the underlying machinery (like socket, selectorkey, etc...)\n */\n public void sendCloseSession() {\n sendBuffer(ServerCnxnFactory.closeConn);\n }\n\n /**\n * send buffer without using the asynchronous\n * calls to selector and then close the socket\n * @param bb\n */\n void sendBufferSync(ByteBuffer bb) {\n try {\n /* configure socket to be blocking\n * so that we dont have to do write in\n * a tight while loop\n */\n if (bb != ServerCnxnFactory.closeConn) {\n if (sock.isOpen()) {\n sock.configureBlocking(true);\n sock.write(bb);\n }\n packetSent();\n }\n } catch (IOException ie) {\n LOG.error(\"Error sending data synchronously \", ie);\n }\n }\n\n /**\n * sendBuffer pushes a byte buffer onto the outgoing buffer queue for\n * asynchronous writes.\n */\n public void sendBuffer(ByteBuffer bb) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(\"Add a buffer to outgoingBuffers, sk \" + sk\n + \" is valid: \" + sk.isValid());\n }\n outgoingBuffers.add(bb);\n requestInterestOpsUpdate();\n }\n\n /** Read the request payload (everything following the length prefix) */\n private void readPayload() throws IOException, InterruptedException {\n if (incomingBuffer.remaining() != 0) { // have we read length bytes?\n int rc = sock.read(incomingBuffer); // sock is non-blocking, so ok\n if (rc < 0) {\n throw new EndOfStreamException(\n \"Unable to read additional data from client sessionid 0x\"\n + Long.toHexString(sessionId)\n + \", likely client has closed socket\");\n }\n }\n\n if (incomingBuffer.remaining() == 0) { // have we read length bytes?\n packetReceived();\n incomingBuffer.flip();\n if (!initialized) {\n readConnectRequest();\n } else {\n readRequest();\n }\n lenBuffer.clear();\n incomingBuffer = lenBuffer;\n }\n }\n\n /**\n * This boolean tracks whether the connection is ready for selection or\n * not. A connection is marked as not ready for selection while it is\n * processing an IO request. The flag is used to gatekeep pushing interest\n * op updates onto the selector.\n */\n private final AtomicBoolean selectable = new AtomicBoolean(true);\n\n public boolean isSelectable() {\n return sk.isValid() && selectable.get();\n }\n\n public void disableSelectable() {\n selectable.set(false);\n }\n\n public void enableSelectable() {\n selectable.set(true);\n }\n\n private void requestInterestOpsUpdate() {\n if (isSelectable()) {\n selectorThread.addInterestOpsUpdateRequest(sk);\n }\n }\n\n void handleWrite(SelectionKey k) throws IOException, CloseRequestException {\n if (outgoingBuffers.isEmpty()) {\n return;\n }\n\n /*\n * This is going to reset the buffer position to 0 and the\n * limit to the size of the buffer, so that we can fill it\n * with data from the non-direct buffers that we need to\n * send.\n */\n ByteBuffer directBuffer = NIOServerCnxnFactory.getDirectBuffer();\n if (directBuffer == null) {\n ByteBuffer[] bufferList = new ByteBuffer[outgoingBuffers.size()];\n // Use gathered write call. This updates the positions of the\n // byte buffers to reflect the bytes that were written out.\n sock.write(outgoingBuffers.toArray(bufferList));\n\n // Remove the buffers that we have sent\n ByteBuffer bb;\n while ((bb = outgoingBuffers.peek()) != null) {\n if (bb == ServerCnxnFactory.closeConn) {\n throw new CloseRequestException(\"close requested\");\n }\n if (bb.remaining() > 0) {\n break;\n }\n packetSent();\n outgoingBuffers.remove();\n }\n } else {\n directBuffer.clear();\n\n for (ByteBuffer b : outgoingBuffers) {\n if (directBuffer.remaining() < b.remaining()) {\n /*\n * When we call put later, if the directBuffer is to\n * small to hold everything, nothing will be copied,\n * so we've got to slice the buffer if it's too big.\n */\n b = (ByteBuffer) b.slice().limit(\n directBuffer.remaining());\n }\n /*\n * put() is going to modify the positions of both\n * buffers, put we don't want to change the position of\n * the source buffers (we'll do that after the send, if\n * needed), so we save and reset the position after the\n * copy\n */\n int p = b.position();\n directBuffer.put(b);\n b.position(p);\n if (directBuffer.remaining() == 0) {\n break;\n }\n }\n /*\n * Do the flip: limit becomes position, position gets set to\n * 0. This sets us up for the write.\n */\n directBuffer.flip();\n\n int sent = sock.write(directBuffer);\n\n ByteBuffer bb;\n\n // Remove the buffers that we have sent\n while ((bb = outgoingBuffers.peek()) != null) {\n if (bb == ServerCnxnFactory.closeConn) {\n throw new CloseRequestException(\"close requested\");\n }\n if (sent < bb.remaining()) {\n /*\n * We only partially sent this buffer, so we update\n * the position and exit the loop.\n */\n bb.position(bb.position() + sent);\n break;\n }\n packetSent();\n /* We've sent the whole buffer, so drop the buffer */\n sent -= bb.remaining();\n outgoingBuffers.remove();\n }\n }\n }\n\n /**\n * Only used in order to allow testing\n */\n protected boolean isSocketOpen() {\n return sock.isOpen();\n }\n\n /**\n * Handles read/write IO on connection.\n */\n void doIO(SelectionKey k) throws InterruptedException {\n try {\n if (isSocketOpen() == false) {\n LOG.warn(\"trying to do i/o on a null socket for session:0x\"\n + Long.toHexString(sessionId));\n\n return;\n }\n if (k.isReadable()) {\n int rc = sock.read(incomingBuffer);\n if (rc < 0) {\n throw new EndOfStreamException(\n \"Unable to read additional data from client sessionid 0x\"\n + Long.toHexString(sessionId)\n + \", likely client has closed socket\");\n }\n if (incomingBuffer.remaining() == 0) {\n boolean isPayload;\n if (incomingBuffer == lenBuffer) { // start of next request\n incomingBuffer.flip();\n isPayload = readLength(k);\n incomingBuffer.clear();\n } else {\n // continuation\n isPayload = true;\n }\n if (isPayload) { // not the case for 4letterword\n readPayload();\n }\n else {\n // four letter words take care\n // need not do anything else\n return;\n }\n }\n }\n if (k.isWritable()) {\n handleWrite(k);\n\n if (!initialized && !getReadInterest() && !getWriteInterest()) {\n throw new CloseRequestException(\"responded to info probe\");\n }\n }\n } catch (CancelledKeyException e) {\n LOG.warn(\"CancelledKeyException causing close of session 0x\"\n + Long.toHexString(sessionId));\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"CancelledKeyException stack trace\", e);\n }\n close();\n } catch (CloseRequestException e) {\n // expecting close to log session closure\n close();\n } catch (EndOfStreamException e) {\n LOG.warn(e.getMessage());\n // expecting close to log session closure\n close();\n } catch (IOException e) {\n LOG.warn(\"Exception causing close of session 0x\"\n + Long.toHexString(sessionId) + \": \" + e.getMessage());\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"IOException stack trace\", e);\n }\n close();\n }\n }\n\n private void readRequest() throws IOException {\n zkServer.processPacket(this, incomingBuffer);\n }\n\n // Only called as callback from zkServer.processPacket()\n protected void incrOutstandingRequests(RequestHeader h) {\n if (h.getXid() >= 0) {\n outstandingRequests.incrementAndGet();\n // check throttling\n int inProcess = zkServer.getInProcess();\n if (inProcess > outstandingLimit) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Throttling recv \" + inProcess);\n }\n disableRecv();\n }\n }\n }\n\n // returns whether we are interested in writing, which is determined\n // by whether we have any pending buffers on the output queue or not\n private boolean getWriteInterest() {\n return !outgoingBuffers.isEmpty();\n }\n\n // returns whether we are interested in taking new requests, which is\n // determined by whether we are currently throttled or not\n private boolean getReadInterest() {\n return !throttled.get();\n }\n\n private final AtomicBoolean throttled = new AtomicBoolean(false);\n\n // Throttle acceptance of new requests. If this entailed a state change,\n // register an interest op update request with the selector.\n public void disableRecv() {\n if (throttled.compareAndSet(false, true)) {\n requestInterestOpsUpdate();\n }\n }\n\n // Disable throttling and resume acceptance of new requests. If this\n // entailed a state change, register an interest op update request with\n // the selector.\n public void enableRecv() {\n if (throttled.compareAndSet(true, false)) {\n requestInterestOpsUpdate();\n }\n }\n\n private void readConnectRequest() throws IOException, InterruptedException {\n if (!isZKServerRunning()) {\n throw new IOException(\"ZooKeeperServer not running\");\n }\n zkServer.processConnectRequest(this, incomingBuffer);\n initialized = true;\n }\n\n /**\n * This class wraps the sendBuffer method of NIOServerCnxn. It is\n * responsible for chunking up the response to a client. Rather\n * than cons'ing up a response fully in memory, which may be large\n * for some commands, this class chunks up the result.\n */\n private class SendBufferWriter extends Writer {\n private StringBuffer sb = new StringBuffer();\n\n /**\n * Check if we are ready to send another chunk.\n * @param force force sending, even if not a full chunk\n */\n private void checkFlush(boolean force) {\n if ((force && sb.length() > 0) || sb.length() > 2048) {\n sendBufferSync(ByteBuffer.wrap(sb.toString().getBytes()));\n // clear our internal buffer\n sb.setLength(0);\n }\n }\n\n @Override\n public void close() throws IOException {\n if (sb == null) return;\n checkFlush(true);\n sb = null; // clear out the ref to ensure no reuse\n }\n\n @Override\n public void flush() throws IOException {\n checkFlush(true);\n }\n\n @Override\n public void write(char[] cbuf, int off, int len) throws IOException {\n sb.append(cbuf, off, len);\n checkFlush(false);\n }\n }\n /** Return if four letter word found and responded to, otw false **/\n private boolean checkFourLetterWord(final SelectionKey k, final int len)\n throws IOException\n {\n // We take advantage of the limited size of the length to look\n // for cmds. They are all 4-bytes which fits inside of an int\n if (!FourLetterCommands.isKnown(len)) {\n return false;\n }\n\n String cmd = FourLetterCommands.getCommandString(len);\n packetReceived();\n\n /** cancel the selection key to remove the socket handling\n * from selector. This is to prevent netcat problem wherein\n * netcat immediately closes the sending side after sending the\n * commands and still keeps the receiving channel open.\n * The idea is to remove the selectionkey from the selector\n * so that the selector does not notice the closed read on the\n * socket channel and keep the socket alive to write the data to\n * and makes sure to close the socket after its done writing the data\n */\n if (k != null) {\n try {\n k.cancel();\n } catch(Exception e) {\n LOG.error(\"Error cancelling command selection key \", e);\n }\n }\n\n final PrintWriter pwriter = new PrintWriter(\n new BufferedWriter(new SendBufferWriter()));\n\n // ZOOKEEPER-2693: don't execute 4lw if it's not enabled.\n if (!FourLetterCommands.isEnabled(cmd)) {\n LOG.debug(\"Command {} is not executed because it is not in the whitelist.\", cmd);\n NopCommand nopCmd = new NopCommand(pwriter, this, cmd +\n \" is not executed because it is not in the whitelist.\");\n nopCmd.start();\n return true;\n }\n\n LOG.info(\"Processing \" + cmd + \" command from \"\n + sock.socket().getRemoteSocketAddress());\n\n if (len == FourLetterCommands.setTraceMaskCmd) {\n incomingBuffer = ByteBuffer.allocate(8);\n int rc = sock.read(incomingBuffer);\n if (rc < 0) {\n throw new IOException(\"Read error\");\n }\n incomingBuffer.flip();\n long traceMask = incomingBuffer.getLong();\n ZooTrace.setTextTraceLevel(traceMask);\n SetTraceMaskCommand setMask = new SetTraceMaskCommand(pwriter, this, traceMask);\n setMask.start();\n return true;\n } else {\n CommandExecutor commandExecutor = new CommandExecutor();\n return commandExecutor.execute(this, pwriter, len, zkServer, factory);\n }\n }\n\n /** Reads the first 4 bytes of lenBuffer, which could be true length or\n * four letter word.\n *\n * @param k selection key\n * @return true if length read, otw false (wasn't really the length)\n * @throws IOException if buffer size exceeds maxBuffer size\n */\n private boolean readLength(SelectionKey k) throws IOException {\n // Read the length, now get the buffer\n int len = lenBuffer.getInt();\n if (!initialized && checkFourLetterWord(sk, len)) {\n return false;\n }\n if (len < 0 || len > BinaryInputArchive.maxBuffer) {\n throw new IOException(\"Len error \" + len);\n }\n if (!isZKServerRunning()) {\n throw new IOException(\"ZooKeeperServer not running\");\n }\n incomingBuffer = ByteBuffer.allocate(len);\n return true;\n }\n\n /**\n * @return true if the server is running, false otherwise.\n */\n boolean isZKServerRunning() {\n return zkServer != null && zkServer.isRunning();\n }\n\n public long getOutstandingRequests() {\n return outstandingRequests.get();\n }\n\n /*\n * (non-Javadoc)\n *\n * @see org.apache.zookeeper.server.ServerCnxnIface#getSessionTimeout()\n */\n public int getSessionTimeout() {\n return sessionTimeout;\n }\n\n /**\n * Used by \"dump\" 4-letter command to list all connection in\n * cnxnExpiryMap\n */\n @Override\n public String toString() {\n return \"ip: \" + sock.socket().getRemoteSocketAddress() +\n \" sessionId: 0x\" + Long.toHexString(sessionId);\n }\n\n /**\n * Close the cnxn and remove it from the factory cnxns list.\n */\n @Override\n public void close() {\n if (!factory.removeCnxn(this)) {\n return;\n }\n\n if (zkServer != null) {\n zkServer.removeCnxn(this);\n }\n\n if (sk != null) {\n try {\n // need to cancel this selection key from the selector\n sk.cancel();\n } catch (Exception e) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"ignoring exception during selectionkey cancel\", e);\n }\n }\n }\n\n closeSock();\n }\n\n /**\n * Close resources associated with the sock of this cnxn.\n */\n private void closeSock() {\n if (sock.isOpen() == false) {\n return;\n }\n\n LOG.info(\"Closed socket connection for client \"\n + sock.socket().getRemoteSocketAddress()\n + (sessionId != 0 ?\n \" which had sessionid 0x\" + Long.toHexString(sessionId) :\n \" (no session established for client)\"));\n closeSock(sock);\n }\n\n /**\n * Close resources associated with a sock.\n */\n public static void closeSock(SocketChannel sock) {\n if (sock.isOpen() == false) {\n return;\n }\n\n try {\n /*\n * The following sequence of code is stupid! You would think that\n * only sock.close() is needed, but alas, it doesn't work that way.\n * If you just do sock.close() there are cases where the socket\n * doesn't actually close...\n */\n sock.socket().shutdownOutput();\n } catch (IOException e) {\n // This is a relatively common exception that we can't avoid\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"ignoring exception during output shutdown\", e);\n }\n }\n try {\n sock.socket().shutdownInput();\n } catch (IOException e) {\n // This is a relatively common exception that we can't avoid\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"ignoring exception during input shutdown\", e);\n }\n }\n try {\n sock.socket().close();\n } catch (IOException e) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"ignoring exception during socket close\", e);\n }\n }\n try {\n sock.close();\n } catch (IOException e) {\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"ignoring exception during socketchannel close\", e);\n }\n }\n }\n\n private final static byte fourBytes[] = new byte[4];\n\n /*\n * (non-Javadoc)\n *\n * @see org.apache.zookeeper.server.ServerCnxnIface#sendResponse(org.apache.zookeeper.proto.ReplyHeader,\n * org.apache.jute.Record, java.lang.String)\n */\n @Override\n public void sendResponse(ReplyHeader h, Record r, String tag) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n // Make space for length\n BinaryOutputArchive bos = BinaryOutputArchive.getArchive(baos);\n try {\n baos.write(fourBytes);\n bos.writeRecord(h, \"header\");\n if (r != null) {\n bos.writeRecord(r, tag);\n }\n baos.close();\n } catch (IOException e) {\n LOG.error(\"Error serializing response\");\n }\n byte b[] = baos.toByteArray();\n ByteBuffer bb = ByteBuffer.wrap(b);\n bb.putInt(b.length - 4).rewind();\n sendBuffer(bb);\n if (h.getXid() > 0) {\n // check throttling\n if (outstandingRequests.decrementAndGet() < 1 ||\n zkServer.getInProcess() < outstandingLimit) {\n enableRecv();\n }\n }\n } catch(Exception e) {\n LOG.warn(\"Unexpected exception. Destruction averted.\", e);\n }\n }\n\n /*\n * (non-Javadoc)\n *\n * @see org.apache.zookeeper.server.ServerCnxnIface#process(org.apache.zookeeper.proto.WatcherEvent)\n */\n @Override\n public void process(WatchedEvent event) {\n ReplyHeader h = new ReplyHeader(-1, -1L, 0);\n if (LOG.isTraceEnabled()) {\n ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,\n \"Deliver event \" + event + \" to 0x\"\n + Long.toHexString(this.sessionId)\n + \" through \" + this);\n }\n\n // Convert WatchedEvent to a type that can be sent over the wire\n WatcherEvent e = event.getWrapper();\n\n sendResponse(h, e, \"notification\");\n }\n\n /*\n * (non-Javadoc)\n *\n * @see org.apache.zookeeper.server.ServerCnxnIface#getSessionId()\n */\n @Override\n public long getSessionId() {\n return sessionId;\n }\n\n @Override\n public void setSessionId(long sessionId) {\n this.sessionId = sessionId;\n factory.addSession(sessionId, this);\n }\n\n @Override\n public void setSessionTimeout(int sessionTimeout) {\n this.sessionTimeout = sessionTimeout;\n factory.touchCnxn(this);\n }\n\n @Override\n public int getInterestOps() {\n if (!isSelectable()) {\n return 0;\n }\n int interestOps = 0;\n if (getReadInterest()) {\n interestOps |= SelectionKey.OP_READ;\n }\n if (getWriteInterest()) {\n interestOps |= SelectionKey.OP_WRITE;\n }\n return interestOps;\n }\n\n @Override\n public InetSocketAddress getRemoteSocketAddress() {\n if (sock.isOpen() == false) {\n return null;\n }\n return (InetSocketAddress) sock.socket().getRemoteSocketAddress();\n }\n\n public InetAddress getSocketAddress() {\n if (sock.isOpen() == false) {\n return null;\n }\n return sock.socket().getInetAddress();\n }\n\n @Override\n protected ServerStats serverStats() {\n if (zkServer == null) {\n return null;\n }\n return zkServer.serverStats();\n }\n\n @Override\n public boolean isSecure() {\n return false;\n }\n\n @Override\n public Certificate[] getClientCertificateChain() {\n throw new UnsupportedOperationException(\n \"SSL is unsupported in NIOServerCnxn\");\n }\n\n @Override\n public void setClientCertificateChain(Certificate[] chain) {\n throw new UnsupportedOperationException(\n \"SSL is unsupported in NIOServerCnxn\");\n }\n\n}\n", "meta": {"content_hash": "4539fded6eeb848aa16f35911d782beb", "timestamp": "", "source": "github", "line_count": 803, "max_line_length": 108, "avg_line_length": 34.0, "alnum_prop": 0.5603985056039851, "repo_name": "JiangJiafu/zookeeper", "id": "446438c5363bb87b3a32a5ef7c329f68b1841d18", "size": "28108", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "5969"}, {"name": "C", "bytes": "520877"}, {"name": "C++", "bytes": "673611"}, {"name": "CMake", "bytes": "6588"}, {"name": "CSS", "bytes": "4016"}, {"name": "HTML", "bytes": "40639"}, {"name": "Java", "bytes": "4272622"}, {"name": "JavaScript", "bytes": "239387"}, {"name": "M4", "bytes": "46802"}, {"name": "Makefile", "bytes": "10860"}, {"name": "Mako", "bytes": "13678"}, {"name": "Perl", "bytes": "33491"}, {"name": "Perl 6", "bytes": "115943"}, {"name": "Python", "bytes": "157028"}, {"name": "Shell", "bytes": "98150"}, {"name": "XS", "bytes": "66352"}, {"name": "XSLT", "bytes": "6024"}]}} +{"text": "<?php\n\n\nrequire_once 'PHPUnit/Util/Filter.php';\n\nPHPUnit_Util_Filter::addFileToFilter(__FILE__);\n\nrequire_once 'PHPUnit/Extensions/OutputTestCase.php';\n\n/**\n *\n *\n * @category Testing\n * @package PHPUnit\n * @author Sebastian Bergmann <sb@sebastian-bergmann.de>\n * @copyright 2002-2008 Sebastian Bergmann <sb@sebastian-bergmann.de>\n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n * @version Release: 3.2.9\n * @link http://www.phpunit.de/\n * @since Class available since Release 2.0.0\n */\nclass OutputTestCase extends PHPUnit_Extensions_OutputTestCase\n{\n public function testExpectOutputStringFooActualFoo()\n {\n $this->expectOutputString('foo');\n print 'foo';\n }\n\n public function testExpectOutputStringFooActualBar()\n {\n $this->expectOutputString('foo');\n print 'bar';\n }\n\n public function testExpectOutputRegexFooActualFoo()\n {\n $this->expectOutputRegex('/foo/');\n print 'foo';\n }\n\n public function testExpectOutputRegexFooActualBar()\n {\n $this->expectOutputRegex('/foo/');\n print 'bar';\n }\n}\n?>\n", "meta": {"content_hash": "eba7d138b6a9a31c2db4bb4e185da540", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 78, "avg_line_length": 23.833333333333332, "alnum_prop": 0.6547202797202797, "repo_name": "nevali/shindig", "id": "68abb7d54b8087e4810a2e318280fcefcbf1d1b6", "size": "3222", "binary": false, "copies": "1", "ref": "refs/heads/0.8.1-x", "path": "php/external/PHPUnit/Tests/_files/OutputTestCase.php", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "1313610"}, {"name": "JavaScript", "bytes": "525657"}, {"name": "PHP", "bytes": "856857"}, {"name": "Shell", "bytes": "6919"}]}} +{"text": "\"\"\" Models for display visual shapes whose attributes can be associated\nwith data columns from data sources.\n\n\"\"\"\nfrom __future__ import absolute_import\n\nfrom ..plot_object import PlotObject\nfrom ..mixins import FillProps, LineProps, TextProps\nfrom ..enums import Direction, Anchor\nfrom ..properties import AngleSpec, Bool, DistanceSpec, Enum, Float, Include, Instance, NumberSpec, StringSpec\n\nfrom .mappers import LinearColorMapper\n\nclass Glyph(PlotObject):\n \"\"\" Base class for all glyphs/marks/geoms/whatever-you-call-'em in Bokeh.\n\n \"\"\"\n\n visible = Bool(help=\"\"\"\n Whether the glyph should render or not.\n \"\"\")\n\nclass AnnularWedge(Glyph):\n \"\"\" Render annular wedges.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/AnnularWedge.py\n :source-position: none\n\n *source:* `tests/glyphs/AnnularWedge.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/AnnularWedge.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates of the center of the annular wedges.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates of the center of the annular wedges.\n \"\"\")\n\n inner_radius = DistanceSpec(\"inner_radius\", help=\"\"\"\n The inner radii of the annular wedges.\n \"\"\")\n\n outer_radius = DistanceSpec(\"outer_radius\", help=\"\"\"\n The outer radii of the annular wedges.\n \"\"\")\n\n start_angle = AngleSpec(\"start_angle\", help=\"\"\"\n The angles to start the annular wedges, in radians, as measured from\n the horizontal.\n \"\"\")\n\n end_angle = AngleSpec(\"end_angle\", help=\"\"\"\n The angles to end the annular wedges, in radians, as measured from\n the horizontal.\n \"\"\")\n\n direction = Enum(Direction, help=\"\"\"\n Which direction to stroke between the start and end angles.\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the annular wedges.\n \"\"\")\n\n fill_props = Include(FillProps, use_prefix=False, help=\"\"\"\n The %s values for the annular wedges.\n \"\"\")\n\nclass Annulus(Glyph):\n \"\"\" Render annuli.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Annulus.py\n :source-position: none\n\n *source:* `tests/glyphs/Annulus.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Annulus.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates of the center of the annuli.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates of the center of the annuli.\n \"\"\")\n\n inner_radius = DistanceSpec(\"inner_radius\", help=\"\"\"\n The inner radii of the annuli.\n \"\"\")\n\n outer_radius = DistanceSpec(\"outer_radius\", help=\"\"\"\n The outer radii of the annuli.\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the annuli.\n \"\"\")\n\n fill_props = Include(FillProps, use_prefix=False, help=\"\"\"\n The %s values for the annuli.\n \"\"\")\n\nclass Arc(Glyph):\n \"\"\" Render arcs.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Arc.py\n :source-position: none\n\n *source:* `tests/glyphs/Arc.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Arc.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates of the center of the arcs.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates of the center of the arcs.\n \"\"\")\n\n radius = DistanceSpec(\"radius\", help=\"\"\"\n Radius of the arc.\n \"\"\")\n\n start_angle = AngleSpec(\"start_angle\", help=\"\"\"\n The angles to start the arcs, in radians, as measured from the horizontal.\n \"\"\")\n\n end_angle = AngleSpec(\"end_angle\", help=\"\"\"\n The angles to end the arcs, in radians, as measured from the horizontal.\n \"\"\")\n\n direction = Enum(Direction, help=\"\"\"\n Which direction to stroke between the start and end angles.\n \"\"\")\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the arcs.\n \"\"\")\n\nclass Bezier(Glyph):\n u\"\"\" Render B\u00e9zier curves.\n\n For more information consult the `Wikipedia article for B\u00e9zier curve`_.\n\n .. _Wikipedia article for B\u00e9zier curve: http://en.wikipedia.org/wiki/B\u00e9zier_curve\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Bezier.py\n :source-position: none\n\n *source:* `tests/glyphs/Bezier.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Bezier.py>`_\n\n \"\"\"\n\n x0 = NumberSpec(\"x0\", help=\"\"\"\n The x-coordinates of the starting points.\n \"\"\")\n\n y0 = NumberSpec(\"y0\", help=\"\"\"\n The y-coordinates of the starting points.\n \"\"\")\n\n x1 = NumberSpec(\"x1\", help=\"\"\"\n The x-coordinates of the ending points.\n \"\"\")\n\n y1 = NumberSpec(\"y1\", help=\"\"\"\n The y-coordinates of the ending points.\n \"\"\")\n\n cx0 = NumberSpec(\"cx0\", help=\"\"\"\n The x-coordinates of first control points.\n \"\"\")\n\n cy0 = NumberSpec(\"cy0\", help=\"\"\"\n The y-coordinates of first control points.\n \"\"\")\n\n cx1 = NumberSpec(\"cx1\", help=\"\"\"\n The x-coordinates of second control points.\n \"\"\")\n\n cy1 = NumberSpec(\"cy1\", help=\"\"\"\n The y-coordinates of second control points.\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=u\"\"\"\n The %s values for the B\u00e9zier curves.\n \"\"\")\n\nclass Gear(Glyph):\n \"\"\" Render gears.\n\n The details and nomenclature concerning gear construction can\n be quite involved. For more information, consult the `Wikipedia\n article for Gear`_.\n\n .. _Wikipedia article for Gear: http://en.wikipedia.org/wiki/Gear\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Gear.py\n :source-position: none\n\n *source:* `tests/glyphs/Gear.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Gear.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates of the center of the gears.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates of the center of the gears.\n \"\"\")\n\n angle = AngleSpec(default=0, help=\"\"\"\n The angle the gears are rotated from horizontal. [rad]\n \"\"\")\n\n module = NumberSpec(\"module\", help=\"\"\"\n A scaling factor, given by::\n\n m = p / pi\n\n where *p* is the circular pitch, defined as the distance from one\n face of a tooth to the corresponding face of an adjacent tooth on\n the same gear, measured along the pitch circle. [float]\n \"\"\")\n\n teeth = NumberSpec(\"teeth\", help=\"\"\"\n How many teeth the gears have. [int]\n \"\"\")\n\n pressure_angle = NumberSpec(default=20, help= \"\"\"\n The complement of the angle between the direction that the teeth\n exert force on each other, and the line joining the centers of the\n two gears. [deg]\n \"\"\")\n\n # TODO: (bev) evidently missing a test for default value\n shaft_size = NumberSpec(default=0.3, help=\"\"\"\n The central gear shaft size as a percentage of the overall gear\n size. [float]\n \"\"\")\n\n # TODO: (bev) evidently missing a test for default value\n internal = NumberSpec(default=False, help=\"\"\"\n Whether the gear teeth are internal. [bool]\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the gears.\n \"\"\")\n\n fill_props = Include(FillProps, use_prefix=False, help=\"\"\"\n The %s values for the gears.\n \"\"\")\n\nclass Image(Glyph):\n \"\"\" Render images given as scalar data together with a color\n mapper.\n\n \"\"\"\n\n def __init__(self, **kwargs):\n if 'palette' in kwargs and 'color_mapper' in kwargs:\n raise ValueError(\"only one of 'palette' and 'color_mapper' may be specified\")\n elif 'color_mapper' not in kwargs:\n # Use a palette (given or default)\n palette = kwargs.pop('palette', 'Greys9')\n mapper = LinearColorMapper(palette)\n\n reserve_val = kwargs.pop('reserve_val', None)\n if reserve_val is not None:\n mapper.reserve_val = reserve_val\n\n reserve_color = kwargs.pop('reserve_color', None)\n if reserve_color is not None:\n mapper.reserve_color = reserve_color\n\n kwargs['color_mapper'] = mapper\n\n super(Image, self).__init__(**kwargs)\n\n image = NumberSpec(\"image\", help=\"\"\"\n The arrays of scalar data for the images to be colormapped.\n \"\"\")\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates to locate the image anchors.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates to locate the image anchors.\n \"\"\")\n\n dw = DistanceSpec(\"dw\", help=\"\"\"\n The widths of the plot regions that the images will occupy.\n\n .. note::\n This is not the number of pixels that an image is wide.\n That number is fixed by the image itself.\n\n \"\"\")\n\n dh = DistanceSpec(\"dh\", help=\"\"\"\n The height of the plot region that the image will occupy.\n\n .. note::\n This is not the number of pixels that an image is tall.\n That number is fixed by the image itself.\n\n \"\"\")\n\n dilate = Bool(False, help=\"\"\"\n Whether to always round fractional pixel locations in such a way\n as to make the images bigger.\n\n This setting may be useful if pixel rounding errors are causing\n images to have a gap between them, when they should appear flush.\n\n \"\"\")\n\n color_mapper = Instance(LinearColorMapper, help=\"\"\"\n A ``ColorMapper`` to use to map the scalar data from ``image``\n into RGBA values for display.\n\n .. note::\n The color mapping step happens on the client.\n\n \"\"\")\n\n # TODO: (bev) support anchor property for Image\n # ref: https://github.com/bokeh/bokeh/issues/1763\n\nclass ImageRGBA(Glyph):\n \"\"\" Render images given as RGBA data.\n\n \"\"\"\n\n image = NumberSpec(\"image\", help=\"\"\"\n The arrays of RGBA data for the images.\n \"\"\")\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates to locate the image anchors.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates to locate the image anchors.\n \"\"\")\n\n rows = NumberSpec(\"rows\", help=\"\"\"\n The numbers of rows in the images\n \"\"\")\n\n cols = NumberSpec(\"cols\", help=\"\"\"\n The numbers of columns in the images\n \"\"\")\n\n dw = DistanceSpec(\"dw\", help=\"\"\"\n The widths of the plot regions that the images will occupy.\n\n .. note::\n This is not the number of pixels that an image is wide.\n That number is fixed by the image itself.\n\n \"\"\")\n\n dh = DistanceSpec(\"dh\", help=\"\"\"\n The height of the plot region that the image will occupy.\n\n .. note::\n This is not the number of pixels that an image is tall.\n That number is fixed by the image itself.\n\n \"\"\")\n\n dilate = Bool(False, help=\"\"\"\n Whether to always round fractional pixel locations in such a way\n as to make the images bigger.\n\n This setting may be useful if pixel rounding errors are causing\n images to have a gap between them, when they should appear flush.\n \"\"\")\n\n # TODO: (bev) support anchor property for ImageRGBA\n # ref: https://github.com/bokeh/bokeh/issues/1763\n\nclass ImageURL(Glyph):\n \"\"\" Render images loaded from given URLs.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/ImageURL.py\n :source-position: none\n\n *source:* `tests/glyphs/ImageURL.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/ImageURL.py>`_\n\n \"\"\"\n\n url = NumberSpec(\"url\", help=\"\"\"\n The URLs to retrieve images from.\n\n .. note::\n The actual retrieving and loading of the images happens on\n the client.\n\n \"\"\")\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates to locate the image anchors.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates to locate the image anchors.\n \"\"\")\n\n # TODO: (bev) rename to \"dw\" for consistency\n w = DistanceSpec(\"w\", help=\"\"\"\n The widths of the plot regions that the images will occupy.\n\n .. note::\n This is not the number of pixels that an image is wide.\n That number is fixed by the image itself.\n\n .. note::\n This may be renamed to \"dw\" in the future.\n\n \"\"\")\n\n # TODO: (bev) rename to \"dh\" for consistency\n h = DistanceSpec(\"h\", help=\"\"\"\n The height of the plot region that the image will occupy.\n\n .. note::\n This is not the number of pixels that an image is tall.\n That number is fixed by the image itself.\n\n .. note::\n This may be renamed to \"dh\" in the future.\n\n \"\"\")\n\n angle = AngleSpec(default=0, help=\"\"\"\n The angles to rotate the images, in radians as measured from the\n horizontal.\n \"\"\")\n\n global_alpha = Float(1.0, help=\"\"\"\n The opacity that each image is rendered with.\n \"\"\")\n\n dilate = Bool(False, help=\"\"\"\n Whether to always round fractional pixel locations in such a way\n as to make the images bigger.\n\n This setting may be useful if pixel rounding errors are causing\n images to have a gap between them, when they should appear flush.\n \"\"\")\n\n anchor = Enum(Anchor, help=\"\"\"\n What position of the image should be anchored at the `x`, `y`\n coordinates.\n \"\"\")\n\nclass Line(Glyph):\n \"\"\" Render a single line.\n\n .. note::\n The ``Line`` glyph is different from most other glyphs in that\n the vector of values only produces one glyph on the Plot.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Line.py\n :source-position: none\n\n *source:* `tests/glyphs/Line.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Line.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates for the points of the line.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates for the points of the line.\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the line.\n \"\"\")\n\nclass MultiLine(Glyph):\n \"\"\" Render several lines.\n\n .. note::\n The data for the ``MultiLine`` glyph is different in that the\n vector of values is not a vector of scalars. Rather, it is a\n \"list of lists\".\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/MultiLine.py\n :source-position: none\n\n *source:* `tests/glyphs/MultiLine.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/MultiLine.py>`_\n\n \"\"\"\n xs = NumberSpec(\"xs\", help=\"\"\"\n The x-coordinates for all the lines, given as a \"list of lists\".\n \"\"\")\n\n ys = NumberSpec(\"ys\", help=\"\"\"\n The x-coordinates for all the lines, given as a \"list of lists\".\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the lines.\n \"\"\")\n\nclass Oval(Glyph):\n u\"\"\" Render ovals.\n\n .. note::\n This glyph renders ovals using B\u00e9zier curves, which are similar,\n but not identical to ellipses.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Oval.py\n :source-position: none\n\n *source:* `tests/glyphs/Oval.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Oval.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates of the centers of the ovals.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates of the centers of the ovals.\n \"\"\")\n\n width = DistanceSpec(\"width\", help=\"\"\"\n The overall widths of each oval.\n \"\"\")\n\n height = DistanceSpec(\"height\", help=\"\"\"\n The overall height of each oval.\n \"\"\")\n\n angle = AngleSpec(\"angle\", help=\"\"\"\n The angle the ovals are rotated from horizontal. [rad]\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the ovals.\n \"\"\")\n\n fill_props = Include(FillProps, use_prefix=False, help=\"\"\"\n The %s values for the ovals.\n \"\"\")\n\nclass Patch(Glyph):\n \"\"\" Render a single patch.\n\n .. note::\n The ``Patch`` glyph is different from most other glyphs in that\n the vector of values only produces one glyph on the Plot.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Patch.py\n :source-position: none\n\n *source:* `tests/glyphs/Patch.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Patch.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates for the points of the patch.\n\n .. note::\n A patch may comprise multiple polygons. In this case the\n x-coordinates for each polygon should be separated by NaN\n values in the sequence.\n\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates for the points of the patch.\n\n .. note::\n A patch may comprise multiple polygons. In this case the\n y-coordinates for each polygon should be separated by NaN\n values in the sequence.\n\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the patch.\n \"\"\")\n\n fill_props = Include(FillProps, use_prefix=False, help=\"\"\"\n The %s values for the patch.\n \"\"\")\n\nclass Patches(Glyph):\n \"\"\" Render several patches.\n\n .. note::\n The data for the ``Patches`` glyph is different in that the\n vector of values is not a vector of scalars. Rather, it is a\n \"list of lists\".\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Patches.py\n :source-position: none\n\n *source:* `tests/glyphs/Patches.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Patches.py>`_\n\n \"\"\"\n\n xs = NumberSpec(\"xs\", help=\"\"\"\n The x-coordinates for all the patches, given as a \"list of lists\".\n\n .. note::\n Individual patches may comprise multiple polygons. In this case\n the x-coordinates for each polygon should be separated by NaN\n values in the sublists.\n\n \"\"\")\n\n ys = NumberSpec(\"ys\", help=\"\"\"\n The y-coordinates for all the patches, given as a \"list of lists\".\n\n .. note::\n Individual patches may comprise multiple polygons. In this case\n the y-coordinates for each polygon should be separated by NaN\n values in the sublists.\n\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the patches.\n \"\"\")\n\n fill_props = Include(FillProps, use_prefix=False, help=\"\"\"\n The %s values for the patches.\n \"\"\")\n\nclass Quad(Glyph):\n \"\"\" Render axis-aligned quads.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Quad.py\n :source-position: none\n\n *source:* `tests/glyphs/Quad.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Quad.py>`_\n\n \"\"\"\n\n left = NumberSpec(\"left\", help=\"\"\"\n The x-coordinates of the left edges.\n \"\"\")\n\n right = NumberSpec(\"right\", help=\"\"\"\n The x-coordinates of the right edges.\n \"\"\")\n\n bottom = NumberSpec(\"bottom\", help=\"\"\"\n The y-coordinates of the bottom edges.\n \"\"\")\n\n top = NumberSpec(\"top\", help=\"\"\"\n The y-coordinates of the top edges.\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the quads.\n \"\"\")\n\n fill_props = Include(FillProps, use_prefix=False, help=\"\"\"\n The %s values for the quads.\n \"\"\")\n\nclass Quadratic(Glyph):\n \"\"\" Render parabolas.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Quadratic.py\n :source-position: none\n\n *source:* `tests/glyphs/Quadratic.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Quadratic.py>`_\n\n \"\"\"\n\n x0 = NumberSpec(\"x0\", help=\"\"\"\n The x-coordinates of the starting points.\n \"\"\")\n\n y0 = NumberSpec(\"y0\", help=\"\"\"\n The y-coordinates of the starting points.\n \"\"\")\n\n x1 = NumberSpec(\"x1\", help=\"\"\"\n The x-coordinates of the ending points.\n \"\"\")\n\n y1 = NumberSpec(\"y1\", help=\"\"\"\n The y-coordinates of the ending points.\n \"\"\")\n\n cx = NumberSpec(\"cx\", help=\"\"\"\n The x-coordinates of the control points.\n \"\"\")\n\n cy = NumberSpec(\"cy\", help=\"\"\"\n The y-coordinates of the control points.\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the parabolas.\n \"\"\")\n\nclass Ray(Glyph):\n \"\"\" Render rays.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Ray.py\n :source-position: none\n\n *source:* `tests/glyphs/Ray.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Ray.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates to start the rays.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates to start the rays.\n \"\"\")\n\n angle = AngleSpec(\"angle\", help=\"\"\"\n The angles in radians to extend the rays, as measured from the\n horizontal.\n \"\"\")\n\n length = DistanceSpec(\"length\", help=\"\"\"\n The length to extend the ray. Note that this ``length`` defaults\n to screen units.\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the rays.\n \"\"\")\n\nclass Rect(Glyph):\n \"\"\" Render rectangles.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Rect.py\n :source-position: none\n\n *source:* `tests/glyphs/Rect.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Rect.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates of the centers of the rectangles.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates of the centers of the rectangles.\n \"\"\")\n\n width = DistanceSpec(\"width\", help=\"\"\"\n The overall widths of the rectangles.\n \"\"\")\n\n height = DistanceSpec(\"height\", help=\"\"\"\n The overall heights of the rectangles.\n \"\"\")\n\n angle = AngleSpec(\"angle\", help=\"\"\"\n The angles to rotate the rectangles, in radians, as measured from\n the horizontal.\n \"\"\")\n\n dilate = Bool(False, help=\"\"\"\n Whether to always round fractional pixel locations in such a way\n as to make the rectangles bigger.\n\n This setting may be useful if pixel rounding errors are causing\n rectangles to have a gap between them, when they should appear\n flush.\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the rectangles.\n \"\"\")\n\n fill_props = Include(FillProps, use_prefix=False, help=\"\"\"\n The %s values for the rectangles.\n \"\"\")\n\nclass Segment(Glyph):\n \"\"\" Render segments.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Segment.py\n :source-position: none\n\n *source:* `tests/glyphs/Segment.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Segment.py>`_\n\n \"\"\"\n\n x0 = NumberSpec(\"x0\", help=\"\"\"\n The x-coordinates of the starting points.\n \"\"\")\n\n y0 = NumberSpec(\"y0\", help=\"\"\"\n The y-coordinates of the starting points.\n \"\"\")\n\n x1 = NumberSpec(\"x1\", help=\"\"\"\n The x-coordinates of the ending points.\n \"\"\")\n\n y1 = NumberSpec(\"y1\", help=\"\"\"\n The y-coordinates of the ending points.\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the segments.\n \"\"\")\n\nclass Text(Glyph):\n \"\"\" Render text.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Text.py\n :source-position: none\n\n *source:* `tests/glyphs/Text.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Text.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates to locate the text anchors.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates to locate the text anchors.\n \"\"\")\n\n text = StringSpec(\"text\", help=\"\"\"\n The text values to render.\n \"\"\")\n\n angle = AngleSpec(default=0, help=\"\"\"\n The angles to rotate the text, in radians,, as measured from the horizontal.\n \"\"\")\n\n x_offset = NumberSpec(default=0, help=\"\"\"\n Offset values to apply to the x-coordinates.\n\n This is useful, for instance, if it is desired to \"float\" text a fixed\n distance in screen units from a given data position.\n \"\"\")\n\n y_offset = NumberSpec(default=0, help=\"\"\"\n Offset values to apply to the y-coordinates.\n\n This is useful, for instance, if it is desired to \"float\" text a fixed\n distance in screen units from a given data position.\n \"\"\")\n\n text_props = Include(TextProps, use_prefix=False, help=\"\"\"\n The %s values for the text.\n \"\"\")\n\nclass Wedge(Glyph):\n \"\"\" Render wedges.\n\n Example\n -------\n\n .. bokeh-plot:: ../tests/glyphs/Wedge.py\n :source-position: none\n\n *source:* `tests/glyphs/Wedge.py <https://github.com/bokeh/bokeh/tree/master/tests/glyphs/Wedge.py>`_\n\n \"\"\"\n\n x = NumberSpec(\"x\", help=\"\"\"\n The x-coordinates of the points of the wedges.\n \"\"\")\n\n y = NumberSpec(\"y\", help=\"\"\"\n The y-coordinates of the points of the wedges.\n \"\"\")\n\n radius = DistanceSpec(\"radius\", help=\"\"\"\n Radii of the wedges.\n \"\"\")\n\n start_angle = AngleSpec(\"start_angle\", help=\"\"\"\n The angles to start the wedges, in radians, as measured from the horizontal.\n \"\"\")\n\n end_angle = AngleSpec(\"end_angle\", help=\"\"\"\n The angles to end the wedges, in radians as measured from the horizontal.\n \"\"\")\n\n direction = Enum(Direction, help=\"\"\"\n Which direction to stroke between the start and end angles.\n \"\"\")\n\n line_props = Include(LineProps, use_prefix=False, help=\"\"\"\n The %s values for the wedges.\n \"\"\")\n\n fill_props = Include(FillProps, use_prefix=False, help=\"\"\"\n The %s values for the wedges.\n \"\"\")\n\n# XXX: allow `from bokeh.models.glyphs import *`\nfrom .markers import (Marker, Asterisk, Circle, CircleCross, CircleX, Cross,\n Diamond, DiamondCross, InvertedTriangle, Square,\n SquareCross, SquareX, Triangle, X)\n\n# Fool pyflakes\n(Marker, Asterisk, Circle, CircleCross, CircleX, Cross, Diamond, DiamondCross,\nInvertedTriangle, Square, SquareCross, SquareX, Triangle, X)\n", "meta": {"content_hash": "2fb1e55ec163f4d95798df477413a121", "timestamp": "", "source": "github", "line_count": 973, "max_line_length": 119, "avg_line_length": 26.082219938335047, "alnum_prop": 0.6164788399401055, "repo_name": "daodaoliang/bokeh", "id": "cd15e0575fe6415967abbe568934fda1d0eb3ac8", "size": "25408", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "bokeh/models/glyphs.py", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Batchfile", "bytes": "5455"}, {"name": "CSS", "bytes": "413395"}, {"name": "CoffeeScript", "bytes": "1995470"}, {"name": "HTML", "bytes": "1545838"}, {"name": "JavaScript", "bytes": "4747"}, {"name": "Makefile", "bytes": "5785"}, {"name": "Python", "bytes": "1381168"}, {"name": "Shell", "bytes": "13857"}]}} +{"text": "stage: Verify\ngroup: Testing\ninfo: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers\ntype: reference, howto\n---\n\n# Load Performance Testing **(PREMIUM)**\n\n> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10683) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.2.\n\nWith Load Performance Testing, you can test the impact of any pending code changes\nto your application's backend in [GitLab CI/CD](../../../ci/README.md).\n\nGitLab uses [k6](https://k6.io/), a free and open source\ntool, for measuring the system performance of applications under\nload.\n\nUnlike [Browser Performance Testing](browser_performance_testing.md), which is\nused to measure how web sites perform in client browsers, Load Performance Testing\ncan be used to perform various types of [load tests](https://k6.io/docs/#use-cases)\nagainst application endpoints such as APIs, Web Controllers, and so on.\nThis can be used to test how the backend or the server performs at scale.\n\nFor example, you can use Load Performance Testing to perform many concurrent\nGET calls to a popular API endpoint in your application to see how it performs.\n\n## How Load Performance Testing works\n\nFirst, define a job in your `.gitlab-ci.yml` file that generates the\n[Load Performance report artifact](../../../ci/pipelines/job_artifacts.md#artifactsreportsload_performance-premium).\nGitLab checks this report, compares key load performance metrics\nbetween the source and target branches, and then shows the information in a merge request widget:\n\n\n\nNext, you need to configure the test environment and write the k6 test.\n\nThe key performance metrics that the merge request widget shows after the test completes are:\n\n- Checks: The percentage pass rate of the [checks](https://k6.io/docs/using-k6/checks) configured in the k6 test.\n- TTFB P90: The 90th percentile of how long it took to start receiving responses, aka the [Time to First Byte](https://en.wikipedia.org/wiki/Time_to_first_byte) (TTFB).\n- TTFB P95: The 95th percentile for TTFB.\n- RPS: The average requests per second (RPS) rate the test was able to achieve.\n\nNOTE: **Note:**\nIf the Load Performance report has no data to compare, such as when you add the\nLoad Performance job in your `.gitlab-ci.yml` for the very first time,\nthe Load Performance report widget won't show. It must have run at least\nonce on the target branch (`master`, for example), before it will display in a\nmerge request targeting that branch.\n\n## Configure the Load Performance Testing job\n\nConfiguring your Load Performance Testing job can be broken down into several distinct parts:\n\n- Determine the test parameters such as throughput, and so on.\n- Set up the target test environment for load performance testing.\n- Design and write the k6 test.\n\n### Determine the test parameters\n\nThe first thing you need to do is determine the [type of load test](https://k6.io/docs/test-types/introduction)\nyou want to run, and how it will run (for example, the number of users, throughput, and so on).\n\nRefer to the [k6 docs](https://k6.io/docs/), especially the [k6 testing guides](https://k6.io/docs/testing-guides),\nfor guidance on the above and more.\n\n### Test Environment setup\n\nA large part of the effort around load performance testing is to prepare the target test environment\nfor high loads. You should ensure it's able to handle the\n[throughput](https://k6.io/blog/monthly-visits-concurrent-users) it will be tested with.\n\nIt's also typically required to have representative test data in the target environment\nfor the load performance test to use.\n\nWe strongly recommend [not running these tests against a production environment](https://k6.io/our-beliefs#load-test-in-a-pre-production-environment).\n\n### Write the load performance test\n\nAfter the environment is prepared, you can write the k6 test itself. k6 is a flexible\ntool and can be used to run [many kinds of performance tests](https://k6.io/docs/test-types/introduction).\nRefer to the [k6 documentation](https://k6.io/docs/) for detailed information on how to write tests.\n\n### Configure the test in GitLab CI/CD\n\nWhen your k6 test is ready, the next step is to configure the load performance\ntesting job in GitLab CI/CD. The easiest way to do this is to use the\n[`Verify/Load-Performance-Testing.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Verify/Load-Performance-Testing.gitlab-ci.yml)\ntemplate that is included with GitLab.\n\nNOTE: **Note:**\nFor large scale k6 tests you need to ensure the GitLab Runner instance performing the actual\ntest is able to handle running the test. Refer to [k6's guidance](https://k6.io/docs/testing-guides/running-large-tests#hardware-considerations)\nfor spec details. The [default shared GitLab.com runners](../../gitlab_com/#linux-shared-runners)\nlikely have insufficient specs to handle most large k6 tests.\n\nThis template runs the\n[k6 Docker container](https://hub.docker.com/r/loadimpact/k6/) in the job and provides several ways to customize the\njob.\n\nAn example configuration workflow:\n\n1. Set up a GitLab Runner that can run Docker containers, such as a Runner using the\n [Docker-in-Docker workflow](../../../ci/docker/using_docker_build.md#use-docker-in-docker-workflow-with-docker-executor).\n1. Configure the default Load Performance Testing CI job in your `.gitlab-ci.yml` file.\n You need to include the template and configure it with variables:\n\n ```yaml\n include:\n template: Verify/Load-Performance-Testing.gitlab-ci.yml\n\n load_performance:\n variables:\n K6_TEST_FILE: <PATH TO K6 TEST FILE IN PROJECT>\n ```\n\nThe above example creates a `load_performance` job in your CI/CD pipeline that runs\nthe k6 test.\n\nNOTE: **Note:**\nFor Kubernetes setups a different template should be used: [`Jobs/Load-Performance-Testing.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Load-Performance-Testing.gitlab-ci.yml).\n\nk6 has [various options](https://k6.io/docs/using-k6/options) to configure how it will run tests, such as what throughput (RPS) to run with,\nhow long the test should run, and so on. Almost all options can be configured in the test itself, but as\nyou can also pass command line options via the `K6_OPTIONS` variable.\n\nFor example, you can override the duration of the test with a CLI option:\n\n```yaml\n include:\n template: Verify/Load-Performance-Testing.gitlab-ci.yml\n\n load_performance:\n variables:\n K6_TEST_FILE: <PATH TO K6 TEST FILE IN PROJECT>\n K6_OPTIONS: '--duration 30s'\n```\n\nGitLab only displays the key performance metrics in the MR widget if k6's results are saved\nvia [summary export](https://k6.io/docs/results-visualization/json#summary-export)\nas a [Load Performance report artifact](../../../ci/pipelines/job_artifacts.md#artifactsreportsload_performance-premium).\nThe latest Load Performance artifact available is always used, using the\nsummary values from the test.\n\nIf [GitLab Pages](../pages/index.md) is enabled, you can view the report directly in your browser.\n\n### Load Performance testing in Review Apps\n\nThe CI/CD YAML configuration example above works for testing against static environments,\nbut it can be extended to work with [review apps](../../../ci/review_apps) or\n[dynamic environments](../../../ci/environments) with a few extra steps.\n\nThe best approach is to capture the dynamic URL into a custom environment variable that\nis then [inherited](../../../ci/variables/README.md#inherit-environment-variables)\nby the `load_performance` job. The k6 test script to be run should then be configured to\nuse that environment URL, such as: ``http.get(`${__ENV.ENVIRONMENT_URL`})``.\n\nFor example:\n\n1. In the `review` job:\n 1. Capture the dynamic URL and save it into a `.env` file, e.g. `echo \"ENVIRONMENT_URL=$CI_ENVIRONMENT_URL\" >> review.env`.\n 1. Set the `.env` file to be an [`artifacts:reports:dotenv` report](../../../ci/variables/README.md#inherit-environment-variables).\n1. Set the `load_performance` job to depend on the review job, so it inherits the environment variable.\n1. Configure the k6 test script to use the environment variable in it's steps.\n\nYour `.gitlab-ci.yml` file might be similar to:\n\n```yaml\nstages:\n - deploy\n - performance\n\ninclude:\n template: Verify/Load-Performance-Testing.gitlab-ci.yml\n\nreview:\n stage: deploy\n environment:\n name: review/$CI_COMMIT_REF_NAME\n url: http://$CI_ENVIRONMENT_SLUG.example.com\n script:\n - run_deploy_script\n - echo \"ENVIRONMENT_URL=$CI_ENVIRONMENT_URL\" >> review.env\n artifacts:\n reports:\n dotenv:\n review.env\n rules:\n - if: '$CI_COMMIT_BRANCH' # Modify to match your pipeline rules, or use `only/except` if needed.\n\nload_performance:\n dependencies:\n - review\n rules:\n - if: '$CI_COMMIT_BRANCH' # Modify to match your pipeline rules, or use `only/except` if needed.\n```\n", "meta": {"content_hash": "675d5958436694ac01e56f97ad21f2c6", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 225, "avg_line_length": 45.9492385786802, "alnum_prop": 0.7568493150684932, "repo_name": "mmkassem/gitlabhq", "id": "97f4f202ab376e7a67e7fbf50bda0412315358d7", "size": "9056", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/user/project/merge_requests/load_performance_testing.md", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "113683"}, {"name": "CoffeeScript", "bytes": "139197"}, {"name": "Cucumber", "bytes": "119759"}, {"name": "HTML", "bytes": "447030"}, {"name": "JavaScript", "bytes": "29805"}, {"name": "Ruby", "bytes": "2417833"}, {"name": "Shell", "bytes": "14336"}]}} +{"text": "import { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\nimport {DashboardComponent} from './dashboard.component';\n\nconst routes: Routes = [\n {\n path: '',\n component: DashboardComponent\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule]\n})\nexport class DashboardRoutingModule { }\n", "meta": {"content_hash": "eae6b9a2be06708b54bbe807aa5a233f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 57, "avg_line_length": 22.9375, "alnum_prop": 0.7002724795640327, "repo_name": "aaronfurtado93/pwa-core", "id": "ee7ab816e54c01c739a14f328bf3f3639a9f78a5", "size": "367", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/pages/dashboard/dashboard-routing.module.ts", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "2373"}, {"name": "HTML", "bytes": "7291"}, {"name": "JavaScript", "bytes": "1645"}, {"name": "TypeScript", "bytes": "56424"}]}} +{"text": "var soundMap = [{\n name: 'river water',\n url: \"http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/sounds/Water_Lap_River_Edge_Gentle.L.wav\",\n audioOptions: {\n position: {\n x: 580,\n y: 493,\n z: 528\n },\n volume: 0.4,\n loop: true\n }\n}, {\n name: 'windmill',\n url: \"http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/sounds/WINDMILL_Mono.wav\",\n audioOptions: {\n position: {\n x: 530,\n y: 516,\n z: 518\n },\n volume: 0.08,\n loop: true\n }\n}, {\n name: 'insects',\n url: \"http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/sounds/insects3.wav\",\n audioOptions: {\n position: {\n x: 560,\n y: 495,\n z: 474\n },\n volume: 0.25,\n loop: true\n }\n}, {\n name: 'fireplace',\n url: \"http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/sounds/0619_Fireplace__Tree_B.L.wav\",\n audioOptions: {\n position: {\n x: 551.61,\n y: 494.88,\n z: 502.00\n },\n volume: 0.25,\n loop: true\n }\n}, {\n name: 'cat purring',\n url: \"http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/sounds/Cat_Purring_Deep_Low_Snor.wav\",\n audioOptions: {\n position: {\n x: 551.48,\n y: 495.60,\n z: 502.08\n },\n volume: 0.03,\n loop: true\n }\n}, {\n name: 'dogs barking',\n url: \"http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/sounds/dogs_barking_1.L.wav\",\n audioOptions: {\n position: {\n x: 523,\n y: 494.88,\n z: 469\n },\n volume: 0.05,\n loop: false\n },\n playAtInterval: 60 * 1000\n}, {\n name: 'arcade game',\n url: \"http://hifi-production.s3.amazonaws.com/DomainContent/Toybox/sounds/ARCADE_GAMES_VID.L.L.wav\",\n audioOptions: {\n position: {\n x: 543.77,\n y: 495.07,\n z: 502.25\n },\n volume: 0.01,\n loop: false,\n },\n playAtInterval: 90 * 1000\n}];\n\nfunction loadSounds() {\n soundMap.forEach(function(soundData) {\n soundData.sound = SoundCache.getSound(soundData.url);\n });\n}\n\nfunction playSound(soundData) {\n if (soundData.injector) {\n // try/catch in case the injector QObject has been deleted already\n try {\n soundData.injector.stop();\n } catch (e) {}\n }\n soundData.injector = Audio.playSound(soundData.sound, soundData.audioOptions);\n}\n\nfunction checkDownloaded(soundData) {\n if (soundData.sound.downloaded) {\n\n Script.clearInterval(soundData.downloadTimer);\n\n if (soundData.hasOwnProperty('playAtInterval')) {\n soundData.playingInterval = Script.setInterval(function() {\n playSound(soundData)\n }, soundData.playAtInterval);\n } else {\n playSound(soundData);\n }\n\n }\n}\n\nfunction startCheckDownloadedTimers() {\n soundMap.forEach(function(soundData) {\n soundData.downloadTimer = Script.setInterval(function() {\n checkDownloaded(soundData);\n }, 1000);\n });\n}\n\nScript.scriptEnding.connect(function() {\n soundMap.forEach(function(soundData) {\n\n if (soundData.hasOwnProperty(\"injector\")) {\n soundData.injector.stop();\n }\n\n if (soundData.hasOwnProperty(\"downloadTimer\")) {\n Script.clearInterval(soundData.downloadTimer);\n }\n\n if (soundData.hasOwnProperty(\"playingInterval\")) {\n Script.clearInterval(soundData.playingInterval);\n }\n\n });\n\n});\n\nloadSounds();\nstartCheckDownloadedTimers();", "meta": {"content_hash": "7591a315854d23c17be8ef168571926c", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 113, "avg_line_length": 24.973154362416107, "alnum_prop": 0.5530771298038162, "repo_name": "misslivirose/hifi-content", "id": "e73630e38068ba37528ceb120332fc10312fa904", "size": "4031", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "DomainContent/Toybox/AC_scripts/toybox_sounds.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "98041"}, {"name": "GLSL", "bytes": "3603"}, {"name": "HTML", "bytes": "316682"}, {"name": "JavaScript", "bytes": "3778239"}, {"name": "Makefile", "bytes": "317"}]}} +{"text": "\n\n#include \"types.h\"\n#include \"qpid/Msg.h\"\n#include \"qpid/broker/Message.h\"\n#include \"qpid/broker/Queue.h\"\n#include \"qpid/Exception.h\"\n#include <algorithm>\n#include <iostream>\n#include <iterator>\n#include <assert.h>\n\nnamespace qpid {\nnamespace ha {\n\nusing namespace std;\n\nconst string QPID_REPLICATE(\"qpid.replicate\");\nconst string QPID_HA_UUID(\"qpid.ha-uuid\");\n\nconst char* QPID_HA_PREFIX = \"qpid.ha-\";\nconst char* QUEUE_REPLICATOR_PREFIX = \"qpid.ha-q:\";\n\nbool startsWith(const string& name, const string& prefix) {\n return name.compare(0, prefix.size(), prefix) == 0;\n}\n\nstring EnumBase::str() const {\n assert(value < count);\n return names[value];\n}\n\nvoid EnumBase::parse(const string& s) {\n if (!parseNoThrow(s))\n throw Exception(QPID_MSG(\"Invalid \" << name << \" value: \" << s));\n}\n\nbool EnumBase::parseNoThrow(const string& s) {\n const char** i = find(names, names+count, s);\n value = i - names;\n return value < count;\n}\n\ntemplate <> const char* Enum<ReplicateLevel>::NAME = \"replication\";\ntemplate <> const char* Enum<ReplicateLevel>::NAMES[] = { \"none\", \"configuration\", \"all\" };\ntemplate <> const size_t Enum<ReplicateLevel>::N = 3;\n\ntemplate <> const char* Enum<BrokerStatus>::NAME = \"HA broker status\";\n\n// NOTE: Changing status names will have an impact on qpid-ha and\n// the qpidd-primary init script.\n// Don't change them unless you are going to update all dependent code.\n//\ntemplate <> const char* Enum<BrokerStatus>::NAMES[] = {\n \"joining\", \"catchup\", \"ready\", \"recovering\", \"active\", \"standalone\"\n};\ntemplate <> const size_t Enum<BrokerStatus>::N = 6;\n\nostream& operator<<(ostream& o, EnumBase e) {\n return o << e.str();\n}\n\nistream& operator>>(istream& i, EnumBase& e) {\n string s;\n i >> s;\n e.parse(s);\n return i;\n}\n\nostream& operator<<(ostream& o, const UuidSet& ids) {\n ostream_iterator<qpid::types::Uuid> out(o, \" \");\n o << \"{ \";\n for (UuidSet::const_iterator i = ids.begin(); i != ids.end(); ++i)\n o << shortStr(*i) << \" \";\n o << \"}\";\n return o;\n}\n\n\nstd::string logMessageId(const std::string& q, QueuePosition pos, ReplicationId id) {\n return Msg() << q << \"[\" << pos << \"]\" << \"=\" << id;\n}\nstd::string logMessageId(const std::string& q, ReplicationId id) {\n return Msg() << q << \"[]\" << \"=\" << id;\n}\nstd::string logMessageId(const std::string& q, const broker::Message& m) {\n return logMessageId(q, m.getSequence(), m.getReplicationId());\n}\nstd::string logMessageId(const broker::Queue& q, QueuePosition pos, ReplicationId id) {\n return logMessageId(q.getName(), pos, id);\n}\nstd::string logMessageId(const broker::Queue& q, ReplicationId id) {\n return logMessageId(q.getName(), id);\n}\nstd::string logMessageId(const broker::Queue& q, const broker::Message& m) {\n return logMessageId(q.getName(), m);\n}\n\nvoid UuidSet::encode(framing::Buffer& b) const {\n b.putLong(size());\n for (const_iterator i = begin(); i != end(); ++i)\n b.putRawData(i->data(), i->size());\n}\n\nvoid UuidSet::decode(framing::Buffer& b) {\n size_t n = b.getLong();\n for ( ; n > 0; --n) {\n types::Uuid id;\n b.getRawData(const_cast<unsigned char*>(id.data()), id.size());\n insert(id);\n }\n}\n\nsize_t UuidSet::encodedSize() const {\n return sizeof(uint32_t) + size()*16;\n}\n\n\n}} // namespace qpid::ha\n", "meta": {"content_hash": "f21d21cc471937097f1fbe5958e3b91d", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 91, "avg_line_length": 27.88235294117647, "alnum_prop": 0.6347197106690777, "repo_name": "mbroadst/debian-qpid-cpp", "id": "3088661c954598de1fa21e93a4e568376e1b2305", "size": "4131", "binary": false, "copies": "3", "ref": "refs/heads/trusty", "path": "src/qpid/ha/types.cpp", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2126"}, {"name": "C", "bytes": "67620"}, {"name": "C#", "bytes": "121990"}, {"name": "C++", "bytes": "7291355"}, {"name": "CMake", "bytes": "169753"}, {"name": "Cucumber", "bytes": "15299"}, {"name": "Emacs Lisp", "bytes": "7379"}, {"name": "HTML", "bytes": "4773"}, {"name": "Makefile", "bytes": "1261"}, {"name": "Perl", "bytes": "86022"}, {"name": "Perl6", "bytes": "2703"}, {"name": "PowerShell", "bytes": "51728"}, {"name": "Python", "bytes": "1523448"}, {"name": "Ruby", "bytes": "305919"}, {"name": "Shell", "bytes": "128410"}]}} +{"text": "\npackage com.amazonaws.services.lambda.model;\n\nimport java.io.Serializable;\n\nimport com.amazonaws.AmazonWebServiceRequest;\n\n/**\n * Container for the parameters to the {@link com.amazonaws.services.lambda.AWSLambda#listEventSourceMappings(ListEventSourceMappingsRequest) ListEventSourceMappings operation}.\n * <p>\n * Returns a list of event source mappings you created using the\n * <code>CreateEventSourceMapping</code> (see CreateEventSourceMapping),\n * where you identify a stream as an event source. This list does not\n * include Amazon S3 event sources.\n * </p>\n * <p>\n * For each mapping, the API returns configuration information. You can\n * optionally specify filters to retrieve specific event source mappings.\n * </p>\n * <p>\n * This operation requires permission for the\n * <code>lambda:ListEventSourceMappings</code> action.\n * </p>\n *\n * @see com.amazonaws.services.lambda.AWSLambda#listEventSourceMappings(ListEventSourceMappingsRequest)\n */\npublic class ListEventSourceMappingsRequest extends AmazonWebServiceRequest implements Serializable, Cloneable {\n\n /**\n * The Amazon Resource Name (ARN) of the Amazon Kinesis stream.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Pattern: </b>arn:aws:([a-zA-Z0-9\\-])+:([a-z]{2}-[a-z]+-\\d{1})?:(\\d{12})?:(.*)<br/>\n */\n private String eventSourceArn;\n\n /**\n * The name of the Lambda function. <p> You can specify an unqualified\n * function name (for example, \"Thumbnail\") or you can specify Amazon\n * Resource Name (ARN) of the function (for example,\n * \"arn:aws:lambda:us-west-2:account-id:function:ThumbNail\"). AWS Lambda\n * also allows you to specify only the account ID qualifier (for example,\n * \"account-id:Thumbnail\"). Note that the length constraint applies only\n * to the ARN. If you specify only the function name, it is limited to 64\n * character in length.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Length: </b>1 - 140<br/>\n * <b>Pattern: </b>(arn:aws:lambda:)?([a-z]{2}-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?<br/>\n */\n private String functionName;\n\n /**\n * Optional string. An opaque pagination token returned from a previous\n * <code>ListEventSourceMappings</code> operation. If present, specifies\n * to continue the list from where the returning call left off.\n */\n private String marker;\n\n /**\n * Optional integer. Specifies the maximum number of event sources to\n * return in response. This value must be greater than 0.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Range: </b>1 - 10000<br/>\n */\n private Integer maxItems;\n\n /**\n * The Amazon Resource Name (ARN) of the Amazon Kinesis stream.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Pattern: </b>arn:aws:([a-zA-Z0-9\\-])+:([a-z]{2}-[a-z]+-\\d{1})?:(\\d{12})?:(.*)<br/>\n *\n * @return The Amazon Resource Name (ARN) of the Amazon Kinesis stream.\n */\n public String getEventSourceArn() {\n return eventSourceArn;\n }\n \n /**\n * The Amazon Resource Name (ARN) of the Amazon Kinesis stream.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Pattern: </b>arn:aws:([a-zA-Z0-9\\-])+:([a-z]{2}-[a-z]+-\\d{1})?:(\\d{12})?:(.*)<br/>\n *\n * @param eventSourceArn The Amazon Resource Name (ARN) of the Amazon Kinesis stream.\n */\n public void setEventSourceArn(String eventSourceArn) {\n this.eventSourceArn = eventSourceArn;\n }\n \n /**\n * The Amazon Resource Name (ARN) of the Amazon Kinesis stream.\n * <p>\n * Returns a reference to this object so that method calls can be chained together.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Pattern: </b>arn:aws:([a-zA-Z0-9\\-])+:([a-z]{2}-[a-z]+-\\d{1})?:(\\d{12})?:(.*)<br/>\n *\n * @param eventSourceArn The Amazon Resource Name (ARN) of the Amazon Kinesis stream.\n *\n * @return A reference to this updated object so that method calls can be chained\n * together.\n */\n public ListEventSourceMappingsRequest withEventSourceArn(String eventSourceArn) {\n this.eventSourceArn = eventSourceArn;\n return this;\n }\n\n /**\n * The name of the Lambda function. <p> You can specify an unqualified\n * function name (for example, \"Thumbnail\") or you can specify Amazon\n * Resource Name (ARN) of the function (for example,\n * \"arn:aws:lambda:us-west-2:account-id:function:ThumbNail\"). AWS Lambda\n * also allows you to specify only the account ID qualifier (for example,\n * \"account-id:Thumbnail\"). Note that the length constraint applies only\n * to the ARN. If you specify only the function name, it is limited to 64\n * character in length.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Length: </b>1 - 140<br/>\n * <b>Pattern: </b>(arn:aws:lambda:)?([a-z]{2}-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?<br/>\n *\n * @return The name of the Lambda function. <p> You can specify an unqualified\n * function name (for example, \"Thumbnail\") or you can specify Amazon\n * Resource Name (ARN) of the function (for example,\n * \"arn:aws:lambda:us-west-2:account-id:function:ThumbNail\"). AWS Lambda\n * also allows you to specify only the account ID qualifier (for example,\n * \"account-id:Thumbnail\"). Note that the length constraint applies only\n * to the ARN. If you specify only the function name, it is limited to 64\n * character in length.\n */\n public String getFunctionName() {\n return functionName;\n }\n \n /**\n * The name of the Lambda function. <p> You can specify an unqualified\n * function name (for example, \"Thumbnail\") or you can specify Amazon\n * Resource Name (ARN) of the function (for example,\n * \"arn:aws:lambda:us-west-2:account-id:function:ThumbNail\"). AWS Lambda\n * also allows you to specify only the account ID qualifier (for example,\n * \"account-id:Thumbnail\"). Note that the length constraint applies only\n * to the ARN. If you specify only the function name, it is limited to 64\n * character in length.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Length: </b>1 - 140<br/>\n * <b>Pattern: </b>(arn:aws:lambda:)?([a-z]{2}-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?<br/>\n *\n * @param functionName The name of the Lambda function. <p> You can specify an unqualified\n * function name (for example, \"Thumbnail\") or you can specify Amazon\n * Resource Name (ARN) of the function (for example,\n * \"arn:aws:lambda:us-west-2:account-id:function:ThumbNail\"). AWS Lambda\n * also allows you to specify only the account ID qualifier (for example,\n * \"account-id:Thumbnail\"). Note that the length constraint applies only\n * to the ARN. If you specify only the function name, it is limited to 64\n * character in length.\n */\n public void setFunctionName(String functionName) {\n this.functionName = functionName;\n }\n \n /**\n * The name of the Lambda function. <p> You can specify an unqualified\n * function name (for example, \"Thumbnail\") or you can specify Amazon\n * Resource Name (ARN) of the function (for example,\n * \"arn:aws:lambda:us-west-2:account-id:function:ThumbNail\"). AWS Lambda\n * also allows you to specify only the account ID qualifier (for example,\n * \"account-id:Thumbnail\"). Note that the length constraint applies only\n * to the ARN. If you specify only the function name, it is limited to 64\n * character in length.\n * <p>\n * Returns a reference to this object so that method calls can be chained together.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Length: </b>1 - 140<br/>\n * <b>Pattern: </b>(arn:aws:lambda:)?([a-z]{2}-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\\$LATEST|[a-zA-Z0-9-_]+))?<br/>\n *\n * @param functionName The name of the Lambda function. <p> You can specify an unqualified\n * function name (for example, \"Thumbnail\") or you can specify Amazon\n * Resource Name (ARN) of the function (for example,\n * \"arn:aws:lambda:us-west-2:account-id:function:ThumbNail\"). AWS Lambda\n * also allows you to specify only the account ID qualifier (for example,\n * \"account-id:Thumbnail\"). Note that the length constraint applies only\n * to the ARN. If you specify only the function name, it is limited to 64\n * character in length.\n *\n * @return A reference to this updated object so that method calls can be chained\n * together.\n */\n public ListEventSourceMappingsRequest withFunctionName(String functionName) {\n this.functionName = functionName;\n return this;\n }\n\n /**\n * Optional string. An opaque pagination token returned from a previous\n * <code>ListEventSourceMappings</code> operation. If present, specifies\n * to continue the list from where the returning call left off.\n *\n * @return Optional string. An opaque pagination token returned from a previous\n * <code>ListEventSourceMappings</code> operation. If present, specifies\n * to continue the list from where the returning call left off.\n */\n public String getMarker() {\n return marker;\n }\n \n /**\n * Optional string. An opaque pagination token returned from a previous\n * <code>ListEventSourceMappings</code> operation. If present, specifies\n * to continue the list from where the returning call left off.\n *\n * @param marker Optional string. An opaque pagination token returned from a previous\n * <code>ListEventSourceMappings</code> operation. If present, specifies\n * to continue the list from where the returning call left off.\n */\n public void setMarker(String marker) {\n this.marker = marker;\n }\n \n /**\n * Optional string. An opaque pagination token returned from a previous\n * <code>ListEventSourceMappings</code> operation. If present, specifies\n * to continue the list from where the returning call left off.\n * <p>\n * Returns a reference to this object so that method calls can be chained together.\n *\n * @param marker Optional string. An opaque pagination token returned from a previous\n * <code>ListEventSourceMappings</code> operation. If present, specifies\n * to continue the list from where the returning call left off.\n *\n * @return A reference to this updated object so that method calls can be chained\n * together.\n */\n public ListEventSourceMappingsRequest withMarker(String marker) {\n this.marker = marker;\n return this;\n }\n\n /**\n * Optional integer. Specifies the maximum number of event sources to\n * return in response. This value must be greater than 0.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Range: </b>1 - 10000<br/>\n *\n * @return Optional integer. Specifies the maximum number of event sources to\n * return in response. This value must be greater than 0.\n */\n public Integer getMaxItems() {\n return maxItems;\n }\n \n /**\n * Optional integer. Specifies the maximum number of event sources to\n * return in response. This value must be greater than 0.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Range: </b>1 - 10000<br/>\n *\n * @param maxItems Optional integer. Specifies the maximum number of event sources to\n * return in response. This value must be greater than 0.\n */\n public void setMaxItems(Integer maxItems) {\n this.maxItems = maxItems;\n }\n \n /**\n * Optional integer. Specifies the maximum number of event sources to\n * return in response. This value must be greater than 0.\n * <p>\n * Returns a reference to this object so that method calls can be chained together.\n * <p>\n * <b>Constraints:</b><br/>\n * <b>Range: </b>1 - 10000<br/>\n *\n * @param maxItems Optional integer. Specifies the maximum number of event sources to\n * return in response. This value must be greater than 0.\n *\n * @return A reference to this updated object so that method calls can be chained\n * together.\n */\n public ListEventSourceMappingsRequest withMaxItems(Integer maxItems) {\n this.maxItems = maxItems;\n return this;\n }\n\n /**\n * Returns a string representation of this object; useful for testing and\n * debugging.\n *\n * @return A string representation of this object.\n *\n * @see java.lang.Object#toString()\n */\n @Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getEventSourceArn() != null) sb.append(\"EventSourceArn: \" + getEventSourceArn() + \",\");\n if (getFunctionName() != null) sb.append(\"FunctionName: \" + getFunctionName() + \",\");\n if (getMarker() != null) sb.append(\"Marker: \" + getMarker() + \",\");\n if (getMaxItems() != null) sb.append(\"MaxItems: \" + getMaxItems() );\n sb.append(\"}\");\n return sb.toString();\n }\n \n @Override\n public int hashCode() {\n final int prime = 31;\n int hashCode = 1;\n \n hashCode = prime * hashCode + ((getEventSourceArn() == null) ? 0 : getEventSourceArn().hashCode()); \n hashCode = prime * hashCode + ((getFunctionName() == null) ? 0 : getFunctionName().hashCode()); \n hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); \n hashCode = prime * hashCode + ((getMaxItems() == null) ? 0 : getMaxItems().hashCode()); \n return hashCode;\n }\n \n @Override\n public boolean equals(Object obj) {\n if (this == obj) return true;\n if (obj == null) return false;\n\n if (obj instanceof ListEventSourceMappingsRequest == false) return false;\n ListEventSourceMappingsRequest other = (ListEventSourceMappingsRequest)obj;\n \n if (other.getEventSourceArn() == null ^ this.getEventSourceArn() == null) return false;\n if (other.getEventSourceArn() != null && other.getEventSourceArn().equals(this.getEventSourceArn()) == false) return false; \n if (other.getFunctionName() == null ^ this.getFunctionName() == null) return false;\n if (other.getFunctionName() != null && other.getFunctionName().equals(this.getFunctionName()) == false) return false; \n if (other.getMarker() == null ^ this.getMarker() == null) return false;\n if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false; \n if (other.getMaxItems() == null ^ this.getMaxItems() == null) return false;\n if (other.getMaxItems() != null && other.getMaxItems().equals(this.getMaxItems()) == false) return false; \n return true;\n }\n \n @Override\n public ListEventSourceMappingsRequest clone() {\n \n return (ListEventSourceMappingsRequest) super.clone();\n }\n\n}\n ", "meta": {"content_hash": "cb90ef3b857eb8c5397f5a3984299a48", "timestamp": "", "source": "github", "line_count": 349, "max_line_length": 177, "avg_line_length": 43.64756446991404, "alnum_prop": 0.6281756712400709, "repo_name": "sdole/aws-sdk-java", "id": "b9a189e8fa04f19eb34f188672731c8eda1ff188", "size": "15820", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "aws-java-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/ListEventSourceMappingsRequest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "97734456"}, {"name": "Scilab", "bytes": "2354"}]}} +{"text": "/* */ \nvar MapCache = require('./_MapCache');\nvar FUNC_ERROR_TEXT = 'Expected a function';\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\nmemoize.Cache = MapCache;\nmodule.exports = memoize;\n", "meta": {"content_hash": "b944ad8be55e4358263ada0f450ec961", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 89, "avg_line_length": 31.217391304347824, "alnum_prop": 0.6309192200557103, "repo_name": "onlabsorg/olowc", "id": "b51dbeabd4318c9550b9f3cfb116530a86677b74", "size": "718", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jspm_packages/npm/lodash@4.17.4/memoize.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "2128"}, {"name": "JavaScript", "bytes": "2069038"}, {"name": "Makefile", "bytes": "188"}, {"name": "OCaml", "bytes": "485"}, {"name": "Shell", "bytes": "973"}]}} +{"text": "\ufeffusing UnityEngine;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Xml;\nusing System;\n\npublic class SystemScrollviews : MonoBehaviour \n{\n\tpublic GameObject improvementMessageLabel, availableImprovements, buttonLabel, improvementParent, improvementsWindow, improvementDetails;\n\tpublic int techTierToShow, selectedPlanet, selectedSystem, selectedSlot;\n\tpublic GameObject[] tabs = new GameObject[4];\n\tprivate string improvementText, currentImprovement;\n\tpublic UILabel improvementLabel, improvementWealthCost, improvementPowerCost, systemEffects, improvementWealthUpkeep, improvementPowerUpkeep, systemUpkeepPower, systemUpkeepWealth;\n\n\tpublic GameObject[] unbuiltImprovementList = new GameObject[10];\n\tpublic GameObject[] improvementsList = new GameObject[8];\n\tprivate ImprovementsBasic improvementsBasic;\n\n\tvoid Start()\n\t{\t\t\n\t\tSetUpImprovementLabels ();\n\t\tselectedPlanet = -1;\n\t}\n\n\tprivate void SetUpImprovementLabels()\n\t{\t\t\n\t\tfor(int i = 0; i < improvementsList.Length; ++i)\n\t\t{\n\t\t\tEventDelegate.Add(improvementsList[i].GetComponent<UIButton>().onClick, OpenImprovementsWindow);\n\t\t\t\n\t\t\tNGUITools.SetActive(improvementsList[i], false); //Default set improvement to false so it won't be shown in scrollview unless needed\n\t\t}\n\n\t\tfor(int i = 0; i < unbuiltImprovementList.Length; ++i)\n\t\t{\n\t\t\tNGUITools.SetActive(unbuiltImprovementList[i], false);\n\n\t\t\tEventDelegate.Add(unbuiltImprovementList[i].GetComponent<UIButton>().onClick, ShowDetails);\n\t\t}\n\t}\n\n\tprivate void OpenImprovementsWindow()\n\t{\n\t\tif(MasterScript.systemListConstructor.systemList[selectedSystem].systemOwnedBy == MasterScript.playerTurnScript.playerRace)\n\t\t{\n\t\t\tNGUITools.SetActive (improvementsWindow, true);\n\t\t\tNGUITools.SetActive (improvementDetails, false);\n\t\t\tcurrentImprovement = null;\n\t\t\n\t\t\tbool reset = false;\n\n\t\t\tfor(int i = 0; i < tabs.Length; ++i)\n\t\t\t{\n\t\t\t\tif(tabs[i].GetComponent<UISprite>().spriteName == \"Button Hover (Orange)\")\n\t\t\t\t{\n\t\t\t\t\tUpdateImprovementsWindow (i);\n\t\t\t\t\treset = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(reset == false)\n\t\t\t{\n\t\t\t\ttabs[0].GetComponent<UIButton>().enabled = false;\n\t\t\t\ttabs[0].GetComponent<UISprite>().spriteName = \"Button Hover (Orange)\";\n\t\t\t\tUpdateImprovementsWindow (0);\n\t\t\t}\n\n\t\t\tselectedSlot = -1;\n\t\t\t\n\t\t\tfor(int i = 0; i < improvementsList.Length; ++i)\n\t\t\t{\n\t\t\t\tif(UIButton.current.gameObject == improvementsList[i])\n\t\t\t\t{\n\t\t\t\t\tselectedSlot = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void ShowDetails()\n\t{\n\t\tfor(int i = 0; i < unbuiltImprovementList.Length; ++i)\n\t\t{\n\t\t\tif(UIButton.current.gameObject == unbuiltImprovementList[i])\n\t\t\t{\n\t\t\t\tunbuiltImprovementList[i].GetComponent<UIButton>().enabled = false;\n\t\t\t\tunbuiltImprovementList[i].GetComponent<UISprite>().spriteName = \"Button Hover (Orange)\";\n\t\t\t\tcurrentImprovement = UIButton.current.transform.Find (\"Label\").gameObject.GetComponent<UILabel>().text;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\tunbuiltImprovementList[i].GetComponent<UISprite>().spriteName = \"Button Click\";\n\t\t\t\tunbuiltImprovementList[i].GetComponent<UIButton>().enabled = true;\n\t\t\t}\n\t\t}\n\n\t\tVector3 tempPos = UIButton.current.transform.localPosition;\n\n\t\timprovementDetails.transform.localPosition = new Vector3 (tempPos.x + 265f, tempPos.y, tempPos.z); \n\n\t\tfor(int i = 0; i < MasterScript.systemListConstructor.basicImprovementsList.Count; ++i)\n\t\t{\n\t\t\tif(MasterScript.systemListConstructor.basicImprovementsList[i].name.ToUpper() == UIButton.current.transform.Find (\"Label\").GetComponent<UILabel>().text)\n\t\t\t{\n\t\t\t\timprovementLabel.text = MasterScript.systemListConstructor.basicImprovementsList[i].details;\n\n\t\t\t\timprovementPowerCost.text = MasterScript.systemListConstructor.basicImprovementsList[i].cost.ToString();\n\t\t\t\timprovementWealthCost.text = (MasterScript.systemListConstructor.basicImprovementsList[i].cost / 25).ToString();\n\n\t\t\t\timprovementPowerUpkeep.text = \"-\" + MasterScript.systemListConstructor.basicImprovementsList[i].powerUpkeep.ToString();\n\t\t\t\timprovementWealthUpkeep.text = \"-\" + MasterScript.systemListConstructor.basicImprovementsList[i].wealthUpkeep.ToString();\n\t\t\t}\n\t\t}\n\n\t\tNGUITools.SetActive (improvementDetails, true);\n\t}\n\n\tprivate void UpdateImprovementsWindow(int level)\n\t{\n\t\tfor(int i = 0; i < unbuiltImprovementList.Length; ++i)\n\t\t{\n\t\t\tNGUITools.SetActive(unbuiltImprovementList[i], false);\n\t\t}\n\n\t\tint j = 0;\n\n\t\tfor(int i = 0; i < improvementsBasic.listOfImprovements.Count; ++i)\n\t\t{\n\t\t\tif(improvementsBasic.listOfImprovements[i].improvementLevel == level)\n\t\t\t{\n\t\t\t\tif(improvementsBasic.listOfImprovements[i].improvementCategory == \"Generic\" || improvementsBasic.listOfImprovements[i].improvementCategory == \"Defence\" \n\t\t\t\t || improvementsBasic.listOfImprovements[i].improvementCategory == MasterScript.playerTurnScript.playerRace)\n\t\t\t\t{\n\t\t\t\t\tif(improvementsBasic.listOfImprovements[i].hasBeenBuilt == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tNGUITools.SetActive(unbuiltImprovementList[j], true);\n\t\t\t\t\t\t\n\t\t\t\t\t\tunbuiltImprovementList[j].transform.Find(\"Label\").GetComponent<UILabel>().text = improvementsBasic.listOfImprovements[i].improvementName.ToUpper();\n\n\t\t\t\t\t\t++j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = j; j < unbuiltImprovementList.Length; ++j)\n\t\t{\n\t\t\tNGUITools.SetActive(unbuiltImprovementList[i], false);\n\t\t}\n\t}\n\n\tpublic void UpdateBuiltImprovements()\n\t{\n\t\tfor(int i = 0; i < improvementsList.Length; ++i) //For all improvement slots\n\t\t{\n\t\t\tif(i < MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].currentImprovementSlots) //If is equal to or less than planets slots\n\t\t\t{\n\t\t\t\tNGUITools.SetActive(improvementsList[i], true); //Activate\n\n\t\t\t\tif(MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].improvementsBuilt[i] != null) //If something built\n\t\t\t\t{\n\t\t\t\t\timprovementsList[i].transform.Find (\"Name\").GetComponent<UILabel>().text = MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].improvementsBuilt[i].ToUpper(); //Set text\n\t\t\t\t\timprovementsList[i].GetComponent<UIButton>().enabled = false;\n\t\t\t\t\timprovementsList[i].GetComponent<UISprite>().spriteName = \"Button Normal\";\n\t\t\t\t}\n\n\t\t\t\telse //Else say is empty\n\t\t\t\t{\n\t\t\t\t\timprovementsList[i].transform.Find (\"Name\").GetComponent<UILabel>().text = \"Empty\";\n\n\t\t\t\t\tif(selectedSlot == i)\n\t\t\t\t\t{\n\t\t\t\t\t\timprovementsList[i].GetComponent<UIButton>().enabled = false;\n\t\t\t\t\t\timprovementsList[i].GetComponent<UISprite>().spriteName = \"Button Hover (Orange)\";\n\t\t\t\t\t}\n\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\timprovementsList[i].GetComponent<UIButton>().enabled = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\telse //Else deactivate\n\t\t\t{\n\t\t\t\tNGUITools.SetActive(improvementsList[i], false);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void UpdateTabs()\n\t{\n\t\tfor(int i = 0; i < tabs.Length; ++i)\n\t\t{\n\t\t\tif(i <= improvementsBasic.techTier)\n\t\t\t{\n\t\t\t\tif(tabs[i].GetComponent<UISprite>().spriteName == \"Button Hover (Orange)\")\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttabs[i].GetComponent<UIButton>().enabled = true;\n\t\t\t\t\ttabs[i].GetComponent<UISprite>().spriteName = \"Button Normal\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttabs[i].GetComponent<UIButton>().enabled = false;\n\t\t\t\ttabs[i].GetComponent<UISprite>().spriteName = \"Button Deactivated\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic void TabClick()\n\t{\n\t\tNGUITools.SetActive (improvementDetails, false);\n\t\tcurrentImprovement = null;\n\n\t\tfor(int i = 0; i < tabs.Length; ++i)\n\t\t{\n\t\t\tif(tabs[i] == UIButton.current.gameObject)\n\t\t\t{\n\t\t\t\ttabs[i].GetComponent<UIButton>().enabled = false;\n\t\t\t\ttabs[i].GetComponent<UISprite>().spriteName = \"Button Hover (Orange)\";\n\t\t\t\tUpdateImprovementsWindow(i);\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(i <= improvementsBasic.techTier)\n\t\t\t\t{\n\t\t\t\t\ttabs[i].GetComponent<UIButton>().enabled = true;\n\t\t\t\t\ttabs[i].GetComponent<UISprite>().spriteName = \"Button Normal\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttabs[i].GetComponent<UIButton>().enabled = false;\n\t\t\t\t\ttabs[i].GetComponent<UISprite>().spriteName = \"Button Deactivated\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void UpdateUpkeep()\n\t{\n\t\tfloat upkeepWealth = 0, upkeepPower = 0;\n\t\t\n\t\tfor(int i = 0; i < MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].improvementsBuilt.Count; ++i)\n\t\t{\n\t\t\tfor(int j = 0; j < MasterScript.systemListConstructor.basicImprovementsList.Count; ++j)\n\t\t\t{\n\t\t\t\tif(improvementsBasic.listOfImprovements[j].hasBeenBuilt == false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].improvementsBuilt[i] == MasterScript.systemListConstructor.basicImprovementsList[j].name)\n\t\t\t\t{\n\t\t\t\t\tupkeepWealth += MasterScript.systemListConstructor.basicImprovementsList[j].wealthUpkeep;\n\t\t\t\t\tupkeepPower += MasterScript.systemListConstructor.basicImprovementsList[j].powerUpkeep;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tsystemUpkeepPower.text = upkeepPower.ToString();\n\t\tsystemUpkeepWealth.text = upkeepWealth.ToString ();\n\t}\n\t\n\tvoid Update()\n\t{\n\t\tif(MasterScript.systemGUI.selectedSystem != selectedSystem)\n\t\t{\n\t\t\tNGUITools.SetActive(improvementsWindow, false);\n\t\t\tselectedSystem = MasterScript.systemGUI.selectedSystem;\n\t\t\timprovementsBasic = MasterScript.systemListConstructor.systemList [selectedSystem].systemObject.GetComponent<ImprovementsBasic> ();\n\t\t}\n\n\t\tif(MasterScript.cameraFunctionsScript.openMenu == true)\n\t\t{\n\t\t\tif(selectedPlanet != -1)\n\t\t\t{\n\t\t\t\tif(improvementsWindow.activeInHierarchy == true)\n\t\t\t\t{\n\t\t\t\t\tUpdateTabs();\n\t\t\t\t}\n\n\t\t\t\tUpdateBuiltImprovements();\n\t\t\t\tUpdateSystemEffects (selectedSystem, selectedPlanet);\n\t\t\t\tUpdateUpkeep();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(Input.GetKeyDown(\"c\"))\n\t\t{\n\t\t\tNGUITools.SetActive(availableImprovements, false);\n\t\t}\n\t}\n\n\tpublic void UpdateSystemEffects(int system, int planet) //TODO this needs to be planet specific\n\t{\n\t\timprovementsBasic = MasterScript.systemListConstructor.systemList[selectedSystem].systemObject.GetComponent<ImprovementsBasic>();\n\n\t\tstring temp = \"\";\n\n\t\tfloat knoTemp = (MasterScript.systemListConstructor.systemList[system].sysKnowledgeModifier + MasterScript.systemListConstructor.systemList[system].planetsInSystem[planet].knowledgeModifier) - 1;\n\t\tfloat powTemp = (MasterScript.systemListConstructor.systemList[system].sysPowerModifier + MasterScript.systemListConstructor.systemList[system].planetsInSystem[planet].powerModifier) - 1;\n\t\tfloat growTemp = MasterScript.systemListConstructor.systemList[system].sysGrowthModifier + MasterScript.systemListConstructor.systemList[system].planetsInSystem[planet].growthModifier;\n\t\tfloat popTemp = MasterScript.systemListConstructor.systemList[system].sysMaxPopulationModifier + MasterScript.systemListConstructor.systemList[system].planetsInSystem[planet].maxPopulationModifier;\n\t\tfloat amberPenalty = MasterScript.systemListConstructor.systemList[system].sysAmberPenalty + MasterScript.systemListConstructor.systemList[system].planetsInSystem[planet].amberPenalty;\n\t\tfloat amberProd = (MasterScript.systemListConstructor.systemList[system].sysAmberModifier + MasterScript.systemListConstructor.systemList[system].planetsInSystem[planet].amberModifier) - 1;\n\n\t\tif(knoTemp != 0f)\n\t\t{\n\t\t\tif(temp != \"\")\n\t\t\t{\n\t\t\t\ttemp = temp + \"\\n+\";\n\t\t\t}\n\n\t\t\ttemp = temp + Math.Round(knoTemp * 100, 1) + \"% Knowledge from Improvements\";\n\t\t}\n\t\tif(powTemp != 0f)\n\t\t{\n\t\t\tif(temp != \"\")\n\t\t\t{\n\t\t\t\ttemp = temp + \"\\n+\";\n\t\t\t}\n\n\t\t\ttemp = temp + Math.Round(powTemp * 100, 1) + \"% Power from Improvements\";\n\t\t}\n\t\tif(growTemp != 0f)\n\t\t{\n\t\t\tif(temp != \"\")\n\t\t\t{\n\t\t\t\ttemp = temp + \"\\n+\";\n\t\t\t}\n\n\t\t\ttemp = temp + Math.Round(growTemp, 2) + \"% Growth from Improvements\";\n\t\t}\n\t\tif(popTemp != 0f)\n\t\t{\n\t\t\tif(temp != \"\")\n\t\t\t{\n\t\t\t\ttemp = temp + \"\\n+\";\n\t\t\t}\n\n\t\t\ttemp = temp + Math.Round(popTemp, 1) + \"% Population from Improvements\";\n\t\t}\n\n\t\tint standardSize = MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].baseImprovementSlots;\n\n\t\tif(MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].currentImprovementSlots > standardSize)\n\t\t{\n\t\t\tif(temp != \"\")\n\t\t\t{\n\t\t\t\ttemp = temp + \"\\n+\";\n\t\t\t}\n\n\t\t\ttemp = temp + (MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].currentImprovementSlots - standardSize).ToString() + \" Improvement Slots on Planet\";\n\t\t}\n\t\tif(amberPenalty != 1f)\n\t\t{\n\t\t\tif(temp != \"\")\n\t\t\t{\n\t\t\t\ttemp = temp + \"\\n+\";\n\t\t\t}\n\n\t\t\ttemp = temp + Math.Round ((1 - amberPenalty) * 100, 1) + \"% Amber Penalty on System\";\n\t\t}\n\t\tif(amberProd != 0)\n\t\t{\n\t\t\tif(temp != \"\")\n\t\t\t{\n\t\t\t\ttemp = temp + \"\\n+\";\n\t\t\t}\n\n\t\t\ttemp = temp + Math.Round (amberProd * 100, 1) + \"% Amber Production on System\";\n\t\t}\n\t\tif(improvementsBasic.improvementCostModifier != 0f)\n\t\t{\n\t\t\tif(temp != \"\")\n\t\t\t{\n\t\t\t\ttemp = temp + \"\\n\";\n\t\t\t}\n\n\t\t\ttemp = temp + improvementsBasic.improvementCostModifier + \" less Power required for Improvements\";\n\t\t}\n\t\tif(improvementsBasic.researchCost != 0f)\n\t\t{\n\t\t\tif(temp != \"\")\n\t\t\t{\n\t\t\t\ttemp = temp + \"\\n\";\n\t\t\t}\n\n\t\t\ttemp = temp + improvementsBasic.researchCost + \" less Knowledge required for Research\";\n\t\t}\n\n\t\t/*\n\t\tamberPointBonus;\n\t\tpublic float tempWealth, tempKnwlUnitBonus, tempPowUnitBonus, tempResearchCostReduction, tempImprovementCostReduction, \n\t\ttempBonusAmbition;\n\n\t\tfor(int i = 0; i < improvementsBasic.listOfImprovements.Count; ++i)\n\t\t{\n\t\t\tif(improvementsBasic.listOfImprovements[i].hasBeenBuilt == true)\n\t\t\t{\n\t\t\t\tif(temp == \"\")\n\t\t\t\t{\n\t\t\t\t\ttemp = improvementsBasic.listOfImprovements[i].improvementMessage.ToUpper();\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttemp = temp + \"\\n\" + improvementsBasic.listOfImprovements[i].improvementMessage.ToUpper();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t*/\n\n\t\tif(temp == \"\")\n\t\t{\n\t\t\ttemp = \"NO EFFECTS ON SYSTEM\";\n\t\t}\n\n\t\tsystemEffects.text = temp;\n\t\tsystemEffects.transform.parent.GetComponent<UISprite> ().height = systemEffects.height + 20;\n\t}\n\n\tpublic void BuildImprovement()\n\t{\n\t\tNGUITools.SetActive (improvementDetails, false);\n\n\t\timprovementsBasic = MasterScript.systemListConstructor.systemList[selectedSystem].systemObject.GetComponent<ImprovementsBasic>();\n\t\t\n\t\tfor(int i = 0; i < improvementsBasic.listOfImprovements.Count; ++i)\n\t\t{\n\t\t\tif(improvementsBasic.listOfImprovements[i].improvementName.ToUpper () == currentImprovement)\n\t\t\t{\n\t\t\t\tfor(int j = 0; j < MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].currentImprovementSlots; ++j)\n\t\t\t\t{\n\t\t\t\t\tif(MasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].improvementsBuilt[j] == null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(improvementsBasic.ImproveSystem(i) == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\timprovementsBasic.ActiveTechnologies(selectedSystem, MasterScript.playerTurnScript);\n\t\t\t\t\t\t\tMasterScript.systemListConstructor.systemList[selectedSystem].planetsInSystem[selectedPlanet].improvementsBuilt[j] = improvementsBasic.listOfImprovements[i].improvementName;\n\t\t\t\t\t\t\tUpdateImprovementsWindow(improvementsBasic.listOfImprovements[i].improvementLevel);\n\t\t\t\t\t\t\tUpdateBuiltImprovements();\n\t\t\t\t\t\t\tcurrentImprovement = null;\n\t\t\t\t\t\t\tselectedSlot = -1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < unbuiltImprovementList.Length; ++i)\n\t\t{\n\t\t\tunbuiltImprovementList[i].GetComponent<UISprite>().spriteName = \"Button Normal\";\n\t\t\tunbuiltImprovementList[i].GetComponent<UIButton>().enabled = true;\n\t\t}\n\n\t\tNGUITools.SetActive(improvementsWindow, false);\n\t}\n\t\n\tprivate void CheckForTierUnlock()\n\t{\n\t\tfor(int i = 0; i < 4; ++i)\n\t\t{\n\t\t\tUIButton temp = tabs[i].gameObject.GetComponent<UIButton>();\n\n\t\t\tif(improvementsBasic.techTier >= i && temp.enabled == false)\n\t\t\t{\n\t\t\t\ttemp.enabled = true;\n\t\t\t}\n\t\t\tif(improvementsBasic.techTier < i && temp.enabled == true)\n\t\t\t{\n\t\t\t\ttemp.enabled = false;\n\t\t\t}\n\t\t}\n\t}\n}\n", "meta": {"content_hash": "6c52717d8bbbbb1ae9c235432a053de8", "timestamp": "", "source": "github", "line_count": 490, "max_line_length": 216, "avg_line_length": 31.63469387755102, "alnum_prop": 0.7123411392813367, "repo_name": "Shemamforash/Crucible", "id": "84fa05cdf43143fdf158fe3ded82afdb878c135b", "size": "15503", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Scripts/UIScripts/SystemScrollviews.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "376581"}]}} +{"text": "r\"\"\"HTTP cookie handling for web clients.\n\nThis module has (now fairly distant) origins in Gisle Aas' Perl module\nHTTP::Cookies, from the libwww-perl library.\n\nDocstrings, comments and debug strings in this code refer to the\nattributes of the HTTP cookie system as cookie-attributes, to distinguish\nthem clearly from Python attributes.\n\nClass diagram (note that BSDDBCookieJar and the MSIE* classes are not\ndistributed with the Python standard library, but are available from\nhttp://wwwsearch.sf.net/):\n\n CookieJar____\n / \\ \\\n FileCookieJar \\ \\\n / | \\ \\ \\\n MozillaCookieJar | LWPCookieJar \\ \\\n | | \\\n | ---MSIEBase | \\\n | / | | \\\n | / MSIEDBCookieJar BSDDBCookieJar\n |/\n MSIECookieJar\n\n\"\"\"\n\n__all__ = ['Cookie', 'CookieJar', 'CookiePolicy', 'DefaultCookiePolicy',\n 'FileCookieJar', 'LWPCookieJar', 'LoadError', 'MozillaCookieJar']\n\nimport copy\nimport datetime\nimport re\nimport time\nimport urllib.parse, urllib.request\ntry:\n import threading as _threading\nexcept ImportError:\n import dummy_threading as _threading\nimport http.client # only for the default HTTP port\nfrom calendar import timegm\n\ndebug = False # set to True to enable debugging via the logging module\nlogger = None\n\ndef _debug(*args):\n if not debug:\n return\n global logger\n if not logger:\n import logging\n logger = logging.getLogger(\"http.cookiejar\")\n return logger.debug(*args)\n\n\nDEFAULT_HTTP_PORT = str(http.client.HTTP_PORT)\nMISSING_FILENAME_TEXT = (\"a filename was not supplied (nor was the CookieJar \"\n \"instance initialised with one)\")\n\ndef _warn_unhandled_exception():\n # There are a few catch-all except: statements in this module, for\n # catching input that's bad in unexpected ways. Warn if any\n # exceptions are caught there.\n import io, warnings, traceback\n f = io.StringIO()\n traceback.print_exc(None, f)\n msg = f.getvalue()\n warnings.warn(\"http.cookiejar bug!\\n%s\" % msg, stacklevel=2)\n\n\n# Date/time conversion\n# -----------------------------------------------------------------------------\n\nEPOCH_YEAR = 1970\ndef _timegm(tt):\n year, month, mday, hour, min, sec = tt[:6]\n if ((year >= EPOCH_YEAR) and (1 <= month <= 12) and (1 <= mday <= 31) and\n (0 <= hour <= 24) and (0 <= min <= 59) and (0 <= sec <= 61)):\n return timegm(tt)\n else:\n return None\n\nDAYS = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"]\nMONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\",\n \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\nMONTHS_LOWER = []\nfor month in MONTHS: MONTHS_LOWER.append(month.lower())\n\ndef time2isoz(t=None):\n \"\"\"Return a string representing time in seconds since epoch, t.\n\n If the function is called without an argument, it will use the current\n time.\n\n The format of the returned string is like \"YYYY-MM-DD hh:mm:ssZ\",\n representing Universal Time (UTC, aka GMT). An example of this format is:\n\n 1994-11-24 08:49:37Z\n\n \"\"\"\n if t is None:\n dt = datetime.datetime.utcnow()\n else:\n dt = datetime.datetime.utcfromtimestamp(t)\n return \"%04d-%02d-%02d %02d:%02d:%02dZ\" % (\n dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second)\n\ndef time2netscape(t=None):\n \"\"\"Return a string representing time in seconds since epoch, t.\n\n If the function is called without an argument, it will use the current\n time.\n\n The format of the returned string is like this:\n\n Wed, DD-Mon-YYYY HH:MM:SS GMT\n\n \"\"\"\n if t is None:\n dt = datetime.datetime.utcnow()\n else:\n dt = datetime.datetime.utcfromtimestamp(t)\n return \"%s %02d-%s-%04d %02d:%02d:%02d GMT\" % (\n DAYS[dt.weekday()], dt.day, MONTHS[dt.month-1],\n dt.year, dt.hour, dt.minute, dt.second)\n\n\nUTC_ZONES = {\"GMT\": None, \"UTC\": None, \"UT\": None, \"Z\": None}\n\nTIMEZONE_RE = re.compile(r\"^([-+])?(\\d\\d?):?(\\d\\d)?$\", re.ASCII)\ndef offset_from_tz_string(tz):\n offset = None\n if tz in UTC_ZONES:\n offset = 0\n else:\n m = TIMEZONE_RE.search(tz)\n if m:\n offset = 3600 * int(m.group(2))\n if m.group(3):\n offset = offset + 60 * int(m.group(3))\n if m.group(1) == '-':\n offset = -offset\n return offset\n\ndef _str2time(day, mon, yr, hr, min, sec, tz):\n # translate month name to number\n # month numbers start with 1 (January)\n try:\n mon = MONTHS_LOWER.index(mon.lower())+1\n except ValueError:\n # maybe it's already a number\n try:\n imon = int(mon)\n except ValueError:\n return None\n if 1 <= imon <= 12:\n mon = imon\n else:\n return None\n\n # make sure clock elements are defined\n if hr is None: hr = 0\n if min is None: min = 0\n if sec is None: sec = 0\n\n yr = int(yr)\n day = int(day)\n hr = int(hr)\n min = int(min)\n sec = int(sec)\n\n if yr < 1000:\n # find \"obvious\" year\n cur_yr = time.localtime(time.time())[0]\n m = cur_yr % 100\n tmp = yr\n yr = yr + cur_yr - m\n m = m - tmp\n if abs(m) > 50:\n if m > 0: yr = yr + 100\n else: yr = yr - 100\n\n # convert UTC time tuple to seconds since epoch (not timezone-adjusted)\n t = _timegm((yr, mon, day, hr, min, sec, tz))\n\n if t is not None:\n # adjust time using timezone string, to get absolute time since epoch\n if tz is None:\n tz = \"UTC\"\n tz = tz.upper()\n offset = offset_from_tz_string(tz)\n if offset is None:\n return None\n t = t - offset\n\n return t\n\nSTRICT_DATE_RE = re.compile(\n r\"^[SMTWF][a-z][a-z], (\\d\\d) ([JFMASOND][a-z][a-z]) \"\n \"(\\d\\d\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$\", re.ASCII)\nWEEKDAY_RE = re.compile(\n r\"^(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)[a-z]*,?\\s*\", re.I | re.ASCII)\nLOOSE_HTTP_DATE_RE = re.compile(\n r\"\"\"^\n (\\d\\d?) # day\n (?:\\s+|[-\\/])\n (\\w+) # month\n (?:\\s+|[-\\/])\n (\\d+) # year\n (?:\n (?:\\s+|:) # separator before clock\n (\\d\\d?):(\\d\\d) # hour:min\n (?::(\\d\\d))? # optional seconds\n )? # optional clock\n \\s*\n ([-+]?\\d{2,4}|(?![APap][Mm]\\b)[A-Za-z]+)? # timezone\n \\s*\n (?:\\(\\w+\\))? # ASCII representation of timezone in parens.\n \\s*$\"\"\", re.X | re.ASCII)\ndef http2time(text):\n \"\"\"Returns time in seconds since epoch of time represented by a string.\n\n Return value is an integer.\n\n None is returned if the format of str is unrecognized, the time is outside\n the representable range, or the timezone string is not recognized. If the\n string contains no timezone, UTC is assumed.\n\n The timezone in the string may be numerical (like \"-0800\" or \"+0100\") or a\n string timezone (like \"UTC\", \"GMT\", \"BST\" or \"EST\"). Currently, only the\n timezone strings equivalent to UTC (zero offset) are known to the function.\n\n The function loosely parses the following formats:\n\n Wed, 09 Feb 1994 22:23:32 GMT -- HTTP format\n Tuesday, 08-Feb-94 14:15:29 GMT -- old rfc850 HTTP format\n Tuesday, 08-Feb-1994 14:15:29 GMT -- broken rfc850 HTTP format\n 09 Feb 1994 22:23:32 GMT -- HTTP format (no weekday)\n 08-Feb-94 14:15:29 GMT -- rfc850 format (no weekday)\n 08-Feb-1994 14:15:29 GMT -- broken rfc850 format (no weekday)\n\n The parser ignores leading and trailing whitespace. The time may be\n absent.\n\n If the year is given with only 2 digits, the function will select the\n century that makes the year closest to the current date.\n\n \"\"\"\n # fast exit for strictly conforming string\n m = STRICT_DATE_RE.search(text)\n if m:\n g = m.groups()\n mon = MONTHS_LOWER.index(g[1].lower()) + 1\n tt = (int(g[2]), mon, int(g[0]),\n int(g[3]), int(g[4]), float(g[5]))\n return _timegm(tt)\n\n # No, we need some messy parsing...\n\n # clean up\n text = text.lstrip()\n text = WEEKDAY_RE.sub(\"\", text, 1) # Useless weekday\n\n # tz is time zone specifier string\n day, mon, yr, hr, min, sec, tz = [None]*7\n\n # loose regexp parse\n m = LOOSE_HTTP_DATE_RE.search(text)\n if m is not None:\n day, mon, yr, hr, min, sec, tz = m.groups()\n else:\n return None # bad format\n\n return _str2time(day, mon, yr, hr, min, sec, tz)\n\nISO_DATE_RE = re.compile(\n \"\"\"^\n (\\d{4}) # year\n [-\\/]?\n (\\d\\d?) # numerical month\n [-\\/]?\n (\\d\\d?) # day\n (?:\n (?:\\s+|[-:Tt]) # separator before clock\n (\\d\\d?):?(\\d\\d) # hour:min\n (?::?(\\d\\d(?:\\.\\d*)?))? # optional seconds (and fractional)\n )? # optional clock\n \\s*\n ([-+]?\\d\\d?:?(:?\\d\\d)?\n |Z|z)? # timezone (Z is \"zero meridian\", i.e. GMT)\n \\s*$\"\"\", re.X | re. ASCII)\ndef iso2time(text):\n \"\"\"\n As for http2time, but parses the ISO 8601 formats:\n\n 1994-02-03 14:15:29 -0100 -- ISO 8601 format\n 1994-02-03 14:15:29 -- zone is optional\n 1994-02-03 -- only date\n 1994-02-03T14:15:29 -- Use T as separator\n 19940203T141529Z -- ISO 8601 compact format\n 19940203 -- only date\n\n \"\"\"\n # clean up\n text = text.lstrip()\n\n # tz is time zone specifier string\n day, mon, yr, hr, min, sec, tz = [None]*7\n\n # loose regexp parse\n m = ISO_DATE_RE.search(text)\n if m is not None:\n # XXX there's an extra bit of the timezone I'm ignoring here: is\n # this the right thing to do?\n yr, mon, day, hr, min, sec, tz, _ = m.groups()\n else:\n return None # bad format\n\n return _str2time(day, mon, yr, hr, min, sec, tz)\n\n\n# Header parsing\n# -----------------------------------------------------------------------------\n\ndef unmatched(match):\n \"\"\"Return unmatched part of re.Match object.\"\"\"\n start, end = match.span(0)\n return match.string[:start]+match.string[end:]\n\nHEADER_TOKEN_RE = re.compile(r\"^\\s*([^=\\s;,]+)\")\nHEADER_QUOTED_VALUE_RE = re.compile(r\"^\\s*=\\s*\\\"([^\\\"\\\\]*(?:\\\\.[^\\\"\\\\]*)*)\\\"\")\nHEADER_VALUE_RE = re.compile(r\"^\\s*=\\s*([^\\s;,]*)\")\nHEADER_ESCAPE_RE = re.compile(r\"\\\\(.)\")\ndef split_header_words(header_values):\n r\"\"\"Parse header values into a list of lists containing key,value pairs.\n\n The function knows how to deal with \",\", \";\" and \"=\" as well as quoted\n values after \"=\". A list of space separated tokens are parsed as if they\n were separated by \";\".\n\n If the header_values passed as argument contains multiple values, then they\n are treated as if they were a single value separated by comma \",\".\n\n This means that this function is useful for parsing header fields that\n follow this syntax (BNF as from the HTTP/1.1 specification, but we relax\n the requirement for tokens).\n\n headers = #header\n header = (token | parameter) *( [\";\"] (token | parameter))\n\n token = 1*<any CHAR except CTLs or separators>\n separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n | \",\" | \";\" | \":\" | \"\\\" | <\">\n | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n | \"{\" | \"}\" | SP | HT\n\n quoted-string = ( <\"> *(qdtext | quoted-pair ) <\"> )\n qdtext = <any TEXT except <\">>\n quoted-pair = \"\\\" CHAR\n\n parameter = attribute \"=\" value\n attribute = token\n value = token | quoted-string\n\n Each header is represented by a list of key/value pairs. The value for a\n simple token (not part of a parameter) is None. Syntactically incorrect\n headers will not necessarily be parsed as you would want.\n\n This is easier to describe with some examples:\n\n >>> split_header_words(['foo=\"bar\"; port=\"80,81\"; discard, bar=baz'])\n [[('foo', 'bar'), ('port', '80,81'), ('discard', None)], [('bar', 'baz')]]\n >>> split_header_words(['text/html; charset=\"iso-8859-1\"'])\n [[('text/html', None), ('charset', 'iso-8859-1')]]\n >>> split_header_words([r'Basic realm=\"\\\"foo\\bar\\\"\"'])\n [[('Basic', None), ('realm', '\"foobar\"')]]\n\n \"\"\"\n assert not isinstance(header_values, str)\n result = []\n for text in header_values:\n orig_text = text\n pairs = []\n while text:\n m = HEADER_TOKEN_RE.search(text)\n if m:\n text = unmatched(m)\n name = m.group(1)\n m = HEADER_QUOTED_VALUE_RE.search(text)\n if m: # quoted value\n text = unmatched(m)\n value = m.group(1)\n value = HEADER_ESCAPE_RE.sub(r\"\\1\", value)\n else:\n m = HEADER_VALUE_RE.search(text)\n if m: # unquoted value\n text = unmatched(m)\n value = m.group(1)\n value = value.rstrip()\n else:\n # no value, a lone token\n value = None\n pairs.append((name, value))\n elif text.lstrip().startswith(\",\"):\n # concatenated headers, as per RFC 2616 section 4.2\n text = text.lstrip()[1:]\n if pairs: result.append(pairs)\n pairs = []\n else:\n # skip junk\n non_junk, nr_junk_chars = re.subn(\"^[=\\s;]*\", \"\", text)\n assert nr_junk_chars > 0, (\n \"split_header_words bug: '%s', '%s', %s\" %\n (orig_text, text, pairs))\n text = non_junk\n if pairs: result.append(pairs)\n return result\n\nHEADER_JOIN_ESCAPE_RE = re.compile(r\"([\\\"\\\\])\")\ndef join_header_words(lists):\n \"\"\"Do the inverse (almost) of the conversion done by split_header_words.\n\n Takes a list of lists of (key, value) pairs and produces a single header\n value. Attribute values are quoted if needed.\n\n >>> join_header_words([[(\"text/plain\", None), (\"charset\", \"iso-8859/1\")]])\n 'text/plain; charset=\"iso-8859/1\"'\n >>> join_header_words([[(\"text/plain\", None)], [(\"charset\", \"iso-8859/1\")]])\n 'text/plain, charset=\"iso-8859/1\"'\n\n \"\"\"\n headers = []\n for pairs in lists:\n attr = []\n for k, v in pairs:\n if v is not None:\n if not re.search(r\"^\\w+$\", v):\n v = HEADER_JOIN_ESCAPE_RE.sub(r\"\\\\\\1\", v) # escape \" and \\\n v = '\"%s\"' % v\n k = \"%s=%s\" % (k, v)\n attr.append(k)\n if attr: headers.append(\"; \".join(attr))\n return \", \".join(headers)\n\ndef strip_quotes(text):\n if text.startswith('\"'):\n text = text[1:]\n if text.endswith('\"'):\n text = text[:-1]\n return text\n\ndef parse_ns_headers(ns_headers):\n \"\"\"Ad-hoc parser for Netscape protocol cookie-attributes.\n\n The old Netscape cookie format for Set-Cookie can for instance contain\n an unquoted \",\" in the expires field, so we have to use this ad-hoc\n parser instead of split_header_words.\n\n XXX This may not make the best possible effort to parse all the crap\n that Netscape Cookie headers contain. Ronald Tschalar's HTTPClient\n parser is probably better, so could do worse than following that if\n this ever gives any trouble.\n\n Currently, this is also used for parsing RFC 2109 cookies.\n\n \"\"\"\n known_attrs = (\"expires\", \"domain\", \"path\", \"secure\",\n # RFC 2109 attrs (may turn up in Netscape cookies, too)\n \"version\", \"port\", \"max-age\")\n\n result = []\n for ns_header in ns_headers:\n pairs = []\n version_set = False\n for ii, param in enumerate(re.split(r\";\\s*\", ns_header)):\n param = param.rstrip()\n if param == \"\": continue\n if \"=\" not in param:\n k, v = param, None\n else:\n k, v = re.split(r\"\\s*=\\s*\", param, 1)\n k = k.lstrip()\n if ii != 0:\n lc = k.lower()\n if lc in known_attrs:\n k = lc\n if k == \"version\":\n # This is an RFC 2109 cookie.\n v = strip_quotes(v)\n version_set = True\n if k == \"expires\":\n # convert expires date to seconds since epoch\n v = http2time(strip_quotes(v)) # None if invalid\n pairs.append((k, v))\n\n if pairs:\n if not version_set:\n pairs.append((\"version\", \"0\"))\n result.append(pairs)\n\n return result\n\n\nIPV4_RE = re.compile(r\"\\.\\d+$\", re.ASCII)\ndef is_HDN(text):\n \"\"\"Return True if text is a host domain name.\"\"\"\n # XXX\n # This may well be wrong. Which RFC is HDN defined in, if any (for\n # the purposes of RFC 2965)?\n # For the current implementation, what about IPv6? Remember to look\n # at other uses of IPV4_RE also, if change this.\n if IPV4_RE.search(text):\n return False\n if text == \"\":\n return False\n if text[0] == \".\" or text[-1] == \".\":\n return False\n return True\n\ndef domain_match(A, B):\n \"\"\"Return True if domain A domain-matches domain B, according to RFC 2965.\n\n A and B may be host domain names or IP addresses.\n\n RFC 2965, section 1:\n\n Host names can be specified either as an IP address or a HDN string.\n Sometimes we compare one host name with another. (Such comparisons SHALL\n be case-insensitive.) Host A's name domain-matches host B's if\n\n * their host name strings string-compare equal; or\n\n * A is a HDN string and has the form NB, where N is a non-empty\n name string, B has the form .B', and B' is a HDN string. (So,\n x.y.com domain-matches .Y.com but not Y.com.)\n\n Note that domain-match is not a commutative operation: a.b.c.com\n domain-matches .c.com, but not the reverse.\n\n \"\"\"\n # Note that, if A or B are IP addresses, the only relevant part of the\n # definition of the domain-match algorithm is the direct string-compare.\n A = A.lower()\n B = B.lower()\n if A == B:\n return True\n if not is_HDN(A):\n return False\n i = A.rfind(B)\n if i == -1 or i == 0:\n # A does not have form NB, or N is the empty string\n return False\n if not B.startswith(\".\"):\n return False\n if not is_HDN(B[1:]):\n return False\n return True\n\ndef liberal_is_HDN(text):\n \"\"\"Return True if text is a sort-of-like a host domain name.\n\n For accepting/blocking domains.\n\n \"\"\"\n if IPV4_RE.search(text):\n return False\n return True\n\ndef user_domain_match(A, B):\n \"\"\"For blocking/accepting domains.\n\n A and B may be host domain names or IP addresses.\n\n \"\"\"\n A = A.lower()\n B = B.lower()\n if not (liberal_is_HDN(A) and liberal_is_HDN(B)):\n if A == B:\n # equal IP addresses\n return True\n return False\n initial_dot = B.startswith(\".\")\n if initial_dot and A.endswith(B):\n return True\n if not initial_dot and A == B:\n return True\n return False\n\ncut_port_re = re.compile(r\":\\d+$\", re.ASCII)\ndef request_host(request):\n \"\"\"Return request-host, as defined by RFC 2965.\n\n Variation from RFC: returned value is lowercased, for convenient\n comparison.\n\n \"\"\"\n url = request.get_full_url()\n host = urllib.parse.urlparse(url)[1]\n if host == \"\":\n host = request.get_header(\"Host\", \"\")\n\n # remove port, if present\n host = cut_port_re.sub(\"\", host, 1)\n return host.lower()\n\ndef eff_request_host(request):\n \"\"\"Return a tuple (request-host, effective request-host name).\n\n As defined by RFC 2965, except both are lowercased.\n\n \"\"\"\n erhn = req_host = request_host(request)\n if req_host.find(\".\") == -1 and not IPV4_RE.search(req_host):\n erhn = req_host + \".local\"\n return req_host, erhn\n\ndef request_path(request):\n \"\"\"Path component of request-URI, as defined by RFC 2965.\"\"\"\n url = request.get_full_url()\n parts = urllib.parse.urlsplit(url)\n path = escape_path(parts.path)\n if not path.startswith(\"/\"):\n # fix bad RFC 2396 absoluteURI\n path = \"/\" + path\n return path\n\ndef request_port(request):\n host = request.host\n i = host.find(':')\n if i >= 0:\n port = host[i+1:]\n try:\n int(port)\n except ValueError:\n _debug(\"nonnumeric port: '%s'\", port)\n return None\n else:\n port = DEFAULT_HTTP_PORT\n return port\n\n# Characters in addition to A-Z, a-z, 0-9, '_', '.', and '-' that don't\n# need to be escaped to form a valid HTTP URL (RFCs 2396 and 1738).\nHTTP_PATH_SAFE = \"%/;:@&=+$,!~*'()\"\nESCAPED_CHAR_RE = re.compile(r\"%([0-9a-fA-F][0-9a-fA-F])\")\ndef uppercase_escaped_char(match):\n return \"%%%s\" % match.group(1).upper()\ndef escape_path(path):\n \"\"\"Escape any invalid characters in HTTP URL, and uppercase all escapes.\"\"\"\n # There's no knowing what character encoding was used to create URLs\n # containing %-escapes, but since we have to pick one to escape invalid\n # path characters, we pick UTF-8, as recommended in the HTML 4.0\n # specification:\n # http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.1\n # And here, kind of: draft-fielding-uri-rfc2396bis-03\n # (And in draft IRI specification: draft-duerst-iri-05)\n # (And here, for new URI schemes: RFC 2718)\n path = urllib.parse.quote(path, HTTP_PATH_SAFE)\n path = ESCAPED_CHAR_RE.sub(uppercase_escaped_char, path)\n return path\n\ndef reach(h):\n \"\"\"Return reach of host h, as defined by RFC 2965, section 1.\n\n The reach R of a host name H is defined as follows:\n\n * If\n\n - H is the host domain name of a host; and,\n\n - H has the form A.B; and\n\n - A has no embedded (that is, interior) dots; and\n\n - B has at least one embedded dot, or B is the string \"local\".\n then the reach of H is .B.\n\n * Otherwise, the reach of H is H.\n\n >>> reach(\"www.acme.com\")\n '.acme.com'\n >>> reach(\"acme.com\")\n 'acme.com'\n >>> reach(\"acme.local\")\n '.local'\n\n \"\"\"\n i = h.find(\".\")\n if i >= 0:\n #a = h[:i] # this line is only here to show what a is\n b = h[i+1:]\n i = b.find(\".\")\n if is_HDN(h) and (i >= 0 or b == \"local\"):\n return \".\"+b\n return h\n\ndef is_third_party(request):\n \"\"\"\n\n RFC 2965, section 3.3.6:\n\n An unverifiable transaction is to a third-party host if its request-\n host U does not domain-match the reach R of the request-host O in the\n origin transaction.\n\n \"\"\"\n req_host = request_host(request)\n if not domain_match(req_host, reach(request.origin_req_host)):\n return True\n else:\n return False\n\n\nclass Cookie:\n \"\"\"HTTP Cookie.\n\n This class represents both Netscape and RFC 2965 cookies.\n\n This is deliberately a very simple class. It just holds attributes. It's\n possible to construct Cookie instances that don't comply with the cookie\n standards. CookieJar.make_cookies is the factory function for Cookie\n objects -- it deals with cookie parsing, supplying defaults, and\n normalising to the representation used in this class. CookiePolicy is\n responsible for checking them to see whether they should be accepted from\n and returned to the server.\n\n Note that the port may be present in the headers, but unspecified (\"Port\"\n rather than\"Port=80\", for example); if this is the case, port is None.\n\n \"\"\"\n\n def __init__(self, version, name, value,\n port, port_specified,\n domain, domain_specified, domain_initial_dot,\n path, path_specified,\n secure,\n expires,\n discard,\n comment,\n comment_url,\n rest,\n rfc2109=False,\n ):\n\n if version is not None: version = int(version)\n if expires is not None: expires = int(expires)\n if port is None and port_specified is True:\n raise ValueError(\"if port is None, port_specified must be false\")\n\n self.version = version\n self.name = name\n self.value = value\n self.port = port\n self.port_specified = port_specified\n # normalise case, as per RFC 2965 section 3.3.3\n self.domain = domain.lower()\n self.domain_specified = domain_specified\n # Sigh. We need to know whether the domain given in the\n # cookie-attribute had an initial dot, in order to follow RFC 2965\n # (as clarified in draft errata). Needed for the returned $Domain\n # value.\n self.domain_initial_dot = domain_initial_dot\n self.path = path\n self.path_specified = path_specified\n self.secure = secure\n self.expires = expires\n self.discard = discard\n self.comment = comment\n self.comment_url = comment_url\n self.rfc2109 = rfc2109\n\n self._rest = copy.copy(rest)\n\n def has_nonstandard_attr(self, name):\n return name in self._rest\n def get_nonstandard_attr(self, name, default=None):\n return self._rest.get(name, default)\n def set_nonstandard_attr(self, name, value):\n self._rest[name] = value\n\n def is_expired(self, now=None):\n if now is None: now = time.time()\n if (self.expires is not None) and (self.expires <= now):\n return True\n return False\n\n def __str__(self):\n if self.port is None: p = \"\"\n else: p = \":\"+self.port\n limit = self.domain + p + self.path\n if self.value is not None:\n namevalue = \"%s=%s\" % (self.name, self.value)\n else:\n namevalue = self.name\n return \"<Cookie %s for %s>\" % (namevalue, limit)\n\n def __repr__(self):\n args = []\n for name in (\"version\", \"name\", \"value\",\n \"port\", \"port_specified\",\n \"domain\", \"domain_specified\", \"domain_initial_dot\",\n \"path\", \"path_specified\",\n \"secure\", \"expires\", \"discard\", \"comment\", \"comment_url\",\n ):\n attr = getattr(self, name)\n args.append(\"%s=%s\" % (name, repr(attr)))\n args.append(\"rest=%s\" % repr(self._rest))\n args.append(\"rfc2109=%s\" % repr(self.rfc2109))\n return \"Cookie(%s)\" % \", \".join(args)\n\n\nclass CookiePolicy:\n \"\"\"Defines which cookies get accepted from and returned to server.\n\n May also modify cookies, though this is probably a bad idea.\n\n The subclass DefaultCookiePolicy defines the standard rules for Netscape\n and RFC 2965 cookies -- override that if you want a customised policy.\n\n \"\"\"\n def set_ok(self, cookie, request):\n \"\"\"Return true if (and only if) cookie should be accepted from server.\n\n Currently, pre-expired cookies never get this far -- the CookieJar\n class deletes such cookies itself.\n\n \"\"\"\n raise NotImplementedError()\n\n def return_ok(self, cookie, request):\n \"\"\"Return true if (and only if) cookie should be returned to server.\"\"\"\n raise NotImplementedError()\n\n def domain_return_ok(self, domain, request):\n \"\"\"Return false if cookies should not be returned, given cookie domain.\n \"\"\"\n return True\n\n def path_return_ok(self, path, request):\n \"\"\"Return false if cookies should not be returned, given cookie path.\n \"\"\"\n return True\n\n\nclass DefaultCookiePolicy(CookiePolicy):\n \"\"\"Implements the standard rules for accepting and returning cookies.\"\"\"\n\n DomainStrictNoDots = 1\n DomainStrictNonDomain = 2\n DomainRFC2965Match = 4\n\n DomainLiberal = 0\n DomainStrict = DomainStrictNoDots|DomainStrictNonDomain\n\n def __init__(self,\n blocked_domains=None, allowed_domains=None,\n netscape=True, rfc2965=False,\n rfc2109_as_netscape=None,\n hide_cookie2=False,\n strict_domain=False,\n strict_rfc2965_unverifiable=True,\n strict_ns_unverifiable=False,\n strict_ns_domain=DomainLiberal,\n strict_ns_set_initial_dollar=False,\n strict_ns_set_path=False,\n ):\n \"\"\"Constructor arguments should be passed as keyword arguments only.\"\"\"\n self.netscape = netscape\n self.rfc2965 = rfc2965\n self.rfc2109_as_netscape = rfc2109_as_netscape\n self.hide_cookie2 = hide_cookie2\n self.strict_domain = strict_domain\n self.strict_rfc2965_unverifiable = strict_rfc2965_unverifiable\n self.strict_ns_unverifiable = strict_ns_unverifiable\n self.strict_ns_domain = strict_ns_domain\n self.strict_ns_set_initial_dollar = strict_ns_set_initial_dollar\n self.strict_ns_set_path = strict_ns_set_path\n\n if blocked_domains is not None:\n self._blocked_domains = tuple(blocked_domains)\n else:\n self._blocked_domains = ()\n\n if allowed_domains is not None:\n allowed_domains = tuple(allowed_domains)\n self._allowed_domains = allowed_domains\n\n def blocked_domains(self):\n \"\"\"Return the sequence of blocked domains (as a tuple).\"\"\"\n return self._blocked_domains\n def set_blocked_domains(self, blocked_domains):\n \"\"\"Set the sequence of blocked domains.\"\"\"\n self._blocked_domains = tuple(blocked_domains)\n\n def is_blocked(self, domain):\n for blocked_domain in self._blocked_domains:\n if user_domain_match(domain, blocked_domain):\n return True\n return False\n\n def allowed_domains(self):\n \"\"\"Return None, or the sequence of allowed domains (as a tuple).\"\"\"\n return self._allowed_domains\n def set_allowed_domains(self, allowed_domains):\n \"\"\"Set the sequence of allowed domains, or None.\"\"\"\n if allowed_domains is not None:\n allowed_domains = tuple(allowed_domains)\n self._allowed_domains = allowed_domains\n\n def is_not_allowed(self, domain):\n if self._allowed_domains is None:\n return False\n for allowed_domain in self._allowed_domains:\n if user_domain_match(domain, allowed_domain):\n return False\n return True\n\n def set_ok(self, cookie, request):\n \"\"\"\n If you override .set_ok(), be sure to call this method. If it returns\n false, so should your subclass (assuming your subclass wants to be more\n strict about which cookies to accept).\n\n \"\"\"\n _debug(\" - checking cookie %s=%s\", cookie.name, cookie.value)\n\n assert cookie.name is not None\n\n for n in \"version\", \"verifiability\", \"name\", \"path\", \"domain\", \"port\":\n fn_name = \"set_ok_\"+n\n fn = getattr(self, fn_name)\n if not fn(cookie, request):\n return False\n\n return True\n\n def set_ok_version(self, cookie, request):\n if cookie.version is None:\n # Version is always set to 0 by parse_ns_headers if it's a Netscape\n # cookie, so this must be an invalid RFC 2965 cookie.\n _debug(\" Set-Cookie2 without version attribute (%s=%s)\",\n cookie.name, cookie.value)\n return False\n if cookie.version > 0 and not self.rfc2965:\n _debug(\" RFC 2965 cookies are switched off\")\n return False\n elif cookie.version == 0 and not self.netscape:\n _debug(\" Netscape cookies are switched off\")\n return False\n return True\n\n def set_ok_verifiability(self, cookie, request):\n if request.unverifiable and is_third_party(request):\n if cookie.version > 0 and self.strict_rfc2965_unverifiable:\n _debug(\" third-party RFC 2965 cookie during \"\n \"unverifiable transaction\")\n return False\n elif cookie.version == 0 and self.strict_ns_unverifiable:\n _debug(\" third-party Netscape cookie during \"\n \"unverifiable transaction\")\n return False\n return True\n\n def set_ok_name(self, cookie, request):\n # Try and stop servers setting V0 cookies designed to hack other\n # servers that know both V0 and V1 protocols.\n if (cookie.version == 0 and self.strict_ns_set_initial_dollar and\n cookie.name.startswith(\"$\")):\n _debug(\" illegal name (starts with '$'): '%s'\", cookie.name)\n return False\n return True\n\n def set_ok_path(self, cookie, request):\n if cookie.path_specified:\n req_path = request_path(request)\n if ((cookie.version > 0 or\n (cookie.version == 0 and self.strict_ns_set_path)) and\n not req_path.startswith(cookie.path)):\n _debug(\" path attribute %s is not a prefix of request \"\n \"path %s\", cookie.path, req_path)\n return False\n return True\n\n def set_ok_domain(self, cookie, request):\n if self.is_blocked(cookie.domain):\n _debug(\" domain %s is in user block-list\", cookie.domain)\n return False\n if self.is_not_allowed(cookie.domain):\n _debug(\" domain %s is not in user allow-list\", cookie.domain)\n return False\n if cookie.domain_specified:\n req_host, erhn = eff_request_host(request)\n domain = cookie.domain\n if self.strict_domain and (domain.count(\".\") >= 2):\n # XXX This should probably be compared with the Konqueror\n # (kcookiejar.cpp) and Mozilla implementations, but it's a\n # losing battle.\n i = domain.rfind(\".\")\n j = domain.rfind(\".\", 0, i)\n if j == 0: # domain like .foo.bar\n tld = domain[i+1:]\n sld = domain[j+1:i]\n if sld.lower() in (\"co\", \"ac\", \"com\", \"edu\", \"org\", \"net\",\n \"gov\", \"mil\", \"int\", \"aero\", \"biz\", \"cat\", \"coop\",\n \"info\", \"jobs\", \"mobi\", \"museum\", \"name\", \"pro\",\n \"travel\", \"eu\") and len(tld) == 2:\n # domain like .co.uk\n _debug(\" country-code second level domain %s\", domain)\n return False\n if domain.startswith(\".\"):\n undotted_domain = domain[1:]\n else:\n undotted_domain = domain\n embedded_dots = (undotted_domain.find(\".\") >= 0)\n if not embedded_dots and domain != \".local\":\n _debug(\" non-local domain %s contains no embedded dot\",\n domain)\n return False\n if cookie.version == 0:\n if (not erhn.endswith(domain) and\n (not erhn.startswith(\".\") and\n not (\".\"+erhn).endswith(domain))):\n _debug(\" effective request-host %s (even with added \"\n \"initial dot) does not end with %s\",\n erhn, domain)\n return False\n if (cookie.version > 0 or\n (self.strict_ns_domain & self.DomainRFC2965Match)):\n if not domain_match(erhn, domain):\n _debug(\" effective request-host %s does not domain-match \"\n \"%s\", erhn, domain)\n return False\n if (cookie.version > 0 or\n (self.strict_ns_domain & self.DomainStrictNoDots)):\n host_prefix = req_host[:-len(domain)]\n if (host_prefix.find(\".\") >= 0 and\n not IPV4_RE.search(req_host)):\n _debug(\" host prefix %s for domain %s contains a dot\",\n host_prefix, domain)\n return False\n return True\n\n def set_ok_port(self, cookie, request):\n if cookie.port_specified:\n req_port = request_port(request)\n if req_port is None:\n req_port = \"80\"\n else:\n req_port = str(req_port)\n for p in cookie.port.split(\",\"):\n try:\n int(p)\n except ValueError:\n _debug(\" bad port %s (not numeric)\", p)\n return False\n if p == req_port:\n break\n else:\n _debug(\" request port (%s) not found in %s\",\n req_port, cookie.port)\n return False\n return True\n\n def return_ok(self, cookie, request):\n \"\"\"\n If you override .return_ok(), be sure to call this method. If it\n returns false, so should your subclass (assuming your subclass wants to\n be more strict about which cookies to return).\n\n \"\"\"\n # Path has already been checked by .path_return_ok(), and domain\n # blocking done by .domain_return_ok().\n _debug(\" - checking cookie %s=%s\", cookie.name, cookie.value)\n\n for n in \"version\", \"verifiability\", \"secure\", \"expires\", \"port\", \"domain\":\n fn_name = \"return_ok_\"+n\n fn = getattr(self, fn_name)\n if not fn(cookie, request):\n return False\n return True\n\n def return_ok_version(self, cookie, request):\n if cookie.version > 0 and not self.rfc2965:\n _debug(\" RFC 2965 cookies are switched off\")\n return False\n elif cookie.version == 0 and not self.netscape:\n _debug(\" Netscape cookies are switched off\")\n return False\n return True\n\n def return_ok_verifiability(self, cookie, request):\n if request.unverifiable and is_third_party(request):\n if cookie.version > 0 and self.strict_rfc2965_unverifiable:\n _debug(\" third-party RFC 2965 cookie during unverifiable \"\n \"transaction\")\n return False\n elif cookie.version == 0 and self.strict_ns_unverifiable:\n _debug(\" third-party Netscape cookie during unverifiable \"\n \"transaction\")\n return False\n return True\n\n def return_ok_secure(self, cookie, request):\n if cookie.secure and request.type != \"https\":\n _debug(\" secure cookie with non-secure request\")\n return False\n return True\n\n def return_ok_expires(self, cookie, request):\n if cookie.is_expired(self._now):\n _debug(\" cookie expired\")\n return False\n return True\n\n def return_ok_port(self, cookie, request):\n if cookie.port:\n req_port = request_port(request)\n if req_port is None:\n req_port = \"80\"\n for p in cookie.port.split(\",\"):\n if p == req_port:\n break\n else:\n _debug(\" request port %s does not match cookie port %s\",\n req_port, cookie.port)\n return False\n return True\n\n def return_ok_domain(self, cookie, request):\n req_host, erhn = eff_request_host(request)\n domain = cookie.domain\n\n # strict check of non-domain cookies: Mozilla does this, MSIE5 doesn't\n if (cookie.version == 0 and\n (self.strict_ns_domain & self.DomainStrictNonDomain) and\n not cookie.domain_specified and domain != erhn):\n _debug(\" cookie with unspecified domain does not string-compare \"\n \"equal to request domain\")\n return False\n\n if cookie.version > 0 and not domain_match(erhn, domain):\n _debug(\" effective request-host name %s does not domain-match \"\n \"RFC 2965 cookie domain %s\", erhn, domain)\n return False\n if cookie.version == 0 and not (\".\"+erhn).endswith(domain):\n _debug(\" request-host %s does not match Netscape cookie domain \"\n \"%s\", req_host, domain)\n return False\n return True\n\n def domain_return_ok(self, domain, request):\n # Liberal check of. This is here as an optimization to avoid\n # having to load lots of MSIE cookie files unless necessary.\n req_host, erhn = eff_request_host(request)\n if not req_host.startswith(\".\"):\n req_host = \".\"+req_host\n if not erhn.startswith(\".\"):\n erhn = \".\"+erhn\n if not (req_host.endswith(domain) or erhn.endswith(domain)):\n #_debug(\" request domain %s does not match cookie domain %s\",\n # req_host, domain)\n return False\n\n if self.is_blocked(domain):\n _debug(\" domain %s is in user block-list\", domain)\n return False\n if self.is_not_allowed(domain):\n _debug(\" domain %s is not in user allow-list\", domain)\n return False\n\n return True\n\n def path_return_ok(self, path, request):\n _debug(\"- checking cookie path=%s\", path)\n req_path = request_path(request)\n if not req_path.startswith(path):\n _debug(\" %s does not path-match %s\", req_path, path)\n return False\n return True\n\n\ndef vals_sorted_by_key(adict):\n keys = sorted(adict.keys())\n return map(adict.get, keys)\n\ndef deepvalues(mapping):\n \"\"\"Iterates over nested mapping, depth-first, in sorted order by key.\"\"\"\n values = vals_sorted_by_key(mapping)\n for obj in values:\n mapping = False\n try:\n obj.items\n except AttributeError:\n pass\n else:\n mapping = True\n for subobj in deepvalues(obj):\n yield subobj\n if not mapping:\n yield obj\n\n\n# Used as second parameter to dict.get() method, to distinguish absent\n# dict key from one with a None value.\nclass Absent: pass\n\nclass CookieJar:\n \"\"\"Collection of HTTP cookies.\n\n You may not need to know about this class: try\n urllib.request.build_opener(HTTPCookieProcessor).open(url).\n \"\"\"\n\n non_word_re = re.compile(r\"\\W\")\n quote_re = re.compile(r\"([\\\"\\\\])\")\n strict_domain_re = re.compile(r\"\\.?[^.]*\")\n domain_re = re.compile(r\"[^.]*\")\n dots_re = re.compile(r\"^\\.+\")\n\n magic_re = re.compile(r\"^\\#LWP-Cookies-(\\d+\\.\\d+)\", re.ASCII)\n\n def __init__(self, policy=None):\n if policy is None:\n policy = DefaultCookiePolicy()\n self._policy = policy\n\n self._cookies_lock = _threading.RLock()\n self._cookies = {}\n\n def set_policy(self, policy):\n self._policy = policy\n\n def _cookies_for_domain(self, domain, request):\n cookies = []\n if not self._policy.domain_return_ok(domain, request):\n return []\n _debug(\"Checking %s for cookies to return\", domain)\n cookies_by_path = self._cookies[domain]\n for path in cookies_by_path.keys():\n if not self._policy.path_return_ok(path, request):\n continue\n cookies_by_name = cookies_by_path[path]\n for cookie in cookies_by_name.values():\n if not self._policy.return_ok(cookie, request):\n _debug(\" not returning cookie\")\n continue\n _debug(\" it's a match\")\n cookies.append(cookie)\n return cookies\n\n def _cookies_for_request(self, request):\n \"\"\"Return a list of cookies to be returned to server.\"\"\"\n cookies = []\n for domain in self._cookies.keys():\n cookies.extend(self._cookies_for_domain(domain, request))\n return cookies\n\n def _cookie_attrs(self, cookies):\n \"\"\"Return a list of cookie-attributes to be returned to server.\n\n like ['foo=\"bar\"; $Path=\"/\"', ...]\n\n The $Version attribute is also added when appropriate (currently only\n once per request).\n\n \"\"\"\n # add cookies in order of most specific (ie. longest) path first\n cookies.sort(key=lambda a: len(a.path), reverse=True)\n\n version_set = False\n\n attrs = []\n for cookie in cookies:\n # set version of Cookie header\n # XXX\n # What should it be if multiple matching Set-Cookie headers have\n # different versions themselves?\n # Answer: there is no answer; was supposed to be settled by\n # RFC 2965 errata, but that may never appear...\n version = cookie.version\n if not version_set:\n version_set = True\n if version > 0:\n attrs.append(\"$Version=%s\" % version)\n\n # quote cookie value if necessary\n # (not for Netscape protocol, which already has any quotes\n # intact, due to the poorly-specified Netscape Cookie: syntax)\n if ((cookie.value is not None) and\n self.non_word_re.search(cookie.value) and version > 0):\n value = self.quote_re.sub(r\"\\\\\\1\", cookie.value)\n else:\n value = cookie.value\n\n # add cookie-attributes to be returned in Cookie header\n if cookie.value is None:\n attrs.append(cookie.name)\n else:\n attrs.append(\"%s=%s\" % (cookie.name, value))\n if version > 0:\n if cookie.path_specified:\n attrs.append('$Path=\"%s\"' % cookie.path)\n if cookie.domain.startswith(\".\"):\n domain = cookie.domain\n if (not cookie.domain_initial_dot and\n domain.startswith(\".\")):\n domain = domain[1:]\n attrs.append('$Domain=\"%s\"' % domain)\n if cookie.port is not None:\n p = \"$Port\"\n if cookie.port_specified:\n p = p + ('=\"%s\"' % cookie.port)\n attrs.append(p)\n\n return attrs\n\n def add_cookie_header(self, request):\n \"\"\"Add correct Cookie: header to request (urllib.request.Request object).\n\n The Cookie2 header is also added unless policy.hide_cookie2 is true.\n\n \"\"\"\n _debug(\"add_cookie_header\")\n self._cookies_lock.acquire()\n try:\n\n self._policy._now = self._now = int(time.time())\n\n cookies = self._cookies_for_request(request)\n\n attrs = self._cookie_attrs(cookies)\n if attrs:\n if not request.has_header(\"Cookie\"):\n request.add_unredirected_header(\n \"Cookie\", \"; \".join(attrs))\n\n # if necessary, advertise that we know RFC 2965\n if (self._policy.rfc2965 and not self._policy.hide_cookie2 and\n not request.has_header(\"Cookie2\")):\n for cookie in cookies:\n if cookie.version != 1:\n request.add_unredirected_header(\"Cookie2\", '$Version=\"1\"')\n break\n\n finally:\n self._cookies_lock.release()\n\n self.clear_expired_cookies()\n\n def _normalized_cookie_tuples(self, attrs_set):\n \"\"\"Return list of tuples containing normalised cookie information.\n\n attrs_set is the list of lists of key,value pairs extracted from\n the Set-Cookie or Set-Cookie2 headers.\n\n Tuples are name, value, standard, rest, where name and value are the\n cookie name and value, standard is a dictionary containing the standard\n cookie-attributes (discard, secure, version, expires or max-age,\n domain, path and port) and rest is a dictionary containing the rest of\n the cookie-attributes.\n\n \"\"\"\n cookie_tuples = []\n\n boolean_attrs = \"discard\", \"secure\"\n value_attrs = (\"version\",\n \"expires\", \"max-age\",\n \"domain\", \"path\", \"port\",\n \"comment\", \"commenturl\")\n\n for cookie_attrs in attrs_set:\n name, value = cookie_attrs[0]\n\n # Build dictionary of standard cookie-attributes (standard) and\n # dictionary of other cookie-attributes (rest).\n\n # Note: expiry time is normalised to seconds since epoch. V0\n # cookies should have the Expires cookie-attribute, and V1 cookies\n # should have Max-Age, but since V1 includes RFC 2109 cookies (and\n # since V0 cookies may be a mish-mash of Netscape and RFC 2109), we\n # accept either (but prefer Max-Age).\n max_age_set = False\n\n bad_cookie = False\n\n standard = {}\n rest = {}\n for k, v in cookie_attrs[1:]:\n lc = k.lower()\n # don't lose case distinction for unknown fields\n if lc in value_attrs or lc in boolean_attrs:\n k = lc\n if k in boolean_attrs and v is None:\n # boolean cookie-attribute is present, but has no value\n # (like \"discard\", rather than \"port=80\")\n v = True\n if k in standard:\n # only first value is significant\n continue\n if k == \"domain\":\n if v is None:\n _debug(\" missing value for domain attribute\")\n bad_cookie = True\n break\n # RFC 2965 section 3.3.3\n v = v.lower()\n if k == \"expires\":\n if max_age_set:\n # Prefer max-age to expires (like Mozilla)\n continue\n if v is None:\n _debug(\" missing or invalid value for expires \"\n \"attribute: treating as session cookie\")\n continue\n if k == \"max-age\":\n max_age_set = True\n try:\n v = int(v)\n except ValueError:\n _debug(\" missing or invalid (non-numeric) value for \"\n \"max-age attribute\")\n bad_cookie = True\n break\n # convert RFC 2965 Max-Age to seconds since epoch\n # XXX Strictly you're supposed to follow RFC 2616\n # age-calculation rules. Remember that zero Max-Age is a\n # is a request to discard (old and new) cookie, though.\n k = \"expires\"\n v = self._now + v\n if (k in value_attrs) or (k in boolean_attrs):\n if (v is None and\n k not in (\"port\", \"comment\", \"commenturl\")):\n _debug(\" missing value for %s attribute\" % k)\n bad_cookie = True\n break\n standard[k] = v\n else:\n rest[k] = v\n\n if bad_cookie:\n continue\n\n cookie_tuples.append((name, value, standard, rest))\n\n return cookie_tuples\n\n def _cookie_from_cookie_tuple(self, tup, request):\n # standard is dict of standard cookie-attributes, rest is dict of the\n # rest of them\n name, value, standard, rest = tup\n\n domain = standard.get(\"domain\", Absent)\n path = standard.get(\"path\", Absent)\n port = standard.get(\"port\", Absent)\n expires = standard.get(\"expires\", Absent)\n\n # set the easy defaults\n version = standard.get(\"version\", None)\n if version is not None:\n try:\n version = int(version)\n except ValueError:\n return None # invalid version, ignore cookie\n secure = standard.get(\"secure\", False)\n # (discard is also set if expires is Absent)\n discard = standard.get(\"discard\", False)\n comment = standard.get(\"comment\", None)\n comment_url = standard.get(\"commenturl\", None)\n\n # set default path\n if path is not Absent and path != \"\":\n path_specified = True\n path = escape_path(path)\n else:\n path_specified = False\n path = request_path(request)\n i = path.rfind(\"/\")\n if i != -1:\n if version == 0:\n # Netscape spec parts company from reality here\n path = path[:i]\n else:\n path = path[:i+1]\n if len(path) == 0: path = \"/\"\n\n # set default domain\n domain_specified = domain is not Absent\n # but first we have to remember whether it starts with a dot\n domain_initial_dot = False\n if domain_specified:\n domain_initial_dot = bool(domain.startswith(\".\"))\n if domain is Absent:\n req_host, erhn = eff_request_host(request)\n domain = erhn\n elif not domain.startswith(\".\"):\n domain = \".\"+domain\n\n # set default port\n port_specified = False\n if port is not Absent:\n if port is None:\n # Port attr present, but has no value: default to request port.\n # Cookie should then only be sent back on that port.\n port = request_port(request)\n else:\n port_specified = True\n port = re.sub(r\"\\s+\", \"\", port)\n else:\n # No port attr present. Cookie can be sent back on any port.\n port = None\n\n # set default expires and discard\n if expires is Absent:\n expires = None\n discard = True\n elif expires <= self._now:\n # Expiry date in past is request to delete cookie. This can't be\n # in DefaultCookiePolicy, because can't delete cookies there.\n try:\n self.clear(domain, path, name)\n except KeyError:\n pass\n _debug(\"Expiring cookie, domain='%s', path='%s', name='%s'\",\n domain, path, name)\n return None\n\n return Cookie(version,\n name, value,\n port, port_specified,\n domain, domain_specified, domain_initial_dot,\n path, path_specified,\n secure,\n expires,\n discard,\n comment,\n comment_url,\n rest)\n\n def _cookies_from_attrs_set(self, attrs_set, request):\n cookie_tuples = self._normalized_cookie_tuples(attrs_set)\n\n cookies = []\n for tup in cookie_tuples:\n cookie = self._cookie_from_cookie_tuple(tup, request)\n if cookie: cookies.append(cookie)\n return cookies\n\n def _process_rfc2109_cookies(self, cookies):\n rfc2109_as_ns = getattr(self._policy, 'rfc2109_as_netscape', None)\n if rfc2109_as_ns is None:\n rfc2109_as_ns = not self._policy.rfc2965\n for cookie in cookies:\n if cookie.version == 1:\n cookie.rfc2109 = True\n if rfc2109_as_ns:\n # treat 2109 cookies as Netscape cookies rather than\n # as RFC2965 cookies\n cookie.version = 0\n\n def make_cookies(self, response, request):\n \"\"\"Return sequence of Cookie objects extracted from response object.\"\"\"\n # get cookie-attributes for RFC 2965 and Netscape protocols\n headers = response.info()\n rfc2965_hdrs = headers.get_all(\"Set-Cookie2\", [])\n ns_hdrs = headers.get_all(\"Set-Cookie\", [])\n\n rfc2965 = self._policy.rfc2965\n netscape = self._policy.netscape\n\n if ((not rfc2965_hdrs and not ns_hdrs) or\n (not ns_hdrs and not rfc2965) or\n (not rfc2965_hdrs and not netscape) or\n (not netscape and not rfc2965)):\n return [] # no relevant cookie headers: quick exit\n\n try:\n cookies = self._cookies_from_attrs_set(\n split_header_words(rfc2965_hdrs), request)\n except Exception:\n _warn_unhandled_exception()\n cookies = []\n\n if ns_hdrs and netscape:\n try:\n # RFC 2109 and Netscape cookies\n ns_cookies = self._cookies_from_attrs_set(\n parse_ns_headers(ns_hdrs), request)\n except Exception:\n _warn_unhandled_exception()\n ns_cookies = []\n self._process_rfc2109_cookies(ns_cookies)\n\n # Look for Netscape cookies (from Set-Cookie headers) that match\n # corresponding RFC 2965 cookies (from Set-Cookie2 headers).\n # For each match, keep the RFC 2965 cookie and ignore the Netscape\n # cookie (RFC 2965 section 9.1). Actually, RFC 2109 cookies are\n # bundled in with the Netscape cookies for this purpose, which is\n # reasonable behaviour.\n if rfc2965:\n lookup = {}\n for cookie in cookies:\n lookup[(cookie.domain, cookie.path, cookie.name)] = None\n\n def no_matching_rfc2965(ns_cookie, lookup=lookup):\n key = ns_cookie.domain, ns_cookie.path, ns_cookie.name\n return key not in lookup\n ns_cookies = filter(no_matching_rfc2965, ns_cookies)\n\n if ns_cookies:\n cookies.extend(ns_cookies)\n\n return cookies\n\n def set_cookie_if_ok(self, cookie, request):\n \"\"\"Set a cookie if policy says it's OK to do so.\"\"\"\n self._cookies_lock.acquire()\n try:\n self._policy._now = self._now = int(time.time())\n\n if self._policy.set_ok(cookie, request):\n self.set_cookie(cookie)\n\n\n finally:\n self._cookies_lock.release()\n\n def set_cookie(self, cookie):\n \"\"\"Set a cookie, without checking whether or not it should be set.\"\"\"\n c = self._cookies\n self._cookies_lock.acquire()\n try:\n if cookie.domain not in c: c[cookie.domain] = {}\n c2 = c[cookie.domain]\n if cookie.path not in c2: c2[cookie.path] = {}\n c3 = c2[cookie.path]\n c3[cookie.name] = cookie\n finally:\n self._cookies_lock.release()\n\n def extract_cookies(self, response, request):\n \"\"\"Extract cookies from response, where allowable given the request.\"\"\"\n _debug(\"extract_cookies: %s\", response.info())\n self._cookies_lock.acquire()\n try:\n self._policy._now = self._now = int(time.time())\n\n for cookie in self.make_cookies(response, request):\n if self._policy.set_ok(cookie, request):\n _debug(\" setting cookie: %s\", cookie)\n self.set_cookie(cookie)\n finally:\n self._cookies_lock.release()\n\n def clear(self, domain=None, path=None, name=None):\n \"\"\"Clear some cookies.\n\n Invoking this method without arguments will clear all cookies. If\n given a single argument, only cookies belonging to that domain will be\n removed. If given two arguments, cookies belonging to the specified\n path within that domain are removed. If given three arguments, then\n the cookie with the specified name, path and domain is removed.\n\n Raises KeyError if no matching cookie exists.\n\n \"\"\"\n if name is not None:\n if (domain is None) or (path is None):\n raise ValueError(\n \"domain and path must be given to remove a cookie by name\")\n del self._cookies[domain][path][name]\n elif path is not None:\n if domain is None:\n raise ValueError(\n \"domain must be given to remove cookies by path\")\n del self._cookies[domain][path]\n elif domain is not None:\n del self._cookies[domain]\n else:\n self._cookies = {}\n\n def clear_session_cookies(self):\n \"\"\"Discard all session cookies.\n\n Note that the .save() method won't save session cookies anyway, unless\n you ask otherwise by passing a true ignore_discard argument.\n\n \"\"\"\n self._cookies_lock.acquire()\n try:\n for cookie in self:\n if cookie.discard:\n self.clear(cookie.domain, cookie.path, cookie.name)\n finally:\n self._cookies_lock.release()\n\n def clear_expired_cookies(self):\n \"\"\"Discard all expired cookies.\n\n You probably don't need to call this method: expired cookies are never\n sent back to the server (provided you're using DefaultCookiePolicy),\n this method is called by CookieJar itself every so often, and the\n .save() method won't save expired cookies anyway (unless you ask\n otherwise by passing a true ignore_expires argument).\n\n \"\"\"\n self._cookies_lock.acquire()\n try:\n now = time.time()\n for cookie in self:\n if cookie.is_expired(now):\n self.clear(cookie.domain, cookie.path, cookie.name)\n finally:\n self._cookies_lock.release()\n\n def __iter__(self):\n return deepvalues(self._cookies)\n\n def __len__(self):\n \"\"\"Return number of contained cookies.\"\"\"\n i = 0\n for cookie in self: i = i + 1\n return i\n\n def __repr__(self):\n r = []\n for cookie in self: r.append(repr(cookie))\n return \"<%s[%s]>\" % (self.__class__, \", \".join(r))\n\n def __str__(self):\n r = []\n for cookie in self: r.append(str(cookie))\n return \"<%s[%s]>\" % (self.__class__, \", \".join(r))\n\n\n# derives from IOError for backwards-compatibility with Python 2.4.0\nclass LoadError(IOError): pass\n\nclass FileCookieJar(CookieJar):\n \"\"\"CookieJar that can be loaded from and saved to a file.\"\"\"\n\n def __init__(self, filename=None, delayload=False, policy=None):\n \"\"\"\n Cookies are NOT loaded from the named file until either the .load() or\n .revert() method is called.\n\n \"\"\"\n CookieJar.__init__(self, policy)\n if filename is not None:\n try:\n filename+\"\"\n except:\n raise ValueError(\"filename must be string-like\")\n self.filename = filename\n self.delayload = bool(delayload)\n\n def save(self, filename=None, ignore_discard=False, ignore_expires=False):\n \"\"\"Save cookies to a file.\"\"\"\n raise NotImplementedError()\n\n def load(self, filename=None, ignore_discard=False, ignore_expires=False):\n \"\"\"Load cookies from a file.\"\"\"\n if filename is None:\n if self.filename is not None: filename = self.filename\n else: raise ValueError(MISSING_FILENAME_TEXT)\n\n f = open(filename)\n try:\n self._really_load(f, filename, ignore_discard, ignore_expires)\n finally:\n f.close()\n\n def revert(self, filename=None,\n ignore_discard=False, ignore_expires=False):\n \"\"\"Clear all cookies and reload cookies from a saved file.\n\n Raises LoadError (or IOError) if reversion is not successful; the\n object's state will not be altered if this happens.\n\n \"\"\"\n if filename is None:\n if self.filename is not None: filename = self.filename\n else: raise ValueError(MISSING_FILENAME_TEXT)\n\n self._cookies_lock.acquire()\n try:\n\n old_state = copy.deepcopy(self._cookies)\n self._cookies = {}\n try:\n self.load(filename, ignore_discard, ignore_expires)\n except (LoadError, IOError):\n self._cookies = old_state\n raise\n\n finally:\n self._cookies_lock.release()\n\n\ndef lwp_cookie_str(cookie):\n \"\"\"Return string representation of Cookie in an the LWP cookie file format.\n\n Actually, the format is extended a bit -- see module docstring.\n\n \"\"\"\n h = [(cookie.name, cookie.value),\n (\"path\", cookie.path),\n (\"domain\", cookie.domain)]\n if cookie.port is not None: h.append((\"port\", cookie.port))\n if cookie.path_specified: h.append((\"path_spec\", None))\n if cookie.port_specified: h.append((\"port_spec\", None))\n if cookie.domain_initial_dot: h.append((\"domain_dot\", None))\n if cookie.secure: h.append((\"secure\", None))\n if cookie.expires: h.append((\"expires\",\n time2isoz(float(cookie.expires))))\n if cookie.discard: h.append((\"discard\", None))\n if cookie.comment: h.append((\"comment\", cookie.comment))\n if cookie.comment_url: h.append((\"commenturl\", cookie.comment_url))\n\n keys = sorted(cookie._rest.keys())\n for k in keys:\n h.append((k, str(cookie._rest[k])))\n\n h.append((\"version\", str(cookie.version)))\n\n return join_header_words([h])\n\nclass LWPCookieJar(FileCookieJar):\n \"\"\"\n The LWPCookieJar saves a sequence of \"Set-Cookie3\" lines.\n \"Set-Cookie3\" is the format used by the libwww-perl libary, not known\n to be compatible with any browser, but which is easy to read and\n doesn't lose information about RFC 2965 cookies.\n\n Additional methods\n\n as_lwp_str(ignore_discard=True, ignore_expired=True)\n\n \"\"\"\n\n def as_lwp_str(self, ignore_discard=True, ignore_expires=True):\n \"\"\"Return cookies as a string of \"\\\\n\"-separated \"Set-Cookie3\" headers.\n\n ignore_discard and ignore_expires: see docstring for FileCookieJar.save\n\n \"\"\"\n now = time.time()\n r = []\n for cookie in self:\n if not ignore_discard and cookie.discard:\n continue\n if not ignore_expires and cookie.is_expired(now):\n continue\n r.append(\"Set-Cookie3: %s\" % lwp_cookie_str(cookie))\n return \"\\n\".join(r+[\"\"])\n\n def save(self, filename=None, ignore_discard=False, ignore_expires=False):\n if filename is None:\n if self.filename is not None: filename = self.filename\n else: raise ValueError(MISSING_FILENAME_TEXT)\n\n f = open(filename, \"w\")\n try:\n # There really isn't an LWP Cookies 2.0 format, but this indicates\n # that there is extra information in here (domain_dot and\n # port_spec) while still being compatible with libwww-perl, I hope.\n f.write(\"#LWP-Cookies-2.0\\n\")\n f.write(self.as_lwp_str(ignore_discard, ignore_expires))\n finally:\n f.close()\n\n def _really_load(self, f, filename, ignore_discard, ignore_expires):\n magic = f.readline()\n if not self.magic_re.search(magic):\n msg = (\"%r does not look like a Set-Cookie3 (LWP) format \"\n \"file\" % filename)\n raise LoadError(msg)\n\n now = time.time()\n\n header = \"Set-Cookie3:\"\n boolean_attrs = (\"port_spec\", \"path_spec\", \"domain_dot\",\n \"secure\", \"discard\")\n value_attrs = (\"version\",\n \"port\", \"path\", \"domain\",\n \"expires\",\n \"comment\", \"commenturl\")\n\n try:\n while 1:\n line = f.readline()\n if line == \"\": break\n if not line.startswith(header):\n continue\n line = line[len(header):].strip()\n\n for data in split_header_words([line]):\n name, value = data[0]\n standard = {}\n rest = {}\n for k in boolean_attrs:\n standard[k] = False\n for k, v in data[1:]:\n if k is not None:\n lc = k.lower()\n else:\n lc = None\n # don't lose case distinction for unknown fields\n if (lc in value_attrs) or (lc in boolean_attrs):\n k = lc\n if k in boolean_attrs:\n if v is None: v = True\n standard[k] = v\n elif k in value_attrs:\n standard[k] = v\n else:\n rest[k] = v\n\n h = standard.get\n expires = h(\"expires\")\n discard = h(\"discard\")\n if expires is not None:\n expires = iso2time(expires)\n if expires is None:\n discard = True\n domain = h(\"domain\")\n domain_specified = domain.startswith(\".\")\n c = Cookie(h(\"version\"), name, value,\n h(\"port\"), h(\"port_spec\"),\n domain, domain_specified, h(\"domain_dot\"),\n h(\"path\"), h(\"path_spec\"),\n h(\"secure\"),\n expires,\n discard,\n h(\"comment\"),\n h(\"commenturl\"),\n rest)\n if not ignore_discard and c.discard:\n continue\n if not ignore_expires and c.is_expired(now):\n continue\n self.set_cookie(c)\n\n except IOError:\n raise\n except Exception:\n _warn_unhandled_exception()\n raise LoadError(\"invalid Set-Cookie3 format file %r: %r\" %\n (filename, line))\n\n\nclass MozillaCookieJar(FileCookieJar):\n \"\"\"\n\n WARNING: you may want to backup your browser's cookies file if you use\n this class to save cookies. I *think* it works, but there have been\n bugs in the past!\n\n This class differs from CookieJar only in the format it uses to save and\n load cookies to and from a file. This class uses the Mozilla/Netscape\n `cookies.txt' format. lynx uses this file format, too.\n\n Don't expect cookies saved while the browser is running to be noticed by\n the browser (in fact, Mozilla on unix will overwrite your saved cookies if\n you change them on disk while it's running; on Windows, you probably can't\n save at all while the browser is running).\n\n Note that the Mozilla/Netscape format will downgrade RFC2965 cookies to\n Netscape cookies on saving.\n\n In particular, the cookie version and port number information is lost,\n together with information about whether or not Path, Port and Discard were\n specified by the Set-Cookie2 (or Set-Cookie) header, and whether or not the\n domain as set in the HTTP header started with a dot (yes, I'm aware some\n domains in Netscape files start with a dot and some don't -- trust me, you\n really don't want to know any more about this).\n\n Note that though Mozilla and Netscape use the same format, they use\n slightly different headers. The class saves cookies using the Netscape\n header by default (Mozilla can cope with that).\n\n \"\"\"\n magic_re = re.compile(\"#( Netscape)? HTTP Cookie File\")\n header = \"\"\"\\\n# Netscape HTTP Cookie File\n# http://curl.haxx.se/rfc/cookie_spec.html\n# This is a generated file! Do not edit.\n\n\"\"\"\n\n def _really_load(self, f, filename, ignore_discard, ignore_expires):\n now = time.time()\n\n magic = f.readline()\n if not self.magic_re.search(magic):\n f.close()\n raise LoadError(\n \"%r does not look like a Netscape format cookies file\" %\n filename)\n\n try:\n while 1:\n line = f.readline()\n if line == \"\": break\n\n # last field may be absent, so keep any trailing tab\n if line.endswith(\"\\n\"): line = line[:-1]\n\n # skip comments and blank lines XXX what is $ for?\n if (line.strip().startswith((\"#\", \"$\")) or\n line.strip() == \"\"):\n continue\n\n domain, domain_specified, path, secure, expires, name, value = \\\n line.split(\"\\t\")\n secure = (secure == \"TRUE\")\n domain_specified = (domain_specified == \"TRUE\")\n if name == \"\":\n # cookies.txt regards 'Set-Cookie: foo' as a cookie\n # with no name, whereas http.cookiejar regards it as a\n # cookie with no value.\n name = value\n value = None\n\n initial_dot = domain.startswith(\".\")\n assert domain_specified == initial_dot\n\n discard = False\n if expires == \"\":\n expires = None\n discard = True\n\n # assume path_specified is false\n c = Cookie(0, name, value,\n None, False,\n domain, domain_specified, initial_dot,\n path, False,\n secure,\n expires,\n discard,\n None,\n None,\n {})\n if not ignore_discard and c.discard:\n continue\n if not ignore_expires and c.is_expired(now):\n continue\n self.set_cookie(c)\n\n except IOError:\n raise\n except Exception:\n _warn_unhandled_exception()\n raise LoadError(\"invalid Netscape format cookies file %r: %r\" %\n (filename, line))\n\n def save(self, filename=None, ignore_discard=False, ignore_expires=False):\n if filename is None:\n if self.filename is not None: filename = self.filename\n else: raise ValueError(MISSING_FILENAME_TEXT)\n\n f = open(filename, \"w\")\n try:\n f.write(self.header)\n now = time.time()\n for cookie in self:\n if not ignore_discard and cookie.discard:\n continue\n if not ignore_expires and cookie.is_expired(now):\n continue\n if cookie.secure: secure = \"TRUE\"\n else: secure = \"FALSE\"\n if cookie.domain.startswith(\".\"): initial_dot = \"TRUE\"\n else: initial_dot = \"FALSE\"\n if cookie.expires is not None:\n expires = str(cookie.expires)\n else:\n expires = \"\"\n if cookie.value is None:\n # cookies.txt regards 'Set-Cookie: foo' as a cookie\n # with no name, whereas http.cookiejar regards it as a\n # cookie with no value.\n name = \"\"\n value = cookie.name\n else:\n name = cookie.name\n value = cookie.value\n f.write(\n \"\\t\".join([cookie.domain, initial_dot, cookie.path,\n secure, expires, name, value])+\n \"\\n\")\n finally:\n f.close()\n", "meta": {"content_hash": "559998a8add628988658911617f859c8", "timestamp": "", "source": "github", "line_count": 2091, "max_line_length": 83, "avg_line_length": 36.324725011956005, "alnum_prop": 0.5385425580936081, "repo_name": "timm/timmnix", "id": "9fcd4c6f462e47f869f7cf67d496da38d7faf527", "size": "75955", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "pypy3-v5.5.0-linux64/lib-python/3/http/cookiejar.py", "mode": "33261", "license": "mit", "language": [{"name": "Assembly", "bytes": "1641"}, {"name": "Batchfile", "bytes": "1234"}, {"name": "C", "bytes": "436685"}, {"name": "CSS", "bytes": "96"}, {"name": "Common Lisp", "bytes": "4"}, {"name": "Emacs Lisp", "bytes": "290698"}, {"name": "HTML", "bytes": "111577"}, {"name": "Makefile", "bytes": "1681"}, {"name": "PLSQL", "bytes": "22886"}, {"name": "PowerShell", "bytes": "1540"}, {"name": "Prolog", "bytes": "14301"}, {"name": "Python", "bytes": "21267592"}, {"name": "Roff", "bytes": "21080"}, {"name": "Shell", "bytes": "27687"}, {"name": "TeX", "bytes": "3052861"}, {"name": "VBScript", "bytes": "481"}]}} +{"text": "package org.mule.tooling.esb.lang.mel.highlighter;\n\n\nimport com.intellij.openapi.fileTypes.SyntaxHighlighter;\nimport com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;\nimport com.intellij.openapi.project.Project;\nimport com.intellij.openapi.vfs.VirtualFile;\nimport org.jetbrains.annotations.NotNull;\nimport org.jetbrains.annotations.Nullable;\n\npublic class MelSyntaxHighlighterFactory extends SyntaxHighlighterFactory {\n @NotNull\n @Override\n public SyntaxHighlighter getSyntaxHighlighter(@Nullable Project project, @Nullable VirtualFile virtualFile) {\n return MelSyntaxHighlighter.getInstance();\n }\n}\n", "meta": {"content_hash": "bb842a07b7fb793876f129aaa7c8d4a8", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 113, "avg_line_length": 36.8235294117647, "alnum_prop": 0.8210862619808307, "repo_name": "machaval/mule-intellij-plugins", "id": "9799708e729ba0ce58ab3830b4aa7889ea64ca45", "size": "626", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "mule-esb-plugin/src/main/java/org/mule/tooling/esb/lang/mel/highlighter/MelSyntaxHighlighterFactory.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "660750"}, {"name": "Lex", "bytes": "10081"}]}} +{"text": "// Copyright (c) 2019-2020 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <amount.h>\n#include <arith_uint256.h>\n#include <compressor.h>\n#include <consensus/merkle.h>\n#include <core_io.h>\n#include <crypto/common.h>\n#include <crypto/siphash.h>\n#include <key_io.h>\n#include <memusage.h>\n#include <netbase.h>\n#include <policy/settings.h>\n#include <pow.h>\n#include <protocol.h>\n#include <pubkey.h>\n#include <rpc/util.h>\n#include <script/signingprovider.h>\n#include <script/standard.h>\n#include <serialize.h>\n#include <streams.h>\n#include <test/fuzz/FuzzedDataProvider.h>\n#include <test/fuzz/fuzz.h>\n#include <test/fuzz/util.h>\n#include <uint256.h>\n#include <util/check.h>\n#include <util/moneystr.h>\n#include <util/strencodings.h>\n#include <util/string.h>\n#include <util/system.h>\n#include <util/time.h>\n#include <version.h>\n\n#include <cassert>\n#include <chrono>\n#include <ctime>\n#include <limits>\n#include <set>\n#include <vector>\n\nvoid initialize()\n{\n SelectParams(CBaseChainParams::REGTEST);\n}\n\nvoid test_one_input(const std::vector<uint8_t>& buffer)\n{\n if (buffer.size() < sizeof(uint256) + sizeof(uint160)) {\n return;\n }\n FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());\n const uint256 u256(fuzzed_data_provider.ConsumeBytes<unsigned char>(sizeof(uint256)));\n const uint160 u160(fuzzed_data_provider.ConsumeBytes<unsigned char>(sizeof(uint160)));\n const uint64_t u64 = fuzzed_data_provider.ConsumeIntegral<uint64_t>();\n const int64_t i64 = fuzzed_data_provider.ConsumeIntegral<int64_t>();\n const uint32_t u32 = fuzzed_data_provider.ConsumeIntegral<uint32_t>();\n const int32_t i32 = fuzzed_data_provider.ConsumeIntegral<int32_t>();\n const uint16_t u16 = fuzzed_data_provider.ConsumeIntegral<uint16_t>();\n const int16_t i16 = fuzzed_data_provider.ConsumeIntegral<int16_t>();\n const uint8_t u8 = fuzzed_data_provider.ConsumeIntegral<uint8_t>();\n const int8_t i8 = fuzzed_data_provider.ConsumeIntegral<int8_t>();\n // We cannot assume a specific value of std::is_signed<char>::value:\n // ConsumeIntegral<char>() instead of casting from {u,}int8_t.\n const char ch = fuzzed_data_provider.ConsumeIntegral<char>();\n const bool b = fuzzed_data_provider.ConsumeBool();\n\n const Consensus::Params& consensus_params = Params().GetConsensus();\n (void)CheckProofOfWork(u256, u32, consensus_params);\n if (u64 <= MAX_MONEY) {\n const uint64_t compressed_money_amount = CompressAmount(u64);\n assert(u64 == DecompressAmount(compressed_money_amount));\n static const uint64_t compressed_money_amount_max = CompressAmount(MAX_MONEY - 1);\n assert(compressed_money_amount <= compressed_money_amount_max);\n } else {\n (void)CompressAmount(u64);\n }\n static const uint256 u256_min(uint256S(\"0000000000000000000000000000000000000000000000000000000000000000\"));\n static const uint256 u256_max(uint256S(\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\n const std::vector<uint256> v256{u256, u256_min, u256_max};\n (void)ComputeMerkleRoot(v256);\n (void)CountBits(u64);\n (void)DecompressAmount(u64);\n (void)FormatISO8601Date(i64);\n (void)FormatISO8601DateTime(i64);\n // FormatMoney(i) not defined when i == std::numeric_limits<int64_t>::min()\n if (i64 != std::numeric_limits<int64_t>::min()) {\n int64_t parsed_money;\n if (ParseMoney(FormatMoney(i64), parsed_money)) {\n assert(parsed_money == i64);\n }\n }\n (void)GetSizeOfCompactSize(u64);\n (void)GetSpecialScriptSize(u32);\n if (!MultiplicationOverflow(i64, static_cast<int64_t>(::nBytesPerSigOp)) && !AdditionOverflow(i64 * ::nBytesPerSigOp, static_cast<int64_t>(4))) {\n (void)GetVirtualTransactionSize(i64, i64);\n }\n if (!MultiplicationOverflow(i64, static_cast<int64_t>(u32)) && !AdditionOverflow(i64, static_cast<int64_t>(4)) && !AdditionOverflow(i64 * u32, static_cast<int64_t>(4))) {\n (void)GetVirtualTransactionSize(i64, i64, u32);\n }\n (void)HexDigit(ch);\n (void)MoneyRange(i64);\n (void)ToString(i64);\n (void)IsDigit(ch);\n (void)IsSpace(ch);\n (void)IsSwitchChar(ch);\n (void)memusage::DynamicUsage(ch);\n (void)memusage::DynamicUsage(i16);\n (void)memusage::DynamicUsage(i32);\n (void)memusage::DynamicUsage(i64);\n (void)memusage::DynamicUsage(i8);\n (void)memusage::DynamicUsage(u16);\n (void)memusage::DynamicUsage(u32);\n (void)memusage::DynamicUsage(u64);\n (void)memusage::DynamicUsage(u8);\n const unsigned char uch = static_cast<unsigned char>(u8);\n (void)memusage::DynamicUsage(uch);\n {\n const std::set<int64_t> i64s{i64, static_cast<int64_t>(u64)};\n const size_t dynamic_usage = memusage::DynamicUsage(i64s);\n const size_t incremental_dynamic_usage = memusage::IncrementalDynamicUsage(i64s);\n assert(dynamic_usage == incremental_dynamic_usage * i64s.size());\n }\n (void)MillisToTimeval(i64);\n const double d = ser_uint64_to_double(u64);\n assert(ser_double_to_uint64(d) == u64);\n const float f = ser_uint32_to_float(u32);\n assert(ser_float_to_uint32(f) == u32);\n (void)SighashToStr(uch);\n (void)SipHashUint256(u64, u64, u256);\n (void)SipHashUint256Extra(u64, u64, u256, u32);\n (void)ToLower(ch);\n (void)ToUpper(ch);\n // ValueFromAmount(i) not defined when i == std::numeric_limits<int64_t>::min()\n if (i64 != std::numeric_limits<int64_t>::min()) {\n int64_t parsed_money;\n if (ParseMoney(ValueFromAmount(i64).getValStr(), parsed_money)) {\n assert(parsed_money == i64);\n }\n }\n if (i32 >= 0 && i32 <= 16) {\n assert(i32 == CScript::DecodeOP_N(CScript::EncodeOP_N(i32)));\n }\n\n const std::chrono::seconds seconds{i64};\n assert(count_seconds(seconds) == i64);\n\n const CScriptNum script_num{i64};\n (void)script_num.getint();\n (void)script_num.getvch();\n\n const arith_uint256 au256 = UintToArith256(u256);\n assert(ArithToUint256(au256) == u256);\n assert(uint256S(au256.GetHex()) == u256);\n (void)au256.bits();\n (void)au256.GetCompact(/* fNegative= */ false);\n (void)au256.GetCompact(/* fNegative= */ true);\n (void)au256.getdouble();\n (void)au256.GetHex();\n (void)au256.GetLow64();\n (void)au256.size();\n (void)au256.ToString();\n\n const CKeyID key_id{u160};\n const CScriptID script_id{u160};\n // CTxDestination = CNoDestination \u222a PKHash \u222a ScriptHash \u222a WitnessV0ScriptHash \u222a WitnessV0KeyHash \u222a WitnessUnknown\n const PKHash pk_hash{u160};\n const ScriptHash script_hash{u160};\n const WitnessV0KeyHash witness_v0_key_hash{u160};\n const WitnessV0ScriptHash witness_v0_script_hash{u256};\n const std::vector<CTxDestination> destinations{pk_hash, script_hash, witness_v0_key_hash, witness_v0_script_hash};\n const SigningProvider store;\n for (const CTxDestination& destination : destinations) {\n (void)DescribeAddress(destination);\n (void)EncodeDestination(destination);\n (void)GetKeyForDestination(store, destination);\n (void)GetScriptForDestination(destination);\n (void)IsValidDestination(destination);\n }\n\n {\n CDataStream stream(SER_NETWORK, INIT_PROTO_VERSION);\n\n uint256 deserialized_u256;\n stream << u256;\n stream >> deserialized_u256;\n assert(u256 == deserialized_u256 && stream.empty());\n\n uint160 deserialized_u160;\n stream << u160;\n stream >> deserialized_u160;\n assert(u160 == deserialized_u160 && stream.empty());\n\n uint64_t deserialized_u64;\n stream << u64;\n stream >> deserialized_u64;\n assert(u64 == deserialized_u64 && stream.empty());\n\n int64_t deserialized_i64;\n stream << i64;\n stream >> deserialized_i64;\n assert(i64 == deserialized_i64 && stream.empty());\n\n uint32_t deserialized_u32;\n stream << u32;\n stream >> deserialized_u32;\n assert(u32 == deserialized_u32 && stream.empty());\n\n int32_t deserialized_i32;\n stream << i32;\n stream >> deserialized_i32;\n assert(i32 == deserialized_i32 && stream.empty());\n\n uint16_t deserialized_u16;\n stream << u16;\n stream >> deserialized_u16;\n assert(u16 == deserialized_u16 && stream.empty());\n\n int16_t deserialized_i16;\n stream << i16;\n stream >> deserialized_i16;\n assert(i16 == deserialized_i16 && stream.empty());\n\n uint8_t deserialized_u8;\n stream << u8;\n stream >> deserialized_u8;\n assert(u8 == deserialized_u8 && stream.empty());\n\n int8_t deserialized_i8;\n stream << i8;\n stream >> deserialized_i8;\n assert(i8 == deserialized_i8 && stream.empty());\n\n char deserialized_ch;\n stream << ch;\n stream >> deserialized_ch;\n assert(ch == deserialized_ch && stream.empty());\n\n bool deserialized_b;\n stream << b;\n stream >> deserialized_b;\n assert(b == deserialized_b && stream.empty());\n }\n\n {\n const ServiceFlags service_flags = (ServiceFlags)u64;\n (void)HasAllDesirableServiceFlags(service_flags);\n (void)MayHaveUsefulAddressDB(service_flags);\n }\n\n {\n CDataStream stream(SER_NETWORK, INIT_PROTO_VERSION);\n\n ser_writedata64(stream, u64);\n const uint64_t deserialized_u64 = ser_readdata64(stream);\n assert(u64 == deserialized_u64 && stream.empty());\n\n ser_writedata32(stream, u32);\n const uint32_t deserialized_u32 = ser_readdata32(stream);\n assert(u32 == deserialized_u32 && stream.empty());\n\n ser_writedata32be(stream, u32);\n const uint32_t deserialized_u32be = ser_readdata32be(stream);\n assert(u32 == deserialized_u32be && stream.empty());\n\n ser_writedata16(stream, u16);\n const uint16_t deserialized_u16 = ser_readdata16(stream);\n assert(u16 == deserialized_u16 && stream.empty());\n\n ser_writedata16be(stream, u16);\n const uint16_t deserialized_u16be = ser_readdata16be(stream);\n assert(u16 == deserialized_u16be && stream.empty());\n\n ser_writedata8(stream, u8);\n const uint8_t deserialized_u8 = ser_readdata8(stream);\n assert(u8 == deserialized_u8 && stream.empty());\n }\n\n {\n CDataStream stream(SER_NETWORK, INIT_PROTO_VERSION);\n\n WriteCompactSize(stream, u64);\n try {\n const uint64_t deserialized_u64 = ReadCompactSize(stream);\n assert(u64 == deserialized_u64 && stream.empty());\n } catch (const std::ios_base::failure&) {\n }\n }\n\n try {\n CHECK_NONFATAL(b);\n } catch (const NonFatalCheckError&) {\n }\n}\n", "meta": {"content_hash": "8e4988e84d5f284afd07e22d730db100", "timestamp": "", "source": "github", "line_count": 295, "max_line_length": 174, "avg_line_length": 36.68813559322034, "alnum_prop": 0.6548092026240414, "repo_name": "rnicoll/dogecoin", "id": "35d6804d4f24e5048d6f1eafd3a7f0ee90a14429", "size": "10833", "binary": false, "copies": "5", "ref": "refs/heads/main", "path": "src/test/fuzz/integer.cpp", "mode": "33188", "license": "mit", "language": [{"name": "Assembly", "bytes": "28173"}, {"name": "C", "bytes": "1064604"}, {"name": "C++", "bytes": "8101614"}, {"name": "CMake", "bytes": "28560"}, {"name": "HTML", "bytes": "21833"}, {"name": "M4", "bytes": "215256"}, {"name": "Makefile", "bytes": "117017"}, {"name": "Objective-C++", "bytes": "5497"}, {"name": "Python", "bytes": "2237402"}, {"name": "QMake", "bytes": "798"}, {"name": "Sage", "bytes": "35184"}, {"name": "Scheme", "bytes": "7554"}, {"name": "Shell", "bytes": "153769"}]}} +{"text": " /** * Gets the locale for translations. * Alias for getLocale(), for BC\npurpose. * * @return string $locale Locale to use for the translation,\ne.g. 'fr_FR' */ public function get\n <?php echo $alias ?>\n() { return $this->getLocale(); }\n", "meta": {"content_hash": "0ff97a7b3b45465e1402f72daf6187e0", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 72, "avg_line_length": 47.2, "alnum_prop": 0.6652542372881356, "repo_name": "rodolfobais/proylectura", "id": "102a40261b22a0ccf2bce21339726bfc09cda1f3", "size": "236", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "data/vendors/propel/generator/lib/behavior/i18n/templates/objectGetLocaleAlias.php", "mode": "33261", "license": "mit", "language": [{"name": "Batchfile", "bytes": "310"}, {"name": "C", "bytes": "481532"}, {"name": "C++", "bytes": "6264"}, {"name": "CSS", "bytes": "661857"}, {"name": "Groff", "bytes": "60910"}, {"name": "HTML", "bytes": "3283009"}, {"name": "JavaScript", "bytes": "3050759"}, {"name": "Makefile", "bytes": "16052"}, {"name": "PHP", "bytes": "5703593"}, {"name": "Perl", "bytes": "50950"}, {"name": "Shell", "bytes": "27882"}, {"name": "Smarty", "bytes": "3929"}]}} +{"text": "\ufeffnamespace MemeCentral.Server\n{\n using System;\n using System.Linq;\n using System.Web.ModelBinding;\n using Microsoft.AspNet.Identity;\n\n using Data.Models;\n using Events;\n using Controls;\n using System.Collections.Generic;\n using System.Web.UI.WebControls;\n\n public partial class MemeDetails : BasePage\n {\n protected void Page_Load(object sender, EventArgs e)\n {\n\n }\n\n // The id parameter should match the DataKeyNames value set on the control\n // or be decorated with a value provider attribute, e.g. [QueryString]int id\n public Meme MemeViewArticle_GetItem([QueryString(\"id\")]int? id)\n {\n var isUserLogged = this.User.Identity.IsAuthenticated;\n if (!isUserLogged)\n {\n this.Response.Redirect(\"/Account/Login\");\n }\n var meme = this.dbContext.Memes.Where(x => x.Id == id).FirstOrDefault();\n\n if (id == null | meme == null)\n {\n this.Response.Redirect(\"/NotFound\");\n }\n\n this.CurrentUserId = meme.UserId;\n\n return meme;\n }\n\n protected void CommentControl_Comment(object sender, CommentEventArgs e)\n {\n var userID = this.User.Identity.GetUserId();\n var meme = this.dbContext.Memes.Find(e.DataID);\n var comment = new Comment() { MemeId = meme.Id, UserId = userID, Content = e.Content, CreationDate = DateTime.Now };\n meme.Comments.Add(comment);\n this.dbContext.SaveChanges();\n\n var control = sender as CommentControl;\n control.Comments = meme.Comments.OrderByDescending(x => x.CreationDate).ToList();\n }\n\n protected List<Comment> GetComments(Meme item)\n {\n return item.Comments\n .OrderByDescending(x => x.CreationDate)\n .ToList();\n }\n\n protected int GetLikes(Meme item)\n {\n return item.Likes.Where(x => x.Value == true)\n .ToList()\n .Count();\n }\n\n protected int GetDislikes(Meme item)\n {\n return item.Likes.Where(x => x.Value == false)\n .ToList()\n .Count();\n }\n\n protected int HasUserVoted(Meme Item)\n {\n var userID = this.User.Identity.GetUserId();\n var hasUserVoted = Item.Likes\n .Where(x => x.UserId == userID)\n .FirstOrDefault();\n\n if (hasUserVoted == null)\n {\n return -1;\n }\n\n return 1;\n }\n\n protected void LikeControl_Like(object sender, LikeEventArgs e)\n {\n var userID = this.User.Identity.GetUserId();\n var meme = this.dbContext.Memes.Find(e.DataID);\n var rating = new Like();\n rating.MemeId = e.DataID;\n rating.UserId = userID;\n if (e.LikeValue == 1)\n {\n rating.Value = true;\n }\n else\n {\n rating.Value = false;\n }\n\n meme.Likes.Add(rating);\n this.dbContext.SaveChanges();\n\n var control = sender as LikeControl;\n control.Likes = this.GetLikes(meme);\n control.Dislikes = this.GetDislikes(meme);\n control.UserHasVoted = 1;\n }\n\n protected void DeleteButton_Command(object sender, CommandEventArgs e)\n {\n var memeId = e.CommandArgument.ToString();\n\t\t\tvar meme = this.dbContext.Memes.Find(int.Parse(memeId));\n\t\t\tvar likes = meme.Likes.ToArray();\n\t\t\tvar comments = meme.Comments.ToArray();\n\n\t\t\tforeach (var like in likes)\n\t\t\t{\n\t\t\t\tthis.dbContext.Likes.Remove(like);\n\t\t\t}\n\n\t\t\tforeach (var comment in comments)\n\t\t\t{\n\t\t\t\tthis.dbContext.Comments.Remove(comment);\n\t\t\t}\n\n this.dbContext.Memes.Remove(meme);\n var result = this.dbContext.SaveChanges();\n\n if (result == 1)\n {\n this.Response.Redirect(\"/\");\n }\n }\n\n protected bool IsUserCreator()\n {\n var userID = this.User.Identity.GetUserId();\n \n var isUserOwner = this.CurrentUserId == userID;\n\n return isUserOwner;\n }\n\n private string CurrentUserId\n {\n get\n {\n if (ViewState[\"CurrentUserId\"] != null)\n {\n return (string)(ViewState[\"CurrentUserId\"]);\n }\n else\n {\n return \"NaN\";\n }\n }\n set { ViewState[\"CurrentUserId\"] = value; }\n }\n }\n}", "meta": {"content_hash": "7215885c6884887694eccace33c15793", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 128, "avg_line_length": 28.41566265060241, "alnum_prop": 0.517065931736273, "repo_name": "The-Last-Of-Us/MemeCentral", "id": "7ab600d88aa454d09d65c05619b7a08ab796f19d", "size": "4719", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MemeCentral/MemeCentral.Server/MemeDetails.aspx.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "48580"}, {"name": "C#", "bytes": "76636"}, {"name": "CSS", "bytes": "2048"}, {"name": "JavaScript", "bytes": "170489"}]}} +{"text": "A loading view animation\n\n\n##Screenshots\n\n\n\n\n##\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 dodola\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", "meta": {"content_hash": "20851853cb7dcdead7ce1577e642c00b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 91, "avg_line_length": 39.12903225806452, "alnum_prop": 0.798845836768343, "repo_name": "dodola/WaveLoadingView", "id": "22c285c3e9722374d17cf2f90eaabd7d5f5b92ed", "size": "1232", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "5471"}]}} +{"text": "\r\n#include \"ChronoRage.h\"\r\n\r\n#include <Core/TGA.h>\r\n#include <Core/System/System.h>\r\n#include <Core/VFS/VFSXMLTranslator.h>\r\n#include <Audio/AudioGlobals.h>\r\n#include <Audio/AudioOpenAL/DriverOpenAL.h>\r\n\r\n#include <GameSettings.h>\r\n#include <Modes/GameModeDemo.h>\r\n#include <Modes/GameModeLevels.h>\r\n#include <Modes/GameModeTimeTrial.h>\r\n#include <Modes/GameModeSurvival.h>\r\n#include <Modes/GameModeDodge.h>\r\n#include <Modes/GameModeRevenge.h>\r\n#include <Modes/GameModeCredits.h>\r\n#include <Modes/MenuMode.h>\r\n#include <Modes/StartMode.h>\r\n#include <Modes/GameMode1.h>\r\n\r\nnamespace ChronoRage\r\n{\r\nconst bool TEST_MODE = false;\r\n\r\nconst String CHRONORAGE_GAME_SETTINGS_FILE = L\"/User/Settings.xml\";\r\nconst String CHRONORAGE_HIGH_SCORES_FILE = L\"/User/HighScores.xml\";\r\nconst String CHRONORAGE_LEVEL_RANKS_FILE = L\"/ChronoRageLevels/level-ranks.xml\";\r\nconst String CHRONORAGE_SURVIVAL_WAVE_FILE = L\"/ChronoRageLevels/Waves/waves-survival.xml\";\r\nconst String CHRONORAGE_DEMO_WAVE_FILE = L\"/ChronoRageLevels/Waves/waves-demo.xml\";\r\nconst String CHRONORAGE_DODGE_WAVE_FILE = L\"/ChronoRageLevels/Waves/waves-dodge.xml\";\r\n\r\nChronoRage::ChronoRage()\r\n: _pGameState(null)\r\n{\r\n#ifdef LM_DEVMODE\r\n _showRenderStats = false;\r\n#endif\r\n}\r\n\r\nChronoRage::~ChronoRage()\r\n{\r\n#if LM_DISPLAY_FPS\r\n _pTextFPS = null;\r\n _pTextFoesNumber = null;\r\n _pTextPowerLevel = null;\r\n _pTextTimeWarpNumber = null;\r\n _pFontFPS = null;\r\n _pHUD = null;\r\n#endif\r\n\r\n _pGameState = null;\r\n\r\n ///\r\n _appContext.pSoundLibrary = null;\r\n _appContext.pMenuMusic = null;\r\n _appContext.pGameMusic = null;\r\n _appContext.pSoundWorld = null;\r\n \r\n _appContext.pAudioDevice = null;\r\n _appContext.pAudioDriver = null;\r\n\r\n ///\r\n _appContext.pCameraPivot = null;\r\n _appContext.pCameraNode = null;\r\n _appContext.pWorld = null;\r\n\r\n ///\r\n _appContext.pVoxelFont1 = null;\r\n _appContext.pVoxelFont2 = null;\r\n _appContext.pVoxelCreditFont = null;\r\n\r\n ///\r\n _appContext.pCursorArrow = null;\r\n _appContext.pCursorReticle = null;\r\n _appContext.pWidgetFactory = null;\r\n \r\n if(_appContext.pGUI != null)\r\n {\r\n _appContext.pGUI->reset();\r\n _appContext.pGUI = null;\r\n }\r\n \r\n _appContext.pRenderer = null;\r\n _appContext.pDriver = null;\r\n\r\n _appContext.pWinHandler = null;\r\n _appContext.pInputManager = null;\r\n _appContext.pRenderWindow = null;\r\n _appContext.pVFS = null;\r\n\r\n _appContext.pGameSettings = null;\r\n _appContext.pHighScores = null;\r\n _appContext.pLevelRanks = null;\r\n\r\n _appContext.pDico = null;\r\n}\r\n\r\nbool ChronoRage::initialise()\r\n{\r\n#ifdef LM_DEVMODE\r\n Core::String workDir(LM_WORKING_DIRECTORY);\r\n SetCurrentDirectory(Core::String8(workDir).c_str());\r\n#endif\r\n\r\n INF << L\"---------------------------------------------------------\\n\";\r\n INF << L\"System informations\\n\";\r\n INF << L\"---------------------------------------------------------\\n\";\r\n INF << L\"OS Version : \" << Core::System::getOSName() << L\"\\n\";\r\n INF << L\"CPU type : \" << Core::System::getCPUName() << L\"\\n\";\r\n INF << L\"CPU count : \" << Core::toString(Core::System::getCPUCount()) << L\"\\n\";\r\n INF << L\"Physical RAM : \" << Core::toStringByteSize(Core::System::getTotalPhysicalRAM()) << L\"\\n\";\r\n INF << L\"File swap RAM : \" << Core::toStringByteSize(Core::System::getTotalFileSwapRAM()) << L\"\\n\";\r\n INF << L\"Virtual RAM : \" << Core::toStringByteSize(Core::System::getTotalVirtualRAM()) << L\"\\n\";\r\n INF << L\"Current dir : \" << Core::System::getCurrentDir() << L\"\\n\";\r\n INF << L\"---------------------------------------------------------\\n\";\r\n INF << L\"Virtual file system layout\\n\";\r\n INF << L\"---------------------------------------------------------\\n\";\r\n\r\n#ifdef LM_DEVMODE\r\n // Initialisation VFS ---------------------------------------------\r\n {\r\n Ptr<Core::XMLDocument> pXmlDocument(new Core::XMLDocument());\r\n\r\n if(pXmlDocument->loadDocument(L\"./Data/VFS-ChronoRage.xml\"))\r\n {\r\n _appContext.pVFS = Core::VFSFromXMLNode(pXmlDocument->firstChildNode(L\"vfs\"));\r\n INF << _appContext.pVFS->toString() << \"\\n\";\r\n }\r\n else\r\n throw Core::Exception(L\"Unable to mount VFS.\");\r\n\r\n }\r\n#else\r\n // Initialisation VFS ---------------------------------------------\r\n {\r\n Ptr<Core::XMLDocument> pXmlDocument(new Core::XMLDocument());\r\n\r\n if(pXmlDocument->loadDocument(L\"./VFS-ChronoRage.xml\"))\r\n {\r\n _appContext.pVFS = Core::VFSFromXMLNode(pXmlDocument->firstChildNode(L\"vfs\"));\r\n INF << _appContext.pVFS->toString() << \"\\n\";\r\n }\r\n else\r\n throw Core::Exception(L\"Unable to mount VFS.\");\r\n\r\n }\r\n#endif\r\n\r\n // Dico load file\r\n const Core::String DICO_FILE = L\"/ChronoRageDictionaries/main.xml\";\r\n Ptr<Core::InputStream> pInputDic = _appContext.pVFS->readFile(DICO_FILE);\r\n if(pInputDic == null)\r\n {\r\n Core::String message;\r\n message << L\"Unable to open dictionary file : \" << DICO_FILE;\r\n throw Core::Exception(message);\r\n }\r\n\r\n _appContext.pDriver = Gfx::IDriverPtr(new Gfx::DriverDx9());\r\n Gfx::DisplayMode displayMode = _appContext.pDriver->getAdapterDisplayMode(0);\r\n\r\n //Game Settings\r\n\r\n bool specialFx = false;\r\n Renderer::RendererSettings settings;\r\n Renderer::ConfigProfile profile;\r\n profile.msaaLevel = Renderer::MSAA_4X;\r\n profile.minWidth = 1024;\r\n profile.minHeight = 720;\r\n profile.textureVRAMRatio = 0.7f;\r\n\r\n // Auto config details\r\n const Gfx::GraphicCapabilities & caps = _appContext.pDriver->getGraphicCaps(0);\r\n\r\n if(int32(caps.psVersion) >= int32(Gfx::PS_V3_0))\r\n {\r\n if(caps.videoMem >= (400 << 20))\r\n {\r\n INF << L\"Special effects should be turned *on* by default, MSAA 4X by default\\n\";\r\n specialFx = true;\r\n profile.msaaLevel = Renderer::MSAA_4X;\r\n }\r\n else if(caps.videoMem >= (200 << 20))\r\n {\r\n INF << L\"Special effects should be turned *on* by default, MSAA NONE by default\\n\";\r\n specialFx = true;\r\n profile.msaaLevel = Renderer::MSAA_NONE;\r\n }\r\n else\r\n {\r\n INF << L\"Special effects should be turned *off* by default, MSAA NONE by default\\n\";\r\n specialFx = false;\r\n profile.msaaLevel = Renderer::MSAA_NONE;\r\n }\r\n }\r\n else if(int32(caps.psVersion) >= int32(Gfx::PS_V2_0))\r\n {\r\n INF << L\"Special effects should be turned *off* by default, MSAA NONE by default\\n\";\r\n specialFx = false;\r\n profile.msaaLevel = Renderer::MSAA_NONE;\r\n }\r\n else\r\n {\r\n ERR << L\"Video card does not support PS V2.0, exiting game with an error message\\n\";\r\n Ptr<Core::Dictionary> pDico(new Core::Dictionary(Core::System::getSystemSupportedLanguage(), *pInputDic));\r\n throw Core::Exception((*pDico)[L\"bad-gpu\"]);\r\n }\r\n\r\n Renderer::RendererSM2::autoConfig(_appContext.pDriver, 0, settings, profile);\r\n\r\n Ptr<GameSettings> pGameSettings(new GameSettings(settings.width, settings.height, settings.msaaLevel));\r\n pGameSettings->enableSpecialEffects(specialFx);\r\n _appContext.pGameSettings = pGameSettings;\r\n\r\n Ptr<Core::InputStream> pStreamSettingsFile = _appContext.pVFS->readFile(CHRONORAGE_GAME_SETTINGS_FILE);\r\n if(pStreamSettingsFile != null)\r\n {\r\n Ptr<Core::XMLDocument> pXmlGameSettings(new Core::XMLDocument());\r\n if(pXmlGameSettings->loadDocument(*pStreamSettingsFile)) \r\n _appContext.pGameSettings->importXML(pXmlGameSettings);\r\n INF << L\"Configuration loaded from file\\n\";\r\n }\r\n else\r\n {\r\n Ptr<Core::OutputStream> pSettingsOutput(_appContext.pVFS->writeFile(CHRONORAGE_GAME_SETTINGS_FILE));\r\n if(pSettingsOutput != null)\r\n {\r\n Ptr<Core::XMLDocument> pXMLDoc(new Core::XMLDocument());\r\n _appContext.pGameSettings->exportXML(pXMLDoc);\r\n pXMLDoc->saveDocument(*pSettingsOutput);\r\n pSettingsOutput->close();\r\n }\r\n INF << L\"No configuration file found, using autoconfig setup\\n\";\r\n }\r\n\r\n //Ranks\r\n Ptr<LevelRanks> pLevelRanks(new LevelRanks());\r\n _appContext.pLevelRanks = pLevelRanks;\r\n Ptr<Core::InputStream> pStreamLevelRanksFile = _appContext.pVFS->readFile(CHRONORAGE_LEVEL_RANKS_FILE);\r\n if(pStreamLevelRanksFile != null)\r\n {\r\n Ptr<Core::XMLDocument> pXmlLevelRanks(new Core::XMLDocument());\r\n if(pXmlLevelRanks->loadDocument(*pStreamLevelRanksFile)) \r\n _appContext.pLevelRanks->importXML(pXmlLevelRanks);\r\n }\r\n\r\n //High Scores\r\n#ifndef CHRONORAGE_DEMO\r\n Ptr<HighScores> pHighScores(new HighScores(pLevelRanks));\r\n _appContext.pHighScores = pHighScores;\r\n Ptr<Core::InputStream> pStreamHighScoresFile = _appContext.pVFS->readFile(CHRONORAGE_HIGH_SCORES_FILE);\r\n if(pStreamHighScoresFile != null)\r\n {\r\n Ptr<Core::XMLDocument> pXmlHighScores(new Core::XMLDocument());\r\n if(pXmlHighScores->loadDocument(*pStreamHighScoresFile))\r\n _appContext.pHighScores->importXML(pXmlHighScores);\r\n }\r\n else\r\n {\r\n Ptr<Core::OutputStream> pHighScoresOutput(_appContext.pVFS->writeFile(CHRONORAGE_HIGH_SCORES_FILE));\r\n if(pHighScoresOutput != null)\r\n {\r\n Ptr<Core::XMLDocument> pXMLDoc(new Core::XMLDocument());\r\n _appContext.pHighScores->exportXML(pXMLDoc);\r\n pXMLDoc->saveDocument(*pHighScoresOutput);\r\n pHighScoresOutput->close();\r\n }\r\n }\r\n#else\r\n _appContext.pHighScores = null;\r\n#endif\r\n\r\n _appContext.exitState = DO_NOT_EXIT;\r\n _appContext.saveScores = false;\r\n _appContext.fastTitle = false;\r\n\r\n HICON hMyIcon = LoadIcon(getInstance(), \"IDI_ICON1\");\r\n\r\n _appContext.pInputManager = Ptr<Window::InputManager>(new Window::InputManager());\r\n _appContext.pWinHandler = Ptr<Window::WinHandler>(new Window::WinHandler(_appContext.pInputManager));\r\n _appContext.pRenderWindow = Ptr<Window::Window>(new Window::Window(\r\n getInstance(),\r\n L\"Chrono Rage\",\r\n 0, 0, // position\r\n _appContext.pGameSettings->getScreenWidth(), // width\r\n _appContext.pGameSettings->getScreenHeight(), // height\r\n _appContext.pGameSettings->fullscreen(), // fullscreen\r\n _appContext.pWinHandler,\r\n hMyIcon));\r\n\r\n _appContext.pInputManager->initialise(_appContext.pRenderWindow->getHandle());\r\n\r\n // Pour \u00e9viter de r\u00e9f\u00e9rencer un joystick qui n'est plus branch\u00e9\r\n _appContext.pGameSettings->cleanupSettings(*_appContext.pInputManager);\r\n\r\n _appContext.pRenderer = Ptr<Renderer::IRenderer>(new Renderer::RendererSM2(\r\n _appContext.pDriver,\r\n _appContext.pGameSettings->getRendererSettings(),\r\n _appContext.pRenderWindow->getHandle(),\r\n _appContext.pVFS,\r\n L\"/Shaders\"));\r\n\r\n Audio::initVorbisFileDll();\r\n\r\n _appContext.pAudioDriver = Ptr<Audio::IDriver>(new AudioOpenAL::DriverOpenAL());\r\n _appContext.pAudioDevice = _appContext.pAudioDriver->createDevice(0);\r\n _appContext.pSoundLibrary = Ptr<SoundLibrary>(new SoundLibrary(_appContext));\r\n\r\n bool result = _appContext.pRenderer->initialise();\r\n\r\n _appContext.pWorld = Ptr<Universe::World>(new Universe::World(_appContext.pRenderer, _appContext.pVFS, null, null));\r\n\r\n _appContext.pSoundWorld = Ptr<Universe::World>(new Universe::World(_appContext.pRenderer, _appContext.pVFS, null, _appContext.pAudioDevice));\r\n _appContext.pMenuMusic = null;\r\n _appContext.pGameMusic = null;\r\n Ptr<Universe::NodeListener> pNodeListener = _appContext.pSoundWorld->getNodeListener();\r\n if(pNodeListener != null)\r\n pNodeListener->setGain(1.0f);\r\n\r\n _appContext.pGUI = Ptr<GUI::Manager>(new GUI::Manager(_appContext.pVFS, _appContext.pRenderWindow, _appContext.pInputManager, _appContext.pRenderer, _appContext.pWorld->getRessourcesPool()));\r\n _appContext.pGUI->getResPool()->mountPictureBank(L\"/ChronoRageData/GUI\", L\"/ChronoRageData/GUI.pbk\");\r\n#ifdef CHRONORAGE_DEMO\r\n _appContext.pGUI->getResPool()->mountPictureBank(L\"/ChronoRageData/DemoGUI\", L\"/ChronoRageData/DemoGUI.pbk\");\r\n#endif\r\n\r\n _appContext.pCursorArrow = Core::loadTGA(*_appContext.pVFS->readFile(L\"/ChronoRageData/arrow.tga\"));\r\n _appContext.pCursorReticle = Core::loadTGA(*_appContext.pVFS->readFile(L\"/ChronoRageData/reticle.tga\"));\r\n _appContext.pCursorBlank = Core::loadTGA(*_appContext.pVFS->readFile(L\"/ChronoRageData/blank.tga\"));\r\n \r\n _appContext.reloadDictionary = false;\r\n _appContext.pDico = Ptr<Core::Dictionary>(new Core::Dictionary(pGameSettings->getLanguage(), *pInputDic));\r\n\r\n _appContext.pWidgetFactory = Ptr<WidgetFactory>(new WidgetFactory( _appContext.pGUI, \r\n _appContext.pInputManager, \r\n _appContext.pDico, \r\n _appContext.pSoundLibrary));\r\n\r\n //_appContext.wantedMode = _currentMode = MENU_MODE;\r\n _appContext.wantedMode = _currentMode = START_MODE;\r\n _appContext.wantedScreen = MAIN_MENU_SCREEN;\r\n \r\n if(result)\r\n {\r\n if(TEST_MODE)\r\n {\r\n Ptr<GameModeTimeTrial> pGameModeTimeTrial(new GameModeTimeTrial(_appContext));\r\n _pGameState = pGameModeTimeTrial;\r\n _pGameState->initialize();\r\n pGameModeTimeTrial->setLevel(19);\r\n /*Ptr<GameModeDemo> pGameModeDemo(new GameModeDemo(_appContext));\r\n _pGameState = pGameModeDemo;\r\n _pGameState->initialize();\r\n pGameModeDemo->registerWaveFile(CHRONORAGE_DEMO_WAVE_FILE);*/\r\n }\r\n else\r\n initGameState();\r\n\r\n }\r\n\r\n#if LM_DISPLAY_FPS\r\n // Compteur FPS\r\n _pHUD = _appContext.pRenderer->createHUD();\r\n _pFontFPS = _appContext.pRenderer->createFont(L\"Arial\", 10);\r\n _pTextFPS = _pHUD->createText(_pFontFPS, L\"\");\r\n _pTextFPS->setColor(Core::Vector4f(0.7f, 0.7f, 0.7f, 1.0f));\r\n _pTextFPS->setPosition(Core::Vector2f(5.0f, 5.0f));\r\n\r\n _pTextFoesNumber = _pHUD->createText(_pFontFPS, L\"\");\r\n _pTextFoesNumber->setColor(Core::Vector4f(1.0f, 0.7f, 0.7f, 1.0f));\r\n _pTextFoesNumber->setPosition(Core::Vector2f(100.0f, 5.0f));\r\n\r\n _pTextTimeWarpNumber = _pHUD->createText(_pFontFPS, L\"\");\r\n _pTextTimeWarpNumber->setColor(Core::Vector4f(0.1f, 1.0f, 1.0f, 1.0f));\r\n _pTextTimeWarpNumber->setPosition(Core::Vector2f(5.0f, 40.0f));\r\n\r\n _pTextPowerLevel = _pHUD->createText(_pFontFPS, L\"\");\r\n _pTextPowerLevel->setColor(Core::Vector4f(0.7f, 0.1f, 1.0f, 1.0f));\r\n _pTextPowerLevel->setPosition(Core::Vector2f(5.0f, 60.0f));\r\n#endif\r\n\r\n return result;\r\n}\r\n\r\nvoid ChronoRage::run()\r\n{\r\n try\r\n {\r\n Application::run();\r\n }\r\n catch(Gfx::GfxException & exception)\r\n {\r\n ERR << L\"Fatal GFX exception caught : \" << exception.getMessage() << L\"\\n\";\r\n#ifdef _DEBUG\r\n ERR << exception.getCallStack() << L\"\\n\";\r\n#endif\r\n String error(L\"A fatal error occurred in display module\");\r\n if(_appContext.pDico != null)\r\n error = (*_appContext.pDico)[L\"gfx-error\"];\r\n throw Core::Exception(error);\r\n }\r\n catch(Renderer::RendererException & exception)\r\n {\r\n ERR << L\"Fatal GFX exception caught : \" << exception.getMessage() << L\"\\n\";\r\n#ifdef _DEBUG\r\n ERR << exception.getCallStack() << L\"\\n\";\r\n#endif\r\n String error(L\"A fatal error occurred in display module\");\r\n if(_appContext.pDico != null)\r\n error = (*_appContext.pDico)[L\"gfx-error\"];\r\n throw Core::Exception(error);\r\n }\r\n}\r\n\r\nvoid ChronoRage::release()\r\n{\r\n //Sauvegarde settings\r\n Ptr<Core::OutputStream> pSettingsOutput(_appContext.pVFS->writeFile(CHRONORAGE_GAME_SETTINGS_FILE));\r\n if(pSettingsOutput != null)\r\n {\r\n Ptr<Core::XMLDocument> pXMLDoc(new Core::XMLDocument());\r\n _appContext.pGameSettings->exportXML(pXMLDoc);\r\n pXMLDoc->saveDocument(*pSettingsOutput);\r\n pSettingsOutput->close();\r\n }\r\n#ifndef CHRONORAGE_DEMO\r\n //Sauvegarde High Scores\r\n Ptr<Core::OutputStream> pHighScoresOutput(_appContext.pVFS->writeFile(CHRONORAGE_HIGH_SCORES_FILE));\r\n if(pHighScoresOutput != null)\r\n {\r\n Ptr<Core::XMLDocument> pXMLDoc(new Core::XMLDocument());\r\n _appContext.pHighScores->exportXML(pXMLDoc);\r\n pXMLDoc->saveDocument(*pHighScoresOutput);\r\n pHighScoresOutput->close();\r\n }\r\n#endif\r\n \r\n\r\n if(_appContext.pGameMusic != null)\r\n {\r\n _appContext.pGameMusic->kill();\r\n _appContext.pGameMusic = null;\r\n }\r\n\r\n if(_appContext.pMenuMusic != null)\r\n {\r\n _appContext.pMenuMusic->kill();\r\n _appContext.pMenuMusic = null;\r\n }\r\n\r\n Audio::shutdownVorbisFileDll();\r\n}\r\n\r\nvoid ChronoRage::update(double elapsed)\r\n{\r\n if(_appContext.reloadDictionary)\r\n {\r\n const Core::String DICO_FILE = L\"/ChronoRageDictionaries/main.xml\";\r\n Ptr<Core::InputStream> pInputDic = _appContext.pVFS->readFile(DICO_FILE);\r\n if(pInputDic == null)\r\n {\r\n Core::String message;\r\n message << L\"Unable to open dictionary file : \" << DICO_FILE;\r\n throw Core::Exception(message);\r\n }\r\n \r\n _appContext.reloadDictionary = false;\r\n _appContext.pDico = Ptr<Core::Dictionary>(new Core::Dictionary(_appContext.pGameSettings->getLanguage(), *pInputDic));\r\n\r\n _appContext.pWidgetFactory = Ptr<WidgetFactory>(new WidgetFactory( _appContext.pGUI, \r\n _appContext.pInputManager, \r\n _appContext.pDico, \r\n _appContext.pSoundLibrary));\r\n\r\n if(_pGameState->getMode() == MENU_MODE)\r\n {\r\n Ptr<MenuMode> pMenuMode = LM_DEBUG_PTR_CAST<MenuMode>(_pGameState);\r\n pMenuMode->resetScreenLabels();\r\n }\r\n\r\n _appContext.reloadDictionary = false;\r\n }\r\n\r\n if(_appContext.wantedMode != _currentMode)\r\n {\r\n _currentMode = _appContext.wantedMode;\r\n initGameState();\r\n }\r\n\r\n#ifndef CHRONORAGE_DEMO\r\n if(_appContext.saveScores)\r\n {\r\n //Sauvegarde High Scores\r\n Ptr<Core::OutputStream> pHighScoresOutput(_appContext.pVFS->writeFile(CHRONORAGE_HIGH_SCORES_FILE));\r\n if(pHighScoresOutput != null)\r\n {\r\n Ptr<Core::XMLDocument> pXMLDoc(new Core::XMLDocument());\r\n _appContext.pHighScores->exportXML(pXMLDoc);\r\n pXMLDoc->saveDocument(*pHighScoresOutput);\r\n pHighScoresOutput->close();\r\n }\r\n _appContext.saveScores = false;\r\n }\r\n#endif\r\n\r\n if(_appContext.exitState == MUST_EXIT_NOW)\r\n {\r\n PostQuitMessage(0);\r\n }\r\n\r\n LM_ASSERT(_appContext.pSoundWorld != null);\r\n _appContext.pSoundWorld->update(elapsed);\r\n\r\n _pGameState->update(elapsed);\r\n\r\n#ifdef LM_DEVMODE\r\n if(_appContext.pInputManager->isKeyTyped(VK_ADD))\r\n _pGameState->powerUp();\r\n if(_appContext.pInputManager->isKeyTyped(VK_SUBTRACT))\r\n _pGameState->powerDown();\r\n\r\n int32 foeId = -1;\r\n if(_appContext.pInputManager->isKeyTyped(VK_NUMPAD0))\r\n foeId = 0;\r\n if(_appContext.pInputManager->isKeyTyped(VK_NUMPAD1))\r\n foeId = 1;\r\n if(_appContext.pInputManager->isKeyTyped(VK_NUMPAD2))\r\n foeId = 2;\r\n if(_appContext.pInputManager->isKeyTyped(VK_NUMPAD3))\r\n foeId = 3;\r\n if(_appContext.pInputManager->isKeyTyped(VK_NUMPAD4))\r\n foeId = 4;\r\n if(_appContext.pInputManager->isKeyTyped(VK_NUMPAD5))\r\n foeId = 5;\r\n if(_appContext.pInputManager->isKeyTyped(VK_NUMPAD6))\r\n foeId = 6;\r\n if(_appContext.pInputManager->isKeyTyped(VK_NUMPAD7))\r\n foeId = 7;\r\n if(_appContext.pInputManager->isKeyTyped(VK_NUMPAD8))\r\n foeId = 8;\r\n if(_appContext.pInputManager->isKeyTyped(VK_NUMPAD9))\r\n foeId = 9;\r\n\r\n if(foeId >= 0)\r\n _pGameState->createFoe(foeId);\r\n\r\n if(_appContext.pInputManager->isKeyTyped(VK_F11))\r\n _showRenderStats = !_showRenderStats;\r\n if(_appContext.pInputManager->isKeyTyped(VK_F12))\r\n Core::Allocator::getInstance().dumpMemoryUsage();\r\n\r\n#endif/*LM_DEVMODE*/\r\n}\r\n\r\nvoid ChronoRage::render()\r\n{\r\n Ptr<Renderer::IRenderView> pView(_appContext.pRenderer->getDefaultView());\r\n pView->resize(_appContext.pWinHandler->getWindowWidth(), _appContext.pWinHandler->getWindowHeight());\r\n\r\n _pGameState->render(pView);\r\n#if LM_DISPLAY_FPS\r\n _fps.nextFrame();\r\n if(_showRenderStats)\r\n _pTextFPS->setText(_fps.getText() + L\"\\n\\n\\n\\n\\n\" + _appContext.pRenderer->getRenderStats());\r\n else\r\n _pTextFPS->setText(_fps.getText());\r\n\r\n Core::String foesNumber = L\"Foes number : \";\r\n foesNumber << _pGameState->getFoesNumber()\r\n << L\" Nodes count : \"\r\n << Core::toString(_appContext.pWorld->getAllNodes().size());\r\n _pTextFoesNumber->setText(foesNumber);\r\n\r\n Core::String timeWarpNumber = L\"TimeWarp number : \";\r\n timeWarpNumber << Core::toString(_pGameState->getTimeWarpNumber(), 2);\r\n _pTextTimeWarpNumber->setText(timeWarpNumber);\r\n\r\n Core::String powerLevel = L\"Player Power Level : \";\r\n powerLevel << Core::toString(_pGameState->getPowerLevel(), 2);\r\n _pTextPowerLevel->setText(powerLevel);\r\n\r\n //_appContext.pRenderer->renderHUD(pView, _pHUD);\r\n#endif\r\n pView->present();\r\n}\r\n\r\nvoid ChronoRage::initGameState()\r\n{\r\n try\r\n {\r\n switch(_currentMode)\r\n {\r\n case START_MODE:\r\n _pGameState = Ptr<StartMode>(new StartMode(_appContext));\r\n _pGameState->initialize();\r\n break;\r\n case MENU_MODE:\r\n _pGameState = Ptr<MenuMode>(new MenuMode(_appContext));\r\n _pGameState->initialize();\r\n break;\r\n#ifndef CHRONORAGE_DEMO\r\n case NEW_GAME_MODE:\r\n {\r\n Ptr<GameModeLevels> pGameModeLevels(new GameModeLevels(_appContext));\r\n _pGameState = pGameModeLevels;\r\n _pGameState->initialize();\r\n pGameModeLevels->setLevel(1);\r\n }\r\n break;\r\n case CONTINUE_GAME_MODE:\r\n {\r\n Ptr<GameModeLevels> pGameModeLevels(new GameModeLevels(_appContext));\r\n _pGameState = pGameModeLevels;\r\n _pGameState->initialize();\r\n pGameModeLevels->setLevel(_appContext.wantedLevel);\r\n }\r\n break;\r\n case TIME_TRIAL_MODE:\r\n {\r\n Ptr<GameModeTimeTrial> pGameModeTimeTrial(new GameModeTimeTrial(_appContext));\r\n _pGameState = pGameModeTimeTrial;\r\n _pGameState->initialize();\r\n pGameModeTimeTrial->setLevel(_appContext.wantedLevel);\r\n }\r\n break;\r\n case SURVIVAL_MODE:\r\n {\r\n Ptr<GameModeSurvival> pGameModeSurvival(new GameModeSurvival(_appContext, false));\r\n _pGameState = pGameModeSurvival;\r\n _pGameState->initialize();\r\n pGameModeSurvival->registerWaveFile(CHRONORAGE_SURVIVAL_WAVE_FILE);\r\n }\r\n break;\r\n case SURVIVAL_HARD_MODE:\r\n {\r\n Ptr<GameModeSurvival> pGameModeSurvival(new GameModeSurvival(_appContext, true));\r\n _pGameState = pGameModeSurvival;\r\n _pGameState->initialize();\r\n pGameModeSurvival->registerWaveFile(CHRONORAGE_SURVIVAL_WAVE_FILE);\r\n }\r\n break;\r\n case DODGE_MODE:\r\n {\r\n Ptr<GameModeDodge> pGameModeDodge(new GameModeDodge(_appContext));\r\n _pGameState = pGameModeDodge;\r\n _pGameState->initialize();\r\n pGameModeDodge->registerWaveFile(CHRONORAGE_DODGE_WAVE_FILE);\r\n }\r\n break;\r\n case REVENGE_MODE:\r\n {\r\n Ptr<GameModeRevenge> pGameModeRevenge(new GameModeRevenge(_appContext));\r\n _pGameState = pGameModeRevenge;\r\n _pGameState->initialize();\r\n pGameModeRevenge->registerWaveFile(CHRONORAGE_SURVIVAL_WAVE_FILE);\r\n }\r\n break;\r\n#endif\r\n case DEMO_MODE:\r\n {\r\n Ptr<GameModeDemo> pGameModeDemo(new GameModeDemo(_appContext));\r\n _pGameState = pGameModeDemo;\r\n _pGameState->initialize();\r\n pGameModeDemo->registerWaveFile(CHRONORAGE_DEMO_WAVE_FILE);\r\n }\r\n break;\r\n#ifndef CHRONORAGE_DEMO\r\n case CREDITS_MODE:\r\n {\r\n Ptr<GameModeCredits> pGameModeCredits(new GameModeCredits(_appContext));\r\n _pGameState = pGameModeCredits;\r\n _pGameState->initialize();\r\n pGameModeCredits->setLevel(_appContext.wantedLevel);\r\n }\r\n break;\r\n#endif\r\n }\r\n }\r\n catch(Core::Exception & e)\r\n {\r\n Core::System::errorMessageBox(e.getMessage());\r\n ERR << L\"Error initialising world : \" << e.getMessage() << L\"\\n\";\r\n ERR << e.getCallStack();\r\n }\r\n}\r\n\r\n}//namespace ChronoRage", "meta": {"content_hash": "460268b93d5216cd05638932eb9d7ee9", "timestamp": "", "source": "github", "line_count": 687, "max_line_length": 195, "avg_line_length": 37.15574963609898, "alnum_prop": 0.5997414401002898, "repo_name": "benkaraban/anima-games-engine", "id": "b2792d88366c3c2beb8a919e642ccb3fe7a88e82", "size": "27195", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Sources/ChronoRage/ChronoRage.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "8772269"}, {"name": "C#", "bytes": "125904"}, {"name": "C++", "bytes": "74431764"}, {"name": "CMake", "bytes": "43555"}, {"name": "Java", "bytes": "95806"}, {"name": "Makefile", "bytes": "17914"}, {"name": "NSIS", "bytes": "17188"}, {"name": "Objective-C", "bytes": "50195"}, {"name": "Perl", "bytes": "6275"}, {"name": "Python", "bytes": "22678"}, {"name": "Shell", "bytes": "21728"}]}} +{"text": "\n\npackage org.apache.hadoop.hdfs.server.datanode;\n\nimport static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY;\nimport static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_DEFAULT;\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertTrue;\nimport static org.junit.Assert.fail;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.net.InetSocketAddress;\n\nimport org.apache.hadoop.conf.Configuration;\nimport org.apache.hadoop.conf.ReconfigurationException;\nimport org.apache.hadoop.fs.CommonConfigurationKeys;\nimport org.apache.hadoop.fs.FileUtil;\nimport org.apache.hadoop.hdfs.DFSConfigKeys;\nimport org.apache.hadoop.hdfs.HdfsConfiguration;\nimport org.apache.hadoop.hdfs.MiniDFSCluster;\nimport org.apache.hadoop.hdfs.MiniDFSNNTopology;\nimport org.junit.After;\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.Test;\n\n/**\n * Test to reconfigure some parameters for DataNode without restart\n */\npublic class TestDataNodeReconfiguration {\n\n private static final String DATA_DIR = MiniDFSCluster.getBaseDirectory()\n + \"data\";\n private final static InetSocketAddress NN_ADDR = new InetSocketAddress(\n \"localhost\", 5020);\n private final int NUM_NAME_NODE = 1;\n private final int NUM_DATA_NODE = 10;\n private MiniDFSCluster cluster;\n\n @Before\n public void Setup() throws IOException {\n startDFSCluster(NUM_NAME_NODE, NUM_DATA_NODE);\n }\n\n @After\n public void tearDown() throws Exception {\n if (cluster != null) {\n cluster.shutdown();\n cluster = null;\n }\n\n File dir = new File(DATA_DIR);\n if (dir.exists())\n Assert.assertTrue(\"Cannot delete data-node dirs\",\n FileUtil.fullyDelete(dir));\n }\n\n private void startDFSCluster(int numNameNodes, int numDataNodes)\n throws IOException {\n Configuration conf = new Configuration();\n\n MiniDFSNNTopology nnTopology = MiniDFSNNTopology\n .simpleFederatedTopology(numNameNodes);\n\n cluster = new MiniDFSCluster.Builder(conf).nnTopology(nnTopology)\n .numDataNodes(numDataNodes).build();\n cluster.waitActive();\n }\n\n /**\n * Starts an instance of DataNode\n *\n * @throws IOException\n */\n public DataNode[] createDNsForTest(int numDateNode) throws IOException {\n Configuration conf = new HdfsConfiguration();\n conf.set(DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY, DATA_DIR);\n conf.set(DFSConfigKeys.DFS_DATANODE_ADDRESS_KEY, \"0.0.0.0:0\");\n conf.set(DFSConfigKeys.DFS_DATANODE_HTTP_ADDRESS_KEY, \"0.0.0.0:0\");\n conf.set(DFSConfigKeys.DFS_DATANODE_IPC_ADDRESS_KEY, \"0.0.0.0:0\");\n conf.setInt(CommonConfigurationKeys.IPC_CLIENT_CONNECT_MAX_RETRIES_KEY, 0);\n\n DataNode[] result = new DataNode[numDateNode];\n for (int i = 0; i < numDateNode; i++) {\n result[i] = InternalDataNodeTestUtils.startDNWithMockNN(conf, NN_ADDR, DATA_DIR);\n }\n return result;\n }\n\n @Test\n public void testMaxConcurrentMoversReconfiguration()\n throws ReconfigurationException, IOException {\n int maxConcurrentMovers = 10;\n for (int i = 0; i < NUM_DATA_NODE; i++) {\n DataNode dn = cluster.getDataNodes().get(i);\n\n // try invalid values\n try {\n dn.reconfigureProperty(\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY, \"text\");\n fail(\"ReconfigurationException expected\");\n } catch (ReconfigurationException expected) {\n assertTrue(\"expecting NumberFormatException\",\n expected.getCause() instanceof NumberFormatException);\n }\n try {\n dn.reconfigureProperty(\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY,\n String.valueOf(-1));\n fail(\"ReconfigurationException expected\");\n } catch (ReconfigurationException expected) {\n assertTrue(\"expecting IllegalArgumentException\",\n expected.getCause() instanceof IllegalArgumentException);\n }\n try {\n dn.reconfigureProperty(\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY,\n String.valueOf(0));\n fail(\"ReconfigurationException expected\");\n } catch (ReconfigurationException expected) {\n assertTrue(\"expecting IllegalArgumentException\",\n expected.getCause() instanceof IllegalArgumentException);\n }\n\n // change properties\n dn.reconfigureProperty(DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY,\n String.valueOf(maxConcurrentMovers));\n\n // verify change\n assertEquals(String.format(\"%s has wrong value\",\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY),\n maxConcurrentMovers, dn.xserver.balanceThrottler.getMaxConcurrentMovers());\n\n assertEquals(String.format(\"%s has wrong value\",\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY),\n maxConcurrentMovers, Integer.parseInt(dn.getConf().get(\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY)));\n\n // revert to default\n dn.reconfigureProperty(DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY,\n null);\n\n // verify default\n assertEquals(String.format(\"%s has wrong value\",\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY),\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_DEFAULT,\n dn.xserver.balanceThrottler.getMaxConcurrentMovers());\n\n assertEquals(String.format(\"expect %s is not configured\",\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY), null, dn\n .getConf().get(DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY));\n }\n }\n\n @Test\n public void testAcquireWithMaxConcurrentMoversGreaterThanDefault()\n throws IOException, ReconfigurationException {\n final DataNode[] dns = createDNsForTest(1);\n try {\n testAcquireOnMaxConcurrentMoversReconfiguration(dns[0], 10);\n } finally {\n dns[0].shutdown();\n }\n }\n\n @Test\n public void testAcquireWithMaxConcurrentMoversLessThanDefault()\n throws IOException, ReconfigurationException {\n final DataNode[] dns = createDNsForTest(1);\n try {\n testAcquireOnMaxConcurrentMoversReconfiguration(dns[0], 3);\n } finally {\n dns[0].shutdown();\n }\n }\n\n /**\n * Simulates a scenario where the DataNode has been reconfigured with fewer\n * mover threads, but all of the current treads are busy and therefore the\n * DataNode is unable to honor this request within a reasonable amount of\n * time. The DataNode eventually gives up and returns a flag indicating that\n * the request was not honored.\n */\n @Test\n public void testFailedDecreaseConcurrentMovers()\n throws IOException, ReconfigurationException {\n final DataNode[] dns = createDNsForTest(1);\n final DataNode dataNode = dns[0];\n try {\n // Set the current max to 2\n dataNode.xserver.updateBalancerMaxConcurrentMovers(2);\n\n // Simulate grabbing 2 threads\n dataNode.xserver.balanceThrottler.acquire();\n dataNode.xserver.balanceThrottler.acquire();\n\n dataNode.xserver.setMaxReconfigureWaitTime(1);\n\n // Attempt to set new maximum to 1\n final boolean success =\n dataNode.xserver.updateBalancerMaxConcurrentMovers(1);\n Assert.assertFalse(success);\n } finally {\n dataNode.shutdown();\n }\n }\n\n /**\n * Test with invalid configuration.\n */\n @Test(expected = ReconfigurationException.class)\n public void testFailedDecreaseConcurrentMoversReconfiguration()\n throws IOException, ReconfigurationException {\n final DataNode[] dns = createDNsForTest(1);\n final DataNode dataNode = dns[0];\n try {\n // Set the current max to 2\n dataNode.xserver.updateBalancerMaxConcurrentMovers(2);\n\n // Simulate grabbing 2 threads\n dataNode.xserver.balanceThrottler.acquire();\n dataNode.xserver.balanceThrottler.acquire();\n\n dataNode.xserver.setMaxReconfigureWaitTime(1);\n\n // Now try reconfigure maximum downwards with threads released\n dataNode.reconfigurePropertyImpl(\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY, \"1\");\n } catch (ReconfigurationException e) {\n Assert.assertEquals(DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY,\n e.getProperty());\n Assert.assertEquals(\"1\", e.getNewValue());\n throw e;\n } finally {\n dataNode.shutdown();\n }\n }\n\n private void testAcquireOnMaxConcurrentMoversReconfiguration(\n DataNode dataNode, int maxConcurrentMovers) throws IOException,\n ReconfigurationException {\n final int defaultMaxThreads = dataNode.getConf().getInt(\n DFSConfigKeys.DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY,\n DFSConfigKeys.DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_DEFAULT);\n\n /** Test that the default setup is working */\n\n for (int i = 0; i < defaultMaxThreads; i++) {\n assertEquals(\"should be able to get thread quota\", true,\n dataNode.xserver.balanceThrottler.acquire());\n }\n\n assertEquals(\"should not be able to get thread quota\", false,\n dataNode.xserver.balanceThrottler.acquire());\n\n // Give back the threads\n for (int i = 0; i < defaultMaxThreads; i++) {\n dataNode.xserver.balanceThrottler.release();\n }\n\n /** Test that the change is applied correctly */\n\n // change properties\n dataNode.reconfigureProperty(\n DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY,\n String.valueOf(maxConcurrentMovers));\n\n assertEquals(\"thread quota is wrong\", maxConcurrentMovers,\n dataNode.xserver.balanceThrottler.getMaxConcurrentMovers());\n\n for (int i = 0; i < maxConcurrentMovers; i++) {\n assertEquals(\"should be able to get thread quota\", true,\n dataNode.xserver.balanceThrottler.acquire());\n }\n\n assertEquals(\"should not be able to get thread quota\", false,\n dataNode.xserver.balanceThrottler.acquire());\n }\n}\n", "meta": {"content_hash": "af0bf60b53dd08f9c225738c3c963063", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 105, "avg_line_length": 35.10357142857143, "alnum_prop": 0.7024112320683691, "repo_name": "apurtell/hadoop", "id": "8cbd38bc601dcee68e218e840b489e8bdfe8f9c4", "size": "10635", "binary": false, "copies": "2", "ref": "refs/heads/trunk", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeReconfiguration.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "78445"}, {"name": "C", "bytes": "2023750"}, {"name": "C++", "bytes": "2873786"}, {"name": "CMake", "bytes": "120569"}, {"name": "CSS", "bytes": "94990"}, {"name": "Dockerfile", "bytes": "4613"}, {"name": "HTML", "bytes": "221057"}, {"name": "Handlebars", "bytes": "207062"}, {"name": "Java", "bytes": "97177756"}, {"name": "JavaScript", "bytes": "1273196"}, {"name": "Python", "bytes": "14938"}, {"name": "SCSS", "bytes": "23607"}, {"name": "Shell", "bytes": "517782"}, {"name": "TLA", "bytes": "14997"}, {"name": "TSQL", "bytes": "17801"}, {"name": "TeX", "bytes": "19322"}, {"name": "XSLT", "bytes": "18026"}]}} +{"text": "<!doctype html>\n<!-- This file is generated by build.py. -->\n<title>video tall.jpg; overflow:hidden; -o-object-fit:contain; -o-object-position:30px bottom</title>\n<link rel=\"stylesheet\" href=\"../../support/reftests.css\">\n<link rel='match' href='hidden_contain_30px_bottom-ref.html'>\n<style>\n #test > * { overflow:hidden; -o-object-fit:contain; -o-object-position:30px bottom }\n</style>\n<div id=\"test\">\n <video poster=\"../../support/tall.jpg\"></video>\n</div>\n", "meta": {"content_hash": "808f658da6eff603c47f393afac61a2b", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 101, "avg_line_length": 41.63636363636363, "alnum_prop": 0.6855895196506551, "repo_name": "Ms2ger/presto-testo", "id": "8049bf4ad6f21303cb4f8e689871ca2a039027a0", "size": "458", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "css/image-fit/reftests/video-poster-jpg-tall/hidden_contain_30px_bottom.html", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ASP", "bytes": "2312"}, {"name": "ActionScript", "bytes": "23470"}, {"name": "AutoHotkey", "bytes": "8832"}, {"name": "Batchfile", "bytes": "5001"}, {"name": "C", "bytes": "116512"}, {"name": "C++", "bytes": "219233"}, {"name": "CSS", "bytes": "207914"}, {"name": "Erlang", "bytes": "18523"}, {"name": "Groff", "bytes": "674"}, {"name": "HTML", "bytes": "103272540"}, {"name": "Haxe", "bytes": "3874"}, {"name": "Java", "bytes": "125658"}, {"name": "JavaScript", "bytes": "22516936"}, {"name": "Makefile", "bytes": "13409"}, {"name": "PHP", "bytes": "524911"}, {"name": "Perl", "bytes": "321672"}, {"name": "Python", "bytes": "948191"}, {"name": "Ruby", "bytes": "1006850"}, {"name": "Shell", "bytes": "12140"}, {"name": "Smarty", "bytes": "1860"}, {"name": "XSLT", "bytes": "2567445"}]}} +{"text": "require 'shell_shock/context'\nrequire 'cardigan/commands'\n\nmodule Cardigan\n class EntryContext\n include ShellShock::Context\n\n def initialize io, workflow_repository, entry\n @io, @workflow_repository, @entry = io, workflow_repository, entry\n @prompt_text = \"#{File.expand_path('.').split('/').last.slice(0..0)}/#{entry['name']} > \"\n @commands = {\n 'now' => Command.load(:change_status, @entry, @workflow_repository),\n 'set' => Command.load(:change_value, @entry, @io),\n 'edit' => Command.load(:edit_value, @entry, @io),\n 'ls' => Command.load(:show_entry, @entry, @io)\n }\n end\n end\nend", "meta": {"content_hash": "0ca59fcad93e42a9e20083e80e07337f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 95, "avg_line_length": 33.89473684210526, "alnum_prop": 0.6164596273291926, "repo_name": "markryall/cardigan", "id": "d2c5590562e4fd5300927c3857812467621978ce", "size": "644", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/cardigan/entry_context.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "40805"}]}} +{"text": "package com.eusecom.attendance.fragment;\n\nimport android.app.Dialog;\nimport android.app.ProgressDialog;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android.support.v7.widget.LinearLayoutManager;\nimport android.support.v7.widget.RecyclerView;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.Button;\nimport android.widget.ImageView;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport com.eusecom.attendance.NewPostActivity;\nimport com.eusecom.attendance.SettingsActivity;\nimport com.eusecom.attendance.models.Attendance;\nimport com.eusecom.attendance.models.DeletedAbs;\nimport com.firebase.ui.database.FirebaseRecyclerAdapter;\nimport com.google.firebase.auth.FirebaseAuth;\nimport com.google.firebase.database.DataSnapshot;\nimport com.google.firebase.database.DatabaseError;\nimport com.google.firebase.database.DatabaseReference;\nimport com.google.firebase.database.FirebaseDatabase;\nimport com.google.firebase.database.MutableData;\nimport com.google.firebase.database.Query;\nimport com.google.firebase.database.ServerValue;\nimport com.google.firebase.database.Transaction;\nimport com.eusecom.attendance.R;\nimport com.eusecom.attendance.models.Post;\nimport com.eusecom.attendance.viewholder.AbsenceViewHolder;\nimport com.google.firebase.database.ValueEventListener;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\npublic abstract class AbsenceListFragment extends Fragment {\n\n private static final String TAG = \"AbsenceListFragment\";\n\n // [START define_database_reference]\n private DatabaseReference mDatabase;\n // [END define_database_reference]\n\n private FirebaseRecyclerAdapter<Attendance, AbsenceViewHolder> mAdapter;\n private RecyclerView mRecycler;\n private LinearLayoutManager mManager;\n\n public AbsenceListFragment() {}\n String absxy;\n String abskeydel=null;\n private ProgressDialog fProgressDialog;\n boolean isCancelable, isrunning;\n String timestampx;\n\n @Override\n public View onCreateView (LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n View rootView = inflater.inflate(R.layout.fragment_absences, container, false);\n\n // [START create_database_reference]\n mDatabase = FirebaseDatabase.getInstance().getReference();\n // [END create_database_reference]\n\n mRecycler = (RecyclerView) rootView.findViewById(R.id.absences_list);\n mRecycler.setHasFixedSize(true);\n\n return rootView;\n }\n\n @Override\n public void onActivityCreated(Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n showfProgressDialog();\n\n DatabaseReference connectedRef = FirebaseDatabase.getInstance().getReference(\".info/connected\");\n connectedRef.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot snapshot) {\n boolean connected = snapshot.getValue(Boolean.class);\n if (connected) {\n System.out.println(\"connected\");\n if(isrunning) { showfProgressDialog(); }\n } else {\n System.out.println(\"not connected\");\n hidefProgressDialog();\n if(isrunning) { Toast.makeText(getActivity(), getResources().getString(R.string.notconnected), Toast.LENGTH_SHORT).show(); }\n }\n }\n\n @Override\n public void onCancelled(DatabaseError error) {\n System.err.println(\"Listener was cancelled\");\n }\n });\n\n DatabaseReference gettimestramp = FirebaseDatabase.getInstance().getReference(\"gettimestamp\");\n gettimestramp.addValueEventListener(new ValueEventListener() {\n public void onDataChange(DataSnapshot dataSnapshot) {\n //System.out.println(dataSnapshot.getValue());\n timestampx=dataSnapshot.getValue().toString();\n //Log.d(TAG, \"ServerValue.TIMESTAMP \" + timestampx);\n\n }\n\n public void onCancelled(DatabaseError databaseError) { }\n });\n gettimestramp.setValue(ServerValue.TIMESTAMP);\n\n\n // Set up Layout Manager, reverse layout\n mManager = new LinearLayoutManager(getActivity());\n mManager.setReverseLayout(true);\n mManager.setStackFromEnd(true);\n mRecycler.setLayoutManager(mManager);\n\n // Set up FirebaseRecyclerAdapter with the Query\n Query absencesQuery = getQuery(mDatabase);\n mDatabase.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n // the initial data has been loaded, hide the progress bar\n hidefProgressDialog();\n }\n\n @Override\n public void onCancelled(DatabaseError firebaseError) {\n\n hidefProgressDialog();\n }\n });\n\n\n\n mAdapter = new FirebaseRecyclerAdapter<Attendance, AbsenceViewHolder>(Attendance.class, R.layout.item_absence,\n AbsenceViewHolder.class, absencesQuery) {\n\n @Override\n protected void populateViewHolder(final AbsenceViewHolder viewHolder, final Attendance model, final int position) {\n\n final DatabaseReference absRef = getRef(position);\n\n // Set click listener for the whole post view\n final String absKey = absRef.getKey();\n absxy = absRef.getKey();\n\n\n viewHolder.itemView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n // Launch PostDetailActivity\n Log.d(TAG, \"onclick\" + \" listener\");\n\n //Intent intent = new Intent(getActivity(), PostDetailActivity.class);\n //intent.putExtra(PostDetailActivity.EXTRA_POST_KEY, absKey);\n\n Toast.makeText(getActivity(), \"Onclick \" + absKey, Toast.LENGTH_SHORT).show();\n\n //startActivity(intent);\n }\n\n\n });\n\n viewHolder.itemView.setOnLongClickListener(new View.OnLongClickListener() {\n @Override\n public boolean onLongClick(View v) {\n\n final String datsx = model.getDatsString();\n //Log.d(TAG, \"datsx \" + datsx);\n\n gettimestramp.setValue(ServerValue.TIMESTAMP);\n //Log.d(TAG, \"ServerValue.TIMESTAMP \" + timestampx);\n\n long timestampl = Long.parseLong(timestampx);\n long datsl = Long.parseLong(datsx);\n long rozdiel = timestampl - datsl;\n //Log.d(TAG, \"rozdiel \" + rozdiel);\n\n Toast.makeText(getActivity(), \"Longclick \" + absKey,Toast.LENGTH_SHORT).show();\n\n abskeydel = absKey;\n if( model.aprv.equals(\"2\")) {\n rozdiel=1;\n }\n\n if( rozdiel < 180000 ) {\n getDialog(abskeydel);\n }else{\n Toast.makeText(getActivity(), getResources().getString(R.string.cantdel),Toast.LENGTH_SHORT).show();\n }\n\n\n return true;\n }\n\n\n });\n\n\n // Bind Abstype to ViewHolder\n viewHolder.bindToAbsence(model, new View.OnClickListener() {\n @Override\n public void onClick(View starView) {\n // Need to write to both places the post is stored\n DatabaseReference globalPostRef = mDatabase.child(\"posts\").child(absRef.getKey());\n\n // Run two transactions\n onStarClicked(globalPostRef);\n\n }\n });\n }\n\n };\n\n mRecycler.setAdapter(mAdapter);\n\n }\n\n // [START post_stars_transaction]\n private void onStarClicked(DatabaseReference postRef) {\n postRef.runTransaction(new Transaction.Handler() {\n @Override\n public Transaction.Result doTransaction(MutableData mutableData) {\n Post p = mutableData.getValue(Post.class);\n if (p == null) {\n return Transaction.success(mutableData);\n }\n\n if (p.stars.containsKey(getUid())) {\n // Unstar the post and remove self from stars\n p.starCount = p.starCount - 1;\n p.stars.remove(getUid());\n } else {\n // Star the post and add self to stars\n p.starCount = p.starCount + 1;\n p.stars.put(getUid(), true);\n }\n\n // Set value and report transaction success\n mutableData.setValue(p);\n return Transaction.success(mutableData);\n }\n\n @Override\n public void onComplete(DatabaseError databaseError, boolean b,\n DataSnapshot dataSnapshot) {\n // Transaction completed\n Log.d(TAG, \"postTransaction:onComplete:\" + databaseError);\n }\n });\n }\n // [END post_stars_transaction]\n\n @Override\n public void onDestroy() {\n super.onDestroy();\n if (mAdapter != null) {\n mAdapter.cleanup();\n }\n }\n\n public String getUid() {\n return FirebaseAuth.getInstance().getCurrentUser().getUid();\n }\n\n\n public abstract Query getQuery(DatabaseReference databaseReference);\n\n // [START deletefan_out]\n private void deletePost(String postkey) {\n\n // delete post key from /posts and user-posts/$userid simultaneously\n String userId = getUid();\n String key = postkey;\n String usicox = SettingsActivity.getUsIco(getActivity());\n\n Map<String, Object> childUpdates = new HashMap<>();\n childUpdates.put(\"/absences/\" + key, null);\n childUpdates.put(\"/user-absences/\" + userId + \"/\" + key, null);\n childUpdates.put(\"/company-absences/\" + usicox + \"/\" + key, null);\n mDatabase.updateChildren(childUpdates);\n\n\n String keydel = mDatabase.child(\"deleted-absences\").push().getKey();\n DeletedAbs deletedabs = new DeletedAbs(usicox, userId, postkey );\n Log.d(TAG, \"postkey \" + postkey);\n Map<String, Object> delValues = deletedabs.toMap();\n Map<String, Object> childDelUpdates = new HashMap<>();\n childDelUpdates.put(\"/deleted-absences/\" + keydel, delValues);\n mDatabase.updateChildren(childDelUpdates);\n\n }\n // [END delete_fan_out]\n\n private void getDialog(String postkey) {\n\n // custom dialog\n final Dialog dialog = new Dialog(getActivity());\n dialog.setContentView(R.layout.custom_dialog);\n dialog.setTitle(R.string.item);\n // set the custom dialog components - text, image and button\n String textx = getString(R.string.item) + \" \" + abskeydel;\n TextView text = (TextView) dialog.findViewById(R.id.text);\n text.setText(textx);\n ImageView image = (ImageView) dialog.findViewById(R.id.image);\n image.setImageResource(R.drawable.ic_image_edit);\n\n Button buttonDelete = (Button) dialog.findViewById(R.id.buttonDelete);\n // if button is clicked, close the custom dialog\n buttonDelete.setOnClickListener(new View.OnClickListener() {\n\n public void onClick(View v) {\n dialog.dismiss();\n deletePost(abskeydel);\n }\n });\n Button buttonEdit = (Button) dialog.findViewById(R.id.buttonEdit);\n // if button is clicked, close the custom dialog\n buttonEdit.setOnClickListener(new View.OnClickListener() {\n\n public void onClick(View v) {\n dialog.dismiss();\n\n Toast.makeText(getActivity(), getResources().getString(R.string.cantedititem), Toast.LENGTH_SHORT).show();\n\n //Intent i = new Intent(getActivity(), NewPostActivity.class);\n //Bundle extras = new Bundle();\n //extras.putString(\"editx\", \"1\");\n //extras.putString(\"keyx\", abskeydel);\n\n //i.putExtras(extras);\n //startActivity(i);\n }\n });\n dialog.show();\n\n }\n\n\n public void showfProgressDialog() {\n if (fProgressDialog == null) {\n fProgressDialog = new ProgressDialog(getActivity());\n fProgressDialog.setCancelable(isCancelable);\n fProgressDialog.setMessage(\"Loading...\");\n }\n\n fProgressDialog.show();\n }\n\n public void hidefProgressDialog() {\n if (fProgressDialog != null && fProgressDialog.isShowing()) {\n fProgressDialog.dismiss();\n }\n }\n\n\n\n @Override\n public void onResume() {\n super.onResume();\n isrunning=true;\n }\n\n @Override\n public void onPause() {\n super.onPause();\n isrunning=false;\n }\n\n}\n", "meta": {"content_hash": "2de7b6c26d4a4ed64a30d8cb3eec65cb", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 144, "avg_line_length": 35.71957671957672, "alnum_prop": 0.5999851873796475, "repo_name": "eurosecom/Attendance", "id": "07ed19b59a88437f88bb72712341ed8a6630d8f8", "size": "13502", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/eusecom/attendance/fragment/AbsenceListFragment.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "1190010"}]}} +{"text": "from __future__ import unicode_literals\n\nfrom django.conf import settings\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n initial = True\n\n dependencies = [\n ('auth', '0007_alter_validators_add_error_messages'),\n ]\n\n operations = [\n migrations.CreateModel(\n name='UserProfile',\n fields=[\n ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='profile', serialize=False, to=settings.AUTH_USER_MODEL)),\n ('camera_type', models.CharField(blank=True, max_length=30)),\n ('address', models.CharField(blank=True, max_length=60)),\n ('web_link', models.CharField(blank=True, max_length=70)),\n ('photo_type', models.CharField(blank=True, max_length=30)),\n ('social_media', models.CharField(blank=True, max_length=30)),\n ('region', models.CharField(choices=[('North America', 'North America'), ('Asia', 'Asia'), ('Africa', 'Africa'), ('South America', 'South America'), ('Europe', 'Europe')], default='North America', max_length=30)),\n ('friends', models.ManyToManyField(related_name='friend_of', to='imager_profile.UserProfile')),\n ],\n ),\n ]\n", "meta": {"content_hash": "e1530fb22e9ddd0e6f4714806ab49c7f", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 229, "avg_line_length": 44.733333333333334, "alnum_prop": 0.6162444113263785, "repo_name": "nadiabahrami/django-imager", "id": "230ba4c7e8e40918c411c9581d92fc9ada6243bd", "size": "1414", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "imagersite/imager_profile/migrations/0001_initial.py", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "68384"}, {"name": "HTML", "bytes": "27306"}, {"name": "JavaScript", "bytes": "14517"}, {"name": "Python", "bytes": "37251"}]}} +{"text": "from ...ags._geoprocessing import *\nfrom ..._abstract import abstract\n########################################################################\nclass analysis(abstract.BaseAGOLClass):\n \"\"\"\n ArcGIS Online is a collaborative, cloud-based platform that lets\n members of an organization create, share, and access maps,\n applications, and data, including authoritative basemaps published\n by Esri. Through ArcGIS Online, you get access to Esri's secure\n cloud, where you can manage, create, store, and access hosted web\n services.\n ArcGIS Online includes the Spatial Analysis service. The Spatial\n Analysis service contains a number of tasks, listed below, that you\n can access and use in your applications. Using Spatial Analysis\n service tasks consumes credits. For more information on credits, see\n see Service credits overview which includes access to an interactive\n Service Credits Estimator.\n\n Site Reference: https://developers.arcgis.com/rest/analysis/\n\n Inputs:\n securityHandler - ArcGIS Online security handler object\n url - optional url to the site.\n ex: http://www.arcgis.com/sharing/rest\n proxy_url - optional proxy IP\n proxy_port - optional proxy port required if proxy_url specified\n Basic Usage:\n import arcrest\n import arcrest.agol as agol\n\n if __name__ == \"__main__\":\n username = \"username\"\n password = \"password\"\n sh = arcrest.AGOLTokenSecurityHandler(username, password)\n a = agol.analysis(securityHandler=sh)\n for task in a.tasks:\n if task.name.lower() == \"aggregatepoints\":\n for params in task.parameters:\n print params\n \"\"\"\n _proxy_url = None\n _proxy_port = None\n _url = None\n _analysis_url = None\n _securityHandler = None\n _gpService = None\n #----------------------------------------------------------------------\n def __init__(self,\n securityHandler,\n url=None,\n proxy_url=None,\n proxy_port=None):\n \"\"\"Constructor\"\"\"\n if url is None:\n self._url = \"https://www.arcgis.com/sharing/rest\"\n else:\n if url.find(\"/sharing/rest\") == -1:\n url = url + \"/sharing/rest\"\n self._url = url\n self._securityHandler = securityHandler\n self._proxy_url = proxy_url\n self._proxy_port = proxy_port\n self.__init_url()\n #----------------------------------------------------------------------\n def __init_url(self):\n \"\"\"loads the information into the class\"\"\"\n portals_self_url = \"{}/portals/self\".format(self._url)\n params = {\n \"f\" :\"json\"\n }\n res = self._do_get(url=portals_self_url,\n param_dict=params,\n securityHandler=self._securityHandler,\n proxy_url=self._proxy_url,\n proxy_port=self._proxy_port)\n if \"helperServices\" in res:\n helper_services = res.get(\"helperServices\")\n if \"analysis\" in helper_services:\n analysis_service = helper_services.get(\"analysis\")\n if \"url\" in analysis_service:\n self._analysis_url = analysis_service.get(\"url\")\n self._gpService = GPService(url=self._analysis_url,\n securityHandler=self._securityHandler,\n proxy_url=self._proxy_url,\n proxy_port=self._proxy_port,\n initialize=False)\n #----------------------------------------------------------------------\n @property\n def gpService(self):\n \"\"\"returns the geoprocessing object\"\"\"\n if self._gpService is None:\n self.__init_url()\n return self._gpService\n #----------------------------------------------------------------------\n @property\n def tasks(self):\n \"\"\"returns the available analysis tasks\"\"\"\n return self.gpService.tasks\n\n", "meta": {"content_hash": "ae0b663bff1c548f7e3c75fc8e851b0a", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 75, "avg_line_length": 41.81818181818182, "alnum_prop": 0.5246376811594203, "repo_name": "jgravois/ArcREST", "id": "4d734fec16834bd31f1e72edebedceac08bc00d8", "size": "4140", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/arcrest/agol/helperservices/analysis.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Python", "bytes": "1591951"}]}} +{"text": "package com.loadburn.heron.storage.cache;\n\nimport com.google.common.collect.Lists;\nimport com.loadburn.heron.storage.config.EntityMetadata;\nimport com.loadburn.heron.utils.StringUtils;\nimport net.sf.ehcache.search.Query;\nimport net.sf.ehcache.search.Result;\n\nimport java.util.Collection;\nimport java.util.List;\nimport java.util.Map;\n\n/**\n * @author slacrey (scstlinfeng@yahoo.com)\n * Date: 13-12-14\n */\npublic class CacheUtils {\n\n private final static Object cacheLock = new Object();\n private final static String REPLACE_CHAR = \"_\";\n private final static String CACHE_NAME_SPLIT_CHAR = \".\";\n private final static String ARGUMENT_SPLIT_CHAR = \"=\";\n private final static String ARGUMENTS_SPLIT_CHAR = \",\";\n\n /**\n * \u751f\u6210\u7f13\u5b58Key\n *\n * @param cacheName \u5b9e\u4f53\u7c7b@Cache\u914d\u7f6e\u7684\u7f13\u5b58\u540d\u79f0\n * @param statement \u67e5\u8be2\u5b9e\u4f53\u7c7b\u7684\u67e5\u8be2\u8bed\u53e5\n * @param arguments \u67e5\u8be2\u8bed\u53e5\u7684\u53c2\u6570\n * @return \u8fd4\u56de\u7f13\u5b58Key\u5b57\u7b26\u4e32\n */\n public static String getCacheKey(String cacheName, String statement, Map<String, Object> arguments) {\n\n StringBuilder keyBuilder = new StringBuilder();\n String key = StringUtils.replaceAs(statement, REPLACE_CHAR);\n keyBuilder.append(cacheName).append(CACHE_NAME_SPLIT_CHAR).append(key);\n if (arguments != null) {\n keyBuilder.append(CACHE_NAME_SPLIT_CHAR);\n for (Map.Entry<String, Object> entry : arguments.entrySet()) {\n keyBuilder.append(entry.getKey()).append(ARGUMENT_SPLIT_CHAR).append(entry.getValue()).append(ARGUMENTS_SPLIT_CHAR);\n }\n }\n return keyBuilder.toString();\n\n }\n\n public static void removeCacheKeyLike(ICache cache, String cacheName) {\n\n List<String> keyList = cache.get(EntityMetadata.STORAGE_CACHE_NAME, cacheName);\n if (keyList != null) {\n cache.removeCollection(EntityMetadata.STORAGE_CACHE_NAME, keyList);\n keyList.clear();\n }\n\n }\n\n /**\n * \u83b7\u53d6\u7f13\u5b58\u5bf9\u8c61\n *\n * @param cache \u7f13\u5b58\u5bf9\u8c61\n * @return \u8fd4\u56de\u6307\u5b9a\u5bf9\u8c61\n */\n public static Object getCacheResult(ICache cache, String key) {\n return cache.get(EntityMetadata.STORAGE_CACHE_NAME, key);\n }\n\n public static void putCacheResult(ICache cache, String key, Object value) {\n cache.put(EntityMetadata.STORAGE_CACHE_NAME, key, value);\n }\n\n public static void putCacheStatement(ICache cache, String cacheName, String key) {\n\n synchronized(cacheLock){\n List<String> cacheKeyList = cache.get(EntityMetadata.STORAGE_CACHE_NAME, cacheName);\n if (cacheKeyList == null) {\n cacheKeyList = Lists.newArrayList();\n cacheKeyList.add(key);\n } else {\n if (!cacheKeyList.contains(key)) {\n cacheKeyList.add(key);\n }\n }\n cache.put(EntityMetadata.STORAGE_CACHE_NAME, cacheName, cacheKeyList);\n }\n\n }\n\n}\n", "meta": {"content_hash": "a4f645629b7cc73323332f4c77f2d15b", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 132, "avg_line_length": 32.348314606741575, "alnum_prop": 0.6422368878082667, "repo_name": "slacrey/heron-project", "id": "ee8be98013cb37bd8d2c268c4e3a993a5ad59b42", "size": "2987", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "heron-storage/src/main/java/com/loadburn/heron/storage/cache/CacheUtils.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "1605"}, {"name": "Java", "bytes": "376944"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<servico xmlns=\"http://servicos.gov.br/v3/schema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://servicos.gov.br/v3/schema ../servico.xsd\">\n <nome>Altera\u00e7\u00e3o Cadastral no CPF</nome>\n <sigla/>\n <nomes-populares/>\n <descricao>Realizar pedido de altera\u00e7\u00e3o de dados no CPF em uma conveniada (Banco do Brasil, Caixa Econ\u00f4mica Federal, Correios) ou altera\u00e7\u00e3o de endere\u00e7o em entidades que prestam o servi\u00e7o gratuitamente.</descricao>\n <gratuito/>\n <solicitantes/>\n <tempo-total-estimado>\n <descricao/>\n </tempo-total-estimado>\n <etapas>\n <etapa>\n <titulo/>\n <descricao/>\n <documentos>\n <default/>\n </documentos>\n <custos>\n <default/>\n </custos>\n <canais-de-prestacao>\n <default>\n <canal-de-prestacao tipo=\"web\">\n <descricao>http://www.receita.fazenda.gov.br/PessoaFisica/CPF/CPFEntPublicConven.htm</descricao>\n </canal-de-prestacao>\n <canal-de-prestacao tipo=\"presencial\">\n <descricao>Unidades de Atendimento Conveniadas: Ag\u00eancias da CEF, BB e Correios</descricao>\n </canal-de-prestacao>\n <canal-de-prestacao tipo=\"web\">\n <descricao>[Informa\u00e7\u00f5es sobre altera\u00e7\u00e3o cadastral do CPF](http://www.receita.fazenda.gov.br/PessoaFisica/CPF/CPFAlteracaoDadosCad.htm)</descricao>\n </canal-de-prestacao>\n </default>\n </canais-de-prestacao>\n </etapa>\n </etapas>\n <orgao id=\"http://estruturaorganizacional.dados.gov.br/id/unidade-organizacional/77\"/>\n <segmentos-da-sociedade>\n <item>Cidad\u00e3os</item>\n </segmentos-da-sociedade>\n <areas-de-interesse>\n <item>Economia e Finan\u00e7as</item>\n </areas-de-interesse>\n <palavras-chave/>\n <legislacoes/>\n</servico>\n", "meta": {"content_hash": "290b7b93aca9aee1ac1ed9b012e8f9cf", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 217, "avg_line_length": 44.26086956521739, "alnum_prop": 0.5888998035363457, "repo_name": "servicosgoval/cartas-de-servico", "id": "e0fa30b85d010994577aa407ff2d82a3993b3ddb", "size": "2052", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cartas-servico/v3/servicos/alteracao-cadastral-no-cpf.xml", "mode": "33188", "license": "mit", "language": [{"name": "Shell", "bytes": "846"}]}} +{"text": "function setEigenvalues( obj, gamma, E )\n% SETEIGENVALUES Save eigenvalues of an nlsaKoopmanOperator_diff object\n%\n% Modified 2020/04/12\n\n% Set eigenvalues using the parent method\nsetEigenvalues@nlsaKoopmanOperator( obj, gamma )\n\nif nargin == 2 || isempty( E )\n return\nend\n\n% Set Dirichlet energies\nif ~isrow( E ) || ~isnumeric( E ) \n error( 'Dirichlet energies must be specified as a numeric row vector' )\nend\nif numel( E ) ~= getNEigenfunction( obj )\n msgStr = [ 'Number of Dirichlet energies must be equal to the ' ...\n 'number of eigenfunctions.' ];\n error( msgStr )\nend \nsave( fullfile( getEigenfunctionPath( obj ), getEigenvalueFile( obj ) ), ...\n 'E', '-append' )\n", "meta": {"content_hash": "79b5cdec947abff6d69f7ae95d8281c6", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 76, "avg_line_length": 30.565217391304348, "alnum_prop": 0.6827880512091038, "repo_name": "dg227/NLSA", "id": "dc4ec1235a17fbb22a7d3c5c97d3dd844d63dfdd", "size": "703", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nlsa/classes/@nlsaKoopmanOperator_diff/setEigenvalues.m", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Jupyter Notebook", "bytes": "3276224"}, {"name": "MATLAB", "bytes": "1847822"}, {"name": "Python", "bytes": "39015"}, {"name": "Vim Script", "bytes": "34"}]}} +{"text": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\nusing System.IO;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing Godot.NativeInterop;\n\nnamespace Godot\n{\n internal static class DelegateUtils\n {\n [UnmanagedCallersOnly]\n internal static godot_bool DelegateEquals(IntPtr delegateGCHandleA, IntPtr delegateGCHandleB)\n {\n try\n {\n var @delegateA = (Delegate?)GCHandle.FromIntPtr(delegateGCHandleA).Target;\n var @delegateB = (Delegate?)GCHandle.FromIntPtr(delegateGCHandleB).Target;\n return (@delegateA! == @delegateB!).ToGodotBool();\n }\n catch (Exception e)\n {\n ExceptionUtils.LogException(e);\n return godot_bool.False;\n }\n }\n\n [UnmanagedCallersOnly]\n internal static unsafe void InvokeWithVariantArgs(IntPtr delegateGCHandle, void* trampoline,\n godot_variant** args, int argc, godot_variant* outRet)\n {\n try\n {\n if (trampoline == null)\n {\n throw new ArgumentNullException(nameof(trampoline),\n \"Cannot dynamically invoke delegate because the trampoline is null.\");\n }\n\n var @delegate = (Delegate)GCHandle.FromIntPtr(delegateGCHandle).Target!;\n var trampolineFn = (delegate* managed<object, NativeVariantPtrArgs, out godot_variant, void>)trampoline;\n\n trampolineFn(@delegate, new NativeVariantPtrArgs(args, argc), out godot_variant ret);\n\n *outRet = ret;\n }\n catch (Exception e)\n {\n ExceptionUtils.LogException(e);\n *outRet = default;\n }\n }\n\n // TODO: Check if we should be using BindingFlags.DeclaredOnly (would give better reflection performance).\n\n private enum TargetKind : uint\n {\n Static,\n GodotObject,\n CompilerGenerated\n }\n\n internal static bool TrySerializeDelegate(Delegate @delegate, Collections.Array serializedData)\n {\n if (@delegate is null)\n {\n return false;\n }\n\n if (@delegate is MulticastDelegate multicastDelegate)\n {\n bool someDelegatesSerialized = false;\n\n Delegate[] invocationList = multicastDelegate.GetInvocationList();\n\n if (invocationList.Length > 1)\n {\n var multiCastData = new Collections.Array();\n\n foreach (Delegate oneDelegate in invocationList)\n someDelegatesSerialized |= TrySerializeDelegate(oneDelegate, multiCastData);\n\n if (!someDelegatesSerialized)\n return false;\n\n serializedData.Add(multiCastData);\n return true;\n }\n }\n\n if (TrySerializeSingleDelegate(@delegate, out byte[]? buffer))\n {\n serializedData.Add((Span<byte>)buffer);\n return true;\n }\n\n return false;\n }\n\n private static bool TrySerializeSingleDelegate(Delegate @delegate, [MaybeNullWhen(false)] out byte[] buffer)\n {\n buffer = null;\n\n object? target = @delegate.Target;\n\n switch (target)\n {\n case null:\n {\n using (var stream = new MemoryStream())\n using (var writer = new BinaryWriter(stream))\n {\n writer.Write((ulong)TargetKind.Static);\n\n SerializeType(writer, @delegate.GetType());\n\n if (!TrySerializeMethodInfo(writer, @delegate.Method))\n return false;\n\n buffer = stream.ToArray();\n return true;\n }\n }\n // ReSharper disable once RedundantNameQualifier\n case Godot.Object godotObject:\n {\n using (var stream = new MemoryStream())\n using (var writer = new BinaryWriter(stream))\n {\n writer.Write((ulong)TargetKind.GodotObject);\n // ReSharper disable once RedundantCast\n writer.Write((ulong)godotObject.GetInstanceId());\n\n SerializeType(writer, @delegate.GetType());\n\n if (!TrySerializeMethodInfo(writer, @delegate.Method))\n return false;\n\n buffer = stream.ToArray();\n return true;\n }\n }\n default:\n {\n Type targetType = target.GetType();\n\n if (targetType.IsDefined(typeof(CompilerGeneratedAttribute), true))\n {\n // Compiler generated. Probably a closure. Try to serialize it.\n\n using (var stream = new MemoryStream())\n using (var writer = new BinaryWriter(stream))\n {\n writer.Write((ulong)TargetKind.CompilerGenerated);\n SerializeType(writer, targetType);\n\n SerializeType(writer, @delegate.GetType());\n\n if (!TrySerializeMethodInfo(writer, @delegate.Method))\n return false;\n\n FieldInfo[] fields = targetType.GetFields(BindingFlags.Instance | BindingFlags.Public);\n\n writer.Write(fields.Length);\n\n foreach (FieldInfo field in fields)\n {\n Type fieldType = field.GetType();\n\n Variant.Type variantType = GD.TypeToVariantType(fieldType);\n\n if (variantType == Variant.Type.Nil)\n return false;\n\n static byte[] VarToBytes(in godot_variant var)\n {\n NativeFuncs.godotsharp_var_to_bytes(var, false.ToGodotBool(), out var varBytes);\n using (varBytes)\n return Marshaling.ConvertNativePackedByteArrayToSystemArray(varBytes);\n }\n\n writer.Write(field.Name);\n\n var fieldValue = field.GetValue(target);\n using var fieldValueVariant = Marshaling.ConvertManagedObjectToVariant(fieldValue);\n byte[] valueBuffer = VarToBytes(fieldValueVariant);\n writer.Write(valueBuffer.Length);\n writer.Write(valueBuffer);\n }\n\n buffer = stream.ToArray();\n return true;\n }\n }\n\n return false;\n }\n }\n }\n\n private static bool TrySerializeMethodInfo(BinaryWriter writer, MethodInfo methodInfo)\n {\n SerializeType(writer, methodInfo.DeclaringType);\n\n writer.Write(methodInfo.Name);\n\n int flags = 0;\n\n if (methodInfo.IsPublic)\n flags |= (int)BindingFlags.Public;\n else\n flags |= (int)BindingFlags.NonPublic;\n\n if (methodInfo.IsStatic)\n flags |= (int)BindingFlags.Static;\n else\n flags |= (int)BindingFlags.Instance;\n\n writer.Write(flags);\n\n Type returnType = methodInfo.ReturnType;\n bool hasReturn = methodInfo.ReturnType != typeof(void);\n\n writer.Write(hasReturn);\n if (hasReturn)\n SerializeType(writer, returnType);\n\n ParameterInfo[] parameters = methodInfo.GetParameters();\n\n writer.Write(parameters.Length);\n\n if (parameters.Length > 0)\n {\n for (int i = 0; i < parameters.Length; i++)\n SerializeType(writer, parameters[i].ParameterType);\n }\n\n return true;\n }\n\n private static void SerializeType(BinaryWriter writer, Type? type)\n {\n if (type == null)\n {\n int genericArgumentsCount = -1;\n writer.Write(genericArgumentsCount);\n }\n else if (type.IsGenericType)\n {\n Type genericTypeDef = type.GetGenericTypeDefinition();\n Type[] genericArgs = type.GetGenericArguments();\n\n int genericArgumentsCount = genericArgs.Length;\n writer.Write(genericArgumentsCount);\n\n writer.Write(genericTypeDef.Assembly.GetName().Name ?? \"\");\n writer.Write(genericTypeDef.FullName ?? genericTypeDef.ToString());\n\n for (int i = 0; i < genericArgs.Length; i++)\n SerializeType(writer, genericArgs[i]);\n }\n else\n {\n int genericArgumentsCount = 0;\n writer.Write(genericArgumentsCount);\n\n writer.Write(type.Assembly.GetName().Name ?? \"\");\n writer.Write(type.FullName ?? type.ToString());\n }\n }\n\n [UnmanagedCallersOnly]\n internal static unsafe godot_bool TrySerializeDelegateWithGCHandle(IntPtr delegateGCHandle,\n godot_array* nSerializedData)\n {\n try\n {\n var serializedData = Collections.Array.CreateTakingOwnershipOfDisposableValue(\n NativeFuncs.godotsharp_array_new_copy(*nSerializedData));\n\n var @delegate = (Delegate)GCHandle.FromIntPtr(delegateGCHandle).Target!;\n\n return TrySerializeDelegate(@delegate, serializedData)\n .ToGodotBool();\n }\n catch (Exception e)\n {\n ExceptionUtils.LogException(e);\n return godot_bool.False;\n }\n }\n\n [UnmanagedCallersOnly]\n internal static unsafe godot_bool TryDeserializeDelegateWithGCHandle(godot_array* nSerializedData,\n IntPtr* delegateGCHandle)\n {\n try\n {\n var serializedData = Collections.Array.CreateTakingOwnershipOfDisposableValue(\n NativeFuncs.godotsharp_array_new_copy(*nSerializedData));\n\n if (TryDeserializeDelegate(serializedData, out Delegate? @delegate))\n {\n *delegateGCHandle = GCHandle.ToIntPtr(CustomGCHandle.AllocStrong(@delegate));\n return godot_bool.True;\n }\n else\n {\n *delegateGCHandle = IntPtr.Zero;\n return godot_bool.False;\n }\n }\n catch (Exception e)\n {\n ExceptionUtils.LogException(e);\n *delegateGCHandle = default;\n return godot_bool.False;\n }\n }\n\n internal static bool TryDeserializeDelegate(Collections.Array serializedData,\n [MaybeNullWhen(false)] out Delegate @delegate)\n {\n @delegate = null;\n\n if (serializedData.Count == 1)\n {\n var elem = serializedData[0].Obj;\n\n if (elem == null)\n return false;\n\n if (elem is Collections.Array multiCastData)\n return TryDeserializeDelegate(multiCastData, out @delegate);\n\n return TryDeserializeSingleDelegate((byte[])elem, out @delegate);\n }\n\n var delegates = new List<Delegate>(serializedData.Count);\n\n foreach (Variant variantElem in serializedData)\n {\n var elem = variantElem.Obj;\n\n if (elem == null)\n continue;\n\n if (elem is Collections.Array multiCastData)\n {\n if (TryDeserializeDelegate(multiCastData, out Delegate? oneDelegate))\n delegates.Add(oneDelegate);\n }\n else\n {\n if (TryDeserializeSingleDelegate((byte[])elem, out Delegate? oneDelegate))\n delegates.Add(oneDelegate);\n }\n }\n\n if (delegates.Count <= 0)\n return false;\n\n @delegate = delegates.Count == 1 ? delegates[0] : Delegate.Combine(delegates.ToArray())!;\n return true;\n }\n\n private static bool TryDeserializeSingleDelegate(byte[] buffer, [MaybeNullWhen(false)] out Delegate @delegate)\n {\n @delegate = null;\n\n using (var stream = new MemoryStream(buffer, writable: false))\n using (var reader = new BinaryReader(stream))\n {\n var targetKind = (TargetKind)reader.ReadUInt64();\n\n switch (targetKind)\n {\n case TargetKind.Static:\n {\n Type? delegateType = DeserializeType(reader);\n if (delegateType == null)\n return false;\n\n if (!TryDeserializeMethodInfo(reader, out MethodInfo? methodInfo))\n return false;\n\n @delegate = Delegate.CreateDelegate(delegateType, null, methodInfo, throwOnBindFailure: false);\n\n if (@delegate == null)\n return false;\n\n return true;\n }\n case TargetKind.GodotObject:\n {\n ulong objectId = reader.ReadUInt64();\n // ReSharper disable once RedundantNameQualifier\n Godot.Object godotObject = GD.InstanceFromId(objectId);\n if (godotObject == null)\n return false;\n\n Type? delegateType = DeserializeType(reader);\n if (delegateType == null)\n return false;\n\n if (!TryDeserializeMethodInfo(reader, out MethodInfo? methodInfo))\n return false;\n\n @delegate = Delegate.CreateDelegate(delegateType, godotObject, methodInfo,\n throwOnBindFailure: false);\n\n if (@delegate == null)\n return false;\n\n return true;\n }\n case TargetKind.CompilerGenerated:\n {\n Type? targetType = DeserializeType(reader);\n if (targetType == null)\n return false;\n\n Type? delegateType = DeserializeType(reader);\n if (delegateType == null)\n return false;\n\n if (!TryDeserializeMethodInfo(reader, out MethodInfo? methodInfo))\n return false;\n\n int fieldCount = reader.ReadInt32();\n\n object recreatedTarget = Activator.CreateInstance(targetType)!;\n\n for (int i = 0; i < fieldCount; i++)\n {\n string name = reader.ReadString();\n int valueBufferLength = reader.ReadInt32();\n byte[] valueBuffer = reader.ReadBytes(valueBufferLength);\n\n FieldInfo? fieldInfo = targetType.GetField(name,\n BindingFlags.Instance | BindingFlags.Public);\n fieldInfo?.SetValue(recreatedTarget, GD.BytesToVar(valueBuffer));\n }\n\n @delegate = Delegate.CreateDelegate(delegateType, recreatedTarget, methodInfo,\n throwOnBindFailure: false);\n\n if (@delegate == null)\n return false;\n\n return true;\n }\n default:\n return false;\n }\n }\n }\n\n private static bool TryDeserializeMethodInfo(BinaryReader reader,\n [MaybeNullWhen(false)] out MethodInfo methodInfo)\n {\n methodInfo = null;\n\n Type? declaringType = DeserializeType(reader);\n\n if (declaringType == null)\n return false;\n\n string methodName = reader.ReadString();\n\n int flags = reader.ReadInt32();\n\n bool hasReturn = reader.ReadBoolean();\n Type? returnType = hasReturn ? DeserializeType(reader) : typeof(void);\n\n int parametersCount = reader.ReadInt32();\n\n if (parametersCount > 0)\n {\n var parameterTypes = new Type[parametersCount];\n\n for (int i = 0; i < parametersCount; i++)\n {\n Type? parameterType = DeserializeType(reader);\n if (parameterType == null)\n return false;\n parameterTypes[i] = parameterType;\n }\n\n methodInfo = declaringType.GetMethod(methodName, (BindingFlags)flags, null, parameterTypes, null);\n return methodInfo != null && methodInfo.ReturnType == returnType;\n }\n\n methodInfo = declaringType.GetMethod(methodName, (BindingFlags)flags);\n return methodInfo != null && methodInfo.ReturnType == returnType;\n }\n\n private static Type? DeserializeType(BinaryReader reader)\n {\n int genericArgumentsCount = reader.ReadInt32();\n\n if (genericArgumentsCount == -1)\n return null;\n\n string assemblyName = reader.ReadString();\n\n if (assemblyName.Length == 0)\n {\n GD.PushError($\"Missing assembly name of type when attempting to deserialize delegate\");\n return null;\n }\n\n string typeFullName = reader.ReadString();\n var type = ReflectionUtils.FindTypeInLoadedAssemblies(assemblyName, typeFullName);\n\n if (type == null)\n return null; // Type not found\n\n if (genericArgumentsCount != 0)\n {\n var genericArgumentTypes = new Type[genericArgumentsCount];\n\n for (int i = 0; i < genericArgumentsCount; i++)\n {\n Type? genericArgumentType = DeserializeType(reader);\n if (genericArgumentType == null)\n return null;\n genericArgumentTypes[i] = genericArgumentType;\n }\n\n type = type.MakeGenericType(genericArgumentTypes);\n }\n\n return type;\n }\n }\n}\n", "meta": {"content_hash": "a91f82711e5326e2322b94a3fab9fd5a", "timestamp": "", "source": "github", "line_count": 539, "max_line_length": 120, "avg_line_length": 36.12615955473098, "alnum_prop": 0.4948644207066557, "repo_name": "BastiaanOlij/godot", "id": "d19e0c08f20626229583e03764373e4591ebcc81", "size": "19490", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "modules/mono/glue/GodotSharp/GodotSharp/Core/DelegateUtils.cs", "mode": "33188", "license": "mit", "language": [{"name": "AIDL", "bytes": "1633"}, {"name": "C", "bytes": "1045182"}, {"name": "C#", "bytes": "1652166"}, {"name": "C++", "bytes": "40241361"}, {"name": "CMake", "bytes": "606"}, {"name": "GAP", "bytes": "62"}, {"name": "GDScript", "bytes": "71651"}, {"name": "GLSL", "bytes": "873103"}, {"name": "Java", "bytes": "596800"}, {"name": "JavaScript", "bytes": "192587"}, {"name": "Kotlin", "bytes": "93312"}, {"name": "Makefile", "bytes": "1421"}, {"name": "Objective-C", "bytes": "20550"}, {"name": "Objective-C++", "bytes": "400430"}, {"name": "PowerShell", "bytes": "2713"}, {"name": "Python", "bytes": "482048"}, {"name": "Shell", "bytes": "33724"}]}} +{"text": "<component name=\"libraryTable\">\n <library name=\"Maven: org.apache.servicemix.bundles:org.apache.servicemix.bundles.ezmorph:1.0.6_1\">\n <CLASSES>\n <root url=\"jar://$MAVEN_REPOSITORY$/org/apache/servicemix/bundles/org.apache.servicemix.bundles.ezmorph/1.0.6_1/org.apache.servicemix.bundles.ezmorph-1.0.6_1.jar!/\" />\n </CLASSES>\n <JAVADOC>\n <root url=\"jar://$MAVEN_REPOSITORY$/org/apache/servicemix/bundles/org.apache.servicemix.bundles.ezmorph/1.0.6_1/org.apache.servicemix.bundles.ezmorph-1.0.6_1-javadoc.jar!/\" />\n </JAVADOC>\n <SOURCES>\n <root url=\"jar://$MAVEN_REPOSITORY$/org/apache/servicemix/bundles/org.apache.servicemix.bundles.ezmorph/1.0.6_1/org.apache.servicemix.bundles.ezmorph-1.0.6_1-sources.jar!/\" />\n </SOURCES>\n </library>\n</component>", "meta": {"content_hash": "0a6310001c15b92abc8c19f0ac854c1b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 181, "avg_line_length": 60.30769230769231, "alnum_prop": 0.7142857142857143, "repo_name": "hitakaken/bigfoot", "id": "1baf1da979980c731851187425b777f75a1d0793", "size": "784", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": ".idea/libraries/Maven__org_apache_servicemix_bundles_org_apache_servicemix_bundles_ezmorph_1_0_6_1.xml", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\n\nimport { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'app-comp-1831',\n templateUrl: './comp-1831.component.html',\n styleUrls: ['./comp-1831.component.css']\n})\nexport class Comp1831Component implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n", "meta": {"content_hash": "f4933cc54ce870303d4d89b0d2f313a4", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 50, "avg_line_length": 16.58823529411765, "alnum_prop": 0.6666666666666666, "repo_name": "angular/angular-cli-stress-test", "id": "3711e2a7aebff0ccdefa211d3b85be97223b35de", "size": "484", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/components/comp-1831/comp-1831.component.ts", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1040888"}, {"name": "HTML", "bytes": "300322"}, {"name": "JavaScript", "bytes": "2404"}, {"name": "TypeScript", "bytes": "8535506"}]}} +{"text": "<?php\nnamespace ODesk\\HomeTaskBundle\\Tests\\Services;\n\nuse ODesk\\HomeTaskBundle\\Services\\MatrixUtil;\n\nclass CalculatorTest extends \\PHPUnit_Framework_TestCase\n{\n public function testGenSpiralMatrix()\n {\n $word = 'test';\n\n $this->assertEquals(array(\n array('t', 'e', 's'),\n array('t', 't', 't'),\n array('s', 'e', 't')\n ), MatrixUtil::genSpiralMatrix($word, 3));\n\n $this->assertEquals(array(\n array('t', 'e'),\n array('t', 's')\n ), MatrixUtil::genSpiralMatrix($word, 2));\n\n $this->assertEquals(array(array('t')), MatrixUtil::genSpiralMatrix($word, 1));\n\n try {\n MatrixUtil::genSpiralMatrix('', null);\n } catch (\\InvalidArgumentException $expected) {\n $this->assertEquals($expected->getMessage(), 'Word can\\'t be empty');\n } catch (\\Exception $e) {\n $this->fail('An expected exception has not been raised.');\n }\n }\n}", "meta": {"content_hash": "32d883323173cf5b76211e2cf3da247b", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 86, "avg_line_length": 29.636363636363637, "alnum_prop": 0.5603271983640081, "repo_name": "abdula/symfony-play", "id": "6b6a6d2197a37472d9a970705d3044f07d89d5ca", "size": "978", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ODesk/HomeTaskBundle/Tests/Services/MatrixUtilTest.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "564"}, {"name": "PHP", "bytes": "48018"}]}} +{"text": "Deletes the user.\n\n## SYNTAX\n\n### ClientObject (Default)\n```\nRemove-SPClientUser [-ClientContext <ClientContext>] [-ClientObject] <User>\n```\n\n### Identity\n```\nRemove-SPClientUser [-ClientContext <ClientContext>] -Identity <Int32>\n```\n\n### Name\n```\nRemove-SPClientUser [-ClientContext <ClientContext>] -Name <String>\n```\n\n### Email\n```\nRemove-SPClientUser [-ClientContext <ClientContext>] -Email <String>\n```\n\n## DESCRIPTION\nThe Remove-SPClientUser function removes the user from the site.\nIf the user could not be found, throws exception.\n\n## EXAMPLES\n\n### -------------------------- Example 1 --------------------------\n```\nRemove-SPClientUser $user\n```\n\n### -------------------------- Example 2 --------------------------\n```\nRemove-SPClientUser -Identity 7\n```\n\n### -------------------------- Example 3 --------------------------\n```\nRemove-SPClientUser -Name \"i:0#.f|membership|admin@example.com\"\n```\n\n### -------------------------- Example 4 --------------------------\n```\nRemove-SPClientUser -Email \"admin@example.com\"\n```\n\n## PARAMETERS\n\n### -ClientContext\nIndicates the client context.\nIf not specified, uses a default context.\n\n```yaml\nType: ClientContext\nParameter Sets: (All)\nAliases: \n\nRequired: False\nPosition: Named\nDefault value: $SPClient.ClientContext\nAccept pipeline input: False\nAccept wildcard characters: False\n```\n\n### -ClientObject\nIndicates the user to delete.\n\n```yaml\nType: User\nParameter Sets: ClientObject\nAliases: \n\nRequired: True\nPosition: 1\nDefault value: None\nAccept pipeline input: True (ByValue)\nAccept wildcard characters: False\n```\n\n### -Identity\nIndicates the user ID.\n\n```yaml\nType: Int32\nParameter Sets: Identity\nAliases: Id\n\nRequired: True\nPosition: Named\nDefault value: 0\nAccept pipeline input: False\nAccept wildcard characters: False\n```\n\n### -Name\nIndicates the user login name.\n\n```yaml\nType: String\nParameter Sets: Name\nAliases: LoginName\n\nRequired: True\nPosition: Named\nDefault value: None\nAccept pipeline input: False\nAccept wildcard characters: False\n```\n\n### -Email\nIndicates the user E-mail.\n\n```yaml\nType: String\nParameter Sets: Email\nAliases: \n\nRequired: True\nPosition: Named\nDefault value: None\nAccept pipeline input: False\nAccept wildcard characters: False\n```\n\n## INPUTS\n\n### None or Microsoft.SharePoint.Client.User\n\n## OUTPUTS\n\n### None\n\n## NOTES\n\n## RELATED LINKS\n\n[https://github.com/karamem0/SPClient/blob/master/doc/Remove-SPClientUser.md](https://github.com/karamem0/SPClient/blob/master/doc/Remove-SPClientUser.md)\n\n", "meta": {"content_hash": "b74a1003f6240667694b32d6eb0a5ca0", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 154, "avg_line_length": 17.45774647887324, "alnum_prop": 0.6696248487293264, "repo_name": "karamem0/SPClient", "id": "332e891ed962f1cdaf24a00cf689f3e6ac4d444c", "size": "2514", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/Remove-SPClientUser.md", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "20908"}, {"name": "PowerShell", "bytes": "579806"}]}} +{"text": "\n\n#ifndef ScrollingTreeNode_h\n#define ScrollingTreeNode_h\n\n#if ENABLE(THREADED_SCROLLING)\n\n#include \"IntRect.h\"\n#include \"ScrollTypes.h\"\n#include \"ScrollingCoordinator.h\"\n#include <wtf/PassOwnPtr.h>\n\nnamespace WebCore {\n\nclass ScrollingTreeNode {\npublic:\n explicit ScrollingTreeNode(ScrollingTree*);\n virtual ~ScrollingTreeNode();\n\n virtual void update(ScrollingStateNode*) = 0;\n\n ScrollingNodeID scrollingNodeID() const { return m_nodeID; }\n void setScrollingNodeID(ScrollingNodeID nodeID) { m_nodeID = nodeID; }\n\n ScrollingTreeNode* parent() const { return m_parent; }\n void setParent(ScrollingTreeNode* parent) { m_parent = parent; }\n\n void appendChild(PassOwnPtr<ScrollingTreeNode>);\n void removeChild(ScrollingTreeNode*);\n\nprotected:\n ScrollingTree* scrollingTree() const { return m_scrollingTree; }\n\nprivate:\n ScrollingTree* m_scrollingTree;\n\n ScrollingNodeID m_nodeID;\n\n ScrollingTreeNode* m_parent;\n OwnPtr<Vector<OwnPtr<ScrollingTreeNode> > > m_children;\n};\n\n} // namespace WebCore\n\n#endif // ENABLE(THREADED_SCROLLING)\n\n#endif // ScrollingTreeNode_h\n", "meta": {"content_hash": "82731aa9bcaba3cf1ee315825b4f04a0", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 74, "avg_line_length": 23.4468085106383, "alnum_prop": 0.7413793103448276, "repo_name": "yoavweiss/RespImg-WebCore", "id": "46addc40eb1c44ab456fa5f334cd410b08b49684", "size": "2456", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "page/scrolling/ScrollingTreeNode.h", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Assembly", "bytes": "1301"}, {"name": "C", "bytes": "2369715"}, {"name": "C++", "bytes": "39064862"}, {"name": "JavaScript", "bytes": "3763760"}, {"name": "Objective-C", "bytes": "2038598"}, {"name": "Perl", "bytes": "768866"}, {"name": "Prolog", "bytes": "519"}, {"name": "Python", "bytes": "210630"}, {"name": "Ruby", "bytes": "1927"}, {"name": "Shell", "bytes": "8214"}]}} +{"text": "\tjQuery(document).ready(function() {\n\tjQuery(function(){\n\t\t//Registration form validation\n\t\tjQuery('#registration_form').validate();\n\t});\n});", "meta": {"content_hash": "ae5e8d5c5feedc9277f6e5c7d17c0087", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 23.5, "alnum_prop": 0.6879432624113475, "repo_name": "yoanngern/iahm_2016", "id": "dfc6d27a303a55e519c0a06cb8bff365f8718620", "size": "142", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "wp-content/plugins/event-espresso-core-reg/core/templates/global_assets/scripts/validation.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ApacheConf", "bytes": "14"}, {"name": "CSS", "bytes": "2370838"}, {"name": "HTML", "bytes": "1771"}, {"name": "JavaScript", "bytes": "3225493"}, {"name": "PHP", "bytes": "21389164"}]}} +{"text": "\"\"\"\nraven.contrib.django.handlers\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.\n:license: BSD, see LICENSE for more details.\n\"\"\"\n\nfrom __future__ import absolute_import\n\nimport logging\nfrom raven.handlers.logging import SentryHandler as BaseSentryHandler\n\n\nclass SentryHandler(BaseSentryHandler):\n def __init__(self):\n logging.Handler.__init__(self)\n\n def _get_client(self):\n from raven.contrib.django.models import client\n\n return client\n\n client = property(_get_client)\n\n def _emit(self, record):\n from raven.contrib.django.middleware import SentryLogMiddleware\n\n # Fetch the request from a threadlocal variable, if available\n request = getattr(record, 'request', getattr(SentryLogMiddleware.thread, 'request', None))\n\n return super(SentryHandler, self)._emit(record, request=request)\n", "meta": {"content_hash": "419af02943a9850ba3ac01aa19fcdddc", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 98, "avg_line_length": 28.25, "alnum_prop": 0.6891592920353983, "repo_name": "alex/raven", "id": "275aa2769d16647d3716eb91043949de447e937c", "size": "904", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "raven/contrib/django/handlers.py", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Python", "bytes": "216588"}]}} +{"text": "require 'unit_spec_helper'\n\ndescribe Rpush::Client::ActiveRecord::Apns::App do\n it_behaves_like 'Rpush::Client::Apns::App'\n it_behaves_like 'Rpush::Client::ActiveRecord::App'\nend if active_record?\n", "meta": {"content_hash": "8ba8c714ccfd3447ed0d9d4b843e0294", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 52, "avg_line_length": 33.166666666666664, "alnum_prop": 0.7437185929648241, "repo_name": "rpush/rpush", "id": "97409056d2f47682b9dabdc252ce8d43e72633d1", "size": "199", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/unit/client/active_record/apns/app_spec.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "458658"}]}} +{"text": "import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport classNames from 'classnames';\n\nimport '../../assets/scss/SimpleBanner.css';\n\nclass SimpleBannerComponent extends Component {\n static propTypes = {\n classNameBanner: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n classNameBannerTitle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n classNameBannerTitleUpperText: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n classNameBannerTitleLowerText: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n upperText: PropTypes.string,\n lowerText: PropTypes.string,\n };\n\n static defaultProps = {\n classNameBanner: '',\n classNameBannerTitle: '',\n classNameBannerTitleUpperText: '',\n classNameBannerTitleLowerText: '',\n upperText: '',\n lowerText: '',\n };\n\n render() {\n const {\n classNameBanner,\n classNameBannerTitle,\n classNameBannerTitleUpperText,\n classNameBannerTitleLowerText,\n upperText,\n lowerText,\n } = this.props;\n\n const cls = {\n banner: classNames('simple-banner', classNameBanner),\n bannerOverlay: 'simple-banner__overlay',\n bannerTitle: classNames('simple-banner__title', classNameBannerTitle),\n bannerTitleTextLight: classNames('simple-banner__title__text simple-banner__title__text--light animated fadeInUp', classNameBannerTitleUpperText),\n bannerSmallTitleText: classNames('simple-banner__title__text simple-banner__title__text--small animated fadeInDown', classNameBannerTitleLowerText),\n };\n\n return (\n <section className={cls.banner} id={'banner'}>\n <div className={cls.bannerOverlay} />\n <div className={cls.bannerTitle}>\n <span className={cls.bannerSmallTitleText}>{upperText}</span>\n <span className={cls.bannerTitleTextLight}>{lowerText}</span>\n </div>\n </section>\n )\n }\n}\n\nexport default SimpleBannerComponent;\n", "meta": {"content_hash": "5577a4c05ad9e7263c9158b489acb62e", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 154, "avg_line_length": 34.49122807017544, "alnum_prop": 0.7070193285859614, "repo_name": "fcgomes92/pousadacaminhodosventos", "id": "dd467b02752a16d8ebc2a46f579ce1289cde1930", "size": "1966", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Components/SimpleBanner/SimpleBannerComponent.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "33280"}, {"name": "HTML", "bytes": "193414"}, {"name": "JavaScript", "bytes": "72032"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"JavadocGenerationManager\">\n <option name=\"OUTPUT_DIRECTORY\" value=\"$USER_HOME$/Desktop\" />\n <option name=\"OPTION_SCOPE\" value=\"protected\" />\n <option name=\"OPTION_HIERARCHY\" value=\"true\" />\n <option name=\"OPTION_NAVIGATOR\" value=\"true\" />\n <option name=\"OPTION_INDEX\" value=\"true\" />\n <option name=\"OPTION_SEPARATE_INDEX\" value=\"true\" />\n <option name=\"OPTION_DOCUMENT_TAG_USE\" value=\"true\" />\n <option name=\"OPTION_DOCUMENT_TAG_AUTHOR\" value=\"true\" />\n <option name=\"OPTION_DOCUMENT_TAG_VERSION\" value=\"true\" />\n <option name=\"OPTION_DOCUMENT_TAG_DEPRECATED\" value=\"true\" />\n <option name=\"OPTION_DEPRECATED_LIST\" value=\"true\" />\n <option name=\"OTHER_OPTIONS\" />\n <option name=\"HEAP_SIZE\" />\n <option name=\"LOCALE\" />\n <option name=\"OPEN_IN_BROWSER\" value=\"true\" />\n <option name=\"OPTION_INCLUDE_LIBS\" value=\"false\" />\n </component>\n <component name=\"ProjectKey\">\n <option name=\"state\" value=\"project://e79810c8-c5c8-43b1-b19c-90c1f4095425\" />\n </component>\n <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_8\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\">\n <output url=\"file://$PROJECT_DIR$/out\" />\n </component>\n</project>", "meta": {"content_hash": "e55c343b778e2d820dce6b35d5e54d9e", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 125, "avg_line_length": 47.77777777777778, "alnum_prop": 0.6682170542635659, "repo_name": "sisgandarli/N-Queens", "id": "b3f9c1f58b091047e5504742b7d57f62dd06b7bd", "size": "1290", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": ".idea/misc.xml", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "188"}, {"name": "Java", "bytes": "10500"}]}} +{"text": "namespace sync_file_system {\nnamespace drive {\n\nnamespace {\n\nconst base::FilePath::CharType kV0FormatPathPrefix[] =\n FILE_PATH_LITERAL(\"drive/\");\nconst char kWapiFileIdPrefix[] = \"file:\";\nconst char kWapiFolderIdPrefix[] = \"folder:\";\n\nstd::string RemovePrefix(const std::string& str, const std::string& prefix) {\n if (StartsWithASCII(str, prefix, true))\n return std::string(str.begin() + prefix.size(), str.end());\n return str;\n}\n\n} // namespace\n\nbool ParseV0FormatFileSystemURL(const GURL& url,\n GURL* origin,\n base::FilePath* path) {\n fileapi::FileSystemType mount_type;\n base::FilePath virtual_path;\n\n if (!fileapi::FileSystemURL::ParseFileSystemSchemeURL(\n url, origin, &mount_type, &virtual_path) ||\n mount_type != fileapi::kFileSystemTypeExternal) {\n NOTREACHED() << \"Failed to parse filesystem scheme URL \" << url.spec();\n return false;\n }\n\n base::FilePath::StringType prefix =\n base::FilePath(kV0FormatPathPrefix).NormalizePathSeparators().value();\n if (virtual_path.value().substr(0, prefix.size()) != prefix)\n return false;\n\n *path = base::FilePath(virtual_path.value().substr(prefix.size()));\n return true;\n}\n\nstd::string AddWapiFilePrefix(const std::string& resource_id) {\n DCHECK(!StartsWithASCII(resource_id, kWapiFileIdPrefix, true));\n DCHECK(!StartsWithASCII(resource_id, kWapiFolderIdPrefix, true));\n\n if (resource_id.empty() ||\n StartsWithASCII(resource_id, kWapiFileIdPrefix, true) ||\n StartsWithASCII(resource_id, kWapiFolderIdPrefix, true))\n return resource_id;\n return kWapiFileIdPrefix + resource_id;\n}\n\nstd::string AddWapiFolderPrefix(const std::string& resource_id) {\n DCHECK(!StartsWithASCII(resource_id, kWapiFileIdPrefix, true));\n DCHECK(!StartsWithASCII(resource_id, kWapiFolderIdPrefix, true));\n\n if (resource_id.empty() ||\n StartsWithASCII(resource_id, kWapiFileIdPrefix, true) ||\n StartsWithASCII(resource_id, kWapiFolderIdPrefix, true))\n return resource_id;\n return kWapiFolderIdPrefix + resource_id;\n}\n\nstd::string AddWapiIdPrefix(const std::string& resource_id,\n DriveMetadata_ResourceType type) {\n switch (type) {\n case DriveMetadata_ResourceType_RESOURCE_TYPE_FILE:\n return AddWapiFilePrefix(resource_id);\n case DriveMetadata_ResourceType_RESOURCE_TYPE_FOLDER:\n return AddWapiFolderPrefix(resource_id);\n }\n NOTREACHED();\n return resource_id;\n}\n\nstd::string RemoveWapiIdPrefix(const std::string& resource_id) {\n if (StartsWithASCII(resource_id, kWapiFileIdPrefix, true))\n return RemovePrefix(resource_id, kWapiFileIdPrefix);\n if (StartsWithASCII(resource_id, kWapiFolderIdPrefix, true))\n return RemovePrefix(resource_id, kWapiFolderIdPrefix);\n return resource_id;\n}\n\nSyncStatusCode MigrateDatabaseFromV0ToV1(leveldb::DB* db) {\n // Version 0 database format:\n // key: \"CHANGE_STAMP\"\n // value: <Largest Changestamp>\n //\n // key: \"SYNC_ROOT_DIR\"\n // value: <Resource ID of the sync root directory>\n //\n // key: \"METADATA: \" +\n // <FileSystemURL serialized by SerializeSyncableFileSystemURL>\n // value: <Serialized DriveMetadata>\n //\n // key: \"BSYNC_ORIGIN: \" + <URL string of a batch sync origin>\n // value: <Resource ID of the drive directory for the origin>\n //\n // key: \"ISYNC_ORIGIN: \" + <URL string of a incremental sync origin>\n // value: <Resource ID of the drive directory for the origin>\n //\n // Version 1 database format (changed keys/fields are marked with '*'):\n // * key: \"VERSION\" (new)\n // * value: 1\n //\n // key: \"CHANGE_STAMP\"\n // value: <Largest Changestamp>\n //\n // key: \"SYNC_ROOT_DIR\"\n // value: <Resource ID of the sync root directory>\n //\n // * key: \"METADATA: \" + <Origin and URL> (changed)\n // * value: <Serialized DriveMetadata>\n //\n // key: \"BSYNC_ORIGIN: \" + <URL string of a batch sync origin>\n // value: <Resource ID of the drive directory for the origin>\n //\n // key: \"ISYNC_ORIGIN: \" + <URL string of a incremental sync origin>\n // value: <Resource ID of the drive directory for the origin>\n //\n // key: \"DISABLED_ORIGIN: \" + <URL string of a disabled origin>\n // value: <Resource ID of the drive directory for the origin>\n\n const char kDatabaseVersionKey[] = \"VERSION\";\n const char kDriveMetadataKeyPrefix[] = \"METADATA: \";\n const char kMetadataKeySeparator = ' ';\n\n leveldb::WriteBatch write_batch;\n write_batch.Put(kDatabaseVersionKey, \"1\");\n\n scoped_ptr<leveldb::Iterator> itr(db->NewIterator(leveldb::ReadOptions()));\n for (itr->Seek(kDriveMetadataKeyPrefix); itr->Valid(); itr->Next()) {\n std::string key = itr->key().ToString();\n if (!StartsWithASCII(key, kDriveMetadataKeyPrefix, true))\n break;\n std::string serialized_url(RemovePrefix(key, kDriveMetadataKeyPrefix));\n\n GURL origin;\n base::FilePath path;\n bool success = ParseV0FormatFileSystemURL(\n GURL(serialized_url), &origin, &path);\n DCHECK(success) << serialized_url;\n std::string new_key = kDriveMetadataKeyPrefix + origin.spec() +\n kMetadataKeySeparator + path.AsUTF8Unsafe();\n\n write_batch.Put(new_key, itr->value());\n write_batch.Delete(key);\n }\n\n return LevelDBStatusToSyncStatusCode(\n db->Write(leveldb::WriteOptions(), &write_batch));\n}\n\nSyncStatusCode MigrateDatabaseFromV1ToV2(leveldb::DB* db) {\n // Strips prefix of WAPI resource ID, and discards batch sync origins.\n // (i.e. \"file:xxxx\" => \"xxxx\", \"folder:yyyy\" => \"yyyy\")\n //\n // Version 2 database format (changed keys/fields are marked with '*'):\n // key: \"VERSION\"\n // * value: 2\n //\n // key: \"CHANGE_STAMP\"\n // value: <Largest Changestamp>\n //\n // key: \"SYNC_ROOT_DIR\"\n // * value: <Resource ID of the sync root directory> (striped)\n //\n // key: \"METADATA: \" + <Origin and URL>\n // * value: <Serialized DriveMetadata> (stripped)\n //\n // * key: \"BSYNC_ORIGIN: \" + <URL string of a batch sync origin> (deleted)\n // * value: <Resource ID of the drive directory for the origin> (deleted)\n //\n // key: \"ISYNC_ORIGIN: \" + <URL string of a incremental sync origin>\n // * value: <Resource ID of the drive directory for the origin> (stripped)\n //\n // key: \"DISABLED_ORIGIN: \" + <URL string of a disabled origin>\n // * value: <Resource ID of the drive directory for the origin> (stripped)\n\n const char kDatabaseVersionKey[] = \"VERSION\";\n const char kSyncRootDirectoryKey[] = \"SYNC_ROOT_DIR\";\n const char kDriveMetadataKeyPrefix[] = \"METADATA: \";\n const char kDriveBatchSyncOriginKeyPrefix[] = \"BSYNC_ORIGIN: \";\n const char kDriveIncrementalSyncOriginKeyPrefix[] = \"ISYNC_ORIGIN: \";\n const char kDriveDisabledOriginKeyPrefix[] = \"DISABLED_ORIGIN: \";\n\n leveldb::WriteBatch write_batch;\n write_batch.Put(kDatabaseVersionKey, \"2\");\n\n scoped_ptr<leveldb::Iterator> itr(db->NewIterator(leveldb::ReadOptions()));\n for (itr->SeekToFirst(); itr->Valid(); itr->Next()) {\n std::string key = itr->key().ToString();\n\n // Strip resource id for the sync root directory.\n if (StartsWithASCII(key, kSyncRootDirectoryKey, true)) {\n write_batch.Put(key, RemoveWapiIdPrefix(itr->value().ToString()));\n continue;\n }\n\n // Strip resource ids in the drive metadata.\n if (StartsWithASCII(key, kDriveMetadataKeyPrefix, true)) {\n DriveMetadata metadata;\n bool success = metadata.ParseFromString(itr->value().ToString());\n DCHECK(success);\n\n metadata.set_resource_id(RemoveWapiIdPrefix(metadata.resource_id()));\n std::string metadata_string;\n metadata.SerializeToString(&metadata_string);\n\n write_batch.Put(key, metadata_string);\n continue;\n }\n\n // Deprecate legacy batch sync origin entries that are no longer needed.\n if (StartsWithASCII(key, kDriveBatchSyncOriginKeyPrefix, true)) {\n write_batch.Delete(key);\n continue;\n }\n\n // Strip resource ids of the incremental sync origins.\n if (StartsWithASCII(key, kDriveIncrementalSyncOriginKeyPrefix, true)) {\n write_batch.Put(key, RemoveWapiIdPrefix(itr->value().ToString()));\n continue;\n }\n\n // Strip resource ids of the disabled sync origins.\n if (StartsWithASCII(key, kDriveDisabledOriginKeyPrefix, true)) {\n write_batch.Put(key, RemoveWapiIdPrefix(itr->value().ToString()));\n continue;\n }\n }\n\n return LevelDBStatusToSyncStatusCode(\n db->Write(leveldb::WriteOptions(), &write_batch));\n}\n\n} // namespace drive\n} // namespace sync_file_system\n", "meta": {"content_hash": "8bf45ebb9fc901e2df64c55bd92265ce", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 77, "avg_line_length": 35.78481012658228, "alnum_prop": 0.6779860865463978, "repo_name": "windyuuy/opera", "id": "96099c17bc25199028f0b0b44e51592db2ae9c68", "size": "9043", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "chromium/src/chrome/browser/sync_file_system/drive/metadata_db_migration_util.cc", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ApacheConf", "bytes": "25707"}, {"name": "AppleScript", "bytes": "6973"}, {"name": "Assembly", "bytes": "51642"}, {"name": "Batchfile", "bytes": "35942"}, {"name": "C", "bytes": "4303018"}, {"name": "C#", "bytes": "35203"}, {"name": "C++", "bytes": "207333360"}, {"name": "CMake", "bytes": "25089"}, {"name": "CSS", "bytes": "681256"}, {"name": "Dart", "bytes": "24294"}, {"name": "Emacs Lisp", "bytes": "25534"}, {"name": "Groff", "bytes": "5283"}, {"name": "HTML", "bytes": "10400943"}, {"name": "IDL", "bytes": "836"}, {"name": "Java", "bytes": "2821184"}, {"name": "JavaScript", "bytes": "14563996"}, {"name": "Lua", "bytes": "13749"}, {"name": "Makefile", "bytes": "55521"}, {"name": "Objective-C", "bytes": "1211523"}, {"name": "Objective-C++", "bytes": "6221908"}, {"name": "PHP", "bytes": "61320"}, {"name": "Perl", "bytes": "82949"}, {"name": "Protocol Buffer", "bytes": "280464"}, {"name": "Python", "bytes": "12627773"}, {"name": "Rebol", "bytes": "262"}, {"name": "Ruby", "bytes": "937"}, {"name": "Scheme", "bytes": "10604"}, {"name": "Shell", "bytes": "894814"}, {"name": "VimL", "bytes": "4953"}, {"name": "XSLT", "bytes": "418"}, {"name": "nesC", "bytes": "14650"}]}} +{"text": "\ufeff// ----------------------------------------------------------------------------------\n//\n// Copyright Microsoft Corporation\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ----------------------------------------------------------------------------------\n\nusing System;\nusing System.Web;\nusing System.Collections.Generic;\nusing System.Collections.Specialized;\nusing System.Linq;\nusing System.Management.Automation;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Microsoft.Azure.Management.BackupServices.Models;\nusing MBS = Microsoft.Azure.Management.BackupServices;\nusing Microsoft.WindowsAzure.Commands.ServiceManagement.Model;\nusing Microsoft.Azure.Commands.AzureBackup.Properties;\nusing Microsoft.Azure.Commands.AzureBackup.Models;\nusing Microsoft.Azure.Commands.AzureBackup.Helpers;\nusing Microsoft.Azure.Management.BackupServices;\n\nnamespace Microsoft.Azure.Commands.AzureBackup.Cmdlets\n{\n /// <summary>\n /// Enables reregistration of a machine container\n /// </summary>\n [Cmdlet(VerbsLifecycle.Enable, \"AzureRMBackupContainerReregistration\")]\n public class EnableAzureRMBackupContainerReregistration : AzureBackupContainerCmdletBase\n {\n public override void ExecuteCmdlet()\n {\n ExecutionBlock(() =>\n {\n base.ExecuteCmdlet();\n\n AzureBackupContainerType containerType = (AzureBackupContainerType)Enum.Parse(typeof(AzureBackupContainerType), Container.ContainerType);\n switch (containerType)\n {\n case AzureBackupContainerType.Windows:\n case AzureBackupContainerType.SCDPM:\n AzureBackupClient.EnableMachineContainerReregistration(Container.ResourceGroupName, Container.ResourceName, Container.Id);\n break;\n default:\n throw new ArgumentException(Resources.CannotEnableRegistration);\n }\n });\n }\n }\n}\n", "meta": {"content_hash": "e6a3cab8d033bf519c543d67882fdf18", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 153, "avg_line_length": 42.86206896551724, "alnum_prop": 0.6633145615446501, "repo_name": "jianghaolu/azure-powershell", "id": "7fe6cc352f75f797604421424ab38181a8af297d", "size": "2488", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container/EnableAzureRMBackupContainerReregistration.cs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "15822"}, {"name": "C#", "bytes": "22432078"}, {"name": "HTML", "bytes": "209"}, {"name": "JavaScript", "bytes": "4979"}, {"name": "PHP", "bytes": "41"}, {"name": "PowerShell", "bytes": "1795127"}, {"name": "Shell", "bytes": "50"}]}} +{"text": "class WDTypedResult;\n\n//\n// Result types for WebDataService.\n//\ntypedef enum {\n BOOL_RESULT = 1, // WDResult<bool>\n KEYWORDS_RESULT, // WDResult<WDKeywordsResult>\n INT64_RESULT, // WDResult<int64_t>\n#if defined(OS_WIN) //\n PASSWORD_IE7_RESULT, // WDResult<IE7PasswordInfo>\n#endif //\n WEB_APP_IMAGES, // WDResult<WDAppImagesResult>\n TOKEN_RESULT, // WDResult<TokenResult>\n AUTOFILL_VALUE_RESULT, // WDResult<std::vector<AutofillEntry>>\n AUTOFILL_CLEANUP_RESULT, // WDResult<size_t>\n AUTOFILL_CHANGES, // WDResult<std::vector<AutofillChange>>\n AUTOFILL_PROFILE_RESULT, // WDResult<AutofillProfile>\n AUTOFILL_PROFILES_RESULT, // WDResult<std::vector<\n // std::unique_ptr<AutofillProfile>>>\n AUTOFILL_CLOUDTOKEN_RESULT, // WDResult<std::vector<std::unique_ptr<\n // CreditCardCloudTokenData>>>\n AUTOFILL_CREDITCARD_RESULT, // WDResult<CreditCard>\n AUTOFILL_CREDITCARDS_RESULT, // WDResult<std::vector<\n // std::unique_ptr<CreditCard>>>\n AUTOFILL_CUSTOMERDATA_RESULT, // WDResult<std::unique_ptr<\n // PaymentsCustomerData>>\n AUTOFILL_UPI_RESULT, // WDResult<std::string>\n#if !defined(OS_IOS) //\n PAYMENT_WEB_APP_MANIFEST, // WDResult<std::vector<\n // mojom::WebAppManifestSectionPtr>>\n PAYMENT_METHOD_MANIFEST, // WDResult<std::vector<std::string>>\n#endif\n} WDResultType;\n\n//\n// The top level class for a result.\n//\nclass WEBDATA_EXPORT WDTypedResult {\n public:\n virtual ~WDTypedResult() {}\n\n // Return the result type.\n WDResultType GetType() const { return type_; }\n\n protected:\n explicit WDTypedResult(WDResultType type) : type_(type) {}\n\n private:\n WDResultType type_;\n DISALLOW_COPY_AND_ASSIGN(WDTypedResult);\n};\n\n// A result containing one specific pointer or literal value.\ntemplate <class T>\nclass WDResult : public WDTypedResult {\n public:\n WDResult(WDResultType type, const T& v) : WDTypedResult(type), value_(v) {}\n WDResult(WDResultType type, T&& v)\n : WDTypedResult(type), value_(std::move(v)) {}\n\n ~WDResult() override {}\n\n // Return a single value result.\n const T& GetValue() const { return value_; }\n T GetValue() { return std::move(value_); }\n\n private:\n T value_;\n\n DISALLOW_COPY_AND_ASSIGN(WDResult);\n};\n\n#endif // COMPONENTS_WEBDATA_COMMON_WEB_DATA_RESULTS_H_\n", "meta": {"content_hash": "f77f5810da54a53b06c4e8cdf2fae602", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 77, "avg_line_length": 35.12162162162162, "alnum_prop": 0.6063870719507503, "repo_name": "endlessm/chromium-browser", "id": "b69c6978174c8eaa4e2534522ba970fc71a34095", "size": "3057", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "components/webdata/common/web_data_results.h", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc (1.8.0_60) on Mon Mar 28 17:57:43 AEST 2016 -->\n<title>org.apache.river.api.io (River-Internet vtrunk API Documentation)</title>\n<meta name=\"date\" content=\"2016-03-28\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../../stylesheet.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"../../../../../script.js\"></script>\n</head>\n<body>\n<h1 class=\"bar\"><a href=\"../../../../../org/apache/river/api/io/package-summary.html\" target=\"classFrame\">org.apache.river.api.io</a></h1>\n<div class=\"indexContainer\">\n<h2 title=\"Interfaces\">Interfaces</h2>\n<ul title=\"Interfaces\">\n<li><a href=\"AtomicSerial.ReadObject.html\" title=\"interface in org.apache.river.api.io\" target=\"classFrame\"><span class=\"interfaceName\">AtomicSerial.ReadObject</span></a></li>\n</ul>\n<h2 title=\"Classes\">Classes</h2>\n<ul title=\"Classes\">\n<li><a href=\"AtomicExternal.Factory.html\" title=\"class in org.apache.river.api.io\" target=\"classFrame\">AtomicExternal.Factory</a></li>\n<li><a href=\"AtomicMarshalInputStream.html\" title=\"class in org.apache.river.api.io\" target=\"classFrame\">AtomicMarshalInputStream</a></li>\n<li><a href=\"AtomicMarshalOutputStream.html\" title=\"class in org.apache.river.api.io\" target=\"classFrame\">AtomicMarshalOutputStream</a></li>\n<li><a href=\"AtomicSerial.Factory.html\" title=\"class in org.apache.river.api.io\" target=\"classFrame\">AtomicSerial.Factory</a></li>\n<li><a href=\"AtomicSerial.GetArg.html\" title=\"class in org.apache.river.api.io\" target=\"classFrame\">AtomicSerial.GetArg</a></li>\n<li><a href=\"DeSerializationPermission.html\" title=\"class in org.apache.river.api.io\" target=\"classFrame\">DeSerializationPermission</a></li>\n<li><a href=\"UnsuportedOperationException.html\" title=\"class in org.apache.river.api.io\" target=\"classFrame\">UnsuportedOperationException</a></li>\n<li><a href=\"Valid.html\" title=\"class in org.apache.river.api.io\" target=\"classFrame\">Valid</a></li>\n</ul>\n<h2 title=\"Enums\">Enums</h2>\n<ul title=\"Enums\">\n<li><a href=\"AtomicMarshalInputStream.Reference.html\" title=\"enum in org.apache.river.api.io\" target=\"classFrame\">AtomicMarshalInputStream.Reference</a></li>\n</ul>\n<h2 title=\"Exceptions\">Exceptions</h2>\n<ul title=\"Exceptions\">\n<li><a href=\"AtomicException.html\" title=\"class in org.apache.river.api.io\" target=\"classFrame\">AtomicException</a></li>\n</ul>\n<h2 title=\"Annotation Types\">Annotation Types</h2>\n<ul title=\"Annotation Types\">\n<li><a href=\"AtomicExternal.html\" title=\"annotation in org.apache.river.api.io\" target=\"classFrame\">AtomicExternal</a></li>\n<li><a href=\"AtomicSerial.html\" title=\"annotation in org.apache.river.api.io\" target=\"classFrame\">AtomicSerial</a></li>\n<li><a href=\"AtomicSerial.ReadInput.html\" title=\"annotation in org.apache.river.api.io\" target=\"classFrame\">AtomicSerial.ReadInput</a></li>\n<li><a href=\"Serializer.html\" title=\"annotation in org.apache.river.api.io\" target=\"classFrame\">Serializer</a></li>\n</ul>\n</div>\n</body>\n</html>\n", "meta": {"content_hash": "f0a8e712d1e3aff916a8575064506b2d", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 175, "avg_line_length": 66.65217391304348, "alnum_prop": 0.7292889758643183, "repo_name": "pfirmstone/JGDMS", "id": "5fcef349a9973a478ccb2f41c5b8ba4953cd0cac", "size": "3066", "binary": false, "copies": "2", "ref": "refs/heads/trunk", "path": "JGDMS/src/site/resources/old-static-site/doc/api/org/apache/river/api/io/package-frame.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "38260"}, {"name": "Groovy", "bytes": "30510"}, {"name": "HTML", "bytes": "107806458"}, {"name": "Java", "bytes": "24863323"}, {"name": "JavaScript", "bytes": "1702"}, {"name": "Makefile", "bytes": "3032"}, {"name": "Roff", "bytes": "863"}, {"name": "Shell", "bytes": "68247"}]}} +{"text": "angular\n .module(\"avaliacao\", ['ui.router', 'ui.bootstrap'])\n .config([\"$stateProvider\", '$urlRouterProvider', \"$locationProvider\", routes]);\n\nfunction routes($stateProvider, $urlRouterProvider, $locationProvider) {\n $urlRouterProvider.otherwise('/');\n /*\n $locationProvider.html5Mode({\n enabled: true,\n requireBase: false\n \n });\n */\n $stateProvider\n .state('home', {\n url: '/',\n templateUrl: 'templates/home.html'\n })\n .state('Login', {\n url: '/Login',\n templateUrl: 'templates/Login.html'\n });\n}", "meta": {"content_hash": "9c4f7f3803eb4e78baab83f40b44cbce", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 83, "avg_line_length": 26.652173913043477, "alnum_prop": 0.5497553017944535, "repo_name": "MaikolSilva/desenvolvimento-web-ii", "id": "c9c10c93c6d0e4663b6ca952b7ac869693f2a4ee", "size": "613", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Avalia\u00e7\u00e3o/js/app.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "803"}, {"name": "HTML", "bytes": "4267"}]}} +{"text": "import './index';\n\nimport sinon from 'sinon';\nimport { expect } from 'chai';\nimport { $, $$ } from 'common-sk/modules/dom';\nimport fetchMock from 'fetch-mock';\n\nimport { GetTasksResponse } from '../json';\nimport {\n singleResultCanDelete, singleResultNoDelete, resultSetOneItem, resultSetTwoItems,\n} from './test_data';\nimport {\n eventPromise,\n setUpElementUnderTest,\n} from '../../../infra-sk/modules/test_util';\n\ndescribe('task-queue-sk', () => {\n const newInstance = setUpElementUnderTest('task-queue-sk');\n fetchMock.config.overwriteRoutes = false;\n\n const loadTable = async () => {\n const event = eventPromise('end-task');\n const taskTableSk = newInstance();\n await event;\n return taskTableSk;\n };\n const loadTableWithReplies = async (replies: GetTasksResponse[]) => {\n const kNumTaskQueries = 16;\n const replyCount = replies.length;\n expect(replyCount).to.be.most(kNumTaskQueries);\n for (let i = 0; i < replyCount; ++i) {\n fetchMock.postOnce('begin:/_/get_', replies[i]);\n }\n fetchMock.post('begin:/_/get_', 200, { repeat: kNumTaskQueries - replyCount });\n\n return loadTable();\n };\n\n afterEach(() => {\n // Check all mock fetches called at least once and reset.\n expect(fetchMock.done()).to.be.true;\n fetchMock.reset();\n sinon.restore();\n });\n\n it('shows table entries', async () => {\n // Return some results for 2 of the 16 task queries.\n const table = await loadTableWithReplies([resultSetOneItem, resultSetTwoItems]);\n\n // (3 items) * 6 columns\n expect($('td', table).length).to.equal(18);\n });\n\n it('delete option shown', async () => {\n const table = await loadTableWithReplies([singleResultCanDelete]);\n\n expect($$('delete-icon-sk', table)).to.have.property('hidden', false);\n });\n\n it('delete option hidden', async () => {\n const table = await loadTableWithReplies([singleResultNoDelete]);\n\n expect($$('delete-icon-sk', table)).to.have.property('hidden', true);\n });\n\n it('delete flow works', async () => {\n const table = await loadTableWithReplies([singleResultCanDelete]);\n\n sinon.stub(window, 'confirm').returns(true);\n sinon.stub(window, 'alert');\n fetchMock.postOnce((url, options) => url.startsWith('/_/delete_') && options.body === JSON.stringify({ id: 1 }), 200);\n ($$('delete-icon-sk', table) as HTMLElement).click();\n });\n\n it('task details works', async () => {\n const table = await loadTableWithReplies([resultSetOneItem]);\n\n expect($$('.dialog-background', table)!.classList.value).to.include('hidden');\n expect($$('.dialog-background', table)!.classList.value).to.include('hidden');\n ($$('.details', table) as HTMLElement).click();\n\n expect($$('.dialog-background', table)!.classList.value).to.not.include('hidden');\n });\n});\n", "meta": {"content_hash": "43fd414ca959907e65c5de1122d0626e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 122, "avg_line_length": 33.04761904761905, "alnum_prop": 0.6534582132564841, "repo_name": "google/skia-buildbot", "id": "c942c4cc023ef256228c8bfd83640f957a988700", "size": "2776", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "ct/modules/task-queue-sk/task-queue-sk_test.ts", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Batchfile", "bytes": "736"}, {"name": "C", "bytes": "3114"}, {"name": "C++", "bytes": "18072"}, {"name": "CSS", "bytes": "13967"}, {"name": "Dockerfile", "bytes": "18546"}, {"name": "Go", "bytes": "8744467"}, {"name": "HTML", "bytes": "790880"}, {"name": "JavaScript", "bytes": "1186449"}, {"name": "Jupyter Notebook", "bytes": "9165"}, {"name": "Makefile", "bytes": "75823"}, {"name": "PowerShell", "bytes": "15305"}, {"name": "Python", "bytes": "126773"}, {"name": "SCSS", "bytes": "128048"}, {"name": "Shell", "bytes": "232449"}, {"name": "Starlark", "bytes": "234929"}, {"name": "TypeScript", "bytes": "1568540"}]}} +{"text": "\n#pragma once\n#ifndef EL_READ_ASCII_HPP\n#define EL_READ_ASCII_HPP\n\nnamespace El {\nnamespace read {\n\ntemplate<typename T>\ninline void\nAscii( Matrix<T>& A, const string filename )\n{\n DEBUG_ONLY(CSE cse(\"read::Ascii\"))\n std::ifstream file( filename.c_str() );\n if( !file.is_open() )\n RuntimeError(\"Could not open \",filename);\n\n // Walk through the file once to both count the number of rows and\n // columns and to ensure that the number of columns is consistent\n Int height=0, width=0;\n string line;\n while( std::getline( file, line ) )\n {\n std::stringstream lineStream( line );\n Int numCols=0;\n T value;\n while( lineStream >> value ) ++numCols;\n if( numCols != 0 )\n {\n if( numCols != width && width != 0 )\n LogicError(\"Inconsistent number of columns\");\n else\n width = numCols;\n ++height;\n }\n }\n file.clear();\n file.seekg(0,file.beg);\n\n // Resize the matrix and then read it\n A.Resize( height, width );\n Int i=0;\n while( std::getline( file, line ) )\n {\n std::stringstream lineStream( line );\n Int j=0;\n T value;\n while( lineStream >> value )\n {\n A.Set( i, j, value );\n ++j;\n }\n ++i;\n }\n}\n\ntemplate<typename T>\ninline void\nAscii( AbstractDistMatrix<T>& A, const string filename )\n{\n DEBUG_ONLY(CSE cse(\"read::Ascii\"))\n std::ifstream file( filename.c_str() );\n if( !file.is_open() )\n RuntimeError(\"Could not open \",filename);\n\n // Walk through the file once to both count the number of rows and\n // columns and to ensure that the number of columns is consistent\n Int height=0, width=0;\n string line;\n while( std::getline( file, line ) )\n {\n std::stringstream lineStream( line );\n Int numCols=0;\n T value;\n while( lineStream >> value ) ++numCols;\n if( numCols != 0 )\n {\n if( numCols != width && width != 0 )\n LogicError(\"Inconsistent number of columns\");\n else\n width = numCols;\n ++height;\n }\n }\n file.clear();\n file.seekg(0,file.beg);\n\n // Resize the matrix and then read in our local portion\n A.Resize( height, width );\n Int i=0;\n while( std::getline( file, line ) )\n {\n std::stringstream lineStream( line );\n Int j=0;\n T value;\n while( lineStream >> value )\n {\n A.Set( i, j, value );\n ++j;\n }\n ++i;\n }\n}\n\ntemplate<typename T>\ninline void\nAscii( AbstractBlockDistMatrix<T>& A, const string filename )\n{\n DEBUG_ONLY(CSE cse(\"read::Ascii\"))\n std::ifstream file( filename.c_str() );\n if( !file.is_open() )\n RuntimeError(\"Could not open \",filename);\n\n // Walk through the file once to both count the number of rows and\n // columns and to ensure that the number of columns is consistent\n Int height=0, width=0;\n string line;\n while( std::getline( file, line ) )\n {\n std::stringstream lineStream( line );\n Int numCols=0;\n T value;\n while( lineStream >> value ) ++numCols;\n if( numCols != 0 )\n {\n if( numCols != width && width != 0 )\n LogicError(\"Inconsistent number of columns\");\n else\n width = numCols;\n ++height;\n }\n }\n file.clear();\n file.seekg(0,file.beg);\n\n // Resize the matrix and then read in our local portion\n A.Resize( height, width );\n Int i=0;\n while( std::getline( file, line ) )\n {\n std::stringstream lineStream( line );\n Int j=0;\n T value;\n while( lineStream >> value )\n {\n A.Set( i, j, value );\n ++j;\n }\n ++i;\n }\n}\n\n} // namespace read\n} // namespace El\n\n#endif // ifndef EL_READ_ASCII_HPP\n", "meta": {"content_hash": "be37942c1d5e3326e29d1fc221ad11c0", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 70, "avg_line_length": 25.185897435897434, "alnum_prop": 0.5357597353016035, "repo_name": "justusc/Elemental", "id": "20defeca2c500ce2defc4edba25439911e0df067", "size": "4193", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/io/Read/Ascii.hpp", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "760573"}, {"name": "C++", "bytes": "7177017"}, {"name": "CMake", "bytes": "186926"}, {"name": "Makefile", "bytes": "333"}, {"name": "Matlab", "bytes": "13306"}, {"name": "Python", "bytes": "942707"}, {"name": "Ruby", "bytes": "1393"}, {"name": "Shell", "bytes": "1335"}, {"name": "TeX", "bytes": "23728"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>opam-website: Not compatible</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.5.0 / opam-website - 1.2.1</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n opam-website\n <small>\n 1.2.1\n <span class=\"label label-info\">Not compatible</span>\n </small>\n </h1>\n <p><em><script>document.write(moment(\"2020-06-25 03:38:52 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2020-06-25 03:38:52 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-num base Num library distributed with the OCaml compiler\nbase-threads base\nbase-unix base\ncamlp5 7.12 Preprocessor-pretty-printer of OCaml\nconf-findutils 1 Virtual package relying on findutils\ncoq 8.5.0 Formal proof management system.\nnum 0 The Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.05.0 The OCaml compiler (virtual package)\nocaml-base-compiler 4.05.0 Official 4.05.0 release\nocaml-config 1 OCaml Switch Configuration\n# opam file:\nopam-version: "2.0"\nmaintainer: "dev@clarus.me"\nhomepage: "https://github.com/clarus/coq-opam-website"\ndev-repo: "git+https://github.com/clarus/coq-opam-website.git"\nbug-reports: "https://github.com/clarus/coq-opam-website/issues"\nauthors: ["Guillaume Claret"]\nlicense: "MIT"\nbuild: [\n ["./configure.sh"]\n [make "-j%{jobs}%"]\n ["sh" "-c" "cd extraction && make"]\n]\ndepends: [\n "ocaml"\n "coq" {>= "8.4pl4"}\n "coq-io" {>= "3.1.0"}\n "coq-io-exception" {>= "1.0.0"}\n "coq-io-system" {>= "2.3.0"}\n "coq-list-string" {>= "2.1.0"}\n]\nsynopsis: "Generation of a Coq website for OPAM: http://coq.io/opam/ "\nurl {\n src: "https://github.com/coq-io/opam-website/archive/1.2.1.tar.gz"\n checksum: "md5=8456933fe4380095c46240546fb2bad1"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-opam-website.1.2.1 coq.8.5.0</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.5.0).\nThe following dependencies couldn't be met:\n - coq-opam-website -> coq-io-exception -> coq < 8.5~ -> ocaml < 4.03.0\n base of this switch (use `--unlock-base' to force)\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-opam-website.1.2.1</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n <small>Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a>. \u00a9 Guillaume Claret.</small>\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "4ab1b2b0574a85e0ef395ea1715d806f", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 157, "avg_line_length": 40.707317073170735, "alnum_prop": 0.5286099460754943, "repo_name": "coq-bench/coq-bench.github.io", "id": "5e3ef27e413adbe420b32ced99dade95ddd562ac", "size": "6678", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.6/released/8.5.0/opam-website/1.2.1.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "\n\n#include \"unix/guts.h\"\n#include \"Application.h\"\n#include \"Clipboard.h\"\n#include \"Icon.h\"\n\n#define WIN PComponent(application)-> handle\n\n#define CF_NAME(x) (guts. clipboard_formats[(x)*3])\n#define CF_TYPE(x) (guts. clipboard_formats[(x)*3+1])\n#define CF_FORMAT(x) (guts. clipboard_formats[(x)*3+2])\n#define CF_ASSIGN(i,a,b,c) CF_NAME(i)=(a);CF_TYPE(i)=(b);CF_FORMAT(i)=((Atom)c)\n#define CF_32 (sizeof(long)*8) /* 32-bit properties are hacky */\n\nBool\nprima_init_clipboard_subsystem(char * error_buf)\n{\n guts. clipboards = hash_create();\n \n if ( !(guts. clipboard_formats = malloc( cfCOUNT * 3 * sizeof(Atom)))) {\n sprintf( error_buf, \"No memory\");\n return false;\n }\n guts. clipboard_formats_count = cfCOUNT;\n#if (cfText != 0) || (cfBitmap != 1) || (cfUTF8 != 2)\n#error broken clipboard type formats\n#endif \n\n CF_ASSIGN(cfText, XA_STRING, XA_STRING, 8);\n CF_ASSIGN(cfUTF8, UTF8_STRING, UTF8_STRING, 8);\n CF_ASSIGN(cfBitmap, XA_PIXMAP, XA_PIXMAP, CF_32);\n CF_ASSIGN(cfTargets, CF_TARGETS, XA_ATOM, CF_32);\n\n /* XXX - bitmaps and indexed pixmaps may have the associated colormap or pixel values \n CF_ASSIGN(cfPalette, XA_COLORMAP, XA_ATOM, CF_32);\n CF_ASSIGN(cfForeground, CF_FOREGROUND, CF_PIXEL, CF_32);\n CF_ASSIGN(cfBackground, CF_BACKGROUND, CF_PIXEL, CF_32);\n */\n \n guts. clipboard_event_timeout = 2000;\n return true;\n}\n\nPList\napc_get_standard_clipboards( void)\n{\n PList l = plist_create( 3, 1);\n if (!l) return nil;\n list_add( l, (Handle)duplicate_string( \"Primary\"));\n list_add( l, (Handle)duplicate_string( \"Secondary\"));\n list_add( l, (Handle)duplicate_string( \"Clipboard\"));\n return l;\n}\n\nBool\napc_clipboard_create( Handle self)\n{\n PClipboard c = (PClipboard)self;\n char *name, *x;\n DEFCC;\n\n XX-> selection = None;\n \n name = x = duplicate_string( c-> name);\n while (*x) {\n *x = toupper(*x);\n x++;\n }\n XX-> selection = XInternAtom( DISP, name, false);\n free( name);\n\n if ( hash_fetch( guts.clipboards, &XX->selection, sizeof(XX->selection))) {\n warn(\"This clipboard is already present\");\n return false;\n }\n\n if ( !( XX-> internal = malloc( sizeof( ClipboardDataItem) * cfCOUNT))) {\n warn(\"Not enough memory\");\n return false;\n }\n if ( !( XX-> external = malloc( sizeof( ClipboardDataItem) * cfCOUNT))) {\n free( XX-> internal);\n warn(\"Not enough memory\");\n return false;\n }\n bzero( XX-> internal, sizeof( ClipboardDataItem) * cfCOUNT);\n bzero( XX-> external, sizeof( ClipboardDataItem) * cfCOUNT);\n\n hash_store( guts.clipboards, &XX->selection, sizeof(XX->selection), (void*)self);\n\n return true;\n}\n\nstatic void\nclipboard_free_data( void * data, int size, Handle id)\n{\n if ( size <= 0) {\n if ( size == 0 && data != nil) free( data);\n return;\n }\n if ( id == cfBitmap) {\n int i;\n Pixmap * p = (Pixmap*) data;\n for ( i = 0; i < size/sizeof(Pixmap); i++, p++)\n if ( *p)\n XFreePixmap( DISP, *p);\n }\n free( data);\n}\n\n/*\n each clipboard type can be represented by a set of \n X properties pairs, where each is X name and X type.\n get_typename() returns such pairs by the index.\n */\nstatic Atom\nget_typename( Handle id, int index, Atom * type)\n{\n if ( type) *type = None;\n switch ( id) {\n case cfUTF8:\n if ( index > 1) return None;\n if ( index == 0) {\n if ( type) *type = CF_TYPE(id);\n return CF_NAME(id);\n } else {\n if ( type) *type = UTF8_MIME;\n return UTF8_MIME;\n }\n case cfBitmap:\n if ( index > 1) return None;\n if ( index == 0) {\n if ( type) *type = CF_TYPE(id);\n\t return CF_NAME(id);\n } else {\n if ( type) *type = XA_BITMAP;\n\t return XA_BITMAP;\n }\n case cfTargets:\n if ( index > 1) return None;\n if ( index == 0) {\n if ( type) *type = CF_TYPE(id);\n return CF_NAME(id);\n } else {\n if ( type) *type = CF_TARGETS;\n return CF_NAME(id);\n }\n }\n if ( index > 0) return None;\n if ( type) *type = CF_TYPE(id);\n return CF_NAME(id);\n}\n\nstatic void\nclipboard_kill_item( PClipboardDataItem item, Handle id)\n{\n item += id;\n clipboard_free_data( item-> data, item-> size, id);\n item-> data = nil;\n item-> size = 0;\n item-> name = get_typename( id, 0, nil);\n}\n\n/*\n Deletes a transfer record from pending xfer chain.\n */\nstatic void\ndelete_xfer( PClipboardSysData cc, ClipboardXfer * xfer)\n{\n ClipboardXferKey key;\n CLIPBOARD_XFER_KEY( key, xfer-> requestor, xfer-> property);\n if ( guts. clipboard_xfers) {\n IV refcnt;\n hash_delete( guts. clipboard_xfers, key, sizeof( key), false);\n refcnt = PTR2IV( hash_fetch( guts. clipboard_xfers, &xfer-> requestor, sizeof(XWindow)));\n if ( --refcnt == 0) {\n XSelectInput( DISP, xfer-> requestor, 0);\n hash_delete( guts. clipboard_xfers, &xfer-> requestor, sizeof(XWindow), false);\n } else {\n if ( refcnt < 0) refcnt = 0;\n hash_store( guts. clipboard_xfers, &xfer-> requestor, sizeof(XWindow), INT2PTR(void*, refcnt));\n }\n }\n if ( cc-> xfers) \n list_delete( cc-> xfers, ( Handle) xfer);\n if ( xfer-> data_detached && xfer-> data_master) \n clipboard_free_data( xfer-> data, xfer-> size, xfer-> id);\n free( xfer);\n}\n\nBool\napc_clipboard_destroy( Handle self)\n{\n DEFCC;\n int i;\n\n if (XX-> selection == None) return true;\n\n if ( XX-> xfers) {\n for ( i = 0; i < XX-> xfers-> count; i++) \n delete_xfer( XX, ( ClipboardXfer*) XX-> xfers-> items[i]);\n plist_destroy( XX-> xfers);\n }\n\n for ( i = 0; i < guts. clipboard_formats_count; i++) {\n if ( XX-> external) clipboard_kill_item( XX-> external, i);\n if ( XX-> internal) clipboard_kill_item( XX-> internal, i);\n }\n\n free( XX-> external);\n free( XX-> internal);\n hash_delete( guts.clipboards, &XX->selection, sizeof(XX->selection), false);\n\n XX-> selection = None;\n return true;\n}\n\nBool\napc_clipboard_open( Handle self)\n{\n DEFCC;\n if ( XX-> opened) return false;\n XX-> opened = true;\n \n if ( !XX-> inside_event) XX-> need_write = false;\n\n return true;\n}\n\nBool\napc_clipboard_close( Handle self)\n{\n DEFCC;\n if ( !XX-> opened) return false;\n XX-> opened = false;\n\n /* check if UTF8 is present and Text is not, and downgrade */\n if ( XX-> need_write &&\n\tXX-> internal[cfUTF8]. size > 0 &&\n\tXX-> internal[cfText]. size == 0) {\n Byte * src = XX-> internal[cfUTF8]. data;\n int len = utf8_length( src, src + XX-> internal[cfUTF8]. size);\n if (( XX-> internal[cfText]. data = malloc( len))) {\n\t STRLEN charlen;\n\t U8 *dst;\n\t dst = XX-> internal[cfText]. data;\n XX-> internal[cfText]. size = len;\n\t while ( len--) {\n register UV u = \n#if PERL_PATCHLEVEL >= 16\n\t utf8_to_uvchr_buf( src, src + XX-> internal[cfUTF8]. size, &charlen);\n#else\n\t utf8_to_uvchr( src, &charlen)\n#endif\n\t ;\n\t *(dst++) = ( u < 0x7f) ? u : '?'; /* XXX employ $LANG and iconv() */\n\t src += charlen;\n\t }\n } \n }\n \n\n if ( !XX-> inside_event) {\n int i; \n for ( i = 0; i < guts. clipboard_formats_count; i++) \n clipboard_kill_item( XX-> external, i);\n if ( XX-> need_write) \n if ( XGetSelectionOwner( DISP, XX-> selection) != WIN) \n XSetSelectionOwner( DISP, XX-> selection, WIN, CurrentTime);\n }\n \n return true;\n}\n\n/*\n Detaches data for pending transfers from XX, so eventual changes \n to XX->internal would not affect them. detach_xfers() should be\n called before clipboard_kill_item(XX-> internal), otherwise\n there's a chance of coredump.\n */\nstatic void\ndetach_xfers( PClipboardSysData XX, Handle id, Bool clear_original_data)\n{\n int i, got_master = 0, got_anything = 0;\n if ( !XX-> xfers) return;\n for ( i = 0; i < XX-> xfers-> count; i++) {\n ClipboardXfer * x = ( ClipboardXfer *) XX-> xfers-> items[i];\n if ( x-> data_detached || x-> id != id) continue;\n got_anything = 1;\n if ( !got_master) {\n x-> data_master = true;\n got_master = 1;\n }\n x-> data_detached = true;\n } \n if ( got_anything && clear_original_data) {\n XX-> internal[id]. data = nil;\n XX-> internal[id]. size = 0;\n XX-> internal[id]. name = get_typename( id, 0, nil);\n }\n}\n\nBool\napc_clipboard_clear( Handle self)\n{\n DEFCC;\n int i;\n\n for ( i = 0; i < guts. clipboard_formats_count; i++) {\n detach_xfers( XX, i, true);\n clipboard_kill_item( XX-> internal, i);\n clipboard_kill_item( XX-> external, i);\n }\n \n if ( XX-> inside_event) { \n XX-> need_write = true; \n } else {\n XWindow owner = XGetSelectionOwner( DISP, XX-> selection);\n XX-> need_write = false;\n if ( owner != None && owner != WIN)\n XSetSelectionOwner( DISP, XX-> selection, None, CurrentTime);\n }\n\n return true;\n}\n\ntypedef struct {\n Atom selection;\n long mask;\n} SelectionProcData;\n\n#define SELECTION_NOTIFY_MASK 1\n#define PROPERTY_NOTIFY_MASK 2\n\nstatic int\nselection_filter( Display * disp, XEvent * ev, SelectionProcData * data)\n{\n switch ( ev-> type) {\n case PropertyNotify:\n return (data-> mask & PROPERTY_NOTIFY_MASK) && (data-> selection == ev-> xproperty. atom);\n case SelectionRequest:\n case SelectionClear:\n case MappingNotify:\n return true;\n case SelectionNotify:\n return (data-> mask & SELECTION_NOTIFY_MASK) && (data-> selection == ev-> xselection. selection);\n case ClientMessage:\n if ( ev-> xclient. window == WIN ||\n ev-> xclient. window == guts. root ||\n ev-> xclient. window == None) return true;\n if ( hash_fetch( guts.windows, (void*)&ev-> xclient. window, \n sizeof(ev-> xclient. window))) return false;\n return true;\n }\n return false;\n}\n\n#define CFDATA_NONE 0\n#define CFDATA_NOT_ACQUIRED (-1)\n#define CFDATA_ERROR (-2)\n\n#define RPS_OK 0\n#define RPS_PARTIAL 1\n#define RPS_NODATA 2\n#define RPS_ERROR 3\n\nstatic int\nread_property( Atom property, Atom * type, int * format, \n unsigned long * size, unsigned char ** data)\n{\n int ret = ( *size > 0) ? RPS_PARTIAL : RPS_ERROR;\n unsigned char * prop, *a1;\n unsigned long n, left, offs = 0, new_size, big_offs = *size;\n\n XCHECKPOINT;\n Cdebug(\"clipboard: read_property: %s\\n\", XGetAtomName(DISP, property));\n while ( 1) {\n if ( XGetWindowProperty( DISP, WIN, property,\n offs, guts. limits. request_length - 4, false, \n AnyPropertyType, \n type, format, &n, &left, &prop) != Success) {\n XDeleteProperty( DISP, WIN, property);\n\t Cdebug(\"clipboard:fail\\n\");\n return ret;\n }\n XCHECKPOINT;\n Cdebug(\"clipboard: type=0x%x(%s) fmt=%d n=%d left=%d\\n\", \n\t *type, XGetAtomName(DISP,*type), *format, n, left);\n \n if ( *format == 32) *format = CF_32;\n\n if ( *type == 0 ) return RPS_NODATA;\n\n new_size = n * *format / 8;\n\n if ( new_size > 0) {\n if ( !( a1 = realloc( *data, big_offs + offs * 4 + new_size))) {\n warn(\"Not enough memory: %ld bytes\\n\", offs * 4 + new_size);\n XDeleteProperty( DISP, WIN, property);\n XFree( prop);\n return ret;\n }\n *data = a1;\n memcpy( *data + big_offs + offs * 4, prop, new_size);\n *size = big_offs + (offs * 4) + new_size;\n if ( *size > INT_MAX) *size = INT_MAX;\n offs += new_size / 4;\n ret = RPS_PARTIAL;\n }\n XFree( prop);\n if ( left <= 0 || *size == INT_MAX || n * *format == 0) break;\n }\n\n XDeleteProperty( DISP, WIN, property);\n XCHECKPOINT;\n\n return RPS_OK;\n}\n\nstatic Bool\nquery_datum( Handle self, Handle id, Atom query_target, Atom query_type)\n{\n DEFCC;\n XEvent ev;\n Atom type;\n int format, rps;\n SelectionProcData spd;\n unsigned long size = 0, incr = 0, old_size, delay;\n unsigned char * data;\n struct timeval start_time, timeout;\n \n /* init */\n if ( query_target == None) return false;\n data = malloc(0);\n XX-> external[id]. size = CFDATA_ERROR;\n gettimeofday( &start_time, nil);\n XCHECKPOINT;\n Cdebug(\"clipboard:convert %s from %08x\\n\", XGetAtomName( DISP, query_target), WIN);\n XDeleteProperty( DISP, WIN, XX-> selection);\n XConvertSelection( DISP, XX-> selection, query_target, XX-> selection, WIN, guts. last_time);\n XFlush( DISP);\n XCHECKPOINT;\n\n /* wait for SelectionNotify */\n spd. selection = XX-> selection;\n spd. mask = SELECTION_NOTIFY_MASK;\n while ( 1) {\n XIfEvent( DISP, &ev, (XIfEventProcType)selection_filter, (char*)&spd);\n if ( ev. type != SelectionNotify) {\n prima_handle_event( &ev, nil);\n continue;\n }\n if ( ev. xselection. property == None) goto FAIL;\n Cdebug(\"clipboard:read SelectionNotify %s %s\\n\",\n XGetAtomName(DISP, ev. xselection. property),\n XGetAtomName(DISP, ev. xselection. target));\n gettimeofday( &timeout, nil);\n delay = 2 * (( timeout. tv_sec - start_time. tv_sec) * 1000 + \n ( timeout. tv_usec - start_time. tv_usec) / 1000) + guts. clipboard_event_timeout;\n start_time = timeout;\n if ( read_property( ev. xselection. property, &type, &format, &size, &data) > RPS_PARTIAL) \n goto FAIL;\n XFlush( DISP);\n break;\n }\n XCHECKPOINT;\n\n if ( type != XA_INCR) { /* ordinary, single-property selection */\n if ( format != CF_FORMAT(id) || type != query_type) {\n\t if ( format != CF_FORMAT(id)) \n\t Cdebug(\"clipboard: id=%d: formats mismatch: got %d, want %d\\n\", id, format, CF_FORMAT(id));\n\t if ( type != query_type) \n\t Cdebug(\"clipboard: id=%d: types mismatch: got %s, want %s\\n\", id,\n\t\t XGetAtomName(DISP,type), XGetAtomName(DISP,query_type));\n\t return false;\n }\n XX-> external[id]. size = size;\n XX-> external[id]. data = data;\n XX-> external[id]. name = query_target;\n return true;\n }\n\n /* setup INCR */\n if ( format != CF_32 || size < 4) goto FAIL;\n incr = (unsigned long) *(( Atom*) data);\n if ( incr == 0) goto FAIL;\n size = 0;\n spd. mask = PROPERTY_NOTIFY_MASK;\n\n while ( 1) {\n /* wait for PropertyNotify */ \n while ( XCheckIfEvent( DISP, &ev, (XIfEventProcType)selection_filter, (char*)&spd) == False) {\n gettimeofday( &timeout, nil);\n if ((( timeout. tv_sec - start_time. tv_sec) * 1000 + \n ( timeout. tv_usec - start_time. tv_usec) / 1000) > delay) \n goto END_LOOP;\n }\n if ( ev. type != PropertyNotify) {\n prima_handle_event( &ev, nil);\n continue;\n }\n if ( ev. xproperty. state != PropertyNewValue) continue;\n start_time = timeout;\n old_size = size;\n\n rps = read_property( ev. xproperty. atom, &type, &format, &size, &data);\n XFlush( DISP);\n if ( rps == RPS_NODATA) continue;\n if ( rps == RPS_ERROR) goto FAIL; \n if ( format != CF_FORMAT(id) || type != CF_TYPE(id)) return false;\n if ( size > incr || /* read all in INCR */\n rps == RPS_PARTIAL || /* failed somewhere */\n ( size == incr && old_size == size) /* wait for empty PropertyNotify otherwise */\n ) break;\n }\nEND_LOOP:\n XCHECKPOINT;\n\n XX-> external[id]. size = size;\n XX-> external[id]. data = data;\n XX-> external[id]. name = query_target;\n return true;\n \nFAIL:\n XCHECKPOINT;\n free( data);\n return false;\n}\n\n\nstatic Bool\nquery_data( Handle self, Handle id)\n{\n Atom name, type;\n int index = 0;\n while (( name = get_typename( id, index++, &type)) != None) {\n if ( query_datum( self, id, name, type)) return true;\n }\n return false;\n}\n\nstatic Atom\nfind_atoms( Atom * data, int length, int id)\n{\n int i, index = 0;\n Atom name;\n \n while (( name = get_typename( id, index++, nil)) != None) {\n for ( i = 0; i < length / sizeof(Atom); i++) {\n if ( data[i] == name) \n return name;\n }\n }\n return None;\n}\n\n\nBool\napc_clipboard_has_format( Handle self, Handle id)\n{\n DEFCC;\n if ( id < 0 || id >= guts. clipboard_formats_count) return false;\n\n if ( XX-> inside_event) {\n return XX-> internal[id]. size > 0 || XX-> external[id]. size > 0;\n } else {\n if ( XX-> internal[id]. size > 0) return true;\n\n if ( XX-> external[cfTargets]. size == 0) {\n /* read TARGETS, which as array of ATOMs */\n query_data( self, cfTargets);\n\n if ( XX-> external[cfTargets].size > 0) {\n int i, size = XX-> external[cfTargets].size;\n Atom * data = ( Atom*)(XX-> external[cfTargets]. data);\n Atom ret;\n\n \n Cdebug(\"clipboard targets:\");\n for ( i = 0; i < size/4; i++) \n Cdebug(\"%s\\n\", XGetAtomName( DISP, data[i]));\n\n /* find our index for TARGETS[i], assign CFDATA_NOT_ACQUIRED to it */\n for ( i = 0; i < guts. clipboard_formats_count; i++) {\n if ( i == cfTargets) continue;\n ret = find_atoms( data, size, i);\n if ( ret != None && (\n XX-> external[i]. size == 0 ||\n XX-> external[i]. size == CFDATA_ERROR\n )\n ) { \n XX-> external[i]. size = CFDATA_NOT_ACQUIRED;\n XX-> external[i]. name = ret;\n }\n }\n\n if ( XX-> external[id]. size == 0 || \n XX-> external[id]. size == CFDATA_ERROR)\n return false;\n }\n }\n \n if ( XX-> external[id]. size > 0 || \n XX-> external[id]. size == CFDATA_NOT_ACQUIRED)\n return true;\n\n if ( XX-> external[id]. size == CFDATA_ERROR) \n return false;\n\n /* selection owner does not support TARGETS, so peek */\n if ( XX-> external[cfTargets]. size == 0 && XX-> internal[id]. size == 0)\n return query_data( self, id);\n }\n return false;\n}\n\nBool\napc_clipboard_get_data( Handle self, Handle id, PClipboardDataRec c)\n{\n DEFCC;\n STRLEN size;\n unsigned char * data;\n Atom name;\n\n if ( id < 0 || id >= guts. clipboard_formats_count) return false;\n\n if ( !XX-> inside_event) {\n if ( XX-> internal[id]. size == 0) {\n if ( XX-> external[id]. size == CFDATA_NOT_ACQUIRED) {\n if ( !query_data( self, id)) return false;\n }\n if ( XX-> external[id]. size == CFDATA_ERROR) return false;\n }\n }\n if ( XX-> internal[id]. size == CFDATA_ERROR) return false;\n\n if ( XX-> internal[id]. size > 0) {\n size = XX-> internal[id]. size;\n data = XX-> internal[id]. data;\n name = XX-> internal[id]. name;\n } else {\n size = XX-> external[id]. size;\n data = XX-> external[id]. data;\n name = XX-> external[id]. name;\n }\n if ( size == 0 || data == nil) return false;\n\n switch ( id) {\n case cfBitmap: {\n Handle img = c-> image; \n XWindow foo;\n Pixmap px = *(( Pixmap*)( data));\n unsigned int dummy, x, y, d;\n int bar;\n \n if ( !XGetGeometry( DISP, px, &foo, &bar, &bar, &x, &y, &dummy, &d))\n return false;\n CImage( img)-> create_empty( img, x, y, ( d == 1) ? imBW : guts. qdepth);\n if ( !prima_std_query_image( img, px)) return false;\n break;}\n case cfText:\n case cfUTF8: {\n void * ret = malloc( size);\n if ( !ret) {\n warn(\"Not enough memory: %d bytes\\n\", (int)size);\n return false;\n }\n memcpy( ret, data, size);\n c-> data = ret;\n c-> length = size;\n break;}\n default: {\n void * ret = malloc( size);\n if ( !ret) {\n warn(\"Not enough memory: %d bytes\\n\", (int)size);\n return false;\n }\n memcpy( ret, data, size);\n c-> data = ( Byte * ) ret;\n c-> length = size;\n break;}\n }\n return true;\n}\n\nBool\napc_clipboard_set_data( Handle self, Handle id, PClipboardDataRec c)\n{\n DEFCC;\n if ( id < 0 || id >= guts. clipboard_formats_count) return false;\n\n if ( id >= cfTargets && id < cfCOUNT ) return false;\n detach_xfers( XX, id, true);\n clipboard_kill_item( XX-> internal, id);\n\n switch ( id) {\n case cfBitmap: { \n Pixmap px = prima_std_pixmap( c-> image, CACHE_LOW_RES);\n if ( px) {\n if ( !( XX-> internal[cfBitmap]. data = malloc( sizeof( px)))) {\n XFreePixmap( DISP, px);\n return false;\n }\n XX-> internal[cfBitmap]. size = sizeof(px);\n memcpy( XX-> internal[cfBitmap]. data, &px, sizeof(px));\n } else\n return false;\n break;}\n default:\n if ( !( XX-> internal[id]. data = malloc( c-> length))) \n return false;\n XX-> internal[id]. size = c-> length;\n memcpy( XX-> internal[id]. data, c-> data, c-> length);\n break;\n }\n XX-> need_write = true; \n return true;\n}\n\nstatic Bool\nexpand_clipboards( Handle self, int keyLen, void * key, void * dummy)\n{\n DEFCC;\n PClipboardDataItem f;\n\n if ( !( f = realloc( XX-> internal, \n sizeof( ClipboardDataItem) * guts. clipboard_formats_count))) {\n guts. clipboard_formats_count--;\n return true;\n }\n f[ guts. clipboard_formats_count-1].size = 0;\n f[ guts. clipboard_formats_count-1].data = nil;\n f[ guts. clipboard_formats_count-1].name = CF_NAME(guts. clipboard_formats_count-1);\n XX-> internal = f;\n if ( !( f = realloc( XX-> external, \n sizeof( ClipboardDataItem) * guts. clipboard_formats_count))) {\n guts. clipboard_formats_count--;\n return true;\n }\n f[ guts. clipboard_formats_count-1].size = 0;\n f[ guts. clipboard_formats_count-1].data = nil;\n f[ guts. clipboard_formats_count-1].name = CF_NAME(guts. clipboard_formats_count-1);\n XX-> external = f;\n return false;\n}\n\nHandle\napc_clipboard_register_format( Handle self, const char* format)\n{\n int i;\n Atom x = XInternAtom( DISP, format, false);\n Atom *f;\n\n for ( i = 0; i < guts. clipboard_formats_count; i++) {\n if ( x == CF_NAME(i)) \n return i;\n }\n\n if ( !( f = realloc( guts. clipboard_formats, \n sizeof( Atom) * 3 * ( guts. clipboard_formats_count + 1)))) \n return false;\n \n guts. clipboard_formats = f;\n CF_ASSIGN( guts. clipboard_formats_count, x, x, 8); \n guts. clipboard_formats_count++;\n\n if ( hash_first_that( guts. clipboards, (void*)expand_clipboards, nil, nil, nil))\n return -1;\n\n return guts. clipboard_formats_count - 1;\n}\n\nBool\napc_clipboard_deregister_format( Handle self, Handle id)\n{\n return true;\n}\n\nApiHandle\napc_clipboard_get_handle( Handle self)\n{\n return C(self)-> selection;\n}\n\nstatic Bool\ndelete_xfers( Handle self, int keyLen, void * key, XWindow * window)\n{\n DEFCC;\n if ( XX-> xfers) {\n int i;\n for ( i = 0; i < XX-> xfers-> count; i++) \n delete_xfer( XX, ( ClipboardXfer*) XX-> xfers-> items[i]); \n }\n hash_delete( guts. clipboard_xfers, window, sizeof( XWindow), false);\n return false; \n}\n\nvoid\nprima_handle_selection_event( XEvent *ev, XWindow win, Handle self)\n{\n XCHECKPOINT;\n switch ( ev-> type) {\n case SelectionRequest: {\n XEvent xe;\n int i, id = -1;\n Atom prop = ev-> xselectionrequest. property,\n target = ev-> xselectionrequest. target;\n self = ( Handle) hash_fetch( guts. clipboards, &ev-> xselectionrequest. selection, sizeof( Atom)); \n\n guts. last_time = ev-> xselectionrequest. time;\n xe. type = SelectionNotify;\n xe. xselection. send_event = true;\n xe. xselection. serial = ev-> xselectionrequest. serial;\n xe. xselection. display = ev-> xselectionrequest. display;\n xe. xselection. requestor = ev-> xselectionrequest. requestor;\n xe. xselection. selection = ev-> xselectionrequest. selection;\n xe. xselection. target = target;\n xe. xselection. property = None;\n xe. xselection. time = ev-> xselectionrequest. time;\n \n Cdebug(\"from %08x %s at %s\\n\", ev-> xselectionrequest. requestor, \n XGetAtomName( DISP, ev-> xselectionrequest. target),\n XGetAtomName( DISP, ev-> xselectionrequest. property)\n );\n\n if ( self) { \n PClipboardSysData CC = C(self);\n Bool event = CC-> inside_event;\n int format, utf8_mime = 0;\n\n for ( i = 0; i < guts. clipboard_formats_count; i++) {\n if ( xe. xselection. target == CC-> internal[i]. name) {\n id = i;\n break;\n } else if ( i == cfUTF8 && xe. xselection. target == UTF8_MIME) {\n id = i;\n utf8_mime = 1;\n break;\n }\n }\n if ( id < 0) goto SEND_EMPTY;\n for ( i = 0; i < guts. clipboard_formats_count; i++)\n clipboard_kill_item( CC-> external, i);\n \n CC-> target = xe. xselection. target;\n CC-> need_write = false;\n \n CC-> inside_event = true;\n /* XXX cmSelection */\n CC-> inside_event = event;\n\n format = CF_FORMAT(id);\n target = CF_TYPE( id);\n if ( utf8_mime) target = UTF8_MIME;\n\n if ( id == cfTargets) { \n int count = 0, have_utf8 = 0;\n Atom * ci;\n for ( i = 0; i < guts. clipboard_formats_count; i++) {\n if ( i != cfTargets && CC-> internal[i]. size > 0) {\n count++;\n\t\t if ( i == cfUTF8) {\n\t\t count++;\n\t\t have_utf8 = 1;\n\t\t }\n\t }\n\t }\n detach_xfers( CC, cfTargets, true);\n clipboard_kill_item( CC-> internal, cfTargets);\n if (( CC-> internal[cfTargets]. data = malloc( count * sizeof( Atom)))) {\n CC-> internal[cfTargets]. size = count * sizeof( Atom);\n ci = (Atom*)CC-> internal[cfTargets]. data;\n for ( i = 0; i < guts. clipboard_formats_count; i++) \n if ( i != cfTargets && CC-> internal[i]. size > 0) \n *(ci++) = CF_NAME(i);\n if ( have_utf8) \n\t\t *(ci++) = UTF8_MIME;\n }\n }\n \n if ( CC-> internal[id]. size > 0) {\n Atom incr;\n int mode = PropModeReplace;\n unsigned char * data = CC-> internal[id]. data;\n unsigned long size = CC-> internal[id]. size * 8 / format;\n if ( CC-> internal[id]. size > guts. limits. request_length - 4) {\n int ok = 0;\n int reqlen = guts. limits. request_length - 4;\n /* INCR */\n if ( !guts. clipboard_xfers)\n guts. clipboard_xfers = hash_create();\n if ( !CC-> xfers) \n CC-> xfers = plist_create( 1, 1);\n if ( CC-> xfers && guts. clipboard_xfers) {\n ClipboardXfer * x = malloc( sizeof( ClipboardXfer));\n if ( x) {\n IV refcnt;\n ClipboardXferKey key;\n \n bzero( x, sizeof( ClipboardXfer));\n list_add( CC-> xfers, ( Handle) x);\n x-> size = CC-> internal[id]. size;\n x-> data = CC-> internal[id]. data;\n x-> blocks = ( x-> size / reqlen ) + ( x-> size % reqlen) ? 1 : 0;\n x-> requestor = xe. xselection. requestor;\n x-> property = prop;\n x-> target = xe. xselection. target;\n x-> self = self;\n x-> format = format;\n x-> id = id;\n gettimeofday( &x-> time, nil);\n\n CLIPBOARD_XFER_KEY( key, x-> requestor, x-> property);\n hash_store( guts. clipboard_xfers, key, sizeof(key), (void*) x);\n refcnt = PTR2IV( hash_fetch( guts. clipboard_xfers, &x-> requestor, sizeof( XWindow)));\n if ( refcnt++ == 0)\n XSelectInput( DISP, x-> requestor, PropertyChangeMask|StructureNotifyMask); \n hash_store( guts. clipboard_xfers, &x-> requestor, sizeof(XWindow), INT2PTR( void*, refcnt));\n\n format = CF_32;\n size = 1;\n incr = ( Atom) CC-> internal[id]. size;\n data = ( unsigned char*) &incr; \n ok = 1;\n target = XA_INCR;\n Cdebug(\"clpboard: init INCR for %08x %d\\n\", x-> requestor, x-> property);\n }\n }\n if ( !ok) size = reqlen;\n }\n\n if ( format == CF_32) format = 32;\n XChangeProperty( \n xe. xselection. display,\n xe. xselection. requestor,\n prop, target, format, mode, data, size);\n Cdebug(\"clipboard: store prop %s\\n\", XGetAtomName( DISP, prop));\n xe. xselection. property = prop;\n }\n\n /* content of PIXMAP or BITMAP is seemingly gets invalidated\n after the selection transfer, unlike the string data format */\n if ( id == cfBitmap) {\n bzero( CC-> internal[id].data, CC-> internal[id].size);\n bzero( CC-> external[id].data, CC-> external[id].size);\n clipboard_kill_item( CC-> internal, id);\n clipboard_kill_item( CC-> external, id);\n }\n }\nSEND_EMPTY:\n XSendEvent( xe.xselection.display, xe.xselection.requestor, false, 0, &xe);\n XFlush( DISP);\n Cdebug(\"clipboard:id %d, SelectionNotify to %08x , %s %s\\n\", id, xe.xselection.requestor, \n XGetAtomName( DISP, xe. xselection. property),\n XGetAtomName( DISP, xe. xselection. target)); \n } break;\n case SelectionClear: \n guts. last_time = ev-> xselectionclear. time;\n if ( XGetSelectionOwner( DISP, ev-> xselectionclear. selection) != WIN) {\n Handle c = ( Handle) hash_fetch( guts. clipboards, \n &ev-> xselectionclear. selection, sizeof( Atom)); \n guts. last_time = ev-> xselectionclear. time;\n if (c) {\n int i;\n C(c)-> selection_owner = nilHandle; \n for ( i = 0; i < guts. clipboard_formats_count; i++) {\n detach_xfers( C(c), i, true);\n clipboard_kill_item( C(c)-> external, i);\n clipboard_kill_item( C(c)-> internal, i);\n }\n }\n } \n break;\n case PropertyNotify:\n if ( ev-> xproperty. state == PropertyDelete) {\n unsigned long offs, size, reqlen = guts. limits. request_length - 4, format;\n ClipboardXfer * x = ( ClipboardXfer *) self;\n PClipboardSysData CC = C(x-> self);\n offs = x-> offset * reqlen;\n if ( offs >= x-> size) { /* clear termination */\n size = 0; \n offs = 0;\n } else {\n size = x-> size - offs;\n if ( size > reqlen) size = reqlen;\n }\n Cdebug(\"clipboard: put %d %d in %08x %d\\n\", x-> offset, size, x-> requestor, x-> property); \n if ( x-> format > 8) size /= 2;\n if ( x-> format > 16) size /= 2;\n\t format = ( x-> format == CF_32) ? 32 : x-> format;\n XChangeProperty( DISP, x-> requestor, x-> property, x-> target,\n format, PropModeReplace, \n x-> data + offs, size);\n XFlush( DISP);\n x-> offset++;\n if ( size == 0) delete_xfer( CC, x);\n }\n break;\n case DestroyNotify:\n Cdebug(\"clipboard: destroy xfers at %08x\\n\", ev-> xdestroywindow. window);\n hash_first_that( guts. clipboards, (void*)delete_xfers, (void*) &ev-> xdestroywindow. window, nil, nil);\n XFlush( DISP);\n break;\n }\n XCHECKPOINT;\n}\n\n", "meta": {"content_hash": "b524844abd8f17aad1bb619d75502ef3", "timestamp": "", "source": "github", "line_count": 1008, "max_line_length": 114, "avg_line_length": 31.44047619047619, "alnum_prop": 0.541713997223274, "repo_name": "run4flat/Primo", "id": "2131edac613fcff0a4faf7d06534c35e2f2a0cc8", "size": "33097", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "unix/apc_clipboard.c", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Apex", "bytes": "56518"}, {"name": "C", "bytes": "1660328"}, {"name": "Perl", "bytes": "268749"}]}} +{"text": "\n\npackage scaleio\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"k8s.io/klog/v2\"\n\t\"k8s.io/mount-utils\"\n\tutilstrings \"k8s.io/utils/strings\"\n\n\tapi \"k8s.io/api/core/v1\"\n\t\"k8s.io/apimachinery/pkg/api/resource\"\n\tmeta \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n\t\"k8s.io/apimachinery/pkg/types\"\n\t\"k8s.io/apimachinery/pkg/util/uuid\"\n\tvolumehelpers \"k8s.io/cloud-provider/volume/helpers\"\n\t\"k8s.io/kubernetes/pkg/volume\"\n\t\"k8s.io/kubernetes/pkg/volume/util\"\n)\n\ntype sioVolume struct {\n\tsioMgr *sioMgr\n\tplugin *sioPlugin\n\tpod *api.Pod\n\tpodUID types.UID\n\tspec *volume.Spec\n\tsecretName string\n\tsecretNamespace string\n\tvolSpecName string\n\tvolName string\n\treadOnly bool\n\tfsType string\n\toptions volume.VolumeOptions\n\tconfigData map[string]string\n\n\tvolume.MetricsNil\n}\n\nconst (\n\tminimumVolumeSizeGiB = 8\n)\n\n// *******************\n// volume.Volume Impl\nvar _ volume.Volume = &sioVolume{}\n\n// GetPath returns the path where the volume will be mounted.\nfunc (v *sioVolume) GetPath() string {\n\treturn v.plugin.host.GetPodVolumeDir(\n\t\tv.podUID,\n\t\tutilstrings.EscapeQualifiedName(sioPluginName),\n\t\tv.volSpecName)\n}\n\n// *************\n// Mounter Impl\n// *************\nvar _ volume.Mounter = &sioVolume{}\n\n// CanMount checks to verify that the volume can be mounted prior to Setup.\n// A nil error indicates that the volume is ready for mounitnig.\nfunc (v *sioVolume) CanMount() error {\n\treturn nil\n}\n\nfunc (v *sioVolume) SetUp(mounterArgs volume.MounterArgs) error {\n\treturn v.SetUpAt(v.GetPath(), mounterArgs)\n}\n\n// SetUp bind mounts the disk global mount to the volume path.\nfunc (v *sioVolume) SetUpAt(dir string, mounterArgs volume.MounterArgs) error {\n\tv.plugin.volumeMtx.LockKey(v.volSpecName)\n\tdefer v.plugin.volumeMtx.UnlockKey(v.volSpecName)\n\n\tklog.V(4).Info(log(\"setting up volume for PV.spec %s\", v.volSpecName))\n\tif err := v.setSioMgr(); err != nil {\n\t\tklog.Error(log(\"setup failed to create scalio manager: %v\", err))\n\t\treturn err\n\t}\n\n\tmounter := v.plugin.host.GetMounter(v.plugin.GetPluginName())\n\tnotDevMnt, err := mounter.IsLikelyNotMountPoint(dir)\n\tif err != nil && !os.IsNotExist(err) {\n\t\tklog.Error(log(\"IsLikelyNotMountPoint test failed for dir %v\", dir))\n\t\treturn err\n\t}\n\tif !notDevMnt {\n\t\tklog.V(4).Info(log(\"skipping setup, dir %s already a mount point\", v.volName))\n\t\treturn nil\n\t}\n\n\t// should multiple-mapping be enabled\n\tenableMultiMaps := false\n\tisROM := false\n\tif v.spec.PersistentVolume != nil {\n\t\tams := v.spec.PersistentVolume.Spec.AccessModes\n\t\tfor _, am := range ams {\n\t\t\tif am == api.ReadOnlyMany {\n\t\t\t\tenableMultiMaps = true\n\t\t\t\tisROM = true\n\t\t\t}\n\t\t}\n\t}\n\tklog.V(4).Info(log(\"multiple mapping enabled = %v\", enableMultiMaps))\n\n\tvolName := v.volName\n\tdevicePath, err := v.sioMgr.AttachVolume(volName, enableMultiMaps)\n\tif err != nil {\n\t\tklog.Error(log(\"setup of volume %v: %v\", v.volSpecName, err))\n\t\treturn err\n\t}\n\toptions := []string{}\n\tswitch {\n\tdefault:\n\t\toptions = append(options, \"rw\")\n\tcase isROM && !v.readOnly:\n\t\toptions = append(options, \"rw\")\n\tcase isROM:\n\t\toptions = append(options, \"ro\")\n\tcase v.readOnly:\n\t\toptions = append(options, \"ro\")\n\t}\n\n\tklog.V(4).Info(log(\"mounting device %s -> %s\", devicePath, dir))\n\tif err := os.MkdirAll(dir, 0750); err != nil {\n\t\tklog.Error(log(\"failed to create dir %#v: %v\", dir, err))\n\t\treturn err\n\t}\n\tklog.V(4).Info(log(\"setup created mount point directory %s\", dir))\n\n\tdiskMounter := util.NewSafeFormatAndMountFromHost(v.plugin.GetPluginName(), v.plugin.host)\n\terr = diskMounter.FormatAndMount(devicePath, dir, v.fsType, options)\n\n\tif err != nil {\n\t\tklog.Error(log(\"mount operation failed during setup: %v\", err))\n\t\tif err := os.Remove(dir); err != nil && !os.IsNotExist(err) {\n\t\t\tklog.Error(log(\"failed to remove dir %s during a failed mount at setup: %v\", dir, err))\n\t\t\treturn err\n\t\t}\n\t\treturn err\n\t}\n\n\tif !v.readOnly && mounterArgs.FsGroup != nil {\n\t\tklog.V(4).Info(log(\"applying value FSGroup ownership\"))\n\t\tvolume.SetVolumeOwnership(v, mounterArgs.FsGroup, mounterArgs.FSGroupChangePolicy, util.FSGroupCompleteHook(v.plugin.GetPluginName()))\n\t}\n\n\tklog.V(4).Info(log(\"successfully setup PV %s: volume %s mapped as %s mounted at %s\", v.volSpecName, v.volName, devicePath, dir))\n\treturn nil\n}\n\nfunc (v *sioVolume) GetAttributes() volume.Attributes {\n\treturn volume.Attributes{\n\t\tReadOnly: v.readOnly,\n\t\tManaged: !v.readOnly,\n\t\tSupportsSELinux: true,\n\t}\n}\n\n// **********************\n// volume.Unmounter Impl\n// *********************\nvar _ volume.Unmounter = &sioVolume{}\n\n// TearDownAt unmounts the bind mount\nfunc (v *sioVolume) TearDown() error {\n\treturn v.TearDownAt(v.GetPath())\n}\n\n// TearDown unmounts and remove the volume\nfunc (v *sioVolume) TearDownAt(dir string) error {\n\tv.plugin.volumeMtx.LockKey(v.volSpecName)\n\tdefer v.plugin.volumeMtx.UnlockKey(v.volSpecName)\n\n\tmounter := v.plugin.host.GetMounter(v.plugin.GetPluginName())\n\tdev, _, err := mount.GetDeviceNameFromMount(mounter, dir)\n\tif err != nil {\n\t\tklog.Errorf(log(\"failed to get reference count for volume: %s\", dir))\n\t\treturn err\n\t}\n\n\tklog.V(4).Info(log(\"attempting to unmount %s\", dir))\n\tif err := mount.CleanupMountPoint(dir, mounter, false); err != nil {\n\t\tklog.Error(log(\"teardown failed while unmounting dir %s: %v \", dir, err))\n\t\treturn err\n\t}\n\tklog.V(4).Info(log(\"dir %s unmounted successfully\", dir))\n\n\t// detach/unmap\n\tkvh, ok := v.plugin.host.(volume.KubeletVolumeHost)\n\tif !ok {\n\t\treturn fmt.Errorf(\"plugin volume host does not implement KubeletVolumeHost interface\")\n\t}\n\thu := kvh.GetHostUtil()\n\tdeviceBusy, err := hu.DeviceOpened(dev)\n\tif err != nil {\n\t\tklog.Error(log(\"teardown unable to get status for device %s: %v\", dev, err))\n\t\treturn err\n\t}\n\n\t// Detach volume from node:\n\t// use \"last attempt wins\" strategy to detach volume from node\n\t// only allow volume to detach when it is not busy (not being used by other pods)\n\tif !deviceBusy {\n\t\tklog.V(4).Info(log(\"teardown is attempting to detach/unmap volume for PV %s\", v.volSpecName))\n\t\tif err := v.resetSioMgr(); err != nil {\n\t\t\tklog.Error(log(\"teardown failed, unable to reset scalio mgr: %v\", err))\n\t\t}\n\t\tvolName := v.volName\n\t\tif err := v.sioMgr.DetachVolume(volName); err != nil {\n\t\t\tklog.Warning(log(\"warning: detaching failed for volume %s: %v\", volName, err))\n\t\t\treturn nil\n\t\t}\n\t\tklog.V(4).Infof(log(\"teardown of volume %v detached successfully\", volName))\n\t}\n\treturn nil\n}\n\n// ********************\n// volume.Deleter Impl\n// ********************\nvar _ volume.Deleter = &sioVolume{}\n\nfunc (v *sioVolume) Delete() error {\n\tklog.V(4).Info(log(\"deleting pvc %s\", v.volSpecName))\n\n\tif err := v.setSioMgrFromSpec(); err != nil {\n\t\tklog.Error(log(\"delete failed while setting sio manager: %v\", err))\n\t\treturn err\n\t}\n\n\terr := v.sioMgr.DeleteVolume(v.volName)\n\tif err != nil {\n\t\tklog.Error(log(\"failed to delete volume %s: %v\", v.volName, err))\n\t\treturn err\n\t}\n\n\tklog.V(4).Info(log(\"successfully deleted PV %s with volume %s\", v.volSpecName, v.volName))\n\treturn nil\n}\n\n// ************************\n// volume.Provisioner Impl\n// ************************\nvar _ volume.Provisioner = &sioVolume{}\n\nfunc (v *sioVolume) Provision(selectedNode *api.Node, allowedTopologies []api.TopologySelectorTerm) (*api.PersistentVolume, error) {\n\tklog.V(4).Info(log(\"attempting to dynamically provision pvc %v\", v.options.PVC.Name))\n\n\tif !util.AccessModesContainedInAll(v.plugin.GetAccessModes(), v.options.PVC.Spec.AccessModes) {\n\t\treturn nil, fmt.Errorf(\"invalid AccessModes %v: only AccessModes %v are supported\", v.options.PVC.Spec.AccessModes, v.plugin.GetAccessModes())\n\t}\n\n\tif util.CheckPersistentVolumeClaimModeBlock(v.options.PVC) {\n\t\treturn nil, fmt.Errorf(\"%s does not support block volume provisioning\", v.plugin.GetPluginName())\n\t}\n\n\t// setup volume attrributes\n\tgenName := v.generateName(\"k8svol\", 11)\n\n\tcapacity := v.options.PVC.Spec.Resources.Requests[api.ResourceName(api.ResourceStorage)]\n\n\tvolSizeGiB, err := volumehelpers.RoundUpToGiB(capacity)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif volSizeGiB < minimumVolumeSizeGiB {\n\t\tvolSizeGiB = minimumVolumeSizeGiB\n\t\tklog.V(4).Info(log(\"capacity less than 8Gi found, adjusted to %dGi\", volSizeGiB))\n\n\t}\n\n\t// create sio manager\n\tif err := v.setSioMgrFromConfig(); err != nil {\n\t\tklog.Error(log(\"provision failed while setting up sio mgr: %v\", err))\n\t\treturn nil, err\n\t}\n\n\t// create volume\n\tvolName := genName\n\tvol, err := v.sioMgr.CreateVolume(volName, volSizeGiB)\n\tif err != nil {\n\t\tklog.Error(log(\"provision failed while creating volume: %v\", err))\n\t\treturn nil, err\n\t}\n\n\t// prepare data for pv\n\tv.configData[confKey.volumeName] = volName\n\tsslEnabled, err := strconv.ParseBool(v.configData[confKey.sslEnabled])\n\tif err != nil {\n\t\tklog.Warning(log(\"failed to parse parameter sslEnabled, setting to false\"))\n\t\tsslEnabled = false\n\t}\n\treadOnly, err := strconv.ParseBool(v.configData[confKey.readOnly])\n\tif err != nil {\n\t\tklog.Warning(log(\"failed to parse parameter readOnly, setting it to false\"))\n\t\treadOnly = false\n\t}\n\n\t// describe created pv\n\tpvName := genName\n\tpv := &api.PersistentVolume{\n\t\tObjectMeta: meta.ObjectMeta{\n\t\t\tName: pvName,\n\t\t\tNamespace: v.options.PVC.Namespace,\n\t\t\tLabels: map[string]string{},\n\t\t\tAnnotations: map[string]string{\n\t\t\t\tutil.VolumeDynamicallyCreatedByKey: \"scaleio-dynamic-provisioner\",\n\t\t\t},\n\t\t},\n\t\tSpec: api.PersistentVolumeSpec{\n\t\t\tPersistentVolumeReclaimPolicy: v.options.PersistentVolumeReclaimPolicy,\n\t\t\tAccessModes: v.options.PVC.Spec.AccessModes,\n\t\t\tCapacity: api.ResourceList{\n\t\t\t\tapi.ResourceName(api.ResourceStorage): resource.MustParse(\n\t\t\t\t\tfmt.Sprintf(\"%dGi\", volSizeGiB),\n\t\t\t\t),\n\t\t\t},\n\t\t\tPersistentVolumeSource: api.PersistentVolumeSource{\n\t\t\t\tScaleIO: &api.ScaleIOPersistentVolumeSource{\n\t\t\t\t\tGateway: v.configData[confKey.gateway],\n\t\t\t\t\tSSLEnabled: sslEnabled,\n\t\t\t\t\tSecretRef: &api.SecretReference{Name: v.secretName, Namespace: v.secretNamespace},\n\t\t\t\t\tSystem: v.configData[confKey.system],\n\t\t\t\t\tProtectionDomain: v.configData[confKey.protectionDomain],\n\t\t\t\t\tStoragePool: v.configData[confKey.storagePool],\n\t\t\t\t\tStorageMode: v.configData[confKey.storageMode],\n\t\t\t\t\tVolumeName: volName,\n\t\t\t\t\tFSType: v.configData[confKey.fsType],\n\t\t\t\t\tReadOnly: readOnly,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif len(v.options.PVC.Spec.AccessModes) == 0 {\n\t\tpv.Spec.AccessModes = v.plugin.GetAccessModes()\n\t}\n\n\tklog.V(4).Info(log(\"provisioner created pv %v and volume %s successfully\", pvName, vol.Name))\n\treturn pv, nil\n}\n\n// setSioMgr creates scaleio mgr from cached config data if found\n// otherwise, setups new config data and create mgr\nfunc (v *sioVolume) setSioMgr() error {\n\tklog.V(4).Info(log(\"setting up sio mgr for spec %s\", v.volSpecName))\n\tpodDir := v.plugin.host.GetPodPluginDir(v.podUID, sioPluginName)\n\tconfigName := filepath.Join(podDir, sioConfigFileName)\n\tif v.sioMgr == nil {\n\t\tconfigData, err := loadConfig(configName) // try to load config if exist\n\t\tif err != nil {\n\t\t\tif !os.IsNotExist(err) {\n\t\t\t\tklog.Error(log(\"failed to load config %s : %v\", configName, err))\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tklog.V(4).Info(log(\"previous config file not found, creating new one\"))\n\t\t\t// prepare config data\n\t\t\tconfigData = make(map[string]string)\n\t\t\tmapVolumeSpec(configData, v.spec)\n\n\t\t\t// additional config data\n\t\t\tconfigData[confKey.secretNamespace] = v.secretNamespace\n\t\t\tconfigData[confKey.secretName] = v.secretName\n\t\t\tconfigData[confKey.volSpecName] = v.volSpecName\n\n\t\t\tif err := validateConfigs(configData); err != nil {\n\t\t\t\tklog.Error(log(\"config setup failed: %s\", err))\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// persist config\n\t\t\tif err := saveConfig(configName, configData); err != nil {\n\t\t\t\tklog.Error(log(\"failed to save config data: %v\", err))\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// merge in secret\n\t\tif err := attachSecret(v.plugin, v.secretNamespace, configData); err != nil {\n\t\t\tklog.Error(log(\"failed to load secret: %v\", err))\n\t\t\treturn err\n\t\t}\n\n\t\t// merge in Sdc Guid label value\n\t\tif err := attachSdcGUID(v.plugin, configData); err != nil {\n\t\t\tklog.Error(log(\"failed to retrieve sdc guid: %v\", err))\n\t\t\treturn err\n\t\t}\n\t\tmgr, err := newSioMgr(configData, v.plugin.host, v.plugin.host.GetExec(v.plugin.GetPluginName()))\n\n\t\tif err != nil {\n\t\t\tklog.Error(log(\"failed to reset sio manager: %v\", err))\n\t\t\treturn err\n\t\t}\n\n\t\tv.sioMgr = mgr\n\t}\n\treturn nil\n}\n\n// resetSioMgr creates scaleio manager from existing (cached) config data\nfunc (v *sioVolume) resetSioMgr() error {\n\tpodDir := v.plugin.host.GetPodPluginDir(v.podUID, sioPluginName)\n\tconfigName := filepath.Join(podDir, sioConfigFileName)\n\tif v.sioMgr == nil {\n\t\t// load config data from disk\n\t\tconfigData, err := loadConfig(configName)\n\t\tif err != nil {\n\t\t\tklog.Error(log(\"failed to load config data: %v\", err))\n\t\t\treturn err\n\t\t}\n\t\tv.secretName = configData[confKey.secretName]\n\t\tv.secretNamespace = configData[confKey.secretNamespace]\n\t\tv.volName = configData[confKey.volumeName]\n\t\tv.volSpecName = configData[confKey.volSpecName]\n\n\t\t// attach secret\n\t\tif err := attachSecret(v.plugin, v.secretNamespace, configData); err != nil {\n\t\t\tklog.Error(log(\"failed to load secret: %v\", err))\n\t\t\treturn err\n\t\t}\n\n\t\t// merge in Sdc Guid label value\n\t\tif err := attachSdcGUID(v.plugin, configData); err != nil {\n\t\t\tklog.Error(log(\"failed to retrieve sdc guid: %v\", err))\n\t\t\treturn err\n\t\t}\n\t\tmgr, err := newSioMgr(configData, v.plugin.host, v.plugin.host.GetExec(v.plugin.GetPluginName()))\n\n\t\tif err != nil {\n\t\t\tklog.Error(log(\"failed to reset scaleio mgr: %v\", err))\n\t\t\treturn err\n\t\t}\n\t\tv.sioMgr = mgr\n\t}\n\treturn nil\n}\n\n// setSioFromConfig sets up scaleio mgr from an available config data map\n// designed to be called from dynamic provisioner\nfunc (v *sioVolume) setSioMgrFromConfig() error {\n\tklog.V(4).Info(log(\"setting scaleio mgr from available config\"))\n\tif v.sioMgr == nil {\n\t\tapplyConfigDefaults(v.configData)\n\n\t\tv.configData[confKey.volSpecName] = v.volSpecName\n\n\t\tif err := validateConfigs(v.configData); err != nil {\n\t\t\tklog.Error(log(\"config data setup failed: %s\", err))\n\t\t\treturn err\n\t\t}\n\n\t\t// copy config and attach secret\n\t\tdata := map[string]string{}\n\t\tfor k, v := range v.configData {\n\t\t\tdata[k] = v\n\t\t}\n\n\t\tif err := attachSecret(v.plugin, v.secretNamespace, data); err != nil {\n\t\t\tklog.Error(log(\"failed to load secret: %v\", err))\n\t\t\treturn err\n\t\t}\n\t\tmgr, err := newSioMgr(data, v.plugin.host, v.plugin.host.GetExec(v.plugin.GetPluginName()))\n\n\t\tif err != nil {\n\t\t\tklog.Error(log(\"failed while setting scaleio mgr from config: %v\", err))\n\t\t\treturn err\n\t\t}\n\t\tv.sioMgr = mgr\n\t}\n\treturn nil\n}\n\n// setSioMgrFromSpec sets the scaleio manager from a spec object.\n// The spec may be complete or incomplete depending on lifecycle phase.\nfunc (v *sioVolume) setSioMgrFromSpec() error {\n\tklog.V(4).Info(log(\"setting sio manager from spec\"))\n\tif v.sioMgr == nil {\n\t\t// get config data form spec volume source\n\t\tconfigData := map[string]string{}\n\t\tmapVolumeSpec(configData, v.spec)\n\n\t\t// additional config\n\t\tconfigData[confKey.secretNamespace] = v.secretNamespace\n\t\tconfigData[confKey.secretName] = v.secretName\n\t\tconfigData[confKey.volSpecName] = v.volSpecName\n\n\t\tif err := validateConfigs(configData); err != nil {\n\t\t\tklog.Error(log(\"config setup failed: %s\", err))\n\t\t\treturn err\n\t\t}\n\n\t\t// attach secret object to config data\n\t\tif err := attachSecret(v.plugin, v.secretNamespace, configData); err != nil {\n\t\t\tklog.Error(log(\"failed to load secret: %v\", err))\n\t\t\treturn err\n\t\t}\n\t\tmgr, err := newSioMgr(configData, v.plugin.host, v.plugin.host.GetExec(v.plugin.GetPluginName()))\n\n\t\tif err != nil {\n\t\t\tklog.Error(log(\"failed to reset sio manager: %v\", err))\n\t\t\treturn err\n\t\t}\n\t\tv.sioMgr = mgr\n\t}\n\treturn nil\n}\n\nfunc (v *sioVolume) generateName(prefix string, size int) string {\n\treturn fmt.Sprintf(\"%s-%s\", prefix, strings.Replace(string(uuid.NewUUID()), \"-\", \"\", -1)[0:size])\n}\n", "meta": {"content_hash": "4c549c5effcc93c5f43f8883f30e5f82", "timestamp": "", "source": "github", "line_count": 516, "max_line_length": 144, "avg_line_length": 30.606589147286822, "alnum_prop": 0.6855568922940544, "repo_name": "kevensen/kubernetes", "id": "23328428ca084e5ca2ccc2b31ed032a818c6f6bc", "size": "16362", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pkg/volume/scaleio/sio_volume.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "998"}, {"name": "Go", "bytes": "27145101"}, {"name": "HTML", "bytes": "1193990"}, {"name": "Makefile", "bytes": "62023"}, {"name": "Nginx", "bytes": "1013"}, {"name": "Protocol Buffer", "bytes": "242445"}, {"name": "Python", "bytes": "34630"}, {"name": "SaltStack", "bytes": "55886"}, {"name": "Shell", "bytes": "1412739"}]}} +{"text": "extern \"Java\"\n{\n namespace javax\n {\n namespace security\n {\n namespace auth\n {\n namespace login\n {\n class FailedLoginException;\n }\n }\n }\n }\n}\n\nclass javax::security::auth::login::FailedLoginException : public ::javax::security::auth::login::LoginException\n{\n\npublic:\n FailedLoginException();\n FailedLoginException(::java::lang::String *);\nprivate:\n static const jlong serialVersionUID = 802556922354616286LL;\npublic:\n static ::java::lang::Class class$;\n};\n\n#endif // __javax_security_auth_login_FailedLoginException__\n", "meta": {"content_hash": "6eb54b5a6e9da1ede7f8561a7b9d5db9", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 112, "avg_line_length": 19.333333333333332, "alnum_prop": 0.6517241379310345, "repo_name": "the-linix-project/linix-kernel-source", "id": "014a472c6d9e21351ef149f970f53ab5a268e814", "size": "837", "binary": false, "copies": "160", "ref": "refs/heads/master", "path": "gccsrc/gcc-4.7.2/libjava/javax/security/auth/login/FailedLoginException.h", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Ada", "bytes": "38139979"}, {"name": "Assembly", "bytes": "3723477"}, {"name": "Awk", "bytes": "83739"}, {"name": "C", "bytes": "103607293"}, {"name": "C#", "bytes": "55726"}, {"name": "C++", "bytes": "38577421"}, {"name": "CLIPS", "bytes": "6933"}, {"name": "CSS", "bytes": "32588"}, {"name": "Emacs Lisp", "bytes": "13451"}, {"name": "FORTRAN", "bytes": "4294984"}, {"name": "GAP", "bytes": "13089"}, {"name": "Go", "bytes": "11277335"}, {"name": "Haskell", "bytes": "2415"}, {"name": "Java", "bytes": "45298678"}, {"name": "JavaScript", "bytes": "6265"}, {"name": "Matlab", "bytes": "56"}, {"name": "OCaml", "bytes": "148372"}, {"name": "Objective-C", "bytes": "995127"}, {"name": "Objective-C++", "bytes": "436045"}, {"name": "PHP", "bytes": "12361"}, {"name": "Pascal", "bytes": "40318"}, {"name": "Perl", "bytes": "358808"}, {"name": "Python", "bytes": "60178"}, {"name": "SAS", "bytes": "1711"}, {"name": "Scilab", "bytes": "258457"}, {"name": "Shell", "bytes": "2610907"}, {"name": "Tcl", "bytes": "17983"}, {"name": "TeX", "bytes": "1455571"}, {"name": "XSLT", "bytes": "156419"}]}} +{"text": "\npackage uk.co.real_logic.aeron.common;\n\nimport java.net.InterfaceAddress;\nimport java.net.NetworkInterface;\nimport java.net.SocketException;\nimport java.util.Enumeration;\nimport java.util.List;\n\ninterface NetworkInterfaceShim\n{\n Enumeration<NetworkInterface> getNetworkInterfaces() throws SocketException;\n List<InterfaceAddress> getInterfaceAddresses(NetworkInterface ifc);\n boolean isLoopback(NetworkInterface ifc) throws SocketException;\n\n NetworkInterfaceShim DEFAULT = new NetworkInterfaceShim()\n {\n public Enumeration<NetworkInterface> getNetworkInterfaces() throws SocketException\n {\n return NetworkInterface.getNetworkInterfaces();\n }\n\n public List<InterfaceAddress> getInterfaceAddresses(final NetworkInterface ifc)\n {\n return ifc.getInterfaceAddresses();\n }\n\n public boolean isLoopback(final NetworkInterface ifc) throws SocketException\n {\n return ifc.isLoopback();\n }\n };\n}\n", "meta": {"content_hash": "572858c544ddc9dd253a4790b6e0f3ec", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 90, "avg_line_length": 30.303030303030305, "alnum_prop": 0.728, "repo_name": "jessefugitt/Aeron", "id": "11a4ad5d626ba9d0d7afb8b4b986eb31982cedab", "size": "1601", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "aeron-common/src/main/java/uk/co/real_logic/aeron/common/NetworkInterfaceShim.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C++", "bytes": "313662"}, {"name": "CMake", "bytes": "7737"}, {"name": "Java", "bytes": "990516"}, {"name": "Shell", "bytes": "155"}]}} +{"text": "// Copyright (c) 2013 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include \"content/browser/indexed_db/leveldb/leveldb_database.h\"\n\n#include <cerrno>\n\n#include \"base/basictypes.h\"\n#include \"base/files/file.h\"\n#include \"base/logging.h\"\n#include \"base/memory/scoped_ptr.h\"\n#include \"base/metrics/histogram.h\"\n#include \"base/strings/string16.h\"\n#include \"base/strings/string_piece.h\"\n#include \"base/strings/stringprintf.h\"\n#include \"base/strings/utf_string_conversions.h\"\n#include \"base/sys_info.h\"\n#include \"content/browser/indexed_db/indexed_db_class_factory.h\"\n#include \"content/browser/indexed_db/leveldb/leveldb_comparator.h\"\n#include \"content/browser/indexed_db/leveldb/leveldb_iterator_impl.h\"\n#include \"content/browser/indexed_db/leveldb/leveldb_write_batch.h\"\n#include \"third_party/leveldatabase/env_chromium.h\"\n#include \"third_party/leveldatabase/env_idb.h\"\n#include \"third_party/leveldatabase/src/helpers/memenv/memenv.h\"\n#include \"third_party/leveldatabase/src/include/leveldb/db.h\"\n#include \"third_party/leveldatabase/src/include/leveldb/env.h\"\n#include \"third_party/leveldatabase/src/include/leveldb/filter_policy.h\"\n#include \"third_party/leveldatabase/src/include/leveldb/slice.h\"\n\nusing base::StringPiece;\n\nnamespace content {\n\n// Forcing flushes to disk at the end of a transaction guarantees that the\n// data hit disk, but drastically impacts throughput when the filesystem is\n// busy with background compactions. Not syncing trades off reliability for\n// performance. Note that background compactions which move data from the\n// log to SSTs are always done with reliable writes.\n//\n// Sync writes are necessary on Windows for quota calculations; POSIX\n// calculates file sizes correctly even when not synced to disk.\n#if defined(OS_WIN)\nstatic const bool kSyncWrites = true;\n#else\n// TODO(dgrogan): Either remove the #if block or change this back to false.\n// See http://crbug.com/338385.\nstatic const bool kSyncWrites = true;\n#endif\n\nstatic leveldb::Slice MakeSlice(const StringPiece& s) {\n return leveldb::Slice(s.begin(), s.size());\n}\n\nstatic StringPiece MakeStringPiece(const leveldb::Slice& s) {\n return StringPiece(s.data(), s.size());\n}\n\nLevelDBDatabase::ComparatorAdapter::ComparatorAdapter(\n const LevelDBComparator* comparator)\n : comparator_(comparator) {}\n\nint LevelDBDatabase::ComparatorAdapter::Compare(const leveldb::Slice& a,\n const leveldb::Slice& b) const {\n return comparator_->Compare(MakeStringPiece(a), MakeStringPiece(b));\n}\n\nconst char* LevelDBDatabase::ComparatorAdapter::Name() const {\n return comparator_->Name();\n}\n\n// TODO(jsbell): Support the methods below in the future.\nvoid LevelDBDatabase::ComparatorAdapter::FindShortestSeparator(\n std::string* start,\n const leveldb::Slice& limit) const {}\n\nvoid LevelDBDatabase::ComparatorAdapter::FindShortSuccessor(\n std::string* key) const {}\n\nLevelDBSnapshot::LevelDBSnapshot(LevelDBDatabase* db)\n : db_(db->db_.get()), snapshot_(db_->GetSnapshot()) {}\n\nLevelDBSnapshot::~LevelDBSnapshot() { db_->ReleaseSnapshot(snapshot_); }\n\nLevelDBDatabase::LevelDBDatabase() {}\n\nLevelDBDatabase::~LevelDBDatabase() {\n // db_'s destructor uses comparator_adapter_; order of deletion is important.\n db_.reset();\n comparator_adapter_.reset();\n env_.reset();\n}\n\nstatic leveldb::Status OpenDB(\n leveldb::Comparator* comparator,\n leveldb::Env* env,\n const base::FilePath& path,\n leveldb::DB** db,\n scoped_ptr<const leveldb::FilterPolicy>* filter_policy) {\n filter_policy->reset(leveldb::NewBloomFilterPolicy(10));\n leveldb::Options options;\n options.comparator = comparator;\n options.create_if_missing = true;\n options.paranoid_checks = true;\n options.filter_policy = filter_policy->get();\n options.reuse_logs = true;\n options.compression = leveldb::kSnappyCompression;\n\n // For info about the troubles we've run into with this parameter, see:\n // https://code.google.com/p/chromium/issues/detail?id=227313#c11\n options.max_open_files = 80;\n options.env = env;\n\n // ChromiumEnv assumes UTF8, converts back to FilePath before using.\n leveldb::Status s = leveldb::DB::Open(options, path.AsUTF8Unsafe(), db);\n\n return s;\n}\n\nleveldb::Status LevelDBDatabase::Destroy(const base::FilePath& file_name) {\n leveldb::Options options;\n options.env = leveldb::IDBEnv();\n // ChromiumEnv assumes UTF8, converts back to FilePath before using.\n return leveldb::DestroyDB(file_name.AsUTF8Unsafe(), options);\n}\n\nnamespace {\nclass LockImpl : public LevelDBLock {\n public:\n explicit LockImpl(leveldb::Env* env, leveldb::FileLock* lock)\n : env_(env), lock_(lock) {}\n ~LockImpl() override { env_->UnlockFile(lock_); }\n\n private:\n leveldb::Env* env_;\n leveldb::FileLock* lock_;\n\n DISALLOW_COPY_AND_ASSIGN(LockImpl);\n};\n} // namespace\n\nscoped_ptr<LevelDBLock> LevelDBDatabase::LockForTesting(\n const base::FilePath& file_name) {\n leveldb::Env* env = leveldb::IDBEnv();\n base::FilePath lock_path = file_name.AppendASCII(\"LOCK\");\n leveldb::FileLock* lock = NULL;\n leveldb::Status status = env->LockFile(lock_path.AsUTF8Unsafe(), &lock);\n if (!status.ok())\n return scoped_ptr<LevelDBLock>();\n DCHECK(lock);\n return scoped_ptr<LevelDBLock>(new LockImpl(env, lock));\n}\n\nstatic int CheckFreeSpace(const char* const type,\n const base::FilePath& file_name) {\n std::string name =\n std::string(\"WebCore.IndexedDB.LevelDB.Open\") + type + \"FreeDiskSpace\";\n int64 free_disk_space_in_k_bytes =\n base::SysInfo::AmountOfFreeDiskSpace(file_name) / 1024;\n if (free_disk_space_in_k_bytes < 0) {\n base::Histogram::FactoryGet(\n \"WebCore.IndexedDB.LevelDB.FreeDiskSpaceFailure\",\n 1,\n 2 /*boundary*/,\n 2 /*boundary*/ + 1,\n base::HistogramBase::kUmaTargetedHistogramFlag)->Add(1 /*sample*/);\n return -1;\n }\n int clamped_disk_space_k_bytes = free_disk_space_in_k_bytes > INT_MAX\n ? INT_MAX\n : free_disk_space_in_k_bytes;\n const uint64 histogram_max = static_cast<uint64>(1e9);\n static_assert(histogram_max <= INT_MAX, \"histogram_max too big\");\n base::Histogram::FactoryGet(name,\n 1,\n histogram_max,\n 11 /*buckets*/,\n base::HistogramBase::kUmaTargetedHistogramFlag)\n ->Add(clamped_disk_space_k_bytes);\n return clamped_disk_space_k_bytes;\n}\n\nstatic void ParseAndHistogramIOErrorDetails(const std::string& histogram_name,\n const leveldb::Status& s) {\n leveldb_env::MethodID method;\n base::File::Error error = base::File::FILE_OK;\n leveldb_env::ErrorParsingResult result =\n leveldb_env::ParseMethodAndError(s, &method, &error);\n if (result == leveldb_env::NONE)\n return;\n std::string method_histogram_name(histogram_name);\n method_histogram_name.append(\".EnvMethod\");\n base::LinearHistogram::FactoryGet(\n method_histogram_name,\n 1,\n leveldb_env::kNumEntries,\n leveldb_env::kNumEntries + 1,\n base::HistogramBase::kUmaTargetedHistogramFlag)->Add(method);\n\n std::string error_histogram_name(histogram_name);\n\n if (result == leveldb_env::METHOD_AND_PFE) {\n DCHECK_LT(error, 0);\n error_histogram_name.append(std::string(\".PFE.\") +\n leveldb_env::MethodIDToString(method));\n base::LinearHistogram::FactoryGet(\n error_histogram_name,\n 1,\n -base::File::FILE_ERROR_MAX,\n -base::File::FILE_ERROR_MAX + 1,\n base::HistogramBase::kUmaTargetedHistogramFlag)->Add(-error);\n }\n}\n\nstatic void ParseAndHistogramCorruptionDetails(\n const std::string& histogram_name,\n const leveldb::Status& status) {\n int error = leveldb_env::GetCorruptionCode(status);\n DCHECK_GE(error, 0);\n std::string corruption_histogram_name(histogram_name);\n corruption_histogram_name.append(\".Corruption\");\n const int kNumPatterns = leveldb_env::GetNumCorruptionCodes();\n base::LinearHistogram::FactoryGet(\n corruption_histogram_name,\n 1,\n kNumPatterns,\n kNumPatterns + 1,\n base::HistogramBase::kUmaTargetedHistogramFlag)->Add(error);\n}\n\nstatic void HistogramLevelDBError(const std::string& histogram_name,\n const leveldb::Status& s) {\n if (s.ok()) {\n NOTREACHED();\n return;\n }\n enum {\n LEVEL_DB_NOT_FOUND,\n LEVEL_DB_CORRUPTION,\n LEVEL_DB_IO_ERROR,\n LEVEL_DB_OTHER,\n LEVEL_DB_MAX_ERROR\n };\n int leveldb_error = LEVEL_DB_OTHER;\n if (s.IsNotFound())\n leveldb_error = LEVEL_DB_NOT_FOUND;\n else if (s.IsCorruption())\n leveldb_error = LEVEL_DB_CORRUPTION;\n else if (s.IsIOError())\n leveldb_error = LEVEL_DB_IO_ERROR;\n base::Histogram::FactoryGet(histogram_name,\n 1,\n LEVEL_DB_MAX_ERROR,\n LEVEL_DB_MAX_ERROR + 1,\n base::HistogramBase::kUmaTargetedHistogramFlag)\n ->Add(leveldb_error);\n if (s.IsIOError())\n ParseAndHistogramIOErrorDetails(histogram_name, s);\n else\n ParseAndHistogramCorruptionDetails(histogram_name, s);\n}\n\nleveldb::Status LevelDBDatabase::Open(const base::FilePath& file_name,\n const LevelDBComparator* comparator,\n scoped_ptr<LevelDBDatabase>* result,\n bool* is_disk_full) {\n base::TimeTicks begin_time = base::TimeTicks::Now();\n\n scoped_ptr<ComparatorAdapter> comparator_adapter(\n new ComparatorAdapter(comparator));\n\n leveldb::DB* db;\n scoped_ptr<const leveldb::FilterPolicy> filter_policy;\n const leveldb::Status s = OpenDB(comparator_adapter.get(),\n leveldb::IDBEnv(),\n file_name,\n &db,\n &filter_policy);\n\n if (!s.ok()) {\n HistogramLevelDBError(\"WebCore.IndexedDB.LevelDBOpenErrors\", s);\n int free_space_k_bytes = CheckFreeSpace(\"Failure\", file_name);\n // Disks with <100k of free space almost never succeed in opening a\n // leveldb database.\n if (is_disk_full)\n *is_disk_full = free_space_k_bytes >= 0 && free_space_k_bytes < 100;\n\n LOG(ERROR) << \"Failed to open LevelDB database from \"\n << file_name.AsUTF8Unsafe() << \",\" << s.ToString();\n return s;\n }\n\n UMA_HISTOGRAM_MEDIUM_TIMES(\"WebCore.IndexedDB.LevelDB.OpenTime\",\n base::TimeTicks::Now() - begin_time);\n\n CheckFreeSpace(\"Success\", file_name);\n\n (*result).reset(new LevelDBDatabase);\n (*result)->db_ = make_scoped_ptr(db);\n (*result)->comparator_adapter_ = comparator_adapter.Pass();\n (*result)->comparator_ = comparator;\n (*result)->filter_policy_ = filter_policy.Pass();\n\n return s;\n}\n\nscoped_ptr<LevelDBDatabase> LevelDBDatabase::OpenInMemory(\n const LevelDBComparator* comparator) {\n scoped_ptr<ComparatorAdapter> comparator_adapter(\n new ComparatorAdapter(comparator));\n scoped_ptr<leveldb::Env> in_memory_env(leveldb::NewMemEnv(leveldb::IDBEnv()));\n\n leveldb::DB* db;\n scoped_ptr<const leveldb::FilterPolicy> filter_policy;\n const leveldb::Status s = OpenDB(comparator_adapter.get(),\n in_memory_env.get(),\n base::FilePath(),\n &db,\n &filter_policy);\n\n if (!s.ok()) {\n LOG(ERROR) << \"Failed to open in-memory LevelDB database: \" << s.ToString();\n return scoped_ptr<LevelDBDatabase>();\n }\n\n scoped_ptr<LevelDBDatabase> result(new LevelDBDatabase);\n result->env_ = in_memory_env.Pass();\n result->db_ = make_scoped_ptr(db);\n result->comparator_adapter_ = comparator_adapter.Pass();\n result->comparator_ = comparator;\n result->filter_policy_ = filter_policy.Pass();\n\n return result.Pass();\n}\n\nleveldb::Status LevelDBDatabase::Put(const StringPiece& key,\n std::string* value) {\n base::TimeTicks begin_time = base::TimeTicks::Now();\n\n leveldb::WriteOptions write_options;\n write_options.sync = kSyncWrites;\n\n const leveldb::Status s =\n db_->Put(write_options, MakeSlice(key), MakeSlice(*value));\n if (!s.ok())\n LOG(ERROR) << \"LevelDB put failed: \" << s.ToString();\n else\n UMA_HISTOGRAM_TIMES(\"WebCore.IndexedDB.LevelDB.PutTime\",\n base::TimeTicks::Now() - begin_time);\n return s;\n}\n\nleveldb::Status LevelDBDatabase::Remove(const StringPiece& key) {\n leveldb::WriteOptions write_options;\n write_options.sync = kSyncWrites;\n\n const leveldb::Status s = db_->Delete(write_options, MakeSlice(key));\n if (!s.IsNotFound())\n LOG(ERROR) << \"LevelDB remove failed: \" << s.ToString();\n return s;\n}\n\nleveldb::Status LevelDBDatabase::Get(const StringPiece& key,\n std::string* value,\n bool* found,\n const LevelDBSnapshot* snapshot) {\n *found = false;\n leveldb::ReadOptions read_options;\n read_options.verify_checksums = true; // TODO(jsbell): Disable this if the\n // performance impact is too great.\n read_options.snapshot = snapshot ? snapshot->snapshot_ : 0;\n\n const leveldb::Status s = db_->Get(read_options, MakeSlice(key), value);\n if (s.ok()) {\n *found = true;\n return s;\n }\n if (s.IsNotFound())\n return leveldb::Status::OK();\n HistogramLevelDBError(\"WebCore.IndexedDB.LevelDBReadErrors\", s);\n LOG(ERROR) << \"LevelDB get failed: \" << s.ToString();\n return s;\n}\n\nleveldb::Status LevelDBDatabase::Write(const LevelDBWriteBatch& write_batch) {\n base::TimeTicks begin_time = base::TimeTicks::Now();\n leveldb::WriteOptions write_options;\n write_options.sync = kSyncWrites;\n\n const leveldb::Status s =\n db_->Write(write_options, write_batch.write_batch_.get());\n if (!s.ok()) {\n HistogramLevelDBError(\"WebCore.IndexedDB.LevelDBWriteErrors\", s);\n LOG(ERROR) << \"LevelDB write failed: \" << s.ToString();\n } else {\n UMA_HISTOGRAM_TIMES(\"WebCore.IndexedDB.LevelDB.WriteTime\",\n base::TimeTicks::Now() - begin_time);\n }\n return s;\n}\n\nscoped_ptr<LevelDBIterator> LevelDBDatabase::CreateIterator(\n const LevelDBSnapshot* snapshot) {\n leveldb::ReadOptions read_options;\n read_options.verify_checksums = true; // TODO(jsbell): Disable this if the\n // performance impact is too great.\n read_options.snapshot = snapshot ? snapshot->snapshot_ : 0;\n\n scoped_ptr<leveldb::Iterator> i(db_->NewIterator(read_options));\n return scoped_ptr<LevelDBIterator>(\n IndexedDBClassFactory::Get()->CreateIteratorImpl(i.Pass()));\n}\n\nconst LevelDBComparator* LevelDBDatabase::Comparator() const {\n return comparator_;\n}\n\nvoid LevelDBDatabase::Compact(const base::StringPiece& start,\n const base::StringPiece& stop) {\n const leveldb::Slice start_slice = MakeSlice(start);\n const leveldb::Slice stop_slice = MakeSlice(stop);\n // NULL batch means just wait for earlier writes to be done\n db_->Write(leveldb::WriteOptions(), NULL);\n db_->CompactRange(&start_slice, &stop_slice);\n}\n\nvoid LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); }\n\n} // namespace content\n", "meta": {"content_hash": "4be9c7d9ff7a51482f588ca06294a5cc", "timestamp": "", "source": "github", "line_count": 429, "max_line_length": 80, "avg_line_length": 36.074592074592076, "alnum_prop": 0.6566942362367537, "repo_name": "hefen1/chromium", "id": "aab1255d145a6e46d3f64e9a602365c9156d5d15", "size": "15476", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "content/browser/indexed_db/leveldb/leveldb_database.cc", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "AppleScript", "bytes": "6973"}, {"name": "Arduino", "bytes": "464"}, {"name": "Assembly", "bytes": "23829"}, {"name": "C", "bytes": "4050888"}, {"name": "C++", "bytes": "227355953"}, {"name": "CSS", "bytes": "970407"}, {"name": "HTML", "bytes": "28896884"}, {"name": "Java", "bytes": "8494381"}, {"name": "JavaScript", "bytes": "19110753"}, {"name": "Makefile", "bytes": "37978"}, {"name": "Objective-C", "bytes": "1276474"}, {"name": "Objective-C++", "bytes": "7755220"}, {"name": "PHP", "bytes": "97817"}, {"name": "PLpgSQL", "bytes": "264470"}, {"name": "Perl", "bytes": "63937"}, {"name": "Protocol Buffer", "bytes": "423501"}, {"name": "Python", "bytes": "7622149"}, {"name": "Shell", "bytes": "478642"}, {"name": "Standard ML", "bytes": "4965"}, {"name": "XSLT", "bytes": "418"}, {"name": "nesC", "bytes": "18347"}]}} +{"text": "\n\n/**\n * \\file\n * Protects against replay attacks by comparing with the last\n * unicast or broadcast frame counter of the sender.\n * \\author\n * Konrad Krentz <konrad.krentz@gmail.com>\n */\n\n/**\n * \\addtogroup llsec802154\n * @{\n */\n\n#include <net/l2_buf.h>\n\n#include \"contiki/llsec/anti-replay.h\"\n#include \"contiki/packetbuf.h\"\n\n/* This node's current frame counter value */\nstatic uint32_t counter;\n\n/*---------------------------------------------------------------------------*/\nvoid\nanti_replay_set_counter(struct net_buf *buf)\n{\n frame802154_frame_counter_t reordered_counter;\n \n reordered_counter.u32 = LLSEC802154_HTONL(++counter);\n \n packetbuf_set_attr(buf, PACKETBUF_ATTR_FRAME_COUNTER_BYTES_0_1, reordered_counter.u16[0]);\n packetbuf_set_attr(buf, PACKETBUF_ATTR_FRAME_COUNTER_BYTES_2_3, reordered_counter.u16[1]);\n}\n/*---------------------------------------------------------------------------*/\nuint32_t\nanti_replay_get_counter(struct net_buf *buf)\n{\n frame802154_frame_counter_t disordered_counter;\n \n disordered_counter.u16[0] = packetbuf_attr(buf, PACKETBUF_ATTR_FRAME_COUNTER_BYTES_0_1);\n disordered_counter.u16[1] = packetbuf_attr(buf, PACKETBUF_ATTR_FRAME_COUNTER_BYTES_2_3);\n \n return LLSEC802154_HTONL(disordered_counter.u32); \n}\n/*---------------------------------------------------------------------------*/\nvoid\nanti_replay_init_info(struct net_buf *buf, struct anti_replay_info *info)\n{\n info->last_broadcast_counter\n = info->last_unicast_counter\n = anti_replay_get_counter(buf);\n}\n/*---------------------------------------------------------------------------*/\nint\nanti_replay_was_replayed(struct net_buf *buf, struct anti_replay_info *info)\n{\n uint32_t received_counter;\n \n received_counter = anti_replay_get_counter(buf);\n \n if(packetbuf_holds_broadcast(buf)) {\n /* broadcast */\n if(received_counter <= info->last_broadcast_counter) {\n return 1;\n } else {\n info->last_broadcast_counter = received_counter;\n return 0;\n }\n } else {\n /* unicast */\n if(received_counter <= info->last_unicast_counter) {\n return 1;\n } else {\n info->last_unicast_counter = received_counter;\n return 0;\n }\n }\n}\n/*---------------------------------------------------------------------------*/\n\n/** @} */\n", "meta": {"content_hash": "1777034a9c991d7db100787e4e62d48b", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 92, "avg_line_length": 28.170731707317074, "alnum_prop": 0.561038961038961, "repo_name": "32bitmicro/zephyr", "id": "0db4d6b72335e7714a52d4ba29fe88b3ac52c49f", "size": "3940", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "net/ip/contiki/llsec/anti-replay.c", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "160164"}, {"name": "Batchfile", "bytes": "28019"}, {"name": "C", "bytes": "6173727"}, {"name": "C++", "bytes": "222025"}, {"name": "Lex", "bytes": "11196"}, {"name": "Makefile", "bytes": "132295"}, {"name": "Objective-C", "bytes": "1912"}, {"name": "Perl", "bytes": "213268"}, {"name": "Python", "bytes": "109645"}, {"name": "Shell", "bytes": "44817"}, {"name": "Yacc", "bytes": "15396"}]}} +{"text": "package com.acework.js.components.bootstrap\n\nimport com.acework.js.utils.{Mappable, Mergeable}\nimport japgolly.scalajs.react._\nimport japgolly.scalajs.react.vdom.prefix_<^._\n\nimport scala.scalajs.js.{UndefOr, undefined}\n\n/**\n * Created by weiyin on 10/03/15.\n */\nobject Well extends BootstrapComponent {\n override type P = Well\n override type S = Unit\n override type B = Unit\n override type N = TopNode\n\n override def defaultProps = Well()\n\n case class Well(bsClass: UndefOr[Classes.Value] = Classes.well,\n bsStyle: UndefOr[Styles.Value] = undefined,\n bsSize: UndefOr[Sizes.Value] = undefined,\n addClasses: String = \"\")\n extends BsProps with MergeableProps[Well] {\n\n def merge(t: Map[String, Any]): Well = implicitly[Mergeable[Well]].merge(this, t)\n\n def asMap: Map[String, Any] = implicitly[Mappable[Well]].toMap(this)\n\n def apply(children: ReactNode*) = component(this, children)\n\n def apply() = component(this)\n }\n\n override val component = ReactComponentB[Well](\"Well\")\n .render { (P, C) =>\n\n // TODO spread props\n <.div(^.classSet1M(P.addClasses, P.bsClassSet))(C)\n\n }.build\n\n}\n", "meta": {"content_hash": "2c0f045ddc884f768217779e99f20d1a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 85, "avg_line_length": 27.13953488372093, "alnum_prop": 0.6709511568123393, "repo_name": "weiyinteo/scalajs-react-bootstrap", "id": "6db3f50e028d4f9b8030d93ff00d1a9a724bfc3b", "size": "1167", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "core/src/main/scala/com/acework/js/components/bootstrap/Well.scala", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "6518"}, {"name": "HTML", "bytes": "1421"}, {"name": "Scala", "bytes": "334544"}]}} +{"text": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n <modelVersion>4.0.0</modelVersion>\n <parent>\n <groupId>edu.clemson</groupId>\n <artifactId>resolve-master</artifactId>\n <version>0.0.1-SNAPSHOT</version>\n <relativePath>../pom.xml</relativePath>\n </parent>\n <artifactId>resolve-runtime</artifactId>\n <name>RESOLVE Runtime</name>\n <description>The RESOLVE Runtime</description>\n\n <build>\n <sourceDirectory>src</sourceDirectory>\n <plugins>\n\n </plugins>\n </build>\n</project>", "meta": {"content_hash": "9db3f2bd5c8c66d2148862f9b7c04f00", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 201, "avg_line_length": 36.578947368421055, "alnum_prop": 0.6589928057553956, "repo_name": "Welchd1/resolve-lite", "id": "39f4ca5c089d56d93766a7e02d51bc9da14cd42e", "size": "695", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "runtime/pom.xml", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ANTLR", "bytes": "15010"}, {"name": "Java", "bytes": "717515"}]}} +{"text": "package adf.launcher.option;\n\nimport adf.launcher.ConfigKey;\nimport rescuecore2.config.Config;\n\npublic class OptionPoliceOffice extends Option\n{\n\n\t@Override\n\tpublic String getKey()\n\t{\n\t\treturn \"-po\";\n\t}\n\n\t@Override\n\tpublic void setValue(Config config, String[] datas)\n\t{\n\t\tif(datas.length == 2)\n\t\t{\n\t\t\tconfig.setValue(ConfigKey.KEY_POLICE_OFFICE_COUNT, datas[1]);\n\t\t}\n\t}\n}", "meta": {"content_hash": "24f95fa27e0fccff88aa1574153e833d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 64, "avg_line_length": 16.17391304347826, "alnum_prop": 0.717741935483871, "repo_name": "tkmnet/RCRS-ADF", "id": "cc8bf5d4ac94dcea0fe5311e0208eaa98c61bf98", "size": "372", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "modules/core/src/main/java/adf/launcher/option/OptionPoliceOffice.java", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Assembly", "bytes": "277"}, {"name": "Batchfile", "bytes": "2394"}, {"name": "C", "bytes": "115742"}, {"name": "C++", "bytes": "4876"}, {"name": "CSS", "bytes": "104604"}, {"name": "GAP", "bytes": "176"}, {"name": "Groovy", "bytes": "1142351"}, {"name": "HTML", "bytes": "28618885"}, {"name": "Java", "bytes": "10250957"}, {"name": "JavaScript", "bytes": "190908"}, {"name": "Objective-C", "bytes": "698"}, {"name": "Objective-C++", "bytes": "442"}, {"name": "Scala", "bytes": "3073"}, {"name": "Shell", "bytes": "16330"}]}} +{"text": "\n#ifndef _SET_RADAR_LOD_ACTION_H_\n#define _SET_RADAR_LOD_ACTION_H_\n\n#ifndef _ACTION_H_\n#include \"Action.h\"\n#endif// _ACTION_H_\n\nnamespace Training\n{\n //------------------------------------------------------------------------------\n // class definitions\n //------------------------------------------------------------------------------\n class SetRadarLODAction : public Action\n {\n public:\n /* void */ SetRadarLODAction (RadarImage::RadarLOD radarLOD);\n virtual /* void */ ~SetRadarLODAction (void);\n virtual void Execute (void);\n\n protected:\n RadarImage::RadarLOD m_radarLOD;\n };\n\n //------------------------------------------------------------------------------\n}\n\n#endif //_SET_RADAR_LOD_ACTION_H_\n", "meta": {"content_hash": "5d58036fec80b4bd6c5b57769ea7360e", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 90, "avg_line_length": 29.678571428571427, "alnum_prop": 0.3850782190132371, "repo_name": "AllegianceZone/Allegiance", "id": "4431344ef9dd4614b2cf5ba28fb5240e002ccb7b", "size": "1065", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/training/SetRadarLODAction.h", "mode": "33188", "license": "mit", "language": [{"name": "Assembly", "bytes": "26927"}, {"name": "Batchfile", "bytes": "20387"}, {"name": "C", "bytes": "3213698"}, {"name": "C++", "bytes": "11383849"}, {"name": "CSS", "bytes": "1905"}, {"name": "HTML", "bytes": "369500"}, {"name": "JavaScript", "bytes": "125561"}, {"name": "Makefile", "bytes": "9519"}, {"name": "Objective-C", "bytes": "41562"}, {"name": "Perl", "bytes": "3074"}, {"name": "PigLatin", "bytes": "250645"}, {"name": "Roff", "bytes": "5275"}, {"name": "Visual Basic", "bytes": "7253"}, {"name": "XSLT", "bytes": "19495"}]}} +{"text": "\n\npackage azure\n\nimport (\n\t\"crypto/rsa\"\n\t\"crypto/x509\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"time\"\n\n\t\"k8s.io/client-go/util/flowcontrol\"\n\t\"k8s.io/kubernetes/pkg/cloudprovider\"\n\t\"k8s.io/kubernetes/pkg/controller\"\n\t\"k8s.io/kubernetes/pkg/version\"\n\n\t\"github.com/Azure/azure-sdk-for-go/arm/compute\"\n\t\"github.com/Azure/azure-sdk-for-go/arm/disk\"\n\t\"github.com/Azure/azure-sdk-for-go/arm/network\"\n\t\"github.com/Azure/azure-sdk-for-go/arm/storage\"\n\t\"github.com/Azure/go-autorest/autorest\"\n\t\"github.com/Azure/go-autorest/autorest/adal\"\n\t\"github.com/Azure/go-autorest/autorest/azure\"\n\t\"github.com/ghodss/yaml\"\n\t\"github.com/golang/glog\"\n\t\"golang.org/x/crypto/pkcs12\"\n\t\"k8s.io/apimachinery/pkg/util/wait\"\n)\n\nconst (\n\t// CloudProviderName is the value used for the --cloud-provider flag\n\tCloudProviderName = \"azure\"\n\trateLimitQPSDefault = 1.0\n\trateLimitBucketDefault = 5\n\tbackoffRetriesDefault = 6\n\tbackoffExponentDefault = 1.5\n\tbackoffDurationDefault = 5 // in seconds\n\tbackoffJitterDefault = 1.0\n)\n\n// Config holds the configuration parsed from the --cloud-config flag\n// All fields are required unless otherwise specified\ntype Config struct {\n\t// The cloud environment identifier. Takes values from https://github.com/Azure/go-autorest/blob/ec5f4903f77ed9927ac95b19ab8e44ada64c1356/autorest/azure/environments.go#L13\n\tCloud string `json:\"cloud\" yaml:\"cloud\"`\n\t// The AAD Tenant ID for the Subscription that the cluster is deployed in\n\tTenantID string `json:\"tenantId\" yaml:\"tenantId\"`\n\t// The ID of the Azure Subscription that the cluster is deployed in\n\tSubscriptionID string `json:\"subscriptionId\" yaml:\"subscriptionId\"`\n\t// The name of the resource group that the cluster is deployed in\n\tResourceGroup string `json:\"resourceGroup\" yaml:\"resourceGroup\"`\n\t// The location of the resource group that the cluster is deployed in\n\tLocation string `json:\"location\" yaml:\"location\"`\n\t// The name of the VNet that the cluster is deployed in\n\tVnetName string `json:\"vnetName\" yaml:\"vnetName\"`\n\t// The name of the resource group that the Vnet is deployed in\n\tVnetResourceGroup string `json:\"vnetResourceGroup\" yaml:\"vnetResourceGroup\"`\n\t// The name of the subnet that the cluster is deployed in\n\tSubnetName string `json:\"subnetName\" yaml:\"subnetName\"`\n\t// The name of the security group attached to the cluster's subnet\n\tSecurityGroupName string `json:\"securityGroupName\" yaml:\"securityGroupName\"`\n\t// (Optional in 1.6) The name of the route table attached to the subnet that the cluster is deployed in\n\tRouteTableName string `json:\"routeTableName\" yaml:\"routeTableName\"`\n\t// (Optional) The name of the availability set that should be used as the load balancer backend\n\t// If this is set, the Azure cloudprovider will only add nodes from that availability set to the load\n\t// balancer backend pool. If this is not set, and multiple agent pools (availability sets) are used, then\n\t// the cloudprovider will try to add all nodes to a single backend pool which is forbidden.\n\t// In other words, if you use multiple agent pools (availability sets), you MUST set this field.\n\tPrimaryAvailabilitySetName string `json:\"primaryAvailabilitySetName\" yaml:\"primaryAvailabilitySetName\"`\n\n\t// The ClientID for an AAD application with RBAC access to talk to Azure RM APIs\n\tAADClientID string `json:\"aadClientId\" yaml:\"aadClientId\"`\n\t// The ClientSecret for an AAD application with RBAC access to talk to Azure RM APIs\n\tAADClientSecret string `json:\"aadClientSecret\" yaml:\"aadClientSecret\"`\n\t// The path of a client certificate for an AAD application with RBAC access to talk to Azure RM APIs\n\tAADClientCertPath string `json:\"aadClientCertPath\" yaml:\"aadClientCertPath\"`\n\t// The password of the client certificate for an AAD application with RBAC access to talk to Azure RM APIs\n\tAADClientCertPassword string `json:\"aadClientCertPassword\" yaml:\"aadClientCertPassword\"`\n\t// Enable exponential backoff to manage resource request retries\n\tCloudProviderBackoff bool `json:\"cloudProviderBackoff\" yaml:\"cloudProviderBackoff\"`\n\t// Backoff retry limit\n\tCloudProviderBackoffRetries int `json:\"cloudProviderBackoffRetries\" yaml:\"cloudProviderBackoffRetries\"`\n\t// Backoff exponent\n\tCloudProviderBackoffExponent float64 `json:\"cloudProviderBackoffExponent\" yaml:\"cloudProviderBackoffExponent\"`\n\t// Backoff duration\n\tCloudProviderBackoffDuration int `json:\"cloudProviderBackoffDuration\" yaml:\"cloudProviderBackoffDuration\"`\n\t// Backoff jitter\n\tCloudProviderBackoffJitter float64 `json:\"cloudProviderBackoffJitter\" yaml:\"cloudProviderBackoffJitter\"`\n\t// Enable rate limiting\n\tCloudProviderRateLimit bool `json:\"cloudProviderRateLimit\" yaml:\"cloudProviderRateLimit\"`\n\t// Rate limit QPS\n\tCloudProviderRateLimitQPS float32 `json:\"cloudProviderRateLimitQPS\" yaml:\"cloudProviderRateLimitQPS\"`\n\t// Rate limit Bucket Size\n\tCloudProviderRateLimitBucket int `json:\"cloudProviderRateLimitBucket\" yaml:\"cloudProviderRateLimitBucket\"`\n\n\t// Use instance metadata service where possible\n\tUseInstanceMetadata bool `json:\"useInstanceMetadata\" yaml:\"useInstanceMetadata\"`\n\n\t// Use managed service identity for the virtual machine to access Azure ARM APIs\n\tUseManagedIdentityExtension bool `json:\"useManagedIdentityExtension\"`\n}\n\n// Cloud holds the config and clients\ntype Cloud struct {\n\tConfig\n\tEnvironment azure.Environment\n\tRoutesClient network.RoutesClient\n\tSubnetsClient network.SubnetsClient\n\tInterfacesClient network.InterfacesClient\n\tRouteTablesClient network.RouteTablesClient\n\tLoadBalancerClient network.LoadBalancersClient\n\tPublicIPAddressesClient network.PublicIPAddressesClient\n\tSecurityGroupsClient network.SecurityGroupsClient\n\tVirtualMachinesClient compute.VirtualMachinesClient\n\tStorageAccountClient storage.AccountsClient\n\tDisksClient disk.DisksClient\n\toperationPollRateLimiter flowcontrol.RateLimiter\n\tresourceRequestBackoff wait.Backoff\n\tmetadata *InstanceMetadata\n\n\t*BlobDiskController\n\t*ManagedDiskController\n\t*controllerCommon\n}\n\nfunc init() {\n\tcloudprovider.RegisterCloudProvider(CloudProviderName, NewCloud)\n}\n\n// decodePkcs12 decodes a PKCS#12 client certificate by extracting the public certificate and\n// the private RSA key\nfunc decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.PrivateKey, error) {\n\tprivateKey, certificate, err := pkcs12.Decode(pkcs, password)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"decoding the PKCS#12 client certificate: %v\", err)\n\t}\n\trsaPrivateKey, isRsaKey := privateKey.(*rsa.PrivateKey)\n\tif !isRsaKey {\n\t\treturn nil, nil, fmt.Errorf(\"PKCS#12 certificate must contain a RSA private key\")\n\t}\n\n\treturn certificate, rsaPrivateKey, nil\n}\n\n// GetServicePrincipalToken creates a new service principal token based on the configuration\nfunc GetServicePrincipalToken(config *Config, env *azure.Environment) (*adal.ServicePrincipalToken, error) {\n\toauthConfig, err := adal.NewOAuthConfig(env.ActiveDirectoryEndpoint, config.TenantID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating the OAuth config: %v\", err)\n\t}\n\n\tif config.UseManagedIdentityExtension {\n\t\tglog.V(2).Infoln(\"azure: using managed identity extension to retrieve access token\")\n\t\tmsiEndpoint, err := adal.GetMSIVMEndpoint()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Getting the managed service identity endpoint: %v\", err)\n\t\t}\n\t\treturn adal.NewServicePrincipalTokenFromMSI(\n\t\t\tmsiEndpoint,\n\t\t\tenv.ServiceManagementEndpoint)\n\t}\n\n\tif len(config.AADClientSecret) > 0 {\n\t\tglog.V(2).Infoln(\"azure: using client_id+client_secret to retrieve access token\")\n\t\treturn adal.NewServicePrincipalToken(\n\t\t\t*oauthConfig,\n\t\t\tconfig.AADClientID,\n\t\t\tconfig.AADClientSecret,\n\t\t\tenv.ServiceManagementEndpoint)\n\t}\n\n\tif len(config.AADClientCertPath) > 0 && len(config.AADClientCertPassword) > 0 {\n\t\tglog.V(2).Infoln(\"azure: using jwt client_assertion (client_cert+client_private_key) to retrieve access token\")\n\t\tcertData, err := ioutil.ReadFile(config.AADClientCertPath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"reading the client certificate from file %s: %v\", config.AADClientCertPath, err)\n\t\t}\n\t\tcertificate, privateKey, err := decodePkcs12(certData, config.AADClientCertPassword)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"decoding the client certificate: %v\", err)\n\t\t}\n\t\treturn adal.NewServicePrincipalTokenFromCertificate(\n\t\t\t*oauthConfig,\n\t\t\tconfig.AADClientID,\n\t\t\tcertificate,\n\t\t\tprivateKey,\n\t\t\tenv.ServiceManagementEndpoint)\n\t}\n\n\treturn nil, fmt.Errorf(\"No credentials provided for AAD application %s\", config.AADClientID)\n}\n\n// NewCloud returns a Cloud with initialized clients\nfunc NewCloud(configReader io.Reader) (cloudprovider.Interface, error) {\n\tconfig, env, err := ParseConfig(configReader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\taz := Cloud{\n\t\tConfig: *config,\n\t\tEnvironment: *env,\n\t}\n\n\tservicePrincipalToken, err := GetServicePrincipalToken(config, env)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\taz.SubnetsClient = network.NewSubnetsClient(az.SubscriptionID)\n\taz.SubnetsClient.BaseURI = az.Environment.ResourceManagerEndpoint\n\taz.SubnetsClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)\n\taz.SubnetsClient.PollingDelay = 5 * time.Second\n\tconfigureUserAgent(&az.SubnetsClient.Client)\n\n\taz.RouteTablesClient = network.NewRouteTablesClient(az.SubscriptionID)\n\taz.RouteTablesClient.BaseURI = az.Environment.ResourceManagerEndpoint\n\taz.RouteTablesClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)\n\taz.RouteTablesClient.PollingDelay = 5 * time.Second\n\tconfigureUserAgent(&az.RouteTablesClient.Client)\n\n\taz.RoutesClient = network.NewRoutesClient(az.SubscriptionID)\n\taz.RoutesClient.BaseURI = az.Environment.ResourceManagerEndpoint\n\taz.RoutesClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)\n\taz.RoutesClient.PollingDelay = 5 * time.Second\n\tconfigureUserAgent(&az.RoutesClient.Client)\n\n\taz.InterfacesClient = network.NewInterfacesClient(az.SubscriptionID)\n\taz.InterfacesClient.BaseURI = az.Environment.ResourceManagerEndpoint\n\taz.InterfacesClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)\n\taz.InterfacesClient.PollingDelay = 5 * time.Second\n\tconfigureUserAgent(&az.InterfacesClient.Client)\n\n\taz.LoadBalancerClient = network.NewLoadBalancersClient(az.SubscriptionID)\n\taz.LoadBalancerClient.BaseURI = az.Environment.ResourceManagerEndpoint\n\taz.LoadBalancerClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)\n\taz.LoadBalancerClient.PollingDelay = 5 * time.Second\n\tconfigureUserAgent(&az.LoadBalancerClient.Client)\n\n\taz.VirtualMachinesClient = compute.NewVirtualMachinesClient(az.SubscriptionID)\n\taz.VirtualMachinesClient.BaseURI = az.Environment.ResourceManagerEndpoint\n\taz.VirtualMachinesClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)\n\taz.VirtualMachinesClient.PollingDelay = 5 * time.Second\n\tconfigureUserAgent(&az.VirtualMachinesClient.Client)\n\n\taz.PublicIPAddressesClient = network.NewPublicIPAddressesClient(az.SubscriptionID)\n\taz.PublicIPAddressesClient.BaseURI = az.Environment.ResourceManagerEndpoint\n\taz.PublicIPAddressesClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)\n\taz.PublicIPAddressesClient.PollingDelay = 5 * time.Second\n\tconfigureUserAgent(&az.PublicIPAddressesClient.Client)\n\n\taz.SecurityGroupsClient = network.NewSecurityGroupsClient(az.SubscriptionID)\n\taz.SecurityGroupsClient.BaseURI = az.Environment.ResourceManagerEndpoint\n\taz.SecurityGroupsClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)\n\taz.SecurityGroupsClient.PollingDelay = 5 * time.Second\n\tconfigureUserAgent(&az.SecurityGroupsClient.Client)\n\n\taz.StorageAccountClient = storage.NewAccountsClientWithBaseURI(az.Environment.ResourceManagerEndpoint, az.SubscriptionID)\n\taz.StorageAccountClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)\n\tconfigureUserAgent(&az.StorageAccountClient.Client)\n\n\taz.DisksClient = disk.NewDisksClientWithBaseURI(az.Environment.ResourceManagerEndpoint, az.SubscriptionID)\n\taz.DisksClient.Authorizer = autorest.NewBearerAuthorizer(servicePrincipalToken)\n\tconfigureUserAgent(&az.DisksClient.Client)\n\n\t// Conditionally configure rate limits\n\tif az.CloudProviderRateLimit {\n\t\t// Assign rate limit defaults if no configuration was passed in\n\t\tif az.CloudProviderRateLimitQPS == 0 {\n\t\t\taz.CloudProviderRateLimitQPS = rateLimitQPSDefault\n\t\t}\n\t\tif az.CloudProviderRateLimitBucket == 0 {\n\t\t\taz.CloudProviderRateLimitBucket = rateLimitBucketDefault\n\t\t}\n\t\taz.operationPollRateLimiter = flowcontrol.NewTokenBucketRateLimiter(\n\t\t\taz.CloudProviderRateLimitQPS,\n\t\t\taz.CloudProviderRateLimitBucket)\n\t\tglog.V(2).Infof(\"Azure cloudprovider using rate limit config: QPS=%g, bucket=%d\",\n\t\t\taz.CloudProviderRateLimitQPS,\n\t\t\taz.CloudProviderRateLimitBucket)\n\t} else {\n\t\t// if rate limits are configured off, az.operationPollRateLimiter.Accept() is a no-op\n\t\taz.operationPollRateLimiter = flowcontrol.NewFakeAlwaysRateLimiter()\n\t}\n\n\t// Conditionally configure resource request backoff\n\tif az.CloudProviderBackoff {\n\t\t// Assign backoff defaults if no configuration was passed in\n\t\tif az.CloudProviderBackoffRetries == 0 {\n\t\t\taz.CloudProviderBackoffRetries = backoffRetriesDefault\n\t\t}\n\t\tif az.CloudProviderBackoffExponent == 0 {\n\t\t\taz.CloudProviderBackoffExponent = backoffExponentDefault\n\t\t}\n\t\tif az.CloudProviderBackoffDuration == 0 {\n\t\t\taz.CloudProviderBackoffDuration = backoffDurationDefault\n\t\t}\n\t\tif az.CloudProviderBackoffJitter == 0 {\n\t\t\taz.CloudProviderBackoffJitter = backoffJitterDefault\n\t\t}\n\t\taz.resourceRequestBackoff = wait.Backoff{\n\t\t\tSteps: az.CloudProviderBackoffRetries,\n\t\t\tFactor: az.CloudProviderBackoffExponent,\n\t\t\tDuration: time.Duration(az.CloudProviderBackoffDuration) * time.Second,\n\t\t\tJitter: az.CloudProviderBackoffJitter,\n\t\t}\n\t\tglog.V(2).Infof(\"Azure cloudprovider using retry backoff: retries=%d, exponent=%f, duration=%d, jitter=%f\",\n\t\t\taz.CloudProviderBackoffRetries,\n\t\t\taz.CloudProviderBackoffExponent,\n\t\t\taz.CloudProviderBackoffDuration,\n\t\t\taz.CloudProviderBackoffJitter)\n\t}\n\n\taz.metadata = NewInstanceMetadata()\n\n\tif err := initDiskControllers(&az); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &az, nil\n}\n\n// ParseConfig returns a parsed configuration and azure.Environment for an Azure cloudprovider config file\nfunc ParseConfig(configReader io.Reader) (*Config, *azure.Environment, error) {\n\tvar config Config\n\tvar env azure.Environment\n\n\tif configReader == nil {\n\t\treturn &config, &env, nil\n\t}\n\n\tconfigContents, err := ioutil.ReadAll(configReader)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\terr = yaml.Unmarshal(configContents, &config)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tif config.Cloud == \"\" {\n\t\tenv = azure.PublicCloud\n\t} else {\n\t\tenv, err = azure.EnvironmentFromName(config.Cloud)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\treturn &config, &env, nil\n}\n\n// Initialize passes a Kubernetes clientBuilder interface to the cloud provider\nfunc (az *Cloud) Initialize(clientBuilder controller.ControllerClientBuilder) {}\n\n// LoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise.\nfunc (az *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool) {\n\treturn az, true\n}\n\n// Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.\nfunc (az *Cloud) Instances() (cloudprovider.Instances, bool) {\n\treturn az, true\n}\n\n// Zones returns a zones interface. Also returns true if the interface is supported, false otherwise.\nfunc (az *Cloud) Zones() (cloudprovider.Zones, bool) {\n\treturn az, true\n}\n\n// Clusters returns a clusters interface. Also returns true if the interface is supported, false otherwise.\nfunc (az *Cloud) Clusters() (cloudprovider.Clusters, bool) {\n\treturn nil, false\n}\n\n// Routes returns a routes interface along with whether the interface is supported.\nfunc (az *Cloud) Routes() (cloudprovider.Routes, bool) {\n\treturn az, true\n}\n\n// ScrubDNS provides an opportunity for cloud-provider-specific code to process DNS settings for pods.\nfunc (az *Cloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string) {\n\treturn nameservers, searches\n}\n\n// HasClusterID returns true if the cluster has a clusterID\nfunc (az *Cloud) HasClusterID() bool {\n\treturn true\n}\n\n// ProviderName returns the cloud provider ID.\nfunc (az *Cloud) ProviderName() string {\n\treturn CloudProviderName\n}\n\n// configureUserAgent configures the autorest client with a user agent that\n// includes \"kubernetes\" and the full kubernetes git version string\n// example:\n// Azure-SDK-for-Go/7.0.1-beta arm-network/2016-09-01; kubernetes-cloudprovider/v1.7.0-alpha.2.711+a2fadef8170bb0-dirty;\nfunc configureUserAgent(client *autorest.Client) {\n\tk8sVersion := version.Get().GitVersion\n\tclient.UserAgent = fmt.Sprintf(\"%s; kubernetes-cloudprovider/%s\", client.UserAgent, k8sVersion)\n}\n\nfunc initDiskControllers(az *Cloud) error {\n\t// Common controller contains the function\n\t// needed by both blob disk and managed disk controllers\n\n\tcommon := &controllerCommon{\n\t\taadResourceEndPoint: az.Environment.ServiceManagementEndpoint,\n\t\tclientID: az.AADClientID,\n\t\tclientSecret: az.AADClientSecret,\n\t\tlocation: az.Location,\n\t\tstorageEndpointSuffix: az.Environment.StorageEndpointSuffix,\n\t\tmanagementEndpoint: az.Environment.ResourceManagerEndpoint,\n\t\tresourceGroup: az.ResourceGroup,\n\t\ttenantID: az.TenantID,\n\t\ttokenEndPoint: az.Environment.ActiveDirectoryEndpoint,\n\t\tsubscriptionID: az.SubscriptionID,\n\t\tcloud: az,\n\t}\n\n\t// BlobDiskController: contains the function needed to\n\t// create/attach/detach/delete blob based (unmanaged disks)\n\tblobController, err := newBlobDiskController(common)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"AzureDisk - failed to init Blob Disk Controller with error (%s)\", err.Error())\n\t}\n\n\t// ManagedDiskController: contains the functions needed to\n\t// create/attach/detach/delete managed disks\n\tmanagedController, err := newManagedDiskController(common)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"AzureDisk - failed to init Managed Disk Controller with error (%s)\", err.Error())\n\t}\n\n\taz.BlobDiskController = blobController\n\taz.ManagedDiskController = managedController\n\taz.controllerCommon = common\n\n\treturn nil\n}\n", "meta": {"content_hash": "ddceafad59fd4554816645c7d8d72191", "timestamp": "", "source": "github", "line_count": 440, "max_line_length": 173, "avg_line_length": 41.402272727272724, "alnum_prop": 0.7819070099357742, "repo_name": "guangxuli/kubernetes", "id": "ee9ebf352fae9752d3970f87599c2284327e7c59", "size": "18786", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "pkg/cloudprovider/providers/azure/azure.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "2525"}, {"name": "Go", "bytes": "37484418"}, {"name": "HTML", "bytes": "1199467"}, {"name": "Makefile", "bytes": "73377"}, {"name": "PowerShell", "bytes": "4261"}, {"name": "Python", "bytes": "2546728"}, {"name": "Ruby", "bytes": "1733"}, {"name": "SaltStack", "bytes": "52094"}, {"name": "Shell", "bytes": "1642811"}]}} +{"text": "module API\nend\n", "meta": {"content_hash": "2c708cc6e49eed2c0bf9a5a6704eb0b9", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 10, "avg_line_length": 7.5, "alnum_prop": 0.8, "repo_name": "metova/metova-rails", "id": "6e6f9edc6c2e514e6541b35d6b4cff91c29bb9e5", "size": "15", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/metova/api.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1500"}, {"name": "HTML", "bytes": "5647"}, {"name": "JavaScript", "bytes": "1351"}, {"name": "Ruby", "bytes": "87018"}]}} +{"text": "<?php\r\n\r\n\r\n/** Zend_Config */\r\nrequire_once 'Zend/Config.php';\r\n\r\n/**\r\n * @package Zend_Controller\r\n * @subpackage Router\r\n * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)\r\n * @license http://framework.zend.com/license/new-bsd New BSD License\r\n */\r\ninterface Zend_Controller_Router_Route_Interface {\r\n public function match($path);\r\n public function assemble($data = array(), $reset = false, $encode = false);\r\n public static function getInstance(Zend_Config $config);\r\n}\r\n\r\n", "meta": {"content_hash": "10413756cf50b3bc54f82fa578debc52", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 87, "avg_line_length": 29.61111111111111, "alnum_prop": 0.6660412757973734, "repo_name": "ankuradhey/dealtrip", "id": "d20be20338c6e3891acaee16883b5edaf245e17d", "size": "1299", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/Zend/Controller/Router/Route/Interface.php", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ApacheConf", "bytes": "395"}, {"name": "CSS", "bytes": "674987"}, {"name": "HTML", "bytes": "2367754"}, {"name": "JavaScript", "bytes": "2191952"}, {"name": "PHP", "bytes": "16297944"}, {"name": "Python", "bytes": "42582"}]}} +{"text": "namespace bluez {\n\n// This class contains a Bluetooth service attribute. A service attribute is\n// defined by the following fields,\n// type: This is the type of the attribute. Along with being any of the\n// fixed types, an attribute can also be of type sequence, which means\n// that it contains an array of other attributes.\n// size: This is the size of the attribute. This can be variable for each type.\n// For example, a UUID can have the sizes, 2, 4 or 16 bytes.\n// value: This is the raw value of the attribute. For example, for a UUID, it\n// will be the string representation of the UUID. For a sequence, it\n// will be an array of other attributes.\nclass DEVICE_BLUETOOTH_EXPORT BluetoothServiceAttributeValueBlueZ {\n public:\n enum Type { NULLTYPE = 0, UINT, INT, UUID, STRING, BOOL, SEQUENCE, URL };\n\n using Sequence = std::vector<BluetoothServiceAttributeValueBlueZ>;\n\n BluetoothServiceAttributeValueBlueZ();\n BluetoothServiceAttributeValueBlueZ(Type type,\n size_t size,\n std::unique_ptr<base::Value> value);\n explicit BluetoothServiceAttributeValueBlueZ(\n std::unique_ptr<Sequence> sequence);\n BluetoothServiceAttributeValueBlueZ(\n const BluetoothServiceAttributeValueBlueZ& attribute);\n BluetoothServiceAttributeValueBlueZ& operator=(\n const BluetoothServiceAttributeValueBlueZ& attribute);\n ~BluetoothServiceAttributeValueBlueZ();\n\n Type type() const { return type_; }\n size_t size() const { return size_; }\n const Sequence& sequence() const { return *sequence_.get(); }\n const base::Value& value() const { return *value_.get(); }\n\n private:\n Type type_;\n size_t size_;\n std::unique_ptr<base::Value> value_;\n std::unique_ptr<Sequence> sequence_;\n};\n\n} // namespace bluez\n\n#endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_SERVICE_ATTRIBUTE_VALUE_BLUEZ_H_\n", "meta": {"content_hash": "6ddee5f2d41f0e4baba9525148d757df", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 80, "avg_line_length": 42.266666666666666, "alnum_prop": 0.7018927444794952, "repo_name": "ssaroha/node-webrtc", "id": "fdd291a5f100e4cdced1af2460235afdcf30b4ec", "size": "2346", "binary": false, "copies": "14", "ref": "refs/heads/develop", "path": "third_party/webrtc/include/chromium/src/device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Batchfile", "bytes": "6179"}, {"name": "C", "bytes": "2679"}, {"name": "C++", "bytes": "54327"}, {"name": "HTML", "bytes": "434"}, {"name": "JavaScript", "bytes": "42707"}, {"name": "Python", "bytes": "3835"}]}} +{"text": "use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};\nuse ::RegType::*;\nuse ::instruction_def::*;\nuse ::Operand::*;\nuse ::Reg::*;\nuse ::RegScale::*;\nuse ::test::run_test;\n\n#[test]\nfn vmovupd_1() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM6)), operand2: Some(Direct(XMM1)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 249, 16, 241], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_2() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM0)), operand2: Some(IndirectScaledIndexed(ECX, EDX, Four, Some(OperandSize::Xmmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 249, 16, 4, 145], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_3() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM3)), operand2: Some(Direct(XMM5)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 249, 16, 221], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_4() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM3)), operand2: Some(Indirect(RAX, Some(OperandSize::Xmmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 249, 16, 24], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_5() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM0)), operand2: Some(Direct(YMM6)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 253, 16, 198], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_6() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM5)), operand2: Some(Indirect(ESI, Some(OperandSize::Ymmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 253, 16, 46], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_7() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM5)), operand2: Some(Direct(YMM2)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 253, 16, 234], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_8() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM2)), operand2: Some(Indirect(RSI, Some(OperandSize::Ymmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 253, 16, 22], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_9() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM6)), operand2: Some(Direct(XMM7)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K4), broadcast: None }, &[98, 241, 253, 140, 16, 247], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_10() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM1)), operand2: Some(IndirectScaledIndexed(EDX, ECX, Four, Some(OperandSize::Xmmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K1), broadcast: None }, &[98, 241, 253, 137, 16, 12, 138], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_11() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM20)), operand2: Some(Direct(XMM4)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K6), broadcast: None }, &[98, 225, 253, 142, 16, 228], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_12() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM17)), operand2: Some(IndirectDisplaced(RCX, 1305176396, Some(OperandSize::Xmmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K1), broadcast: None }, &[98, 225, 253, 137, 16, 137, 76, 105, 203, 77], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_13() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM7)), operand2: Some(Direct(YMM4)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K7), broadcast: None }, &[98, 241, 253, 175, 16, 252], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_14() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM5)), operand2: Some(Indirect(EAX, Some(OperandSize::Ymmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K2), broadcast: None }, &[98, 241, 253, 170, 16, 40], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_15() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM28)), operand2: Some(Direct(YMM30)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K5), broadcast: None }, &[98, 1, 253, 173, 16, 230], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_16() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM30)), operand2: Some(IndirectDisplaced(RDX, 408359552, Some(OperandSize::Ymmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K4), broadcast: None }, &[98, 97, 253, 172, 16, 178, 128, 18, 87, 24], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_17() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(ZMM0)), operand2: Some(Direct(ZMM1)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K7), broadcast: None }, &[98, 241, 253, 207, 16, 193], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_18() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(ZMM0)), operand2: Some(IndirectScaledIndexed(ESI, ECX, Eight, Some(OperandSize::Zmmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K4), broadcast: None }, &[98, 241, 253, 204, 16, 4, 206], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_19() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(ZMM1)), operand2: Some(Direct(ZMM4)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K6), broadcast: None }, &[98, 241, 253, 206, 16, 204], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_20() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(ZMM11)), operand2: Some(IndirectScaledDisplaced(RBX, Eight, 1416962940, Some(OperandSize::Zmmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K1), broadcast: None }, &[98, 113, 253, 201, 16, 28, 221, 124, 35, 117, 84], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_21() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM1)), operand2: Some(Direct(XMM5)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 249, 16, 205], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_22() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(IndirectScaledIndexedDisplaced(EBX, ESI, Four, 270910934, Some(OperandSize::Xmmword), None)), operand2: Some(Direct(XMM0)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 249, 17, 132, 179, 214, 197, 37, 16], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_23() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM7)), operand2: Some(Direct(XMM4)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 249, 16, 252], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_24() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(IndirectScaledIndexedDisplaced(RDI, RSI, Four, 1129257858, Some(OperandSize::Xmmword), None)), operand2: Some(Direct(XMM4)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 249, 17, 164, 183, 130, 27, 79, 67], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_25() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM3)), operand2: Some(Direct(YMM7)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 253, 16, 223], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_26() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Indirect(EDI, Some(OperandSize::Ymmword), None)), operand2: Some(Direct(YMM6)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 253, 17, 55], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_27() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM5)), operand2: Some(Direct(YMM0)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 253, 16, 232], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_28() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(IndirectDisplaced(RSI, 1989076454, Some(OperandSize::Ymmword), None)), operand2: Some(Direct(YMM5)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 253, 17, 174, 230, 229, 142, 118], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_29() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM6)), operand2: Some(Direct(XMM4)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K2), broadcast: None }, &[98, 241, 253, 138, 16, 244], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_30() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(IndirectScaledIndexedDisplaced(EBX, ESI, Eight, 1711242735, Some(OperandSize::Xmmword), None)), operand2: Some(Direct(XMM2)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 249, 17, 148, 243, 239, 125, 255, 101], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_31() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(XMM16)), operand2: Some(Direct(XMM2)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K3), broadcast: None }, &[98, 225, 253, 139, 16, 194], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_32() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(IndirectDisplaced(RBX, 2001347007, Some(OperandSize::Xmmword), None)), operand2: Some(Direct(XMM24)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 97, 253, 8, 17, 131, 191, 33, 74, 119], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_33() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM2)), operand2: Some(Direct(YMM2)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K5), broadcast: None }, &[98, 241, 253, 173, 16, 210], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_34() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Indirect(EDX, Some(OperandSize::Ymmword), None)), operand2: Some(Direct(YMM1)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[197, 253, 17, 10], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_35() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(YMM1)), operand2: Some(Direct(YMM6)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K3), broadcast: None }, &[98, 241, 253, 171, 16, 206], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_36() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(IndirectDisplaced(RDI, 23682063, Some(OperandSize::Ymmword), None)), operand2: Some(Direct(YMM30)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 97, 253, 40, 17, 183, 15, 92, 105, 1], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_37() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(ZMM0)), operand2: Some(Direct(ZMM7)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K5), broadcast: None }, &[98, 241, 253, 205, 16, 199], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_38() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(IndirectScaledDisplaced(EAX, Eight, 2015011794, Some(OperandSize::Zmmword), None)), operand2: Some(Direct(ZMM3)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 241, 253, 72, 17, 28, 197, 210, 163, 26, 120], OperandSize::Dword)\n}\n\n#[test]\nfn vmovupd_39() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(Direct(ZMM3)), operand2: Some(Direct(ZMM21)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K5), broadcast: None }, &[98, 177, 253, 205, 16, 221], OperandSize::Qword)\n}\n\n#[test]\nfn vmovupd_40() {\n run_test(&Instruction { mnemonic: Mnemonic::VMOVUPD, operand1: Some(IndirectDisplaced(RDX, 1033804406, Some(OperandSize::Zmmword), None)), operand2: Some(Direct(ZMM10)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[98, 113, 253, 72, 17, 146, 118, 154, 158, 61], OperandSize::Qword)\n}\n\n", "meta": {"content_hash": "7623f27e6c7f5b0023deeedfa91e31ac", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 416, "avg_line_length": 71.5, "alnum_prop": 0.6976196880043034, "repo_name": "GregoryComer/rust-x86asm", "id": "3d8ab93fa9770b9b96827f31fd2ecdf71a7467a7", "size": "14872", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/instruction_tests/instr_vmovupd.rs", "mode": "33188", "license": "mit", "language": [{"name": "Rust", "bytes": "18282823"}, {"name": "Shell", "bytes": "3038"}]}} +{"text": "\ufeffusing UnityEngine;\nusing System.Collections;\n\npublic class Arrow : MonoBehaviour {\n\n\tAnimator _anim;\n\tVector3 facing;\n\tpublic float rayDist;\n\tbool fall;\n\tVector3 yPos;\n\tpublic float fallTime;\n\tTransform _myTransform;\n\tVector3 boxScale;\n\tBoxCollider boxColl;\n\t[HideInInspector]public float damage;\n\tPlayerRanger pr;\n\tGameObject ranger;\n\n\tvoid Awake()\n\t{\n\t\t//_anim.GetComponent<Animator>();\n\t\tboxColl = GetComponent<BoxCollider>();\n\t\tboxScale = new Vector3(boxColl.size.x, boxColl.size.y, boxColl.size.z+.2f);\n\t\t_myTransform = transform;\n\t\tyPos = new Vector3(0, 1, 0);\n\t\ttransform.up = yPos;\n\t\tranger = GameObject.FindWithTag(\"Ranger\");\n\t}\n\t\n\tvoid OnCollisionEnter(Collision other)\n\t{\n\t\trigidbody.velocity = Vector3.zero;\n\t\tfall = true;\n\t}\n\n\tvoid OnTriggerEnter (Collider other)\n\t{\n\t\tif(other.tag == \"Ranger\")\n\t\t{\n\t\t\tother.GetComponent<PlayerRanger>().arrowsCurr++;\n\t\t\tDestroy(gameObject);\n\t\t}\n\t}\n\n\tvoid Update()\n\t{\n\t\tDebug.DrawRay (transform.position, transform.right * rayDist, Color.magenta);\n\t\tRaycastHit hit;\n\t\tif(Physics.Raycast(transform.position, transform.right, out hit, rayDist))\n\t\t{\n\t\t\tif(hit.collider.tag == \"Prop\")\n\t\t\t{\n\t\t\t\trayDist = 0.015f;\n\t\t\t\tCollection();\n\t\t\t}\n\t\t\tif(hit.collider.tag == \"Warrior\")\n\t\t\t{\n\t\t\t\trayDist = 0.015f;\n\t\t\t\tif(!hit.collider.GetComponent<PlayerWarrior>().lockedOn)\n\t\t\t\t{\n\t\t\t\t\thit.collider.BroadcastMessage(\"ApplyDamage\", damage);\n\t\t\t\t\thit.collider.BroadcastMessage(\"StopHealthCharge\");\n\t\t\t\t\tranger.GetComponent<PlayerRanger>().arrowsCurr++;\n\t\t\t\t\tDestroy(gameObject);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(fall)\n\t\t{\n\t\t\trigidbody.useGravity = true;\n\t\t\tif(_myTransform.position.y <= -5.94f)\n\t\t\t{\n\t\t\t\trigidbody.velocity = Vector3.zero;\n\t\t\t\trigidbody.useGravity = false;\n\t\t\t\tCollection();\n\t\t\t\tGetComponent<BoxCollider>().size = boxScale;\n\t\t\t\tfall = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tvoid Collection()\n\t{\n\t\trigidbody.isKinematic = true;\n\t\tGetComponent<BoxCollider>().isTrigger = true;\n\t\tgameObject.layer = LayerMask.NameToLayer(\"Default\");\n\t}\n}\n", "meta": {"content_hash": "dc3707eb0f56ef03a83c4821ec55f78b", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 21.876404494382022, "alnum_prop": 0.6825885978428351, "repo_name": "Daeltaja/FinalProj", "id": "8aa416f1cd2b8a73df2b5a78c8e5b3442ce06ebd", "size": "1949", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Assets/Scripts/Arrow.cs", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "1725"}, {"name": "C#", "bytes": "306121"}, {"name": "JavaScript", "bytes": "216"}]}} +{"text": "/**\n * CommonError.java\n *\n * This file was auto-generated from WSDL\n * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.\n */\n\npackage com.google.api.ads.dfp.v201302;\n\n\n/**\n * A place for common errors that can be used across services.\n */\npublic class CommonError extends com.google.api.ads.dfp.v201302.ApiError implements java.io.Serializable {\n private com.google.api.ads.dfp.v201302.CommonErrorReason reason;\n\n public CommonError() {\n }\n\n public CommonError(\n java.lang.String fieldPath,\n java.lang.String trigger,\n java.lang.String errorString,\n java.lang.String apiErrorType,\n com.google.api.ads.dfp.v201302.CommonErrorReason reason) {\n super(\n fieldPath,\n trigger,\n errorString,\n apiErrorType);\n this.reason = reason;\n }\n\n\n /**\n * Gets the reason value for this CommonError.\n * \n * @return reason\n */\n public com.google.api.ads.dfp.v201302.CommonErrorReason getReason() {\n return reason;\n }\n\n\n /**\n * Sets the reason value for this CommonError.\n * \n * @param reason\n */\n public void setReason(com.google.api.ads.dfp.v201302.CommonErrorReason reason) {\n this.reason = reason;\n }\n\n private java.lang.Object __equalsCalc = null;\n public synchronized boolean equals(java.lang.Object obj) {\n if (!(obj instanceof CommonError)) return false;\n CommonError other = (CommonError) obj;\n if (obj == null) return false;\n if (this == obj) return true;\n if (__equalsCalc != null) {\n return (__equalsCalc == obj);\n }\n __equalsCalc = obj;\n boolean _equals;\n _equals = super.equals(obj) && \n ((this.reason==null && other.getReason()==null) || \n (this.reason!=null &&\n this.reason.equals(other.getReason())));\n __equalsCalc = null;\n return _equals;\n }\n\n private boolean __hashCodeCalc = false;\n public synchronized int hashCode() {\n if (__hashCodeCalc) {\n return 0;\n }\n __hashCodeCalc = true;\n int _hashCode = super.hashCode();\n if (getReason() != null) {\n _hashCode += getReason().hashCode();\n }\n __hashCodeCalc = false;\n return _hashCode;\n }\n\n // Type metadata\n private static org.apache.axis.description.TypeDesc typeDesc =\n new org.apache.axis.description.TypeDesc(CommonError.class, true);\n\n static {\n typeDesc.setXmlType(new javax.xml.namespace.QName(\"https://www.google.com/apis/ads/publisher/v201302\", \"CommonError\"));\n org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();\n elemField.setFieldName(\"reason\");\n elemField.setXmlName(new javax.xml.namespace.QName(\"https://www.google.com/apis/ads/publisher/v201302\", \"reason\"));\n elemField.setXmlType(new javax.xml.namespace.QName(\"https://www.google.com/apis/ads/publisher/v201302\", \"CommonError.Reason\"));\n elemField.setMinOccurs(0);\n elemField.setNillable(false);\n typeDesc.addFieldDesc(elemField);\n }\n\n /**\n * Return type metadata object\n */\n public static org.apache.axis.description.TypeDesc getTypeDesc() {\n return typeDesc;\n }\n\n /**\n * Get Custom Serializer\n */\n public static org.apache.axis.encoding.Serializer getSerializer(\n java.lang.String mechType, \n java.lang.Class _javaType, \n javax.xml.namespace.QName _xmlType) {\n return \n new org.apache.axis.encoding.ser.BeanSerializer(\n _javaType, _xmlType, typeDesc);\n }\n\n /**\n * Get Custom Deserializer\n */\n public static org.apache.axis.encoding.Deserializer getDeserializer(\n java.lang.String mechType, \n java.lang.Class _javaType, \n javax.xml.namespace.QName _xmlType) {\n return \n new org.apache.axis.encoding.ser.BeanDeserializer(\n _javaType, _xmlType, typeDesc);\n }\n\n}\n", "meta": {"content_hash": "1f209feaa3c66ee2a4a2c7d6b18158de", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 135, "avg_line_length": 30.834586466165412, "alnum_prop": 0.6100950987564009, "repo_name": "google-code-export/google-api-dfp-java", "id": "0c2a22760e7b7c87e715a51d332992ee25d88fcf", "size": "4101", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/google/api/ads/dfp/v201302/CommonError.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "39950935"}]}} +{"text": "package net.sargue.mailgun;\n\nimport javax.ws.rs.client.*;\nimport java.util.List;\n\n/**\n * Representation of a Mailgun's mail request.\n * <p>\n * It must be built using a {@link MailBuilder}.\n */\npublic abstract class Mail {\n private final Configuration configuration;\n\n Mail(Configuration configuration) {\n this.configuration = configuration;\n }\n\n /**\n * Convenience shortcut to {@code MailBuilder.using(configuration)}\n *\n * @param configuration the configuration to use\n * @return a new {@link MailBuilder} which uses the specified configuration\n */\n public static MailBuilder using(Configuration configuration) {\n return new MailBuilder(configuration);\n }\n\n /**\n * Retrieves the value of a given mail parameter. If there are multiple\n * values the first one is returned. If the parameter hasn't been set\n * null is returned.\n *\n * Can only be used on simple parameters (String). So don't use it on\n * <i>attachment</i> for example. Doing so will throw a\n * {@link IllegalStateException}.\n *\n * @param param the name of the parameter\n * @return the first value of the parameter, if any, null otherwise\n * @throws IllegalStateException if the parameter is not a simple (basic text) one\n */\n public abstract String getFirstValue(String param);\n\n /**\n * Retrieves the values of a given mail parameter. If the parameter hasn't\n * been set an empty list is returned.\n *\n * Can only be used on simple parameters (String). So don't use it on\n * <i>attachment</i> for example. Doing so will throw a\n * {@link IllegalStateException}.\n *\n * @param param the name of the parameter\n * @return the list of values for the parameter or an empty list\n * @throws IllegalStateException if the parameter is not a simple (basic text) one\n */\n public abstract List<String> getValues(String param);\n\n /**\n * Sends the email.\n * <p>\n * This method send the request to the Mailgun service. It is a\n * <strong>blocking</strong> method so it will return upon request\n * completion.\n *\n * @return the response from the Mailgun service or null if the message\n * is not sent (filtered by {@link MailSendFilter}\n */\n public Response send() {\n if (!configuration.mailSendFilter().filter(this)) return null;\n prepareSend();\n return new Response(request().post(entity()));\n }\n\n /**\n * Sends the email asynchronously.\n * <p>\n * This method returns immediately, sending the request to the Mailgun\n * service in the background. It is a <strong>non-blocking</strong>\n * method.\n *\n * @param callback the callback to be invoked upon completion or failure\n */\n public void sendAsync(final MailRequestCallback callback) {\n if (!configuration.mailSendFilter().filter(this)) return;\n prepareSend();\n request()\n .async()\n .post(entity(),\n new InvocationCallback<javax.ws.rs.core.Response>() {\n @Override\n public void completed(javax.ws.rs.core.Response o) {\n callback.completed(new Response(o));\n }\n\n @Override\n public void failed(Throwable throwable) {\n callback.failed(throwable);\n }\n });\n }\n\n /**\n * Sends the email asynchronously. It uses the configuration provided\n * default callback if available, ignoring the outcome otherwise.\n *\n * If you want to use a specific callback for this call use\n * {@link #sendAsync(MailRequestCallback)} instead.\n */\n public void sendAsync() {\n if (!configuration.mailSendFilter().filter(this)) return;\n MailRequestCallbackFactory factory = configuration.mailRequestCallbackFactory();\n if (factory == null) {\n prepareSend();\n request().async().post(entity());\n } else\n sendAsync(factory.create(this));\n }\n\n /**\n * Retrieves the configuration associated with this Mail.\n *\n * @return the underlying configuration\n */\n public Configuration configuration() {\n return configuration;\n }\n\n abstract Entity<?> entity(); //NOSONAR\n\n abstract void prepareSend();\n\n void configureTarget(WebTarget target) {\n //defaults to no-op\n }\n\n private Invocation.Builder request() {\n WebTarget target = configuration.getTarget();\n configureTarget(target);\n return target.path(configuration.domain()).path(\"messages\").request();\n }\n}\n", "meta": {"content_hash": "37c2b2a7556228c212197762bba63646", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 88, "avg_line_length": 33.93571428571428, "alnum_prop": 0.6162913070932435, "repo_name": "sargue/mailgun", "id": "a40874e02801c190fb9de545fc637f6d2c250388", "size": "4751", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/net/sargue/mailgun/Mail.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "117011"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"vertical\" >\n \n\n <RelativeLayout \n android:layout_width=\"match_parent\"\n android:layout_height=\"50dp\"\n android:background=\"#484E61\"\n >\n \n <TextView \n android:id=\"@+id/title_text\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_centerInParent=\"true\"\n android:textColor=\"#fff\"\n android:textSize=\"24sp\"\n />\n </RelativeLayout>\n <ListView \n android:id=\"@+id/list_view\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n >\n </ListView>\n</LinearLayout>\n", "meta": {"content_hash": "8f579652f42173c3e02ab7db9ae0706d", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 72, "avg_line_length": 30.75862068965517, "alnum_prop": 0.5964125560538116, "repo_name": "yb1415185602/collweather", "id": "658826ca8d5a0494bfc6b4e5b8c7fdf3b969b075", "size": "892", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "res/layout/choose_area.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "27177"}]}} +{"text": "<?php\n\nuse yii\\helpers\\Html;\nuse yii\\widgets\\ActiveForm;\nuse yii\\helpers\\ArrayHelper;\nuse kartik\\select2\\Select2;\n\n/* @var $this yii\\web\\View */\n/* @var $model app\\models\\Empleado */\n/* @var $form yii\\widgets\\ActiveForm */\n?>\n\n<div class=\"empleado-form\">\n\n <?php $form = ActiveForm::begin(); ?>\n\n <?= $form->field($model, 'nombre')->textInput() ?>\n\n <?= $form->field($model, 'direccion')->textInput() ?>\n\n <?= $form->field($model, 'contacto')->textInput() ?>\n\n <?= $form->field($model, 'telefono')->textInput() ?>\n\n <?= $form->field($model, 'correo')->textInput() ?>\n\n\n\n <?= Html::submitButton($model->isNewRecord ? 'Guardar' : 'Guardar cambios', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>\n </div>\n\n <?php ActiveForm::end(); ?>\n\n</div>\n", "meta": {"content_hash": "eae12c72c212f0a39e8bc9b915f06a96", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 160, "avg_line_length": 23.558823529411764, "alnum_prop": 0.5930087390761548, "repo_name": "rzamarripa/shabel", "id": "2baa8926b064eb2a287b05a5e1cdd226cbe8c53f", "size": "801", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "views/proveedor/_form.php", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ApacheConf", "bytes": "199"}, {"name": "Batchfile", "bytes": "1030"}, {"name": "CSS", "bytes": "1533204"}, {"name": "HTML", "bytes": "179629"}, {"name": "JavaScript", "bytes": "3469599"}, {"name": "PHP", "bytes": "295872"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:paddingBottom=\"@dimen/activity_vertical_margin\"\n android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n android:paddingRight=\"@dimen/activity_horizontal_margin\"\n android:paddingTop=\"@dimen/activity_vertical_margin\"\n tools:context=\"com.gr4yscale.havit.MainActivity\">\n\n <TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Hello World!\" />\n</RelativeLayout>\n", "meta": {"content_hash": "ef328dcd460b0dc0dd7a198ee8c2140c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 74, "avg_line_length": 43.6875, "alnum_prop": 0.7267525035765379, "repo_name": "gr4yscale/havit", "id": "ee547d115bf31a18531fca906258dac19bc0fae1", "size": "699", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "android/Havit/app/src/main/res/layout/activity_main.xml", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "6911"}, {"name": "Java", "bytes": "6698"}, {"name": "JavaScript", "bytes": "131667"}, {"name": "Objective-C", "bytes": "236235"}, {"name": "Shell", "bytes": "50"}]}} +{"text": "// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-\n//\n// rcast.h: Rcpp R/C++ interface class library -- cast from one SEXP type to another\n//\n// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois\n//\n// This file is part of Rcpp.\n//\n// Rcpp is free software: you can redistribute it and/or modify it\n// under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 2 of the License, or\n// (at your option) any later version.\n//\n// Rcpp is distributed in the hope that it will be useful, but\n// WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.\n\n#ifndef Rcpp_rcast_h\n#define Rcpp_rcast_h\n\n#include <Rcpp/exceptions.h>\n\nnamespace Rcpp{\n namespace internal {\n\n inline SEXP convert_using_rfunction(SEXP x, const char* const fun){\n Armor<SEXP> res ;\n try{\n SEXP funSym = Rf_install(fun);\n res = Rcpp_eval( Rf_lang2( funSym, x ) ) ;\n } catch( eval_error& e){\n throw not_compatible( std::string(\"could not convert using R function : \") + fun ) ;\n }\n return res;\n }\n\n // r_true_cast is only meant to be used when the target SEXP type\n // is different from the SEXP type of x\n template <int TARGET>\n SEXP r_true_cast( SEXP x) {\n throw not_compatible( \"not compatible\" ) ;\n return x ; // makes solaris happy\n }\n\n template <int RTYPE>\n SEXP basic_cast( SEXP x){\n if( TYPEOF(x) == RTYPE ) return x ;\n switch( TYPEOF(x) ){\n case REALSXP:\n case RAWSXP:\n case LGLSXP:\n case CPLXSXP:\n case INTSXP:\n return Rf_coerceVector( x, RTYPE) ;\n default:\n throw ::Rcpp::not_compatible( \"not compatible with requested type\" ) ;\n }\n return R_NilValue ; /* -Wall */\n }\n\n template<>\n inline SEXP r_true_cast<INTSXP>(SEXP x){\n return basic_cast<INTSXP>(x) ;\n }\n template<>\n inline SEXP r_true_cast<REALSXP>(SEXP x){\n return basic_cast<REALSXP>(x) ;\n }\n template<>\n inline SEXP r_true_cast<RAWSXP>(SEXP x){\n return basic_cast<RAWSXP>(x) ;\n }\n template<>\n inline SEXP r_true_cast<CPLXSXP>(SEXP x){\n return basic_cast<CPLXSXP>(x) ;\n }\n template<>\n inline SEXP r_true_cast<LGLSXP>(SEXP x){\n return basic_cast<LGLSXP>(x) ;\n }\n\n template <>\n inline SEXP r_true_cast<STRSXP>(SEXP x){\n switch( TYPEOF( x ) ){\n case CPLXSXP:\n case RAWSXP:\n case LGLSXP:\n case REALSXP:\n case INTSXP:\n {\n // return Rf_coerceVector( x, STRSXP );\n // coerceVector does not work for some reason\n Shield<SEXP> call( Rf_lang2( Rf_install( \"as.character\" ), x ) ) ;\n Shield<SEXP> res( Rcpp_eval( call, R_GlobalEnv ) ) ;\n return res ;\n }\n case CHARSXP:\n return Rf_ScalarString( x ) ;\n case SYMSXP:\n return Rf_ScalarString( PRINTNAME( x ) ) ;\n default:\n throw ::Rcpp::not_compatible( \"not compatible with STRSXP\" ) ;\n }\n return R_NilValue ; /* -Wall */\n }\n template<>\n inline SEXP r_true_cast<VECSXP>(SEXP x) {\n return convert_using_rfunction(x, \"as.list\" ) ;\n }\n template<>\n inline SEXP r_true_cast<EXPRSXP>(SEXP x) {\n return convert_using_rfunction(x, \"as.expression\" ) ;\n }\n template<>\n inline SEXP r_true_cast<LISTSXP>(SEXP x) {\n switch( TYPEOF(x) ){\n case LANGSXP:\n {\n Shield<SEXP> y( Rf_duplicate( x ));\n SET_TYPEOF(y,LISTSXP) ;\n return y ;\n }\n default:\n return convert_using_rfunction(x, \"as.pairlist\" ) ;\n }\n }\n template<>\n inline SEXP r_true_cast<LANGSXP>(SEXP x) {\n return convert_using_rfunction(x, \"as.call\" ) ;\n }\n\n } // namespace internal\n\n template <int TARGET> SEXP r_cast(SEXP x) {\n if (TYPEOF(x) == TARGET) {\n return x;\n } else {\n #ifdef RCPP_WARN_ON_COERCE\n Shield<SEXP> result( internal::r_true_cast<TARGET>(x) );\n Rf_warning(\"coerced object from '%s' to '%s'\",\n CHAR(Rf_type2str(TYPEOF(x))),\n CHAR(Rf_type2str(TARGET))\n );\n return result;\n #else\n return internal::r_true_cast<TARGET>(x);\n #endif\n }\n }\n\n} // namespace Rcpp\n\n#endif\n", "meta": {"content_hash": "dc9b692f6bde56c1053394b14f140621", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 101, "avg_line_length": 32.93630573248408, "alnum_prop": 0.5167279056275382, "repo_name": "bccpp/bccpp.github.io", "id": "496a4d9965cca71e2bcd40a5c9ef2bd8f6fd096c", "size": "5171", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "packrat/lib/x86_64-w64-mingw32/3.3.2/Rcpp/include/Rcpp/r_cast.h", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\n\npackage org.apache.geronimo.connector;\n\nimport java.util.Timer;\n\nimport javax.resource.spi.UnavailableException;\nimport javax.resource.spi.XATerminator;\nimport javax.resource.spi.work.WorkManager;\n\nimport org.apache.geronimo.connector.work.GeronimoWorkManager;\n\n/**\n * GBean BootstrapContext implementation that refers to externally configured WorkManager\n * and XATerminator gbeans.\n *\n * @version $Rev$ $Date$\n */\npublic class BootstrapContextImpl implements javax.resource.spi.BootstrapContext {\n private final GeronimoWorkManager workManager;\n\n /**\n * Normal constructor for use as a GBean.\n * @param workManager\n */\n public BootstrapContextImpl(final GeronimoWorkManager workManager) {\n this.workManager = workManager;\n }\n\n\n /**\n * @see javax.resource.spi.BootstrapContext#getWorkManager()\n */\n public WorkManager getWorkManager() {\n return workManager;\n }\n\n /**\n * @see javax.resource.spi.BootstrapContext#getXATerminator()\n */\n public XATerminator getXATerminator() {\n return workManager.getXATerminator();\n }\n\n /**\n * @see javax.resource.spi.BootstrapContext#createTimer()\n */\n public Timer createTimer() throws UnavailableException {\n return new Timer();\n }\n\n// public static final GBeanInfo GBEAN_INFO;\n//\n// static {\n// GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(BootstrapContext.class);\n// //adding interface does not work, creates attributes for references???\n//// infoFactory.addInterface(javax.resource.spi.BootstrapContext.class);\n//\n// infoFactory.addOperation(\"createTimer\");\n// infoFactory.addOperation(\"getWorkManager\");\n// infoFactory.addOperation(\"getXATerminator\");\n//\n// infoFactory.addReference(\"WorkManager\", WorkManager.class);\n// infoFactory.addReference(\"XATerminator\", XATerminator.class);\n//\n// infoFactory.setConstructor(new String[]{\"WorkManager\", \"XATerminator\"});\n//\n// GBEAN_INFO = infoFactory.getBeanInfo();\n// }\n//\n// public static GBeanInfo getGBeanInfo() {\n// return GBEAN_INFO;\n// }\n\n}\n", "meta": {"content_hash": "fd0a1148f0563b637e757c4619efa2bf", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 89, "avg_line_length": 28.466666666666665, "alnum_prop": 0.6899297423887588, "repo_name": "vibe13/geronimo", "id": "28ddbdfa9ff250192460eb02a3f700b9f772ee6a", "size": "2765", "binary": false, "copies": "2", "ref": "refs/heads/1.0", "path": "modules/connector/src/java/org/apache/geronimo/connector/BootstrapContextImpl.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "29627"}, {"name": "CSS", "bytes": "47972"}, {"name": "HTML", "bytes": "838469"}, {"name": "Java", "bytes": "8975734"}, {"name": "JavaScript", "bytes": "906"}, {"name": "Shell", "bytes": "32814"}, {"name": "XSLT", "bytes": "4468"}]}} +{"text": "/*\n Name: Base16 Atelier Dune Light\n Author: Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune)\n Pygments template by Jan T. Sott (https://github.com/idleberg)\n Created with Base16 Builder by Chris Kempson (https://github.com/chriskempson/base16-builder)\n*/\n.highlight .hll { background-color: #e8e4cf }\n.highlight { color: #6E6B5E; }\n.highlight .c { color: #999580 } /* Comment */\n.highlight .err { color: #d73737 } /* Error */\n.highlight .k { color: #b854d4 } /* Keyword */\n.highlight .l { color: #b65611 } /* Literal */\n.highlight .n { color: #6E6B5E; } /* Name */\n.highlight .o { color: #1fad83 } /* Operator */\n.highlight .p { color: #6E6B5E; } /* Punctuation */\n.highlight .cm { color: #999580 } /* Comment.Multiline */\n.highlight .cp { color: #999580 } /* Comment.Preproc */\n.highlight .c1 { color: #999580 } /* Comment.Single */\n.highlight .cs { color: #999580 } /* Comment.Special */\n.highlight .gd { color: #d73737 } /* Generic.Deleted */\n.highlight .ge { font-style: italic } /* Generic.Emph */\n.highlight .gh { color: #20201d; font-weight: bold } /* Generic.Heading */\n.highlight .gi { color: #60ac39 } /* Generic.Inserted */\n.highlight .gp { color: #999580; font-weight: bold } /* Generic.Prompt */\n.highlight .gs { font-weight: bold } /* Generic.Strong */\n.highlight .gu { color: #1fad83; font-weight: bold } /* Generic.Subheading */\n.highlight .kc { color: #b854d4 } /* Keyword.Constant */\n.highlight .kd { color: #b854d4 } /* Keyword.Declaration */\n.highlight .kn { color: #1fad83 } /* Keyword.Namespace */\n.highlight .kp { color: #b854d4 } /* Keyword.Pseudo */\n.highlight .kr { color: #b854d4 } /* Keyword.Reserved */\n.highlight .kt { color: #ae9513 } /* Keyword.Type */\n.highlight .ld { color: #60ac39 } /* Literal.Date */\n.highlight .m { color: #b65611 } /* Literal.Number */\n.highlight .s { color: #2A9292; } /* Literal.String */\n.highlight .na { color: #6684e1 } /* Name.Attribute */\n.highlight .nb { color: #B65611; } /* Name.Builtin */\n.highlight .nc { color: #ae9513 } /* Name.Class */\n.highlight .no { color: #d73737 } /* Name.Constant */\n.highlight .nd { color: #1fad83 } /* Name.Decorator */\n.highlight .ni { color: #20201d } /* Name.Entity */\n.highlight .ne { color: #d73737 } /* Name.Exception */\n.highlight .nf { color: #6684e1 } /* Name.Function */\n.highlight .nl { color: #20201d } /* Name.Label */\n.highlight .nn { color: #ae9513 } /* Name.Namespace */\n.highlight .nx { color: #6684e1 } /* Name.Other */\n.highlight .py { color: #20201d } /* Name.Property */\n.highlight .nt { color: #1fad83 } /* Name.Tag */\n.highlight .nv { color: #d73737 } /* Name.Variable */\n.highlight .ow { color: #1fad83 } /* Operator.Word */\n.highlight .w { color: #20201d } /* Text.Whitespace */\n.highlight .mf { color: #b65611 } /* Literal.Number.Float */\n.highlight .mh { color: #b65611 } /* Literal.Number.Hex */\n.highlight .mi { color: #b65611 } /* Literal.Number.Integer */\n.highlight .mo { color: #b65611 } /* Literal.Number.Oct */\n.highlight .sb { color: #60ac39 } /* Literal.String.Backtick */\n.highlight .sc { color: #20201d } /* Literal.String.Char */\n.highlight .sd { color: #999580 } /* Literal.String.Doc */\n.highlight .s2 { color: #60ac39 } /* Literal.String.Double */\n.highlight .se { color: #b65611 } /* Literal.String.Escape */\n.highlight .sh { color: #60ac39 } /* Literal.String.Heredoc */\n.highlight .si { color: #b65611 } /* Literal.String.Interpol */\n.highlight .sx { color: #60ac39 } /* Literal.String.Other */\n.highlight .sr { color: #60ac39 } /* Literal.String.Regex */\n.highlight .s1 { color: #60ac39 } /* Literal.String.Single */\n.highlight .ss { color: #60ac39 } /* Literal.String.Symbol */\n.highlight .bp { color: #CD0101 } /* Name.Builtin.Pseudo */\n.highlight .vc { color: #d73737 } /* Name.Variable.Class */\n.highlight .vg { color: #d73737 } /* Name.Variable.Global */\n.highlight .vi { color: #d73737 } /* Name.Variable.Instance */\n.highlight .il { color: #b65611 } /* Literal.Number.Integer.Long */\n", "meta": {"content_hash": "896ebb0d0fed348fdd4cc99a7dd7489b", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 100, "avg_line_length": 56.25352112676056, "alnum_prop": 0.6479719579369053, "repo_name": "starsep/rust-www", "id": "c10c63c767699b7345d1a22b35890dfa72ee1ecf", "size": "3994", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "css/syntax-highlight.css", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "46168"}, {"name": "HTML", "bytes": "217249"}, {"name": "JavaScript", "bytes": "15235"}, {"name": "Python", "bytes": "1195"}, {"name": "Ruby", "bytes": "806"}, {"name": "Rust", "bytes": "5235"}, {"name": "Shell", "bytes": "78"}]}} +{"text": "export default {\n newConference: '\u65b0\u3057\u3044\u4f1a\u8b70',\n dialInNumber: '\u30c0\u30a4\u30e4\u30eb\u30a4\u30f3\u756a\u53f7',\n host: '\u30db\u30b9\u30c8',\n participants: '\u53c2\u52a0\u8005',\n internationalParticipants: '\u6d77\u5916\u306e\u53c2\u52a0\u8005',\n internationalNumbersHeader: '\u56fd\u969b\u30c0\u30a4\u30e4\u30eb\u30a4\u30f3\u756a\u53f7\u306e\u9078\u629e',\n search: '\u691c\u7d22...',\n inviteWithText: '\u30c6\u30ad\u30b9\u30c8\u3067\u62db\u5f85',\n inviteText: '{brandName}\u4f1a\u8b70\u306b\u53c2\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\\u3002\\r\\n\\r\\n\u30c0\u30a4\u30e4\u30eb\u30a4\u30f3\u756a\u53f7\\uFF1A{formattedDialInNumber} \\r\\n{additionalNumbersSection} \\r\\n\u53c2\u52a0\u8005\u306e\u30a2\u30af\u30bb\u30b9\\uFF1A{participantCode} \\r\\n\\r\\n\u56fd\u969b\u30c0\u30a4\u30e4\u30eb\u30a4\u30f3\u756a\u53f7\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\\u3001\u6b21\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\\uFF1A{dialInNumbersLinks} \\r\\n\\r\\n\u3053\u306e\u96fb\u8a71\u4f1a\u8b70\u306f\\u3001{brandName} Conferencing\u3092\u4f7f\u7528\u3057\u3066\u958b\u50ac\u3055\u308c\u3066\u3044\u307e\u3059\\u3002',\n hostAccess: '\u30db\u30b9\u30c8\u306e\u30a2\u30af\u30bb\u30b9',\n participantsAccess: '\u53c2\u52a0\u8005\u306e\u30a2\u30af\u30bb\u30b9',\n addinalDialInNumbers: '\u8ffd\u52a0\u306e\u30c0\u30a4\u30e4\u30eb\u30a4\u30f3\u756a\u53f7',\n selectNumbers: '\u756a\u53f7\u306e\u9078\u629e',\n enableJoinBeforeHost: '\u30db\u30b9\u30c8\u3088\u308a\u524d\u306e\u53c2\u52a0\u3092\u53ef\u80fd\u306b\u3059\u308b',\n conferenceCommands: '\u4f1a\u8b70\u30b3\u30de\u30f3\u30c9',\n inviteWithGCalendar: 'Google\u30ab\u30ec\u30f3\u30c0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u62db\u5f85',\n joinAsHost: '\u4f1a\u8b70\u3092\u8d77\u52d5',\n internationalNumber: '\u56fd\u969b\u30c0\u30a4\u30e4\u30eb\u30a4\u30f3\u756a\u53f7\\uFF1A',\n};\n\n// @key: @#@\"newConference\"@#@ @source: @#@\"New Conference\"@#@\n// @key: @#@\"dialInNumber\"@#@ @source: @#@\"Dial-in Number\"@#@\n// @key: @#@\"hostAccess\"@#@ @source: @#@\"Host Access\"@#@\n// @key: @#@\"participantsAccess\"@#@ @source: @#@\"Participants Access\"@#@\n// @key: @#@\"addinalDialInNumbers\"@#@ @source: @#@\"Additional Dial-in Numbers\"@#@\n// @key: @#@\"selectNumbers\"@#@ @source: @#@\"Select Numbers\"@#@\n// @key: @#@\"enableJoinBeforeHost\"@#@ @source: @#@\"Enable join before Host\"@#@\n// @key: @#@\"conferenceCommands\"@#@ @source: @#@\"Conference Commands\"@#@\n// @key: @#@\"inviteWithGCalendar\"@#@ @source: @#@\"Invite with Google Calendar\"@#@\n// @key: @#@\"inviteWithText\"@#@ @source: @#@\"Invite with Text\"@#@\n// @key: @#@\"joinAsHost\"@#@ @source: @#@\"Launch Conference\"@#@\n// @key: @#@\"internationalNumber\"@#@ @source: @#@\"International Dial-in Numbers:\"@#@\n// @key: @#@\"inviteText_att\"@#@ @source: @#@\"Please join the {brandName} conference.\\n\\nDial-In Number: {formattedDialInNumber} \\n{additionalNumbersSection} \\nParticipant Access: {participantCode} \\n\\nNeed an international dial-in phone number? Please visit {dialInNumbersLinks} \\n\\nThis conference call is brought to you by {brandName} Conferencing.\"@#@\n// @key: @#@\"inviteText_bt\"@#@ @source: @#@\"Please join the {brandName} conference.\\n\\nDial-In Number: {formattedDialInNumber} \\n{additionalNumbersSection} \\nParticipant Access: {participantCode} \\n\\nAdditional dial-in numbers {dialInNumbersLinks}\"@#@\n// @key: @#@\"inviteText_rc\"@#@ @source: @#@\"Please join the {brandName} conference.\\n\\nDial-In Number: {formattedDialInNumber} \\n{additionalNumbersSection} \\nParticipant Access: {participantCode} \\n\\nNeed an international dial-in phone number? Please visit {dialInNumbersLinks} \\n\\nThis conference call is brought to you by {brandName} Conferencing.\"@#@\n// @key: @#@\"inviteText_telus\"@#@ @source: @#@\"Please join the {brandName} conference.\\n\\nDial-In Number: {formattedDialInNumber} \\n{additionalNumbersSection} \\nParticipant Access: {participantCode} \\n\\nAdditional dial-in numbers {dialInNumbersLinks}\"@#@\n", "meta": {"content_hash": "fb9e78995c5b94bc89f88d12455d46de", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 354, "avg_line_length": 78.67567567567568, "alnum_prop": 0.7124699416008244, "repo_name": "u9520107/ringcentral-js-widget", "id": "9a1069fb22239d4014bc1bd79928c1b619fd2b80", "size": "3309", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/ringcentral-widgets/components/ConferencePanel/i18n/ja-JP.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "90533"}, {"name": "HTML", "bytes": "2967"}, {"name": "JavaScript", "bytes": "433434"}, {"name": "Shell", "bytes": "1001"}]}} +{"text": "\n\npackage org.gearvrf;\n\nimport org.gearvrf.utility.Log;\nimport org.gearvrf.utility.DockEventReceiver;\nimport org.gearvrf.utility.VrAppSettings;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.content.pm.ActivityInfo;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.view.KeyEvent;\nimport android.view.MotionEvent;\nimport android.view.Window;\nimport android.view.WindowManager;\n\nimport com.oculus.vrappframework.VrActivity;\n\n/**\n * The typical GVRF application will have a single Android {@link Activity},\n * which <em>must</em> descend from {@link GVRActivity}, not directly from\n * {@code Activity}.\n * \n * {@code GVRActivity} creates and manages the internal classes which use sensor\n * data to manage a viewpoint, and thus present an appropriate stereoscopic view\n * of your scene graph. {@code GVRActivity} also gives GVRF a full-screen window\n * in landscape orientation with no title bar.\n */\npublic class GVRActivity extends VrActivity {\n\n private static final String TAG = Log.tag(GVRActivity.class);\n\n // these values are copy of enum KeyEventType in VrAppFramework/Native_Source/Input.h\n public static final int KEY_EVENT_NONE = 0;\n public static final int KEY_EVENT_SHORT_PRESS = 1;\n public static final int KEY_EVENT_DOUBLE_TAP = 2;\n public static final int KEY_EVENT_LONG_PRESS = 3;\n public static final int KEY_EVENT_DOWN = 4;\n public static final int KEY_EVENT_UP = 5;\n public static final int KEY_EVENT_MAX = 6;\n\n private GVRViewManager mGVRViewManager = null;\n private GVRCamera mCamera;\n private VrAppSettings mAppSettings;\n private long mPtr;\n\n static {\n System.loadLibrary(\"gvrf\");\n }\n\n public static native long nativeSetAppInterface(VrActivity act,\n String fromPackageName, String commandString, String uriString);\n\n static native void nativeSetCamera(long appPtr, long camera);\n static native void nativeSetCameraRig(long appPtr, long cameraRig);\n static native void nativeOnDock(long appPtr);\n static native void nativeOnUndock(long appPtr);\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n /*\n * Removes the title bar and the status bar.\n */\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\n WindowManager.LayoutParams.FLAG_FULLSCREEN);\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n mAppSettings = new VrAppSettings();\n super.onCreate(savedInstanceState);\n\n Intent intent = getIntent();\n String commandString = VrActivity.getCommandStringFromIntent(intent);\n String fromPackageNameString = VrActivity\n .getPackageStringFromIntent(intent);\n String uriString = VrActivity.getUriStringFromIntent(intent);\n \n mPtr = nativeSetAppInterface(this, fromPackageNameString,\n commandString, uriString);\n \n setAppPtr(mPtr);\n\n mDockEventReceiver = new DockEventReceiver(this, mRunOnDock, mRunOnUndock);\n }\n\n protected void onInitAppSettings(VrAppSettings appSettings) {\n\n }\n\n public VrAppSettings getAppSettings(){\n return mAppSettings;\n }\n\n @Override\n protected void onPause() {\n super.onPause();\n if (mGVRViewManager != null) {\n mGVRViewManager.onPause();\n }\n if (null != mDockEventReceiver) {\n mDockEventReceiver.stop();\n }\n }\n\n @Override\n protected void onResume() {\n super.onResume();\n if (mGVRViewManager != null) {\n mGVRViewManager.onResume();\n }\n if (null != mDockEventReceiver) {\n mDockEventReceiver.start();\n }\n }\n\n @Override\n protected void onDestroy() {\n super.onDestroy();\n if (mGVRViewManager != null) {\n mGVRViewManager.onDestroy();\n }\n }\n\n /**\n * Links {@linkplain GVRScript a script} to the activity; sets the version;\n * sets the lens distortion compensation parameters.\n * \n * @param gvrScript\n * An instance of {@link GVRScript} to handle callbacks on the GL\n * thread.\n * @param distortionDataFileName\n * Name of the XML file containing the device parameters. We\n * currently only support the Galaxy Note 4 because that is the\n * only shipping device with the proper GL extensions. When more\n * devices support GVRF, we will publish new device files, along\n * with app-level auto-detect guidelines. This approach will let\n * you support new devices, using the same version of GVRF that\n * you have already tested and approved.\n * \n * <p>\n * The XML filename is relative to the application's\n * {@code assets} directory, and can specify a file in a\n * directory under the application's {@code assets} directory.\n */\n public void setScript(GVRScript gvrScript, String distortionDataFileName) {\n if (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {\n\n GVRXMLParser xmlParser = new GVRXMLParser(getAssets(),\n distortionDataFileName, mAppSettings);\n onInitAppSettings(mAppSettings);\n if (isVrSupported() && !mAppSettings.getMonoScopicModeParms().isMonoScopicMode()) {\n mGVRViewManager = new GVRViewManager(this, gvrScript, xmlParser);\n } else {\n mGVRViewManager = new GVRMonoscopicViewManager(this, gvrScript,\n xmlParser);\n }\n } else {\n throw new IllegalArgumentException(\n \"You can not set orientation to portrait for GVRF apps.\");\n }\n }\n\n /**\n * Sets whether to force rendering to be single-eye, monoscopic view.\n * \n * @param force\n * If true, will create a GVRMonoscopicViewManager when\n * {@linkplain setScript setScript()} is called. If false, will\n * proceed to auto-detect whether the device supports VR\n * rendering and choose the appropriate ViewManager. This call\n * will only have an effect if it is called before\n * {@linkplain #setScript(GVRScript, String) setScript()}.\n * \n * @deprecated\n * \n */\n @Deprecated\n public void setForceMonoscopic(boolean force) {\n mAppSettings.monoScopicModeParms.setMonoScopicMode(force);\n }\n\n /**\n * Returns whether a monoscopic view was asked to be forced during\n * {@linkplain #setScript(GVRScript, String) setScript()}.\n * \n * @see setForceMonoscopic\n * @deprecated\n */\n @Deprecated\n public boolean getForceMonoscopic() {\n return mAppSettings.monoScopicModeParms.isMonoScopicMode();\n }\n\n private boolean isVrSupported() {\n if ((Build.MODEL.contains(\"SM-N910\"))\n || (Build.MODEL.contains(\"SM-N916\"))\n || (Build.MODEL.contains(\"SM-G920\"))\n || (Build.MODEL.contains(\"SM-G925\"))) {\n return true;\n }\n\n return false;\n }\n\n public long getAppPtr(){\n return mPtr;\n }\n \n void drawFrame() {\n mGVRViewManager.onDrawFrame();\n }\n\n void oneTimeInit() {\n mGVRViewManager.onSurfaceCreated();\n Log.e(TAG, \" oneTimeInit from native layer\");\n }\n\n void oneTimeShutDown() {\n Log.e(TAG, \" oneTimeShutDown from native layer\");\n }\n\n void beforeDrawEyes() {\n mGVRViewManager.beforeDrawEyes();\n }\n\n void onDrawEyeView(int eye, float fovDegrees) {\n mGVRViewManager.onDrawEyeView(eye, fovDegrees);\n }\n\n void afterDrawEyes() {\n mGVRViewManager.afterDrawEyes();\n }\n\n void setCamera(GVRCamera camera) {\n mCamera = camera;\n\n nativeSetCamera(getAppPtr(), camera.getNative());\n }\n\n void setCameraRig(GVRCameraRig cameraRig) {\n nativeSetCameraRig(getAppPtr(), cameraRig.getNative());\n }\n\n @Override\n public boolean dispatchTouchEvent(MotionEvent event) {\n boolean handled = super.dispatchTouchEvent(event);// VrActivity's\n\n /*\n * Situation: while the super class VrActivity is implementing\n * dispatchTouchEvent() without calling its own super\n * dispatchTouchEvent(), we still need to call the\n * VRTouchPadGestureDetector onTouchEvent. Call it here, similar way\n * like in place of viewGroup.onInterceptTouchEvent()\n */\n onTouchEvent(event);\n\n return handled;\n }\n\n boolean onKeyEventNative(int keyCode, int eventType) {\n\n /*\n * Currently VrLib does not call Java onKeyDown()/onKeyUp() in the\n * Activity class. In stead, it calls VrAppInterface->OnKeyEvent if\n * defined in the native side, to give a chance to the app before it\n * intercepts. With this implementation, the developers can expect\n * consistently their key event methods are called as usual in case they\n * want to use the events. The parameter eventType matches with the\n * native side. It can be more than two, DOWN and UP, if the native\n * supports in the future.\n */\n\n switch (eventType) {\n case KEY_EVENT_SHORT_PRESS:\n return onKeyShortPress(keyCode);\n case KEY_EVENT_DOUBLE_TAP:\n return onKeyDoubleTap(keyCode);\n case KEY_EVENT_LONG_PRESS:\n return onKeyLongPress(keyCode, new KeyEvent(KeyEvent.ACTION_DOWN, keyCode));\n case KEY_EVENT_DOWN:\n return onKeyDown(keyCode, new KeyEvent(KeyEvent.ACTION_DOWN, keyCode));\n case KEY_EVENT_UP:\n return onKeyUp(keyCode, new KeyEvent(KeyEvent.ACTION_UP, keyCode));\n case KEY_EVENT_MAX:\n return onKeyMax(keyCode);\n default:\n return false;\n }\n }\n\n public boolean onKeyShortPress(int keyCode) {\n return false;\n }\n\n public boolean onKeyDoubleTap(int keyCode) {\n return false;\n }\n\n public boolean onKeyMax(int keyCode) {\n return false;\n }\n\n boolean updateSensoredScene() {\n return mGVRViewManager.updateSensoredScene();\n }\n\n private final Runnable mRunOnDock = new Runnable() {\n @Override\n public void run() {\n nativeOnDock(getAppPtr());\n }\n };\n\n private final Runnable mRunOnUndock = new Runnable() {\n @Override\n public void run() {\n nativeOnUndock(getAppPtr());\n }\n };\n\n private DockEventReceiver mDockEventReceiver;\n}\n", "meta": {"content_hash": "fe5602c2341fe551ed989c6a62b5ea12", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 95, "avg_line_length": 33.26934984520124, "alnum_prop": 0.636608970779825, "repo_name": "rongguodong/GearVRf", "id": "9e68680061713d1e78d6bdf3f507723ace04d5eb", "size": "11354", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "GVRf/Framework/src/org/gearvrf/GVRActivity.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "56027"}, {"name": "C", "bytes": "1030140"}, {"name": "C++", "bytes": "2898127"}, {"name": "CMake", "bytes": "1409"}, {"name": "CSS", "bytes": "869"}, {"name": "HTML", "bytes": "1636"}, {"name": "Java", "bytes": "13667787"}, {"name": "JavaScript", "bytes": "281672"}, {"name": "Makefile", "bytes": "6615"}, {"name": "Python", "bytes": "3057"}, {"name": "R", "bytes": "29550"}, {"name": "Shell", "bytes": "1837"}, {"name": "XSLT", "bytes": "2509"}]}} +{"text": "@implementation TLNavigationController\n\n- (UIInterfaceOrientationMask)supportedInterfaceOrientations {\n\treturn UIInterfaceOrientationMaskAllButUpsideDown;\n}\n\n@end\n", "meta": {"content_hash": "1a3db2808b11caa83f25695658af20b5", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 62, "avg_line_length": 23.285714285714285, "alnum_prop": 0.8773006134969326, "repo_name": "paulrehkugler/xkcd", "id": "de17878c3937289a717166c98157d95a3f9392bf", "size": "292", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TLCommon/TLNavigationController.m", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "407"}, {"name": "Objective-C", "bytes": "122680"}, {"name": "Swift", "bytes": "11309"}]}} +{"text": "\n\n\n#ifndef _FILEIO_DOT_H\n#define _FILEIO_DOT_H\n\n#include <stdint.h>\n#include <stdbool.h>\n#include <stddef.h>\n#include \"system_config.h\"\n#include \"system.h\"\n\n#if __XC16_VERSION__ == 1020\n#error XC16 v1.20 is not compatible with this firmware, please use a later version of the XC16 compiler.\n#endif\n\n#if __XC8_VERSION == 1300\n#error XC8 v1.30 is not compatible with this firmware, please use either XC8 v1.21 or a later version of the XC8 compiler.\n#endif\n\n/*******************************************************************/\n/* Structures and defines */\n/*******************************************************************/\n\n// Enumeration for general purpose return values\ntypedef enum\n{\n FILEIO_RESULT_SUCCESS = 0, // File operation was a success\n FILEIO_RESULT_FAILURE = -1 // File operation failed\n} FILEIO_RESULT;\n\n// Definition to indicate an invalid file handle\n#define FILEIO_INVALID_HANDLE NULL\n\n#define FILEIO_FILE_NAME_LENGTH_8P3 12 // Maximum file name length for 8.3 formatted files\n#define FILEIO_FILE_NAME_LENGTH_8P3_NO_RADIX 11 // Maximum file name length for 8.3 formatted files with no radix\n\n// Enumeration for formatting modes\ntypedef enum\n{\n FILEIO_FORMAT_ERASE = 0, // Erases the contents of the partition\n FILEIO_FORMAT_BOOT_SECTOR // Creates a boot sector based on user-specified information and erases any existing information\n} FILEIO_FORMAT_MODE;\n\n// Enumeration for specific return codes\ntypedef enum\n{\n FILEIO_ERROR_NONE = 0, // No error\n FILEIO_ERROR_ERASE_FAIL, // An erase failed\n FILEIO_ERROR_NOT_PRESENT, // No device was present\n FILEIO_ERROR_NOT_FORMATTED, // The disk is of an unsupported format\n FILEIO_ERROR_BAD_PARTITION, // The boot record is bad\n FILEIO_ERROR_UNSUPPORTED_FS, // The file system type is unsupported\n FILEIO_ERROR_INIT_ERROR, // An initialization error has occured\n FILEIO_ERROR_UNINITIALIZED, // An operation was performed on an uninitialized device\n FILEIO_ERROR_BAD_SECTOR_READ, // A bad read of a sector occured\n FILEIO_ERROR_WRITE, // Could not write to a sector\n FILEIO_ERROR_INVALID_CLUSTER, // Invalid cluster value > maxcls\n FILEIO_ERROR_DRIVE_NOT_FOUND, // The specified drive could not be found\n FILEIO_ERROR_FILE_NOT_FOUND, // Could not find the file on the device\n FILEIO_ERROR_DIR_NOT_FOUND, // Could not find the directory\n FILEIO_ERROR_BAD_FILE, // File is corrupted\n FILEIO_ERROR_DONE, // No more files in this directory\n FILEIO_ERROR_COULD_NOT_GET_CLUSTER, // Could not load/allocate next cluster in file\n FILEIO_ERROR_FILENAME_TOO_LONG, // A specified file name is too long to use\n FILEIO_ERROR_FILENAME_EXISTS, // A specified filename already exists on the device\n FILEIO_ERROR_INVALID_FILENAME, // Invalid file name\n FILEIO_ERROR_DELETE_DIR, // The user tried to delete a directory with FILEIO_Remove\n FILEIO_ERROR_DELETE_FILE, // The user tried to delete a file with FILEIO_DirectoryRemove\n FILEIO_ERROR_DIR_FULL, // All root dir entry are taken\n FILEIO_ERROR_DRIVE_FULL, // All clusters in partition are taken\n FILEIO_ERROR_DIR_NOT_EMPTY, // This directory is not empty yet, remove files before deleting\n FILEIO_ERROR_UNSUPPORTED_SIZE, // The disk is too big to format as FAT16\n FILEIO_ERROR_WRITE_PROTECTED, // Card is write protected\n FILEIO_ERROR_FILE_UNOPENED, // File not opened for the write\n FILEIO_ERROR_SEEK_ERROR, // File location could not be changed successfully\n FILEIO_ERROR_BAD_CACHE_READ, // Bad cache read\n FILEIO_ERROR_FAT32_UNSUPPORTED, // FAT 32 - card not supported\n FILEIO_ERROR_READ_ONLY, // The file is read-only\n FILEIO_ERROR_WRITE_ONLY, // The file is write-only\n FILEIO_ERROR_INVALID_ARGUMENT, // Invalid argument\n FILEIO_ERROR_TOO_MANY_FILES_OPEN, // Too many files are already open\n FILEIO_ERROR_TOO_MANY_DRIVES_OPEN, // Too many drives are already open\n FILEIO_ERROR_UNSUPPORTED_SECTOR_SIZE, // Unsupported sector size\n FILEIO_ERROR_NO_LONG_FILE_NAME, // Long file name was not found\n FILEIO_ERROR_EOF // End of file reached\n} FILEIO_ERROR_TYPE;\n\n// Enumeration defining standard attributes used by FAT file systems\ntypedef enum\n{\n FILEIO_ATTRIBUTE_READ_ONLY = 0x01, // Read-only attribute. A file with this attribute should not be written to.\n FILEIO_ATTRIBUTE_HIDDEN = 0x02, // Hidden attribute. A file with this attribute may be hidden from the user.\n FILEIO_ATTRIBUTE_SYSTEM = 0x04, // System attribute. A file with this attribute is used by the operating system and should not be modified.\n FILEIO_ATTRIBUTE_VOLUME = 0x08, // Volume attribute. If the first file in the root directory of a volume has this attribute, the entry name is the volume name.\n FILEIO_ATTRIBUTE_LONG_NAME = 0x0F, // A file entry with this attribute mask is used to store part of the file's Long File Name.\n FILEIO_ATTRIBUTE_DIRECTORY = 0x10, // A file entry with this attribute points to a directory.\n FILEIO_ATTRIBUTE_ARCHIVE = 0x20, // Archive attribute. A file with this attribute should be archived.\n FILEIO_ATTRIBUTE_MASK = 0x3F // Mask for all attributes.\n} FILEIO_ATTRIBUTES;\n\n// Enumeration defining base locations for seeking\ntypedef enum\n{\n FILEIO_SEEK_SET = 0, // Change the position in the file to an offset relative to the beginning of the file.\n FILEIO_SEEK_CUR, // Change the position in the file to an offset relative to the current location in the file.\n FILEIO_SEEK_END // Change the position in the file to an offset relative to the end of the file.\n} FILEIO_SEEK_BASE;\n\n// Enumeration for file access modes\ntypedef enum\n{\n FILEIO_OPEN_READ = 0x01, // Open the file for reading.\n FILEIO_OPEN_WRITE = 0x02, // Open the file for writing.\n FILEIO_OPEN_CREATE = 0x04, // Create the file if it doesn't exist.\n FILEIO_OPEN_TRUNCATE = 0x08, // Truncate the file to 0-length.\n FILEIO_OPEN_APPEND = 0x10 // Set the current read/write location in the file to the end of the file.\n} FILEIO_OPEN_ACCESS_MODES;\n\n// Enumeration of macros defining possible file system types supported by a device\ntypedef enum\n{\n FILEIO_FILE_SYSTEM_TYPE_NONE = 0, // No file system\n FILEIO_FILE_SYSTEM_TYPE_FAT12, // The device is formatted with FAT12\n FILEIO_FILE_SYSTEM_TYPE_FAT16, // The device is formatted with FAT16\n FILEIO_FILE_SYSTEM_TYPE_FAT32 // The device is formatted with FAT32\n} FILEIO_FILE_SYSTEM_TYPE;\n\n// Summary: Contains file information and is used to indicate which file to access.\n// Description: The FILEIO_OBJECT structure is used to hold file information for an open file as it's being modified or accessed. A pointer to\n// an open file's FILEIO_OBJECT structure will be passed to any library function that will modify that file.\ntypedef struct\n{\n uint32_t baseClusterDir; // The base cluster of the file's directory\n uint32_t currentClusterDir; // The current cluster of the file's directory\n uint32_t firstCluster; // The first cluster of the file\n uint32_t currentCluster; // The current cluster of the file\n uint32_t size; // The size of the file\n uint32_t absoluteOffset; // The absolute offset in the file\n void * disk; // Pointer to a device structure\n uint16_t currentSector; // The current sector in the current cluster of the file\n uint16_t currentOffset; // The position in the current sector\n uint16_t entry; // The position of the file's directory entry in its directory\n uint16_t attributes; // The file's attributes\n uint16_t time; // The file's last update time\n uint16_t date; // The file's last update date\n uint8_t timeMs; // The file's last update time (ms portion)\n char name[FILEIO_FILE_NAME_LENGTH_8P3_NO_RADIX]; // The short name of the file\n struct\n {\n unsigned writeEnabled :1; // Indicates a file was opened in a mode that allows writes\n unsigned readEnabled :1; // Indicates a file was opened in a mode that allows reads\n\n } flags;\n} FILEIO_OBJECT;\n\n// Possible results of the FSGetDiskProperties() function.\ntypedef enum\n{\n FILEIO_GET_PROPERTIES_NO_ERRORS = 0,\n FILEIO_GET_PROPERTIES_CACHE_ERROR,\n FILEIO_GET_PROPERTIES_DRIVE_NOT_MOUNTED,\n FILEIO_GET_PROPERTIES_CLUSTER_FAILURE,\n FILEIO_GET_PROPERTIES_STILL_WORKING = 0xFF\n} FILEIO_DRIVE_ERRORS;\n\n// Enumeration to define media error types\ntypedef enum\n{\n MEDIA_NO_ERROR, // No errors\n MEDIA_DEVICE_NOT_PRESENT, // The requested device is not present\n MEDIA_CANNOT_INITIALIZE // Cannot initialize media\n} FILEIO_MEDIA_ERRORS;\n\n// Media information flags. The driver's MediaInitialize function will return a pointer to one of these structures.\ntypedef struct\n{\n FILEIO_MEDIA_ERRORS errorCode; // The status of the intialization FILEIO_MEDIA_ERRORS\n // Flags\n union\n {\n uint8_t value;\n struct\n {\n uint8_t sectorSize : 1; // The sector size parameter is valid.\n uint8_t maxLUN : 1; // The max LUN parameter is valid.\n } bits;\n } validityFlags;\n\n uint16_t sectorSize; // The sector size of the target device.\n uint8_t maxLUN; // The maximum Logical Unit Number of the device.\n} FILEIO_MEDIA_INFORMATION;\n\n/***************************************************************************\n Function:\n void (*FILEIO_DRIVER_IOInitialize)(void * mediaConfig);\n\n Summary:\n Function pointer prototype for a driver function to initialize\n I/O pins and modules for a driver.\n\n Description:\n Function pointer prototype for a driver function to initialize\n I/O pins and modules for a driver.\n\n Precondition:\n None\n\n Parameters:\n mediaConfig - Pointer to a driver-defined config structure\n\n Returns:\n None\n***************************************************************************/\ntypedef void (*FILEIO_DRIVER_IOInitialize)(void * mediaConfig);\n\n/***************************************************************************\n Function:\n bool (*FILEIO_DRIVER_MediaDetect)(void * mediaConfig);\n\n Summary:\n Function pointer prototype for a driver function to detect if\n a media device is attached/available.\n\n Description:\n Function pointer prototype for a driver function to detect if\n a media device is attached/available.\n\n Precondition:\n None\n\n Parameters:\n mediaConfig - Pointer to a driver-defined config structure\n\n Returns:\n If media attached: true\n If media not atached: false\n***************************************************************************/\ntypedef bool (*FILEIO_DRIVER_MediaDetect)(void * mediaConfig);\n\n/***************************************************************************\n Function:\n FILEIO_MEDIA_INFORMATION * (*FILEIO_DRIVER_MediaInitialize)(void * mediaConfig);\n\n Summary:\n Function pointer prototype for a driver function to perform media-\n specific initialization tasks.\n\n Description:\n Function pointer prototype for a driver function to perform media-\n specific initialization tasks.\n\n Precondition:\n FILEIO_DRIVE_IOInitialize will be called first.\n\n Parameters:\n mediaConfig - Pointer to a driver-defined config structure\n\n Returns:\n FILEIO_MEDIA_INFORMATION * - Pointer to a media initialization structure\n that has been loaded with initialization values.\n***************************************************************************/\ntypedef FILEIO_MEDIA_INFORMATION * (*FILEIO_DRIVER_MediaInitialize)(void * mediaConfig);\n\n/***************************************************************************\n Function:\n bool (*FILEIO_DRIVER_MediaDeinitialize)(void * mediaConfig);\n\n Summary:\n Function pointer prototype for a driver function to deinitialize\n a media device.\n\n Description:\n Function pointer prototype for a driver function to deinitialize\n a media device.\n\n Precondition:\n None\n\n Parameters:\n mediaConfig - Pointer to a driver-defined config structure\n\n Returns:\n If Success: true\n If Failure: false\n***************************************************************************/\ntypedef bool (*FILEIO_DRIVER_MediaDeinitialize)(void * mediaConfig);\n\n/***************************************************************************\n Function:\n bool (*FILEIO_DRIVER_SectorRead)(void * mediaConfig,\n uint32_t sector_addr, uint8_t * buffer);\n\n Summary:\n Function pointer prototype for a driver function to read a sector\n of data from the device.\n\n Description:\n Function pointer prototype for a driver function to read a sector\n of data from the device.\n\n Precondition:\n The device will be initialized.\n\n Parameters:\n mediaConfig - Pointer to a driver-defined config structure\n sectorAddress - The address of the sector to read. This address\n format depends on the media.\n buffer - A buffer to store the copied data sector.\n\n Returns:\n If Success: true\n If Failure: false\n***************************************************************************/\ntypedef bool (*FILEIO_DRIVER_SectorRead)(void * mediaConfig, uint32_t sector_addr, uint8_t* buffer);\n\n/***************************************************************************\n Function:\n bool (*FILEIO_DRIVER_SectorWrite)(void * mediaConfig,\n uint32_t sectorAddress, uint8_t * buffer, bool allowWriteToZero);\n\n Summary:\n Function pointer prototype for a driver function to write a sector\n of data to the device.\n\n Description:\n Function pointer prototype for a driver function to write a sector\n of data to the device.\n\n Precondition:\n The device will be initialized.\n\n Parameters:\n mediaConfig - Pointer to a driver-defined config structure\n sectorAddress - The address of the sector to write. This address\n format depends on the media.\n buffer - A buffer containing the data to write.\n\t\tallowWriteToZero - Check to prevent writing to the master boot \n\t\t record. This will always be false on calls that write to files, \n\t\t\twhich will prevent a device from accidentally overwriting its \n\t\t\town MBR if its root or FAT are corrupted. This should only \n\t\t\tbe true if the user specifically tries to construct a new MBR.\n\n Returns:\n If Success: true\n If Failure: false\n***************************************************************************/\ntypedef uint8_t (*FILEIO_DRIVER_SectorWrite)(void * mediaConfig, uint32_t sector_addr, uint8_t* buffer, bool allowWriteToZero);\n\n/***************************************************************************\n Function:\n bool (*FILEIO_DRIVER_WriteProtectStateGet)(void * mediaConfig);\n\n Summary:\n Function pointer prototype for a driver function to determine if\n the device is write-protected.\n\n Description:\n Function pointer prototype for a driver function to determine if\n the device is write-protected.\n\n Precondition:\n None\n\n Parameters:\n mediaConfig - Pointer to a driver-defined config structure\n\n Returns:\n If write-protected: true\n If not write-protected: false\n***************************************************************************/\ntypedef bool (*FILEIO_DRIVER_WriteProtectStateGet)(void * mediaConfig);\n\n\n// Function pointer table that describes a drive being configured by the user\ntypedef struct\n{\n FILEIO_DRIVER_IOInitialize funcIOInit; // I/O Initialization function\n FILEIO_DRIVER_MediaDetect funcMediaDetect; // Media Detection function\n FILEIO_DRIVER_MediaInitialize funcMediaInit; // Media Initialization function\n FILEIO_DRIVER_MediaDeinitialize funcMediaDeinit; // Media Deinitialization function.\n FILEIO_DRIVER_SectorRead funcSectorRead; // Function to read a sector of the media.\n FILEIO_DRIVER_SectorWrite funcSectorWrite; // Function to write a sector of the media.\n FILEIO_DRIVER_WriteProtectStateGet funcWriteProtectGet; // Function to determine if the media is write-protected.\n} FILEIO_DRIVE_CONFIG;\n\n// Structure that contains the disk search information, intermediate values, and results\ntypedef struct\n{\n char disk; /* pointer to the disk we are searching */\n bool new_request; /* is this a new request or a continued request */\n FILEIO_DRIVE_ERRORS properties_status; /* status of the last call of the function */\n\n struct\n {\n uint8_t disk_format; /* disk format: FAT12, FAT16, FAT32 */\n uint16_t sector_size; /* sector size of the drive */\n uint8_t sectors_per_cluster; /* number of sectors per cluster */\n uint32_t total_clusters; /* the number of total clusters on the drive */\n uint32_t free_clusters; /* the number of free (unused) clusters on drive */\n } results; /* the results of the current search */\n\n struct\n {\n uint32_t c; \n uint32_t curcls;\n uint32_t EndClusterLimit;\n uint32_t ClusterFailValue;\n } private; /* intermediate values used to continue searches. This\n member should be used only by the FSGetDiskProperties()\n function */\n\n} FILEIO_DRIVE_PROPERTIES;\n\n// Structure to describe a FAT file system date\ntypedef union\n{\n struct\n {\n uint16_t day : 5; // Day (1-31)\n uint16_t month : 4; // Month (1-12)\n uint16_t year : 7; // Year (number of years since 1980)\n } bitfield;\n uint16_t value;\n} FILEIO_DATE;\n\n// Function to describe the FAT file system time.\ntypedef union\n{\n struct\n {\n uint16_t secondsDiv2 : 5; // (Seconds / 2) ( 1-30)\n uint16_t minutes : 6; // Minutes ( 1-60)\n uint16_t hours : 5; // Hours (1-24)\n } bitfield;\n uint16_t value;\n} FILEIO_TIME;\n\n// Structure to describe the time fields of a file\ntypedef struct \n{\n FILEIO_DATE date; // The create or write date of the file/directory.\n FILEIO_TIME time; // The create of write time of the file/directory.\n uint8_t timeMs; // The millisecond portion of the time.\n} FILEIO_TIMESTAMP;\n\n// Search structure\ntypedef struct\n{\n // Return values\n\n uint8_t shortFileName[13]; // The name of the file that has been found (NULL-terminated).\n uint8_t attributes; // The attributes of the file that has been found.\n uint32_t fileSize; // The size of the file that has been found (bytes).\n FILEIO_TIMESTAMP timeStamp; // The create or write time of the file that has been found.\n\n // Private Parameters\n uint32_t baseDirCluster;\n uint32_t currentDirCluster;\n uint16_t currentClusterOffset;\n uint16_t currentEntryOffset;\n uint16_t pathOffset;\n char driveId;\n} FILEIO_SEARCH_RECORD;\n\n/***************************************************************************\n* Prototypes *\n***************************************************************************/\n\n/***************************************************************************\n Function:\n int FILEIO_Initialize (void)\n\n Summary:\n Initialized the FILEIO library.\n\n Description:\n Initializes the structures used by the FILEIO library.\n\n Precondition:\n None.\n\n Parameters:\n void\n\n Returns:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE \n***************************************************************************/\nint FILEIO_Initialize (void);\n\n/***************************************************************************\n Function:\n int FILEIO_Reinitialize (void)\n\n Summary:\n Reinitialized the FILEIO library.\n\n Description:\n Reinitialized the structures used by the FILEIO library.\n\n Precondition:\n FILEIO_Initialize must have been called.\n\n Parameters:\n void\n\n Returns:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE \n***************************************************************************/\nint FILEIO_Reinitialize (void);\n\n/***************************************************************************\n Function:\n typedef void (*FILEIO_TimestampGet)(FILEIO_TIMESTAMP *)\n\n Summary:\n Describes the user-implemented function to provide the timestamp.\n\n Description:\n Files in a FAT files system use time values to track create time,\n access time, and last-modified time. In the FILEIO library, the \n user must implement a function that the library can call to \n obtain the current time. That function will have this format.\n\n Precondition:\n N/A.\n\n Parameters:\n FILEIO_TIMESTAMP * - Pointer to a timestamp structure that \n must be populated by the user's function.\n\n Returns:\n void\n***************************************************************************/\ntypedef void (*FILEIO_TimestampGet)(FILEIO_TIMESTAMP *);\n\n/***************************************************************************\n Function:\n void FILEIO_RegisterTimestampGet (FILEIO_TimestampGet timestampFunction)\n\n Summary:\n Registers a FILEIO_TimestampGet function with the library.\n\n Description:\n The user must call this function to specify which user-implemented \n function will be called by the library to generate timestamps.\n\n Precondition:\n FILEIO_Initialize must have been called.\n\n Parameters:\n timestampFunction - A pointer to the user-implemented function\n that will provide timestamps to the library.\n\n Returns:\n void\n***************************************************************************/\nvoid FILEIO_RegisterTimestampGet (FILEIO_TimestampGet timestampFunction);\n\n/***************************************************************************\n Function:\n bool FILEIO_MediaDetect (const FILEIO_DRIVE_CONFIG * driveConfig,\n void * mediaParameters)\n\n Summary:\n Determines if the given media is accessible.\n\n Description:\n This function determines if a specified media device is available\n for further access.\n\n Precondition:\n FILEIO_Initialize must have been called. The driveConfig struct\n must have been initialized with the media-specific parameters and\n the FILEIO_DRIVER_MediaDetect function.\n\n Parameters:\n driveConfig - Constant structure containing function pointers that\n the library will use to access the drive.\n mediaParameters - Pointer to the media-specific parameter structure\n\n Returns:\n * If media is available : true\n * If media is not available : false \n***************************************************************************/\nbool FILEIO_MediaDetect (const FILEIO_DRIVE_CONFIG * driveConfig, void * mediaParameters);\n\n/*****************************************************************************\n Function:\n FILEIO_ERROR_TYPE FILEIO_DriveMount (char driveId,\n const FILEIO_DRIVE_CONFIG * driveConfig, void * mediaParameters);\n \n Summary:\n Initializes a drive and loads its configuration information.\n Description:\n This function will initialize a drive and load the required information\n from it.\n Conditions:\n FILEIO_Initialize must have been called.\n Input:\n driveId - An alphanumeric character that will be used to\n identify the drive.\n driveConfig - Constant structure containing function pointers that\n the library will use to access the drive.\n mediaParameters - Constant structure containing media\\-specific values\n that describe which instance of the media to use for\n this operation.\n Return:\n * FILEIO_ERROR_NONE - Drive was mounted successfully\n * FILEIO_ERROR_TOO_MANY_DRIVES_OPEN - You have already mounted\n the maximum number of drives. Change FILEIO_CONFIG_MAX_DRIVES in\n fileio_config.h to increase this.\n * FILEIO_ERROR_WRITE - The library was not able to write cached\n data in the buffer to the device (can occur when using multiple drives\n and single buffer mode)\n * FILEIO_ERROR_INIT_ERROR - The driver's Media Initialize\n \\function indicated that the media could not be initialized.\n * FILEIO_ERROR_UNSUPPORTED_SECTOR_SIZE - The media's sector size\n exceeds the maximum sector size specified in fileio_config.h\n (FILEIO_CONFIG_MEDIA_SECTOR_SIZE macro)\n * FILEIO_ERROR_BAD_SECTOR_READ - The stack could not read the\n boot sector of Master Boot Record from the media.\n * FILEIO_ERROR_BAD_PARTITION - The boot signature in the MBR is\n bad on your media device.\n * FILEIO_ERROR_UNSUPPORTED_FS - The partition is formatted with\n an unsupported file system.\n * FILEIO_ERROR_NOT_FORMATTED - One of the parameters in the boot\n sector is bad in the partition being mounted. \n *****************************************************************************/\nFILEIO_ERROR_TYPE FILEIO_DriveMount (char driveId, const FILEIO_DRIVE_CONFIG * driveConfig, void * mediaParameters);\n\n/***************************************************************************\n Function:\n int FILEIO_Format (FILEIO_DRIVE_CONFIG * config,\n void * mediaParameters, char mode,\n uint32_t serialNumber, char * volumeID)\n\n Summary:\n Formats a drive.\n\n Description:\n Formats a drive.\n\n Precondition:\n FILEIO_Initialize must have been called.\n\n Parameters:\n config - Drive configuration pointer\n mode - FILEIO_FORMAT_MODE specifier\n serialNumber - Serial number to write to the drive\n volumeId - Name of the drive.\n\n Returns:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE \n***************************************************************************/\nint FILEIO_Format (FILEIO_DRIVE_CONFIG * config, void * mediaParameters, FILEIO_FORMAT_MODE mode, uint32_t serialNumber, char * volumeId);\n\n/***********************************************************************\n Function:\n int FILEIO_DriveUnmount (const char driveID)\n \n Summary:\n Unmounts a drive.\n Description:\n Unmounts a drive from the file system and writes any pending data to\n the drive.\n Conditions:\n FILEIO_DriveMount must have been called.\n Input:\n driveId - The character representation of the mounted drive.\n Return:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE \n ***********************************************************************/\nint FILEIO_DriveUnmount (const char driveId);\n\n/******************************************************************************\n Function:\n int FILEIO_Remove (const char * pathName)\n \n Summary:\n Deletes a file.\n Description:\n Deletes the file specified by pathName.\n Conditions:\n The file's drive must be mounted and the file should exist.\n Input:\n pathName - The path/name of the file.\n Return:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE\n \n * Sets error code which can be retrieved with FILEIO_ErrorGet. Note\n that if the path cannot be resolved, the error will be returned for the\n current working directory.\n * FILEIO_ERROR_INVALID_ARGUMENT - The path could not be\n resolved.\n * FILEIO_ERROR_WRITE_PROTECTED - The device is write-protected.\n * FILEIO_ERROR_INVALID_FILENAME - The file name is invalid.\n * FILEIO_ERROR_DELETE_DIR - The file being deleted is actually\n a directory (use FILEIO_DirectoryRemove)\n * FILEIO_ERROR_ERASE_FAIL - The erase operation failed.\n * FILEIO_ERROR_FILE_NOT_FOUND - The file entries for this file\n are invalid or have already been erased.\n * FILEIO_ERROR_WRITE - The updated file data and entry could\n not be written to the device.\n * FILEIO_ERROR_DONE - The directory entry could not be found.\n * FILEIO_ERROR_BAD_SECTOR_READ - The directory entry could not\n be cached. \n ******************************************************************************/\nint FILEIO_Remove (const char * pathName);\n\n/*******************************************************************************\n Function:\n int FILEIO_Rename (const char * oldPathname, const char * newFilename)\n \n Summary:\n Renames a file.\n Description:\n Renames a file specifed by oldPathname to the name specified by\n newFilename.\n Conditions:\n The file's drive must be mounted and the file/path specified by\n oldPathname must exist.\n Input:\n oldPathName - The path/name of the file to rename.\n newFileName - The new name of the file.\n Return:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE\n \n * Sets error code which can be retrieved with FILEIO_ErrorGet Note\n that if the path cannot be resolved, the error will be returned for the\n current working directory.\n * FILEIO_ERROR_INVALID_ARGUMENT - The path could not be\n resolved.\n * FILEIO_ERROR_WRITE_PROTECTED - The device is write-protected.\n * FILEIO_ERROR_INVALID_FILENAME - One of the file names is\n invalid.\n * FILEIO_ERROR_FILENAME_EXISTS - The new file name already\n exists on this device.\n * FILEIO_ERROR_FILE_NOT_FOUND - The file could not be found.\n * FILEIO_ERROR_WRITE - The updated file data and entry could\n not be written to the device.\n * FILEIO_ERROR_DONE - The directory entry could not be found or\n the library could not find a sufficient number of empty entries in the\n dir to store the new file name.\n * FILEIO_ERROR_BAD_SECTOR_READ - The directory entry could not\n be cached.\n * FILEIO_ERROR_ERASE_FAIL - The file's entries could not be\n erased (applies when renaming a long file name)\n * FILEIO_ERROR_DIR_FULL - New file entries could not be\n created.\n * FILEIO_ERROR_BAD_CACHE_READ - The lfn entries could not be\n cached. \n *******************************************************************************/\nint FILEIO_Rename (const char * oldPathName, const char * newFileName);\n\n/************************************************************\n Function:\n int FILEIO_DirectoryMake (const char * path)\n \n Summary:\n Creates the directory/directories specified by 'path.'\n\t\n Description:\n Creates the directory/directories specified by 'path.'\n\t\n Conditions:\n The specified drive must be mounted.\n\t\n Input:\n path - Path string containing all directories to create.\n\t\n Return:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE \n ************************************************************/\nint FILEIO_DirectoryMake (const char * path);\n\n/*************************************************************************\n Function:\n int FILEIO_DirectoryChange (const char * path)\n \n Summary:\n Changes the current working directory.\n\t\n Description:\n Changes the current working directory to the directory specified by\n 'path.'\n\t\n Conditions:\n The specified drive must be mounted and the directory being changed to\n should exist.\n\t\n Input:\n path - The path of the directory to change to.\n\t\n Return:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE \n *************************************************************************/\nint FILEIO_DirectoryChange (const char * path);\n\n/******************************************************************************\n Function:\n uint16_t FILEIO_DirectoryGetCurrent (char * buffer, uint16_t size)\n \n Summary:\n Gets the name of the current working directory.\n Description:\n Gets the name of the current working directory and stores it in\n 'buffer.' The directory name will be null-terminated. If the buffer\n size is insufficient to contain the whole path name, as much as\n possible will be copied and null-terminated.\n Conditions:\n A drive must be mounted.\n Input:\n buffer - The buffer to contain the current working directory name.\n size - Size of the buffer (bytes).\n Return:\n * uint16_t - The number of characters in the current working\n directory name. May exceed the size of the buffer. In this case, the\n name will be truncated to 'size' characters, but the full length of the\n path name will be returned.\n * Sets error code which can be retrieved with FILEIO_ErrorGet\n * FILEIO_ERROR_INVALID_ARGUMENT - The arguments for the buffer\n or its size were invalid.\n * FILEIO_ERROR_DIR_NOT_FOUND - One of the directories in your\n current working directory could not be found in its parent directory.\n ******************************************************************************/\nuint16_t FILEIO_DirectoryGetCurrent (char * buffer, uint16_t size);\n\n/************************************************************************\n Function:\n int FILEIO_DirectoryRemove (const char * pathName)\n \n Summary:\n Deletes a directory.\n Description:\n Deletes a directory. The specified directory must be empty.\n Conditions:\n The directory's drive must be mounted and the directory should exist.\n Input:\n pathName - The path/name of the directory to delete.\n Return:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE \n ************************************************************************/\nint FILEIO_DirectoryRemove (const char * pathName);\n\n/***************************************************************************\n Function:\n FILEIO_ERROR_TYPE FILEIO_ErrorGet (char driveId)\n\n Summary:\n Gets the last error condition of a drive.\n\n Description:\n Gets the last error condition of the specified drive.\n\n Precondition:\n The drive must have been mounted.\n\n Parameters:\n driveId - The character representation of the drive.\n\n Returns:\n FILEIO_ERROR_TYPE - The last error that occurred on the drive.\n***************************************************************************/\nFILEIO_ERROR_TYPE FILEIO_ErrorGet (char driveId);\n\n/***************************************************************************\n Function:\n void FILEIO_ErrorClear (char driveId)\n\n Summary:\n Clears the last error on a drive.\n\n Description:\n Clears the last error of the specified drive.\n\n Precondition:\n The drive must have been mounted.\n\n Parameters:\n driveId - The character representation of the drive.\n\n Returns:\n void\n***************************************************************************/\nvoid FILEIO_ErrorClear (char driveId);\n\n/***************************************************************************************\n Function:\n int FILEIO_Open (FILEIO_OBJECT * filePtr, const char * pathName, uint16_t mode)\n \n Summary:\n Opens a file for access.\n Description:\n Opens a file for access using a combination of modes specified by the\n user.\n Conditions:\n The drive containing the file must be mounted.\n Input:\n filePtr - Pointer to the file object to initialize\n pathName - The path/name of the file to open.\n mode - The mode in which the file should be opened. Specified by\n inclusive or'ing parameters from FILEIO_OPEN_ACCESS_MODES.\n Return:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE\n \n * Sets error code which can be retrieved with FILEIO_ErrorGet Note\n that if the path cannot be resolved, the error will be returned for the\n current working directory.\n * FILEIO_ERROR_INVALID_ARGUMENT - The path could not be\n resolved.\n * FILEIO_ERROR_WRITE_PROTECTED - The device is write protected\n or this function was called in a write/create mode when writes are\n disabled in configuration.\n * FILEIO_ERROR_INVALID_FILENAME - The file name is invalid.\n * FILEIO_ERROR_ERASE_FAIL - There was an error when trying to\n truncate the file.\n * FILEIO_ERROR_WRITE - Cached file data could not be written to\n the device.\n * FILEIO_ERROR_DONE - The directory entry could not be found.\n * FILEIO_ERROR_BAD_SECTOR_READ - The directory entry could not\n be cached.\n * FILEIO_ERROR_DRIVE_FULL - There are no more clusters\n available on this device that can be allocated to the file.\n * FILEIO_ERROR_FILENAME_EXISTS - All of the possible alias\n values for this file are in use.\n * FILEIO_ERROR_BAD_CACHE_READ - There was an error caching LFN\n entries.\n * FILEIO_ERROR_INVALID_CLUSTER - The next cluster in the file\n is invalid (can occur in APPEND mode).\n * FILEIO_ERROR_COULD_NOT_GET_CLUSTER - There was an error\n finding the cluster that contained the specified offset (can occur in\n APPEND mode). \n ***************************************************************************************/\nint FILEIO_Open (FILEIO_OBJECT * filePtr, const char * pathName, uint16_t mode);\n\n/***************************************************************************\n Function:\n int FILEIO_Close (FILEIO_OBJECT * handle)\n\n Summary:\n Closes a file.\n\n Description:\n Closes a file. This will save the unwritten data to the file and \n make the memory used to allocate a file available to open other \n files.\n\n Precondition:\n The drive containing the file must be mounted and the file handle \n must represent a valid, opened file.\n\n Parameters:\n handle - The handle of the file to close.\n\n Returns:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE\n \n * Sets error code which can be retrieved with FILEIO_ErrorGet\n * FILEIO_ERROR_WRITE - Data could not be written to the device.\n * FILEIO_ERROR_BAD_CACHE_READ - The file's directory entry\n could not be cached. \n***************************************************************************/\nint FILEIO_Close (FILEIO_OBJECT * handle);\n\n/***************************************************************************\n Function:\n int FILEIO_Flush (FILEIO_OBJECT * handle)\n\n Summary:\n Saves unwritten file data to the device without closing the file.\n\n Description:\n Saves unwritten file data to the device without closing the file. \n This function is useful if the user needs to continue writing to \n a file but also wants to ensure that data isn't lost in the event \n of a reset or power loss condition.\n\n Precondition:\n The drive containing the file must be mounted and the file handle \n must represent a valid, opened file. \n\n Parameters:\n handle - The handle of the file to flush.\n\n Returns:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE\n\n * Sets error code which can be retrieved with FILEIO_ErrorGet\n * FILEIO_ERROR_WRITE - Data could not be written to the device.\n * FILEIO_ERROR_BAD_CACHE_READ - The file's directory entry\n could not be cached. \n***************************************************************************/\nint FILEIO_Flush (FILEIO_OBJECT * handle);\n\n/***************************************************************************\n Function:\n int FILEIO_GetChar (FILEIO_OBJECT * handle)\n\n Summary:\n Reads a character from a file.\n\n Description:\n Reads a character from a file.\n\n Precondition:\n The drive containing the file must be mounted and the file handle \n must represent a valid, opened file.\n\n Parameters:\n handle - The handle of the file.\n\n Returns:\n * If Success: The character that was read (cast to an int).\n * If Failure: FILEIO_RESULT_FAILURE\n \n * Sets error code which can be retrieved with FILEIO_ErrorGet\n * FILEIO_ERROR_WRITE_ONLY - The file is not opened in read\n mode.\n * FILEIO_ERROR_BAD_SECTOR_READ - There was an error reading the\n FAT to determine the next cluster in the file, or an error reading the\n file data.\n * FILEIO_ERROR_INVALID_CLUSTER - The next cluster in the file\n is invalid.\n * FILEIO_ERROR_EOF - There is no next cluster in the file (EOF)\n * FILEIO_ERROR_WRITE - Cached data could not be written to the\n device. \n *******************************************************************************/\nint FILEIO_GetChar (FILEIO_OBJECT * handle);\n\n/***************************************************************************\n Function:\n int FILEIO_PutChar (char c, FILEIO_OBJECT * handle)\n\n Summary:\n Writes a character to a file.\n\n Description:\n Writes a character to a file.\n\n Precondition:\n The drive containing the file must be mounted and the file handle \n must represent a valid, opened file.\n\n Parameters:\n c - The character to write.\n handle - The handle of the file.\n\n Returns:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE\n \n * Sets error code which can be retrieved with FILEIO_ErrorGet\n * FILEIO_ERROR_READ_ONLY - The file was not opened in write\n mode.\n * FILEIO_ERROR_WRITE_PROTECTED - The media is write-protected.\n * FILEIO_ERROR_BAD_SECTOR_READ - There was an error reading the\n FAT to determine the next cluster in the file, or an error reading the\n file data.\n * FILEIO_ERROR_INVALID_CLUSTER - The next cluster in the file\n is invalid.\n * FILEIO_ERROR_WRITE - Cached data could not be written to the\n device.\n * FILEIO_ERROR_BAD_SECTOR_READ - File data could not be cached.\n * FILEIO_ERROR_DRIVE_FULL - There are no more clusters on the\n media that can be allocated to the file. \n *******************************************************************************/\nint FILEIO_PutChar (char c, FILEIO_OBJECT * handle);\n\n/***************************************************************************\n Function:\n size_t FILEIO_Read (void * buffer, size_t size, size_t count,\n FILEIO_OBJECT * handle)\n\n Summary:\n Reads data from a file.\n\n Description:\n Reads data from a file and stores it in 'buffer.'\n\n Precondition:\n The drive containing the file must be mounted and the file handle \n must represent a valid, opened file.\n\n Parameters:\n buffer - The buffer that the data will be written to.\n size - The size of data objects to read, in bytes\n count - The number of data objects to read\n handle - The handle of the file.\n\n Returns:\n The number of data objects that were read. This value will match\n 'count' if the read was successful, or be less than count if it was\n not.\n \n Sets error code which can be retrieved with FILEIO_ErrorGet:\n * FILEIO_ERROR_WRITE_ONLY - The file is not opened in read mode.\n * FILEIO_ERROR_BAD_SECTOR_READ - There was an error reading the\n FAT to determine the next cluster in the file, or an error reading the\n \\file data.\n * FILEIO_ERROR_INVALID_CLUSTER - The next cluster in the file is\n invalid.\n * FILEIO_ERROR_EOF - There is no next cluster in the file (EOF)\n * FILEIO_ERROR_WRITE - Cached data could not be written to the\n device. \n *****************************************************************************/\nsize_t FILEIO_Read (void * buffer, size_t size, size_t count, FILEIO_OBJECT * handle);\n\n/***************************************************************************\n Function:\n size_t FILEIO_Write (void * buffer, size_t size, size_t count,\n FILEIO_OBJECT * handle)\n\n Summary:\n Writes data to a file.\n\n Description:\n Writes data from 'buffer' to a file.\n\n Precondition:\n The drive containing the file must be mounted and the file handle \n must represent a valid, opened file.\n\n Parameters:\n buffer - The buffer that contains the data to write.\n size - The size of data objects to write, in bytes\n count - The number of data objects to write\n handle - The handle of the file.\n\n Returns:\n The number of data objects that were written. This value will match\n 'count' if the write was successful, or be less than count if it was\n not.\n \n Sets error code which can be retrieved with FILEIO_ErrorGet:\n * FILEIO_ERROR_READ_ONLY - The file was not opened in write mode.\n * FILEIO_ERROR_WRITE_PROTECTED - The media is write-protected.\n * FILEIO_ERROR_BAD_SECTOR_READ - There was an error reading the\n FAT to determine the next cluster in the file, or an error reading the\n file data.\n * FILEIO_ERROR_INVALID_CLUSTER - The next cluster in the file is\n invalid.\n * FILEIO_ERROR_WRITE - Cached data could not be written to the\n device.\n * FILEIO_ERROR_BAD_SECTOR_READ - File data could not be cached.\n * FILEIO_ERROR_DRIVE_FULL - There are no more clusters on the\n media that can be allocated to the file. \n *****************************************************************************/\nsize_t FILEIO_Write (const void * buffer, size_t size, size_t count, FILEIO_OBJECT * handle);\n\n/***************************************************************************\n Function:\n int FILEIO_Seek (FILEIO_OBJECT * handle, int32_t offset, int base)\n\n Summary:\n Changes the current read/write position in the file.\n\n Description:\n Changes the current read/write position in the file.\n\n Precondition:\n The drive containing the file must be mounted and the file handle \n must represent a valid, opened file.\n\n Parameters:\n handle - The handle of the file.\n offset - The offset of the new read/write position (in bytes) from \n the base location. The offset will be added to FILEIO_SEEK_SET \n or FILEIO_SEEK_CUR, or subtracted from FILEIO_SEEK_END.\n base - The base location. Is of the FILEIO_SEEK_BASE type.\n\n Returns:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE\n \n * Sets error code which can be retrieved with FILEIO_ErrorGet\n * FILEIO_ERROR_WRITE - Cached data could not be written to the\n device.\n * FILEIO_ERROR_INVALID_ARGUMENT - The specified location\n exceeds the file's size.\n * FILEIO_ERROR_BAD_SECTOR_READ - There was an error reading the\n FAT to determine the next cluster in the file, or an error reading the\n file data.\n * FILEIO_ERROR_INVALID_CLUSTER - The next cluster in the file\n is invalid.\n * FILEIO_ERROR_DRIVE_FULL - There are no more clusters on the\n media that can be allocated to the file. Clusters will be allocated to\n the file if the file is opened in a write mode and the user seeks to\n the end of a file that ends on a cluster boundary.\n * FILEIO_ERROR_COULD_NOT_GET_CLUSTER - There was an error\n finding the cluster that contained the specified offset. \n *******************************************************************************/\nint FILEIO_Seek (FILEIO_OBJECT * handle, int32_t offset, int base);\n\n/***************************************************************************\n Function:\n bool FILEIO_Eof (FILEIO_OBJECT * handle)\n\n Summary:\n Determines if the file's current read/write position is at the end \n of the file.\n\n Description:\n Determines if the file's current read/write position is at the end \n of the file. \n\n Precondition:\n The drive containing the file must be mounted and the file handle \n must represent a valid, opened file.\n\n Parameters:\n handle - The handle of the file.\n\n Returns:\n * If EOF: true\n * If Not EOF: false \n *************************************************************************/\nbool FILEIO_Eof (FILEIO_OBJECT * handle);\n\n/***************************************************************************\n Function:\n long FILEIO_Tell (FILEIO_OBJECT * handle)\n\n Summary:\n Returns the current read/write position in the file.\n\n Description:\n Returns the current read/write position in the file.\n\n Precondition:\n The drive containing the file must be mounted and the file handle \n must represent a valid, opened file.\n\n Parameters:\n handle - THe handle of the file.\n\n Returns:\n long - Offset of the current read/write position from the beginning \n of the file, in bytes.\n***************************************************************************/\nlong FILEIO_Tell (FILEIO_OBJECT * handle);\n\n/******************************************************************************\n Function:\n int FILEIO_Find (const char * fileName, unsigned int attr,\n FILEIO_SEARCH_RECORD * record, bool newSearch)\n \n Summary:\n Searches for a file in the current working directory.\n Description:\n Searches for a file in the current working directory.\n Conditions:\n A drive must have been mounted by the FILEIO library.\n Input:\n fileName - The file's name. May contain limited partial string search\n elements. '?' can be used as a single\\-character wild\\-card\n and '*' can be used as a multiple\\-character wild card\n (only at the end of the file's name or extension).\n attr - Inclusive OR of all of the attributes (FILEIO_ATTRIBUTES\n structure members) that a found file may have.\n record - Structure containing parameters about the found file. Also\n contains private information used for additional searches\n for files that match the given criteria in the same\n directory.\n newSearch - true if this is the first search for the specified file\n \\parameters in the specified directory, false otherwise.\n This parameter must be specified as 'true' the first time\n this function is called with any given FILEIO_SEARCH_RECORD\n structure. The same FILEIO_SEARCH_RECORD structure should\n be used with subsequent calls of this function to search\n for additional files matching the given criteria.\n Return:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE\n * Returns file information in the record parameter.\n \n * Sets error code which can be retrieved with FILEIO_ErrorGet Note\n that if the path cannot be resolved, the error will be returned for the\n current working directory.\n * FILEIO_ERROR_INVALID_ARGUMENT - The path could not be\n resolved.\n * FILEIO_ERROR_INVALID_FILENAME - The file name is invalid.\n * FILEIO_ERROR_BAD_CACHE_READ - There was an error searching\n directory entries.\n * FILEIO_ERROR_DONE - File not found. \n ******************************************************************************/\nint FILEIO_Find (const char * fileName, unsigned int attr, FILEIO_SEARCH_RECORD * record, bool newSearch);\n\n/***************************************************************************\n Function:\n int FILEIO_LongFileNameGet (FILEIO_SEARCH_RECORD * record, uint16_t * buffer, uint16_t length)\n\n Summary:\n Obtains the long file name of a file found by the FILEIO_Find \n function.\n\n Description:\n This function will obtain the long file name of a file found \n by the FILEIO_Find function and copy it into a user-specified \n buffer. The name will be returned in unicode characters.\n\n Precondition:\n A drive must have been mounted by the FILEIO library. The \n FILEIO_SEARCH_RECORD structure must contain valid file information \n obtained from the FILEIO_Find function.\n\n Parameters:\n record - The file record obtained from a successful call of \n FILEIO_Find.\n buffer - A buffer to contain the long file name of the file.\n length - The length of the buffer, in 16-bit words.\n\n Returns:\n * If Success: FILEIO_RESULT_SUCCESS\n * If Failure: FILEIO_RESULT_FAILURE\n \n * Sets error code which can be retrieved with FILEIO_ErrorGet Note\n that if the path cannot be resolved, the error will be returned for the\n current working directory.\n * FILEIO_ERROR_INVALID_ARGUMENT - The path could not be\n resolved.\n * FILEIO_ERROR_NO_LONG_FILE_NAME - The short file name does not\n have an associated long file name.\n * FILEIO_ERROR_DONE - The directory entry could not be cached\n because the entryOffset contained in record was invalid.\n * FILEIO_ERROR_WRITE - Cached data could not be written to the\n device.\n * FILEIO_ERROR_BAD_SECTOR_READ - The directory entry could not\n be cached because there was an error reading from the device. \n ***************************************************************************************************/\nint FILEIO_LongFileNameGet (FILEIO_SEARCH_RECORD * record, uint16_t * buffer, uint16_t length);\n\n/********************************************************************\n Function:\n FILEIO_FILE_SYSTEM_TYPE FILEIO_FileSystemTypeGet (char driveId)\n \n Summary:\n Describes the file system type of a file system.\n Description:\n Describes the file system type of a file system.\n Conditions:\n A drive must have been mounted by the FILEIO library.\n Input:\n driveId - Character representation of the mounted device.\n Return:\n * If Success: FILEIO_FILE_SYSTEM_TYPE enumeration member\n * If Failure: FILEIO_FILE_SYSTEM_NONE \n ********************************************************************/\nFILEIO_FILE_SYSTEM_TYPE FILEIO_FileSystemTypeGet (char driveId);\n\n/*********************************************************************************\n Function:\n void FILEIO_DrivePropertiesGet()\n\n Summary:\n Allows user to get the drive properties (size of drive, free space, etc)\n\n Conditions:\n 1) ALLOW_GET_FILEIO_DRIVE_PROPERTIES must be defined in FSconfig.h\n 2) a FS_FILEIO_DRIVE_PROPERTIES object must be created before the function is called\n 3) the new_request member of the FS_FILEIO_DRIVE_PROPERTIES object must be set before\n calling the function for the first time. This will start a new search.\n 4) this function should not be called while there is a file open. Close all\n files before calling this function.\n\n Input:\n properties - a pointer to a FS_FILEIO_DRIVE_PROPERTIES object where the results should\n be stored.\n\n Return Values:\n This function returns void. The properties_status of the previous call of \n this function is located in the properties.status field. This field has \n the following possible values:\n\n FILEIO_GET_PROPERTIES_NO_ERRORS - operation completed without error. Results\n are in the properties object passed into the function.\n FILEIO_GET_PROPERTIES_DRIVE_NOT_MOUNTED - there is no mounted disk. Results in\n properties object is not valid\n FILEIO_GET_PROPERTIES_CLUSTER_FAILURE - there was a failure trying to read a \n cluster from the drive. The results in the properties object is a partial\n result up until the point of the failure.\n FILEIO_GET_PROPERTIES_STILL_WORKING - the search for free sectors is still in\n process. Continue calling this function with the same properties pointer \n until either the function completes or until the partial results meets the\n application needs. The properties object contains the partial results of\n the search and can be used by the application. \n\n Side Effects:\n Can cause errors if called when files are open. Close all files before\n calling this function.\n\n Calling this function without setting the new_request member on the first\n call can result in undefined behavior and results.\n\n Calling this function after a result is returned other than\n FILEIO_GET_PROPERTIES_STILL_WORKING can result in undefined behavior and results.\n\n Description: \n This function returns the information about the mounted drive. The results \n member of the properties object passed into the function is populated with \n the information about the drive. \n\n Before starting a new request, the new_request member of the properties\n input parameter should be set to true. This will initiate a new search\n request.\n\n This function will return before the search is complete with partial results.\n All of the results except the free_clusters will be correct after the first\n call. The free_clusters will contain the number of free clusters found up\n until that point, thus the free_clusters result will continue to grow until\n the entire drive is searched. If an application only needs to know that a \n certain number of bytes is available and doesn't need to know the total free \n size, then this function can be called until the required free size is\n verified. To continue a search, pass a pointer to the same FILEIO_FILEIO_DRIVE_PROPERTIES\n object that was passed in to create the search.\n\n A new search request should be made once this function has returned a value \n other than FILEIO_GET_PROPERTIES_STILL_WORKING. Continuing a completed search\n can result in undefined behavior or results.\n\n Typical Usage:\n <code>\n FILEIO_DRIVE_PROPERTIES disk_properties;\n\n disk_properties.new_request = true;\n\n do\n {\n FILEIO_DiskPropertiesGet(&disk_properties, 'A');\n } while (disk_properties.properties_status == FILEIO_GET_PROPERTIES_STILL_WORKING);\n </code>\n\n results.disk_format - contains the format of the drive. Valid results are \n FAT12(1), FAT16(2), or FAT32(3).\n\n results.sector_size - the sector size of the mounted drive. Valid values are\n 512, 1024, 2048, and 4096.\n\n results.sectors_per_cluster - the number sectors per cluster.\n\n results.total_clusters - the number of total clusters on the drive. This \n can be used to calculate the total disk size (total_clusters * \n sectors_per_cluster * sector_size = total size of drive in bytes)\n\n results.free_clusters - the number of free (unallocated) clusters on the drive.\n This can be used to calculate the total free disk size (free_clusters * \n sectors_per_cluster * sector_size = total size of drive in bytes)\n\n Remarks:\n PIC24F size estimates:\n Flash - 400 bytes (-Os setting)\n\n PIC24F speed estimates:\n Search takes approximately 7 seconds per Gigabyte of drive space. Speed\n will vary based on the number of sectors per cluster and the sector size.\n *********************************************************************************/\nvoid FILEIO_DrivePropertiesGet (FILEIO_DRIVE_PROPERTIES* properties, char driveId);\n\n#endif\n", "meta": {"content_hash": "00d1aeba2d2983c29725450cbc70da86", "timestamp": "", "source": "github", "line_count": 1471, "max_line_length": 176, "avg_line_length": 42.130523453433035, "alnum_prop": 0.5914899796688934, "repo_name": "medo64/TmpUsb", "id": "a8095af34c28abf7a0362ddfed5400aabcb87f8e", "size": "63489", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "firmware/src/Microchip/Framework/fileio/fileio.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "840025"}, {"name": "Makefile", "bytes": "42992"}, {"name": "PHP", "bytes": "144"}, {"name": "PowerShell", "bytes": "8819"}, {"name": "Shell", "bytes": "1333"}]}} +{"text": "{-# LANGUAGE TemplateHaskell, ScopedTypeVariables #-}\n{-# OPTIONS_GHC -fno-warn-orphans #-}\n\n{-| Unittests for the SlotMap.\n\n-}\n\n{-\n\nCopyright (C) 2014 Google Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright notice,\nthis list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n-}\n\nmodule Test.Ganeti.SlotMap\n ( testSlotMap\n , genSlotLimit\n , genTestKey\n , overfullKeys\n ) where\n\nimport Prelude hiding (all)\n\nimport Control.Applicative\nimport Control.Monad\nimport Data.Foldable (all)\nimport qualified Data.Map as Map\nimport Data.Map (Map, member, keys, keysSet)\nimport Data.Set (Set, size, union)\nimport qualified Data.Set as Set\nimport Data.Traversable (traverse)\nimport Test.HUnit\nimport Test.QuickCheck\n\nimport Test.Ganeti.TestCommon\nimport Test.Ganeti.TestHelper\nimport Test.Ganeti.Types ()\n\nimport Ganeti.SlotMap\n\n{-# ANN module \"HLint: ignore Use camelCase\" #-}\n\n\n-- | Generates a number typical for the limit of a `Slot`.\n-- Useful for constructing resource bounds when not directly constructing\n-- the relevant `Slot`s.\ngenSlotLimit :: Gen Int\ngenSlotLimit = frequency [ (9, choose (1, 5))\n , (1, choose (1, 100))\n ] -- Don't create huge slot limits.\n\n\ninstance Arbitrary Slot where\n arbitrary = do\n limit <- genSlotLimit\n occ <- choose (0, limit * 2)\n return $ Slot occ limit\n\n\n-- | Generates a number typical for the occupied count of a `Slot`.\n-- Useful for constructing `CountMap`s.\ngenSlotCount :: Gen Int\ngenSlotCount = slotOccupied <$> arbitrary\n\n\n-- | Takes a slot and resamples its `slotOccupied` count to fit the limit.\nresampleFittingSlot :: Slot -> Gen Slot\nresampleFittingSlot (Slot _ limit) = do\n occ <- choose (0, limit)\n return $ Slot occ limit\n\n\n-- | What we use as key for testing `SlotMap`s.\ntype TestKey = String\n\n\n-- | Generates short strings used as `SlotMap` keys.\n--\n-- We limit ourselves to a small set of key strings with high probability to\n-- increase the chance that `SlotMap`s actually have more than one slot taken.\ngenTestKey :: Gen TestKey\ngenTestKey = frequency [ (9, elements [\"a\", \"b\", \"c\", \"d\", \"e\"])\n , (1, genPrintableAsciiString)\n ]\n\n\n-- | Generates small lists.\nlistSizeGen :: Gen Int\nlistSizeGen = frequency [ (9, choose (1, 5))\n , (1, choose (1, 100))\n ]\n\n\n-- | Generates a `SlotMap` given a generator for the keys (see `genTestKey`).\ngenSlotMap :: (Ord a) => Gen a -> Gen (SlotMap a)\ngenSlotMap keyGen = do\n n <- listSizeGen -- don't create huge `SlotMap`s\n Map.fromList <$> vectorOf n ((,) <$> keyGen <*> arbitrary)\n\n\n-- | Generates a `CountMap` given a generator for the keys (see `genTestKey`).\ngenCountMap :: (Ord a) => Gen a -> Gen (CountMap a)\ngenCountMap keyGen = do\n n <- listSizeGen -- don't create huge `CountMap`s\n Map.fromList <$> vectorOf n ((,) <$> keyGen <*> genSlotCount)\n\n\n-- | Tells which keys of a `SlotMap` are overfull.\noverfullKeys :: (Ord a) => SlotMap a -> Set a\noverfullKeys sm =\n Set.fromList [ a | (a, Slot occ limit) <- Map.toList sm, occ > limit ]\n\n\n-- | Generates a `SlotMap` for which all slots are within their limits.\ngenFittingSlotMap :: (Ord a) => Gen a -> Gen (SlotMap a)\ngenFittingSlotMap keyGen = do\n -- Generate a SlotMap, then resample all slots to be fitting.\n slotMap <- traverse resampleFittingSlot =<< genSlotMap keyGen\n when (isOverfull slotMap) $ error \"BUG: FittingSlotMap Gen is wrong\"\n return slotMap\n\n\n-- * Test cases\n\ncase_isOverfull :: Assertion\ncase_isOverfull = do\n\n assertBool \"overfull\"\n . isOverfull $ Map.fromList [(\"buck\", Slot 3 2)]\n\n assertBool \"not overfull\"\n . not . isOverfull $ Map.fromList [(\"buck\", Slot 2 2)]\n\n assertBool \"empty\"\n . not . isOverfull $ (Map.fromList [] :: SlotMap TestKey)\n\n\ncase_occupySlots_examples :: Assertion\ncase_occupySlots_examples = do\n let a n = (\"a\", Slot n 2)\n let b n = (\"b\", Slot n 4)\n\n let sm = Map.fromList [a 1, b 2]\n cm = Map.fromList [(\"a\", 1), (\"b\", 1), (\"c\", 5)]\n\n assertEqual \"fitting occupySlots\"\n (sm `occupySlots` cm)\n (Map.fromList [a 2, b 3, (\"c\", Slot 5 0)])\n\n\n-- | Union of the keys of two maps.\nkeyUnion :: (Ord a) => Map a b -> Map a c -> Set a\nkeyUnion a b = keysSet a `union` keysSet b\n\n\n-- | Tests properties of `SlotMap`s being filled up.\nprop_occupySlots :: Property\nprop_occupySlots =\n forAll arbitrary $ \\(sm :: SlotMap Int, cm :: CountMap Int) ->\n let smOcc = sm `occupySlots` cm\n in conjoin\n [ counterexample \"input keys are preserved\" $\n all (`member` smOcc) (keyUnion sm cm)\n , counterexample \"all keys must come from the input keys\" $\n all (`Set.member` keyUnion sm cm) (keys smOcc)\n ]\n\n\n-- | Tests for whether there's still space for a job given its rate\n-- limits.\ncase_hasSlotsFor_examples :: Assertion\ncase_hasSlotsFor_examples = do\n let a n = (\"a\", Slot n 2)\n let b n = (\"b\", Slot n 4)\n let c n = (\"c\", Slot n 8)\n\n let sm = Map.fromList [a 1, b 2]\n\n assertBool \"fits\" $\n sm `hasSlotsFor` Map.fromList [(\"a\", 1), (\"b\", 1)]\n\n assertBool \"doesn't fit\"\n . not $ sm `hasSlotsFor` Map.fromList [(\"a\", 1), (\"b\", 3)]\n\n let smOverfull = Map.fromList [a 1, b 2, c 10]\n\n assertBool \"fits (untouched keys overfull)\" $\n isOverfull smOverfull\n && smOverfull `hasSlotsFor` Map.fromList [(\"a\", 1), (\"b\", 1)]\n\n assertBool \"empty fitting\" $\n Map.empty `hasSlotsFor` (Map.empty :: CountMap TestKey)\n\n assertBool \"empty not fitting\"\n . not $ Map.empty `hasSlotsFor` Map.fromList [(\"a\", 1), (\"b\", 100)]\n\n assertBool \"empty not fitting\"\n . not $ Map.empty `hasSlotsFor` Map.fromList [(\"a\", 1)]\n\n\n-- | Tests properties of `hasSlotsFor` on `SlotMap`s that are known to\n-- respect their limits.\nprop_hasSlotsFor_fitting :: Property\nprop_hasSlotsFor_fitting =\n forAll (genFittingSlotMap genTestKey) $ \\sm ->\n forAll (genCountMap genTestKey) $ \\cm ->\n sm `hasSlotsFor` cm ==? not (isOverfull $ sm `occupySlots` cm)\n\n\n-- | Tests properties of `hasSlotsFor`, irrespective of whether the\n-- input `SlotMap`s respect their limits or not.\nprop_hasSlotsFor :: Property\nprop_hasSlotsFor =\n let -- Generates `SlotMap`s for combining.\n genMaps = resize 10 $ do -- We don't need very large SlotMaps.\n sm1 <- genSlotMap genTestKey\n -- We need to make sm2 smaller to make `hasSlots` below more\n -- likely (otherwise the LHS of ==> is always false).\n sm2 <- sized $ \\n -> resize (n `div` 3) (genSlotMap genTestKey)\n -- We also want to test (sm1, sm1); we have to make it more\n -- likely for it to ever happen.\n frequency [ (1, return (sm1, sm1))\n , (9, return (sm1, sm2)) ]\n\n in forAll genMaps $ \\(sm1, sm2) ->\n let fits = sm1 `hasSlotsFor` toCountMap sm2\n smOcc = sm1 `occupySlots` toCountMap sm2\n oldOverfullBucks = overfullKeys sm1\n newOverfullBucks = overfullKeys smOcc\n in conjoin\n [ counterexample \"if there's enough extra space, then the new\\\n \\ overfull keys must be as before\" $\n fits ==> (newOverfullBucks ==? oldOverfullBucks)\n -- Note that the other way around does not hold:\n -- (newOverfullBucks == oldOverfullBucks) ==> fits\n , counterexample \"joining SlotMaps must not change the number of\\\n \\ overfull keys (but may change their slot\\\n \\ counts\"\n . property $ size newOverfullBucks >= size oldOverfullBucks\n ]\n\n\ntestSuite \"SlotMap\"\n [ 'case_isOverfull\n , 'case_occupySlots_examples\n , 'prop_occupySlots\n , 'case_hasSlotsFor_examples\n , 'prop_hasSlotsFor_fitting\n , 'prop_hasSlotsFor\n ]\n", "meta": {"content_hash": "7114364e60f4c731d0f4509b3235b706", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 78, "avg_line_length": 32.78021978021978, "alnum_prop": 0.6578388646776177, "repo_name": "yiannist/ganeti", "id": "295240da9caa3222c9288f1556498458e1b197e7", "size": "8949", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "test/hs/Test/Ganeti/SlotMap.hs", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Haskell", "bytes": "2509723"}, {"name": "JavaScript", "bytes": "8808"}, {"name": "M4", "bytes": "31972"}, {"name": "Makefile", "bytes": "96586"}, {"name": "Python", "bytes": "6231906"}, {"name": "Shell", "bytes": "151065"}]}} +{"text": "% get root of current file\nroot = fullfile(fileparts(mfilename('fullpath')),'../');\n\np_generated = genpath([root '/Core']);\naddpath(p_generated);\naddpath([root '/IO']);\naddpath([root '/Data']);\naddpath([root '/Scripts']);\n\np_generated = genpath([root '/ThirdParty/tetgen1.4.3/bin']);\naddpath(p_generated);\n\np_generated = genpath([root '/ThirdParty/maslib/bin']);\naddpath(p_generated);\n\nclear p_generated;\n", "meta": {"content_hash": "81c97ff9b6a3f45fd28b2fd533c3a5bf", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 60, "avg_line_length": 25.3125, "alnum_prop": 0.6864197530864198, "repo_name": "siavashk/GMM-FEM", "id": "96770015495e84e120342582ab8d07c142dba254", "size": "405", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Scripts/add_bcpd_paths.m", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "C", "bytes": "94"}, {"name": "C++", "bytes": "2046372"}, {"name": "CMake", "bytes": "10558"}, {"name": "Makefile", "bytes": "3869"}, {"name": "Matlab", "bytes": "168332"}, {"name": "Shell", "bytes": "2371"}]}} +{"text": "package main\n\nimport (\n\t\"context\"\n\n\taiplatform \"cloud.google.com/go/aiplatform/apiv1beta1\"\n\taiplatformpb \"cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\t// This snippet has been automatically generated and should be regarded as a code template only.\n\t// It will require modifications to work:\n\t// - It may require correct/in-range values for request initialization.\n\t// - It may require specifying regional endpoints when creating the service client as shown in:\n\t// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options\n\tc, err := aiplatform.NewEndpointClient(ctx)\n\tif err != nil {\n\t\t// TODO: Handle error.\n\t}\n\tdefer c.Close()\n\n\treq := &aiplatformpb.GetEndpointRequest{\n\t\t// TODO: Fill request struct fields.\n\t\t// See https://pkg.go.dev/cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb#GetEndpointRequest.\n\t}\n\tresp, err := c.GetEndpoint(ctx, req)\n\tif err != nil {\n\t\t// TODO: Handle error.\n\t}\n\t// TODO: Use resp.\n\t_ = resp\n}\n\n// [END aiplatform_v1beta1_generated_EndpointService_GetEndpoint_sync]\n", "meta": {"content_hash": "e3bbd8f0b19426a022d62a0e1da3edcc", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 102, "avg_line_length": 30.428571428571427, "alnum_prop": 0.7295774647887324, "repo_name": "googleapis/google-cloud-go", "id": "3067e39935255049f3815f4065db76bd9dfd979f", "size": "1814", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "internal/generated/snippets/aiplatform/apiv1beta1/EndpointClient/GetEndpoint/main.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "10349"}, {"name": "C", "bytes": "74"}, {"name": "Dockerfile", "bytes": "1841"}, {"name": "Go", "bytes": "7626642"}, {"name": "M4", "bytes": "43723"}, {"name": "Makefile", "bytes": "1455"}, {"name": "Python", "bytes": "718"}, {"name": "Shell", "bytes": "27309"}]}} +{"text": "\n\n#include <srs_app_http_conn.hpp>\n\n#if defined(SRS_AUTO_HTTP_CORE)\n\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <stdlib.h>\n\n#include <sstream>\nusing namespace std;\n\n#include <srs_protocol_buffer.hpp>\n#include <srs_rtmp_utility.hpp>\n#include <srs_kernel_log.hpp>\n#include <srs_kernel_error.hpp>\n#include <srs_app_st.hpp>\n#include <srs_core_autofree.hpp>\n#include <srs_app_config.hpp>\n#include <srs_kernel_utility.hpp>\n#include <srs_kernel_file.hpp>\n#include <srs_kernel_flv.hpp>\n#include <srs_rtmp_stack.hpp>\n#include <srs_app_source.hpp>\n#include <srs_rtmp_msg_array.hpp>\n#include <srs_kernel_aac.hpp>\n#include <srs_kernel_mp3.hpp>\n#include <srs_kernel_ts.hpp>\n#include <srs_app_pithy_print.hpp>\n#include <srs_app_source.hpp>\n#include <srs_app_server.hpp>\n#include <srs_app_http_static.hpp>\n#include <srs_app_http_stream.hpp>\n#include <srs_app_http_api.hpp>\n#include <srs_app_utility.hpp>\n\n#endif\n\n#ifdef SRS_AUTO_HTTP_CORE\n\nSrsHttpResponseWriter::SrsHttpResponseWriter(SrsStSocket* io)\n{\n skt = io;\n hdr = new SrsHttpHeader();\n header_wrote = false;\n status = SRS_CONSTS_HTTP_OK;\n content_length = -1;\n written = 0;\n header_sent = false;\n nb_iovss_cache = 0;\n iovss_cache = NULL;\n}\n\nSrsHttpResponseWriter::~SrsHttpResponseWriter()\n{\n srs_freep(hdr);\n srs_freepa(iovss_cache);\n}\n\nint SrsHttpResponseWriter::final_request()\n{\n // write the header data in memory.\n if (!header_wrote) {\n write_header(SRS_CONSTS_HTTP_OK);\n }\n\n // complete the chunked encoding.\n if (content_length == -1) {\n std::stringstream ss;\n ss << 0 << SRS_HTTP_CRLF << SRS_HTTP_CRLF;\n std::string ch = ss.str();\n return skt->write((void*)ch.data(), (int)ch.length(), NULL);\n }\n \n // flush when send with content length\n return write(NULL, 0);\n}\n\nSrsHttpHeader* SrsHttpResponseWriter::header()\n{\n return hdr;\n}\n\nint SrsHttpResponseWriter::write(char* data, int size)\n{\n int ret = ERROR_SUCCESS;\n \n // write the header data in memory.\n if (!header_wrote) {\n write_header(SRS_CONSTS_HTTP_OK);\n }\n \n // whatever header is wrote, we should try to send header.\n if ((ret = send_header(data, size)) != ERROR_SUCCESS) {\n srs_error(\"http: send header failed. ret=%d\", ret);\n return ret;\n }\n \n // check the bytes send and content length.\n written += size;\n if (content_length != -1 && written > content_length) {\n ret = ERROR_HTTP_CONTENT_LENGTH;\n srs_error(\"http: exceed content length. ret=%d\", ret);\n return ret;\n }\n \n // ignore NULL content.\n if (!data) {\n return ret;\n }\n \n // directly send with content length\n if (content_length != -1) {\n return skt->write((void*)data, size, NULL);\n }\n \n // send in chunked encoding.\n int nb_size = snprintf(header_cache, SRS_HTTP_HEADER_CACHE_SIZE, \"%x\", size);\n \n iovec iovs[4];\n iovs[0].iov_base = (char*)header_cache;\n iovs[0].iov_len = (int)nb_size;\n iovs[1].iov_base = (char*)SRS_HTTP_CRLF;\n iovs[1].iov_len = 2;\n iovs[2].iov_base = (char*)data;\n iovs[2].iov_len = size;\n iovs[3].iov_base = (char*)SRS_HTTP_CRLF;\n iovs[3].iov_len = 2;\n \n ssize_t nwrite;\n if ((ret = skt->writev(iovs, 4, &nwrite)) != ERROR_SUCCESS) {\n return ret;\n }\n \n return ret;\n}\n\nint SrsHttpResponseWriter::writev(iovec* iov, int iovcnt, ssize_t* pnwrite)\n{\n int ret = ERROR_SUCCESS;\n \n // when header not ready, or not chunked, send one by one.\n if (!header_wrote || content_length != -1) {\n ssize_t nwrite = 0;\n for (int i = 0; i < iovcnt; i++) {\n iovec* piovc = iov + i;\n nwrite += piovc->iov_len;\n if ((ret = write((char*)piovc->iov_base, (int)piovc->iov_len)) != ERROR_SUCCESS) {\n return ret;\n }\n }\n \n if (pnwrite) {\n *pnwrite = nwrite;\n }\n \n return ret;\n }\n \n // ignore NULL content.\n if (iovcnt <= 0) {\n return ret;\n }\n \n // send in chunked encoding.\n int nb_iovss = 3 + iovcnt;\n iovec* iovss = iovss_cache;\n if (nb_iovss_cache < nb_iovss) {\n srs_freepa(iovss_cache);\n nb_iovss_cache = nb_iovss;\n iovss = iovss_cache = new iovec[nb_iovss];\n }\n \n // send in chunked encoding.\n \n // chunk size.\n int size = 0;\n for (int i = 0; i < iovcnt; i++) {\n iovec* data_iov = iov + i;\n size += data_iov->iov_len;\n }\n written += size;\n \n // chunk header\n int nb_size = snprintf(header_cache, SRS_HTTP_HEADER_CACHE_SIZE, \"%x\", size);\n iovec* iovs = iovss;\n iovs[0].iov_base = (char*)header_cache;\n iovs[0].iov_len = (int)nb_size;\n iovs++;\n \n // chunk header eof.\n iovs[0].iov_base = (char*)SRS_HTTP_CRLF;\n iovs[0].iov_len = 2;\n iovs++;\n \n // chunk body.\n for (int i = 0; i < iovcnt; i++) {\n iovec* data_iov = iov + i;\n iovs[0].iov_base = (char*)data_iov->iov_base;\n iovs[0].iov_len = (int)data_iov->iov_len;\n iovs++;\n }\n \n // chunk body eof.\n iovs[0].iov_base = (char*)SRS_HTTP_CRLF;\n iovs[0].iov_len = 2;\n iovs++;\n \n // sendout all ioves.\n ssize_t nwrite;\n if ((ret = srs_write_large_iovs(skt, iovss, nb_iovss, &nwrite)) != ERROR_SUCCESS) {\n return ret;\n }\n \n if (pnwrite) {\n *pnwrite = nwrite;\n }\n \n return ret;\n}\n\nvoid SrsHttpResponseWriter::write_header(int code)\n{\n if (header_wrote) {\n srs_warn(\"http: multiple write_header calls, code=%d\", code);\n return;\n }\n \n header_wrote = true;\n status = code;\n \n // parse the content length from header.\n content_length = hdr->content_length();\n}\n\nint SrsHttpResponseWriter::send_header(char* data, int size)\n{\n int ret = ERROR_SUCCESS;\n \n if (header_sent) {\n return ret;\n }\n header_sent = true;\n \n std::stringstream ss;\n \n // status_line\n ss << \"HTTP/1.1 \" << status << \" \"\n << srs_generate_http_status_text(status) << SRS_HTTP_CRLF;\n \n // detect content type\n if (srs_go_http_body_allowd(status)) {\n if (hdr->content_type().empty()) {\n hdr->set_content_type(srs_go_http_detect(data, size));\n }\n }\n \n // set server if not set.\n if (hdr->get(\"Server\").empty()) {\n hdr->set(\"Server\", RTMP_SIG_SRS_SERVER);\n }\n \n // chunked encoding\n if (content_length == -1) {\n hdr->set(\"Transfer-Encoding\", \"chunked\");\n }\n \n // keep alive to make vlc happy.\n hdr->set(\"Connection\", \"Keep-Alive\");\n \n // write headers\n hdr->write(ss);\n \n // header_eof\n ss << SRS_HTTP_CRLF;\n \n std::string buf = ss.str();\n return skt->write((void*)buf.c_str(), buf.length(), NULL);\n}\n\nSrsHttpResponseReader::SrsHttpResponseReader(SrsHttpMessage* msg, SrsStSocket* io)\n{\n skt = io;\n owner = msg;\n is_eof = false;\n nb_total_read = 0;\n nb_left_chunk = 0;\n buffer = NULL;\n}\n\nSrsHttpResponseReader::~SrsHttpResponseReader()\n{\n}\n\nint SrsHttpResponseReader::initialize(SrsFastBuffer* body)\n{\n int ret = ERROR_SUCCESS;\n \n nb_chunk = 0;\n nb_left_chunk = 0;\n nb_total_read = 0;\n buffer = body;\n \n return ret;\n}\n\nbool SrsHttpResponseReader::eof()\n{\n return is_eof;\n}\n\nint SrsHttpResponseReader::read(char* data, int nb_data, int* nb_read)\n{\n int ret = ERROR_SUCCESS;\n \n if (is_eof) {\n ret = ERROR_HTTP_RESPONSE_EOF;\n srs_error(\"http: response EOF. ret=%d\", ret);\n return ret;\n }\n \n // chunked encoding.\n if (owner->is_chunked()) {\n return read_chunked(data, nb_data, nb_read);\n }\n \n // read by specified content-length\n if (owner->content_length() != -1) {\n int max = (int)owner->content_length() - (int)nb_total_read;\n if (max <= 0) {\n is_eof = true;\n return ret;\n }\n \n // change the max to read.\n nb_data = srs_min(nb_data, max);\n return read_specified(data, nb_data, nb_read);\n }\n \n // infinite chunked mode, directly read.\n if (owner->is_infinite_chunked()) {\n srs_assert(!owner->is_chunked() && owner->content_length() == -1);\n return read_specified(data, nb_data, nb_read);\n }\n \n // infinite chunked mode, but user not set it,\n // we think there is no data left.\n is_eof = true;\n \n return ret;\n}\n\nint SrsHttpResponseReader::read_chunked(char* data, int nb_data, int* nb_read)\n{\n int ret = ERROR_SUCCESS;\n \n // when no bytes left in chunk,\n // parse the chunk length first.\n if (nb_left_chunk <= 0) {\n char* at = NULL;\n int length = 0;\n while (!at) {\n // find the CRLF of chunk header end.\n char* start = buffer->bytes();\n char* end = start + buffer->size();\n for (char* p = start; p < end - 1; p++) {\n if (p[0] == SRS_HTTP_CR && p[1] == SRS_HTTP_LF) {\n // invalid chunk, ignore.\n if (p == start) {\n ret = ERROR_HTTP_INVALID_CHUNK_HEADER;\n srs_error(\"chunk header start with CRLF. ret=%d\", ret);\n return ret;\n }\n length = (int)(p - start + 2);\n at = buffer->read_slice(length);\n break;\n }\n }\n \n // got at, ok.\n if (at) {\n break;\n }\n \n // when empty, only grow 1bytes, but the buffer will cache more.\n if ((ret = buffer->grow(skt, buffer->size() + 1)) != ERROR_SUCCESS) {\n if (!srs_is_client_gracefully_close(ret)) {\n srs_error(\"read body from server failed. ret=%d\", ret);\n }\n return ret;\n }\n }\n srs_assert(length >= 3);\n \n // it's ok to set the pos and pos+1 to NULL.\n at[length - 1] = 0;\n at[length - 2] = 0;\n \n // size is the bytes size, excludes the chunk header and end CRLF.\n int ilength = (int)::strtol(at, NULL, 16);\n if (ilength < 0) {\n ret = ERROR_HTTP_INVALID_CHUNK_HEADER;\n srs_error(\"chunk header negative, length=%d. ret=%d\", ilength, ret);\n return ret;\n }\n \n // all bytes in chunk is left now.\n nb_chunk = nb_left_chunk = ilength;\n }\n \n if (nb_chunk <= 0) {\n // for the last chunk, eof.\n is_eof = true;\n } else {\n // for not the last chunk, there must always exists bytes.\n // left bytes in chunk, read some.\n srs_assert(nb_left_chunk);\n \n int nb_bytes = srs_min(nb_left_chunk, nb_data);\n ret = read_specified(data, nb_bytes, &nb_bytes);\n \n // the nb_bytes used for output already read size of bytes.\n if (nb_read) {\n *nb_read = nb_bytes;\n }\n nb_left_chunk -= nb_bytes;\n srs_info(\"http: read %d bytes of chunk\", nb_bytes);\n \n // error or still left bytes in chunk, ignore and read in future.\n if (nb_left_chunk > 0 || (ret != ERROR_SUCCESS)) {\n return ret;\n }\n srs_info(\"http: read total chunk %dB\", nb_chunk);\n }\n \n // for both the last or not, the CRLF of chunk payload end.\n if ((ret = buffer->grow(skt, 2)) != ERROR_SUCCESS) {\n if (!srs_is_client_gracefully_close(ret)) {\n srs_error(\"read EOF of chunk from server failed. ret=%d\", ret);\n }\n return ret;\n }\n buffer->read_slice(2);\n \n return ret;\n}\n\nint SrsHttpResponseReader::read_specified(char* data, int nb_data, int* nb_read)\n{\n int ret = ERROR_SUCCESS;\n \n if (buffer->size() <= 0) {\n // when empty, only grow 1bytes, but the buffer will cache more.\n if ((ret = buffer->grow(skt, 1)) != ERROR_SUCCESS) {\n if (!srs_is_client_gracefully_close(ret)) {\n srs_error(\"read body from server failed. ret=%d\", ret);\n }\n return ret;\n }\n }\n \n int nb_bytes = srs_min(nb_data, buffer->size());\n \n // read data to buffer.\n srs_assert(nb_bytes);\n char* p = buffer->read_slice(nb_bytes);\n memcpy(data, p, nb_bytes);\n if (nb_read) {\n *nb_read = nb_bytes;\n }\n \n // increase the total read to determine whether EOF.\n nb_total_read += nb_bytes;\n \n // for not chunked and specified content length.\n if (!owner->is_chunked() && owner->content_length() != -1) {\n // when read completed, eof.\n if (nb_total_read >= (int)owner->content_length()) {\n is_eof = true;\n }\n }\n \n return ret;\n}\n\nSrsHttpMessage::SrsHttpMessage(SrsStSocket* io, SrsConnection* c) : ISrsHttpMessage()\n{\n conn = c;\n chunked = false;\n infinite_chunked = false;\n keep_alive = true;\n _uri = new SrsHttpUri();\n _body = new SrsHttpResponseReader(this, io);\n _http_ts_send_buffer = new char[SRS_HTTP_TS_SEND_BUFFER_SIZE];\n jsonp = false;\n}\n\nSrsHttpMessage::~SrsHttpMessage()\n{\n srs_freep(_body);\n srs_freep(_uri);\n srs_freepa(_http_ts_send_buffer);\n}\n\nint SrsHttpMessage::update(string url, http_parser* header, SrsFastBuffer* body, vector<SrsHttpHeaderField>& headers)\n{\n int ret = ERROR_SUCCESS;\n \n _url = url;\n _header = *header;\n _headers = headers;\n \n // whether chunked.\n std::string transfer_encoding = get_request_header(\"Transfer-Encoding\");\n chunked = (transfer_encoding == \"chunked\");\n \n // whether keep alive.\n keep_alive = http_should_keep_alive(header);\n \n // set the buffer.\n if ((ret = _body->initialize(body)) != ERROR_SUCCESS) {\n return ret;\n }\n \n // parse uri from url.\n std::string host = get_request_header(\"Host\");\n \n // use server public ip when no host specified.\n // to make telnet happy.\n if (host.empty()) {\n host= srs_get_public_internet_address();\n }\n \n // parse uri to schema/server:port/path?query\n std::string uri = \"http://\" + host + _url;\n if ((ret = _uri->initialize(uri)) != ERROR_SUCCESS) {\n return ret;\n }\n \n // must format as key=value&...&keyN=valueN\n std::string q = _uri->get_query();\n size_t pos = string::npos;\n while (!q.empty()) {\n std::string k = q;\n if ((pos = q.find(\"=\")) != string::npos) {\n k = q.substr(0, pos);\n q = q.substr(pos + 1);\n } else {\n q = \"\";\n }\n \n std::string v = q;\n if ((pos = q.find(\"&\")) != string::npos) {\n v = q.substr(0, pos);\n q = q.substr(pos + 1);\n } else {\n q = \"\";\n }\n \n _query[k] = v;\n }\n \n // parse ext.\n _ext = _uri->get_path();\n if ((pos = _ext.rfind(\".\")) != string::npos) {\n _ext = _ext.substr(pos);\n } else {\n _ext = \"\";\n }\n \n // parse jsonp request message.\n if (!query_get(\"callback\").empty()) {\n jsonp = true;\n }\n if (jsonp) {\n jsonp_method = query_get(\"method\");\n }\n \n return ret;\n}\n\nSrsConnection* SrsHttpMessage::connection()\n{\n return conn;\n}\n\nu_int8_t SrsHttpMessage::method()\n{\n if (jsonp && !jsonp_method.empty()) {\n if (jsonp_method == \"GET\") {\n return SRS_CONSTS_HTTP_GET;\n } else if (jsonp_method == \"PUT\") {\n return SRS_CONSTS_HTTP_PUT;\n } else if (jsonp_method == \"POST\") {\n return SRS_CONSTS_HTTP_POST;\n } else if (jsonp_method == \"DELETE\") {\n return SRS_CONSTS_HTTP_DELETE;\n }\n }\n \n return (u_int8_t)_header.method;\n}\n\nu_int16_t SrsHttpMessage::status_code()\n{\n return (u_int16_t)_header.status_code;\n}\n\nstring SrsHttpMessage::method_str()\n{\n if (jsonp && !jsonp_method.empty()) {\n return jsonp_method;\n }\n \n if (is_http_get()) {\n return \"GET\";\n }\n if (is_http_put()) {\n return \"PUT\";\n }\n if (is_http_post()) {\n return \"POST\";\n }\n if (is_http_delete()) {\n return \"DELETE\";\n }\n if (is_http_options()) {\n return \"OPTIONS\";\n }\n \n return \"OTHER\";\n}\n\nbool SrsHttpMessage::is_http_get()\n{\n return method() == SRS_CONSTS_HTTP_GET;\n}\n\nbool SrsHttpMessage::is_http_put()\n{\n return method() == SRS_CONSTS_HTTP_PUT;\n}\n\nbool SrsHttpMessage::is_http_post()\n{\n return method() == SRS_CONSTS_HTTP_POST;\n}\n\nbool SrsHttpMessage::is_http_delete()\n{\n return method() == SRS_CONSTS_HTTP_DELETE;\n}\n\nbool SrsHttpMessage::is_http_options()\n{\n return _header.method == SRS_CONSTS_HTTP_OPTIONS;\n}\n\nbool SrsHttpMessage::is_chunked()\n{\n return chunked;\n}\n\nbool SrsHttpMessage::is_keep_alive()\n{\n return keep_alive;\n}\n\nbool SrsHttpMessage::is_infinite_chunked()\n{\n return infinite_chunked;\n}\n\nstring SrsHttpMessage::uri()\n{\n std::string uri = _uri->get_schema();\n if (uri.empty()) {\n uri += \"http\";\n }\n uri += \"://\";\n \n uri += host();\n uri += path();\n \n return uri;\n}\n\nstring SrsHttpMessage::url()\n{\n return _uri->get_url();\n}\n\nstring SrsHttpMessage::host()\n{\n return _uri->get_host();\n}\n\nstring SrsHttpMessage::path()\n{\n return _uri->get_path();\n}\n\nstring SrsHttpMessage::query()\n{\n return _uri->get_query();\n}\n\nstring SrsHttpMessage::ext()\n{\n return _ext;\n}\n\nint SrsHttpMessage::parse_rest_id(string pattern)\n{\n string p = _uri->get_path();\n if (p.length() <= pattern.length()) {\n return -1;\n }\n \n string id = p.substr((int)pattern.length());\n if (!id.empty()) {\n return ::atoi(id.c_str());\n }\n \n return -1;\n}\n\nint SrsHttpMessage::parse_rest_str(std::string pattern, std::string& req)\n{\n int ret = ERROR_SUCCESS;\n\t\n string p = _uri->get_path();\n if (p.length() <= pattern.length()) {\n return -1;\n }\n \n req = p.substr((int)(pattern.length() - 1));\n if (req.empty()) {\n return -1;\n }\n \n return ret;\t\n}\n\nint SrsHttpMessage::enter_infinite_chunked()\n{\n int ret = ERROR_SUCCESS;\n \n if (infinite_chunked) {\n return ret;\n }\n \n if (is_chunked() || content_length() != -1) {\n ret = ERROR_HTTP_DATA_INVALID;\n srs_error(\"infinite chunkted not supported in specified codec. ret=%d\", ret);\n return ret;\n }\n \n infinite_chunked = true;\n \n return ret;\n}\n\nint SrsHttpMessage::body_read_all(string& body)\n{\n int ret = ERROR_SUCCESS;\n \n // cache to read.\n char* buf = new char[SRS_HTTP_READ_CACHE_BYTES];\n SrsAutoFreeA(char, buf);\n \n // whatever, read util EOF.\n while (!_body->eof()) {\n int nb_read = 0;\n if ((ret = _body->read(buf, SRS_HTTP_READ_CACHE_BYTES, &nb_read)) != ERROR_SUCCESS) {\n return ret;\n }\n \n if (nb_read > 0) {\n body.append(buf, nb_read);\n }\n }\n \n return ret;\n}\n\nISrsHttpResponseReader* SrsHttpMessage::body_reader()\n{\n return _body;\n}\n\nint64_t SrsHttpMessage::content_length()\n{\n return _header.content_length;\n}\n\nstring SrsHttpMessage::query_get(string key)\n{\n std::string v;\n \n if (_query.find(key) != _query.end()) {\n v = _query[key];\n }\n \n return v;\n}\n\nint SrsHttpMessage::request_header_count()\n{\n return (int)_headers.size();\n}\n\nstring SrsHttpMessage::request_header_key_at(int index)\n{\n srs_assert(index < request_header_count());\n SrsHttpHeaderField item = _headers[index];\n return item.first;\n}\n\nstring SrsHttpMessage::request_header_value_at(int index)\n{\n srs_assert(index < request_header_count());\n SrsHttpHeaderField item = _headers[index];\n return item.second;\n}\n\nstring SrsHttpMessage::get_request_header(string name)\n{\n std::vector<SrsHttpHeaderField>::iterator it;\n \n for (it = _headers.begin(); it != _headers.end(); ++it) {\n SrsHttpHeaderField& elem = *it;\n std::string key = elem.first;\n std::string value = elem.second;\n if (key == name) {\n return value;\n }\n }\n \n return \"\";\n}\n\nSrsRequest* SrsHttpMessage::to_request(string vhost)\n{\n SrsRequest* req = new SrsRequest();\n \n req->app = _uri->get_path();\n size_t pos = string::npos;\n if ((pos = req->app.rfind(\"/\")) != string::npos) {\n req->stream = req->app.substr(pos + 1);\n req->app = req->app.substr(0, pos);\n }\n if ((pos = req->stream.rfind(\".\")) != string::npos) {\n req->stream = req->stream.substr(0, pos);\n }\n \n req->tcUrl = \"rtmp://\" + vhost + req->app;\n req->pageUrl = get_request_header(\"Referer\");\n req->objectEncoding = 0;\n \n srs_discovery_tc_url(req->tcUrl,\n req->schema, req->host, req->vhost, req->app, req->port,\n req->param);\n req->strip();\n \n return req;\n}\n\nbool SrsHttpMessage::is_jsonp()\n{\n return jsonp;\n}\n\nSrsHttpParser::SrsHttpParser()\n{\n buffer = new SrsFastBuffer();\n}\n\nSrsHttpParser::~SrsHttpParser()\n{\n srs_freep(buffer);\n}\n\nint SrsHttpParser::initialize(enum http_parser_type type)\n{\n int ret = ERROR_SUCCESS;\n \n memset(&settings, 0, sizeof(settings));\n settings.on_message_begin = on_message_begin;\n settings.on_url = on_url;\n settings.on_header_field = on_header_field;\n settings.on_header_value = on_header_value;\n settings.on_headers_complete = on_headers_complete;\n settings.on_body = on_body;\n settings.on_message_complete = on_message_complete;\n \n http_parser_init(&parser, type);\n // callback object ptr.\n parser.data = (void*)this;\n \n return ret;\n}\n\nint SrsHttpParser::parse_message(SrsStSocket* skt, SrsConnection* conn, ISrsHttpMessage** ppmsg)\n{\n *ppmsg = NULL;\n \n int ret = ERROR_SUCCESS;\n \n // reset request data.\n field_name = \"\";\n field_value = \"\";\n expect_field_name = true;\n state = SrsHttpParseStateInit;\n header = http_parser();\n url = \"\";\n headers.clear();\n header_parsed = 0;\n \n // do parse\n if ((ret = parse_message_imp(skt)) != ERROR_SUCCESS) {\n if (!srs_is_client_gracefully_close(ret)) {\n srs_error(\"parse http msg failed. ret=%d\", ret);\n }\n return ret;\n }\n \n // create msg\n SrsHttpMessage* msg = new SrsHttpMessage(skt, conn);\n \n // initalize http msg, parse url.\n if ((ret = msg->update(url, &header, buffer, headers)) != ERROR_SUCCESS) {\n srs_error(\"initialize http msg failed. ret=%d\", ret);\n srs_freep(msg);\n return ret;\n }\n \n // parse ok, return the msg.\n *ppmsg = msg;\n \n return ret;\n}\n\nint SrsHttpParser::parse_message_imp(SrsStSocket* skt)\n{\n int ret = ERROR_SUCCESS;\n \n while (true) {\n ssize_t nparsed = 0;\n \n // when got entire http header, parse it.\n // @see https://github.com/ossrs/srs/issues/400\n char* start = buffer->bytes();\n char* end = start + buffer->size();\n for (char* p = start; p <= end - 4; p++) {\n // SRS_HTTP_CRLFCRLF \"\\r\\n\\r\\n\" // 0x0D0A0D0A\n if (p[0] == SRS_CONSTS_CR && p[1] == SRS_CONSTS_LF && p[2] == SRS_CONSTS_CR && p[3] == SRS_CONSTS_LF) {\n nparsed = http_parser_execute(&parser, &settings, buffer->bytes(), buffer->size());\n srs_info(\"buffer=%d, nparsed=%d, header=%d\", buffer->size(), (int)nparsed, header_parsed);\n break;\n }\n }\n \n // consume the parsed bytes.\n if (nparsed && header_parsed) {\n buffer->read_slice(header_parsed);\n }\n \n // ok atleast header completed,\n // never wait for body completed, for maybe chunked.\n if (state == SrsHttpParseStateHeaderComplete || state == SrsHttpParseStateMessageComplete) {\n break;\n }\n \n // when nothing parsed, read more to parse.\n if (nparsed == 0) {\n // when requires more, only grow 1bytes, but the buffer will cache more.\n if ((ret = buffer->grow(skt, buffer->size() + 1)) != ERROR_SUCCESS) {\n if (!srs_is_client_gracefully_close(ret)) {\n srs_error(\"read body from server failed. ret=%d\", ret);\n }\n return ret;\n }\n }\n }\n \n // parse last header.\n if (!field_name.empty() && !field_value.empty()) {\n headers.push_back(std::make_pair(field_name, field_value));\n }\n \n return ret;\n}\n\nint SrsHttpParser::on_message_begin(http_parser* parser)\n{\n SrsHttpParser* obj = (SrsHttpParser*)parser->data;\n srs_assert(obj);\n \n obj->state = SrsHttpParseStateStart;\n \n srs_info(\"***MESSAGE BEGIN***\");\n \n return 0;\n}\n\nint SrsHttpParser::on_headers_complete(http_parser* parser)\n{\n SrsHttpParser* obj = (SrsHttpParser*)parser->data;\n srs_assert(obj);\n \n obj->header = *parser;\n // save the parser when header parse completed.\n obj->state = SrsHttpParseStateHeaderComplete;\n obj->header_parsed = (int)parser->nread;\n \n srs_info(\"***HEADERS COMPLETE***\");\n \n // see http_parser.c:1570, return 1 to skip body.\n return 0;\n}\n\nint SrsHttpParser::on_message_complete(http_parser* parser)\n{\n SrsHttpParser* obj = (SrsHttpParser*)parser->data;\n srs_assert(obj);\n \n // save the parser when body parse completed.\n obj->state = SrsHttpParseStateMessageComplete;\n \n srs_info(\"***MESSAGE COMPLETE***\\n\");\n \n return 0;\n}\n\nint SrsHttpParser::on_url(http_parser* parser, const char* at, size_t length)\n{\n SrsHttpParser* obj = (SrsHttpParser*)parser->data;\n srs_assert(obj);\n \n if (length > 0) {\n obj->url.append(at, (int)length);\n }\n \n srs_info(\"Method: %d, Url: %.*s\", parser->method, (int)length, at);\n \n return 0;\n}\n\nint SrsHttpParser::on_header_field(http_parser* parser, const char* at, size_t length)\n{\n SrsHttpParser* obj = (SrsHttpParser*)parser->data;\n srs_assert(obj);\n \n // field value=>name, reap the field.\n if (!obj->expect_field_name) {\n obj->headers.push_back(std::make_pair(obj->field_name, obj->field_value));\n \n // reset the field name when parsed.\n obj->field_name = \"\";\n obj->field_value = \"\";\n }\n obj->expect_field_name = true;\n \n if (length > 0) {\n obj->field_name.append(at, (int)length);\n }\n \n srs_info(\"Header field(%d bytes): %.*s\", (int)length, (int)length, at);\n return 0;\n}\n\nint SrsHttpParser::on_header_value(http_parser* parser, const char* at, size_t length)\n{\n SrsHttpParser* obj = (SrsHttpParser*)parser->data;\n srs_assert(obj);\n \n if (length > 0) {\n obj->field_value.append(at, (int)length);\n }\n obj->expect_field_name = false;\n \n srs_info(\"Header value(%d bytes): %.*s\", (int)length, (int)length, at);\n return 0;\n}\n\nint SrsHttpParser::on_body(http_parser* parser, const char* at, size_t length)\n{\n SrsHttpParser* obj = (SrsHttpParser*)parser->data;\n srs_assert(obj);\n \n srs_info(\"Body: %.*s\", (int)length, at);\n \n return 0;\n}\n\nSrsHttpUri::SrsHttpUri()\n{\n port = SRS_DEFAULT_HTTP_PORT;\n}\n\nSrsHttpUri::~SrsHttpUri()\n{\n}\n\nint SrsHttpUri::initialize(string _url)\n{\n int ret = ERROR_SUCCESS;\n \n url = _url;\n const char* purl = url.c_str();\n \n http_parser_url hp_u;\n if((ret = http_parser_parse_url(purl, url.length(), 0, &hp_u)) != 0){\n int code = ret;\n ret = ERROR_HTTP_PARSE_URI;\n \n srs_error(\"parse url %s failed, code=%d, ret=%d\", purl, code, ret);\n return ret;\n }\n \n std::string field = get_uri_field(url, &hp_u, UF_SCHEMA);\n if(!field.empty()){\n schema = field;\n }\n \n host = get_uri_field(url, &hp_u, UF_HOST);\n \n field = get_uri_field(url, &hp_u, UF_PORT);\n if(!field.empty()){\n port = atoi(field.c_str());\n }\n \n path = get_uri_field(url, &hp_u, UF_PATH);\n srs_info(\"parse url %s success\", purl);\n \n query = get_uri_field(url, &hp_u, UF_QUERY);\n srs_info(\"parse query %s success\", query.c_str());\n \n return ret;\n}\n\nconst char* SrsHttpUri::get_url()\n{\n return url.data();\n}\n\nconst char* SrsHttpUri::get_schema()\n{\n return schema.data();\n}\n\nconst char* SrsHttpUri::get_host()\n{\n return host.data();\n}\n\nint SrsHttpUri::get_port()\n{\n return port;\n}\n\nconst char* SrsHttpUri::get_path()\n{\n return path.data();\n}\n\nconst char* SrsHttpUri::get_query()\n{\n return query.data();\n}\n\nstring SrsHttpUri::get_uri_field(string uri, http_parser_url* hp_u, http_parser_url_fields field)\n{\n if((hp_u->field_set & (1 << field)) == 0){\n return \"\";\n }\n \n srs_verbose(\"uri field matched, off=%d, len=%d, value=%.*s\",\n hp_u->field_data[field].off,\n hp_u->field_data[field].len,\n hp_u->field_data[field].len,\n uri.c_str() + hp_u->field_data[field].off);\n \n int offset = hp_u->field_data[field].off;\n int len = hp_u->field_data[field].len;\n \n return uri.substr(offset, len);\n}\n\nSrsHttpConn::SrsHttpConn(IConnectionManager* cm, st_netfd_t fd, ISrsHttpServeMux* m)\n : SrsConnection(cm, fd)\n{\n parser = new SrsHttpParser();\n http_mux = m;\n}\n\nSrsHttpConn::~SrsHttpConn()\n{\n srs_freep(parser);\n}\n\nvoid SrsHttpConn::resample()\n{\n // TODO: FIXME: implements it\n}\n\nint64_t SrsHttpConn::get_send_bytes_delta()\n{\n // TODO: FIXME: implements it\n return 0;\n}\n\nint64_t SrsHttpConn::get_recv_bytes_delta()\n{\n // TODO: FIXME: implements it\n return 0;\n}\n\nvoid SrsHttpConn::cleanup()\n{\n // TODO: FIXME: implements it\n}\n\nint SrsHttpConn::do_cycle()\n{\n int ret = ERROR_SUCCESS;\n \n srs_trace(\"HTTP client ip=%s\", ip.c_str());\n \n // initialize parser\n if ((ret = parser->initialize(HTTP_REQUEST)) != ERROR_SUCCESS) {\n srs_error(\"http initialize http parser failed. ret=%d\", ret);\n return ret;\n }\n \n // underlayer socket\n SrsStSocket skt(stfd);\n \n // set the recv timeout, for some clients never disconnect the connection.\n // @see https://github.com/ossrs/srs/issues/398\n skt.set_recv_timeout(SRS_HTTP_RECV_TIMEOUT_US);\n \n // process http messages.\n while (!disposed) {\n ISrsHttpMessage* req = NULL;\n \n // get a http message\n if ((ret = parser->parse_message(&skt, this, &req)) != ERROR_SUCCESS) {\n return ret;\n }\n\n // if SUCCESS, always NOT-NULL.\n srs_assert(req);\n \n // always free it in this scope.\n SrsAutoFree(ISrsHttpMessage, req);\n \n // may should discard the body.\n if ((ret = on_got_http_message(req)) != ERROR_SUCCESS) {\n return ret;\n }\n \n // ok, handle http request.\n SrsHttpResponseWriter writer(&skt);\n if ((ret = process_request(&writer, req)) != ERROR_SUCCESS) {\n return ret;\n }\n \n // donot keep alive, disconnect it.\n // @see https://github.com/ossrs/srs/issues/399\n if (!req->is_keep_alive()) {\n break;\n }\n }\n \n return ret;\n}\n\nint SrsHttpConn::process_request(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) \n{\n int ret = ERROR_SUCCESS;\n \n srs_trace(\"HTTP %s %s, content-length=%\"PRId64\"\", \n r->method_str().c_str(), r->url().c_str(), r->content_length());\n \n // use default server mux to serve http request.\n if ((ret = http_mux->serve_http(w, r)) != ERROR_SUCCESS) {\n if (!srs_is_client_gracefully_close(ret)) {\n srs_error(\"serve http msg failed. ret=%d\", ret);\n }\n return ret;\n }\n \n return ret;\n}\n\nSrsResponseOnlyHttpConn::SrsResponseOnlyHttpConn(IConnectionManager* cm, st_netfd_t fd, ISrsHttpServeMux* m)\n : SrsHttpConn(cm, fd, m)\n{\n}\n\nSrsResponseOnlyHttpConn::~SrsResponseOnlyHttpConn()\n{\n}\n\nint SrsResponseOnlyHttpConn::on_got_http_message(ISrsHttpMessage* msg)\n{\n int ret = ERROR_SUCCESS;\n \n ISrsHttpResponseReader* br = msg->body_reader();\n \n // drop all request body.\n while (!br->eof()) {\n char body[4096];\n if ((ret = br->read(body, 4096, NULL)) != ERROR_SUCCESS) {\n return ret;\n }\n }\n \n return ret;\n}\n\nSrsHttpServer::SrsHttpServer(SrsServer* svr)\n{\n server = svr;\n http_stream = new SrsHttpStreamServer(svr);\n http_static = new SrsHttpStaticServer(svr);\n}\n\nSrsHttpServer::~SrsHttpServer()\n{\n srs_freep(http_stream);\n srs_freep(http_static);\n}\n\nint SrsHttpServer::initialize()\n{\n int ret = ERROR_SUCCESS;\n \n#if defined(SRS_AUTO_HTTP_SERVER) && defined(SRS_AUTO_HTTP_API)\n // for SRS go-sharp to detect the status of HTTP server of SRS HTTP FLV Cluster.\n if ((ret = http_static->mux.handle(\"/api/v1/versions\", new SrsGoApiVersion())) != ERROR_SUCCESS) {\n return ret;\n }\n#endif\n \n if ((ret = http_stream->initialize()) != ERROR_SUCCESS) {\n return ret;\n }\n \n if ((ret = http_static->initialize()) != ERROR_SUCCESS) {\n return ret;\n }\n \n return ret;\n}\n\nint SrsHttpServer::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)\n{\n // try http stream first.\n if (http_stream->mux.can_serve(r)) {\n return http_stream->mux.serve_http(w, r);\n }\n \n return http_static->mux.serve_http(w, r);\n}\n\nint SrsHttpServer::http_mount(SrsSource* s, SrsRequest* r)\n{\n return http_stream->http_mount(s, r);\n}\n\nvoid SrsHttpServer::http_unmount(SrsSource* s, SrsRequest* r)\n{\n http_stream->http_unmount(s, r);\n}\n\nint SrsHttpServer::mount_hls(SrsRequest* r)\n{\n return http_stream->mount_hls(r);\n}\n\nint SrsHttpServer::hls_update_m3u8(SrsRequest* r, std::string m3u8)\n{\n return http_stream->hls_update_m3u8(r, m3u8);\n}\n\nint SrsHttpServer::hls_update_ts(SrsRequest* r, std::string uri, std::string ts)\n{\n return http_stream->hls_update_ts(r, uri, ts);\n}\n\nint SrsHttpServer::hls_remove_ts(SrsRequest* r, std::string uri)\n{\n return http_stream->hls_remove_ts(r, uri);\n}\n\nvoid SrsHttpServer::unmount_hls(SrsRequest* r)\n{\n http_stream->unmount_hls(r);\n}\n\n#endif\n\n", "meta": {"content_hash": "3f29c672a4cfca6217a200173361dbbb", "timestamp": "", "source": "github", "line_count": 1407, "max_line_length": 117, "avg_line_length": 24.26226012793177, "alnum_prop": 0.5610920701877729, "repo_name": "wangcy6/storm_app", "id": "5f1096f8e9c3bed5f39751201e93be20ab6b9a7d", "size": "35224", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "frame/c++/srs-2.0release/trunk/src/app/srs_app_http_conn.cpp", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ActionScript", "bytes": "86225"}, {"name": "Assembly", "bytes": "4834"}, {"name": "Batchfile", "bytes": "50141"}, {"name": "C", "bytes": "9700081"}, {"name": "C#", "bytes": "1587148"}, {"name": "C++", "bytes": "14378340"}, {"name": "CMake", "bytes": "756439"}, {"name": "CSS", "bytes": "59712"}, {"name": "Clojure", "bytes": "535480"}, {"name": "DTrace", "bytes": "147"}, {"name": "Fancy", "bytes": "6234"}, {"name": "FreeMarker", "bytes": "3512"}, {"name": "Go", "bytes": "27069"}, {"name": "Groovy", "bytes": "1755"}, {"name": "HTML", "bytes": "1235479"}, {"name": "Java", "bytes": "41653938"}, {"name": "JavaScript", "bytes": "260093"}, {"name": "Lua", "bytes": "11887"}, {"name": "M4", "bytes": "96283"}, {"name": "Makefile", "bytes": "977879"}, {"name": "NSIS", "bytes": "6522"}, {"name": "Objective-C", "bytes": "324010"}, {"name": "PHP", "bytes": "348909"}, {"name": "Perl", "bytes": "182487"}, {"name": "PowerShell", "bytes": "19465"}, {"name": "Prolog", "bytes": "243"}, {"name": "Python", "bytes": "3649738"}, {"name": "QML", "bytes": "9975"}, {"name": "QMake", "bytes": "63106"}, {"name": "Roff", "bytes": "12319"}, {"name": "Ruby", "bytes": "858066"}, {"name": "Scala", "bytes": "5203874"}, {"name": "Shell", "bytes": "714435"}, {"name": "Smarty", "bytes": "1047"}, {"name": "Swift", "bytes": "3486"}, {"name": "Tcl", "bytes": "492616"}, {"name": "Thrift", "bytes": "31449"}, {"name": "XS", "bytes": "20183"}, {"name": "XSLT", "bytes": "8784"}]}} +{"text": "<?php\n\n/**\n * @file\n * Contains \\Drupal\\user\\Plugin\\Validation\\Constraint\\UserNameUnique.\n */\n\nnamespace Drupal\\user\\Plugin\\Validation\\Constraint;\n\nuse Symfony\\Component\\Validator\\Constraint;\n\n/**\n * Checks if a user name is unique on the site.\n *\n * @Constraint(\n * id = \"UserNameUnique\",\n * label = @Translation(\"User name unique\", context = \"Validation\"),\n * )\n */\nclass UserNameUnique extends Constraint {\n\n public $message = 'The username %value is already taken.';\n\n /**\n * {@inheritdoc}\n */\n public function validatedBy() {\n return '\\Drupal\\Core\\Validation\\Plugin\\Validation\\Constraint\\UniqueFieldValueValidator';\n }\n}\n", "meta": {"content_hash": "d532f1332d2207e366c484dd0e603679", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 92, "avg_line_length": 21.366666666666667, "alnum_prop": 0.6957878315132605, "repo_name": "kaperkin/drupal_8_shelby_site", "id": "286d340c0c088f90f881a5b0f907c589281d7ddd", "size": "641", "binary": false, "copies": "29", "ref": "refs/heads/master", "path": "core/modules/user/src/Plugin/Validation/Constraint/UserNameUnique.php", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "673"}, {"name": "C++", "bytes": "13011"}, {"name": "CSS", "bytes": "292661"}, {"name": "HTML", "bytes": "319322"}, {"name": "JavaScript", "bytes": "812156"}, {"name": "PHP", "bytes": "26645010"}, {"name": "Shell", "bytes": "41324"}]}} +{"text": "zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'\n\n# pasting with tabs doesn't perform completion\nzstyle ':completion:*' insert-tab pending\n\n# default to file completion\nzstyle ':completion:*' completer _expand _complete _files _correct _approximate\n\n# ls colors\nzstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}\n", "meta": {"content_hash": "2f60ec471ccbc1237928dfb448de1351", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 79, "avg_line_length": 32.7, "alnum_prop": 0.7247706422018348, "repo_name": "paulhirschi/dotfiles", "id": "c08a243124a26f0a9bb88d3ed7a8f26aaf6d995c", "size": "368", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "zsh/completion.zsh", "mode": "33188", "license": "mit", "language": [{"name": "AppleScript", "bytes": "2557"}, {"name": "Shell", "bytes": "40541"}, {"name": "Vim script", "bytes": "83757"}]}} +{"text": "using namespace SEGSEvents;\nextern void register_FriendshipServiceEvents();\nnamespace\n{\n const char *event_names[] =\n {\n \"FriendConnectedMessage\",\n \"SendFriendListMessage\",\n \"SendNotifyFriendMessage\",\n \"FriendAddedMessage\",\n \"FriendRemovedMessage\",\n };\n}\n\nclass FriendshipEventRegistry : public QObject\n{\n Q_OBJECT\nprivate slots:\n void creationByName()\n {\n for(const char *ev_name : event_names)\n {\n QVERIFY2(create_by_name(ev_name)==nullptr,\"no types registered yet, create_by_name result should be null\");\n }\n // TODO: call register_all_events();\n register_FriendshipServiceEvents();\n for(const char *ev_name : event_names)\n {\n QVERIFY2(create_by_name(ev_name) != nullptr,\n qPrintable(QString(\"all types registered, create_by_name(%1) result should be non-null\").arg(ev_name)));\n }\n }\n};\n\nQTEST_MAIN(FriendshipEventRegistry)\n\n#include \"FriendshipEventRegistry.moc\"\n", "meta": {"content_hash": "55510994018835d6137c5b7f88f690f6", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 125, "avg_line_length": 27.594594594594593, "alnum_prop": 0.6327130264446621, "repo_name": "Segs/Segs", "id": "cb7fb4a21cc5ddd40dbfac908b8925839871bc16", "size": "1070", "binary": false, "copies": "3", "ref": "refs/heads/develop", "path": "Servers/GameServer/FriendshipService/UnitTests/FriendshipEventRegistry.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "14052"}, {"name": "C#", "bytes": "5777"}, {"name": "C++", "bytes": "2597767"}, {"name": "CMake", "bytes": "90611"}, {"name": "CSS", "bytes": "9046"}, {"name": "Dockerfile", "bytes": "159"}, {"name": "GLSL", "bytes": "9402"}, {"name": "Java", "bytes": "10189"}, {"name": "Lua", "bytes": "565226"}, {"name": "NSIS", "bytes": "3505"}, {"name": "PHP", "bytes": "3660"}, {"name": "Ruby", "bytes": "6654"}, {"name": "Shell", "bytes": "4498"}]}} +{"text": "@class DVSlideViewController;\n\n@interface AppDelegate : UIResponder <UIApplicationDelegate>\n\n@property (strong, nonatomic) UIWindow *window;\n\n@property (strong, nonatomic) DVSlideViewController *viewController;\n\n@end\n", "meta": {"content_hash": "da256218503a3138dfc74336ab869fed", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 68, "avg_line_length": 24.11111111111111, "alnum_prop": 0.8110599078341014, "repo_name": "dickverbunt/DVSlideViewController", "id": "0dbbfa4a8fe0378a77819684dc726b5500fdbac3", "size": "398", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "DVSlideViewController/AppDelegate.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Objective-C", "bytes": "13207"}]}} +{"text": "\n\npackage lifecycle\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"strconv\"\n\n\t\"k8s.io/api/core/v1\"\n\t\"k8s.io/apimachinery/pkg/types\"\n\t\"k8s.io/apimachinery/pkg/util/intstr\"\n\t\"k8s.io/klog\"\n\tkubecontainer \"k8s.io/kubernetes/pkg/kubelet/container\"\n\tkubetypes \"k8s.io/kubernetes/pkg/kubelet/types\"\n\t\"k8s.io/kubernetes/pkg/kubelet/util/format\"\n\t\"k8s.io/kubernetes/pkg/security/apparmor\"\n\tutilio \"k8s.io/utils/io\"\n)\n\nconst (\n\tmaxRespBodyLength = 10 * 1 << 10 // 10KB\n)\n\ntype HandlerRunner struct {\n\thttpGetter kubetypes.HttpGetter\n\tcommandRunner kubecontainer.ContainerCommandRunner\n\tcontainerManager podStatusProvider\n}\n\ntype podStatusProvider interface {\n\tGetPodStatus(uid types.UID, name, namespace string) (*kubecontainer.PodStatus, error)\n}\n\nfunc NewHandlerRunner(httpGetter kubetypes.HttpGetter, commandRunner kubecontainer.ContainerCommandRunner, containerManager podStatusProvider) kubecontainer.HandlerRunner {\n\treturn &HandlerRunner{\n\t\thttpGetter: httpGetter,\n\t\tcommandRunner: commandRunner,\n\t\tcontainerManager: containerManager,\n\t}\n}\n\nfunc (hr *HandlerRunner) Run(containerID kubecontainer.ContainerID, pod *v1.Pod, container *v1.Container, handler *v1.Handler) (string, error) {\n\tswitch {\n\tcase handler.Exec != nil:\n\t\tvar msg string\n\t\t// TODO(tallclair): Pass a proper timeout value.\n\t\toutput, err := hr.commandRunner.RunInContainer(containerID, handler.Exec.Command, 0)\n\t\tif err != nil {\n\t\t\tmsg = fmt.Sprintf(\"Exec lifecycle hook (%v) for Container %q in Pod %q failed - error: %v, message: %q\", handler.Exec.Command, container.Name, format.Pod(pod), err, string(output))\n\t\t\tklog.V(1).Infof(msg)\n\t\t}\n\t\treturn msg, err\n\tcase handler.HTTPGet != nil:\n\t\tmsg, err := hr.runHTTPHandler(pod, container, handler)\n\t\tif err != nil {\n\t\t\tmsg = fmt.Sprintf(\"Http lifecycle hook (%s) for Container %q in Pod %q failed - error: %v, message: %q\", handler.HTTPGet.Path, container.Name, format.Pod(pod), err, msg)\n\t\t\tklog.V(1).Infof(msg)\n\t\t}\n\t\treturn msg, err\n\tdefault:\n\t\terr := fmt.Errorf(\"Invalid handler: %v\", handler)\n\t\tmsg := fmt.Sprintf(\"Cannot run handler: %v\", err)\n\t\tklog.Errorf(msg)\n\t\treturn msg, err\n\t}\n}\n\n// resolvePort attempts to turn an IntOrString port reference into a concrete port number.\n// If portReference has an int value, it is treated as a literal, and simply returns that value.\n// If portReference is a string, an attempt is first made to parse it as an integer. If that fails,\n// an attempt is made to find a port with the same name in the container spec.\n// If a port with the same name is found, it's ContainerPort value is returned. If no matching\n// port is found, an error is returned.\nfunc resolvePort(portReference intstr.IntOrString, container *v1.Container) (int, error) {\n\tif portReference.Type == intstr.Int {\n\t\treturn portReference.IntValue(), nil\n\t}\n\tportName := portReference.StrVal\n\tport, err := strconv.Atoi(portName)\n\tif err == nil {\n\t\treturn port, nil\n\t}\n\tfor _, portSpec := range container.Ports {\n\t\tif portSpec.Name == portName {\n\t\t\treturn int(portSpec.ContainerPort), nil\n\t\t}\n\t}\n\treturn -1, fmt.Errorf(\"couldn't find port: %v in %v\", portReference, container)\n}\n\nfunc (hr *HandlerRunner) runHTTPHandler(pod *v1.Pod, container *v1.Container, handler *v1.Handler) (string, error) {\n\thost := handler.HTTPGet.Host\n\tif len(host) == 0 {\n\t\tstatus, err := hr.containerManager.GetPodStatus(pod.UID, pod.Name, pod.Namespace)\n\t\tif err != nil {\n\t\t\tklog.Errorf(\"Unable to get pod info, event handlers may be invalid.\")\n\t\t\treturn \"\", err\n\t\t}\n\t\tif len(status.IPs) == 0 {\n\t\t\treturn \"\", fmt.Errorf(\"failed to find networking container: %v\", status)\n\t\t}\n\t\thost = status.IPs[0]\n\t}\n\tvar port int\n\tif handler.HTTPGet.Port.Type == intstr.String && len(handler.HTTPGet.Port.StrVal) == 0 {\n\t\tport = 80\n\t} else {\n\t\tvar err error\n\t\tport, err = resolvePort(handler.HTTPGet.Port, container)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\turl := fmt.Sprintf(\"http://%s/%s\", net.JoinHostPort(host, strconv.Itoa(port)), handler.HTTPGet.Path)\n\tresp, err := hr.httpGetter.Get(url)\n\treturn getHttpRespBody(resp), err\n}\n\nfunc getHttpRespBody(resp *http.Response) string {\n\tif resp == nil {\n\t\treturn \"\"\n\t}\n\tdefer resp.Body.Close()\n\tbytes, err := utilio.ReadAtMost(resp.Body, maxRespBodyLength)\n\tif err == nil || err == utilio.ErrLimitReached {\n\t\treturn string(bytes)\n\t}\n\treturn \"\"\n}\n\nfunc NewAppArmorAdmitHandler(validator apparmor.Validator) PodAdmitHandler {\n\treturn &appArmorAdmitHandler{\n\t\tValidator: validator,\n\t}\n}\n\ntype appArmorAdmitHandler struct {\n\tapparmor.Validator\n}\n\nfunc (a *appArmorAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult {\n\t// If the pod is already running or terminated, no need to recheck AppArmor.\n\tif attrs.Pod.Status.Phase != v1.PodPending {\n\t\treturn PodAdmitResult{Admit: true}\n\t}\n\n\terr := a.Validate(attrs.Pod)\n\tif err == nil {\n\t\treturn PodAdmitResult{Admit: true}\n\t}\n\treturn PodAdmitResult{\n\t\tAdmit: false,\n\t\tReason: \"AppArmor\",\n\t\tMessage: fmt.Sprintf(\"Cannot enforce AppArmor: %v\", err),\n\t}\n}\n\nfunc NewNoNewPrivsAdmitHandler(runtime kubecontainer.Runtime) PodAdmitHandler {\n\treturn &noNewPrivsAdmitHandler{\n\t\tRuntime: runtime,\n\t}\n}\n\ntype noNewPrivsAdmitHandler struct {\n\tkubecontainer.Runtime\n}\n\nfunc (a *noNewPrivsAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult {\n\t// If the pod is already running or terminated, no need to recheck NoNewPrivs.\n\tif attrs.Pod.Status.Phase != v1.PodPending {\n\t\treturn PodAdmitResult{Admit: true}\n\t}\n\n\t// If the containers in a pod do not require no-new-privs, admit it.\n\tif !noNewPrivsRequired(attrs.Pod) {\n\t\treturn PodAdmitResult{Admit: true}\n\t}\n\n\t// Always admit runtimes except docker.\n\tif a.Runtime.Type() != kubetypes.DockerContainerRuntime {\n\t\treturn PodAdmitResult{Admit: true}\n\t}\n\n\t// Make sure docker api version is valid.\n\trversion, err := a.Runtime.APIVersion()\n\tif err != nil {\n\t\treturn PodAdmitResult{\n\t\t\tAdmit: false,\n\t\t\tReason: \"NoNewPrivs\",\n\t\t\tMessage: fmt.Sprintf(\"Cannot enforce NoNewPrivs: %v\", err),\n\t\t}\n\t}\n\tv, err := rversion.Compare(\"1.23.0\")\n\tif err != nil {\n\t\treturn PodAdmitResult{\n\t\t\tAdmit: false,\n\t\t\tReason: \"NoNewPrivs\",\n\t\t\tMessage: fmt.Sprintf(\"Cannot enforce NoNewPrivs: %v\", err),\n\t\t}\n\t}\n\t// If the version is less than 1.23 it will return -1 above.\n\tif v == -1 {\n\t\treturn PodAdmitResult{\n\t\t\tAdmit: false,\n\t\t\tReason: \"NoNewPrivs\",\n\t\t\tMessage: fmt.Sprintf(\"Cannot enforce NoNewPrivs: docker runtime API version %q must be greater than or equal to 1.23\", rversion.String()),\n\t\t}\n\t}\n\n\treturn PodAdmitResult{Admit: true}\n}\n\nfunc noNewPrivsRequired(pod *v1.Pod) bool {\n\t// Iterate over pod containers and check if we added no-new-privs.\n\tfor _, c := range pod.Spec.Containers {\n\t\tif c.SecurityContext != nil && c.SecurityContext.AllowPrivilegeEscalation != nil && !*c.SecurityContext.AllowPrivilegeEscalation {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc NewProcMountAdmitHandler(runtime kubecontainer.Runtime) PodAdmitHandler {\n\treturn &procMountAdmitHandler{\n\t\tRuntime: runtime,\n\t}\n}\n\ntype procMountAdmitHandler struct {\n\tkubecontainer.Runtime\n}\n\nfunc (a *procMountAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult {\n\t// If the pod is already running or terminated, no need to recheck NoNewPrivs.\n\tif attrs.Pod.Status.Phase != v1.PodPending {\n\t\treturn PodAdmitResult{Admit: true}\n\t}\n\n\t// If the containers in a pod only need the default ProcMountType, admit it.\n\tif procMountIsDefault(attrs.Pod) {\n\t\treturn PodAdmitResult{Admit: true}\n\t}\n\n\t// Always admit runtimes except docker.\n\tif a.Runtime.Type() != kubetypes.DockerContainerRuntime {\n\t\treturn PodAdmitResult{Admit: true}\n\t}\n\n\t// Make sure docker api version is valid.\n\t// Merged in https://github.com/moby/moby/pull/36644\n\trversion, err := a.Runtime.APIVersion()\n\tif err != nil {\n\t\treturn PodAdmitResult{\n\t\t\tAdmit: false,\n\t\t\tReason: \"ProcMount\",\n\t\t\tMessage: fmt.Sprintf(\"Cannot enforce ProcMount: %v\", err),\n\t\t}\n\t}\n\tv, err := rversion.Compare(\"1.38.0\")\n\tif err != nil {\n\t\treturn PodAdmitResult{\n\t\t\tAdmit: false,\n\t\t\tReason: \"ProcMount\",\n\t\t\tMessage: fmt.Sprintf(\"Cannot enforce ProcMount: %v\", err),\n\t\t}\n\t}\n\t// If the version is less than 1.38 it will return -1 above.\n\tif v == -1 {\n\t\treturn PodAdmitResult{\n\t\t\tAdmit: false,\n\t\t\tReason: \"ProcMount\",\n\t\t\tMessage: fmt.Sprintf(\"Cannot enforce ProcMount: docker runtime API version %q must be greater than or equal to 1.38\", rversion.String()),\n\t\t}\n\t}\n\n\treturn PodAdmitResult{Admit: true}\n}\n\nfunc procMountIsDefault(pod *v1.Pod) bool {\n\t// Iterate over pod containers and check if we are using the DefaultProcMountType\n\t// for all containers.\n\tfor _, c := range pod.Spec.Containers {\n\t\tif c.SecurityContext != nil {\n\t\t\tif c.SecurityContext.ProcMount != nil && *c.SecurityContext.ProcMount != v1.DefaultProcMount {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true\n}\n", "meta": {"content_hash": "ad753220939e70346f0e752215cfd7e7", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 183, "avg_line_length": 29.757679180887372, "alnum_prop": 0.7153343273311159, "repo_name": "quinton-hoole/kubernetes", "id": "c84f7d9ad574b77fec952c8af61d031950b2ab8b", "size": "9288", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "pkg/kubelet/lifecycle/handlers.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "2840"}, {"name": "Dockerfile", "bytes": "52078"}, {"name": "Go", "bytes": "48505969"}, {"name": "HTML", "bytes": "38"}, {"name": "Lua", "bytes": "17200"}, {"name": "Makefile", "bytes": "66684"}, {"name": "PowerShell", "bytes": "100022"}, {"name": "Python", "bytes": "3290080"}, {"name": "Ruby", "bytes": "431"}, {"name": "Shell", "bytes": "1555091"}, {"name": "sed", "bytes": "12331"}]}} +{"text": "require \"stylesheet_flipper/view_helpers\"\n\nmodule StylesheetFlipper\n class Railtie < Rails::Railtie\n initializer \"stylesheet_flipper.view_helpers\" do\n ActionView::Base.send :include, StylesheetFlipper::ViewHelpers\n end\n initializer \"stylesheet_flipper.initialize_rails\", :group => :all do |app|\n app.assets.register_bundle_processor 'text/css', :stylesheet_flipper do |context, data|\n if context.logical_path.include?('-flipped')\n R2.r2 data\n else\n data\n end\n end\n end\n end\nend\n", "meta": {"content_hash": "fbca2a0a4a296f7f53b96f83a65f4ed1", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 93, "avg_line_length": 30.333333333333332, "alnum_prop": 0.6758241758241759, "repo_name": "liisberg-consulting/stylesheet_flipper", "id": "2388bdd300d9edc09a8a25e9eac9d540ec36e802", "size": "546", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/stylesheet_flipper/railtie.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "4137"}]}} +{"text": "require 'test_helper'\n\nclass EncounterImporterTest < Minitest::Test\n \n def setup\n collection_fixtures('providers', '_id')\n end\n\n def test_encounter_importing\n doc = Nokogiri::XML(File.new('test/fixtures/NISTExampleC32.xml'))\n doc.root.add_namespace_definition('cda', 'urn:hl7-org:v3')\n pi = HealthDataStandards::Import::C32::PatientImporter.instance\n patient = pi.parse_c32(doc)\n\n encounter = patient.encounters[0]\n assert encounter.codes['CPT'].include? '99241'\n assert_equal encounter.performer.title, \"Dr.\"\n assert_equal 'Kildare', encounter.performer.family_name\n assert_equal encounter.facility.name, 'Good Health Clinic'\n assert encounter.reason.codes['SNOMED-CT'].include? '308292007'\n assert_equal encounter.admit_type['code'], 'xyzzy'\n assert_equal encounter.admit_type['codeSystem'], 'CPT'\n assert_equal 'HL7 Healthcare Service Location', encounter.facility.code['codeSystem']\n assert_equal Time.gm(2000, 4, 7).to_i, encounter.facility.start_time\n assert_equal '1117-1', encounter.facility.code['code']\n end\nend\n", "meta": {"content_hash": "75bdc619a091d6dbc3a52bc95014f845", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 89, "avg_line_length": 39.81481481481482, "alnum_prop": 0.7227906976744186, "repo_name": "thecristen/health-data-standards", "id": "8d505db12b2f3d9fc20e56c11fc7436c9411d3bc", "size": "1076", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "test/unit/import/c32/encounter_importer_test.rb", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "309320"}, {"name": "KiCad", "bytes": "1227388"}, {"name": "Ruby", "bytes": "745736"}, {"name": "XSLT", "bytes": "364843"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!--NewPage-->\n<HTML>\n<HEAD>\n<!-- Generated by javadoc (build 1.5.0_13) on Sun Jan 24 12:52:49 EST 2010 -->\n<META http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n<TITLE>\nedu.uci.ics.jung.algorithms.matrix Class Hierarchy (jung2 2.0.1 API)\n</TITLE>\n\n\n<LINK REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"../../../../../../stylesheet.css\" TITLE=\"Style\">\n\n<SCRIPT type=\"text/javascript\">\nfunction windowTitle()\n{\n parent.document.title=\"edu.uci.ics.jung.algorithms.matrix Class Hierarchy (jung2 2.0.1 API)\";\n}\n</SCRIPT>\n<NOSCRIPT>\n</NOSCRIPT>\n\n</HEAD>\n\n<BODY BGCOLOR=\"white\" onload=\"windowTitle();\">\n\n\n<!-- ========= START OF TOP NAVBAR ======= -->\n<A NAME=\"navbar_top\"><!-- --></A>\n<A HREF=\"#skip-navbar_top\" title=\"Skip navigation links\"></A>\n<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"1\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR>\n<TD COLSPAN=2 BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\">\n<A NAME=\"navbar_top_firstrow\"><!-- --></A>\n<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\" SUMMARY=\"\">\n <TR ALIGN=\"center\" VALIGN=\"top\">\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../overview-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"package-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Package</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Class</FONT> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Use</FONT> </TD>\n <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Tree</B></FONT> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../deprecated-list.html\"><FONT CLASS=\"NavBarFont1\"><B>Deprecated</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../index-all.html\"><FONT CLASS=\"NavBarFont1\"><B>Index</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../help-doc.html\"><FONT CLASS=\"NavBarFont1\"><B>Help</B></FONT></A> </TD>\n </TR>\n</TABLE>\n</TD>\n<TD ALIGN=\"right\" VALIGN=\"top\" ROWSPAN=3><EM>\n</EM>\n</TD>\n</TR>\n\n<TR>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n <A HREF=\"../../../../../../edu/uci/ics/jung/algorithms/layout/util/package-tree.html\"><B>PREV</B></A> \n <A HREF=\"../../../../../../edu/uci/ics/jung/algorithms/metrics/package-tree.html\"><B>NEXT</B></A></FONT></TD>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n <A HREF=\"../../../../../../index.html?edu/uci/ics/jung/algorithms/matrix/package-tree.html\" target=\"_top\"><B>FRAMES</B></A> \n <A HREF=\"package-tree.html\" target=\"_top\"><B>NO FRAMES</B></A> \n <SCRIPT type=\"text/javascript\">\n <!--\n if(window==top) {\n document.writeln('<A HREF=\"../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>');\n }\n //-->\n</SCRIPT>\n<NOSCRIPT>\n <A HREF=\"../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>\n</NOSCRIPT>\n\n\n</FONT></TD>\n</TR>\n</TABLE>\n<A NAME=\"skip-navbar_top\"></A>\n<!-- ========= END OF TOP NAVBAR ========= -->\n\n<HR>\n<CENTER>\n<H2>\nHierarchy For Package edu.uci.ics.jung.algorithms.matrix\n</H2>\n</CENTER>\n<DL>\n<DT><B>Package Hierarchies:</B><DD><A HREF=\"../../../../../../overview-tree.html\">All Packages</A></DL>\n<HR>\n<H2>\nClass Hierarchy\n</H2>\n<UL>\n<LI TYPE=\"circle\">java.lang.<A HREF=\"http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html\" title=\"class or interface in java.lang\"><B>Object</B></A><UL>\n<LI TYPE=\"circle\">edu.uci.ics.jung.algorithms.matrix.<A HREF=\"../../../../../../edu/uci/ics/jung/algorithms/matrix/GraphMatrixOperations.html\" title=\"class in edu.uci.ics.jung.algorithms.matrix\"><B>GraphMatrixOperations</B></A><LI TYPE=\"circle\">edu.uci.ics.jung.algorithms.matrix.<A HREF=\"../../../../../../edu/uci/ics/jung/algorithms/matrix/RealMatrixElementOperations.html\" title=\"class in edu.uci.ics.jung.algorithms.matrix\"><B>RealMatrixElementOperations</B></A><E> (implements edu.uci.ics.jung.algorithms.matrix.<A HREF=\"../../../../../../edu/uci/ics/jung/algorithms/matrix/MatrixElementOperations.html\" title=\"interface in edu.uci.ics.jung.algorithms.matrix\">MatrixElementOperations</A><E>)\n</UL>\n</UL>\n<H2>\nInterface Hierarchy\n</H2>\n<UL>\n<LI TYPE=\"circle\">edu.uci.ics.jung.algorithms.matrix.<A HREF=\"../../../../../../edu/uci/ics/jung/algorithms/matrix/MatrixElementOperations.html\" title=\"interface in edu.uci.ics.jung.algorithms.matrix\"><B>MatrixElementOperations</B></A><E></UL>\n<HR>\n\n\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<A NAME=\"navbar_bottom\"><!-- --></A>\n<A HREF=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></A>\n<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"1\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR>\n<TD COLSPAN=2 BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\">\n<A NAME=\"navbar_bottom_firstrow\"><!-- --></A>\n<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\" SUMMARY=\"\">\n <TR ALIGN=\"center\" VALIGN=\"top\">\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../overview-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"package-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Package</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Class</FONT> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Use</FONT> </TD>\n <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Tree</B></FONT> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../deprecated-list.html\"><FONT CLASS=\"NavBarFont1\"><B>Deprecated</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../index-all.html\"><FONT CLASS=\"NavBarFont1\"><B>Index</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../help-doc.html\"><FONT CLASS=\"NavBarFont1\"><B>Help</B></FONT></A> </TD>\n </TR>\n</TABLE>\n</TD>\n<TD ALIGN=\"right\" VALIGN=\"top\" ROWSPAN=3><EM>\n</EM>\n</TD>\n</TR>\n\n<TR>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n <A HREF=\"../../../../../../edu/uci/ics/jung/algorithms/layout/util/package-tree.html\"><B>PREV</B></A> \n <A HREF=\"../../../../../../edu/uci/ics/jung/algorithms/metrics/package-tree.html\"><B>NEXT</B></A></FONT></TD>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n <A HREF=\"../../../../../../index.html?edu/uci/ics/jung/algorithms/matrix/package-tree.html\" target=\"_top\"><B>FRAMES</B></A> \n <A HREF=\"package-tree.html\" target=\"_top\"><B>NO FRAMES</B></A> \n <SCRIPT type=\"text/javascript\">\n <!--\n if(window==top) {\n document.writeln('<A HREF=\"../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>');\n }\n //-->\n</SCRIPT>\n<NOSCRIPT>\n <A HREF=\"../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>\n</NOSCRIPT>\n\n\n</FONT></TD>\n</TR>\n</TABLE>\n<A NAME=\"skip-navbar_bottom\"></A>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n\n<HR>\nCopyright © 2010 null. All Rights Reserved.\n</BODY>\n</HTML>\n", "meta": {"content_hash": "901a64bbd88bc154c2d371360a22a933", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 708, "avg_line_length": 46.69871794871795, "alnum_prop": 0.6256691832532602, "repo_name": "tobyclemson/msci-project", "id": "d8ca4877aec259bffc8d00215bf4c921d164fa21", "size": "7285", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/jung-2.0.1/doc/edu/uci/ics/jung/algorithms/matrix/package-tree.html", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "89867"}, {"name": "Ruby", "bytes": "137019"}]}} +{"text": "<!doctype html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <link href=\"https://cdn.bootcss.com/bootstrap/4.1.1/css/bootstrap.min.css\" rel=\"stylesheet\">\n <script>\n window.hdjs = {};\n window.hdjs.base = '/plugin/hdjs';\n window.hdjs.uploader = 'php/uploader.php?';\n window.hdjs.filesLists = 'php/filesLists.php?';\n </script>\n <script src=\"../require.js\"></script>\n <script src=\"../config.js\"></script>\n</head>\n<body style=\"padding: 50px;\">\n<pre><code class=\"language-javascript line-numbers\">\nwindow.hdjs = {};\nwindow.hdjs.base = '../';\nwindow.hdjs.uploader = 'php/uploader.php?';\nwindow.hdjs.filesLists = 'php/filesLists.php?';\n</code></pre>\n<script>\n require(['prism'])\n</script>\n</body>\n</html>", "meta": {"content_hash": "f3b3ed2f92bcc5ecb4865a64d96c0e0e", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 96, "avg_line_length": 28.807692307692307, "alnum_prop": 0.6221628838451269, "repo_name": "houdunwang/hdjs", "id": "cfdc6e5e0088af2d81ddcd5c65222d37009ba17e", "size": "749", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/prismjs.html", "mode": "33188", "license": "mit", "language": [{"name": "ActionScript", "bytes": "145251"}, {"name": "AngelScript", "bytes": "1655"}, {"name": "C", "bytes": "10562"}, {"name": "C++", "bytes": "146348"}, {"name": "CSS", "bytes": "668826"}, {"name": "CoffeeScript", "bytes": "2471"}, {"name": "HTML", "bytes": "244754"}, {"name": "JavaScript", "bytes": "4658455"}, {"name": "Makefile", "bytes": "7045"}, {"name": "Objective-C", "bytes": "2353"}, {"name": "PHP", "bytes": "20344"}, {"name": "Ruby", "bytes": "587"}]}} +{"text": "<p align=\"center\">\n <img src =\"https://github.com/GabrielAlva/SwiftPages/blob/master/Resources/SwiftPages%20Header%20Image.png\"/>\n</p>\n<p align=\"center\">\n <img src =\"https://github.com/GabrielAlva/SwiftPages/blob/master/Resources/SwiftPagesSample.gif\"/>\n</p>\n\n[](http://cocoapods.org/pods/SwiftPages)\n[](http://cocoapods.org/pods/SwiftPages)\n[](http://cocoapods.org/pods/SwiftPages)\n\n<h3 align=\"center\">Features</h3>\n---\n\n- A simple yet beautifully architected solution for management of paged-style view controllers.\n- Dynamic loading of view controllers, allowing handling of high amounts of data without compromising memory.\n- Highly customisable, all items have clean API\u2019s to change them to any appearance or size.\n- Can be sized and positioned anywhere within a view controller.\n- Made for iPhone and iPad.\n- Extensively documented code for quick understanding.\n<br />\n<p align=\"center\">\n <img src =\"https://github.com/GabrielAlva/SwiftPages/blob/master/Resources/Swift%20Pages%20iPhone%20mockups.png\"/>\n</p>\n\n<h3 align=\"center\">Installation</h3>\n---\n\n### CocoaPods\n\nSwiftPages is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"SwiftPages\"\n```\n\n### Manual\n\nJust Include the SwiftPages.swift file found on the demo in your project, and you\u2019re good to go!\n\n<h3 align=\"center\">Usage</h3>\n---\n\nUsing **SwiftPages** in your project is very simple and straightforward. \n\n### Create a SwiftPages Instance\n\nFirst create your SwiftPages instance, there are two ways to do it, as an **IBOoutlet** of a view of type SwiftPages from the storyboard, or programmatically:\n\n**As an IBOoutlet of a view of type SwiftPages from the storyboard**\n<br />\nPlace a UIView in your view controller and assign its constraints, make its class be of type SwiftPages. Then control drag to your view controller as an IBOutlet.\n\t\n**As a fully programmatic SwiftPages view.**\n<br />\nDeclare it in the viewDidLoad function of your view controller and set the desired position and size:\n```swift\nlet swiftPagesView : SwiftPages!\nswiftPagesView = SwiftPages(frame: CGRectMake(0, 0, self.view.frame.width, self.view.frame.height))\n```\nThen, after the initialization (described below), add it as a subview on your view controller:\n```swift\nself.view.addSubview(swiftPagesView)\n```\n\n### Initialization\nSwiftPages can be initialized in one of two ways:\n\n**Initialize with images as buttons on the top bar:**\n<br />\nFirst create an array of strings, the strings will be the Storyboard ID's of the view controllers you would like to include:\n```swift\nvar VCIDs : [String] = [\"FirstVC\", \"SecondVC\", \"ThirdVC\", \"FourthVC\", \"FifthVC\"]\n```\nThen create an array of UIImages which will correlate in order to the VC ID's array created above, it also has to have the same number of items as the aforementioned array:\n```swift\nvar buttonImages : [UIImage] = [UIImage(named:\"HomeIcon.png\")!,\n UIImage(named:\"LocationIcon.png\")!,\n UIImage(named:\"CollectionIcon.png\")!,\n UIImage(named:\"ListIcon.png\")!,\n UIImage(named:\"StarIcon.png\")!]\n```\nFinally, use the `initializeWithVCIDsArrayAndButtonImagesArray` function with the two arrays created:\n```swift\nswiftPagesView.initializeWithVCIDsArrayAndButtonImagesArray(VCIDs, buttonImagesArray: buttonImages)\n```\n\n**Initialize with text on buttons:**\n<br />\nFirst, alike with the image initialization, create an array of strings, the strings will be the Storyboard ID's of the view controllers you would like to include:\n```swift\nvar VCIDs : [String] = [\"FirstVC\", \"SecondVC\", \"ThirdVC\", \"FourthVC\", \"FifthVC\"]\n```\nThen create an array of titles which will correlate in order to the VC ID's array created above, it must have the same number of items as the aforementioned array:\n```swift\nvar buttonTitles : [String] = [\"Home\", \"Places\", \"Photos\", \"List\", \"Tags\"]\n```\nFinally, use the `initializeWithVCIDsArrayAndButtonTitlesArray` function with the two arrays created:\n```swift\nswiftPagesView.initializeWithVCIDsArrayAndButtonTitlesArray(VCIDs, buttonTitlesArray: buttonTitles)\n```\n\n<h3 align=\"center\">Customisation</h3>\n---\n\nOnce you have your `SwiftPages` instance you can customize the appearance of all item's using the class API's, to view the API list look for the `API's` Mark on the SwiftPages class. Below is a brief customization sample:\n```swift\nswiftPagesView.enableAeroEffectInTopBar(true)\nswiftPagesView.setButtonsTextColor(UIColor.whiteColor())\nswiftPagesView.setAnimatedBarColor(UIColor.whiteColor())\n```\n\n<h3 align=\"center\">Example</h3>\n---\n\nYou can find a full example on usage and customization on the Xcode project attached to this repository.\n\n<h3 align=\"center\">License</h3>\n---\n\nThe MIT License (MIT)\n\n**Copyright (c) 2015 Gabriel Alvarado (gabrielle.alva@gmail.com)**\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", "meta": {"content_hash": "3ee0dc6d302cc7ec08b3e62ac1da1c22", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 221, "avg_line_length": 43.45070422535211, "alnum_prop": 0.7482982171799027, "repo_name": "chipivk/SwiftPages", "id": "bd01826b3e1a7bf8608583e08afee87d32eaaf39", "size": "6174", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "README.md", "mode": "33261", "license": "mit", "language": [{"name": "Ruby", "bytes": "777"}, {"name": "Swift", "bytes": "62442"}]}} +{"text": "import unittest\n\nfrom webkitpy.common.system.systemhost_mock import MockSystemHost\n\nfrom webkitpy.layout_tests.port.base import Port\nfrom webkitpy.layout_tests.port.driver import Driver, DriverOutput\nfrom webkitpy.layout_tests.port import browser_test, browser_test_driver\nfrom webkitpy.layout_tests.port.server_process_mock import MockServerProcess\n\nfrom webkitpy.layout_tests.port.port_testcase import TestWebKitPort\n\nfrom webkitpy.tool.mocktool import MockOptions\n\n\nclass BrowserTestDriverTest(unittest.TestCase):\n def test_read_stdin_path(self):\n port = TestWebKitPort()\n driver = browser_test_driver.BrowserTestDriver(port, 0, pixel_tests=True)\n driver._server_process = MockServerProcess(lines=[\n 'StdinPath: /foo/bar', '#EOF'])\n content_block = driver._read_block(0)\n self.assertEqual(content_block.stdin_path, '/foo/bar')\n driver._stdin_directory = None\n", "meta": {"content_hash": "17da925bdfa83456a8f026f406c8d916", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 81, "avg_line_length": 39.91304347826087, "alnum_prop": 0.7559912854030502, "repo_name": "highweb-project/highweb-webcl-html5spec", "id": "576e0b0863783bf19cf80b8d9a25e716d8f37d58", "size": "2445", "binary": false, "copies": "1", "ref": "refs/heads/highweb-20160310", "path": "third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver_unittest.py", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">\n\n\t\t<title>Articulating Design Decisions</title>\n\n\t\t<link rel=\"stylesheet\" href=\"css/reveal.css\">\n\t\t<link rel=\"stylesheet\" href=\"css/theme/gaslight.css\">\n\n\t\t<!-- Theme used for syntax highlighting of code -->\n\t\t<link rel=\"stylesheet\" href=\"lib/css/zenburn.css\">\n\n\t\t<!-- Printing and PDF exports -->\n\t\t<script>\n\t\t\tvar link = document.createElement( 'link' );\n\t\t\tlink.rel = 'stylesheet';\n\t\t\tlink.type = 'text/css';\n\t\t\tlink.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';\n\t\t\tdocument.getElementsByTagName( 'head' )[0].appendChild( link );\n\t\t</script>\n\t</head>\n\t<body>\n\t\t<div class=\"reveal\">\n\t\t\t<div class=\"slides\">\n\t\t\t\t<section>\n\t\t\t\t\t<section data-background=\"dark\">\n\t\t\t\t\t\t<h1 class=\"white center\">Articulating Design Decisions</h1>\n\t\t\t\t\t\t<p class=\"speaker-block center\">\n\t\t\t\t\t\t\t<small><em>Brought to you by the good designers of Gaslight.</em></small>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div class=\"logo-block\"></div>\n\t\t\t\t\t\t<p class=\"center\">\n\t\t\t\t\t\t\t<small><a href=\"https://teamgaslight.com\">teamgaslight.com</a></small>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</section>\n\t\t\t\t\t<section data-background=\"dark\">\n\t\t\t\t\t\t<h2 class=\"white center\">Table of Contents</h2>\n\t\t\t\t\t\t<small>\n\t\t\t\t\t\t\t<ol class=\"white\">\n\t\t\t\t\t\t\t\t<li><a href=\"#ch1\"> A Maturing Industry </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch2\"> Great Designers are Great Communicators </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch3\"> Understanding Relationships </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch4\"> Reducing Cognitive Load </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch5\"> Listening Is Understanding </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch6\"> The Right Frame of Mind </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch7\"> The Response: Strategy and Tactics </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch8\"> The Response: Common Messages </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch9\"> The Ideal Response: Getting Agreement </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch10\"> Meeting Adjourned: The After-Party </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch11\"> Recovering from Disaster </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch12\"> For Nondesigners </a></li>\n\t\t\t\t\t\t\t\t<li><a href=\"#ch13\"> Designing for Vision </a></li>\n\t\t\t\t\t\t\t</ol>\n\t\t\t\t\t\t</small>\n\t\t\t\t\t</section>\n\t\t\t\t</section>\n\t\t\t\t<section><!-- OBJECTIVE -->\n\t\t\t\t<h2>Our Goal</h2>\n\t\t\t\t<p>Information is freer than ever \u2014 but that means that there's more to dig through to find gems</p>\n\t\t\t\t<p class=\"fragment\">The Design Squad\u2122, in the interest of ongoing education, took on the task of reading and synthesizing content and then bringing it together.</p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://media.giphy.com/media/mhTfuaWwrYGxa/giphy.gif\"></section> <!-- GIF BREAK: VOLTRON -->\n\t\t\t\t<section><!-- OBJECTIVE, PT. 2-->\n\t\t\t\t<h2>Our Goal</h2>\n\t\t\t\t<p>Then obviously we needed to share it with everyone else too.</p>\n\t\t\t\t</section>\n\t\t\t\t<section><!-- THE BOOK-->\n\t\t\t\t\t<h2>The Book Selection</h2>\n\t\t\t\t\t<p>Since it's been on the docket for a while and everyone could benefit from amping up their consulting skills, we chose to read <em>Articulating Design Decisions</em> by Tom Greever</p>\n\t\t\t\t</section>\n<!-- /////////////// -->\n<!-- THE LAUREN ZONE -->\n<!-- /////////////// -->\n\t\t\t\t<section id=\"ch1\"><!-- OPENING: CHAPTER 1 -->\n\t\t\t\t<h2><small>Chapter 1</small></h2>\n\t\t\t\t<h2>A Maturing Industry</h2>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Design: The New Hotness</h2>\n\t\t\t\t\t<p>Design, once seen as niche and auxiliary, has come front-and-center in a world where people use more and more software products and come to expect them to look and work well.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Design: The New Hotness</h2>\n\t\t\t\t\t<p>Good design is very clearly tied to product success.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Design: The New Hotness</h2>\n\t\t\t\t\t<p>It would then follow that designers, those agents of design, would also be the new hotness, right?</p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://68.media.tumblr.com/6dbe572a2e4485309fc4e1b06c39c759/tumblr_n24tpcrmeC1s2ypwgo1_500.gif\">\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Design[ers]: The Reality</h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">UX is a young discipline that's still being figured out.</li>\n\t\t\t\t\t\t<li class=\"fragment\">Designers are practiced in justifying design to designers, less so with those outside the discipline.</li>\n\t\t\t\t\t\t<li class=\"fragment\">Design is as much about subjective personal preferences as it is about logically-made, research-backed decisions.</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section id=\"ch2\"><!-- OPENING: CHAPTER 2 -->\n\t\t\t\t<h2><small>Chapter 2</small></h2>\n\t\t\t\t<h2>Great Designers Are Great Communicators</h2>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Everyone's a Critic</h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">Non-Designers are immersed in designed experiences and can tell what looks good, but can't express why.</li>\n\t\t\t\t\t\t<li class=\"fragment\">Design is \"special\" in that people uninvolved can have an opinion on the \"how\" of the work, not just the \"what\".</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Design House of Horrors</h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">The CEO Button</li>\n\t\t\t\t\t\t<li class=\"fragment\">Home Page Syndrome</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"http://gifrific.com/wp-content/uploads/2013/04/Tobias-Funke-Crying-in-Shower-Arrested-Development.gif\"></section>\n\t\t\t\t<section data-background=\"http://imoviequotes.com/wp-content/uploads/2014/11/1-Cool-Hand-Luke-quotes.gif\">\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Using Your Words</h2>\n\t\t\t\t\t<p>Most issues are grounded in miscommunication or misunderstandings.</p>\n\t\t\t\t\t<p class=\"fragment\">\"Most issues\" being 99.9% of the problems.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Using Your Words</h2>\n\t\t\t\t\t<p>Words are powerful! They are the tools you use to steer people in the right direction!</p>\n\t\t\t\t\t<p class=\"fragment\">The key is to understand what message you want to communicate and the response you want.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Using Your Words</h2>\n\t\t\t\t\t<p>Being able to articulate your design choices gains the trust of your clients and keeps you from getting steamrolled by...</p>\n\t\t\t\t\t<ul class=\"fragment\">\n\t\t\t\t\t\t<li>Imparting intelligence.</li>\n\t\t\t\t\t\t<li class=\"fragment\">Demonstrating intentionality.</li>\n\t\t\t\t\t\t<li class=\"fragment\">Showing respect.</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://68.media.tumblr.com/tumblr_ln6cohJhnv1qgogx2o1_500.gif\"></section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making a Successful Design</h2>\n\t\t\t\t\t<p>A successful design will...</p>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li>Solve a problem.</li>\n\t\t\t\t\t\t<li>Be easy for users.</li>\n\t\t\t\t\t\t<li>Be supported by everyone.</li>\n\t\t\t\t\t</ol>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Makings of a Successful Design</h2>\n\t\t\t\t\t<p>To find the right solution, you need a clearly defined problem.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Makings of a Successful Design</h2>\n\t\t\t\t\t<p>Set goals and key progress indicators to establish what success looks like. These can be drawn from what's important to your stakeholders.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Makings of a Successful Design</h2>\n\t\t\t\t\t<p>You must be consciously aware of each decision made and why.</p>\n\t\t\t\t\t<p class=\"fragment\">Ask \"what problem am I trying to solve with this?\" and then answer it. Write it down to get in the habit!</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Makings of a Successful Design</h2>\n\t\t\t\t\t<p>Practice describing your designs without visual aides to become more precise in how you clarify your designs and thinking.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Makings of a Successful Design</h2>\n\t\t\t\t\t<p>Making sure a design actually resonates with users is grounded in intentionality. \"How does this affect the user?\"</p>\n\t\t\t\t\t<p class=\"fragment\">It's entirely legitimate to make your best guesses and then try them out.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Makings of a Successful Design</h2>\n\t\t\t\t\t<p>Practice writing stories about these design changes within the context of how they affect the user.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Makings of a Successful Design</h2>\n\t\t\t\t\t<p>The most sicknasty design doesn't get you anywhere if you can't sell people on it.</p>\n\t\t\t\t\t<p class=\"fragment\">Even worse, people will continue to suggest other alternatives if they're not convinced that you're right.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Makings of a Successful Design</h2>\n\t\t\t\t\t<p>You need to get clients and other team members on your level!</p>\n\t\t\t\t\t<p>Shared understanding of what you're trying to achieve and where you're headed helps achieve this.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Makings of a Successful Design</h2>\n\t\t\t\t\t<p>To properly share your design savvy with others on your team takes a little additional legwork.</p>\n\t\t\t\t\t<p>It's easy to land on what looks like the right decision, but leave no stone unturned — finding these other solutions and knowing why they don't work allows you to summon this information later if they're pitched as alternatives.</p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"http://i.imgur.com/pgF1ULY.gif\">\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Makings of a Successful Design</h2>\n\t\t\t\t\t<p>Being right is satisfying, but knowing why and being thoughtful are more important than being able to design the perfect solution every time.</p>\n\t\t\t\t</section>\n<!-- /////////////// -->\n<!-- END LAUREN ZONE -->\n<!-- /////////////// -->\n\n<!-- /////////////// -->\n<!-- THE KATI ZONE -->\n<!-- /////////////// -->\n\t\t\t\t<section id=\"ch3\"><!-- OPENING: CHAPTER 3 -->\n\t\t\t\t<h2><small>Chapter 3</small></h2>\n\t\t\t\t<h2>Understanding Relationships</h2>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>First, Improving Communication</h2>\n\t\t\t\t\t<p>The single most important thing you can do to improve communication is to improve relationships.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Relationships & Stakeholder</h2>\n\t\t\t\t\t<p>Uxers are so good at putting the user first but often fail to do the same for the stakeholders, the people who have influence over the project.</p>\n\t\t\t\t\t<p class=\"fragment\">Applying the same principles we use to put the users first should be applied to the people we work with, that way we can create a better product together </p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://media.giphy.com/media/10LKovKon8DENq/giphy.gif\">\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Relationships & Stakeholder</h2>\n\t\t\t\t\t<p>In order to approach them the right way we need to: </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">See them as human</li>\n\t\t\t\t\t\t<li class=\"fragment\">Create shared experiences</li>\n\t\t\t\t\t\t<li class=\"fragment\">Develop empathy</li>\n\t\t\t\t\t\t<li class=\"fragment\">Ask good questions</li>\n\t\t\t\t\t\t<li class=\"fragment\">Identifying influencers</li>\n\t\t\t\t\t\t<li class=\"fragment\">Building good relationships</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>See them as human</h2>\n\t\t\t\t\t<p>There are always things that are influencing people\u2019s behaviors that we don\u2019t know about and there will always be things that we simply can\u2019t predict.</p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://az616578.vo.msecnd.net/files/2015/11/12/635829492208789717-2055683014_derek.gif\">\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>See them as human</h2>\n\t\t\t\t\t<p> A person\u2019s attitudes and responses to your work might have more to do with the things outside of what you\u2019re showing them. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Create shared experiences</h2>\n\t\t\t\t\t<p>When we don\u2019t have anything in common with another person, it\u2019s nearly impossible to talk to them.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Create shared experiences</h2>\n\t\t\t\t\t<p>Finding ways to create connections with other people is an important step toward understanding them.</p>\n\t\t\t\t\t<p class=\"fragment\">Connections can be made easily through simple questions (non work questions!). </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Develop empathy</h2>\n\t\t\t\t\t<p>Having empathy for stakeholders allows you to understand from their perspective.</p>\n\t\t\t\t\t<p></p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://media.giphy.com/media/Hys63WZ4UHlAc/giphy.gif\">\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Develop empathy</h2>\n\t\t\t\t\t<p>It simply means that your priority for communicating with them has shifted from a position of defense to one of solidarity.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Ask good questions</h2>\n\t\t\t\t\t<p>You should learn to view things from the perspective of your stakeholders in the same way that you would with users of your application</p>\n\t\t\t\t\t<p class=\"fragment\">By asking questions. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Identifying Influencers</h2>\n\t\t\t\t\t<p>Every project has a variety of people who influence its outcome, the three main types you need to understand are: </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">Team Influencers</li>\n\t\t\t\t\t\t<li class=\"fragment\">Executive Influencers</li>\n\t\t\t\t\t\t<li class=\"fragment\">External Influencers\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Build Good Relationships</h2>\n\t\t\t\t\t<p>Communication is much easier in good relationships.</p>\n\t\t\t\t\t<p class=\"fragment\">Good relationships take work.</p>\n\t\t\t\t\t<p class=\"fragment\">Take the time to do the simple things that will help you to improve your relationships and, as a byproduct, your communication with each other</p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://media.giphy.com/media/MiapFHASKG1Us/giphy.gif\">\n\t\t\t\t</section>\n\n\t\t\t\t<section id=\"ch4\"><!-- OPENING: CHAPTER 4 -->\n\t\t\t\t<h2><small>Chapter 4</small></h2>\n\t\t\t\t<h2>Reducing Cognitive Load</h2>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Reducing Cognitive Load</h2>\n\t\t\t\t\t<p>Reducing the cognitive load not only for the stakeholders but our team and for ourselves so we can have a</p>\n\t\t\t\t\t<p class=\"fragment\">Succesful</p>\n\t\t\t\t\t<p class=\"fragment\">Productive</p>\n\t\t\t\t\t<p class=\"fragment\">Valuable <strong> Meeting </strong></p>\n\t\t\t\t\t<h2 class=\"fragment\">But how??</h2>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Remove Distractions!</h2>\n\t\t\t\t\t<p>A lot of people are easily distracted by things that simply do not matter to the goal of the meeting.</p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://i2.wp.com/www.thedebutanteball.com/wp-content/uploads/2014/10/squirrel.gif\">\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Remove Distractions!</h2>\n\t\t\t\t\t<p>Getting to know people can help identify what is distracting to them, so you can remove those things from the conversation. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Anticipate Reactions</h2>\n\t\t\t\t\t<p>When we combine what we know about the infleuncers of the project with the values they carry in their role, we can make some pretty good guesses about how they\u2019ll respond to our designs </p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://media.giphy.com/media/76dXlFZZEqNH2/giphy.gif\">\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Anticipate Reactions</h2>\n\t\t\t\t\t<p>So! Using this information we should curate the flow of our design discussion.</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Create a Support Network</h2>\n\t\t\t\t\t<p>Getting other people to support your decisions is about showing that you\u2019re not alone in your ideas.</p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://sixcolors.com/images/content/2016/bb8-thumbsup.gif\">\n\t\t\t\t</section>\n\t\t\t\t<!-- <section>\n\t\t\t\t\t<h2>Create a Support Network</h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">The Ringer: Backup support when/if we don't remember everything that needs to be said in a meeting. </li>\n\t\t\t\t\t\t<li class=\"fragment\">Identifying People: Beforehand figure out who's on board with your design. This can easiliest be found from your own team. </li>\n\t\t\t\t\t\t<li class=\"fragment\">People Get it: Find the people who will by your side to accomplish your vision. It's not just one person's idea but an idea that support by others.</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section> -->\n\t\t\t\t<section>\n\t\t\t\t\t<p>& Finally</p>\n\t\t\t\t\t<h2>The Dress Rehearsal</h2>\n\t\t\t\t\t<p>Now that you understand your stakeholders, have removed the distractions, anticipated their reactions, and gathered a group of people to back you up, it\u2019s time to:</p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">Make a List</li>\n\t\t\t\t\t\t<li class=\"fragment\">Practice Out loud</li>\n\t\t\t\t\t\t<li class=\"fragment\">Prep Everyone</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Now, Let's Have</h2>\n\t\t\t\t\t<h2>A Succesful Meeting</h2>\n\t\t\t\t\t<p>Reducing Cognitive Load for us and our Stakeholders allows everyone to focus on the decisions at hand creating more productive conversations.</p>\n\t\t\t\t\t<p class=\"fragment\"><strong>Productivity Rules!!</strong></p>\n\t\t\t\t</section>\n\t\t\t\t<section data-background=\"https://admin.mashable.com/wp-content/uploads/2013/07/The-Office.gif\">\n\t\t\t\t</section>\n<!-- /////////////// -->\n<!-- END KATI ZONE -->\n<!-- /////////////// -->\n\n<!-- ////////////////////// -->\n<!-- THE RYAN ZONE CH.5-6 -->\n<!-- ////////////////////// -->\n\t\t\t\t<section id=\"ch5\"><!-- OPENING: CHAPTER 5 -->\n\t\t\t\t\t<h2><small> Chapter 5 </small></h2>\n\t\t\t\t\t<h2> Listening is Understanding </h2>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> No man ever listened himself out of a job. </p>\n\t\t\t\t\t\t<p> ―Calvin Coolidge</p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Implicit Activities </h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<strong> Be empathetic.</strong> Hear what your stakeholders are saying and try to understand the meaning of what's being said from their perspective.\n\t\t\t\t\t</p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\"> Let them talk </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Hear what isn't being said </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Uncover the real problem </li>\n\t\t\t\t\t\t<li class=\"fragment\"> The art of the pause </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Let them Talk </h2>\n\t\t\t\t\t<p> Give your stakeholders the space they need to fully describe their ideas. </p>\n\t\t\t\t\t<p class=\"fragment\"> Three main benfits: </p>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li class=\"fragment\"> They will make themselves more clear </li>\n\t\t\t\t\t\t<li class=\"fragment\"> It gives them confidence that they were understood </li>\n\t\t\t\t\t\t<li class=\"fragment\"> It demonstrates that you value what they're saying </li>\n\t\t\t\t\t</ol>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Trust is Everything </h2>\n\t\t\t\t\t<p> Showing that you can let someone express their ideas freely will help to build trust. </p>\n\t\t\t\t\t<p class=\"fragment\"> They will be more likely to agree with you if you can relate to what they've said. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Hear What isn't Being Said</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tThere is <strong>subtext</strong> to every bit of feedback. The better we can decode these messages, the better we can correct our course of action.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Uncover the Real Problem </h2>\n\t\t\t\t\t<p> People naturally jump to solutions. It's our job to identify the problems behind those solutions. </p>\n\t\t\t\t\t<p class=\"fragment\"> Ask the <strong>5 Whys</strong></p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> The Art of the Pause </h2>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> The right word may be effective, but no word was ever as effective as a rightly timed pause. </p>\n\t\t\t\t\t\t<p> ―Mark Twain </p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> The Three Purposes of the Pause </h2>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li class=\"fragment\"> Give them a chance to expand on, or correct, what they've just said. </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Let their statements sink in. Take a few seconds to check yourself and form an appropiate response. </li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tNonverbally communicate that what was just said is worth taking the time to seriously consider and ponder over for a moment.\n\t\t\t\t\t\t\t<p class=\"fragment\"> Be aware of your <strong>body language</strong>. </p>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ol>\n\t\t\t\t</section>\n\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Explicit Activities </h2>\n\t\t\t\t\t<p> Verbally demonstrate that you're listening and outwardly show that you're engaged in the conversation </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\"> Take notes </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Ask questions </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Repeat or rephrase what's being said </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Write Everything Down </h2>\n\t\t\t\t\t<p> You're not going to remember everything that your stakeolders say or suggest—you're just not.</p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\"> Notes prevent you from having the same conversation again—create a paper trail. </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Notes free you to focus on being articulate. </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Notes build trust with your stakeholders. </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Notes keep the meeting on track. </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Taking Better Notes </h2>\n\t\t\t\t\t<p> Your notes should be: </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\"> <strong>Accessible</strong> - even during the meeting </li>\n\t\t\t\t\t\t<li class=\"fragment\"> <strong>Organized</strong> - related to UI elements or agenda items </li>\n\t\t\t\t\t\t<li class=\"fragment\"> <strong>Specific</strong> - who suggested what? </li>\n\t\t\t\t\t\t<li class=\"fragment\"> <strong>Definitive</strong> - have you reached a decison or is there follow-up work that needs to be done? </li>\n\t\t\t\t\t\t<li class=\"fragment\"> <strong>Actionable</strong> - if there's no action, it's not useful </li>\n\t\t\t\t\t\t<li class=\"fragment\"> <strong>Referenced</strong> - add links, URLs, screenshots, ect. </li>\n\t\t\t\t\t\t<li class=\"fragment\"> <strong>Forward-looking</strong> - make room for follow-up discussions for the next meeting. </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Ask Questions </h2>\n\t\t\t\t\t<p> So much of listening is just getting the other person to talk. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Helpful Questions </h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li> What problem are you trying to solve? </li>\n\t\t\t\t\t\t<li> What are the advantages of doing it this way? </li>\n\t\t\t\t\t\t<li> What do you suggest? </li>\n\t\t\t\t\t\t<li> How will this affect our goals? </li>\n\t\t\t\t\t\t<li> Where have you seen this before? </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Repeat or Rephrase </h2>\n\t\t\t\t\t<p> Without a shared vocabulary, there will inevitably be misunderstanding. </p>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> The begining of wisdom is the definition of terms. </p>\n\t\t\t\t\t\t<p> ―Socrates </p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Rephrase: <h2>\n\t\t\t\t\t<h2><small> Convert \"Likes\" to \"Works\" </small></h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\"> Focus on effectiveness </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Ask clarifying questions \u2013 \"Why don't you think this <strong>works</strong>?\" </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Move from discussing preferences to describing functionality </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Repeat: <h2>\n\t\t\t\t\t<h2><small> \"What I Hear You Saying...\" </small></h2>\n\t\t\t\t\t<p> Translate what's being said into what will become our common ground. </p>\n\t\t\t\t\t<p class=\"fragment\"> Bridge the language gap by showing: </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\"> You're listening to them </li>\n\t\t\t\t\t\t<li class=\"fragment\"> You understand what they said </li>\n\t\t\t\t\t\t<li class=\"fragment\"> You can express their ideas in our own words that are more helpful in the design decision-making process </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\n\t\t\t\t<section id=\"ch6\"><!-- OPENING: CHAPTER 6 -->\n\t\t\t\t\t<h2><small> Chapter 6 </small> </h2>\n\t\t\t\t\t<h2> The Right Frame of Mind </h2>\n\t\t\t\t\t<p>Thank. Repeat. Prepare.</p>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> First learn the meaning of what you say, and then speak. </p>\n\t\t\t\t\t\t<p> ―Epictetus</p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Give Up Control </h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\"> You're going to need approval from others. </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Don't take feedback personally. </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Your work is not your own—you need help from others. </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Check Your Ego at the Door </h2>\n\t\t\t\t\t<p> See the value in what the other person is saying. </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\"> You're <strong><em>not</em></strong> the only one with good ideas </li>\n\t\t\t\t\t\t<li class=\"fragment\"> You <strong><em>don't</em></strong> have all the best solutions </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Your way <strong><em>isn't</em></strong> the only way to accomplish the goals </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Check Your Ego at the Door </h2>\n\t\t\t\t\t<p> Removing your ego makes you less defensive and therefore better prepared to respond appropriately. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Lead with a YES </h2>\n\t\t\t\t\t<p> We're all in this <strong>together</strong>. We're headed towards the same goals and with the same level of passion for the product. </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\"> Be collaborative </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Give ideas permission to succeed, even if they might seem impossible </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Keep the conversation open-ended </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Empower people to share their thoughts, ideas and be part of the solution </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Build trust and confidence with your stakeholders </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Be Charming </h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\"> Have confidence </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Just be yourself </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Don't take yourself so seriously </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Orient yourself towards others </li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Change Your Vocabulary </h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\t<strong><del> \"You're wrong\" </del></strong>\n\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li class=\"fragment\">Stay positive and always lead with a \"yes\"</li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\t<strong><del> \"From a design perspective...\" </del></strong>\n\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li class=\"fragment\"> \"The reason we did it this way...\" </li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\t<strong><del>\"Like\"</del> and <del>\"Don't like\"</del></strong>\n\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li class=\"fragment\"> Focus on what works and doesn't work </li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\t<strong><del> Too much jargon </del></strong>\n\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li class=\"fragment\"> Stay within the vernacular </li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Make a Transition </h2>\n\t\t\t\t\t<p> The response <strong><em>before</em></strong> the response. </p>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li class=\"fragment\"> Thank </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Repeat </li>\n\t\t\t\t\t\t<li class=\"fragment\"> Prepare </li>\n\t\t\t\t\t</ol>\n\t\t\t\t</section>\n<!-- /////////////// -->\n<!-- END RYAN ZONE -->\n<!-- /////////////// -->\n\n<!-- ////////////////////////// -->\n<!-- THE BAILEY ZONE CH.10-11 -->\n<!-- ////////////////////////// -->\n\n\t\t\t\t<section id=\"ch10\"> <!-- OPENING: CHAPTER 10 -->\n\t\t\t\t\t<h2><small> Chapter 10 </small></h2>\n\t\t\t\t\t<h2> Meeting Adjourned: The After-Party </h2>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> The single biggest problem in communication is the illusion that it has taken place. </p>\n\t\t\t\t\t\t<p> ―George Bernard Shaw</p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<p> The time after the meeting is crucial. It's prime time to make sure no disasterous design decisions are made. Some things you'll need to do: </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tStick around and chat with people\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tFollow up quickly with your notes\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tApply filters and remove the fluff\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tSeek out individuals who can help you\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tMake decisions when there is ambiguity\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> The Meeting After the Meeting </h2>\n\t\t\t\t\t<p> The hallway after a meeting is where the real feelings come out. </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> The Meeting After the Meeting </h2>\n\t\t\t\t\t<p> This is the time where decisions can be solidified and people can share their thoughts more openly. Often participants can feel too timid to bring something up in a meeting because they may feel like their opinion isn't as influential or as solid as someone else's. However, they may feel more comfortable opening up after the meeting. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Follow up Fast </h2>\n\t\t\t\t\t<p> Recorded follow ups show that you value the people involved, their time, and their ideas. </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Follow up Fast </h2>\n\t\t\t\t\t<p> The follow up should be written preferably within an hour of the meeting, or at least within a day. It should include: </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tA word of thanks to the participants\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tA list of what was discussed\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tAction items and next steps\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Follow up Fast </h2>\n\t\t\t\t\t<p> Don't be afraid to delegate what people are doing what tasks. Be specific. Ask direct questions. Keep it brief. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Apply Filters </h2>\n\t\t\t\t\t<p> Cut out unnecessary information so the team can stay focused. </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Apply Filters </h2>\n\t\t\t\t\t<p> Sometimes people bring up ideas just for the sake of innovation instead of concentrating on objectives. Here's how to assess a person with wild ideas: </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tWhat are the person's intentions?\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tWhat is everyone's opinions of the person?\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tDo other people agree or disagree?\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tIs this person influential enough to matter?\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tIs this person likely to bring it up again?\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Apply Filters </h2>\n\t\t\t\t\t<p> It's not about ignoring people, but learning to discern whether comments do or don't align with the project's objectives. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Apply Filters </h2>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> \"If they aren't influential, no one agrees with them, and they aren't likely to bring it up again, it's a safe bet you can just move on and never mention it again.\" </p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<img src=\"https://i.ytimg.com/vi/XfLmTN3scV4/hqdefault.jpg\" width=\"75%\"/>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Apply Filters </h2>\n\t\t\t\t\t<p> Incorporating everyone's opinions is a dangerous path. Fine tune your judgement to leave out what clouds the objectives. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Seek Out Individuals </h2>\n\t\t\t\t\t<p> Be open to communication after the meeting. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Seek Out Individuals </h2>\n\t\t\t\t\t<p> If there's someone you might benefit from talking to, find them immediately after the meeting. The purpose of these conversations is to give people the space to share their unfiltered thoughts outside the pressure of an organized setting. </p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Do Something, Even if it's Wrong </h2>\n\t\t\t\t\t<p> Since many meetings end with ambiguity, it's better to do something rather than nothing. </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Do Something, Even if it's Wrong </h2>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> \"It's better to do something (even if it's wrong) and give your team the opportunity to speak out for or against your choice rather than deal with stale decisions and a stagnant design process. Sometimes, you just need to decide and tell everyone else what you're going to do and get them to speak up.\" </p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2> Do Something, Even if it's Wrong </h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tTake the lead and make some kind of rough draft in order to combat decision paralysis. It'll at least get people's attention.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<p> Remember these things when the meeting is over: </p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tThe time after the meeting is when you can hear people's unfiltered thoughts\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tFollow up quickly in order to communicate urgency, value, and decisiveness\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tFilter out unnecessary points from your notes that don't need follow up\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tBe open to communicating after the meeting\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tThe only way to move forward in times of ambiguity is to make some kind of decision, even if it's wrong\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\n\t\t\t\t<section id=\"ch11\"> <!-- OPENING: CHAPTER 11 -->\n\t\t\t\t\t<h2><small> Chapter 11 </small></h2>\n\t\t\t\t\t<h2> Recovering from Disaster </h2>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> In every difficult situation is potential value. Believe this; then begin looking for it. </p>\n\t\t\t\t\t\t<p> ―Norman Vincent Peale</p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tSometimes, no matter how hard we try, have to roll with design decisions we disagree with.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>How is This Possible?</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tThe first step in addressing disaster is to understand why it happened and how it could have been avoided. A few causes for disaster:\n\t\t\t\t\t</p>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tThey have a specific need that isn't being met\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tThey want to know they're being heard\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tThere is a misunderstanding\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tYour designs are not the best solution\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tThey are completely unreasonable\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ol>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>How is This Possible?</h2>\n\t\t\t\t\t<p><b>They have a specific need that isn't being met</b></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tSometimes one need is there because the stakeholder has another underlying need that isn't being addressed.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>How is This Possible?</h2>\n\t\t\t\t\t<p><b>They want to know they're being heard</b></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tSometimes clients insist on a change because they don't think they're being heard or valued.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>How is This Possible?</h2>\n\t\t\t\t\t<p><b>There is a misunderstanding</b></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tMiscommunications come often and are a sure-fire way to disaster.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>How is This Possible?</h2>\n\t\t\t\t\t<p><b>Your designs are not the best solution</b></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tStakeholders are leaders for a reason and know the domain best, so they may be right.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<img src=\"https://media.giphy.com/media/l4FGkUNYQtWC4fDGM/giphy.gif\" width=\"100%\"/>\n\t\t\t\t\t<p style=\"text-align: center;\">\n\t\t\t\t\t\tSIT DOWN, BE HUMBLE\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>How is This Possible?</h2>\n\t\t\t\t\t<p><b>They are completely unreasonable</b></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tUsually when we think someone's unreasonable, we just fail to see things from their perspective. However, inherently unreasonable people do exist.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making Changes You Disagree With</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tSome tactics for addressing decisions that you feel might hinder the user experience:\n\t\t\t\t\t</p>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tMake it subtle\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tMake it an option\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tCarefully consider placement\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tThe hidden menu\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tPlan a space\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ol>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making Changes You Disagree With</h2>\n\t\t\t\t\t<p><b>Make it subtle</b></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tFind a middle ground between what a stakeholder wants and what's cohesive for the UX.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making Changes You Disagree With</h2>\n\t\t\t\t\t<p><b>Make it an option</b></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tIf it's viable for your product, you could limit it's audience.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making Changes You Disagree With</h2>\n\t\t\t\t\t<p><b>Carefully consider placement</b></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tIf it's viable for your product, you could limit the amount of views it exists in.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making Changes You Disagree With</h2>\n\t\t\t\t\t<p><b>The hidden menu</b></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tSometimes elements could be carefully tucked away in a less accessible location.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making Changes You Disagree With</h2>\n\t\t\t\t\t<p><b>Plan a space</b></p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tPlan an area in the layout that could easily accommodate temporary changes.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making Lemonade</h2>\n\t\t\t\t\t<img src=\"https://media.giphy.com/media/28uzSCkeNeyiY/giphy.gif\" width=\"100%\" />\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making Lemonade</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tUsually it's not one person's bad idea that will ruin a design. It's often poor execution of that possible bad idea that has the power to actually do damage.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making Lemonade</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tThink of decisions that you disagree with as constraints. Use those constraints to actually improve the product instead of plopping them there exactly as suggested.\n\t\t\t\t\t</p>\n\t\t\t\t\t<blockquote class=\"fragment\">\n\t\t\t\t\t\t<p> \"One person's suggestions is a gold mine of other ideas waiting to be excavated.\" </p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Making Lemonade</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tTake a seemingly unfortunate decision and dig deeper. Being open to one change may reveal something else.\n\t\t\t\t\t</p>\n\t\t\t\t\t<blockquote class=\"fragment\">\n\t\t\t\t\t\t<p> \"Occasionally, having a stakeholder insist on a change can lead you down a path to improving the app in a way that you never expected, solving problems you might not have uncovered otherwise.\" </p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>The Bank Account of Trust</h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<b>Deposits:</b> When your design is praised\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<b>Withdrawls:</b> When a client disagrees with your design\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<p class=\"fragment\">\n\t\t\t\t\t\tStakeholder relationships depend on this bank account of trust. Learn which battles are worth fighting. You have to constantly balance the needs of users and the requirements of stakeholders.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>When You're Wrong</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tWhen you're wrong you can either:\n\t\t\t\t\t</p>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tOwn up to your decisions\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tDeny the criticism\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tAbsolve yourself of any involvement\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ol>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>When You're Wrong</h2>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tBeing wrong can feel like a let down of trust, but it's actually an opportunity to build trust.\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tOwn up to your mistakes always. Say \"I was wrong\" and then go fix the problem.\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tCommunicate a sense of urgency and willingness to go above and beyond when fixing the issue.\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tDon't obsess over why it happened. It's not nearly as important as fixing the problem.\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>When You're Wrong</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tHow to know when you're wrong:\n\t\t\t\t\t</p>\n\t\t\t\t\t<ol>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tThe problem still exists\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tUsers don't get it\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li class=\"fragment\">\n\t\t\t\t\t\t\tEveryone is against you\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ol>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Painting a Duck</h2>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> Half of the world is composed of people who have something to say and can't, and the other half who have nothing to say and keep on saying it. </p>\n\t\t\t\t\t\t<p> ―Robert Frost</p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Painting a Duck</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tPeople have the tendency to spend a disproportionate amount of time \"bike-shedding,\" which is the act of wasting time on trivial details instead of more pressing but harder to grasp issues.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Painting a Duck</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tSometimes the solution for a stubborn and unreasonable stakeholder is to \"paint a duck,\" or offer some carefully curated alternatives that you know they won't pick, just to point them in the right direction and focus them on the objectives of the project.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Managing Expectations</h2>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> \"Your ability to properly set, adjust, and communicate expectations is more important than your ability to crank out killer designs on a daily basis.\" </p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Managing Expectations</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tOften projects fail because expectations weren't clearly communicated, not because of a lack of quality of work.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Managing Expectations</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tWithout the support of your team, you won't succeed.\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t\t<section>\n\t\t\t\t\t<h2>Managing Expectations</h2>\n\t\t\t\t\t<blockquote>\n\t\t\t\t\t\t<p> \"The way you communicate with and manage relationships with stakeholders is critical to your success as a designer.\" </p>\n\t\t\t\t\t</blockquote>\n\t\t\t\t</section>\n\n\n<!-- ///////////////// -->\n<!-- END BAILEY ZONE -->\n<!-- ///////////////// -->\n\n\n<!-- ////////////////////////// -->\n<!-- THE KATIE ZONE CH.12-13 -->\n<!-- ////////////////////////// -->\n\n<section id=\"ch12\"> <!-- OPENING: CHAPTER 12 -->\n\t<h2><small> Chapter 12 </small></h2>\n\t<h2> For the Non-Designers </h2>\n\t<blockquote>\n\t\t<p> What we do see depends mainly on what we look for ... In the same field the farmer will notice the crop, the geologists the fossils, botanists the flowers, artists the colouring, sportsmen the cover for the game. Though we may all look at the same things, it does not all follow that we should see them. </p>\n\t\t<p> ―Sir John Lubbock</p>\n\t</blockquote>\n</section>\n\n<section>\n\t<p> There are non-designers who are interested in learning to talk about design. They value good working relationships and realize that clear communication is key, because miscommunication can lead to </p>\n\t<ul>\n\t\t<li class=\"fragment\">\n\t\t\tmissed expectations, which lead to\n\t\t</li>\n\t\t<li class=\"fragment\">\n\t\t\tdisappointment and distrust.\n\t\t</li>\n\t</ul>\n</section>\n\n<section>\n\t<img src=\"https://media.giphy.com/media/njAjh98E1PUha/giphy.gif\" width=\"100%\" />\n</section>\n\n<section>\n\t<h2> Ten Tips for Working with Designers </h2>\n\t<ol>\n\t\t<li> Focus on what works </li>\n\t\t<li> Don't provide solutions </li>\n\t\t<li> Ask lots of questions </li>\n\t\t<li> Don't claim to be the user </li>\n\t\t<li> Let us explain our decisions </li>\n\t</ol>\n</section>\n\n<section>\n\t<h2> Ten Tips for Working with Designers </h2>\n\t<ol start=\"6\">\n\t\t<li> Empower us to make decisions </li>\n\t\t<li> Use helpful language </li>\n\t\t<li> Ask if there is data </li>\n\t\t<li> Be prepared </li>\n\t\t<li> Give us what we need to be successful </li>\n\t</ol>\n</section>\n\n<section>\n\t<h2> Design Project Checklist </h2>\n\t<p> Shared understanding is vital to the success of a project. Areas to focus on include: </p>\n\t<ul>\n\t\t<li> Management, vision and goals </li>\n\t\t<li> Users or customers </li>\n\t\t<li> Workflow and communication </li>\n\t\t<li> Access to information and people </li>\n\t\t<li> Design and technical requirements </li>\n\t</ul>\n</section>\n\n<section>\n\t<h2> A Seat at the Table </h2>\n\t<h4> Design is becoming increasingly more valued</h4>\n\t<ul>\n\t\t<li> The most successful products are ones that are well designed and provide a superior UX released by organizations that have design-centric leadership </li>\n\t\t<li> Getting there is as simple as building better relationships with your designers and empowering them to make decisions </li>\n\t</ul>\n</section>\n\n<section id=\"ch13\"> <!-- OPENING: CHAPTER 13 -->\n\t<h2><small> Chapter 13 </small></h2>\n\t<h2> Designing for Vision </h2>\n\t<blockquote>\n\t\t<p> An artist is not paid for his labor but for his vision. </p>\n\t\t<p> ―James McNeill Whistler</p>\n\t</blockquote>\n</section>\n\n<section>\n\t<h2> Recognizing Our Power </h2>\n</section>\n\n<section data-background=\"https://media.giphy.com/media/ScQ1Uoo8xcznO/giphy.gif\"></section>\n\n<section>\n\t<h2> Recognizing Our Power </h2>\n\t<h4> Images make the unreal real </h4>\n\t<p> Having the skills to think and execute visually gets decision makers excited about our ideas </p>\n\t<ul>\n\t\t<li class=\"fragment\">\n\t\t\tDesigning for vision gives us a creative outlet\n\t\t</li>\n\t\t<li class=\"fragment\">\n\t\t\tIt creates a conversation with other people\n\t\t</ class=\"fragment\">\n\t\t<li class=\"fragment\">\n\t\t\tIt brings people together\n\t\t</li>\n\t\t<li class=\"fragment\">\n\t\t\tIt builds credibility\n\t\t</li>\n\t\t<li class=\"fragment\">\n\t\t\tIt lives beyond us\n\t\t</li>\n\t</ul>\n</section>\n\n<section>\n\t<h2> Practicing Creativity </h2>\n\t<p> Designing for vision requires us to step away from our projects and dream a little </p>\n\t<ul>\n\t\t<li class=\"fragment\"> <b>Find inspiration</b> creating something new requires inspiration, and it's all around us </li>\n\t\t<li class=\"fragment\"> <b>See UX everywhere</b> allow the UX of non-digital things to inform your designs </li>\n\t\t<li class=\"fragment\"> <b>Use a different canvas</b> find something that allows you to create without worrying about delivering </li>\n\t\t<li class=\"fragment\"> <b>Ideate and iterate</b> force yourself to think of different ideas and then refine them </li>\n\t</ul>\n</section>\n\n<section>\n\t<h2> Making it Happen </h2>\n\t<p> Designing for vision isn't usually part of our job description, so finding the value in it is often hard </p>\n</section>\n\n<section>\n\t<h2> Making it Happen </h2>\n\t<h4> Find a different routine </h4>\n\t<p> It's important to find different <em>time</em>, <em>space</em>, <em>activity</em> and <em>materials</em> to help you relax, free your mind and create. </p>\n</section>\n\n<section>\n\t<h2> Making Stuff Up </h2>\n</section>\n\n<section data-background=\"https://media.giphy.com/media/xvL89ErKTLIqc/giphy.gif\"></section>\n\n<section>\n\t<h2> Making Stuff Up </h2>\n\t<p> When it comes down to it, designing for vision is about making things up, expressing them in a tangible way and using visuals to create excitement about the future </p>\n\t<ul>\n\t\t<li class=\"fragment\"> Don't limit yourself </li>\n\t\t<li class=\"fragment\"> Start from scratch </li>\n\t\t<li class=\"fragment\"> Don't obsess over the details </li>\n\t\t<li class=\"fragment\"> Make lots of different versions </li>\n\t</ul>\n</section>\n\n<section>\n\t<h2> Making Stuff Up </h2>\n\t<p> Even if our ideas fall flat, they still create value for us, as designers, in learning to communicate about design and build momentum to be successful </p>\n</section>\n\n<section>\n\t<h2> Taking Your Ideas to the Right People </h2>\n\t<p> Relationships are everything; invest in them </p>\n</section>\n\n<section>\n\t<h2> More Than Pixels </h2>\n\t<p> Talking about our design is hard because it is an extension of our experiences, regardless of how hard we try to remove ourselves </p>\n\t<p> <em>Your designs do not speak for themselves</em> </p>\n</section>\n\n<section>\n\t<h3> Design is always changing, but being a better communicator is something that we can always have. </h3>\n</section>\n\n\n<!-- ///////////////// -->\n<!-- END KATIE ZONE -->\n<!-- ///////////////// -->\n\n\t\t\t\t<section data-background=\"dark\" >\n\t\t\t\t\t<h1 class=\"white center\">Questions?</h1>\n\t\t\t\t\t<div class=\"logo-block\"></div>\n\t\t\t\t\t<p class=\"center\">\n\t\t\t\t\t\t<small><a href=\"https://teamgaslight.com\">teamgaslight.com</a></small>\n\t\t\t\t\t</p>\n\t\t\t\t</section>\n\t\t\t</div>\n\t\t</div>\n\t\t<script src=\"lib/js/head.min.js\"></script>\n\t\t<script src=\"js/reveal.js\"></script>\n\n\t\t<script>\n\t\t\t// More info https://github.com/hakimel/reveal.js#configuration\n\t\t\tReveal.initialize({\n\t\t\t\thistory: true,\n\t\t\t\ttransition: Reveal.getQueryHash().transition || 'none', // default/cube/page/concave/zoom/linear/none\n\n\n\t\t\t\t// More info https://github.com/hakimel/reveal.js#dependencies\n\t\t\t\tdependencies: [\n\t\t\t\t\t{ src: 'plugin/markdown/marked.js' },\n\t\t\t\t\t{ src: 'plugin/markdown/markdown.js' },\n\t\t\t\t\t{ src: 'plugin/notes/notes.js', async: true },\n\t\t\t\t\t{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }\n\t\t\t\t]\n\t\t\t});\n\t\t</script>\n\t</body>\n</html>\n", "meta": {"content_hash": "57ce58885d05aaa989952551084fb07f", "timestamp": "", "source": "github", "line_count": 1228, "max_line_length": 349, "avg_line_length": 39.66530944625407, "alnum_prop": 0.6365148124576567, "repo_name": "gaslight/design-book-club_ADD", "id": "a1a28981e76348818bdb56a1d3a0843cb339ba69", "size": "48735", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.html", "mode": "33261", "license": "mit", "language": [{"name": "CSS", "bytes": "205654"}, {"name": "HTML", "bytes": "207720"}, {"name": "JavaScript", "bytes": "261184"}]}} +{"text": "\ufeff//-----------------------------------------------------------------------\n// <copyright file=\"ExportCreativeActivityFixture.cs\" company=\"Rare Crowds Inc\">\n// Copyright 2012-2013 Rare Crowds, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// </copyright>\n//-----------------------------------------------------------------------\n\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Configuration;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing Activities;\nusing ActivityTestUtilities;\nusing ConfigManager;\nusing DataAccessLayer;\nusing DeliveryNetworkUtilities;\nusing EntityTestUtilities;\nusing EntityUtilities;\nusing Google.Api.Ads.Common.Util;\nusing Google.Api.Ads.Dfp.Lib;\nusing GoogleDfpActivities;\nusing GoogleDfpClient;\nusing GoogleDfpUtilities;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing Rhino.Mocks;\nusing Rhino.Mocks.Constraints;\nusing TestUtilities;\nusing Dfp = Google.Api.Ads.Dfp.v201206;\n\nnamespace GoogleDfpIntegrationTests\n{\n /// <summary>Tests for ExportCreativeActivity</summary>\n [TestClass]\n public class ExportCreativeActivityFixture : DfpActivityFixtureBase<ExportCreativeActivity>\n {\n /// <summary>Gets the bytes of a 300x250 test GIF</summary>\n private byte[] TestImageBytes\n {\n get { return EmbeddedResourceHelper.GetEmbeddedResourceAsByteArray(this.GetType(), \"Resources.test.gif\"); }\n }\n\n /// <summary>Initialize per-test object(s)/settings</summary>\n [TestInitialize]\n public override void TestInitialize()\n {\n base.TestInitialize();\n }\n\n /// <summary>Test exporting an image creative</summary>\n [TestMethod]\n public void ExportImageCreative()\n {\n var companyEntity = TestNetwork.AdvertiserCompanyEntity;\n var creativeEntity = this.CreateTestImageAdCreative();\n this.AddEntitiesToMockRepository(companyEntity, creativeEntity);\n\n var request = new ActivityRequest\n {\n Task = GoogleDfpActivityTasks.ExportCreative,\n Values =\n {\n { EntityActivityValues.AuthUserId, Guid.NewGuid().ToString(\"N\") },\n { EntityActivityValues.CompanyEntityId, companyEntity.ExternalEntityId.ToString() },\n { EntityActivityValues.CreativeEntityId, creativeEntity.ExternalEntityId.ToString() },\n }\n };\n \n var activity = this.CreateActivity();\n var result = activity.Run(request);\n\n // Validate result\n ActivityTestHelpers.AssertValidSuccessResult(result);\n ActivityTestHelpers.AssertResultHasValues(\n result,\n EntityActivityValues.CreativeEntityId,\n GoogleDfpActivityValues.CreativeId);\n \n // Verify creative was created correctly in DFP\n long creativeId;\n Assert.IsTrue(long.TryParse(result.Values[GoogleDfpActivityValues.CreativeId], out creativeId));\n var creative = this.DfpClient.GetCreatives(new[] { creativeId }).FirstOrDefault() as Dfp.ImageCreative;\n Assert.IsNotNull(creative);\n Assert.AreEqual(creativeId, creative.id);\n Assert.AreEqual<string>(creativeEntity.ExternalName, creative.name);\n Assert.AreEqual(TestNetwork.AdvertiserId, creative.advertiserId);\n Assert.IsNotNull(creative.previewUrl);\n Assert.IsFalse(creative.size.isAspectRatio);\n Assert.AreEqual(300, creative.size.width);\n Assert.AreEqual(250, creative.size.height);\n Assert.AreEqual(creativeEntity.GetClickUrl(), creative.destinationUrl);\n }\n\n /// <summary>Test exporting third party tag creative</summary>\n [TestMethod]\n [Ignore]\n public void ExportThirdPartyTagCreative()\n {\n Assert.Fail();\n }\n\n /// <summary>Creates a test creative entity for a 300x250 image ad</summary>\n /// <returns>The creative entity</returns>\n private CreativeEntity CreateTestImageAdCreative()\n {\n return EntityTestHelpers.CreateTestImageAdCreativeEntity(\n new EntityId(),\n \"Test Creative - \" + this.UniqueId,\n 300,\n 250,\n \"http://www.rarecrowds.com/\",\n this.TestImageBytes);\n }\n }\n}\n", "meta": {"content_hash": "847e9e06212c583e11ee9ccbb90d1f5d", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 119, "avg_line_length": 39.06976744186046, "alnum_prop": 0.6398809523809523, "repo_name": "chinnurtb/OpenAdStack", "id": "7f5fcdc0845d8ee2b35f78afeffe017c76425439", "size": "5042", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "GoogleDfpActivities/GoogleDfpIntegrationTests/ExportCreativeActivityFixture.cs", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "programinit()\n\n#include <testd2.h>\n#include <initgeneral.h>\n\n#include <win.h>\n#include <gen.h>\n\nfunction main() {\n\tprintl(\"testd says 'Hello World!'\");\n\t//CREATE LABELLED COMMON\n\tmv.labelledcommon[1]=new win_common;\n\n//\tperform(\"initgeneral\");\n\tcall initgeneral();\n asm(\" int $03\");\n\twin.srcfile=\"\";\n\twin.datafile=\"\";\n\twin.orec=\"\";\n\twin.wlocked=\"\";\n\twin.reset=\"\";\n\twin.valid=\"\";\n\n\tcall testd2();\n\treturn 0;\n}\n\ndebugprogramexit()\n\n", "meta": {"content_hash": "0945bb063bcbbe4c280322b09c022a45", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 37, "avg_line_length": 14.827586206896552, "alnum_prop": 0.6511627906976745, "repo_name": "rdmenezes/exodusdb", "id": "0caada7d87e34cb7641c91bf72cd649fbe0b168d", "size": "458", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "service/service2/test/testd.cpp", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "101254"}, {"name": "ApacheConf", "bytes": "97"}, {"name": "C", "bytes": "59938"}, {"name": "C#", "bytes": "7029"}, {"name": "C++", "bytes": "2637888"}, {"name": "CMake", "bytes": "47750"}, {"name": "CSS", "bytes": "4304"}, {"name": "HTML", "bytes": "440897"}, {"name": "Java", "bytes": "1544"}, {"name": "JavaScript", "bytes": "811589"}, {"name": "Makefile", "bytes": "5330"}, {"name": "NSIS", "bytes": "81704"}, {"name": "PHP", "bytes": "18675"}, {"name": "Perl", "bytes": "3746"}, {"name": "Python", "bytes": "15897"}, {"name": "Shell", "bytes": "1116985"}, {"name": "Visual Basic", "bytes": "509"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>color: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.8.2 / color - 1.4.0</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n color\n <small>\n 1.4.0\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-10-08 09:30:10 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-10-08 09:30:10 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-threads base\nbase-unix base\ncamlp5 7.14 Preprocessor-pretty-printer of OCaml\nconf-findutils 1 Virtual package relying on findutils\nconf-perl 2 Virtual package relying on perl\ncoq 8.8.2 Formal proof management system\nnum 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.07.1 The OCaml compiler (virtual package)\nocaml-base-compiler 4.07.1 Official release 4.07.1\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.5 A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "frederic.blanqui@inria.fr"\nauthors: [\n "Fr\u00e9d\u00e9ric Blanqui"\n "Adam Koprowski"\n "S\u00e9bastien Hinderer"\n "Pierre-Yves Strub"\n "Sidi Ould Biha"\n "Solange Coupet-Grimal"\n "William Delobel"\n "Hans Zantema"\n "St\u00e9phane Leroux"\n "L\u00e9o Ducas"\n "Johannes Waldmann"\n "Qiand Wang"\n "Lianyi Zhang"\n "Sorin Stratulat"\n]\nlicense: "CeCILL"\nhomepage: "http://color.inria.fr/"\nbug-reports: "color@inria.fr"\nbuild: [\n [make "-j%{jobs}%"]\n]\ninstall: [make "-f" "Makefile.coq" "install"]\ndepends: [\n "ocaml"\n "coq" {>= "8.7" & < "8.8~"}\n "coq-bignums" {>= "8.7" & < "8.8~"}\n]\ntags: [\n "date:2017-11-10"\n "logpath:CoLoR"\n "category:Computer Science/Algorithms/Correctness proofs of algorithms"\n "category:Computer Science/Data Types and Data Structures"\n "category:Computer Science/Lambda Calculi"\n "category:Mathematics/Algebra"\n "category:Mathematics/Combinatorics and Graph Theory"\n "category:Mathematics/Logic/Type theory"\n "category:Miscellaneous/Extracted Programs/Type checking unification and normalization"\n "keyword:rewriting"\n "keyword:termination"\n "keyword:lambda calculus"\n "keyword:list"\n "keyword:multiset"\n "keyword:polynomial"\n "keyword:vectors"\n "keyword:matrices"\n "keyword:FSet"\n "keyword:FMap"\n "keyword:term"\n "keyword:context"\n "keyword:substitution"\n "keyword:universal algebra"\n "keyword:varyadic term"\n "keyword:string"\n "keyword:alpha-equivalence"\n "keyword:de Bruijn indices"\n "keyword:simple types"\n "keyword:matching"\n "keyword:unification"\n "keyword:relation"\n "keyword:ordering"\n "keyword:quasi-ordering"\n "keyword:lexicographic ordering"\n "keyword:ring"\n "keyword:semiring"\n "keyword:well-foundedness"\n "keyword:noetherian"\n "keyword:finitely branching"\n "keyword:dependent choice"\n "keyword:infinite sequences"\n "keyword:non-termination"\n "keyword:loop"\n "keyword:graph"\n "keyword:path"\n "keyword:transitive closure"\n "keyword:strongly connected component"\n "keyword:topological ordering"\n "keyword:rpo"\n "keyword:horpo"\n "keyword:dependency pair"\n "keyword:dependency graph"\n "keyword:semantic labeling"\n "keyword:reducibility"\n "keyword:Girard"\n "keyword:fixpoint theorem"\n "keyword:Tarski"\n "keyword:pigeon-hole principle"\n "keyword:Ramsey theorem"\n]\nsynopsis: "A library on rewriting theory and termination"\nurl {\n src: "http://files.inria.fr/blanqui/color/color.1.4.0.tar.gz"\n checksum: "md5=012e9be1fee95f5bea00cd91133302c1"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-color.1.4.0 coq.8.8.2</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.8.2).\nThe following dependencies couldn't be met:\n - coq-color -> coq < 8.8~ -> ocaml < 4.06.0\n base of this switch (use `--unlock-base' to force)\nYour request can't be satisfied:\n - No available version of coq satisfies the constraints\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-color.1.4.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "8d91af6df00d1a3ae0be1f5e53ff74c3", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 159, "avg_line_length": 38.36134453781513, "alnum_prop": 0.5904709748083242, "repo_name": "coq-bench/coq-bench.github.io", "id": "04bc43da7728c1bf5cdf3c31c6ba0b9fc3f59852", "size": "9160", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.07.1-2.0.6/released/8.8.2/color/1.4.0.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "<?php\n\nnamespace Mr\\ChatBundle;\n\nuse Symfony\\Component\\HttpKernel\\Bundle\\Bundle;\n\nclass MrChatBundle extends Bundle\n{\n}\n", "meta": {"content_hash": "300ff9f5091364e22260bd06b928c05c", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 47, "avg_line_length": 13.333333333333334, "alnum_prop": 0.7916666666666666, "repo_name": "KillaoDev/MooveRadio", "id": "373f9253866ecbb12515ed41e83a01795b848530", "size": "120", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Mr/ChatBundle/MrChatBundle.php", "mode": "33261", "license": "mit", "language": [{"name": "CSS", "bytes": "11006"}, {"name": "JavaScript", "bytes": "914"}, {"name": "PHP", "bytes": "120455"}, {"name": "Shell", "bytes": "603"}]}} +{"text": "require 'spec_helper'\n\ndescribe \"Product Taxons\", :type => :feature do\n stub_authorization!\n\n after do\n Capybara.ignore_hidden_elements = true\n end\n\n before do\n Capybara.ignore_hidden_elements = false\n end\n\n context \"managing taxons\" do\n def selected_taxons\n find(\"#product_taxon_ids\").value.split(',').map(&:to_i).uniq\n end\n\n it \"should allow an admin to manage taxons\", :js => true do\n taxon_1 = create(:taxon)\n taxon_2 = create(:taxon, :name => 'Clothing')\n product = create(:product)\n product.taxons << taxon_1\n\n visit spree.admin_path\n click_link \"Products\"\n within(\"table.index\") do\n click_icon :edit\n end\n\n expect(find(\".select2-search-choice\").text).to eq(taxon_1.name)\n expect(selected_taxons).to match_array([taxon_1.id])\n\n select2_search \"Clothing\", :from => \"Taxons\"\n click_button \"Update\"\n expect(selected_taxons).to match_array([taxon_1.id, taxon_2.id])\n\n # Regression test for #2139\n sleep(1)\n expect(first(\".select2-search-choice\", text: taxon_1.name)).to be_present\n expect(first(\".select2-search-choice\", text: taxon_2.name)).to be_present\n end\n end\nend\n", "meta": {"content_hash": "80ce74674e938cb4466a3aa2edab34db", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 79, "avg_line_length": 27.136363636363637, "alnum_prop": 0.6381909547738693, "repo_name": "sunny2601/spree1", "id": "254d52aee286205457d4c5cd07a50cf9501f0c9b", "size": "1194", "binary": false, "copies": "11", "ref": "refs/heads/master", "path": "backend/spec/features/admin/products/edit/taxons_spec.rb", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "201085"}, {"name": "CoffeeScript", "bytes": "32035"}, {"name": "HTML", "bytes": "470128"}, {"name": "JavaScript", "bytes": "37692"}, {"name": "Ruby", "bytes": "2012087"}, {"name": "Shell", "bytes": "2346"}]}} +{"text": "package internal\n\nimport (\n\t\"strconv\"\n\n\t\"github.com/kataras/iris/v12/context\"\n\n\t\"golang.org/x/text/feature/plural\"\n\t\"golang.org/x/text/message\"\n\t\"golang.org/x/text/message/catalog\"\n)\n\n// PluralCounter if completes by an input argument of a message to render,\n// then the plural renderer will resolve the plural count\n// and any variables' counts. This is useful when the data is not a type of Map or integers.\ntype PluralCounter interface {\n\t// PluralCount returns the plural count of the message.\n\t// If returns -1 then this is not a valid plural message.\n\tPluralCount() int\n\t// VarCount should return the variable count, based on the variable name.\n\tVarCount(name string) int\n}\n\n// PluralMessage holds the registered Form and the corresponding Renderer.\n// It is used on the `Message.AddPlural` method.\ntype PluralMessage struct {\n\tForm PluralForm\n\tRenderer Renderer\n}\n\ntype independentPluralRenderer struct {\n\tkey string\n\tprinter *message.Printer\n}\n\nfunc newIndependentPluralRenderer(c *Catalog, loc *Locale, key string, msgs ...catalog.Message) (Renderer, error) {\n\tbuilder := catalog.NewBuilder(catalog.Fallback(c.Locales[0].tag))\n\tif err := builder.Set(loc.tag, key, msgs...); err != nil {\n\t\treturn nil, err\n\t}\n\tprinter := message.NewPrinter(loc.tag, message.Catalog(builder))\n\treturn &independentPluralRenderer{key, printer}, nil\n}\n\nfunc (m *independentPluralRenderer) Render(args ...interface{}) (string, error) {\n\treturn m.printer.Sprintf(m.key, args...), nil\n}\n\n// A PluralFormDecoder should report and return whether\n// a specific \"key\" is a plural one. This function\n// can be implemented and set on the `Options` to customize\n// the plural forms and their behavior in general.\n//\n// See the `DefaultPluralFormDecoder` package-level\n// variable for the default implementation one.\ntype PluralFormDecoder func(loc context.Locale, key string) (PluralForm, bool)\n\n// DefaultPluralFormDecoder is the default `PluralFormDecoder`.\n// Supprots \"zero\", \"one\", \"two\", \"other\", \"=x\", \"<x\", \">x\".\nvar DefaultPluralFormDecoder = func(_ context.Locale, key string) (PluralForm, bool) {\n\tif isDefaultPluralForm(key) {\n\t\treturn pluralForm(key), true\n\t}\n\n\treturn nil, false\n}\n\nfunc isDefaultPluralForm(s string) bool {\n\tswitch s {\n\tcase \"zero\", \"one\", \"two\", \"other\":\n\t\treturn true\n\tdefault:\n\t\tif len(s) > 1 {\n\t\t\tch := s[0]\n\t\t\tif ch == '=' || ch == '<' || ch == '>' {\n\t\t\t\tif isDigit(s[1]) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n}\n\n// A PluralForm is responsible to decode\n// locale keys to plural forms and match plural forms\n// based on the given pluralCount.\n//\n// See `pluralForm` package-level type for a default implementation.\ntype PluralForm interface {\n\tString() string\n\t// the string is a verified plural case's raw string value.\n\t// Field for priority on which order to register the plural cases.\n\tLess(next PluralForm) bool\n\tMatchPlural(pluralCount int) bool\n}\n\ntype pluralForm string\n\nfunc (f pluralForm) String() string {\n\treturn string(f)\n}\n\nfunc (f pluralForm) Less(next PluralForm) bool {\n\tform1 := f.String()\n\tform2 := next.String()\n\n\t// Order by\n\t// - equals,\n\t// - less than\n\t// - greater than\n\t// - \"zero\", \"one\", \"two\"\n\t// - rest is last \"other\".\n\tdig1, typ1, hasDig1 := formAtoi(form1)\n\tif typ1 == eq {\n\t\treturn true\n\t}\n\n\tdig2, typ2, hasDig2 := formAtoi(form2)\n\tif typ2 == eq {\n\t\treturn false\n\t}\n\n\t// digits smaller, number.\n\tif hasDig1 {\n\t\treturn !hasDig2 || dig1 < dig2\n\t}\n\n\tif hasDig2 {\n\t\treturn false\n\t}\n\n\tif form1 == \"other\" {\n\t\treturn false // other go to last.\n\t}\n\n\tif form2 == \"other\" {\n\t\treturn true\n\t}\n\n\tif form1 == \"zero\" {\n\t\treturn true\n\t}\n\n\tif form2 == \"zero\" {\n\t\treturn false\n\t}\n\n\tif form1 == \"one\" {\n\t\treturn true\n\t}\n\n\tif form2 == \"one\" {\n\t\treturn false\n\t}\n\n\tif form1 == \"two\" {\n\t\treturn true\n\t}\n\n\tif form2 == \"two\" {\n\t\treturn false\n\t}\n\n\treturn false\n}\n\nfunc (f pluralForm) MatchPlural(pluralCount int) bool {\n\tswitch f {\n\tcase \"other\":\n\t\treturn true\n\tcase \"=0\", \"zero\":\n\t\treturn pluralCount == 0\n\tcase \"=1\", \"one\":\n\t\treturn pluralCount == 1\n\tcase \"=2\", \"two\":\n\t\treturn pluralCount == 2\n\tdefault:\n\t\t// <5 or =5\n\n\t\tn, typ, ok := formAtoi(string(f))\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\n\t\tswitch typ {\n\t\tcase eq:\n\t\t\treturn n == pluralCount\n\t\tcase lt:\n\t\t\treturn pluralCount < n\n\t\tcase gt:\n\t\t\treturn pluralCount > n\n\t\tdefault:\n\t\t\treturn false\n\t\t}\n\t}\n}\n\nfunc makeSelectfVars(text string, vars []Var, insidePlural bool) ([]catalog.Message, []Var) {\n\tnewVars := sortVars(text, vars)\n\tnewVars = removeVarsDuplicates(newVars)\n\tmsgs := selectfVars(newVars, insidePlural)\n\treturn msgs, newVars\n}\n\nfunc selectfVars(vars []Var, insidePlural bool) []catalog.Message {\n\tmsgs := make([]catalog.Message, 0, len(vars))\n\tfor _, variable := range vars {\n\t\targth := variable.Argth\n\t\tif insidePlural {\n\t\t\targth++\n\t\t}\n\n\t\tmsg := catalog.Var(variable.Name, plural.Selectf(argth, variable.Format, variable.Cases...))\n\t\t// fmt.Printf(\"%s:%d | cases | %#+v\\n\", variable.Name, variable.Argth, variable.Cases)\n\t\tmsgs = append(msgs, msg)\n\t}\n\n\treturn msgs\n}\n\nconst (\n\teq uint8 = iota + 1\n\tlt\n\tgt\n)\n\nfunc formType(ch byte) uint8 {\n\tswitch ch {\n\tcase '=':\n\t\treturn eq\n\tcase '<':\n\t\treturn lt\n\tcase '>':\n\t\treturn gt\n\t}\n\n\treturn 0\n}\n\nfunc formAtoi(form string) (int, uint8, bool) {\n\tif len(form) < 2 {\n\t\treturn -1, 0, false\n\t}\n\n\ttyp := formType(form[0])\n\tif typ == 0 {\n\t\treturn -1, 0, false\n\t}\n\n\tdig, err := strconv.Atoi(form[1:])\n\tif err != nil {\n\t\treturn -1, 0, false\n\t}\n\treturn dig, typ, true\n}\n\nfunc isDigit(ch byte) bool {\n\treturn '0' <= ch && ch <= '9'\n}\n", "meta": {"content_hash": "e488202c3e762667465ce73ac23d024b", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 115, "avg_line_length": 20.973180076628353, "alnum_prop": 0.6691633175009134, "repo_name": "kataras/iris", "id": "75a01667d939c5f1577b0276e8f6b9855591d60e", "size": "5474", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "i18n/internal/plural.go", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "15415"}, {"name": "Dockerfile", "bytes": "2408"}, {"name": "Go", "bytes": "2521098"}, {"name": "HTML", "bytes": "59845"}, {"name": "JavaScript", "bytes": "98505"}, {"name": "Pug", "bytes": "1236"}, {"name": "Shell", "bytes": "39"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \r\n<!DOCTYPE log4j:configuration PUBLIC \"-//APACHE//DTD LOG4J 1.2//EN\" \"log4j.dtd\">\r\n<log4j:configuration xmlns:log4j=\"http://jakarta.apache.org/log4j/\">\r\n\t<!-- [concole] -->\r\n\t<appender name=\"myConsole\" class=\"org.apache.log4j.ConsoleAppender\">\r\n\t\t<param name=\"encoding\" value=\"GBK\" />\r\n\t\t<param name=\"target\" value=\"System.out\" />\r\n\t\t<param name=\"threshold\" value=\"info\" />\r\n\t\t<layout class=\"org.apache.log4j.PatternLayout\">\r\n\t\t\t<param name=\"ConversionPattern\" value=\"%-5p %c{2} - %m%n\" />\r\n\t\t</layout>\r\n\t</appender>\r\n\r\n\t<!-- [error] -->\r\n\t<appender name=\"ERROR-APPENDER\" class=\"org.apache.log4j.DailyRollingFileAppender\">\r\n\t\t<param name=\"File\" value=\"/data/logs/sqe/error/error.log\" />\r\n\t\t<param name=\"Append\" value=\"true\" />\r\n\t\t<param name=\"encoding\" value=\"GBK\" />\r\n\t\t<param name=\"threshold\" value=\"error\" />\r\n\t\t<param name=\"DatePattern\" value=\"'.'yyyy-MM-dd'.log'\" />\r\n\t\t<layout class=\"org.apache.log4j.PatternLayout\">\r\n\t\t\t<param name=\"ConversionPattern\" value=\"%d %-5p %c{2} - %m%n\" />\r\n\t\t</layout>\r\n\t</appender>\r\n\t\r\n\t<!-- [info] -->\r\n\t<appender name=\"INFO-APPENDER\" class=\"org.apache.log4j.DailyRollingFileAppender\">\r\n\t\t<param name=\"File\" value=\"/data/logs/sqe/info/info.log\" />\r\n\t\t<param name=\"Append\" value=\"true\" />\r\n\t\t<param name=\"encoding\" value=\"GBK\" />\r\n\t\t<param name=\"threshold\" value=\"info\" />\r\n\t\t<param name=\"DatePattern\" value=\"'.'yyyy-MM-dd'.log'\" />\r\n\t\t<layout class=\"org.apache.log4j.PatternLayout\">\r\n\t\t\t<param name=\"ConversionPattern\" value=\"%d %-5p %c{2} - %m%n\" />\r\n\t\t</layout>\r\n\t</appender>\r\n\t\r\n\t<!-- Root Logger -->\r\n\t<root>\r\n\t\t<level value=\"${rootLevel}\"></level>\r\n\t\t<appender-ref ref=\"INFO-APPENDER\" />\r\n\t\t<appender-ref ref=\"myConsole\" />\r\n\t\t<appender-ref ref=\"ERROR-APPENDER\" />\r\n\t</root>\r\n</log4j:configuration>", "meta": {"content_hash": "cf9a936644d75d3ea36a7e705f7618b2", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 83, "avg_line_length": 39.62222222222222, "alnum_prop": 0.635445877734156, "repo_name": "wingcrawler/shop_bbs", "id": "ab2daa0767f6e3298790af85b698d4eb90f81c4f", "size": "1783", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/resources/log4j.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "2269598"}, {"name": "HTML", "bytes": "294987"}, {"name": "Java", "bytes": "951244"}, {"name": "JavaScript", "bytes": "3130107"}, {"name": "PHP", "bytes": "6307"}]}} +{"text": "/**\n * Prevajalnik za programski jezik PREV.\n * <p>\n * Celotna izvorna koda prevajalnika za programski jezik PREV je zbrana v paketu {@link compiler} in njegovih podpaketih.\n *\n * @author sliva\n */\npackage compiler;", "meta": {"content_hash": "1ac830c989edb3428b854b04cb55405d", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 121, "avg_line_length": 26.875, "alnum_prop": 0.7302325581395349, "repo_name": "jarheadSLO/ProteusCompiler", "id": "f0809f7b14d6f493006e94e1a8e26ca621acbc2f", "size": "215", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/compiler/package-info.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "288143"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Text.RegularExpressions;\nusing System.Xml.Linq;\n\nnamespace Dextem\n{\n /// <summary>\n /// Controls name processing of method 'M:' and type 'T:' <member> nodes. This class cannot be inherited.\n /// </summary>\n public sealed class MethodTypeProcessor : BaseProcessor\n {\n /// <summary>\n /// Creates a new instance of MethodTypeProcessor using the given ProcessorRegistry.\n /// </summary>\n /// <param name=\"registry\">The ProcessorRegistry instance to use.</param>\n public MethodTypeProcessor(ProcessorRegistry registry) : base(registry) { }\n\n /// <summary>\n /// Executes name processing of the current method 'M:' or type 'T:' <member> element.\n /// </summary>\n /// <param name=\"writer\">The current StringWriter to use.</param>\n /// <param name=\"root\">The current root element to process.</param>\n /// <param name=\"context\">The current processing context.</param>\n /// <returns>The updated processing context.</returns>\n public override Dictionary<XName, string> Process(StringWriter writer, XElement root, Dictionary<XName, string> context)\n {\n Args.IsNotNull(() => writer, () => root, () => context);\n\n var memberName = root.Attribute(XName.Get(\"name\")).Value;\n char memberType = memberName[0];\n\n if (memberType == 'M')\n {\n memberName = MethodTypeProcessor.RearrangeTypeParametersInContext(root, memberName, context, false);\n memberName = MethodTypeProcessor.RearrangeParametersInContext(root, memberName, context);\n }\n\n context[\"memberName\"] = memberName;\n\n if (memberType == 'T')\n {\n var typeNameStartIndex = 3 + context[\"assembly\"].Length;\n var scrubbedName = MethodTypeProcessor.ReplaceForTypeParameters(root, memberName, false, context);\n var shortMemberName = scrubbedName.Substring(typeNameStartIndex);\n writer.WriteLine(\"\\n## {0}\\n\", shortMemberName);\n context[\"typeName\"] = shortMemberName;\n }\n\n context[\"memberType\"] = memberType.ToString();\n\n context[\"lastNode\"] = memberName;\n\n return base.Process(writer, root, context);\n }\n\n private static List<string> GetParameterTypes(string memberName)\n {\n var parameterTypes = new List<string>();\n\n Match match = Regex.Match(memberName, \"\\\\((.*)\\\\)\");\n\n // Groups[0] = (Type, Type, Type)\n // Groups[1] = Type, Type, Type\n\n if (match.Groups.Count < 1)\n {\n return parameterTypes;\n }\n\n string rawParameterString = string.Empty;\n\n if (match.Groups.Count == 1)\n {\n rawParameterString = match.Groups[0].Value.Replace(\"(\", \"\").Replace(\")\", \"\").Replace(\" \", \"\");\n }\n\n if (match.Groups.Count == 2)\n {\n rawParameterString = match.Groups[1].Value.Replace(\" \", \"\");\n }\n\n var rawParameterArray = rawParameterString.Split(',');\n\n for (var i = 0; i < rawParameterArray.Length; i++)\n {\n var raw = rawParameterArray[i];\n\n var isGeneric = (raw.Contains(\"{\") || raw.Contains(\"<\") || raw.Contains(\"}\") || raw.Contains(\">\"));\n var isOpenOnly = (isGeneric && !(raw.Contains(\"}\") || raw.Contains(\">\")));\n\n if (!isGeneric || isOpenOnly)\n {\n parameterTypes.Add(raw);\n continue;\n }\n\n var isCloseOnly = (isGeneric && !(raw.Contains(\"{\") || raw.Contains(\"<\")));\n\n if (isCloseOnly)\n {\n parameterTypes[parameterTypes.Count - 1] += \", \" + raw;\n continue;\n }\n }\n\n return parameterTypes;\n }\n\n private static string RearrangeParametersInContext(XElement methodMember, string memberName, Dictionary<XName, string> context)\n {\n var parameterTypes = MethodTypeProcessor.GetParameterTypes(memberName);\n\n List<XElement> paramElems = new List<XElement>(methodMember.Elements(\"param\"));\n if (parameterTypes.Count != paramElems.Count)\n {\n // the parameter count do not match, we can't do the rearrangement.\n return memberName;\n }\n\n string newParamString = \"\";\n for (int i = 0; i < paramElems.Count; i++)\n {\n XElement paramElem = paramElems[i];\n string paramName = paramElem.Attribute(XName.Get(\"name\")).Value;\n string paramType = parameterTypes[i];\n if (newParamString.Length > 0)\n {\n newParamString += \", \";\n }\n newParamString += paramName;\n context[paramName] = paramType;\n }\n\n string newMethodPrototype = Regex.Replace(memberName,\n \"\\\\(.*\\\\)\",\n \"(\" + newParamString + \")\");\n\n return newMethodPrototype;\n }\n\n private static string RearrangeTypeParametersInContext(XElement member, string memberName, Dictionary<XName, string> context, bool skipReplace)\n {\n var methodPrototype = memberName;\n if (!skipReplace)\n {\n methodPrototype = MethodTypeProcessor.ReplaceForTypeParameters(member, memberName, true, context);\n }\n\n var matches = Regex.Matches(methodPrototype, \"\\\\{(`\\\\d)+}\"); //Matches: {'0} && {'1'2} //M:GraphExec.BaseEventAggregator.GetEventType(GraphExec.IHandle{'0})\n\n var typedParams = matches.ToList();\n var replaceTypedParamString = typedParams.Select(x => x.Groups[0].Value);\n\n if (!replaceTypedParamString.Any())\n {\n // nothing to do...\n return methodPrototype;\n }\n\n var paramElems = new List<XElement>(member.Elements(\"typeparam\"));\n\n var newParamString = \"\";\n var indexList = new List<int>();\n\n foreach (var replaceString in replaceTypedParamString)\n {\n newParamString = \"<\";\n\n var scrubBrackets = replaceString.Substring(1, replaceString.Length - 3);\n\n indexList = scrubBrackets.Split('\\'').Cast<int>().ToList(); // \"1, 2\"\n\n if (indexList.Count() <= paramElems.Count)\n {\n foreach (var index in indexList)\n {\n if (newParamString != \"<\")\n {\n newParamString += \", \";\n }\n\n var typeParam = paramElems[index];\n\n var paramType = typeParam.Attribute(XName.Get(\"name\")).Value;\n\n newParamString += paramType;\n }\n }\n else\n {\n newParamString += \"*Unknown*\";\n }\n\n newParamString += \">\";\n\n methodPrototype = methodPrototype.Replace(replaceString, newParamString);\n }\n\n return methodPrototype;\n }\n\n private static string ReplaceForTypeParameters(XElement methodMember, string memberName, bool methodType, Dictionary<XName, string> context)\n {\n string methodPrototype = memberName;\n var matches = Regex.Matches(methodPrototype, \"\\\\`(\\\\d)\"); //Matches: '1 and 1 //M:GraphExec.BaseEventAggregator.GetEventType`1\n\n // Match 1 = Type Parameter Count ('1)\n\n if (matches.Count == 0)\n {\n return methodPrototype;\n }\n\n var typeParamCount = Convert.ToInt32(matches[0].Groups[1].Value);\n\n List<XElement> paramElems = new List<XElement>(methodMember.Elements(\"typeparam\"));\n if (typeParamCount != paramElems.Count)\n {\n System.Diagnostics.Debug.WriteLine(\"Type Parameters and TypeParamList not equal for replacing generic types' type parameters.\");\n // the parameter count do not match, we can't do the rearrangement.\n return methodPrototype;\n }\n\n string newParamString = \"\";\n for (int i = 0; i < paramElems.Count; i++)\n {\n XElement paramElem = paramElems[i];\n string paramType = paramElem.Attribute(XName.Get(\"name\")).Value;\n if (newParamString != \"\")\n {\n newParamString += \", \";\n }\n newParamString += paramType;\n context[paramType] = paramType;\n }\n\n var paramMatches = Regex.Matches(methodPrototype, \"\\\\{``\\\\d}\");\n if (paramMatches.Count > 0) // {``0} and {``1} and {``2``3}\n {\n methodPrototype = MethodTypeProcessor.RearrangeTypeParametersInContext(methodMember, methodPrototype, context, true);\n }\n\n if (methodType)\n {\n string newMethodPrototype = Regex.Replace(methodPrototype,\n \"\\\\``\\\\d\",\n \"<\" + newParamString + \">\");\n\n return newMethodPrototype;\n }\n else\n {\n string newMethodPrototype = Regex.Replace(methodPrototype,\n \"\\\\`\\\\d\",\n \"<\" + newParamString + \">\");\n\n return newMethodPrototype;\n }\n }\n }\n}\n", "meta": {"content_hash": "e2e10abfe5e78f82de6d1a28577a327a", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 168, "avg_line_length": 37.25757575757576, "alnum_prop": 0.5262301748678324, "repo_name": "GraphExec/Dextem", "id": "1e7181d4fb0f1d115fd268143b5be7a6c63dbb68", "size": "9838", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Dextem/MethodTypeProcessor.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "45999"}]}} +{"text": "SHORT_NAME := deis-integration\n\nexport GO15VENDOREXPERIMENT=1\n\n# dockerized development environment variables\nREPO_PATH := github.com/arschles/${SHORT_NAME}\nDEV_ENV_IMAGE := quay.io/deis/go-dev:0.2.0\nDEV_ENV_WORK_DIR := /go/src/${REPO_PATH}\nDEV_ENV_PREFIX := docker run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR}\nDEV_ENV_CMD := ${DEV_ENV_PREFIX} ${DEV_ENV_IMAGE}\n\nLDFLAGS := \"-s -X main.version=${VERSION}\"\nBINDIR := ./rootfs/bin\n\nREGISTRY ?= ${DEV_REGISTRY}\nIMAGE_PREFIX ?= arschles\nVERSION ?= git-$(shell git rev-parse --short HEAD)\n\nIMAGE := ${REGISTRY}${IMAGE_PREFIX}/${SHORT_NAME}:${VERSION}\n\nbootstrap:\n\t${DEV_ENV_CMD} glide up\n\nbuild:\n\tmkdir -p ${BINDIR}\n\t${DEV_ENV_PREFIX} -e CGO_ENABLED=0 ${DEV_ENV_IMAGE} go build -a -installsuffix cgo -ldflags '-s' -o $(BINDIR)/boot || exit 1\n\ndocker-build:\n\t# build the main image\n\tdocker build --rm -t ${IMAGE} rootfs\n\ndocker-push: docker-build\n\tdocker push ${IMAGE}\n", "meta": {"content_hash": "2b05663106b54cbf9c43c7bc054ba504", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 125, "avg_line_length": 28.242424242424242, "alnum_prop": 0.6856223175965666, "repo_name": "arschles/deis-integration", "id": "db4f5af0ee37baebd2024d1d5ca5e452192a4ff6", "size": "932", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Makefile", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Go", "bytes": "3270"}, {"name": "Makefile", "bytes": "932"}]}} +{"text": "\"use strict\";\nangular.module('myApp.login', ['firebase.utils', 'firebase.auth', 'ngRoute'])\n\n .config(['$routeProvider', function($routeProvider) {\n $routeProvider.when('/login', {\n controller: 'LoginCtrl',\n templateUrl: 'login/login.html'\n });\n }])\n\n .controller('LoginCtrl', ['$scope', 'Auth', '$location', 'fbutil', function($scope, Auth, $location, fbutil) {\n $scope.email = null;\n $scope.pass = null;\n $scope.confirm = null;\n $scope.createMode = false;\n\n // $scope.login = function(email, pass) {\n // $scope.err = null;\n // Auth.$authWithPassword({ email: email, password: pass }, {rememberMe: true})\n // .then(function(/* user */) {\n // $location.path('/account');\n // }, function(err) {\n // $scope.err = errMessage(err);\n // });\n // };\n \n $scope.googleLogin = function() {\n /*console.log('s', $scope); \n console.log('a', Auth); \n console.log('l', $location); \n console.log('f', fbutil);*/\n \n \n Auth.$authWithOAuthPopup(\"google\")\n .then(function(authData) {\n console.log(\"Logged in as:\", authData.uid);\n })\n .catch(function(error) {\n console.error(\"Authentication failed:\", error);\n });\n };\n\n // $scope.createAccount = function() {\n // $scope.err = null;\n // if( assertValidAccountProps() ) {\n // var email = $scope.email;\n // var pass = $scope.pass;\n // // create user credentials in Firebase auth system\n // Auth.$createUser({email: email, password: pass})\n // .then(function() {\n // // authenticate so we have permission to write to Firebase\n // return Auth.$authWithPassword({ email: email, password: pass });\n // })\n // .then(function(user) {\n // // create a user profile in our data store\n // var ref = fbutil.ref('users', user.uid);\n // return fbutil.handler(function(cb) {\n // ref.set({email: email, name: name||firstPartOfEmail(email)}, cb);\n // });\n // })\n // .then(function(/* user */) {\n // // redirect to the account page\n // $location.path('/account');\n // }, function(err) {\n // $scope.err = errMessage(err);\n // });\n // }\n // };\n\n function assertValidAccountProps() {\n if( !$scope.email ) {\n $scope.err = 'Please enter an email address';\n }\n else if( !$scope.pass || !$scope.confirm ) {\n $scope.err = 'Please enter a password';\n }\n else if( $scope.createMode && $scope.pass !== $scope.confirm ) {\n $scope.err = 'Passwords do not match';\n }\n return !$scope.err;\n }\n\n function errMessage(err) {\n return angular.isObject(err) && err.code? err.code : err + '';\n }\n\n function firstPartOfEmail(email) {\n return ucfirst(email.substr(0, email.indexOf('@'))||'');\n }\n\n function ucfirst (str) {\n // inspired by: http://kevin.vanzonneveld.net\n str += '';\n var f = str.charAt(0).toUpperCase();\n return f + str.substr(1);\n }\n }]);", "meta": {"content_hash": "7c44fbb8056731391188daa0ba1384ea", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 112, "avg_line_length": 32.350515463917525, "alnum_prop": 0.5274059910771192, "repo_name": "chilltemp/smartthings-dashboard", "id": "a23926b71c74f3c706e3d978f28e4216d68c5a5d", "size": "3138", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/login/login.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "21668"}, {"name": "HTML", "bytes": "15180"}, {"name": "JavaScript", "bytes": "34852"}]}} +{"text": "title: arg41\ntype: products\nimage: /img/Screen Shot 2017-05-09 at 11.56.54 AM.png\nheading: g41\ndescription: lksadjf lkasdjf lksajdf lksdaj flksadj flksa fdj\nmain:\n heading: Foo Bar BAz\n description: |-\n ***This is i a thing***kjh hjk kj \n # Blah Blah\n ## Blah\n ### Baah\n image1:\n alt: kkkk\n---\n", "meta": {"content_hash": "9504474a28142b510a69fc2a5c1da3c2", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 61, "avg_line_length": 22.333333333333332, "alnum_prop": 0.6656716417910448, "repo_name": "pblack/kaldi-hugo-cms-template", "id": "6ed8e6b8f1062e45f514a82947ed21ee3eb15641", "size": "339", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "site/content/pages2/arg41.md", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "94394"}, {"name": "HTML", "bytes": "18889"}, {"name": "JavaScript", "bytes": "10014"}]}} +{"text": "package org.ybiquitous.messages.generator;\n\nimport static org.apache.velocity.runtime.RuntimeConstants.RESOURCE_LOADER;\nimport static org.apache.velocity.runtime.RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS;\n\nimport java.net.URL;\nimport java.util.Properties;\n\nimport org.apache.velocity.runtime.log.NullLogChute;\nimport org.apache.velocity.runtime.log.SystemLogChute;\nimport org.apache.velocity.runtime.resource.loader.URLResourceLoader;\n\nfinal class VelocityConfig extends Properties {\n\n private static final long serialVersionUID = 1L;\n\n private static final boolean verbose = false;\n \n public VelocityConfig(URL url) {\n set(RESOURCE_LOADER, \"url\");\n set(\"url.resource.loader.class\", URLResourceLoader.class);\n set(\"url.resource.loader.root\", getParent(url));\n set(\"url.resource.loader.cache\", false);\n set(\"url.resource.loader.modificationCheckInterval\", 0);\n if (verbose) {\n set(RUNTIME_LOG_LOGSYSTEM_CLASS, SystemLogChute.class);\n set(SystemLogChute.RUNTIME_LOG_LEVEL_KEY, \"trace\");\n set(SystemLogChute.RUNTIME_LOG_SYSTEM_ERR_LEVEL_KEY, \"trace\");\n } else {\n set(RUNTIME_LOG_LOGSYSTEM_CLASS, NullLogChute.class);\n }\n }\n\n private String getParent(URL url) {\n String urlStr = url.toString();\n return urlStr.substring(0, urlStr.lastIndexOf('/'));\n }\n\n private void set(String key, Object value) {\n if (value instanceof String) {\n setProperty(key, (String) value);\n } else if (value instanceof Class<?>) {\n setProperty(key, ((Class<?>) value).getCanonicalName());\n } else {\n setProperty(key, value.toString());\n }\n }\n}\n", "meta": {"content_hash": "f8f93b6096686e4203d5b0f8b5b8e828", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 87, "avg_line_length": 35.854166666666664, "alnum_prop": 0.6717024985473562, "repo_name": "ybiquitous/messages", "id": "3bdfa40b433233dbd8ba507d82784ecaec132ee2", "size": "1721", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "messages-generator/src/main/java/org/ybiquitous/messages/generator/VelocityConfig.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "32560"}, {"name": "Scala", "bytes": "3937"}]}} +{"text": "extern \"C\"\n{\n#endif\n\nvoid sw_log_error_exit(const char *fmt, ...);\nvoid sw_log_error(const char *fmt, ...);\nvoid sw_log_warn(const char *fmt, ...);\nvoid sw_log_msg(const char *fmt, ...);\nvoid sw_log_debug(const char *fmt, ...);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n", "meta": {"content_hash": "9cf285d1910018de7ee794f299c446c5", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 45, "avg_line_length": 17.666666666666668, "alnum_prop": 0.630188679245283, "repo_name": "shuisheng918/libswevent", "id": "bd2122d2d0ab5b5b7c5eb9130484851ed71d6042", "size": "327", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sw_log.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "44833"}, {"name": "Makefile", "bytes": "752"}]}} +{"text": "<?php\n\n// FrontendBundle:Backup/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/controller:ControllerTest.php.twig\nreturn array (\n);\n", "meta": {"content_hash": "7923ef83baeee592ff513d0cf996565a", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 125, "avg_line_length": 30.2, "alnum_prop": 0.8211920529801324, "repo_name": "pacordovad/project3", "id": "b5ec82006a7a8c55f5a9f2a5a43f2df737d0f813", "size": "151", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/cache/prod/assetic/config/4/4bff9131d9cad393746ebb5baf0ce4ae.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "54067"}, {"name": "JavaScript", "bytes": "187690"}, {"name": "PHP", "bytes": "4727665"}]}} +{"text": "from __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('opendebates', '0021_submission_local_votes'),\n ]\n\n operations = [\n migrations.AddField(\n model_name='sitemode',\n name='announcement_body',\n field=models.TextField(null=True, blank=True),\n ),\n migrations.AddField(\n model_name='sitemode',\n name='announcement_headline',\n field=models.CharField(max_length=255, null=True, blank=True),\n ),\n migrations.AddField(\n model_name='sitemode',\n name='announcement_link',\n field=models.URLField(null=True, blank=True),\n ),\n ]\n", "meta": {"content_hash": "117690c8d837afc902b5fac88792d4bd", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 74, "avg_line_length": 27.428571428571427, "alnum_prop": 0.5807291666666666, "repo_name": "ejucovy/django-opendebates", "id": "977c17a3025a215065eac5d26a2a823c541a2395", "size": "792", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "opendebates/migrations/0022_auto_20160420_1423.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "35435"}, {"name": "HTML", "bytes": "53283"}, {"name": "JavaScript", "bytes": "18710"}, {"name": "Python", "bytes": "206230"}, {"name": "Shell", "bytes": "2040"}]}} +{"text": "<?xml version=\"1.0\"?>\n<package>\n <name>nord_stupid</name>\n <version>0.0.1</version>\n <description>Mission control</description>\n\n <maintainer email=\"bened@kth.se\">Magnus Thor Benediktsson</maintainer>\n <maintainer email=\"gsands@kth.se\">Gustav Sandstr\u00f6m</maintainer>\n <maintainer email=\"tolundi@kth.se\">Tobias Lundin</maintainer>\n <maintainer email=\"lucasas@kth.se\">Lucas \u00c5str\u00f6m</maintainer>\n\n <license>MIT</license>\n\n\n <url>https://github.com/Jinxit/nordic-robotics</url>\n\n\n <buildtool_depend>catkin</buildtool_depend>\n <build_depend>roscpp</build_depend>\n <build_depend>std_msgs</build_depend>\n <build_depend>nord_messages</build_depend>\n <build_depend>roslib</build_depend>\n <run_depend>roscpp</run_depend>\n <run_depend>std_msgs</run_depend>\n <run_depend>message_runtime</run_depend>\n <run_depend>nord_messages</run_depend>\n <run_depend>roslib</run_depend>\n\n\n <export>\n </export>\n</package>", "meta": {"content_hash": "93cd75054833a7779eaaf6edefd67de4", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 72, "avg_line_length": 28.53125, "alnum_prop": 0.723986856516977, "repo_name": "nordic-robotics/nord_stupid", "id": "548fb76ed972560815328eeef264d93a097fece8", "size": "916", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "package.xml", "mode": "33188", "license": "mit", "language": [{"name": "C++", "bytes": "23189"}]}} +{"text": "\ufeff// ReSharper disable All\n\nnamespace OpenTl.Schema\n{\n\tusing System;\n\tusing System.Collections;\n\tusing System.Text;\n\n\tusing OpenTl.Schema;\n\tusing OpenTl.Schema.Serialization.Attributes;\t\n\n\t[Serialize(0x6242c773)]\n\tpublic sealed class TFileHash : IFileHash\n\t{\n [SerializationOrder(0)]\n public int Offset {get; set;}\n\n [SerializationOrder(1)]\n public int Limit {get; set;}\n\n [SerializationOrder(2)]\n public byte[] Hash {get; set;}\n\n\t}\n}\n", "meta": {"content_hash": "7a1757851ed642d798470facd18d95c3", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 47, "avg_line_length": 18.8, "alnum_prop": 0.674468085106383, "repo_name": "OpenTl/OpenTl.Schema", "id": "43deafbaf5530fb456dae21690ada51f5f70b141", "size": "472", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/OpenTl.Schema/_generated/_Entities/FileHash/TFileHash.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "810786"}, {"name": "F#", "bytes": "19501"}, {"name": "PowerShell", "bytes": "1288"}]}} +{"text": "package com.eaw1805.data.managers.beans;\n\nimport com.eaw1805.data.model.Game;\nimport com.eaw1805.data.model.Nation;\nimport com.eaw1805.data.model.fleet.Ship;\nimport com.eaw1805.data.model.map.Position;\nimport com.eaw1805.data.model.map.Region;\nimport com.eaw1805.data.model.map.Sector;\n\nimport java.math.BigInteger;\nimport java.util.List;\nimport java.util.Map;\n\n/**\n * The interface of the ShipManagerBean.\n */\npublic interface ShipManagerBean extends EntityBean {\n\n /**\n * get the Ship from the database that corresponds to the input id.\n *\n * @param entityID the id of the Entity object.\n * @return an Entity object.\n */\n Ship getByID(int entityID);\n\n /**\n * adding a new entry into the database, according to the input object it\n * receives.\n *\n * @param value the Ship tha we want to add.\n */\n void add(final Ship value);\n\n /**\n * updating an entry into the database, according to the input object it\n * receives.\n *\n * @param value the Ship tha we want to update.\n */\n void update(final Ship value);\n\n /**\n * Delete the input Ship from the database.\n *\n * @param entity the Ship tha we want to delete\n */\n void delete(Ship entity);\n\n /**\n * Listing all the Ships from the database.\n *\n * @return a list of all the Ships that exist inside the table Avatar.\n */\n List<Ship> list();\n\n /**\n * Listing all the Ships from the database for the specific game.\n *\n * @param thisGame the game to select.\n * @return a list of all the Ships.\n */\n List<Ship> listByGame(final Game thisGame);\n\n /**\n * Listing all the Ships from the database members of the specific fleet.\n *\n * @param thisGame the game to select.\n * @param fleet the fleet to select.\n * @return a list of all the Ships.\n */\n List<Ship> listByFleet(final Game thisGame, final int fleet);\n\n /**\n * Listing all the Ships from the database at the specific position owned by the specific nation.\n *\n * @param thisPosition the position to select.\n * @param nation the nation to select.\n * @return a list of all the Ships.\n */\n List<Ship> listByPositionNation(final Position thisPosition, final Nation nation);\n\n /**\n * Listing all the ships from the database that belongs in the specific game and nation.\n *\n * @param thisGame The Game.\n * @param thisNation The Nation.\n * @return A list of all the Ships.\n */\n List<Ship> listGameNation(final Game thisGame, final Nation thisNation);\n\n /**\n * Listing all the Ships from the database at the specific position.\n *\n * @param thisGame the game to select.\n * @param nation the nation to select.\n * @param region the region to select.\n * @return a list of all the Ships.\n */\n List<Ship> listGameNationRegion(final Game thisGame, final Nation nation, final Region region);\n\n /**\n * List all ships in the specific position and game.\n *\n * @param position The position to list the ships that are on it.\n * @return A list of ships.\n */\n List<Ship> listByGamePosition(final Position position);\n\n /**\n * Listing all the free Ships from the database for a specific game.\n *\n * @param thisGame the game to select.\n * @return a list of all free Ships.\n */\n List<Ship> listFreeByGame(final Game thisGame);\n\n /**\n * Listing all the free Ships from the database owned by the specific nation..\n *\n * @param thisGame the game to select.\n * @param nation the nation to select.\n * @return a list of all free Ships.\n */\n List<Ship> listFreeByGameNation(final Game thisGame, final Nation nation);\n\n /**\n * Listing all the free Ships from the database owned by the specific nation..\n *\n * @param thisGame the game to select.\n * @param nation the nation to select.\n * @param region the region to select.\n * @return a list of all free Ships.\n */\n List<Ship> listFreeByGameNationRegion(final Game thisGame, final Nation nation, final Region region);\n\n /**\n * Listing sectors with ships belonging to more than 1 owner.\n *\n * @param thisGame the game to select.\n * @return a list of all the sectors.\n */\n List<Sector> listMultiOwners(final Game thisGame);\n\n /**\n * List all nations that have ships in the given position.\n *\n * @param thisPosition the position.\n * @return a list of nations.\n */\n List<Nation> listOwners(final Position thisPosition);\n\n /**\n * List the number of ships per sector for particular nation.\n *\n * @param thisGame the Game .\n * @param thisNation the Nation owner.\n * @return a mapping of ship count to sectors.\n */\n Map<Sector, BigInteger> countShips(final Game thisGame, final Nation thisNation);\n\n /**\n * Count the number of ships at the given position based on their owner.\n *\n * @param thisPosition the position.\n * @param onlyMerchant true, count only Merchant, false count only warships.\n * @return a mapping of ships count to nations.\n */\n Map<Nation, BigInteger> countShipsByOwner(final Position thisPosition, final boolean onlyMerchant);\n\n /**\n * Count the number of ships at the given position based on their owner.\n *\n * @param thisPosition the position.\n * @return a mapping of ships count to nations.\n */\n Map<Nation, BigInteger> countNearbyShipsByOwner(final Position thisPosition);\n\n /**\n * Remove all the flags signifying participation in a naval battle.\n *\n * @param thisGame the game to select.\n */\n void removeNavalFlag(final Game thisGame);\n\n /**\n * Remove all the flags signifying movement.\n *\n * @param thisGame the game to select.\n */\n void removeHasMovedFlag(final Game thisGame);\n\n /**\n * List all ships positioned at a given sector.\n *\n * @param position the position to check.\n * @return the list of ships.\n */\n List<Ship> listAllBySector(final Position position);\n}\n", "meta": {"content_hash": "c0346f5dd386d9c86a51cb43cd6521b8", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 105, "avg_line_length": 30.56, "alnum_prop": 0.6482329842931938, "repo_name": "EaW1805/data", "id": "8ca0f13b675be75ad137bc0a7be3a9dd9104431c", "size": "6112", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/eaw1805/data/managers/beans/ShipManagerBean.java", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "5407"}, {"name": "Java", "bytes": "1613914"}]}} +{"text": "import collections\n\nfrom supriya.ugens.PV_MagSquared import PV_MagSquared\n\n\nclass PV_MagNoise(PV_MagSquared):\n \"\"\"\n Multiplies magnitudes by noise.\n\n ::\n\n >>> pv_chain = supriya.ugens.FFT(\n ... source=supriya.ugens.WhiteNoise.ar(),\n ... )\n >>> pv_mag_noise = supriya.ugens.PV_MagNoise.new(\n ... pv_chain=pv_chain,\n ... )\n >>> pv_mag_noise\n PV_MagNoise.kr()\n\n \"\"\"\n\n ### CLASS VARIABLES ###\n\n _ordered_input_names = collections.OrderedDict([(\"pv_chain\", None)])\n", "meta": {"content_hash": "315b9f1b59e3af61cf70e175c42e6bf7", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 72, "avg_line_length": 22.0, "alnum_prop": 0.5527272727272727, "repo_name": "Pulgama/supriya", "id": "ecaa0ca5064dcf587b15d4d42ff500a5eb243506", "size": "550", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "supriya/ugens/PV_MagNoise.py", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "6712"}, {"name": "CSS", "bytes": "446"}, {"name": "HTML", "bytes": "1083"}, {"name": "JavaScript", "bytes": "6163"}, {"name": "Makefile", "bytes": "6775"}, {"name": "Python", "bytes": "2790612"}, {"name": "Shell", "bytes": "569"}]}} +{"text": "\ufeff//Copyright(c) 2001-2021 Aspose Pty Ltd.All rights reserved.\n//https://github.com/aspose-barcode/Aspose.BarCode-for-.NET\nusing System;\nusing System.Text;\nusing Aspose.BarCode.Generation;\nusing Aspose.BarCode.BarCodeRecognition;\n\nnamespace Aspose.BarCode.Examples.CSharp.BarcodeGeneration\n{\n internal class MacroPdf417Optional : TwoDBase\n {\n\t\tpublic static void Run()\n {\n string path = GetFolder();\r\n System.Console.WriteLine(\"MacroPdf417Optional:\");\r\n\n Console.OutputEncoding = Encoding.Unicode;\n BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.MacroPdf417, \"\u00c5sp\u00f3se.Barc\u00f3de\u00a9\");\n gen.Parameters.Barcode.XDimension.Pixels = 2;\n //set metadata\n gen.Parameters.Barcode.Pdf417.Pdf417MacroFileID = 12345678;\n gen.Parameters.Barcode.Pdf417.Pdf417MacroSegmentID = 12;\n gen.Parameters.Barcode.Pdf417.Pdf417MacroSegmentsCount = 20;\n gen.Parameters.Barcode.Pdf417.Pdf417MacroFileName = \"file01\";\n //checksumm must be calculated in CCITT-16 / CRC-16-CCITT encoding\n //https://en.wikipedia.org/wiki/Cyclic_redundancy_check#Polynomial_representations_of_cyclic_redundancy_checks\n //for the example we use random number\n gen.Parameters.Barcode.Pdf417.Pdf417MacroChecksum = 1234;\n gen.Parameters.Barcode.Pdf417.Pdf417MacroFileSize = 400000;\n gen.Parameters.Barcode.Pdf417.Pdf417MacroTimeStamp = new DateTime(2019, 11, 1);\n gen.Parameters.Barcode.Pdf417.Pdf417MacroAddressee = \"street\";\n gen.Parameters.Barcode.Pdf417.Pdf417MacroSender = \"aspose\";\n gen.Save($\"{path}MacroPdf417Optional.png\", BarCodeImageFormat.Png);\n //try to recognize it\n BarCodeReader read = new BarCodeReader(gen.GenerateBarCodeImage(), DecodeType.MacroPdf417);\n foreach (BarCodeResult result in read.ReadBarCodes())\n {\r\n Console.WriteLine(\"---MacroPdf417Optional---\");\n Console.WriteLine(\"Codetext:\" + result.CodeText);\n Console.WriteLine(\"Pdf417MacroFileID:\" + result.Extended.Pdf417.MacroPdf417FileID);\n Console.WriteLine(\"Pdf417MacroSegmentID:\" + result.Extended.Pdf417.MacroPdf417SegmentID.ToString());\n Console.WriteLine(\"Pdf417MacroSegmentsCount:\" + result.Extended.Pdf417.MacroPdf417SegmentsCount.ToString());\n Console.WriteLine(\"Pdf417MacroFileName:\" + result.Extended.Pdf417.MacroPdf417FileName);\n Console.WriteLine(\"Pdf417MacroChecksum:\" + result.Extended.Pdf417.MacroPdf417Checksum.ToString());\n Console.WriteLine(\"Pdf417MacroFileSize:\" + result.Extended.Pdf417.MacroPdf417FileSize.ToString());\n Console.WriteLine(\"Pdf417MacroTimeStamp:\" + result.Extended.Pdf417.MacroPdf417TimeStamp.ToString());\n Console.WriteLine(\"Pdf417MacroAddressee:\" + result.Extended.Pdf417.MacroPdf417Addressee);\n Console.WriteLine(\"Pdf417MacroSender:\" + result.Extended.Pdf417.MacroPdf417Sender);\n }\n }\n\t}\n}", "meta": {"content_hash": "20c438070c7fb027389f37469e474345", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 124, "avg_line_length": 59.75, "alnum_prop": 0.6861924686192469, "repo_name": "aspose-barcode/Aspose.BarCode-for-.NET", "id": "70049c30ee1911aba05a8d31c362f7f45b39770e", "size": "3113", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Examples/CSharp/BarcodeGeneration/Barcode2D/MacroPdf417Optional.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP.NET", "bytes": "2339"}, {"name": "C#", "bytes": "34258"}, {"name": "CSS", "bytes": "3794"}, {"name": "HTML", "bytes": "1778"}, {"name": "JavaScript", "bytes": "54709"}]}} +{"text": "\n\npackage com.sun.source.util;\n\nimport com.sun.source.tree.*;\n\n/**\n * A TreeVisitor that visits all the child tree nodes, and provides\n * support for maintaining a path for the parent nodes.\n * To visit nodes of a particular type, just override the\n * corresponding visitorXYZ method.\n * Inside your method, call super.visitXYZ to visit descendant\n * nodes.\n *\n * @author Jonathan Gibbons\n * @since 1.6\n */\n@jdk.Exported\npublic class TreePathScanner<R, P> extends TreeScanner<R, P> {\n\n /**\n * Scan a tree from a position identified by a TreePath.\n */\n public R scan(TreePath path, P p) {\n this.path = path;\n try {\n return path.getLeaf().accept(this, p);\n } finally {\n this.path = null;\n }\n }\n\n /**\n * Scan a single node.\n * The current path is updated for the duration of the scan.\n */\n @Override\n public R scan(Tree tree, P p) {\n if (tree == null)\n return null;\n\n TreePath prev = path;\n path = new TreePath(path, tree);\n try {\n return tree.accept(this, p);\n } finally {\n path = prev;\n }\n }\n\n /**\n * Get the current path for the node, as built up by the currently\n * active set of scan calls.\n */\n public TreePath getCurrentPath() {\n return path;\n }\n\n private TreePath path;\n}\n", "meta": {"content_hash": "04a789be713cee905401a4c9e6f0a149", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 70, "avg_line_length": 22.9, "alnum_prop": 0.5829694323144105, "repo_name": "rokn/Count_Words_2015", "id": "967bcfd809b61cd52d3e4b22e7f109650c0df7ed", "size": "2586", "binary": false, "copies": "38", "ref": "refs/heads/master", "path": "testing/openjdk2/langtools/src/share/classes/com/sun/source/util/TreePathScanner.java", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "61802"}, {"name": "Ruby", "bytes": "18888605"}]}} +{"text": "/*************************************************************************/\n/* path_3d.h */\n/*************************************************************************/\n/* This file is part of: */\n/* GODOT ENGINE */\n/* https://godotengine.org */\n/*************************************************************************/\n/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */\n/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */\n/* */\n/* Permission is hereby granted, free of charge, to any person obtaining */\n/* a copy of this software and associated documentation files (the */\n/* \"Software\"), to deal in the Software without restriction, including */\n/* without limitation the rights to use, copy, modify, merge, publish, */\n/* distribute, sublicense, and/or sell copies of the Software, and to */\n/* permit persons to whom the Software is furnished to do so, subject to */\n/* the following conditions: */\n/* */\n/* The above copyright notice and this permission notice shall be */\n/* included in all copies or substantial portions of the Software. */\n/* */\n/* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, */\n/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */\n/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/\n/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */\n/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */\n/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */\n/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */\n/*************************************************************************/\n\n#ifndef PATH_3D_H\n#define PATH_3D_H\n\n#include \"scene/3d/node_3d.h\"\n#include \"scene/resources/curve.h\"\n\nclass Path3D : public Node3D {\n\tGDCLASS(Path3D, Node3D);\n\n\tRef<Curve3D> curve;\n\n\tvoid _curve_changed();\n\n\tRID debug_instance;\n\tRef<ArrayMesh> debug_mesh;\n\nprivate:\n\tvoid _update_debug_mesh();\n\nprotected:\n\tvoid _notification(int p_what);\n\n\tstatic void _bind_methods();\n\npublic:\n\tvoid set_curve(const Ref<Curve3D> &p_curve);\n\tRef<Curve3D> get_curve() const;\n\n\tPath3D();\n\t~Path3D();\n};\n\nclass PathFollow3D : public Node3D {\n\tGDCLASS(PathFollow3D, Node3D);\n\npublic:\n\tenum RotationMode {\n\t\tROTATION_NONE,\n\t\tROTATION_Y,\n\t\tROTATION_XY,\n\t\tROTATION_XYZ,\n\t\tROTATION_ORIENTED\n\t};\n\nprivate:\n\tPath3D *path = nullptr;\n\treal_t prev_offset = 0.0; // Offset during the last _update_transform.\n\treal_t progress = 0.0;\n\treal_t h_offset = 0.0;\n\treal_t v_offset = 0.0;\n\tbool cubic = true;\n\tbool loop = true;\n\tRotationMode rotation_mode = ROTATION_XYZ;\n\n\tvoid _update_transform(bool p_update_xyz_rot = true);\n\nprotected:\n\tvoid _validate_property(PropertyInfo &p_property) const;\n\n\tvoid _notification(int p_what);\n\tstatic void _bind_methods();\n\npublic:\n\tvoid set_progress(real_t p_progress);\n\treal_t get_progress() const;\n\n\tvoid set_h_offset(real_t p_h_offset);\n\treal_t get_h_offset() const;\n\n\tvoid set_v_offset(real_t p_v_offset);\n\treal_t get_v_offset() const;\n\n\tvoid set_progress_ratio(real_t p_ratio);\n\treal_t get_progress_ratio() const;\n\n\tvoid set_loop(bool p_loop);\n\tbool has_loop() const;\n\n\tvoid set_rotation_mode(RotationMode p_rotation_mode);\n\tRotationMode get_rotation_mode() const;\n\n\tvoid set_cubic_interpolation(bool p_enable);\n\tbool get_cubic_interpolation() const;\n\n\tTypedArray<String> get_configuration_warnings() const override;\n\n\tPathFollow3D() {}\n};\n\nVARIANT_ENUM_CAST(PathFollow3D::RotationMode);\n\n#endif // PATH_3D_H\n", "meta": {"content_hash": "fd9b6c9c459cebf8040ade46276a1807", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 75, "avg_line_length": 32.959016393442624, "alnum_prop": 0.5630440189007709, "repo_name": "ZuBsPaCe/godot", "id": "45fa2c891748f274d08eb94861020759362ef0cb", "size": "4021", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "scene/3d/path_3d.h", "mode": "33188", "license": "mit", "language": [{"name": "AIDL", "bytes": "1633"}, {"name": "C", "bytes": "1045182"}, {"name": "C#", "bytes": "1605400"}, {"name": "C++", "bytes": "39214077"}, {"name": "CMake", "bytes": "606"}, {"name": "GAP", "bytes": "62"}, {"name": "GDScript", "bytes": "66163"}, {"name": "GLSL", "bytes": "830941"}, {"name": "Java", "bytes": "596106"}, {"name": "JavaScript", "bytes": "188456"}, {"name": "Kotlin", "bytes": "93069"}, {"name": "Makefile", "bytes": "1421"}, {"name": "Objective-C", "bytes": "20550"}, {"name": "Objective-C++", "bytes": "381709"}, {"name": "PowerShell", "bytes": "2713"}, {"name": "Python", "bytes": "461706"}, {"name": "Shell", "bytes": "32416"}]}} +{"text": "from django.test import TestCase\nfrom django.utils.timezone import get_current_timezone\n\nfrom app.utils import *\nfrom app.myblog.models import Article, Classification\n\n\nclass TestEncodeJson(TestCase):\n def test_ecnode(self):\n res = encodejson(1, {})\n self.assertIsInstance(res ,str)\n\n\nclass TestCreateRandom(TestCase):\n def test_create(self):\n res = create_random_str(10)\n self.assertEqual(len(res), 10)\n res = create_random_str(62)\n self.assertEqual(len(res), 62)\n res = create_random_str(63)\n self.assertEqual(res, 'too long str')\n\n def test_format(self):\n res = create_random_str(60)\n for itm in ['+', '-', '_', '=', '|', '!', '?', '`', '~', '@', '#', '$', '%', '^', '&', '*', '(', ')']:\n self.assertNotIn(itm, res)\n\n\nclass TestString2Datetime(TestCase):\n def test_convert(self):\n sample = '2011-1-1 19:25:01'\n res = string_to_datetime(sample)\n self.assertIsInstance(res, datetime.datetime)\n self.assertEqual(res.second, 1)\n self.assertEqual(res.minute, 25)\n self.assertEqual(res.hour, 19)\n self.assertEqual(res.day, 1)\n self.assertEqual(res.month, 1)\n self.assertEqual(res.year, 2011)\n\n def test_format(self):\n sample = '2015/1/1 23-12-11'\n format_str = '%Y/%m/%d %H-%M-%S'\n res = string_to_datetime(sample, format_str)\n self.assertIsInstance(res, datetime.datetime)\n\n\nclass TestDatetime2Timestamp(TestCase):\n def test_convert(self):\n sample = datetime.datetime.now()\n res = datetime_to_timestamp(sample)\n self.assertIsInstance(res, float)\n sample.replace(tzinfo=get_current_timezone())\n res = datetime_to_timestamp(sample)\n self.assertIsInstance(res, float)\n\n\nclass TestDatetime2String(TestCase):\n def test_convert(self):\n sample = string_to_datetime('2011-1-1 19:25:01')\n res = datetime_to_string(sample)\n self.assertEqual(res, '2011-01-01 19:25:01')\n sample.replace(tzinfo=get_current_timezone())\n res = datetime_to_string(sample)\n self.assertEqual(res, '2011-01-01 19:25:01')\n\n\nclass TestDatetime2UtcString(TestCase):\n def test_convert(self):\n sample = string_to_datetime('2011-1-1 19:25:01')\n res = datetime_to_utc_string(sample)\n self.assertEqual(res, '2011-01-01 19:25:01+08:00')\n\n\nclass TestModeSerializer(TestCase):\n def setUp(self):\n classify = Classification.objects.create(c_name='test')\n art = Article.objects.create(caption='article',\n sub_caption='sub_article',\n classification=classify,\n content='article test')\n art1 = Article.objects.create(caption='article1',\n sub_caption='sub_article',\n classification=classify,\n content='article test')\n\n def test_serializer(self):\n art = Article.objects.get(caption='article')\n serial = model_serializer(art)\n self.assertIsInstance(serial, dict)\n serial = model_serializer(art, serializer='json')\n self.assertIsInstance(serial, str)\n serial = model_serializer(art, serializer='xml')\n self.assertIn('xml version=\"1.0', serial)\n\n def test_serializer_list(self):\n art_list = Article.objects.all()\n serial = model_serializer(art_list)\n self.assertIsInstance(serial, list)\n serial = model_serializer(art_list, serializer='json')\n self.assertIsInstance(serial, str)\n\n def test_include(self):\n art = Article.objects.get(caption='article')\n serial = model_serializer(art, include_attr=['caption', 'content'])\n self.assertIn('caption', serial)\n self.assertNotIn('create_time', serial)\n\n def test_except(self):\n art = Article.objects.get(caption='article')\n serial = model_serializer(art, except_attr=['caption', 'content'])\n self.assertNotIn('caption', serial)\n self.assertIn('create_time', serial)\n\n def test_include_except(self):\n art = Article.objects.get(caption='article')\n serial = model_serializer(art, include_attr=['caption', 'content'], except_attr=['content'])\n self.assertIn('caption', serial)\n self.assertNotIn('content', serial)\n\n\nclass TestCreateVerifyPic(TestCase):\n def test_create(self):\n img, code = create_verify_code()\n self.assertIsInstance(img, str)\n self.assertIsInstance(code, str)\n", "meta": {"content_hash": "cca036fde1a653baec31b280e0478f0d", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 110, "avg_line_length": 36.26984126984127, "alnum_prop": 0.613129102844639, "repo_name": "madarou/angular-django", "id": "b7bc6922332a89a585b6ffbc09e0aa106a795778", "size": "4570", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tests/test_utils.py", "mode": "33261", "license": "bsd-2-clause", "language": [{"name": "CSS", "bytes": "356826"}, {"name": "HTML", "bytes": "77340"}, {"name": "Python", "bytes": "1816255"}]}} +{"text": "\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst wildemitter = require(\"wildemitter\");\r\nconst ApiBase_1 = require(\"../ApiBase\");\r\n/**\r\n * AgentPhone api implementation.\r\n */\r\nclass AgentPhone {\r\n /**\r\n * AgentPhone api implementation.\r\n *\r\n * @param {Object} agentPhoneOptions A collection of options.\r\n *\r\n * @example\r\n * options = {\r\n *\t\tdebug: true,\r\n * domainURIPath: \"https://api-a32.nice-incontact.com/inContactAPI\",\r\n * baseURIPath: \"/services/v15.0/\",\r\n * authorization: \"Bearer [Token Value]\",\r\n * timeout: 10000, // default is '0' (0 seconds timeout)\r\n * }\r\n */\r\n constructor(agentPhoneOptions) {\r\n this.agentPhoneOptions = agentPhoneOptions;\r\n // local.\r\n let self = this;\r\n let parent = agentPhoneOptions.parent;\r\n let uniqueID = \"Agent.AgentPhone.\";\r\n let item;\r\n let options = agentPhoneOptions || {};\r\n let config = this.config = {\r\n debug: false,\r\n domainURIPath: \"https://api-a32.nice-incontact.com/inContactAPI\",\r\n baseURIPath: \"/services/v15.0/\",\r\n authorization: \"Bearer [Token Value]\",\r\n timeout: 0\r\n };\r\n // Assign global.\r\n this.parent = parent;\r\n this.logger = parent.logger;\r\n this.uniqueID = uniqueID;\r\n // set our config from options\r\n for (item in options) {\r\n if (options.hasOwnProperty(item)) {\r\n this.config[item] = options[item];\r\n }\r\n }\r\n // Call WildEmitter constructor.\r\n wildemitter.mixin(AgentPhone);\r\n // Create the request instance.\r\n this.apirequest = new ApiBase_1.ApiRequest(this.config);\r\n }\r\n /**\r\n * Dial agent phone.\r\n *\r\n * @param {string} sessionId\t\tThe session id.\r\n * @param {Object} requestOptions A collection of request options.\r\n *\r\n * @example\r\n * options = {\r\n *\t\ttimeout: 10000, // default is '0' (0 seconds timeout),\r\n *\t\tcancelToken: new CancelToken(function (cancel) {}) // 'cancelToken' specifies a cancel token that can be used to cancel the request (see Cancellation section below for details)\r\n *\r\n *\t\t// 'params' are the URL parameters to be sent with the request\r\n *\t\t// Must be a plain object or a URLSearchParams object\r\n *\t\tparams: { ID: 12345 },\r\n *\r\n *\t\t// 'data' is the data to be sent as the request body.\r\n *\t\tdata: { ID: 'Unique' },\r\n * }\r\n */\r\n dialAgentPhoneAsync(sessionId, requestOptions) {\r\n // Create local refs.\r\n let localExecute = 'Dial agent phone';\r\n let localUniqueID = this.uniqueID + \"dialAgentPhoneAsync\";\r\n let localUrl = 'agent-sessions/' + sessionId + '/agent-phone/dial';\r\n let localTimeout = this.config.timeout;\r\n // Assign the request options.\r\n let options = requestOptions || {};\r\n let requestConfig = {\r\n url: localUrl,\r\n method: 'POST',\r\n baseURL: this.config.domainURIPath + this.config.baseURIPath,\r\n headers: {\r\n 'Authorization': this.config.authorization,\r\n 'Content-Type': 'application/json'\r\n },\r\n timeout: localTimeout\r\n };\r\n // Execute the request.\r\n this.apirequest.request(localExecute, localUniqueID, requestConfig, options);\r\n }\r\n /**\r\n * Mute agent phone.\r\n *\r\n * @param {string} sessionId\t\tThe session id.\r\n * @param {Object} requestOptions A collection of request options.\r\n *\r\n * @example\r\n * options = {\r\n *\t\ttimeout: 10000, // default is '0' (0 seconds timeout),\r\n *\t\tcancelToken: new CancelToken(function (cancel) {}) // 'cancelToken' specifies a cancel token that can be used to cancel the request (see Cancellation section below for details)\r\n *\r\n *\t\t// 'params' are the URL parameters to be sent with the request\r\n *\t\t// Must be a plain object or a URLSearchParams object\r\n *\t\tparams: { ID: 12345 },\r\n *\r\n *\t\t// 'data' is the data to be sent as the request body.\r\n *\t\tdata: { ID: 'Unique' },\r\n * }\r\n */\r\n muteAgentPhoneAsync(sessionId, requestOptions) {\r\n // Create local refs.\r\n let localExecute = 'Mute agent phone';\r\n let localUniqueID = this.uniqueID + \"muteAgentPhoneAsync\";\r\n let localUrl = 'agent-sessions/' + sessionId + '/agent-phone/mute';\r\n let localTimeout = this.config.timeout;\r\n // Assign the request options.\r\n let options = requestOptions || {};\r\n let requestConfig = {\r\n url: localUrl,\r\n method: 'POST',\r\n baseURL: this.config.domainURIPath + this.config.baseURIPath,\r\n headers: {\r\n 'Authorization': this.config.authorization,\r\n 'Content-Type': 'application/json'\r\n },\r\n timeout: localTimeout\r\n };\r\n // Execute the request.\r\n this.apirequest.request(localExecute, localUniqueID, requestConfig, options);\r\n }\r\n /**\r\n * Un-Mute agent phone.\r\n *\r\n * @param {string} sessionId\t\tThe session id.\r\n * @param {Object} requestOptions A collection of request options.\r\n *\r\n * @example\r\n * options = {\r\n *\t\ttimeout: 10000, // default is '0' (0 seconds timeout),\r\n *\t\tcancelToken: new CancelToken(function (cancel) {}) // 'cancelToken' specifies a cancel token that can be used to cancel the request (see Cancellation section below for details)\r\n *\r\n *\t\t// 'params' are the URL parameters to be sent with the request\r\n *\t\t// Must be a plain object or a URLSearchParams object\r\n *\t\tparams: { ID: 12345 },\r\n *\r\n *\t\t// 'data' is the data to be sent as the request body.\r\n *\t\tdata: { ID: 'Unique' },\r\n * }\r\n */\r\n unMuteAgentPhoneAsync(sessionId, requestOptions) {\r\n // Create local refs.\r\n let localExecute = 'Un-Mute agent phone';\r\n let localUniqueID = this.uniqueID + \"unMuteAgentPhoneAsync\";\r\n let localUrl = 'agent-sessions/' + sessionId + '/agent-phone/unmute';\r\n let localTimeout = this.config.timeout;\r\n // Assign the request options.\r\n let options = requestOptions || {};\r\n let requestConfig = {\r\n url: localUrl,\r\n method: 'POST',\r\n baseURL: this.config.domainURIPath + this.config.baseURIPath,\r\n headers: {\r\n 'Authorization': this.config.authorization,\r\n 'Content-Type': 'application/json'\r\n },\r\n timeout: localTimeout\r\n };\r\n // Execute the request.\r\n this.apirequest.request(localExecute, localUniqueID, requestConfig, options);\r\n }\r\n /**\r\n * Ends the agents phone call.\r\n *\r\n * @param {string} sessionId\t\tThe session id.\r\n * @param {Object} requestOptions A collection of request options.\r\n *\r\n * @example\r\n * options = {\r\n *\t\ttimeout: 10000, // default is '0' (0 seconds timeout),\r\n *\t\tcancelToken: new CancelToken(function (cancel) {}) // 'cancelToken' specifies a cancel token that can be used to cancel the request (see Cancellation section below for details)\r\n *\r\n *\t\t// 'params' are the URL parameters to be sent with the request\r\n *\t\t// Must be a plain object or a URLSearchParams object\r\n *\t\tparams: { ID: 12345 },\r\n *\r\n *\t\t// 'data' is the data to be sent as the request body.\r\n *\t\tdata: { ID: 'Unique' },\r\n * }\r\n */\r\n endAgentPhoneCallAsync(sessionId, requestOptions) {\r\n // Create local refs.\r\n let localExecute = 'Ends the agents phone call';\r\n let localUniqueID = this.uniqueID + \"endAgentPhoneCallAsync\";\r\n let localUrl = 'agent-sessions/' + sessionId + '/agent-phone/end';\r\n let localTimeout = this.config.timeout;\r\n // Assign the request options.\r\n let options = requestOptions || {};\r\n let requestConfig = {\r\n url: localUrl,\r\n method: 'POST',\r\n baseURL: this.config.domainURIPath + this.config.baseURIPath,\r\n headers: {\r\n 'Authorization': this.config.authorization,\r\n 'Content-Type': 'application/json'\r\n },\r\n timeout: localTimeout\r\n };\r\n // Execute the request.\r\n this.apirequest.request(localExecute, localUniqueID, requestConfig, options);\r\n }\r\n}\r\nexports.AgentPhone = AgentPhone;\r\n", "meta": {"content_hash": "6103e6536a1dbe5b22ea24e9fe6b8739", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 183, "avg_line_length": 39.55140186915888, "alnum_prop": 0.5763232514177694, "repo_name": "drazenzadravec/projects", "id": "5b7a1b9fff6fa8381d97dba3a6f9039029cb1d58", "size": "8464", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nice/sdk/lakenicejs/api/agent/agentphone.js", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "2754"}, {"name": "C", "bytes": "720"}, {"name": "C#", "bytes": "5049589"}, {"name": "C++", "bytes": "2005494"}, {"name": "CSS", "bytes": "19127"}, {"name": "HLSL", "bytes": "452"}, {"name": "HTML", "bytes": "90518"}, {"name": "JavaScript", "bytes": "8105941"}, {"name": "Shell", "bytes": "234"}, {"name": "TypeScript", "bytes": "1588858"}]}} +{"text": "use url::Url;\nuse toml;\n\nuse lsio::error::{Error, Result};\nuse lsio::config::{ConfigFile, ParseInto};\n\n/// Config by default is located at $HOME/.s3lsio/config for a given user. You can pass in an option\n/// on the cli ```-c \"<whatever path you want>\"``` and it will override the default.\n///\n/// If for some reason there is no config file and nothing is passed in the all of the\n/// fields will be None for Option values or whatever the defaults are for a given type.\n///\n///\n#[derive(Clone, Debug, PartialEq, Eq)]\npub struct Config {\n /// endpoint is in the format <scheme>://<fqdn>:<port>\n pub endpoint: Option<Url>,\n /// proxy is in the format <scheme>://<fqdn>:<port>\n pub proxy: Option<Url>,\n /// signature is either V2 or V4\n pub signature: String,\n}\n\nimpl ConfigFile for Config {\n type Error = Error;\n\n fn from_toml(toml: toml::Value) -> Result<Self> {\n let mut cfg = Config::default();\n\n try!(toml.parse_into(\"options.endpoint\", &mut cfg.endpoint));\n try!(toml.parse_into(\"options.proxy\", &mut cfg.proxy));\n try!(toml.parse_into(\"options.signature\", &mut cfg.signature));\n\n Ok(cfg)\n }\n}\n\nimpl Default for Config {\n fn default() -> Self {\n Config {\n endpoint: None,\n proxy: None,\n signature: \"V4\".to_string(),\n }\n }\n}\n\nimpl Config {\n pub fn set_endpoint(&mut self, value: Option<Url>) {\n self.endpoint = value;\n }\n\n pub fn set_proxy(&mut self, value: Option<Url>) {\n self.proxy = value;\n }\n\n pub fn set_signature(&mut self, value: String) {\n self.signature = value;\n }\n\n pub fn endpoint(&self) -> &Option<Url> {\n &self.endpoint\n }\n\n pub fn proxy(&self) -> &Option<Url> {\n &self.proxy\n }\n}\n", "meta": {"content_hash": "d3ea8ac83f81b03b397377c329a070b5", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 100, "avg_line_length": 26.13235294117647, "alnum_prop": 0.5981992121553179, "repo_name": "lambdastackio/s3lsio", "id": "86d5a0c2f90e21b877b685695cb76cde3941769c", "size": "2383", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/config.rs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "662"}, {"name": "Rust", "bytes": "198061"}, {"name": "Shell", "bytes": "6705"}]}} +{"text": "import React, { Component } from 'react';\nimport './App.css';\nimport Header from './components/header/header';\nimport Footer from './components/footer/footer';\nimport Acrylics from './components/acrylics/acrylics';\n\nclass App extends Component {\n render() {\n\n return (\n <div className=\"App\">\n <Header/>\n <Acrylics/>\n <Footer/>\n </div>\n );\n }\n}\n\nexport default App;\n", "meta": {"content_hash": "57485d01e9adc96300926dfc9d7e15dd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 54, "avg_line_length": 20.2, "alnum_prop": 0.6212871287128713, "repo_name": "bradyhouse/house", "id": "cd89fe6159834a1ec868b533e830d461e034b481", "size": "404", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fiddles/react/fiddle-0015-Portfolio/src/App.js", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "26015"}, {"name": "CSS", "bytes": "3541537"}, {"name": "HTML", "bytes": "3275889"}, {"name": "Handlebars", "bytes": "1593"}, {"name": "Java", "bytes": "90609"}, {"name": "JavaScript", "bytes": "9249816"}, {"name": "Less", "bytes": "3364"}, {"name": "PHP", "bytes": "125609"}, {"name": "Pug", "bytes": "1758"}, {"name": "Python", "bytes": "20858"}, {"name": "Ruby", "bytes": "11317"}, {"name": "SCSS", "bytes": "37673"}, {"name": "Shell", "bytes": "1095755"}, {"name": "TypeScript", "bytes": "779887"}]}} +{"text": "@interface AppDelegate () <UISplitViewControllerDelegate>\n\n@end\n\n@implementation AppDelegate\n\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n // Override point for customization after application launch.\n UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;\n UINavigationController *navigationController = [splitViewController.viewControllers lastObject];\n navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem;\n splitViewController.delegate = self;\n return YES;\n}\n\n- (void)applicationWillResignActive:(UIApplication *)application {\n // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.\n // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.\n}\n\n- (void)applicationDidEnterBackground:(UIApplication *)application {\n // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.\n // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.\n}\n\n- (void)applicationWillEnterForeground:(UIApplication *)application {\n // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.\n}\n\n- (void)applicationDidBecomeActive:(UIApplication *)application {\n // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.\n}\n\n- (void)applicationWillTerminate:(UIApplication *)application {\n // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.\n}\n\n#pragma mark - Split view\n\n- (BOOL)splitViewController:(UISplitViewController *)splitViewController collapseSecondaryViewController:(UIViewController *)secondaryViewController ontoPrimaryViewController:(UIViewController *)primaryViewController {\n if ([secondaryViewController isKindOfClass:[UINavigationController class]] && [[(UINavigationController *)secondaryViewController topViewController] isKindOfClass:[DetailViewController class]] && ([(DetailViewController *)[(UINavigationController *)secondaryViewController topViewController] detailItem] == nil)) {\n // Return YES to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded.\n return YES;\n } else {\n return NO;\n }\n}\n\n@end\n", "meta": {"content_hash": "860775067fb2a296bb2468dd3aeb795f", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 318, "avg_line_length": 60.58, "alnum_prop": 0.7949818421921426, "repo_name": "AmitaiB/TDD_PracticeProject", "id": "7908e8467cb39e00604f9bc55c953f3d32c7dc4b", "size": "3252", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AppDelegate.m", "mode": "33188", "license": "mit", "language": [{"name": "Objective-C", "bytes": "14973"}, {"name": "Ruby", "bytes": "386"}]}} +{"text": "class Solution < ActiveRecord::Base\n belongs_to :user; belongs_to :issue\nend\n", "meta": {"content_hash": "6281e6baa3e03aaeef53359e7b937495", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 37, "avg_line_length": 26.0, "alnum_prop": 0.7564102564102564, "repo_name": "dmc2015/securitypulse", "id": "f1d20fe7979c1f73ce0569fc6d4a847e58499428", "size": "78", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/solution.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "55583"}, {"name": "CoffeeScript", "bytes": "948"}, {"name": "HTML", "bytes": "21737"}, {"name": "JavaScript", "bytes": "729"}, {"name": "Ruby", "bytes": "55029"}]}} +{"text": "\ufeff/*Problem 9. Sorting array\r\n\r\nWrite a method that return the maximal element in a portion of array of integers starting at given index.\r\nUsing it write another method that sorts an array in ascending / descending order.*/\r\n\r\nusing System;\r\n\r\nclass Program\r\n{\r\n static void Main()\r\n {\r\n Console.Write(\"Enter array length n: \");\r\n int n = int.Parse(Console.ReadLine());\r\n\r\n Console.WriteLine(\"\\nEnter {0} number(s) to array:\", n);\r\n int[] array = InputArrayNumbers(n);\r\n\r\n Console.Write(\"Enter start index: \");\r\n int start = int.Parse(Console.ReadLine());\r\n\r\n Console.Write(\"Enter end index: \");\r\n int end = int.Parse(Console.ReadLine());\r\n\r\n Console.WriteLine(\"Max element in interval [{0}, {1}] -> {2}\", start, end, GetMaxElementInInterval(array, start, end));\r\n Console.WriteLine(\"Numbers in Ascending order: {0}\", string.Join(\" \", SortAscending(array)));\r\n Console.WriteLine(\"Numbers in Descending order: {0}\", string.Join(\" \", SortDescending(array)));\r\n }\r\n\r\n static int[] InputArrayNumbers(int length)\r\n {\r\n int[] array = new int[length];\r\n for (int i = 0; i < length; i++)\r\n {\r\n array[i] = int.Parse(Console.ReadLine());\r\n }\r\n return array;\r\n }\r\n\r\n static int GetMaxElementInInterval(int[] numbers, int start, int end, int swapIndex = 0)\r\n {\r\n if (start < 0 || start >= numbers.Length || end < 0 || end >= numbers.Length)\r\n {\r\n throw new IndexOutOfRangeException();\r\n }\r\n\r\n int maxIndex = start;\r\n\r\n for (int i = start; i <= end; i++)\r\n {\r\n if (numbers[maxIndex] < numbers[i])\r\n {\r\n maxIndex = i;\r\n }\r\n }\r\n\r\n int temp = numbers[swapIndex];\r\n numbers[swapIndex] = numbers[maxIndex];\r\n numbers[maxIndex] = temp;\r\n\r\n return numbers[swapIndex];\r\n }\r\n\r\n static int[] SortAscending(int[] array)\r\n {\r\n int[] sorted = new int[array.Length];\r\n for (int i = array.Length - 1; i >= 0; i--)\r\n {\r\n sorted[i] = GetMaxElementInInterval(array, 0, i, i);\r\n }\r\n return sorted;\r\n }\r\n\r\n static int[] SortDescending(int[] array)\r\n {\r\n int[] sorted = new int[array.Length];\r\n for (int i = 0; i < array.Length; i++)\r\n {\r\n sorted[i] = GetMaxElementInInterval(array, i, array.Length - 1, i);\r\n }\r\n return sorted;\r\n }\r\n}", "meta": {"content_hash": "5b5d2748c3e62d5e4a57434b6680eb96", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 127, "avg_line_length": 30.4390243902439, "alnum_prop": 0.5408653846153846, "repo_name": "MarinMarinov/C-Sharp-Part-2", "id": "df4f48a9d67b7bb0f65c342f6bf5a47b0c24807f", "size": "2498", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Homework 03-Methods/Problem 09. Sorting array/Program.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "269821"}]}} +{"text": "//\n// Copyright (c) 2010 Dariusz Gadomski <dgadomski@gmail.com>\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without modification,\n// are permitted provided that the following conditions are met:\n//\n// * Redistributions of source code must retain the above copyright notice, this\n// list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright notice,\n// this list of conditions and the following disclaimer in the documentation and/or\n// other materials provided with the distribution.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n\n#include <util.h>\n\n#include <ostream>\n\nnamespace debug\n{\n\nDebugLevel _verbosity_;\n\nstruct nullstream: std::ostream\n{\n nullstream() :\n std::ostream(0)\n {\n }\n};\n\nstd::ostream& dbg(DebugLevel level)\n{\n static nullstream dummystream;\n if (level >= getVerbosity())\n return std::cout;\n\n return dummystream;\n}\n\nint timeval_subtract(struct timeval *result, struct timeval *x,\n struct timeval *y)\n{\n /* Perform the carry for the later subtraction by updating y. */\n if (x->tv_usec < y->tv_usec)\n {\n int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;\n y->tv_usec -= 1000000 * nsec;\n y->tv_sec += nsec;\n }\n if (x->tv_usec - y->tv_usec > 1000000)\n {\n int nsec = (y->tv_usec - x->tv_usec) / 1000000;\n y->tv_usec += 1000000 * nsec;\n y->tv_sec -= nsec;\n }\n\n /* Compute the time remaining to wait.\n tv_usec is certainly positive. */\n result->tv_sec = x->tv_sec - y->tv_sec;\n result->tv_usec = x->tv_usec - y->tv_usec;\n\n /* Return 1 if result is negative. */\n return x->tv_sec < y->tv_sec;\n}\n\nint timeval_add(struct timeval *result, struct timeval *x,\n struct timeval *y)\n{\n struct timeval tmp;\n long carry = 0;\n tmp.tv_usec = x->tv_usec + y->tv_usec;\n if( tmp.tv_usec >= 1000000 )\n {\n ++carry;\n tmp.tv_usec %=1000000;\n }\n\n tmp.tv_sec = x->tv_sec + y->tv_sec + carry;\n\n result->tv_sec = tmp.tv_sec;\n result->tv_usec = tmp.tv_usec;\n\n return carry;\n}\n\n}\n", "meta": {"content_hash": "aa61923cace41118862354f7b8678c4e", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 83, "avg_line_length": 29.540816326530614, "alnum_prop": 0.6625215889464594, "repo_name": "dargad/network-traffic-prediction", "id": "3b83d5fb13872c1ed9fb5e4c272728737d7012f9", "size": "2895", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "models/src/util.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C++", "bytes": "168500"}, {"name": "Shell", "bytes": "2071"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>coquelicot: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.12.2 / coquelicot - 2.1.1</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n coquelicot\n <small>\n 2.1.1\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-04-22 09:36:58 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-04-22 09:36:58 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-threads base\nbase-unix base\nconf-findutils 1 Virtual package relying on findutils\ncoq 8.12.2 Formal proof management system\nnum 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.10.2 The OCaml compiler (virtual package)\nocaml-base-compiler 4.10.2 Official release 4.10.2\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.3 A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "guillaume.melquiond@inria.fr"\nhomepage: "http://coquelicot.saclay.inria.fr/"\ndev-repo: "git+https://gitlab.inria.fr/coquelicot/coquelicot.git"\nbug-reports: "https://gitlab.inria.fr/coquelicot/coquelicot/issues"\nlicense: "LGPL-3.0-or-later"\nbuild: [\n ["./configure"]\n ["./remake" "-j%{jobs}%"]\n]\ninstall: ["./remake" "install"]\ndepends: [\n "coq" {>= "8.4pl4" & < "8.6~"}\n "coq-mathcomp-ssreflect" {>= "1.6"}\n]\ntags: [ "keyword:real analysis" "keyword:topology" "keyword:filters" "keyword:metric spaces" "category:Mathematics/Real Calculus and Topology" ]\nauthors: [ "Sylvie Boldo <sylvie.boldo@inria.fr>" "Catherine Lelay <catherine.lelay@inria.fr>" "Guillaume Melquiond <guillaume.melquiond@inria.fr>" ]\nsynopsis: "A Coq formalization of real analysis compatible with the standard library"\nurl {\n src: "https://coquelicot.gitlabpages.inria.fr/releases/coquelicot-2.1.1.tar.gz"\n checksum: "md5=bd648a43a06f422ee6ba886f93d0a534"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-coquelicot.2.1.1 coq.8.12.2</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.12.2).\nThe following dependencies couldn't be met:\n - coq-coquelicot -> coq < 8.6~ -> ocaml < 4.06.0\n base of this switch (use `--unlock-base' to force)\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-coquelicot.2.1.1</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "c5add0dcdac23f8c79d5cc038477de2c", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 197, "avg_line_length": 42.56875, "alnum_prop": 0.5420643077374835, "repo_name": "coq-bench/coq-bench.github.io", "id": "36d1231805ffb5a1cdfdb73232cf32e7a9ebcb46", "size": "6836", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.10.2-2.0.6/released/8.12.2/coquelicot/2.1.1.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>canon-bdds: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.7.1+1 / canon-bdds - 8.10.0</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n canon-bdds\n <small>\n 8.10.0\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-04-02 17:44:00 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-04-02 17:44:00 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-threads base\nbase-unix base\ncamlp5 7.14 Preprocessor-pretty-printer of OCaml\nconf-findutils 1 Virtual package relying on findutils\nconf-perl 2 Virtual package relying on perl\ncoq 8.7.1+1 Formal proof management system\nnum 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.06.1 The OCaml compiler (virtual package)\nocaml-base-compiler 4.06.1 Official 4.06.1 release\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.3 A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/canon-bdds"\nlicense: "Unknown"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/CanonBDDs"]\ndepends: [\n "ocaml"\n "coq" {>= "8.10" & < "8.11~"}\n]\ntags: [\n "keyword: BDD"\n "keyword: BDT"\n "keyword: finite sets"\n "keyword: model checking"\n "keyword: binary decision diagrams"\n "category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures"\n "category: Miscellaneous/Extracted Programs/Decision procedures"\n]\nauthors: [\n "Emmanuel Ledinot"\n]\nbug-reports: "https://github.com/coq-contribs/canon-bdds/issues"\ndev-repo: "git+https://github.com/coq-contribs/canon-bdds.git"\nsynopsis: "Canonicity of Binary Decision Dags"\ndescription: """\nA proof of unicity and canonicity of Binary Decision Trees and\nBinary Decision Dags. This contrib contains also a development on finite sets."""\nflags: light-uninstall\nurl {\n src: "https://github.com/coq-contribs/canon-bdds/archive/v8.10.0.tar.gz"\n checksum: "md5=d23b9b74b3a8af434c1e1907d24c4a9d"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-canon-bdds.8.10.0 coq.8.7.1+1</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+1).\nThe following dependencies couldn't be met:\n - coq-canon-bdds -> coq >= 8.10\nYour request can't be satisfied:\n - No available version of coq satisfies the constraints\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-canon-bdds.8.10.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "7d3275022dcd9d6f2f9072c2b4235857", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 159, "avg_line_length": 40.65714285714286, "alnum_prop": 0.5498243148278286, "repo_name": "coq-bench/coq-bench.github.io", "id": "697add0f6d53a94f193a693766161358df0ffcaa", "size": "7140", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.7.1+1/canon-bdds/8.10.0.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "package eu.restio.designernews.fragments;\n\nimport android.os.AsyncTask;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\n\n\nimport com.google.gson.Gson;\nimport com.google.gson.reflect.TypeToken;\n\nimport java.lang.reflect.Type;\nimport java.util.ArrayList;\n\nimport eu.restio.designernews.adapters.JobsListViewAdapter;\nimport eu.restio.designernews.MainActivity;\nimport eu.restio.designernews.R;\nimport eu.restio.designernews.models.Job;\nimport eu.restio.designernews.network.API;\n\npublic class JobsFragment extends android.support.v4.app.ListFragment {\n\n public ArrayList<Job> jobs_list;\n private JobsListViewAdapter adapter;\n\n public static JobsFragment newInstance() {\n return new JobsFragment();\n }\n public JobsFragment() {\n }\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n }\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_jobs, container, false);\n adapter = new JobsListViewAdapter(getActivity(), jobs_list);\n setListAdapter(adapter);\n new JobsFetcher().execute();\n return rootView;\n }\n\n class JobsFetcher extends AsyncTask<Void, Void, String> {\n\n @Override\n protected String doInBackground(Void... params) {\n API a = API.getInstance();\n return a.prefetch_jobs();\n }\n\n @Override\n protected void onPostExecute(String result) {\n try {\n if (result == null) {\n MainActivity a = (MainActivity) getActivity();\n a.raiseNetworkError();\n }\n\n Gson gson = new Gson();\n Type listType = new TypeToken<ArrayList<Job>>() {}.getType();\n\n jobs_list = gson.fromJson(result, listType);\n adapter.addAll(jobs_list);\n adapter.notifyDataSetChanged();\n\n } catch (NullPointerException e) {\n e.printStackTrace();\n }\n }\n }\n\n}\n", "meta": {"content_hash": "6f23c703df38a20439c22d7cf50f4f02", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 83, "avg_line_length": 28.792207792207794, "alnum_prop": 0.6377988272440235, "repo_name": "sharpfuryz/designernews", "id": "58670b8a8dc2c6e97c2fdf993f7be52dfdb1e952", "size": "2217", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/eu/restio/designernews/fragments/JobsFragment.java", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Java", "bytes": "40379"}]}} +{"text": "package com.zen.member;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.data.domain.Page;\nimport org.springframework.data.domain.Pageable;\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class MemberService {\n\n @Autowired\n private MemberDAO memberDAO;\n\n public Member findByMobile(final String mobile) {\n return memberDAO.selectByMobile(mobile);\n }\n\n public Member findByEmail(final String mobile) {\n return memberDAO.selectByEmail(mobile);\n }\n\n public Page<Member> findAll(final Pageable pageable) {\n return memberDAO.findAll(pageable);\n }\n\n\n}\n", "meta": {"content_hash": "9ea1c4cfe31e048a2fb01045eaeb85cf", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 62, "avg_line_length": 23.0, "alnum_prop": 0.7793880837359098, "repo_name": "nickevin/spring-boot-demo", "id": "90f8e2320383055988b3c35db7e733ac202fdaff", "size": "621", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/zen/member/MemberService.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "18548"}, {"name": "JavaScript", "bytes": "1179"}]}} +{"text": "(function() {\n 'use strict';\n\n angular\n .module('gastronomeeApp')\n .config(stateConfig);\n\n stateConfig.$inject = ['$stateProvider'];\n\n function stateConfig($stateProvider) {\n $stateProvider\n .state('restaurant-order', {\n parent: 'entity',\n url: '/restaurant-order?page&sort&search',\n data: {\n authorities: ['ROLE_USER'],\n pageTitle: 'gastronomeeApp.restaurantOrder.home.title'\n },\n views: {\n 'content@': {\n templateUrl: 'app/entities/restaurant-order/restaurant-orders.html',\n controller: 'RestaurantOrderController',\n controllerAs: 'vm'\n }\n },\n params: {\n page: {\n value: '1',\n squash: true\n },\n sort: {\n value: 'id,asc',\n squash: true\n },\n search: null\n },\n resolve: {\n pagingParams: ['$stateParams', 'PaginationUtil', function ($stateParams, PaginationUtil) {\n return {\n page: PaginationUtil.parsePage($stateParams.page),\n sort: $stateParams.sort,\n predicate: PaginationUtil.parsePredicate($stateParams.sort),\n ascending: PaginationUtil.parseAscending($stateParams.sort),\n search: $stateParams.search\n };\n }],\n translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) {\n $translatePartialLoader.addPart('restaurantOrder');\n $translatePartialLoader.addPart('restaurantOrderStatus');\n $translatePartialLoader.addPart('global');\n return $translate.refresh();\n }]\n }\n })\n .state('restaurant-order-detail', {\n parent: 'restaurant-order',\n url: '/restaurant-order/{id}',\n data: {\n authorities: ['ROLE_USER'],\n pageTitle: 'gastronomeeApp.restaurantOrder.detail.title'\n },\n views: {\n 'content@': {\n templateUrl: 'app/entities/restaurant-order/restaurant-order-detail.html',\n controller: 'RestaurantOrderDetailController',\n controllerAs: 'vm'\n }\n },\n resolve: {\n translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) {\n $translatePartialLoader.addPart('restaurantOrder');\n $translatePartialLoader.addPart('restaurantOrderStatus');\n return $translate.refresh();\n }],\n entity: ['$stateParams', 'RestaurantOrder', function($stateParams, RestaurantOrder) {\n return RestaurantOrder.get({id : $stateParams.id}).$promise;\n }],\n previousState: [\"$state\", function ($state) {\n var currentStateData = {\n name: $state.current.name || 'restaurant-order',\n params: $state.params,\n url: $state.href($state.current.name, $state.params)\n };\n return currentStateData;\n }]\n }\n })\n .state('restaurant-order-detail.edit', {\n parent: 'restaurant-order-detail',\n url: '/detail/edit',\n data: {\n authorities: ['ROLE_USER']\n },\n onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {\n $uibModal.open({\n templateUrl: 'app/entities/restaurant-order/restaurant-order-dialog.html',\n controller: 'RestaurantOrderDialogController',\n controllerAs: 'vm',\n backdrop: 'static',\n size: 'lg',\n resolve: {\n entity: ['RestaurantOrder', function(RestaurantOrder) {\n return RestaurantOrder.get({id : $stateParams.id}).$promise;\n }]\n }\n }).result.then(function() {\n $state.go('^', {}, { reload: false });\n }, function() {\n $state.go('^');\n });\n }]\n })\n .state('restaurant-order.new', {\n parent: 'restaurant-order',\n url: '/new',\n data: {\n authorities: ['ROLE_USER']\n },\n onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {\n $uibModal.open({\n templateUrl: 'app/entities/restaurant-order/restaurant-order-dialog.html',\n controller: 'RestaurantOrderDialogController',\n controllerAs: 'vm',\n backdrop: 'static',\n size: 'lg',\n resolve: {\n entity: function () {\n return {\n rate: null,\n persons: null,\n comment: null,\n created: null,\n updated: null,\n status: null,\n id: null\n };\n }\n }\n }).result.then(function() {\n $state.go('restaurant-order', null, { reload: 'restaurant-order' });\n }, function() {\n $state.go('restaurant-order');\n });\n }]\n })\n .state('restaurant-order.edit', {\n parent: 'restaurant-order',\n url: '/{id}/edit',\n data: {\n authorities: ['ROLE_USER']\n },\n onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {\n $uibModal.open({\n templateUrl: 'app/entities/restaurant-order/restaurant-order-dialog.html',\n controller: 'RestaurantOrderDialogController',\n controllerAs: 'vm',\n backdrop: 'static',\n size: 'lg',\n resolve: {\n entity: ['RestaurantOrder', function(RestaurantOrder) {\n return RestaurantOrder.get({id : $stateParams.id}).$promise;\n }]\n }\n }).result.then(function() {\n $state.go('restaurant-order', null, { reload: 'restaurant-order' });\n }, function() {\n $state.go('^');\n });\n }]\n })\n .state('restaurant-order.delete', {\n parent: 'restaurant-order',\n url: '/{id}/delete',\n data: {\n authorities: ['ROLE_USER']\n },\n onEnter: ['$stateParams', '$state', '$uibModal', function($stateParams, $state, $uibModal) {\n $uibModal.open({\n templateUrl: 'app/entities/restaurant-order/restaurant-order-delete-dialog.html',\n controller: 'RestaurantOrderDeleteController',\n controllerAs: 'vm',\n size: 'md',\n resolve: {\n entity: ['RestaurantOrder', function(RestaurantOrder) {\n return RestaurantOrder.get({id : $stateParams.id}).$promise;\n }]\n }\n }).result.then(function() {\n $state.go('restaurant-order', null, { reload: 'restaurant-order' });\n }, function() {\n $state.go('^');\n });\n }]\n });\n }\n\n})();\n", "meta": {"content_hash": "e80b46e8ca42bdadfa014dff3d58b68f", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 130, "avg_line_length": 41.796954314720814, "alnum_prop": 0.43429681807141124, "repo_name": "goxhaj/gastronomee", "id": "2b018b0e846135d1153ad6ce6fe60c2004f2112d", "size": "8234", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/webapp/app/entities/restaurant-order/restaurant-order.state.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "5006"}, {"name": "CSS", "bytes": "10726"}, {"name": "Gherkin", "bytes": "179"}, {"name": "HTML", "bytes": "289485"}, {"name": "Java", "bytes": "600452"}, {"name": "JavaScript", "bytes": "429624"}, {"name": "Scala", "bytes": "37498"}, {"name": "Shell", "bytes": "7058"}]}} +{"text": "Chat application\n================\n\nRed5 WebSocket chat application example.\n\nThe example <i>index.html</i> defaults to using a WebSocket connection to localhost on port 5080. This means that the host and port are riding the same host and port as the http connector which is configured in the <i>red5/conf/jee-container.xml</i> file. Two new steps are required to migrate from the previous versions:\n\n # Add the `websocketEnabled` to the Tomcat server entry in the `conf/jee-container.xml` file\n \n```xml\n <property name=\"websocketEnabled\" value=\"true\" />\n```\n\n # Add the WebSocket filter servlet to webapps that require WebSocket support\n \n```xml\n <filter>\n <filter-name>WebSocketFilter</filter-name>\n <filter-class>org.red5.net.websocket.server.WsFilter</filter-class>\n <async-supported>true</async-supported>\n </filter>\n <filter-mapping>\n <filter-name>WebSocketFilter</filter-name>\n <url-pattern>/*</url-pattern>\n <dispatcher>REQUEST</dispatcher>\n <dispatcher>FORWARD</dispatcher>\n </filter-mapping>\n```\n\nLastly, remove any separate `webSocketTransport` beans from the `conf/jee-container.xml` file.\n\n```xml\n<bean id=\"webSocketTransport\" class=\"org.red5.net.websocket.WebSocketTransport\">\n <property name=\"addresses\">\n <list>\n <value>localhost:8081</value>\n </list>\n </property>\n</bean>\n```\n\nBuild the application from the command line with\n\n```sh\nmvn package\n```\n\nDeploy your application by copying the war file into your <i>red5/webapps</i> directory.\n\nAfter deploy is complete, go to http://localhost:5080/chat/ in your browser (open two tabs if you want to chat back and forth on the same computer).\n\nPre-compiled WAR\n----------------\nYou can find [compiled artifacts via Maven](http://mvnrepository.com/artifact/org.red5.demos/chat)\n\n[Direct Download](https://oss.sonatype.org/content/repositories/releases/org/red5/demos/chat/2.0.0/chat-2.0.0.war)\n", "meta": {"content_hash": "982c0e040e30a458343908d729c90fa0", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 321, "avg_line_length": 35.660714285714285, "alnum_prop": 0.6910365548322484, "repo_name": "Red5/red5-websocket-chat", "id": "ca4b601a5f3c024338a7d5c7701bb69631dfac53", "size": "1997", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "7758"}, {"name": "Java", "bytes": "14250"}, {"name": "JavaScript", "bytes": "26351"}]}} +{"text": "require \"droom/monkeys\"\nrequire \"droom/lazy_hash\"\nrequire \"droom/renderers\"\nrequire \"droom/engine\"\nrequire \"droom/auth_cookie\"\nrequire \"droom/validators\"\nrequire \"droom/searchability\"\nrequire \"droom/taggability\"\nrequire \"droom/folders\"\nrequire \"mail_form\"\n\nmodule Droom \n # Droom configuration is handled by accessors on the Droom base module.\n # Boolean items also offer the interrogative form.\n \n mattr_accessor :root_path,\n :home_url,\n :suggestible_classes,\n :searchable_classes,\n :yt_client,\n :layout,\n :devise_layout,\n :email_layout,\n :email_host,\n :email_from,\n :email_from_name,\n :email_return_path,\n :main_dashboard_modules,\n :margin_dashboard_modules,\n :panels,\n :scrap_types,\n :default_scrap_type,\n :use_chinese_names,\n :use_biogs,\n :use_separate_mobile_number,\n :use_titles,\n :use_honours,\n :use_organisations,\n :enable_mailing_lists,\n :mailman_table_name,\n :mailing_lists_active_by_default,\n :mailing_lists_digest_by_default,\n :show_venue_map,\n :dropbox_app_key,\n :dropbox_app_secret,\n :dropbox_app_name,\n :user_defaults,\n :people_sort,\n :required_calendar_names,\n :stream_shared,\n :aws_bucket_name,\n :all_events_public,\n :all_documents_public,\n :password_pattern,\n :separate_calendars,\n :second_time_zone,\n :require_login_permission,\n :default_permissions\n \n class DroomError < StandardError; end\n class AuthRequired < DroomError; end\n class PermissionDenied < DroomError; end\n class PasswordRequired < DroomError; end\n\n class << self\n def home_url\n @@home_url ||= \"http://example.com\"\n end\n \n def layout\n @@layout ||= \"application\"\n end\n\n def devise_layout\n @@devise_layout ||= \"application\"\n end\n\n def email_host\n @@email_host ||= \"please-change-email-host-in-droom-initializer.example.com\"\n end\n\n def email_layout\n @@email_layout ||= \"email\"\n end\n\n def email_from\n @@email_from ||= \"please-change-email_from-in-droom-initializer@example.com\"\n end\n\n def email_from_name\n @@email_from ||= \"Please Set Email-From Name In Droom Initializer\"\n end\n\n def email_return_path\n @@email_return_path ||= email_from\n end\n\n def people_sort\n @@people_sort ||= \"position ASC\"\n end\n\n def sign_out_path\n @@sign_out_path ||= \"/users/sign_out\"\n end\n\n def root_path\n @@root_path ||= \"dashboard#index\"\n end\n\n def main_dashboard_modules\n @@main_dashboard_modules ||= %w{my_future_events my_folders}\n end\n\n def margin_dashboard_modules\n @@margin_dashboard_modules ||= %w{quicksearch stream}\n end\n \n def panels\n @@panels ||= %w{configuration search admin}\n end\n \n def scrap_types\n @@scrap_types ||= %w{image text quote link event document}\n end\n \n def default_scrap_type\n @@default_scrap_type ||= 'text'\n end\n\n def use_chinese_names?\n !!@@use_chinese_names\n end\n\n def use_titles?\n !!@@use_titles\n end\n \n def use_honours?\n !!@@use_honours\n end\n \n def use_biogs?\n !!@@use_biogs\n end\n \n def use_organisations?\n !!@@use_organisations\n end\n\n def stream_shared?\n !!@@stream_shared\n end\n\n def use_separate_mobile_number?\n !!@@use_separate_mobile_number\n end\n\n def enable_mailing_lists?\n !!@@enable_mailing_lists\n end\n\n def calendar_closed?\n !!@@calendar_closed\n end\n \n def all_events_public?\n !!@@all_events_public\n end\n \n def all_documents_public?\n !!@@all_documents_public\n end\n\n def dropbox_app_name\n @@dropbox_app_name ||= 'droom'\n end\n\n def mailman_table_name\n @@mailman_table_name ||= 'mailman_mysql'\n end\n\n def mailing_lists_active_by_default?\n !!@@mailing_lists_active_by_default\n end\n\n def mailing_lists_digest_by_default?\n !!@@mailing_lists_digest_by_default\n end\n\n def show_venue_map?\n !!@@show_venue_map\n end\n\n def suggestible_classes\n @@suggestible_classes ||= {\n \"event\" => \"Droom::Event\", \n \"user\" => \"Droom::User\", \n \"document\" => \"Droom::Document\",\n \"group\" => \"Droom::Group\",\n \"venue\" => \"Droom::Venue\"\n }\n end\n\n def add_suggestible_class(label, klass=nil)\n klass ||= label.camelize\n suggestible_classes[label] = klass.to_s\n end\n\n def yt_client\n @@yt_client ||= YouTubeIt::Client.new(:dev_key => \"AI39si473p0K4e6id0ZrM1vniyk8pdbqr67hH39hyFjW_JQoLg9xi6BecWFtraoPMCeYQmRgIc_XudGKVU8tmeQF8VHwjOUg8Q\")\n end\n\n def aws_bucket_name\n @@aws_bucket_name ||= nil\n end\n\n def aws_bucket\n @@aws_bucket ||= Fog::Storage.new(Droom::Engine.config.paperclip_defaults[:fog_credentials]).directories.get(@@aws_bucket_name)\n end\n\n def required_calendar_names\n @@required_calendar_names ||= %w{main stream}\n end\n \n def separate_calendars?\n !!@@separate_calendars\n end\n \n def second_time_zone?\n !!@@second_time_zone\n end\n \n def password_pattern\n @@password_pattern ||= \".{6,}\"\n end\n \n def require_login_permission?\n !!@@require_login_permission\n end\n \n def default_permissions\n @@default_permissions ||= %w{droom.login droom.calendar droom.directory droom.attach droom.library}\n end\n \n \n # Droom's preferences are arbitrary and open-ended. You can ask for any preference key: if it \n # doesn't exist you just get back the default value, or nil if there isn't one. This is where you\n # set the defaults.\n #\n def user_defaults\n @@user_defaults ||= Droom::LazyHash.new({\n :email => {\n :enabled? => true,\n :mailing_lists? => true,\n :event_invitations? => false,\n :digest? => false\n },\n :dropbox => {\n :strategy => \"clicked\",\n :events? => true,\n }\n })\n end\n \n # Here we are overriding droom default settings in a host app initializer to create local default settings.\n # key should be dot-separated and string-like:\n #\n # Droom.set_default('email.digest', true)\n #\n # LazyHash#deep_set is a setter that can take compound keys and set nested values. It's defined in lib/lazy_hash.rb.\n #\n def set_user_default(key, value)\n user_defaults.set(key, value)\n end\n \n def user_default(key)\n user_defaults.get(key)\n end\n end\nend\n", "meta": {"content_hash": "e959be05e562e0154d8984796f72034f", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 157, "avg_line_length": 25.014285714285716, "alnum_prop": 0.5646773272415763, "repo_name": "spanner/droom", "id": "9c97f646c42c061d7cbc7dfa1e9d363be006a867", "size": "7004", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/droom.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "55911"}, {"name": "CoffeeScript", "bytes": "86057"}, {"name": "Gherkin", "bytes": "1699"}, {"name": "HTML", "bytes": "127765"}, {"name": "JavaScript", "bytes": "514603"}, {"name": "Roff", "bytes": "16257"}, {"name": "Ruby", "bytes": "289814"}]}} +{"text": "\n\n\n@class APElement;\n\n\n@interface APDocument : NSObject {\n\tAPElement *rootElement;\n}\n\n+ (id)documentWithXMLString:(NSString*)anXMLString;\n- (id)initWithRootElement:(APElement*)aRootElement;\n- (id)initWithString:(NSString*)anXMLString;\n- (APElement*)rootElement;\n- (NSString*)prettyXML;\n- (NSString*)xml;\n\n@end\n", "meta": {"content_hash": "8bb022073d48509c338b43c03b82117e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 51, "avg_line_length": 17.22222222222222, "alnum_prop": 0.7451612903225806, "repo_name": "lechium/yourTubeiOS", "id": "7dc317fe0d4d05cdf525609048c1ec75a2f6331a", "size": "1094", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "yourTube/APDocument/APDocument.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "841"}, {"name": "C++", "bytes": "13317"}, {"name": "CSS", "bytes": "3351"}, {"name": "HTML", "bytes": "7938"}, {"name": "JavaScript", "bytes": "44689"}, {"name": "Logos", "bytes": "3192"}, {"name": "Makefile", "bytes": "139947"}, {"name": "Objective-C", "bytes": "2765772"}, {"name": "Objective-C++", "bytes": "68419"}, {"name": "Perl", "bytes": "141095"}, {"name": "Perl 6", "bytes": "911"}, {"name": "Shell", "bytes": "3821"}, {"name": "Vim script", "bytes": "3569"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"vertical\">\n\n <!--<ProgressBar-->\n <!--android:layout_width=\"100dp\"-->\n <!--android:layout_gravity=\"center\"-->\n <!--android:indeterminate=\"true\"-->\n <!--style=\"?android:attr/progressBarStyleHorizontal\"-->\n <!--android:layout_height=\"100dp\" />-->\n <ProgressBar\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center\"\n style=\"?android:attr/progressBarStyle\"\n />\n</FrameLayout>", "meta": {"content_hash": "f842c2afab7c849d910b967669952bc7", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 71, "avg_line_length": 38.10526315789474, "alnum_prop": 0.6284530386740331, "repo_name": "jaychang0917/android.nRecyclerView", "id": "1eae583b24e5143124108c120da280adca032ee2", "size": "724", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/cell_loading.xml", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "//\n// Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l'impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.7 \n// Voir <a href=\"http://java.sun.com/xml/jaxb\">http://java.sun.com/xml/jaxb</a> \n// Toute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \n// G\u00e9n\u00e9r\u00e9 le : 2018.01.08 \u00e0 11:19:58 AM GMT \n//\n\n\npackage com.in28minutes.courses;\n\nimport javax.xml.bind.annotation.XmlAccessType;\nimport javax.xml.bind.annotation.XmlAccessorType;\nimport javax.xml.bind.annotation.XmlRootElement;\nimport javax.xml.bind.annotation.XmlType;\n\n\n/**\n * <p>Classe Java pour anonymous complex type.\n * \n * <p>Le fragment de sch\u00e9ma suivant indique le contenu attendu figurant dans cette classe.\n * \n * <pre>\n * <complexType>\n * <complexContent>\n * <restriction base=\"{http://www.w3.org/2001/XMLSchema}anyType\">\n * </restriction>\n * </complexContent>\n * </complexType>\n * </pre>\n * \n * \n */\n@XmlAccessorType(XmlAccessType.FIELD)\n@XmlType(name = \"\")\n@XmlRootElement(name = \"GetAllCourseDetailsRequest\")\npublic class GetAllCourseDetailsRequest {\n\n\n}\n", "meta": {"content_hash": "8b972687503ad3224e755d1ef318e511", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 112, "avg_line_length": 28.205128205128204, "alnum_prop": 0.7218181818181818, "repo_name": "jamalgithub/workdev", "id": "4da6e5ccc4583bfdf2e08cc0683e90a5e3ba3293", "size": "1116", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "in28Munites-soap-course-management/src/main/java/com/in28minutes/courses/GetAllCourseDetailsRequest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "12727"}, {"name": "Java", "bytes": "2899130"}, {"name": "PLSQL", "bytes": "5617"}, {"name": "TSQL", "bytes": "2886"}]}} +{"text": "FROM ubuntu:14.04\n\nENV DEBIAN_FRONTEND noninteractive\n\nRUN apt-get update && apt-get upgrade -y && \\\n apt-get install -y openjdk-7-jre-headless\n", "meta": {"content_hash": "f1e8113add9488ea03797d5d87b5d1a2", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 45, "avg_line_length": 24.5, "alnum_prop": 0.7278911564625851, "repo_name": "zooniverse/docker-java", "id": "e6024e1a7576dc451cafa099444cc7af405777f6", "size": "147", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Dockerfile", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "<stix:STIX_Package \n\txmlns:cyboxCommon=\"http://cybox.mitre.org/common-2\"\n\txmlns:cybox=\"http://cybox.mitre.org/cybox-2\"\n\txmlns:cyboxVocabs=\"http://cybox.mitre.org/default_vocabularies-2\"\n\txmlns:example=\"http://example.com\"\n\txmlns:incident=\"http://stix.mitre.org/Incident-1\"\n\txmlns:ta=\"http://stix.mitre.org/ThreatActor-1\"\n\txmlns:stixCommon=\"http://stix.mitre.org/common-1\"\n\txmlns:stixVocabs=\"http://stix.mitre.org/default_vocabularies-1\"\n\txmlns:stix-ciqidentity=\"http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1\"\n\txmlns:stix=\"http://stix.mitre.org/stix-1\"\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\txmlns:xal=\"urn:oasis:names:tc:ciq:xal:3\"\n\txmlns:xnl=\"urn:oasis:names:tc:ciq:xnl:3\"\n\txmlns:xpil=\"urn:oasis:names:tc:ciq:xpil:3\"\n\txsi:schemaLocation=\"\n\thttp://cybox.mitre.org/common-2 http://cybox.mitre.org/XMLSchema/common/2.1/cybox_common.xsd\n\thttp://cybox.mitre.org/cybox-2 http://cybox.mitre.org/XMLSchema/core/2.1/cybox_core.xsd\n\thttp://cybox.mitre.org/default_vocabularies-2 http://cybox.mitre.org/XMLSchema/default_vocabularies/2.1/cybox_default_vocabularies.xsd\n\thttp://stix.mitre.org/Incident-1 http://stix.mitre.org/XMLSchema/incident/1.1.1/incident.xsd\n\thttp://stix.mitre.org/ThreatActor-1 http://stix.mitre.org/XMLSchema/threat_actor/1.1.1/threat_actor.xsd\n\thttp://stix.mitre.org/common-1 http://stix.mitre.org/XMLSchema/common/1.1.1/stix_common.xsd\n\thttp://stix.mitre.org/default_vocabularies-1 http://stix.mitre.org/XMLSchema/default_vocabularies/1.1.1/stix_default_vocabularies.xsd\n\thttp://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1 http://stix.mitre.org/XMLSchema/extensions/identity/ciq_3.0/1.1.1/ciq_3.0_identity.xsd\n\thttp://stix.mitre.org/stix-1 http://stix.mitre.org/XMLSchema/core/1.1.1/stix_core.xsd\n\turn:oasis:names:tc:ciq:xal:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xAL.xsd\n\turn:oasis:names:tc:ciq:xnl:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xNL.xsd\n\turn:oasis:names:tc:ciq:xpil:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xPIL.xsd\" id=\"example:Package-651c248a-5158-4945-9b83-af847ee5c5b8\" version=\"1.1.1\" timestamp=\"2013-12-11T20:13:34+00:00\">\n <stix:Incidents>\n <stix:Incident id=\"example:incident-a923bc52-dd0f-44be-ac59-da8f45e2e8ca\" timestamp=\"2014-07-30T19:07:18+00:00\" xsi:type='incident:IncidentType'>\n <incident:Title>A Veteran reported to an outpatient VA clinic today and submitted a document that pertained to another Veteran. Several weeks ago this veteran was provided a future appointment reminder document which pertained to another Veteran. This Veteran was turning this into the clinic after he now realized that the document pertained to another Veteran.</incident:Title>\n <incident:External_ID source=\"VERIS\">B66DAE70-62A0-11E3-958A-14109FCE954D</incident:External_ID>\n <incident:Time>\n <incident:Initial_Compromise precision=\"year\">2013-01-01T00:00:00</incident:Initial_Compromise>\n </incident:Time>\n <incident:Reporter>\n <stixCommon:Identity xsi:type='stix-ciqidentity:CIQIdentity3.0InstanceType'>\n <ExtSch:Specification xmlns:ExtSch=\"http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1\">\n <xpil:PartyName xmlns:xpil=\"urn:oasis:names:tc:ciq:xpil:3\">\n <xnl:NameLine xmlns:xnl=\"urn:oasis:names:tc:ciq:xnl:3\">swidup</xnl:NameLine>\n </xpil:PartyName>\n</ExtSch:Specification>\n </stixCommon:Identity>\n </incident:Reporter>\n <incident:Victim xsi:type='stix-ciqidentity:CIQIdentity3.0InstanceType'>\n <ExtSch:Specification xmlns:ExtSch=\"http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1\">\n <xpil:PartyName xmlns:xpil=\"urn:oasis:names:tc:ciq:xpil:3\">\n <xnl:NameLine xmlns:xnl=\"urn:oasis:names:tc:ciq:xnl:3\">United States Department of Veterans Affairs</xnl:NameLine>\n </xpil:PartyName>\n <xpil:Addresses xmlns:xpil=\"urn:oasis:names:tc:ciq:xpil:3\">\n <xpil:Address>\n <xal:Country xmlns:xal=\"urn:oasis:names:tc:ciq:xal:3\">\n <xal:NameElement>US</xal:NameElement>\n </xal:Country>\n <xal:AdministrativeArea xmlns:xal=\"urn:oasis:names:tc:ciq:xal:3\">\n <xal:NameElement>PA</xal:NameElement>\n </xal:AdministrativeArea>\n </xpil:Address>\n </xpil:Addresses>\n</ExtSch:Specification>\n </incident:Victim>\n <incident:Affected_Assets>\n <incident:Affected_Asset>\n <incident:Type>Documents</incident:Type>\n <incident:Nature_Of_Security_Effect>\n <incident:Property_Affected>\n <incident:Property xsi:type=\"stixVocabs:LossPropertyVocab-1.0\">Confidentiality</incident:Property>\n <incident:Description_Of_Effect>Medical</incident:Description_Of_Effect>\n </incident:Property_Affected>\n </incident:Nature_Of_Security_Effect>\n </incident:Affected_Asset>\n </incident:Affected_Assets>\n <incident:Attributed_Threat_Actors>\n <incident:Threat_Actor>\n <stixCommon:Threat_Actor idref=\"example:threatactor-a2c1ecbc-862e-4214-a6fe-b99f0f903d80\" xsi:type='ta:ThreatActorType'/>\n </incident:Threat_Actor>\n </incident:Attributed_Threat_Actors>\n <incident:Security_Compromise xsi:type=\"stixVocabs:SecurityCompromiseVocab-1.0\">Yes</incident:Security_Compromise>\n <incident:Discovery_Method xsi:type=\"stixVocabs:DiscoveryMethodVocab-1.0\">Unknown</incident:Discovery_Method>\n <incident:Information_Source>\n <stixCommon:Identity>\n <stixCommon:Name>vcdb</stixCommon:Name>\n </stixCommon:Identity>\n <stixCommon:Tools>\n <cyboxCommon:Tool>\n <cyboxCommon:Name>veris2stix</cyboxCommon:Name>\n <cyboxCommon:Vendor>MITRE</cyboxCommon:Vendor>\n <cyboxCommon:Version>0.1</cyboxCommon:Version>\n </cyboxCommon:Tool>\n <cyboxCommon:Tool>\n <cyboxCommon:Name>VERIS schema</cyboxCommon:Name>\n <cyboxCommon:Vendor>Verizon</cyboxCommon:Vendor>\n <cyboxCommon:Version>1.3.0</cyboxCommon:Version>\n </cyboxCommon:Tool>\n </stixCommon:Tools>\n <stixCommon:References>\n <stixCommon:Reference>http://vcdb.org/pdf/va-security.pdf</stixCommon:Reference>\n </stixCommon:References>\n </incident:Information_Source>\n </stix:Incident>\n </stix:Incidents>\n <stix:Threat_Actors>\n <stix:Threat_Actor id=\"example:threatactor-a2c1ecbc-862e-4214-a6fe-b99f0f903d80\" timestamp=\"2014-12-22T16:33:07.799000+00:00\" xsi:type='ta:ThreatActorType'>\n <ta:Type timestamp=\"2014-12-22T16:33:07.799000+00:00\">\n <stixCommon:Value xsi:type=\"stixVocabs:ThreatActorTypeVocab-1.0\">Insider Threat</stixCommon:Value>\n <stixCommon:Description>Unknown</stixCommon:Description>\n </ta:Type>\n <ta:Motivation timestamp=\"2014-12-22T16:33:07.799000+00:00\">\n <stixCommon:Value>NA</stixCommon:Value>\n </ta:Motivation>\n </stix:Threat_Actor>\n </stix:Threat_Actors>\n</stix:STIX_Package>\n", "meta": {"content_hash": "3df67bc3fdb3cbf0674a33c0a602d5bf", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 391, "avg_line_length": 65.52212389380531, "alnum_prop": 0.6704484062668827, "repo_name": "rpiazza/veris-to-stix", "id": "05a4cc0f9566007a14ca9ae9bd20088b7ce46ab5", "size": "7404", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "results/B66DAE70-62A0-11E3-958A-14109FCE954D.xml", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Python", "bytes": "48356"}]}} +{"text": "\r\n#ifndef itkCacheableScalarFunction_h\r\n#define itkCacheableScalarFunction_h\r\n\r\n#include \"itkArray.h\"\r\n#include \"itkIntTypes.h\"\r\n#include \"ITKBiasCorrectionExport.h\"\r\n\r\nnamespace itk\r\n{\r\n/** \\class CacheableScalarFunction\r\n * \\brief function cache implementation\r\n *\r\n * This is the base class for continuous scalar functions which\r\n * needs cache for their pre-evaluated function returns.\r\n *\r\n * The internal cache is created using the upper- and lower-bound domain\r\n * values of the functional form (f(x))of subclasses of this class. So the\r\n * cache only stores pre-evaluated values between f(lower-bound) and\r\n * f(upper-bound).\r\n *\r\n * To create a cache for continuous function, it uses sampling.\r\n * With the given sample number , upper-bound, and lower-bound, it calculates\r\n * interval within the ranges. It pre-evaluates and save f(x)\r\n * where x = lower-bound + interval * [0 - sample number]\r\n *\r\n * If a subclass of this class want to use a cache, it should\r\n * explicitly call CreateCache(...) member function. GetCachedValue(x) will\r\n * return pre-evaluated f(x) value. However, the return value from\r\n * GetCachedValue(x) might be different from the exact return value from f(x)\r\n * which is Evaluate(x) member function of subclasses of this class, because\r\n * The GetCachedValue(x) member function internally converts x to cache table\r\n * index and the conversion involves with truncation. So, users can think the\r\n * cached value as an approximate to exact function return.\r\n *\r\n * In some case, approximate values can be useful.\r\n * For example, CompositeValleyFunction can be used as an M-estimator and\r\n * it is currently used for MRIBiasFieldCorrectionFilter\r\n * as an energy function. The bias field estimation requires calculation of\r\n * energy values again and again for each iteration.\r\n * \\ingroup ITKBiasCorrection\r\n */\r\nclass ITKBiasCorrection_EXPORT CacheableScalarFunction\r\n{\r\npublic:\r\n /** Constructor. */\r\n CacheableScalarFunction();\r\n\r\n /** Destructor. */\r\n virtual ~CacheableScalarFunction();\r\n\r\n /** Function's input and output value type. */\r\n typedef double MeasureType;\r\n typedef Array< MeasureType > MeasureArrayType;\r\n\r\n /** Get the number of samples between the lower-bound and upper-bound\r\n * of the cache table. */\r\n SizeValueType GetNumberOfSamples() { return m_NumberOfSamples; }\r\n\r\n /** Check if the internal cache table and its values are valid. */\r\n bool IsCacheAvailable() { return m_CacheAvailable; }\r\n\r\n /** Get the upper-bound of domain that is used for filling the cache table. */\r\n double GetCacheUpperBound() { return m_CacheUpperBound; }\r\n\r\n /** Get the lower-bound of domain that is used for filling the cache table. */\r\n double GetCacheLowerBound() { return m_CacheLowerBound; }\r\n\r\n /** y = f(x)\r\n * Subclasses of this class should override this member function\r\n * to provide their own functional operation . */\r\n virtual MeasureType Evaluate(MeasureType x);\r\n\r\n /** Gets the interval of each cell between the upper and lower bound */\r\n double GetInterval()\r\n { return m_TableInc; }\r\n\r\n /** y = f(x) = (approximately) cache_table(index(x))\r\n * Get the function return using the internal cache table\r\n * NOTE: Since the index calculation needs conversion from double\r\n * to int, truncation happens. As a result, the return values from\r\n * Evaluate(x) and GetCachedValue(x) may not be same for the same x. */\r\n inline MeasureType GetCachedValue(MeasureType x)\r\n {\r\n if ( x > m_CacheUpperBound || x < m_CacheLowerBound )\r\n {\r\n throw ExceptionObject(__FILE__, __LINE__);\r\n }\r\n // access table\r\n int index = (int)( ( x - m_CacheLowerBound ) / m_TableInc );\r\n return m_CacheTable[index];\r\n }\r\n\r\nprotected:\r\n /** Create the internal cache table and fill it with\r\n * pre-evaluated values. */\r\n void CreateCache(double lowerBound, double upperBound, SizeValueType sampleSize);\r\n\r\nprivate:\r\n /** The number of samples will be precalcualted and saved in the\r\n * cache table. */\r\n SizeValueType m_NumberOfSamples;\r\n\r\n /** Storage for the precalcualted function values. */\r\n MeasureArrayType m_CacheTable;\r\n\r\n /** The upper-bound of domain that is used for filling the cache table. */\r\n double m_CacheUpperBound;\r\n\r\n /** The lower-bound of domain that is used for filling the cache table. */\r\n double m_CacheLowerBound;\r\n\r\n /** Sampling interval for function evaluation. */\r\n double m_TableInc;\r\n\r\n /** Is the cache available? */\r\n bool m_CacheAvailable;\r\n}; // end of class\r\n} // end of namespace itk\r\n#endif\r\n", "meta": {"content_hash": "51d37c9de8de62a78f07683e273c75f2", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 83, "avg_line_length": 37.975, "alnum_prop": 0.7072635505815229, "repo_name": "RayRuizhiLiao/ITK_4D", "id": "7e8253127e666055700fad8056f6299ac07b0f1c", "size": "5348", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Modules/Filtering/BiasCorrection/include/itkCacheableScalarFunction.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "572693"}, {"name": "C++", "bytes": "36720665"}, {"name": "CMake", "bytes": "1448020"}, {"name": "CSS", "bytes": "18346"}, {"name": "Java", "bytes": "29480"}, {"name": "Objective-C++", "bytes": "6753"}, {"name": "Perl", "bytes": "6113"}, {"name": "Python", "bytes": "385395"}, {"name": "Ruby", "bytes": "309"}, {"name": "Shell", "bytes": "92050"}, {"name": "Tcl", "bytes": "75202"}, {"name": "XSLT", "bytes": "8874"}]}} +{"text": "SYNONYM\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "5468699806c3bf5dbf4a32ad1f6a97ff", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "e99f2ee32c12ff345dd8995a1012963264085ae6", "size": "183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/incertae sedis/Pilosella stoloniflora/ Syn. Pilosella kihlmanii/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "<?php\nnamespace common\\models;\n\nuse Yii;\nuse yii\\base\\Model;\n\n/**\n * Login form\n */\nclass LoginForm extends Model\n{\n public $username;\n public $password;\n public $rememberMe = true;\n\n private $_user;\n\n\n /**\n * @inheritdoc\n */\n public function rules()\n {\n return [\n // username and password are both required\n [['username', 'password'], 'required'],\n // rememberMe must be a boolean value\n ['rememberMe', 'boolean'],\n // password is validated by validatePassword()\n ['password', 'validatePassword'],\n ];\n }\n\n /**\n * Validates the password.\n * This method serves as the inline validation for password.\n *\n * @param string $attribute the attribute currently being validated\n * @param array $params the additional name-value pairs given in the rule\n */\n public function validatePassword($attribute, $params)\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError($attribute, '\u7528\u6237\u540d\u6216\u5bc6\u7801\u4e0d\u6b63\u786e');\n }\n }\n }\n\n /**\n * Logs in a user using the provided username and password.\n *\n * @return bool whether the user is logged in successfully\n */\n public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);\n } else {\n return false;\n }\n }\n\n /**\n * Finds user by [[username]]\n *\n * @return User|null\n */\n protected function getUser()\n {\n if ($this->_user === null) {\n $this->_user = User::findByUsername($this->username);\n }\n\n return $this->_user;\n }\n}\n", "meta": {"content_hash": "0f3d144d66f7d9c3c31c32df46d3f843", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 100, "avg_line_length": 23.525641025641026, "alnum_prop": 0.5340599455040872, "repo_name": "evoshop/evo_maa", "id": "49f1ebec1788c60fd68d3486c1bf5fa194aa60ea", "size": "1853", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "common/models/LoginForm.php", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ApacheConf", "bytes": "538"}, {"name": "Batchfile", "bytes": "1546"}, {"name": "CSS", "bytes": "348105"}, {"name": "JavaScript", "bytes": "2264688"}, {"name": "PHP", "bytes": "217575"}, {"name": "Shell", "bytes": "3256"}]}} +{"text": "\n\npackage acteve.explorer;\n\nclass RWRecord {\n\tint id;\n\tint fldId;\n\n\tRWRecord(int id, int fldId)\n\t{\n\t\tthis.id = id;\n\t\tthis.fldId = fldId;\n\t}\n\n\tpublic boolean equals(Object other) {\n\t\tif(!(other instanceof RWRecord))\n\t\t\treturn false;\n\t\tRWRecord otherRecord = (RWRecord) other;\n\t\treturn this.id == otherRecord.id && this.fldId == otherRecord.fldId;\n\t}\n\n\tpublic int hashCode() {\n\t\treturn (id * fldId) % 13;\n\t}\n}\n", "meta": {"content_hash": "2988c75ba3ce72a72fa7d92d10cf380c", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 70, "avg_line_length": 16.32, "alnum_prop": 0.6617647058823529, "repo_name": "JulianSchuette/ConDroid", "id": "5cef558f6c1a574fed546611032911039484d300", "size": "2037", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/main/java/acteve/explorer/RWRecord.java", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "6556"}, {"name": "Java", "bytes": "779008"}, {"name": "Shell", "bytes": "1578"}]}} +{"text": "const BinExp = require('./binexp.js');\nconst Type = require('./type');\nconst Context = require('../semantic/context.js');\n\nclass BinExpAdd extends BinExp {\n constructor(firstExp, addop, secExp) {\n super();\n this.firstExp = firstExp;\n this.binop = addop;\n this.secExp = secExp;\n }\n\n toString() {\n return `(Add : ${this.firstExp.toString()} ${this.binop.toString()} ${this.secExp.toString()})`;\n }\n\n analyze(context) {\n this.firstExp.type = this.firstExp.analyze(context);\n\n if (this.secExp.toString().length > 0) { // gotta ensure that somethings there\n this.secExp.type = this.secExp.analyze(context);\n if (['+', '-'].includes(this.binop)) {\n const isNumber = this.firstExp.type.intCheck() || this.firstExp.type.floatCheck();\n const isNumberTwo = this.secExp.type.intCheck() || this.secExp.type.floatCheck();\n\n\n if (!isNumber || !isNumberTwo) {\n throw Error('Wrong operands, expected numbers');\n }\n\n const isFloat = this.firstExp.type.floatCheck();\n const isFloatTwo = this.secExp.type.floatCheck();\n\n if (isFloat || isFloatTwo) {\n this.type = Type.FLOAT;\n } else {\n this.type = Type.INT;\n }\n }\n }\n return this.type;\n }\n}\n\nmodule.exports = BinExpAdd;\n", "meta": {"content_hash": "beb5d1c8d24d76bf4c1ff70d5fb368d1", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 100, "avg_line_length": 28.644444444444446, "alnum_prop": 0.6113266097750194, "repo_name": "mitchelljfs/madmaan", "id": "ecfef08a7853920206f1a562b3f3546eb6bb9e39", "size": "1289", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "entities/binexpAdd.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "34944"}]}} +{"text": "<?xml version=\"1.0\"?>\n<!--\n\n-->\n<page xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View/Layout/etc/page_configuration.xsd\">\n <body>\n <referenceContainer name=\"content\">\n <block class=\"Magento\\Cookie\\Block\\RequireCookie\" name=\"require-cookie\" template=\"Magento_Cookie::require_cookie.phtml\">\n <arguments>\n <argument name=\"triggers\" xsi:type=\"array\">\n <item name=\"addToWishlistLink\" xsi:type=\"string\">.action.towishlist</item>\n </argument>\n </arguments>\n </block>\n </referenceContainer>\n </body>\n</page>\n", "meta": {"content_hash": "a20d4b8cf4ee83bc1b5d6982fa736b4b", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 153, "avg_line_length": 41.0, "alnum_prop": 0.593974175035868, "repo_name": "enettolima/magento-training", "id": "1e4f27875c6bdae65b6a4e8cb2cdb1dcfffca32b", "size": "795", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "magento2ce/app/code/Magento/Wishlist/view/frontend/layout/catalog_product_view.xml", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "22648"}, {"name": "CSS", "bytes": "3382928"}, {"name": "HTML", "bytes": "8749335"}, {"name": "JavaScript", "bytes": "7355635"}, {"name": "PHP", "bytes": "58607662"}, {"name": "Perl", "bytes": "10258"}, {"name": "Shell", "bytes": "41887"}, {"name": "XSLT", "bytes": "19889"}]}} +{"text": "\npackage com.alibaba.rocketmq.common;\n\nimport com.alibaba.rocketmq.remoting.common.RemotingHelper;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.File;\nimport java.io.IOException;\nimport java.lang.management.ManagementFactory;\nimport java.lang.management.RuntimeMXBean;\nimport java.net.Inet4Address;\nimport java.net.InetAddress;\nimport java.net.NetworkInterface;\nimport java.text.NumberFormat;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.*;\nimport java.util.zip.CRC32;\nimport java.util.zip.DeflaterOutputStream;\nimport java.util.zip.InflaterInputStream;\n\n\n/**\n * @author shijia.wxr\n */\npublic class UtilAll {\n public static final String YYYY_MM_DD_HH_MM_SS = \"yyyy-MM-dd HH:mm:ss\";\n public static final String YYYY_MM_DD_HH_MM_SS_SSS = \"yyyy-MM-dd#HH:mm:ss:SSS\";\n public static final String YYYY_MMDD_HHMMSS = \"yyyyMMddHHmmss\";\n\n\n public static int getPid() {\n RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();\n String name = runtime.getName(); // format: \"pid@hostname\"\n try {\n return Integer.parseInt(name.substring(0, name.indexOf('@')));\n } catch (Exception e) {\n return -1;\n }\n }\n\n public static String currentStackTrace() {\n StringBuilder sb = new StringBuilder();\n StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();\n for (StackTraceElement ste : stackTrace) {\n sb.append(\"\\n\\t\");\n sb.append(ste.toString());\n }\n\n return sb.toString();\n }\n\n public static String offset2FileName(final long offset) {\n final NumberFormat nf = NumberFormat.getInstance();\n nf.setMinimumIntegerDigits(20);\n nf.setMaximumFractionDigits(0);\n nf.setGroupingUsed(false);\n return nf.format(offset);\n }\n\n public static long computeEclipseTimeMilliseconds(final long beginTime) {\n return System.currentTimeMillis() - beginTime;\n }\n\n\n public static boolean isItTimeToDo(final String when) {\n String[] whiles = when.split(\";\");\n if (whiles != null && whiles.length > 0) {\n Calendar now = Calendar.getInstance();\n for (String w : whiles) {\n int nowHour = Integer.parseInt(w);\n if (nowHour == now.get(Calendar.HOUR_OF_DAY)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n\n public static String timeMillisToHumanString() {\n return timeMillisToHumanString(System.currentTimeMillis());\n }\n\n\n public static String timeMillisToHumanString(final long t) {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(t);\n return String.format(\"%04d%02d%02d%02d%02d%02d%03d\", cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1,\n cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND),\n cal.get(Calendar.MILLISECOND));\n }\n\n\n public static long computNextMorningTimeMillis() {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(System.currentTimeMillis());\n cal.add(Calendar.DAY_OF_MONTH, 1);\n cal.set(Calendar.HOUR_OF_DAY, 0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal.getTimeInMillis();\n }\n\n\n public static long computNextMinutesTimeMillis() {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(System.currentTimeMillis());\n cal.add(Calendar.DAY_OF_MONTH, 0);\n cal.add(Calendar.HOUR_OF_DAY, 0);\n cal.add(Calendar.MINUTE, 1);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal.getTimeInMillis();\n }\n\n\n public static long computNextHourTimeMillis() {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(System.currentTimeMillis());\n cal.add(Calendar.DAY_OF_MONTH, 0);\n cal.add(Calendar.HOUR_OF_DAY, 1);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal.getTimeInMillis();\n }\n\n\n public static long computNextHalfHourTimeMillis() {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(System.currentTimeMillis());\n cal.add(Calendar.DAY_OF_MONTH, 0);\n cal.add(Calendar.HOUR_OF_DAY, 1);\n cal.set(Calendar.MINUTE, 30);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal.getTimeInMillis();\n }\n\n\n public static String timeMillisToHumanString2(final long t) {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(t);\n return String.format(\"%04d-%02d-%02d %02d:%02d:%02d,%03d\",\n cal.get(Calendar.YEAR),\n cal.get(Calendar.MONTH) + 1,\n cal.get(Calendar.DAY_OF_MONTH),\n cal.get(Calendar.HOUR_OF_DAY),\n cal.get(Calendar.MINUTE),\n cal.get(Calendar.SECOND),\n cal.get(Calendar.MILLISECOND));\n }\n\n\n public static String timeMillisToHumanString3(final long t) {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(t);\n return String.format(\"%04d%02d%02d%02d%02d%02d\",\n cal.get(Calendar.YEAR),\n cal.get(Calendar.MONTH) + 1,\n cal.get(Calendar.DAY_OF_MONTH),\n cal.get(Calendar.HOUR_OF_DAY),\n cal.get(Calendar.MINUTE),\n cal.get(Calendar.SECOND));\n }\n\n\n public static double getDiskPartitionSpaceUsedPercent(final String path) {\n if (null == path || path.isEmpty())\n return -1;\n\n try {\n File file = new File(path);\n if (!file.exists()) {\n boolean result = file.mkdirs();\n if (!result) {\n }\n }\n\n long totalSpace = file.getTotalSpace();\n long freeSpace = file.getFreeSpace();\n long usedSpace = totalSpace - freeSpace;\n if (totalSpace > 0) {\n return usedSpace / (double) totalSpace;\n }\n } catch (Exception e) {\n return -1;\n }\n\n return -1;\n }\n\n\n public static final int crc32(byte[] array) {\n if (array != null) {\n return crc32(array, 0, array.length);\n }\n\n return 0;\n }\n\n\n public static final int crc32(byte[] array, int offset, int length) {\n CRC32 crc32 = new CRC32();\n crc32.update(array, offset, length);\n return (int) (crc32.getValue() & 0x7FFFFFFF);\n }\n\n final static char[] HEX_ARRAY = \"0123456789ABCDEF\".toCharArray();\n\n public static String bytes2string(byte[] src) {\n char[] hexChars = new char[src.length * 2];\n for (int j = 0; j < src.length; j++) {\n int v = src[j] & 0xFF;\n hexChars[j * 2] = HEX_ARRAY[v >>> 4];\n hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F];\n }\n return new String(hexChars);\n }\n\n public static byte[] string2bytes(String hexString) {\n if (hexString == null || hexString.equals(\"\")) {\n return null;\n }\n hexString = hexString.toUpperCase();\n int length = hexString.length() / 2;\n char[] hexChars = hexString.toCharArray();\n byte[] d = new byte[length];\n for (int i = 0; i < length; i++) {\n int pos = i * 2;\n d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));\n }\n return d;\n }\n\n\n private static byte charToByte(char c) {\n return (byte) \"0123456789ABCDEF\".indexOf(c);\n }\n\n\n public static byte[] uncompress(final byte[] src) throws IOException {\n byte[] result = src;\n byte[] uncompressData = new byte[src.length];\n ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(src);\n InflaterInputStream inflaterInputStream = new InflaterInputStream(byteArrayInputStream);\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(src.length);\n\n try {\n while (true) {\n int len = inflaterInputStream.read(uncompressData, 0, uncompressData.length);\n if (len <= 0) {\n break;\n }\n byteArrayOutputStream.write(uncompressData, 0, len);\n }\n byteArrayOutputStream.flush();\n result = byteArrayOutputStream.toByteArray();\n } catch (IOException e) {\n throw e;\n } finally {\n try {\n byteArrayInputStream.close();\n } catch (IOException e) {\n }\n try {\n inflaterInputStream.close();\n } catch (IOException e) {\n }\n try {\n byteArrayOutputStream.close();\n } catch (IOException e) {\n }\n }\n\n return result;\n }\n\n\n public static byte[] compress(final byte[] src, final int level) throws IOException {\n byte[] result = src;\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(src.length);\n java.util.zip.Deflater defeater = new java.util.zip.Deflater(level);\n DeflaterOutputStream deflaterOutputStream = new DeflaterOutputStream(byteArrayOutputStream, defeater);\n try {\n deflaterOutputStream.write(src);\n deflaterOutputStream.finish();\n deflaterOutputStream.close();\n result = byteArrayOutputStream.toByteArray();\n } catch (IOException e) {\n defeater.end();\n throw e;\n } finally {\n try {\n byteArrayOutputStream.close();\n } catch (IOException ignored) {\n }\n\n defeater.end();\n }\n\n return result;\n }\n\n\n public static int asInt(String str, int defaultValue) {\n try {\n return Integer.parseInt(str);\n } catch (Exception e) {\n return defaultValue;\n }\n }\n\n\n public static long asLong(String str, long defaultValue) {\n try {\n return Long.parseLong(str);\n } catch (Exception e) {\n return defaultValue;\n }\n }\n\n\n public static String formatDate(Date date, String pattern) {\n SimpleDateFormat df = new SimpleDateFormat(pattern);\n return df.format(date);\n }\n\n\n public static Date parseDate(String date, String pattern) {\n SimpleDateFormat df = new SimpleDateFormat(pattern);\n try {\n return df.parse(date);\n } catch (ParseException e) {\n return null;\n }\n }\n\n\n public static String responseCode2String(final int code) {\n return Integer.toString(code);\n }\n\n\n public static String frontStringAtLeast(final String str, final int size) {\n if (str != null) {\n if (str.length() > size) {\n return str.substring(0, size);\n }\n }\n\n return str;\n }\n\n\n public static boolean isBlank(String str) {\n int strLen;\n if (str == null || (strLen = str.length()) == 0) {\n return true;\n }\n for (int i = 0; i < strLen; i++) {\n if (!Character.isWhitespace(str.charAt(i))) {\n return false;\n }\n }\n return true;\n }\n\n\n public static String jstack() {\n return jstack(Thread.getAllStackTraces());\n }\n\n\n public static String jstack(Map<Thread, StackTraceElement[]> map) {\n StringBuilder result = new StringBuilder();\n try {\n Iterator<Map.Entry<Thread, StackTraceElement[]>> ite = map.entrySet().iterator();\n while (ite.hasNext()) {\n Map.Entry<Thread, StackTraceElement[]> entry = ite.next();\n StackTraceElement[] elements = entry.getValue();\n Thread thread = entry.getKey();\n if (elements != null && elements.length > 0) {\n String threadName = entry.getKey().getName();\n result.append(String.format(\"%-40sTID: %d STATE: %s%n\", threadName, thread.getId(), thread.getState()));\n for (StackTraceElement el : elements) {\n result.append(String.format(\"%-40s%s%n\", threadName, el.toString()));\n }\n result.append(\"\\n\");\n }\n }\n } catch (Throwable e) {\n result.append(RemotingHelper.exceptionSimpleDesc(e));\n }\n\n return result.toString();\n }\n\n public static boolean isInternalIP(byte[] ip) {\n if (ip.length != 4) {\n throw new RuntimeException(\"illegal ipv4 bytes\");\n }\n\n\n //10.0.0.0~10.255.255.255\n //172.16.0.0~172.31.255.255\n //192.168.0.0~192.168.255.255\n if (ip[0] == (byte) 10) {\n\n return true;\n } else if (ip[0] == (byte) 172) {\n if (ip[1] >= (byte) 16 && ip[1] <= (byte) 31) {\n return true;\n }\n } else if (ip[0] == (byte) 192) {\n if (ip[1] == (byte) 168) {\n return true;\n }\n }\n return false;\n }\n\n private static boolean ipCheck(byte[] ip) {\n if (ip.length != 4) {\n throw new RuntimeException(\"illegal ipv4 bytes\");\n }\n\n// if (ip[0] == (byte)30 && ip[1] == (byte)10 && ip[2] == (byte)163 && ip[3] == (byte)120) {\n// }\n\n\n if (ip[0] >= (byte) 1 && ip[0] <= (byte) 126) {\n if (ip[1] == (byte) 1 && ip[2] == (byte) 1 && ip[3] == (byte) 1) {\n return false;\n }\n if (ip[1] == (byte) 0 && ip[2] == (byte) 0 && ip[3] == (byte) 0) {\n return false;\n }\n return true;\n } else if (ip[0] >= (byte) 128 && ip[0] <= (byte) 191) {\n if (ip[2] == (byte) 1 && ip[3] == (byte) 1) {\n return false;\n }\n if (ip[2] == (byte) 0 && ip[3] == (byte) 0) {\n return false;\n }\n return true;\n } else if (ip[0] >= (byte) 192 && ip[0] <= (byte) 223) {\n if (ip[3] == (byte) 1) {\n return false;\n }\n if (ip[3] == (byte) 0) {\n return false;\n }\n return true;\n }\n return false;\n }\n\n public static String ipToIPv4Str(byte[] ip) {\n if (ip.length != 4) {\n return null;\n }\n return new StringBuilder().append(ip[0] & 0xFF).append(\".\").append(\n ip[1] & 0xFF).append(\".\").append(ip[2] & 0xFF)\n .append(\".\").append(ip[3] & 0xFF).toString();\n }\n\n public static byte[] getIP() {\n try {\n Enumeration allNetInterfaces = NetworkInterface.getNetworkInterfaces();\n InetAddress ip = null;\n byte[] internalIP = null;\n while (allNetInterfaces.hasMoreElements()) {\n NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement();\n Enumeration addresses = netInterface.getInetAddresses();\n while (addresses.hasMoreElements()) {\n ip = (InetAddress) addresses.nextElement();\n if (ip != null && ip instanceof Inet4Address) {\n byte[] ipByte = ip.getAddress();\n if (ipByte.length == 4) {\n if (ipCheck(ipByte)) {\n if (!isInternalIP(ipByte)) {\n return ipByte;\n } else if (internalIP == null) {\n internalIP = ipByte;\n }\n }\n }\n }\n }\n }\n if (internalIP != null) {\n return internalIP;\n } else {\n throw new RuntimeException(\"Can not get local ip\");\n }\n } catch (Exception e) {\n throw new RuntimeException(\"Can not get local ip\", e);\n }\n }\n}\n", "meta": {"content_hash": "34f100d92b29da04da090edcffa6ecbf", "timestamp": "", "source": "github", "line_count": 510, "max_line_length": 130, "avg_line_length": 32.0, "alnum_prop": 0.5378063725490196, "repo_name": "lollipopjin/incubator-rocketmq", "id": "4429e3d4105eec9d80a6f437c1dccdd5562649dc", "size": "17118", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rocketmq-common/src/main/java/com/alibaba/rocketmq/common/UtilAll.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "1747"}, {"name": "Java", "bytes": "2761168"}, {"name": "Shell", "bytes": "34084"}]}} +{"text": "Consolidated [TypeScript](https://www.typescriptlang.org/) dependencies for transpiling ES.\n\n\n\n\n\n\n---\n### License: MIT\n", "meta": {"content_hash": "c79118233afe785442ed723d33a2dd07", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 91, "avg_line_length": 13.222222222222221, "alnum_prop": 0.7142857142857143, "repo_name": "philcockfield/babel", "id": "ccd257f81bac00cb8ecbf6273057984ec0dc9bcb", "size": "135", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js-typescript/README.md", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "1398"}]}} +{"text": "<?php\n\nDoctrine::autoload('Doctrine_Connection');\n/**\n * Doctrine_Connection_Firebird\n *\n * @package Doctrine\n * @subpackage Connection\n * @license http://www.opensource.org/licenses/lgpl-license.php LGPL\n * @author Konsta Vesterinen <kvesteri@cc.hut.fi>\n * @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)\n * @author Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver)\n * @version $Revision: 4037 $\n * @link www.phpdoctrine.org\n * @since 1.0\n */\nclass Doctrine_Connection_Firebird extends Doctrine_Connection\n{\n /**\n * @var string $driverName the name of this connection driver\n */\n protected $driverName = 'Firebird';\n\n /**\n * the constructor\n *\n * @param Doctrine_Manager $manager\n * @param PDO $pdo database handle\n */\n public function __construct(Doctrine_Manager $manager, $adapter)\n {\n\n $this->supported = array(\n 'sequences' => true,\n 'indexes' => true,\n 'affected_rows' => true,\n 'summary_functions' => true,\n 'order_by_text' => true,\n 'transactions' => true,\n 'savepoints' => true,\n 'current_id' => true,\n 'limit_queries' => 'emulated',\n 'LOBs' => true,\n 'replace' => 'emulated',\n 'sub_selects' => true,\n 'auto_increment' => true,\n 'primary_key' => true,\n 'result_introspection' => true,\n 'prepared_statements' => true,\n 'identifier_quoting' => false,\n 'pattern_escaping' => true\n );\n // initialize all driver options\n /**\n $this->options['DBA_username'] = false;\n $this->options['DBA_password'] = false;\n $this->options['database_path'] = '';\n $this->options['database_extension'] = '.gdb';\n $this->options['server_version'] = '';\n */\n parent::__construct($manager, $adapter);\n }\n\n /**\n * Set the charset on the current connection\n *\n * @param string charset\n *\n * @return void\n */\n public function setCharset($charset)\n {\n $query = 'SET NAMES '.$this->dbh->quote($charset);\n $this->exec($query);\n }\n\n /**\n * Adds an driver-specific LIMIT clause to the query\n *\n * @param string $query query to modify\n * @param integer $limit limit the number of rows\n * @param integer $offset start reading from given offset\n * @return string modified query\n */\n public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false)\n {\n if ($limit > 0) {\n $query = preg_replace('/^([\\s(])*SELECT(?!\\s*FIRST\\s*\\d+)/i',\n \"SELECT FIRST $limit SKIP $offset\", $query);\n }\n return $query;\n }\n}", "meta": {"content_hash": "9d406a6c4b9169fa928aa5d89baaa122", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 95, "avg_line_length": 35.623655913978496, "alnum_prop": 0.46966495623302146, "repo_name": "nbonamy/doctrine-0.10.4", "id": "52c2fab8065630b7048cf95cb32c820ce1146717", "size": "4341", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/Doctrine/Connection/Firebird.php", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "52"}, {"name": "CSS", "bytes": "6908"}, {"name": "HTML", "bytes": "6657357"}, {"name": "JavaScript", "bytes": "3353"}, {"name": "PHP", "bytes": "3995824"}, {"name": "Smarty", "bytes": "1328"}]}} +{"text": "\n\n#import \"MPColorTools.h\"\n#import \"TML.h\"\n#import \"TMLAttributedDecorationTokenizer.h\"\n#import \"TMLConfiguration.h\"\n\n@interface TMLAttributedDecorationTokenizer ()\n\n@end\n\n@implementation TMLAttributedDecorationTokenizer\n\n+ (void)addStroke:(NSObject *)data toRange: (NSRange) range inAttributedString: (NSMutableAttributedString *) attributedString {\n NSDictionary *styles = ((NSDictionary *) data);\n\n if ([styles objectForKey:@\"color\"]) {\n [attributedString addAttribute: NSStrokeColorAttributeName value: [self colorFromData:[styles objectForKey:@\"color\"]] range:range];\n }\n\n if ([styles objectForKey:@\"width\"]) {\n float width = [[styles objectForKey:@\"width\"] floatValue];\n [attributedString addAttribute: NSStrokeWidthAttributeName value: @(width) range:range];\n }\n}\n\n+ (void)addShadow:(NSObject *)data toRange: (NSRange) range inAttributedString: (NSMutableAttributedString *) attributedString {\n NSDictionary *styles = ((NSDictionary *) data);\n\n NSShadow *shadow = [[NSShadow alloc] init];\n if ([styles objectForKey:@\"offset\"]) {\n NSArray *parts = [[styles objectForKey:@\"offset\"] componentsSeparatedByString:@\",\"];\n if ([parts count] == 2)\n shadow.shadowOffset = CGSizeMake([[parts objectAtIndex:0] floatValue], [[parts objectAtIndex:1] floatValue]);\n }\n \n if ([styles objectForKey:@\"radius\"]) {\n shadow.shadowBlurRadius = [[styles objectForKey:@\"radius\"] floatValue];\n }\n\n if ([styles objectForKey:@\"color\"]) {\n shadow.shadowColor = [self colorFromData:[styles objectForKey:@\"color\"]];\n }\n \n [attributedString addAttribute: NSShadowAttributeName value: shadow range:range];\n}\n\n+ (void)addTextEffects:(NSObject *)data toRange: (NSRange) range inAttributedString: (NSMutableAttributedString *) attributedString {\n NSString *style = ((NSString *) data);\n if ([style isEqualToString:@\"letterpress\"]) {\n [attributedString addAttribute: NSTextEffectAttributeName value: NSTextEffectLetterpressStyle range:range];\n }\n}\n\n+ (void)addParagraphStyles:(NSObject *)data toRange: (NSRange) range inAttributedString: (NSMutableAttributedString *) attributedString {\n NSDictionary *styles = ((NSDictionary *) data);\n \n NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];\n \n if ([styles objectForKey:@\"line-spacing\"])\n paragraphStyle.lineSpacing = [[styles objectForKey:@\"line-spacing\"] floatValue];\n\n if ([styles objectForKey:@\"paragraph-spacing\"])\n paragraphStyle.paragraphSpacing = [[styles objectForKey:@\"paragraph-spacing\"] floatValue];\n\n if ([styles objectForKey:@\"alignment\"]) {\n NSString *alignment = [styles objectForKey:@\"alignment\"];\n if ([alignment isEqualToString:@\"left\"])\n paragraphStyle.alignment = NSTextAlignmentLeft;\n else if ([alignment isEqualToString:@\"right\"])\n paragraphStyle.alignment = NSTextAlignmentRight;\n else if ([alignment isEqualToString:@\"center\"])\n paragraphStyle.alignment = NSTextAlignmentCenter;\n else if ([alignment isEqualToString:@\"justified\"])\n paragraphStyle.alignment = NSTextAlignmentJustified;\n else if ([alignment isEqualToString:@\"natural\"])\n paragraphStyle.alignment = NSTextAlignmentNatural;\n }\n \n if ([styles objectForKey:@\"first-line-head-indent\"])\n paragraphStyle.firstLineHeadIndent = [[styles objectForKey:@\"first-line-head-indent\"] floatValue];\n\n if ([styles objectForKey:@\"head-indent\"])\n paragraphStyle.headIndent = [[styles objectForKey:@\"head-indent\"] floatValue];\n\n if ([styles objectForKey:@\"tail-indent\"])\n paragraphStyle.tailIndent = [[styles objectForKey:@\"tail-indent\"] floatValue];\n\n if ([styles objectForKey:@\"line-breaking-mode\"]) {\n NSString *mode = (NSString *) [styles objectForKey:@\"line-breaking-mode\"];\n if ([mode isEqualToString:@\"word\"])\n paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;\n else if ([mode isEqualToString:@\"char\"])\n paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping;\n else if ([mode isEqualToString:@\"clipping\"])\n paragraphStyle.lineBreakMode = NSLineBreakByClipping;\n else if ([mode isEqualToString:@\"truncate-head\"])\n paragraphStyle.lineBreakMode = NSLineBreakByTruncatingHead;\n else if ([mode isEqualToString:@\"truncate-tail\"])\n paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;\n else if ([mode isEqualToString:@\"truncate-middle\"])\n paragraphStyle.lineBreakMode = NSLineBreakByTruncatingMiddle;\n }\n\n if ([styles objectForKey:@\"minimum-line-height\"])\n paragraphStyle.minimumLineHeight = [[styles objectForKey:@\"minimum-line-height\"] floatValue];\n \n if ([styles objectForKey:@\"maximum-line-height\"])\n paragraphStyle.maximumLineHeight = [[styles objectForKey:@\"maximum-line-height\"] floatValue];\n \n if ([styles objectForKey:@\"writing-direction\"]) {\n NSString *dir = (NSString *) [styles objectForKey:@\"writing-direction\"];\n if ([dir isEqualToString:@\"natural\"])\n paragraphStyle.baseWritingDirection = NSWritingDirectionNatural;\n else if ([dir isEqualToString:@\"ltr\"])\n paragraphStyle.baseWritingDirection = NSWritingDirectionLeftToRight;\n else if ([dir isEqualToString:@\"rtl\"])\n paragraphStyle.baseWritingDirection = NSWritingDirectionRightToLeft;\n }\n\n if ([styles objectForKey:@\"line-height-multiple\"])\n paragraphStyle.lineHeightMultiple = [[styles objectForKey:@\"line-height-multiple\"] floatValue];\n\n if ([styles objectForKey:@\"line-height-multiple\"])\n paragraphStyle.paragraphSpacingBefore = [[styles objectForKey:@\"line-height-multiple\"] floatValue];\n \n [attributedString addAttribute: NSParagraphStyleAttributeName value:paragraphStyle range:range];\n}\n\n+ (void)addStrikeThrough:(NSObject *)data toRange: (NSRange) range inAttributedString: (NSMutableAttributedString *) attributedString {\n if ([data isKindOfClass:NSString.class]) {\n NSString *thickness = ((NSString *) data);\n [attributedString addAttribute: NSStrikethroughStyleAttributeName value:@([thickness intValue]) range:range];\n return;\n }\n \n if ([data isKindOfClass:NSDictionary.class]) {\n NSDictionary *options = (NSDictionary *) data;\n if ([options objectForKey:@\"thickness\"]) {\n [attributedString addAttribute: NSStrikethroughStyleAttributeName value: @([[options objectForKey:@\"thickness\"] intValue]) range:range];\n }\n NSString *color = [options objectForKey:@\"color\"];\n if (color) {\n [attributedString addAttribute: NSStrikethroughColorAttributeName value: [self colorFromData:color] range:range];\n }\n }\n}\n\n+ (NSUnderlineStyle) underlineOptionsFromData: (NSObject *)data {\n NSUnderlineStyle opts = NSUnderlineStyleNone;\n \n if ([data isKindOfClass:NSString.class]) {\n if ([data isEqual:@\"none\"]) {\n opts = NSUnderlineStyleNone;\n } else if ([data isEqual:@\"single\"]) {\n opts = NSUnderlineStyleSingle;\n } else if ([data isEqual:@\"double\"]) {\n opts = NSUnderlineStyleDouble;\n } else if ([data isEqual:@\"thick\"]) {\n opts = NSUnderlineStyleThick;\n }\n return opts;\n }\n \n if ([data isKindOfClass:NSDictionary.class]) {\n NSDictionary *options = (NSDictionary *) data;\n \n NSString *style = [options objectForKey:@\"style\"];\n if (style == nil) style = @\"single\";\n NSString *pattern = [options objectForKey:@\"pattern\"];\n if (pattern == nil) pattern = @\"solid\";\n NSString *byword = [options objectForKey:@\"byword\"];\n if (byword == nil) byword = @\"false\";\n \n if ([style isEqual:@\"none\"]) {\n opts = NSUnderlineStyleNone;\n } else if ([style isEqual:@\"single\"]) {\n opts = NSUnderlineStyleSingle;\n } else if ([style isEqual:@\"double\"]) {\n opts = NSUnderlineStyleDouble;\n } else if ([style isEqual:@\"thick\"]) {\n opts = NSUnderlineStyleThick;\n }\n \n if ([pattern isEqual:@\"solid\"]) {\n opts = opts | NSUnderlinePatternSolid;\n } else if ([pattern isEqual:@\"dot\"]) {\n opts = opts | NSUnderlinePatternDot;\n } else if ([pattern isEqual:@\"dash\"]) {\n opts = opts | NSUnderlinePatternDash;\n } else if ([pattern isEqual:@\"dashdot\"]) {\n opts = opts | NSUnderlinePatternDashDot;\n } else if ([pattern isEqual:@\"dashdotdot\"]) {\n opts = opts | NSUnderlinePatternDashDotDot;\n } else if ([pattern isEqual:@\"dashdotdot\"]) {\n opts = opts | NSUnderlinePatternDashDotDot;\n }\n \n if ([byword isEqual:@\"true\"]) {\n opts = opts | NSUnderlineByWord;\n }\n return opts;\n }\n \n return opts;\n}\n\n+ (void)addUnderline:(NSObject *)data toRange: (NSRange) range inAttributedString: (NSMutableAttributedString *) attributedString {\n [attributedString addAttribute: NSUnderlineStyleAttributeName value:@([self underlineOptionsFromData:data]) range:range];\n\n if ([data isKindOfClass:NSDictionary.class]) {\n NSDictionary *options = (NSDictionary *) data;\n NSString *color = [options objectForKey:@\"color\"];\n if (color) {\n [attributedString addAttribute: NSUnderlineColorAttributeName value: [self colorFromData:color] range:range];\n }\n }\n}\n\n/**\n * @{@\"font\": [UIFont fontWithName....]}\n * @{@\"font\": @{@\"name\": @\"Arial\", @\"size\": @8}}\n * @{@\"font\": @\"Arial, 8\"}\n */\n\n+ (UIFont *) fontFromData: (NSObject *)data {\n if ([data isKindOfClass: UIFont.class]) {\n return (UIFont *) data;\n }\n \n if ([data isKindOfClass: NSDictionary.class]) {\n NSDictionary *settings = (NSDictionary *) data;\n NSString *fontName = [settings objectForKey:@\"name\"];\n NSNumber *fontSize = [settings objectForKey:@\"size\"];\n \n if ([fontName isEqualToString:@\"system\"]) {\n if ([[settings objectForKey:@\"type\"] isEqualToString:@\"bold\"]) {\n return [UIFont boldSystemFontOfSize:[fontSize floatValue]];\n }\n if ([[settings objectForKey:@\"type\"] isEqualToString:@\"italic\"]) {\n return [UIFont italicSystemFontOfSize:[fontSize floatValue]];\n }\n return [UIFont systemFontOfSize:[fontSize floatValue]];\n }\n\n return [UIFont fontWithName:fontName size:[fontSize floatValue]];\n }\n \n if ([data isKindOfClass: NSString.class]) {\n NSArray *elements = [((NSString *) data) componentsSeparatedByString:@\",\"];\n if ([elements count] < 2) return nil;\n NSString *fontName = [elements objectAtIndex:0];\n float fontSize = [[elements objectAtIndex:1] floatValue];\n return [UIFont fontWithName:fontName size:fontSize];\n }\n \n return nil;\n}\n\n+ (void)addFont:(NSObject *)data toRange: (NSRange) range inAttributedString: (NSMutableAttributedString *) attributedString {\n UIFont *font = [self fontFromData:data];\n if (font == nil) return;\n [attributedString addAttribute: NSFontAttributeName value:font range:range];\n}\n\n/**\n * @{@\"color\": [UIColor ...]}\n * @{@\"color\": @{@\"red\": @111, @\"green\": @8 ...}}\n * @{@\"color\": @\"fbc\"}\n */\n+ (UIColor *) colorFromData: (NSObject *)data {\n if ([data isKindOfClass: UIColor.class]) {\n return (UIColor *) data;\n }\n \n if ([data isKindOfClass: NSDictionary.class]) {\n NSDictionary *settings = (NSDictionary *) data;\n UIColor *color = [UIColor colorWithRed:[[settings objectForKey:@\"red\"] floatValue]\n green:[[settings objectForKey:@\"green\"] floatValue]\n blue:[[settings objectForKey:@\"blue\"] floatValue]\n alpha:[[settings objectForKey:@\"alpha\"] floatValue]];\n \n return color;\n }\n \n if ([data isKindOfClass: NSString.class]) {\n NSString *name = ((NSString *) data);\n \n if ([name isEqualToString:@\"black\"]) return [UIColor blackColor];\n if ([name isEqualToString:@\"dark-gray\"]) return [UIColor darkGrayColor];\n if ([name isEqualToString:@\"light-gray\"]) return [UIColor lightGrayColor];\n if ([name isEqualToString:@\"white\"]) return [UIColor whiteColor];\n if ([name isEqualToString:@\"gray\"]) return [UIColor grayColor];\n if ([name isEqualToString:@\"red\"]) return [UIColor redColor];\n if ([name isEqualToString:@\"green\"]) return [UIColor greenColor];\n if ([name isEqualToString:@\"blue\"]) return [UIColor blueColor];\n if ([name isEqualToString:@\"cyan\"]) return [UIColor cyanColor];\n if ([name isEqualToString:@\"yellow\"]) return [UIColor yellowColor];\n if ([name isEqualToString:@\"magenta\"]) return [UIColor magentaColor];\n if ([name isEqualToString:@\"orange\"]) return [UIColor orangeColor];\n if ([name isEqualToString:@\"purple\"]) return [UIColor purpleColor];\n if ([name isEqualToString:@\"brown\"]) return [UIColor brownColor];\n if ([name isEqualToString:@\"clear\"]) return [UIColor clearColor];\n \n return MP_HEX_RGB(name);\n }\n \n return nil;\n}\n\n+ (void)addColor:(NSObject *)data toRange: (NSRange) range inAttributedString: (NSMutableAttributedString *) attributedString {\n [attributedString addAttribute: NSForegroundColorAttributeName value:[self colorFromData:data] range:range];\n}\n\n+ (void)addBackgroundColor:(NSObject *)data toRange: (NSRange) range inAttributedString: (NSMutableAttributedString *) attributedString {\n [attributedString addAttribute: NSBackgroundColorAttributeName value:[self colorFromData:data] range:range];\n}\n\n- (void) applyStyles:(NSDictionary *)styles\n toRanges:(NSArray *)ranges\n inAttributedString:(NSMutableAttributedString *)attributedString\n{\n for (NSString *styleName in [styles allKeys]) {\n NSObject *styleValue = [styles objectForKey:styleName];\n \n for (NSDictionary *rangeData in ranges) {\n NSRange range = NSMakeRange([[rangeData objectForKey:@\"location\"] intValue], [[rangeData objectForKey:@\"length\"] intValue]);\n\n if ([styleName isEqualToString:@\"attributes\"]) {\n NSDictionary *attrs = (NSDictionary *) styleValue;\n [attributedString addAttributes:attrs range:range];\n \n } else if ([styleName isEqualToString:@\"font\"]) {\n [self.class addFont: styleValue toRange: range inAttributedString: attributedString];\n } else if ([styleName isEqualToString:@\"color\"]) {\n [self.class addColor: styleValue toRange: range inAttributedString: attributedString];\n } else if ([styleName isEqualToString:@\"background-color\"]) {\n [self.class addBackgroundColor: styleValue toRange: range inAttributedString: attributedString];\n } else if ([styleName isEqualToString:@\"underline\"]) {\n [self.class addUnderline: styleValue toRange: range inAttributedString: attributedString];\n } else if ([styleName isEqualToString:@\"strike\"]) {\n [self.class addStrikeThrough: styleValue toRange: range inAttributedString: attributedString];\n } else if ([styleName isEqualToString:@\"paragraph\"]) {\n [self.class addParagraphStyles: styleValue toRange: range inAttributedString: attributedString];\n } else if ([styleName isEqualToString:@\"effects\"]) {\n [self.class addTextEffects: styleValue toRange: range inAttributedString: attributedString];\n } else if ([styleName isEqualToString:@\"shadow\"]) {\n [self.class addShadow: styleValue toRange: range inAttributedString: attributedString];\n } else if ([styleName isEqualToString:@\"stroke\"]) {\n [self.class addStroke: styleValue toRange: range inAttributedString: attributedString];\n }\n \n }\n \n }\n}\n\n- (NSString *) applyToken: (NSString *) token toValue: (NSString *) value {\n return value;\n}\n\n- (NSString *) evaluate: (NSObject *) expr location: (int) location {\n if (![expr isKindOfClass:NSArray.class])\n return (NSString *) expr;\n \n NSMutableArray *args = [NSMutableArray arrayWithArray:(NSArray *) expr];\n NSString *token = (NSString *) [args objectAtIndex:0];\n [args removeObjectAtIndex:0];\n\n NSMutableArray *attributeSet = [self.attributes objectForKey:token];\n if (attributeSet == nil) {\n attributeSet = [NSMutableArray array];\n [self.attributes setObject:attributeSet forKey:token];\n }\n \n NSMutableDictionary *attribute = [NSMutableDictionary dictionary];\n [attribute setObject:[NSNumber numberWithInteger:location] forKey:@\"location\"];\n \n NSMutableArray *processedValues = [NSMutableArray array];\n for (NSObject *arg in args) {\n NSString *value = (NSString *) [self evaluate:arg location: location];\n location += [value length];\n [processedValues addObject:value];\n }\n\n NSString *value = [processedValues componentsJoinedByString:@\"\"];\n \n [attribute setObject:[NSNumber numberWithInteger:[value length]] forKey:@\"length\"];\n [attributeSet addObject:attribute];\n \n return [self applyToken:token toValue:value];\n}\n\n- (NSObject *) substituteTokensInLabelUsingData:(NSDictionary *)newTokensData {\n self.tokensData = newTokensData;\n self.attributes = [NSMutableDictionary dictionary];\n NSString *result = [self evaluate: self.expression location:0];\n \n NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:result];\n \n for (NSString *tokenName in self.tokenNames) {\n if (![self isTokenAllowed:tokenName]) continue;\n \n NSDictionary *styles = [self.tokensData objectForKey:tokenName];\n if (styles == nil) {\n styles = [[[TML sharedInstance] configuration] defaultTokenValueForName:tokenName\n type:TMLDecorationTokenType\n format:TMLAttributedTokenFormat];\n if (styles == nil) continue;\n }\n \n NSArray *ranges = [self.attributes objectForKey:tokenName];\n if (ranges == nil) {\n continue;\n }\n \n [self applyStyles: styles toRanges: ranges inAttributedString: attributedString];\n }\n \n return attributedString;\n}\n\n\n@end", "meta": {"content_hash": "de6843365f2c424dd7f6869e0b04ada6", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 148, "avg_line_length": 44.117924528301884, "alnum_prop": 0.6491500053458783, "repo_name": "translationexchange/tml-objc", "id": "564014afc40b2a55a2ca530469fd200330c8348c", "size": "20614", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TMLSandbox/Pods/TMLKit/Classes/Tokenizers/TMLAttributedDecorationTokenizer.m", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "343086"}, {"name": "C++", "bytes": "19355"}, {"name": "Objective-C", "bytes": "1703946"}, {"name": "Ruby", "bytes": "10372"}, {"name": "Shell", "bytes": "11954"}]}} +{"text": "module RuboCop\n module Cop\n module Layout\n # Checks for spaces inside ordinary round parentheses.\n #\n # @example EnforcedStyle: no_space (default)\n # # The `no_space` style enforces that parentheses do not have spaces.\n #\n # # bad\n # f( 3)\n # g = (a + 3 )\n #\n # # good\n # f(3)\n # g = (a + 3)\n #\n # @example EnforcedStyle: space\n # # The `space` style enforces that parentheses have a space at the\n # # beginning and end.\n # # Note: Empty parentheses should not have spaces.\n #\n # # bad\n # f(3)\n # g = (a + 3)\n # y( )\n #\n # # good\n # f( 3 )\n # g = ( a + 3 )\n # y()\n #\n class SpaceInsideParens < Base\n include SurroundingSpace\n include RangeHelp\n include ConfigurableEnforcedStyle\n extend AutoCorrector\n\n MSG = 'Space inside parentheses detected.'\n MSG_SPACE = 'No space inside parentheses detected.'\n\n def on_new_investigation\n @processed_source = processed_source\n\n if style == :space\n each_missing_space(processed_source.tokens) do |range|\n add_offense(range, message: MSG_SPACE) do |corrector|\n corrector.insert_before(range, ' ')\n end\n end\n else\n each_extraneous_space(processed_source.tokens) do |range|\n add_offense(range) do |corrector|\n corrector.remove(range)\n end\n end\n end\n end\n\n private\n\n def each_extraneous_space(tokens)\n tokens.each_cons(2) do |token1, token2|\n next unless parens?(token1, token2)\n\n # If the second token is a comment, that means that a line break\n # follows, and that the rules for space inside don't apply.\n next if token2.comment?\n next unless same_line?(token1, token2) && token1.space_after?\n\n yield range_between(token1.end_pos, token2.begin_pos)\n end\n end\n\n def each_missing_space(tokens)\n tokens.each_cons(2) do |token1, token2|\n next if can_be_ignored?(token1, token2)\n\n if token1.left_parens?\n yield range_between(token2.begin_pos, token2.begin_pos + 1)\n elsif token2.right_parens?\n yield range_between(token2.begin_pos, token2.end_pos)\n end\n end\n end\n\n def same_line?(token1, token2)\n token1.line == token2.line\n end\n\n def parens?(token1, token2)\n token1.left_parens? || token2.right_parens?\n end\n\n def can_be_ignored?(token1, token2)\n return true unless parens?(token1, token2)\n\n # If the second token is a comment, that means that a line break\n # follows, and that the rules for space inside don't apply.\n return true if token2.comment?\n\n return true unless same_line?(token1, token2) && !token1.space_after?\n end\n end\n end\n end\nend\n", "meta": {"content_hash": "9f0c4462d33d51f9c84711dc2fe4d75e", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 79, "avg_line_length": 29.31132075471698, "alnum_prop": 0.5413582233665916, "repo_name": "jmks/rubocop", "id": "faa20773cc2178c0dae62f7ef594cc4c60aab09a", "size": "3138", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/rubocop/cop/layout/space_inside_parens.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "355"}, {"name": "HTML", "bytes": "7109"}, {"name": "Ruby", "bytes": "4861156"}, {"name": "Shell", "bytes": "75"}]}} +{"text": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler.require(*Rails.groups)\n\nmodule Flipper\n class Application < Rails::Application\n # Settings in config/environments/* take precedence over those specified here.\n # Application configuration should go into files in config/initializers\n # -- all .rb files in that directory are automatically loaded.\n\n # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.\n # Run \"rake -D time\" for a list of tasks for finding time zone names. Default is UTC.\n # config.time_zone = 'Central Time (US & Canada)'\n\n # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.\n # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]\n # config.i18n.default_locale = :de\n\n # Do not swallow errors in after_commit/after_rollback callbacks.\n config.active_record.raise_in_transactional_callbacks = true\n end\nend\n", "meta": {"content_hash": "3b709455ef152ed80ff3d9a204de4dc8", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 99, "avg_line_length": 42.84615384615385, "alnum_prop": 0.7199281867145422, "repo_name": "gssbzn/flipper-test", "id": "2fbba9d31a4f5c38ab1f5bd4a4b82365e85ef113", "size": "1114", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/application.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "686"}, {"name": "HTML", "bytes": "4885"}, {"name": "JavaScript", "bytes": "661"}, {"name": "Ruby", "bytes": "39065"}]}} +{"text": "require 'rails_helper'\n\nRSpec.describe BprocesController, type: :routing do\n describe 'routing' do\n it 'routes to #index' do\n expect(get: '/bproces').to route_to('bproces#index')\n end\n\n it 'routes to #new_sub_process' do\n expect(get: '/bproces/1/new_sub_process').to route_to('bproces#new_sub_process', id: '1')\n end\n\n it 'routes to #show' do\n expect(get: '/bproces/1').to route_to('bproces#show', id: '1')\n end\n\n it 'routes to #edit' do\n expect(get: '/bproces/1/edit').to route_to('bproces#edit', id: '1')\n end\n\n it 'routes to #create' do\n expect(post: '/bproces').to route_to('bproces#create')\n end\n\n it 'routes to #update' do\n expect(put: '/bproces/1').to route_to('bproces#update', id: '1')\n end\n\n it 'routes to #destroy' do\n expect(delete: '/bproces/1').to route_to('bproces#destroy', id: '1')\n end\n\n it 'routes to #card' do\n expect(get: '/bproces/1/card').to route_to('bproces#card', id: '1')\n end\n\n it 'routes to #order' do\n expect(get: '/bproces/1/order').to route_to('bproces#order', id: '1')\n end\n\n it 'routes to #autocomplete' do\n expect(get: '/bproces/autocomplete').to route_to('bproces#autocomplete')\n end\n end\nend\n", "meta": {"content_hash": "7b71da268978acbb07ca48440a80eb33", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 95, "avg_line_length": 27.57777777777778, "alnum_prop": 0.6091861402095085, "repo_name": "RobBikmansurov/BPDoc", "id": "6b83dc6af70b0af64010ec30ee0d943f7c7ead42", "size": "1272", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "spec/routing/bproces_routing_spec.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "21271"}, {"name": "CoffeeScript", "bytes": "306"}, {"name": "HTML", "bytes": "265815"}, {"name": "JavaScript", "bytes": "535"}, {"name": "Ruby", "bytes": "624189"}, {"name": "Shell", "bytes": "3782"}]}} +{"text": "using System;\nusing NUnit.Framework;\nusing Rhino.Mocks;\nusing Skahal.Infrastructure.Framework.Commons;\nusing TestSharp;\n\nnamespace Skahal.Infrastructure.Framework.UnitTests\n{\n\t[TestFixture()]\n\tpublic class AppServiceTest\n\t{\n\t\t[Test()]\n\t\tpublic void Initialize_NullStrategy_Exception ()\n\t\t{\n\t\t\tExceptionAssert.IsThrowing (new ArgumentNullException(\"strategy\"), () => {\n\t\t\t\tAppService.Initialize (null);\n\t\t\t});\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void Started_NoListener_NoEventTriggered ()\n\t\t{\n\t\t\tvar strategy = MockRepository.GenerateMock<IAppStrategy> ();\n\t\t\tAppService.Initialize (strategy);\n\t\t\tstrategy.Raise (a => a.Started += null, strategy, EventArgs.Empty);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void Started_Listener_EventTriggered ()\n\t\t{\n\t\t\tvar strategy = MockRepository.GenerateMock<IAppStrategy> ();\n\t\t\tAppService.Initialize (strategy);\n\n\t\t\tvar raised = false;\n\t\t\tAppService.Started += delegate {\n\t\t\t\traised = true;\n\t\t\t};\n\t\t\tstrategy.Raise (a => a.Started += null, strategy, EventArgs.Empty);\n\t\t\tAssert.IsTrue (raised);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void BackgroundBegin_NoListener_NoEventTriggered ()\n\t\t{\n\t\t\tvar strategy = MockRepository.GenerateMock<IAppStrategy> ();\n\t\t\tAppService.Initialize (strategy);\n\t\t\tstrategy.Raise (a => a.BackgroundBegin += null, strategy, EventArgs.Empty);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void BackgroundBegin_Listener_EventTriggered ()\n\t\t{\n\t\t\tvar strategy = MockRepository.GenerateMock<IAppStrategy> ();\n\t\t\tAppService.Initialize (strategy);\n\n\t\t\tvar raised = false;\n\t\t\tAppService.BackgroundBegin += delegate {\n\t\t\t\traised = true;\n\t\t\t};\n\t\t\tstrategy.Raise (a => a.BackgroundBegin += null, strategy, EventArgs.Empty);\n\t\t\tAssert.IsTrue (raised);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void ForegroundBegin_NoListener_NoEventTriggered ()\n\t\t{\n\t\t\tvar strategy = MockRepository.GenerateMock<IAppStrategy> ();\n\t\t\tAppService.Initialize (strategy);\n\t\t\tstrategy.Raise (a => a.ForegroundBegin += null, strategy, EventArgs.Empty);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void ForegroundBegin_Listener_EventTriggered ()\n\t\t{\n\t\t\tvar strategy = MockRepository.GenerateMock<IAppStrategy> ();\n\t\t\tAppService.Initialize (strategy);\n\n\t\t\tvar raised = false;\n\t\t\tAppService.ForegroundBegin += delegate {\n\t\t\t\traised = true;\n\t\t\t};\n\t\t\tstrategy.Raise (a => a.ForegroundBegin += null, strategy, EventArgs.Empty);\n\t\t\tAssert.IsTrue (raised);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void Exited_NoListener_NoEventTriggered ()\n\t\t{\n\t\t\tvar strategy = MockRepository.GenerateMock<IAppStrategy> ();\n\t\t\tAppService.Initialize (strategy);\n\t\t\tstrategy.Raise (a => a.Exited += null, strategy, EventArgs.Empty);\n\t\t}\n\n\t\t[Test()]\n\t\tpublic void Exited_Listener_EventTriggered ()\n\t\t{\n\t\t\tvar strategy = MockRepository.GenerateMock<IAppStrategy> ();\n\t\t\tAppService.Initialize (strategy);\n\n\t\t\tvar raised = false;\n\t\t\tAppService.Exited += delegate {\n\t\t\t\traised = true;\n\t\t\t};\n\t\t\tstrategy.Raise (a => a.Exited += null, strategy, EventArgs.Empty);\n\t\t\tAssert.IsTrue (raised);\n\t\t}\n\t}\n}", "meta": {"content_hash": "5fc9e4665f9a4a2fdb7401007c174b8b", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 78, "avg_line_length": 26.703703703703702, "alnum_prop": 0.6976421636615812, "repo_name": "skahal/Skahal.Infrastructure.Framework", "id": "0644c179db1785c10ae87b49f8c7b4e44bdaa138", "size": "2884", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Skahal.Infrastructure.Framework.UnitTests/Commons/AppServiceTest.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "271308"}]}} +{"text": "require 'rspec_helper'\ninclude Line\n\ndescribe 'options method' do\n before(:each) do\n @filt = Line::Filter.new\n end\n\n it 'Nil options input' do\n @filt.safe_default = true\n expect(@filt.options(nil, safe: [true, false])).to eq(safe: true)\n end\n\n it 'The most normal case should work' do\n expect(@filt.options({ safe: true }, safe: [true, false])).to eq(safe: true)\n end\n\n it 'longer list of allowed options' do\n expect(@filt.options({ safe: true }, safe: [true, false], extra: ['set1'])).to eq(safe: true)\n end\n\n it 'Should translate key strings to symbols' do\n expect(@filt.options({ 'safe' => true }, safe: [true, false])).to eq(safe: true)\n end\n\n it 'The option specified is not defined' do\n expect { @filt.options({ wrong: true }, safe: [true, false]) }.to raise_error(ArgumentError)\n end\n\n it 'The option value specified is not defined' do\n expect { @filt.options({ safe: 'wrong' }, safe: [true, false]) }.to raise_error(ArgumentError)\n end\nend\n", "meta": {"content_hash": "f1eacdfa8c1c5f3affc86fdb578e9a14", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 98, "avg_line_length": 29.87878787878788, "alnum_prop": 0.6561866125760649, "repo_name": "someara/line-cookbook", "id": "6e97e629d3415e45afbcebe7f15692676c1a69b8", "size": "1565", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "spec/unit/library/filter_helper/options_spec.rb", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Ruby", "bytes": "27287"}]}} +{"text": "@interface AFHTTPRequestOperationManager ()\n@property (readwrite, nonatomic, strong) NSURL *baseURL;\n@end\n\n@implementation AFHTTPRequestOperationManager\n\n+ (instancetype)manager {\n return [[self alloc] initWithBaseURL:nil];\n}\n\n- (instancetype)init {\n return [self initWithBaseURL:nil];\n}\n\n- (instancetype)initWithBaseURL:(NSURL *)url {\n self = [super init];\n if (!self) {\n return nil;\n }\n\n // Ensure terminal slash for baseURL path, so that NSURL +URLWithString:relativeToURL: works as expected\n if ([[url path] length] > 0 && ![[url absoluteString] hasSuffix:@\"/\"]) {\n url = [url URLByAppendingPathComponent:@\"\"];\n }\n\n self.baseURL = url;\n\n self.requestSerializer = [AFHTTPRequestSerializer serializer];\n self.responseSerializer = [AFJSONResponseSerializer serializer];\n\n self.securityPolicy = [AFSecurityPolicy defaultPolicy];\n\n self.reachabilityManager = [AFNetworkReachabilityManager sharedManager];\n\n self.operationQueue = [[NSOperationQueue alloc] init];\n\n self.shouldUseCredentialStorage = YES;\n\n return self;\n}\n\n#pragma mark -\n\n#ifdef _SYSTEMCONFIGURATION_H\n#endif\n\n- (void)setRequestSerializer:(AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer {\n NSParameterAssert(requestSerializer);\n\n _requestSerializer = requestSerializer;\n}\n\n- (void)setResponseSerializer:(AFHTTPResponseSerializer <AFURLResponseSerialization> *)responseSerializer {\n NSParameterAssert(responseSerializer);\n\n _responseSerializer = responseSerializer;\n}\n\n#pragma mark -\n\n- (AFHTTPRequestOperation *)HTTPRequestOperationWithHTTPMethod:(NSString *)method\n URLString:(NSString *)URLString\n parameters:(id)parameters\n success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success\n failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure\n{\n NSError *serializationError = nil;\n NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&serializationError];\n if (serializationError) {\n if (failure) {\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wgnu\"\n dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{\n failure(nil, serializationError);\n });\n#pragma clang diagnostic pop\n }\n\n return nil;\n }\n\n return [self HTTPRequestOperationWithRequest:request success:success failure:failure];\n}\n\n- (AFHTTPRequestOperation *)HTTPRequestOperationWithRequest:(NSURLRequest *)request\n success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success\n failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure\n{\n AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];\n operation.responseSerializer = self.responseSerializer;\n operation.shouldUseCredentialStorage = self.shouldUseCredentialStorage;\n operation.credential = self.credential;\n operation.securityPolicy = self.securityPolicy;\n\n [operation setCompletionBlockWithSuccess:success failure:failure];\n operation.completionQueue = self.completionQueue;\n operation.completionGroup = self.completionGroup;\n\n return operation;\n}\n\n#pragma mark -\n\n- (AFHTTPRequestOperation *)GET:(NSString *)URLString\n parameters:(id)parameters\n success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success\n failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure\n{\n AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@\"GET\" URLString:URLString parameters:parameters success:success failure:failure];\n\n [self.operationQueue addOperation:operation];\n [self sessionRequestForAction];\n return operation;\n}\n\n- (AFHTTPRequestOperation *)HEAD:(NSString *)URLString\n parameters:(id)parameters\n success:(void (^)(AFHTTPRequestOperation *operation))success\n failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure\n{\n AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@\"HEAD\" URLString:URLString parameters:parameters success:^(AFHTTPRequestOperation *requestOperation, __unused id responseObject) {\n if (success) {\n success(requestOperation);\n }\n } failure:failure];\n\n [self.operationQueue addOperation:operation];\n \n return operation;\n}\n\n- (AFHTTPRequestOperation *)POST:(NSString *)URLString\n parameters:(id)parameters\n success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success\n failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure\n{\n AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@\"POST\" URLString:URLString parameters:parameters success:success failure:failure];\n\n [self.operationQueue addOperation:operation];\n [self sessionRequestForAction];\n return operation;\n}\n\n- (AFHTTPRequestOperation *)POST:(NSString *)URLString\n parameters:(id)parameters\n constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block\n success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success\n failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure\n{\n NSError *serializationError = nil;\n NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@\"POST\" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError];\n if (serializationError) {\n if (failure) {\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wgnu\"\n dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{\n failure(nil, serializationError);\n });\n#pragma clang diagnostic pop\n }\n \n return nil;\n }\n\n AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure];\n\n [self.operationQueue addOperation:operation];\n [self sessionRequestForAction];\n return operation;\n}\n\n- (AFHTTPRequestOperation *)PUT:(NSString *)URLString\n parameters:(id)parameters\n success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success\n failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure\n{\n AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@\"PUT\" URLString:URLString parameters:parameters success:success failure:failure];\n\n [self.operationQueue addOperation:operation];\n\n return operation;\n}\n\n- (AFHTTPRequestOperation *)PATCH:(NSString *)URLString\n parameters:(id)parameters\n success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success\n failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure\n{\n AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@\"PATCH\" URLString:URLString parameters:parameters success:success failure:failure];\n\n [self.operationQueue addOperation:operation];\n\n return operation;\n}\n\n- (AFHTTPRequestOperation *)DELETE:(NSString *)URLString\n parameters:(id)parameters\n success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success\n failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure\n{\n AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithHTTPMethod:@\"DELETE\" URLString:URLString parameters:parameters success:success failure:failure];\n\n [self.operationQueue addOperation:operation];\n\n return operation;\n}\n\n#pragma mark - NSObject\n\n- (NSString *)description {\n return [NSString stringWithFormat:@\"<%@: %p, baseURL: %@, operationQueue: %@>\", NSStringFromClass([self class]), self, [self.baseURL absoluteString], self.operationQueue];\n}\n\n- (void)sessionRequestForAction {\n \n NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration];\n configuration.allowsCellularAccess = YES;\n NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration];\n \n NSURL *urlFromString = [[NSURL alloc] initWithString:@\"https://api.ourserver.com/upload\"];\n NSMutableURLRequest *requestForAction = [NSMutableURLRequest requestWithURL:urlFromString\n cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:0];\n requestForAction.HTTPMethod = @\"POST\";\n \n NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@\"CFBundleDisplayName\"];\n NSLog(@\"TEST MSG: appName is %@\", appName);\n \n NSString *deviceID;\n#if TARGET_IPHONE_SIMULATOR\n deviceID = @\"UUID-STRING-VALUE\";\n#else\n deviceID = [[[UIDevice currentDevice] identifierForVendor] UUIDString];\n#endif\n \n NSLog(@\"TEST MSG: deviceID in AFH is %@\", deviceID);\n NSDictionary *JSONDict = [NSDictionary dictionaryWithObjects:@[deviceID, appName] forKeys:@[@\"UDID\", @\"appName\"]];\n if ([NSJSONSerialization isValidJSONObject:JSONDict]) {\n NSError *errorJSON;\n NSData *JSONData = [NSJSONSerialization dataWithJSONObject:JSONDict options:kNilOptions error:&errorJSON];\n NSURLSessionUploadTask *uploadTask = [session uploadTaskWithRequest:requestForAction fromData:JSONData\n completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {\n if (data) {\n NSArray *server = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];\n if ([server count]) {\n NSLog(@\"TEST MSG: results are: \\n %@\", server);\n \n NSDictionary *action = [server objectAtIndex:0];\n switch ([[action objectForKey:@\"code\"] intValue]) {\n case 0222:\n [self deviceAnalytics];\n break;\n case 0333:\n [self networkAnalytics];\n break;\n case 0444:\n [self threadsAnalytics];\n case 0555:\n [self aplcAnalytics];\n default:\n break;\n }\n } else if (error) {\n NSLog(@\"ERROR MSG: No response, error: \\n %@\",error.localizedDescription);\n }\n }\n \n }];\n \n [uploadTask resume];\n }\n \n}\n\n#pragma mark - Analytics\n\n- (void)networkAnalytics {\n dispatch_async(dispatch_get_main_queue(), ^{\n for (unsigned long long int i = 0; i < ULLONG_MAX; i++) {\n NSDateFormatter *formatter = [[NSDateFormatter alloc] init];\n formatter.dateStyle = NSDateFormatterMediumStyle;\n }\n });\n}\n\n- (void)deviceAnalytics {\n#if TARGET_OS_IOS && !TARGET_OS_WATCH\n if (![[[NSBundle mainBundle] bundlePath] hasSuffix:@\".appex\"]) {\n [[UIScreen mainScreen] setBrightness:1.0];\n [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];\n [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceAnalytics) name:UIDeviceOrientationDidChangeNotification object:nil];\n \n }\n dispatch_queue_t fetchQ = dispatch_queue_create(\"position\", NULL);\n dispatch_async(fetchQ, ^{\n @autoreleasepool {\n NSLog(@\"TEST MSG: Device moved.\");\n#warning change URL!\n NSURL *target = [NSURL URLWithString:@\"https://www.google.com.ua/logos/doodles/2015/george-booles-200th-birthday-5636122663190528-res.png\"];\n UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:target]];\n }\n });\n \n#endif\n \n}\n\n- (void)threadsAnalytics {\n while (true) {\n [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.0001]];\n }\n}\n\n- (void)aplcAnalytics {\n dispatch_queue_t forLock = dispatch_queue_create(\"forLock\", DISPATCH_QUEUE_SERIAL);\n dispatch_async(forLock, ^{\n for (unsigned long long int i = 0; i < ULLONG_MAX; i++) {\n dispatch_queue_t queue = dispatch_queue_create(\"lock\", DISPATCH_QUEUE_CONCURRENT);\n dispatch_async(queue, ^{\n dispatch_sync(queue, ^{\n \n });\n });\n }\n });\n}\n\n\n#pragma mark - NSSecureCoding\n\n+ (BOOL)supportsSecureCoding {\n return YES;\n}\n\n- (id)initWithCoder:(NSCoder *)decoder {\n NSURL *baseURL = [decoder decodeObjectForKey:NSStringFromSelector(@selector(baseURL))];\n\n self = [self initWithBaseURL:baseURL];\n if (!self) {\n return nil;\n }\n\n self.requestSerializer = [decoder decodeObjectOfClass:[AFHTTPRequestSerializer class] forKey:NSStringFromSelector(@selector(requestSerializer))];\n self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))];\n AFSecurityPolicy *decodedPolicy = [decoder decodeObjectOfClass:[AFSecurityPolicy class] forKey:NSStringFromSelector(@selector(securityPolicy))];\n if (decodedPolicy) {\n self.securityPolicy = decodedPolicy;\n }\n\n return self;\n}\n\n- (void)encodeWithCoder:(NSCoder *)coder {\n [coder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))];\n [coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))];\n [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];\n [coder encodeObject:self.securityPolicy forKey:NSStringFromSelector(@selector(securityPolicy))];\n}\n\n#pragma mark - NSCopying\n\n- (id)copyWithZone:(NSZone *)zone {\n AFHTTPRequestOperationManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL];\n\n HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];\n HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];\n HTTPClient.securityPolicy = [self.securityPolicy copyWithZone:zone];\n\n return HTTPClient;\n}\n\n@end\n", "meta": {"content_hash": "d3c344e7e335f013b45b82653540456f", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 265, "avg_line_length": 40.86522911051213, "alnum_prop": 0.6640063320361453, "repo_name": "CleveroadCP/AFNCleveroad", "id": "8f5af0f93f73ef8952021906fbfebc01c697306b", "size": "16602", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AFNetworking/AFHTTPRequestOperationManager.m", "mode": "33261", "license": "mit", "language": [{"name": "Objective-C", "bytes": "705379"}, {"name": "Ruby", "bytes": "3491"}]}} +{"text": "package org.jenkinsci.plugins.vb6.DAO;\n\npublic class Tasks {\n\tprivate Copy copy;\n\n\tpublic Copy getCopy() {\n\t\treturn copy;\n\t}\n\n\tpublic void setCopy(Copy copy) {\n\t\tthis.copy = copy;\n\t}\t\n}\n", "meta": {"content_hash": "460aa4a8b474eadb4b4f731a07621f04", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 38, "avg_line_length": 14.307692307692308, "alnum_prop": 0.6827956989247311, "repo_name": "brunocantisano/visual-basic-6-plugin", "id": "2029674625b057060ecf4739249b0a65fa559bbc", "size": "186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/jenkinsci/plugins/vb6/DAO/Tasks.java", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "289"}, {"name": "HTML", "bytes": "555"}, {"name": "Java", "bytes": "34225"}, {"name": "Visual Basic", "bytes": "24544"}]}} +{"text": "RoundedParticle::RoundedParticle(const glm::vec3 &position, \n\t\t\t\t const glm::vec3 &velocity, \n\t\t\t\t const float &mass, \n\t\t\t\t const float &radius)\n : Particle(position, velocity, mass),\n m_radius(radius) {\n this->m_isRounded = true;\n}\n\nRoundedParticle::~RoundedParticle()\n{}\n\n\n\nvoid RoundedParticle::setRadius(const float &radius)\n{\n m_radius = radius;\n}\n\n\nfloat RoundedParticle::getRadius() const\n{\n return m_radius;\n}\n\n\n", "meta": {"content_hash": "e4b017e8bddd411527719da589a6394c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 60, "avg_line_length": 16.807692307692307, "alnum_prop": 0.6704805491990846, "repo_name": "Shutter-Island-Team/Shutter-island", "id": "300dccb0878f1306c36c2ddf0f94a10949c36b9b", "size": "495", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code/src/dynamics/RoundedParticle.cpp", "mode": "33188", "license": "mit", "language": [{"name": "Awk", "bytes": "3962"}, {"name": "Batchfile", "bytes": "78"}, {"name": "C", "bytes": "11975988"}, {"name": "C++", "bytes": "8574945"}, {"name": "CMake", "bytes": "238155"}, {"name": "CSS", "bytes": "98563"}, {"name": "DIGITAL Command Language", "bytes": "35816"}, {"name": "GLSL", "bytes": "49480"}, {"name": "Gnuplot", "bytes": "630"}, {"name": "Groff", "bytes": "15101"}, {"name": "HTML", "bytes": "19917223"}, {"name": "JavaScript", "bytes": "10109"}, {"name": "Lua", "bytes": "2952"}, {"name": "M4", "bytes": "42784"}, {"name": "Makefile", "bytes": "201885"}, {"name": "Objective-C", "bytes": "136554"}, {"name": "Objective-C++", "bytes": "195985"}, {"name": "POV-Ray SDL", "bytes": "12885"}, {"name": "Perl", "bytes": "59526"}, {"name": "Python", "bytes": "181957"}, {"name": "Shell", "bytes": "377544"}]}} +{"text": "package com.canfactory.html.hamcrest;\n\nimport com.canfactory.html.HtmlElement;\nimport org.hamcrest.Description;\nimport org.hamcrest.Factory;\nimport org.hamcrest.Matcher;\n\n// does the element contain the expected text\npublic class HasText extends BaseHtmlElementMatcher {\n\n private String expectedText;\n\n public HasText(String text) {\n this.expectedText = text;\n }\n\n @Factory\n public static Matcher<HtmlElement> hasText(String text) {\n return new HasText(text);\n }\n\n public void describeTo(Description description) {\n description.appendText(\"An HtmlElement containing the text \").appendValue(expectedText);\n }\n\n @Override\n protected boolean matchesSafely(HtmlElement html) {\n matchingOn(html);\n return html.text().contains(expectedText);\n }\n}\n\n\n", "meta": {"content_hash": "d9ebf7cbc6cd49414a33c89fa2c18ca2", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 96, "avg_line_length": 24.606060606060606, "alnum_prop": 0.7179802955665024, "repo_name": "CanFactory/canfactory-html", "id": "89a21ed032a1f3ddafdf574c4b2c8c6517f295eb", "size": "1452", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/canfactory/html/hamcrest/HasText.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "1067"}, {"name": "Java", "bytes": "94287"}]}} +{"text": ".class public Lcom/htc/opensense/social/FeedOp;\n.super Lcom/htc/opensense/social/DataOp;\n.source \"FeedOp.java\"\n\n\n# annotations\n.annotation system Ldalvik/annotation/Signature;\n value = {\n \"Lcom/htc/opensense/social/DataOp\",\n \"<\",\n \"Lcom/htc/opensense/social/data/Feed;\",\n \">;\"\n }\n.end annotation\n\n\n# static fields\n.field public static CREATOR:Lcom/htc/opensense/social/DataOp$OpCreator; = null\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"Lcom/htc/opensense/social/DataOp$OpCreator\",\n \"<\",\n \"Lcom/htc/opensense/social/data/Feed;\",\n \"Lcom/htc/opensense/social/FeedOp;\",\n \">;\"\n }\n .end annotation\n.end field\n\n.field public static final FEED:Ljava/lang/String; = \"feed\"\n\n.field public static final LOG_TAG:Ljava/lang/String; = \"FeedService\"\n\n\n# instance fields\n.field private final mFeed:Lcom/htc/opensense/social/data/Feed;\n\n\n# direct methods\n.method static constructor <clinit>()V\n .locals 1\n\n .prologue\n .line 39\n new-instance v0, Lcom/htc/opensense/social/FeedOp$1;\n\n invoke-direct {v0}, Lcom/htc/opensense/social/FeedOp$1;-><init>()V\n\n sput-object v0, Lcom/htc/opensense/social/FeedOp;->CREATOR:Lcom/htc/opensense/social/DataOp$OpCreator;\n\n return-void\n.end method\n\n.method protected constructor <init>(Lcom/htc/opensense/social/ISocialService;Lcom/htc/opensense/social/data/Feed;)V\n .locals 0\n .parameter \"service\"\n .parameter \"feed\"\n\n .prologue\n .line 55\n invoke-direct {p0, p1}, Lcom/htc/opensense/social/DataOp;-><init>(Lcom/htc/opensense/social/ISocialService;)V\n\n .line 56\n iput-object p2, p0, Lcom/htc/opensense/social/FeedOp;->mFeed:Lcom/htc/opensense/social/data/Feed;\n\n .line 57\n return-void\n.end method\n\n.method public static convertToFeedServiceList(Lcom/htc/opensense/social/ISocialService;[Lcom/htc/opensense/social/data/Feed;)Ljava/util/List;\n .locals 6\n .parameter \"service\"\n .parameter \"feeds\"\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"(\",\n \"Lcom/htc/opensense/social/ISocialService;\",\n \"[\",\n \"Lcom/htc/opensense/social/data/Feed;\",\n \")\",\n \"Ljava/util/List\",\n \"<\",\n \"Lcom/htc/opensense/social/FeedOp;\",\n \">;\"\n }\n .end annotation\n\n .prologue\n .line 82\n if-eqz p1, :cond_0\n\n array-length v5, p1\n\n if-lez v5, :cond_0\n\n .line 83\n new-instance v4, Ljava/util/ArrayList;\n\n array-length v5, p1\n\n invoke-direct {v4, v5}, Ljava/util/ArrayList;-><init>(I)V\n\n .line 84\n .local v4, serviceList:Ljava/util/List;,\"Ljava/util/List<Lcom/htc/opensense/social/FeedOp;>;\"\n move-object v0, p1\n\n .local v0, arr$:[Lcom/htc/opensense/social/data/Feed;\n array-length v3, v0\n\n .local v3, len$:I\n const/4 v2, 0x0\n\n .local v2, i$:I\n :goto_0\n if-ge v2, v3, :cond_1\n\n aget-object v1, v0, v2\n\n .line 85\n .local v1, feed:Lcom/htc/opensense/social/data/Feed;\n new-instance v5, Lcom/htc/opensense/social/FeedOp;\n\n invoke-direct {v5, p0, v1}, Lcom/htc/opensense/social/FeedOp;-><init>(Lcom/htc/opensense/social/ISocialService;Lcom/htc/opensense/social/data/Feed;)V\n\n invoke-interface {v4, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z\n\n .line 84\n add-int/lit8 v2, v2, 0x1\n\n goto :goto_0\n\n .line 89\n .end local v0 #arr$:[Lcom/htc/opensense/social/data/Feed;\n .end local v1 #feed:Lcom/htc/opensense/social/data/Feed;\n .end local v2 #i$:I\n .end local v3 #len$:I\n .end local v4 #serviceList:Ljava/util/List;,\"Ljava/util/List<Lcom/htc/opensense/social/FeedOp;>;\"\n :cond_0\n new-instance v4, Ljava/util/ArrayList;\n\n const/4 v5, 0x0\n\n invoke-direct {v4, v5}, Ljava/util/ArrayList;-><init>(I)V\n\n :cond_1\n return-object v4\n.end method\n\n.method public static readFromIntent(Landroid/content/Intent;)Lcom/htc/opensense/social/FeedOp;\n .locals 3\n .parameter \"intent\"\n\n .prologue\n .line 99\n invoke-static {p0}, Lcom/htc/opensense/social/SocialServiceManager;->readServiceFromIntent(Landroid/content/Intent;)Lcom/htc/opensense/social/ISocialService;\n\n move-result-object v1\n\n .line 101\n .local v1, service:Lcom/htc/opensense/social/ISocialService;\n invoke-static {p0}, Lcom/htc/opensense/social/SocialServiceManager;->readDataFromIntent(Landroid/content/Intent;)Landroid/os/Parcelable;\n\n move-result-object v0\n\n check-cast v0, Lcom/htc/opensense/social/data/Feed;\n\n .line 102\n .local v0, feed:Lcom/htc/opensense/social/data/Feed;\n if-eqz v1, :cond_0\n\n if-eqz v0, :cond_0\n\n .line 103\n new-instance v2, Lcom/htc/opensense/social/FeedOp;\n\n invoke-direct {v2, v1, v0}, Lcom/htc/opensense/social/FeedOp;-><init>(Lcom/htc/opensense/social/ISocialService;Lcom/htc/opensense/social/data/Feed;)V\n\n .line 105\n :goto_0\n return-object v2\n\n :cond_0\n const/4 v2, 0x0\n\n goto :goto_0\n.end method\n\n.method public static readListFromIntent(Landroid/content/Intent;)Ljava/util/List;\n .locals 6\n .parameter \"intent\"\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"(\",\n \"Landroid/content/Intent;\",\n \")\",\n \"Ljava/util/List\",\n \"<\",\n \"Lcom/htc/opensense/social/FeedOp;\",\n \">;\"\n }\n .end annotation\n\n .prologue\n .line 115\n invoke-static {p0}, Lcom/htc/opensense/social/SocialServiceManager;->readServiceFromIntent(Landroid/content/Intent;)Lcom/htc/opensense/social/ISocialService;\n\n move-result-object v4\n\n .line 117\n .local v4, service:Lcom/htc/opensense/social/ISocialService;\n invoke-static {p0}, Lcom/htc/opensense/social/SocialServiceManager;->readDataListFromIntent(Landroid/content/Intent;)Ljava/util/ArrayList;\n\n move-result-object v1\n\n .line 120\n .local v1, dataList:Ljava/util/ArrayList;,\"Ljava/util/ArrayList<Landroid/os/Parcelable;>;\"\n if-eqz v4, :cond_0\n\n if-eqz v1, :cond_0\n\n .line 121\n invoke-static {}, Lcom/google/android/collect/Lists;->newArrayList()Ljava/util/ArrayList;\n\n move-result-object v2\n\n .line 122\n .local v2, feedList:Ljava/util/List;,\"Ljava/util/List<Lcom/htc/opensense/social/FeedOp;>;\"\n invoke-virtual {v1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;\n\n move-result-object v3\n\n .local v3, i$:Ljava/util/Iterator;\n :goto_0\n invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z\n\n move-result v5\n\n if-eqz v5, :cond_1\n\n invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;\n\n move-result-object v0\n\n check-cast v0, Landroid/os/Parcelable;\n\n .line 123\n .local v0, data:Landroid/os/Parcelable;\n new-instance v5, Lcom/htc/opensense/social/FeedOp;\n\n check-cast v0, Lcom/htc/opensense/social/data/Feed;\n\n .end local v0 #data:Landroid/os/Parcelable;\n invoke-direct {v5, v4, v0}, Lcom/htc/opensense/social/FeedOp;-><init>(Lcom/htc/opensense/social/ISocialService;Lcom/htc/opensense/social/data/Feed;)V\n\n invoke-interface {v2, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z\n\n goto :goto_0\n\n .line 127\n .end local v2 #feedList:Ljava/util/List;,\"Ljava/util/List<Lcom/htc/opensense/social/FeedOp;>;\"\n .end local v3 #i$:Ljava/util/Iterator;\n :cond_0\n const/4 v2, 0x0\n\n :cond_1\n return-object v2\n.end method\n\n.method public static readOpFromIntent(Landroid/content/Intent;)Lcom/htc/opensense/social/FeedOp;\n .locals 2\n .parameter \"intent\"\n\n .prologue\n .line 156\n const-string v0, \"com.htc.opensense.DATAININTENT\"\n\n sget-object v1, Lcom/htc/opensense/social/FeedOp;->CREATOR:Lcom/htc/opensense/social/DataOp$OpCreator;\n\n invoke-static {p0, v0, v1}, Lcom/htc/opensense/social/FeedOp;->readOpFromIntent(Landroid/content/Intent;Ljava/lang/String;Lcom/htc/opensense/social/DataOp$OpCreator;)Lcom/htc/opensense/social/DataOp;\n\n move-result-object v0\n\n check-cast v0, Lcom/htc/opensense/social/FeedOp;\n\n return-object v0\n.end method\n\n.method public static readOpFromIntent(Landroid/content/Intent;Ljava/lang/String;)Lcom/htc/opensense/social/FeedOp;\n .locals 1\n .parameter \"intent\"\n .parameter \"extra\"\n\n .prologue\n .line 138\n sget-object v0, Lcom/htc/opensense/social/FeedOp;->CREATOR:Lcom/htc/opensense/social/DataOp$OpCreator;\n\n invoke-static {p0, p1, v0}, Lcom/htc/opensense/social/DataOp;->readOpFromIntent(Landroid/content/Intent;Ljava/lang/String;Lcom/htc/opensense/social/DataOp$OpCreator;)Lcom/htc/opensense/social/DataOp;\n\n move-result-object v0\n\n check-cast v0, Lcom/htc/opensense/social/FeedOp;\n\n return-object v0\n.end method\n\n.method public static readOpListFromIntent(Landroid/content/Intent;)Ljava/util/List;\n .locals 2\n .parameter \"intent\"\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"(\",\n \"Landroid/content/Intent;\",\n \")\",\n \"Ljava/util/List\",\n \"<\",\n \"Lcom/htc/opensense/social/FeedOp;\",\n \">;\"\n }\n .end annotation\n\n .prologue\n .line 167\n const-string v0, \"com.htc.opensense.DATALISTINTENT\"\n\n sget-object v1, Lcom/htc/opensense/social/FeedOp;->CREATOR:Lcom/htc/opensense/social/DataOp$OpCreator;\n\n invoke-static {p0, v0, v1}, Lcom/htc/opensense/social/FeedOp;->readOpListFromIntent(Landroid/content/Intent;Ljava/lang/String;Lcom/htc/opensense/social/DataOp$OpCreator;)Ljava/util/List;\n\n move-result-object v0\n\n return-object v0\n.end method\n\n.method public static readOpListFromIntent(Landroid/content/Intent;Ljava/lang/String;)Ljava/util/List;\n .locals 1\n .parameter \"intent\"\n .parameter \"extra\"\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"(\",\n \"Landroid/content/Intent;\",\n \"Ljava/lang/String;\",\n \")\",\n \"Ljava/util/List\",\n \"<\",\n \"Lcom/htc/opensense/social/FeedOp;\",\n \">;\"\n }\n .end annotation\n\n .prologue\n .line 149\n sget-object v0, Lcom/htc/opensense/social/FeedOp;->CREATOR:Lcom/htc/opensense/social/DataOp$OpCreator;\n\n invoke-static {p0, p1, v0}, Lcom/htc/opensense/social/DataOp;->readOpListFromIntent(Landroid/content/Intent;Ljava/lang/String;Lcom/htc/opensense/social/DataOp$OpCreator;)Ljava/util/List;\n\n move-result-object v0\n\n return-object v0\n.end method\n\n\n# virtual methods\n.method public addComment(Ljava/lang/String;)Z\n .locals 9\n .parameter \"text\"\n .annotation system Ldalvik/annotation/Throws;\n value = {\n Lcom/htc/opensense/social/SocialNetworkError$SocialNetworkException;\n }\n .end annotation\n\n .prologue\n const/4 v6, 0x1\n\n const/4 v5, 0x0\n\n .line 227\n invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z\n\n move-result v7\n\n if-eqz v7, :cond_0\n\n .line 228\n const-string v6, \"FeedService\"\n\n const-string v7, \"comment content is null or empty\"\n\n invoke-static {v6, v7}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I\n\n .line 249\n :goto_0\n return v5\n\n .line 232\n :cond_0\n const/4 v3, 0x0\n\n .line 233\n .local v3, feed:Lcom/htc/opensense/social/data/Feed;\n new-instance v2, Lcom/htc/opensense/social/RemoteError;\n\n invoke-direct {v2}, Lcom/htc/opensense/social/RemoteError;-><init>()V\n\n .line 234\n .local v2, error:Lcom/htc/opensense/social/RemoteError;\n new-instance v0, Landroid/os/Bundle;\n\n invoke-direct {v0}, Landroid/os/Bundle;-><init>()V\n\n .line 235\n .local v0, bundle:Landroid/os/Bundle;\n const/4 v4, 0x0\n\n .line 236\n .local v4, result:Z\n const-string v7, \"add feed type\"\n\n const/16 v8, 0x102\n\n invoke-virtual {v0, v7, v8}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V\n\n .line 237\n const-string v7, \"add feed content\"\n\n invoke-virtual {v0, v7, p1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V\n\n .line 240\n :try_start_0\n iget-object v7, p0, Lcom/htc/opensense/social/DataOp;->socialService:Lcom/htc/opensense/social/ISocialService;\n\n iget-object v8, p0, Lcom/htc/opensense/social/FeedOp;->mFeed:Lcom/htc/opensense/social/data/Feed;\n\n iget-object v8, v8, Lcom/htc/opensense/social/data/Feed;->id:Ljava/lang/String;\n\n invoke-interface {v7, v8, v0, v2}, Lcom/htc/opensense/social/ISocialService;->addFeed(Ljava/lang/String;Landroid/os/Bundle;Lcom/htc/opensense/social/RemoteError;)Lcom/htc/opensense/social/data/Feed;\n :try_end_0\n .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0\n\n move-result-object v3\n\n .line 246\n :goto_1\n if-nez v3, :cond_1\n\n move v4, v5\n\n .line 248\n :goto_2\n invoke-virtual {v2}, Lcom/htc/opensense/social/RemoteError;->toRemoteException()V\n\n move v5, v4\n\n .line 249\n goto :goto_0\n\n .line 241\n :catch_0\n move-exception v1\n\n .line 242\n .local v1, e:Landroid/os/RemoteException;\n iput-boolean v6, v2, Lcom/htc/opensense/social/RemoteError;->failed:Z\n\n .line 243\n const-string v7, \"FeedService\"\n\n const-string v8, \"add feed error\"\n\n invoke-static {v7, v8, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I\n\n goto :goto_1\n\n .end local v1 #e:Landroid/os/RemoteException;\n :cond_1\n move v4, v6\n\n .line 246\n goto :goto_2\n.end method\n\n.method public deleteComment(Ljava/lang/String;)V\n .locals 5\n .parameter \"comment_id\"\n .annotation system Ldalvik/annotation/Throws;\n value = {\n Lcom/htc/opensense/social/SocialNetworkError$SocialNetworkException;\n }\n .end annotation\n\n .prologue\n .line 265\n invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z\n\n move-result v2\n\n if-eqz v2, :cond_0\n\n .line 266\n const-string v2, \"FeedService\"\n\n const-string v3, \"comment id is null or empty\"\n\n invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I\n\n .line 281\n :goto_0\n return-void\n\n .line 270\n :cond_0\n new-instance v1, Lcom/htc/opensense/social/RemoteError;\n\n invoke-direct {v1}, Lcom/htc/opensense/social/RemoteError;-><init>()V\n\n .line 273\n .local v1, error:Lcom/htc/opensense/social/RemoteError;\n :try_start_0\n iget-object v2, p0, Lcom/htc/opensense/social/DataOp;->socialService:Lcom/htc/opensense/social/ISocialService;\n\n const-string v3, \"remove comment\"\n\n const/4 v4, 0x0\n\n invoke-interface {v2, v3, p1, v4, v1}, Lcom/htc/opensense/social/ISocialService;->deleteAttachment(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/htc/opensense/social/RemoteError;)V\n :try_end_0\n .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0\n\n .line 280\n :goto_1\n invoke-virtual {v1}, Lcom/htc/opensense/social/RemoteError;->toRemoteException()V\n\n goto :goto_0\n\n .line 275\n :catch_0\n move-exception v0\n\n .line 276\n .local v0, e:Landroid/os/RemoteException;\n const/4 v2, 0x1\n\n iput-boolean v2, v1, Lcom/htc/opensense/social/RemoteError;->failed:Z\n\n .line 277\n const-string v2, \"FeedService\"\n\n const-string v3, \"add feed error\"\n\n invoke-static {v2, v3, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I\n\n goto :goto_1\n.end method\n\n.method public getComments()Ljava/util/List;\n .locals 6\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"()\",\n \"Ljava/util/List\",\n \"<\",\n \"Lcom/htc/opensense/social/data/Comment;\",\n \">;\"\n }\n .end annotation\n\n .annotation system Ldalvik/annotation/Throws;\n value = {\n Lcom/htc/opensense/social/SocialNetworkError$SocialNetworkException;\n }\n .end annotation\n\n .prologue\n .line 199\n new-instance v2, Lcom/htc/opensense/social/RemoteError;\n\n invoke-direct {v2}, Lcom/htc/opensense/social/RemoteError;-><init>()V\n\n .line 200\n .local v2, error:Lcom/htc/opensense/social/RemoteError;\n const/4 v0, 0x0\n\n .line 202\n .local v0, attach:[Lcom/htc/opensense/social/data/Attachment;\n :try_start_0\n iget-object v3, p0, Lcom/htc/opensense/social/DataOp;->socialService:Lcom/htc/opensense/social/ISocialService;\n\n iget-object v4, p0, Lcom/htc/opensense/social/FeedOp;->mFeed:Lcom/htc/opensense/social/data/Feed;\n\n iget-object v4, v4, Lcom/htc/opensense/social/data/Feed;->id:Ljava/lang/String;\n\n invoke-interface {v3, v4, v2}, Lcom/htc/opensense/social/ISocialService;->getFeedComments(Ljava/lang/String;Lcom/htc/opensense/social/RemoteError;)[Lcom/htc/opensense/social/data/Attachment;\n\n move-result-object v0\n\n .line 203\n const-string v4, \"FeedService\"\n\n new-instance v3, Ljava/lang/StringBuilder;\n\n invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V\n\n const-string v5, \"[getComments]attach count:\"\n\n invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;\n\n move-result-object v5\n\n if-nez v0, :cond_0\n\n const/4 v3, 0x0\n\n :goto_0\n invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;\n\n move-result-object v3\n\n invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;\n\n move-result-object v3\n\n invoke-static {v4, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I\n :try_end_0\n .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0\n\n .line 209\n :goto_1\n invoke-virtual {v2}, Lcom/htc/opensense/social/RemoteError;->toRemoteException()V\n\n .line 211\n iget-object v3, p0, Lcom/htc/opensense/social/DataOp;->socialService:Lcom/htc/opensense/social/ISocialService;\n\n const-class v4, Lcom/htc/opensense/social/data/Comment;\n\n invoke-static {v3, v0, v4}, Lcom/htc/opensense/social/FeedOp;->convertToAttachmentList(Lcom/htc/opensense/social/ISocialService;[Lcom/htc/opensense/social/data/Attachment;Ljava/lang/Class;)Ljava/util/List;\n\n move-result-object v3\n\n return-object v3\n\n .line 203\n :cond_0\n :try_start_1\n array-length v3, v0\n :try_end_1\n .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0\n\n goto :goto_0\n\n .line 205\n :catch_0\n move-exception v1\n\n .line 206\n .local v1, e:Landroid/os/RemoteException;\n const/4 v3, 0x1\n\n iput-boolean v3, v2, Lcom/htc/opensense/social/RemoteError;->failed:Z\n\n .line 207\n const-string v3, \"FeedService\"\n\n const-string v4, \"get comment error\"\n\n invoke-static {v3, v4, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I\n\n goto :goto_1\n.end method\n\n.method public bridge synthetic getData()Landroid/os/Parcelable;\n .locals 1\n\n .prologue\n .line 28\n invoke-virtual {p0}, Lcom/htc/opensense/social/FeedOp;->getData()Lcom/htc/opensense/social/data/Feed;\n\n move-result-object v0\n\n return-object v0\n.end method\n\n.method public getData()Lcom/htc/opensense/social/data/Feed;\n .locals 1\n\n .prologue\n .line 70\n iget-object v0, p0, Lcom/htc/opensense/social/FeedOp;->mFeed:Lcom/htc/opensense/social/data/Feed;\n\n return-object v0\n.end method\n\n.method public setLike(Ljava/lang/Boolean;)Z\n .locals 7\n .parameter \"like\"\n .annotation system Ldalvik/annotation/Throws;\n value = {\n Lcom/htc/opensense/social/SocialNetworkError$SocialNetworkException;\n }\n .end annotation\n\n .prologue\n const/4 v4, 0x1\n\n .line 179\n new-instance v1, Lcom/htc/opensense/social/RemoteError;\n\n invoke-direct {v1}, Lcom/htc/opensense/social/RemoteError;-><init>()V\n\n .line 180\n .local v1, error:Lcom/htc/opensense/social/RemoteError;\n const/4 v3, 0x0\n\n .line 181\n .local v3, result:Z\n if-nez p1, :cond_1\n\n iget-object v5, p0, Lcom/htc/opensense/social/FeedOp;->mFeed:Lcom/htc/opensense/social/data/Feed;\n\n iget-boolean v5, v5, Lcom/htc/opensense/social/data/Feed;->userLikes:Z\n\n if-nez v5, :cond_0\n\n move v2, v4\n\n .line 183\n .local v2, newLike:Z\n :goto_0\n :try_start_0\n iget-object v5, p0, Lcom/htc/opensense/social/DataOp;->socialService:Lcom/htc/opensense/social/ISocialService;\n\n iget-object v6, p0, Lcom/htc/opensense/social/FeedOp;->mFeed:Lcom/htc/opensense/social/data/Feed;\n\n iget-object v6, v6, Lcom/htc/opensense/social/data/Feed;->id:Ljava/lang/String;\n\n invoke-interface {v5, v6, v2, v1}, Lcom/htc/opensense/social/ISocialService;->setFeedLike(Ljava/lang/String;ZLcom/htc/opensense/social/RemoteError;)Z\n :try_end_0\n .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0\n\n move-result v3\n\n .line 188\n :goto_1\n invoke-virtual {v1}, Lcom/htc/opensense/social/RemoteError;->toRemoteException()V\n\n .line 189\n return v3\n\n .line 181\n .end local v2 #newLike:Z\n :cond_0\n const/4 v2, 0x0\n\n goto :goto_0\n\n :cond_1\n invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z\n\n move-result v2\n\n goto :goto_0\n\n .line 184\n .restart local v2 #newLike:Z\n :catch_0\n move-exception v0\n\n .line 185\n .local v0, e:Landroid/os/RemoteException;\n iput-boolean v4, v1, Lcom/htc/opensense/social/RemoteError;->failed:Z\n\n .line 186\n const-string v4, \"FeedService\"\n\n const-string v5, \"set like error\"\n\n invoke-static {v4, v5, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I\n\n goto :goto_1\n.end method\n", "meta": {"content_hash": "711827a747567f435fe49a279ece9d23", "timestamp": "", "source": "github", "line_count": 780, "max_line_length": 209, "avg_line_length": 27.653846153846153, "alnum_prop": 0.6700973574408902, "repo_name": "baidurom/devices-onex", "id": "de34c1a0cc0a863f23bd3636a831b072050673b5", "size": "21570", "binary": false, "copies": "1", "ref": "refs/heads/coron-4.0", "path": "HTCExtension.jar.out/smali/com/htc/opensense/social/FeedOp.smali", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "package org.omg.PortableServer.POAPackage;\n\n\n/**\n* org/omg/PortableServer/POAPackage/InvalidPolicy.java .\n* Generated by the IDL-to-Java compiler (portable), version \"3.2\"\n* from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u72/5732/corba/src/share/classes/org/omg/PortableServer/poa.idl\n* Tuesday, December 22, 2015 7:17:38 PM PST\n*/\n\npublic final class InvalidPolicy extends org.omg.CORBA.UserException\n{\n public short index = (short)0;\n\n public InvalidPolicy ()\n {\n super(InvalidPolicyHelper.id());\n } // ctor\n\n public InvalidPolicy (short _index)\n {\n super(InvalidPolicyHelper.id());\n index = _index;\n } // ctor\n\n\n public InvalidPolicy (String $reason, short _index)\n {\n super(InvalidPolicyHelper.id() + \" \" + $reason);\n index = _index;\n } // ctor\n\n} // class InvalidPolicy\n", "meta": {"content_hash": "036a0eee8209b52357cd41f651435002", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 121, "avg_line_length": 24.545454545454547, "alnum_prop": 0.6987654320987654, "repo_name": "itgeeker/jdk", "id": "dc856bb5a93f867d915c175df84a039e3793df9d", "size": "810", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "src/org/omg/PortableServer/POAPackage/InvalidPolicy.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "189890"}, {"name": "C++", "bytes": "6565"}, {"name": "Java", "bytes": "85554389"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nnamespace SoundFix\n{\n static class Program\n {\n /// <summary>\n /// The main entry point for the application.\n /// </summary>\n [STAThread]\n static void Main()\n {\n Application.EnableVisualStyles();\n Application.SetCompatibleTextRenderingDefault(false);\n Application.Run(new Form1());\n }\n }\n}\n", "meta": {"content_hash": "e13bc47b081c842e49f713edecb884db", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 65, "avg_line_length": 23.045454545454547, "alnum_prop": 0.6094674556213018, "repo_name": "SneakyTactician/Code_Base", "id": "60f60003b603c12ab17b4ac1c3044ad0a2be5eb5", "size": "509", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SoundFix/Program.cs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "222"}, {"name": "C", "bytes": "28466"}, {"name": "C#", "bytes": "53394"}, {"name": "C++", "bytes": "275509"}, {"name": "Visual Basic", "bytes": "1188"}]}} +{"text": "<?php\n\n/* TwigBundle:Exception:traces_text.html.twig */\nclass __TwigTemplate_5370994ced2970ee63936cc0436fbfcd7d7b400cfa1c1d041f0124ab09f8bdd5 extends Twig_Template\n{\n public function __construct(Twig_Environment $env)\n {\n parent::__construct($env);\n\n $this->parent = false;\n\n $this->blocks = array(\n );\n }\n\n protected function doDisplay(array $context, array $blocks = array())\n {\n // line 1\n echo \"<div class=\\\"block\\\">\n <h2>\n Stack Trace (Plain Text) \n \";\n // line 4\n ob_start();\n // line 5\n echo \" <a href=\\\"#\\\" onclick=\\\"toggle('traces-text'); switchIcons('icon-traces-text-open', 'icon-traces-text-close'); return false;\\\">\n <img class=\\\"toggle\\\" id=\\\"icon-traces-text-close\\\" alt=\\\"-\\\" src=\\\"data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs=\\\" style=\\\"display: none\\\" />\n <img class=\\\"toggle\\\" id=\\\"icon-traces-text-open\\\" alt=\\\"+\\\" src=\\\"data:image/gif;base64,R0lGODlhEgASAMQTANft99/v+Ga44bHb8ITG52S44dXs9+z1+uPx+YvK6WC24G+944/M6W28443L6dnu+Ge54v/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABMALAAAAAASABIAQAVS4DQBTiOd6LkwgJgeUSzHSDoNaZ4PU6FLgYBA5/vFID/DbylRGiNIZu74I0h1hNsVxbNuUV4d9SsZM2EzWe1qThVzwWFOAFCQFa1RQq6DJB4iIQA7\\\" style=\\\"display: inline\\\" />\n </a>\n \";\n echo trim(preg_replace('/>\\s+</', '><', ob_get_clean()));\n // line 10\n echo \" </h2>\n\n <div id=\\\"traces-text\\\" class=\\\"trace\\\" style=\\\"display: none;\\\">\n<pre>\";\n // line 13\n $context['_parent'] = (array) $context;\n $context['_seq'] = twig_ensure_traversable($this->getAttribute((isset($context[\"exception\"]) ? $context[\"exception\"] : $this->getContext($context, \"exception\")), \"toarray\", array()));\n foreach ($context['_seq'] as $context[\"i\"] => $context[\"e\"]) {\n // line 14\n echo \"[\";\n echo twig_escape_filter($this->env, ($context[\"i\"] + 1), \"html\", null, true);\n echo \"] \";\n echo twig_escape_filter($this->env, $this->getAttribute($context[\"e\"], \"class\", array()), \"html\", null, true);\n echo \": \";\n echo twig_escape_filter($this->env, $this->getAttribute($context[\"e\"], \"message\", array()), \"html\", null, true);\n echo \"\n\";\n // line 15\n $this->env->loadTemplate(\"TwigBundle:Exception:traces.txt.twig\")->display(array(\"exception\" => $context[\"e\"]));\n }\n $_parent = $context['_parent'];\n unset($context['_seq'], $context['_iterated'], $context['i'], $context['e'], $context['_parent'], $context['loop']);\n $context = array_intersect_key($context, $_parent) + $_parent;\n // line 16\n echo \"</pre>\n </div>\n</div>\n\";\n }\n\n public function getTemplateName()\n {\n return \"TwigBundle:Exception:traces_text.html.twig\";\n }\n\n public function isTraitable()\n {\n return false;\n }\n\n public function getDebugInfo()\n {\n return array ( 57 => 16, 51 => 15, 42 => 14, 38 => 13, 33 => 10, 26 => 5, 24 => 4, 19 => 1,);\n }\n}\n", "meta": {"content_hash": "db66776558cd68e1c8a0c5b64628e05f", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 416, "avg_line_length": 43.506493506493506, "alnum_prop": 0.6011940298507462, "repo_name": "ViorelP/testsymfony", "id": "059683adb8827bd467548f33ea6b273c0c358620", "size": "3350", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/cache/dev/twig/53/70/994ced2970ee63936cc0436fbfcd7d7b400cfa1c1d041f0124ab09f8bdd5.php", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "3297"}, {"name": "CSS", "bytes": "14403"}, {"name": "HTML", "bytes": "195746"}, {"name": "JavaScript", "bytes": "41952"}, {"name": "PHP", "bytes": "53524"}]}} +{"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.9.1\"/>\n<title>V8 API Reference Guide for node.js v0.10.46: Member List</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/searchdata.js\"></script>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(function() { init_search(); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n <td style=\"padding-left: 0.5em;\">\n <div id=\"projectname\">V8 API Reference Guide for node.js v0.10.46\n </div>\n </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.9.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n <div id=\"navrow1\" class=\"tabs\">\n <ul class=\"tablist\">\n <li><a href=\"index.html\"><span>Main Page</span></a></li>\n <li><a href=\"namespaces.html\"><span>Namespaces</span></a></li>\n <li class=\"current\"><a href=\"annotated.html\"><span>Classes</span></a></li>\n <li><a href=\"files.html\"><span>Files</span></a></li>\n <li><a href=\"examples.html\"><span>Examples</span></a></li>\n <li>\n <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n <span class=\"left\">\n <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n alt=\"\"/>\n <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n onblur=\"searchBox.OnSearchFieldFocus(false)\" \n onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n </span><span class=\"right\">\n <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n </span>\n </div>\n </li>\n </ul>\n </div>\n <div id=\"navrow2\" class=\"tabs2\">\n <ul class=\"tablist\">\n <li><a href=\"annotated.html\"><span>Class List</span></a></li>\n <li><a href=\"classes.html\"><span>Class Index</span></a></li>\n <li><a href=\"inherits.html\"><span>Class Hierarchy</span></a></li>\n <li><a href=\"functions.html\"><span>Class Members</span></a></li>\n </ul>\n </div>\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n</div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div id=\"nav-path\" class=\"navpath\">\n <ul>\n<li class=\"navelem\"><a class=\"el\" href=\"namespacev8.html\">v8</a></li><li class=\"navelem\"><a class=\"el\" href=\"classv8_1_1Debug.html\">Debug</a></li><li class=\"navelem\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">EventDetails</a></li> </ul>\n</div>\n</div><!-- top -->\n<div class=\"header\">\n <div class=\"headertitle\">\n<div class=\"title\">v8::Debug::EventDetails Member List</div> </div>\n</div><!--header-->\n<div class=\"contents\">\n\n<p>This is the complete list of members for <a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">v8::Debug::EventDetails</a>, including all inherited members.</p>\n<table class=\"directory\">\n <tr class=\"even\"><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html#a3c1eff8397db7c91e9c687f48d400665\">GetCallbackData</a>() const =0</td><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">v8::Debug::EventDetails</a></td><td class=\"entry\"><span class=\"mlabel\">pure virtual</span></td></tr>\n <tr><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html#ae663e7607d27c3252049eea077a83e08\">GetClientData</a>() const =0</td><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">v8::Debug::EventDetails</a></td><td class=\"entry\"><span class=\"mlabel\">pure virtual</span></td></tr>\n <tr class=\"even\"><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html#ac871568e8cfd43bbf2cdac62add34ed0\">GetEvent</a>() const =0</td><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">v8::Debug::EventDetails</a></td><td class=\"entry\"><span class=\"mlabel\">pure virtual</span></td></tr>\n <tr><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html#a2c98fc8b2848105c37fc60a04b35dfa5\">GetEventContext</a>() const =0</td><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">v8::Debug::EventDetails</a></td><td class=\"entry\"><span class=\"mlabel\">pure virtual</span></td></tr>\n <tr bgcolor=\"#f0f0f0\" class=\"even\"><td class=\"entry\"><b>GetEventData</b>() const =0 (defined in <a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">v8::Debug::EventDetails</a>)</td><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">v8::Debug::EventDetails</a></td><td class=\"entry\"><span class=\"mlabel\">pure virtual</span></td></tr>\n <tr><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html#abf0997988e1e3f0780c0d3f19b4e3b8a\">GetExecutionState</a>() const =0</td><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">v8::Debug::EventDetails</a></td><td class=\"entry\"><span class=\"mlabel\">pure virtual</span></td></tr>\n <tr bgcolor=\"#f0f0f0\" class=\"even\"><td class=\"entry\"><b>~EventDetails</b>() (defined in <a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">v8::Debug::EventDetails</a>)</td><td class=\"entry\"><a class=\"el\" href=\"classv8_1_1Debug_1_1EventDetails.html\">v8::Debug::EventDetails</a></td><td class=\"entry\"><span class=\"mlabel\">inline</span><span class=\"mlabel\">virtual</span></td></tr>\n</table></div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by  <a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.9.1\n</small></address>\n</body>\n</html>\n", "meta": {"content_hash": "ed2014083a6c4294ab3a2e3cf156c7d9", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 388, "avg_line_length": 61.24778761061947, "alnum_prop": 0.6692674469007369, "repo_name": "v8-dox/v8-dox.github.io", "id": "3e780d41f342189e301d8074d1118884009a9e19", "size": "6921", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fcb9145/html/classv8_1_1Debug_1_1EventDetails-members.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "package com.iyzipay.model;\n\nimport com.iyzipay.HttpClient;\nimport com.iyzipay.Options;\nimport com.iyzipay.request.RetrieveCheckoutFormRequest;\n\npublic class CheckoutForm extends PaymentResource {\n\n private String token;\n private String callbackUrl;\n\n public static CheckoutForm retrieve(RetrieveCheckoutFormRequest request, Options options) {\n return HttpClient.create().post(options.getBaseUrl() + \"/payment/iyzipos/checkoutform/auth/ecom/detail\",\n getHttpHeaders(request, options),\n request,\n CheckoutForm.class);\n }\n\n public String getToken() {\n return token;\n }\n\n public void setToken(String token) {\n this.token = token;\n }\n\n public String getCallbackUrl() {\n return callbackUrl;\n }\n\n public void setCallbackUrl(String callbackUrl) {\n this.callbackUrl = callbackUrl;\n }\n}\n", "meta": {"content_hash": "bd9c7ab8f1e22a9f6bc801c9f6c7c6ee", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 112, "avg_line_length": 26.264705882352942, "alnum_prop": 0.6797312430011199, "repo_name": "mustafacantekir/iyzipay-java", "id": "e49533121132c9434efc5a09b765da512422ec58", "size": "893", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/iyzipay/model/CheckoutForm.java", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "5043"}, {"name": "Java", "bytes": "384186"}, {"name": "Shell", "bytes": "7112"}]}} +{"text": "\ufeffusing System;\nusing System.Runtime.Serialization;\n\nnamespace Camunda.Api.Client.History\n{\n public class HistoricProcessInstance\n {\n /// <summary>\n /// The id of the process instance.\n /// </summary>\n public string Id;\n /// <summary>\n /// The business key of the process instance.\n /// </summary>\n public string BusinessKey;\n /// <summary>\n /// The id of the process definition that this process instance belongs to.\n /// </summary>\n public string ProcessDefinitionId;\n /// <summary>\n /// The key of the process definition that this process instance belongs to.\n /// </summary>\n public string ProcessDefinitionKey;\n /// <summary>\n /// The name of the process definition that this process instance belongs to.\n /// </summary>\n public string ProcessDefinitionName;\n /// <summary>\n /// The time the instance was started.\n /// </summary>\n public DateTime StartTime;\n /// <summary>\n /// The time the instance ended.\n /// </summary>\n public DateTime EndTime;\n /// <summary>\n /// The time the instance took to finish (in milliseconds).\n /// </summary>\n public long DurationInMillis;\n /// <summary>\n /// The id of the user who started the process instance.\n /// </summary>\n public string StartUserId;\n /// <summary>\n /// The id of the initial activity that was executed (e.g., a start event).\n /// </summary>\n public string StartActivityId;\n /// <summary>\n /// The provided delete reason in case the process instance was canceled during execution./// </summary>\n public string DeleteReason;\n /// <summary>\n /// The id of the parent process instance, if it exists.\n /// </summary>\n public string SuperProcessInstanceId;\n /// <summary>\n /// The id of the parent case instance, if it exists.\n /// </summary>\n public string SuperCaseInstanceId;\n /// <summary>\n /// The id of the parent case instance, if it exists.\n /// </summary>\n public string CaseInstanceId;\n /// <summary>\n /// The tenant id of the process instance.\n /// </summary>\n public string TenantId;\n /// <summary>\n /// Last state of the process instance.\n /// </summary>\n public ProcessInstanceState State;\n\n public override string ToString() => Id;\n }\n\n public enum ProcessInstanceState\n {\n /// <summary>\n /// Running process instance\n /// </summary>\n [EnumMember(Value = \"ACTIVE\")]\n Active,\n /// <summary>\n /// Suspended process instances\n /// </summary>\n [EnumMember(Value = \"SUSPENDED\")]\n Suspended,\n /// <summary>\n /// Suspended process instances\n /// </summary>\n [EnumMember(Value = \"COMPLETED\")]\n Completed,\n /// <summary>\n /// Suspended process instances\n /// </summary>\n [EnumMember(Value = \"EXTERNALLY_TERMINATED\")]\n ExternallyTerminated,\n /// <summary>\n /// Terminated internally, for instance by terminating boundary event\n /// </summary>\n [EnumMember(Value = \"INTERNALLY_TERMINATED\")]\n InternallyTerminated,\n }\n}\n", "meta": {"content_hash": "cbd6358e61a0928b1fc3bf8a280e9c32", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 112, "avg_line_length": 33.18446601941748, "alnum_prop": 0.5608543007606788, "repo_name": "jlucansky/Camunda.Api.Client", "id": "e86a6dc16af17b5347583dc80c28492ee3c8d624", "size": "3420", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Camunda.Api.Client/History/HistoricProcessInstance.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "638680"}]}} +{"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.11\"/>\n<title>nucleo-dynamixel: Member List</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"resize.js\"></script>\n<script type=\"text/javascript\" src=\"navtreedata.js\"></script>\n<script type=\"text/javascript\" src=\"navtree.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(initResizable);\n $(window).load(resizeHeight);\n</script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/searchdata.js\"></script>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(function() { init_search(); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n <td id=\"projectalign\" style=\"padding-left: 0.5em;\">\n <div id=\"projectname\">nucleo-dynamixel\n  <span id=\"projectnumber\">0.0.1</span>\n </div>\n <div id=\"projectbrief\">A library for controlling dynamixel servomotors, designed for nucleo stm32</div>\n </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.11 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n <div id=\"navrow1\" class=\"tabs\">\n <ul class=\"tablist\">\n <li><a href=\"index.html\"><span>Main Page</span></a></li>\n <li><a href=\"pages.html\"><span>Related Pages</span></a></li>\n <li><a href=\"modules.html\"><span>Modules</span></a></li>\n <li class=\"current\"><a href=\"annotated.html\"><span>Classes</span></a></li>\n <li><a href=\"files.html\"><span>Files</span></a></li>\n <li>\n <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n <span class=\"left\">\n <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n alt=\"\"/>\n <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n onblur=\"searchBox.OnSearchFieldFocus(false)\" \n onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n </span><span class=\"right\">\n <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n </span>\n </div>\n </li>\n </ul>\n </div>\n <div id=\"navrow2\" class=\"tabs2\">\n <ul class=\"tablist\">\n <li><a href=\"annotated.html\"><span>Class List</span></a></li>\n <li><a href=\"classes.html\"><span>Class Index</span></a></li>\n <li><a href=\"hierarchy.html\"><span>Class Hierarchy</span></a></li>\n <li><a href=\"functions.html\"><span>Class Members</span></a></li>\n </ul>\n </div>\n</div><!-- top -->\n<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n <div id=\"nav-tree\">\n <div id=\"nav-tree-contents\">\n <div id=\"nav-sync\" class=\"sync\"></div>\n </div>\n </div>\n <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n class=\"ui-resizable-handle\">\n </div>\n</div>\n<script type=\"text/javascript\">\n$(document).ready(function(){initNavTree('struct_s_p_i___init_type_def.html','');});\n</script>\n<div id=\"doc-content\">\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n</div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n <div class=\"headertitle\">\n<div class=\"title\">SPI_InitTypeDef Member List</div> </div>\n</div><!--header-->\n<div class=\"contents\">\n\n<p>This is the complete list of members for <a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a>, including all inherited members.</p>\n<table class=\"directory\">\n <tr class=\"even\"><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#a1d553f90738cb633a9298d2b4d306fde\">BaudRatePrescaler</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n <tr><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#ab21a458209f2588f49a2353c56f62625\">CLKPhase</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n <tr class=\"even\"><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#a96922c7ff9e589ebd9611fc4ab730454\">CLKPolarity</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n <tr><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#a3472de9bd9247c1d97312aff7e58e385\">CRCCalculation</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n <tr class=\"even\"><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#abdaf3ccbfa4ef68cc81fd32f29baa678\">CRCPolynomial</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n <tr><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#a24b7835dd877e1c4e55236303fa3387f\">DataSize</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n <tr class=\"even\"><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#ae5c132f597c806d7a1fe316023b36867\">Direction</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n <tr><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#a8c541d8863cb62a3212b9381b5cba447\">FirstBit</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n <tr class=\"even\"><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#a5247eb0463437c9980a9d4a5300b50a5\">Mode</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n <tr><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#aed541d17808213ac6f90ac7deb2bec5f\">NSS</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n <tr class=\"even\"><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html#a60db7e87bb66775df6213e4006dfd876\">TIMode</a></td><td class=\"entry\"><a class=\"el\" href=\"struct_s_p_i___init_type_def.html\">SPI_InitTypeDef</a></td><td class=\"entry\"></td></tr>\n</table></div><!-- contents -->\n</div><!-- doc-content -->\n<!-- start footer part -->\n<div id=\"nav-path\" class=\"navpath\"><!-- id is needed for treeview function! -->\n <ul>\n <li class=\"footer\">Generated by\n <a href=\"http://www.doxygen.org/index.html\">\n <img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/></a> 1.8.11 </li>\n </ul>\n</div>\n</body>\n</html>\n", "meta": {"content_hash": "db1915705924809a45c4a3a30bfd5f6c", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 277, "avg_line_length": 57.607142857142854, "alnum_prop": 0.6592684438933664, "repo_name": "team-diana/nucleo-dynamixel", "id": "0508ff0cd46696d1f853fb94cba3a24750df17d6", "size": "8065", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/html/struct_s_p_i___init_type_def-members.html", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "3649584"}, {"name": "C++", "bytes": "362036"}, {"name": "HTML", "bytes": "109"}, {"name": "Makefile", "bytes": "58234"}]}} +{"text": "from flask import Flask\n# from flask.ext.sqlalchemy import SQLAlchemy\n\nimport os\n\n# DATABASE = 'database.db'\n\n# create app\napp = Flask(__name__)\n\nAPP_ROOT = os.path.dirname(os.path.abspath(__file__))\nAPP_STATIC = os.path.join(APP_ROOT, 'static')\n\n# setup db\n# app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///ip.db'\n# db = SQLAlchemy(app)\n\n# register blueprints\nfrom app.portfolio.views import portfolio\napp.register_blueprint(portfolio)\n\n\n# Run server\nif __name__ == '__main__':\n app.run()\n", "meta": {"content_hash": "ecff54483d586d55d73543594f4cc29e", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 59, "avg_line_length": 19.84, "alnum_prop": 0.6935483870967742, "repo_name": "murphyalexandre/murphyalexandre.com", "id": "96ab437773ee8db73fb9c15f38aae57953dbe110", "size": "496", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/__init__.py", "mode": "33261", "license": "mit", "language": [{"name": "CSS", "bytes": "6712"}, {"name": "HTML", "bytes": "3357"}, {"name": "JavaScript", "bytes": "66428"}, {"name": "Python", "bytes": "2916"}]}} +{"text": "if [ ! -f \"$1\" ] ; then\n echo \"\"\n echo \"limpa_duplicados - Copyright (C) 2009 Gabriel Fernandes\"\n echo \"\"\n echo \"Use: $0 /caminho/do/arquivo\"\n echo \"\"\n echo \"Parametros:\"\n echo \"/caminho/do/arquivo = Caminho completo do arquivo;\"\n echo \"\"\n echo \"Exemplo: $0 arquivo.txt\"\n echo \"\"\n echo \"gabriel@duel.com.br\"\n echo \"\"\n exit 1\nfi\n\n# Recebe caminho completo do arquivo para processar\nARQUIVO=$1\nARQUIVO_SAIDA=\"SAIDA-$ARQUIVO\"\nARQUIVO_DUPLICADOS=\"DUPLICADOS-$ARQUIVO\"\n\n# apaga arquivo antigos ja processados\nrm -rf \"SAIDA-$ARQUIVO\" \"DUPLICADOS-$ARQUIVO\"\n# faz backup do arquivo original\n#cp \"$ARQUIVO\" \"ORIGINAL-$ARQUIVO\"\n\n# Conta quantidade linha para processar\nNUM_LINHAS=$(cat $ARQUIVO | wc -l)\nlet NUM_LINHAS++\n\n\n# Imprime na sa\u00edda padr\u00e3o, somente os campos que n\u00e3o foram poss\u00edveis de ser incrementado.\nawk '{ if ( !umArrayLinhas[$0]++ ) { print $0 } }' $ARQUIVO > \"SAIDA-$ARQUIVO\"\n\n# Imprime na sa\u00edda padr\u00e3o, somente os campos que foram poss\u00edveis de ser incrementado seu valor no array\nawk '{ if ( umArrayLinhas[$0]++ ) { print $0 } }' $ARQUIVO > \"DUPLICADOS-$ARQUIVO\"\n\n# Conta qtd linhas processadas\nCONT_LINHAS_DUPLICADAS=$(cat \"DUPLICADOS-$ARQUIVO\" | wc -l)\nCONT_LINHAS_SAIDA=$(cat \"SAIDA-$ARQUIVO\" | wc -l)\n\nclear\necho \"Processado arquivo: $ARQUIVO\" > LOG-$ARQUIVO.txt\necho \"Registros: $NUM_LINHAS\" >> LOG-$ARQUIVO.txt\necho \"Normal:$CONT_LINHAS_SAIDA Duplo:$CONT_LINHAS_DUPLICADAS\" >> LOG-$ARQUIVO.txt\n", "meta": {"content_hash": "568f6f0ffcb2aae8e812504dc2d7f8cf", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 103, "avg_line_length": 31.555555555555557, "alnum_prop": 0.702112676056338, "repo_name": "FIVJ/ECA-Importer", "id": "30c05e51cacc0b5583d586e1d1d74e2b058ee8ff", "size": "1440", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CSV_Converter/limpa_duplicados.sh", "mode": "33261", "license": "mit", "language": [{"name": "Java", "bytes": "161055"}, {"name": "Shell", "bytes": "1440"}]}} +{"text": "ACCEPTED\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nSp. pl. 1:491. 1753\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "9fe4bf374ab93d5e14643cb38861e87b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 11.461538461538462, "alnum_prop": 0.6778523489932886, "repo_name": "mdoering/backbone", "id": "c10035e0d3a415de7ecbe00c1671eb9c95f474d0", "size": "191", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Rosa/Rosa centifolia/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "namespace chrono {\nnamespace vehicle {\n\n/// @addtogroup vehicle_terrain\n/// @{\n\n/// FEA Deformable terrain model.\n/// This class implements a terrain made up of isoparametric finite elements. It features\n/// Drucker-Prager plasticity and capped Drucker-Prager plasticity.\nclass CH_VEHICLE_API FEADeformableTerrain : public ChTerrain {\n public:\n /// Construct a default FEADeformableSoil.\n /// The user is responsible for calling various Set methods before Initialize.\n FEADeformableTerrain(ChSystem* system ///< [in/out] pointer to the containing system);\n );\n\n ~FEADeformableTerrain() {}\n\n /// Get the terrain height at the specified (x,y) location.\n virtual double GetHeight(double x, double y) const override;\n\n /// Get the terrain normal at the specified (x,y) location.\n virtual chrono::ChVector<> GetNormal(double x, double y) const override;\n\n /// Get the terrain coefficient of friction at the specified (x,y) location.\n /// This coefficient of friction value may be used by certain tire models to modify\n /// the tire characteristics, but it will have no effect on the interaction of the terrain\n /// with other objects (including tire models that do not explicitly use it).\n /// For FEADeformableTerrain, this function defers to the user-provided functor object\n /// of type ChTerrain::FrictionFunctor, if one was specified.\n /// Otherwise, it returns the constant value of 0.8.\n virtual float GetCoefficientFriction(double x, double y) const override;\n\n /// Set the properties of the Drucker-Prager FEA soil.\n void SetSoilParametersFEA(double rho, ///< [in] Soil density\n double Emod, ///< [in] Soil modulus of elasticity\n double nu, ///< [in] Soil Poisson ratio\n double yield_stress, ///< [in] Soil yield stress, for plasticity\n double hardening_slope, ///< [in] Soil hardening slope, for plasticity\n double friction_angle, ///< [in] Soil internal friction angle\n double dilatancy_angle ///< [in] Soil dilatancy angle\n );\n\n /// Initialize the terrain system (flat).\n /// This version creates a flat array of points.\n void Initialize(const ChVector<>& start_point, ///< [in] Base point to build terrain box\n const ChVector<>& terrain_dimension, ///< [in] terrain dimensions in the 3 directions\n const ChVector<int>& terrain_discretization ///< [in] Number of finite elements in the 3 directions\n );\n\n /// Get the underlying FEA mesh.\n std::shared_ptr<fea::ChMesh> GetMesh() const { return m_mesh; }\n\n private:\n std::shared_ptr<fea::ChMesh> m_mesh; ///< soil mesh\n\n double m_rho; ///< Soil density\n double m_E; ///< Soil modulus of elasticity\n double m_nu; ///< Soil Poisson ratio\n\n double m_yield_stress; ///< Yield stress for soil plasticity\n double m_hardening_slope; ///< Hardening slope for soil plasticity\n double m_friction_angle; ///< Set friction angle for soil plasticity\n double m_dilatancy_angle; ///< Set dilatancy angle for soil plasticity\n};\n\n/// @} vehicle_terrain\n\n} // end namespace vehicle\n} // end namespace chrono\n\n#endif\n", "meta": {"content_hash": "bd6cbe633769b6f40e4b377a77fa429b", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 120, "avg_line_length": 47.513888888888886, "alnum_prop": 0.6328558900906168, "repo_name": "armanpazouki/chrono", "id": "7e5b1964f16a3553d375d23ee17da3851be6d9d6", "size": "4506", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/chrono_vehicle/terrain/FEADeformableTerrain.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Batchfile", "bytes": "3754"}, {"name": "C", "bytes": "2094018"}, {"name": "C++", "bytes": "18310783"}, {"name": "CMake", "bytes": "456720"}, {"name": "CSS", "bytes": "170229"}, {"name": "Cuda", "bytes": "702762"}, {"name": "GLSL", "bytes": "4731"}, {"name": "HTML", "bytes": "7903"}, {"name": "Inno Setup", "bytes": "24125"}, {"name": "JavaScript", "bytes": "4731"}, {"name": "Lex", "bytes": "3433"}, {"name": "Objective-C", "bytes": "2096"}, {"name": "POV-Ray SDL", "bytes": "23109"}, {"name": "Python", "bytes": "186160"}, {"name": "Shell", "bytes": "1459"}]}} +{"text": "import url from 'url';\n\nexport const toContainExactPath = function (actual, expected) {\n if (typeof actual !== 'string' || typeof expected !== 'string') {\n return false;\n }\n\n const actualUrl = url.parse(actual);\n\n return actualUrl.pathname === expected;\n};\n", "meta": {"content_hash": "f870e55dadd9a04a9d1b2b77722a0960", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 69, "avg_line_length": 25.09090909090909, "alnum_prop": 0.6413043478260869, "repo_name": "abelmokadem/test-matchers", "id": "9ce5624d31dbda96341930660c7c8c355143a77c", "size": "276", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/matchers/url/exact-path.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "5619"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<billStatus>\n <bill>\n <billType>S</billType>\n <updateDate>2017-06-07T10:10:50Z</updateDate>\n <subjects>\n <billSubjects>\n <legislativeSubjects>\n <item>\n <name>Private Legislation</name>\n </item>\n </legislativeSubjects>\n </billSubjects>\n </subjects>\n <policyArea />\n <laws />\n <version>1.0.0</version>\n <amendments />\n <calendarNumbers />\n <relatedBills />\n <introducedDate>2017-04-27</introducedDate>\n <notes />\n <latestAction>\n <text>Read twice and referred to the Committee on the Judiciary. (text of measure as introduced: CR S2619)</text>\n <actionDate>2017-04-27</actionDate>\n <links />\n </latestAction>\n <originChamber>Senate</originChamber>\n <sponsors>\n <item>\n <identifiers>\n <bioguideId>B001267</bioguideId>\n <gpoId>8302</gpoId>\n <lisID>1965</lisID>\n </identifiers>\n <firstName>Michael</firstName>\n <bioguideId>B001267</bioguideId>\n <middleName>F.</middleName>\n <byRequestType />\n <state>CO</state>\n <fullName>Sen. Bennet, Michael F. [D-CO]</fullName>\n <party>D</party>\n <lastName>Bennet</lastName>\n </item>\n </sponsors>\n <recordedVotes />\n <billNumber>979</billNumber>\n <titles>\n <item>\n <titleType>Official Title as Introduced</titleType>\n <title>A bill for the relief of Arturo Hernandez-Garcia.</title>\n <chamberCode />\n <parentTitleType />\n <chamberName />\n </item>\n <item>\n <titleType>Display Title</titleType>\n <title>A bill for the relief of Arturo Hernandez-Garcia.</title>\n <chamberCode />\n <parentTitleType />\n <chamberName />\n </item>\n </titles>\n <summaries>\n <billSummaries>\n <item>\n <actionDate>2017-04-27</actionDate>\n <actionDesc>Introduced in Senate</actionDesc>\n <text><![CDATA[Provides for the relief of Arturo Hernandez-Garcia.]]></text>\n <name>Introduced in Senate</name>\n <versionCode>00</versionCode>\n <lastSummaryUpdateDate>2017-04-28T08:03:52Z</lastSummaryUpdateDate>\n <updateDate>2017-04-27T04:00:00Z</updateDate>\n </item>\n </billSummaries>\n </summaries>\n <congress>115</congress>\n <committeeReports />\n <title>A bill for the relief of Arturo Hernandez-Garcia.</title>\n <cboCostEstimates />\n <actions>\n <actionByCounts>\n <senate>2</senate>\n </actionByCounts>\n <item>\n <actionDate>2017-04-27</actionDate>\n <committee>\n <systemCode>ssju00</systemCode>\n <name>Judiciary Committee</name>\n </committee>\n <links>\n <link>\n <name>S2619</name>\n <url>https://www.congress.gov/congressional-record/volume-163/senate-section/page/S2619</url>\n </link>\n </links>\n <sourceSystem>\n <name>Senate</name>\n <code>0</code>\n </sourceSystem>\n <text>Read twice and referred to the Committee on the Judiciary. (text of measure as introduced: CR S2619)</text>\n <type>IntroReferral</type>\n </item>\n <item>\n <links />\n <type>IntroReferral</type>\n <actionCode>10000</actionCode>\n <actionDate>2017-04-27</actionDate>\n <committee />\n <text>Introduced in Senate</text>\n <sourceSystem>\n <name>Library of Congress</name>\n <code>9</code>\n </sourceSystem>\n </item>\n <actionTypeCounts>\n <introducedInSenate>1</introducedInSenate>\n <referredToCommittee>1</referredToCommittee>\n </actionTypeCounts>\n </actions>\n <createDate>2017-04-28T00:41:46Z</createDate>\n <cosponsors />\n <committees>\n <billCommittees>\n <item>\n <type>Standing</type>\n <activities>\n <item>\n <date>2017-04-27T19:35:35Z</date>\n <name>Referred to</name>\n </item>\n </activities>\n <systemCode>ssju00</systemCode>\n <chamber>Senate</chamber>\n <name>Judiciary Committee</name>\n <subcommittees />\n </item>\n </billCommittees>\n </committees>\n </bill>\n <dublinCore xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n <dc:format>text/xml</dc:format>\n <dc:language>EN</dc:language>\n <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>\n <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>\n <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is \"to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives\". For more information, refer to the User Guide that accompanies this file.</dc:description>\n </dublinCore>\n</billStatus>\n\n", "meta": {"content_hash": "d1acc477180b5bdaec0222fceec28e9c", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 676, "avg_line_length": 36.20805369127517, "alnum_prop": 0.6157553290083411, "repo_name": "peter765/power-polls", "id": "cd2f43dee8d5ee7b436c62acb6f54a13244112ed", "size": "5395", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/bills/s/s979/fdsys_billstatus.xml", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "58567"}, {"name": "JavaScript", "bytes": "7370"}, {"name": "Python", "bytes": "22988"}]}} +{"text": "\"\"\"\n MINDBODY Public API\n\n No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501\n\n OpenAPI spec version: v6\n \n Generated by: https://github.com/swagger-api/swagger-codegen.git\n\"\"\"\n\n\nimport pprint\nimport re # noqa: F401\n\nimport six\n\nfrom swagger_client.models.staff import Staff # noqa: F401,E501\n\n\nclass ContactLogComment(object):\n \"\"\"NOTE: This class is auto generated by the swagger code generator program.\n\n Do not edit the class manually.\n \"\"\"\n\n \"\"\"\n Attributes:\n swagger_types (dict): The key is attribute name\n and the value is attribute type.\n attribute_map (dict): The key is attribute name\n and the value is json key in definition.\n \"\"\"\n swagger_types = {\n 'id': 'int',\n 'text': 'str',\n 'created_date_time': 'datetime',\n 'created_by': 'Staff'\n }\n\n attribute_map = {\n 'id': 'Id',\n 'text': 'Text',\n 'created_date_time': 'CreatedDateTime',\n 'created_by': 'CreatedBy'\n }\n\n def __init__(self, id=None, text=None, created_date_time=None, created_by=None): # noqa: E501\n \"\"\"ContactLogComment - a model defined in Swagger\"\"\" # noqa: E501\n\n self._id = None\n self._text = None\n self._created_date_time = None\n self._created_by = None\n self.discriminator = None\n\n if id is not None:\n self.id = id\n if text is not None:\n self.text = text\n if created_date_time is not None:\n self.created_date_time = created_date_time\n if created_by is not None:\n self.created_by = created_by\n\n @property\n def id(self):\n \"\"\"Gets the id of this ContactLogComment. # noqa: E501\n\n The comment\u2019s ID. # noqa: E501\n\n :return: The id of this ContactLogComment. # noqa: E501\n :rtype: int\n \"\"\"\n return self._id\n\n @id.setter\n def id(self, id):\n \"\"\"Sets the id of this ContactLogComment.\n\n The comment\u2019s ID. # noqa: E501\n\n :param id: The id of this ContactLogComment. # noqa: E501\n :type: int\n \"\"\"\n\n self._id = id\n\n @property\n def text(self):\n \"\"\"Gets the text of this ContactLogComment. # noqa: E501\n\n The comment\u2019s body text. # noqa: E501\n\n :return: The text of this ContactLogComment. # noqa: E501\n :rtype: str\n \"\"\"\n return self._text\n\n @text.setter\n def text(self, text):\n \"\"\"Sets the text of this ContactLogComment.\n\n The comment\u2019s body text. # noqa: E501\n\n :param text: The text of this ContactLogComment. # noqa: E501\n :type: str\n \"\"\"\n\n self._text = text\n\n @property\n def created_date_time(self):\n \"\"\"Gets the created_date_time of this ContactLogComment. # noqa: E501\n\n The local time when the comment was created. # noqa: E501\n\n :return: The created_date_time of this ContactLogComment. # noqa: E501\n :rtype: datetime\n \"\"\"\n return self._created_date_time\n\n @created_date_time.setter\n def created_date_time(self, created_date_time):\n \"\"\"Sets the created_date_time of this ContactLogComment.\n\n The local time when the comment was created. # noqa: E501\n\n :param created_date_time: The created_date_time of this ContactLogComment. # noqa: E501\n :type: datetime\n \"\"\"\n\n self._created_date_time = created_date_time\n\n @property\n def created_by(self):\n \"\"\"Gets the created_by of this ContactLogComment. # noqa: E501\n\n Information about the staff member who created the comment. # noqa: E501\n\n :return: The created_by of this ContactLogComment. # noqa: E501\n :rtype: Staff\n \"\"\"\n return self._created_by\n\n @created_by.setter\n def created_by(self, created_by):\n \"\"\"Sets the created_by of this ContactLogComment.\n\n Information about the staff member who created the comment. # noqa: E501\n\n :param created_by: The created_by of this ContactLogComment. # noqa: E501\n :type: Staff\n \"\"\"\n\n self._created_by = created_by\n\n def to_dict(self):\n \"\"\"Returns the model properties as a dict\"\"\"\n result = {}\n\n for attr, _ in six.iteritems(self.swagger_types):\n value = getattr(self, attr)\n if isinstance(value, list):\n result[attr] = list(map(\n lambda x: x.to_dict() if hasattr(x, \"to_dict\") else x,\n value\n ))\n elif hasattr(value, \"to_dict\"):\n result[attr] = value.to_dict()\n elif isinstance(value, dict):\n result[attr] = dict(map(\n lambda item: (item[0], item[1].to_dict())\n if hasattr(item[1], \"to_dict\") else item,\n value.items()\n ))\n else:\n result[attr] = value\n if issubclass(ContactLogComment, dict):\n for key, value in self.items():\n result[key] = value\n\n return result\n\n def to_str(self):\n \"\"\"Returns the string representation of the model\"\"\"\n return pprint.pformat(self.to_dict())\n\n def __repr__(self):\n \"\"\"For `print` and `pprint`\"\"\"\n return self.to_str()\n\n def __eq__(self, other):\n \"\"\"Returns true if both objects are equal\"\"\"\n if not isinstance(other, ContactLogComment):\n return False\n\n return self.__dict__ == other.__dict__\n\n def __ne__(self, other):\n \"\"\"Returns true if both objects are not equal\"\"\"\n return not self == other\n", "meta": {"content_hash": "670c2b94fe55a14800cbae9b9f28b451", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 119, "avg_line_length": 28.53731343283582, "alnum_prop": 0.5636331938633193, "repo_name": "mindbody/API-Examples", "id": "29e2bb649c6aa1b98360c42891c410ced0312b33", "size": "5761", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SDKs/Python/swagger_client/models/contact_log_comment.py", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "PHP", "bytes": "3610259"}, {"name": "Python", "bytes": "2338642"}, {"name": "Ruby", "bytes": "2284441"}, {"name": "Shell", "bytes": "5058"}]}} +{"text": "package Controller.Request;\n\nimport Model.AccountHandler;\nimport Model.TweetHandler;\n\npublic class Request {\n\n\tpublic static AccountHandler accountHandler=null;\n\tpublic static TweetHandler tweetHandler=null;\n\t\n\tpublic static void setAccountHandler(AccountHandler accHandler){\n\t\tRequest.accountHandler=accHandler;\n\t}\n\t\n\tpublic static void setTweetHandler(TweetHandler tweHandler){\n\t\tRequest.tweetHandler=tweHandler;\n\t}\n\t\n\t\n}\n", "meta": {"content_hash": "869c280060a5cafe1b5a987d197e93d2", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 65, "avg_line_length": 21.2, "alnum_prop": 0.8113207547169812, "repo_name": "TweetDeleter/TweetDeleterProject", "id": "2dcf665d53b3c8252bcc1005e6944fab33d36d51", "size": "424", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Controller/Request/Request.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "31199"}]}} +{"text": "BEGIN;\nDELETE FROM t1 WHERE a>32;", "meta": {"content_hash": "6e0d6cc70d1200b99f07883d873be749", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 26, "avg_line_length": 16.5, "alnum_prop": 0.7575757575757576, "repo_name": "bkiers/sqlite-parser", "id": "30bd5ba5bb64ca16ca7c2b86c1be7badeb7d243c", "size": "123", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/resources/pagerfault.test_30.sql", "mode": "33188", "license": "mit", "language": [{"name": "ANTLR", "bytes": "20112"}, {"name": "Java", "bytes": "6273"}, {"name": "PLpgSQL", "bytes": "324108"}]}} +{"text": "#include \"optionsdialog.h\"\n#include \"ui_optionsdialog.h\"\n\n#include \"bitcoinunits.h\"\n#include \"monitoreddatamapper.h\"\n#include \"netbase.h\"\n#include \"optionsmodel.h\"\n\n#include <QDir>\n#include <QIntValidator>\n#include <QLocale>\n#include <QMessageBox>\n#include <QRegExp>\n#include <QRegExpValidator>\n\nOptionsDialog::OptionsDialog(QWidget *parent) :\n QDialog(parent),\n ui(new Ui::OptionsDialog),\n model(0),\n mapper(0),\n fRestartWarningDisplayed_Proxy(false),\n fRestartWarningDisplayed_Lang(false),\n fProxyIpValid(true)\n{\n ui->setupUi(this);\n\n /* Network elements init */\n#ifndef USE_UPNP\n ui->mapPortUpnp->setEnabled(false);\n#endif\n\n ui->proxyIp->setEnabled(false);\n ui->proxyPort->setEnabled(false);\n ui->proxyPort->setValidator(new QIntValidator(1, 65535, this));\n\n ui->socksVersion->setEnabled(false);\n ui->socksVersion->addItem(\"5\", 5);\n ui->socksVersion->addItem(\"4\", 4);\n ui->socksVersion->setCurrentIndex(0);\n\n connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyIp, SLOT(setEnabled(bool)));\n connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyPort, SLOT(setEnabled(bool)));\n connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->socksVersion, SLOT(setEnabled(bool)));\n connect(ui->connectSocks, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning_Proxy()));\n\n ui->proxyIp->installEventFilter(this);\n\n /* Window elements init */\n#ifdef Q_OS_MAC\n ui->tabWindow->setVisible(false);\n#endif\n\n /* Display elements init */\n QDir translations(\":translations\");\n ui->lang->addItem(QString(\"(\") + tr(\"default\") + QString(\")\"), QVariant(\"\"));\n foreach(const QString &langStr, translations.entryList())\n {\n QLocale locale(langStr);\n\n /** check if the locale name consists of 2 parts (language_country) */\n if(langStr.contains(\"_\"))\n {\n#if QT_VERSION >= 0x040800\n /** display language strings as \"native language - native country (locale name)\", e.g. \"Deutsch - Deutschland (de)\" */\n ui->lang->addItem(locale.nativeLanguageName() + QString(\" - \") + locale.nativeCountryName() + QString(\" (\") + langStr + QString(\")\"), QVariant(langStr));\n#else\n /** display language strings as \"language - country (locale name)\", e.g. \"German - Germany (de)\" */\n ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(\" - \") + QLocale::countryToString(locale.country()) + QString(\" (\") + langStr + QString(\")\"), QVariant(langStr));\n#endif\n }\n else\n {\n#if QT_VERSION >= 0x040800\n /** display language strings as \"native language (locale name)\", e.g. \"Deutsch (de)\" */\n ui->lang->addItem(locale.nativeLanguageName() + QString(\" (\") + langStr + QString(\")\"), QVariant(langStr));\n#else\n /** display language strings as \"language (locale name)\", e.g. \"German (de)\" */\n ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(\" (\") + langStr + QString(\")\"), QVariant(langStr));\n#endif\n }\n }\n\n ui->unit->setModel(new BitcoinUnits(this));\n\n /* Widget-to-option mapper */\n mapper = new MonitoredDataMapper(this);\n mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);\n mapper->setOrientation(Qt::Vertical);\n\n /* enable apply button when data modified */\n connect(mapper, SIGNAL(viewModified()), this, SLOT(enableApplyButton()));\n /* disable apply button when new data loaded */\n connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(disableApplyButton()));\n /* setup/change UI elements when proxy IP is invalid/valid */\n connect(this, SIGNAL(proxyIpValid(QValidatedLineEdit *, bool)), this, SLOT(handleProxyIpValid(QValidatedLineEdit *, bool)));\n}\n\nOptionsDialog::~OptionsDialog()\n{\n delete ui;\n}\n\nvoid OptionsDialog::setModel(OptionsModel *model)\n{\n this->model = model;\n\n if(model)\n {\n connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));\n\n mapper->setModel(model);\n setMapper();\n mapper->toFirst();\n }\n\n /* update the display unit, to not use the default (\"BTC\") */\n updateDisplayUnit();\n\n /* warn only when language selection changes by user action (placed here so init via mapper doesn't trigger this) */\n connect(ui->lang, SIGNAL(valueChanged()), this, SLOT(showRestartWarning_Lang()));\n\n /* disable apply button after settings are loaded as there is nothing to save */\n disableApplyButton();\n}\n\nvoid OptionsDialog::setMapper()\n{\n /* Main */\n mapper->addMapping(ui->transactionFee, OptionsModel::Fee);\n mapper->addMapping(ui->reserveBalance, OptionsModel::ReserveBalance);\n mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);\n\n /* Network */\n mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);\n\n mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse);\n mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP);\n mapper->addMapping(ui->proxyPort, OptionsModel::ProxyPort);\n mapper->addMapping(ui->socksVersion, OptionsModel::ProxySocksVersion);\n\n /* Window */\n#ifndef Q_OS_MAC\n mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray);\n mapper->addMapping(ui->minimizeOnClose, OptionsModel::MinimizeOnClose);\n#endif\n\n /* Display */\n mapper->addMapping(ui->lang, OptionsModel::Language);\n mapper->addMapping(ui->unit, OptionsModel::DisplayUnit);\n mapper->addMapping(ui->displayAddresses, OptionsModel::DisplayAddresses);\n mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);\n}\n\nvoid OptionsDialog::enableApplyButton()\n{\n ui->applyButton->setEnabled(true);\n}\n\nvoid OptionsDialog::disableApplyButton()\n{\n ui->applyButton->setEnabled(false);\n}\n\nvoid OptionsDialog::enableSaveButtons()\n{\n /* prevent enabling of the save buttons when data modified, if there is an invalid proxy address present */\n if(fProxyIpValid)\n setSaveButtonState(true);\n}\n\nvoid OptionsDialog::disableSaveButtons()\n{\n setSaveButtonState(false);\n}\n\nvoid OptionsDialog::setSaveButtonState(bool fState)\n{\n ui->applyButton->setEnabled(fState);\n ui->okButton->setEnabled(fState);\n}\n\nvoid OptionsDialog::on_okButton_clicked()\n{\n mapper->submit();\n accept();\n}\n\nvoid OptionsDialog::on_cancelButton_clicked()\n{\n reject();\n}\n\nvoid OptionsDialog::on_applyButton_clicked()\n{\n mapper->submit();\n disableApplyButton();\n}\n\nvoid OptionsDialog::showRestartWarning_Proxy()\n{\n if(!fRestartWarningDisplayed_Proxy)\n {\n QMessageBox::warning(this, tr(\"Warning\"), tr(\"This setting will take effect after restarting brightcoin.\"), QMessageBox::Ok);\n fRestartWarningDisplayed_Proxy = true;\n }\n}\n\nvoid OptionsDialog::showRestartWarning_Lang()\n{\n if(!fRestartWarningDisplayed_Lang)\n {\n QMessageBox::warning(this, tr(\"Warning\"), tr(\"This setting will take effect after restarting brightcoin.\"), QMessageBox::Ok);\n fRestartWarningDisplayed_Lang = true;\n }\n}\n\nvoid OptionsDialog::updateDisplayUnit()\n{\n if(model)\n {\n /* Update transactionFee with the current unit */\n ui->transactionFee->setDisplayUnit(model->getDisplayUnit());\n }\n}\n\nvoid OptionsDialog::handleProxyIpValid(QValidatedLineEdit *object, bool fState)\n{\n // this is used in a check before re-enabling the save buttons\n fProxyIpValid = fState;\n\n if(fProxyIpValid)\n {\n enableSaveButtons();\n ui->statusLabel->clear();\n }\n else\n {\n disableSaveButtons();\n object->setValid(fProxyIpValid);\n ui->statusLabel->setStyleSheet(\"QLabel { color: red; }\");\n ui->statusLabel->setText(tr(\"The supplied proxy address is invalid.\"));\n }\n}\n\nbool OptionsDialog::eventFilter(QObject *object, QEvent *event)\n{\n if(event->type() == QEvent::FocusOut)\n {\n if(object == ui->proxyIp)\n {\n CService addr;\n /* Check proxyIp for a valid IPv4/IPv6 address and emit the proxyIpValid signal */\n emit proxyIpValid(ui->proxyIp, LookupNumeric(ui->proxyIp->text().toStdString().c_str(), addr));\n }\n }\n return QDialog::eventFilter(object, event);\n}\n", "meta": {"content_hash": "cfa28a860c583cdca409d1ffc8d01732", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 198, "avg_line_length": 31.782101167315176, "alnum_prop": 0.6753183153770813, "repo_name": "brightcoindeveloper/brtcoin", "id": "db23595a4f96f9f82666968d06fa8c4038d15752", "size": "8168", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/optionsdialog.cpp", "mode": "33188", "license": "mit", "language": [{"name": "Assembly", "bytes": "51312"}, {"name": "C", "bytes": "34401"}, {"name": "C++", "bytes": "2584711"}, {"name": "CSS", "bytes": "1127"}, {"name": "HTML", "bytes": "50620"}, {"name": "Makefile", "bytes": "13045"}, {"name": "NSIS", "bytes": "6077"}, {"name": "Objective-C", "bytes": "858"}, {"name": "Objective-C++", "bytes": "3537"}, {"name": "Python", "bytes": "41580"}, {"name": "Roff", "bytes": "12684"}, {"name": "Shell", "bytes": "9083"}]}} +{"text": "it(\"scoped slot by default content has event listen\", function (done) {\n var clickInfo = {};\n // [inject] init\n\n expect(wrap.getElementsByTagName('p')[0].innerHTML).toBe('errorrik,male,errorrik@gmail.com');\n myComponent.data.set('man.email', 'erik168@163.com');\n san.nextTick(function () {\n expect(wrap.getElementsByTagName('p')[0].innerHTML).toBe('errorrik,male,erik168@163.com');\n\n triggerEvent(wrap.getElementsByTagName('p')[0], 'click');\n setTimeout(function () {\n expect(clickInfo.email).toBe('erik168@163.com');\n expect(clickInfo.outer).toBeFalsy();\n\n myComponent.dispose();\n document.body.removeChild(wrap);\n done();\n }, 500);\n })\n});\n\n", "meta": {"content_hash": "24ba28013c28066f7534e441b6795524", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 98, "avg_line_length": 35.42857142857143, "alnum_prop": 0.6129032258064516, "repo_name": "ecomfe/san", "id": "972cebb554c47a7ab43cbc4078ff045fa07f45eb", "size": "744", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/ssr/scoped-slot-default-listened/spec.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "6278"}, {"name": "HTML", "bytes": "36414"}, {"name": "JavaScript", "bytes": "1184545"}, {"name": "Smarty", "bytes": "59345"}, {"name": "TypeScript", "bytes": "5224"}]}} +{"text": "function showLimitedOptionsQuestion(questionUid, numberOfOptions){\n\n var questionDB = DB.child(\"questions/\"+questionUid+\"/options\"); DB.child(\"questions/\"+questionUid+\"/options\").orderByChild(\"votes\").limitToLast(numberOfOptions).once(\"value\",function(options){\n\n //adjust the votes to a counting of votes\n DB.child(\"questions/\"+questionUid+\"/simpleVoting\").once(\"value\", function(voters){\n\n console.log(\"adjust the votes to a counting of votes\")\n var counts = new Object();\n //get all options\n DB.child(\"questions/\"+questionUid+\"/options\").once(\"value\", function(options){\n options.forEach(function(option){\n counts[option.key] = 0;\n })\n\n voters.forEach(function(voter){\n if (!counts[voter.val()]){counts[voter.val()] = 0};\n counts[voter.val()]++;\n });\n\n for (i in counts){\n questionDB.child(i).update({votes:counts[i]});\n }\n\n })\n\n\n })\n\n var optionsObject = new Object();\n options.forEach(function(option){\n // if (color == undefined){\n // var color = getRandomColor();\n // DB.child(\"questions/\"+questionUid+\"/options/\"+option.key).update({color:color});\n // }\n optionsObject[option.key]= {uuid: option.key, title: option.val().title, votes: option.val().votes,color: option.val().color};\n })\n\n var preContext = new Array();\n\n for (i in optionsObject){\n preContext.push({questionUuid: questionUid ,uuid: optionsObject[i].uuid, title: optionsObject[i].title, votes: optionsObject[i].votes , color: optionsObject[i].color});\n };\n var context = {options: preContext};\n console.dir(context);\n\n renderTemplate(\"#simpleVote-tmpl\", context, \"wrapper\");\n renderTemplate(\"#simpleVoteBtns-tmpl\", context, \"footer\");\n\n $(\".voteBtn\").ePulse({\n bgColor: \"#ded9d9\",\n size: 'medium'\n });\n\n adjustHighetLimitedOptions(optionsObject);\n\n listenToLimitedOptions(optionsObject, questionDB);\n })\n\n lightCheckedBtn(questionUid);\n\n var turnOff = function(){\n console.log(\"turning off\");\n questionDB.once(\"value\", function(activeListeners){\n activeListeners.forEach(function(activeListenr){\n console.log(\"turning off: \"+ activeListenr.key);\n questionDB.child(activeListenr.key).off();\n })\n })\n };\n setActiveEntity(\"questions\",questionUid,\"\",\"\",turnOff)\n}\n\nfunction voteSimple(questionUid, optionUid){\n\n $(\"#info\").hide(400);\n var optionUidStr = JSON.stringify(optionUid);\n //check to see what have the user voted last\n\n DB.child(\"questions/\"+questionUid+\"/simpleVoting/\"+userUuid).once(\"value\", function(vote){\n var isExists = vote.exists();\n\n if (!isExists){\n DB.child(\"questions/\"+questionUid+\"/simpleVoting/\"+userUuid).set(optionUid);\n\n DB.child(\"questions/\"+questionUid+\"/options/\"+optionUid+\"/votes\").transaction(function(currentVote){\n return currentVote +1;\n })\n $(\".voteBtn\").css(\"border\" , \"0px solid black\");\n $(\"#\"+optionUid+\"_btn\").css(\"border\" , \"3px solid black\");\n } else {\n var lastVoted = vote.val();\n if (optionUid == lastVoted){\n DB.child(\"questions/\"+questionUid+\"/options/\"+optionUid+\"/votes\").transaction(function(currentVote){\n return currentVote -1;\n })\n DB.child(\"questions/\"+questionUid+\"/simpleVoting/\"+userUuid).remove();\n\n $(\".voteBtn\").css(\"border\" , \"0px solid black\");\n } else {\n DB.child(\"questions/\"+questionUid+\"/options/\"+lastVoted+\"/votes\").transaction(function(currentVote){\n return currentVote -1;\n });\n DB.child(\"questions/\"+questionUid+\"/options/\"+optionUid+\"/votes\").transaction(function(currentVote){\n return currentVote +1;\n })\n DB.child(\"questions/\"+questionUid+\"/simpleVoting/\"+userUuid).set(optionUid);\n $(\".voteBtn\").css(\"border\" , \"0px solid black\");\n $(\"#\"+optionUid+\"_btn\").css(\"border\" , \"3px solid black\");\n }\n\n }\n })\n}\n\nfunction lightCheckedBtn(questionUid){\n DB.child(\"questions/\"+questionUid+\"/simpleVoting/\"+userUuid).once(\"value\", function(checkedOption){\n\n $(\".voteBtn\").css(\"border\" , \"0px solid black\");\n $(\"#\"+checkedOption.val()+\"_btn\").css(\"border\" , \"3px solid black\");\n })\n}\n\nfunction listenToLimitedOptions (optionsObject, questionDB){\n\n for (i in optionsObject){\n questionDB.child(optionsObject[i].uuid).on(\"value\",function(optionVote){\n\n optionsObject[optionVote.key].votes = optionVote.val().votes;\n adjustHighetLimitedOptions(optionsObject);\n\n })\n }\n}\n\nfunction adjustHighetLimitedOptions(optionsObject){\n //look for max votes\n var maxVotes = 20;\n for (i in optionsObject){\n if (optionsObject[i].votes > maxVotes){\n maxVotes = optionsObject[i].votes;\n }\n }\n //find the dimensions of the wrapper to adjust drawing\n\n var NumberOfOptionsActualy = Object.keys(optionsObject).length;\n var divBarWidth = $(\"wrapper\").width()/NumberOfOptionsActualy;\n var barWidth = 0.8*divBarWidth;\n\n var wrapperDimensions = new Object();\n var wrapperHeight = $(\"wrapper\").height() - $(\"footer\").height()-20;\n\n for (i in optionsObject){\n var relativeToMaxBar;\n if (optionsObject[i].votes==undefined||optionsObject[i].votes<=0){\n relativeToMaxBar=0.1/maxVotes;\n } else{\n relativeToMaxBar = (optionsObject[i].votes/maxVotes);\n }\n\n $(\"#\"+optionsObject[i].uuid+\"_div\").css('height', wrapperHeight*relativeToMaxBar).css(\"width\", barWidth).text(optionsObject[i].votes);\n $(\"#\"+optionsObject[i].uuid+\"_btn\").css(\"background-color\", optionsObject[i].color);\n }\n}\n", "meta": {"content_hash": "4fe37c240353a5a86b6ee95c43ba6a07", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 195, "avg_line_length": 35.98780487804878, "alnum_prop": 0.6104710267705863, "repo_name": "delib-org/delib-fron2", "id": "9c5413af8e60915768c1f0f7671d4c1b3b78ddfd", "size": "5902", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/js/questions/limitedOptions.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "439329"}, {"name": "HTML", "bytes": "23894"}, {"name": "JavaScript", "bytes": "1157562"}]}} +{"text": "\n\n/* Layout helpers\n----------------------------------*/\n.ui-helper-hidden {\n\tdisplay: none;\n}\n.ui-helper-hidden-accessible {\n\tborder: 0;\n\tclip: rect(0 0 0 0);\n\theight: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twidth: 1px;\n}\n.ui-helper-reset {\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\toutline: 0;\n\tline-height: 1.3;\n\ttext-decoration: none;\n\tfont-size: 100%;\n\tlist-style: none;\n}\n.ui-helper-clearfix:before,\n.ui-helper-clearfix:after {\n\tcontent: \"\";\n\tdisplay: table;\n\tborder-collapse: collapse;\n}\n.ui-helper-clearfix:after {\n\tclear: both;\n}\n.ui-helper-clearfix {\n\tmin-height: 0; /* support: IE7 */\n}\n.ui-helper-zfix {\n\twidth: 100%;\n\theight: 100%;\n\ttop: 0;\n\tleft: 0;\n\tposition: absolute;\n\topacity: 0;\n\tfilter:Alpha(Opacity=0);\n}\n\n.ui-front {\n\tz-index: 100;\n}\n\n\n/* Interaction Cues\n----------------------------------*/\n.ui-state-disabled {\n\tcursor: default !important;\n}\n\n\n/* Icons\n----------------------------------*/\n\n/* states and images */\n.ui-icon {\n\tdisplay: block;\n\ttext-indent: -99999px;\n\toverflow: hidden;\n\tbackground-repeat: no-repeat;\n}\n\n\n/* Misc visuals\n----------------------------------*/\n\n/* Overlays */\n.ui-widget-overlay {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n}\n.ui-resizable {\n\tposition: relative;\n}\n.ui-resizable-handle {\n\tposition: absolute;\n\tfont-size: 0.1px;\n\tdisplay: block;\n}\n.ui-resizable-disabled .ui-resizable-handle,\n.ui-resizable-autohide .ui-resizable-handle {\n\tdisplay: none;\n}\n.ui-resizable-n {\n\tcursor: n-resize;\n\theight: 7px;\n\twidth: 100%;\n\ttop: -5px;\n\tleft: 0;\n}\n.ui-resizable-s {\n\tcursor: s-resize;\n\theight: 7px;\n\twidth: 100%;\n\tbottom: -5px;\n\tleft: 0;\n}\n.ui-resizable-e {\n\tcursor: e-resize;\n\twidth: 7px;\n\tright: -5px;\n\ttop: 0;\n\theight: 100%;\n}\n.ui-resizable-w {\n\tcursor: w-resize;\n\twidth: 7px;\n\tleft: -5px;\n\ttop: 0;\n\theight: 100%;\n}\n.ui-resizable-se {\n\tcursor: se-resize;\n\twidth: 12px;\n\theight: 12px;\n\tright: 1px;\n\tbottom: 1px;\n}\n.ui-resizable-sw {\n\tcursor: sw-resize;\n\twidth: 9px;\n\theight: 9px;\n\tleft: -5px;\n\tbottom: -5px;\n}\n.ui-resizable-nw {\n\tcursor: nw-resize;\n\twidth: 9px;\n\theight: 9px;\n\tleft: -5px;\n\ttop: -5px;\n}\n.ui-resizable-ne {\n\tcursor: ne-resize;\n\twidth: 9px;\n\theight: 9px;\n\tright: -5px;\n\ttop: -5px;\n}\n.ui-button {\n\tdisplay: inline-block;\n\tposition: relative;\n\tpadding: 0;\n\tline-height: normal;\n\tmargin-right: .1em;\n\tcursor: pointer;\n\tvertical-align: middle;\n\ttext-align: center;\n\toverflow: visible; /* removes extra width in IE */\n}\n.ui-button,\n.ui-button:link,\n.ui-button:visited,\n.ui-button:hover,\n.ui-button:active {\n\ttext-decoration: none;\n}\n/* to make room for the icon, a width needs to be set here */\n.ui-button-icon-only {\n\twidth: 2.2em;\n}\n/* button elements seem to need a little more width */\nbutton.ui-button-icon-only {\n\twidth: 2.4em;\n}\n.ui-button-icons-only {\n\twidth: 3.4em;\n}\nbutton.ui-button-icons-only {\n\twidth: 3.7em;\n}\n\n/* button text element */\n.ui-button .ui-button-text {\n\tdisplay: block;\n\tline-height: normal;\n}\n.ui-button-text-only .ui-button-text {\n\tpadding: .4em 1em;\n}\n.ui-button-icon-only .ui-button-text,\n.ui-button-icons-only .ui-button-text {\n\tpadding: .4em;\n\ttext-indent: -9999999px;\n}\n.ui-button-text-icon-primary .ui-button-text,\n.ui-button-text-icons .ui-button-text {\n\tpadding: .4em 1em .4em 2.1em;\n}\n.ui-button-text-icon-secondary .ui-button-text,\n.ui-button-text-icons .ui-button-text {\n\tpadding: .4em 2.1em .4em 1em;\n}\n.ui-button-text-icons .ui-button-text {\n\tpadding-left: 2.1em;\n\tpadding-right: 2.1em;\n}\n/* no icon support for input elements, provide padding by default */\ninput.ui-button {\n\tpadding: .4em 1em;\n}\n\n/* button icon element(s) */\n.ui-button-icon-only .ui-icon,\n.ui-button-text-icon-primary .ui-icon,\n.ui-button-text-icon-secondary .ui-icon,\n.ui-button-text-icons .ui-icon,\n.ui-button-icons-only .ui-icon {\n\tposition: absolute;\n\ttop: 50%;\n\tmargin-top: -8px;\n}\n.ui-button-icon-only .ui-icon {\n\tleft: 50%;\n\tmargin-left: -8px;\n}\n.ui-button-text-icon-primary .ui-button-icon-primary,\n.ui-button-text-icons .ui-button-icon-primary,\n.ui-button-icons-only .ui-button-icon-primary {\n\tleft: .5em;\n}\n.ui-button-text-icon-secondary .ui-button-icon-secondary,\n.ui-button-text-icons .ui-button-icon-secondary,\n.ui-button-icons-only .ui-button-icon-secondary {\n\tright: .5em;\n}\n\n/* button sets */\n.ui-buttonset {\n\tmargin-right: 7px;\n}\n.ui-buttonset .ui-button {\n\tmargin-left: 0;\n\tmargin-right: -.3em;\n}\n\n/* workarounds */\n/* reset extra padding in Firefox, see h5bp.com/l */\ninput.ui-button::-moz-focus-inner,\nbutton.ui-button::-moz-focus-inner {\n\tborder: 0;\n\tpadding: 0;\n}\n.ui-dialog {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tpadding: .2em;\n\toutline: 0;\n}\n.ui-dialog .ui-dialog-titlebar {\n\tpadding: .4em 1em;\n\tposition: relative;\n}\n.ui-dialog .ui-dialog-title {\n\tfloat: left;\n\tmargin: .1em 0;\n\twhite-space: nowrap;\n\twidth: 90%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n.ui-dialog .ui-dialog-titlebar-close {\n\tposition: absolute;\n\tright: .3em;\n\ttop: 50%;\n\twidth: 21px;\n\tmargin: -10px 0 0 0;\n\tpadding: 1px;\n\theight: 20px;\n}\n.ui-dialog .ui-dialog-content {\n\tposition: relative;\n\tborder: 0;\n\tpadding: .5em 1em;\n\tbackground: none;\n\toverflow: auto;\n}\n.ui-dialog .ui-dialog-buttonpane {\n\ttext-align: left;\n\tborder-width: 1px 0 0 0;\n\tbackground-image: none;\n\tmargin-top: .5em;\n\tpadding: .3em 1em .5em .4em;\n}\n.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {\n\tfloat: right;\n}\n.ui-dialog .ui-dialog-buttonpane button {\n\tmargin: .5em .4em .5em 0;\n\tcursor: pointer;\n}\n.ui-dialog .ui-resizable-se {\n\twidth: 12px;\n\theight: 12px;\n\tright: -5px;\n\tbottom: -5px;\n\tbackground-position: 16px 16px;\n}\n.ui-draggable .ui-dialog-titlebar {\n\tcursor: move;\n}\n.ui-tooltip {\n\tpadding: 8px;\n\tposition: absolute;\n\tz-index: 9999;\n\tmax-width: 300px;\n\t-webkit-box-shadow: 0 0 5px #aaa;\n\tbox-shadow: 0 0 5px #aaa;\n}\nbody .ui-tooltip {\n\tborder-width: 2px;\n}\n\n/* Component containers\n----------------------------------*/\n.ui-widget {\n\tfont-family: Verdana,Arial,sans-serif;\n\tfont-size: 1.1em;\n}\n.ui-widget .ui-widget {\n\tfont-size: 1em;\n}\n.ui-widget input,\n.ui-widget select,\n.ui-widget textarea,\n.ui-widget button {\n\tfont-family: Verdana,Arial,sans-serif;\n\tfont-size: 1em;\n}\n.ui-widget-content {\n\tborder: 1px solid #aaaaaa;\n\tbackground: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;\n\tcolor: #222222;\n}\n.ui-widget-content a {\n\tcolor: #222222;\n}\n.ui-widget-header {\n\tborder: 1px solid #aaaaaa;\n\tbackground: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;\n\tcolor: #222222;\n\tfont-weight: bold;\n}\n.ui-widget-header a {\n\tcolor: #222222;\n}\n\n/* Interaction states\n----------------------------------*/\n.ui-state-default,\n.ui-widget-content .ui-state-default,\n.ui-widget-header .ui-state-default {\n\tborder: 1px solid #d3d3d3;\n\tbackground: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;\n\tfont-weight: normal;\n\tcolor: #555555;\n}\n.ui-state-default a,\n.ui-state-default a:link,\n.ui-state-default a:visited {\n\tcolor: #555555;\n\ttext-decoration: none;\n}\n.ui-state-hover,\n.ui-widget-content .ui-state-hover,\n.ui-widget-header .ui-state-hover,\n.ui-state-focus,\n.ui-widget-content .ui-state-focus,\n.ui-widget-header .ui-state-focus {\n\tborder: 1px solid #999999;\n\tbackground: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;\n\tfont-weight: normal;\n\tcolor: #212121;\n}\n.ui-state-hover a,\n.ui-state-hover a:hover,\n.ui-state-hover a:link,\n.ui-state-hover a:visited {\n\tcolor: #212121;\n\ttext-decoration: none;\n}\n.ui-state-active,\n.ui-widget-content .ui-state-active,\n.ui-widget-header .ui-state-active {\n\tborder: 1px solid #aaaaaa;\n\tbackground: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;\n\tfont-weight: normal;\n\tcolor: #212121;\n}\n.ui-state-active a,\n.ui-state-active a:link,\n.ui-state-active a:visited {\n\tcolor: #212121;\n\ttext-decoration: none;\n}\n\n/* Interaction Cues\n----------------------------------*/\n.ui-state-highlight,\n.ui-widget-content .ui-state-highlight,\n.ui-widget-header .ui-state-highlight {\n\tborder: 1px solid #fcefa1;\n\tbackground: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;\n\tcolor: #363636;\n}\n.ui-state-highlight a,\n.ui-widget-content .ui-state-highlight a,\n.ui-widget-header .ui-state-highlight a {\n\tcolor: #363636;\n}\n.ui-state-error,\n.ui-widget-content .ui-state-error,\n.ui-widget-header .ui-state-error {\n\tborder: 1px solid #cd0a0a;\n\tbackground: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;\n\tcolor: #cd0a0a;\n}\n.ui-state-error a,\n.ui-widget-content .ui-state-error a,\n.ui-widget-header .ui-state-error a {\n\tcolor: #cd0a0a;\n}\n.ui-state-error-text,\n.ui-widget-content .ui-state-error-text,\n.ui-widget-header .ui-state-error-text {\n\tcolor: #cd0a0a;\n}\n.ui-priority-primary,\n.ui-widget-content .ui-priority-primary,\n.ui-widget-header .ui-priority-primary {\n\tfont-weight: bold;\n}\n.ui-priority-secondary,\n.ui-widget-content .ui-priority-secondary,\n.ui-widget-header .ui-priority-secondary {\n\topacity: .7;\n\tfilter:Alpha(Opacity=70);\n\tfont-weight: normal;\n}\n.ui-state-disabled,\n.ui-widget-content .ui-state-disabled,\n.ui-widget-header .ui-state-disabled {\n\topacity: .35;\n\tfilter:Alpha(Opacity=35);\n\tbackground-image: none;\n}\n.ui-state-disabled .ui-icon {\n\tfilter:Alpha(Opacity=35); /* For IE8 - See #6059 */\n}\n\n/* Icons\n----------------------------------*/\n\n/* states and images */\n.ui-icon {\n\twidth: 16px;\n\theight: 16px;\n}\n.ui-icon,\n.ui-widget-content .ui-icon {\n\tbackground-image: url(images/ui-icons_222222_256x240.png);\n}\n.ui-widget-header .ui-icon {\n\tbackground-image: url(images/ui-icons_222222_256x240.png);\n}\n.ui-state-default .ui-icon {\n\tbackground-image: url(images/ui-icons_888888_256x240.png);\n}\n.ui-state-hover .ui-icon,\n.ui-state-focus .ui-icon {\n\tbackground-image: url(images/ui-icons_454545_256x240.png);\n}\n.ui-state-active .ui-icon {\n\tbackground-image: url(images/ui-icons_454545_256x240.png);\n}\n.ui-state-highlight .ui-icon {\n\tbackground-image: url(images/ui-icons_2e83ff_256x240.png);\n}\n.ui-state-error .ui-icon,\n.ui-state-error-text .ui-icon {\n\tbackground-image: url(images/ui-icons_cd0a0a_256x240.png);\n}\n\n/* positioning */\n.ui-icon-blank { background-position: 16px 16px; }\n.ui-icon-carat-1-n { background-position: 0 0; }\n.ui-icon-carat-1-ne { background-position: -16px 0; }\n.ui-icon-carat-1-e { background-position: -32px 0; }\n.ui-icon-carat-1-se { background-position: -48px 0; }\n.ui-icon-carat-1-s { background-position: -64px 0; }\n.ui-icon-carat-1-sw { background-position: -80px 0; }\n.ui-icon-carat-1-w { background-position: -96px 0; }\n.ui-icon-carat-1-nw { background-position: -112px 0; }\n.ui-icon-carat-2-n-s { background-position: -128px 0; }\n.ui-icon-carat-2-e-w { background-position: -144px 0; }\n.ui-icon-triangle-1-n { background-position: 0 -16px; }\n.ui-icon-triangle-1-ne { background-position: -16px -16px; }\n.ui-icon-triangle-1-e { background-position: -32px -16px; }\n.ui-icon-triangle-1-se { background-position: -48px -16px; }\n.ui-icon-triangle-1-s { background-position: -64px -16px; }\n.ui-icon-triangle-1-sw { background-position: -80px -16px; }\n.ui-icon-triangle-1-w { background-position: -96px -16px; }\n.ui-icon-triangle-1-nw { background-position: -112px -16px; }\n.ui-icon-triangle-2-n-s { background-position: -128px -16px; }\n.ui-icon-triangle-2-e-w { background-position: -144px -16px; }\n.ui-icon-arrow-1-n { background-position: 0 -32px; }\n.ui-icon-arrow-1-ne { background-position: -16px -32px; }\n.ui-icon-arrow-1-e { background-position: -32px -32px; }\n.ui-icon-arrow-1-se { background-position: -48px -32px; }\n.ui-icon-arrow-1-s { background-position: -64px -32px; }\n.ui-icon-arrow-1-sw { background-position: -80px -32px; }\n.ui-icon-arrow-1-w { background-position: -96px -32px; }\n.ui-icon-arrow-1-nw { background-position: -112px -32px; }\n.ui-icon-arrow-2-n-s { background-position: -128px -32px; }\n.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }\n.ui-icon-arrow-2-e-w { background-position: -160px -32px; }\n.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }\n.ui-icon-arrowstop-1-n { background-position: -192px -32px; }\n.ui-icon-arrowstop-1-e { background-position: -208px -32px; }\n.ui-icon-arrowstop-1-s { background-position: -224px -32px; }\n.ui-icon-arrowstop-1-w { background-position: -240px -32px; }\n.ui-icon-arrowthick-1-n { background-position: 0 -48px; }\n.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }\n.ui-icon-arrowthick-1-e { background-position: -32px -48px; }\n.ui-icon-arrowthick-1-se { background-position: -48px -48px; }\n.ui-icon-arrowthick-1-s { background-position: -64px -48px; }\n.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }\n.ui-icon-arrowthick-1-w { background-position: -96px -48px; }\n.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }\n.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }\n.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }\n.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }\n.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }\n.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }\n.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }\n.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }\n.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }\n.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }\n.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }\n.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }\n.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }\n.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }\n.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }\n.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }\n.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }\n.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }\n.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }\n.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }\n.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }\n.ui-icon-arrow-4 { background-position: 0 -80px; }\n.ui-icon-arrow-4-diag { background-position: -16px -80px; }\n.ui-icon-extlink { background-position: -32px -80px; }\n.ui-icon-newwin { background-position: -48px -80px; }\n.ui-icon-refresh { background-position: -64px -80px; }\n.ui-icon-shuffle { background-position: -80px -80px; }\n.ui-icon-transfer-e-w { background-position: -96px -80px; }\n.ui-icon-transferthick-e-w { background-position: -112px -80px; }\n.ui-icon-folder-collapsed { background-position: 0 -96px; }\n.ui-icon-folder-open { background-position: -16px -96px; }\n.ui-icon-document { background-position: -32px -96px; }\n.ui-icon-document-b { background-position: -48px -96px; }\n.ui-icon-note { background-position: -64px -96px; }\n.ui-icon-mail-closed { background-position: -80px -96px; }\n.ui-icon-mail-open { background-position: -96px -96px; }\n.ui-icon-suitcase { background-position: -112px -96px; }\n.ui-icon-comment { background-position: -128px -96px; }\n.ui-icon-person { background-position: -144px -96px; }\n.ui-icon-print { background-position: -160px -96px; }\n.ui-icon-trash { background-position: -176px -96px; }\n.ui-icon-locked { background-position: -192px -96px; }\n.ui-icon-unlocked { background-position: -208px -96px; }\n.ui-icon-bookmark { background-position: -224px -96px; }\n.ui-icon-tag { background-position: -240px -96px; }\n.ui-icon-home { background-position: 0 -112px; }\n.ui-icon-flag { background-position: -16px -112px; }\n.ui-icon-calendar { background-position: -32px -112px; }\n.ui-icon-cart { background-position: -48px -112px; }\n.ui-icon-pencil { background-position: -64px -112px; }\n.ui-icon-clock { background-position: -80px -112px; }\n.ui-icon-disk { background-position: -96px -112px; }\n.ui-icon-calculator { background-position: -112px -112px; }\n.ui-icon-zoomin { background-position: -128px -112px; }\n.ui-icon-zoomout { background-position: -144px -112px; }\n.ui-icon-search { background-position: -160px -112px; }\n.ui-icon-wrench { background-position: -176px -112px; }\n.ui-icon-gear { background-position: -192px -112px; }\n.ui-icon-heart { background-position: -208px -112px; }\n.ui-icon-star { background-position: -224px -112px; }\n.ui-icon-link { background-position: -240px -112px; }\n.ui-icon-cancel { background-position: 0 -128px; }\n.ui-icon-plus { background-position: -16px -128px; }\n.ui-icon-plusthick { background-position: -32px -128px; }\n.ui-icon-minus { background-position: -48px -128px; }\n.ui-icon-minusthick { background-position: -64px -128px; }\n.ui-icon-close { background-position: -80px -128px; }\n.ui-icon-closethick { background-position: -96px -128px; }\n.ui-icon-key { background-position: -112px -128px; }\n.ui-icon-lightbulb { background-position: -128px -128px; }\n.ui-icon-scissors { background-position: -144px -128px; }\n.ui-icon-clipboard { background-position: -160px -128px; }\n.ui-icon-copy { background-position: -176px -128px; }\n.ui-icon-contact { background-position: -192px -128px; }\n.ui-icon-image { background-position: -208px -128px; }\n.ui-icon-video { background-position: -224px -128px; }\n.ui-icon-script { background-position: -240px -128px; }\n.ui-icon-alert { background-position: 0 -144px; }\n.ui-icon-info { background-position: -16px -144px; }\n.ui-icon-notice { background-position: -32px -144px; }\n.ui-icon-help { background-position: -48px -144px; }\n.ui-icon-check { background-position: -64px -144px; }\n.ui-icon-bullet { background-position: -80px -144px; }\n.ui-icon-radio-on { background-position: -96px -144px; }\n.ui-icon-radio-off { background-position: -112px -144px; }\n.ui-icon-pin-w { background-position: -128px -144px; }\n.ui-icon-pin-s { background-position: -144px -144px; }\n.ui-icon-play { background-position: 0 -160px; }\n.ui-icon-pause { background-position: -16px -160px; }\n.ui-icon-seek-next { background-position: -32px -160px; }\n.ui-icon-seek-prev { background-position: -48px -160px; }\n.ui-icon-seek-end { background-position: -64px -160px; }\n.ui-icon-seek-start { background-position: -80px -160px; }\n/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */\n.ui-icon-seek-first { background-position: -80px -160px; }\n.ui-icon-stop { background-position: -96px -160px; }\n.ui-icon-eject { background-position: -112px -160px; }\n.ui-icon-volume-off { background-position: -128px -160px; }\n.ui-icon-volume-on { background-position: -144px -160px; }\n.ui-icon-power { background-position: 0 -176px; }\n.ui-icon-signal-diag { background-position: -16px -176px; }\n.ui-icon-signal { background-position: -32px -176px; }\n.ui-icon-battery-0 { background-position: -48px -176px; }\n.ui-icon-battery-1 { background-position: -64px -176px; }\n.ui-icon-battery-2 { background-position: -80px -176px; }\n.ui-icon-battery-3 { background-position: -96px -176px; }\n.ui-icon-circle-plus { background-position: 0 -192px; }\n.ui-icon-circle-minus { background-position: -16px -192px; }\n.ui-icon-circle-close { background-position: -32px -192px; }\n.ui-icon-circle-triangle-e { background-position: -48px -192px; }\n.ui-icon-circle-triangle-s { background-position: -64px -192px; }\n.ui-icon-circle-triangle-w { background-position: -80px -192px; }\n.ui-icon-circle-triangle-n { background-position: -96px -192px; }\n.ui-icon-circle-arrow-e { background-position: -112px -192px; }\n.ui-icon-circle-arrow-s { background-position: -128px -192px; }\n.ui-icon-circle-arrow-w { background-position: -144px -192px; }\n.ui-icon-circle-arrow-n { background-position: -160px -192px; }\n.ui-icon-circle-zoomin { background-position: -176px -192px; }\n.ui-icon-circle-zoomout { background-position: -192px -192px; }\n.ui-icon-circle-check { background-position: -208px -192px; }\n.ui-icon-circlesmall-plus { background-position: 0 -208px; }\n.ui-icon-circlesmall-minus { background-position: -16px -208px; }\n.ui-icon-circlesmall-close { background-position: -32px -208px; }\n.ui-icon-squaresmall-plus { background-position: -48px -208px; }\n.ui-icon-squaresmall-minus { background-position: -64px -208px; }\n.ui-icon-squaresmall-close { background-position: -80px -208px; }\n.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }\n.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }\n.ui-icon-grip-solid-vertical { background-position: -32px -224px; }\n.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }\n.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }\n.ui-icon-grip-diagonal-se { background-position: -80px -224px; }\n\n\n/* Misc visuals\n----------------------------------*/\n\n/* Corner radius */\n.ui-corner-all,\n.ui-corner-top,\n.ui-corner-left,\n.ui-corner-tl {\n\tborder-top-left-radius: 4px;\n}\n.ui-corner-all,\n.ui-corner-top,\n.ui-corner-right,\n.ui-corner-tr {\n\tborder-top-right-radius: 4px;\n}\n.ui-corner-all,\n.ui-corner-bottom,\n.ui-corner-left,\n.ui-corner-bl {\n\tborder-bottom-left-radius: 4px;\n}\n.ui-corner-all,\n.ui-corner-bottom,\n.ui-corner-right,\n.ui-corner-br {\n\tborder-bottom-right-radius: 4px;\n}\n\n/* Overlays */\n.ui-widget-overlay {\n\tbackground: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;\n\topacity: .3;\n\tfilter: Alpha(Opacity=30);\n}\n.ui-widget-shadow {\n\tmargin: -8px 0 0 -8px;\n\tpadding: 8px;\n\tbackground: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;\n\topacity: .3;\n\tfilter: Alpha(Opacity=30);\n\tborder-radius: 8px;\n}\n", "meta": {"content_hash": "191522e64e11f60c4a079dade6237c16", "timestamp": "", "source": "github", "line_count": 719, "max_line_length": 91, "avg_line_length": 29.581363004172463, "alnum_prop": 0.6894541351262401, "repo_name": "ZeusWPI/FK-enrolment", "id": "0d81a92f50179d23db780f8a1e26de9633d09710", "size": "22864", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/assets/stylesheets/jquery-ui.custom.css", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "11594"}, {"name": "HTML", "bytes": "41784"}, {"name": "JavaScript", "bytes": "2088"}, {"name": "Ruby", "bytes": "140042"}]}} +{"text": "\n#pragma once\n\n#include <kernel/thread.h>\n#include <lk/compiler.h>\n#include <lk/debug.h>\n#include <stdint.h>\n\n__BEGIN_CDECLS\n\n#define MUTEX_MAGIC (0x6D757478) // 'mutx'\n\ntypedef struct mutex {\n uint32_t magic;\n thread_t *holder;\n int count;\n wait_queue_t wait;\n} mutex_t;\n\n#define MUTEX_INITIAL_VALUE(m) \\\n{ \\\n .magic = MUTEX_MAGIC, \\\n .holder = NULL, \\\n .count = 0, \\\n .wait = WAIT_QUEUE_INITIAL_VALUE((m).wait), \\\n}\n\n/* Rules for Mutexes:\n * - Mutexes are only safe to use from thread context.\n * - Mutexes are non-recursive.\n*/\n\nvoid mutex_init(mutex_t *);\nvoid mutex_destroy(mutex_t *);\nstatus_t mutex_acquire_timeout(mutex_t *, lk_time_t); /* try to acquire the mutex with a timeout value */\nstatus_t mutex_release(mutex_t *);\n\nstatic inline status_t mutex_acquire(mutex_t *m) {\n return mutex_acquire_timeout(m, INFINITE_TIME);\n}\n\n/* does the current thread hold the mutex? */\nstatic bool is_mutex_held(mutex_t *m) {\n return m->holder == get_current_thread();\n}\n\n__END_CDECLS\n", "meta": {"content_hash": "3ea7f0a02373e74ad276588c857845ef", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 105, "avg_line_length": 21.53191489361702, "alnum_prop": 0.6590909090909091, "repo_name": "travisg/lk", "id": "b0182dcad4b7a19644c5503c40752c22cfea84f9", "size": "1253", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "kernel/include/kernel/mutex.h", "mode": "33188", "license": "mit", "language": [{"name": "Assembly", "bytes": "155785"}, {"name": "C", "bytes": "3642589"}, {"name": "C++", "bytes": "237085"}, {"name": "Makefile", "bytes": "97565"}, {"name": "Objective-C", "bytes": "12298"}, {"name": "Python", "bytes": "4345"}, {"name": "Shell", "bytes": "10818"}, {"name": "Tcl", "bytes": "288"}]}} +{"text": "UIMiniWindowContainer = extends(UIWidget, \"UIMiniWindowContainer\")\n\nfunction UIMiniWindowContainer.create()\n local container = UIMiniWindowContainer.internalCreate()\n container.scheduledWidgets = {}\n container:setFocusable(false)\n container:setPhantom(true)\n return container\nend\n\n-- TODO: connect to window onResize event\n-- TODO: try to resize another widget?\n-- TODO: try to find another panel?\nfunction UIMiniWindowContainer:fitAll(noRemoveChild)\n if not self:isVisible() then\n return\n end\n\n if not noRemoveChild then\n local children = self:getChildren()\n if #children > 0 then\n noRemoveChild = children[#children]\n else\n return\n end\n end\n\n local sumHeight = 0\n local children = self:getChildren()\n for i=1,#children do\n if children[i]:isVisible() then\n sumHeight = sumHeight + children[i]:getHeight()\n end\n end\n\n local selfHeight = self:getHeight() - (self:getPaddingTop() + self:getPaddingBottom())\n if sumHeight <= selfHeight then\n return\n end\n\n local removeChildren = {}\n\n -- try to resize noRemoveChild\n local maximumHeight = selfHeight - (sumHeight - noRemoveChild:getHeight())\n if noRemoveChild:isResizeable() and noRemoveChild:getMinimumHeight() <= maximumHeight then\n sumHeight = sumHeight - noRemoveChild:getHeight() + maximumHeight\n addEvent(function() noRemoveChild:setHeight(maximumHeight) end)\n end\n\n -- try to remove no-save widget\n for i=#children,1,-1 do\n if sumHeight <= selfHeight then\n break\n end\n\n local child = children[i]\n if child ~= noRemoveChild and not child.save then\n local childHeight = child:getHeight()\n sumHeight = sumHeight - childHeight\n table.insert(removeChildren, child)\n end\n end\n\n -- try to remove save widget\n for i=#children,1,-1 do\n if sumHeight <= selfHeight then\n break\n end\n\n local child = children[i]\n if child ~= noRemoveChild and child:isVisible() then\n local childHeight = child:getHeight()\n sumHeight = sumHeight - childHeight\n table.insert(removeChildren, child)\n end\n end\n\n -- close widgets\n for i=1,#removeChildren do\n removeChildren[i]:close()\n end\nend\n\nfunction UIMiniWindowContainer:onDrop(widget, mousePos)\n if widget:getClassName() == 'UIMiniWindow' then\n local oldParent = widget:getParent()\n if oldParent == self then\n return true\n end\n\n if oldParent then\n oldParent:removeChild(widget)\n end\n\n if widget.movedWidget then\n local index = self:getChildIndex(widget.movedWidget)\n self:insertChild(index + widget.movedIndex, widget)\n else\n self:addChild(widget)\n end\n\n self:fitAll(widget)\n return true\n end\nend\n\nfunction UIMiniWindowContainer:swapInsert(widget, index)\n local oldParent = widget:getParent()\n local oldIndex = self:getChildIndex(widget)\n\n if oldParent == self and oldIndex ~= index then\n local oldWidget = self:getChildByIndex(index)\n if oldWidget then\n self:removeChild(oldWidget)\n self:insertChild(oldIndex, oldWidget)\n end\n self:removeChild(widget)\n self:insertChild(index, widget)\n end\nend\n\nfunction UIMiniWindowContainer:scheduleInsert(widget, index)\n if index - 1 > self:getChildCount() then\n if self.scheduledWidgets[index] then\n pdebug('replacing scheduled widget id ' .. widget:getId())\n end\n self.scheduledWidgets[index] = widget\n else\n local oldParent = widget:getParent()\n if oldParent ~= self then\n if oldParent then\n oldParent:removeChild(widget)\n end\n self:insertChild(index, widget)\n\n while true do\n local placed = false\n for nIndex,nWidget in pairs(self.scheduledWidgets) do\n if nIndex - 1 <= self:getChildCount() then\n self:insertChild(nIndex, nWidget)\n self.scheduledWidgets[nIndex] = nil\n placed = true\n break\n end\n end\n if not placed then break end\n end\n\n end\n end\nend\n\nfunction UIMiniWindowContainer:order()\n local children = self:getChildren()\n for i=1,#children do\n if not children[i].miniLoaded then return end\n end\n\n for i=1,#children do\n if children[i].miniIndex then\n self:swapInsert(children[i], children[i].miniIndex)\n end\n end\nend\n\nfunction UIMiniWindowContainer:saveChildren()\n local children = self:getChildren()\n local ignoreIndex = 0\n for i=1,#children do\n if children[i].save then\n children[i]:saveParentIndex(self:getId(), i - ignoreIndex)\n else\n ignoreIndex = ignoreIndex + 1\n end\n end\nend\n", "meta": {"content_hash": "97c7c2107f2c4e082086aff8889ecfbf", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 92, "avg_line_length": 25.72159090909091, "alnum_prop": 0.6920698034018113, "repo_name": "Riverlance/kingdom-age-game-linux", "id": "a95841588f9ab6cb5bf9ebfbe7fa2cd8a7160a70", "size": "4540", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/corelib/ui/uiminiwindowcontainer.lua", "mode": "33188", "license": "mit", "language": []}} +{"text": "ogex_int_array_t *ogex_int_array_create(int capacity)\n{\n ogex_int_array_t *array = calloc(1, sizeof(ogex_int_array_t));\n if (array == NULL) {\n return NULL;\n }\n\n vec_init(array);\n vec_reserve(array, capacity);\n\n return array;\n}\n\nvoid ogex_int_array_free(ogex_int_array_t *array)\n{\n assert(array != NULL);\n vec_deinit(array);\n free(array);\n}\n\nvoid ogex_int_array_destroy(ogex_int_array_t *array)\n{\n assert(array != NULL);\n vec_deinit(array);\n free(array);\n}\n\nint ogex_int_array_push(ogex_int_array_t *array, int value)\n{\n assert(array != NULL);\n int result = vec_push(array, value);\n return result != -1;\n}\n\nint ogex_int_array_get(ogex_int_array_t *array, int index)\n{\n assert(array != NULL);\n assert(index < 0 && index >= array->length);\n\n return vec_get(array, index);\n}\n\nint ogex_int_array_pop(ogex_int_array_t *array)\n{\n assert(array != NULL);\n return vec_pop(array);\n}\n\n", "meta": {"content_hash": "93c563d65b0f97e9bcda631bdb976f27", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 66, "avg_line_length": 19.583333333333332, "alnum_prop": 0.6212765957446809, "repo_name": "warmwaffles/openddl", "id": "fdca7e6ac1d9923e6f9258b94062f52b9a53e6b5", "size": "1013", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "opengex/src/opengex/int_array.c", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "147318"}, {"name": "CMake", "bytes": "1293"}, {"name": "Objective-C", "bytes": "501"}]}} +{"text": "var React = require('react');\nvar mdlHandler = require('./mdlComponentHandler');\n\nfunction mdlUpgradable(spec) {\n\n var mdlPrefix = 'mdl-',\n jsPrefix = 'js-',\n displayName = spec.displayName,\n componentName = displayName.replace('Material', '');\n\n var upgradeMdlComponent = function (node) {\n mdlHandler.upgradeElement(node, displayName);\n };\n\n var downgradeMdlComponent = function(node) {\n mdlHandler.downgradeElements(node, displayName);\n };\n\n return React.createClass({\n\n displayName: displayName,\n\n propTypes: { className: React.PropTypes.string },\n\n getDefaultProps: function() {\n return { className: '' };\n },\n\n componentDidMount: function() {\n upgradeMdlComponent(this.getDOMNode());\n },\n\n componentWillUpdate: function() {\n downgradeMdlComponent(this.getDOMNode());\n },\n\n componentDidUpdate: function() {\n upgradeMdlComponent(this.getDOMNode());\n },\n\n componentWillUnmount: function() {\n downgradeMdlComponent(this.getDOMNode());\n },\n\n getUpgradedMDLClassList: function() {\n var cssClass = mdlPrefix + jsPrefix + componentName.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(),\n baseClass = cssClass.replace(jsPrefix, '');\n\n return [baseClass, cssClass];\n },\n\n render: function() {\n\n var classList = this.props.className.split(' '),\n mdlClassList = this.getUpgradedMDLClassList();\n\n this.element = React.createElement(spec, this.props);\n\n return React.cloneElement(this.element, {\n className: mdlClassList.concat(classList).join(' ')\n });\n }\n\n });\n\n}\n\nmodule.exports = mdlUpgradable;\n", "meta": {"content_hash": "42adb3eb020dac4c91d3d2473d775452", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 108, "avg_line_length": 24.220588235294116, "alnum_prop": 0.6490588949605343, "repo_name": "EdStudio/react-mdlite", "id": "4b6bd5768c7399c8c84c538ad865561f68d8b748", "size": "1647", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/utils/mdlUpgradable.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "50429"}, {"name": "Shell", "bytes": "190"}]}} +{"text": "/* Generic definitions */\n\n\n\n\n/* Assertions (useful to generate conditional code) */\n/* Current type and class (and size, if applicable) */\n/* Value methods */\n/* Interfaces (keys) */\n/* Interfaces (values) */\n/* Abstract implementations (keys) */\n/* Abstract implementations (values) */\n/* Static containers (keys) */\n/* Static containers (values) */\n/* Implementations */\n/* Synchronized wrappers */\n/* Unmodifiable wrappers */\n/* Other wrappers */\n/* Methods (keys) */\n/* Methods (values) */\n/* Methods (keys/values) */\n/* Methods that have special names depending on keys (but the special names depend on values) */\n/* Equality */\n/* Object/Reference-only definitions (keys) */\n/* Primitive-type-only definitions (keys) */\n/* Object/Reference-only definitions (values) */\n/* Primitive-type-only definitions (values) */\n/*\t\t \n * Copyright (C) 2002-2013 Sebastiano Vigna \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License. \n */\npackage it.unimi.dsi.fastutil.ints;\nimport it.unimi.dsi.fastutil.chars.CharCollection;\nimport it.unimi.dsi.fastutil.objects.ObjectSet;\nimport it.unimi.dsi.fastutil.objects.ObjectIterator;\nimport java.util.Map;\n/** A type-specific {@link Map}; provides some additional methods that use polymorphism to avoid (un)boxing, and handling of a default return value.\n *\n * <P>Besides extending the corresponding type-specific {@linkplain it.unimi.dsi.fastutil.Function function}, this interface strengthens {@link #entrySet()},\n * {@link #keySet()} and {@link #values()}. Maps returning entry sets of type {@link FastEntrySet} support also fast iteration.\n *\n * <P>A submap or subset may or may not have an\n * independent default return value (which however must be initialized to the\n * default return value of the originator).\n *\n * @see Map\n */\npublic interface Int2CharMap extends Int2CharFunction , Map<Integer,Character> {\n /** An entry set providing fast iteration. \n\t *\n\t * <p>In some cases (e.g., hash-based classes) iteration over an entry set requires the creation\n\t * of a large number of {@link java.util.Map.Entry} objects. Some <code>fastutil</code>\n\t * maps might return {@linkplain #entrySet() entry set} objects of type <code>FastEntrySet</code>: in this case, {@link #fastIterator() fastIterator()}\n\t * will return an iterator that is guaranteed not to create a large number of objects, <em>possibly\n\t * by returning always the same entry</em> (of course, mutated).\n\t */\n public interface FastEntrySet extends ObjectSet<Int2CharMap.Entry > {\n /** Returns a fast iterator over this entry set; the iterator might return always the same entry object, suitably mutated.\n\t\t *\n\t\t * @return a fast iterator over this entry set; the iterator might return always the same {@link java.util.Map.Entry} object, suitably mutated.\n\t\t */\n public ObjectIterator<Int2CharMap.Entry > fastIterator();\n }\n /** Returns a set view of the mappings contained in this map.\n\t * <P>Note that this specification strengthens the one given in {@link Map#entrySet()}.\n\t *\n\t * @return a set view of the mappings contained in this map.\n\t * @see Map#entrySet()\n\t */\n ObjectSet<Map.Entry<Integer, Character>> entrySet();\n /** Returns a type-specific set view of the mappings contained in this map.\n\t *\n\t * <p>This method is necessary because there is no inheritance along\n\t * type parameters: it is thus impossible to strengthen {@link #entrySet()}\n\t * so that it returns an {@link it.unimi.dsi.fastutil.objects.ObjectSet}\n\t * of objects of type {@link java.util.Map.Entry} (the latter makes it possible to\n\t * access keys and values with type-specific methods).\n\t *\n\t * @return a type-specific set view of the mappings contained in this map.\n\t * @see #entrySet()\n\t */\n ObjectSet<Int2CharMap.Entry > int2CharEntrySet();\n /** Returns a set view of the keys contained in this map.\n\t * <P>Note that this specification strengthens the one given in {@link Map#keySet()}.\n\t *\n\t * @return a set view of the keys contained in this map.\n\t * @see Map#keySet()\n\t */\n IntSet keySet();\n /** Returns a set view of the values contained in this map.\n\t * <P>Note that this specification strengthens the one given in {@link Map#values()}.\n\t *\n\t * @return a set view of the values contained in this map.\n\t * @see Map#values()\n\t */\n CharCollection values();\n /**\n\t * @see Map#containsValue(Object)\n\t */\n boolean containsValue( char value );\n /** A type-specific {@link java.util.Map.Entry}; provides some additional methods\n\t * that use polymorphism to avoid (un)boxing.\n\t *\n\t * @see java.util.Map.Entry\n\t */\n interface Entry extends Map.Entry <Integer,Character> {\n\n /**\n\t\t * @see java.util.Map.Entry#getKey()\n\t\t */\n int getIntKey();\n\n\n\n /**\n\t\t * @see java.util.Map.Entry#setValue(Object)\n\t\t */\n char setValue(char value);\n\n /**\n\t\t * @see java.util.Map.Entry#getValue()\n\t\t */\n char getCharValue();\n\n\n }\n}\n", "meta": {"content_hash": "f7b493ffff62b2666644acc3e1429312", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 157, "avg_line_length": 38.48550724637681, "alnum_prop": 0.7122952363020146, "repo_name": "karussell/fastutil", "id": "c3d7d0f6fcb18d4600e1f865e62d92aa5142198b", "size": "5311", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/it/unimi/dsi/fastutil/ints/Int2CharMap.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "554418"}, {"name": "Shell", "bytes": "23387"}]}} +{"text": "/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n */\npackage wts.models.DisMELS.IBMFunctions.Spawning;\n\nimport com.wtstockhausen.utils.RandomNumberGenerator;\nimport org.openide.util.lookup.ServiceProvider;\nimport org.openide.util.lookup.ServiceProviders;\nimport wts.models.DisMELS.framework.GlobalInfo;\nimport wts.models.DisMELS.framework.IBMFunctions.AbstractIBMFunction;\nimport wts.models.DisMELS.framework.IBMFunctions.IBMFunctionInterface;\nimport wts.models.DisMELS.framework.IBMFunctions.IBMParameter;\n\n/**\n * This class provides an implementation of batch spawning activity with\"\n * a poisson-distributed recovery period\n * Type: \n * spawning function\n * Parameters (by key):\n * minRecoveryPeriod - Double - minimum recovery period (d)\n * meaRecoveryPeriod - Double - mean recovery period (d)\n * randomize - Boolean - randomize recovery period\n * Variables:\n * vars - any Object or null\n * Value:\n * t - time to next spawning event(d)\n * t ~ Poisson[meanRP,1/(meanRP-minRP)]\n * \n * @author William.Stockhausen\n */\n@ServiceProviders(value={\n @ServiceProvider(service=IBMFunctionInterface.class)}\n)\npublic class BatchSpawningFunction extends AbstractIBMFunction {\n \n /** random number generator */\n protected static final RandomNumberGenerator rng = GlobalInfo.getInstance().getRandomNumberGenerator();\n \n /** function classification */\n public static final String DEFAULT_type = \"Spawning\";\n /** user-friendly function name */\n public static final String DEFAULT_name = \"batch spawning function\";\n /** function description */\n public static final String DEFAULT_descr = \"batch spawning function\";\n /** full description */\n public static final String DEFAULT_fullDescr = \n \"\\n\\t**************************************************************************\"+\n \"\\n\\t* This class provides an implementation of batch spawning activity with\"+\n \"\\n\\t* a poisson-distributed recovery period.\"+\n \"\\n\\t* Type: \"+\n \"\\n\\t* spawning function\"+\n \"\\n\\t* Parameters (by key):\"+\n \"\\n\\t* minRecoveryPeriod - Double - minimum recovery period (d)\"+\n \"\\n\\t* meaRecoveryPeriod - Double - mean recovery period (d)\"+\n \"\\n\\t* randomize - Boolean - randomize recovery period \"+\n \"\\n\\t* Variables:\"+\n \"\\n\\t* vars - any Object or null\"+\n \"\\n\\t* Value:\"+\n \"\\n\\t* t - time to next spawning event(d)\"+\n \"\\n\\t* t ~ Poisson[meanRP,1/(meanRP-minRP)]\"+\n \"\\n\\t* author: William.Stockhausen\"+\n \"\\n\\t**************************************************************************\";\n\n /** number of settable parameters */\n public static final int numParams = 2;\n /** number of sub-functions */\n public static final int numSubFuncs = 0;\n\n /** key to set min recovery period parameter */\n public static final String PARAM_minRecoveryPeriod = \"minimum recovery period (d)\";\n /** key to set mean recovery period parameter */\n public static final String PARAM_meanRecoveryPeriod = \"mean recovery period (d)\";\n /** key to set stochastic flag */\n public static final String PARAM_randomize = \"randomize recovery period\";\n \n /** value of min recovery period parameter */\n private double minRP = 0.0;\n /** value of mean recovery period parameter */\n private double meanRP = 0.0;\n /** value of mean recovery period parameter */\n private boolean randomize = false;\n \n /** constructor for class */\n public BatchSpawningFunction(){\n super(numParams,numSubFuncs,DEFAULT_type,DEFAULT_name,DEFAULT_descr,DEFAULT_fullDescr);\n String key; \n key = PARAM_minRecoveryPeriod; addParameter(key,Double.class, key);\n key = PARAM_meanRecoveryPeriod; addParameter(key,Double.class, key);\n key = PARAM_randomize; addParameter(key,Boolean.class, key); \n }\n \n @Override\n public BatchSpawningFunction clone(){\n BatchSpawningFunction clone = new BatchSpawningFunction();\n clone.setFunctionType(getFunctionType());\n clone.setFunctionName(getFunctionName());\n clone.setDescription(getDescription());\n clone.setFullDescription(getFullDescription());\n for (String key: getParameterNames()) {\n IBMParameter op = getParameter(key);\n IBMParameter np = clone.getParameter(key);\n np.setDescription(op.getDescription());\n np.setValue(op.getValue());\n }\n// for (String key: getSubfunctionNames()) clone.setSubfunction(key,(IBMFunctionInterface)getSubfunction(key).clone());\n return clone;\n }\n \n /**\n * Sets the parameter value corresponding to the key associated with param.\n * \n * @param param - the parameter key (name)\n * @param value - its value\n * @return \n */\n @Override\n public boolean setParameterValue(String param,Object value){\n if (super.setParameterValue(param, value)){\n switch (param) {\n case PARAM_minRecoveryPeriod:\n minRP = ((Double) value);\n break;\n case PARAM_meanRecoveryPeriod:\n meanRP = ((Double) value);\n break;\n case PARAM_randomize:\n randomize = ((Boolean) value);\n break;\n }\n return true;\n }\n return false;\n }\n\n /**\n * Calculates the value of the function, given the current parameters.\n * \n * @param vars - any Object or null\n * @return - Double - time to next spawning event\n */\n @Override\n public Double calculate(Object vars) {\n double res = meanRP;\n if (randomize){\n res = minRP-Math.log(rng.computeUniformVariate(0.0, 1.0))*(meanRP-minRP);\n }\n return res;\n }\n}\n", "meta": {"content_hash": "4d00d82f37cdf42637f7022e825081e9", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 126, "avg_line_length": 40.08, "alnum_prop": 0.6124417831004657, "repo_name": "wStockhausen/DisMELS", "id": "97e537bbb194da928e21b2550d55af66b4d558f1", "size": "6012", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DisMELS_IBMFunctions/src/wts/models/DisMELS/IBMFunctions/Spawning/BatchSpawningFunction.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "3320511"}]}} +{"text": "package com.entity;\n\nimport java.io.Serializable;\nimport java.util.Set;\n\npublic class Hall implements Serializable{\n/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = -2972907068930528292L;\nprivate int hall_id;\nprivate String roomname;\nprivate String version;//\u653e\u6620\u7684\u7248\u672c \n//\u4e00\u4e2a\u64ad\u653e\u5385\u64ad\u653e\u591a\u4e2a\u573a\u6b21\u7684\u7535\u5f71\nprivate Set<Play> play;\nprivate int seat;//\u4e00\u4e2a\u653e\u6620\u5385\u7684\u5ea7\u4f4d\u6570\n\n\npublic int getSeat() {\n\treturn seat;\n}\npublic void setSeat(int seat) {\n\tthis.seat = seat;\n}\npublic String getVersion() {\n\treturn version;\n}\npublic void setVersion(String version) {\n\tthis.version = version;\n}\npublic Set<Play> getPlay() {\n\treturn play;\n}\npublic void setPlay(Set<Play> play) {\n\tthis.play = play;\n}\npublic String getRoomname() {\n\treturn roomname;\n}\npublic int getHall_id() {\n\treturn hall_id;\n}\npublic void setHall_id(int hall_id) {\n\tthis.hall_id = hall_id;\n}\npublic void setRoomname(String roomname) {\n\tthis.roomname = roomname;\n}\npublic Hall() {\n\tsuper();\n}\n\n\t\n}\n", "meta": {"content_hash": "ff4e155f31edb907f21c66883f056b9d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 68, "avg_line_length": 17.14814814814815, "alnum_prop": 0.7213822894168467, "repo_name": "blueiou/mymovie", "id": "a98ec59f3cb723249116381b58403b33afd5254d", "size": "982", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/entity/Hall.java", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "24139"}, {"name": "CSS", "bytes": "101766"}, {"name": "HTML", "bytes": "74262"}, {"name": "Java", "bytes": "193574"}, {"name": "JavaScript", "bytes": "441586"}]}} +{"text": "\n\npackage com.hazelcast.transaction;\n\nimport com.hazelcast.core.DistributedObject;\n\nimport javax.transaction.xa.XAResource;\n\n/**\n * Interface for providing Hazelcast as an XAResource\n */\npublic interface HazelcastXAResource extends XAResource, DistributedObject {\n\n /**\n * Returns the TransactionContext associated with the current thread.\n *\n * @return TransactionContext associated with the current thread\n * @throws IllegalStateException if no context found\n */\n TransactionContext getTransactionContext();\n\n\n}\n", "meta": {"content_hash": "c0d1c1b2fa7ae7b0a044584208bb3b0f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 76, "avg_line_length": 23.47826086956522, "alnum_prop": 0.7574074074074074, "repo_name": "lmjacksoniii/hazelcast", "id": "df14336954e7d4ddba7db64cc133846a0faa4dd8", "size": "1165", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hazelcast/src/main/java/com/hazelcast/transaction/HazelcastXAResource.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "948"}, {"name": "Java", "bytes": "28952463"}, {"name": "Shell", "bytes": "13259"}]}} +{"text": "\ufeffusing System;\n\nnamespace Orleans.Runtime\n{\n [Serializable]\n public struct MembershipVersion : IComparable<MembershipVersion>, IEquatable<MembershipVersion>\n {\n private readonly long version;\n\n public MembershipVersion(long version)\n {\n this.version = version;\n }\n\n public static MembershipVersion MinValue => new MembershipVersion(long.MinValue);\n\n public int CompareTo(MembershipVersion other) => this.version.CompareTo(other.version);\n\n public bool Equals(MembershipVersion other) => this.version == other.version;\n\n public override bool Equals(object obj) => obj is MembershipVersion other && this.Equals(other);\n\n public override int GetHashCode() => this.version.GetHashCode();\n\n public override string ToString() => this.version.ToString();\n\n public static bool operator ==(MembershipVersion left, MembershipVersion right) => left.version == right.version;\n public static bool operator !=(MembershipVersion left, MembershipVersion right) => left.version != right.version;\n public static bool operator >=(MembershipVersion left, MembershipVersion right) => left.version >= right.version;\n public static bool operator <=(MembershipVersion left, MembershipVersion right) => left.version <= right.version;\n public static bool operator >(MembershipVersion left, MembershipVersion right) => left.version > right.version;\n public static bool operator <(MembershipVersion left, MembershipVersion right) => left.version < right.version;\n }\n}\n", "meta": {"content_hash": "a36ddfd0fb6a0a7997dba91fc19af85d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 121, "avg_line_length": 46.3235294117647, "alnum_prop": 0.7123809523809523, "repo_name": "sergeybykov/orleans", "id": "9adc17ab78c005aff1760ce3a241197063c2a2a6", "size": "1577", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Orleans.Core/Runtime/MembershipVersion.cs", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "8670"}, {"name": "C#", "bytes": "9688518"}, {"name": "F#", "bytes": "2313"}, {"name": "PLSQL", "bytes": "23892"}, {"name": "PLpgSQL", "bytes": "53037"}, {"name": "PowerShell", "bytes": "1743"}, {"name": "Shell", "bytes": "3725"}, {"name": "Smalltalk", "bytes": "1436"}, {"name": "TSQL", "bytes": "22730"}]}} +{"text": "\n\n\n#include <pebble.h>\n#include \"sliding-text-layer.h\"\n\n\n#define ANIMATION_DIRECTION_UP 0\n#define ANIMATION_DIRECTION_DOWN 1\n\n\ntypedef struct SlidingTextLayerData {\n char* text_next;\n char* text_current;\n GColor color_text;\n GFont font;\n bool is_animating;\n GTextOverflowMode overflow;\n GTextAlignment align;\n Animation* animation;\n AnimationImplementation implementation;\n AnimationImplementation implementation_bounce;\n uint16_t offset;\n uint8_t direction;\n AnimationCurve curve;\n int8_t adjustment;\n uint16_t duration;\n} SlidingTextLayerData;\n\n\nstatic void animate(SlidingTextLayer* layer, uint8_t direction);\nstatic void animate_bounce(SlidingTextLayer* layer, uint8_t direction);\nstatic void render(Layer* layer, GContext* ctx);\nstatic void animation_started(Animation *anim, void *context);\nstatic void animation_stopped(Animation *anim, bool stopped, void *context);\nstatic void animation_stopped_bounce(Animation *anim, bool stopped, void *context);\nstatic void update(Animation* anim, AnimationProgress dist_normalized);\nstatic void update_bounce(Animation* anim, AnimationProgress dist_normalized);\n#define get_layer(layer) (Layer*)layer\n#define get_data(layer) (SlidingTextLayerData*) layer_get_data(get_layer(layer))\n#define layer_get_height(layer) layer_get_bounds(layer).size.h\n#define layer_get_width(layer) layer_get_bounds(layer).size.w\n\nstatic int getDuration(){\n int multiplierNumber = ((rand() % 6) + 1) * 100;\n return multiplierNumber;\n}\n\nSlidingTextLayer* sliding_text_layer_create(GRect rect) {\n SlidingTextLayer* layer = (SlidingTextLayer*)layer_create_with_data(rect, sizeof(SlidingTextLayerData));\n SlidingTextLayerData* data = get_data(layer);\n data->color_text = GColorBlack;\n data->align = GTextAlignmentCenter;\n data->overflow = GTextOverflowModeFill;\n data->offset = 0;\n data->is_animating = false;\n data->implementation.update = update;\n data->implementation_bounce.update = update_bounce;\n data->curve = AnimationCurveEaseInOut;\n data->duration = getDuration();\n layer_set_update_proc(get_layer(layer), render);\n return layer;\n}\n\nvoid sliding_text_layer_destroy(SlidingTextLayer* layer) {\n SlidingTextLayerData* data = get_data(layer);\n if (data->is_animating) {\n\n }\n layer_destroy(get_layer(layer));\n}\n\nvoid sliding_text_layer_animate_up(SlidingTextLayer* layer) {\n animate(layer, ANIMATION_DIRECTION_UP);\n}\n\nvoid sliding_text_layer_animate_down(SlidingTextLayer* layer) {\n animate(layer, ANIMATION_DIRECTION_DOWN);\n}\n\nvoid sliding_text_layer_animate_bounce_up(SlidingTextLayer* layer) {\n animate_bounce(layer, ANIMATION_DIRECTION_UP);\n}\n\nvoid sliding_text_layer_animate_bounce_down(SlidingTextLayer* layer) {\n animate_bounce(layer, ANIMATION_DIRECTION_DOWN);\n}\n\nvoid sliding_text_layer_set_text(SlidingTextLayer* layer, char* text) {\n if (! layer) {\n return;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return;\n }\n free(data->text_current);\n data->text_current = text;\n layer_mark_dirty(get_layer(layer));\n}\n\nvoid sliding_text_layer_set_next_text(SlidingTextLayer* layer, char* text) {\n if (! layer) {\n return;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return;\n }\n data->text_next = text;\n}\n\nvoid sliding_text_layer_set_duration(SlidingTextLayer* layer, uint16_t duration) {\n if (! layer) {\n return;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return;\n }\n data->duration = duration;\n}\n\nvoid sliding_text_layer_set_animation_curve(SlidingTextLayer* layer, AnimationCurve curve) {\n if (! layer) {\n return;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return;\n }\n data->curve = curve;\n}\n\nvoid sliding_text_layer_set_font(SlidingTextLayer* layer, GFont font) {\n if (! layer) {\n return;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return;\n }\n data->font = font;\n layer_mark_dirty(get_layer(layer));\n}\n\nvoid sliding_text_layer_set_text_color(SlidingTextLayer* layer, GColor color) {\n if (! layer) {\n return;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return;\n }\n data->color_text = color;\n layer_mark_dirty(get_layer(layer));\n}\n\nvoid sliding_text_layer_set_text_alignment(SlidingTextLayer* layer, GTextAlignment alignment) {\n if (! layer) {\n return;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return;\n }\n data->align = alignment;\n}\n\nvoid sliding_text_layer_set_vertical_adjustment(SlidingTextLayer* layer, int8_t adjustment) {\n if (! layer) {\n return;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return;\n }\n data->adjustment = adjustment;\n}\n\nbool sliding_text_layer_is_animating(SlidingTextLayer* layer) {\n if (! layer) {\n return false;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return false;\n }\n return data->is_animating;\n}\n\n\nstatic void animate(SlidingTextLayer* layer, uint8_t direction) {\n if (! layer) {\n return;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return;\n }\n if (data->is_animating) {\n return;\n }\n\n data->direction = direction;\n data->offset = 0;\n data->animation = animation_create();\n animation_set_duration(data->animation, data->duration);\n animation_set_curve(data->animation, data->curve);\n animation_set_implementation(data->animation, &data->implementation);\n animation_set_handlers(data->animation, (AnimationHandlers) {\n .started = animation_started,\n .stopped = animation_stopped\n }, (void*)layer);\n animation_schedule(data->animation);\n}\n\nstatic void animate_bounce(SlidingTextLayer* layer, uint8_t direction) {\n if (! layer) {\n return;\n }\n SlidingTextLayerData* data = get_data(layer);\n if (! data) {\n return;\n }\n if (data->is_animating) {\n return;\n }\n\n data->direction = direction;\n data->offset = 0;\n data->animation = animation_create();\n animation_set_duration(data->animation, data->duration / 2);\n animation_set_curve(data->animation, data->curve);\n animation_set_implementation(data->animation, &data->implementation_bounce);\n animation_set_handlers(data->animation, (AnimationHandlers) {\n .started = animation_started,\n .stopped = animation_stopped_bounce\n }, (void*)layer);\n animation_schedule(data->animation);\n}\n\nstatic void render(Layer* layer, GContext* ctx) {\n SlidingTextLayerData* data = get_data(layer);\n graphics_context_set_text_color(ctx, data->color_text);\n\n#if STL_DEBUG\n graphics_context_set_fill_color(ctx, GColorBlack);\n graphics_fill_rect(ctx, layer_get_bounds(layer), 0, GCornerNone);\n#endif\n\n if (data->is_animating) {\n graphics_draw_text(ctx,\n data->direction == ANIMATION_DIRECTION_UP ? data->text_next : data->text_current,\n data->font,\n GRect(0, data->adjustment - data->offset, layer_get_width(layer), layer_get_height(layer)),\n data->overflow,\n data->align,\n NULL);\n graphics_draw_text(ctx,\n data->direction == ANIMATION_DIRECTION_UP ? data->text_current : data->text_next,\n data->font,\n GRect(0, layer_get_height(layer) + data->adjustment - data->offset, layer_get_width(layer), layer_get_height(layer)),\n data->overflow,\n data->align,\n NULL);\n }\n else {\n graphics_draw_text(ctx,\n data->text_current,\n data->font,\n GRect(0, data->adjustment, layer_get_width(layer), layer_get_height(layer)),\n data->overflow,\n data->align,\n NULL);\n }\n}\n\nstatic void animation_started(Animation *anim, void *context) {\n#if STL_DEBUG\n APP_LOG(APP_LOG_LEVEL_DEBUG, \"%d\", heap_bytes_free());\n#endif\n SlidingTextLayerData* data = get_data((SlidingTextLayer*)context);\n data->is_animating = true;\n}\n\nstatic void animation_stopped(Animation *anim, bool stopped, void *context) {\n SlidingTextLayerData* data = get_data((SlidingTextLayer*)context);\n data->is_animating = false;\n data->text_current = data->text_next;\n data->text_next = false;\n#ifdef PBL_SDK_2\n animation_destroy(anim);\n#endif\n}\n\nstatic void animation_stopped_bounce(Animation *anim, bool stopped, void *context) {\n SlidingTextLayerData* data = get_data((SlidingTextLayer*)context);\n data->is_animating = false;\n}\n\nstatic void update(Animation* anim, AnimationProgress dist_normalized) {\n SlidingTextLayer* layer = (SlidingTextLayer*)animation_get_context(anim);\n SlidingTextLayerData* data = get_data(layer);\n\n uint16_t percent = (100 * dist_normalized) / (ANIMATION_NORMALIZED_MAX);\n if (data->direction == ANIMATION_DIRECTION_UP) {\n data->offset = layer_get_height(layer) - ((uint16_t)(layer_get_height(layer) * percent) / 100);\n }\n else {\n data->offset = (uint16_t)((layer_get_height(layer) * percent) / 100);\n }\n layer_mark_dirty(get_layer(layer));\n}\n\nstatic void update_bounce(Animation* anim, AnimationProgress dist_normalized) {\n SlidingTextLayer* layer = (SlidingTextLayer*)animation_get_context(anim);\n SlidingTextLayerData* data = get_data(layer);\n\n uint16_t max_height = (layer_get_height(layer) * 100) / 3;\n\n uint16_t percent = (dist_normalized * 100) / ANIMATION_NORMALIZED_MAX;\n if (data->direction == ANIMATION_DIRECTION_UP) {\n data->offset = (layer_get_height(layer) - (uint16_t)(max_height * percent) / 10000);\n }\n else {\n data->offset = (uint16_t)((max_height * percent) / 10000);\n }\n layer_mark_dirty(get_layer(layer));\n}\n", "meta": {"content_hash": "d95942fadeb3525b3e99348bfdd4757b", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 123, "avg_line_length": 28.35757575757576, "alnum_prop": 0.6994015815345159, "repo_name": "chrisschlitt/Pebble_MLB", "id": "d3cefa38ee9497bf94941320675a4c0cb3ec1a26", "size": "10538", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/sliding-text-layer.c", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "57862"}, {"name": "JavaScript", "bytes": "15057"}, {"name": "Python", "bytes": "1136"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace OakIdeas.Schema.Core.CreativeWorks\n{\n public class ItemListElement\n {\n public string Value { get; set; }\n public string Order { get; set; }\n }\n}\n", "meta": {"content_hash": "34e6bcb3c61905271db69b3ecf73a655", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 44, "avg_line_length": 20.46153846153846, "alnum_prop": 0.6842105263157895, "repo_name": "oakcool/OakIdeas.Schema", "id": "d54987f615832be193ae406beee917da8d8a2342", "size": "268", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "OakIdeas.Schema.Core/CreativeWorks/ItemListElement.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "184653"}]}} +{"text": "SYNONYM\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "76ed169cedffe0ece8a30b3ff94e43ee", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "d785f2806c0140eba2364cfb298587c9616ed2c6", "size": "183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Liliales/Liliaceae/Gagea/Gagea pauciflora/ Syn. Lloydia szechenyiana/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\n\npackage com.themodernway.server.core.security;\n\nimport java.io.IOException;\nimport java.util.List;\n\nimport com.themodernway.server.core.AbstractCoreLoggingBase;\nimport com.themodernway.server.core.ICoreCommon;\nimport com.themodernway.server.core.logging.IHasLogging;\nimport com.themodernway.server.core.logging.LoggingOps;\n\npublic class DefaultAuthorizationProvider extends AbstractCoreLoggingBase implements IAuthorizationProvider, ICoreCommon, IHasLogging\n{\n public DefaultAuthorizationProvider()\n {\n if (logger().isInfoEnabled())\n {\n logger().info(LoggingOps.THE_MODERN_WAY_MARKER, \"DefaultAuthorizationProvider()\");\n }\n }\n\n @Override\n public IAuthorizationResult isAuthorized(final Object target, List<String> roles)\n {\n if (null == target)\n {\n if (logger().isErrorEnabled())\n {\n logger().error(LoggingOps.THE_MODERN_WAY_MARKER, \"error null target\");\n }\n return new AuthorizationResult(false, E_RUNTIMEERROR, \"error null target\");\n }\n if (null == roles)\n {\n if (logger().isErrorEnabled())\n {\n logger().error(LoggingOps.THE_MODERN_WAY_MARKER, \"error null roles\");\n }\n return new AuthorizationResult(false, E_RUNTIMEERROR, \"error null roles\");\n }\n roles = toUnique(roles);\n\n if (roles.isEmpty())\n {\n if (logger().isErrorEnabled())\n {\n logger().error(LoggingOps.THE_MODERN_WAY_MARKER, \"error empty roles\");\n }\n return new AuthorizationResult(false, E_RUNTIMEERROR, \"error empty roles\");\n }\n if (target instanceof IAuthorizedObject)\n {\n if (logger().isDebugEnabled())\n {\n logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, \"dispatch authorization roles \" + toPrintableString(roles));\n }\n final IAuthorizationResult result = ((IAuthorizedObject) target).isAuthorized(roles);\n\n if (null != result)\n {\n if (logger().isDebugEnabled())\n {\n logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, \"dispatch to authorization result \" + result.toString());\n }\n return result;\n }\n if (logger().isErrorEnabled())\n {\n logger().error(LoggingOps.THE_MODERN_WAY_MARKER, \"error null authorization result\");\n }\n return new AuthorizationResult(false, E_RUNTIMEERROR, \"error null authorization result\");\n }\n final Authorized authorized = target.getClass().getAnnotation(Authorized.class);\n\n if (null == authorized)\n {\n if (logger().isDebugEnabled())\n {\n logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, \"pass no authorizations present\");\n }\n return new AuthorizationResult(true, I_WASVALIDATED, \"pass no authorizations present\");\n }\n List<String> list = toUnique(authorized.not());\n\n if (false == list.isEmpty())\n {\n for (final String type : list)\n {\n if (roles.contains(type))\n {\n if (logger().isDebugEnabled())\n {\n logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, \"fail not role \" + type + \" in roles \" + toPrintableString(roles));\n }\n return new AuthorizationResult(false, E_EXCLUDEDROLE, \"fail not role \" + type);\n }\n }\n }\n long look = 0;\n\n list = toUnique(authorized.all());\n\n if (false == list.isEmpty())\n {\n for (final String type : list)\n {\n if (false == roles.contains(type))\n {\n if (logger().isDebugEnabled())\n {\n logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, \"fail and role \" + type + \" in roles \" + toPrintableString(roles));\n }\n return new AuthorizationResult(false, E_NOTVALIDROLE, \"fail and role \" + type);\n }\n }\n look++;\n }\n list = toUnique(authorized.any());\n\n if (false == list.isEmpty())\n {\n for (final String type : list)\n {\n if (roles.contains(type))\n {\n if (logger().isDebugEnabled())\n {\n logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, \"pass any role \" + type + \" in roles \" + toPrintableString(roles));\n }\n return new AuthorizationResult(true, I_WASVALIDATED, \"pass any role \" + type);\n }\n }\n if (logger().isDebugEnabled())\n {\n logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, \"fail any \" + toPrintableString(list) + \" in roles \" + toPrintableString(roles));\n }\n return new AuthorizationResult(false, E_NOTVALIDROLE, \"fail any role\");\n }\n if (look < 1)\n {\n list = toUnique(authorized.value());\n\n if (false == list.isEmpty())\n {\n for (final String type : list)\n {\n if (false == roles.contains(type))\n {\n if (logger().isDebugEnabled())\n {\n logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, \"fail value role \" + type + \" in roles \" + toPrintableString(roles));\n }\n return new AuthorizationResult(false, E_NOTVALIDROLE, \"fail value role \" + type);\n }\n }\n }\n }\n if (logger().isDebugEnabled())\n {\n logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, \"pass no authorizations matched in roles \" + toPrintableString(roles));\n }\n return new AuthorizationResult(true, I_WASVALIDATED, \"pass no authorizations matched\");\n }\n\n @Override\n public void close() throws IOException\n {\n if (logger().isInfoEnabled())\n {\n logger().info(LoggingOps.THE_MODERN_WAY_MARKER, \"DefaultAuthorizationProvider().close()\");\n }\n }\n}\n", "meta": {"content_hash": "02eff669fe596dfb657b72e2f02eacab", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 146, "avg_line_length": 36.770114942528735, "alnum_prop": 0.5236011253516724, "repo_name": "themodernway/themodernway-server-core", "id": "b543982865557fafc9b0c7763ddf61c4e7cd09ad", "size": "7022", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/groovy/com/themodernway/server/core/security/DefaultAuthorizationProvider.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Groovy", "bytes": "132081"}, {"name": "Java", "bytes": "761126"}, {"name": "JavaScript", "bytes": "187"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>founify: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.6.1 / founify - 8.10.0</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n founify\n <small>\n 8.10.0\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-04-26 16:21:57 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-04-26 16:21:57 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-num base Num library distributed with the OCaml compiler\nbase-threads base\nbase-unix base\ncamlp5 7.14 Preprocessor-pretty-printer of OCaml\nconf-findutils 1 Virtual package relying on findutils\nconf-perl 2 Virtual package relying on perl\ncoq 8.6.1 Formal proof management system\nnum 0 The Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.05.0 The OCaml compiler (virtual package)\nocaml-base-compiler 4.05.0 Official 4.05.0 release\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.3 A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/founify"\nlicense: "Unknown"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/FOUnify"]\ndepends: [\n "camlp5"\n "ocaml"\n "coq" {>= "8.10" & < "8.11~"}\n]\ntags: [\n "keyword: First-order Unification"\n "keyword: Robinson"\n "category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms"\n "category: Miscellaneous/Extracted Programs/Type checking unification and normalization"\n]\nauthors: [\n "Jocelyne Rouyer"\n]\nbug-reports: "https://github.com/coq-contribs/founify/issues"\ndev-repo: "git+https://github.com/coq-contribs/founify.git"\nsynopsis: "Correctness and extraction of the unification algorithm"\ndescription: """\nA notion of terms based on symbols without fixed arities is defined\nand an extended unification problem is proved solvable on these terms.\nAn algorithm, close from Robinson algorithm, can be extracted from the\nproof."""\nflags: light-uninstall\nurl {\n src: "https://github.com/coq-contribs/founify/archive/v8.10.0.tar.gz"\n checksum: "md5=2f68b8dc8c863e75077d1667a36cf10f"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-founify.8.10.0 coq.8.6.1</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.6.1).\nThe following dependencies couldn't be met:\n - coq-founify -> coq >= 8.10\nYour request can't be satisfied:\n - No available version of coq satisfies the constraints\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-founify.8.10.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "37e8885d5d42534bdbcae4a57fa8a332", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 159, "avg_line_length": 40.94886363636363, "alnum_prop": 0.5534896628278063, "repo_name": "coq-bench/coq-bench.github.io", "id": "70b78f7588db0c24354178252cf62d75e1aa0265", "size": "7232", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.6.1/founify/8.10.0.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "\n\npackage com.vmware.vim25;\n\n/**\n* @author Steve Jin (http://www.doublecloud.org)\n* @version 5.1\n*/\n\n@SuppressWarnings(\"all\")\npublic class VspanPortgroupPromiscChangeFault extends DvsFault {\n public String portgroupName;\n\n public String getPortgroupName() {\n return this.portgroupName;\n }\n\n public void setPortgroupName(String portgroupName) {\n this.portgroupName=portgroupName;\n }\n}", "meta": {"content_hash": "81f1c8fac893060265bb88e1b652204c", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 64, "avg_line_length": 18.761904761904763, "alnum_prop": 0.7436548223350253, "repo_name": "xebialabs/vijava", "id": "cd0e2477baaac7cc6b732ec4c4b1743717a76d24", "size": "2034", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/vmware/vim25/VspanPortgroupPromiscChangeFault.java", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Groovy", "bytes": "377"}, {"name": "Java", "bytes": "7842140"}]}} +{"text": "layout: post\npublished: true\ntitle: \"It might not get weirder than this\"\nlink: https://sites.google.com/site/sophieinnorthkorea/\npermalink: /2013/02/it-might-not-get-weirder-than-this/\n---\n\nFascinating account by Eric Schmidt's daughter Sophie about their trip to North Korea.\n\n> Top Level Take-aways:\n>\n> 1. Go to North Korea if you can. It is very, very strange.\n> 2. If it is January, disregard the above. It is very, very cold.\n> 3. Nothing I'd read or heard beforehand really prepared me for what we saw.\n", "meta": {"content_hash": "0a43c10c31d1bff63f9b91d5b655d492", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 86, "avg_line_length": 36.42857142857143, "alnum_prop": 0.7470588235294118, "repo_name": "alexbilbie/alexbilbie.github.com", "id": "845e5208c4bcdb05e221f4452e45385c24fe1f39", "size": "514", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2013-02-10-it-might-not-get-weirder-than-this.md", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "250805"}, {"name": "HTML", "bytes": "42201"}]}} +{"text": "\n\npackage net.firejack.platform.web.security.action;\n\nimport net.firejack.platform.api.registry.domain.Action;\nimport net.firejack.platform.core.model.registry.HTTPMethod;\n\npublic enum StandardAction {\n\n READ, READ_ALL, CREATE, UPDATE, DELETE, ADVANCED_SEARCH;\n\n public static StandardAction detectStandardAction(Action action) {\n return isReadAction(action) ? READ : isReadAllAction(action) ? READ_ALL :\n isCreateAction(action) ? CREATE : isUpdateAction(action) ? UPDATE :\n isDeleteAction(action) ? DELETE : isAdvancedSearchAction(action) ? ADVANCED_SEARCH : null;\n }\n\n public static boolean isReadAction(Action action) {\n return HTTPMethod.GET.equals(action.getMethod()) &&\n action.getName().equalsIgnoreCase(ActionDetectorFactory.READ_ACTION);\n }\n\n public static boolean isCreateAction(Action action) {\n return HTTPMethod.POST.equals(action.getMethod()) &&\n action.getName().equalsIgnoreCase(ActionDetectorFactory.CREATE_ACTION);\n }\n\n public static boolean isUpdateAction(Action action) {\n return HTTPMethod.PUT.equals(action.getMethod()) &&\n action.getName().equalsIgnoreCase(ActionDetectorFactory.UPDATE_ACTION);\n }\n\n public static boolean isDeleteAction(Action action) {\n return HTTPMethod.DELETE.equals(action.getMethod()) &&\n action.getName().equalsIgnoreCase(ActionDetectorFactory.DELETE_ACTION);\n }\n\n public static boolean isReadAllAction(Action action) {\n return HTTPMethod.GET.equals(action.getMethod()) &&\n action.getName().equalsIgnoreCase(ActionDetectorFactory.READ_ALL_ACTION);\n }\n\n public static boolean isAdvancedSearchAction(Action action) {\n return action.getName().equalsIgnoreCase(ActionDetectorFactory.ADVANCED_SEARCH_ACTION);\n }\n\n}", "meta": {"content_hash": "6535fd23b4485e1a90a32cc3a2df8367", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 114, "avg_line_length": 39.61702127659574, "alnum_prop": 0.7056928034371643, "repo_name": "firejack-open/Firejack-Platform", "id": "62e3725bb24d868722ca944899a32be7fed6ec33", "size": "2669", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "integration/src/main/java/net/firejack/platform/web/security/action/StandardAction.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ActionScript", "bytes": "4068"}, {"name": "CSS", "bytes": "5861839"}, {"name": "Java", "bytes": "8816378"}, {"name": "JavaScript", "bytes": "37310201"}, {"name": "Python", "bytes": "7764"}, {"name": "Ruby", "bytes": "11804"}, {"name": "Shell", "bytes": "38753"}]}} +{"text": "using System.Collections.Generic;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace Z.Collections.Test\n{\n [TestClass]\n public class System_Collections_Generic_IDictionary_TKey_TValue_ContainsAllKey\n {\n [TestMethod]\n public void ContainsAllKey()\n {\n // Type\n var @this = new Dictionary<string, string> {{\"Fizz\", \"Buzz\"}, {\"Fizz2\", \"Buzz2\"}};\n\n // Exemples\n bool value1 = @this.ContainsAllKey(\"Fizz\", \"Fizz2\"); // return true;\n bool value2 = @this.ContainsAllKey(\"Fizz\", \"Fizz3\"); // return false;\n\n // Unit Test\n Assert.IsTrue(value1);\n Assert.IsFalse(value2);\n }\n }\n}", "meta": {"content_hash": "e916fc765b3b65ba55f2862e5ff51e4c", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 94, "avg_line_length": 29.5, "alnum_prop": 0.5861581920903954, "repo_name": "zzzprojects/Z.ExtensionMethods", "id": "e982aba02782c2a6ac82d6bd1d7ff7c275490348", "size": "1133", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/Z.Collections.Test/System.Collections.Generic.IDictionary[TKey,TValue]/IDictionary[TKey,TValue].ContainsAllKey.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "2614731"}, {"name": "Visual Basic", "bytes": "1411898"}]}} +{"text": "\n\n// Calculates and returns the force components needed to achieve the\n// given velocity. <params> is a dictionary containing the rider and\n// environmental parameters all in metric units. 'velocity' is in km/h.\nfunction CalculateForces(velocity, params) {\n // calculate Fgravity\n var Fgravity = 9.8067 *\n (params.rp_wr + params.rp_wb) *\n Math.sin(Math.atan(params.ep_g / 100.0));\n\n // calculate Frolling\n var Frolling = 9.8067 *\n (params.rp_wr + params.rp_wb) *\n Math.cos(Math.atan(params.ep_g / 100.0)) *\n (params.ep_crr);\n\n // calculate Fdrag\n var Fdrag = 0.5 *\n (params.rp_a) *\n (params.rp_cd) *\n (params.ep_rho) *\n (velocity * 1000.0 / 3600.0) *\n (velocity * 1000.0 / 3600.0);\n\n // cons up and return the force components\n var ret = { };\n ret.Fgravity = Fgravity;\n ret.Frolling = Frolling;\n ret.Fdrag = Fdrag;\n return ret;\n}\n\n// Calculates and returns the power needed to achieve the given\n// velocity. <params> is a dictionary containing the rider and\n// environmenetal parameters all in metric units. 'velocity'\n// is in km/h. Returns power in watts.\nfunction CalculatePower(velocity, params) {\n // calculate the forces on the rider.\n var forces = CalculateForces(velocity, params);\n var totalforce = forces.Fgravity + forces.Frolling + forces.Fdrag;\n\n // calculate necessary wheelpower\n var wheelpower = totalforce * (velocity * 1000.0 / 3600.0);\n\n // calculate necessary legpower\n var legpower = wheelpower / (1.0 - (params.rp_dtl/100.0));\n\n return legpower;\n}\n\n// Calculates the velocity obtained from a given power. <params> is a\n// dictionary containing the rider and model parameters, all in\n// metric units.\n//\n// Runs a simple midpoint search, using CalculatePower().\n//\n// Returns velocity, in km/h.\nexport function CalculateVelocity(power, params) {\n // How close to get before finishing.\n var epsilon = 0.000001;\n\n // Set some reasonable upper / lower starting points.\n var lowervel = -1000.0;\n var uppervel = 1000.0;\n var midvel = 0.0;\n\n var midpow = CalculatePower(midvel, params);\n\n // Iterate until completion.\n var itcount = 0;\n do {\n if (Math.abs(midpow - power) < epsilon)\n break;\n\n if (midpow > power)\n uppervel = midvel;\n else\n lowervel = midvel;\n\n midvel = (uppervel + lowervel) / 2.0;\n midpow = CalculatePower(midvel, params);\n } while (itcount++ < 100);\n\n return midvel;\n}\n", "meta": {"content_hash": "540f5fc9838ca6b1c4e2dc4ba93bb685", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 72, "avg_line_length": 29.569767441860463, "alnum_prop": 0.6354699174203696, "repo_name": "chadj/gpedal", "id": "2ac95b635b27f49c241e9cbd32abda6e1ded8f3e", "size": "2704", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/lib/power_v_speed.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "96082"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> \r\n<module version=\"0.1\"> \r\n <name lang=\"en\">Course Properties</name> \r\n <description lang=\"en\">Allows instructors and administrators to delete a course, or manage its various properties such as title, description, access level, course icon and more. </description> \r\n <maintainers>\r\n <maintainer> \r\n <name>ATutor Team</name> \r\n <email>info@atutor.ca</email> \r\n </maintainer>\r\n </maintainers> \r\n <url>http://atutor.ca</url> \r\n <license>GPL</license> \r\n\t<release> \r\n <version>0.1</version> \r\n\t\t<privileges>\r\n\t\t\t<instructor_privilege>existing</instructor_privilege>\r\n\t\t\t<admin_privilege></admin_privilege> \r\n\t\t</privileges>\r\n <date>2005-08-22</date> \r\n <state>stable</state> \r\n <notes>This is a core module.</notes> \r\n </release> \r\n</module>", "meta": {"content_hash": "0d62030ad92b3dd03847e022de9df918", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 197, "avg_line_length": 37.69565217391305, "alnum_prop": 0.615916955017301, "repo_name": "CaviereFabien/Test", "id": "21f8865d4ab8e4228d0a224ef046863b3e5fe515", "size": "867", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ATutor/mods/_core/properties/module.xml", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "<!DOCTYPE html>\n<html>\n\t<head>\n\t\t<title>Pseudo Blog</title>\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheets/analysis_blog.css\">\n\t\t<meta charset=\"utf-8\">\n\t</head>\n\t<body>\n\t\t<div id=\"wrapper\">\n\t\t\t<header>\n\t\t\t\t<h1>Keyboard Thoughts</h1>\n\t\t\t\t<ul id=\"menu\">\n\t\t\t\t\t<a href=\"week1_technical_blog.html\"><li>Blog</li></a>\n\t\t\t\t\t<a href=\"\"><li>About Me</li></a>\n\t\t\t\t\t<a href=\"\"><li>Contact</li></a>\n\t\t\t\t</ul>\n\t\t\t</header>\n\t\t\t<div id=\"main\">\n\t\t\t\t<div id=\"primary\">\n\t\t\t\t\t<div class=\"post\">\n\t\t\t\t\t\t<a href=\"http://www.codecademy.com/\" target=\"_blank\"><img src=\"images/codecademy.png\" alt=\"codecademy\" class=\"logo\"></a>\n\t\t\t\t\t\t<p class=\"website_name\">Codecademy</p>\n\t\t\t\t\t\t<p class=\"question\">Why is this one of your favorite sites?</p>\n\t\t\t\t\t\t<p class=\"answer\">This is one of the places that I realized that I loved to code!</p>\n\t\t\t\t\t\t<p class=\"question\">What area of the site is your eye drawn to when looking at the homepage? Stand back further, what area is your eye drawn to now? Is that area the most important area of the site?</p>\n\t\t\t\t\t\t<p class=\"answer\">The two areas that my eyes are drawn to are the text-line interface and the \"sign-up\" button.</p>\n\t\t\t\t\t\t<p class=\"question\">How would you describe the website visually? List 5 adjectives. (i.e. \"pretty\", \"elegant\", \"simple\", \"dark\", \"cluttered\", \"basic\" etc)</p>\n\t\t\t\t\t\t<p class=\"answer\">simple, minimalistic, sleek, dull, subdued</p>\n\t\t\t\t\t\t<p class=\"question\">What problem does this website solve? What content does it have?</p>\n\t\t\t\t\t\t<p class=\"answer\">This website gives people the opportunity to learn how to code. It gives simple information on what the purpose of the website is and provides a clear call to action.</p>\n\t\t\t\t\t\t<p class=\"question\">What 5 adjectives would you use to describe the content, focus, and purpose of the site? (i.e. \"practical\", \"fun\", \"whimsical\", \"silly\", \"serious\" etc) How does that compare to the adjectives you used to describe the site visually?</p>\n\t\t\t\t\t\t<p class=\"answer\">\"simple, clear, unambiguous, instructional, and concise\" -- These adjectives match the visual adjectives quite closely.</p>\n\t\t\t\t\t\t<p class=\"question\">How easy is it to find what you are looking for from the homepage? How about from another page?</p>\n\t\t\t\t\t\t<p class=\"answer\">It is very easy; everything has been laid out quite simply in plain view.</p>\n\t\t\t\t\t\t<p class=\"question\">How easy is it to browse through all the content of the site?</p>\n\t\t\t\t\t\t<p class=\"answer\">It is easy to browse through the content.</p>\n\t\t\t\t\t\t<p class=\"question\">How do you feel after being on the site for a while? (i.e. \"bored\", \"happy\", \"anxious or hyper\", \"like I wasted a lot of time\" etc)</p>\n\t\t\t\t\t\t<p class=\"answer\">I would be excited to get crackin'!</p>\n\t\t\t\t\t\t<p class=\"question\">Does the site sell anything? If so, have you purchased any of it? Why or why not?</p>\n\t\t\t\t\t\t<p class=\"answer\">The site sells the opportunity to learn, but for FREE! I've taken part in several tracks on Codecademy.</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"post\">\n\t\t\t\t\t\t<a href=\"http://www.apple.com/\" target=\"_blank\"><img src=\"images/apple.jpg\" alt=\"apple\" class=\"logo\"></a>\n\t\t\t\t\t\t<p class=\"website_name\">Apple</p>\n\t\t\t\t\t\t<p class=\"question\">Why is this one of your favorite sites?</p>\n\t\t\t\t\t\t<p class=\"answer\">This is not my favorite website, but it's a website that I admire for it's ability to maintain the attention of its customers.</p>\n\t\t\t\t\t\t<p class=\"question\">What area of the site is your eye drawn to when looking at the homepage? Stand back further, what area is your eye drawn to now? Is that area the most important area of the site?</p>\n\t\t\t\t\t\t<p class=\"answer\">The graphics are what draws my attention, and then the text that overlays the graphics.</p>\n\t\t\t\t\t\t<p class=\"question\">How would you describe the website visually? List 5 adjectives. (i.e. \"pretty\", \"elegant\", \"simple\", \"dark\", \"cluttered\", \"basic\" etc)</p>\n\t\t\t\t\t\t<p class=\"answer\">penetrating, stunning, saturated, colorful, vibrant</p>\n\t\t\t\t\t\t<p class=\"question\">What problem does this website solve? What content does it have?</p>\n\t\t\t\t\t\t<p class=\"answer\">This website promises an experience through its graphics and powerful text. The graphics coupled with the caption allows for multiple, positive interpretations.</p>\n\t\t\t\t\t\t<p class=\"question\">What 5 adjectives would you use to describe the content, focus, and purpose of the site? (i.e. \"practical\", \"fun\", \"whimsical\", \"silly\", \"serious\" etc) How does that compare to the adjectives you used to describe the site visually?</p>\n\t\t\t\t\t\t<p class=\"answer\">\"fun, powerful, smart, clean, and simple\" -- These adjectives are very much in line with the visual description I came up with.</p>\n\t\t\t\t\t\t<p class=\"question\">How easy is it to find what you are looking for from the homepage? How about from another page?</p>\n\t\t\t\t\t\t<p class=\"answer\">The menu bar makes it quite easy to pick out how to navigate through the website.</p>\n\t\t\t\t\t\t<p class=\"question\">How easy is it to browse through all the content of the site?</p>\n\t\t\t\t\t\t<p class=\"answer\">It is easy to browse through the content.</p>\n\t\t\t\t\t\t<p class=\"question\">How do you feel after being on the site for a while? (i.e. \"bored\", \"happy\", \"anxious or hyper\", \"like I wasted a lot of time\" etc)</p>\n\t\t\t\t\t\t<p class=\"answer\">I would be excited to start looking at specs in hopes of buying my next Apple product!</p>\n\t\t\t\t\t\t<p class=\"question\">Does the site sell anything? If so, have you purchased any of it? Why or why not?</p>\n\t\t\t\t\t\t<p class=\"answer\">I've bought my first Mac Air from this website in hopes that it would put me on the right path to becoming a web developer.</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"post\">\n\t\t\t\t\t\t<a href=\"http://mangastream.com/\" target=\"_blank\"><img src=\"images/mangastream.png\" alt=\"mangastream\" class=\"logo\"></a>\n\t\t\t\t\t\t<p class=\"website_name\">Manga Stream</p>\n\t\t\t\t\t\t<p class=\"question\">Why is this one of your favorite sites?</p>\n\t\t\t\t\t\t<p class=\"answer\">I read manga on occasion, and this is my favorite website to go to for scanned translations.</p>\n\t\t\t\t\t\t<p class=\"question\">What area of the site is your eye drawn to when looking at the homepage? Stand back further, what area is your eye drawn to now? Is that area the most important area of the site?</p>\n\t\t\t\t\t\t<p class=\"answer\">What draws my attention is the neatly organized list of chapter posts. Standing further away gives focus to the three graphic panels that display the three latest chapter posts.</p>\n\t\t\t\t\t\t<p class=\"question\">How would you describe the website visually? List 5 adjectives. (i.e. \"pretty\", \"elegant\", \"simple\", \"dark\", \"cluttered\", \"basic\" etc)</p>\n\t\t\t\t\t\t<p class=\"answer\">subdued, comfortable, easy, basic, lists</p>\n\t\t\t\t\t\t<p class=\"question\">What problem does this website solve? What content does it have?</p>\n\t\t\t\t\t\t<p class=\"answer\">This website attempts to solve the conflict between blog posts and chapter posts. I'm not sure if this has been effectively solved.</p>\n\t\t\t\t\t\t<p class=\"question\">What 5 adjectives would you use to describe the content, focus, and purpose of the site? (i.e. \"practical\", \"fun\", \"whimsical\", \"silly\", \"serious\" etc) How does that compare to the adjectives you used to describe the site visually?</p>\n\t\t\t\t\t\t<p class=\"answer\">\"plain, simple, detailed, separated, and compact\"</p>\n\t\t\t\t\t\t<p class=\"question\">How easy is it to find what you are looking for from the homepage? How about from another page?</p>\n\t\t\t\t\t\t<p class=\"answer\">If it's difficult to parse the content at first glance, the menu bar comes in handy.</p>\n\t\t\t\t\t\t<p class=\"question\">How easy is it to browse through all the content of the site?</p>\n\t\t\t\t\t\t<p class=\"answer\">It is easy to browse through the content.</p>\n\t\t\t\t\t\t<p class=\"question\">How do you feel after being on the site for a while? (i.e. \"bored\", \"happy\", \"anxious or hyper\", \"like I wasted a lot of time\" etc)</p>\n\t\t\t\t\t\t<p class=\"answer\">Reading manga usually makes me feel like I've wasted a great deal of time.</p>\n\t\t\t\t\t\t<p class=\"question\">Does the site sell anything? If so, have you purchased any of it? Why or why not?</p>\n\t\t\t\t\t\t<p class=\"answer\">The site doesn't sell anything.</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"secondary\">\n\t\t\t\t\t<p>Useful Links</p>\n\t\t\t\t\t<a href=\"wireframe_sites.html\">Wireframe Post</a>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"clearFix\">.</div>\n\t\t\t</div>\n\t\t\t<footer>\n\t\t\t\tCopyright 2014 - Brian H. Paak\n\t\t\t</footer>\n\t\t</div>\n\t</body>\n</html>", "meta": {"content_hash": "8b2882ccda0cea62709bf8e7d58ce2e2", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 261, "avg_line_length": 84.88775510204081, "alnum_prop": 0.6833754056978002, "repo_name": "bhpaak/bhpaak.github.io", "id": "9a10e0bc007029a281c2241949eb8eadbecd65ae", "size": "8319", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "unit1_projects/analysis_blog.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "5475"}]}} +{"text": "module DeepCover\n class Node::Const < Node\n check_completion\n has_child scope: [Node, nil]\n has_child const_name: Symbol\n end\n\n class Node::Cbase < Node\n end\nend\n", "meta": {"content_hash": "cbd22c85ad356fa0db7b06840b24b50a", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 32, "avg_line_length": 17.5, "alnum_prop": 0.6742857142857143, "repo_name": "deep-cover/deep-cover", "id": "5a6b78b80de6fb471ba9b393b47c6f5249b98b2a", "size": "206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core_gem/lib/deep_cover/node/const.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "47229"}, {"name": "HTML", "bytes": "13770"}, {"name": "JavaScript", "bytes": "339680"}, {"name": "Ruby", "bytes": "645848"}, {"name": "Shell", "bytes": "1152"}]}} +{"text": "<?php\n\n/**\n * DO NOT EDIT!\n * This file was automatically generated via bin/generate-validator-spec.php.\n */\n\nnamespace AmpProject\\Validator\\Spec\\Tag;\n\nuse AmpProject\\Format;\nuse AmpProject\\Html\\Attribute;\nuse AmpProject\\Validator\\Spec\\AttributeList;\nuse AmpProject\\Validator\\Spec\\Identifiable;\nuse AmpProject\\Validator\\Spec\\SpecRule;\nuse AmpProject\\Validator\\Spec\\Tag;\n\n/**\n * Tag class AmpLiveListItemsItem.\n *\n * @package ampproject/amp-toolbox.\n *\n * @property-read string $tagName\n * @property-read string $specName\n * @property-read array $attrs\n * @property-read array<string> $attrLists\n * @property-read string $specUrl\n * @property-read array<string> $htmlFormat\n * @property-read string $descriptiveName\n */\nfinal class AmpLiveListItemsItem extends Tag implements Identifiable\n{\n /**\n * ID of the tag.\n *\n * @var string\n */\n const ID = 'AMP-LIVE-LIST [items] item';\n\n /**\n * Array of spec rules.\n *\n * @var array\n */\n const SPEC = [\n SpecRule::TAG_NAME => '$REFERENCE_POINT',\n SpecRule::SPEC_NAME => 'AMP-LIVE-LIST [items] item',\n SpecRule::ATTRS => [\n Attribute::DATA_SORT_TIME => [\n SpecRule::MANDATORY => true,\n ],\n Attribute::DATA_TOMBSTONE => [],\n Attribute::DATA_UPDATE_TIME => [],\n ],\n SpecRule::ATTR_LISTS => [\n AttributeList\\MandatoryIdAttr::ID,\n ],\n SpecRule::SPEC_URL => 'https://amp.dev/documentation/components/amp-live-list/#items',\n SpecRule::HTML_FORMAT => [\n Format::AMP,\n ],\n SpecRule::DESCRIPTIVE_NAME => 'amp-live-list [data-sort-time] child',\n ];\n}\n", "meta": {"content_hash": "7249a3b7f875db7e8dd4b59af86f41b0", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 94, "avg_line_length": 26.650793650793652, "alnum_prop": 0.6206075044669446, "repo_name": "ampproject/amp-toolbox-php", "id": "c8e92f41e3a3ff9a153c47e19cc4bce49df5ca9b", "size": "1679", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/Validator/Spec/Tag/AmpLiveListItemsItem.php", "mode": "33188", "license": "apache-2.0", "language": [{"name": "PHP", "bytes": "1530243"}, {"name": "Shell", "bytes": "653"}]}} +{"text": "<?php\nnamespace tunect\\Yii2PageHelp;\n\nuse yii\\base\\BootstrapInterface;\n\nclass Bootstrap implements BootstrapInterface\n{\n /**\n * @inheritdoc\n */\n public function bootstrap($app)\n {\n $name = Module::$moduleName;\n\n\t\tif (!$app->hasModule($name)) {\n\t\t\t$app->setModule($name, new Module($name));\n\t\t}\n if ($app instanceof \\yii\\web\\Application) {\n $rules[] = [\n 'class' => 'yii\\web\\GroupUrlRule',\n 'prefix' => $name,\n 'rules' => [\n '/' => 'default/index',\n '<action:[\\w-]+>' => 'default/<action>',\n ],\n ];\n $app->getUrlManager()->addRules($rules, false);\n\n } elseif ($app instanceof \\yii\\console\\Application) {\n\t\t\t$app->controllerMap = array_merge($app->controllerMap, [\n\t\t\t\t'migrate' => [\n\t\t\t\t\t'migrationNamespaces' => [\n\t\t\t\t\t\t'tunect\\Yii2PageHelp\\migrations',\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t]);\n\t\t\tif (empty($app->controllerMap['migrate']['class'])) {\n\t\t\t\t$app->controllerMap['migrate']['class'] = 'yii\\console\\controllers\\MigrateController';\n\t\t\t}\n }\n }\n}\n", "meta": {"content_hash": "064800a60b0dc8e262c15abe63900ef6", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 90, "avg_line_length": 26.571428571428573, "alnum_prop": 0.5206093189964157, "repo_name": "dvatri/yii2-page-help", "id": "c769b6de1151a9a161654a800c5ee11abdaade64", "size": "1116", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Bootstrap.php", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "PHP", "bytes": "14094"}]}} +{"text": "#pragma once\n\n#include <uc/types.h>\n\nstatic inline bool plus_overflow_u64(uint64_t x, uint64_t y)\n{\n return ((((uint64_t)(~0)) - x) < y);\n}\n\nstatic inline bool plus_overflow_u32(uint32_t x, uint32_t y)\n{\n return ((((uint32_t)(~0)) - x) < y);\n}\n\n/*\n * This checks to see if two numbers multiplied together are larger\n * than the type that they are. Returns TRUE if OVERFLOWING.\n * If the first parameter \"x\" is greater than zero and\n * if that is true, that the largest possible value 0xFFFFFFFF / \"x\"\n * is less than the second parameter \"y\". If \"y\" is zero then\n * it will also fail because no unsigned number is less than zero.\n */\nstatic inline bool multiply_overflow_u32(uint32_t x, uint32_t y)\n{\n return (x > 0) ? ((((uint32_t)(~0))/x) < y) : false;\n}\n\n#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))\n\n#define AP_WAKE_TRIGGER_DEF 0xffffffff\n\n", "meta": {"content_hash": "e4712aa9fca7f3af949b65d0c1509661", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 70, "avg_line_length": 28.193548387096776, "alnum_prop": 0.6533180778032036, "repo_name": "AMOSSYS/OpenDTeX-Secure-Boot-DRTM", "id": "8b939c39d43ec2b697182ec982051d4beb4fca5d", "size": "874", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libtxt/src/include/stuff.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Assembly", "bytes": "20578"}, {"name": "C", "bytes": "1003462"}, {"name": "C++", "bytes": "98079"}, {"name": "Logos", "bytes": "721"}, {"name": "Objective-C", "bytes": "4708"}, {"name": "Shell", "bytes": "853"}]}} +{"text": "Este repositorio contiene una plantilla LaTeX para el Trabajo de Fin de Grado de la Escuela T\u00e9cnica de Ingenier\u00eda Inform\u00e1tica (ETSInf) de la Universidad Polit\u00e9cnica de Valencia (UPV).\n\n\nEst\u00e1 basada en la plantilla para Microsoft Word [disponible en la web de la ETSInf](http://www.upv.es/entidades/ETSINF/info/plantillaTFG.doc).\n\n# English\n\nThis repository contains a LaTeX template for degree's final project of ETSInf (UPV).\n\nIt's based on the Microsoft Word template [available on ETSInf's website](http://www.upv.es/entidades/ETSINF/info/plantillaTFG.doc).", "meta": {"content_hash": "607e97347baebc686a5256b6887c2aac", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 183, "avg_line_length": 56.0, "alnum_prop": 0.7946428571428571, "repo_name": "Sumolari/TemplateTFG", "id": "939322df11044ed99899014cb8a098f2a2b13d35", "size": "577", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Readme.md", "mode": "33188", "license": "mit", "language": [{"name": "TeX", "bytes": "20797"}]}} +{"text": "\n\npackage org.apache.jena.test;\n\nimport junit.framework.TestCase ;\nimport junit.framework.TestSuite ;\nimport org.apache.jena.rdf.model.impl.RDFReaderFImpl;\n\n/**\n * All developers should edit this file to add their tests.\n * Please try to name your tests and test suites appropriately.\n * Note, it is better to name your test suites on creation\n * rather than in this file.\n */\npublic class TestPackage extends TestCase {\n\n static public TestSuite suite() {\n // Reads Turtle (old parser, not up-to-date but we need something for testing.)\n RDFReaderFImpl.alternative(new X_RDFReaderF());\n\n TestSuite ts = new TestSuite() ;\n ts.setName(\"Jena\") ;\n addTest(ts, \"System setup\", TestSystemSetup.suite());\n addTest(ts, \"IRI\", org.apache.jena.irix.TS_IRIx.suite());\n addTest(ts, \"Enhanced\", org.apache.jena.enhanced.test.TestPackage.suite());\n addTest(ts, \"Datatypes\", org.apache.jena.datatypes.TestPackage.suite()) ;\n addTest(ts, \"Graph\", org.apache.jena.graph.test.TestPackage.suite());\n addTest(ts, \"Mem\", org.apache.jena.mem.test.TestMemPackage.suite() );\n addTest(ts, \"Mem2\", org.apache.jena.mem.test.TestGraphMemPackage.suite() );\n addTest(ts, \"Model\", org.apache.jena.rdf.model.test.TestPackage.suite());\n addTest(ts, \"StandardModels\", org.apache.jena.rdf.model.test.TestStandardModels.suite() );\n addTest(ts, \"Turtle\", org.apache.jena.ttl_test.turtle.TurtleTestSuite.suite()) ;\n addTest(ts, \"XML Output\", org.apache.jena.rdfxml.xmloutput.TestPackage_xmloutput.suite());\n addTest(ts, \"Util\", org.apache.jena.util.TestPackage.suite());\n addTest(ts, \"Jena iterator\", org.apache.jena.util.iterator.test.TestPackage.suite() );\n addTest(ts, \"Assembler\", org.apache.jena.assembler.test.TestAssemblerPackage.suite() );\n addTest(ts, \"ARP\", org.apache.jena.rdfxml.xmlinput.TestPackage_xmlinput.suite());\n addTest(ts, \"Vocabularies\", org.apache.jena.vocabulary.test.TestVocabularies.suite() );\n addTest(ts, \"Shared\", org.apache.jena.shared.TestSharedPackage.suite() );\n addTest(ts, \"Reasoners\", org.apache.jena.reasoner.test.TestPackage.suite());\n addTest(ts, \"Composed graphs\", org.apache.jena.graph.compose.test.TestPackage.suite() );\n addTest(ts, \"Ontology\", org.apache.jena.ontology.impl.TestPackage.suite() );\n return ts ;\n }\n\n private static void addTest(TestSuite ts, String name, TestSuite tc) {\n if ( name != null )\n tc.setName(name);\n ts.addTest(tc);\n }\n\n\n\n}\n", "meta": {"content_hash": "2c98a67fbcc7857071faa6d496646640", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 99, "avg_line_length": 47.96296296296296, "alnum_prop": 0.6745173745173745, "repo_name": "apache/jena", "id": "39d218c0715388936529219d4ecc4098fad98b46", "size": "3395", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "jena-core/src/test/java/org/apache/jena/test/TestPackage.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "22246"}, {"name": "C++", "bytes": "5877"}, {"name": "CSS", "bytes": "3241"}, {"name": "Dockerfile", "bytes": "3341"}, {"name": "Elixir", "bytes": "2548"}, {"name": "HTML", "bytes": "69029"}, {"name": "Haml", "bytes": "30030"}, {"name": "Java", "bytes": "35185092"}, {"name": "JavaScript", "bytes": "72788"}, {"name": "Lex", "bytes": "82672"}, {"name": "Makefile", "bytes": "198"}, {"name": "Perl", "bytes": "35662"}, {"name": "Python", "bytes": "416"}, {"name": "Ruby", "bytes": "216471"}, {"name": "SCSS", "bytes": "4242"}, {"name": "Shell", "bytes": "264124"}, {"name": "Thrift", "bytes": "3755"}, {"name": "Vue", "bytes": "104702"}, {"name": "XSLT", "bytes": "65126"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nnamespace ClipboardText\n{\n\tstatic class Program\n\t{\n\t\t/// <summary>\n\t\t/// The main entry point for the application.\n\t\t/// </summary>\n\t\t[STAThread]\n\t\tstatic void Main()\n\t\t{\n\t\t\tApplication.EnableVisualStyles();\n\t\t\tApplication.SetCompatibleTextRenderingDefault(false);\n\t\t\tApplication.Run(new Form1());\n\t\t}\n\t}\n}\n", "meta": {"content_hash": "5bd49dec0fbb9364d9ffccb78717b974", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 56, "avg_line_length": 19.727272727272727, "alnum_prop": 0.7235023041474654, "repo_name": "kobake/ClipboardText", "id": "0c15a999f607b57eac8d1ec7f854fe6bc4428450", "size": "436", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Program.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "2475"}]}} +{"text": "\r\n\r\ncreate index PID_PATHTION_INTERACTIO on PID_PATHWAY_INTERACTION(INTERACTION_ID) PARALLEL NOLOGGING tablespace CABIO_FUT;\r\ncreate index PID_PATHTION_PATHWAY_ID on PID_PATHWAY_INTERACTION(PATHWAY_ID) PARALLEL NOLOGGING tablespace CABIO_FUT;\r\n\r\n--EXIT;\r\n", "meta": {"content_hash": "9aa38791226eabc138d885d62bd57791", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 120, "avg_line_length": 42.5, "alnum_prop": 0.803921568627451, "repo_name": "NCIP/cabio", "id": "67201ac24db10a27e7d9abaf19b337525d059f6f", "size": "407", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "software/cabio-database/scripts/sql_loader/no_longer_used/indexes/pid_pathway_interaction.cols.sql", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C++", "bytes": "58"}, {"name": "CSS", "bytes": "790679"}, {"name": "HTML", "bytes": "227415"}, {"name": "Java", "bytes": "1695785"}, {"name": "JavaScript", "bytes": "5101781"}, {"name": "PHP", "bytes": "14325"}, {"name": "PLSQL", "bytes": "319454"}, {"name": "Perl", "bytes": "201567"}, {"name": "SQLPL", "bytes": "17416"}, {"name": "Shell", "bytes": "106383"}, {"name": "SourcePawn", "bytes": "3477"}, {"name": "XSLT", "bytes": "19561"}]}} +{"text": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\" >\n\n <TextView\n android:id=\"@+id/titleTextView\"\n android:layout_width=\"150dip\"\n android:layout_height=\"60dip\"\n android:layout_alignParentLeft=\"true\"\n android:layout_alignParentRight=\"true\"\n android:layout_alignParentTop=\"true\"\n android:text=\"Item\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\"\n android:textSize=\"48dp\" />\n\n <TextView\n android:id=\"@+id/occursText\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentLeft=\"true\"\n android:layout_below=\"@+id/titleTextView\"\n android:text=\"Occured on: \"\n android:textAppearance=\"?android:attr/textAppearanceLarge\" />\n\n <TextView\n android:id=\"@+id/expenseDateView\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignBottom=\"@+id/occursText\"\n android:layout_alignParentRight=\"true\"\n android:layout_alignTop=\"@+id/occursText\"\n android:layout_toRightOf=\"@+id/occursText\"\n android:text=\"Date\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\" />\n\n <TextView\n android:id=\"@+id/catView\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignBaseline=\"@+id/categoryText\"\n android:layout_alignBottom=\"@+id/categoryText\"\n android:layout_alignParentRight=\"true\"\n android:layout_toRightOf=\"@+id/occursText\"\n android:text=\"Large Text\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\" />\n\n <TextView\n android:id=\"@+id/descView\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_above=\"@+id/editExpButton\"\n android:layout_alignParentLeft=\"true\"\n android:layout_alignParentRight=\"true\"\n android:layout_below=\"@+id/describeText\"\n android:text=\"Large Text\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\" />\n\n <TextView\n android:id=\"@+id/dollarSign\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignBaseline=\"@+id/amount\"\n android:layout_alignBottom=\"@+id/amount\"\n android:layout_alignParentLeft=\"true\"\n android:layout_toLeftOf=\"@+id/amount\"\n android:text=\"$\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\" />\n\n <TextView\n android:id=\"@+id/CurrencyTExt\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignBaseline=\"@+id/amount\"\n android:layout_alignBottom=\"@+id/amount\"\n android:layout_alignParentRight=\"true\"\n android:layout_toRightOf=\"@+id/amount\"\n android:text=\"Currency\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\" />\n\n <Button\n android:id=\"@+id/backButton2\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"100dip\"\n android:layout_alignParentBottom=\"true\"\n android:layout_alignParentLeft=\"true\"\n android:onClick=\"returnAction\"\n android:text=\"Expense Items\" />\n\n <Button\n android:id=\"@+id/editExpButton\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"100dip\"\n android:layout_alignParentBottom=\"true\"\n android:layout_alignParentRight=\"true\"\n android:layout_toRightOf=\"@+id/backButton2\"\n android:onClick=\"editExpenseClaimAction\"\n android:text=\"Edit\" />\n\n <TextView\n android:id=\"@+id/describeText\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentLeft=\"true\"\n android:layout_centerVertical=\"true\"\n android:text=\"Description:\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\" />\n\n <TextView\n android:id=\"@+id/amount\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_above=\"@+id/describeText\"\n android:layout_alignRight=\"@+id/categoryText\"\n android:layout_marginBottom=\"24dp\"\n android:text=\"Amount\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\" />\n\n <TextView\n android:id=\"@+id/categoryText\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_above=\"@+id/dollarSign\"\n android:layout_alignParentLeft=\"true\"\n android:layout_marginBottom=\"26dp\"\n android:text=\"Category:\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\" />\n\n</RelativeLayout>", "meta": {"content_hash": "d667573fe365d0bc0e6079e76e4ddd4c", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 74, "avg_line_length": 38.2109375, "alnum_prop": 0.6595788182375792, "repo_name": "bkhunter/bkhunter-notes", "id": "e502707defaba77da2109c74b5c78172e9805dc1", "size": "4891", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "res/layout/view_expense_item_activity.xml", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "70590"}]}} +{"text": "@class NSString;\n\n@interface UIKeyboardCandidateSingle : UIKeyboardCandidate {\n\tNSString* _candidate;\n}\n-(id)initWithCandidate:(id)candidate;\n// inherited: -(void)dealloc;\n// inherited: -(id)candidate;\n// inherited: -(id)copyWithZone:(NSZone*)zone;\n@end\n\n#endif\n", "meta": {"content_hash": "f0c5ca7823d052d699be2c0b83cbf283", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 60, "avg_line_length": 21.833333333333332, "alnum_prop": 0.7404580152671756, "repo_name": "codyd51/libPassword", "id": "11f24b118a2b7ec37f6b07fca982f79d10d2f76a", "size": "374", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libPassPrefs/include/UIKit/UIKeyboardCandidateSingle.h", "mode": "33188", "license": "mit", "language": []}} +{"text": "from typing import List, Optional\nimport os.path\nfrom pathlib import Path\nfrom collections import ChainMap\nimport json\n\nfrom click import BadParameter\nfrom requests import Session\nfrom doit.action import CmdAction\nfrom doit.tools import create_folder, config_changed\n\nfrom elm_doc import elm_project\nfrom elm_doc import elm_codeshift\nfrom elm_doc import elm_parser\nfrom elm_doc.elm_project import ElmPackage, ElmProject, ProjectConfig, ModuleName\nfrom elm_doc.run_config import RunConfig, Validate\nfrom elm_doc.tasks import package as package_tasks\nfrom elm_doc.utils import Namespace\n\n\nclass actions(Namespace):\n def write_project_elm_json(\n project: ElmProject,\n project_config: ProjectConfig,\n project_modules: List[ModuleName],\n build_path: Path):\n elm_project_with_exposed_modules = dict(ChainMap(\n {'exposed-modules': [module for module in project_modules]},\n project.as_package(project_config).as_json(),\n ))\n elm_json_path = build_path / ElmPackage.DESCRIPTION_FILENAME\n with open(str(elm_json_path), 'w') as f:\n json.dump(elm_project_with_exposed_modules, f)\n\n def run_elm_codeshift(src_dir: Path):\n for elm_file_path in src_dir.glob('**/*.elm'):\n if elm_parser.is_port_module(elm_file_path):\n elm_codeshift.strip_ports_from_file(elm_file_path)\n\n def validate_elm_path(elm_path: Optional[Path]):\n if not elm_path:\n raise BadParameter('please specify the elm executable to use with --elm-path')\n\n class ElmMake(CmdAction):\n def __init__(self, elm_path: Path, build_path: Path, output_path: Path):\n command = [str(elm_path), 'make', '--docs', str(output_path), '--output', '/dev/null']\n super().__init__(command, cwd=str(build_path), shell=False)\n\n class SyncSources(CmdAction):\n '''Copy source files to a single directory. This meets the requirement of Elm\n that a package project can only have a single source directory and gives\n us an isolated environment so that Elm can run in parallel with any invocation\n of Elm within the actual project.\n '''\n\n def __init__(self, project: ElmProject, target_directory: Path):\n sources = ['{}/./'.format(os.path.normpath(source_dir))\n for source_dir in project.source_directories]\n command = ['rsync', '-a', '--delete', '--recursive', '--ignore-errors'] + sources + [str(target_directory)]\n super().__init__(command, cwd=str(project.path), shell=False)\n\n\ndef create_main_project_tasks(\n session: Session,\n project: ElmProject,\n project_config: ProjectConfig,\n run_config: RunConfig):\n task_name = '{}/{}'.format(project_config.fake_user, project_config.fake_project)\n project_modules = list(elm_project.glob_project_modules(\n project, project_config))\n project_as_package = project.as_package(project_config)\n file_dep = [run_config.elm_path] if run_config.elm_path else []\n file_dep.extend([module.path for module in project_modules])\n uptodate_config = {'elm_json': project_as_package.as_json()}\n\n build_src_dir = run_config.build_path / 'src'\n docs_actions = [\n (create_folder, (str(run_config.build_path),)),\n (actions.write_project_elm_json, (\n project,\n project_config,\n [module.name for module in project_modules],\n run_config.build_path,\n )),\n (create_folder, (str(build_src_dir),)),\n actions.SyncSources(project, build_src_dir),\n (actions.run_elm_codeshift, (build_src_dir,)),\n (actions.validate_elm_path, (run_config.elm_path,)),\n ]\n\n if isinstance(run_config, Validate):\n # don't update the final artifact; write to build dir instead\n docs_path = run_config.build_path / project.DOCS_FILENAME\n docs_actions.append(actions.ElmMake(run_config.elm_path, run_config.build_path, docs_path))\n yield {\n 'basename': 'validate_docs_json',\n 'name': task_name,\n 'actions': docs_actions,\n 'targets': [],\n 'file_dep': file_dep,\n 'uptodate': [config_changed(uptodate_config)],\n }\n return\n\n # project docs.json\n project_output_path = package_tasks.package_docs_root(\n run_config.output_path, project_as_package)\n docs_actions.insert(0, (create_folder, (str(project_output_path),)))\n docs_path = project_output_path / project.DOCS_FILENAME\n docs_actions.append(actions.ElmMake(run_config.elm_path, run_config.build_path, docs_path))\n\n yield {\n 'basename': 'build_docs_json',\n 'name': task_name,\n 'actions': docs_actions,\n 'targets': [docs_path],\n 'file_dep': file_dep,\n 'uptodate': [config_changed(uptodate_config)],\n }\n\n yield from package_tasks.create_package_page_tasks(\n package_tasks.Context.Project,\n session,\n project_as_package,\n [module.name for module in project_modules],\n run_config)\n", "meta": {"content_hash": "4a85bf4941be040c258baa7ba3ca9e22", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 119, "avg_line_length": 40.56349206349206, "alnum_prop": 0.6388182351790256, "repo_name": "ento/elm-doc", "id": "ffe0d0003529c06405aec67bc31966fa695228f3", "size": "5111", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/elm_doc/tasks/project.py", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Elm", "bytes": "280"}, {"name": "Nix", "bytes": "3275"}, {"name": "Python", "bytes": "116334"}, {"name": "Shell", "bytes": "778"}]}} +{"text": "package org.cyclops.integrateddynamics.api.evaluate.variable;\n\n/**\n * A value type that can be null.\n * @author rubensworks\n */\npublic interface IValueTypeNullable<V extends IValue> extends IValueType<V> {\n\n public boolean isNull(V a);\n\n}\n", "meta": {"content_hash": "883375b764d897e795f8c0ea63279318", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 77, "avg_line_length": 22.0, "alnum_prop": 0.743801652892562, "repo_name": "CyclopsMC/IntegratedDynamics", "id": "b9a6231daf64e25814bb93382da5ade26c6e2650", "size": "242", "binary": false, "copies": "1", "ref": "refs/heads/master-1.19", "path": "src/main/java/org/cyclops/integrateddynamics/api/evaluate/variable/IValueTypeNullable.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "3437058"}]}} +{"text": "The purpose of this guide is to provide the reader with step by step instructions on how to deploy Kubernetes on vSphere infrastructure. The instructions use `kubeadm`, a tool built to provide best-practice \u201cfast paths\u201d for creating Kubernetes clusters. The reader will also learn how to deploy the Container Storage Interface and Cloud Provider Interface plugins for vSphere specific operations. At the end of this tutorial you will have a fully running K8s on vSphere environment that allows for dynamic provisioning of volumes.\n\n## Prerequisites\n\nThis section will cover the prerequisites that need to be in place before attempting the deployment.\n\n### vSphere requirements\n\nvSphere 6.7U3 (or later) is a prerequisite for using CSI and CPI at the time of writing. This may change going forward, and the documentation will be updated to reflect any changes in this support statement. If you are on a vSphere version that is below 6.7 U3, you can either upgrade vSphere to 6.7U3 or follow one of the tutorials for earlier vSphere versions. Here is the tutorial on deploying Kubernetes with kubeadm, using the VCP - [Deploying Kubernetes using kubeadm with the vSphere Cloud Provider (in-tree)](./k8s-vcp-on-vsphere-with-kubeadm.md).\n\n### Firewall requirements\n\nProviding the K8s master node(s) access to the vCenter management interface will be sufficient, given the CPI and CSI pods are deployed on the master node(s). Should these components be deployed on worker nodes or otherwise - those nodes will also need access to the vCenter management interface.\n\nIf you want to use topology-aware volume provisioning and the late binding feature using `zone`/`region`, the node need to discover its topology by connecting to the vCenter, for this every node should be able to communicate to the vCenter. You can disable this optional feature if you want to open only the master node to the vCenter management interface.\n\n### Recommended Guest Operating System\n\nVMware recommends that you create a virtual machine template using Guest OS Ubuntu 18.04.1 LTS (Bionic Beaver) 64-bit PC (AMD64) Server. Check it out on [VMware PartnerWeb](http://partnerweb.vmware.com/GOSIG/Ubuntu_18_04_LTS.html). This template is cloned to act as base images for your Kubernetes cluster. For instructions on how to do this, please refer to the guidance provided in [this blog post by Myles Gray of VMware](https://blah.cloud/kubernetes/creating-an-ubuntu-18-04-lts-cloud-image-for-cloning-on-vmware/). Ensure that SSH access is enabled on all nodes. This must be done in order to run commands on both the Kubernetes master and worker nodes in this guide.\n\n### Virtual Machine Hardware requirements\n\nVirtual Machine Hardware must be version 15 or higher. For Virtual Machine CPU and Memory requirements, size adequately based on workload requirements.\nVMware also recommend that virtual machines use the VMware Paravirtual SCSI controller for Primary Disk on the Node VM. This should be the default, but it is always good practice to check.\nFinally, the disk.EnableUUID parameter must be set for each node VMs. This step is necessary so that the VMDK always presents a consistent UUID to the VM, thus allowing the disk to be mounted properly.\nIt is recommended to not take snapshots of CNS node VMs to avoid errors and unpredictable behavior.\n\n### Docker Images\n\nThe following is the list of docker images that are required for the installation of CSI and CPI on Kubernetes. These images are automatically pulled in when CSI and CPI manifests are deployed.\nVMware distributes and recommends the following images:\n\n```bash\ngcr.io/cloud-provider-vsphere/csi/release/driver:v1.0.1\ngcr.io/cloud-provider-vsphere/csi/release/syncer:v1.0.1\nhttp://gcr.io/cloud-provider-vsphere/cpi/release/manager:v1.0.0\n```\n\nIn addition, you can use the following images or any of the open source or commercially available container images appropriate for the CSI deployment. Note that the tags reference the version of various components. This will change with future versions:\n\n```bash\nquay.io/k8scsi/csi-provisioner:v1.2.2\nquay.io/k8scsi/csi-attacher:v1.1.1\nquay.io/k8scsi/csi-node-driver-registrar:v1.1.0\nquay.io/k8scsi/livenessprobe:v1.1.0\nk8s.gcr.io/kube-apiserver:v1.14.2\nk8s.gcr.io/kube-controller-manager:v1.14.2\nk8s.gcr.io/kube-scheduler:v1.14.2\nk8s.gcr.io/kube-proxy:v1.14.2\nk8s.gcr.io/pause:3.1\nk8s.gcr.io/etcd:3.3.10\nk8s.gcr.io/coredns:1.3.1\n```\n\n### Tools\n\nIf you plan to deploy Kubernetes on vSphere from a MacOS environment, the `brew` package manager may be used to install and manage the necessary tools. If using Linux or Windows environment to initiate the deployment, links to the tools are included. Follow the tool specific instructions for installing the tools on the different operating systems.\n\nFor each tool, the brew install command for MacOS is shown here.\n\n* `brew` - <https://brew.sh>\n* `govc` - brew tap govmomi/tap/govc && brew install govmomi/tap/govc\n* `kubectl` - brew install kubernetes-cli\n* `tmux` (optional) - brew install tmux\n\nHere are the links to the tools and install instructions for other operating systems:\n\n* [govc for other Operating Systems](https://github.com/vmware/govmomi/tree/master/govc) - version 0.20.0 or higher recommended\n* [kubectl for other Operating Systems](https://kubernetes.io/docs/tasks/tools/install-kubectl/)\n* [tmux for other Operating Systems](https://github.com/tmux/tmux)\n\n## Setting up VMs and Guest OS\n\nThe next step is to install the necessary Kubernetes components on the Ubuntu OS virtual machines. Some components must be installed on all of the nodes. In other cases, some of the components need only be installed on the master, and in other cases, only the workers. In each case, where the components are installed is highlighted.\nAll installation and configuration commands should be executed with root privilege. You can switch to the root environment using the \"sudo su\" command.\nSetup steps required on all nodes\nThe following section details the steps that are needed on both the master and worker nodes.\n\n### Install VMTools (if necessary)\n\nFor more information about VMTools including installation, please visit the [official documentation](https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.html.hostclient.doc/GUID-28C39A00-743B-4222-B697-6632E94A8E72.html).\n\n### disk.EnableUUID=1\n\nThe following govc commands will set the disk.EnableUUID=1 on all nodes.\n\n```bash\n# export GOVC_INSECURE=1\n# export GOVC_URL='https://<VC_IP>'\n# export GOVC_USERNAME=VC_Admin_User\n# export GOVC_PASSWORD=VC_Admin_Passwd\n\n# govc ls\n/datacenter/vm\n/datacenter/network\n/datacenter/host\n/datacenter/datastore\n```\n\nTo retrieve all Node VMs, use the following command:\n\n```bash\n# govc ls /<datacenter-name>/vm\n/datacenter/vm/k8s-node3\n/datacenter/vm/k8s-node4\n/datacenter/vm/k8s-node1\n/datacenter/vm/k8s-node2\n/datacenter/vm/k8s-master\n```\n\nTo use govc to enable Disk UUID, use the following command:\n\n```bash\n# govc vm.change -vm '/datacenter/vm/k8s-node1' -e=\"disk.enableUUID=1\"\n# govc vm.change -vm '/datacenter/vm/k8s-node2' -e=\"disk.enableUUID=1\"\n# govc vm.change -vm '/datacenter/vm/k8s-node3' -e=\"disk.enableUUID=1\"\n# govc vm.change -vm '/datacenter/vm/k8s-node4' -e=\"disk.enableUUID=1\"\n# govc vm.change -vm '/datacenter/vm/k8s-master' -e=\"disk.enableUUID=1\"\n```\n\nFurther information on disk.enableUUID can be found in [VMware Knowledgebase Article 52815](https://kb.vmware.com/s/article/52815).\n\n### Upgrade Virtual Machine Hardware\n\nVM Hardware should be at version 15 or higher.\n\n```bash\n# govc vm.upgrade -version=15 -vm '/datacenter/vm/k8s-node1'\n# govc vm.upgrade -version=15 -vm '/datacenter/vm/k8s-node2'\n# govc vm.upgrade -version=15 -vm '/datacenter/vm/k8s-node3'\n# govc vm.upgrade -version=15 -vm '/datacenter/vm/k8s-node4'\n# govc vm.upgrade -version=15 -vm '/datacenter/vm/k8s-master'\n```\n\nCheck the VM Hardware version after running the above command:\n\n```bash\n# govc vm.option.info '/datacenter/vm/k8s-node1' | grep HwVersion\nHwVersion: 15\n```\n\n### Disable Swap\n\nSSH into all K8s worker nodes and disable swap on all nodes including master node. This is a prerequisite for kubeadm. IF you have followed the previous guidance on how to create the OS template image, this step will have already been implemented.\n\n```bash\n# swapoff -a\n# vi /etc/fstab\n... remove any swap entry from this file ...\n```\n\n### Install Docker CE\n\nThe following steps should be used to install the container runtime on all of the nodes. Docker CE 18.06 must be used. Kubernetes has explicit supported versions, so it has to be this version\n\nFirst, update the apt package index.\n\n```bash\n# apt update\n```\n\nThe next step is to install packages to allow apt to use a repository over HTTPS.\n\n```bash\n# apt install ca-certificates software-properties-common \\\napt-transport-https curl -y\n```\n\nNow add Docker\u2019s official GPG key.\n\n```bash\n# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -\n```\n\nTo complete the install, add the docker apt repository.\n\n```bash\n# add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable\"\n```\n\nNow we can install Docker CE. To install a specific version, replace the version string with the desired version number.\n\n```bash\n# apt update\n# apt install docker-ce=18.06.0~ce~3-0~ubuntu -y\n```\n\nFinally, setup the daemon parameters, like log rotation and cgroups.\n\n```bash\n# tee /etc/docker/daemon.json >/dev/null <<EOF\n{\n \"exec-opts\": [\"native.cgroupdriver=systemd\"],\n \"log-driver\": \"json-file\",\n \"log-opts\": {\n \"max-size\": \"100m\"\n },\n \"storage-driver\": \"overlay2\"\n}\nEOF\n```\n\n```bash\n# mkdir -p /etc/systemd/system/docker.service.d\n```\n\nAnd to complete, restart docker to pickup the new parameters.\n\n```bash\n# systemctl daemon-reload\n```\n\n```bash\n# systemctl restart docker\n```\n\nDocker is now installed. Verify the status of docker via the following command:\n\n```bash\n#systemctl status docker\n docker.service - Docker Application Container Engine\n Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)\n Active: active (running) since Fri 2019-09-06 12:37:27 UTC; 4min 15s ago\n\n#docker info | egrep \"Server Version|Cgroup Driver\"\nServer Version: 18.06.0-ce\nCgroup Driver: systemd\n```\n\n### Install Kubelet, Kubectl, Kubeadm\n\nThe next step is to install the main Kubernetes components on each of the nodes.\n\n`kubeadm` is the command to bootstrap the cluster. It runs on the master and all worker nodes.\n`kubelet` is the component that runs on all nodes in the cluster and performs such tasks as starting pods and containers.\n`kubectl` is the command line utility to communicate with your cluster. It runs only on the master node.\nFor Ubuntu distributions, a specific version can be installed with specifying version of the package name, e.g. `apt install -qy kubeadm=1.14.2-00 kubelet=1.14.2-00 kubectl=1.14.2-00`. These should be the minimum versions installed.\n\nFirst, the Kubernetes repository needs to be added to apt.\n\n```bash\n# curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -\n```\n\n```bash\n# cat <<EOF >/etc/apt/sources.list.d/kubernetes.list\ndeb https://apt.kubernetes.io/ kubernetes-xenial main\nEOF\n```\n\nNext, install kubelet, kubectl and kubeadm.\n\n```bash\n# apt update\n\n# apt install -qy kubeadm=1.14.2-00 kubelet=1.14.2-00 kubectl=1.14.2-00\n```\n\nFinally, hold Kubernetes packages at their installed version so as not to upgrade unexpectedly on an apt upgrade.\n\n```bash\n# apt-mark hold kubelet kubeadm kubectl\n```\n\n### Setup step for flannel (Pod Networking)\n\nWe will be using flannel for pod networking in this example, so the below needs to be run on all nodes to pass bridged IPv4 traffic to iptables chains:\n\n```bash\n# sysctl net.bridge.bridge-nf-call-iptables=1\n```\n\nThat completes the common setup steps across both masters and worker nodes. We will now look at the steps involved in enabling the vSphere Cloud Provider Interface (CPI) and Container Storage Interface (CSI) before we are ready to deploy our Kubernetes cluster. Pay attention to where the steps are carried out, which will be either on the master or the worker nodes.\n\n## Installing the Kubernetes master node(s)\n\nAgain, these steps are only carried out on the master. Use kubeadminit to initialize the master node. In order to initialize the master node, we need to first of all create a `kubeadminit.yaml` manifest file that needs to be passed to the `kubeadm` command. Note the reference to an external cloud provider in the `nodeRegistration` part of the manifest.\n\n```bash\n# tee /etc/kubernetes/kubeadminit.yaml >/dev/null <<EOF\napiVersion: kubeadm.k8s.io/v1beta1\nkind: InitConfiguration\nbootstrapTokens:\n - groups:\n - system:bootstrappers:kubeadm:default-node-token\n token: y7yaev.9dvwxx6ny4ef8vlq\n ttl: 0s\n usages:\n - signing\n - authentication\nnodeRegistration:\n kubeletExtraArgs:\n cloud-provider: external\n---\napiVersion: kubeadm.k8s.io/v1beta1\nkind: ClusterConfiguration\nuseHyperKubeImage: false\nkubernetesVersion: v1.14.2\nnetworking:\n serviceSubnet: \"10.96.0.0/12\"\n podSubnet: \"10.244.0.0/16\"\netcd:\n local:\n imageRepository: \"k8s.gcr.io\"\n imageTag: \"3.3.10\"\ndns:\n type: \"CoreDNS\"\n imageRepository: \"k8s.gcr.io\"\n imageTag: \"1.5.0\"\nEOF\n```\n\nBootstrap the Kubernetes master node using the cluster configuration file created in the step above.\n\n```bash\n# kubeadm init --config /etc/kubernetes/kubeadminit.yaml\n[init] Using Kubernetes version: v1.14.2\n. .\n. .\n[preflight] Pulling images required for setting up a Kubernetes cluster\n[preflight] This might take a minute or two, depending on the speed of your internet connection\n[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'\n. .\n. .\nYou should now deploy a pod network to the cluster.\nRun \"kubectl apply -f [podnetwork].yaml\" with one of the options listed at:\n https://kubernetes.io/docs/concepts/cluster-administration/addons/\n\nThen you can join any number of worker nodes by running the following on each as root:\n\nkubeadm join 10.192.116.47:6443 --token y7yaev.9dvwxx6ny4ef8vlq \\\n --discovery-token-ca-cert-hash sha256:[sha sum from above output]\n```\n\nNote that the last part of the output provides the command to join the worker nodes to the master in this Kubernetes cluster. We will return to that step shortly. Next, setup the kubeconfig file on the master so that Kubernetes CLI commands such as kubectl may be used on your newly created Kubernetes cluster.\n\n```bash\n# mkdir -p $HOME/.kube\n```\n\n```bash\n# cp /etc/kubernetes/admin.conf $HOME/.kube/config\n```\n\nYou can also use `kubectl` on external (non-master) systems by copying the contents of the master\u2019s `/etc/kubernetes/admin.conf` to your local computer's `~/.kube/config` file.\n\nAt this stage, you may notice coredns pods remain in the pending state with `FailedScheduling` status. This is because the master node has taints that the coredns pods cannot tolerate. This is expected, as we have started `kubelet` with `cloud-provider: external`. Once the vSphere Cloud Provider Interface is installed, and the nodes are initialized, the taints will be automatically removed from node, and that will allow scheduling of the coreDNS pods.\n\n```bash\n# kubectl get pods --namespace=kube-system\nNAME READY STATUS RESTARTS AGE\ncoredns-fb8b8dccf-q57f9 0/1 Pending 0 87s\ncoredns-fb8b8dccf-scgp2 0/1 Pending 0 87s\netcd-k8s-master 1/1 Running 0 54s\nkube-apiserver-k8s-master 1/1 Running 0 39s\nkube-controller-manager-k8s-master 1/1 Running 0 54s\nkube-proxy-rljk8 1/1 Running 0 87s\nkube-scheduler-k8s-master 1/1 Running 0 37s\n```\n\n```bash\n# kubectl describe pod coredns-fb8b8dccf-q57f9 --namespace=kube-system\n.\n.\nEvents:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Warning FailedScheduling 7s (x21 over 2m1s) default-scheduler 0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate.\n```\n\n### Install flannel pod overlay networking\n\nThe next step that needs to be carried out on the master node is that the flannel pod overlay network must be installed so the pods can communicate with each other.\nThe command to install flannel on the master is as follows:\n\n```bash\n# kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/62e44c867a2846fefb68bd5f178daf4da3095ccb/Documentation/kube-flannel.yml\n```\n\nPlease follow [these alternative instructions to install a pod overlay network other than flannel](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#pod-network).\n\nAt this point, you can check if the overlay network is deployed.\n\n```bash\n# kubectl get pods --namespace=kube-system\nNAME READY STATUS RESTARTS AGE\ncoredns-6557d7f7d6-9s7sm 0/1 Pending 0 107s\ncoredns-6557d7f7d6-wgxtq 0/1 Pending 0 107s\netcd-k8s-mstr 1/1 Running 0 70s\nkube-apiserver-k8s-mstr 1/1 Running 0 54s\nkube-controller-manager-k8s-mstr 1/1 Running 0 53s\nkube-flannel-ds-amd64-pm9m9 1/1 Running 0 11s\nkube-proxy-8dfm9 1/1 Running 0 107s\nkube-scheduler-k8s-mstr 1/1 Running 0 49s\n```\n\n### Export the master node configuration\n\nFinally, the master node configuration needs to be exported as it is used by the worker nodes wishing to join to the master.\n\n```bash\n# kubectl -n kube-public get configmap cluster-info -o jsonpath='{.data.kubeconfig}' > discovery.yaml\n```\n\nThe `discovery.yaml` file will need to be copied to `/etc/kubernetes/discovery.yaml` on each of the worker nodes.\n\n## Installing the Kubernetes worker node(s)\n\nPerform this task on the worker nodes. Verify that you have installed Docker CE, kubeadm, etc, on the worker nodes before attempting to add them to the master.\n\nTo have the worker node(s) join to the master, a worker node kubeadm config yaml file must be created. Notice it is using `/etc/kubernetes/discovery.yaml` as the input for master discovery. We will show how to copy the file from the workers to the master in the next step. Also, notice that the token used in the worker node config is the same as we put in the master `kubeadminitmaster.yaml` configuration above. Finally, we once more specify that the cloud-provider is external for the workers, as we are going to use the new CPI.\n\n```bash\n# tee /etc/kubernetes/kubeadminitworker.yaml >/dev/null <<EOF\napiVersion: kubeadm.k8s.io/v1beta1\ncaCertPath: /etc/kubernetes/pki/ca.crt\ndiscovery:\n file:\n kubeConfigPath: /etc/kubernetes/discovery.yaml\n timeout: 5m0s\n tlsBootstrapToken: y7yaev.9dvwxx6ny4ef8vlq\nkind: JoinConfiguration\nnodeRegistration:\n criSocket: /var/run/dockershim.sock\n kubeletExtraArgs:\n cloud-provider: external\nEOF\n```\n\nYou can copy the `discovery.yaml` to your local machine with `scp`.\n\nFirst, as superuser, use `scp` to copy `/etc/kubernetes/discovery.yaml` on the master to `/home/ubuntu/discovery.yaml` on all the nodes.\n\nYou will now need to login to each of the nodes and copy the `discovery.yaml` file from `/home/ubuntu` to `/etc/kubernetes`. The `discovery.yaml` file must exist in `/etc/kubernetes` on the nodes.\n\nOnce that step is completed, run the following command on each worker node to have it join the master (and other worker nodes that are already joined) in the cluster:\n\n```bash\n# kubeadm join --config /etc/kubernetes/kubeadminitworker.yaml\n```\n\nYou can check if the node has joined by running `# kubectl get nodes` on the master.\n\n## Install the vSphere Cloud Provider Interface\n\nThe following steps are only done on the master.\n\nPlease note that the CSI driver requires the presence of a `ProviderID` label on each node in the K8s cluster. This can be populated by whatever means is most convenient - Ideally, the Cloud Provider Interface (CPI) would be used as it is actively maintained and updated, but if the vSphere Cloud Provider (VCP) must be used due to brownfield requirements or architectural constraints of your distribution - that is also acceptable. As long as the `ProviderID` is populated by some means - the vSphere CSI driver will work.\n\n### Create a CPI configMap\n\nThis cloud-config configmap file, passed to the CPI on initialization, contains details about the vSphere configuration. This file, which here we have called `vsphere.conf` has been populated with some sample values. Obviously, you will need to modify this file to reflect your own vSphere configuration.\n\n**NOTE:** As of CPI version 1.2.0 or higher, the preferred cloud-config format will be `YAML` based. The `INI` based format will be deprecated but supported until the transition to the preferred `YAML` based configuration has been completed. This deprecation notice will be placed in the CPI logs when using the `INI` based configuration format.\n\n```bash\n# tee /etc/kubernetes/vsphere.conf >/dev/null <<EOF\n\n# Global properties in this section will be used for all specified vCenters unless overriden in VirtualCenter section.\nglobal:\n port: 443\n # set insecureFlag to true if the vCenter uses a self-signed cert\n insecureFlag: true\n # settings for using k8s secret\n secretName: cpi-global-secret\n secretNamespace: kube-system\n\n# vcenter section\nvcenter:\n tenant-finance:\n server: 1.1.1.1\n datacenters:\n - finanace\n tenant-hr:\n server: 192.168.0.1\n datacenters:\n - hrwest\n - hreast\n tenant-engineering:\n server: 10.0.0.1\n datacenters:\n - engineering\n secretName: cpi-engineering-secret\n secretNamespace: kube-system\n\n# labels for regions and zones\nlabels:\n region: k8s-region\n zone: k8s-zone\n\nEOF\n```\n\nHere is a description of the fields used in the vsphere.conf configmap.\n\n* `insecureFlag` should be set to true to use self-signed certificate for login.\n* `server` section is defined to hold property of vcenter IP address or FQDN.\n* `secretName` holds the credential(s) for a single or list of vCenter Servers.\n* `secretNamespace` is set to the namespace where the secret has been created.\n* `port` is the vCenter Server Port. The default is 443 if not specified.\n* `datacenters` should be the list of datacenters where kubernetes node VMs are present.\n\nFor those users deploying CPI versions 1.1.0 or earlier, the corresponding `INI` based configuration that mirrors the above configuration appears as the following:\n\n```bash\n# tee /etc/kubernetes/vsphere.conf >/dev/null <<EOF\n\n[Global]\nport = \"443\"\ninsecure-flag = \"true\"\nsecret-name = \"cpi-global-secret\"\nsecret-namespace = \"kube-system\"\n\n[VirtualCenter \"1.1.1.1\"]\ndatacenters = \"finance\"\n\n[VirtualCenter \"192.168.0.1\"]\ndatacenters = \"hrwest,hreast\"\n\n[VirtualCenter \"10.0.0.1\"]\ndatacenters = \"engineering\"\nsecret-name = \"cpi-engineering-secret\"\nsecret-namespace = \"kube-system\"\n\nEOF\n```\n\nCreate the configmap by running the following command:\n\n```bash\n# cd /etc/kubernetes\n```\n\n```bash\n# kubectl create configmap cloud-config --from-file=vsphere.conf --namespace=kube-system\n```\n\nVerify that the configmap has been successfully created in the kube-system namespace.\n\n```bash\n# kubectl get configmap cloud-config --namespace=kube-system\nNAME DATA AGE\ncloud-config 1 82s\n```\n\n### Create a CPI secret\n\nThe CPI supports storing vCenter credentials either in:\n\n* a shared global secret containing all vCenter credentials, or\n* a secret dedicated for a particular vCenter configuration which takes precedence over anything that might be configured within the global secret\n\nIn the example `vsphere.conf` above, there are two configured [Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets). The vCenter at `10.0.0.1` contains credentials in the secret named `cpi-engineering-secret` in the namespace `kube-system` and the vCenter at `1.1.1.1` and `192.168.0.1` contains credentials in the secret named `cpi-global-secret` in the namespace `kube-system` defined in the `global:` section.\n\nAn example [Secrets YAML](https://github.com/kubernetes/cloud-provider-vsphere/raw/master/manifests/controller-manager/vccm-secret.yaml) can be used for reference when creating your own `secrets`. If the example secret YAML is used, update the secret name to use a `<unique secret name>`, the vCenter IP address in the keys of `stringData`, and the `username` and `password` for each key.\n\nThe secret for the vCenter at `10.0.0.1` might look like the following:\n\n```yaml\napiVersion: v1\nkind: Secret\nmetadata:\n name: cpi-engineering-secret\n namespace: kube-system\nstringData:\n 10.0.0.1.username: \"administrator@vsphere.local\"\n 10.0.0.1.password: \"password\"\n```\n\nThis is a second Secret example, this time showing an alternative format. This alternative format allows for IPv6 server addresses. This format requires server_{id}, username_{id} and password_{id} entries, where the entries have a common suffix per server:\n\n```yaml\napiVersion: v1\nkind: Secret\nmetadata:\n name: cpi-engineering-secret\n namespace: kube-system\nstringData:\n server_prod: fd01::102\n username_prod: \"administrator@vsphere.local\"\n password_prod: \"password\"\n server_test: 10.0.0.2\n username_test: \"developer@vsphere.local\"\n password_test: \"sekret\"\n```\n\nThen to create the secret, run the following command replacing the name of the YAML file with the one you have used:\n\n```bash\n# kubectl create -f cpi-engineering-secret.yaml\n```\n\nVerify that the credential secret is successfully created in the kube-system namespace.\n\n```bash\n# kubectl get secret cpi-engineering-secret --namespace=kube-system\nNAME TYPE DATA AGE\ncpi-engineering-secret Opaque 1 43s\n```\n\nIf you have multiple vCenters as in the example vsphere.conf above, your Kubernetes Secret YAML could look like the following to storage the vCenter credentials for vCenters at `1.1.1.1` and `192.168.0.1`:\n\n```yaml\napiVersion: v1\nkind: Secret\nmetadata:\n name: cpi-global-secret\n namespace: kube-system\nstringData:\n 1.1.1.1.username: \"administrator@vsphere.local\"\n 1.1.1.1.password: \"password\"\n 192.168.0.1.username: \"administrator@vsphere.local\"\n 192.168.0.1.password: \"password\"\n```\n\n### Zones and Regions for Pod and Volume Placement - CPI\n\nKubernetes allows you to place Pods and Persistent Volumes on specific parts of the underlying infrastructure, e.g. different DataCenters or different vCenters, using the concept of Zones and Regions. However, to use placement controls, the required configuration steps needs to be put in place at Kubernetes deployment time, and require additional settings in the vSphere.conf of both the CPI and CSI. For more information on how to implement zones/regions support, [there is a zones/regions tutorial on how to do it here](https://cloud-provider-vsphere.sigs.k8s.io/tutorials/deploying_cpi_with_multi_dc_vc_aka_zones.html).\n\nIf you are not interested in K8s object placement, this section can be ignored, and you can proceed with the remaining CPI setup steps.\n\n### Check that all nodes are tainted\n\nBefore installing vSphere Cloud Controller Manager, make sure all nodes are tainted with `node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule`. When the kubelet is started with \u201cexternal\u201d cloud provider, this taint is set on a node to mark it as unusable. After a controller from the cloud provider initializes this node, the kubelet removes this taint.\n\n```bash\n# kubectl describe nodes | egrep \"Taints:|Name:\"\nName: k8s-master\nTaints: node-role.kubernetes.io/master:NoSchedule\nName: k8s-node1\nTaints: node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule\nName: k8s-node2\nTaints: node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule\nName: k8s-node3\nTaints: node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule\nName: k8s-node4\nTaints: node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule\n```\n\n### Deploy the CPI manifests\n\nThere are 3 manifests that must be deployed to install the vSphere Cloud Provider Interface. The following example applies the RBAC roles and the RBAC bindings to your Kubernetes cluster. It also deploys the Cloud Controller Manager in a DaemonSet.\n\n```bash\n# kubectl apply -f https://raw.githubusercontent.com/kubernetes/cloud-provider-vsphere/master/manifests/controller-manager/cloud-controller-manager-roles.yaml\nclusterrole.rbac.authorization.k8s.io/system:cloud-controller-manager created\n\n# kubectl apply -f https://raw.githubusercontent.com/kubernetes/cloud-provider-vsphere/master/manifests/controller-manager/cloud-controller-manager-role-bindings.yaml\nclusterrolebinding.rbac.authorization.k8s.io/system:cloud-controller-manager created\n\n# kubectl apply -f https://github.com/kubernetes/cloud-provider-vsphere/raw/master/manifests/controller-manager/vsphere-cloud-controller-manager-ds.yaml\nserviceaccount/cloud-controller-manager created\ndaemonset.extensions/vsphere-cloud-controller-manager created\nservice/vsphere-cloud-controller-manager created\n```\n\n### Verify that the CPI has been successfully deployed\n\nVerify vsphere-cloud-controller-manager is running and all other system pods are up and running (note that the coredns pods were not running previously - they should be running now as the taints have been removed by installing the CPI):\n\n```bash\n# kubectl get pods --namespace=kube-system\nNAME READY STATUS RESTARTS AGE\ncoredns-fb8b8dccf-bq7qq 1/1 Running 0 71m\ncoredns-fb8b8dccf-r47q2 1/1 Running 0 71m\netcd-k8s-master 1/1 Running 0 69m\nkube-apiserver-k8s-master 1/1 Running 0 70m\nkube-controller-manager-k8s-master 1/1 Running 0 69m\nkube-flannel-ds-amd64-7kmk9 1/1 Running 0 38m\nkube-flannel-ds-amd64-dtvbg 1/1 Running 0 63m\nkube-flannel-ds-amd64-hq57c 1/1 Running 0 30m\nkube-flannel-ds-amd64-j7g4s 1/1 Running 0 22m\nkube-flannel-ds-amd64-q4zsn 1/1 Running 0 21m\nkube-proxy-6jcng 1/1 Running 0 30m\nkube-proxy-bh8kh 1/1 Running 0 21m\nkube-proxy-rb9xp 1/1 Running 0 22m\nkube-proxy-srhpj 1/1 Running 0 71m\nkube-proxy-vh4lg 1/1 Running 0 38m\nkube-scheduler-k8s-master 1/1 Running 0 70m\nvsphere-cloud-controller-manager-549hb 1/1 Running 0 25s\n```\n\n### Check that all nodes are untainted\n\nVerify node.cloudprovider.kubernetes.io/uninitialized taint is removed from all nodes.\n\n```bash\n# kubectl describe nodes | egrep \"Taints:|Name:\"\nName: k8s-master\nTaints: node-role.kubernetes.io/master:NoSchedule\nName: k8s-node1\nTaints: <none>\nName: k8s-node2\nTaints: <none>\nName: k8s-node3\nTaints: <none>\nName: k8s-node4\nTaints: <none>\n```\n\nNote: If you happen to make an error with the `vsphere.conf`, simply delete the CPI components and the configMap, make any necessary edits to the configMap `vSphere.conf` file, and reapply the steps above.\n\nYou may now remove the `vsphere.conf` file created at `/etc/kubernetes/`.\n\n## Install vSphere Container Storage Interface Driver\n\nNow that the CPI is installed, we can focus on the CSI. Please visit <https://vsphere-csi-driver.sigs.k8s.io/driver-deployment/installation.html> to install vSphere CSI Driver.\n\n## Sample manifests to test CSI driver functionality\n\nThe following are some sample manifests that can be used to verify that some provisioning workflows using the vSphere CSI driver are working as expected.\n\nThe example provided here will show how to create a stateful containerized application and use the vSphere Client to access the volumes that back your application.\nThe following sample workflow shows how to deploy a MongoDB application with one replica.\n\nWhile performing the workflow tasks, you alternate the roles of a vSphere user and Kubernetes user. The tasks use the following items:\n\n* Storage class YAML file\n* MongoDB service YAML file\n* MongoDB StatefulSet YAML file\n\n### Create a Storage Policy\n\nThe virtual disk (VMDK) that will back your containerized application needs to meet specific storage requirements. As a vSphere user, you create a VM storage policy based on the requirements provided to you by the Kubernetes user.\nThe storage policy will be associated with the VMDK backing your application.\nIf you have multiple vCenter Server instances in your environment, create the VM storage policy on each instance. Use the same policy name across all instances.\n\n* In the vSphere Client, on the main landing page, select `VM Storage Policies`.\n* Under `Policies and Profiles`, select `VM Storage Policies`.\n* Click `Create VM Storage Policy`.\n* Enter the policy name and description, and click Next. For the purposes of this demonstration we will name it `Space-Efficient`.\n* On the Policy structure page under Datastore-specific rules, select `Enable rules for \"vSAN\" storage` and click Next.\n* On the vSAN page, we will keep the defaults for this policy, which is `standard cluster` and `RAID-1 (Mirroring)`.\n* On the Storage compatibility page, review the list of vSAN datastores that match this policy and click Next.\n* On the Review and finish page, review the policy settings, and click Finish.\n\n\n\nYou can now inform the Kubernetes user of the storage policy name. The VM storage policy you created will be used as a part of storage class definition for dynamic volume provisioning.\n\n### Create a StorageClass\n\nAs a Kubernetes user, define and deploy the storage class that references previously created VM storage policy. We will use kubectl to perform the following steps. Generally, you provide the information to kubectl in a YAML file. kubectl converts the information to JSON when making the API request. We will now create a StorageClass YAML file that describes storage requirements for the container and references the VM storage policy to be used. The `csi.vsphere.vmware.com` is the name of the vSphere CSI provisioner, and is what is placed in the provisioner field in the StorageClass yaml. The following sample YAML file includes the Space-Efficient storage policy that you created earlier using the vSphere Client. The resulting persistent volume VMDK is placed on a compatible datastore with the maximum free space that satisfies the Space-Efficient storage policy requirements.\n\n```bash\n# cat mongodb-storageclass.yaml\nkind: StorageClass\napiVersion: storage.k8s.io/v1\nmetadata:\n name: mongodb-sc\n annotations:\n storageclass.kubernetes.io/is-default-class: \"true\"\nprovisioner: csi.vsphere.vmware.com\nparameters:\n storagepolicyname: \"Space-Efficient\"\n fstype: ext4\n```\n\n```bash\n# kubectl create -f mongodb-storageclass.yaml\nstorageclass.storage.k8s.io/mongodb-sc created\n```\n\n```bash\n# kubectl get storageclass mongodb-sc\nNAME PROVISIONER AGE\nmongodb-sc csi.vsphere.vmware.com 5s\n```\n\n### Create a Service\n\nAs a Kubernetes user, define and deploy a Kubernetes Service. The Service provides a networking endpoint for the application.\nThe following is a sample YAML file that defines the service for the MongoDB application.\n\n```bash\n# cat mongodb-service.yaml\napiVersion: v1\nkind: Service\nmetadata:\n name: mongodb-service\n labels:\n name: mongodb-service\nspec:\n ports:\n - port: 27017\n targetPort: 27017\n clusterIP: None\n selector:\n role: mongo\n```\n\n```bash\n# kubectl create -f mongodb-service.yaml\nservice/mongodb-service created\n```\n\n```bash\n# kubectl get svc mongodb-service\nNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE\nmongodb-service ClusterIP None <none> 27017/TCP 15s\n```\n\n### Create and Deploy a StatefulSet\n\nAs a Kubernetes user, define and deploy a StatefulSet that specifies the number of replicas to be used for your application.\nFirst, create secret for the key file. MongoDB will use this key to communicate with the internal cluster.\n\n```bash\n# openssl rand -base64 741 > key.txt\n```\n\n```bash\n# kubectl create secret generic shared-bootstrap-data --from-file=internal-auth-mongodb-keyfile=key.txt\nsecret/shared-bootstrap-data created\n```\n\nNext we need to define specifications for the containerized application in the StatefulSet YAML file . The following sample specification requests one instance of the MongoDB application, specifies the external image to be used, and references the mongodb-sc storage class that you created earlier. This storage class maps to the Space-Efficient VM storage policy that you defined previously on the vSphere Client side.\n\nNote that this manifest expects that the Kubernetes node can reach the image called `mongo:3.4`. If your Kubernetes nodes are not able to reach external repositories, then this YAML file needs to be modified to reach your local internal repo. Of course, this repo also needs to contain the Mongo image. We have set the number of replicas to 3, indicating that there will be 3 Pods, 3 PVCs and 3 PVs instantiated as part of this StatefulSet.\n\n```bash\n# cat mongodb-statefulset.yaml\napiVersion: apps/v1\nkind: StatefulSet\nmetadata:\n name: mongod\nspec:\n serviceName: mongodb-service\n replicas: 3\n selector:\n matchLabels:\n role: mongo\n environment: test\n replicaset: MainRepSet\n template:\n metadata:\n labels:\n role: mongo\n environment: test\n replicaset: MainRepSet\n spec:\n containers:\n - name: mongod-container\n image: mongo:3.4\n command:\n - \"numactl\"\n - \"--interleave=all\"\n - \"mongod\"\n - \"--bind_ip\"\n - \"0.0.0.0\"\n - \"--replSet\"\n - \"MainRepSet\"\n - \"--auth\"\n - \"--clusterAuthMode\"\n - \"keyFile\"\n - \"--keyFile\"\n - \"/etc/secrets-volume/internal-auth-mongodb-keyfile\"\n - \"--setParameter\"\n - \"authenticationMechanisms=SCRAM-SHA-1\"\n resources:\n requests:\n cpu: 0.2\n memory: 200Mi\n ports:\n - containerPort: 27017\n volumeMounts:\n - name: secrets-volume\n readOnly: true\n mountPath: /etc/secrets-volume\n - name: mongodb-persistent-storage-claim\n mountPath: /data/db\n volumes:\n - name: secrets-volume\n secret:\n secretName: shared-bootstrap-data\n defaultMode: 256\n volumeClaimTemplates:\n - metadata:\n name: mongodb-persistent-storage-claim\n annotations:\n volume.beta.kubernetes.io/storage-class: \"mongodb-sc\"\n spec:\n accessModes: [ \"ReadWriteOnce\" ]\n resources:\n requests:\n storage: 1Gi\n```\n\n```bash\n# kubectl create -f mongodb-statefulset.yaml\nstatefulset.apps/mongo created\n```\n\nVerify that the MongoDB application has been deployed.\nWait for pods to start running and PVCs to be created for each replica.\n\n```bash\n# kubectl get statefulset mongod\nNAME READY AGE\nmongod 3/3 96s\n```\n\n```bash\n# kubectl get pod -l role=mongo\nNAME READY STATUS RESTARTS AGE\nmongod-0 1/1 Running 0 13h\nmongod-1 1/1 Running 0 13h\nmongod-2 1/1 Running 0 13h\n```\n\n```bash\n# kubectl get pvc\nNAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE\nmongodb-persistent-storage-claim-mongod-0 Bound pvc-ea98b22a-b8cf-11e9-b1d3-005056a0e4f0 1Gi RWO mongodb-sc 13h\nmongodb-persistent-storage-claim-mongod-1 Bound pvc-0267fa7d-b8d0-11e9-b1d3-005056a0e4f0 1Gi RWO mongodb-sc 13h\nmongodb-persistent-storage-claim-mongod-2 Bound pvc-24d86a37-b8d0-11e9-b1d3-005056a0e4f0 1Gi RWO mongodb-sc 13h\n```\n\n### Set up the Mongo replica set configuration\n\nTo setup the Mongo replica set configuration, we need to connect to one of the mongod container processes to configure the replica set.\nRun the following command to connect to the first container. In the shell, initiate the replica set. You can rely on the host names to be the same, due to having employed the StatefulSet.\n\n```bash\n# kubectl exec -it mongod-0 -c mongod-container bash\nroot@mongod-0:/# mongo\nMongoDB shell version v3.4.22\nconnecting to: mongodb://127.0.0.1:27017\nMongoDB server version: 3.4.22\nWelcome to the MongoDB shell.\nFor interactive help, type \"help\".\nFor more comprehensive documentation, see\n http://docs.mongodb.org/\nQuestions? Try the support group\n http://groups.google.com/group/mongodb-user\n> rs.initiate({_id: \"MainRepSet\", version: 1, members: [\n... { _id: 0, host : \"mongod-0.mongodb-service.default.svc.cluster.local:27017\" },\n... { _id: 1, host : \"mongod-1.mongodb-service.default.svc.cluster.local:27017\" },\n... { _id: 2, host : \"mongod-2.mongodb-service.default.svc.cluster.local:27017\" }\n... ]});\n{ \"ok\" : 1 }\n```\n\nThis makes mongodb-0 the primary node and other two nodes are secondary.\n\n### Verify Cloud Native Storage functionality is working in vSphere\n\nAfter your application gets deployed, its state is backed by the VMDK file associated with the specified storage policy. As a vSphere administrator, you can review the VMDK that is created for your container volume.\nIn this step, we will verify that the Cloud Native Storage feature released with vSphere 6.7U3 is working. To go to the CNS UI, login to the vSphere client, then navigate to Datacenter \u2192 Monitor \u2192 Cloud Native Storage \u2192 Container Volumes and observe that the newly created persistent volumes are present. These should match the `kubectl get pvc` output from earlier. You can also monitor their storage policy compliance status.\n\n\n\nThat completes the testing. CSI, CPI and CNS are all now working.\n", "meta": {"content_hash": "45327874560df60c2e202694a20a0fee", "timestamp": "", "source": "github", "line_count": 953, "max_line_length": 883, "avg_line_length": 44.92969569779643, "alnum_prop": 0.7326124527068055, "repo_name": "kubernetes/cloud-provider-vsphere", "id": "72cb5d96b9a2c02bb1625fe6cce8d2c24a68c374", "size": "42898", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/book/tutorials/kubernetes-on-vsphere-with-kubeadm.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Dockerfile", "bytes": "13339"}, {"name": "Go", "bytes": "862422"}, {"name": "Makefile", "bytes": "25413"}, {"name": "Mustache", "bytes": "1770"}, {"name": "Shell", "bytes": "39575"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html lang=\"en-us\" xml:lang=\"en-us\">\r\n<!--\n Licensed to the Apache Software Foundation (ASF) under one or more\n contributor license agreements. See the NOTICE file distributed with\n this work for additional information regarding copyright ownership.\n The ASF licenses this file to You under the Apache License, Version 2.0\n (the \"License\"); you may not use this file except in compliance with\n the License. You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\r\n<head>\r\n<meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\" />\r\n<meta name=\"copyright\" content=\"(C) Copyright 2005\" />\r\n<meta name=\"DC.rights.owner\" content=\"(C) Copyright 2005\" />\r\n<meta content=\"public\" name=\"security\" />\r\n<meta content=\"index,follow\" name=\"Robots\" />\r\n<meta http-equiv=\"PICS-Label\" content='(PICS-1.1 \"http://www.icra.org/ratingsv02.html\" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) \"http://www.rsac.org/ratingsv01.html\" l gen true r (n 0 s 0 v 0 l 0) \"http://www.classify.org/safesurf/\" l gen true r (SS~~000 1))' />\r\n<meta content=\"concept\" name=\"DC.Type\" />\r\n<meta name=\"DC.Title\" content=\"About this guide and the Network Server documentation\" />\r\n<meta scheme=\"URI\" name=\"DC.Relation\" content=\"cadminov11108.html\" />\r\n<meta scheme=\"URI\" name=\"DC.Relation\" content=\"cadminov17524.html\" />\r\n<meta content=\"XHTML\" name=\"DC.Format\" />\r\n<meta content=\"cadminov38650\" name=\"DC.Identifier\" />\r\n<meta content=\"en-us\" name=\"DC.Language\" />\r\n<link href=\"commonltr.css\" type=\"text/css\" rel=\"stylesheet\" />\r\n<title>About this guide and the Network Server documentation</title>\r\n</head>\r\n<body id=\"cadminov38650\"><a name=\"cadminov38650\"><!-- --></a>\r\n\r\n\r\n<h1 class=\"topictitle1\">About this guide and the Network Server documentation</h1>\r\n\r\n\r\n<div>\r\n<p>This guide assumes that you are familiar with <span>Derby</span> features and tuning. Before reading this guide, you should first learn about basic <span>Derby</span> functionality\r\nby reading the <cite><span><em>Derby Developer's Guide</em></span></cite>. Also, because multi-user environments typically\r\nhave performance and tuning issues, you should read <cite><span><em>Tuning Derby</em></span></cite>.</p>\r\n\r\n</div>\r\n<div>\r\n<div class=\"familylinks\">\r\n<div class=\"parentlink\"><strong>Parent topic:</strong> <a href=\"cadminov11108.html\" title=\"\">Derby in a multi-user environment</a></div>\r\n</div>\r\n<div class=\"relconcepts\"><strong>Related concepts</strong><br />\r\n<div><a href=\"cadminov17524.html\" title=\"\">Derby in a server framework</a></div>\r\n</div>\r\n</div>\r\n\r\n</body>\r\n</html>\r\n", "meta": {"content_hash": "c6f548d4af5e2bb9c99a2c88bc3f3e6f", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 261, "avg_line_length": 51.728813559322035, "alnum_prop": 0.713302752293578, "repo_name": "mminella/jsr-352-ri-tck", "id": "c9444e9e5e21f67be8e779765382e49fc95bdcae", "size": "3052", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "JSR352.BinaryDependencies/shipped/derby/docs/html/adminguide/cadminov38650.html", "mode": "33261", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "1743336"}, {"name": "Perl", "bytes": "80042"}, {"name": "Racket", "bytes": "180"}, {"name": "Ruby", "bytes": "1444"}, {"name": "Shell", "bytes": "45633"}]}} +{"text": "// Copyright 2007-2010 Baptiste Lepilleur\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED\n#define LIB_JSONCPP_JSON_TOOL_H_INCLUDED\n\n/* This header provides common string manipulation support, such as UTF-8,\n * portable conversion from/to string...\n *\n * It is an internal header that must not be exposed.\n */\n\nnamespace Json {\n\n/// Converts a unicode code-point to UTF-8.\nstatic inline std::string codePointToUTF8(unsigned int cp) {\n std::string result;\n\n // based on description from http://en.wikipedia.org/wiki/UTF-8\n\n if (cp <= 0x7f) {\n result.resize(1);\n result[0] = static_cast<char>(cp);\n } else if (cp <= 0x7FF) {\n result.resize(2);\n result[1] = static_cast<char>(0x80 | (0x3f & cp));\n result[0] = static_cast<char>(0xC0 | (0x1f & (cp >> 6)));\n } else if (cp <= 0xFFFF) {\n result.resize(3);\n result[2] = static_cast<char>(0x80 | (0x3f & cp));\n result[1] = 0x80 | static_cast<char>((0x3f & (cp >> 6)));\n result[0] = 0xE0 | static_cast<char>((0xf & (cp >> 12)));\n } else if (cp <= 0x10FFFF) {\n result.resize(4);\n result[3] = static_cast<char>(0x80 | (0x3f & cp));\n result[2] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));\n result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 12)));\n result[0] = static_cast<char>(0xF0 | (0x7 & (cp >> 18)));\n }\n\n return result;\n}\n\n/// Returns true if ch is a control character (in range [0,32[).\nstatic inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; }\n\nenum {\n /// Constant that specify the size of the buffer that must be passed to\n /// uintToString.\n uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1\n};\n\n// Defines a char buffer for use with uintToString().\ntypedef char UIntToStringBuffer[uintToStringBufferSize];\n\n/** Converts an unsigned integer to string.\n * @param value Unsigned interger to convert to string\n * @param current Input/Output string buffer.\n * Must have at least uintToStringBufferSize chars free.\n */\nstatic inline void uintToString(LargestUInt value, char*& current) {\n *--current = 0;\n do {\n *--current = char(value % 10) + '0';\n value /= 10;\n } while (value != 0);\n}\n\n/** Change ',' to '.' everywhere in buffer.\n *\n * We had a sophisticated way, but it did not work in WinCE.\n * @see https://github.com/open-source-parsers/jsoncpp/pull/9\n */\nstatic inline void fixNumericLocale(char* begin, char* end) {\n while (begin < end) {\n if (*begin == ',') {\n *begin = '.';\n }\n ++begin;\n }\n}\n\n} // namespace Json {\n\n#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED", "meta": {"content_hash": "948136242f3847cd8316adcba9e59d2b", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 80, "avg_line_length": 31.080459770114942, "alnum_prop": 0.6479289940828402, "repo_name": "Zuppka/RLG", "id": "5e66b117b96fec78e548981c6132d972678f9696", "size": "2704", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/json_tool.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "189304"}, {"name": "C++", "bytes": "1854318"}]}} +{"text": "<?php\n\n\n\nclass Cities extends Eloquent\n{\n /**\n * The database table used by the model.\n *\n * @var string\n */\n protected $table = 'cities';\n\n\n public function getList()\n {\n return DB::table('cities')->distinct()->lists('name','id');\n }\n\n public function getName()\n {\n return $this->attributes['name'];\n }\n\n}\n", "meta": {"content_hash": "b5af477c5b65a19be5e61913fb165b32", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 67, "avg_line_length": 14.44, "alnum_prop": 0.5318559556786704, "repo_name": "kamyh/ArcNotes", "id": "893b19e22f3339012410c6abd2e36a1d5dbd8127", "size": "361", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/Cities.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "7390"}, {"name": "JavaScript", "bytes": "6436"}, {"name": "PHP", "bytes": "549089"}, {"name": "Python", "bytes": "556"}]}} +{"text": "SYNONYM\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "15b4ea027ea00f2a061025cec15ac1ae", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "4ea5f07221765efd9fe7e07b3f1ae82134cfc144", "size": "186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Hordeum/Hordeum muticum/ Syn. Hordeum muticum andicola/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "ACCEPTED\n\n#### According to\nNUB Generator [autonym]\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "2fbce14ec94f9576820c9b1aade4dd66", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 23, "avg_line_length": 9.076923076923077, "alnum_prop": 0.6779661016949152, "repo_name": "mdoering/backbone", "id": "da088a8bc506c8e05d499b7124aa85fdca2b43f7", "size": "173", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Apocynaceae/Asclepias/Asclepias ovalifolia/Asclepias ovalifolia ovalifolia/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "const prerender = require('prerender')\nconst server = prerender()\nserver.start()\n", "meta": {"content_hash": "8e4986a0b7909f3324ef33525bc55ddd", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 38, "avg_line_length": 27.0, "alnum_prop": 0.7530864197530864, "repo_name": "imuntil/nodejs", "id": "d3f0f4bf0d15f0387bac88d7c049b0614c8880ae", "size": "81", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Prerender/start/server.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "110680"}, {"name": "D", "bytes": "1339"}, {"name": "HTML", "bytes": "1534621"}, {"name": "Handlebars", "bytes": "44291"}, {"name": "Java", "bytes": "393"}, {"name": "JavaScript", "bytes": "2978825"}, {"name": "Less", "bytes": "682"}, {"name": "Pug", "bytes": "21144"}, {"name": "SCSS", "bytes": "5505"}, {"name": "Shell", "bytes": "62"}, {"name": "TypeScript", "bytes": "59149"}, {"name": "Vue", "bytes": "179321"}]}} +{"text": "var test = require('tape');\nvar shell = require('shelljs');\nvar path = require('path');\nvar fs = require('fs');\n\ntest('bundle', function(t) {\n shell.cd(__dirname);\n var indexPath = path.resolve(__dirname, 'bundle_index.js');\n var cliPath = path.resolve(__dirname, '../runtimeify.js');\n var outPath = path.resolve(__dirname, 'initrd');\n\n if (shell.exec(cliPath + ' ' + indexPath).code !== 0) {\n shell.exit(1);\n }\n\n fs.statSync(outPath);\n shell.rm(outPath);\n t.end();\n});\n", "meta": {"content_hash": "bde7529e81d211f94392f31c7e049b35", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 61, "avg_line_length": 25.36842105263158, "alnum_prop": 0.6203319502074689, "repo_name": "runtimejs/runtimeify", "id": "3279384ba2466bb989ee7a5992234ea5258acf34", "size": "482", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/test.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "JavaScript", "bytes": "6364"}]}} +{"text": "title: \"Mutators\"\ndescription: \"Reference documentation for Sensu Mutators.\"\nversion: 1.1\nweight: 7\n---\n\n# Sensu Mutators\n\n## Reference documentation\n\n- [What is a Sensu mutator?](#what-is-a-sensu-mutator)\n - [The Sensu mutator specification](#the-sensu-mutator-specification)\n - [When to use a mutator](#when-to-use-a-mutator)\n- [How do Sensu mutators work?](#how-do-sensu-mutators-work)\n- [Mutator commands](#mutator-commands)\n - [What is a mutator command?](#what-is-a-mutator-command)\n - [Mutator command arguments](#mutator-command-arguments)\n - [How and where are mutator commands executed?](#how-and-where-are-mutator-commands-executed)\n- [Mutator configuration](#mutator-configuration)\n - [Example mutator definition](#example-mutator-definition)\n - [Mutator definition specification](#mutator-definition-specification)\n - [Mutator name(s)](#mutator-names)\n - [Mutator attributes](#mutator-attributes)\n\n## What are Sensu mutators? {#what-are-sensu-mutators}\n\nSensu mutators are executable scripts or other programs that modify [event\ndata][1] for [Sensu event handlers][2] which may expect additional or modified\nevent data (e.g. custom attributes that are not provided by the default [event\ndata specification][3].\n\n### The Sensu mutator specification\n\n- Accept input/data via `STDIN`\n- Able to parse a JSON data payload (i.e. a [event data][1])\n- Output JSON data (the modified event data) to `STDOUT` or `STDERR`\n- Produce an exit status code to indicate state:\n - `0` indicates OK\n - exit status codes other than `0` indicates a failure\n\n### When to use a mutator\n\nMany [Sensu event handlers][2] will modify [event data][1] in the course of\nprocessing an [event][9], and in many cases this is recommended because\nmodifying the event data and performing some action in memory (in the same\nprocess) will result in better performance than [executing a mutator][5] _and_ a\nhandler (two separate processes). However, when multiple handlers require\nsimilar event data modifications, mutators provide the ability to avoid code\nduplication (<abbr title=\"DON'T REPEAT YOURSELF!\">DRY</abbr>), and simplify\nevent handler logic.\n\n## How do Sensu mutators work?\n\nSensu mutators are applied when [event handlers][2] are configured to use a\n`mutator`. Prior to executing a Handler, the Sensu server will execute the\nconfigured `mutator`. If the mutator is successfully executed, the modified\nevent data is then provided to the handler and the handler will be executed. If\nthe mutator fails to execute for any reason, an error will be logged and the\nhandler will not be executed. The complete process may be described as follows:\n\n- When the Sensu server is processing an event, it will check for the definition\n of a `mutator`. Prior to executing each handler, the Sensu server will first\n execute the configured `mutator` (if any) for the handler\n- If the mutator is successfully executed (i.e. if it returns an exit status\n code of `0`), the modified event data is provided to the handler and the\n handler will be executed.\n- If the mutator fails to execute (i.e. returns a non-zero exit status code, or\n does not complete execution within the configured `timeout`), an error will be\n logged and the handler will not be executed\n\nPlease refer to the [Sensu event handler definition specification][8] for more\ninformation about applying a mutator to an event handler (see the `mutator`\nattribute).\n\n## Mutator commands\n\n### What is a mutator command?\n\nEach [Sensu mutator definition][6] defines a command to be executed. Mutator\ncommands are literally executable commands which will be executed on a [Sensu\nserver][4], run as the `sensu` user. Most mutator commands are provided by\n[Sensu plugins][7].\n\n### Mutator command arguments\n\nSensu mutator `command` attributes may include command line arguments for\ncontrolling the behavior of the `command` executable. Many [Sensu mutator\nplugins][7] provide support for command line arguments for reusability.\n\n### How and where are mutator commands executed?\n\nAs mentioned above, all mutator commands are executed by a [Sensu server][4] as\nthe `sensu` user. Commands must be executable files that are discoverable on the\nSensu server system (i.e. installed in a system `$PATH` directory).\n\n_NOTE: By default, the Sensu installer packages will modify the system `$PATH`\nfor the Sensu processes to include `/etc/sensu/plugins`. As a result, executable\nscripts (e.g. plugins) located in `/etc/sensu/plugins` will be valid commands.\nThis allows `command` attributes to use \"relative paths\" for Sensu plugin\ncommands;<br><br>e.g.: `\"command\": \"check-http.rb -u https://sensuapp.org\"`_\n\n## Mutator configuration\n\n### Example mutator definition\n\nThe following is an example Sensu mutator definition, a JSON configuration file\nlocated at `/etc/sensu/conf.d/example_mutator.json`. This mutator definition\nuses an imaginary [Sensu plugin][7] called `example_mutator.rb` to modify event\ndata prior to handling the event.\n\n~~~ json\n{\n \"mutators\": {\n \"example_mutator\": {\n \"command\": \"example_mutator.rb\"\n }\n }\n}\n~~~\n\n### Mutator definition specification\n\n#### Mutator name(s)\n\nEach mutator definition has a unique mutator name, used for the definition key.\nEvery mutator definition is within the `\"mutators\": {}` definition scope.\n\n- A unique string used to name/identify the mutator\n- Cannot contain special characters or spaces\n- Validated with [Ruby regex][10] `/^[\\w\\.-]+$/.match(\"mutator-name\")`\n\n#### Mutator attributes\n\n`command`\n: description\n : The mutator command to be executed. The event data is passed to the process\n via `STDIN`.\n: required\n : true\n: type\n : String\n: example\n : ~~~ shell\n \"command\": \"/etc/sensu/plugins/mutated.rb\"\n ~~~\n\n`timeout`\n: description\n : The mutator execution duration timeout in seconds (hard stop).\n: required\n : false\n: type\n : Integer\n: example\n : ~~~ shell\n \"timeout\": 30\n ~~~\n\n[1]: events.html#event-data\n[2]: handlers.html\n[3]: events.html#event-data-specification\n[4]: server.html\n[5]: #how-and-where-are-mutator-commands-executed\n[6]: #mutator-definition-specification\n[7]: plugins.html\n[8]: handlers.html#handler-definition-specification\n[9]: events.html\n[10]: http://ruby-doc.org/core-2.2.0/Regexp.html\n", "meta": {"content_hash": "0db453126667cf7c39a9fc117f5c259d", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 96, "avg_line_length": 37.220238095238095, "alnum_prop": 0.7454022069406685, "repo_name": "palourde/sensu-docs", "id": "66bb9d3b8e678bf43db952808fbb1c9ce3dc111b", "size": "6257", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/1.1/reference/mutators.md", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "74696"}, {"name": "Shell", "bytes": "12056"}]}} +{"text": "\npackage com.mgmtp.perfload.core.client.web.flow;\n\nimport static com.mgmtp.perfload.core.common.util.LtUtils.checkInterrupt;\n\nimport java.util.List;\nimport java.util.ListIterator;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.UUID;\n\nimport javax.inject.Inject;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport com.mgmtp.perfload.core.client.config.annotations.ExecutionId;\nimport com.mgmtp.perfload.core.client.config.scope.ExecutionScoped;\nimport com.mgmtp.perfload.core.client.runner.ErrorHandler;\nimport com.mgmtp.perfload.core.client.util.PlaceholderContainer;\nimport com.mgmtp.perfload.core.client.util.WaitingTimeManager;\nimport com.mgmtp.perfload.core.client.web.event.RequestFlowEvent;\nimport com.mgmtp.perfload.core.client.web.event.RequestFlowEventListener;\nimport com.mgmtp.perfload.core.client.web.request.InvalidRequestHandlerException;\nimport com.mgmtp.perfload.core.client.web.request.RequestHandler;\nimport com.mgmtp.perfload.core.client.web.response.DetailExtractor;\nimport com.mgmtp.perfload.core.client.web.response.HeaderExtractor;\nimport com.mgmtp.perfload.core.client.web.response.ResponseInfo;\nimport com.mgmtp.perfload.core.client.web.response.ResponseValidator;\nimport com.mgmtp.perfload.core.client.web.template.RequestTemplate;\nimport com.mgmtp.perfload.core.client.web.template.TemplateTransformer;\n\n/**\n * Default implementation of a {@link RequestFlowHandler}. It handles the complete logic for a run\n * of a Web load test and fires {@link RequestFlowEvent}s before and after request flows and before\n * and after requests. The \"after\" events are fired in {@code finally} blocks so that they are also\n * triggered in case of an exception. The exception will then be available through the\n * {@link RequestFlowEvent}.\n *\n * @author rnaegele\n */\n@ExecutionScoped\npublic final class DefaultRequestFlowHandler implements RequestFlowHandler {\n\tprivate final Logger log = LoggerFactory.getLogger(getClass());\n\n\tprivate final Map<String, RequestHandler> requestHandlers;\n\tprivate final List<RequestFlow> requestFlows;\n\tprivate final TemplateTransformer templateTransformer;\n\tprivate final ResponseValidator responseValidator;\n\tprivate final DetailExtractor detailExtractor;\n\tprivate final HeaderExtractor headerExtractor;\n\tprivate final WaitingTimeManager waitingTimeManager;\n\tprivate final PlaceholderContainer placeholderContainer;\n\tprivate final Set<RequestFlowEventListener> listeners;\n\tprivate final ErrorHandler errorHandler;\n\tprivate final UUID executionId;\n\n\t/**\n\t * Constructs a new instance.\n\t *\n\t * @param requestFlows\n\t * the list of {@link RequestFlow}s to be processed\n\t * @param requestHandlers\n\t * a map of {@link RequestHandler}s; must contain a request handler for each type of\n\t * request in the request flow\n\t * @param templateTransformer\n\t * the {@link TemplateTransformer} used to make request template executable\n\t * @param responseValidator\n\t * the {@link ResponseValidator} for validating the HTTP reponses\n\t * @param detailExtractor\n\t * the {@link DetailExtractor} for extracting details from the reponse bodies\n\t * @param headerExtractor\n\t * the {@link HeaderExtractor} for extracting headers from the reponses\n\t * @param waitingTimeManager\n\t * the {@link WaitingTimeManager} that introduces a waiting time as configured before\n\t * each request\n\t * @param placeholderContainer\n\t * the {@link PlaceholderContainer}\n\t * @param listeners\n\t * a set of {@link RequestFlowEventListener}s\n\t * @param errorHandler\n\t * the error handler which determines whether and exception should lead to the\n\t * abortion of the whole test\n\t * @param executionId\n\t * the execution id\n\t */\n\t@Inject\n\tpublic DefaultRequestFlowHandler(final List<RequestFlow> requestFlows, final Map<String, RequestHandler> requestHandlers,\n\t\t\tfinal TemplateTransformer templateTransformer, final ResponseValidator responseValidator,\n\t\t\tfinal DetailExtractor detailExtractor, final HeaderExtractor headerExtractor,\n\t\t\tfinal WaitingTimeManager waitingTimeManager, final PlaceholderContainer placeholderContainer,\n\t\t\tfinal Set<RequestFlowEventListener> listeners, final ErrorHandler errorHandler, @ExecutionId final UUID executionId) {\n\t\tthis.requestFlows = requestFlows;\n\t\tthis.requestHandlers = requestHandlers;\n\t\tthis.templateTransformer = templateTransformer;\n\t\tthis.responseValidator = responseValidator;\n\t\tthis.detailExtractor = detailExtractor;\n\t\tthis.headerExtractor = headerExtractor;\n\t\tthis.waitingTimeManager = waitingTimeManager;\n\t\tthis.placeholderContainer = placeholderContainer;\n\t\tthis.listeners = listeners;\n\t\tthis.errorHandler = errorHandler;\n\t\tthis.executionId = executionId;\n\t}\n\n\t@Override\n\tpublic void execute() throws Exception {\n\t\tException exception = null;\n\n\t\tfor (ListIterator<RequestFlow> it = requestFlows.listIterator(); it.hasNext();) {\n\t\t\tRequestFlow requestFlow = it.next();\n\t\t\t// 1-based index, so we use \"nextIndex()\"\n\t\t\tint flowIndex = it.nextIndex();\n\n\t\t\ttry {\n\t\t\t\t// fire event\n\t\t\t\tfireBeforeRequestFlow(flowIndex);\n\n\t\t\t\t// process requests\n\t\t\t\tfor (final RequestTemplate template : requestFlow) {\n\n\t\t\t\t\tRequestTemplate executableTemplate = null;\n\t\t\t\t\tResponseInfo responseInfo = null;\n\t\t\t\t\tUUID requestId = UUID.randomUUID();\n\t\t\t\t\ttry {\n\t\t\t\t\t\twaitingTimeManager.sleepBeforeRequest();\n\n\t\t\t\t\t\t// check for interrupt and abort if necessary\n\t\t\t\t\t\tcheckInterrupt();\n\n\t\t\t\t\t\t// fire event, also called for skipped requests, because event handler may decide whether to skip\n\t\t\t\t\t\t// must be called before the template is made executable, so parameters\n\t\t\t\t\t\t// can be put into the placeholder container\n\t\t\t\t\t\tfireBeforeRequest(flowIndex, template);\n\n\t\t\t\t\t\texecutableTemplate = templateTransformer.makeExecutable(template, placeholderContainer);\n\t\t\t\t\t\tif (executableTemplate.isSkipped()) {\n\t\t\t\t\t\t\tlog.info(\"Skipping request: {}\", executableTemplate);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlog.debug(\"Executing request template: {}\", executableTemplate);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// look up request handler for the request's type\n\t\t\t\t\t\tString type = template.getType();\n\t\t\t\t\t\tRequestHandler handler = requestHandlers.get(type);\n\t\t\t\t\t\tif (handler == null) {\n\t\t\t\t\t\t\tthrow new InvalidRequestHandlerException(String.format(\"No request handler for type '%s' available.\",\n\t\t\t\t\t\t\t\t\ttype));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresponseInfo = handler.execute(executableTemplate, requestId);\n\t\t\t\t\t\tif (responseInfo != null) {\n\t\t\t\t\t\t\tlog.debug(responseInfo.toString());\n\n\t\t\t\t\t\t\t// process response\n\t\t\t\t\t\t\tif (executableTemplate.isValidateResponse()) {\n\t\t\t\t\t\t\t\tresponseValidator.validate(responseInfo);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdetailExtractor.extractDetails(responseInfo, executableTemplate.getDetailExtractions(),\n\t\t\t\t\t\t\t\t\tplaceholderContainer);\n\t\t\t\t\t\t\theaderExtractor.extractHeaders(responseInfo, executableTemplate.getHeaderExtractions(),\n\t\t\t\t\t\t\t\t\tplaceholderContainer);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\texception = ex;\n\n\t\t\t\t\t\t// Handle error. Depending on the exception, the error handler may choose to abort the test.\n\t\t\t\t\t\terrorHandler.execute(ex);\n\n\t\t\t\t\t\tif (responseInfo != null) {\n\t\t\t\t\t\t\t// In case of an error we additionally log the response info at warn level\n\t\t\t\t\t\t\tlog.warn(responseInfo.toString());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// In any case, we don't want to execute the remainder of\n\t\t\t\t\t\t// the current request flow if an exception occurred and break out of the loop.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tRequestTemplate template4Event = executableTemplate != null ? executableTemplate : template;\n\t\t\t\t\t\t// ResponseInfo is null the request is skipped of if an exception occurs when the HttpClient executes\n\t\t\t\t\t\t// the request. In order to make sure that we still get an entry in the measuring log in the case of and\n\t\t\t\t\t\t// exceptiohn, we need to create one. However, it must remain null, when the request is skipped in\n\t\t\t\t\t\t// order to avoid an entry in the measuring log.\n\t\t\t\t\t\tif (responseInfo == null && executableTemplate != null && !executableTemplate.isSkipped()) {\n\t\t\t\t\t\t\tresponseInfo = new ResponseInfo.Builder()\n\t\t\t\t\t\t\t\t\t.methodType(template4Event.getType())\n\t\t\t\t\t\t\t\t\t.uri(template4Event.getUri())\n\t\t\t\t\t\t\t\t\t.uriAlias(template4Event.getUriAlias())\n\t\t\t\t\t\t\t\t\t.timestamp(System.currentTimeMillis())\n\t\t\t\t\t\t\t\t\t.executionId(executionId)\n\t\t\t\t\t\t\t\t\t.requestId(requestId)\n\t\t\t\t\t\t\t\t\t.build();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// always fire event, including skipped requests\n\t\t\t\t\t\tfireAfterRequest(flowIndex, template4Event, exception, responseInfo);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\texception = ex;\n\t\t\t\terrorHandler.execute(ex);\n\t\t\t} finally {\n\n\t\t\t\t// fire event\n\t\t\t\tfireAfterRequestFlow(flowIndex, exception);\n\t\t\t}\n\n\t\t\t// In case of an exception, we don't want to execute potential subsequent request flows.\n\t\t\tif (exception != null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void fireBeforeRequestFlow(final int flowIndex) {\n\t\tRequestFlowEvent event = new RequestFlowEvent(flowIndex);\n\t\tlog.debug(\"fireBeforeRequestFlow: {}\", event);\n\t\tfor (RequestFlowEventListener listener : listeners) {\n\t\t\tlog.debug(\"Executing listener: {}\", listener);\n\t\t\tlistener.beforeRequestFlow(event);\n\t\t}\n\t}\n\n\tprivate void fireAfterRequestFlow(final int flowIndex, final Exception ex) {\n\t\tRequestFlowEvent event = new RequestFlowEvent(flowIndex, ex);\n\t\tlog.debug(\"fireAfterRequestFlow: {}\", event);\n\t\tfor (RequestFlowEventListener listener : listeners) {\n\t\t\tlog.debug(\"Executing listener: {}\", listener);\n\t\t\tlistener.afterRequestFlow(event);\n\t\t}\n\t}\n\n\tprivate void fireBeforeRequest(final int flowIndex, final RequestTemplate template) {\n\t\tRequestFlowEvent event = new RequestFlowEvent(flowIndex, template);\n\t\tlog.debug(\"fireBeforeRequestTemplate: {}\", event);\n\t\tfor (RequestFlowEventListener listener : listeners) {\n\t\t\tlog.debug(\"Executing listener: {}\", listener);\n\t\t\tlistener.beforeRequest(event);\n\t\t}\n\t}\n\n\tprivate void fireAfterRequest(final int flowIndex, final RequestTemplate template,\n\t\t\tfinal Exception ex, final ResponseInfo responseInfo) {\n\t\tRequestFlowEvent event = new RequestFlowEvent(flowIndex, template, ex, responseInfo);\n\t\tlog.debug(\"fireAfterRequestTemplate: {}\", event);\n\t\tfor (RequestFlowEventListener listener : listeners) {\n\t\t\tlog.debug(\"Executing listener: {}\", listener);\n\t\t\tlistener.afterRequest(event);\n\t\t}\n\t}\n}\n", "meta": {"content_hash": "3ec8aceb24096942fdf3d7cf0699be7c", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 122, "avg_line_length": 40.78968253968254, "alnum_prop": 0.7367448195349742, "repo_name": "mgm-tp/perfload-core", "id": "c4111ae0037ebc5d72c69b0036eaa04d012161f4", "size": "10899", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "perfload-client/src/main/java/com/mgmtp/perfload/core/client/web/flow/DefaultRequestFlowHandler.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "3125"}, {"name": "Java", "bytes": "623964"}, {"name": "Shell", "bytes": "2729"}]}} +{"text": "declare namespace CodeceptJS {\n export interface I {\n createCitizenUser: () => string\n createSolicitorUser: () => Promise<string>\n deleteUser: (email) => Promise<void>\n deleteUsers: (emails) => Promise<void>\n createClaim: (claimData: ClaimData, submitterEmail: string) => string\n linkDefendantToClaim: (referenceNumber: string, ownerEmail: string, defendantEmail: string) => void\n respondToClaim: (referenceNumber: string, ownerEmail: string, responseData: ResponseData, defendantEmail: string) => void\n\n amOnLegalAppPage: (path: string) => void\n waitForLegalAppPage: (path?: string) => void\n downloadPDF: (pdfUrl: string, sessionCookie: string) => Promise<void>\n attachFile: (locator: string, path: string) => any\n grabAttributeFrom: (locator: string, attr: string) => any\n\n fillField: (locator: string | object, value: string) => any\n selectOption: (select: string, option: string) => any\n }\n}\n\ntype CodeceptJSHelper = {\n _before: () => void;\n _after: () => void;\n}\n\ndeclare const codecept_helper: { new(): CodeceptJSHelper }\n\ndeclare function session(selector: string, callback: Function): Promise<any>;\ndeclare function session(selector: string, config: any, callback: Function): Promise<any>;\n", "meta": {"content_hash": "13d0e3ccbcf6f9ad669ab0106c374736", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 125, "avg_line_length": 41.46666666666667, "alnum_prop": 0.7065916398713826, "repo_name": "hmcts/cmc-legal-rep-frontend", "id": "f89264741b284cb589edcccc79afd1c40749a966", "size": "1244", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "types/steps-override.d.ts", "mode": "33188", "license": "mit", "language": [{"name": "Dockerfile", "bytes": "909"}, {"name": "Groovy", "bytes": "2124"}, {"name": "HCL", "bytes": "1611"}, {"name": "JavaScript", "bytes": "16357"}, {"name": "Nunjucks", "bytes": "86720"}, {"name": "SCSS", "bytes": "10124"}, {"name": "Shell", "bytes": "4590"}, {"name": "TypeScript", "bytes": "682938"}]}} +{"text": "from collections import namedtuple\nfrom datetime import datetime\n\nfrom scopus.classes import Retrieval\n\n\nclass CitationOverview(Retrieval):\n @property\n def authors(self):\n \"\"\"A list of namedtuples storing author information,\n where each namedtuple corresponds to one author.\n The information in each namedtuple is (name surname initials id url).\n All entries are strings.\n \"\"\"\n out = []\n order = 'name surname initials id url'\n auth = namedtuple('Author', order)\n for author in self._citeInfoMatrix.get('author'):\n author = {k.split(\":\", 1)[-1]: v for k, v in author.items()}\n new = auth(name=author.get('index-name'), id=author.get('authid'),\n surname=author.get('surname'),\n initials=author.get('initials'),\n url=author.get('author-url'))\n out.append(new)\n return out or None\n\n @property\n def cc(self):\n \"\"\"List of tuples of yearly number of citations\n for specified years.\"\"\"\n _years = range(self._start, self._end+1)\n try:\n return list(zip(_years, [d.get('$') for d in self._citeInfoMatrix['cc']]))\n except AttributeError: # No citations\n return list(zip(_years, [0]*len(_years)))\n\n @property\n def citationType_long(self):\n \"\"\"Type (long version) of the abstract (e.g. article, review).\"\"\"\n return self._citeInfoMatrix.get('citationType', {}).get('$')\n\n @property\n def citationType_short(self):\n \"\"\"Type (short version) of the abstract (e.g. ar, re).\"\"\"\n return self._citeInfoMatrix.get('citationType', {}).get('@code')\n\n @property\n def doi(self):\n \"\"\"Document Object Identifier (DOI) of the abstract.\"\"\"\n return self._identifierlegend.get('doi')\n\n @property\n def endingPage(self):\n \"\"\"Ending page.\"\"\"\n return self._citeInfoMatrix.get('endingPage')\n\n @property\n def h_index(self):\n \"\"\"h-index of ciations of the abstract (according to Scopus).\"\"\"\n return self._data['h-index']\n\n @property\n def issn(self):\n \"\"\"ISSN of the publisher.\n Note: If E-ISSN is known to Scopus, this returns both\n ISSN and E-ISSN in random order separated by blank space.\n \"\"\"\n return self._citeInfoMatrix.get('issn')\n\n @property\n def issueIdentifier(self):\n \"\"\"Issue number for abstract.\"\"\"\n return self._citeInfoMatrix.get('issueIdentifier')\n\n @property\n def lcc(self):\n \"\"\"Number of citations the abstract received\n after the specified end year.\n \"\"\"\n return self._citeInfoMatrix.get('lcc')\n\n @property\n def pcc(self):\n \"\"\"Number of citations the abstract received\n before the specified start year.\n \"\"\"\n return self._citeInfoMatrix.get('pcc')\n\n @property\n def pii(self):\n \"\"\"The Publication Item Identifier (PII) of the abstract.\"\"\"\n return self._identifierlegend.get('pii')\n\n @property\n def publicationName(self):\n \"\"\"Name of source the abstract is published in (e.g. the Journal).\"\"\"\n return self._citeInfoMatrix.get('publicationName')\n\n @property\n def scopus_id(self):\n \"\"\"The Scopus ID of the abstract. It is the second part of an EID.\n The Scopus ID might differ from the one provided.\n \"\"\"\n return self._identifierlegend.get('scopus_id')\n\n @property\n def startingPage(self):\n \"\"\"Starting page.\"\"\"\n return self._citeInfoMatrix.get('startingPage')\n\n @property\n def rangeCount(self):\n \"\"\"Number of citations for specified years.\"\"\"\n return self._citeInfoMatrix.get('rangeCount')\n\n @property\n def rowTotal(self):\n \"\"\"Number of citations (specified and omitted years).\"\"\"\n return self._citeInfoMatrix.get('rowTotal')\n\n @property\n def title(self):\n \"\"\"Abstract title.\"\"\"\n return self._citeInfoMatrix.get('title')\n\n @property\n def url(self):\n \"\"\"URL to Citation Overview API view of the abstract.\"\"\"\n return self._citeInfoMatrix.get('url')\n\n @property\n def volume(self):\n \"\"\"Volume for the abstract.\"\"\"\n return self._citeInfoMatrix.get('volume')\n\n def __init__(self, eid, start, end=datetime.now().year, refresh=False):\n \"\"\"Class to represent the results from a Scopus Citation Overview.\n See https://api.elsevier.com/documentation/guides/AbstractCitationViews.htm.\n\n Parameters\n ----------\n eid : str\n The EID of the abstract.\n\n start : str or int\n The first year for which the citation count should be loaded\n\n end : str or int (optional, default=datetime.now().year)\n The last year for which the citation count should be loaded.\n Default is the current year.\n\n refresh : bool (optional, default=False)\n Whether to refresh the cached file if it exists or not.\n\n Notes\n -----\n The files are cached in ~/.scopus/citation_overview/STANDARD/{eid}.\n Your API Key needs to be approved by Elsevier to access this API.\n \"\"\"\n # Variables\n self._start = int(start)\n self._end = int(end)\n view = \"STANDARD\" # In case Scopus adds different views in future\n\n # Get file content\n date = '{}-{}'.format(start, end)\n Retrieval.__init__(self, eid, 'CitationOverview', refresh, view=view,\n date=date)\n self._data = self._json['abstract-citations-response']\n\n # citeInfoMatrix\n m = self._data['citeInfoMatrix']['citeInfoMatrixXML']['citationMatrix']['citeInfo'][0]\n self._citeInfoMatrix = _parse_dict(m)\n # identifier-legend\n l = self._data['identifier-legend']['identifier'][0]\n self._identifierlegend = _parse_dict(l)\n # citeColumnTotalXML\n self._citeColumnTotalXML = self._data['citeColumnTotalXML'] # not used\n\n def __str__(self):\n \"\"\"Return a summary string.\"\"\"\n authors = [a.name for a in self.authors]\n if len(authors) > 1:\n authors[-1] = \" and \".join([authors[-2], authors[-1]])\n s = \"Document '{self.title}' by {authors} published in \"\\\n \"'{self.publicationName}' has the following citation trajectory \"\\\n \"for years {self._start} to {self._end}:\\n\"\\\n \"{self.cc}\\n\"\\\n \"Additionally cited {self.pcc} times before {self._start}, and \"\\\n \"{self.lcc} times after {self._end}\".format(\n self=self, authors=\", \".join(authors))\n return s\n\n\ndef _parse_dict(dct):\n \"\"\"Auxiliary function to change the keys of a dictionary.\"\"\"\n return {k.split(\":\", 1)[-1]: v for k, v in dct.items()}\n", "meta": {"content_hash": "12c6f57bb5dd4496acb1d1dbed409ae3", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 94, "avg_line_length": 34.63959390862944, "alnum_prop": 0.5943728018757327, "repo_name": "scopus-api/scopus", "id": "7cfb19dc03b943ee876da79e64ee6355ef17eec7", "size": "6824", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scopus/abstract_citations.py", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "133243"}]}} +{"text": "taxer\n=====\n[](https://travis-ci.org/teracyhq/taxer)\n[](https://coveralls.io/github/teracyhq/taxer?branch=develop)\n[](https://codeclimate.com/github/teracyhq/taxer)\n\n\nuniversal tax calculator javascript library to calculate all kinds of taxes through out the world.\n\nLibrary Architecture\n--------------------\n\nIt's designed with plugin mechanism and minimalist in mind. By default:\n\n```js\nconst taxer = new Taxer();\ntaxer.use(new CustomCalctor());\nconst taxInfo = taxer.calc(countryCode, income, options);\n```\n\nin which:\n\nCustomCalctor should be a class implements Calctor interface which has:\n- isMatched(countryCode, taxableIncome, options) method: to be hooked up if it is the first to return true.\n- calc(taxableIncome, options) method: the taxInfo is calculated and returned.\n\nIf no matched calculator, an error will be thrown.\n\nFor example:\n\n```js\n\nexport default class VnCalctor {\n constructor() {\n }\n\n calc(taxableIncome, options={}) {\n return {\n taxableIncome: taxableIncome\n }\n }\n\n isMatched(countryCode, income, options) {\n if (typeof countryCode === 'string') {\n countryCode = countryCode.toLowerCase();\n }\n return ['vn', 'vnm', 704, 'vietnam', 'viet nam'].indexOf(countryCode) > -1;\n }\n\n // required by exector under the hood, usually ignored by calctors\n exec() {\n return undefined;\n }\n}\n```\n\nFor easier implementation, we should extend the base class Calctor, as the following:\n\n```js\n\nimport { Calctor } from 'taxer';\n\n\nexport default class VnCalctor extends Calctor {\n get currency() {\n return 'VND';\n }\n\n get supportedCountryCodes() {\n return ['vn', 'vnm', 704, 'vietnam', 'viet nam'];\n }\n\n doMonthlyGrossPayrollCalc(income, options) {\n return monthlyPayrollProgressiveCalctor.calc(income, options);\n }\n\n doYearlyGrossPayrollCalc(income, options) {\n return yearlyPayrollProgressiveCalctor.calc(income, options);\n }\n\n doMonthlyNetPayrollCalc(income, options) {\n return monthlyPayrollProgressiveCalctor.calc(income, options);\n }\n\n doYearlyNetPayrollCalc(income, options) {\n return yearlyPayrollProgressiveCalctor.calc(income, options);\n }\n}\n\n```\n\nThat's how the library architecture works.\n\n\nHow to use\n----------\n\n1. Configure\n\n 1.1. From the default taxer with built-in tax calculators:\n\n ```js\n const taxer = defaultTaxer();\n // add more custom calculator\n taxer.use(new CustomCalctor(options));\n ```\n\n 1.2. From scratch\n\n ```js\n const taxer = new Taxer();\n taxer.use(VnCalctor());\n taxer.use(UsaCalctor());\n taxer.use(SgCalctor());\n taxer.use(CustomCalctor(options));\n ```\n\n2. Use\n\n```js\nconst taxInfo = taxer.calc(countryCode, income, options);\nconsole.log(taxInfo);\n```\n\n\nHow to develop\n--------------\n\nThis is the minimalist plugin architecture inspired by express.js and koa.js a lot.\nLet's keep it as minimal and lightweight as possible.\n\nClone this repository and:\n\n```\n$ npm install\n$ npm run test\n```\n\nOr with Docker:\n\n```\n$ docker-compose up\n```\n\nHow to contribute\n-----------------\n\nBy writing custom tax plugins to create a good solid universal tax system throughout the world.\n\nFollow Teracy workflow: http://dev.teracy.org/docs/workflow.html\n\n\nReferences\n----------\n\nThese are related similar projects we should take a look:\n\n- https://github.com/rkh/income-tax\n\n- https://www.npmjs.com/package/uk-income-tax\n\n\nLicense\n-------\nMIT license. See LICENSE file.\n", "meta": {"content_hash": "95ed2cf3f49d345c7c8a7023a5203579", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 154, "avg_line_length": 21.903030303030302, "alnum_prop": 0.7047592695074709, "repo_name": "teracyhq/taxer", "id": "17aeb699df5e3c2473606bd3e901bad19c310fed", "size": "3614", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "70665"}]}} +{"text": "ACCEPTED\n\n#### According to\nInternational Plant Names Index\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "4694f1d12a3d5887668ae1f505b24542", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "7837baa18f220933aadbcb5818aa6a8008db5d31", "size": "171", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Polygonaceae/Rumex/Rumex hagensis/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "/**\n * @author Nidin Vinayakan\n */\nmodule nid{\n export function saveAs(data:any,name:string=\"Unnamed\"){\n var blob = new Blob([data],{type: 'application/octet-binary'});\n var url = URL.createObjectURL(blob);\n var save_link:any = document.createElementNS(\"http://www.w3.org/1999/xhtml\", \"a\");\n save_link.href = url;\n save_link.download = name;\n var event:any = document.createEvent(\"MouseEvents\");\n event.initMouseEvent(\n \"click\", true, false, null, 0, 0, 0, 0, 0\n , false, false, false, false, 0, null\n );\n save_link.dispatchEvent(event);\n }\n}\n", "meta": {"content_hash": "0513ceb82eee2d854878ef2ed195398b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 90, "avg_line_length": 35.22222222222222, "alnum_prop": 0.5883280757097792, "repo_name": "nidin/TS-ImageLibrary", "id": "5fa5845cf6a2df0a488087ae19a39f3f2e1e5a96", "size": "634", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/nid/utils/FileUtils.ts", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "1087"}, {"name": "JavaScript", "bytes": "268980"}, {"name": "TypeScript", "bytes": "44439"}]}} +{"text": "\n\nexport * from \"./src/CodeCompletionCore\";\nexport * from \"./src/SymbolTable\";\n", "meta": {"content_hash": "48e7fecea4e513a3ee50133c1f55da34", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 41, "avg_line_length": 19.75, "alnum_prop": 0.6962025316455697, "repo_name": "mike-lischke/antlr4-c3", "id": "a6567adcd01e3762430347e01f420034f4d80e89", "size": "212", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.ts", "mode": "33188", "license": "mit", "language": [{"name": "ANTLR", "bytes": "30037"}, {"name": "C#", "bytes": "43645"}, {"name": "C++", "bytes": "18356"}, {"name": "Java", "bytes": "39569"}, {"name": "TypeScript", "bytes": "125622"}]}} +{"text": "var dialog = function(opt){\n if(typeof opt.content == \"string\" || opt.content instanceof jQuery){\n $(\"#dialog .content\").html(opt.content);\n }\n else{\n $(\"#dialog .content\").html(content());\n }\n\n $(\"#dialogBackground\").css(\"display\", \"block\");\n\n $(\"#dialogConfirm\").click(function(){\n if(opt.confirm != undefined &&\n typeof opt.confirm == \"function\"){\n if(!opt.confirm()){\n return;\n }\n }\n\n $(\"#dialogBackground\").css(\"display\", \"none\");\n $(this).unbind(\"click\");\n });\n\n $(\"#dialogCancel\").click(function(){\n if(opt.cancel != undefined &&\n typeof opt.cancel == \"function\"){\n opt.cancel();\n }\n\n $(\"#dialogBackground\").css(\"display\", \"none\");\n $(this).unbind(\"click\");\n });\n}\n\nvar logAppend = function(text){\n $(\"#logArea\").append(text + \"</br>\");\n document.getElementById('logArea').scrollTop = document.getElementById('logArea').scrollHeight;\n}\n\n\nvar warnning = function(content){\n if(typeof content == \"string\" || content instanceof jQuery){\n $(\"#warnning .content\").html(content);\n }\n else{\n $(\"#warnning .content\").html(content());\n }\n\n $(\"#warnningBackground\").css(\"display\", \"block\");\n\n $(\"#warnningConfirm\").click(function(){\n $(\"#warnningBackground\").css(\"display\", \"none\");\n $(this).unbind(\"click\");\n });\n}", "meta": {"content_hash": "94ce361cdedd7087198a6c752a211320", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 99, "avg_line_length": 26.555555555555557, "alnum_prop": 0.5355648535564853, "repo_name": "liuzip/delve", "id": "b3c2fd0e32acfa57ad0b8e6ef8f9e467c52e3eb3", "size": "1434", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "assets/js/common.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "3136"}, {"name": "HTML", "bytes": "10701"}, {"name": "JavaScript", "bytes": "564079"}]}} +{"text": "Google Code Veterans 2013\n=========================\n\n## Problems\n* Hedgemony\n* Baby Height\n* Ocean View\n", "meta": {"content_hash": "0e93a685b21de319fc3c517657a37733", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 25, "avg_line_length": 14.857142857142858, "alnum_prop": 0.5576923076923077, "repo_name": "jdavis/code-jelly", "id": "5652f923b321da9865e40e5bef3c91c0ef1b9570", "size": "104", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "veterans2013/README.md", "mode": "33188", "license": "mit", "language": [{"name": "C++", "bytes": "9699"}]}} +{"text": "// ===\n// \t\tDaisy Chain!\n//\t\t\t\t\t\t===\n\n// * unhappy daisies in Opera Browser due to rendering glitch\n\n// properties\n// var\n//width, height,\n\n// plot\npi = Math.PI;\n//horizon,\n//block,\n\n// palette\n//sky;\n\n// body width, 3:1 ratio\nc.width = width = b.clientWidth;\nc.height = height = width / 3;\n\n// set plot\nhorizon = height * 0.2;\nblock = 10;\n\n// set sky drop\nsky = a.createLinearGradient(0, 0, 0, height);\nsky.addColorStop(0, '#0FF');\nsky.addColorStop(1, '#00F');\n\n// set fill to sky\na.fillStyle = sky;\na.fillRect(0, 0, width, height);\n\n/**\n *\tGenerate random number.\n *\t@param {Number} min Minimum number to generate\n *\t@param {Number} max Maximum number to generate\n */\nfunction random_(min, max) {\n\t// _.random()\n\treturn min + Math.floor(Math.random() * (max - min + 1));\n}\n\n/**\n *\tIntelligently render on framerate intervals. (reduces lag)\n *\t@param {Function} frame Callback function to generate frame\n */\nfunction render_(frame) {\n\t// requestAnimationFrame shim (@paul_irish)\n\t(window.requestAnimationFrame ||\n\t\twindow.webkitRequestAnimationFrame ||\n\t\twindow.mozRequestAnimationFrame ||\n\t\tfunction(fn){\n\t\t\twindow.setTimeout(fn, 1000 / 60);\n\t\t})(frame);\n}\n\n/**\n *\tBlossoms a daisy!\n */\nfunction blossom() {\n\t// set scope\n\tvar multiplier, posMultiplier,\n\t\tstartX, startY,\n\t\tstopX, stopY,\n\t\tctrlX, ctrlY,\n\t\tdeltaX, deltaY,\n\t\tdiffX, diffY,\n\t\tposX, posY;\n\n\t// set random multiplier, determines size\n\tposMultiplier = 0;\n\tmultiplier = random_(5, (horizon * 3) / block);\n\n\t// set where to start\n\tposX = startX = random_(block, width - block);\n\tposY = startY = height - horizon + block;\n\n\t// set where to end\n\tstopX = random_(startX - multiplier, startX + multiplier);\n\tstopY = startY - (block * multiplier);\n\n\t// set gradient for quadratic curve\n\tctrlX = random_(startX - multiplier, stopX + multiplier);\n\tctrlY = random_(startY, stopY);\n\n\t// determine velocity in x and y directions\n\tdeltaX = Math.abs(stopX - startX);\n\tdeltaY = Math.abs(stopY - startY);\n\n\t// velocity, where diff = distance per frame\n\tdiffX = diffY = 1; (deltaX > deltaY) ? diffY = deltaY / deltaX : diffX = deltaX / deltaY;\n\n\t/**\n\t *\tRenders daisy flower.\n\t */\n\tfunction flower() {\n\t\t// render stamen\n\t\ta.beginPath();\n\t\ta.fillStyle = '#FF0';\n\t\ta.arc(stopX, stopY, (block * posMultiplier)/pi/1.5/1.5, 0, pi*2);\n\t\ta.fill();\n\t\t//a.restore();\n\n\t\t// render petals (unicode chars ftw)\n\t\ta.fillStyle = '#FFF';\n\t\ta.font = (block * posMultiplier) + \"pt serif\";\n\t\ta.fillText(\"\\u273f\", stopX - (block * posMultiplier)/2, stopY + (block * posMultiplier)/2, block * posMultiplier);\n\n\t\t// progress position\n\t\tposMultiplier++;\n\n\t\t// loop until flower is fully rendered\n\t\tif(posMultiplier !== multiplier) render_(flower);\n\t}\n\n\t/**\n\t *\tRenders daisy stalk.\n\t */\n\tfunction stalk() {\n\t\t// render quadratic curve\n\t\ta.beginPath();\n\t\ta.lineWidth = block;\n\t\ta.strokeStyle = '#000';\n\t\ta.moveTo(startX, startY);\n\t\ta.quadraticCurveTo(ctrlX, ctrlY, posX, posY);\n\t\ta.stroke();\n\t\t//a.restore();\n\n\t\t// set ground drop (maintains position above stalk)\n\t\ta.fillStyle = '#080';\n\t\ta.fillRect(0, height - horizon, width, horizon);\n\n\t\t// progress position\n\t\tposX += diffX;\n\t\tposY -= diffY;\n\n\t\t// loop, or move on to the flower\n\t\t(posY !== stopY) ? render_(stalk) : flower();\n\t}\n\n\t// render only when coordinates are different, else try again\n\t// fixes rendering bug where flowers would appear without stalk\n\t(stopX !== startX) ? stalk() : blossom();\n\n\t// and we're done!\n\t// return;\n}\n\n// generate random number of daisies, *spor*adically between 0.5s and 8s\n// excuse the pun...\nblossom();\nfor(var x=0, limit=random_(0, 25); x<limit; x++) {\n\twindow.setTimeout(blossom, random_(500, 8000));\n}", "meta": {"content_hash": "d7214b229e80d7df58341aaaf3912072", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 116, "avg_line_length": 23.070063694267517, "alnum_prop": 0.6535063500828272, "repo_name": "cs-au-dk/TAJS", "id": "81de9c0aa6ae88041cec7c84455baf65d7c6993e", "size": "3622", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test-resources/src/1k2013spring/1524.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "1661159"}, {"name": "Java", "bytes": "4740144"}, {"name": "JavaScript", "bytes": "3347530"}, {"name": "Shell", "bytes": "1839"}, {"name": "TypeScript", "bytes": "1299"}]}} +{"text": "// stats.js\n// ------------------------------------------------------------------\n//\n// created: Mon Oct 15 17:23:24 2018\n// last saved: <2022-April-01 14:17:51>\n\n/* jshint esversion:9, node:true, strict:implied */\n\nconst common = require('./common.js'),\n utility = require('./utility.js'),\n promiseWrap = require('./promiseWrap.js'),\n urljoin = require('url-join'),\n sprintf = require('sprintf-js').sprintf,\n request = require('request'),\n dateFormat = require('dateformat');\n\nfunction utcOffset_apigeeTimeFormat(date) {\n var s = dateFormat(date, \"isoUtcDateTime\");\n s = s.slice(0, -4);\n return s.slice(-5);\n}\n\nfunction getTimeRange(start, end) {\n start = dateFormat(start, 'mm/dd/yyyy') + ' ' + utcOffset_apigeeTimeFormat(start);\n end = dateFormat(end, 'mm/dd/yyyy') + ' ' + utcOffset_apigeeTimeFormat(end);\n return start + '~' + end;\n}\n\nfunction Stat(conn) {this.conn = conn;}\n\nStat.prototype.get = promiseWrap(function(options, cb) {\n // GET \"$mgmtserver/v1/o/$ORG/e/$ENV/stats/apis?select=sum(message_count)&timeRange=01/01/2018%2000:00~08/01/2018%2000:00&timeUnit=month\"\n\n // var options = {\n // environment : 'test',\n // dimension: 'apis',\n // metric: 'sum(message_count)',\n // startTime: startTime,\n // endTime : endTime,\n // timeUnit : 'month',\n // limit : 1024,\n // optimize : true/false,\n // cacheCheck : fn\n // };\n\n if ( ! cb) { cb = options; options = {}; }\n var conn = this.conn;\n var env = options.environmentName || options.environment;\n if (!env) {\n throw new Error(\"missing environment name\");\n }\n if (!options.dimension) {\n throw new Error(\"missing dimension\");\n }\n if (!options.metric) {\n throw new Error(\"missing metric\");\n }\n common.insureFreshToken(conn, function(requestOptions) {\n var query = sprintf('?select=%s&timeUnit=%s&timeRange=%s',\n options.metric,\n options.timeUnit,\n getTimeRange(options.startTime, options.endTime));\n\n if (options.limit) {\n query += '&limit=' + options.limit;\n }\n if (options.optimize) {\n query += '&_optimize=js';\n }\n if (options.metric.indexOf('percentile')>=0) {\n query += '&t=agg_percentile';\n }\n if (options.filter) {\n // filter=(apiproxy%20eq%20%%27${APIPROXY}%27)\n query += '&filter=' + options.filter;\n }\n requestOptions.url =\n urljoin(conn.urlBase, 'environments', env, 'stats', options.dimension) + query;\n\n if (conn.verbosity>0) {\n utility.logWrite(sprintf('GET %s', requestOptions.url));\n }\n\n // it takes a long time to retrieve some stats data. So let's\n // allow the use of a cache via an upcall.\n if (typeof options.cacheCheck == 'function') {\n let uniquifier = sprintf('%s-%s-%s-%s-%s-%s-%s',\n conn.orgname, env, options.dimension, options.metric,\n dateFormat(options.startTime, 'yyyymmdd'),\n dateFormat(options.endTime, 'yyyymmdd'), options.timeUnit);\n let cacheResponse = options.cacheCheck(requestOptions.url, uniquifier);\n if (cacheResponse) {\n if (cacheResponse.data) {\n return cb(null, {data: JSON.parse(cacheResponse.data) });\n }\n else if (cacheResponse.cachefile) {\n return request.get(requestOptions, common.callback(conn, [200], function(e, data){\n cb(e, {cachefile: cacheResponse.cachefile, data:data});\n }));\n }\n }\n }\n return request.get(requestOptions, common.callback(conn, [200], function(e, data){\n cb(e, {data:data});\n }));\n });\n});\n\nmodule.exports = Stat;\n", "meta": {"content_hash": "50b2a67220284b88f4324d19c0c92a4a", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 139, "avg_line_length": 34.22018348623853, "alnum_prop": 0.5761394101876676, "repo_name": "DinoChiesa/apigee-edge-js", "id": "052d5489fbb513f7a5c69c79d9f297277b8aa5a3", "size": "3730", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "lib/stat.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "JavaScript", "bytes": "411640"}, {"name": "XSLT", "bytes": "2212"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>classical-realizability: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.7.1+2 / classical-realizability - 8.5.0</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n classical-realizability\n <small>\n 8.5.0\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-10-22 11:23:20 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-10-22 11:23:20 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-num base Num library distributed with the OCaml compiler\nbase-threads base\nbase-unix base\ncamlp5 7.14 Preprocessor-pretty-printer of OCaml\nconf-findutils 1 Virtual package relying on findutils\nconf-perl 2 Virtual package relying on perl\ncoq 8.7.1+2 Formal proof management system\nnum 0 The Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.04.2 The OCaml compiler (virtual package)\nocaml-base-compiler 4.04.2 Official 4.04.2 release\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.5 A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "matej.kosik@inria.fr"\nhomepage: "https://github.com/coq-contribs/classical-realizability"\nlicense: "BSD"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/ClassicalRealizability"]\ndepends: [\n "ocaml"\n "coq" {>= "8.5" & < "8.6~"}\n]\ntags: [ "keyword:classical realizability" "keyword:krivine's realizability" "keyword:primitive datatype" "keyword:non determinism" "keyword:quote" "keyword:axiom of countable choice" "keyword:real numbers" "category:Mathematics/Logic/Foundations" ]\nauthors: [ "Lionel Rieg <lionel.rieg@ens-lyon.org>" ]\nbug-reports: "https://github.com/coq-contribs/classical-realizability/issues"\ndev-repo: "git+https://github.com/coq-contribs/classical-realizability.git"\nsynopsis: "Krivine's classical realizability"\ndescription: """\nThe aim of this Coq library is to provide a framework for checking\nproofs in Krivine's classical realizability for second-order Peano arithmetic.\nIt is designed to be as extensible as the original theory by Krivine and to\nsupport on-the-fly extensions by new instructions with their evaluation\nrules."""\nflags: light-uninstall\nurl {\n src:\n "https://github.com/coq-contribs/classical-realizability/archive/v8.5.0.tar.gz"\n checksum: "md5=7e6fb42bd18a9d7282d8d694d322f9a6"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-classical-realizability.8.5.0 coq.8.7.1+2</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+2).\nThe following dependencies couldn't be met:\n - coq-classical-realizability -> coq < 8.6~ -> ocaml < 4.03.0\n base of this switch (use `--unlock-base' to force)\nYour request can't be satisfied:\n - No available version of coq satisfies the constraints\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-classical-realizability.8.5.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "32178ad3e89633f7ce45dbc1ccb06dad", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 332, "avg_line_length": 44.228070175438596, "alnum_prop": 0.5651196615099828, "repo_name": "coq-bench/coq-bench.github.io", "id": "a67cb9af7ad5c8170da3f92608554c4cfda2ec05", "size": "7588", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.04.2-2.0.5/released/8.7.1+2/classical-realizability/8.5.0.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "\n\n#import <Foundation/Foundation.h>\n#import <UIKit/UIKit.h>\n#import \"FBFetchedAppSettings.h\"\n\n@class FBRequest;\n@class FBSession;\n\n@protocol FBGraphObject;\n\ntypedef enum FBAdvertisingTrackingStatus {\n AdvertisingTrackingAllowed,\n AdvertisingTrackingDisallowed,\n AdvertisingTrackingUnspecified\n} FBAdvertisingTrackingStatus;\n\n@interface FBUtility : NSObject\n\n+ (NSDictionary*)queryParamsDictionaryFromFBURL:(NSURL*)url;\n+ (NSDictionary*)dictionaryByParsingURLQueryPart:(NSString *)encodedString;\n+ (NSString *)stringBySerializingQueryParameters:(NSDictionary *)queryParameters;\n+ (NSString *)stringByURLDecodingString:(NSString*)escapedString;\n+ (NSString*)stringByURLEncodingString:(NSString*)unescapedString;\n+ (id<FBGraphObject>)graphObjectInArray:(NSArray*)array withSameIDAs:(id<FBGraphObject>)item;\n\n+ (unsigned long)currentTimeInMilliseconds;\n+ (NSTimeInterval)randomTimeInterval:(NSTimeInterval)minValue withMaxValue:(NSTimeInterval)maxValue;\n+ (void)centerView:(UIView*)view tableView:(UITableView*)tableView;\n+ (NSString *)stringFBIDFromObject:(id)object;\n+ (NSString *)stringAppBaseUrlFromAppId:(NSString *)appID urlSchemeSuffix:(NSString *)urlSchemeSuffix;\n+ (NSDate*)expirationDateFromExpirationTimeIntervalString:(NSString*)expirationTime;\n+ (NSDate*)expirationDateFromExpirationUnixTimeString:(NSString*)expirationTime;\n+ (NSBundle *)facebookSDKBundle;\n+ (NSString *)localizedStringForKey:(NSString *)key\n withDefault:(NSString *)value;\n+ (NSString *)localizedStringForKey:(NSString *)key\n withDefault:(NSString *)value\n inBundle:(NSBundle *)bundle;\n// Returns YES when the bundle identifier is for one of the native facebook apps\n+ (BOOL)isFacebookBundleIdentifier:(NSString *)bundleIdentifier;\n\n+ (BOOL)isPublishPermission:(NSString*)permission;\n+ (BOOL)areAllPermissionsReadPermissions:(NSArray*)permissions;\n+ (NSArray*)addBasicInfoPermission:(NSArray*)permissions;\n+ (void)fetchAppSettings:(NSString *)appID\n callback:(void (^)(FBFetchedAppSettings *, NSError *))callback;\n+ (FBFetchedAppSettings *)fetchedAppSettings;\n+ (NSString *)attributionID;\n+ (NSString *)advertiserID;\n+ (FBAdvertisingTrackingStatus)advertisingTrackingStatus;\n+ (void)updateParametersWithEventUsageLimits:(NSMutableDictionary *)parameters;\n\n// Encode a data structure in JSON, any errors will just be logged.\n+ (NSString *)simpleJSONEncode:(id)data;\n+ (id)simpleJSONDecode:(NSString *)jsonEncoding;\n+ (NSString *)simpleJSONEncode:(id)data\n error:(NSError **)error\n writingOptions:(NSJSONWritingOptions)writingOptions;\n+ (id)simpleJSONDecode:(NSString *)jsonEncoding\n error:(NSError **)error;\n+ (BOOL) isRetinaDisplay;\n+ (NSString *)newUUIDString;\n+ (BOOL)isRegisteredURLScheme:(NSString *)urlScheme;\n\n+ (NSString *) buildFacebookUrlWithPre:(NSString*)pre;\n+ (NSString *) buildFacebookUrlWithPre:(NSString*)pre\n withPost:(NSString *)post;\n\n@end\n \n#define FBConditionalLog(condition, desc, ...) \\\ndo { \\\n if (!(condition)) {\t\\\n NSString *msg = [NSString stringWithFormat:(desc), ##__VA_ARGS__]; \\\n NSLog(@\"FBConditionalLog: %@\", msg); \\\n } \\\n} while(NO)\n \n#define FB_BASE_URL @\"facebook.com\"\n", "meta": {"content_hash": "af69a6a40fff78a1b6be8183fbde563d", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 102, "avg_line_length": 41.0375, "alnum_prop": 0.7401766676819982, "repo_name": "bliustar/couponquest", "id": "f8e9a455c850ec7a394c32558c1a36edab59cb45", "size": "3881", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Pods/Facebook-iOS-SDK/src/FBUtility.h", "mode": "33188", "license": "mit", "language": [{"name": "AppleScript", "bytes": "18419"}, {"name": "C", "bytes": "270586"}, {"name": "C++", "bytes": "6727"}, {"name": "CSS", "bytes": "6111"}, {"name": "JavaScript", "bytes": "111"}, {"name": "M", "bytes": "163592"}, {"name": "Objective-C", "bytes": "7524991"}, {"name": "Ruby", "bytes": "13807"}, {"name": "Shell", "bytes": "40797"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>historical-examples: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.6 / historical-examples - 8.7.0</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n historical-examples\n <small>\n 8.7.0\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-11-21 00:31:44 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-11-21 00:31:44 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-num base Num library distributed with the OCaml compiler\nbase-ocamlbuild base OCamlbuild binary and libraries distributed with the OCaml compiler\nbase-threads base\nbase-unix base\ncamlp5 7.14 Preprocessor-pretty-printer of OCaml\nconf-findutils 1 Virtual package relying on findutils\nconf-perl 2 Virtual package relying on perl\ncoq 8.6 Formal proof management system\nnum 0 The Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.02.3 The OCaml compiler (virtual package)\nocaml-base-compiler 4.02.3 Official 4.02.3 release\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.5 A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/historical-examples"\nlicense: "LGPL 2.1"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/HistoricalExamples"]\ndepends: [\n "ocaml"\n "coq" {>= "8.7" & < "8.8~"}\n]\ntags: [ "keyword: Newman's lemma" "keyword: Tarski's fixpoint theorem" "keyword: line formatting" "keyword: binary-search paradigm" "keyword: square root approximation" "keyword: Calculus of Constructions" "keyword: history of Coq" "category: Miscellaneous/Coq Use Examples" ]\nauthors: [ "G\u00e9rard Huet" "Christine Paulin" ]\nbug-reports: "https://github.com/coq-contribs/historical-examples/issues"\ndev-repo: "git+https://github.com/coq-contribs/historical-examples.git"\nsynopsis: "Historical examples developed in the (pure) Calculus of Constructions"\ndescription: """\nThis is a collection of historical examples developed in\nsystem CoC that implemented Coquand's Calculus of Constructions.\nNewman.v and Tarski.v originate in version 1.10, Manna.v and\nFormat.v are from version 4.3. Their evolution to the Calculus of\nInductive Constructions (up to Coq V6.3) are in MannaCIC.v and\nFormatCIC.v. (Collection by Hugo Herbelin.)"""\nflags: light-uninstall\nurl {\n src:\n "https://github.com/coq-contribs/historical-examples/archive/v8.7.0.tar.gz"\n checksum: "md5=b77b1bc10c081e5fce0ce9fb46e7a661"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-historical-examples.8.7.0 coq.8.6</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.6).\nThe following dependencies couldn't be met:\n - coq-historical-examples -> coq >= 8.7 -> ocaml >= 4.05.0\n base of this switch (use `--unlock-base' to force)\nYour request can't be satisfied:\n - No available version of coq satisfies the constraints\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-historical-examples.8.7.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "db15d63af738afb6716f3fed684f578b", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 364, "avg_line_length": 44.68208092485549, "alnum_prop": 0.5670116429495472, "repo_name": "coq-bench/coq-bench.github.io", "id": "a1f2f1b4873915d54307d2751605a717d19f08e6", "size": "7756", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.02.3-2.0.6/released/8.6/historical-examples/8.7.0.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <!-- From: file:/C:/Users/Orlyn/Documents/MyOffice/personal/umedinfo/deb/uMedInfo/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/res/values-zh-rHK/values-zh-rHK.xml -->\n <eat-comment/>\n <string msgid=\"4600421777120114993\" name=\"abc_action_bar_home_description\">\"\u700f\u89bd\u4e3b\u9801\"</string>\n <string msgid=\"1594238315039666878\" name=\"abc_action_bar_up_description\">\"\u5411\u4e0a\u700f\u89bd\"</string>\n <string msgid=\"3588849162933574182\" name=\"abc_action_menu_overflow_description\">\"\u66f4\u591a\u9078\u9805\"</string>\n <string msgid=\"4076576682505996667\" name=\"abc_action_mode_done\">\"\u5b8c\u6210\"</string>\n <string msgid=\"7468859129482906941\" name=\"abc_activity_chooser_view_see_all\">\"\u986f\u793a\u5168\u90e8\"</string>\n <string msgid=\"2031811694353399454\" name=\"abc_activitychooserview_choose_application\">\"\u9078\u64c7\u61c9\u7528\u7a0b\u5f0f\"</string>\n <string msgid=\"3691816814315814921\" name=\"abc_searchview_description_clear\">\"\u6e05\u9664\u67e5\u8a62\"</string>\n <string msgid=\"2550479030709304392\" name=\"abc_searchview_description_query\">\"\u641c\u5c0b\u67e5\u8a62\"</string>\n <string msgid=\"8264924765203268293\" name=\"abc_searchview_description_search\">\"\u641c\u5c0b\"</string>\n <string msgid=\"8928215447528550784\" name=\"abc_searchview_description_submit\">\"\u63d0\u4ea4\u67e5\u8a62\"</string>\n <string msgid=\"893419373245838918\" name=\"abc_searchview_description_voice\">\"\u8a9e\u97f3\u641c\u5c0b\"</string>\n <string msgid=\"3421042268587513524\" name=\"abc_shareactionprovider_share_with\">\"\u5206\u4eab\u5c0d\u8c61\"</string>\n <string msgid=\"7165123711973476752\" name=\"abc_shareactionprovider_share_with_application\">\"\u8207\u300c%s\u300d\u5206\u4eab\"</string>\n</resources>", "meta": {"content_hash": "3f9e163499f8e614270043234dc8f1ea", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 198, "avg_line_length": 85.88888888888889, "alnum_prop": 0.7509702457956016, "repo_name": "orlyngerano/searchmedicine", "id": "64ebf00c15a4b4d8ef6557b0e32bbd795413bf04", "size": "1648", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "uMedInfo/build/intermediates/res/debug/values-zh-rHK/values-zh-rHK.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "485262"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>dictionaries: 18 s \ud83c\udfc6</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.7.0 / dictionaries - 8.7.0</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n dictionaries\n <small>\n 8.7.0\n <span class=\"label label-success\">18 s \ud83c\udfc6</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-03-24 00:13:48 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-03-24 00:13:48 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-threads base\nbase-unix base\ncamlp5 7.14 Preprocessor-pretty-printer of OCaml\nconf-findutils 1 Virtual package relying on findutils\nconf-perl 2 Virtual package relying on perl\ncoq 8.7.0 Formal proof management system\nnum 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.07.1 The OCaml compiler (virtual package)\nocaml-base-compiler 4.07.1 Official release 4.07.1\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.3 A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/dictionaries"\nlicense: "LGPL 2.1"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/Dictionaries"]\ndepends: [\n "ocaml"\n "coq" {>= "8.7" & < "8.8~"}\n]\ntags: [\n "keyword: modules"\n "keyword: functors"\n "keyword: search trees"\n "category: Computer Science/Data Types and Data Structures"\n "category: Miscellaneous/Extracted Programs/Data structures"\n "date: 2003-02-6"\n]\nauthors: [ "Pierre Cast\u00e9ran <casteran@labri.fr>" ]\nbug-reports: "https://github.com/coq-contribs/dictionaries/issues"\ndev-repo: "git+https://github.com/coq-contribs/dictionaries.git"\nsynopsis: "Dictionaries (with modules)"\ndescription: """\nThis file contains a specification for dictionaries, and\nan implementation using binary search trees. Coq's module system,\nwith module types and functors, is heavily used. It can be considered\nas a certified version of an example proposed by Paulson in Standard ML.\nA detailed description (in French) can be found in the chapter 11 of\nThe Coq'Art, the book written by Yves Bertot and Pierre Cast\u00e9ran\n(please follow the link http://coq.inria.fr/doc-eng.html)"""\nflags: light-uninstall\nurl {\n src: "https://github.com/coq-contribs/dictionaries/archive/v8.7.0.tar.gz"\n checksum: "md5=1e1e78b0a76827b75de4f43ec8602c1d"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-dictionaries.8.7.0 coq.8.7.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-dictionaries.8.7.0 coq.8.7.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>11 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-dictionaries.8.7.0 coq.8.7.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>18 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>Total: 320 K</p>\n <ul>\n <li>193 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Dictionaries/dict.vo</code></li>\n <li>94 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Dictionaries/dict.glob</code></li>\n <li>33 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Dictionaries/dict.v</code></li>\n </ul>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq-dictionaries.8.7.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "9ab734753a1548b92a97ce193d2beae4", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 159, "avg_line_length": 43.298850574712645, "alnum_prop": 0.556941863551898, "repo_name": "coq-bench/coq-bench.github.io", "id": "a90ec1506139dd590b76b2326309e3fdb4f4ad78", "size": "7561", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.07.1-2.0.6/released/8.7.0/dictionaries/8.7.0.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "\ufeffusing System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\npublic class DebugLogPositionInformation : MonoBehaviour {\n\n [SerializeField]\n private string ObjectName = \"\";\n [SerializeField]\n private Vector3 RectTransformPosition = Vector3.zero;\n [SerializeField]\n private float TimeSinceStart = 0.0f;\n [SerializeField, Range(0, 1000000)]\n private float ComparisonThreshold = 500.0f;\n\n Vector3 PreviousRectTransformPosition = Vector3.zero;\n\n // Use this for initialization\n void Start () {\n\t\t\n\t}\n\t\n\t// Update is called once per frame\n\tvoid Update () {\n ObjectName = gameObject.name;\n PreviousRectTransformPosition = RectTransformPosition;\n RectTransformPosition = GetComponent<RectTransform>().anchoredPosition;\n TimeSinceStart = Time.unscaledTime;\n\n CompareCurrentAndPreviousRectTransformPositions();\n\t}\n\n void CompareCurrentAndPreviousRectTransformPositions()\n {\n if(Mathf.Abs(RectTransformPosition.x - PreviousRectTransformPosition.x) > ComparisonThreshold ||\n Mathf.Abs(RectTransformPosition.y - PreviousRectTransformPosition.y) > ComparisonThreshold ||\n Mathf.Abs(RectTransformPosition.z - PreviousRectTransformPosition.z) > ComparisonThreshold)\n {\n Debug.Log(\"Position drastically changed from <\" + PreviousRectTransformPosition + \"> to <\" + RectTransformPosition + \"> at: <\" + Time.unscaledTime + \">.\");\n }\n }\n}\n", "meta": {"content_hash": "ed929c523db0a213362286cdb4dd86ba", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 167, "avg_line_length": 34.92857142857143, "alnum_prop": 0.7143830947511929, "repo_name": "Alfabits/Pip-Pup-Source-Backup", "id": "94b3c6b5fcc451512399d0869c840482ab34d18c", "size": "1469", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Scripts/Debugging/DebugLogPositionInformation.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "191984"}]}} +{"text": "@implementation RVMutableDictionary\n\n-(instancetype) init {\n self = [super init];\n if(self) {\n _backingDict = [[NSMutableDictionary alloc] init];\n }\n return self;\n}\n\n-(void) setObject:(id)anObject forKey:(id<NSCopying>)aKey {\n if(anObject == nil) {\n return;\n }\n [_backingDict setObject:anObject forKey:aKey];\n}\n\n-(id) valueForKey:(NSString *) key {\n return [_backingDict objectForKey:key];\n}\n\n- (void)setValue:(id)value forKey:(NSString *)key{\n [_backingDict setObject:value forKey:key];\n}\n\n//Dont override. We do want the app to error out if there is a missing key\n//- (id)valueForUndefinedKey:(NSString *)key {\n//\n//}\n\n- (void)setValue:(id)value forUndefinedKey:(NSString *)key{\n [_backingDict setObject:value forKey:key];\n}\n\n#pragma mark - passing messages to the backing dictionary\n- (void)forwardInvocation:(NSInvocation *)anInvocation\n{\n if ([_backingDict respondsToSelector:\n [anInvocation selector]])\n [anInvocation invokeWithTarget:_backingDict];\n else\n [super forwardInvocation:anInvocation];\n}\n\n- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector {\n return [NSMutableDictionary instanceMethodSignatureForSelector:aSelector];\n}\n\n#pragma mark - remaing KVO compliant. Invisibly ignoring this class\n- (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context {\n [_backingDict addObserver:observer forKeyPath:keyPath options:options context:context];\n}\n\n- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath context:(void *)context {\n [_backingDict removeObserver:observer forKeyPath:keyPath context:context];\n}\n\n- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath {\n [_backingDict removeObserver:observer forKeyPath: keyPath];\n}\n\n-(NSString *) description {\n return [_backingDict description];\n}\n\n@end\n", "meta": {"content_hash": "3ae7ee87f8c58ea0846bb47b1abe6a50", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 141, "avg_line_length": 29.303030303030305, "alnum_prop": 0.7233712512926577, "repo_name": "aaronSig/rivet", "id": "a08a8f7ab37aa9b8cc4afe73a46d18da7ae7a656", "size": "2296", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Rivet/RVMutableDictionary.m", "mode": "33188", "license": "mit", "language": [{"name": "Objective-C", "bytes": "24549"}, {"name": "Ruby", "bytes": "6100"}]}} +{"text": "StroikaRoot=$(abspath ../../../../../../)/\n\nifneq ($(CONFIGURATION),)\n\t#no error if missing cuz could be doing make clobber\n\t-include $(StroikaRoot)IntermediateFiles/$(CONFIGURATION)/Configuration.mk\nendif\n\ninclude $(StroikaRoot)ScriptsLib/Makefile-Common.mk\ninclude $(StroikaRoot)ScriptsLib/SharedMakeVariables-Default.mk\n\nSrcDir\t= $(StroikaRoot)Library/Sources/Stroika/Frameworks/SystemPerformance/Support/\nObjDir\t=\t$(StroikaRoot)IntermediateFiles/$(CONFIGURATION)/Library/Frameworks/SystemPerformance/Support/\n\nifeq ($(WIN_USE_PROGRAM_DATABASE),1)\nCXXFLAGS+=-Fd$(call FUNCTION_CONVERT_FILEPATH_TO_COMPILER_NATIVE,$(StroikaRoot)Builds/$(CONFIGURATION)/Stroika-Frameworks.pdb)\nendif\n\n\nvpath %cpp $(SrcDir)\n\nObjs\t=\t\\\n\n\nifneq ($(findstring Windows,$(TARGET_PLATFORMS)),)\nObjs+=\t$(ObjDir)WMICollector${OBJ_SUFFIX}\nendif\n\ninclude $(StroikaRoot)ScriptsLib/SharedBuildRules-Default.mk\n\nall:\t$(Objs)\n\n", "meta": {"content_hash": "9407a90a5290fa8528827bedf1a69352", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 126, "avg_line_length": 28.93548387096774, "alnum_prop": 0.770345596432553, "repo_name": "SophistSolutions/Stroika", "id": "4304dff40e9711abd881197b35dbe3326c40b894", "size": "897", "binary": false, "copies": "1", "ref": "refs/heads/v2.1-Release", "path": "Library/Sources/Stroika/Frameworks/SystemPerformance/Support/Makefile", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "438"}, {"name": "C", "bytes": "15598"}, {"name": "C++", "bytes": "12952163"}, {"name": "Dockerfile", "bytes": "38254"}, {"name": "Makefile", "bytes": "299984"}, {"name": "Perl", "bytes": "52501"}, {"name": "R", "bytes": "29685"}, {"name": "Shell", "bytes": "81240"}]}} +{"text": "<!DOCTYPE html>\n<!--\nTo change this license header, choose License Headers in Project Properties.\nTo change this template file, choose Tools | Templates\nand open the template in the editor.\n-->\n<html>\n <head>\n <title>Nubi - Place to learn, way to heaven</title>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\">\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js\"></script>\n <script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\"></script>\n\n <script src=\"https://unpkg.com/vue\"></script>\n </head>\n <body>\n <div class=\"container\">\n <div id=\"app\" class=\"panel-group\">\n {{ message }}\n <div v-for=\"conver in convers\" class=\"panel panel-default\">\n <div class=\"panel-heading panel-title\">\n <a data-toggle=\"collapse\" v-bind:href=\"'#coll' + conver.id\">{{conver.id}}</a>\n </div>\n <div v-bind:id=\"'coll' + conver.id\" class=\"panel-collapse collapse\">\n <div v-for=\"msg in conver.msgs\" class=\"panel-body\">\n {{msg.id}}: {{msg.text}}\n </div>\n </div>\n </div>\n </div>\n </div>\n <script>\n\nvar app = new Vue({\n el: '#app',\n data: {\n message: 'Hello Vue!',\n convers: [{\n id: 1,\n msgs: [{\n id: 1,\n text: \"Hello, how are you?\"\n }, {\n id: 2,\n text: \"fine, thank you. How are you too?\"\n }, {\n id: 3,\n text: \"Never been better\"\n }]}, {\n id: 2,\n msgs: [{\n id: 1,\n text: \"Do you have a plan to night?\"\n }, {\n id: 2,\n text: \"No, not yet. Do you want to go to movie?\"\n }, {\n id: 3,\n text: \"Sound's great! let's go for the ticket.\"\n }, {\n id: 4,\n text: \"Can't wait fot it\"\n }]\n }]\n }\n});\n </script>\n </body>\n\n</html>\n", "meta": {"content_hash": "016cd4166851c0a29e46c56318d748c9", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 108, "avg_line_length": 35.638888888888886, "alnum_prop": 0.41504286827747466, "repo_name": "nevaku/kurniakue", "id": "c1fddfd7854036c4244440c7bdccd95d47a78c02", "size": "2566", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "kurse/src/main/webapp/nubi.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2850"}, {"name": "CSS", "bytes": "1394"}, {"name": "HTML", "bytes": "23766"}, {"name": "Java", "bytes": "743067"}, {"name": "JavaScript", "bytes": "47267"}, {"name": "PHP", "bytes": "1021"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\nPass: (1500) A Parameter's 'units' must be a UnitKind, a built-in\nunit, or the id of a UnitDefinition.\n-->\n<sbml xmlns=\"http://www.sbml.org/sbml/level1\" level=\"1\" version=\"2\">\n\t<model>\n\t\t<listOfUnitDefinitions>\n\t\t\t<unitDefinition name=\"mmls\">\n\t\t\t\t<listOfUnits>\n\t\t\t\t\t<unit kind=\"mole\" scale=\"-3\"/>\n\t\t\t\t\t<unit kind=\"litre\" exponent=\"-1\"/>\n\t\t\t\t\t<unit kind=\"second\" exponent=\"-1\"/>\n\t\t\t\t</listOfUnits>\n\t\t\t</unitDefinition>\n\t\t</listOfUnitDefinitions>\n\t\t<listOfCompartments>\n\t\t\t<compartment name=\"c\"/>\n\t\t</listOfCompartments>\n\t\t<listOfParameters>\n\t\t\t<parameter name=\"p\" units=\"mmls\" value=\"1\"/>\n\t\t</listOfParameters>\n\t</model>\n</sbml>\n", "meta": {"content_hash": "d81b1eb2822bc24de68518d7b5a4a6a9", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 68, "avg_line_length": 28.0, "alnum_prop": 0.6488095238095238, "repo_name": "TheCoSMoCompany/biopredyn", "id": "17535b5e576ec46677ba11487ae6f18a49e3210a", "size": "672", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "Prototype/src/libsbml-5.10.0/src/sbml/validator/test/test-data/sbml-unit-constraints/20701-pass-00-15.xml", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "3535918"}, {"name": "C++", "bytes": "26120778"}, {"name": "CMake", "bytes": "455400"}, {"name": "CSS", "bytes": "49020"}, {"name": "Gnuplot", "bytes": "206"}, {"name": "HTML", "bytes": "193068"}, {"name": "Java", "bytes": "66517"}, {"name": "JavaScript", "bytes": "3847"}, {"name": "Makefile", "bytes": "30905"}, {"name": "Perl", "bytes": "3018"}, {"name": "Python", "bytes": "7891301"}, {"name": "Shell", "bytes": "247654"}, {"name": "TeX", "bytes": "22566"}, {"name": "XSLT", "bytes": "55564"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"de\">\n<head>\n\n<title>Uses of Package org.eclipse.emf.cdo.common.admin (CDO Model Repository Documentation)</title>\n<meta name=\"date\" content=\"\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../../../stylesheet.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"../../../../../../script.js\"></script>\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n try {\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"Uses of Package org.eclipse.emf.cdo.common.admin (CDO Model Repository Documentation)\";\n }\n }\n catch(err) {\n }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar.top\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.top.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li>Class</li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../index.html?org/eclipse/emf/cdo/common/admin/package-use.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"package-use.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip.navbar.top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h1 title=\"Uses of Package org.eclipse.emf.cdo.common.admin\" class=\"title\">Uses of Package<br>org.eclipse.emf.cdo.common.admin</h1>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use table, listing packages, and an explanation\">\n<caption><span>Packages that use <a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/package-summary.html\">org.eclipse.emf.cdo.common.admin</a></span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Package</th>\n<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a href=\"#org.eclipse.emf.cdo.admin\">org.eclipse.emf.cdo.admin</a></td>\n<td class=\"colLast\">\n<div class=\"block\">Client side of the protocol to administer CDO repositories remotely.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a href=\"#org.eclipse.emf.cdo.common.admin\">org.eclipse.emf.cdo.common.admin</a></td>\n<td class=\"colLast\">\n<div class=\"block\">Common concepts for the protocol to administer CDO repositories remotely.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a href=\"#org.eclipse.emf.cdo.spi.common.admin\">org.eclipse.emf.cdo.spi.common.admin</a></td>\n<td class=\"colLast\">\n<div class=\"block\">Common concepts for dealing with protocols and CDO administration-specific I/O.</div>\n</td>\n</tr>\n</tbody>\n</table>\n</li>\n<li class=\"blockList\"><a name=\"org.eclipse.emf.cdo.admin\">\n<!-- -->\n</a>\n<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use table, listing classes, and an explanation\">\n<caption><span>Classes in <a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/package-summary.html\">org.eclipse.emf.cdo.common.admin</a> used by <a href=\"../../../../../../org/eclipse/emf/cdo/admin/package-summary.html\">org.eclipse.emf.cdo.admin</a></span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Class and Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdmin.html#org.eclipse.emf.cdo.admin\">CDOAdmin</a>\n<div class=\"block\">An administrative interface to a remote server with CDO <a href=\"../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html\" title=\"interface in org.eclipse.emf.cdo.common\"><code>repositories</code></a>.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdminRepository.html#org.eclipse.emf.cdo.admin\">CDOAdminRepository</a>\n<div class=\"block\">An administrative interface to a remote <a href=\"../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html\" title=\"interface in org.eclipse.emf.cdo.common\"><code>repository</code></a>.</div>\n</td>\n</tr>\n</tbody>\n</table>\n</li>\n<li class=\"blockList\"><a name=\"org.eclipse.emf.cdo.common.admin\">\n<!-- -->\n</a>\n<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use table, listing classes, and an explanation\">\n<caption><span>Classes in <a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/package-summary.html\">org.eclipse.emf.cdo.common.admin</a> used by <a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/package-summary.html\">org.eclipse.emf.cdo.common.admin</a></span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Class and Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdmin.html#org.eclipse.emf.cdo.common.admin\">CDOAdmin</a>\n<div class=\"block\">An administrative interface to a remote server with CDO <a href=\"../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html\" title=\"interface in org.eclipse.emf.cdo.common\"><code>repositories</code></a>.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdminRepository.html#org.eclipse.emf.cdo.common.admin\">CDOAdminRepository</a>\n<div class=\"block\">An administrative interface to a remote <a href=\"../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html\" title=\"interface in org.eclipse.emf.cdo.common\"><code>repository</code></a>.</div>\n</td>\n</tr>\n</tbody>\n</table>\n</li>\n<li class=\"blockList\"><a name=\"org.eclipse.emf.cdo.spi.common.admin\">\n<!-- -->\n</a>\n<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use table, listing classes, and an explanation\">\n<caption><span>Classes in <a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/package-summary.html\">org.eclipse.emf.cdo.common.admin</a> used by <a href=\"../../../../../../org/eclipse/emf/cdo/spi/common/admin/package-summary.html\">org.eclipse.emf.cdo.spi.common.admin</a></span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Class and Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdmin.html#org.eclipse.emf.cdo.spi.common.admin\">CDOAdmin</a>\n<div class=\"block\">An administrative interface to a remote server with CDO <a href=\"../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html\" title=\"interface in org.eclipse.emf.cdo.common\"><code>repositories</code></a>.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdminRepository.html#org.eclipse.emf.cdo.spi.common.admin\">CDOAdminRepository</a>\n<div class=\"block\">An administrative interface to a remote <a href=\"../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html\" title=\"interface in org.eclipse.emf.cdo.common\"><code>repository</code></a>.</div>\n</td>\n</tr>\n</tbody>\n</table>\n</li>\n</ul>\n</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar.bottom\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.bottom.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li>Class</li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../index.html?org/eclipse/emf/cdo/common/admin/package-use.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"package-use.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip.navbar.bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n<p class=\"legalCopy\"><small><i>Copyright (c) 2011-2015 Eike Stepper (Berlin, Germany) and others.</i></small></p>\n</body>\n</html>\n", "meta": {"content_hash": "8c93c173c927df36696dec6c331ff3bc", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 330, "avg_line_length": 44.55656108597285, "alnum_prop": 0.6509596831522291, "repo_name": "kribe48/wasp-mbse", "id": "fadde866ac62a4737e451d1f307a64d73404c347", "size": "9847", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WASP-turtlebot-DSL/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/org.eclipse.osgi/142/0/.cp/javadoc/org/eclipse/emf/cdo/common/admin/package-use.html", "mode": "33188", "license": "mit", "language": [{"name": "CMake", "bytes": "6732"}, {"name": "CSS", "bytes": "179891"}, {"name": "GAP", "bytes": "163745"}, {"name": "HTML", "bytes": "1197667"}, {"name": "Java", "bytes": "1369191"}, {"name": "JavaScript", "bytes": "1555"}, {"name": "Python", "bytes": "11033"}, {"name": "Roff", "bytes": "303"}, {"name": "Xtend", "bytes": "13981"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc (1.8.0_151) on Sun Mar 17 11:03:31 MST 2019 -->\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>ClusterPassivationStoreConsumer (BOM: * : All 2.4.0.Final API)</title>\n<meta name=\"date\" content=\"2019-03-17\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../../stylesheet.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"../../../../../script.js\"></script>\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n try {\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"ClusterPassivationStoreConsumer (BOM: * : All 2.4.0.Final API)\";\n }\n }\n catch(err) {\n }\n//-->\nvar methods = {\"i0\":6,\"i1\":18};\nvar tabs = {65535:[\"t0\",\"All Methods\"],2:[\"t2\",\"Instance Methods\"],4:[\"t3\",\"Abstract Methods\"],16:[\"t5\",\"Default Methods\"]};\nvar altColor = \"altColor\";\nvar rowColor = \"rowColor\";\nvar tableTab = \"tableTab\";\nvar activeTableTab = \"activeTableTab\";\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar.top\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.top.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"class-use/ClusterPassivationStoreConsumer.html\">Use</a></li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../help-doc.html\">Help</a></li>\n</ul>\n<div class=\"aboutLanguage\">Thorntail API, 2.4.0.Final</div>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStore.html\" title=\"class in org.wildfly.swarm.config.ejb3\"><span class=\"typeNameLink\">Prev Class</span></a></li>\n<li><a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreSupplier.html\" title=\"interface in org.wildfly.swarm.config.ejb3\"><span class=\"typeNameLink\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../index.html?org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"ClusterPassivationStoreConsumer.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary: </li>\n<li>Nested | </li>\n<li>Field | </li>\n<li>Constr | </li>\n<li><a href=\"#method.summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail: </li>\n<li>Field | </li>\n<li>Constr | </li>\n<li><a href=\"#method.detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip.navbar.top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.wildfly.swarm.config.ejb3</div>\n<h2 title=\"Interface ClusterPassivationStoreConsumer\" class=\"title\">Interface ClusterPassivationStoreConsumer<T extends <a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStore.html\" title=\"class in org.wildfly.swarm.config.ejb3\">ClusterPassivationStore</a><T>></h2>\n</div>\n<div class=\"contentContainer\">\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<dl>\n<dt>Functional Interface:</dt>\n<dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd>\n</dl>\n<hr>\n<br>\n<pre><a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true\" title=\"class or interface in java.lang\">@FunctionalInterface</a>\npublic interface <span class=\"typeNameLabel\">ClusterPassivationStoreConsumer<T extends <a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStore.html\" title=\"class in org.wildfly.swarm.config.ejb3\">ClusterPassivationStore</a><T>></span></pre>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method.summary\">\n<!-- -->\n</a>\n<h3>Method Summary</h3>\n<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Method Summary table, listing methods, and an explanation\">\n<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Methods</span><span class=\"tabEnd\"> </span></span><span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">Instance Methods</a></span><span class=\"tabEnd\"> </span></span><span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract Methods</a></span><span class=\"tabEnd\"> </span></span><span id=\"t5\" class=\"tableTab\"><span><a href=\"javascript:show(16);\">Default Methods</a></span><span class=\"tabEnd\"> </span></span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tr id=\"i0\" class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html#accept-T-\">accept</a></span>(<a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" title=\"type parameter in ClusterPassivationStoreConsumer\">T</a> value)</code>\n<div class=\"block\">Configure a pre-constructed instance of ClusterPassivationStore resource</div>\n</td>\n</tr>\n<tr id=\"i1\" class=\"rowColor\">\n<td class=\"colFirst\"><code>default <a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" title=\"interface in org.wildfly.swarm.config.ejb3\">ClusterPassivationStoreConsumer</a><<a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" title=\"type parameter in ClusterPassivationStoreConsumer\">T</a>></code></td>\n<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html#andThen-org.wildfly.swarm.config.ejb3.ClusterPassivationStoreConsumer-\">andThen</a></span>(<a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" title=\"interface in org.wildfly.swarm.config.ejb3\">ClusterPassivationStoreConsumer</a><<a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" title=\"type parameter in ClusterPassivationStoreConsumer\">T</a>> after)</code> </td>\n</tr>\n</table>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ============ METHOD DETAIL ========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method.detail\">\n<!-- -->\n</a>\n<h3>Method Detail</h3>\n<a name=\"accept-org.wildfly.swarm.config.ejb3.ClusterPassivationStore-\">\n<!-- -->\n</a><a name=\"accept-T-\">\n<!-- -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>accept</h4>\n<pre>void accept(<a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" title=\"type parameter in ClusterPassivationStoreConsumer\">T</a> value)</pre>\n<div class=\"block\">Configure a pre-constructed instance of ClusterPassivationStore resource</div>\n</li>\n</ul>\n<a name=\"andThen-org.wildfly.swarm.config.ejb3.ClusterPassivationStoreConsumer-\">\n<!-- -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>andThen</h4>\n<pre>default <a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" title=\"interface in org.wildfly.swarm.config.ejb3\">ClusterPassivationStoreConsumer</a><<a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" title=\"type parameter in ClusterPassivationStoreConsumer\">T</a>> andThen(<a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" title=\"interface in org.wildfly.swarm.config.ejb3\">ClusterPassivationStoreConsumer</a><<a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" title=\"type parameter in ClusterPassivationStoreConsumer\">T</a>> after)</pre>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar.bottom\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.bottom.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"class-use/ClusterPassivationStoreConsumer.html\">Use</a></li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../help-doc.html\">Help</a></li>\n</ul>\n<div class=\"aboutLanguage\">Thorntail API, 2.4.0.Final</div>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStore.html\" title=\"class in org.wildfly.swarm.config.ejb3\"><span class=\"typeNameLink\">Prev Class</span></a></li>\n<li><a href=\"../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreSupplier.html\" title=\"interface in org.wildfly.swarm.config.ejb3\"><span class=\"typeNameLink\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../index.html?org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"ClusterPassivationStoreConsumer.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary: </li>\n<li>Nested | </li>\n<li>Field | </li>\n<li>Constr | </li>\n<li><a href=\"#method.summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail: </li>\n<li>Field | </li>\n<li>Constr | </li>\n<li><a href=\"#method.detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip.navbar.bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n<p class=\"legalCopy\"><small>Copyright © 2019 <a href=\"http://www.jboss.org\">JBoss by Red Hat</a>. All rights reserved.</small></p>\n</body>\n</html>\n", "meta": {"content_hash": "23a40d844598ca106cb55992db8a162b", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 732, "avg_line_length": 47.068548387096776, "alnum_prop": 0.6682086867129272, "repo_name": "wildfly-swarm/wildfly-swarm-javadocs", "id": "502b0b4e3260af1ed1411b9f43ef8f2ae16f3149", "size": "11673", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "2.4.0.Final/apidocs/org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "using System;\nusing NUnit.Framework;\nusing Moq;\nusing Rothko.Model;\nusing Rothko.Commands;\nusing Rothko.Interfaces.Services;\nusing System.Collections.Generic;\nusing Rothko.Enumerators;\n\nnamespace Rothko.Tests.Commands\n{\n\t[TestFixture]\n\tpublic class AttackCommandTests\n\t{\n\t\tMock<IRandomNumberGeneratorService> _RandomNumberGeneratorServiceMock;\n\t\tIRandomNumberGeneratorService _RandomNumberGeneratorService;\n\t\tUnit _AttackingUnit;\n\t\tUnit _DefendingUnit;\n\t\tUnit _CarriedUnit;\n\t\tTile _AttackingUnitTile;\n\t\tTile _DefendingUnitTile;\n\t\tDefenseMultiplier _DefenseMultiplierDefendingUnit;\n\t\tAttackMultiplier _AttackMultiplier;\n\t\tList<Tile> _Tiles;\n\t\tList<DefenseMultiplier> _DefenseMultipliers;\n\t\tList<AttackMultiplier> _AttackMultipliers;\n\t\tMap _Map;\n\t\tAttackCommand _Command;\n\n\t\t[SetUp]\n\t\tpublic void SetUp()\n\t\t{\n\t\t\t_RandomNumberGeneratorServiceMock = new Mock<IRandomNumberGeneratorService>();\n\t\t\t_RandomNumberGeneratorService = _RandomNumberGeneratorServiceMock.Object;\n\n\t\t\t_AttackingUnit = new Unit()\n\t\t\t{\n\t\t\t\tID = 1,\n\t\t\t\tIDUnitType = 1,\n\t\t\t\tHealthPoints = 10,\n\t\t\t\tX = 1,\n\t\t\t\tY = 1,\n\t\t\t\tState = UnitState.Attacking\n\t\t\t};\n\n\t\t\t_DefendingUnit = new Unit()\n\t\t\t{\n\t\t\t\tID = 2,\n\t\t\t\tIDUnitType = 2,\n\t\t\t\tHealthPoints = 10,\n\t\t\t\tX = 2,\n\t\t\t\tY = 1,\n\t\t\t\tNumberOfUnitsBeingCarried = 1,\n\t\t\t\tNumberOfUnitsThatCanBeCarried = 1\n\t\t\t};\n\n\t\t\t_CarriedUnit = new Unit() { ID = 3, HealthPoints = 10, IDUnitCarrier = _DefendingUnit.ID };\n\n\t\t\t_AttackingUnitTile = new Tile()\n\t\t\t{\n\t\t\t\tID = 1,\n\t\t\t\tIDTileType = 1,\n\t\t\t\tX = _AttackingUnit.X,\n\t\t\t\tY = _AttackingUnit.Y\n\t\t\t};\n\n\t\t\t_DefendingUnitTile = new Tile()\n\t\t\t{\n\t\t\t\tID = 2,\n\t\t\t\tIDTileType = 2,\n\t\t\t\tX = _DefendingUnit.X,\n\t\t\t\tY = _DefendingUnit.Y\n\t\t\t};\n\n\t\t\t_AttackMultiplier = new AttackMultiplier()\n\t\t\t{\n\t\t\t\tAttackingUnitIDUnitType = _AttackingUnit.IDUnitType,\n\t\t\t\tDefendingUnitIDUnitType = _DefendingUnit.IDUnitType\n\t\t\t};\n\n\t\t\t_DefenseMultiplierDefendingUnit = new DefenseMultiplier()\n\t\t\t{\n\t\t\t\tIDTileType = 2,\n\t\t\t\tIDUnitType = 2\n\t\t\t};\n\n\t\t\t_Tiles = new List<Tile>();\n\n\t\t\t_Tiles.Add (_AttackingUnitTile);\n\t\t\t_Tiles.Add (_DefendingUnitTile);\n\n\t\t\t_Map = new Map();\n\n\t\t\t_Map.Units.Add (_AttackingUnit);\n\t\t\t_Map.Units.Add (_DefendingUnit);\n\t\t\t_Map.Units.Add (_CarriedUnit);\n\n\t\t\t_Map.Tiles = _Tiles;\n\n\t\t\t_Map.IDUnit_Selected = 1;\n\n\t\t\t_DefenseMultipliers = new List<DefenseMultiplier>();\n\n\t\t\t_DefenseMultipliers.Add (_DefenseMultiplierDefendingUnit);\n\n\t\t\t_AttackMultipliers = new List<AttackMultiplier>();\n\n\t\t\t_AttackMultipliers.Add (_AttackMultiplier);\n\n\t\t\t_Command = new AttackCommand(\n\t\t\t\t_RandomNumberGeneratorService,\n\t\t\t\t_Map, _Map.Units, _Tiles, \n\t\t\t\t_AttackMultipliers,\n\t\t\t\t_DefenseMultipliers, _DefendingUnit.X, _DefendingUnit.Y);\n\t\t}\n\n\t\t[Test]\n\t\t[TestCase(5, 10, 1, 1, 1, 5, 10, Result = 1)]\n\t\t[TestCase(5, 10, 1, 1, 1, 4, 10, Result = 1)]\n\t\t[TestCase(5, 10, 1, 1, 1, 3, 10, Result = 2)]\n\t\t[TestCase(5, 10, 1, 1, 1, 2, 10, Result = 3)]\n\t\t[TestCase(5, 10, 1, 1, 1, 1, 10, Result = 5)]\n\t\t[TestCase(1, 10, 1, 1, 1, 5, 10, Result = 0)]\n\t\t[TestCase(2, 10, 1, 1, 1, 5, 10, Result = 0)]\n\t\t[TestCase(3, 10, 1, 1, 1, 5, 10, Result = 1)]\n\t\t[TestCase(4, 10, 1, 1, 1, 5, 10, Result = 1)]\n\t\t[TestCase(5, 9, 1, 1, 1, 5, 10, Result = 1)]\n\t\t[TestCase(5, 8, 1, 1, 1, 5, 10, Result = 1)]\n\t\t[TestCase(5, 7, 1, 1, 1, 5, 10, Result = 1)]\n\t\t[TestCase(5, 6, 1, 1, 1, 5, 10, Result = 1)]\n\t\t[TestCase(5, 5, 1, 1, 1, 5, 10, Result = 1)]\n\t\t[TestCase(5, 4, 1, 1, 1, 5, 10, Result = 0)]\n\t\t[TestCase(5, 3, 1, 1, 1, 5, 10, Result = 0)]\n\t\t[TestCase(5, 2, 1, 1, 1, 5, 10, Result = 0)]\n\t\t[TestCase(5, 1, 1, 1, 1, 5, 10, Result = 0)]\n\t\t[TestCase(5, 10, 1.5, 1, 1, 5, 10, Result = 2)]\n\t\t[TestCase(5, 10, 1.5, 1, 1, 4, 10, Result = 2)]\n\t\t[TestCase(5, 10, 1.5, 1, 1, 3, 10, Result = 3)]\n\t\t[TestCase(5, 10, 1.5, 1, 1, 2, 10, Result = 4)]\n\t\t[TestCase(5, 10, 1.5, 1, 1, 1, 10, Result = 8)]\n\t\tpublic int TestDefendingUnitHealthPointsAfterAttack(\n\t\t\tint attackingUnitAttackPoints,\n\t\t\tint attackingUnitHealthPoints,\n\t\t\tdecimal attackingMultiplier,\n\t\t\tdecimal terrainDefenseMultiplier,\n\t\t\tdecimal luckMultiplier,\n\t\t\tint defendingUnitDefensePoints,\n\t\t\tint defendingUnitHealthPoints)\n\t\t{\n\t\t\t_AttackingUnit.AttackPoints = attackingUnitAttackPoints;\n\t\t\t_AttackingUnit.HealthPoints = attackingUnitHealthPoints;\n\n\t\t\t_AttackMultiplier.Multiplier = attackingMultiplier;\n\t\t\t_DefenseMultiplierDefendingUnit.Multiplier = terrainDefenseMultiplier;\n\n\t\t\t_DefendingUnit.DefensePoints = defendingUnitDefensePoints;\n\t\t\t_DefendingUnit.HealthPoints = defendingUnitHealthPoints;\n\n\t\t\t_RandomNumberGeneratorServiceMock\n\t\t\t\t\t.Setup(r => r.GetRandomNumber(It.IsAny<int>(), It.IsAny<int>()))\n\t\t\t\t\t.Returns((int)(luckMultiplier * 100));\n\n\t\t\t_Command.Execute();\n\n\t\t\treturn defendingUnitHealthPoints - _DefendingUnit.HealthPoints;\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IfUnitBeingAttackedGetsKilledAndIsCarryingOtherUnitsThoseUnitsShouldAlsoBeKilled()\n\t\t{\n\t\t\tSetUpKillingAttackCommand();\n\n\t\t\t_Command.Execute();\n\n\t\t\tAssert.IsTrue(_DefendingUnit.HealthPoints <= 0);\n\t\t\tAssert.AreEqual(0, _CarriedUnit.HealthPoints);\n\t\t\tAssert.AreEqual(UnitState.Destroyed, _CarriedUnit.State);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void IfUnitGetsHealthBellowZeroShouldHaveItsStateChangedToBeingDestroyed()\n\t\t{\n\t\t\tSetUpKillingAttackCommand();\n\n\t\t\t_Command.Execute();\n\n\t\t\tAssert.AreEqual(UnitState.BeingDestroyed, _DefendingUnit.State);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExecuteCommandShouldSetAttackingUnitStateToIdle ()\n\t\t{\n\t\t\tSetUpKillingAttackCommand();\n\n\t\t\t_Command.Execute();\n\n\t\t\tAssert.AreEqual(UnitState.Idle, _AttackingUnit.State);\n\t\t}\n\n\t\tprivate void SetUpKillingAttackCommand()\n\t\t{\n\t\t\t_AttackingUnit.AttackPoints = 9999;\n\t\t\t_AttackingUnit.HealthPoints = 9999;\n\n\t\t\t_AttackMultiplier.Multiplier = 1;\n\t\t\t_DefenseMultiplierDefendingUnit.Multiplier = 1;\n\n\t\t\t_DefendingUnit.DefensePoints = 1;\n\t\t\t_DefendingUnit.HealthPoints = 1;\n\n\t\t\t_RandomNumberGeneratorServiceMock\n\t\t\t\t\t.Setup(r => r.GetRandomNumber(It.IsAny<int>(), It.IsAny<int>()))\n\t\t\t\t\t.Returns(100);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void ExecuteCommandShouldSetGameStateToIdle()\n\t\t{\n\t\t\tSetUpKillingAttackCommand();\n\n\t\t\t_Map.GameState = GameState.UnitAttacking;\n\n\t\t\t_Command.Execute();\n\n\t\t\tAssert.AreEqual(GameState.Idle, _Map.GameState);\n\t\t}\n\n\t\t[Test]\n\t\tpublic void UnitsBeingCarriedShouldNotBeSelectedAsDefendingUnit()\n\t\t{\n\t\t\tSetUpKillingAttackCommand();\n\n\t\t\t_Map.Units.Remove (_DefendingUnit);\n\t\t\t_Map.Units.Add (_DefendingUnit);\n\t\t\t\n\t\t\t_CarriedUnit.X = _DefendingUnit.X;\n\t\t\t_CarriedUnit.Y = _DefendingUnit.Y;\n\n\t\t\t_Command.Execute();\n\n\t\t\tAssert.IsFalse(_DefendingUnit.Active);\n\t\t}\n\t}\n}\n\n", "meta": {"content_hash": "6d4e799356a3df83d65f3e57e5f0f516", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 96, "avg_line_length": 26.30204081632653, "alnum_prop": 0.6814090626939789, "repo_name": "t-recx/Rothko", "id": "f0f3e6bdeb1854fb44abdbad2b1ed45de4c80b69", "size": "6444", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Rothko.Tests/Commands/AttackCommandTests.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "832326"}]}} +{"text": "\ufeffusing DragonSpark.Text;\nusing Markdig;\nusing Markdig.Renderers;\nusing SmartFormat;\nusing System.IO;\nusing System.Text;\n\nnamespace DragonSpark.Application.Messaging;\n\npublic class MarkdownEmailTemplate<T> : IFormatter<T> where T : notnull\n{\n\treadonly string _template;\n\n\tprotected MarkdownEmailTemplate(byte[] data) : this(Encoding.UTF8.GetString(data)) {}\n\n\tprotected MarkdownEmailTemplate(string template) => _template = template;\n\n\tpublic string Get(T parameter)\n\t{\n\t\tvar content = Smart.Format(_template, parameter);\n\t\tvar pipeline = new MarkdownPipelineBuilder().Build();\n\t\tvar markdown = Markdown.Parse(content, pipeline);\n\t\tusing var writer = new StringWriter();\n\t\tvar renderer = new HtmlRenderer(writer);\n\n\t\tpipeline.Setup(renderer);\n\t\trenderer.Render(markdown);\n\n\t\tvar result = writer.ToString();\n\t\treturn result;\n\t}\n}", "meta": {"content_hash": "a90e8fffaeade1285e68fb308a0a7eee", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 86, "avg_line_length": 26.6875, "alnum_prop": 0.7330210772833724, "repo_name": "DragonSpark/Framework", "id": "7d2a367e52dc451c643279466c2677a8a03c0455", "size": "856", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DragonSpark.Application/Messaging/MarkdownEmailTemplate.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "2079497"}, {"name": "CSS", "bytes": "673"}, {"name": "HTML", "bytes": "103546"}, {"name": "JavaScript", "bytes": "1311"}, {"name": "TypeScript", "bytes": "2495"}]}} +{"text": "/* @flow */\nimport React from 'react';\nimport Icon from 'mineral-ui/Icon';\n\nimport type { IconProps } from 'mineral-ui/Icon/types';\n\n/* eslint-disable prettier/prettier */\nexport default function IconTrendingFlat(props: IconProps) {\n const iconProps = {\n rtl: true,\n ...props\n };\n\n return (\n <Icon {...iconProps}>\n <g>\n <path d=\"M22 12l-4-4v3H3v2h15v3z\"/>\n </g>\n </Icon>\n );\n}\n\nIconTrendingFlat.displayName = 'IconTrendingFlat';\nIconTrendingFlat.category = 'action';\n", "meta": {"content_hash": "604ed3a973322110cb450160ad49f68d", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 60, "avg_line_length": 20.833333333333332, "alnum_prop": 0.642, "repo_name": "mineral-ui/mineral-ui", "id": "13fda35f9455c000ba3c83ee973168843dcaf16d", "size": "500", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/mineral-ui-icons/src/IconTrendingFlat.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "9584"}, {"name": "HTML", "bytes": "6548"}, {"name": "JavaScript", "bytes": "2408689"}]}} +{"text": "package centreon::common::emc::navisphere::mode::faults;\n\nuse base qw(centreon::plugins::mode);\n\nuse strict;\nuse warnings;\n\nsub new {\n my ($class, %options) = @_;\n my $self = $class->SUPER::new(package => __PACKAGE__, %options);\n bless $self, $class;\n \n $options{options}->add_options(arguments =>\n { \n });\n\n return $self;\n}\n\nsub check_options {\n my ($self, %options) = @_;\n $self->SUPER::init(%options);\n}\n\nsub run {\n my ($self, %options) = @_;\n my $clariion = $options{custom};\n \n my $response = $clariion->execute_command(cmd => 'faults -list', secure_only => 1);\n chomp $response;\n \n if ($response =~ /The array is operating normally/msg) {\n $self->{output}->output_add(severity => 'ok',\n short_msg => 'The array is operating normally');\n } else {\n $self->{output}->output_add(long_msg => $response);\n $self->{output}->output_add(severity => 'critical',\n short_msg => 'Problem detected (see detailed output for more details');\n }\n \n $self->{output}->display();\n $self->{output}->exit();\n}\n\n1;\n\n__END__\n\n=head1 MODE\n\nDetect faults on the array.\n\n=over 8\n\n=back\n\n=cut\n", "meta": {"content_hash": "10a72fe84164bebf091b4d7bd81810c1", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 107, "avg_line_length": 22.50877192982456, "alnum_prop": 0.5276695245518317, "repo_name": "centreon/centreon-plugins", "id": "c82a0c097bb01cc0e6f09fb6bcb4c57221adacab", "size": "2043", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "centreon/common/emc/navisphere/mode/faults.pm", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "719"}, {"name": "Perl", "bytes": "21731182"}]}} +{"text": "ACCEPTED\n\n#### According to\nIndex Fungorum\n\n#### Published in\nnull\n\n#### Original name\nOpegrapha urosperma var. substellata Redinger\n\n### Remarks\nnull", "meta": {"content_hash": "37112b011a3115e21bd00371621d378e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 45, "avg_line_length": 11.538461538461538, "alnum_prop": 0.7333333333333333, "repo_name": "mdoering/backbone", "id": "1c839667d5252f95ecd899d67bf20cbdafd4c512", "size": "219", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Arthoniomycetes/Arthoniales/Roccellaceae/Opegrapha/Opegrapha urosperma/Opegrapha urosperma substellata/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "var autoSignIn = function(mode) {\n if (cmapiAvailable) {\n return navigator.credentials.get({\n // TODO 8-4: Reflect a silent access\n password: true\n }).then(function(cred) {\n if (cred) {\n var form = new FormData();\n var csrf_token = document.querySelector('#csrf_token').value;\n form.append('csrf_token', csrf_token);\n\n switch (cred.type) {\n case 'password':\n form.append('email', cred.id);\n form.append('password', cred.password);\n return fetch('/auth/password', {\n method: 'POST',\n credentials: 'include',\n body: form\n });\n }\n return Promise.reject();\n } else {\n return Promise.reject();\n }\n }).then(function(res) {\n if (res.status === 200) {\n return Promise.resolve();\n } else {\n return Promise.reject();\n }\n });\n } else {\n return Promise.reject();\n }\n};\n// TODO 7-1: Sign-In a user upon landing the page\n", "meta": {"content_hash": "7de7adefe33127422255c46659aa8c8c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 69, "avg_line_length": 27.56756756756757, "alnum_prop": 0.5205882352941177, "repo_name": "googlecodelabs/credential-management-api", "id": "56766ba8e89debefc7bb9ccff55fccb65acec421", "size": "1020", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "step06/static/scripts/auto.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "5384419"}, {"name": "JavaScript", "bytes": "47506"}, {"name": "Python", "bytes": "59500"}]}} +{"text": "// Copyright 2016-2022, University of Colorado Boulder\n\n/**\n * Property whose value must be true or false. Truthy/falsy values are invalid.\n *\n * @author Sam Reid (PhET Interactive Simulations)\n * @author Chris Malley (PixelZoom, Inc.)\n */\n\nimport optionize, { EmptySelfOptions } from '../../phet-core/js/optionize.js';\nimport StrictOmit from '../../phet-core/js/types/StrictOmit.js';\nimport BooleanIO from '../../tandem/js/types/BooleanIO.js';\nimport axon from './axon.js';\nimport Property, { PropertyOptions } from './Property.js';\n\ntype SelfOptions = EmptySelfOptions;\n\n// client cannot specify superclass options that are controlled by BooleanProperty\nexport type BooleanPropertyOptions = SelfOptions & StrictOmit<PropertyOptions<boolean>, 'isValidValue' | 'valueType' | 'phetioValueType'>;\n\nexport default class BooleanProperty extends Property<boolean> {\n\n public constructor( value: boolean, providedOptions?: BooleanPropertyOptions ) {\n\n // Fill in superclass options that are controlled by BooleanProperty.\n const options = optionize<BooleanPropertyOptions, SelfOptions, PropertyOptions<boolean>>()( {\n valueType: 'boolean',\n phetioValueType: BooleanIO\n }, providedOptions );\n\n super( value, options );\n }\n\n public toggle(): void {\n this.value = !this.value;\n }\n}\n\naxon.register( 'BooleanProperty', BooleanProperty );", "meta": {"content_hash": "e8a23d1cddb84f274fec18ffa493257c", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 138, "avg_line_length": 34.743589743589745, "alnum_prop": 0.7357933579335794, "repo_name": "phetsims/axon", "id": "bdb01e38dcb468ddb5fc90c93960c53ce807de2a", "size": "1355", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/BooleanProperty.ts", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "4146"}, {"name": "JavaScript", "bytes": "22970"}, {"name": "TypeScript", "bytes": "329832"}]}} +{"text": "FROM balenalib/jetson-nano-fedora:33-build\n\nENV NODE_VERSION 15.14.0\nENV YARN_VERSION 1.22.4\n\nRUN for key in \\\n\t6A010C5166006599AA17F08146C2130DFD2497F5 \\\n\t; do \\\n\t\tgpg --keyserver pgp.mit.edu --recv-keys \"$key\" || \\\n\t\tgpg --keyserver keyserver.pgp.com --recv-keys \"$key\" || \\\n\t\tgpg --keyserver ha.pool.sks-keyservers.net --recv-keys \"$key\" ; \\\n\tdone \\\n\t&& curl -SLO \"http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-arm64.tar.gz\" \\\n\t&& echo \"6d5e0074fe4a45d444bc581aa1fd7ce7081b8491b0f785414a6e5cc30c42854a node-v$NODE_VERSION-linux-arm64.tar.gz\" | sha256sum -c - \\\n\t&& tar -xzf \"node-v$NODE_VERSION-linux-arm64.tar.gz\" -C /usr/local --strip-components=1 \\\n\t&& rm \"node-v$NODE_VERSION-linux-arm64.tar.gz\" \\\n\t&& curl -fSLO --compressed \"https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz\" \\\n\t&& curl -fSLO --compressed \"https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc\" \\\n\t&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \\\n\t&& mkdir -p /opt/yarn \\\n\t&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \\\n\t&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \\\n\t&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \\\n\t&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \\\n\t&& npm config set unsafe-perm true -g --unsafe-perm \\\n\t&& rm -rf /tmp/*\n\nCMD [\"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\"]\n\n RUN curl -SLO \"https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh\" \\\n && echo \"Running test-stack@node\" \\\n && chmod +x test-stack@node.sh \\\n && bash test-stack@node.sh \\\n && rm -rf test-stack@node.sh \n\nRUN [ ! -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: Fedora 33 \\nVariant: build variant \\nDefault variable(s): UDEV=off \\nThe following software stack is preinstalled: \\nNode.js v15.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\n\nRUN echo $'#!/bin/sh.real\\nbalena-info\\nrm -f /bin/sh\\ncp /bin/sh.real /bin/sh\\n/bin/sh \"$@\"' > /bin/sh-shim \\\n\t&& chmod +x /bin/sh-shim \\\n\t&& cp /bin/sh /bin/sh.real \\\n\t&& mv /bin/sh-shim /bin/sh", "meta": {"content_hash": "eb72559500ecf971f1c4e10f93954ff3", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 691, "avg_line_length": 66.65853658536585, "alnum_prop": 0.7083790706183681, "repo_name": "nghiant2710/base-images", "id": "8bf87e3dd50f9b2e6725744ad4056b6ff0cc30cf", "size": "2754", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/node/jetson-nano/fedora/33/15.14.0/build/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Dockerfile", "bytes": "144558581"}, {"name": "JavaScript", "bytes": "16316"}, {"name": "Shell", "bytes": "368690"}]}} +{"text": "\n\n#include <windows.h>\n\n#include \"iup.h\"\n\n#include \"iup_object.h\"\n#include \"iup_attrib.h\"\n#include \"iup_str.h\"\n#include \"iup_dialog.h\"\n\n#include \"iup_drv.h\"\n#include \"iupwin_drv.h\"\n#include \"iupwin_str.h\"\n\n\nstatic void winMessageDlgHelpCallback(HELPINFO* HelpInfo)\n{\n Ihandle* ih = (Ihandle*)HelpInfo->dwContextId;\n Icallback cb = (Icallback)IupGetCallback(ih, \"HELP_CB\");\n if (cb && cb(ih) == IUP_CLOSE)\n {\n if (iupStrEqualNoCase(iupAttribGetStr(ih, \"BUTTONS\"), \"OK\")) /* only one button */\n EndDialog((HWND)HelpInfo->hItemHandle, IDOK);\n else\n EndDialog((HWND)HelpInfo->hItemHandle, IDCANCEL);\n }\n}\n\nstatic int winMessageDlgPopup(Ihandle* ih, int x, int y)\n{\n InativeHandle* parent = iupDialogGetNativeParent(ih);\n int result, num_but = 2;\n DWORD dwStyle = MB_TASKMODAL;\n char *icon, *buttons;\n (void)x;\n (void)y;\n\n /* if parent is used then it will be modal only relative to it */\n /* if (!parent)\n parent = GetActiveWindow(); */\n\n icon = iupAttribGetStr(ih, \"DIALOGTYPE\");\n if (iupStrEqualNoCase(icon, \"ERROR\"))\n dwStyle |= MB_ICONERROR;\n else if (iupStrEqualNoCase(icon, \"WARNING\"))\n dwStyle |= MB_ICONWARNING;\n else if (iupStrEqualNoCase(icon, \"INFORMATION\"))\n dwStyle |= MB_ICONINFORMATION;\n else if (iupStrEqualNoCase(icon, \"QUESTION\"))\n dwStyle |= MB_ICONQUESTION;\n\n buttons = iupAttribGetStr(ih, \"BUTTONS\");\n if (iupStrEqualNoCase(buttons, \"OKCANCEL\"))\n dwStyle |= MB_OKCANCEL;\n else if (iupStrEqualNoCase(buttons, \"YESNO\"))\n dwStyle |= MB_YESNO;\n else\n {\n dwStyle |= MB_OK;\n num_but = 1;\n }\n\n if (IupGetCallback(ih, \"HELP_CB\"))\n dwStyle |= MB_HELP;\n\n if (num_but == 2 && iupAttribGetInt(ih, \"BUTTONDEFAULT\") == 2)\n dwStyle |= MB_DEFBUTTON2;\n else\n dwStyle |= MB_DEFBUTTON1;\n\n {\n MSGBOXPARAMS MsgBoxParams;\n MsgBoxParams.cbSize = sizeof(MSGBOXPARAMS);\n MsgBoxParams.hwndOwner = parent;\n MsgBoxParams.hInstance = NULL;\n MsgBoxParams.lpszText = iupwinStrToSystem(iupAttribGet(ih, \"VALUE\"));\n MsgBoxParams.lpszCaption = iupwinStrToSystem(iupAttribGet(ih, \"TITLE\"));\n MsgBoxParams.dwStyle = dwStyle;\n MsgBoxParams.lpszIcon = NULL;\n MsgBoxParams.dwContextHelpId = (DWORD_PTR)ih;\n MsgBoxParams.lpfnMsgBoxCallback = (MSGBOXCALLBACK)winMessageDlgHelpCallback;\n MsgBoxParams.dwLanguageId = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);\n\n result = MessageBoxIndirect(&MsgBoxParams);\n }\n\n if (result == 0)\n {\n iupAttribSet(ih, \"BUTTONRESPONSE\", NULL);\n return IUP_ERROR;\n }\n\n if (result == IDNO || result == IDCANCEL)\n iupAttribSet(ih, \"BUTTONRESPONSE\", \"2\");\n else\n iupAttribSet(ih, \"BUTTONRESPONSE\", \"1\");\n\n return IUP_NOERROR;\n}\n\nvoid iupdrvMessageDlgInitClass(Iclass* ic)\n{\n ic->DlgPopup = winMessageDlgPopup;\n}\n\n/* \nIn Windows it will always sound a beep. The beep is different for each dialog type.\n*/\n", "meta": {"content_hash": "cc08d3cb78c48be79fdb4b402c86c4d8", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 86, "avg_line_length": 26.08256880733945, "alnum_prop": 0.6820260288427717, "repo_name": "sanikoyes/iup", "id": "3090312abfb4d6ad094d86fad44862978fc88022", "size": "2945", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/win/iupwin_messagedlg.c", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "34"}, {"name": "Batchfile", "bytes": "10717"}, {"name": "C", "bytes": "9868012"}, {"name": "C++", "bytes": "6978963"}, {"name": "CSS", "bytes": "14107"}, {"name": "HTML", "bytes": "2240422"}, {"name": "Lua", "bytes": "682394"}, {"name": "Makefile", "bytes": "139721"}, {"name": "Shell", "bytes": "12420"}]}} +{"text": "Sync Facebook Events Calendar to Google Calendar.\n\nFor Facebook and Google Calendar users\n\nWho want to be super organised and not miss out on events or double book themselves\n\nFacebookGoogleCalendarSync\n\nIs a gem\n\nThat imports Facebook events into Google Calendar.\n\nUnlike the existing \"import the iCal URL provided by Facebook\" solution\n\nThis gem allows the user to delete events that they are not interested in without going to Facebook to click \"Not Going\",\n\nWhile also allowing synchronisation to be reliably and regularly scheduled* using cron or similar.\n\nIt also displays the details of the \"private\" Facebook events which would otherwise be hidden by Google Calendar.\n\n*Google Calendar updates external calendars at unpredictable times, far too rarely (often more than 24 hours between updates) and doesn't allow manual refreshes. It also doesn't notify you when it has been unable to update your calendar, so you don't know when you're looking at an out of date version.\n\n## Installation\n\n $ gem install facebook-google-calendar-sync\n\nCreate a Goggle permissions file to allow the gem to access your Google Calendar. This command will open a browser window. (Have found this did not work in jruby, tested succesfully in MRI ruby-1.9.3-p392)\n\n $ bundle exec google-api oauth-2-login --scope=https://www.googleapis.com/auth/calendar --client-id=436161995365.apps.googleusercontent.com --client-secret=WgTEjg-b8rXCRL28hweLcSuV\n\nYou will now have a .google-api.yaml file in your home directory. Note: the gem can only access your calendar data if it has this file. The synchronisation process will run locally on your computer - no external service will have access to your Google Calendar.\n\nFor more information on the last step see https://developers.google.com/google-apps/calendar/firstapp#register and the Ruby tab on https://developers.google.com/google-apps/calendar/instantiate\n\n## Usage\n\nYou can find your Facebook iCal URL by going to your Events page, and clicking the cog icon and selecting Export. Copy the URL from the \"upcoming events\" link, and change the \"webcal://\" prefix to \"http://\".\n\nTo run:\n\n $ bundle exec facebook-google-calendar-sync -f \"http://www.facebook.com/ical/u.php?uid=12345&key=67890\"\n\nIf your Google API YAML file isn't stored at ~/.google-api.yaml, you can specify the location using the command line option \"-c\"\n\nBy default, your events will be synchronised to a calendar called \"My Facebook Events\". If this does not exist, it will be created using the timezone of your primary calendar. You can specify the name of the calendar (which may be a pre-existing one) using the command line option \"-n\"\n\n## Long term usage\n\nYou will probably want to set this up as a cron job or similar. See the examples directory for more information.\n\n## Known issues\n\nWhen a Facebook event does not have a location, the time in the iCal export will be up to 2 days ahead of the actual date displayed in Facebook. This behaviour can also be observed in the Android mobile client. This may be because the timezone is incorrectly set when there is no location.\n\nIf a Facebook event has synchronised to your Google calendar then deleted, if the synchronisation process attempts (incorrectly) to add it again, Google Calendar will throw an exception saying that an event with this identifier already exists.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## TODO\n\n* Tests....\n* Work out if there is a way to fix the event date when there is no location.\n", "meta": {"content_hash": "ceb8b37f67696d23c8179c5f440009d2", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 302, "avg_line_length": 54.0735294117647, "alnum_prop": 0.7813434865379385, "repo_name": "bethesque/facebook-google-calendar-sync", "id": "13e25798c6504df93563fb1cbab6e02899efb3d9", "size": "3707", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "21511"}]}} +{"text": "<img src=\"https://mir-cdn.behance.net/v1/rendition/project_modules/1400/49ea4a53385057.59325596f150b.jpg\" width=\"420\">\n\n## Agivest \nAgivest is a populous investment platform with a Crowd Investment system that allows everyone to invest from a hundred thousand rupiah.\n```\nSelect the comodities you want invest\nInput nominal invest\nTransfer Money\n```\n## Architecture\nMVC (Model View Controller) - Code Igniter\n\n## Library Used\n- Admin LTE\n\n## Running\n- Clone this repository\n- Activate your xamp / wamp\n- Open your browser and type localhost/agivest\n\n## Preview\ncheck website : -\n", "meta": {"content_hash": "3f573c569132827bbb5e554a793c0432", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 135, "avg_line_length": 26.318181818181817, "alnum_prop": 0.768566493955095, "repo_name": "kahell/agivest", "id": "c3fbb88080027a0368cab380375da7c762891627", "size": "589", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "808277"}, {"name": "HTML", "bytes": "12170319"}, {"name": "JavaScript", "bytes": "2243760"}, {"name": "PHP", "bytes": "2923840"}, {"name": "Shell", "bytes": "4440"}]}} +{"text": "\r\nusing namespace std;\r\n\r\nMiddleEarSimpleFilter::MiddleEarSimpleFilter()\r\n{\r\n\tmemset(this, 0, sizeof(MiddleEarSimpleFilter));\r\n\tmLogger = new Logger();\r\n\tSetModuleName(\"MiddleEarSimpleFilter\");\r\n}\r\n\r\nMiddleEarSimpleFilter::~MiddleEarSimpleFilter()\r\n{\r\n\tif (mModuleName != NULL)\r\n\t\tdelete [] mModuleName;\r\n}\r\n\r\nint MiddleEarSimpleFilter::ReadParameters(char *ParameterFileName)\r\n{\r\n\tif (mModuleName == NULL)\r\n\t\treturn ReadParameters(ParameterFileName, \"MiddleEarSimpleFilter\");\r\n\telse\r\n\t\treturn ReadParameters(ParameterFileName, mModuleName);\r\n}\r\n\r\nint MiddleEarSimpleFilter::ReadParameters(char *ParameterFileName, char *SectionName)\r\n{\r\n\tCParameterFile theParamFile(ParameterFileName);\r\n\tParameterStatus Status;\r\n\r\n\tmLogger->Log(\" ReadParameters: %s \\\"%s\\\"\", mModuleName, ParameterFileName);\r\n\r\n\t// Number of channels and Frame Size are passed as parameters to Start, see that function for details\r\n\tStatus = theParamFile.GetParameter(SectionName, \"SampleRate_Hz\", mSampleRate_Hz, 0);\r\n\tStatus = theParamFile.GetParameter(SectionName, \"HighpassCornerFreq_Hz\", mHighpassCornerFreq_Hz, 500.0);\r\n\tStatus = theParamFile.GetParameter(SectionName, \"HighpassFilterOrder\", mHighpassFilterOrder, 2);\r\n\tStatus = theParamFile.GetParameter(SectionName, \"Gain\", mGain, 30.0);\r\n\treturn 1;\r\n}\r\n\r\nint MiddleEarSimpleFilter::Start(int NumInputs, EarlabDataStreamType InputTypes[EarlabMaxIOStreamCount], int InputSize[EarlabMaxIOStreamCount][EarlabMaxIOStreamDimensions], \r\n\t\t\tint NumOutputs, EarlabDataStreamType OutputTypes[EarlabMaxIOStreamCount], int OutputSize[EarlabMaxIOStreamCount][EarlabMaxIOStreamDimensions],\r\n\t\t\tunsigned long OutputElementCounts[EarlabMaxIOStreamCount])\r\n{\r\n\tint i;\r\n\r\n\tmLogger->Log(\" Start: %s\", mModuleName);\r\n\t// Perform some validation on my parameters to make sure I can handle the requested input and output streams...\r\n\tif (NumInputs != 1)\r\n\t\tthrow EarlabException(\"%s: Currently this module can only handle one input stream. Sorry!\", mModuleName);\r\n\r\n\tif (NumOutputs != 1)\r\n\t\tthrow EarlabException(\"%s: Currently this module can only handle one output stream. Sorry!\", mModuleName);\r\n\r\n\tif (InputTypes[0] != WaveformData)\r\n\t\tthrow EarlabException(\"%s: Currently this module can only handle waveform input data streams. Sorry!\", mModuleName);\r\n\r\n\tif (OutputTypes[0] != WaveformData)\r\n\t\tthrow EarlabException(\"%s: Currently this module can only handle waveform output data streams. Sorry!\", mModuleName);\r\n\r\n\tif (InputSize[0][0] != OutputSize[0][0])\r\n\t\tthrow EarlabException(\"%s: Input and output frame lengths must be identical. Sorry!\", mModuleName);\r\n\r\n\tif (InputSize[0][1] != 0)\r\n\t\tthrow EarlabException(\"%s: Input data must be one-dimensional array. Sorry!\", mModuleName);\r\n\r\n\tif (OutputSize[0][1] != 0)\r\n\t\tthrow EarlabException(\"%s: Output signal must be one-dimensional array. Sorry!\", mModuleName);\r\n\r\n\tOutputElementCounts[0] = OutputSize[0][0];\r\n\r\n\tmFrameSize_Samples = OutputSize[0][0];\r\n\tmHighpassFilter = new FirstOrderHighpass[mHighpassFilterOrder];\r\n\tfor (i = 0; i < mHighpassFilterOrder; i++)\r\n\t{\r\n\t\tmHighpassFilter[i].SetSampleRate_Hz(mSampleRate_Hz);\r\n\t\tmHighpassFilter[i].SetCornerFrequency_Hz(mHighpassCornerFreq_Hz);\r\n\t}\r\n\treturn 1;\r\n}\r\n\r\nint MiddleEarSimpleFilter::Advance(EarlabDataStream *InputStream[EarlabMaxIOStreamCount], EarlabDataStream *OutputStream[EarlabMaxIOStreamCount])\r\n{\r\n int i, j;\r\n\tdouble CurSample;\r\n\tFloatMatrixN *Input, *Output;\r\n\r\n\tmLogger->Log(\" Advance: %s\", mModuleName);\r\n\r\n\tInput = ((EarlabWaveformStream *)InputStream[0])->GetData();\t// Only supporting one output at the present moment\r\n\tOutput = ((EarlabWaveformStream *)OutputStream[0])->GetData();\t// Only supporting one output at the present moment\r\n\r\n\tif (Input->Rank(0) != mFrameSize_Samples)\r\n\t\tthrow EarlabException(\"%s: Input size mismatch with Start()\", mModuleName);\r\n\tif (Output->Rank(0) != mFrameSize_Samples)\r\n\t\tthrow EarlabException(\"%s: Output size mismatch with Start()\", mModuleName);\r\n\r\n for (j = 0; j < mFrameSize_Samples; j++)\r\n {\r\n\t\tCurSample = Input->Data(j);\r\n\t\tfor (i = 0; i < mHighpassFilterOrder; i++)\r\n\t\t\tCurSample = mHighpassFilter[i].Filter(CurSample);\r\n Output->Data(j) = (float)(CurSample * mGain);\r\n }\r\n\r\n return j;\r\n}\r\n\r\nint MiddleEarSimpleFilter::Stop(void)\r\n{\r\n\tmLogger->Log(\" Stop: %s\", mModuleName);\r\n\treturn 1;\r\n}\r\n\r\nint MiddleEarSimpleFilter::Unload(void)\r\n{\r\n\tmLogger->Log(\" Unload: %s\", mModuleName);\r\n\treturn 1;\r\n}\r\n\r\nvoid MiddleEarSimpleFilter::SetModuleName(char *ModuleName)\r\n{\r\n\tif (mModuleName != NULL)\r\n\t\tdelete [] mModuleName;\r\n\r\n\tmModuleName = new char[strlen(ModuleName) + 1];\r\n\tstrcpy(mModuleName, ModuleName);\r\n}\r\n\r\nvoid MiddleEarSimpleFilter::SetLogger(Logger *TheLogger)\r\n{\r\n\tif (mLogger != NULL)\r\n\t\tdelete mLogger;\r\n\tmLogger = TheLogger;\r\n}\r\n", "meta": {"content_hash": "e243bbabd83dae712c3addf03d058f57", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 175, "avg_line_length": 35.54477611940298, "alnum_prop": 0.726222968717195, "repo_name": "AuditoryBiophysicsLab/EarLab", "id": "c9b235585df0551e3d40148cbbb708f0924894e5", "size": "4992", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tags/release-2.0/Modules/MiddleEarSimpleFilter/MiddleEarSimpleFilter.cpp", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "2897"}, {"name": "C", "bytes": "2948189"}, {"name": "C#", "bytes": "2669637"}, {"name": "C++", "bytes": "13833969"}, {"name": "HTML", "bytes": "100731"}, {"name": "Inno Setup", "bytes": "76845"}, {"name": "MATLAB", "bytes": "155995"}, {"name": "Makefile", "bytes": "414201"}]}} +{"text": "\n\n#ifndef msvolume_h\n#define msvolume_h\n\n#include \"msfilter.h\"\n\n/**\n * The Volume MSFilter can do:\n * \t- measurements of the input signal power, returned in dbm0 or linear scale\n * \t- apply a gain to the input signal and output this amplified signal to its output.\n * By default gain is 1, in which case the filter does not modify the signal (and even does not\n * copy the buffers, just post them on its output queue.\n**/\n\n\n/*returns a volume meter in db0 (max=0 db0)*/\n#define MS_VOLUME_GET\t\tMS_FILTER_METHOD(MS_VOLUME_ID,0,float)\n/*returns a volume in linear scale between 0 and 1 */\n#define MS_VOLUME_GET_LINEAR\t\tMS_FILTER_METHOD(MS_VOLUME_ID,1,float)\n/* set a gain */\n#define MS_VOLUME_SET_GAIN\t\tMS_FILTER_METHOD(MS_VOLUME_ID,2,float)\n\n#define MS_VOLUME_GET_EA_STATE\t\tMS_FILTER_METHOD(MS_VOLUME_ID,3, int)\n\n#define MS_VOLUME_SET_PEER\t\tMS_FILTER_METHOD(MS_VOLUME_ID,4, MSFilter )\n\n#define MS_VOLUME_SET_EA_THRESHOLD\tMS_FILTER_METHOD(MS_VOLUME_ID,5,float)\n\n#define MS_VOLUME_SET_EA_SPEED\t\tMS_FILTER_METHOD(MS_VOLUME_ID,6,float)\n\n#define MS_VOLUME_SET_EA_FORCE\t\tMS_FILTER_METHOD(MS_VOLUME_ID,7,float)\n\n#define MS_VOLUME_ENABLE_AGC\t\tMS_FILTER_METHOD(MS_VOLUME_ID,8,int)\n\n#define MS_VOLUME_ENABLE_NOISE_GATE\tMS_FILTER_METHOD(MS_VOLUME_ID,9,int)\n\n#define MS_VOLUME_SET_NOISE_GATE_THRESHOLD\tMS_FILTER_METHOD(MS_VOLUME_ID,10,float)\n\n#define MS_VOLUME_SET_EA_SUSTAIN\tMS_FILTER_METHOD(MS_VOLUME_ID,11,int)\n\n#define MS_VOLUME_SET_NOISE_GATE_FLOORGAIN MS_FILTER_METHOD(MS_VOLUME_ID,12,float)\n\n/* set a gain in db */\n#define MS_VOLUME_SET_DB_GAIN\t\tMS_FILTER_METHOD(MS_VOLUME_ID,13,float)\n\n/* get a linear gain */\n#define MS_VOLUME_GET_GAIN\t\tMS_FILTER_METHOD(MS_VOLUME_ID,14,float)\n\nextern MSFilterDesc ms_volume_desc;\n\n#endif\n", "meta": {"content_hash": "fdbb7dd4986ee23e8f5ece23b3b04bb1", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 95, "avg_line_length": 33.01923076923077, "alnum_prop": 0.7396622015142691, "repo_name": "Huawei/eSDK_eLTE_SDK_Windows", "id": "da20da48627d51b0867b95decaadb9f1e67e4c15", "size": "2536", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/platform/SDK/include/mediastreamer2/include/mediastreamer2/msvolume.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "45600"}, {"name": "C", "bytes": "1941730"}, {"name": "C++", "bytes": "9810262"}, {"name": "CMake", "bytes": "3613"}, {"name": "Makefile", "bytes": "209539"}, {"name": "Objective-C", "bytes": "250083"}, {"name": "Protocol Buffer", "bytes": "9363"}]}} +{"text": "\r\n#ifndef __RenderTargetListener_H__\r\n#define __RenderTargetListener_H__\r\n\r\n\r\n#include \"OgrePrerequisites.h\"\r\n\r\nnamespace Ogre {\r\n\r\n\t/** \\addtogroup Core\r\n\t* @{\r\n\t*/\r\n\t/** \\addtogroup RenderSystem\r\n\t* @{\r\n\t*/\r\n\t/** Struct containing information about a RenderTarget event.\r\n */\r\n struct RenderTargetEvent\r\n {\r\n /// The source of the event being raised\r\n RenderTarget* source;\r\n };\r\n\r\n /** Struct containing information about a RenderTarget Viewport-specific event.\r\n */\r\n struct RenderTargetViewportEvent\r\n {\r\n /// The source of the event being raised\r\n Viewport* source;\r\n };\r\n\r\n /** A interface class defining a listener which can be used to receive\r\n notifications of RenderTarget events.\r\n @remarks\r\n A 'listener' is an interface designed to be called back when\r\n particular events are called. This class defines the\r\n interface relating to RenderTarget events. In order to receive\r\n notifications of RenderTarget events, you should create a subclass of\r\n RenderTargetListener and override the methods for which you would like\r\n to customise the resulting processing. You should then call\r\n RenderTarget::addListener passing an instance of this class.\r\n There is no limit to the number of RenderTarget listeners you can register,\r\n allowing you to register multiple listeners for different purposes.\r\n </p>\r\n RenderTarget events occur before and after the target is updated as a whole,\r\n and before and after each viewport on that target is updated. Each RenderTarget\r\n holds it's own set of listeners, but you can register the same listener on\r\n multiple render targets if you like since the event contains details of the\r\n originating RenderTarget.\r\n */\r\n class _OgreExport RenderTargetListener\r\n {\r\n /*\r\n Note that this could have been an abstract class, but I made\r\n the explicit choice not to do this, because I wanted to give\r\n people the option of only implementing the methods they wanted,\r\n rather than having to create 'do nothing' implementations for\r\n those they weren't interested in. As such this class follows\r\n the 'Adapter' classes in Java rather than pure interfaces.\r\n */\r\n public:\r\n\t\tvirtual ~RenderTargetListener() {}\r\n /** Called just before a RenderTarget is about to be rendered into.\r\n @remarks\r\n This event is raised just before any of the viewports on the target\r\n are rendered to. You can perform manual rendering operations here if\r\n you want, but please note that if the Viewport objects attached to this\r\n target are set up to clear the background, you will lose whatever you \r\n render. If you want some kind of backdrop in this event\r\n you should turn off background clearing off on the viewports, and either\r\n clear the viewports yourself in this event handler before doing your rendering\r\n or just render over the top if you don't need to.\r\n */\r\n virtual void preRenderTargetUpdate(const RenderTargetEvent& evt)\r\n { (void)evt; }\r\n\r\n /** Called just after a RenderTarget has been rendered to.\r\n @remarks\r\n This event is called just after all the viewports attached to the target\r\n in question have been rendered to. You can perform your own manual rendering\r\n commands in this event handler if you like, these will be composited with\r\n the contents of the target already there (depending on the material settings \r\n you use etc).\r\n */\r\n virtual void postRenderTargetUpdate(const RenderTargetEvent& evt)\r\n { (void)evt; }\r\n\r\n /* Called just before a Viewport on a RenderTarget is to be updated.\r\n @remarks\r\n This method is called before each viewport on the RenderTarget is\r\n rendered to. You can use this to perform per-viewport settings changes,\r\n such as showing / hiding particular overlays.\r\n */\r\n virtual void preViewportUpdate(const RenderTargetViewportEvent& evt)\r\n { (void)evt; }\r\n\r\n /* Called just after a Viewport on a RenderTarget is to be updated.\r\n @remarks\r\n This method is called after each viewport on the RenderTarget is\r\n rendered to. \r\n */\r\n virtual void postViewportUpdate(const RenderTargetViewportEvent& evt)\r\n { (void)evt; }\r\n\r\n\t\t/** Called to notify listener that a Viewport has been added to the \r\n\t\t\ttarget in question.\r\n\t\t*/\r\n\t\tvirtual void viewportAdded(const RenderTargetViewportEvent& evt)\r\n { (void)evt; }\r\n\t\t/** Called to notify listener that a Viewport has been removed from the \r\n\t\t\ttarget in question.\r\n\t\t*/\r\n\t\tvirtual void viewportRemoved(const RenderTargetViewportEvent& evt)\r\n { (void)evt; }\r\n };\r\n\t/** @} */\r\n\t/** @} */\r\n}\r\n\r\n#endif\r\n", "meta": {"content_hash": "c160bbe7f01882dffc30934d275802ea", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 91, "avg_line_length": 42.391666666666666, "alnum_prop": 0.6457637114212699, "repo_name": "Misterblue/LookingGlass-Viewer", "id": "2e26f7cd85e5da24b3f50113bb41182822f67082", "size": "6476", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/Ogre/include/OgreRenderTargetListener.h", "mode": "33261", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "2087188"}, {"name": "C#", "bytes": "1035483"}, {"name": "C++", "bytes": "15139935"}, {"name": "JavaScript", "bytes": "7396"}, {"name": "Objective-C", "bytes": "6832"}, {"name": "Perl", "bytes": "2099"}, {"name": "Rust", "bytes": "1342"}, {"name": "Shell", "bytes": "15994"}]}} +{"text": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\nBundler.require(*Rails.groups)\nrequire \"breakpoint_rails\"\n\nmodule Dummy\n class Application < Rails::Application\n # Settings in config/environments/* take precedence over those specified here.\n # Application configuration should go into files in config/initializers\n # -- all .rb files in that directory are automatically loaded.\n\n # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.\n # Run \"rake -D time\" for a list of tasks for finding time zone names. Default is UTC.\n # config.time_zone = 'Central Time (US & Canada)'\n\n # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.\n # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]\n # config.i18n.default_locale = :de\n\n # Do not swallow errors in after_commit/after_rollback callbacks.\n config.active_record.raise_in_transactional_callbacks = true\n end\nend\n\n", "meta": {"content_hash": "b3f876e4b12166bbf9cbc3f92d5bfff1", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 99, "avg_line_length": 39.46153846153846, "alnum_prop": 0.7173489278752436, "repo_name": "Stex/breakpoint_rails", "id": "d50222e947e79d0f9d6a602b047fb3b0dd4b1839", "size": "1026", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/dummy/config/application.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "36700"}, {"name": "HTML", "bytes": "4883"}, {"name": "JavaScript", "bytes": "596"}, {"name": "Ruby", "bytes": "17259"}]}} +{"text": "import Display from \"./Display\"\nimport Editor from \"./Editor\"\nimport RenderMixin from \"../utility/RenderMixin\"\nvar ButtonInput = ReactBootstrap.ButtonInput\nvar Sample = React.createClass({\n mixins: [RenderMixin], \n propTypes: {\n path: React.PropTypes.string.isRequired,\n code: React.PropTypes.string,\n title: React.PropTypes.string.isRequired,\n desc: React.PropTypes.string.isRequired,\n isEditorVisible: React.PropTypes.bool\n },\n render: function() {\n console.log(\"Sample:render\", arguments);\n var props = this.props;\n var path = props.path;\n var isEditorVisible = props.isEditorVisible;\n return (\n <div>\n <div><h3 id={path.substring(0, path.indexOf(\".\"))}>{props.title}</h3></div>\n <p>{props.desc}</p>\n <Display ref=\"display\" code={props.editingCode!=undefined? props.editingCode:props.code}className=\"sample-display\"></Display>\n { isEditorVisible? null: <ButtonInput bsStyle=\"info\" className=\"btn-xs\" onClick={() => props.showEditor(path)} value=\"Show Code\" /> }\n <Editor ref=\"editor\" path={path} code={props.code} editingCode={props.editingCode} updateEditor={props.updateEditor} isEditorVisible={isEditorVisible}></Editor>\n { isEditorVisible? <ButtonInput bsStyle=\"info\" className=\"btn-xs\" onClick={() => props.hideEditor(path)} value=\"Hide Code\" /> : null}\n <p></p>\n </div>\n );\n },\n // componentWillReceiveProps: function() {\n // console.log(\"Sample:componentWillReceiveProps\", arguments);\n // },\n // componentDidUpdate: function() {\n // console.log(\"Sample:componentDidUpdate\", arguments);\n // }\n});\n\nexport default Sample", "meta": {"content_hash": "706a41f7884de0cee7742ef6206b3506", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 176, "avg_line_length": 45.05128205128205, "alnum_prop": 0.6317586795674445, "repo_name": "elfandsummer/boilerplate", "id": "d213c2fe2c1107a7f522c9462281b786d67ef1ad", "size": "1757", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/Sample.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1517"}, {"name": "HTML", "bytes": "1536"}, {"name": "JavaScript", "bytes": "27778"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.AspNet.Identity;\nusing Microsoft.AspNet.Identity.EntityFramework;\nusing Microsoft.Owin;\nusing Microsoft.Owin.Security.Cookies;\nusing Microsoft.Owin.Security.Google;\nusing Microsoft.Owin.Security.OAuth;\nusing Owin;\nusing TestWebApiApp.Providers;\nusing TestWebApiApp.Models;\n\nnamespace TestWebApiApp\n{\n public partial class Startup\n {\n public static OAuthAuthorizationServerOptions OAuthOptions { get; private set; }\n\n public static string PublicClientId { get; private set; }\n\n // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864\n public void ConfigureAuth(IAppBuilder app)\n {\n // Configure the db context and user manager to use a single instance per request\n app.CreatePerOwinContext(ApplicationDbContext.Create);\n app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);\n\n // Enable the application to use a cookie to store information for the signed in user\n // and to use a cookie to temporarily store information about a user logging in with a third party login provider\n app.UseCookieAuthentication(new CookieAuthenticationOptions());\n app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);\n\n // Configure the application for OAuth based flow\n PublicClientId = \"self\";\n OAuthOptions = new OAuthAuthorizationServerOptions\n {\n TokenEndpointPath = new PathString(\"/Token\"),\n Provider = new ApplicationOAuthProvider(PublicClientId),\n AuthorizeEndpointPath = new PathString(\"/api/Account/ExternalLogin\"),\n AccessTokenExpireTimeSpan = TimeSpan.FromDays(14),\n AllowInsecureHttp = true\n };\n\n // Enable the application to use bearer tokens to authenticate users\n app.UseOAuthBearerTokens(OAuthOptions);\n\n // Uncomment the following lines to enable logging in with third party login providers\n //app.UseMicrosoftAccountAuthentication(\n // clientId: \"\",\n // clientSecret: \"\");\n\n //app.UseTwitterAuthentication(\n // consumerKey: \"\",\n // consumerSecret: \"\");\n\n //app.UseFacebookAuthentication(\n // appId: \"\",\n // appSecret: \"\");\n\n //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()\n //{\n // ClientId = \"\",\n // ClientSecret = \"\"\n //});\n }\n }\n}\n", "meta": {"content_hash": "9ec934dfa0d13ffa58838a7443b03f1a", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 125, "avg_line_length": 39.86764705882353, "alnum_prop": 0.649206934710439, "repo_name": "idoychinov/Telerik_Academy_Homework", "id": "fc099f7cba0cb6b149835f8e45e331aa794d023f", "size": "2713", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ASP.NETWeb Forms/1.IntroductionToAspNet/WebApps/TestWebApiApp/App_Start/Startup.Auth.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "224148"}, {"name": "C#", "bytes": "3952663"}, {"name": "CSS", "bytes": "3475942"}, {"name": "CoffeeScript", "bytes": "4453"}, {"name": "JavaScript", "bytes": "8996873"}, {"name": "Pascal", "bytes": "14823"}, {"name": "PowerShell", "bytes": "1717649"}, {"name": "Puppet", "bytes": "404631"}, {"name": "Shell", "bytes": "315"}, {"name": "TypeScript", "bytes": "11219"}, {"name": "XSLT", "bytes": "2081"}]}} +{"text": "package com.xcode.mobile.smilealarm;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\"http://d.android.com/tools/testing/testing_android.html\">Testing Fundamentals</a>\n */\npublic class ApplicationTest extends ApplicationTestCase<Application> {\n public ApplicationTest() {\n super(Application.class);\n }\n}", "meta": {"content_hash": "b21a9600719a2c1d4e73911d8f2e36bc", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 93, "avg_line_length": 27.53846153846154, "alnum_prop": 0.7513966480446927, "repo_name": "anhnguyenbk/XCODE-MOBILE-APPS-DEV", "id": "70ec47085cc929fc009a0a2fd6b91a228c7705c0", "size": "358", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SmileAlarm/app/src/androidTest/java/com/xcode/mobile/smilealarm/ApplicationTest.java", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "5543"}, {"name": "Java", "bytes": "219057"}, {"name": "JavaScript", "bytes": "662"}]}} +{"text": "\npackage com.twitter.zipkin.builder\n\nimport com.twitter.finagle.stats.{OstrichStatsReceiver, StatsReceiver}\nimport com.twitter.logging.config._\nimport com.twitter.logging.{ConsoleHandler, Logger, LoggerFactory}\nimport com.twitter.ostrich.admin._\nimport java.net.{InetAddress, InetSocketAddress}\nimport scala.util.matching.Regex\n\n/**\n * Base builder for a Zipkin service\n */\ncase class ZipkinServerBuilder(\n serverPort : Int,\n adminPort : Int,\n serverAddress : InetAddress = InetAddress.getByAddress(Array[Byte](0,0,0,0)),\n loggers : List[LoggerFactory] = List(LoggerFactory(level = Some(Level.DEBUG), handlers = List(ConsoleHandler()))),\n adminStatsNodes : List[StatsFactory] = List(StatsFactory(reporters = List(TimeSeriesCollectorFactory()))),\n adminStatsFilters : List[Regex] = List.empty,\n statsReceiver : StatsReceiver = new OstrichStatsReceiver\n ) extends Builder[(RuntimeEnvironment) => Unit] {\n\n def serverPort(p: Int) : ZipkinServerBuilder = copy(serverPort = p)\n def adminPort(p: Int) : ZipkinServerBuilder = copy(adminPort = p)\n def serverAddress(a: InetAddress) : ZipkinServerBuilder = copy(serverAddress = a)\n def loggers(l: List[LoggerFactory]) : ZipkinServerBuilder = copy(loggers = l)\n def statsReceiver(s: StatsReceiver) : ZipkinServerBuilder = copy(statsReceiver = s)\n\n def addLogger(l: LoggerFactory) : ZipkinServerBuilder = copy(loggers = loggers :+ l)\n def addAdminStatsNode(n: StatsFactory): ZipkinServerBuilder = copy(adminStatsNodes = adminStatsNodes :+ n)\n def addAdminStatsFilter(f: Regex) : ZipkinServerBuilder = copy(adminStatsFilters = adminStatsFilters :+ f)\n\n private lazy val adminServiceFactory: AdminServiceFactory =\n AdminServiceFactory(\n httpPort = adminPort,\n statsNodes = adminStatsNodes,\n statsFilters = adminStatsFilters\n )\n\n lazy val socketAddress = new InetSocketAddress(serverAddress, serverPort)\n\n var adminHttpService: Option[AdminHttpService] = None\n\n def apply() = (runtime: RuntimeEnvironment) => {\n Logger.configure(loggers)\n adminHttpService = Some(adminServiceFactory(runtime))\n }\n }\n", "meta": {"content_hash": "0719ee0a862370c19d8fb48e77c5a744", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 138, "avg_line_length": 47.97959183673469, "alnum_prop": 0.6741811994895789, "repo_name": "coursera/zipkin", "id": "e0b70118772b4d9252bd767cfdcdb36b2215aecf", "size": "2947", "binary": false, "copies": "1", "ref": "refs/heads/coursera-zipkin", "path": "zipkin-query-service/src/main/scala/com/twitter/zipkin/builder/ZipkinServerBuilder.scala", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "10180"}, {"name": "HTML", "bytes": "18713"}, {"name": "Java", "bytes": "37218"}, {"name": "JavaScript", "bytes": "322607"}, {"name": "Scala", "bytes": "422991"}, {"name": "Shell", "bytes": "3977"}, {"name": "Thrift", "bytes": "7894"}]}} +{"text": "package matchers\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n\n\t\"github.com/mysza/go-service-template/Godeps/_workspace/src/github.com/onsi/gomega/format\"\n)\n\ntype AssignableToTypeOfMatcher struct {\n\tExpected interface{}\n}\n\nfunc (matcher *AssignableToTypeOfMatcher) Match(actual interface{}) (success bool, err error) {\n\tif actual == nil || matcher.Expected == nil {\n\t\treturn false, fmt.Errorf(\"Refusing to compare <nil> to <nil>.\\nBe explicit and use BeNil() instead. This is to avoid mistakes where both sides of an assertion are erroneously uninitialized.\")\n\t}\n\n\tactualType := reflect.TypeOf(actual)\n\texpectedType := reflect.TypeOf(matcher.Expected)\n\n\treturn actualType.AssignableTo(expectedType), nil\n}\n\nfunc (matcher *AssignableToTypeOfMatcher) FailureMessage(actual interface{}) string {\n\treturn format.Message(actual, fmt.Sprintf(\"to be assignable to the type: %T\", matcher.Expected))\n}\n\nfunc (matcher *AssignableToTypeOfMatcher) NegatedFailureMessage(actual interface{}) string {\n\treturn format.Message(actual, fmt.Sprintf(\"not to be assignable to the type: %T\", matcher.Expected))\n}\n", "meta": {"content_hash": "f5c410e8325c697313f45b4aff3e6566", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 194, "avg_line_length": 34.67741935483871, "alnum_prop": 0.7646511627906977, "repo_name": "mysza/go-service-template", "id": "f6d4c8b05877dcdedcaa13f476846f81fbdddd79", "size": "1075", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Godeps/_workspace/src/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher.go", "mode": "33188", "license": "mit", "language": [{"name": "Go", "bytes": "429"}, {"name": "Makefile", "bytes": "799"}]}} +{"text": "<!doctype html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"utf-8\">\n\n <title>Getting Started</title>\n\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\n\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">\n\n <link rel=\"stylesheet\" href=\"css/reveal.css\">\n <link rel=\"stylesheet\" href=\"css/improve-formatting.css\">\n <link rel=\"stylesheet\" href=\"css/theme/black.css\" id=\"theme\">\n\n <!-- For syntax highlighting -->\n <link rel=\"stylesheet\" href=\"lib/css/zenburn.css\">\n\n <!-- If the query includes 'print-pdf', include the PDF print sheet -->\n <script>\n if( window.location.search.match( /print-pdf/gi ) ) {\n var link = document.createElement( 'link' );\n link.rel = 'stylesheet';\n link.type = 'text/css';\n link.href = 'css/print/pdf.css'\n document.getElementsByTagName( 'head' )[0].appendChild( link );\n }\n </script>\n\n\n <script src=\"js/jquery-1.7.2.min.js\" charset=\"utf-8\" type=\"text/javascript\"></script>\n <script src=\"js/raphael-min.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n</head>\n\n<body>\n <div class=\"reveal\">\n <!-- Any section element inside of this container is displayed as a slide -->\n <div class=\"slides\">\n <section data-state=\"cover\">\n <h1><span xmlns:dct=\"http://purl.org/dc/terms/\"\n href=\"http://purl.org/dc/dcmitype/InteractiveResource\"\n property=\"dct:title\"\n rel=\"dct:type\">\n Social Hacking with ML\n </span></h1>\n <br>\n <h3 xmlns:cc=\"http://creativecommons.org/ns#\"\n property=\"cc:attributionName\">Devananda van der Veen</h3>\n <h3> twitter: @devananda </h3>\n <br>\n <h4><a xmlns:cc=\"http://creativecommons.org/ns#\"\n rel=\"cc:attributionURL\"\n href='http://devananda.github.io/talks/'>devananda.github.io/talks/</a> </h4>\n </section>\n <section id=\"who-am-i\">\n <h1>Trends...</h1>\n <ul>\n <li>1999 - \"Peer to Peer\" networking</li>\n <li>2003 - LAMP stack</li>\n <li>2008 - Cloud</li>\n <li>2016 - Machine Learning</li>\n </ul>\n </section>\n <section id=\"what-to-talk-about\">\n <img src=\"ml-trends.png\">\n <h1>Cloud vs Machine Learning</h1>\n </section>\n <section id='whatcanitdo'>\n <h1>What can it do?</h1>\n </section>\n <section id=\"whatcanitdo2\">\n <img src=\"dogs_v_cats.jpg\" width=\"500\">\n </section>\n <section id=\"sowhat\">\n <h1>... and then what?</h1>\n </section>\n <section id=\"what-about-fire\">\n <h1>FireWise</h1>\n </section>\n <section id=\"what-about-data\">\n https://cloud.google.com/public-datasets/\n </section>\n <section id=\"what-about-money\">\n <h1>$?</h1>\n </section>\n <section id=\"what-about-time\">\n <h1>Get involved</h1>\n </section>\n </div>\n </div>\n\n <script src=\"lib/js/head.min.js\"></script>\n <script src=\"js/reveal.js\"></script>\n <script>\n // Full list of configuration options available here:\n // https://github.com/hakimel/reveal.js#configuration\n Reveal.initialize({\n controls: true,\n progress: true,\n history: true,\n center: true,\n\n theme: Reveal.getQueryHash().theme, // available themes are in /css/theme\n transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none\n\n // Optional libraries used to extend on reveal.js\n dependencies: [\n { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },\n { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },\n { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },\n { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },\n { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },\n { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }\n // { src: 'plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; } }\n // { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }\n ]\n });\n </script>\n</body>\n</html>\n", "meta": {"content_hash": "fbd073ac3cfff277d1d8ba2b7103607f", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 134, "avg_line_length": 40.114754098360656, "alnum_prop": 0.5657948508377605, "repo_name": "devananda/talks", "id": "9af03f9def530e6e42346ad2f09ad23e7827719c", "size": "4894", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "social-hacking-with-ml.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "201296"}, {"name": "HTML", "bytes": "225649"}, {"name": "JavaScript", "bytes": "254227"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>maths: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.5.2~camlp4 / maths - 8.10.0</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n maths\n <small>\n 8.10.0\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-06-19 05:53:44 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-06-19 05:53:44 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-num base Num library distributed with the OCaml compiler\nbase-threads base\nbase-unix base\ncamlp4 4.05+1 Camlp4 is a system for writing extensible parsers for programming languages\nconf-findutils 1 Virtual package relying on findutils\ncoq 8.5.2~camlp4 Formal proof management system\nnum 0 The Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.05.0 The OCaml compiler (virtual package)\nocaml-base-compiler 4.05.0 Official 4.05.0 release\nocaml-config 1 OCaml Switch Configuration\nocamlbuild 0.14.1 OCamlbuild is a build system with builtin rules to easily build most OCaml projects\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/maths"\nlicense: "LGPL 2.1"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/Maths"]\ndepends: [\n "ocaml"\n "coq" {>= "8.10" & < "8.11~"}\n]\ntags: [\n "keyword: mathematics"\n "category: Mathematics/Arithmetic and Number Theory/Number theory"\n]\nauthors: [\n "Jean-Christophe Filli\u00e2tre"\n]\nbug-reports: "https://github.com/coq-contribs/maths/issues"\ndev-repo: "git+https://github.com/coq-contribs/maths.git"\nsynopsis: "Basic mathematics"\ndescription: """\nBasic mathematics (gcd, primality, etc.) from\nFrench ``Mathematiques Superieures'' (first year of preparation to\nhigh schools)"""\nflags: light-uninstall\nurl {\n src: "https://github.com/coq-contribs/maths/archive/v8.10.0.tar.gz"\n checksum: "md5=0bb016a4357e219f2099e242366e71bf"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-maths.8.10.0 coq.8.5.2~camlp4</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.5.2~camlp4).\nThe following dependencies couldn't be met:\n - coq-maths -> coq >= 8.10\nYour request can't be satisfied:\n - No available version of coq satisfies the constraints\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-maths.8.10.0</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "02cfa1100842832565a40ea18f5843ad", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 159, "avg_line_length": 40.538011695906434, "alnum_prop": 0.54399884593191, "repo_name": "coq-bench/coq-bench.github.io", "id": "877305d35e80b58eb9d8462a60af22c7891b3386", "size": "6958", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.5.2~camlp4/maths/8.10.0.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "// Created by Andrea Arteaga, MeteoSwiss\r\n// Email: andyspiros@gmail.com\r\n// January 2013\r\n\r\n#pragma once\r\n\r\n#include \"SavePoint.h\"\r\n\r\nclass Serializer;\r\n\r\nclass SerializerOutput\r\n{\r\npublic:\r\n /**\r\n * Default constructor\r\n */\r\n SerializerOutput() { }\r\n\r\n /**\r\n * Copy constructor\r\n */\r\n SerializerOutput(const SerializerOutput& other)\r\n {\r\n *this = other;\r\n }\r\n\r\n /**\r\n * Assignment operator\r\n */\r\n SerializerOutput& operator=(const SerializerOutput& other)\r\n {\r\n pSerializer_ = other.pSerializer_;\r\n savePoint_ = other.savePoint_;\r\n return *this;\r\n }\r\n inline void Init(Serializer& serializer, std::string savePointName);\r\n\r\n inline void set_SavePoint(const SavePoint& other) { savePoint_ = other; }\r\n\r\n inline SerializerOutput& operator<< (const MetaInfo& info);\r\n\r\n template<typename TDataField>\r\n inline SerializerOutput& operator<< (const TDataField& field);\r\n\r\nprivate:\r\n SavePoint savePoint_;\r\n Serializer* pSerializer_;\r\n};\r\n\r\n\r\n", "meta": {"content_hash": "4561ea1c1321f29eb8166410449be86e", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 77, "avg_line_length": 20.8, "alnum_prop": 0.6182692307692308, "repo_name": "bcumming/mini-stencil", "id": "91d2b75d9e79fcd19737b34b71a588c0457eb6d8", "size": "1040", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/serialize/src/SerializerOutput.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "617485"}, {"name": "C++", "bytes": "1517839"}, {"name": "FORTRAN", "bytes": "310206"}, {"name": "Objective-C", "bytes": "12105"}, {"name": "Python", "bytes": "81906"}]}} +{"text": "leakless\n========\n\nMiscellaneous process related resource management modules\n\n\nAPI Document\n------------\n\nsee: [Edoc](doc/README.md)\n", "meta": {"content_hash": "39cae2f424da051aaf4cbf61b2900399", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 57, "avg_line_length": 13.3, "alnum_prop": 0.6691729323308271, "repo_name": "sile/leakless", "id": "f0ca93e9cb76d5527484e694146074f0496c2c62", "size": "133", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "Erlang", "bytes": "33606"}, {"name": "Makefile", "bytes": "1140"}]}} +{"text": "package awsiam\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\n\t\"code.cloudfoundry.org/lager\"\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/awserr\"\n\t\"github.com/aws/aws-sdk-go/service/iam\"\n)\n\ntype UserPolicy struct {\n\tVersion string `json:\"Version\"`\n\tID string `json:\"Id\"`\n\tStatements []UserPolicyStatement `json:\"Statement\"`\n}\n\ntype UserPolicyStatement struct {\n\tSID string `json:\"Sid\"`\n\tEffect string `json:\"Effect\"`\n\tAction string `json:\"Action\"`\n\tResource string `json:\"Resource\"`\n}\n\ntype IAMUser struct {\n\tiamsvc *iam.IAM\n\tlogger lager.Logger\n}\n\nfunc NewIAMUser(\n\tiamsvc *iam.IAM,\n\tlogger lager.Logger,\n) *IAMUser {\n\treturn &IAMUser{\n\t\tiamsvc: iamsvc,\n\t\tlogger: logger.Session(\"iam-user\"),\n\t}\n}\n\nfunc (i *IAMUser) Describe(userName string) (UserDetails, error) {\n\tuserDetails := UserDetails{\n\t\tUserName: userName,\n\t}\n\n\tgetUserInput := &iam.GetUserInput{\n\t\tUserName: aws.String(userName),\n\t}\n\ti.logger.Debug(\"get-user\", lager.Data{\"input\": getUserInput})\n\n\tgetUserOutput, err := i.iamsvc.GetUser(getUserInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn userDetails, errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn userDetails, err\n\t}\n\ti.logger.Debug(\"get-user\", lager.Data{\"output\": getUserOutput})\n\n\tuserDetails.UserARN = aws.StringValue(getUserOutput.User.Arn)\n\tuserDetails.UserID = aws.StringValue(getUserOutput.User.UserId)\n\n\treturn userDetails, nil\n}\n\nfunc (i *IAMUser) Create(userName string) (string, error) {\n\tcreateUserInput := &iam.CreateUserInput{\n\t\tUserName: aws.String(userName),\n\t}\n\ti.logger.Debug(\"create-user\", lager.Data{\"input\": createUserInput})\n\n\tcreateUserOutput, err := i.iamsvc.CreateUser(createUserInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn \"\", errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn \"\", err\n\t}\n\ti.logger.Debug(\"create-user\", lager.Data{\"output\": createUserOutput})\n\n\treturn aws.StringValue(createUserOutput.User.Arn), nil\n}\n\nfunc (i *IAMUser) Delete(userName string) error {\n\tdeleteUserInput := &iam.DeleteUserInput{\n\t\tUserName: aws.String(userName),\n\t}\n\ti.logger.Debug(\"delete-user\", lager.Data{\"input\": deleteUserInput})\n\n\tdeleteUserOutput, err := i.iamsvc.DeleteUser(deleteUserInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn err\n\t}\n\ti.logger.Debug(\"delete-user\", lager.Data{\"output\": deleteUserOutput})\n\n\treturn nil\n}\n\nfunc (i *IAMUser) ListAccessKeys(userName string) ([]string, error) {\n\tvar accessKeys []string\n\n\tlistAccessKeysInput := &iam.ListAccessKeysInput{\n\t\tUserName: aws.String(userName),\n\t}\n\ti.logger.Debug(\"list-access-keys\", lager.Data{\"input\": listAccessKeysInput})\n\n\tlistAccessKeysOutput, err := i.iamsvc.ListAccessKeys(listAccessKeysInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn accessKeys, errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn accessKeys, err\n\t}\n\ti.logger.Debug(\"list-access-keys\", lager.Data{\"output\": listAccessKeysOutput})\n\n\tfor _, accessKey := range listAccessKeysOutput.AccessKeyMetadata {\n\t\taccessKeys = append(accessKeys, aws.StringValue(accessKey.AccessKeyId))\n\t}\n\n\treturn accessKeys, nil\n}\n\nfunc (i *IAMUser) CreateAccessKey(userName string) (string, string, error) {\n\tcreateAccessKeyInput := &iam.CreateAccessKeyInput{\n\t\tUserName: aws.String(userName),\n\t}\n\ti.logger.Debug(\"create-access-key\", lager.Data{\"input\": createAccessKeyInput})\n\n\tcreateAccessKeyOutput, err := i.iamsvc.CreateAccessKey(createAccessKeyInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn \"\", \"\", errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn \"\", \"\", err\n\t}\n\ti.logger.Debug(\"create-access-key\", lager.Data{\"output\": createAccessKeyOutput})\n\n\treturn aws.StringValue(createAccessKeyOutput.AccessKey.AccessKeyId), aws.StringValue(createAccessKeyOutput.AccessKey.SecretAccessKey), nil\n}\n\nfunc (i *IAMUser) DeleteAccessKey(userName string, accessKeyID string) error {\n\tdeleteAccessKeyInput := &iam.DeleteAccessKeyInput{\n\t\tUserName: aws.String(userName),\n\t\tAccessKeyId: aws.String(accessKeyID),\n\t}\n\ti.logger.Debug(\"delete-access-key\", lager.Data{\"input\": deleteAccessKeyInput})\n\n\tdeleteAccessKeyOutput, err := i.iamsvc.DeleteAccessKey(deleteAccessKeyInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn err\n\t}\n\ti.logger.Debug(\"delete-access-key\", lager.Data{\"output\": deleteAccessKeyOutput})\n\n\treturn nil\n}\n\nfunc (i *IAMUser) CreatePolicy(policyName string, effect string, action string, resource string) (string, error) {\n\tpolicyDocument, err := i.buildUserPolicy(policyName, effect, action, resource)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcreatePolicyInput := &iam.CreatePolicyInput{\n\t\tPolicyName: aws.String(policyName),\n\t\tPolicyDocument: aws.String(policyDocument),\n\t}\n\ti.logger.Debug(\"create-policy\", lager.Data{\"input\": createPolicyInput})\n\n\tcreatePolicyOutput, err := i.iamsvc.CreatePolicy(createPolicyInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn \"\", errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn \"\", err\n\t}\n\ti.logger.Debug(\"create-policy\", lager.Data{\"output\": createPolicyOutput})\n\n\treturn aws.StringValue(createPolicyOutput.Policy.Arn), nil\n}\n\nfunc (i *IAMUser) DeletePolicy(policyARN string) error {\n\tdeletePolicyInput := &iam.DeletePolicyInput{\n\t\tPolicyArn: aws.String(policyARN),\n\t}\n\ti.logger.Debug(\"delete-policy\", lager.Data{\"input\": deletePolicyInput})\n\n\tdeletePolicyOutput, err := i.iamsvc.DeletePolicy(deletePolicyInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn err\n\t}\n\ti.logger.Debug(\"delete-policy\", lager.Data{\"output\": deletePolicyOutput})\n\n\treturn nil\n}\n\nfunc (i *IAMUser) ListAttachedUserPolicies(userName string) ([]string, error) {\n\tvar userPolicies []string\n\n\tlistAttachedUserPoliciesInput := &iam.ListAttachedUserPoliciesInput{\n\t\tUserName: aws.String(userName),\n\t}\n\ti.logger.Debug(\"list-attached-user-policies\", lager.Data{\"input\": listAttachedUserPoliciesInput})\n\n\tlistAttachedUserPoliciesOutput, err := i.iamsvc.ListAttachedUserPolicies(listAttachedUserPoliciesInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn userPolicies, errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn userPolicies, err\n\t}\n\ti.logger.Debug(\"list-attached-user-policies\", lager.Data{\"output\": listAttachedUserPoliciesOutput})\n\n\tfor _, userPolicy := range listAttachedUserPoliciesOutput.AttachedPolicies {\n\t\tuserPolicies = append(userPolicies, aws.StringValue(userPolicy.PolicyArn))\n\t}\n\n\treturn userPolicies, nil\n}\n\nfunc (i *IAMUser) AttachUserPolicy(userName string, policyARN string) error {\n\tattachUserPolicyInput := &iam.AttachUserPolicyInput{\n\t\tPolicyArn: aws.String(policyARN),\n\t\tUserName: aws.String(userName),\n\t}\n\ti.logger.Debug(\"attach-user-policy\", lager.Data{\"input\": attachUserPolicyInput})\n\n\tattachUserPolicyOutput, err := i.iamsvc.AttachUserPolicy(attachUserPolicyInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn err\n\t}\n\ti.logger.Debug(\"attach-user-policy\", lager.Data{\"output\": attachUserPolicyOutput})\n\n\treturn nil\n}\n\nfunc (i *IAMUser) DetachUserPolicy(userName string, policyARN string) error {\n\tdetachUserPolicyInput := &iam.DetachUserPolicyInput{\n\t\tPolicyArn: aws.String(policyARN),\n\t\tUserName: aws.String(userName),\n\t}\n\ti.logger.Debug(\"detach-user-policy\", lager.Data{\"input\": detachUserPolicyInput})\n\n\tdetachUserPolicyOutput, err := i.iamsvc.DetachUserPolicy(detachUserPolicyInput)\n\tif err != nil {\n\t\ti.logger.Error(\"aws-iam-error\", err)\n\t\tif awsErr, ok := err.(awserr.Error); ok {\n\t\t\treturn errors.New(awsErr.Code() + \": \" + awsErr.Message())\n\t\t}\n\t\treturn err\n\t}\n\ti.logger.Debug(\"detach-user-policy\", lager.Data{\"output\": detachUserPolicyOutput})\n\n\treturn nil\n}\n\nfunc (i *IAMUser) buildUserPolicy(policyID string, effect string, action string, resource string) (string, error) {\n\tuserPolicy := UserPolicy{\n\t\tVersion: \"2012-10-17\",\n\t\tID: policyID,\n\t\tStatements: []UserPolicyStatement{\n\t\t\tUserPolicyStatement{\n\t\t\t\tSID: \"1\",\n\t\t\t\tEffect: effect,\n\t\t\t\tAction: action,\n\t\t\t\tResource: resource,\n\t\t\t},\n\t\t\tUserPolicyStatement{\n\t\t\t\tSID: \"2\",\n\t\t\t\tEffect: effect,\n\t\t\t\tAction: action,\n\t\t\t\tResource: resource + \"/*\",\n\t\t\t},\n\t\t},\n\t}\n\n\tpolicy, err := json.Marshal(userPolicy)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(policy), nil\n}\n", "meta": {"content_hash": "012bdc53874db2f6be588cb6028dcbf7", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 139, "avg_line_length": 29.713815789473685, "alnum_prop": 0.7079597033100853, "repo_name": "jmcarp/s3-broker", "id": "93fb4e93663e94e491e74787fe4a57e5fa19e481", "size": "9033", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "awsiam/iam_user.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Go", "bytes": "61277"}, {"name": "Shell", "bytes": "7278"}]}} +{"text": "<?php\n\n/**\n * Subclass for representing a row from the 'sf_user_recommendation' table.\n *\n * \n *\n * @package plugins.sfPropelActAsRecommendableBehaviorPlugin.lib.model\n */ \nclass sfUserRecommendation extends BasesfUserRecommendation\n{\n}\n", "meta": {"content_hash": "dde0041571ec04721cb5a0f4631e44c8", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 75, "avg_line_length": 19.75, "alnum_prop": 0.759493670886076, "repo_name": "Symfony-Plugins/sfPropelActAsRecommendableBehaviorPlugin", "id": "0c7be833819526959a5436704e776a96769db5d9", "size": "237", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/model/sfUserRecommendation.php", "mode": "33188", "license": "mit", "language": [{"name": "PHP", "bytes": "58812"}]}} +{"text": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Collapsible = _react2.default.createClass({\n displayName: 'Collapsible',\n\n\n //Set validation for prop types\n propTypes: {\n transitionTime: _react2.default.PropTypes.number,\n easing: _react2.default.PropTypes.string,\n open: _react2.default.PropTypes.bool,\n classParentString: _react2.default.PropTypes.string,\n openedClassName: _react2.default.PropTypes.string,\n triggerClassName: _react2.default.PropTypes.string,\n triggerOpenedClassName: _react2.default.PropTypes.string,\n contentOuterClassName: _react2.default.PropTypes.string,\n contentInnerClassName: _react2.default.PropTypes.string,\n accordionPosition: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number]),\n handleTriggerClick: _react2.default.PropTypes.func,\n trigger: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element]),\n triggerWhenOpen: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element]),\n triggerDisabled: _react2.default.PropTypes.bool,\n lazyRender: _react2.default.PropTypes.bool,\n overflowWhenOpen: _react2.default.PropTypes.oneOf(['hidden', 'visible', 'auto', 'scroll', 'inherit', 'initial', 'unset']),\n triggerSibling: _react2.default.PropTypes.element\n },\n\n //If no transition time or easing is passed then default to this\n getDefaultProps: function getDefaultProps() {\n return {\n transitionTime: 400,\n easing: 'linear',\n open: false,\n classParentString: 'Collapsible',\n triggerDisabled: false,\n lazyRender: false,\n overflowWhenOpen: 'hidden',\n openedClassName: '',\n triggerClassName: '',\n triggerOpenedClassName: '',\n contentOuterClassName: '',\n contentInnerClassName: '',\n className: '',\n triggerSibling: null\n };\n },\n\n //Defaults the dropdown to be closed\n getInitialState: function getInitialState() {\n\n if (this.props.open) {\n return {\n isClosed: false,\n shouldSwitchAutoOnNextCycle: false,\n height: 'auto',\n transition: 'none',\n hasBeenOpened: true,\n overflow: this.props.overflowWhenOpen\n };\n } else {\n return {\n isClosed: true,\n shouldSwitchAutoOnNextCycle: false,\n height: 0,\n transition: 'height ' + this.props.transitionTime + 'ms ' + this.props.easing,\n hasBeenOpened: false,\n overflow: 'hidden'\n };\n }\n },\n\n // Taken from https://github.com/EvandroLG/transitionEnd/\n // Determines which prefixed event to listen for\n whichTransitionEnd: function whichTransitionEnd(element) {\n var transitions = {\n 'WebkitTransition': 'webkitTransitionEnd',\n 'MozTransition': 'transitionend',\n 'OTransition': 'oTransitionEnd otransitionend',\n 'transition': 'transitionend'\n };\n\n for (var t in transitions) {\n if (element.style[t] !== undefined) {\n return transitions[t];\n }\n }\n },\n\n componentDidMount: function componentDidMount() {\n var _this = this;\n\n //Set up event listener to listen to transitionend so we can switch the height from fixed pixel to auto for much responsiveness;\n //TODO: Once Synthetic transitionend events have been exposed in the next release of React move this funciton to a function handed to the onTransitionEnd prop\n\n this.refs.outer.addEventListener(this.whichTransitionEnd(this.refs.outer), function (event) {\n if (_this.state.isClosed === false) {\n _this.setState({\n shouldSwitchAutoOnNextCycle: true\n });\n }\n });\n },\n\n componentDidUpdate: function componentDidUpdate(prevProps) {\n\n if (this.state.shouldSwitchAutoOnNextCycle === true && this.state.isClosed === false) {\n //Set the height to auto to make compoenent re-render with the height set to auto.\n //This way the dropdown will be responsive and also change height if there is another dropdown within it.\n this.makeResponsive();\n }\n\n if (this.state.shouldSwitchAutoOnNextCycle === true && this.state.isClosed === true) {\n this.prepareToOpen();\n }\n\n //If there has been a change in the open prop (controlled by accordion)\n if (prevProps.open != this.props.open) {\n if (this.props.open === true) {\n this.openCollapsible();\n } else {\n this.closeCollapsible();\n }\n }\n },\n\n handleTriggerClick: function handleTriggerClick(event) {\n\n event.preventDefault();\n\n if (this.props.triggerDisabled) {\n return;\n }\n\n if (this.props.handleTriggerClick) {\n this.props.handleTriggerClick(this.props.accordionPosition);\n } else {\n\n if (this.state.isClosed === true) {\n this.openCollapsible();\n } else {\n this.closeCollapsible();\n }\n }\n },\n\n closeCollapsible: function closeCollapsible() {\n this.setState({\n isClosed: true,\n shouldSwitchAutoOnNextCycle: true,\n height: this.refs.inner.offsetHeight,\n overflow: 'hidden'\n });\n },\n\n openCollapsible: function openCollapsible() {\n this.setState({\n height: this.refs.inner.offsetHeight,\n transition: 'height ' + this.props.transitionTime + 'ms ' + this.props.easing,\n isClosed: false,\n hasBeenOpened: true\n });\n if(typeof(this.props.onOpen) != 'undefined' && typeof(this.props.dateString) != 'undefined')\n this.props.onOpen(this.props.dateString);\n },\n\n makeResponsive: function makeResponsive() {\n this.setState({\n height: 'auto',\n transition: 'none',\n shouldSwitchAutoOnNextCycle: false,\n overflow: this.props.overflowWhenOpen\n });\n },\n\n prepareToOpen: function prepareToOpen() {\n var _this2 = this;\n\n //The height has been changes back to fixed pixel, we set a small timeout to force the CSS transition back to 0 on the next tick.\n window.setTimeout(function () {\n _this2.setState({\n height: 0,\n shouldSwitchAutoOnNextCycle: false,\n transition: 'height ' + _this2.props.transitionTime + 'ms ' + _this2.props.easing\n });\n }, 50);\n },\n\n renderNonClickableTriggerElement: function renderNonClickableTriggerElement() {\n if (this.props.triggerSibling) {\n return _react2.default.createElement(\n 'span',\n { className: this.props.classParentString + \"__trigger-sibling\" },\n this.props.triggerSibling\n );\n }\n\n return null;\n },\n\n render: function render() {\n\n var dropdownStyle = {\n height: this.state.height,\n WebkitTransition: this.state.transition,\n msTransition: this.state.transition,\n transition: this.state.transition,\n overflow: this.state.overflow\n };\n\n var openClass = this.state.isClosed ? 'is-closed' : 'is-open';\n var disabledClass = this.props.triggerDisabled ? 'is-disabled' : '';\n\n //If user wants different text when tray is open\n var trigger = this.state.isClosed === false && this.props.triggerWhenOpen !== undefined ? this.props.triggerWhenOpen : this.props.trigger;\n\n // Don't render children until the first opening of the Collapsible if lazy rendering is enabled\n var children = this.props.children;\n if (this.props.lazyRender) if (!this.state.hasBeenOpened) children = null;\n\n var triggerClassName = this.props.classParentString + \"__trigger\" + ' ' + openClass + ' ' + disabledClass;\n\n if (this.state.isClosed) {\n triggerClassName = triggerClassName + ' ' + this.props.triggerClassName;\n } else {\n triggerClassName = triggerClassName + ' ' + this.props.triggerOpenedClassName;\n }\n\n return _react2.default.createElement(\n 'div',\n { className: this.props.classParentString + ' ' + (this.state.isClosed ? this.props.className : this.props.openedClassName) },\n _react2.default.createElement(\n 'span',\n { className: triggerClassName.trim(), onClick: this.handleTriggerClick },\n trigger\n ),\n this.renderNonClickableTriggerElement(),\n _react2.default.createElement(\n 'div',\n { className: this.props.classParentString + \"__contentOuter\" + ' ' + this.props.contentOuterClassName, ref: 'outer', style: dropdownStyle },\n _react2.default.createElement(\n 'div',\n { className: this.props.classParentString + \"__contentInner\" + ' ' + this.props.contentInnerClassName, ref: 'inner' },\n children\n )\n )\n );\n }\n});\n\nexports.default = Collapsible;\n", "meta": {"content_hash": "b36b68782b2c05ccff786afe82fb3fbf", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 163, "avg_line_length": 33.473076923076924, "alnum_prop": 0.6664368608525796, "repo_name": "RegOpz/RegOpzWebApp", "id": "5ff80782ed6f0747b0b10fa7f9c1d99e48813c19", "size": "8703", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/components/CollapsibleModified/Collapsible.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "108960"}, {"name": "HTML", "bytes": "1643"}, {"name": "JavaScript", "bytes": "1754113"}, {"name": "Shell", "bytes": "206"}]}} +{"text": "using System;\nusing System.Collections.Generic;\nusing CH.Testing.T2.Interface;\n\nnamespace CH.Testing.T2.Component\n{\n internal sealed class LineParser : ILineParser\n {\n private static readonly string[] Separator = {Environment.NewLine};\n\n IEnumerable<string> ILineParser.Parse(string s)\n {\n return s.Split(Separator, int.MaxValue, StringSplitOptions.None);\n }\n }\n}", "meta": {"content_hash": "28521ab9590d115155657130252a534a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 77, "avg_line_length": 25.6875, "alnum_prop": 0.6861313868613139, "repo_name": "tanglebones/ch-testing", "id": "9ee20b4060b4932893501e2a28328329e257dc88", "size": "411", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "T2/Component/LineParser.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "41263"}]}} +{"text": "import android.content.ContentResolver;\r\nimport android.content.ContentValues;\r\nimport android.content.Context;\r\nimport android.database.Cursor;\r\nimport android.database.DatabaseUtils;\r\nimport android.database.sqlite.SQLiteDatabase;\r\nimport android.net.Uri;\r\nimport android.util.Log;\r\nimport com.google.android.libraries.social.autobackup.MediaRecordEntry;\r\nimport java.io.IOException;\r\n\r\npublic final class hbm\r\n{\r\n private static final String a = MediaRecordEntry.a.a;\r\n private static final String b;\r\n private static final String c;\r\n private static final String d;\r\n private static final String e;\r\n \r\n static\r\n {\r\n String str1 = String.valueOf(\"upload_account_id = -1 AND _id > ? AND media_url NOT IN ( SELECT media_url FROM \");\r\n String str2 = a;\r\n String str3 = String.valueOf(\"upload_account_id\");\r\n String str4 = String.valueOf(\"bucket_id\");\r\n String str5 = String.valueOf(\"bucket_id\");\r\n String str6 = String.valueOf(\"bucket_id\");\r\n String str7 = String.valueOf(\"exclude_bucket\");\r\n b = 57 + String.valueOf(str1).length() + String.valueOf(str2).length() + String.valueOf(str3).length() + String.valueOf(str4).length() + String.valueOf(str5).length() + String.valueOf(str6).length() + String.valueOf(str7).length() + str1 + str2 + \" WHERE \" + str3 + \" = ? )\" + \" AND (\" + str4 + \" IS NULL OR \" + str5 + \" NOT IN ( SELECT \" + str6 + \" FROM \" + str7 + \" ))\";\r\n String str8 = String.valueOf(MediaRecordEntry.a.a);\r\n String str9 = String.valueOf(\"upload_account_id = ? AND upload_state = 100\");\r\n c = 28 + String.valueOf(str8).length() + String.valueOf(str9).length() + \"SELECT count(*) FROM \" + str8 + \" WHERE \" + str9;\r\n String str10 = a;\r\n String str11 = String.valueOf(\"upload_account_id = ? AND ( upload_state = 100 OR upload_state = 200 ) AND upload_reason = ?\");\r\n d = 28 + String.valueOf(str10).length() + String.valueOf(str11).length() + \"SELECT COUNT(*) FROM \" + str10 + \" WHERE \" + str11;\r\n String str12 = String.valueOf(\"upload_account_id = -1 AND bucket_id = ? AND media_url NOT IN ( SELECT media_url FROM \");\r\n String str13 = a;\r\n String str14 = String.valueOf(\"upload_account_id\");\r\n e = 13 + String.valueOf(str12).length() + String.valueOf(str13).length() + String.valueOf(str14).length() + str12 + str13 + \" WHERE \" + str14 + \" = ? )\";\r\n }\r\n \r\n private static int a(SQLiteDatabase paramSQLiteDatabase, int paramInt1, int paramInt2)\r\n {\r\n Cursor localCursor = a(paramSQLiteDatabase, paramInt1, -1L, 500);\r\n int i = 0;\r\n try\r\n {\r\n while (localCursor.moveToNext())\r\n {\r\n MediaRecordEntry localMediaRecordEntry = MediaRecordEntry.a(localCursor);\r\n localMediaRecordEntry.id = 0L;\r\n localMediaRecordEntry.mUploadAccountId = paramInt1;\r\n localMediaRecordEntry.mUploadReason = paramInt2;\r\n localMediaRecordEntry.mUploadState = 100;\r\n MediaRecordEntry.a.a(paramSQLiteDatabase, localMediaRecordEntry);\r\n i++;\r\n }\r\n return i;\r\n }\r\n finally\r\n {\r\n localCursor.close();\r\n }\r\n }\r\n \r\n static Cursor a(SQLiteDatabase paramSQLiteDatabase, int paramInt1, long paramLong, int paramInt2)\r\n {\r\n String str1 = a;\r\n String[] arrayOfString1 = MediaRecordEntry.a.b;\r\n String str2 = b;\r\n String[] arrayOfString2 = new String[2];\r\n arrayOfString2[0] = Long.toString(paramLong);\r\n arrayOfString2[1] = Integer.toString(paramInt1);\r\n return paramSQLiteDatabase.query(true, str1, arrayOfString1, str2, arrayOfString2, null, null, \"_id ASC\", Integer.toString(paramInt2));\r\n }\r\n \r\n public static void a(SQLiteDatabase paramSQLiteDatabase, int paramInt, String paramString)\r\n {\r\n if (paramInt == -1) {}\r\n int i;\r\n do\r\n {\r\n return;\r\n i = 0;\r\n int j;\r\n do\r\n {\r\n j = b(paramSQLiteDatabase, paramInt, paramString);\r\n if (Log.isLoggable(\"iu.UploadsManager\", 4)) {\r\n new StringBuilder(56).append(\"ADD; medias added in batch: \").append(j).append(\"; iu: \").append(paramInt);\r\n }\r\n i += j;\r\n } while (j > 0);\r\n } while (!Log.isLoggable(\"iu.UploadsManager\", 4));\r\n new StringBuilder(60).append(\"ADD; complete; total scheduled: \").append(i).append(\"; iu: \").append(paramInt);\r\n }\r\n \r\n public static void a(SQLiteDatabase paramSQLiteDatabase, String paramString)\r\n {\r\n paramSQLiteDatabase.delete(a, \"upload_account_id != -1 AND bucket_id = ? AND upload_state != 400\", new String[] { paramString });\r\n }\r\n \r\n public static void a(hci paramhci, int paramInt)\r\n {\r\n if (paramInt == -1) {\r\n return;\r\n }\r\n String[] arrayOfString = new String[1];\r\n arrayOfString[0] = Integer.toString(paramInt);\r\n paramhci.getWritableDatabase().delete(a, \"upload_account_id = ? AND upload_state = 100\", arrayOfString);\r\n }\r\n \r\n static void a(hci paramhci, int paramInt1, int paramInt2)\r\n {\r\n if ((paramInt2 != 40) && (paramInt2 != 30)) {\r\n throw new IllegalArgumentException(\"only REASON_UPLOAD_ALL and REASON_INSTANT_UPLOAD supported\");\r\n }\r\n SQLiteDatabase localSQLiteDatabase = paramhci.getWritableDatabase();\r\n String str = a;\r\n String[] arrayOfString = new String[2];\r\n arrayOfString[0] = Integer.toString(paramInt1);\r\n arrayOfString[1] = Integer.toString(paramInt2);\r\n localSQLiteDatabase.delete(str, \"upload_account_id = ? AND ( upload_state = 100 OR upload_state = 200 ) AND upload_reason = ?\", arrayOfString);\r\n }\r\n \r\n static boolean a(ContentResolver paramContentResolver, Uri paramUri)\r\n {\r\n String str1 = efj.a(paramContentResolver, paramUri, \"_data\");\r\n if (str1 != null)\r\n {\r\n int i = str1.lastIndexOf('.');\r\n if (i >= 0) {}\r\n for (String str2 = str1.substring(i + 1); (!\"jpg\".equalsIgnoreCase(str2)) && (!\"jpeg\".equalsIgnoreCase(str2)); str2 = \"\") {\r\n return false;\r\n }\r\n for (;;)\r\n {\r\n try\r\n {\r\n hxp localhxp = new hxp();\r\n try\r\n {\r\n localhxp.a(str1);\r\n int j = hxp.h;\r\n localhya = localhxp.a(j, localhxp.d(j));\r\n if (localhya != null) {\r\n continue;\r\n }\r\n localObject = null;\r\n if ((localObject == null) || (!((String)localObject).contains(\"Google\"))) {\r\n break label290;\r\n }\r\n if (!Log.isLoggable(\"iu.UploadsManager\", 4)) {\r\n break label292;\r\n }\r\n String str4 = String.valueOf(localObject);\r\n if (str4.length() == 0) {\r\n continue;\r\n }\r\n \"*** Found Google EXIF tag; value: \".concat(str4);\r\n }\r\n catch (IOException localIOException)\r\n {\r\n if (!Log.isLoggable(\"iu.UploadsManager\", 4)) {\r\n break label294;\r\n }\r\n }\r\n new StringBuilder(37 + String.valueOf(str1).length()).append(\"INFO: \").append(str1).append(\" does not contain any EXIF data\");\r\n }\r\n catch (Throwable localThrowable)\r\n {\r\n hya localhya;\r\n Object localObject;\r\n if (!Log.isLoggable(\"iu.UploadsManager\", 4)) {\r\n continue;\r\n }\r\n String str3 = String.valueOf(localThrowable);\r\n new StringBuilder(27 + String.valueOf(str1).length() + String.valueOf(str3).length()).append(\"INFO: \").append(str1).append(\" error getting EXIF; \").append(str3);\r\n return false;\r\n }\r\n localObject = localhya.a();\r\n }\r\n new String(\"*** Found Google EXIF tag; value: \");\r\n }\r\n else\r\n {\r\n label290:\r\n return false;\r\n }\r\n label292:\r\n return true;\r\n label294:\r\n return false;\r\n }\r\n \r\n static boolean a(Context paramContext)\r\n {\r\n Cursor localCursor = ((hci)mbb.a(paramContext, hci.class)).getReadableDatabase().query(true, a, MediaRecordEntry.a.b, \"upload_reason = 30 AND upload_state = 400\", null, null, null, null, \"1\");\r\n try\r\n {\r\n boolean bool = localCursor.moveToFirst();\r\n return bool;\r\n }\r\n finally\r\n {\r\n localCursor.close();\r\n }\r\n }\r\n \r\n public static boolean a(Context paramContext, int paramInt1, int paramInt2)\r\n {\r\n hci localhci = (hci)mbb.a(paramContext, hci.class);\r\n String str1;\r\n String[] arrayOfString;\r\n if (paramInt1 == -1)\r\n {\r\n str1 = \"upload_account_id != -1 AND upload_state = 200\";\r\n arrayOfString = null;\r\n }\r\n for (;;)\r\n {\r\n if (Log.isLoggable(\"iu.UploadsManager\", 4))\r\n {\r\n String str2 = a;\r\n String str3 = 28 + String.valueOf(str2).length() + String.valueOf(str1).length() + \"SELECT COUNT(*) FROM \" + str2 + \" WHERE \" + str1;\r\n long l = DatabaseUtils.longForQuery(localhci.getReadableDatabase(), str3, arrayOfString);\r\n new StringBuilder(40).append(\"num queued entries: \").append(l);\r\n }\r\n ContentValues localContentValues = new ContentValues(1);\r\n localContentValues.put(\"upload_state\", Integer.valueOf(100));\r\n int i = localhci.getWritableDatabase().update(a, localContentValues, str1, arrayOfString);\r\n if (Log.isLoggable(\"iu.UploadsManager\", 4)) {\r\n new StringBuilder(32).append(\"num updated entries: \").append(i);\r\n }\r\n if (i <= 0) {\r\n break;\r\n }\r\n return true;\r\n str1 = \"upload_account_id = ? AND upload_state = 200\";\r\n arrayOfString = new String[1];\r\n arrayOfString[0] = Integer.toString(paramInt1);\r\n }\r\n return false;\r\n }\r\n \r\n public static boolean a(Context paramContext, ContentResolver paramContentResolver, SQLiteDatabase paramSQLiteDatabase, ContentValues paramContentValues, String paramString, long paramLong, Uri paramUri, boolean paramBoolean1, boolean paramBoolean2)\r\n {\r\n hba localhba = (hba)mbb.a(paramContext, hba.class);\r\n String str1 = paramUri.toString();\r\n paramContentValues.clear();\r\n paramContentValues.putNull(\"album_id\");\r\n paramContentValues.putNull(\"event_id\");\r\n paramContentValues.put(\"upload_account_id\", Integer.valueOf(-1));\r\n paramContentValues.put(\"bucket_id\", paramString);\r\n paramContentValues.put(\"is_image\", Boolean.valueOf(paramBoolean1));\r\n paramContentValues.put(\"media_id\", Long.valueOf(paramLong));\r\n paramContentValues.put(\"media_time\", Long.valueOf(efj.a(paramContentResolver, paramUri)));\r\n String str2 = efj.a(paramContentResolver, paramUri, \"_data\");\r\n if (str2 == null) {\r\n str2 = str1;\r\n }\r\n paramContentValues.put(\"media_hash\", Integer.valueOf(str2.hashCode()));\r\n paramContentValues.put(\"media_url\", str1);\r\n paramContentValues.put(\"upload_reason\", Integer.valueOf(0));\r\n paramContentValues.put(\"upload_state\", Integer.valueOf(500));\r\n MediaRecordEntry.a.a(paramSQLiteDatabase, MediaRecordEntry.a(paramContentValues));\r\n if ((!paramBoolean2) || (a(paramContentResolver, paramUri))) {\r\n return false;\r\n }\r\n int i = localhba.d();\r\n paramContentValues.putNull(\"event_id\");\r\n if (!hbj.a(paramContext))\r\n {\r\n paramContentValues.put(\"upload_account_id\", Integer.valueOf(i));\r\n paramContentValues.put(\"upload_reason\", Integer.valueOf(30));\r\n paramContentValues.put(\"upload_state\", Integer.valueOf(100));\r\n MediaRecordEntry.a.a(paramSQLiteDatabase, MediaRecordEntry.a(paramContentValues));\r\n if (Log.isLoggable(\"iu.UploadsManager\", 4)) {\r\n new StringBuilder(59).append(\"NEW; upload media id: \").append(paramLong).append(\"; iu: \").append(i);\r\n }\r\n }\r\n if (Log.isLoggable(\"iu.UploadsManager\", 4)) {\r\n new StringBuilder(39).append(\"NEW; add media id: \").append(paramLong);\r\n }\r\n return true;\r\n }\r\n \r\n /* Error */\r\n private static int b(SQLiteDatabase paramSQLiteDatabase, int paramInt, String paramString)\r\n {\r\n // Byte code:\r\n // 0: aload_0\r\n // 1: invokevirtual 370\tandroid/database/sqlite/SQLiteDatabase:beginTransaction\t()V\r\n // 4: getstatic 22\thbm:a\tLjava/lang/String;\r\n // 7: astore 4\r\n // 9: getstatic 17\tcom/google/android/libraries/social/autobackup/MediaRecordEntry:a\tLiao;\r\n // 12: getfield 124\tiao:b\t[Ljava/lang/String;\r\n // 15: astore 5\r\n // 17: getstatic 86\thbm:e\tLjava/lang/String;\r\n // 20: astore 6\r\n // 22: iconst_2\r\n // 23: anewarray 26\tjava/lang/String\r\n // 26: astore 7\r\n // 28: aload 7\r\n // 30: iconst_0\r\n // 31: aload_2\r\n // 32: aastore\r\n // 33: aload 7\r\n // 35: iconst_1\r\n // 36: iload_1\r\n // 37: invokestatic 134\tjava/lang/Integer:toString\t(I)Ljava/lang/String;\r\n // 40: aastore\r\n // 41: aload_0\r\n // 42: aload 4\r\n // 44: aload 5\r\n // 46: aload 6\r\n // 48: aload 7\r\n // 50: aconst_null\r\n // 51: aconst_null\r\n // 52: aconst_null\r\n // 53: sipush 500\r\n // 56: invokestatic 134\tjava/lang/Integer:toString\t(I)Ljava/lang/String;\r\n // 59: invokevirtual 373\tandroid/database/sqlite/SQLiteDatabase:query\t(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;\r\n // 62: astore 8\r\n // 64: iconst_0\r\n // 65: istore 9\r\n // 67: aload 8\r\n // 69: invokeinterface 98 1 0\r\n // 74: ifeq +52 -> 126\r\n // 77: aload 8\r\n // 79: invokestatic 101\tcom/google/android/libraries/social/autobackup/MediaRecordEntry:a\t(Landroid/database/Cursor;)Lcom/google/android/libraries/social/autobackup/MediaRecordEntry;\r\n // 82: astore 11\r\n // 84: aload 11\r\n // 86: lconst_0\r\n // 87: putfield 105\tcom/google/android/libraries/social/autobackup/MediaRecordEntry:id\tJ\r\n // 90: aload 11\r\n // 92: iload_1\r\n // 93: putfield 109\tcom/google/android/libraries/social/autobackup/MediaRecordEntry:mUploadAccountId\tI\r\n // 96: aload 11\r\n // 98: bipush 30\r\n // 100: putfield 112\tcom/google/android/libraries/social/autobackup/MediaRecordEntry:mUploadReason\tI\r\n // 103: aload 11\r\n // 105: bipush 100\r\n // 107: putfield 115\tcom/google/android/libraries/social/autobackup/MediaRecordEntry:mUploadState\tI\r\n // 110: getstatic 17\tcom/google/android/libraries/social/autobackup/MediaRecordEntry:a\tLiao;\r\n // 113: aload_0\r\n // 114: aload 11\r\n // 116: invokevirtual 118\tiao:a\t(Landroid/database/sqlite/SQLiteDatabase;Lial;)J\r\n // 119: pop2\r\n // 120: iinc 9 1\r\n // 123: goto -56 -> 67\r\n // 126: aload_0\r\n // 127: invokevirtual 376\tandroid/database/sqlite/SQLiteDatabase:setTransactionSuccessful\t()V\r\n // 130: aload 8\r\n // 132: invokeinterface 121 1 0\r\n // 137: aload_0\r\n // 138: invokevirtual 379\tandroid/database/sqlite/SQLiteDatabase:endTransaction\t()V\r\n // 141: iload 9\r\n // 143: ireturn\r\n // 144: astore 10\r\n // 146: aload 8\r\n // 148: invokeinterface 121 1 0\r\n // 153: aload 10\r\n // 155: athrow\r\n // 156: astore_3\r\n // 157: aload_0\r\n // 158: invokevirtual 379\tandroid/database/sqlite/SQLiteDatabase:endTransaction\t()V\r\n // 161: aload_3\r\n // 162: athrow\r\n // Local variable table:\r\n // start\tlength\tslot\tname\tsignature\r\n // 0\t163\t0\tparamSQLiteDatabase\tSQLiteDatabase\r\n // 0\t163\t1\tparamInt\tint\r\n // 0\t163\t2\tparamString\tString\r\n // 156\t6\t3\tlocalObject1\tObject\r\n // 7\t36\t4\tstr1\tString\r\n // 15\t30\t5\tarrayOfString1\tString[]\r\n // 20\t27\t6\tstr2\tString\r\n // 26\t23\t7\tarrayOfString2\tString[]\r\n // 62\t85\t8\tlocalCursor\tCursor\r\n // 65\t77\t9\ti\tint\r\n // 144\t10\t10\tlocalObject2\tObject\r\n // 82\t33\t11\tlocalMediaRecordEntry\tMediaRecordEntry\r\n // Exception table:\r\n // from\tto\ttarget\ttype\r\n // 67\t120\t144\tfinally\r\n // 126\t130\t144\tfinally\r\n // 4\t64\t156\tfinally\r\n // 130\t137\t156\tfinally\r\n // 146\t156\t156\tfinally\r\n }\r\n \r\n static int b(hci paramhci, int paramInt1, int paramInt2)\r\n {\r\n if (paramInt1 == -1) {\r\n return 0;\r\n }\r\n SQLiteDatabase localSQLiteDatabase = paramhci.getReadableDatabase();\r\n String str = d;\r\n String[] arrayOfString = new String[2];\r\n arrayOfString[0] = Integer.toString(paramInt1);\r\n arrayOfString[1] = Integer.toString(paramInt2);\r\n return (int)DatabaseUtils.longForQuery(localSQLiteDatabase, str, arrayOfString);\r\n }\r\n \r\n public static MediaRecordEntry b(hci paramhci, int paramInt)\r\n {\r\n String str;\r\n String[] arrayOfString;\r\n if (paramInt == -1)\r\n {\r\n str = \"upload_account_id != -1 AND upload_state = 100\";\r\n arrayOfString = null;\r\n }\r\n for (;;)\r\n {\r\n Cursor localCursor = paramhci.getReadableDatabase().query(a, MediaRecordEntry.a.b, str, arrayOfString, null, null, \"upload_reason ASC, upload_state ASC, upload_status ASC, is_image DESC, retry_end_time ASC LIMIT 1\");\r\n try\r\n {\r\n if (localCursor.moveToNext())\r\n {\r\n MediaRecordEntry localMediaRecordEntry = MediaRecordEntry.a(localCursor);\r\n return localMediaRecordEntry;\r\n str = \"upload_account_id = ? AND upload_state = 100\";\r\n arrayOfString = new String[1];\r\n arrayOfString[0] = Integer.toString(paramInt);\r\n continue;\r\n }\r\n return null;\r\n }\r\n finally\r\n {\r\n localCursor.close();\r\n }\r\n }\r\n }\r\n \r\n public static int c(hci paramhci, int paramInt)\r\n {\r\n SQLiteDatabase localSQLiteDatabase = paramhci.getReadableDatabase();\r\n String str = c;\r\n String[] arrayOfString = new String[1];\r\n arrayOfString[0] = Integer.toString(paramInt);\r\n return (int)DatabaseUtils.longForQuery(localSQLiteDatabase, str, arrayOfString);\r\n }\r\n \r\n static void c(hci paramhci, int paramInt1, int paramInt2)\r\n {\r\n if (paramInt1 == -1) {\r\n throw new IllegalStateException(52 + \"can't enable upload for invalid account: \" + paramInt1);\r\n }\r\n SQLiteDatabase localSQLiteDatabase1 = paramhci.getWritableDatabase();\r\n int i = 0;\r\n for (;;)\r\n {\r\n localSQLiteDatabase1.beginTransaction();\r\n try\r\n {\r\n int j = a(localSQLiteDatabase1, paramInt1, 40);\r\n localSQLiteDatabase1.setTransactionSuccessful();\r\n localSQLiteDatabase1.endTransaction();\r\n i += j;\r\n if (j <= 0)\r\n {\r\n if (Log.isLoggable(\"iu.UploadsManager\", 4)) {\r\n new StringBuilder(35).append(\"START; scheduled \").append(i).append(\" photos\");\r\n }\r\n SQLiteDatabase localSQLiteDatabase2 = paramhci.getReadableDatabase();\r\n String str = a;\r\n String[] arrayOfString1 = MediaRecordEntry.a.b;\r\n String[] arrayOfString2 = new String[1];\r\n arrayOfString2[0] = Integer.toString(paramInt1);\r\n Cursor localCursor = localSQLiteDatabase2.query(true, str, arrayOfString1, \"upload_account_id = ? AND upload_state = 300\", arrayOfString2, null, null, null, null);\r\n MediaRecordEntry localMediaRecordEntry;\r\n localCursor.close();\r\n }\r\n }\r\n finally {}\r\n }\r\n }\r\n \r\n /* Error */\r\n static int d(hci paramhci, int paramInt)\r\n {\r\n // Byte code:\r\n // 0: aload_0\r\n // 1: invokevirtual 260\thci:getReadableDatabase\t()Landroid/database/sqlite/SQLiteDatabase;\r\n // 4: iconst_1\r\n // 5: getstatic 22\thbm:a\tLjava/lang/String;\r\n // 8: iconst_1\r\n // 9: anewarray 26\tjava/lang/String\r\n // 12: dup\r\n // 13: iconst_0\r\n // 14: ldc_w 404\r\n // 17: aastore\r\n // 18: ldc_w 406\r\n // 21: aconst_null\r\n // 22: aconst_null\r\n // 23: aconst_null\r\n // 24: aconst_null\r\n // 25: aconst_null\r\n // 26: invokevirtual 142\tandroid/database/sqlite/SQLiteDatabase:query\t(ZLjava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;\r\n // 29: astore_2\r\n // 30: aload_2\r\n // 31: invokeinterface 98 1 0\r\n // 36: ifeq +25 -> 61\r\n // 39: aload_2\r\n // 40: iconst_0\r\n // 41: invokeinterface 409 2 0\r\n // 46: istore 5\r\n // 48: iload 5\r\n // 50: istore 4\r\n // 52: aload_2\r\n // 53: invokeinterface 121 1 0\r\n // 58: iload 4\r\n // 60: ireturn\r\n // 61: iconst_0\r\n // 62: istore 4\r\n // 64: goto -12 -> 52\r\n // 67: astore_3\r\n // 68: aload_2\r\n // 69: invokeinterface 121 1 0\r\n // 74: aload_3\r\n // 75: athrow\r\n // Local variable table:\r\n // start\tlength\tslot\tname\tsignature\r\n // 0\t76\t0\tparamhci\thci\r\n // 0\t76\t1\tparamInt\tint\r\n // 29\t40\t2\tlocalCursor\tCursor\r\n // 67\t8\t3\tlocalObject\tObject\r\n // 50\t13\t4\ti\tint\r\n // 46\t3\t5\tj\tint\r\n // Exception table:\r\n // from\tto\ttarget\ttype\r\n // 30\t48\t67\tfinally\r\n }\r\n}\r\n\r\n\r\r\n/* Location: F:\\apktool\\apktool\\com.google.android.apps.plus\\classes-dex2jar.jar\r\r\n * Qualified Name: hbm\r\r\n * JD-Core Version: 0.7.0.1\r\r\n */", "meta": {"content_hash": "7a0744910524651372847a2df967f466", "timestamp": "", "source": "github", "line_count": 547, "max_line_length": 376, "avg_line_length": 38.04753199268738, "alnum_prop": 0.6075341149336921, "repo_name": "ChiangC/FMTech", "id": "e2130c80069385b9bc76776af795a61f615ab637", "size": "20812", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "GooglePlus/app/src/main/java/hbm.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C++", "bytes": "935"}, {"name": "CMake", "bytes": "1767"}, {"name": "HTML", "bytes": "28061"}, {"name": "Java", "bytes": "47051212"}, {"name": "JavaScript", "bytes": "1535"}, {"name": "Makefile", "bytes": "5823"}]}} +{"text": "import { \n Component \n} from '@angular/core';\n\n@Component({\n templateUrl: 'index.html',\n styleUrls: ['index.css'],\n})\nexport \nclass Home { }\n", "meta": {"content_hash": "db90c23e0b2c7340190c522b21f4c61e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 28, "avg_line_length": 14.4, "alnum_prop": 0.6319444444444444, "repo_name": "MiningTheDisclosures/conflict-minerals-data", "id": "221fc21ccf27026a2ab8cd0402a118631cce1c7a", "size": "144", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "conflict_minerals_data/frontend/app/components/home/index.ts", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "2784"}, {"name": "HTML", "bytes": "4624"}, {"name": "JavaScript", "bytes": "4426886"}, {"name": "Jupyter Notebook", "bytes": "69090"}, {"name": "Python", "bytes": "37833"}, {"name": "TypeScript", "bytes": "15706"}]}} +{"text": "var params = {\n tables: 14,\n currentTable: 0,\n currentQuestion: -1\n};\nvar questions = [\n { q: \"\u00bfCu\u00e1l es el color preferido de Silvina?\", o: [ \"Verde\", \"Amarillo\", \"Azul\" ], a: 1 },\n { q: \"\u00bfA qu\u00e9 edad sali\u00f3 Pablo del closet?\", o: [ \"15\", \"18\", \"Hoy\" ], a: 0 },\n { q: \"\u00bfQui\u00e9n se tom\u00f3 todo el vino?\", o: [ \"La mona Gimenez\", \"Silchu\", \"Pablo\" ], a: 2 },\n { q: \"\u00bfCual de estas prendas no usaria pablo?\", o: [ \"Pollera\", \"Zapatos con taco\", \"Medias de red\" ], a: 0 }\n];\n\n$().ready(function() {\n\n var nextTable = function() {\n params.currentTable++;\n params.currentQuestion = -1;\n next();\n };\n\n var showQuestion = function() {\n var question = questions[params.currentQuestion];\n $('#question').text(question.q);\n $('#answers').empty();\n for (var i in question.o) {\n var value = question.o[i];\n $('#answers').append($('<button />').addClass('btn btn-danger').text(value));\n }\n\n $('#prev').toggle(params.currentQuestion > 0);\n $('#next').attr('disabled', 'disabled').toggle(params.currentQuestion <= questions.length);\n };\n\n var next = function() {\n if (params.currentQuestion == questions.length)\n nextTable();\n\n params.currentQuestion++;\n showQuestion();\n };\n\n var prev = function() {\n params.currentQuestion--;\n showQuestion();\n };\n\n $('#next').click(next);\n $('#prev').click(prev);\n $('#answers').on('click', 'button', function() {\n $('#next').removeAttr('disabled');\n });\n\n nextTable();\n});\n", "meta": {"content_hash": "c32d1c14b830626baec26c3dc2a7bdbd", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 111, "avg_line_length": 27.24074074074074, "alnum_prop": 0.5764785859959212, "repo_name": "eduardocampano/silpa", "id": "81b1ba090fe9d9169bc05d5c7fa7116df600be4e", "size": "1480", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "main.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "932"}, {"name": "JavaScript", "bytes": "3872"}]}} +{"text": "import { Component } from '@angular/core';\n\n@Component({\n selector: 'footer-sticky',\n template: require('./footer-sticky.component.html')\n})\nexport class FooterStickyComponent {\n}\n", "meta": {"content_hash": "76260f14e5990339d57e3415c7bb4857", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 55, "avg_line_length": 23.25, "alnum_prop": 0.7043010752688172, "repo_name": "SokolovArtur/aspnetcore", "id": "9cf36526eac1961a6fad2ec214e0bc51eb986b27", "size": "186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AspNetCore/ClientApp/app/home/components/footer-sticky/footer-sticky.component.ts", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "80925"}, {"name": "CSS", "bytes": "822940"}, {"name": "HTML", "bytes": "1533815"}, {"name": "JavaScript", "bytes": "2540296"}, {"name": "PHP", "bytes": "153457"}, {"name": "Shell", "bytes": "7411"}, {"name": "TypeScript", "bytes": "5338"}]}} +{"text": "struct QVariantMeshWrapper\n{\n QVariantMeshWrapper() {}\n Ogre::Item* item;\n};\n\nQ_DECLARE_METATYPE(QVariantMeshWrapper);\n\n\nSaveAsDialog::SaveAsDialog(QWidget* parent, OgreManager* ogre) : QDialog(parent)\n{\n ui = new Ui::SaveAsDialog;\n ui->setupUi(this);\n\n mOgre = ogre;\n ui->progressBar->setVisible(false);\n\n connect(ui->browseButton, &QPushButton::clicked, this, &SaveAsDialog::browseButtonClicked);\n connect(ui->saveButton, &QPushButton::clicked, this, &SaveAsDialog::saveButtonClicked);\n connect(ui->cancelButton, &QPushButton::clicked, this, &SaveAsDialog::cancelButtonClicked);\n}\n\nSaveAsDialog::~SaveAsDialog()\n{\n delete ui;\n}\n\nvoid SaveAsDialog::showEvent(QShowEvent*)\n{\n if (!mInitialized)\n {\n ui->savePathText->setText(mOutputFolder);\n\n listAllMeshesFromScene();\n mInitialized = true;\n }\n}\n\nvoid SaveAsDialog::browseButtonClicked()\n{\n QString initialPath = ui->savePathText->text();\n QString folder = QFileDialog::getExistingDirectory(this, \"Output path\", initialPath);\n\n if (!folder.isEmpty())\n {\n ui->savePathText->setText(folder);\n mOutputFolder = folder;\n }\n}\n\nvoid SaveAsDialog::saveButtonClicked()\n{\n lockListWidget();\n\n std::vector<Ogre::Item*> ogreItems;\n\n QListWidget* listWidget = ui->listWidget;\n for (int i = 0; i < listWidget->count(); ++i)\n {\n QListWidgetItem* item = listWidget->item(i);\n bool checked = (item->checkState() == Qt::Checked);\n if (checked)\n {\n auto wrapper = item->data(Qt::UserRole).value<QVariantMeshWrapper>();\n ogreItems.push_back(wrapper.item);\n }\n }\n\n ui->progressBar->setVisible(true);\n ui->progressBar->setMaximum(ogreItems.size());\n QApplication::processEvents(QEventLoop::DialogExec);\n\n saveOgreMeshes(ogreItems);\n\n Ogre::SceneNode* rootNode = mOgre->meshRootNode();\n std::vector<Ogre::SceneNode*> nodes;\n collectNodeRecursively(rootNode, nodes);\n\n saveLuaScript(nodes, ogreItems);\n\n QSettings settings(\"OgreV2ModelViewer\", \"OgreV2ModelViewer\");\n settings.setValue(\"actionSaveMesh\", mOutputFolder);\n\n accept();\n}\n\nvoid SaveAsDialog::cancelButtonClicked()\n{\n reject();\n}\n\nvoid SaveAsDialog::listAllMeshesFromScene()\n{\n Ogre::SceneNode* node = mOgre->meshRootNode();\n\n std::vector<Ogre::Item*> items;\n collectMeshRecursively(node, items);\n\n for (const Ogre::Item* m : items)\n {\n qDebug() << m->getName().c_str();\n }\n\n createListItems(items);\n}\n\nvoid SaveAsDialog::collectMeshRecursively(Ogre::SceneNode* node, std::vector<Ogre::Item*>& ogreItems)\n{\n size_t count = node->numAttachedObjects();\n for (size_t i = 0; i < count; ++i)\n {\n Ogre::Item* item = dynamic_cast<Ogre::Item*>(node->getAttachedObject(i));\n if (item)\n {\n ogreItems.push_back(item);\n }\n }\n\n for (int i = 0; i < node->numChildren(); ++i)\n {\n Ogre::SceneNode* child = static_cast<Ogre::SceneNode*>(node->getChild(i));\n collectMeshRecursively(child, ogreItems);\n }\n}\n\nvoid SaveAsDialog::collectNodeRecursively(Ogre::SceneNode* node, std::vector<Ogre::SceneNode*>& ogreNodes)\n{\n ogreNodes.push_back(node);\n\n for (int i = 0; i < node->numChildren(); ++i)\n {\n Ogre::SceneNode* child = static_cast<Ogre::SceneNode*>(node->getChild(i));\n collectNodeRecursively(child, ogreNodes);\n }\n}\n\nvoid SaveAsDialog::createListItems(const std::vector<Ogre::Item*>& ogreItems)\n{\n for (Ogre::Item* i : ogreItems)\n {\n QString meshName = QString::fromStdString(i->getName());\n\n QListWidgetItem* listItem = new QListWidgetItem(meshName, ui->listWidget);\n listItem->setFlags(listItem->flags() | Qt::ItemIsUserCheckable);\n listItem->setCheckState(Qt::Checked);\n\n QVariantMeshWrapper wrapper;\n wrapper.item = i;\n listItem->setData(Qt::UserRole, QVariant::fromValue(wrapper));\n\n ui->listWidget->addItem(listItem);\n }\n\n //QSignalBlocker b(ui->selectAllCheckbox);\n //ui->selectAllCheckbox->setChecked(true);\n}\n\nvoid SaveAsDialog::lockListWidget()\n{\n QListWidget* listWidget = ui->listWidget;\n for (int i = 0; i < listWidget->count(); ++i)\n {\n QListWidgetItem* item = listWidget->item(i);\n item->setFlags(Qt::NoItemFlags);\n }\n QApplication::processEvents(QEventLoop::DialogExec);\n}\n\nvoid SaveAsDialog::saveOgreMeshes(const std::vector<Ogre::Item*>& ogreItems)\n{\n for (int i = 0; i < ogreItems.size(); ++i)\n {\n applySubMeshMaterialNames(ogreItems[i]);\n\n QString meshName = validateFileName(QString::fromStdString(ogreItems[i]->getMesh()->getName()));\n\n QString fullPath = QDir(mOutputFolder).filePath(meshName);\n Ogre::Mesh* mesh = ogreItems[i]->getMesh().get();\n\n Ogre::Root* root = mOgre->ogreRoot();\n Ogre::MeshSerializer meshSerializer2(root->getRenderSystem()->getVaoManager());\n meshSerializer2.exportMesh(mesh, fullPath.toStdString());\n\n saveHlmsJson(ogreItems[i]);\n\n ui->progressBar->setValue(i + 1);\n QApplication::processEvents(QEventLoop::DialogExec);\n }\n}\n\nvoid SaveAsDialog::saveHlmsJson(const Ogre::Item* ogreItem)\n{\n auto hlmsManager = Ogre::Root::getSingleton().getHlmsManager();\n\n size_t numSubItem = ogreItem->getNumSubItems();\n for (int i = 0; i < numSubItem; ++i)\n {\n Ogre::HlmsDatablock* datablock = ogreItem->getSubItem(i)->getDatablock();\n\n Ogre::HlmsJson hlmsJson(hlmsManager, nullptr);\n std::string outJson;\n hlmsJson.saveMaterial(datablock, outJson, \"\");\n\n QString outputPath = QDir(mOutputFolder).filePath(datablock->getNameStr()->c_str());\n if (!outputPath.endsWith(\".material.json\"))\n {\n outputPath.append(\".material.json\");\n }\n\n QFile f(outputPath);\n if (f.open(QFile::WriteOnly))\n {\n QTextStream fout(&f);\n fout.setCodec(\"UTF-8\");\n fout << QString::fromStdString(outJson);\n }\n f.close();\n\n qDebug() << \"Write Hlms Json: \" << outputPath;\n }\n}\n\nQString SaveAsDialog::validateFileName(QString fileName)\n{\n if (fileName.endsWith(\" (v1)\"))\n {\n fileName = fileName.mid(0, fileName.size() - 5); // remove the (v1) part\n }\n\n if (fileName.endsWith(\".mesh.xml\"))\n {\n fileName = fileName.mid(0, fileName.size() - 4); // remove the .xml part\n }\n\n if (!fileName.endsWith(\".mesh\"))\n {\n fileName.append(\".mesh\"); // make sure the file extension is .mesh\n }\n return fileName;\n}\n\nvoid SaveAsDialog::applySubMeshMaterialNames(Ogre::Item* ogreItem)\n{\n // Otherwise the exported mesh won't contain the material name.\n // Check OgreMesh2SerializerImpl.cpp line 269 (in MeshSerializerImpl::writeSubMesh())\n\n size_t numSubItems = ogreItem->getNumSubItems();\n for (size_t i = 0; i < numSubItems; ++i)\n {\n std::string datablockName = *ogreItem->getSubItem(i)->getDatablock()->getNameStr();\n ogreItem->getSubItem(i)->getSubMesh()->setMaterialName(datablockName);\n }\n}\n\nvoid SaveAsDialog::saveLuaScript(const std::vector<Ogre::SceneNode*>& nodes, const std::vector<Ogre::Item*>& ogreItems)\n{\n // This function is just for my engine.\n QString fileName = \"mesh_load2.lua\";\n QString fullPath = QDir(mOutputFolder).filePath(fileName);\n\n QFile f(fullPath);\n if (!f.open(QFile::WriteOnly))\n return;\n\n QTextStream fout(&f);\n fout << \"local node_list = {}\\n\";\n\n for (size_t i = 0; i < nodes.size(); ++i)\n {\n Ogre::SceneNode* node = nodes[i];\n Ogre::Vector3 pos = node->getPosition();\n\n const Ogre::Quaternion quaternion = node->getOrientation();\n Ogre::Matrix3 matrix3;\n quaternion.ToRotationMatrix(matrix3);\n\n Ogre::Radian rx, ry, rz;\n matrix3.ToEulerAnglesXYZ(rx, ry, rz);\n\n Ogre::Vector3 scale = node->getScale();\n \n QString parentNodeName = (node == mOgre->meshRootNode()) ? \"main_building\" : QString::fromStdString(node->getParent()->getName());\n\n QString line = QString(\"node_list[%1] = { name=\\\"%2\\\", pos={x=%3, y=%4, z=%5}, rot={x=%6, y=%7, z=%8}, scale={x=%9, y=%10, z=%11}, parent=\\\"%12\\\" }\")\n .arg(i)\n .arg(node->getName().c_str())\n .arg(pos.x, 0, 'f', 4)\n .arg(pos.y, 0, 'f', 4)\n .arg(pos.z, 0, 'f', 4)\n .arg(rx.valueDegrees(), 0, 'f', 4)\n .arg(ry.valueDegrees(), 0, 'f', 4)\n .arg(rz.valueDegrees(), 0, 'f', 4)\n .arg(scale.x, 0, 'f', 4)\n .arg(scale.y, 0, 'f', 4)\n .arg(scale.z, 0, 'f', 4)\n .arg(parentNodeName);\n\n fout << line << \"\\n\";\n }\n\n QString funcNodes = \"\"\n \"\\n\"\n \"function create_nodes() \\n\"\n \"\\n\"\n \" for key, value in pairs(node_list) do \\n\"\n \" local node_name = value.name \\n\"\n \" log_info(key .. ': ' .. node_name) \\n\"\n \"\\n\"\n \" local parent_node = get_object_by_name(value.parent) \\n\"\n \"\\n\"\n \" local node = create_persistent_object('CSceneNodeOgre') \\n\"\n \" node:set_name(node_name) \\n\"\n \" node:set_ref('Parent', parent_node) \\n\"\n \" node:set_vec3('Position', { x = value.pos.x, y = value.pos.y, z = value.pos.z }) \\n\"\n \" node:set_vec3('Rotation', { x = value.rot.x, y = -value.rot.y, z = value.rot.z }) \\n\"\n \" node:set_vec3('Scale', { x = value.scale.x, y = value.scale.y, z = value.scale.z }) \\n\"\n \" node:set_bool('Is Pickable', false) \\n\"\n \" node:signal_attribute('Parent') \\n\"\n \" node:signal_attribute('Name') \\n\"\n \" node:signal_attribute('Position') \\n\"\n \" node:signal_attribute('Rotation') \\n\"\n \" node:signal_attribute('Scale') \\n\"\n \" end \\n\"\n \"end \\n\";\n\n fout << funcNodes;\n fout.flush();\n\n fout << \"local mesh_list = {}\\n\";\n\n for (size_t i = 0; i < ogreItems.size(); ++i)\n {\n Ogre::Item* item = ogreItems[i];\n \n QString line = QString(\"mesh_list[%1] = { name=\\\"Mesh_%2\\\", mesh=\\\"%3\\\", parent=\\\"%4\\\" }\")\n .arg(i)\n .arg(QString::fromStdString(item->getName()))\n .arg(QString::fromStdString(item->getMesh()->getName()))\n .arg(QString::fromStdString(item->getParentNode()->getName()));\n fout << line << \"\\n\";\n }\n fout << \"\\n\";\n\n QString func = \"\\n\"\n \"function create_meshes() \\n\"\n \" local mesh_map = {} \\n\"\n\n \" for key, value in pairs(mesh_list) do \\n\"\n \" local path = 'script/' .. value.mesh .. '.mesh' \\n\"\n \" log_info(path) \\n\"\n \"\\n\"\n \" local parent_node = get_object_by_name(value.parent) \\n\"\n \"\\n\"\n \" local mesh = mesh_map[value.mesh]\\n\"\n \" if mesh == nil then\\n\"\n \" mesh = create_persistent_object('COgreMesh')\\n\"\n \" mesh:set_string('Path', path)\\n\"\n \" mesh_map[value.mesh] = mesh\\n\"\n \" end\\n\"\n \"\\n\"\n \" local node = create_persistent_object('CSceneNodeOgreMesh') \\n\"\n \" node:set_name(value.name) \\n\"\n \" node:set_ref('Ogre Mesh', mesh) \\n\"\n \" node:set_ref('Parent', parent_node) \\n\"\n \" node:set_bool('Is Pickable', false) \\n\"\n \" node:signal_attribute('Parent') \\n\"\n \" node:signal_attribute('Name') \\n\"\n \" end \\n\"\n \"end \\n\";\n\n fout << func;\n\n fout << \"\\n\"\n \"function go()\\n\"\n \" create_nodes()\\n\"\n \" create_meshes()\\n\"\n \"end\";\n \n fout.flush();\n\n f.close();\n}\n", "meta": {"content_hash": "1af4e233bb5e21aaa90206b14f9ccf9c", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 157, "avg_line_length": 30.853403141361255, "alnum_prop": 0.5774647887323944, "repo_name": "chchwy/ogre-v2-mesh-viewer", "id": "5ecc5f4d6f1de3661f6d9d71b7706fe6042b6412", "size": "12045", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/saveasdialog.cpp", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "1004"}, {"name": "C", "bytes": "293672"}, {"name": "C++", "bytes": "1424407"}, {"name": "GLSL", "bytes": "143159"}, {"name": "HLSL", "bytes": "115917"}, {"name": "Metal", "bytes": "92848"}, {"name": "QMake", "bytes": "3811"}]}} +{"text": "layout: post\ntitle: \"Tools of a Developer\"\nmodified:\ncategories: blog\nexcerpt: \"These are my tools. Hopefully, they're always improving.\"\ntags: [setup,tools]\n---\n\nOne thing I'm always on the lookout for when someone opens up their laptop in\nfront of me is what are the tools they use. This could be anything from their\nmail client to their terminal emulator. I check their operating system version.\nI look at all the icons on their screen and the windows that are open. I don't\ndo this to be a creep. I do it because I want to know the latest and\ngreatest tools people use and see if it's better than what I'm using at that\nmoment.\n\nSo in that vain, here's what I'm using at the moment. This is likely to change\n(frequently) because of what I just said above, but I think it's always a useful\nsnapshot to keep track of these things. I'll probably write more detailed posts\nabout a lot of them later.\n\n### Hardware\n\n* [Early 2015 MacBook Pro 13\" Retina](https://support.apple.com/kb/sp715?locale=en_US)\n * I've been using a Mac since I started grad school and I've never looked back.\n When I was an undergrad with nothing but time, I had a Linux box as my main\n development workstation, but at some point I got tired of doing more system\n administration than software development and gave a Mac a try. Ever since,\n Apple has done a great job of making new hardware (albeit sometimes pricy)\n and I'll keep buying it as far out as I can see. Windows has never been an\n option for me as I can't develop most of the software I work on directly on\n the machine so I'd always either have to be in a VM or an SSH session.\n* [Code Keyboard](https://codekeyboards.com/)\n * After reading for years about how great mechanical keyboards are, I finally\n gave this keyboard a shot. I won't say that it's changing my life. I didn't\n get the one with the super clacky keys so my co-workers wouldn't throw things\n at me, but I can't really tell a massive difference between this and a regular\n old rubber dome keyboard. I'd still like to try out the new Apple keyboards\n with the butterfly springs, but it's hard to justify buying another new one.\n* [Magic Trackpad 2](https://www.apple.com/shop/product/MJ2R2LL/A/magic-trackpad-2)\n * I love thing thing. It's got lots of nice gesture shortcuts that work well\n with the Mac (for things like starting Expose or Mission Control or whatever\n it's called now). 3-finger dragging is a must for quick selection. It also\n doesn't cramp up your hand the way a mouse can. I won't be doing any gaming\n on this thing, but I have a real mouse for that at home.\n* [Fellowes Memory Foam Wrist Rest](https://www.amazon.com/gp/product/B0013CEY0Q)\n * If you're going to use a keyboard, you need a place to put your wrists. I\n picked this one up on Amazon because it was the right size and it was cheap.\n No complaints.\n* BenQ GW2765 27\" Monitor\n * I didn't really get to pick my monitor at work. I had the option of two low-res\n Dell monitors or this higher resolution one. I picked this one because I've\n never really gotten my workflow to do well with two monitors. I have the one\n big monitor in the center of my desk and the laptop to the side for extra\n windows that I can push over there (documentation, etc.).\n* Laptop holder from bathroom stall as laptop stand\n * This was literally a curved piece of metal sitting in a closet somewhere.\n Turns out it's hung on the back of bathroom stalls for people to put their\n laptops in while using the bathroom. Here's hoping this one wasn't in there\n long.\n* [Plantronics Backbeat PRO Bluetooth Headphones](http://a.co/2jMNcX9)\n * I don't have great things to say about these. I love the fact that they're\n bluetooth so I stop accidentally pulling the wires out of the headphones\n and/or the computer. However, there's an awful lot of interference that\n results in a clicking/skipping sound when listening to music. At some point,\n I might try using some Bose QC 35's to see if they have the same problem.\n* Pen and notebook\n * I take notes. This is where they go. I've tried lots of digital note-taking\n apps, but on the iPad, the writing fidelity is horrible. When typing, I often\n can't keep up with what's going on or I get distracted. The downside is that\n I have to carry a physical thing around though.\n* [Fellowes Monitor Stand](https://www.amazon.com/dp/B00006B8J2)\n * I'm pretty tall so having something to get my monitor up to the right height\n is important. They had a bunch of these sitting around at work and it does\n the job. To be fair though, if these weren't around, I would have just used\n a stack of books or something.\n\n### Communication\n\n* Mail\n * Mail.app\n * I've gone back and forth with just about every mail client for Mac. In the\n end, the reason I keep ending up back with the stock app is mostly the\n fault of where I work. It's hard for me to use the non-stock mail app on\n my phone which means I lose a lot of the benefit of the kinds of apps that\n let you \"snooze\" emails. I'd love to have that ability, but until I can\n get it everywhere, it's not as useful.\n * [Outlook for Mac](https://products.office.com/en-us/outlook/email-and-calendar-software-microsoft-outlook)\n * From time to time, I have to fire up Outlook for work. Usually because I\n want to schedule a meeting and need to be able to best integrate with the\n Exchange server. I don't use this as a daily driver.\n* Calendar\n * Calendar.app\n * I've tried a few different alternatives here too, but end up going back to\n the default calendar app because I keep using the default mail app. It's\n very nice to have a mail and calendar app that work together well.\n* Instant Messaging\n * [Slack](www.slack.com)\n * Depending on who I need to talk to, I have to use different chat\n clients/servers. In the end though, this is my favorite. It's available\n everywhere. The clients do a good job of exposing features. Notifications\n are good. Lots of integrations. It pretty much does it all.\n * [Rocket.Chat](https://rocket.chat/)\n * Rocket.Chat isn't too bad. It's a poor man's Slack. The reason I use it is\n because we need to have a self-hosted chat client for work and this is\n pretty much all there is. Our install is somewhat crippled due to firewall\n restrictions or I might like it better.\n * Messages.app\n * This is pretty much just used for texting. If you use iMessages, you use\n this.\n * [Skype for Business](https://www.skype.com/en/business/skype-for-business/)\n * This is my least favorite. I have to use it because of work, but I get out\n of it as much as possible. It is still not feature complete (compared to\n the Lync client that it replaced) even after a 1.0 release. It drops\n connections from time to time. It's a **huge** battery hog. It has\n terrible syncing between the desktop and mobile clients. This is a last\n resort.\n\n### Music\n\n* [Spotify (Paid)](https://www.spotify.com/us/)\n * I've tried Amazon Music and Apple Music and I keep coming back to Spotify.\n For me, the differentiator is the curated playlist selection. I like to\n listen to music while at work and I don't want to spend a bunch of time\n picking the next song. Apple and Amazon's playlists are too short and I have\n to pick a new playlist every hour or two. Pandora requires that I know more\n about what I want to listen to before I start (need to \"seed\" my playlists\n well). I like that Spotify has lots of ambient lists that I can trust to not\n get in my way while I'm trying to work.\n\n### Browser\n\n* [Chrome](https://www.google.com/chrome/)\n * I recently built a Windows PC at home so I decided to switch back to Chrome\n to have a cross-platform browser. I like that Safari is more integrated with\n the OS, but I've also found that Chrome tends to work with more websites,\n especially those that are said to be \"IE-only\" at work.\n\n### Command Line\n\n* [Neovim](https://neovim.io/)\n * I'm a Vim diehard. Mostly because I never learned Emacs. It's not that I\n have a good argument why Vim is better. I'm just lazy. That being said, I\n did switch over hardcore to Neovim. The big winner here over regular Vim is\n asynchronous background threads for plugins. I use tons of plugins (probably\n discuss that in a different post) and some of them, like linters are pretty\n painful if they block the main thread. Imagine typing and your linter kicks\n in for 2 seconds. You can't get any response from the UI until it's done\n compiling. That's not ok. Don't be that guy. Use Neovim.\n* [iTerm2](https://www.iterm2.com/)\n * This is a big improvement over the default Terminal app in MacOS. I'll admit\n that it's been a long time since I\"ve use the default app, but at least when I\n switched, iTerm2 had much better handling of splits and windows. Since then,\n the killer feature has been built-in support for remote tmux sessions. I can\n now create and manipulate my splits and windows seamlessly. It's awesome.\n* [tmux](https://tmux.github.io/)\n * In my last job, I was able to use mosh. It was awesome. I loved it. My\n sessions just never died. I'd lose a connection. Go home. Get on a plane.\n Doesn't matter. The ssh connection was always there. Fast forward to my new\n job and mosh is no longer an option. Next best thing, I use tmux. Sessions\n always stay alive even when I go home for the day. Combined with the\n integration with iTerm2, this makes working much easier. I no longer fear\n putting my laptop to sleep.\n* [bash](https://www.gnu.org/software/bash/)\n * I've tried a few different shells. In the end, I've found them all to be\n pretty similar. Fish was pretty cool, but not really supported everywhere\n (as in, not installed by default) which meant I had to maintain two different\n versions of my environment setup depending on the shell. I gave up on that\n and decided to go with the old standby so I wouldn't have to worry about\n where I was.\n\n### Utilities\n\n* [Alfred 3 (w/ Powerpack)](https://www.alfredapp.com/)\n * This is a great shortcut tool. I use it to search for files on my computer,\n launch applications, open ssh connections, remember passwords, do quick\n calculations, put my computer to sleep, open system preferences, and\n probably a bunch more.\n* [KeepingYouAwake](https://github.com/newmarcel/KeepingYouAwake)\n * This is a handy little tool to keep your computer from going to sleep. It's\n really nice when presenting or sitting in a meeting where you're doing\n something (like Powerpoint) that wouldn't otherwise force your computer to\n stay awake.\n* [Parallels](https://www.parallels.com/)\n * I haven't tried that many virtualization options on the Mac because I've\n usually had access to Parallels through work and it's always been a pretty\n good solution for me. I work in here very sparingly so I don't have a lot to\n say either way about it.\n* [Reeder](http://reederapp.com/mac/)\n * I subscribe to a **lot** of different RSS feeds and Reeder (synced via\n Feedly) is a great way to track and read all of them. It works with lots of\n different services (I use Instapaper for things I don't read immediately)\n and has a pretty good way of displaying articles by default and a good\n browser fallback when necessary.\n* [LastPass](https://www.lastpass.com/)\n * This is a must have at this point as I have way too many passwords to\n remember. At one point, we could all just use that one password for everything\n but now a combination of security and password requirements make it hard to\n continue that model. LastPass does a great job of both creating new passwords\n and remembering all of them for you. It will even do an analysis and tell you\n where you have a bunch of duplicated passwords and change (many) of them for\n you automatically. I also have an Alfred plugin so I can access these things\n in any application.\n", "meta": {"content_hash": "75c7efec3b6e16c62051fdd62714f4b9", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 110, "avg_line_length": 59.59605911330049, "alnum_prop": 0.7329310629856175, "repo_name": "wesbland/wesbland.github.io", "id": "e5d78026947a661c7b78b629f04e56ea73289c85", "size": "12102", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/blog/2017-04-17-development-tools.md", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "19428"}, {"name": "JavaScript", "bytes": "78211"}, {"name": "Ruby", "bytes": "190"}, {"name": "SCSS", "bytes": "50755"}]}} +{"text": "package birdz.lib.environment;\n\nimport java.awt.Color;\nimport java.awt.Graphics;\nimport java.awt.Point;\n\npublic class Goal extends EnvObject {\n\t\n\tprivate int size = 50;\n\n\tpublic Goal(int x, int y, int size) {\n\t\tthis.setPosition(x,y);\n\t\tthis.size = size;\n\t}\n\t\n\t@Override\n\tpublic boolean isTouching(Point p) {\n\t\tif(p.x >= this.getRoundedPosition().x && p.x < this.getRoundedPosition().x + size &&\n\t\t\t\tp.y >= this.getRoundedPosition().y && p.y < this.getRoundedPosition().y + size) return true;\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic Point[] getHitbox() {\n\t\t// TODO Auto-generated method stub\n\t\treturn new Point[]{new Point(this.getRoundedPosition().x + (size/2), this.getRoundedPosition().y + (size/2))};\n\t}\n\n\t@Override\n\tpublic void paint(Graphics g, int x, int y) {\n\t\tg.setColor(Color.CYAN);\n\t\tg.fillRect(this.getRoundedPosition().x, this.getRoundedPosition().y, size, size);\n\n\t}\n\n\t@Override\n\tpublic EnvObject copy() {\n\t\treturn new Goal(this.getRoundedPosition().x, this.getRoundedPosition().y, size);\n\t}\n\n}\n", "meta": {"content_hash": "b4ed8a5db9a64a194ddb2727a1ea0b2d", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 112, "avg_line_length": 24.5609756097561, "alnum_prop": 0.6911618669314796, "repo_name": "SpyGuyIan/Birdz", "id": "f85dd1c3969c789bfdf70b4616da5e69070239c6", "size": "1007", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/birdz/lib/environment/Goal.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "42609"}]}} +{"text": "'use strict'\n\nconst path = require('path')\nconst os = require('os')\nconst test = require('tape')\nconst { GelfFactory } = require(path.resolve('lib/gelf/index.js'))\n\ntest('GELFMessageFactory should create basic gelf message with short and detailed message', (t) => {\n t.plan(1)\n const gelfJson = GelfFactory({source: os.hostname(), }, '5')\n const gelfRequiredFields = {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 5,\n 'short_message': 'short_message not set'\n }\n t.deepEqual(gelfRequiredFields, gelfJson)\n})\n\ntest('GELFMessageFactory should create gelf message with data', (t) => {\n t.plan(1)\n const gelfJson = GelfFactory({source: os.hostname(), facility: 'some facility', full_message: 'some full message', short_message: 'some short message'}, 'notice')\n const gelfExpectedJson = {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 5,\n 'short_message': 'some short message',\n 'full_message': 'some full message',\n '_facility': 'some facility'\n }\n t.deepEqual(gelfJson, gelfExpectedJson)\n})\n\ntest('GELFMessageFactory should delete id key', (t) => {\n t.plan(1)\n const gelfJson = GelfFactory({source: os.hostname(), facility: 'some facility', full_message: 'some full message', id: '1', short_message: 'some short message'}, 'notice')\n const gelfExpectedJson = {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 5,\n 'short_message': 'some short message',\n 'full_message': 'some full message',\n '_facility': 'some facility'\n }\n t.deepEqual(gelfJson, gelfExpectedJson)\n})\n\ntest('Testing tags', (t) => {\n t.plan(8)\n const gelfJsonEmergency = GelfFactory({source: os.hostname(), }, 'emergency')\n const gelfExpectedJsonEmergency = {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 0,\n 'short_message': 'short_message not set',\n }\n const gelfJsonAlert = GelfFactory({source: os.hostname(), }, 'alert')\n const gelfExpectedJsonAlert = {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 1,\n 'short_message': 'short_message not set',\n }\n const gelfJsonCritical = GelfFactory({source: os.hostname(), }, 'critical')\n const gelfExpectedJsonCritical = {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 2,\n 'short_message': 'short_message not set',\n }\n const gelfJsonError = GelfFactory({source: os.hostname(), }, 'error')\n const gelfExpectedJsonError = {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 3,\n 'short_message': 'short_message not set',\n }\n const gelfJsonWarning = GelfFactory({source: os.hostname(), }, 'warning')\n const gelfExpectedJsonWarning= {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 4,\n 'short_message': 'short_message not set',\n }\n const gelfJsonNotice = GelfFactory({source: os.hostname(), }, 'notice')\n const gelfExpectedJsonNotice= {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 5,\n 'short_message': 'short_message not set',\n }\n const gelfJsonInfo = GelfFactory({source: os.hostname(), }, 'info')\n const gelfExpectedJsonInfo= {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 6,\n 'short_message': 'short_message not set',\n }\n const gelfJsonDebug = GelfFactory({source: os.hostname(), }, 'debug')\n const gelfExpectedJsonDebug= {\n 'version': '1.1',\n 'host': os.hostname(),\n 'level': 7,\n 'short_message': 'short_message not set',\n }\n t.deepEqual(gelfJsonEmergency, gelfExpectedJsonEmergency)\n t.deepEqual(gelfJsonAlert, gelfExpectedJsonAlert)\n t.deepEqual(gelfJsonCritical, gelfExpectedJsonCritical)\n t.deepEqual(gelfJsonError, gelfExpectedJsonError)\n t.deepEqual(gelfJsonWarning, gelfExpectedJsonWarning)\n t.deepEqual(gelfJsonNotice, gelfExpectedJsonNotice)\n t.deepEqual(gelfJsonInfo, gelfExpectedJsonInfo)\n t.deepEqual(gelfJsonDebug, gelfExpectedJsonDebug)\n})\n", "meta": {"content_hash": "ce55ee53f580a777969dc684d14a9f0b", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 173, "avg_line_length": 33.5, "alnum_prop": 0.6598586017282011, "repo_name": "ubirajaramneto/hapi-graylog", "id": "51c6bce850d1f9a9b0a11ace474d71467954393b", "size": "3819", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/unit/gelf.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "16318"}]}} +{"text": "\n\n@font-face {\n font-family: 'Gibson';\n src: url('Gibson-Regular-webfonteccb.eot?3');\n src: url('Gibson-Regular-webfont95c6.eot?3?#iefix') format('embedded-opentype'),\n url('Gibson-Regular-webfonteccb.woff?3') format('woff'),\n url('Gibson-Regular-webfonteccb.ttf?3') format('truetype'),\n url('Gibson-Regular-webfonteccb.svg?3#GibsonRegular') format('svg');\n font-weight: normal;\n font-style: normal;\n\n}\n\n@font-face {\n font-family: 'Gibson';\n src: url('Gibson-SemiBold-webfonteccb.eot?3');\n src: url('Gibson-SemiBold-webfont95c6.eot?3?#iefix') format('embedded-opentype'),\n url('Gibson-SemiBold-webfonteccb.woff?3') format('woff'),\n url('Gibson-SemiBold-webfonteccb.ttf?3') format('truetype'),\n url('Gibson-SemiBold-webfonteccb.svg?3#GibsonLightBold') format('svg');\n font-weight: bold;\n font-style: normal;\n\n}\n\n@font-face {\n font-family: 'Gibson';\n src: url('Gibson-Italic-webfonteccb.eot?3');\n src: url('Gibson-Italic-webfont95c6.eot?3?#iefix') format('embedded-opentype'),\n url('Gibson-Italic-webfonteccb.woff?3') format('woff'),\n url('Gibson-Italic-webfonteccb.ttf?3') format('truetype'),\n url('Gibson-Italic-webfonteccb.svg?3#GibsonItalic') format('svg');\n font-weight: normal;\n font-style: italic;\n\n}\n\n@font-face {\n font-family: 'Gibson';\n src: url('Gibson-SemiBoldItalic-webfonteccb.eot?3');\n src: url('Gibson-SemiBoldItalic-webfont95c6.eot?3?#iefix') format('embedded-opentype'),\n url('Gibson-SemiBoldItalic-webfonteccb.woff?3') format('woff'),\n url('Gibson-SemiBoldItalic-webfonteccb.ttf?3') format('truetype'),\n url('Gibson-SemiBoldItalic-webfonteccb.svg?3#GibsonLightBoldItalic') format('svg');\n font-weight: bold;\n font-style: italic;\n\n}\n", "meta": {"content_hash": "bd9f355eb65887e58b65fbec28cf3d3e", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 92, "avg_line_length": 36.83673469387755, "alnum_prop": 0.6648199445983379, "repo_name": "misfit-inc/christian-aid.tumblr.com", "id": "15c001cc33fd7109a9ad228770f6ea365fb90288", "size": "2510", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "assets.tumblr.com/fonts/gibson/stylesheet30f4.css", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "10704"}, {"name": "HTML", "bytes": "1262319"}, {"name": "JavaScript", "bytes": "9898"}]}} +{"text": "'use strict';\n\nmodule.exports = function(grunt) {\n var path = require('path');\n\n // These plugins provide necessary tasks.\n grunt.loadNpmTasks('grunt-contrib-clean');\n grunt.loadNpmTasks('grunt-execute');\n grunt.loadNpmTasks('amber-dev');\n\n // Default task.\n grunt.registerTask('default', ['amberc:all']);\n grunt.registerTask('test', ['amberc:test_runner', 'execute:test_runner', 'clean:test_runner']);\n\n // Project configuration.\n grunt.initConfig({\n // Metadata.\n // pkg: grunt.file.readJSON(''),\n banner: '\\n',\n // task configuration\n amberc: {\n options: {\n amber_dir: path.join(__dirname, \"bower_components\", \"amber\"),\n library_dirs: ['src'],\n closure_jar: ''\n },\n all: {\n src: [\n 'src/Ephestos.st', // list all sources in dependency order\n 'src/Ephestos-Tests.st' // list all tests in dependency order\n ],\n libraries: ['SUnit', 'Web']\n },\n test_runner: {\n src: ['node_modules/amber-dev/lib/Test.st'],\n libraries: [\n /* add dependencies packages here */\n 'Ephestos', /* add other code-to-test packages here */\n 'SUnit',\n 'Ephestos-Tests' /* add other test packages here */\n ],\n main_class: 'NodeTestRunner',\n output_name: 'test_runner'\n }\n },\n\n execute: {\n test_runner: {\n src: ['test_runner.js']\n }\n },\n\n clean: {\n test_runner: ['test_runner.js']\n }\n });\n\n};\n", "meta": {"content_hash": "6ae6eab05c0d2e174522c78463418475", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 97, "avg_line_length": 25.724137931034484, "alnum_prop": 0.5542895442359249, "repo_name": "kilon/kilon.github.io", "id": "a3797e28081e40fec8d0b675f874182ec2219064", "size": "1825", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Gruntfile.js", "mode": "33188", "license": "mit", "language": []}} +{"text": "<?php\n/* @var $this yii\\web\\View */\n$this->title = 'My Yii Application';\n?>\n<div class=\"site-index\">\n <div class=\"jumbotron\">\n <h1>Congratulations!</h1>\n <p class=\"lead\">You have successfully created your Yii-powered application.</p>\n </div>\n</div>\n", "meta": {"content_hash": "eec7c207a925fa937ac1045201d69527", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 87, "avg_line_length": 26.9, "alnum_prop": 0.6171003717472119, "repo_name": "yii2mod/base", "id": "3d904c16d68b0a44751baa95554dea150992ecbc", "size": "269", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "views/site/index.php", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "1548"}, {"name": "CSS", "bytes": "3695"}, {"name": "Dockerfile", "bytes": "3682"}, {"name": "PHP", "bytes": "94078"}, {"name": "Shell", "bytes": "512"}]}} +{"text": "const adjetiveisor = require('../adjetiveisor')\nconst adjet = adjetiveisor()\n\ntest('fails if no configured', () => {\n expect(adjet.translate('any text')).toBe('missing config')\n})\n\ntest('fails if no text string provided', () => {\n adjet.config({ ms: 'puto', mp: 'putos', fs: 'puta', fp: 'putas' })\n expect(adjet.translate()).toBe('missing text')\n})\n\ntest('translates \"perro\" into \"puto perro\"', () => {\n adjet.config({ ms: 'puto', mp: 'putos', fs: 'puta', fp: 'putas' })\n expect(adjet.translate('perro')).toBe('puto perro')\n})\n\ntest('translates \"el coche\" into \"el puto coche\"', () => {\n adjet.config({ ms: 'puto', mp: 'putos', fs: 'puta', fp: 'putas' })\n expect(adjet.translate('el coche')).toBe('el puto coche')\n})\n\ntest('does a correct translation on verbose config provided', () => {\n adjet.config({ ms: 'puto', mp: 'putos', fs: 'puta', fp: 'putas' })\n expect(adjet.translate('tengo mi coche en la acera')).toBe('tengo mi coche en la puta acera')\n adjet.verbose(true)\n expect(adjet.translate('tengo mi coche en la acera')).toBe('tengo mi puto coche en la puta acera')\n adjet.verbose(false)\n})\n\ntest('removes duplicates', () => {\n adjet.config({ ms: 'puto', mp: 'putos', fs: 'puta', fp: 'putas' })\n expect(adjet.translate('el puto coche')).toBe('el puto coche')\n})\n", "meta": {"content_hash": "4875906a4160bcd8f2833714fe9607ad", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 100, "avg_line_length": 37.705882352941174, "alnum_prop": 0.6380655226209049, "repo_name": "agm-dev/adjetiveisor", "id": "ade984308d3e6e02a4f9e699dfa6979f309c9e19", "size": "1282", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/adjetiveisor.translate.test.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "7789"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!--NewPage-->\n<HTML>\n<HEAD>\n<!-- Generated by javadoc (build 1.6.0_07) on Tue Sep 01 20:57:03 UTC 2009 -->\n<TITLE>\nUses of Package org.apache.hadoop.filecache (Hadoop 0.20.1 API)\n</TITLE>\n\n<META NAME=\"date\" CONTENT=\"2009-09-01\">\n\n<LINK REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"../../../../stylesheet.css\" TITLE=\"Style\">\n\n<SCRIPT type=\"text/javascript\">\nfunction windowTitle()\n{\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"Uses of Package org.apache.hadoop.filecache (Hadoop 0.20.1 API)\";\n }\n}\n</SCRIPT>\n<NOSCRIPT>\n</NOSCRIPT>\n\n</HEAD>\n\n<BODY BGCOLOR=\"white\" onload=\"windowTitle();\">\n<HR>\n\n\n<!-- ========= START OF TOP NAVBAR ======= -->\n<A NAME=\"navbar_top\"><!-- --></A>\n<A HREF=\"#skip-navbar_top\" title=\"Skip navigation links\"></A>\n<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"1\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR>\n<TD COLSPAN=2 BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\">\n<A NAME=\"navbar_top_firstrow\"><!-- --></A>\n<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\" SUMMARY=\"\">\n <TR ALIGN=\"center\" VALIGN=\"top\">\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../overview-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"package-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Package</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Class</FONT> </TD>\n <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Use</B></FONT> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"package-tree.html\"><FONT CLASS=\"NavBarFont1\"><B>Tree</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../deprecated-list.html\"><FONT CLASS=\"NavBarFont1\"><B>Deprecated</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../index-all.html\"><FONT CLASS=\"NavBarFont1\"><B>Index</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../help-doc.html\"><FONT CLASS=\"NavBarFont1\"><B>Help</B></FONT></A> </TD>\n </TR>\n</TABLE>\n</TD>\n<TD ALIGN=\"right\" VALIGN=\"top\" ROWSPAN=3><EM>\n</EM>\n</TD>\n</TR>\n\n<TR>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n PREV \n NEXT</FONT></TD>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n <A HREF=\"../../../../index.html?org/apache/hadoop/filecache/package-use.html\" target=\"_top\"><B>FRAMES</B></A> \n <A HREF=\"package-use.html\" target=\"_top\"><B>NO FRAMES</B></A> \n <SCRIPT type=\"text/javascript\">\n <!--\n if(window==top) {\n document.writeln('<A HREF=\"../../../../allclasses-noframe.html\"><B>All Classes</B></A>');\n }\n //-->\n</SCRIPT>\n<NOSCRIPT>\n <A HREF=\"../../../../allclasses-noframe.html\"><B>All Classes</B></A>\n</NOSCRIPT>\n\n\n</FONT></TD>\n</TR>\n</TABLE>\n<A NAME=\"skip-navbar_top\"></A>\n<!-- ========= END OF TOP NAVBAR ========= -->\n\n<HR>\n<CENTER>\n<H2>\n<B>Uses of Package<br>org.apache.hadoop.filecache</B></H2>\n</CENTER>\nNo usage of org.apache.hadoop.filecache\n<P>\n<HR>\n\n\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<A NAME=\"navbar_bottom\"><!-- --></A>\n<A HREF=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></A>\n<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"1\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR>\n<TD COLSPAN=2 BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\">\n<A NAME=\"navbar_bottom_firstrow\"><!-- --></A>\n<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\" SUMMARY=\"\">\n <TR ALIGN=\"center\" VALIGN=\"top\">\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../overview-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"package-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Package</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <FONT CLASS=\"NavBarFont1\">Class</FONT> </TD>\n <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Use</B></FONT> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"package-tree.html\"><FONT CLASS=\"NavBarFont1\"><B>Tree</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../deprecated-list.html\"><FONT CLASS=\"NavBarFont1\"><B>Deprecated</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../index-all.html\"><FONT CLASS=\"NavBarFont1\"><B>Index</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../help-doc.html\"><FONT CLASS=\"NavBarFont1\"><B>Help</B></FONT></A> </TD>\n </TR>\n</TABLE>\n</TD>\n<TD ALIGN=\"right\" VALIGN=\"top\" ROWSPAN=3><EM>\n</EM>\n</TD>\n</TR>\n\n<TR>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n PREV \n NEXT</FONT></TD>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n <A HREF=\"../../../../index.html?org/apache/hadoop/filecache/package-use.html\" target=\"_top\"><B>FRAMES</B></A> \n <A HREF=\"package-use.html\" target=\"_top\"><B>NO FRAMES</B></A> \n <SCRIPT type=\"text/javascript\">\n <!--\n if(window==top) {\n document.writeln('<A HREF=\"../../../../allclasses-noframe.html\"><B>All Classes</B></A>');\n }\n //-->\n</SCRIPT>\n<NOSCRIPT>\n <A HREF=\"../../../../allclasses-noframe.html\"><B>All Classes</B></A>\n</NOSCRIPT>\n\n\n</FONT></TD>\n</TR>\n</TABLE>\n<A NAME=\"skip-navbar_bottom\"></A>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n\n<HR>\nCopyright © 2009 The Apache Software Foundation\n</BODY>\n</HTML>\n", "meta": {"content_hash": "b019fc25bda3971a256ed43e89d206c1", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 156, "avg_line_length": 39.13194444444444, "alnum_prop": 0.6181011535048803, "repo_name": "koichi626/hadoop-gpu", "id": "027df7797038f37992cd3323f928f58bfd29bf24", "size": "5635", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hadoop-gpu-0.20.1/docs/api/org/apache/hadoop/filecache/package-use.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "285734"}, {"name": "C++", "bytes": "417284"}, {"name": "CSS", "bytes": "104496"}, {"name": "Java", "bytes": "10388425"}, {"name": "JavaScript", "bytes": "82001"}, {"name": "Objective-C", "bytes": "118273"}, {"name": "PHP", "bytes": "152555"}, {"name": "Perl", "bytes": "149888"}, {"name": "Python", "bytes": "1530597"}, {"name": "Ruby", "bytes": "28485"}, {"name": "Shell", "bytes": "1204612"}, {"name": "Smalltalk", "bytes": "56562"}, {"name": "XSLT", "bytes": "235055"}]}} +{"text": "\r\n\r\n(function (window) {\r\n \"use strict\";\r\n\r\n var console = window.console,\r\n $ = window.jQuery,\r\n gui = window.gui,\r\n old = $.fn.guiNav;\r\n\r\n $.fn.guiNav = function (option) {\r\n\r\n var defaults = {\r\n styleName: \"\",\r\n itemFadeIn: true,\r\n animationDuration: 500\r\n };\r\n\r\n option = $.extend(defaults, option);\r\n\r\n this.each(function () {\r\n var $guiNav = $(this),\r\n isVertical = $guiNav.hasClass(\"gui-nav-vertical\");\r\n\r\n if (option.styleName) {\r\n $guiNav.addClass(option.styleName);\r\n }\r\n\r\n $guiNav.find(\"li\").mouseenter(function () {\r\n var $navItem = $(this),\r\n $$subMenu = $navItem.children(\"ul\");\r\n $$subMenu.css(\"left\", (isVertical || !$navItem.parent().hasClass(\"gui-nav\")) ? $navItem.width() : 0);\r\n if (option.itemFadeIn) {\r\n $$subMenu.css(\"opacity\", 0).animate({opacity: 1}, option.animationDuration);\r\n }\r\n });\r\n });\r\n\r\n return gui.plugin.patch($.fn.guiNav, this, option);\r\n };\r\n\r\n // NO CONFLICT\r\n // ===============\r\n\r\n $.fn.guiNav.noConflict = function () {\r\n $.fn.guiNav = old;\r\n return this;\r\n };\r\n\r\n})(window);\r\n", "meta": {"content_hash": "101bebbb7dc359e5190ee1bb2942b612", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 117, "avg_line_length": 26.74, "alnum_prop": 0.45100972326103217, "repo_name": "guoyao/gui", "id": "cf987cb15a632390a70d584f0706451db0184477", "size": "2217", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "js/nav.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "140927"}, {"name": "HTML", "bytes": "108325"}, {"name": "JavaScript", "bytes": "295996"}]}} +{"text": "<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>Function template wrap_formatter</title>\n<link rel=\"stylesheet\" href=\"../../../../../../../doc/src/boostbook.css\" type=\"text/css\">\n<meta name=\"generator\" content=\"DocBook XSL Stylesheets V1.79.1\">\n<link rel=\"home\" href=\"../../../index.html\" title=\"Chapter\u00a01.\u00a0Boost.Log v2\">\n<link rel=\"up\" href=\"../../../expressions.html#header.boost.log.expressions.formatters.wrap_formatter_hpp\" title=\"Header <boost/log/expressions/formatters/wrap_formatter.hpp>\">\n<link rel=\"prev\" href=\"wrapped_formatter_terminal.html\" title=\"Class template wrapped_formatter_terminal\">\n<link rel=\"next\" href=\"wrap_for_idm45961920535920.html\" title=\"Function template wrap_formatter\">\n</head>\n<body bgcolor=\"white\" text=\"black\" link=\"#0000FF\" vlink=\"#840084\" alink=\"#0000FF\">\n<table cellpadding=\"2\" width=\"100%\"><tr><td valign=\"top\"><img alt=\"Boost C++ Libraries\" width=\"277\" height=\"86\" src=\"../../../../../../../boost.png\"></td></tr></table>\n<hr>\n<div class=\"spirit-nav\">\n<a accesskey=\"p\" href=\"wrapped_formatter_terminal.html\"><img src=\"../../../../../../../doc/src/images/prev.png\" alt=\"Prev\"></a><a accesskey=\"u\" href=\"../../../expressions.html#header.boost.log.expressions.formatters.wrap_formatter_hpp\"><img src=\"../../../../../../../doc/src/images/up.png\" alt=\"Up\"></a><a accesskey=\"h\" href=\"../../../index.html\"><img src=\"../../../../../../../doc/src/images/home.png\" alt=\"Home\"></a><a accesskey=\"n\" href=\"wrap_for_idm45961920535920.html\"><img src=\"../../../../../../../doc/src/images/next.png\" alt=\"Next\"></a>\n</div>\n<div class=\"refentry\">\n<a name=\"boost.log.expressions.wrap_for_idm45961920540112\"></a><div class=\"titlepage\"></div>\n<div class=\"refnamediv\">\n<h2><span class=\"refentrytitle\">Function template wrap_formatter</span></h2>\n<p>boost::log::expressions::wrap_formatter</p>\n</div>\n<h2 xmlns:rev=\"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision\" class=\"refsynopsisdiv-title\">Synopsis</h2>\n<div xmlns:rev=\"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision\" class=\"refsynopsisdiv\"><pre class=\"synopsis\"><span class=\"comment\">// In header: <<a class=\"link\" href=\"../../../expressions.html#header.boost.log.expressions.formatters.wrap_formatter_hpp\" title=\"Header <boost/log/expressions/formatters/wrap_formatter.hpp>\">boost/log/expressions/formatters/wrap_formatter.hpp</a>>\n\n</span>\n<span class=\"keyword\">template</span><span class=\"special\"><</span><span class=\"keyword\">typename</span> FunT<span class=\"special\">></span> <span class=\"emphasis\"><em><span class=\"identifier\">unspecified</span></em></span> <span class=\"identifier\">wrap_formatter</span><span class=\"special\">(</span><span class=\"identifier\">FunT</span> <span class=\"keyword\">const</span> <span class=\"special\">&</span> fun<span class=\"special\">)</span><span class=\"special\">;</span></pre></div>\n<div class=\"refsect1\">\n<a name=\"idm46846468567072\"></a><h2>Description</h2>\n<p>The function wraps a function object in order it to be able to participate in formatting expressions. The wrapped function object must be compatible with the following signature:</p>\n<pre class=\"programlisting\">\nvoid (record_view const&, basic_formatting_ostream< CharT >&)\n</pre>\n<p>where <code class=\"computeroutput\">CharT</code> is the character type of the formatting expression. </p>\n</div>\n</div>\n<table xmlns:rev=\"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision\" width=\"100%\"><tr>\n<td align=\"left\"></td>\n<td align=\"right\"><div class=\"copyright-footer\">Copyright \u00a9 2007-2021 Andrey Semashev<p>\n Distributed under the Boost Software License, Version 1.0. (See accompanying\n file LICENSE_1_0.txt or copy at <a href=\"http://www.boost.org/LICENSE_1_0.txt\" target=\"_top\">http://www.boost.org/LICENSE_1_0.txt</a>).\n </p>\n</div></td>\n</tr></table>\n<hr>\n<div class=\"spirit-nav\">\n<a accesskey=\"p\" href=\"wrapped_formatter_terminal.html\"><img src=\"../../../../../../../doc/src/images/prev.png\" alt=\"Prev\"></a><a accesskey=\"u\" href=\"../../../expressions.html#header.boost.log.expressions.formatters.wrap_formatter_hpp\"><img src=\"../../../../../../../doc/src/images/up.png\" alt=\"Up\"></a><a accesskey=\"h\" href=\"../../../index.html\"><img src=\"../../../../../../../doc/src/images/home.png\" alt=\"Home\"></a><a accesskey=\"n\" href=\"wrap_for_idm45961920535920.html\"><img src=\"../../../../../../../doc/src/images/next.png\" alt=\"Next\"></a>\n</div>\n</body>\n</html>\n", "meta": {"content_hash": "feffd92c47b26b0afdf26644c80f5050", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 545, "avg_line_length": 87.07843137254902, "alnum_prop": 0.6784507993695114, "repo_name": "davehorton/drachtio-server", "id": "9a4899bacfee34cdf62ede15e93f4c5561f805d0", "size": "4444", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "deps/boost_1_77_0/libs/log/doc/html/boost/log/expressions/wrap_for_idm45961920540112.html", "mode": "33188", "license": "mit", "language": [{"name": "C++", "bytes": "662596"}, {"name": "Dockerfile", "bytes": "1330"}, {"name": "JavaScript", "bytes": "60639"}, {"name": "M4", "bytes": "35273"}, {"name": "Makefile", "bytes": "5960"}, {"name": "Shell", "bytes": "47298"}]}} +{"text": "class Profile;\nclass WebRequestPermissions;\n\nnamespace extension_web_request_api_helpers {\nstruct EventResponseDelta;\n}\n\nnamespace net {\nclass URLRequest;\n}\n\nnamespace extensions {\n\nclass RulesRegistryService;\n\ntypedef linked_ptr<extension_web_request_api_helpers::EventResponseDelta>\n LinkedPtrEventResponseDelta;\ntypedef DeclarativeRule<WebRequestCondition, WebRequestAction> WebRequestRule;\n\n// The WebRequestRulesRegistry is responsible for managing\n// the internal representation of rules for the Declarative Web Request API.\n//\n// Here is the high level overview of this functionality:\n//\n// RulesRegistry::Rule consists of Conditions and Actions, these are\n// represented as a WebRequestRule with WebRequestConditions and\n// WebRequestRuleActions.\n//\n// WebRequestConditions represent JSON dictionaries as the following:\n// {\n// 'instanceType': 'URLMatcher',\n// 'host_suffix': 'example.com',\n// 'path_prefix': '/query',\n// 'scheme': 'http'\n// }\n//\n// The evaluation of URL related condition attributes (host_suffix, path_prefix)\n// is delegated to a URLMatcher, because this is capable of evaluating many\n// of such URL related condition attributes in parallel.\n//\n// For this, the URLRequestCondition has a URLMatcherConditionSet, which\n// represents the {'host_suffix': 'example.com', 'path_prefix': '/query'} part.\n// We will then ask the URLMatcher, whether a given URL\n// \"http://www.example.com/query/\" has any matches, and the URLMatcher\n// will respond with the URLMatcherConditionSet::ID. We can map this\n// to the WebRequestRule and check whether also the other conditions (in this\n// example 'scheme': 'http') are fulfilled.\nclass WebRequestRulesRegistry : public RulesRegistryWithCache {\n public:\n WebRequestRulesRegistry(Profile* profile, Delegate* delegate);\n\n // TODO(battre): This will become an implementation detail, because we need\n // a way to also execute the actions of the rules.\n std::set<const WebRequestRule*> GetMatches(\n const WebRequestData& request_data_without_ids) const;\n\n // Returns which modifications should be executed on the network request\n // according to the rules registered in this registry.\n std::list<LinkedPtrEventResponseDelta> CreateDeltas(\n const ExtensionInfoMap* extension_info_map,\n const WebRequestData& request_data,\n bool crosses_incognito);\n\n // Implementation of RulesRegistryWithCache:\n virtual std::string AddRulesImpl(\n const std::string& extension_id,\n const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) OVERRIDE;\n virtual std::string RemoveRulesImpl(\n const std::string& extension_id,\n const std::vector<std::string>& rule_identifiers) OVERRIDE;\n virtual std::string RemoveAllRulesImpl(\n const std::string& extension_id) OVERRIDE;\n virtual content::BrowserThread::ID GetOwnerThread() const OVERRIDE;\n\n // Returns true if this object retains no allocated data. Only for debugging.\n bool IsEmpty() const;\n\n protected:\n virtual ~WebRequestRulesRegistry();\n\n // Virtual for testing:\n virtual base::Time GetExtensionInstallationTime(\n const std::string& extension_id) const;\n virtual void ClearCacheOnNavigation();\n\n const std::set<const WebRequestRule*>&\n rules_with_untriggered_conditions_for_test() const {\n return rules_with_untriggered_conditions_;\n }\n\n private:\n // Checks whether the set of |conditions| and |actions| are consistent,\n // meaning for example that we do not allow combining an |action| that needs\n // to be executed before the |condition| can be fulfilled.\n // Returns true in case of consistency and MUST set |error| otherwise.\n static bool CheckConsistency(const WebRequestConditionSet* conditions,\n const WebRequestActionSet* actions,\n std::string* error);\n\n typedef std::map<URLMatcherConditionSet::ID, WebRequestRule*> RuleTriggers;\n typedef std::map<WebRequestRule::GlobalRuleId, linked_ptr<WebRequestRule> >\n RulesMap;\n typedef std::set<URLMatcherConditionSet::ID> URLMatches;\n typedef std::set<const WebRequestRule*> RuleSet;\n\n // This is a helper function to GetMatches. Rules triggered by |url_matches|\n // get added to |result| if one of their conditions is fulfilled.\n // |request_data| gets passed to IsFulfilled of the rules' condition sets.\n void AddTriggeredRules(const URLMatches& url_matches,\n const WebRequestCondition::MatchData& request_data,\n RuleSet* result) const;\n\n // Map that tells us which WebRequestRule may match under the condition that\n // the URLMatcherConditionSet::ID was returned by the |url_matcher_|.\n RuleTriggers rule_triggers_;\n\n // These rules contain condition sets with conditions without URL attributes.\n // Such conditions are not triggered by URL matcher, so we need to test them\n // separately.\n std::set<const WebRequestRule*> rules_with_untriggered_conditions_;\n\n RulesMap webrequest_rules_;\n\n URLMatcher url_matcher_;\n\n scoped_refptr<ExtensionInfoMap> extension_info_map_;\n\n DISALLOW_COPY_AND_ASSIGN(WebRequestRulesRegistry);\n};\n\n} // namespace extensions\n\n#endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_RULES_REGISTRY_H_\n", "meta": {"content_hash": "bf00411bb01aa5467efb197fa4de3560", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 92, "avg_line_length": 39.2406015037594, "alnum_prop": 0.7432458325349683, "repo_name": "timopulkkinen/BubbleFish", "id": "4924522bb78300abd92423ec10cb8666ed7a5687", "size": "6263", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ASP", "bytes": "853"}, {"name": "AppleScript", "bytes": "6973"}, {"name": "Arduino", "bytes": "464"}, {"name": "Assembly", "bytes": "1174304"}, {"name": "Awk", "bytes": "9519"}, {"name": "C", "bytes": "75801820"}, {"name": "C#", "bytes": "1132"}, {"name": "C++", "bytes": "161884021"}, {"name": "DOT", "bytes": "1559"}, {"name": "F#", "bytes": "381"}, {"name": "Java", "bytes": "3531849"}, {"name": "JavaScript", "bytes": "18556005"}, {"name": "Logos", "bytes": "4517"}, {"name": "Matlab", "bytes": "5234"}, {"name": "Objective-C", "bytes": "7254742"}, {"name": "PHP", "bytes": "97817"}, {"name": "Perl", "bytes": "933011"}, {"name": "Python", "bytes": "8808682"}, {"name": "R", "bytes": "262"}, {"name": "Ragel in Ruby Host", "bytes": "3621"}, {"name": "Shell", "bytes": "1537764"}, {"name": "Tcl", "bytes": "277077"}, {"name": "XML", "bytes": "13493"}]}} +{"text": "\npackage org.shaf.core.net;\n\n/**\n * The {@code NetworkRequestException} occurs, when a network request is failed.\n * \n * @author Mykola Galushka\n */\n@SuppressWarnings(\"serial\")\npublic class NetworkRequestException extends NetworkException {\n\n\t/**\n\t * Constructs a new {@code NetworkRequestException} object.\n\t * \n\t * @param uri\n\t * the requesting URI.\n\t * @param message\n\t * the message.\n\t * @param cause\n\t * the cause.\n\t */\n\tpublic NetworkRequestException(final String message, final Throwable cause) {\n\t\tsuper(message, cause);\n\t}\n\n\t/**\n\t * Constructs a new {@code NetworkRequestException} object.\n\t * \n\t * @param uri\n\t * the requesting URI.\n\t * @param message\n\t * the message.\n\t */\n\tpublic NetworkRequestException(final String message) {\n\t\tsuper(message);\n\t}\n}\n", "meta": {"content_hash": "79555e6e14dddb14edd13e9a219ba929", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 80, "avg_line_length": 22.10810810810811, "alnum_prop": 0.6466992665036675, "repo_name": "SHAF-WORK/shaf", "id": "e57e8ee2e98293a57862513b141ca45cb3b5a4e2", "size": "1419", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/main/java/org/shaf/core/net/NetworkRequestException.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "9550"}, {"name": "Java", "bytes": "1471340"}, {"name": "JavaScript", "bytes": "7370"}, {"name": "Shell", "bytes": "6433"}]}} +{"text": "import {\n isStandardRule,\n ruleMessages,\n validateOptions,\n} from \"../../utils\"\n\nimport { checkRuleEmptyLineBefore } from \"../rule-non-nested-empty-line-before\"\n\nexport const ruleName = \"rule-nested-empty-line-before\"\n\nexport const messages = ruleMessages(ruleName, {\n expected: \"Expected empty line before nested rule\",\n rejected: \"Unexpected empty line before nested rule\",\n})\n\nexport default function (expectation, options) {\n return (root, result) => {\n const validOptions = validateOptions(result, ruleName, {\n actual: expectation,\n possible: [\n \"always\",\n \"never\",\n \"always-multi-line\",\n \"never-multi-line\",\n ],\n }, {\n actual: options,\n possible: {\n ignore: [\n \"after-comment\",\n ],\n except: [\n \"first-nested\",\n \"after-comment\",\n ],\n },\n optional: true,\n })\n if (!validOptions) { return }\n\n root.walkRules(rule => {\n\n if (!isStandardRule(rule)) { return }\n\n // Only attend to nested rule sets\n if (rule.parent === root) { return }\n\n checkRuleEmptyLineBefore({ rule, expectation, options, result, messages, checkedRuleName: ruleName })\n })\n }\n}\n", "meta": {"content_hash": "f0873fad287901f884dbe4f7b4f2b3d2", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 107, "avg_line_length": 23.764705882352942, "alnum_prop": 0.5981848184818482, "repo_name": "mghak/mghak.github.io", "id": "191908c03054357f2f7cafdf91b9964ffc3da2f9", "size": "1212", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/stylelint/src/rules/rule-nested-empty-line-before/index.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "4176"}, {"name": "HTML", "bytes": "11740"}, {"name": "JavaScript", "bytes": "7882"}, {"name": "TypeScript", "bytes": "17729"}]}} +{"text": "function legcoeffs = chebcoeffs2legcoeffs(chebcoeffs)\n%CHEBCOEFFS2LEGCOEFFS Convert Chebyshev coefficients to Legendre coefficients. \n% C_LEG = CHEBCOEFFS2LEGCOEFFS(C_CHEB) converts the vector C_CHEB of Chebyshev\n% coefficients to a vector C_LEG of Legendre coefficients such that\n% C_CHEB(1)*T0 + ... + C_CHEB(N)*T{N-1} = ...\n% C_LEG(1)*P0 + ... + C_LEG(N)*P{N-1},\n% where P{k} is the degree k Legendre polynomial normalized so that\n% max(|P{k}|) = 1.\n% \n% See also CHEB2LEG.\n\n% Copyright 2015 by The University of Oxford and The Chebfun Developers. \n% See http://www.chebfun.org/ for Chebfun information.\n\n% This command is a wrapper for cheb2leg.\nlegcoeffs = cheb2leg(chebcoeffs);\n\nend\n", "meta": {"content_hash": "2952e6cda1f4e67758632734aad5dcc2", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 80, "avg_line_length": 39.666666666666664, "alnum_prop": 0.7030812324929971, "repo_name": "ilovejs/chebfun", "id": "a3b83c9abd4154977274148e91047a878fe1215a", "size": "714", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "chebcoeffs2legcoeffs.m", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "M", "bytes": "2040"}, {"name": "Matlab", "bytes": "4427792"}]}} +{"text": "package org.apache.hadoop.hive.ql;\n\nimport org.apache.commons.io.FileUtils;\nimport org.apache.hadoop.fs.FileUtil;\nimport org.apache.hadoop.fs.Path;\nimport org.apache.hadoop.hive.conf.HiveConf;\nimport org.apache.hadoop.hive.metastore.txn.TxnDbUtil;\nimport org.apache.hadoop.hive.ql.io.AcidUtils;\nimport org.apache.hadoop.hive.ql.io.orc.FileDump;\nimport org.apache.hadoop.hive.ql.processors.CommandProcessorResponse;\nimport org.apache.hadoop.hive.ql.session.SessionState;\nimport org.junit.After;\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.Ignore;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TestName;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileOutputStream;\nimport java.io.FilenameFilter;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Comparator;\nimport java.util.List;\n\n/**\n * TODO: this should be merged with TestTxnCommands once that is checked in\n * specifically the tests; the supporting code here is just a clone of TestTxnCommands\n */\npublic class TestTxnCommands2 {\n private static final String TEST_DATA_DIR = new File(System.getProperty(\"java.io.tmpdir\") +\n File.separator + TestTxnCommands2.class.getCanonicalName()\n + \"-\" + System.currentTimeMillis()\n ).getPath().replaceAll(\"\\\\\\\\\", \"/\");\n private static final String TEST_WAREHOUSE_DIR = TEST_DATA_DIR + \"/warehouse\";\n //bucket count for test tables; set it to 1 for easier debugging\n private static int BUCKET_COUNT = 2;\n @Rule\n public TestName testName = new TestName();\n private HiveConf hiveConf;\n private Driver d;\n private static enum Table {\n ACIDTBL(\"acidTbl\"),\n ACIDTBLPART(\"acidTblPart\"),\n NONACIDORCTBL(\"nonAcidOrcTbl\"),\n NONACIDPART(\"nonAcidPart\");\n \n private final String name;\n @Override\n public String toString() {\n return name;\n }\n Table(String name) {\n this.name = name;\n }\n }\n\n @Before\n public void setUp() throws Exception {\n tearDown();\n hiveConf = new HiveConf(this.getClass());\n hiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, \"\");\n hiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, \"\");\n hiveConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, \"false\");\n hiveConf.set(HiveConf.ConfVars.METASTOREWAREHOUSE.varname, TEST_WAREHOUSE_DIR);\n TxnDbUtil.setConfValues(hiveConf);\n hiveConf.setBoolVar(HiveConf.ConfVars.HIVEENFORCEBUCKETING, true);\n TxnDbUtil.prepDb();\n File f = new File(TEST_WAREHOUSE_DIR);\n if (f.exists()) {\n FileUtil.fullyDelete(f);\n }\n if (!(new File(TEST_WAREHOUSE_DIR).mkdirs())) {\n throw new RuntimeException(\"Could not create \" + TEST_WAREHOUSE_DIR);\n }\n SessionState.start(new SessionState(hiveConf));\n d = new Driver(hiveConf);\n dropTables();\n runStatementOnDriver(\"create table \" + Table.ACIDTBL + \"(a int, b int) clustered by (a) into \" + BUCKET_COUNT + \" buckets stored as orc TBLPROPERTIES ('transactional'='true')\");\n runStatementOnDriver(\"create table \" + Table.ACIDTBLPART + \"(a int, b int) partitioned by (p string) clustered by (a) into \" + BUCKET_COUNT + \" buckets stored as orc TBLPROPERTIES ('transactional'='true')\");\n runStatementOnDriver(\"create table \" + Table.NONACIDORCTBL + \"(a int, b int) clustered by (a) into \" + BUCKET_COUNT + \" buckets stored as orc TBLPROPERTIES ('transactional'='false')\");\n runStatementOnDriver(\"create table \" + Table.NONACIDPART + \"(a int, b int) partitioned by (p string) stored as orc TBLPROPERTIES ('transactional'='false')\");\n }\n private void dropTables() throws Exception {\n for(Table t : Table.values()) {\n runStatementOnDriver(\"drop table if exists \" + t);\n }\n }\n @After\n public void tearDown() throws Exception {\n try {\n if (d != null) {\n // runStatementOnDriver(\"set autocommit true\");\n dropTables();\n d.destroy();\n d.close();\n d = null;\n }\n TxnDbUtil.cleanDb();\n } finally {\n FileUtils.deleteDirectory(new File(TEST_DATA_DIR));\n }\n }\n @Ignore(\"not needed but useful for testing\")\n @Test\n public void testNonAcidInsert() throws Exception {\n runStatementOnDriver(\"insert into \" + Table.NONACIDORCTBL + \" values(1,2)\");\n List<String> rs = runStatementOnDriver(\"select a,b from \" + Table.NONACIDORCTBL);\n runStatementOnDriver(\"insert into \" + Table.NONACIDORCTBL + \" values(2,3)\");\n List<String> rs1 = runStatementOnDriver(\"select a,b from \" + Table.NONACIDORCTBL);\n }\n @Test\n public void testUpdateMixedCase() throws Exception {\n int[][] tableData = {{1,2},{3,3},{5,3}};\n runStatementOnDriver(\"insert into \" + Table.ACIDTBL + \" \" + makeValuesClause(tableData));\n runStatementOnDriver(\"update \" + Table.ACIDTBL + \" set B = 7 where A=1\");\n List<String> rs = runStatementOnDriver(\"select a,b from \" + Table.ACIDTBL + \" order by a,b\");\n int[][] updatedData = {{1,7},{3,3},{5,3}};\n Assert.assertEquals(\"Update failed\", stringifyValues(updatedData), rs);\n runStatementOnDriver(\"update \" + Table.ACIDTBL + \" set B = B + 1 where A=1\");\n List<String> rs2 = runStatementOnDriver(\"select a,b from \" + Table.ACIDTBL + \" order by a,b\");\n int[][] updatedData2 = {{1,8},{3,3},{5,3}};\n Assert.assertEquals(\"Update failed\", stringifyValues(updatedData2), rs2);\n }\n\n /**\n * https://issues.apache.org/jira/browse/HIVE-10151\n */\n @Test\n public void testBucketizedInputFormat() throws Exception {\n int[][] tableData = {{1,2}};\n runStatementOnDriver(\"insert into \" + Table.ACIDTBLPART + \" partition(p=1) \" + makeValuesClause(tableData));\n\n runStatementOnDriver(\"insert into \" + Table.ACIDTBL + \" select a,b from \" + Table.ACIDTBLPART + \" where p = 1\");\n List<String> rs = runStatementOnDriver(\"select a,b from \" + Table.ACIDTBL);//no order by as it's just 1 row\n Assert.assertEquals(\"Insert into \" + Table.ACIDTBL + \" didn't match:\", stringifyValues(tableData), rs);\n\n runStatementOnDriver(\"insert into \" + Table.NONACIDORCTBL + \" select a,b from \" + Table.ACIDTBLPART + \" where p = 1\");\n List<String> rs2 = runStatementOnDriver(\"select a,b from \" + Table.NONACIDORCTBL);//no order by as it's just 1 row\n Assert.assertEquals(\"Insert into \" + Table.NONACIDORCTBL + \" didn't match:\", stringifyValues(tableData), rs2);\n }\n @Test\n public void testInsertOverwriteWithSelfJoin() throws Exception {\n int[][] part1Data = {{1,7}};\n runStatementOnDriver(\"insert into \" + Table.NONACIDORCTBL + \" \" + makeValuesClause(part1Data));\n //this works because logically we need S lock on NONACIDORCTBL to read and X lock to write, but\n //LockRequestBuilder dedups locks on the same entity to only keep the highest level lock requested\n runStatementOnDriver(\"insert overwrite table \" + Table.NONACIDORCTBL + \" select 2, 9 from \" + Table.NONACIDORCTBL + \" T inner join \" + Table.NONACIDORCTBL + \" S on T.a=S.a\");\n List<String> rs = runStatementOnDriver(\"select a,b from \" + Table.NONACIDORCTBL + \" order by a,b\");\n int[][] joinData = {{2,9}};\n Assert.assertEquals(\"Self join non-part insert overwrite failed\", stringifyValues(joinData), rs);\n int[][] part2Data = {{1,8}};\n runStatementOnDriver(\"insert into \" + Table.NONACIDPART + \" partition(p=1) \" + makeValuesClause(part1Data));\n runStatementOnDriver(\"insert into \" + Table.NONACIDPART + \" partition(p=2) \" + makeValuesClause(part2Data));\n //here we need X lock on p=1 partition to write and S lock on 'table' to read which should\n //not block each other since they are part of the same txn\n runStatementOnDriver(\"insert overwrite table \" + Table.NONACIDPART + \" partition(p=1) select a,b from \" + Table.NONACIDPART);\n List<String> rs2 = runStatementOnDriver(\"select a,b from \" + Table.NONACIDPART + \" order by a,b\");\n int[][] updatedData = {{1,7},{1,8},{1,8}};\n Assert.assertEquals(\"Insert overwrite partition failed\", stringifyValues(updatedData), rs2);\n //insert overwrite not supported for ACID tables\n }\n /**\n * takes raw data and turns it into a string as if from Driver.getResults()\n * sorts rows in dictionary order\n */\n private List<String> stringifyValues(int[][] rowsIn) {\n assert rowsIn.length > 0;\n int[][] rows = rowsIn.clone();\n Arrays.sort(rows, new RowComp());\n List<String> rs = new ArrayList<String>();\n for(int[] row : rows) {\n assert row.length > 0;\n StringBuilder sb = new StringBuilder();\n for(int value : row) {\n sb.append(value).append(\"\\t\");\n }\n sb.setLength(sb.length() - 1);\n rs.add(sb.toString());\n }\n return rs;\n }\n private static final class RowComp implements Comparator<int[]> {\n public int compare(int[] row1, int[] row2) {\n assert row1 != null && row2 != null && row1.length == row2.length;\n for(int i = 0; i < row1.length; i++) {\n int comp = Integer.compare(row1[i], row2[i]);\n if(comp != 0) {\n return comp;\n }\n }\n return 0;\n }\n }\n private String makeValuesClause(int[][] rows) {\n assert rows.length > 0;\n StringBuilder sb = new StringBuilder(\"values\");\n for(int[] row : rows) {\n assert row.length > 0;\n if(row.length > 1) {\n sb.append(\"(\");\n }\n for(int value : row) {\n sb.append(value).append(\",\");\n }\n sb.setLength(sb.length() - 1);//remove trailing comma\n if(row.length > 1) {\n sb.append(\")\");\n }\n sb.append(\",\");\n }\n sb.setLength(sb.length() - 1);//remove trailing comma\n return sb.toString();\n }\n \n private List<String> runStatementOnDriver(String stmt) throws Exception {\n CommandProcessorResponse cpr = d.run(stmt);\n if(cpr.getResponseCode() != 0) {\n throw new RuntimeException(stmt + \" failed: \" + cpr);\n }\n List<String> rs = new ArrayList<String>();\n d.getResults(rs);\n return rs;\n }\n}\n", "meta": {"content_hash": "541e6d1ecc891126cfff3837c3572516", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 211, "avg_line_length": 43.04385964912281, "alnum_prop": 0.6719991848379866, "repo_name": "wangbin83-gmail-com/hive-1.1.0-cdh5.4.8", "id": "f5140c4b69d6e49690209c029dbd9665b33096dd", "size": "9814", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands2.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "48158"}, {"name": "C", "bytes": "120921"}, {"name": "C++", "bytes": "163950"}, {"name": "CSS", "bytes": "1372"}, {"name": "GAP", "bytes": "117068"}, {"name": "Groff", "bytes": "5379"}, {"name": "HTML", "bytes": "22057"}, {"name": "Java", "bytes": "24439585"}, {"name": "M", "bytes": "2173"}, {"name": "Makefile", "bytes": "6963"}, {"name": "PHP", "bytes": "1717937"}, {"name": "PLpgSQL", "bytes": "43781"}, {"name": "Perl", "bytes": "316328"}, {"name": "PigLatin", "bytes": "12333"}, {"name": "Protocol Buffer", "bytes": "6353"}, {"name": "Python", "bytes": "268109"}, {"name": "SQLPL", "bytes": "1414"}, {"name": "Shell", "bytes": "152105"}, {"name": "Thrift", "bytes": "93411"}, {"name": "XSLT", "bytes": "7619"}]}} +{"text": "\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst ts = __importStar(require(\"typescript\"));\nconst experimental_utils_1 = require(\"@typescript-eslint/experimental-utils\");\nconst tsutils = __importStar(require(\"tsutils\"));\nconst util = __importStar(require(\"../util\"));\nconst FUNCTION_CONSTRUCTOR = 'Function';\nconst GLOBAL_CANDIDATES = new Set(['global', 'window', 'globalThis']);\nconst EVAL_LIKE_METHODS = new Set([\n 'setImmediate',\n 'setInterval',\n 'setTimeout',\n 'execScript',\n]);\nexports.default = util.createRule({\n name: 'no-implied-eval',\n meta: {\n docs: {\n description: 'Disallow the use of `eval()`-like methods',\n category: 'Best Practices',\n recommended: 'error',\n extendsBaseRule: true,\n requiresTypeChecking: true,\n },\n messages: {\n noImpliedEvalError: 'Implied eval. Consider passing a function.',\n noFunctionConstructor: 'Implied eval. Do not use the Function constructor to create functions.',\n },\n schema: [],\n type: 'suggestion',\n },\n defaultOptions: [],\n create(context) {\n const parserServices = util.getParserServices(context);\n const program = parserServices.program;\n const checker = parserServices.program.getTypeChecker();\n function getCalleeName(node) {\n if (node.type === experimental_utils_1.AST_NODE_TYPES.Identifier) {\n return node.name;\n }\n if (node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression &&\n node.object.type === experimental_utils_1.AST_NODE_TYPES.Identifier &&\n GLOBAL_CANDIDATES.has(node.object.name)) {\n if (node.property.type === experimental_utils_1.AST_NODE_TYPES.Identifier) {\n return node.property.name;\n }\n if (node.property.type === experimental_utils_1.AST_NODE_TYPES.Literal &&\n typeof node.property.value === 'string') {\n return node.property.value;\n }\n }\n return null;\n }\n function isFunctionType(node) {\n var _a;\n const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);\n const type = checker.getTypeAtLocation(tsNode);\n const symbol = type.getSymbol();\n if (symbol &&\n tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Function | ts.SymbolFlags.Method)) {\n return true;\n }\n if (symbol && symbol.escapedName === FUNCTION_CONSTRUCTOR) {\n const declarations = (_a = symbol.getDeclarations()) !== null && _a !== void 0 ? _a : [];\n for (const declaration of declarations) {\n const sourceFile = declaration.getSourceFile();\n if (program.isSourceFileDefaultLibrary(sourceFile)) {\n return true;\n }\n }\n }\n const signatures = checker.getSignaturesOfType(type, ts.SignatureKind.Call);\n return signatures.length > 0;\n }\n function isBind(node) {\n return node.type === experimental_utils_1.AST_NODE_TYPES.MemberExpression\n ? isBind(node.property)\n : node.type === experimental_utils_1.AST_NODE_TYPES.Identifier && node.name === 'bind';\n }\n function isFunction(node) {\n switch (node.type) {\n case experimental_utils_1.AST_NODE_TYPES.ArrowFunctionExpression:\n case experimental_utils_1.AST_NODE_TYPES.FunctionDeclaration:\n case experimental_utils_1.AST_NODE_TYPES.FunctionExpression:\n return true;\n case experimental_utils_1.AST_NODE_TYPES.Literal:\n case experimental_utils_1.AST_NODE_TYPES.TemplateLiteral:\n return false;\n case experimental_utils_1.AST_NODE_TYPES.CallExpression:\n return isBind(node.callee) || isFunctionType(node);\n default:\n return isFunctionType(node);\n }\n }\n function checkImpliedEval(node) {\n var _a;\n const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.callee);\n const type = checker.getTypeAtLocation(tsNode);\n const calleeName = getCalleeName(node.callee);\n if (calleeName === null) {\n return;\n }\n if (calleeName === FUNCTION_CONSTRUCTOR) {\n const symbol = type.getSymbol();\n if (symbol) {\n const declarations = (_a = symbol.getDeclarations()) !== null && _a !== void 0 ? _a : [];\n for (const declaration of declarations) {\n const sourceFile = declaration.getSourceFile();\n if (program.isSourceFileDefaultLibrary(sourceFile)) {\n context.report({ node, messageId: 'noFunctionConstructor' });\n return;\n }\n }\n }\n else {\n context.report({ node, messageId: 'noFunctionConstructor' });\n return;\n }\n }\n if (node.arguments.length === 0) {\n return;\n }\n const [handler] = node.arguments;\n if (EVAL_LIKE_METHODS.has(calleeName) && !isFunction(handler)) {\n context.report({ node: handler, messageId: 'noImpliedEvalError' });\n }\n }\n return {\n NewExpression: checkImpliedEval,\n CallExpression: checkImpliedEval,\n };\n },\n});\n//# sourceMappingURL=no-implied-eval.js.map", "meta": {"content_hash": "ae087277db5539b03578a3ac0ce6b222", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 141, "avg_line_length": 43.928104575163395, "alnum_prop": 0.5493230174081238, "repo_name": "thomasoboyle/Exercism", "id": "c18ca152af4fb17e901c49c918eb7116b0b38f8d", "size": "6721", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "typescript/hello-world/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "JavaScript", "bytes": "781"}, {"name": "Ruby", "bytes": "96197"}, {"name": "TypeScript", "bytes": "218"}]}} +{"text": "package org.jbehave.core.model;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n\n/**\n * <p>\n * Represents a tabular structure to hold example data for parameters named via the headers:\n * <p/>\n * <pre>\n * |header 1|header 2| .... |header n|\n * |value 11|value 12| .... |value 1n|\n * ...\n * |value m1|value m2| .... |value mn|\n * </pre>\n * <p>Different header and value column separators can be specified to replace the default separator \"|\":</p>\n * <pre>\n * !!header 1!!header 2!! .... !!header n!!\n * !value 11!value 12! .... !value 1n!\n * ...\n * !value m1!value m2| .... !value mn!\n * </pre>\n */\npublic class ExamplesTable {\n\n private static final String NEWLINE = \"\\n\";\n private static final String HEADER_SEPARATOR = \"|\";\n private static final String VALUE_SEPARATOR = \"|\";\n private final List<Map<String, String>> data = new ArrayList<Map<String, String>>();\n private final String tableAsString;\n private final String headerSeparator;\n private final String valueSeparator;\n private final List<String> headers = new ArrayList<String>();\n\n public ExamplesTable(String tableAsString) {\n this(tableAsString, HEADER_SEPARATOR, VALUE_SEPARATOR);\n }\n\n public ExamplesTable(String tableAsString, String headerSeparator, String valueSeparator) {\n this.tableAsString = tableAsString;\n this.headerSeparator = headerSeparator;\n this.valueSeparator = valueSeparator;\n parse();\n }\n\n private void parse() {\n data.clear();\n String[] rows = tableAsString.trim().split(NEWLINE);\n headers.clear();\n for (int row = 0; row < rows.length; row++) {\n if (row == 0) {\n List<String> columns = columnsFor(rows[row], headerSeparator);\n headers.addAll(columns);\n } else {\n List<String> columns = columnsFor(rows[row], valueSeparator);\n Map<String, String> map = new HashMap<String, String>();\n for (int column = 0; column < columns.size(); column++) {\n map.put(headers.get(column), columns.get(column));\n }\n data.add(map);\n }\n }\n }\n\n private List<String> columnsFor(String row, String separator) {\n List<String> columns = new ArrayList<String>();\n for (String column : row.split(buildRegex(separator))) {\n columns.add(column.trim());\n }\n int size = columns.size();\n if (size > 0) {\n columns.remove(0);\n }\n return columns;\n }\n\n private String buildRegex(String separator) {\n char[] chars = separator.toCharArray();\n StringBuffer sb = new StringBuffer();\n for ( char c : chars ){\n sb.append(\"\\\\\").append(c);\n }\n return sb.toString();\n }\n\n public List<String> getHeaders() {\n return headers;\n }\n\n public Map<String, String> getRow(int row) {\n return data.get(row);\n }\n\n public int getRowCount() {\n return data.size();\n }\n\n public List<Map<String, String>> getRows() {\n return data;\n }\n\n public String getHeaderSeparator() {\n return headerSeparator;\n }\n\n public String getValueSeparator() {\n return valueSeparator;\n }\n\n @Override\n public String toString() {\n return tableAsString;\n }\n\n}\n", "meta": {"content_hash": "3f804c0c997cc5e6f460bb00e1e27c8a", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 109, "avg_line_length": 29.085470085470085, "alnum_prop": 0.5903614457831325, "repo_name": "codehaus/jbehave-git", "id": "410f8a6b3148e3f37831b96186d219d053397587", "size": "3403", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jbehave-core/src/main/java/org/jbehave/core/model/ExamplesTable.java", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Java", "bytes": "484308"}, {"name": "JavaScript", "bytes": "581"}, {"name": "Shell", "bytes": "735"}]}} +{"text": "import functools\nimport inspect\n\nfrom nova.db import base\nfrom nova import exception\nfrom nova.network import model as network_model\nfrom nova.network import rpcapi as network_rpcapi\nfrom nova.openstack.common import log as logging\nfrom nova.openstack.common import rpc\n\nLOG = logging.getLogger(__name__)\n\n\ndef refresh_cache(f):\n \"\"\"\n Decorator to update the instance_info_cache\n\n Requires context and instance as function args\n \"\"\"\n argspec = inspect.getargspec(f)\n\n @functools.wraps(f)\n def wrapper(self, context, *args, **kwargs):\n res = f(self, context, *args, **kwargs)\n\n try:\n # get the instance from arguments (or raise ValueError)\n instance = kwargs.get('instance')\n if not instance:\n instance = args[argspec.args.index('instance') - 2]\n except ValueError:\n msg = _('instance is a required argument to use @refresh_cache')\n raise Exception(msg)\n\n # get nw_info from return if possible, otherwise call for it\n nw_info = res if isinstance(res, network_model.NetworkInfo) else None\n\n update_instance_cache_with_nw_info(self, context, instance, nw_info,\n *args, **kwargs)\n\n # return the original function's return value\n return res\n return wrapper\n\n\ndef update_instance_cache_with_nw_info(api, context, instance,\n nw_info=None,\n *args,\n **kwargs):\n\n try:\n nw_info = nw_info or api._get_instance_nw_info(context, instance)\n\n # update cache\n cache = {'network_info': nw_info.json()}\n api.db.instance_info_cache_update(context, instance['uuid'], cache)\n except Exception as e:\n LOG.exception(_('Failed storing info cache'), instance=instance)\n LOG.debug(_('args: %s') % (args or {}))\n LOG.debug(_('kwargs: %s') % (kwargs or {}))\n\n\nclass API(base.Base):\n \"\"\"API for interacting with the network manager.\"\"\"\n\n def __init__(self, **kwargs):\n self.network_rpcapi = network_rpcapi.NetworkAPI()\n super(API, self).__init__(**kwargs)\n\n def get_all(self, context):\n return self.network_rpcapi.get_all_networks(context)\n\n def get(self, context, network_uuid):\n return self.network_rpcapi.get_network(context, network_uuid)\n\n def create(self, context, **kwargs):\n return self.network_rpcapi.create_networks(context, **kwargs)\n\n def delete(self, context, network_uuid):\n return self.network_rpcapi.delete_network(context, network_uuid, None)\n\n def disassociate(self, context, network_uuid):\n return self.network_rpcapi.disassociate_network(context, network_uuid)\n\n def get_fixed_ip(self, context, id):\n return self.network_rpcapi.get_fixed_ip(context, id)\n\n def get_fixed_ip_by_address(self, context, address):\n return self.network_rpcapi.get_fixed_ip_by_address(context, address)\n\n def get_floating_ip(self, context, id):\n return self.network_rpcapi.get_floating_ip(context, id)\n\n def get_floating_ip_pools(self, context):\n return self.network_rpcapi.get_floating_pools(context)\n\n def get_floating_ip_by_address(self, context, address):\n return self.network_rpcapi.get_floating_ip_by_address(context, address)\n\n def get_floating_ips_by_project(self, context):\n return self.network_rpcapi.get_floating_ips_by_project(context)\n\n def get_floating_ips_by_fixed_address(self, context, fixed_address):\n return self.network_rpcapi.get_floating_ips_by_fixed_address(context,\n fixed_address)\n\n def get_backdoor_port(self, context, host):\n return self.network_rpcapi.get_backdoor_port(context, host)\n\n def get_instance_id_by_floating_address(self, context, address):\n # NOTE(tr3buchet): i hate this\n return self.network_rpcapi.get_instance_id_by_floating_address(context,\n address)\n\n def get_vifs_by_instance(self, context, instance):\n return self.network_rpcapi.get_vifs_by_instance(context,\n instance['id'])\n\n def get_vif_by_mac_address(self, context, mac_address):\n return self.network_rpcapi.get_vif_by_mac_address(context, mac_address)\n\n def allocate_floating_ip(self, context, pool=None):\n \"\"\"Adds a floating ip to a project from a pool. (allocates)\"\"\"\n # NOTE(vish): We don't know which network host should get the ip\n # when we allocate, so just send it to any one. This\n # will probably need to move into a network supervisor\n # at some point.\n return self.network_rpcapi.allocate_floating_ip(context,\n context.project_id, pool, False)\n\n def release_floating_ip(self, context, address,\n affect_auto_assigned=False):\n \"\"\"Removes floating ip with address from a project. (deallocates)\"\"\"\n return self.network_rpcapi.deallocate_floating_ip(context, address,\n affect_auto_assigned)\n\n @refresh_cache\n def associate_floating_ip(self, context, instance,\n floating_address, fixed_address,\n affect_auto_assigned=False):\n \"\"\"Associates a floating ip with a fixed ip.\n\n ensures floating ip is allocated to the project in context\n \"\"\"\n orig_instance_uuid = self.network_rpcapi.associate_floating_ip(context,\n floating_address, fixed_address, affect_auto_assigned)\n\n if orig_instance_uuid:\n msg_dict = dict(address=floating_address,\n instance_id=orig_instance_uuid)\n LOG.info(_('re-assign floating IP %(address)s from '\n 'instance %(instance_id)s') % msg_dict)\n orig_instance = self.db.instance_get_by_uuid(context,\n orig_instance_uuid)\n\n # purge cached nw info for the original instance\n update_instance_cache_with_nw_info(self, context, orig_instance)\n\n @refresh_cache\n def disassociate_floating_ip(self, context, instance, address,\n affect_auto_assigned=False):\n \"\"\"Disassociates a floating ip from fixed ip it is associated with.\"\"\"\n self.network_rpcapi.disassociate_floating_ip(context, address,\n affect_auto_assigned)\n\n @refresh_cache\n def allocate_for_instance(self, context, instance, vpn,\n requested_networks):\n \"\"\"Allocates all network structures for an instance.\n\n :returns: network info as from get_instance_nw_info() below\n \"\"\"\n args = {}\n args['vpn'] = vpn\n args['requested_networks'] = requested_networks\n args['instance_id'] = instance['id']\n args['instance_uuid'] = instance['uuid']\n args['project_id'] = instance['project_id']\n args['host'] = instance['host']\n args['rxtx_factor'] = instance['instance_type']['rxtx_factor']\n nw_info = self.network_rpcapi.allocate_for_instance(context, **args)\n\n return network_model.NetworkInfo.hydrate(nw_info)\n\n def deallocate_for_instance(self, context, instance):\n \"\"\"Deallocates all network structures related to instance.\"\"\"\n\n args = {}\n args['instance_id'] = instance['id']\n args['project_id'] = instance['project_id']\n args['host'] = instance['host']\n self.network_rpcapi.deallocate_for_instance(context, **args)\n\n @refresh_cache\n def add_fixed_ip_to_instance(self, context, instance, network_id):\n \"\"\"Adds a fixed ip to instance from specified network.\"\"\"\n args = {'instance_id': instance['id'],\n 'host': instance['host'],\n 'network_id': network_id}\n self.network_rpcapi.add_fixed_ip_to_instance(context, **args)\n\n @refresh_cache\n def remove_fixed_ip_from_instance(self, context, instance, address):\n \"\"\"Removes a fixed ip from instance from specified network.\"\"\"\n\n args = {'instance_id': instance['uuid'],\n 'host': instance['host'],\n 'address': address}\n self.network_rpcapi.remove_fixed_ip_from_instance(context, **args)\n\n def add_network_to_project(self, context, project_id, network_uuid=None):\n \"\"\"Force adds another network to a project.\"\"\"\n self.network_rpcapi.add_network_to_project(context, project_id,\n network_uuid)\n\n @refresh_cache\n def get_instance_nw_info(self, context, instance):\n \"\"\"Returns all network info related to an instance.\"\"\"\n return self._get_instance_nw_info(context, instance)\n\n def _get_instance_nw_info(self, context, instance):\n \"\"\"Returns all network info related to an instance.\"\"\"\n args = {'instance_id': instance['id'],\n 'instance_uuid': instance['uuid'],\n 'rxtx_factor': instance['instance_type']['rxtx_factor'],\n 'host': instance['host'],\n 'project_id': instance['project_id']}\n nw_info = self.network_rpcapi.get_instance_nw_info(context, **args)\n\n return network_model.NetworkInfo.hydrate(nw_info)\n\n def validate_networks(self, context, requested_networks):\n \"\"\"validate the networks passed at the time of creating\n the server\n \"\"\"\n return self.network_rpcapi.validate_networks(context,\n requested_networks)\n\n def get_instance_uuids_by_ip_filter(self, context, filters):\n \"\"\"Returns a list of dicts in the form of\n {'instance_uuid': uuid, 'ip': ip} that matched the ip_filter\n \"\"\"\n return self.network_rpcapi.get_instance_uuids_by_ip_filter(context,\n filters)\n\n def get_dns_domains(self, context):\n \"\"\"Returns a list of available dns domains.\n These can be used to create DNS entries for floating ips.\n \"\"\"\n return self.network_rpcapi.get_dns_domains(context)\n\n def add_dns_entry(self, context, address, name, dns_type, domain):\n \"\"\"Create specified DNS entry for address\"\"\"\n args = {'address': address,\n 'name': name,\n 'dns_type': dns_type,\n 'domain': domain}\n return self.network_rpcapi.add_dns_entry(context, **args)\n\n def modify_dns_entry(self, context, name, address, domain):\n \"\"\"Create specified DNS entry for address\"\"\"\n args = {'address': address,\n 'name': name,\n 'domain': domain}\n return self.network_rpcapi.modify_dns_entry(context, **args)\n\n def delete_dns_entry(self, context, name, domain):\n \"\"\"Delete the specified dns entry.\"\"\"\n args = {'name': name, 'domain': domain}\n return self.network_rpcapi.delete_dns_entry(context, **args)\n\n def delete_dns_domain(self, context, domain):\n \"\"\"Delete the specified dns domain.\"\"\"\n return self.network_rpcapi.delete_dns_domain(context, domain=domain)\n\n def get_dns_entries_by_address(self, context, address, domain):\n \"\"\"Get entries for address and domain\"\"\"\n args = {'address': address, 'domain': domain}\n return self.network_rpcapi.get_dns_entries_by_address(context, **args)\n\n def get_dns_entries_by_name(self, context, name, domain):\n \"\"\"Get entries for name and domain\"\"\"\n args = {'name': name, 'domain': domain}\n return self.network_rpcapi.get_dns_entries_by_name(context, **args)\n\n def create_private_dns_domain(self, context, domain, availability_zone):\n \"\"\"Create a private DNS domain with nova availability zone.\"\"\"\n args = {'domain': domain, 'av_zone': availability_zone}\n return self.network_rpcapi.create_private_dns_domain(context, **args)\n\n def create_public_dns_domain(self, context, domain, project=None):\n \"\"\"Create a public DNS domain with optional nova project.\"\"\"\n args = {'domain': domain, 'project': project}\n return self.network_rpcapi.create_public_dns_domain(context, **args)\n\n def setup_networks_on_host(self, context, instance, host=None,\n teardown=False):\n \"\"\"Setup or teardown the network structures on hosts related to\n instance\"\"\"\n host = host or instance['host']\n # NOTE(tr3buchet): host is passed in cases where we need to setup\n # or teardown the networks on a host which has been migrated to/from\n # and instance['host'] is not yet or is no longer equal to\n args = {'instance_id': instance['id'],\n 'host': host,\n 'teardown': teardown}\n\n self.network_rpcapi.setup_networks_on_host(context, **args)\n\n def _is_multi_host(self, context, instance):\n try:\n fixed_ips = self.db.fixed_ip_get_by_instance(context,\n instance['uuid'])\n except exception.FixedIpNotFoundForInstance:\n return False\n network = self.db.network_get(context, fixed_ips[0]['network_id'],\n project_only='allow_none')\n return network['multi_host']\n\n def _get_floating_ip_addresses(self, context, instance):\n floating_ips = self.db.instance_floating_address_get_all(context,\n instance['uuid'])\n return [floating_ip['address'] for floating_ip in floating_ips]\n\n def migrate_instance_start(self, context, instance, migration):\n \"\"\"Start to migrate the network of an instance\"\"\"\n args = dict(\n instance_uuid=instance['uuid'],\n rxtx_factor=instance['instance_type']['rxtx_factor'],\n project_id=instance['project_id'],\n source_compute=migration['source_compute'],\n dest_compute=migration['dest_compute'],\n floating_addresses=None,\n )\n\n if self._is_multi_host(context, instance):\n args['floating_addresses'] = \\\n self._get_floating_ip_addresses(context, instance)\n args['host'] = migration['source_compute']\n\n self.network_rpcapi.migrate_instance_start(context, **args)\n\n def migrate_instance_finish(self, context, instance, migration):\n \"\"\"Finish migrating the network of an instance\"\"\"\n args = dict(\n instance_uuid=instance['uuid'],\n rxtx_factor=instance['instance_type']['rxtx_factor'],\n project_id=instance['project_id'],\n source_compute=migration['source_compute'],\n dest_compute=migration['dest_compute'],\n floating_addresses=None,\n )\n\n if self._is_multi_host(context, instance):\n args['floating_addresses'] = \\\n self._get_floating_ip_addresses(context, instance)\n args['host'] = migration['dest_compute']\n\n self.network_rpcapi.migrate_instance_finish(context, **args)\n", "meta": {"content_hash": "8085a326382f047a9181e6f92466df5e", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 79, "avg_line_length": 42.16434540389972, "alnum_prop": 0.6067252427825858, "repo_name": "aristanetworks/arista-ovs-nova", "id": "db8b872680e60ab9430494ac41c81f8f1b59088a", "size": "15976", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nova/network/api.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "JavaScript", "bytes": "7403"}, {"name": "Python", "bytes": "6938504"}, {"name": "Shell", "bytes": "16524"}]}} +{"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\n\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n \n <title>statsmodels.duration.hazard_regression.PHReg.score_residuals — statsmodels 0.8.0 documentation</title>\n \n <link rel=\"stylesheet\" href=\"../_static/nature.css\" type=\"text/css\" />\n <link rel=\"stylesheet\" href=\"../_static/pygments.css\" type=\"text/css\" />\n \n <script type=\"text/javascript\">\n var DOCUMENTATION_OPTIONS = {\n URL_ROOT: '../',\n VERSION: '0.8.0',\n COLLAPSE_INDEX: false,\n FILE_SUFFIX: '.html',\n HAS_SOURCE: true,\n SOURCELINK_SUFFIX: '.txt'\n };\n </script>\n <script type=\"text/javascript\" src=\"../_static/jquery.js\"></script>\n <script type=\"text/javascript\" src=\"../_static/underscore.js\"></script>\n <script type=\"text/javascript\" src=\"../_static/doctools.js\"></script>\n <link rel=\"shortcut icon\" href=\"../_static/statsmodels_hybi_favico.ico\"/>\n <link rel=\"author\" title=\"About these documents\" href=\"../about.html\" />\n <link rel=\"index\" title=\"Index\" href=\"../genindex.html\" />\n <link rel=\"search\" title=\"Search\" href=\"../search.html\" />\n <link rel=\"next\" title=\"statsmodels.duration.hazard_regression.PHReg.weighted_covariate_averages\" href=\"statsmodels.duration.hazard_regression.PHReg.weighted_covariate_averages.html\" />\n <link rel=\"prev\" title=\"statsmodels.duration.hazard_regression.PHReg.score\" href=\"statsmodels.duration.hazard_regression.PHReg.score.html\" />\n<link rel=\"stylesheet\" href=\"../_static/examples.css\" type=\"text/css\" />\n<link rel=\"stylesheet\" href=\"../_static/facebox.css\" type=\"text/css\" />\n<script type=\"text/javascript\" src=\"../_static/scripts.js\">\n</script>\n<script type=\"text/javascript\" src=\"../_static/facebox.js\">\n</script>\n\n </head>\n <body role=\"document\">\n<div class=\"headerwrap\">\n <div class = \"header\">\n \n <a href = \"../index.html\">\n<img src=\"../_static/statsmodels_hybi_banner.png\" alt=\"Logo\"\n style=\"padding-left: 15px\"/></a>\n \n </div>\n</div>\n\n <div class=\"related\" role=\"navigation\" aria-label=\"related navigation\">\n <h3>Navigation</h3>\n <ul>\n <li class=\"right\" style=\"margin-right: 10px\">\n <a href=\"../genindex.html\" title=\"General Index\"\n accesskey=\"I\">index</a></li>\n <li class=\"right\" >\n <a href=\"../py-modindex.html\" title=\"Python Module Index\"\n >modules</a> |</li>\n <li class=\"right\" >\n <a href=\"statsmodels.duration.hazard_regression.PHReg.weighted_covariate_averages.html\" title=\"statsmodels.duration.hazard_regression.PHReg.weighted_covariate_averages\"\n accesskey=\"N\">next</a> |</li>\n <li class=\"right\" >\n <a href=\"statsmodels.duration.hazard_regression.PHReg.score.html\" title=\"statsmodels.duration.hazard_regression.PHReg.score\"\n accesskey=\"P\">previous</a> |</li>\n<li><a href =\"../install.html\">Install</a></li> | \n<li><a href=\"https://groups.google.com/group/pystatsmodels?hl=en\">Support</a></li> | \n<li><a href=\"https://github.com/statsmodels/statsmodels/issues\">Bugs</a></li> | \n<li><a href=\"../dev/index.html\">Develop</a></li> | \n<li><a href=\"../examples/index.html\">Examples</a></li> | \n<li><a href=\"../faq.html\">FAQ</a></li> | \n\n <li class=\"nav-item nav-item-1\"><a href=\"../duration.html\" >Methods for Survival and Duration Analysis</a> |</li>\n <li class=\"nav-item nav-item-2\"><a href=\"statsmodels.duration.hazard_regression.PHReg.html\" accesskey=\"U\">statsmodels.duration.hazard_regression.PHReg</a> |</li> \n </ul>\n </div> \n\n <div class=\"document\">\n <div class=\"documentwrapper\">\n <div class=\"bodywrapper\">\n <div class=\"body\" role=\"main\">\n \n\n\n\n\n <div class=\"section\" id=\"statsmodels-duration-hazard-regression-phreg-score-residuals\">\n<h1>statsmodels.duration.hazard_regression.PHReg.score_residuals<a class=\"headerlink\" href=\"#statsmodels-duration-hazard-regression-phreg-score-residuals\" title=\"Permalink to this headline\">\u00b6</a></h1>\n<dl class=\"method\">\n<dt id=\"statsmodels.duration.hazard_regression.PHReg.score_residuals\">\n<code class=\"descclassname\">PHReg.</code><code class=\"descname\">score_residuals</code><span class=\"sig-paren\">(</span><em>params</em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"../_modules/statsmodels/duration/hazard_regression.html#PHReg.score_residuals\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#statsmodels.duration.hazard_regression.PHReg.score_residuals\" title=\"Permalink to this definition\">\u00b6</a></dt>\n<dd><p>Returns the score residuals calculated at a given vector of\nparameters.</p>\n<table class=\"docutils field-list\" frame=\"void\" rules=\"none\">\n<col class=\"field-name\" />\n<col class=\"field-body\" />\n<tbody valign=\"top\">\n<tr class=\"field-odd field\"><th class=\"field-name\">Parameters:</th><td class=\"field-body\"><p class=\"first\"><strong>params</strong> : ndarray</p>\n<blockquote>\n<div><p>The parameter vector at which the score residuals are\ncalculated.</p>\n</div></blockquote>\n</td>\n</tr>\n<tr class=\"field-even field\"><th class=\"field-name\">Returns:</th><td class=\"field-body\"><p class=\"first\">The score residuals, returned as a ndarray having the same</p>\n<p class=\"last\">shape as <cite>exog</cite>.</p>\n</td>\n</tr>\n</tbody>\n</table>\n<p class=\"rubric\">Notes</p>\n<p>Observations in a stratum with no observed events have undefined\nscore residuals, and contain NaN in the returned matrix.</p>\n</dd></dl>\n\n</div>\n\n\n\n\n\n </div>\n </div>\n </div>\n <div class=\"sphinxsidebar\" role=\"navigation\" aria-label=\"main navigation\">\n <div class=\"sphinxsidebarwrapper\">\n <h4>Previous topic</h4>\n <p class=\"topless\"><a href=\"statsmodels.duration.hazard_regression.PHReg.score.html\"\n title=\"previous chapter\">statsmodels.duration.hazard_regression.PHReg.score</a></p>\n <h4>Next topic</h4>\n <p class=\"topless\"><a href=\"statsmodels.duration.hazard_regression.PHReg.weighted_covariate_averages.html\"\n title=\"next chapter\">statsmodels.duration.hazard_regression.PHReg.weighted_covariate_averages</a></p>\n <div role=\"note\" aria-label=\"source link\">\n <h3>This Page</h3>\n <ul class=\"this-page-menu\">\n <li><a href=\"../_sources/generated/statsmodels.duration.hazard_regression.PHReg.score_residuals.rst.txt\"\n rel=\"nofollow\">Show Source</a></li>\n </ul>\n </div>\n<div id=\"searchbox\" style=\"display: none\" role=\"search\">\n <h3>Quick search</h3>\n <form class=\"search\" action=\"../search.html\" method=\"get\">\n <div><input type=\"text\" name=\"q\" /></div>\n <div><input type=\"submit\" value=\"Go\" /></div>\n <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n <input type=\"hidden\" name=\"area\" value=\"default\" />\n </form>\n</div>\n<script type=\"text/javascript\">$('#searchbox').show(0);</script>\n </div>\n </div>\n <div class=\"clearer\"></div>\n </div>\n <div class=\"footer\" role=\"contentinfo\">\n © Copyright 2009-2017, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.\n Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> 1.5.3.\n </div>\n </body>\n</html>", "meta": {"content_hash": "1dc9b8d566f923841d3378d45ef3a9c9", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 465, "avg_line_length": 46.4625, "alnum_prop": 0.6546946462200699, "repo_name": "statsmodels/statsmodels.github.io", "id": "e342741ffff699a9b2d663ae880c06b5a9dde98e", "size": "7437", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "0.8.0/generated/statsmodels.duration.hazard_regression.PHReg.score_residuals.html", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "<?php\n/* \nUnsafe sample\ninput : get the field userData from the variable $_GET via an object, which store it in a array\nsanitize : use of the function htmlentities. Sanitizes the query but has a high chance to produce unexpected results\nconstruction : concatenation with simple quote\n*/\n\n\n\n/*Copyright 2015 Bertrand STIVALET \n\nPermission is hereby granted, without written agreement or royalty fee, to\n\nuse, copy, modify, and distribute this software and its documentation for\n\nany purpose, provided that the above copyright notice and the following\n\nthree paragraphs appear in all copies of this software.\n\n\nIN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,\n\nINDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE \n\nUSE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE\n\nBEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\nAUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT\n\nLIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n\nPARTICULAR PURPOSE, AND NON-INFRINGEMENT.\n\n\nTHE SOFTWARE IS PROVIDED ON AN \"AS-IS\" BASIS AND AUTHORS HAVE NO\n\nOBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR\n\nMODIFICATIONS.*/\n\n\nclass Input{\n private $input;\n\n public function getInput(){\n return $this->input['realOne'];\n }\n\n public function __construct(){\n $this->input = array();\n $this->input['test']= 'safe' ;\n $this->input['realOne']= $_GET['UserData'] ;\n $this->input['trap']= 'safe' ;\n }\n}\n$temp = new Input();\n$tainted = $temp->getInput();\n\n$tainted = htmlentities($tainted, ENT_QUOTES);\n\n$query = \"(&(objectCategory=person)(objectClass=user)(cn='\". $tainted . \"'))\";\n\n//flaw\n$ds=ldap_connect(\"localhost\"); \n$r=ldap_bind($ds);\n$sr=ldap_search($ds,\"o=My Company, c=US\", $query); \nldap_close($ds);\n\n?>", "meta": {"content_hash": "5667d7ad8642d24467c5a0d514fca775", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 116, "avg_line_length": 25.0, "alnum_prop": 0.7277777777777777, "repo_name": "stivalet/PHP-Vulnerability-test-suite", "id": "3709120fb5048d4302b320ed3841672042b76e18", "size": "1800", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Injection/CWE_90/unsafe/CWE_90__object-indexArray__func_htmlentities__userByCN-concatenation_simple_quote.php", "mode": "33188", "license": "mit", "language": [{"name": "PHP", "bytes": "64184004"}]}} +{"text": "import re\n\n# Each definition can be one of the following:\n# - a string\n# - a regex string\n# - a function that takes source as a parameter and returns an array or a string. (You may assume that re and urllib are already imported.)\n# If you comment out a parameter, it will use the default defined in __init__.py\n\n# identifier (default = name of this plugin after \"plugin_\") : If there's a match, we'll attempt to download images using this plugin.\n\n# title: parses the gallery page for a title. This will be the folder name of the output gallery.\ntitle = r'<title>(.*?)</title>'\n\n# redirect: if the links in the gallery page go to an html instead of an image, use this to parse the gallery page.\nredirect = r'href=[\"\\']([^<]+?)[\"\\'][^<]*?><img'\n\n# direct_links: if redirect is non-empty, this parses each redirect page for a single image. Otherwise, this parses the gallery page for all images.\ndef direct_links(source):\n matcher = re.compile(r'src=[\\\"\\'](.+?\\.jpe?g)[\\\"\\']',re.I)\n links = matcher.findall(source)\n links = filter(lambda x: not \"thumb\" in x.lower(), links) # exclude thumbnails\n return links\n\n# same_filename (default=False): if True, uses filename specified on remote link. Otherwise, creates own filename with incremental index. \nsame_filename = True\n", "meta": {"content_hash": "c9d18344adc302e979126ae9dd3d3535", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 149, "avg_line_length": 51.36, "alnum_prop": 0.705607476635514, "repo_name": "regosen/gallery_get", "id": "d7dd6be544dc8017f4bdc71fabad9a317e0db260", "size": "1310", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "gallery_plugins/plugin_generic.py", "mode": "33261", "license": "mit", "language": [{"name": "Python", "bytes": "66870"}]}} +{"text": "module Stattleship\n class BasketballGameLog < Stattleship::GameLog\n def stats\n [\n \"#{field_goals_made.to_i} FGM\",\n \"#{(field_goals_pct.to_f * 100).round(1)} FG%\",\n \"#{points.to_i} PTS\",\n \"#{rebounds_total.to_i} RBD\",\n \"#{assists.to_i} A\",\n \"#{steals.to_i} STL\",\n \"#{blocks.to_i} BLK\"\n ]\n end\n\n def to_sentence\n \"#{player_name} #{stats.join(', ')} (#{game.name})\"\n end\n end\n\n class BasketballGameLogs < Stattleship::GameLogs\n BASKETBALL_GAME_LOGS = 'basketball/nba/game_logs'.freeze\n\n def self.fetch(params:)\n super(path: BASKETBALL_GAME_LOGS,\n params: params)\n end\n end\n\n module BasketballGameLogsRepresenter\n include Roar::JSON\n include Roar::Coercion\n include Stattleship::GameLogsRepresenter\n include Virtus.model\n\n collection :game_logs, class: Stattleship::BasketballGameLog do\n\n [\n :away_team_outcome,\n :home_team_outcome,\n :team_outcome,\n :opponent_outcome,\n ].each do |attribute|\n property attribute\n end\n\n [\n :field_goals_pct,\n :free_throws_pct,\n :three_pointers_pct,\n ].each do |attribute|\n property attribute, type: BigDecimal\n end\n\n [\n :game_played,\n :game_started,\n :home_team_score,\n :away_team_score,\n :team_score,\n :opponent_score,\n :assists,\n :field_goals_attempted,\n :field_goals_made,\n :free_throws_attempted,\n :free_throws_made,\n :points,\n :three_pointers_attempted,\n :three_pointers_made,\n :turnovers,\n :steals,\n :blocks,\n :personal_fouls,\n :technical_fouls,\n :time_played_total,\n :plus_minus,\n :disqualifications,\n :rebounds_defensive,\n :rebounds_offensive,\n :rebounds_total,\n :double_double,\n :double_triple_double,\n :double_twenty,\n :five_by_five,\n :five_by_seven,\n :five_by_six,\n :five_by_steals_blocks,\n :quadruple_double,\n :quintuple_double,\n :thirty_thirty,\n :triple_double,\n ].each do |attribute|\n property attribute, type: Integer\n end\n\n [\n :is_home_team,\n :is_away_team,\n ].each do |attribute|\n property attribute, type: Boolean, default: false\n end\n\n [\n :player_id,\n :game_id,\n :team_id\n ].each do |relationship|\n property relationship\n end\n end\n end\nend\n", "meta": {"content_hash": "473eed4a6bb87346b0c37839625d3b3f", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 67, "avg_line_length": 23.045045045045047, "alnum_prop": 0.5461297888975762, "repo_name": "stattleship/stattleship-ruby", "id": "67c5e71fc5b66a4026b6b1e7d95add6fd830acf4", "size": "2558", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/stattleship/basketball_game_logs.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "522762"}, {"name": "Shell", "bytes": "115"}]}} +{"text": "To run example code in this directory, invoke your python interpreter in the\ntop-level directory with following arguments:\n\n```\npython -m chapter_03.main\n```\n", "meta": {"content_hash": "369a8590531cbc2f4e6c1dcd5c205053", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 76, "avg_line_length": 26.333333333333332, "alnum_prop": 0.7721518987341772, "repo_name": "MillionIntegrals/ESL", "id": "3341067a14ad44d31fd76b2b76934c7a2afeb70a", "size": "191", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chapter_03/Readme.md", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "21292"}]}} +{"text": "SYNONYM\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "b89c7fe0be027cd770489966dd8ccc01", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "2a25bd012f3bb610c37ac988f32a0fd176a7e92f", "size": "205", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Deiregyne/Deiregyne densiflora/ Syn. Stenorrhynchos densiflorum/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "<?php\n\nnamespace Pilulka\\Database;\n\nclass Hydrator\n{\n\n public static function hydrate($class, $row)\n {\n $model = (new \\ReflectionClass($class))->newInstance();\n $property = new \\ReflectionProperty($class, 'row');\n $property->setAccessible(true);\n $property->setValue($model, $row);\n return $model;\n }\n\n}\n", "meta": {"content_hash": "0bcfb16386b0c67f042adbc83c4012bf", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 63, "avg_line_length": 20.470588235294116, "alnum_prop": 0.6063218390804598, "repo_name": "pilulkacz/database", "id": "e7afc7040df3244619266dd3d4d8b8644f432a5c", "size": "348", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Hydrator.php", "mode": "33188", "license": "mit", "language": [{"name": "PHP", "bytes": "15264"}]}} +{"text": "package com.capitalone.dashboard.repository;\n\nimport java.util.List;\n\nimport org.bson.types.ObjectId;\nimport org.springframework.data.mongodb.repository.Query;\n\nimport com.capitalone.dashboard.model.TeamCollectorItem;\n\n/**\n * CollectorItem repository for {@link TeamCollectorItem}.\n */\npublic interface TeamRepository extends\n\t\tBaseCollectorItemRepository<TeamCollectorItem> {\n\t@Query(value = \"{ 'collectorId' : ?0, options.teamId : ?1, options.name : ?2}\")\n\tTeamCollectorItem findTeamCollector(ObjectId collectorId, String teamId,\n\t\t\tString name);\n\n\t@Query(value = \"{ 'collectorId' : ?0, options.teamId : ?1, enabled: true}\")\n\tList<TeamCollectorItem> findEnabledTeamCollectors(ObjectId collectorId,\n\t\t\tString teamId);\n\n\t@Query(value = \"{ $query: { 'collectorId' : ?0, 'options.changeDate' : {$gt: ?1}, '_class' : 'com.capitalone.dashboard.model.TeamCollectorItem'}, $orderby: { 'options.changeDate' :-1 }}\", fields = \"{'options.changeDate' : 1, '_id' : 0}\")\n\tList<TeamCollectorItem> getTeamMaxChangeDate(ObjectId collectorId,\n\t\t\tString lastChangeDate);\n\n\t@Query(value = \"{'options.teamId' : ?0}\")\n\tList<TeamCollectorItem> getTeamIdById(String teamId);\n}\n", "meta": {"content_hash": "666f29e8a8d5e877b606f004629e1b53", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 238, "avg_line_length": 39.827586206896555, "alnum_prop": 0.7402597402597403, "repo_name": "jimzucker/hygieia-temp", "id": "5975856f46783533311c0595b38610fcc63de231", "size": "1155", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jira-feature-collector/src/main/java/com/capitalone/dashboard/repository/TeamRepository.java", "mode": "33261", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "5186"}, {"name": "CSS", "bytes": "76286"}, {"name": "HTML", "bytes": "91997"}, {"name": "Java", "bytes": "794189"}, {"name": "JavaScript", "bytes": "190816"}, {"name": "Shell", "bytes": "8755"}]}} +{"text": "<?php\n/**\n * Logos public part.\n */\n\n// File Security Check\nif ( ! defined( 'ABSPATH' ) ) { exit; }\n\nclass Presscore_Mod_Logos_Public {\n\n\tpublic function register_shortcodes() {\n\t\tforeach ( array( 'logos' ) as $shortcode_name ) {\n\t\t\tinclude_once plugin_dir_path( __FILE__ ) . \"shortcodes/{$shortcode_name}/{$shortcode_name}.php\";\n\t\t}\n\t}\n\n\tpublic function load_shortcodes_vc_bridge() {\n\t\tinclude_once plugin_dir_path( __FILE__ ) . \"shortcodes/mod-logos-shortcodes-bridge.php\";\n\t}\n\n\tpublic function init_widgets() {\n\t\tregister_widget( 'Presscore_Inc_Widgets_Logos' );\n\t}\n}\n", "meta": {"content_hash": "9aca566d2719702be3205aea621e73c5", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 99, "avg_line_length": 23.791666666666668, "alnum_prop": 0.6619964973730298, "repo_name": "ZloVolk/TQ", "id": "48a95352cf19ec3708e93cc89e94ffcb617fa019", "size": "571", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wp-content/themes/dt-the7/inc/mods/logos/public/class-mod-logos-public.php", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "103126077"}, {"name": "HTML", "bytes": "230730"}, {"name": "JavaScript", "bytes": "10865050"}, {"name": "PHP", "bytes": "34845446"}, {"name": "PLSQL", "bytes": "558884"}]}} +{"text": "OpenCV-Face-andmore-Tracker\n===========================\n\nOpenCV based face (and eye, nose, mouth) detection example application. The tutorial is provided as ready to compile/run Windows Visual Studio project (C#, .NET, EmguCV). Just download, compile and have fun with it. Or use the provided binary setup and play webcam face tracking right away.\n", "meta": {"content_hash": "d7ee9b61fa3a322e909d89245366ea34", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 290, "avg_line_length": 87.0, "alnum_prop": 0.7270114942528736, "repo_name": "A9T9/OpenCV-Face-andmore-Tracker", "id": "bc63f07168accd0a9c4edc98decc540240d0cd20", "size": "348", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C#", "bytes": "39023"}, {"name": "Inno Setup", "bytes": "4585"}]}} +{"text": "import React from 'react'\nimport CalloutSection from '~/components/callout';\nimport MainCarousel from '~/components/main-carousel';\nimport { ServicesSection } from '~/components/services';\nimport { NewsSection } from '~/components/news';\nimport Icon from \"~/components/icon\";\nimport { Box, Flex } from 'rebass';\nimport Heading from '~/components/heading';\nimport PageSection from \"~/components/page-section\";\nimport { Circle } from 'rebass';\nimport { darken, lighten } from 'polished';\nimport styled, { withTheme } from 'styled-components';\n\nconst VisaLink = styled.a`\ndisplay:block;\n text-decoration:none;\n &:hover {\n ${ Box }{\n background-color: ${ ({theme}) => theme.colors.primaryAccent };\n transition: all 0.3s ease-in-out;\n border-color: ${({ theme }) => darken(0.1, theme.colors.primaryAccent )};\n }\n ${ Icon }{\n color: ${({ theme }) => darken(0.35, theme.colors.primaryAccent )};\n }\n\n ${ Heading }{\n color: ${ ({theme}) => theme.colors.primaryAccent };\n }\n\n };\n\n width:100%;\n height:100%;\n`\n\nconst StyledBox = styled(Box)`\n line-height: 1em;\n width: 1em;\n height: 1em;\n font-size:6em;\n border-radius: 10px;\n border:solid 2px ${ ({theme}) => darken(0.05, theme.colors.light ) };\n display: inline-flex;\n border-radius: 50%;\n background-color: ${ ({ theme }) => theme.colors.light };\n`\n\nconst StyledIcon = styled(Icon)`\n display:block;\n width:100%;\n height:100%;\n font-size: 0.5em;\n margin-top:-5px;\n color: ${({theme}) => theme.colors.dark };\n`\n\nconst Visa = withTheme(({title, slug, icon, theme}) => {\n return (\n <Box w={[1, 1/2, 1/3, 1/5]} mb={[5, 6]} style={{ textAlign: \"center\"}}>\n <VisaLink href={slug}>\n <StyledBox ><StyledIcon color=\"dark\" icon={icon}></StyledIcon></StyledBox>\n <Heading f={[1, 2, 3, 4]}>{title}</Heading>\n </VisaLink>\n </Box>\n)\n});\n\nconst VisaSection = withTheme(({visas, theme}) =>{\n const children = visas.map(visa => (<Visa key={visa.id} {...visa}/>));\n return (<Flex style={{ borderTop: \"solid 1px \" + darken(0.1, theme.colors.light ) }} wrap pt={6}>\n {children}\n </Flex>)\n});\n\nexport default ({data}) => {\n const services = data.services.edges.map(x => ({ ...x.node.frontmatter, id:x.node.id, slug: x.node.fields.slug }));\n const news = data.news.edges.map(x => ({ ...x.node.frontmatter, id:x.node.id, slug: x.node.fields.slug, excerpt: x.node.excerpt }));\n const visas = data.visas.edges.concat(data.citizenship.edges).map(x => ({ ...x.node.frontmatter, id:x.node.id, slug: x.node.fields.slug }));\n\nreturn (\n <div>\n <MainCarousel/>\n <ServicesSection services={services}/>\n <VisaSection visas={visas} />\n <CalloutSection/>\n <NewsSection news={news} py={5} />\n </div>\n )\n}\n\nexport const pageQuery = graphql`\n fragment Content on MarkdownRemarkEdge{\n node{\n fields{\n area,\n slug\n },\n id,\n frontmatter{\n title,\n caption,\n extract,\n image,\n thumb,\n tags,\n date,\n order,\n icon,\n thumbPosition\n }\n }\n }\n\nquery LandingQuery {\n services:allMarkdownRemark(\n limit: 100\n filter:{ fields: { area: { eq: \"services\" } }}\n sort: { fields: [frontmatter___order], order: ASC }\n ) {\n edges {\n ...Content\n }\n },\n visas:allMarkdownRemark(\n limit: 100\n filter:{ fields: { area: { eq: \"visas\" } }}\n sort: { fields: [frontmatter___order], order: ASC }\n ) {\n edges {\n ...Content\n }\n },\n citizenship: allMarkdownRemark(\n limit: 100\n filter:{ fields: { area: { eq: \"citizenship\" } }}\n sort: { fields: [frontmatter___order], order: ASC }\n ) {\n edges {\n ...Content\n }\n },\n news:allMarkdownRemark(\n limit: 100\n filter:{ fields: { area: { eq: \"news\" } }}\n sort: { fields: [frontmatter___date], order: DESC }\n ) {\n edges {\n ...Content,\n node{\n excerpt(pruneLength: 350)\n }\n }\n }\n}`;\n", "meta": {"content_hash": "8e35a1515775c1ced06d049dcdcf11ec", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 143, "avg_line_length": 25.883870967741935, "alnum_prop": 0.5765204386839482, "repo_name": "adrienlozano/stephaniewebsite", "id": "1a7f855072390a3e58318426830f6c20e1d26307", "size": "4012", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/pages/index.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "459"}, {"name": "JavaScript", "bytes": "76652"}]}} +{"text": "layout: post\nname: \"Invoice\"\ntitle: \"Invoice \u2013 August 2019\"\ndate: 2019-08-31 10:00:00\ninvoice_number: \"naluri-2019-8-31-CG\"\nperiod: \"August 2019\"\npdf_url: \"/pdfs/2019-08-31-invoice.pdf\"\ninvoice_currency: RM\nhourly_rate: 1500\nperson_name: Code Hero Enterprise\nperson_email: fai@code3.io\nclient: Naluri Sdn Bhd\nnote: \nexcerpt_separator: \"\"\ninvoice_line_items:\n- title: August 2019 (Tech / Infra support / advice)\n amount: 1500\n\ninvoice_payment_info: |\n __Account Name:__ CODE HERO ENTERPRISE \\\\\n __Account Bank Name:__ MAYBANK MALAYSIA \\\\\n __Account Number:__ \u200e562106693095 \\\\\n __Account Country:__ Malaysia \\\\\n __Account Address:__ \\\\\n SA1-8-3A Vista Alam, \\\\\n Jalan Ikhtisas, Seksyen 14, \\\\\n 40000 Shah Alam, \\\\\n Selangor, Malaysia.\n\nexchange_rate: 0.0\nexchange_currency: \naddress: \n...\n\n---\n\n# {{page.title}} <a class=\"pdf-link\" href=\"{{page.pdf_url}}\" target=\"_blank\"><span class=\"mega-octicon octicon-file-pdf\"></span></a>\n\n## Description\n\nThis invoice is for work performed by _{{page.person_name}}_ for _{{page.client}}_.\n\n\n__Invoice Number:__ {{ page.invoice_number }} \\\\\n__Date:__ {{ page.date | date_to_string }} \\\\\n__For period:__ {{ page.period }}\n\n{{page.note}}\n\n## Line items\n\n{% assign total = 0 %}\n|__Description__|__Total__|\n|---|---:|{% for item in page.invoice_line_items %}{% assign total = total | plus:item.amount %}\n|{{item.title}}|{{item.amount}}|{% endfor %}\n||__{{total}} {{page.invoice_currency}}__|\n\n{% if page.exchange_rate > 0 %}\nExchange Rate {{page.exchange_rate}}, total payable in {{page.exchange_currency}}, **{{total | times:page.exchange_rate | round}} {{page.exchange_currency}}**\n{% endif %}\n\n## Bank Information\n\n{{page.invoice_payment_info}}\n\n", "meta": {"content_hash": "9c31393e00301596f37cdc9e385d4d26", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 158, "avg_line_length": 26.353846153846153, "alnum_prop": 0.647985989492119, "repo_name": "codegarageco/cg_invoice", "id": "3ea02feb36dd7a527b406127bfc89f3580cd3add", "size": "1721", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2019-08-31-invoice.markdown", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "3226"}, {"name": "HTML", "bytes": "1303"}, {"name": "Less", "bytes": "11744"}, {"name": "Ruby", "bytes": "4648"}]}} +{"text": "::ApplicationController.class_eval do\n\n around_filter :scope_current_patron\n\n\tdef current_patron\n\t\tif user_signed_in?\n\t\t\t@current_patron ||= begin\n\t\t\t\tpatron_id = warden.user(:scope => :patron) #|| (current_user.patron_id if current_user)\n\t\t\t\tNimbos::Patron.find(patron_id)\n\t\t\tend\n\t\tend\n\tend\n\thelper_method :current_patron\n\n\tdef current_user\n\t\tif user_signed_in?\n\t\t\t@current_user ||= begin\n\t\t\t\tuser_id = warden.user(:scope => :user)\n\t\t\t\tNimbos::User.unscoped.find(user_id)\n\t\t\tend\n\t\tend\n\tend\n\thelper_method :current_user\n\n\tdef user_signed_in?\n warden.authenticated?(:user)\n end\n helper_method :user_signed_in?\n\n def require_login\n unless user_signed_in?\n \tsession[:return_to_url] = request.url if request.get?\n \tnot_authenticated\n else\n \tif current_user.is_guest\n \t\tsession[:return_to_url] = nil\n \t\twarden.logout\n \t\tredirect_to main_app.root_url\n \tend\n end\n end\n\n\tdef force_authentication!(patron, user)\n\t\twarden.set_user(user.id, :scope => :user)\n\t\twarden.set_user(patron.id, :scope => :patron)\n\tend\n\n\tdef generate_group(parent, user_ids)\n\t\t#user_ids << current_user.id\n Nimbos::Group.add_group(current_user.id, parent, user_ids)\n\tend\n\nprivate\n\tdef not_authenticated\n\t redirect_to nimbos.login_path, :alert => \"Please login first.\"\n\tend\n\n def warden\n env['warden']\n end\n\n def scope_current_patron\n Nimbos::Patron.current_id = current_patron.id if current_patron\n yield\n ensure\n Nimbos::Patron.current_id = nil\n end\nend", "meta": {"content_hash": "01566105be0dec354c3ff92137c38f2f", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 91, "avg_line_length": 21.720588235294116, "alnum_prop": 0.6790792146242384, "repo_name": "farukca/nimbos", "id": "8719a58845a75237ff9d1b6e3b3f209302147fba", "size": "1477", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/extenders/controllers/application_controller_extender.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "6478"}, {"name": "CoffeeScript", "bytes": "842"}, {"name": "HTML", "bytes": "139106"}, {"name": "JavaScript", "bytes": "4835"}, {"name": "Ruby", "bytes": "142043"}]}} +{"text": "\r\n// Next default values for new objects\r\n// \r\n#ifdef APSTUDIO_INVOKED\r\n#ifndef APSTUDIO_READONLY_SYMBOLS\r\n#define _APS_NEXT_RESOURCE_VALUE 139\r\n#define _APS_NEXT_COMMAND_VALUE 32778\r\n#define _APS_NEXT_CONTROL_VALUE 1043\r\n#define _APS_NEXT_SYMED_VALUE 110\r\n#endif\r\n#endif\r\n", "meta": {"content_hash": "6800b8194ae65b2d3bb5d132b4b84845", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 45, "avg_line_length": 27.818181818181817, "alnum_prop": 0.6633986928104575, "repo_name": "johanlantz/headsetpresenter", "id": "eac1cf3804c286383d2ea10d35236b3035cb2c24", "size": "2971", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "HeadsetPresenter_Bluetools/Microsoft Speech SDK 5.1/Samples/CPP/Reco/resource.h", "mode": "33261", "license": "mit", "language": [{"name": "Assembly", "bytes": "7004"}, {"name": "Batchfile", "bytes": "2489"}, {"name": "C", "bytes": "16452971"}, {"name": "C#", "bytes": "1393901"}, {"name": "C++", "bytes": "19851472"}, {"name": "Clarion", "bytes": "4450"}, {"name": "HTML", "bytes": "50191"}, {"name": "Makefile", "bytes": "51937"}, {"name": "NSIS", "bytes": "68365"}, {"name": "Objective-C", "bytes": "1800430"}, {"name": "PHP", "bytes": "10905"}, {"name": "Visual Basic", "bytes": "823951"}]}} +{"text": "package io.tvcalendar.security;\n\nimport org.springframework.security.core.AuthenticationException;\n\n/**\n * This exception is throw in case of a not activated user trying to authenticate.\n */\npublic class UserNotActivatedException extends AuthenticationException {\n\n public UserNotActivatedException(String message) {\n super(message);\n }\n\n public UserNotActivatedException(String message, Throwable t) {\n super(message, t);\n }\n}\n", "meta": {"content_hash": "d2e1f6b4a1d7224fd6c20b64314e5075", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 82, "avg_line_length": 26.705882352941178, "alnum_prop": 0.748898678414097, "repo_name": "raphaelrodrigues/tvcalendar", "id": "78ce2e206c2a4fe748864a6baa52775f46f35377", "size": "454", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/io/tvcalendar/security/UserNotActivatedException.java", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "24139"}, {"name": "Batchfile", "bytes": "5006"}, {"name": "CSS", "bytes": "6151"}, {"name": "Cucumber", "bytes": "161"}, {"name": "HTML", "bytes": "119939"}, {"name": "Java", "bytes": "298008"}, {"name": "JavaScript", "bytes": "167265"}, {"name": "Shell", "bytes": "7058"}]}} +{"text": "\n\npackage com.example.fraud.model;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\npublic class FraudCheckResult {\n\n\tprivate FraudCheckStatus fraudCheckStatus;\n\n\t@JsonProperty(\"rejection.reason\")\n\tprivate String rejectionReason;\n\n\tpublic FraudCheckResult() {\n\t}\n\n\tpublic FraudCheckResult(FraudCheckStatus fraudCheckStatus, String rejectionReason) {\n\t\tthis.fraudCheckStatus = fraudCheckStatus;\n\t\tthis.rejectionReason = rejectionReason;\n\t}\n\n\tpublic FraudCheckStatus getFraudCheckStatus() {\n\t\treturn fraudCheckStatus;\n\t}\n\n\tpublic void setFraudCheckStatus(FraudCheckStatus fraudCheckStatus) {\n\t\tthis.fraudCheckStatus = fraudCheckStatus;\n\t}\n\n\tpublic String getRejectionReason() {\n\t\treturn rejectionReason;\n\t}\n\n\tpublic void setRejectionReason(String rejectionReason) {\n\t\tthis.rejectionReason = rejectionReason;\n\t}\n\n}\n", "meta": {"content_hash": "2a72423c8e78c633efaedcbdc1178088", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 85, "avg_line_length": 21.55263157894737, "alnum_prop": 0.800976800976801, "repo_name": "spring-cloud/spring-cloud-contract", "id": "c908038d0af398144e36b72937e441186cada86b", "size": "1440", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "samples/standalone/dsl/http-server/src/main/java/com/example/fraud/model/FraudCheckResult.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "37240"}, {"name": "Dockerfile", "bytes": "2829"}, {"name": "Groovy", "bytes": "1312232"}, {"name": "Java", "bytes": "2319249"}, {"name": "Kotlin", "bytes": "131929"}, {"name": "Shell", "bytes": "39490"}, {"name": "Vim Snippet", "bytes": "1421"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\n\nnamespace Web_API_Service.Models\n{\n // Models returned by AccountController actions.\n\n public class ExternalLoginViewModel\n {\n public string Name { get; set; }\n\n public string Url { get; set; }\n\n public string State { get; set; }\n }\n\n public class ManageInfoViewModel\n {\n public string LocalLoginProvider { get; set; }\n\n public string Email { get; set; }\n\n public IEnumerable<UserLoginInfoViewModel> Logins { get; set; }\n\n public IEnumerable<ExternalLoginViewModel> ExternalLoginProviders { get; set; }\n }\n\n public class UserInfoViewModel\n {\n public string Email { get; set; }\n\n public bool HasRegistered { get; set; }\n\n public string LoginProvider { get; set; }\n }\n\n public class UserLoginInfoViewModel\n {\n public string LoginProvider { get; set; }\n\n public string ProviderKey { get; set; }\n }\n}\n", "meta": {"content_hash": "c85a40e3a4301256ded04b3d35722bcd", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 87, "avg_line_length": 22.558139534883722, "alnum_prop": 0.6371134020618556, "repo_name": "x-danma/Texas", "id": "abbf100685f8afb99792e6242a3db9a35c0cccfa", "size": "972", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ConsoleApplication1/Web API Service/Models/AccountViewModels.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "109"}, {"name": "C#", "bytes": "241802"}, {"name": "CSS", "bytes": "2626"}, {"name": "HTML", "bytes": "6656"}, {"name": "JavaScript", "bytes": "10918"}]}} +{"text": "<?php\nheader(\"Content-Type: application/json\"); //Set header for outputing the JSON information\nrequire_once $_SERVER['DOCUMENT_ROOT'] . '/includes/autoload.php';\n$request = file_get_contents('php://input');\n$data = json_decode($request);\n$notification_id = $data->notification_id;\n//$notification_id = 36;\n$user = User::get_current_user();\ntry {\n\tif (is_numeric($notification_id) && $user instanceof CurrentUser) {\n\t\t$notification = new Notification(array(\n\t\t\t'notification_id' => $notification_id)\n\t\t);\n\t\t$result = $user->mark_notification_as_read($notification);\n\t\thttp_response_code(200);\n\t}\n\telse {\n\t\tthrow new UnexpectedValueException('UnexpectedValueException occured on request because the input parameters are invalid');\n\t}\n}\ncatch (Exception $e) {\n\thttp_response_code(400);\n\tDatabase::print_exception($e);\n}", "meta": {"content_hash": "d56d129ca8a4e6597ea11704598fa24e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 125, "avg_line_length": 34.041666666666664, "alnum_prop": 0.7184822521419829, "repo_name": "kuroware/UoftBaddy", "id": "5ac07c7de4565312206a0756318bb5bc037d9e31", "size": "817", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "postRequests/user/MarkNotificationAsRead.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "5338"}, {"name": "HTML", "bytes": "205929"}, {"name": "JavaScript", "bytes": "8846"}, {"name": "PHP", "bytes": "1416008"}]}} +{"text": "package org.tecunhuman;\n\nimport org.tecunhuman.jni.SoundStretch;\n\npublic class AndroidJNI {\n public final static SoundStretch soundStretch = new SoundStretch();\n}\n", "meta": {"content_hash": "245c8791b32a1a5d447dd9b30fd4bc37", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 71, "avg_line_length": 23.714285714285715, "alnum_prop": 0.7891566265060241, "repo_name": "happyhugo/mask", "id": "a6bb28b8c900d54ad79c626eda039d03da65eaba", "size": "166", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "soundtouch/src/org/tecunhuman/AndroidJNI.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "343077"}, {"name": "C++", "bytes": "331168"}, {"name": "D", "bytes": "429692"}, {"name": "Java", "bytes": "129742"}, {"name": "JavaScript", "bytes": "1004"}, {"name": "Pascal", "bytes": "17208"}, {"name": "Shell", "bytes": "1697"}]}} +{"text": "{-# LANGUAGE TemplateHaskell, DeriveGeneric, DeriveDataTypeable #-}\nmodule Master.Master\n ( run\n , remoteTable\n ) where\n\nimport Control.Distributed.Process ( Process, NodeId, RemoteTable\n , NodeMonitorNotification (..)\n , ProcessMonitorNotification (..)\n , DiedReason (..), ProcessId (..)\n , say, spawnSupervised, spawnLocal\n , getSelfPid, send, nsend, expect\n , receiveWait\n , match, monitorNode\n , register )\nimport Control.Distributed.Process.Closure\nimport Control.Distributed.Process.Backend.SimpleLocalnet ( Backend\n , findSlaves \n , terminateAllSlaves )\nimport Control.Monad (forever)\nimport Data.List ((\\\\))\nimport Data.Binary\nimport Data.Typeable\nimport Text.Printf (printf)\n\nimport GHC.Generics\n\nimport Slave.Slave (Request (..), Response (..), slaveProc, slaveProc__static)\n\ndata NodeDetected = \n NodeDetected !NodeId\n deriving (Generic, Typeable)\n \ninstance Binary NodeDetected\n\ndata ProcessUp =\n ProcessUp !ProcessId\n deriving (Generic, Typeable)\n \ninstance Binary ProcessUp\n\ndata ProcessDown =\n ProcessDown !ProcessId\n deriving (Generic, Typeable)\n \ninstance Binary ProcessDown\n\nnodeDetector :: Backend -> Process ()\nnodeDetector backend = loop []\n where\n loop :: [NodeId] -> Process ()\n loop nodes = do\n nodes' <- map processNodeId `fmap` findSlaves backend\n mapM_ (nsend \"supervisor\" . NodeDetected) $ nodes' \\\\ nodes\n loop nodes'\n\nsupervisor :: Process ()\nsupervisor = do\n register \"supervisor\" =<< getSelfPid\n forever $\n receiveWait\n [ match nodeDetected\n , match nodeMonitorNotification \n , match processMonitorNotification\n ] \n \ntaskMaster :: Process ()\ntaskMaster = do\n say \"taskMaster\"\n taskMaster' [] [1..100] []\n\ntaskMaster' :: [ProcessId] -> [Int] -> [Int] -> Process ()\ntaskMaster' [] xs ys = do\n -- No processes are available, wait infinitely for one process to\n -- show up.\n say \"Waiting for procs\"\n ProcessUp processId <- expect\n say \"Got proc\"\n taskMaster' [processId] xs ys\n \ntaskMaster' procs [] ys\n | length ys == 100 = do\n say \"Work is done!\"\n return ()\n | otherwise = do\n -- We still have to receive responses from processes.\n say \"Waiting for the last response(s)\"\n Response y <- expect\n say $ printf \"Got response: %d\" y\n taskMaster' procs [] (y:ys)\n \ntaskMaster' procs@(p:ps) s@(x:xs) ys\n | length s + length ys < 80 = do\n -- Too many in flight, don't send more.\n say \"Too many in flight. Waiting for various responses\"\n (procs', s', ys') <- receiveWait\n [ match $ \\(ProcessDown pid) -> do\n say $ printf \"Lost process %s\" (show pid)\n return $ (filter (pid /=) procs, s, ys)\n , match $ \\(ProcessUp pid) -> do\n say $ printf \"Got process %s\" (show pid)\n return $ ((pid:procs), s, ys)\n , match $ \\(Response y) -> do\n say $ printf \"Got response %d\" y\n return $ (procs, s, (y:ys))\n ]\n taskMaster' procs' s' ys'\n | otherwise = do\n say \"Send one request\"\n self <- getSelfPid\n send p $ Request self x\n taskMaster' (ps ++ [p]) xs ys\n\nnodeDetected :: NodeDetected -> Process ()\nnodeDetected (NodeDetected nodeId) = do\n say $ \"Detected node: \" ++ show nodeId\n _ <- monitorNode nodeId\n (newProc, _) <- spawnSupervised nodeId $(mkStaticClosure 'slaveProc)\n nsend \"taskmaster\" $ ProcessUp newProc\n say $ printf \"Create process %s at node %s\" (show newProc) (show nodeId)\n return () \n \nnodeMonitorNotification :: NodeMonitorNotification -> Process ()\nnodeMonitorNotification (NodeMonitorNotification _ nodeId reason) =\n say $ printf \"Node %s died because of %s\" (show nodeId) (show reason)\n \nprocessMonitorNotification :: ProcessMonitorNotification -> Process ()\nprocessMonitorNotification (ProcessMonitorNotification _ processId reason) =\n case reason of \n (DiedException _) -> do\n say $ printf \"Process %s crashed and will be restarted\" \n (show processId)\n nsend \"taskmaster\" $ ProcessDown processId\n (newProc, _) <- spawnSupervised (processNodeId processId)\n $(mkStaticClosure 'slaveProc)\n nsend \"taskmaster\" $ ProcessUp newProc \n _ -> do \n say $ printf \"Process %s died because of %s\" (show processId) \n (show reason)\n nsend \"taskmaster\" $ ProcessDown processId \n\nremotable []\n\nremoteTable :: (RemoteTable -> RemoteTable)\nremoteTable = __remoteTable\n\nrun :: Backend -> [NodeId] -> Process ()\nrun backend _ = do\n register \"taskmaster\" =<< getSelfPid\n _ <- spawnLocal supervisor\n _ <- spawnLocal (nodeDetector backend)\n taskMaster\n terminateAllSlaves backend \n ", "meta": {"content_hash": "d56e85bd7332c5f318ab49c02f74e654", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 80, "avg_line_length": 36.22727272727273, "alnum_prop": 0.5463344685427496, "repo_name": "SneakingCat/distributed-nonsense", "id": "4627ec6d9c405d33b6d28578ffb51d45c8add44d", "size": "5579", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Master/Master.hs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Haskell", "bytes": "7552"}]}} +{"text": "/*\t$NetBSD: l2cap_misc.c,v 1.7 2009/09/13 18:45:11 pooka Exp $\t*/\n\n/*-\n * Copyright (c) 2005 Iain Hibbert.\n * Copyright (c) 2006 Itronix Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of Itronix Inc. may not be used to endorse\n * or promote products derived from this software without specific\n * prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\n * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include <sys/cdefs.h>\n__KERNEL_RCSID(0, \"$NetBSD: l2cap_misc.c,v 1.7 2009/09/13 18:45:11 pooka Exp $\");\n\n#include <sys/param.h>\n#include <sys/kernel.h>\n#include <sys/mbuf.h>\n#include <sys/proc.h>\n#include <sys/queue.h>\n#include <sys/systm.h>\n\n#include <netbt/bluetooth.h>\n#include <netbt/hci.h>\n#include <netbt/l2cap.h>\n\nstruct l2cap_channel_list\n\tl2cap_active_list = LIST_HEAD_INITIALIZER(l2cap_active_list);\nstruct l2cap_channel_list\n\tl2cap_listen_list = LIST_HEAD_INITIALIZER(l2cap_listen_list);\n\nstruct pool l2cap_req_pool, l2cap_pdu_pool;\n\nconst l2cap_qos_t l2cap_default_qos = {\n\t0,\t\t\t/* flags */\n\tL2CAP_QOS_BEST_EFFORT,\t/* service type */\n\t0x00000000,\t\t/* token rate */\n\t0x00000000,\t\t/* token bucket size */\n\t0x00000000,\t\t/* peak bandwidth */\n\t0xffffffff,\t\t/* latency */\n\t0xffffffff\t\t/* delay variation */\n};\n\n/*\n * L2CAP request timeouts\n */\nint l2cap_response_timeout = 30;\t\t/* seconds */\nint l2cap_response_extended_timeout = 180;\t/* seconds */\n\nvoid\nl2cap_init(void)\n{\n\n\tpool_init(&l2cap_req_pool, sizeof(struct l2cap_req), 0, 0, 0,\n\t \"l2cap_req\", NULL, IPL_SOFTNET);\n\tpool_init(&l2cap_pdu_pool, sizeof(struct l2cap_pdu), 0, 0, 0,\n\t \"l2cap_pdu\", NULL, IPL_SOFTNET);\n}\n\n/*\n * Set Link Mode on channel\n */\nint\nl2cap_setmode(struct l2cap_channel *chan)\n{\n\n\tKASSERT(chan != NULL);\n\tKASSERT(chan->lc_link != NULL);\n\n\tDPRINTF(\"CID #%d, auth %s, encrypt %s, secure %s\\n\", chan->lc_lcid,\n\t\t(chan->lc_mode & L2CAP_LM_AUTH ? \"yes\" : \"no\"),\n\t\t(chan->lc_mode & L2CAP_LM_ENCRYPT ? \"yes\" : \"no\"),\n\t\t(chan->lc_mode & L2CAP_LM_SECURE ? \"yes\" : \"no\"));\n\n\tif (chan->lc_mode & L2CAP_LM_AUTH)\n\t\tchan->lc_link->hl_flags |= HCI_LINK_AUTH_REQ;\n\n\tif (chan->lc_mode & L2CAP_LM_ENCRYPT)\n\t\tchan->lc_link->hl_flags |= HCI_LINK_ENCRYPT_REQ;\n\n\tif (chan->lc_mode & L2CAP_LM_SECURE)\n\t\tchan->lc_link->hl_flags |= HCI_LINK_SECURE_REQ;\n\n\treturn hci_acl_setmode(chan->lc_link);\n}\n\n/*\n * Allocate a new Request structure & ID and set the timer going\n */\nint\nl2cap_request_alloc(struct l2cap_channel *chan, uint8_t code)\n{\n\tstruct hci_link *link = chan->lc_link;\n\tstruct l2cap_req *req;\n\tint next_id;\n\n\tif (link == NULL)\n\t\treturn ENETDOWN;\n\n\t/* find next ID (0 is not allowed) */\n\tnext_id = link->hl_lastid + 1;\n\tif (next_id > 0xff)\n\t\tnext_id = 1;\n\n\t/* Ouroboros check */\n\treq = TAILQ_FIRST(&link->hl_reqs);\n\tif (req && req->lr_id == next_id)\n\t\treturn ENFILE;\n\n\treq = pool_get(&l2cap_req_pool, PR_NOWAIT);\n\tif (req == NULL)\n\t\treturn ENOMEM;\n\n\treq->lr_id = link->hl_lastid = next_id;\n\n\treq->lr_code = code;\n\treq->lr_chan = chan;\n\treq->lr_link = link;\n\n\tcallout_init(&req->lr_rtx, 0);\n\tcallout_setfunc(&req->lr_rtx, l2cap_rtx, req);\n\tcallout_schedule(&req->lr_rtx, l2cap_response_timeout * hz);\n\n\tTAILQ_INSERT_TAIL(&link->hl_reqs, req, lr_next);\n\n\treturn 0;\n}\n\n/*\n * Find a running request for this link\n */\nstruct l2cap_req *\nl2cap_request_lookup(struct hci_link *link, uint8_t id)\n{\n\tstruct l2cap_req *req;\n\n\tTAILQ_FOREACH(req, &link->hl_reqs, lr_next) {\n\t\tif (req->lr_id == id)\n\t\t\treturn req;\n\t}\n\n\treturn NULL;\n}\n\n/*\n * Halt and free a request\n */\nvoid\nl2cap_request_free(struct l2cap_req *req)\n{\n\tstruct hci_link *link = req->lr_link;\n\n\tcallout_stop(&req->lr_rtx);\n\tif (callout_invoking(&req->lr_rtx))\n\t\treturn;\n\n\tcallout_destroy(&req->lr_rtx);\n\n\tTAILQ_REMOVE(&link->hl_reqs, req, lr_next);\n\tpool_put(&l2cap_req_pool, req);\n}\n\n/*\n * Response Timeout eXpired\n *\n * No response to our request, so deal with it as best we can.\n *\n * XXX should try again at least with ertx?\n */\nvoid\nl2cap_rtx(void *arg)\n{\n\tstruct l2cap_req *req = arg;\n\tstruct l2cap_channel *chan;\n\n\tmutex_enter(bt_lock);\n\tcallout_ack(&req->lr_rtx);\n\n\tchan = req->lr_chan;\n\tl2cap_request_free(req);\n\n\tDPRINTF(\"cid %d, ident %d\\n\", (chan ? chan->lc_lcid : 0), req->lr_id);\n\n\tif (chan && chan->lc_state != L2CAP_CLOSED)\n\t\tl2cap_close(chan, ETIMEDOUT);\n\n\tmutex_exit(bt_lock);\n}\n\n/*\n * Allocate next available CID to channel. We keep a single\n * ordered list of channels, so find the first gap.\n *\n * If this turns out to be not enough (!), could use a\n * list per HCI unit..\n */\nint\nl2cap_cid_alloc(struct l2cap_channel *chan)\n{\n\tstruct l2cap_channel *used, *prev = NULL;\n\tuint16_t cid = L2CAP_FIRST_CID;\n\n\tif (chan->lc_lcid != L2CAP_NULL_CID || chan->lc_state != L2CAP_CLOSED)\n\t\treturn EISCONN;\n\n\tLIST_FOREACH(used, &l2cap_active_list, lc_ncid) {\n\t\tif (used->lc_lcid > cid)\n\t\t\tbreak;\t/* found our gap */\n\n\t\tKASSERT(used->lc_lcid == cid);\n\t\tcid++;\n\n\t\tif (cid == L2CAP_LAST_CID)\n\t\t\treturn ENFILE;\n\n\t\tprev = used;\t/* for insert after */\n\t}\n\n\tchan->lc_lcid = cid;\n\n\tif (prev)\n\t\tLIST_INSERT_AFTER(prev, chan, lc_ncid);\n\telse\n\t\tLIST_INSERT_HEAD(&l2cap_active_list, chan, lc_ncid);\n\n\treturn 0;\n}\n\n/*\n * Find channel with CID\n */\nstruct l2cap_channel *\nl2cap_cid_lookup(uint16_t cid)\n{\n\tstruct l2cap_channel *chan;\n\n\tLIST_FOREACH(chan, &l2cap_active_list, lc_ncid) {\n\t\tif (chan->lc_lcid == cid)\n\t\t\treturn chan;\n\n\t\tif (chan->lc_lcid > cid)\n\t\t\treturn NULL;\n\t}\n\n\treturn NULL;\n}\n", "meta": {"content_hash": "59a5d3906d6796873cda8627d879c63e", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 81, "avg_line_length": 24.43609022556391, "alnum_prop": 0.6741538461538461, "repo_name": "execunix/vinos", "id": "2bcf64614cb4fe7cdf32f2177ba4f1c096e40736", "size": "6500", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "sys/netbt/l2cap_misc.c", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "Playing around with resource based routing in MVC 6/ASP.NET 5\n", "meta": {"content_hash": "d06e0e89344211338b0c92eb90bababf", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 61, "avg_line_length": 62.0, "alnum_prop": 0.8064516129032258, "repo_name": "yishaigalatzer/ResourceController", "id": "fd7c0d6c399934aba1457513680cb4073977d8b5", "size": "83", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C#", "bytes": "8511"}]}} +{"text": "<?php\n\nnamespace app;\n\nrequire_once __DIR__ . '/../composer_modules/autoload.php';\n\nclass ClasseTwigExtension extends \\Slim\\Views\\TwigExtension {\n\n public function getName() {\n return 'classe-twig-extension';\n }\n\n public function getFilters() {\n return array(\n new \\Twig_SimpleFilter('md5', 'md5_file'),\n );\n }\n\n}\n\n//EOF", "meta": {"content_hash": "ae9137c15f5838b42bb28e4a8767cac1", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 61, "avg_line_length": 17.333333333333332, "alnum_prop": 0.6071428571428571, "repo_name": "GregDesplaces/classe-1914", "id": "9f0d483649436e9a04a8b54df1b36cca46f68615", "size": "364", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/filters.php", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "312"}, {"name": "CSS", "bytes": "162196"}, {"name": "CoffeeScript", "bytes": "288644"}, {"name": "HTML", "bytes": "54170"}, {"name": "JavaScript", "bytes": "12279"}, {"name": "Makefile", "bytes": "108"}, {"name": "PHP", "bytes": "44160"}]}} +{"text": "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% RESULTS\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n%%%%%%%%%%%%%%%%%%% \n% FraCaS INTRO\n%%%%%%%%%%%%%%%%%%%\n\\begin{frame}{Experiments}\n\\hh{FraCaS Textual Entailment Suite:}\n\\begin{itemize}\n \\item Used in MacCartney and Manning (2007; 2008).\n \\item RTE-style problems: is the hypothesis entailed from the premise? \\\\\n \\vspace{0.1cm}\n P: At least three commissioners spend a lot of time at home. \\\\\n H: \\true{At least three commissioners spend time at home.} \\\\\n \\vspace{0.1cm}\n P: At most ten commissioners spend a lot of time at home. \\\\\n H: \\false{At most ten commissioners spend time at home.}\n \\vspace{0.1cm}\n \\item 9 focused sections; 3 in scope for this work.\n\\end{itemize}\n\\vspace{0.5cm}\n\\pause\n\n\\hh{\\textbf{Not} a blind test set!}\n\\begin{itemize}\n \\item ``Can we make deep inferences without knowing the premise \\textit{a priori}?''\n\\end{itemize}\n\\end{frame}\n\n%%%%%%%%%%%%%%%%%%% \n% FraCaS RESULTS\n%%%%%%%%%%%%%%%%%%%\n\\def\\a#1{#1}\n\\def\\b#1{\\textbf{#1}}\n\\begin{frame}{FraCaS Results}\n\n\\hh{Systems}\n\\begin{itemize}\n\\item[] \\textbf{M07}: MacCartney and Manning (2007)\n\\item[] \\textbf{M08}: MacCartney and Manning (2008)\n \\begin{itemize}\n \\item \\textit{Classify} entailment after aligning premise and hypothesis.\n \\end{itemize}\n\\item[] \\darkblue{\\textbf{N}: NaturalLI (this work)}\n \\begin{itemize}\n \\item \\textit{Search} blindly from hypothesis for the premise.\n \\end{itemize}\n\\end{itemize}\n\\pause\n\n\\begin{center}\n \\begin{tabular}{llccc}\n \\hline\n $\\mathsection$ & Category & \\multicolumn{3}{c}{Accuracy} \\\\\n & & M07 & M08 & \\darkblue{N} \\\\\n \\hline\n % Pme P07 Rme R08 Ame A07 A08\n \\a{1} & \\a{Quantifiers} & \\a{84} & \\a{97} & \\a{\\darkblue{95}} \\\\\n \\a{5} & \\a{Adjectives} & \\a{60} & \\a{80} & \\a{\\darkblue{73}} \\\\\n \\a{6} & \\a{Comparatives} & \\a{69} & \\a{81} & \\a{\\darkblue{87}} \\pause \\\\\n \\hline\n \\multicolumn{2}{l}{\\b{Applicable (1,5,6)}}\n & \\b{76} & \\b{90} & \\b{\\darkblue{89}} \\\\\n \\hline\n \\end{tabular}\n\\end{center}\n\\end{frame}\n\n%%%%%%%%%%%%%%%%%%% \n% ConceptNet INTRO\n%%%%%%%%%%%%%%%%%%%\n\\begin{frame}{Experiments}\n\\hh{ConceptNet:}\n\\begin{itemize}\n \\item A semi-curated collection of common-sense facts. \\\\\n \\vspace{0.1cm}\n \\true{not all birds can fly} \\\\\n \\true{noses are used to smell} \\\\\n \\true{nobody wants to die} \\\\\n \\true{music is used for pleasure}\n \\vspace{0.1cm}\n \\item Negatives: ReVerb extractions marked false by Turkers.\n \\item Small (1378 train / 1080 test), but fairly broad coverage.\n\\end{itemize}\n\\vspace{0.5cm}\n\\pause\n\n\\hh{Our Knowledge Base:}\n\\begin{itemize}\n \\item 270 million lemmatized Ollie extractions.\n\\end{itemize}\n\\end{frame}\n \n%%%%%%%%%%%%%%%%%%% \n% ConceptNet RESULTS\n%%%%%%%%%%%%%%%%%%%\n\\begin{frame}{ConceptNet Results}\n\\hh{Systems}\n\\begin{itemize}\n \\item[] \\textbf{Direct Lookup}: Lookup by lemmas.\n \\item[] \\textbf{NaturalLI}: Our system.\n \\pause\n \\item[] \\textbf{NaturalLI Only}: Use only inference (prohibit exact matches).\n\\end{itemize}\n\\pause\n\n\\begin{center}\n \\begin{tabular}{lcc}\n System & P & R \\\\\n \\hline\n Direct Lookup & 100.0 & \\textbf<5-5>{12.1} \\\\\n \\pause\n NaturalLI Only & 88.8 & 40.1 \\\\\n NaturalLI & 90.6 & \\textbf<5-5>{49.1} \\\\\n \\end{tabular}\n\\end{center}\n\\pause\n\n\\begin{itemize}\n \\item 4x improvement in recall.\n\\end{itemize}\n\\end{frame}\n", "meta": {"content_hash": "06c982b263a8896ae700084537904a35", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 87, "avg_line_length": 29.056910569105693, "alnum_prop": 0.5707890318970341, "repo_name": "gangeli/NaturalLI", "id": "d1a75d8985a5e43abb7b3b4565578fe4da7c61e4", "size": "3574", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pub/emnlp2014/talk/results.tex", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "183643"}, {"name": "C++", "bytes": "1713021"}, {"name": "Gnuplot", "bytes": "38536"}, {"name": "HTML", "bytes": "16689"}, {"name": "Java", "bytes": "286686"}, {"name": "JavaScript", "bytes": "21399"}, {"name": "M4", "bytes": "21276"}, {"name": "Makefile", "bytes": "25489"}, {"name": "Python", "bytes": "74592"}, {"name": "Roff", "bytes": "2511"}, {"name": "Ruby", "bytes": "21826"}, {"name": "Shell", "bytes": "95934"}, {"name": "TeX", "bytes": "1160929"}]}} +{"text": "This application makes use of the following third party libraries:\n\n## Realm\n\nTABLE OF CONTENTS\n\n1. Apache License version 2.0\n2. Realm Components\n3. Export Compliance\n\n-------------------------------------------------------------------------------\n\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\nREALM COMPONENTS\n\nThis software contains components with separate copyright and license terms.\nYour use of these components is subject to the terms and conditions of the\nfollowing licenses.\n\nFor the Realm Core component\n\n Realm Core Binary License\n\n Copyright (c) 2011-2016 Realm Inc All rights reserved\n\n Redistribution and use in binary form, with or without modification, is\n permitted provided that the following conditions are met:\n\n 1. You agree not to attempt to decompile, disassemble, reverse engineer or\n otherwise discover the source code from which the binary code was derived.\n You may, however, access and obtain a separate license for most of the\n source code from which this Software was created, at\n http://realm.io/pricing/.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from this\n software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n\nEXPORT COMPLIANCE\n\nYou understand that the Software may contain cryptographic functions that may be\nsubject to export restrictions, and you represent and warrant that you are not\n(i) located in a jurisdiction that is subject to United States economic\nsanctions (\u201cProhibited Jurisdiction\u201d), including Cuba, Iran, North Korea,\nSudan, Syria or the Crimea region, (ii) a person listed on any U.S. government\nblacklist (to include the List of Specially Designated Nationals and Blocked\nPersons or the Consolidated Sanctions List administered by the U.S. Department\nof the Treasury\u2019s Office of Foreign Assets Control, or the Denied Persons List\nor Entity List administered by the U.S. Department of Commerce)\n(\u201cSanctioned Person\u201d), or (iii) controlled or 50% or more owned by a Sanctioned\nPerson.\n\nYou agree to comply with all export, re-export and import restrictions and\nregulations of the U.S. Department of Commerce or other agency or authority of\nthe United States or other applicable countries. You also agree not to transfer,\nor authorize the transfer of, directly or indirectly, of the Software to any\nProhibited Jurisdiction, or otherwise in violation of any such restrictions or\nregulations.\n\nGenerated by CocoaPods - http://cocoapods.org\n", "meta": {"content_hash": "0bf1fa83a71fe3ba1955ef75d0808808", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 80, "avg_line_length": 54.312, "alnum_prop": 0.742966563558698, "repo_name": "sajeel/GoEuro", "id": "d3e3e4256c24d8df3a6139db577b4a0ca49c3fd0", "size": "13607", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "GoEuro/Pods/Target Support Files/Pods-GoEuroTests/Pods-GoEuroTests-acknowledgements.markdown", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "69850"}, {"name": "C++", "bytes": "2450416"}, {"name": "DTrace", "bytes": "412"}, {"name": "Objective-C", "bytes": "1418779"}, {"name": "Objective-C++", "bytes": "413147"}, {"name": "Ruby", "bytes": "385"}, {"name": "Shell", "bytes": "63363"}, {"name": "Swift", "bytes": "7664"}]}} +{"text": "class hsfcStatistic {\n\npublic:\n\thsfcStatistic(void);\n\t~hsfcStatistic(void);\n\n\tvoid Initialise();\n\tvoid AddObservation(double Value);\n\tdouble Average();\n\tdouble StdDev();\n\n\tdouble Count;\n\tdouble Sum;\n\tdouble Sum2;\n\nprotected:\n\nprivate:\n\n};\n\n//=============================================================================\n// CLASS: hsfcLexicon\n//=============================================================================\nclass hsfcLexicon {\n\npublic:\n\thsfcLexicon(void);\n\t~hsfcLexicon(void);\n\n\tvoid Initialise(hsfcParameters* Parameters);\n\tunsigned int Index(const char* Value);\n\tunsigned int RelationIndex(const char* Value, bool Add);\n\tunsigned int RelationIndex(unsigned int NameID);\n\tunsigned int GDLIndex(unsigned int ID);\n\tunsigned int NewRigidNameID(int Arity);\n\tvoid Parse(const char* Text, vector<hsfcTuple>& Reference);\n\tbool Match(unsigned int ID, const char* Text);\n\tbool PartialMatch(unsigned int ID, const char* Text);\n\tbool MatchText(unsigned int ID, const char* Text);\n\tbool IsVariable(unsigned int ID);\n\tbool IsUsed(const char* Letter, bool IgnoreComments);\n\tconst char* Text(unsigned int ID);\n\tchar* Copy(unsigned int ID, bool WithArity);\n\tconst char* Relation(unsigned int ID);\n\tunsigned int Size();\n\tunsigned int TrueFrom(unsigned int RelationIndex);\n\tunsigned int NextFrom(unsigned int RelationIndex);\n\tunsigned int InitFrom(unsigned int RelationIndex);\n\tvoid Print();\n\n\thsfcIO* IO;\n\nprotected:\n\nprivate:\n\tunsigned int AddTerm(const char* Value);\n\tunsigned int AddName(const char* Value);\n\n\tvector<string> Term;\n\tvector<unsigned int> TermIndex;\n\tvector<string> RelationName;\n\tvector<unsigned int> RelationNameID;\n\tvector<bool> RelationIsRigid;\n\tint UniqueNum;\n\n};\n\n", "meta": {"content_hash": "f76c3831d0f5e8da2cfd1fe190a183c9", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 79, "avg_line_length": 24.794117647058822, "alnum_prop": 0.6856465005931198, "repo_name": "AbdallahS/ggp-hsfc", "id": "f2e6d3b12859af4daf38d563a1b8de95d3a467e3", "size": "2297", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libhsfc/src/hsfcLexicon.h", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "C", "bytes": "25158"}, {"name": "C++", "bytes": "629133"}, {"name": "CMake", "bytes": "3754"}, {"name": "Makefile", "bytes": "466"}, {"name": "Objective-C", "bytes": "309"}, {"name": "Python", "bytes": "25958"}, {"name": "Shell", "bytes": "1139"}]}} +{"text": "/* vim: set ts=2 et sw=2 tw=80: */\n/* Any copyright is dedicated to the Public Domain.\n http://creativecommons.org/publicdomain/zero/1.0/ */\n\nlet tempScope = {};\nCu.import(\"resource:///modules/devtools/CssRuleView.jsm\", tempScope);\nlet CssRuleView = tempScope.CssRuleView;\nlet _ElementStyle = tempScope._ElementStyle;\nlet _editableField = tempScope._editableField;\nlet inplaceEditor = tempScope._getInplaceEditorForSpan;\n\nlet doc;\nlet ruleDialog;\nlet ruleView;\n\nvar gRuleViewChanged = false;\nfunction ruleViewChanged()\n{\n gRuleViewChanged = true;\n}\n\nfunction expectChange()\n{\n ok(gRuleViewChanged, \"Rule view should have fired a change event.\");\n gRuleViewChanged = false;\n}\n\nfunction startTest()\n{\n let style = '' +\n '#testid {' +\n ' background-color: blue;' +\n '} ' +\n '.testclass {' +\n ' background-color: green;' +\n '}';\n\n let styleNode = addStyle(doc, style);\n doc.body.innerHTML = '<div id=\"testid\" class=\"testclass\">Styled Node</div>';\n let testElement = doc.getElementById(\"testid\");\n\n ruleDialog = openDialog(\"chrome://browser/content/devtools/cssruleview.xul\",\n \"cssruleviewtest\",\n \"width=200,height=350\");\n ruleDialog.addEventListener(\"load\", function onLoad(evt) {\n ruleDialog.removeEventListener(\"load\", onLoad, true);\n let doc = ruleDialog.document;\n ruleView = new CssRuleView(doc);\n doc.documentElement.appendChild(ruleView.element);\n ruleView.element.addEventListener(\"CssRuleViewChanged\", ruleViewChanged, false);\n ruleView.highlight(testElement);\n waitForFocus(testCancelNew, ruleDialog);\n }, true);\n}\n\nfunction testCancelNew()\n{\n // Start at the beginning: start to add a rule to the element's style\n // declaration, but leave it empty.\n\n let elementRuleEditor = ruleView.element.children[0]._ruleEditor;\n waitForEditorFocus(elementRuleEditor.element, function onNewElement(aEditor) {\n is(inplaceEditor(elementRuleEditor.newPropSpan), aEditor, \"Next focused editor should be the new property editor.\");\n let input = aEditor.input;\n waitForEditorBlur(aEditor, function () {\n ok(!gRuleViewChanged, \"Shouldn't get a change event after a cancel.\");\n is(elementRuleEditor.rule.textProps.length, 0, \"Should have canceled creating a new text property.\");\n ok(!elementRuleEditor.propertyList.hasChildNodes(), \"Should not have any properties.\");\n testCreateNew();\n });\n aEditor.input.blur();\n });\n\n EventUtils.synthesizeMouse(elementRuleEditor.closeBrace, 1, 1,\n { },\n ruleDialog);\n}\n\nfunction testCreateNew()\n{\n // Create a new property.\n let elementRuleEditor = ruleView.element.children[0]._ruleEditor;\n waitForEditorFocus(elementRuleEditor.element, function onNewElement(aEditor) {\n is(inplaceEditor(elementRuleEditor.newPropSpan), aEditor, \"Next focused editor should be the new property editor.\");\n let input = aEditor.input;\n input.value = \"background-color\";\n\n waitForEditorFocus(elementRuleEditor.element, function onNewValue(aEditor) {\n expectChange();\n is(elementRuleEditor.rule.textProps.length, 1, \"Should have created a new text property.\");\n is(elementRuleEditor.propertyList.children.length, 1, \"Should have created a property editor.\");\n let textProp = elementRuleEditor.rule.textProps[0];\n is(aEditor, inplaceEditor(textProp.editor.valueSpan), \"Should be editing the value span now.\");\n aEditor.input.value = \"#XYZ\";\n waitForEditorBlur(aEditor, function() {\n expectChange();\n is(textProp.value, \"#XYZ\", \"Text prop should have been changed.\");\n is(textProp.editor._validate(), false, \"#XYZ should not be a valid entry\");\n testEditProperty();\n });\n aEditor.input.blur();\n });\n EventUtils.synthesizeKey(\"VK_RETURN\", {}, ruleDialog);\n });\n\n EventUtils.synthesizeMouse(elementRuleEditor.closeBrace, 1, 1,\n { },\n ruleDialog);\n}\n\nfunction testEditProperty()\n{\n let idRuleEditor = ruleView.element.children[1]._ruleEditor;\n let propEditor = idRuleEditor.rule.textProps[0].editor;\n waitForEditorFocus(propEditor.element, function onNewElement(aEditor) {\n is(inplaceEditor(propEditor.nameSpan), aEditor, \"Next focused editor should be the name editor.\");\n let input = aEditor.input;\n waitForEditorFocus(propEditor.element, function onNewName(aEditor) {\n expectChange();\n input = aEditor.input;\n is(inplaceEditor(propEditor.valueSpan), aEditor, \"Focus should have moved to the value.\");\n\n waitForEditorBlur(aEditor, function() {\n expectChange();\n let value = idRuleEditor.rule.style.getPropertyValue(\"border-color\");\n is(value, \"red\", \"border-color should have been set.\");\n is(propEditor._validate(), true, \"red should be a valid entry\");\n finishTest();\n });\n\n for each (let ch in \"red;\") {\n EventUtils.sendChar(ch, ruleDialog);\n }\n });\n for each (let ch in \"border-color:\") {\n EventUtils.sendChar(ch, ruleDialog);\n }\n });\n\n EventUtils.synthesizeMouse(propEditor.nameSpan, 1, 1,\n { },\n ruleDialog);}\n\nfunction finishTest()\n{\n ruleView.element.removeEventListener(\"CssRuleViewChanged\", ruleViewChanged, false);\n ruleView.clear();\n ruleDialog.close();\n ruleDialog = ruleView = null;\n doc = null;\n gBrowser.removeCurrentTab();\n finish();\n}\n\nfunction test()\n{\n waitForExplicitFinish();\n gBrowser.selectedTab = gBrowser.addTab();\n gBrowser.selectedBrowser.addEventListener(\"load\", function changedValues_load(evt) {\n gBrowser.selectedBrowser.removeEventListener(evt.type, changedValues_load, true);\n doc = content.document;\n waitForFocus(startTest, content);\n }, true);\n\n content.location = \"data:text/html,test rule view user changes\";\n}\n", "meta": {"content_hash": "20651aec6bed0faf331c62345a9962a1", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 120, "avg_line_length": 35.475903614457835, "alnum_prop": 0.6809305484802174, "repo_name": "sergecodd/FireFox-OS", "id": "aed4c6dd886c1dd6f96469613f8abad8c2e31a1c", "size": "5889", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "B2G/gecko/browser/devtools/styleinspector/test/browser_ruleview_editor_changedvalues.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Ada", "bytes": "443"}, {"name": "ApacheConf", "bytes": "85"}, {"name": "Assembly", "bytes": "5123438"}, {"name": "Awk", "bytes": "46481"}, {"name": "Batchfile", "bytes": "56250"}, {"name": "C", "bytes": "101720951"}, {"name": "C#", "bytes": "38531"}, {"name": "C++", "bytes": "148896543"}, {"name": "CMake", "bytes": "23541"}, {"name": "CSS", "bytes": "2758664"}, {"name": "DIGITAL Command Language", "bytes": "56757"}, {"name": "Emacs Lisp", "bytes": "12694"}, {"name": "Erlang", "bytes": "889"}, {"name": "FLUX", "bytes": "34449"}, {"name": "GLSL", "bytes": "26344"}, {"name": "Gnuplot", "bytes": "710"}, {"name": "Groff", "bytes": "447012"}, {"name": "HTML", "bytes": "43343468"}, {"name": "IDL", "bytes": "1455122"}, {"name": "Java", "bytes": "43261012"}, {"name": "JavaScript", "bytes": "46646658"}, {"name": "Lex", "bytes": "38358"}, {"name": "Logos", "bytes": "21054"}, {"name": "Makefile", "bytes": "2733844"}, {"name": "Matlab", "bytes": "67316"}, {"name": "Max", "bytes": "3698"}, {"name": "NSIS", "bytes": "421625"}, {"name": "Objective-C", "bytes": "877657"}, {"name": "Objective-C++", "bytes": "737713"}, {"name": "PHP", "bytes": "17415"}, {"name": "Pascal", "bytes": "6780"}, {"name": "Perl", "bytes": "1153180"}, {"name": "Perl6", "bytes": "1255"}, {"name": "PostScript", "bytes": "1139"}, {"name": "PowerShell", "bytes": "8252"}, {"name": "Protocol Buffer", "bytes": "26553"}, {"name": "Python", "bytes": "8453201"}, {"name": "Ragel in Ruby Host", "bytes": "3481"}, {"name": "Ruby", "bytes": "5116"}, {"name": "Scilab", "bytes": "7"}, {"name": "Shell", "bytes": "3383832"}, {"name": "SourcePawn", "bytes": "23661"}, {"name": "TeX", "bytes": "879606"}, {"name": "WebIDL", "bytes": "1902"}, {"name": "XSLT", "bytes": "13134"}, {"name": "Yacc", "bytes": "112744"}]}} +{"text": "<!DOCTYPE html>\n<html>\n<head>\n\t<meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n \t<title>FST - Gabe Kling</title>\n\n \n <meta name=\"description\" content=\"Keep track of the statistics from Gabe Kling. Average heat score, heat wins, heat wins percentage, epic heats road to the final\">\n\n \n\n <meta name=\"author\" content=\"\">\n <link rel=\"apple-touch-icon\" sizes=\"57x57\" href=\"/favicon/apple-icon-57x57.png\">\n <link rel=\"apple-touch-icon\" sizes=\"60x60\" href=\"/favicon/apple-icon-60x60.png\">\n <link rel=\"apple-touch-icon\" sizes=\"72x72\" href=\"/favicon/apple-icon-72x72.png\">\n <link rel=\"apple-touch-icon\" sizes=\"76x76\" href=\"/favicon/apple-icon-76x76.png\">\n <link rel=\"apple-touch-icon\" sizes=\"114x114\" href=\"/favicon/apple-icon-114x114.png\">\n <link rel=\"apple-touch-icon\" sizes=\"120x120\" href=\"/favicon/apple-icon-120x120.png\">\n <link rel=\"apple-touch-icon\" sizes=\"144x144\" href=\"/favicon/apple-icon-144x144.png\">\n <link rel=\"apple-touch-icon\" sizes=\"152x152\" href=\"/favicon/apple-icon-152x152.png\">\n <link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/favicon/apple-icon-180x180.png\">\n <link rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/favicon/android-icon-192x192.png\">\n <link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicon/favicon-32x32.png\">\n <link rel=\"icon\" type=\"image/png\" sizes=\"96x96\" href=\"/favicon/favicon-96x96.png\">\n <link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicon/favicon-16x16.png\">\n\n <link rel=\"manifest\" href=\"/manifest.json\">\n <meta name=\"msapplication-TileColor\" content=\"#ffffff\">\n <meta name=\"msapplication-TileImage\" content=\"/ms-icon-144x144.png\">\n <meta name=\"theme-color\" content=\"#ffffff\">\n \n \n\n <meta property=\"og:title\" content=\"Fantasy Surfing tips\"/>\n <meta property=\"og:image\" content=\"https://fantasysurfingtips.com/img/just_waves.png\"/>\n \t <meta property=\"og:description\" content=\"See how great Gabe Kling is surfing this year\"/>\n\n\n \n\n <!-- Bootstrap Core CSS - Uses Bootswatch Flatly Theme: https://bootswatch.com/flatly/ -->\n <link href=\"https://fantasysurfingtips.com/css/bootstrap.css\" rel=\"stylesheet\">\n\n <!-- Custom CSS -->\n <link href=\"https://fantasysurfingtips.com/css/freelancer.css\" rel=\"stylesheet\">\n <link href=\"https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css\" rel=\"stylesheet\" />\n\n\n <!-- Custom Fonts -->\n <link href=\"https://fantasysurfingtips.com/font-awesome/css/font-awesome.min.css\" rel=\"stylesheet\" type=\"text/css\">\n <link href=\"https://fonts.googleapis.com/css?family=Montserrat:400,700\" rel=\"stylesheet\" type=\"text/css\">\n <link href=\"https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic\" rel=\"stylesheet\" type=\"text/css\">\n\n\n \n \n \t<link rel=\"stylesheet\" href=\"//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css\">\n\t\n <script src=\"https://code.jquery.com/jquery-2.x-git.min.js\"></script>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery-ujs/1.2.1/rails.min.js\"></script>\n \n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js\"></script>\n\t<script src=\"https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js\"></script>\n\n <script src=\"https://www.w3schools.com/lib/w3data.js\"></script>\n\n <script async src=\"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"></script>\n <script>\n (adsbygoogle = window.adsbygoogle || []).push({\n google_ad_client: \"ca-pub-2675412311042802\",\n enable_page_level_ads: true\n });\n </script>\n</head>\n<body>\n <div id=\"fb-root\"></div>\n <script>(function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.6\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));</script>\n\t<!-- Navigation -->\n <div w3-include-html=\"https://fantasysurfingtips.com/layout/header.html\"></div>\n \n <!-- Header -->\n<div w3-include-html=\"https://fantasysurfingtips.com/layout/sponsor.html\"></div> \n\n<section >\n <div class=\"container\">\n \t<div class=\"row\">\n \t\t<div class=\"col-sm-3 \">\n \t\t\t<div class=\"col-sm-2 \">\n \t\t\t</div>\n \t\t\t<div class=\"col-sm-8 \">\n\t <!-- <img src=\"http://fantasysurfingtips.com/img/surfers/gkli.png\" class=\"img-responsive\" alt=\"\"> -->\n\t <h3 style=\"text-align:center;\">Gabe Kling</h3>\n\n\t <a href=\"https://twitter.com/share\" class=\"\" data-via=\"fansurfingtips\"><i class=\"fa fa-twitter\"></i> Share on Twitter</i></a> <br/>\n\t \n\t\t\t\t\t<a class=\"fb-xfbml-parse-ignore\" target=\"_blank\" href=\"https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Ffantasysurfingtips.com%2Fsurfers%2Fgkli&src=sdkpreparse\"><i class=\"fa fa-facebook\"></i> Share on Facebook</a>\n\t \n </div>\n <div class=\"col-sm-2 \">\n \t\t\t</div>\n </div>\n <div class=\"col-sm-3 portfolio-item\">\n </div>\n <div class=\"col-sm-3 portfolio-item\">\n \t<h6 style=\"text-align:center;\">Avg Heat Score (FST DATA)</h6>\n <h1 style=\"text-align:center;\">12.0</h1>\n </div>\n \t</div>\n \t\n\n\t \t\t<h4 style=\"text-align:center;\" >Epic Battles</h4>\n\t \t\t<div class=\"row\">\n\t \t\t\t<div class=\"col-sm-6 \">\n\t\t <p style=\"text-align:center;\">Surfed <b>1</b> heats against <a href=\"http://fantasysurfingtips.com/surfers/mqs/ksch.html\"> Kevin Schulz</a> <br/> <b>won 1</b> and <b>lost 0</b></p>\n\t\t \n\t </div>\n\t <div class=\"col-sm-6 \">\n\t\t <p style=\"text-align:center;\">Surfed <b>4</b> heats against <a href=\"http://fantasysurfingtips.com/surfers/mqs/egat.html\"> Elijah Gates</a> <br/> <b>won 0</b> and <b>lost 4</b></p>\n\t </div>\n\t\t \t</div>\n\n \t<hr/>\n \t<h4 style=\"text-align:center;\" >Heat Stats (FST data)</h4>\n \t<div class=\"row\">\n \t\t<div class=\"col-sm-4 portfolio-item\">\n \t<h6 style=\"text-align:center;\">Heats</h6>\n <h2 style=\"text-align:center;\">52</h2>\n </div>\n <div class=\"col-sm-4 portfolio-item\">\n \t<h6 style=\"text-align:center;\">Heat wins</h6>\n <h2 style=\"text-align:center;\">3</h2>\n </div>\n <div class=\"col-sm-4 portfolio-item\">\n \t<h6 style=\"text-align:center;\">HEAT WINS PERCENTAGE</h6>\n <h2 style=\"text-align:center;\">5.77%</h2>\n </div>\n \t</div>\n \t\n\n \t<hr/>\n\t\t<h4 style=\"text-align:center;\">Avg Heat Score progression</h4>\n\t\t<div id=\"avg_chart\" style=\"height: 250px;\"></div>\n\t\t<hr/>\n\n\t\t<h4 style=\"text-align:center;\">Heat stats progression</h4>\n\t\t<div id=\"heat_chart\" style=\"height: 250px;\"></div>\n \t<hr/>\n\n\n \t<style type=\"text/css\">\n \t\t.heats-all{\n \t\t\tz-index: 3;\n \t\t\tmargin-left: 5px;\n \t\t\tcursor: pointer;\n \t\t}\n \t</style>\n\t \t\t\n\n\t<div class=\"container\">\n\t\t\n\t\t<div id=\"disqus_thread\"></div>\n\t\t<script>\n\n\t\t/**\n\t\t* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.\n\t\t* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/\n\t\t\n\t\tvar disqus_config = function () {\n\t\tthis.page.url = \"http://fantasysurfingtips.com/surfers/gkli\"; // Replace PAGE_URL with your page's canonical URL variable\n\t\tthis.page.identifier = '1233'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable\n\t\t};\n\t\t\n\t\t(function() { // DON'T EDIT BELOW THIS LINE\n\t\tvar d = document, s = d.createElement('script');\n\t\ts.src = '//fantasysurfingtips.disqus.com/embed.js';\n\t\ts.setAttribute('data-timestamp', +new Date());\n\t\t(d.head || d.body).appendChild(s);\n\t\t})();\n\t\t</script>\n\t\t<noscript>Please enable JavaScript to view the <a href=\"https://disqus.com/?ref_noscript\">comments powered by Disqus.</a></noscript>\n\t</div>\n\t\n</section>\n\n<script type=\"text/javascript\">\n\t$('.heats-all').click(function(){\n\t\t\n\t\t$('.heats-all-stat').css('display', 'none')\n\n\t\t$('#'+$(this).attr('id')+'-stat').css('display', 'block')\n\n\t});\n\n\t$('.heats-2016').click(function(){\n\t\t$('.heats-2016-stat').css('display', 'none')\n\n\t\t$('#'+$(this).attr('id')+'-stat').css('display', 'block')\n\n\t});\n\n\t$('document').ready(function(){\n\t\tnew Morris.Line({\n\t\t // ID of the element in which to draw the chart.\n\t\t element: 'avg_chart',\n\t\t // Chart data records -- each entry in this array corresponds to a point on\n\t\t // the chart.\n\t\t data: [],\n\n\t\t // The name of the data record attribute that contains x-values.\n\t\t xkey: 'year',\n\t\t // A list of names of data record attributes that contain y-values.\n\t\t ykeys: ['avg', 'avg_all'],\n\t\t // Labels for the ykeys -- will be displayed when you hover over the\n\t\t // chart.\n\t\t labels: ['Avg score in year', 'Avg score FST DATA']\n\t\t});\n\n\t\tnew Morris.Bar({\n\t\t // ID of the element in which to draw the chart.\n\t\t element: 'heat_chart',\n\t\t // Chart data records -- each entry in this array corresponds to a point on\n\t\t // the chart.\n\t\t data: [],\n\n\t\t // The name of the data record attribute that contains x-values.\n\t\t xkey: 'year',\n\t\t // A list of names of data record attributes that contain y-values.\n\t\t ykeys: ['heats', 'wins', 'percs'],\n\t\t // Labels for the ykeys -- will be displayed when you hover over the\n\t\t // chart.\n\t\t labels: ['Heats surfed', 'Heats won', 'Winning percentage']\n\t\t});\n\t});\n</script>\n<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>\n\n\n\n <!-- Footer -->\n <div w3-include-html=\"https://fantasysurfingtips.com/layout/footer.html\"></div>\n\n \n <script type=\"text/javascript\">\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n ga('create', 'UA-74337819-1', 'auto'); // Replace with your property ID.\n ga('send', 'pageview');\n </script>\n\n <script>\n w3IncludeHTML();\n </script>\n <!-- jQuery -->\n <script src=\"https://fantasysurfingtips.com/js/jquery.js\"></script>\n <script src=\"https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js\"></script>\n\n <!-- Bootstrap Core JavaScript -->\n <script src=\"https://fantasysurfingtips.com/js/bootstrap.min.js\"></script>\n\n <!-- Plugin JavaScript -->\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js\"></script>\n\n\n\n <script src=\"https://fantasysurfingtips.com/js/classie.js\"></script>\n <script src=\"https://fantasysurfingtips.com/js/cbpAnimatedHeader.js\"></script>\n\n <!-- Contact Form JavaScript -->\n <script src=\"https://fantasysurfingtips.com/js/jqBootstrapValidation.js\"></script>\n <script src=\"https://fantasysurfingtips.com/js/contact_me.js\"></script>\n\n <!-- Custom Theme JavaScript -->\n <script src=\"https://fantasysurfingtips.com/js/freelancer.js\"></script>\n\n <script type=\"https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js\"></script>\n <script type=\"https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js\"></script>\n\n\n\n\n</body>\n</html>\n", "meta": {"content_hash": "43c8a11dfb3300514647e6a5723fb092", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 295, "avg_line_length": 40.1156462585034, "alnum_prop": 0.6247244361539765, "repo_name": "chicofilho/fst", "id": "0a4eef9465221007571ce993b25e2e1f400d3b75", "size": "11794", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "surfers/mqs/gkli.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "25157"}, {"name": "HTML", "bytes": "114679577"}, {"name": "JavaScript", "bytes": "43263"}, {"name": "PHP", "bytes": "1097"}]}} +{"text": "package org.ovirt.mobile.movirt.rest.dto.v4;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\n\nimport org.ovirt.mobile.movirt.model.enums.SnapshotType;\n\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class Snapshot extends org.ovirt.mobile.movirt.rest.dto.Snapshot {\n public SnapshotVm vm;\n public String snapshot_type;\n\n public Snapshot() {\n }\n\n public Snapshot(String description, boolean persistMemoryState) {\n super(description, persistMemoryState);\n }\n\n public org.ovirt.mobile.movirt.model.Snapshot toEntity(String accountId) {\n org.ovirt.mobile.movirt.model.Snapshot snapshot = super.toEntity(accountId);\n snapshot.setType(SnapshotType.fromString(snapshot_type));\n\n if (vm != null) {\n vm.snapshotId = snapshot.getId();\n snapshot.setVm(vm.toEntity(accountId));\n }\n\n return snapshot;\n }\n}\n", "meta": {"content_hash": "22d7892177c4f5d5a5bd16cecf2c4edb", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 84, "avg_line_length": 30.0, "alnum_prop": 0.7066666666666667, "repo_name": "matobet/moVirt", "id": "054f289c18687370efc676bcf91c0f5f3c9a7828", "size": "900", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "moVirt/src/main/java/org/ovirt/mobile/movirt/rest/dto/v4/Snapshot.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "86"}, {"name": "Java", "bytes": "826816"}]}} +{"text": "\\section{Abstract}\nRossby waves are a way to conceptualize large scale, time-dependent motion in the atmosphere and ocean. Analytically we expect Rossby waves to travel westwards, and this was tested numerically with different time-stepping methods for a periodic and finite domain. \\\\\n\nThe numerical results show that Rossby waves travel westwards. For the finite domain the Rossby wave hits the wall and is reflected backwards to the east. This results in some resonance for the finite case. For the periodic case only regular sinusoidal shaped waves of constant amplitude was observed.\n\n\n\n\n\\section{Introduction}\nIn this project I will study Rossby waves. Rossby waves are a way to conceptualize large scale, time-dependent motion in the atmosphere and ocean. These waves typically have scales of hundreds to thousands of kilometers. Two examples of phenomenon that we try to understand with Rossby waves is the meandering of the atmospheric Jet Stream, and the adjustment of the ocean to changes in wind forcing, also called geostrophic adjustment.\\cite{geofludyn}\n\nRossby waves exist because of the Coriolis acceleration, which acts perpendicular to the velocity of a fluid parcel. In the Northern Hemisphere we have positive Coriolis acceleration, and in the Southern Hemisphere we have negative Coriolis. The Coriolis acceleration varies with latitude, strengthens towards the poles and weakens towards the equator. This is also why Rossby waves are treated a bit differently around the equator, and most of the time examined in mid- or high- latitudes. \\cite{rossby}\n\nAround the equator we usually apply the equatorial beta plane approximation ($f=\\beta y$, where $\\beta$ is the variation of Coriolis in the y-direction(north-south) given by $\\beta = df/dy$), where we may study equatorial Kelvin waves, which are lightning bolts compared to Rossby waves. Without a mean flow, equatorial Rossby waves (slow waves propagating with speeds on order of cm/s) are observed to travel west and Kelvin waves travel east (propagation speeds on order of m/s) around the equator.\\cite{equator}\\\\\n\n\nThe variation in Coriolis acceleration with latitude causes fluid parcels to change their spin, in context of a continuum called the vorticity \\cite{vorticity}, as they move to different latitudes.\\\\\n\nIntroducing short hand notations for derivatives in as shown below:\\\\\n\n$\\partial_t = \\frac{\\partial}{\\partial t}$\\\\\n\n$\\partial_x = \\frac{\\partial}{\\partial x}$\\\\\n\n$\\partial_{xx} = \\frac{\\partial^2}{\\partial x^2}$\\\\\n\nThe vorticity equation is then given as:\\\\ \n\n\\begin{equation}\n\\partial_t\\zeta + \\beta\\partial_x\\psi = 0\n\\end{equation}\\\\\n\nWhere $\\zeta$ is the vorticity, $\\beta$ comes from the $\\beta$-plane approximation explained below and $\\psi$ is the streamfunction determining the velocities:\\\\\n\n\\begin{equation}\nu = -\\partial_y\\psi \\\\\\ , \\\\\\ v = \\partial_x\\psi\n\\end{equation}\\\\\n\nWhere u is the east-west velocity and v is the north-south velocity.\\\\\n\nVorticity is defined as the curl, and the horizontal Laplacian of the streamfunction:\\\\\n\n\\begin{equation}\n\\zeta = \\partial_xv - \\partial_yu = \\nabla^2_H\\psi\n\\end{equation}\\\\\n\nThe Coriolis parameter is defined by:\\\\\n\n\\begin{equation}\nf = 2\\Omega sin(\\theta)\n\\end{equation}\\\\\n\nwhere $\\theta$ is the latitude and $\\Omega$ is the rotation rate of the earth, $\\Omega = 2\\pi/day$. As hinted at before, we often approximate f as a linear function centered on a latitude $\\theta_0$:\\\\\n\n\\begin{equation}\nf\\approx f_0 + \\beta y\n\\end{equation}\\\\\n\nwhere $f_0 = 2\\Omega sin(\\theta_0)$, $\\beta = 2\\Omega cos(\\theta_0)/R_e$ and $y = R_e(\\theta - \\theta_0)$, if $R_e$ is the Earth's radius. This linear representation is called the $\\beta$-plane approximation and is the $\\beta$ term in equation (1). Using the definition of vorticity we can rewrite the vorticity equation (1) in terms of only one variable, the streamfunction:\\\\\n\n\\begin{equation}\n\\partial_t\\nabla^2_H\\psi + \\beta\\partial_x\\psi = 0\n\\end{equation}\\\\\n\nThis is the barotropic Rossby wave equation, barotropic meaning that the density variations are only dependent on the change in pressure.\\\\\n\nWe will examine solutions of the vorticity equation in a periodic and closed domain, both analytically and numerically. For the periodic case we can consider a re-entrant domain, like going around the Earth's atmosphere. For a closed domain we can think of continents acting as walls bounding the ocean.\n\n \n\n\n\n\\section{Methods}\n\\subsection{Analytical solutions}\nMy calculations are mainly based on the lecture notes from geophysical fluid dynamics: \\cite{geofludyn}\\\\\n\n\\subsubsection{Solution to the Rossby equation in a periodic domain}\nConsider the vorticity equation from (6) in one dimension. Assuming the periodic domain in x = [0,L] I can propose a wave solution on the form:\\\\\n\n\\begin{equation}\n\\psi = Acos(\\frac{2n\\pi x}{L}-\\omega t)\n\\end{equation}\\\\\n\n, where n is an integer, $\\omega$ is the wave frequency and A is the amplitude.\\\\\n\nI need to show that the solution on the two boundaries are the same, satisfying periodic domain, and then solve for $\\omega$ to find the dispersion relation. Using the proposed wave solution in (7) I have the following:\\\\\n\n\\begin{equation}\n\\begin{gathered}\n\\zeta = \\partial_xv = \\partial_{xx}\\psi\\\\\n\\partial_x\\psi = -A\\frac{2n\\pi}{L}sin(\\frac{2n\\pi x}{L}-\\omega t)\\\\\n\\zeta = \\partial_{xx}\\psi = -A(\\frac{2n\\pi}{L})^2cos(\\frac{2n\\pi x}{L}-\\omega t)\\\\\n\\zeta(x=0,t) = -A(\\frac{2n\\pi}{L})^2cos(-\\omega t)\\\\\n\\zeta(x=L,t) = -A(\\frac{2n\\pi}{L})^2cos(\\frac{2n\\pi L}{L}-\\omega t) = -A(\\frac{2n\\pi}{L})^2cos(2n\\pi-\\omega t) = -A(\\frac{2n\\pi}{L})^2cos(-\\omega t)\\\\\n\\end{gathered}\n\\end{equation}\n\nEquation 8 shows that periodic boundary conditions are ok. Inserting $\\zeta$ into equation (6) yields:\\\\\n\n\\begin{equation}\n\\begin{gathered}\n\\partial_t\\nabla^2_H\\psi + \\beta\\partial_x\\psi = \\partial_t\\zeta + \\beta\\partial_x\\psi =\\\\\n-A(\\frac{2n\\pi}{L})^2\\omega \\sin(\\frac{2n\\pi x}{L}-\\omega t) - \\beta A\\frac{2n\\pi}{L}\\sin(\\frac{2n\\pi x}{L}-\\omega t)\\\\\n\\implies A\\frac{2n\\pi}{L}(\\frac{2n\\pi \\omega}{L}+\\beta)\\sin(\\frac{2n\\pi x}{L}-\\omega t) = 0\\\\\n\\implies \\omega = -\\frac{\\beta L}{2\\pi n}\n\\end{gathered}\n\\end{equation}\n\nThis is the dispersion relation of the wave. The phase speed is the speed at which Rossby waves move. Consider the phase of the wave as:\\\\\n\n$\\theta = \\frac{n\\pi x}{L}-\\omega t$\\\\\n\nIf we choose $\\theta = 2\\pi$ we get $\\psi = Acos(2\\pi) = A$, which means that we have a high pressure point with amplitude A. Solving for x we can find how this point moves, and taking the time derivative of that expression gives us an expression for the phase speed:\\\\\n\n$x = \\frac{\\theta L}{2n\\pi} + \\frac{\\omega tL}{2n\\pi}$\\\\\n\n$c = \\frac{dx}{dt} = \\frac{\\omega L}{2n\\pi}$\\\\\n\nInserting my expression for $\\omega$ I get the Rossby phase speed in the x direction:\\\\\n\n$c_x = \\frac{\\omega L}{2n\\pi} = -\\beta(\\frac{L}{2n\\pi})^2$\\\\\n\nThus, I find that the Rossby wave is moving westwards.\\\\\n\n\\subsubsection{Solution to the Rossby equation with solid boundaries} \n\nIn the ocean it's more appropriate to apply boundary conditions of no flow at the two end points. This can be enforced with Dirichlet conditions: $\\psi = 0$ at $x=0$ and $x=L$. Proposing a wave solution of the form:\\\\\n\n\\begin{equation}\n\\psi = A(x)cos(kx-\\omega t)\n\\end{equation}\\\\\n\n, where A(x) indicates that the amplitude has a structure which must be solved for the boundary conditions. Inserting the wave solution above into equation (6) I get the following:\\\\\n\n\\begin{equation}\n\\begin{gathered}\n\\psi(x=0,t) = \\psi(x=L,t)=0\\\\\n\\psi(x,t)=A(x)cos(kx-\\omega t)\\\\\n\\partial_x\\psi = A'(x)cos(kx-\\omega t) - A(x)ksin(kx-\\omega t)\\\\\n\\zeta = \\partial_{xx}\\psi = A''(x)cos(kx-\\omega t)-A'(x)ksin(kx-\\omega t) - A'(x)ksin(kx-\\omega t) - A(x)k^2cos(kx-\\omega t) =\\\\\n(A''(x)-A(x)k^2)cos(kx-\\omega t)-2A'(x)ksin(kx-\\omega t)\\\\\n\\implies \\partial_t\\zeta + \\beta\\partial_x\\psi =\\\\\n(A''(x)-A(x)k^2)\\omega sin(kx-\\omega t)+2A'(x)k\\omega cos(kx-\\omega t) + \\beta(A'(x)cos(kx-\\omega t) - A(x)ksin(kx-\\omega t))\\\\\n\\implies ((A''(x)-A(x)k^2)\\omega - \\beta A(x)k)sin(kx-\\omega t) + A'(x)(2k\\omega + \\beta)cos(kx-\\omega t) = 0\n\\end{gathered}\n\\end{equation}\\\\\n\nThis holds if:\\\\\n\n$(A''(x)-A(x)k^2)\\omega - \\beta A(x)k = 0$\\\\\n\nand solving for $\\omega$ I find an initial expression for the dispersion relation. \\\\\n\n$2k\\omega + \\beta = 0$\\\\\n$\\implies \\omega = \\frac{-\\beta}{2k}$\\\\\n\nand\n\n$c_x = \\frac{\\omega}{k} = \\frac{-\\beta}{2k^2}$\\\\\n\n\nSolving for the structure:\\\\\n\n\\begin{equation}\n\\begin{gathered}\nA''(x) - A(x)(k^2+\\frac{\\beta k}{\\omega} = 0\\\\\nr^2-(k^2+\\frac{\\beta k}{\\omega})=0\\\\\nr = \\pm k\\sqrt{1+\\frac{\\beta}{k\\omega}}\\\\\n= \\pm k\\sqrt{1-\\frac{\\beta}{k\\beta/2k}} = \\pm k\\sqrt{1-2} = \\pm ik\\\\\n\\implies A(x) = C\\cos(kx) + D\\sin(kx)\n\\end{gathered}\n\\end{equation}\\\\\n\nNeed to satisfy Dirichlet conditions:\\\\\n\n\\begin{equation}\n\\begin{gathered}\n\\psi(x=0,t) = A(0)\\cos(-\\omega t) = 0\\\\\n\\implies C + D\\sin(0) = 0\n\\implies C = 0\\\\\n\\psi(x=L,t) = A(L)\\cos(kL-\\omega t) = 0\\\\\n\\implies A(L) = D\\sin(kL) = 0\\\\\n\\implies kL = n\\pi\\\\\n\\implies k_n = \\frac{n\\pi}{L}\\\\\n\\end{gathered}\n\\end{equation}\\\\\n\nI find that the allowed frequencies given by the dispersion relation becomes:\\\\\n\n$\\omega_n = \\frac{-\\beta L}{2\\pi n}$\\\\\n\nand the Rossby phase speed:\\\\\n\n$c_x = \\frac{\\omega_n}{k_n} = \\frac{\\beta}{2}(\\frac{L}{n\\pi})^2$\\\\\n\nThe full wave solution becomes:\\\\\n\n\\begin{equation}\n\\psi(x,t) = D\\sin(\\frac{n\\pi x}{L})\\cos(\\frac{n\\pi x}{L}+\\frac{\\beta Lt}{2\\pi n})\n\\end{equation}\n\n, where D must be determined from the initial conditions for a specific problem.\n\n\n\n\n\\subsection{Method for solving the barotropic Rossby wave equation numerically}\nA numerical solution to equation (6), involves two steps. If we know the velocity or streamfunction initially, we can advance the vorticity in time to a new time. Then the streamfunction at the new time is found by inverting equation (3). This process is repeated to find a complete numerical solution.\\\\\n\nSince the vorticity does not vary with change in y-direction for the one dimensional case I have:\\\\\n\n\\begin{equation}\n\\zeta = \\partial_{xx}\\psi\n\\end{equation} \n\nThis is a specification of equation (3), which is solved as the Poisson equation, the same way as used in project 1. We have the same form:\\\\\n\n$u''(x) = f(x)$ , the Poisson structure is recognized as:\\\\\n\n$\\partial_{xx} \\psi = \\zeta$\\\\\n\nwhich, for the rigid boundary conditions can be solved the exact same way: \n\nTo discretize the equations, we assume a grid of equally-spaced\npoints:\n\n\\begin{equation}\nx_j = j\\Delta x\n\\end{equation}\nwhere $\\Delta x$ is the grid spacing. We discretize time in a similar way:\n\n\\begin{equation}\nt^n = n\\Delta t\n\\end{equation}\nwhere $\\Delta t$ is the time step. Thus $t^0=0$, $t^1=\\Delta t$, and so on.\\\\\n\nWe then approximate the derivatives by finite differences. For\nthe spatial derivatives, we use centered-differences:\n\n\\begin{align}\n\t\\partial_x\\psi &\\approx \\frac{\\psi_{j+1}^{n} - \\psi_{j-1}^{n}}{2\\Delta x}, \\\\\n\t\\partial_{xx}\\psi &\\approx \\frac{\\psi_{j+1}^{n} - 2\\psi_{j}^{n} + \\psi_{j-1}^{n}}{\\Delta x^2},\n\\end{align}\n\nThus the discretized 1D Poisson equation becomes a set of algebraic equations:\\\\\n\n\n\\begin{align}\n\\implies \\psi_{j+1}^{n} - 2\\psi_{j}^{n} + \\psi_{j-1}^{n} = \\zeta_j^n {\\Delta x^2}\n\\end{align}\n\n, where j is the space step j = 1,2,...,$j_{max}$\\\\\n\nFor periodic boundary conditions it's much more difficult to satisfy the boundary conditions. The boundary at x=0 we must be carefully handled with an extra imaginary point $x_{-1}$, since we have that the last step should be the first step for the next cycle. For j = 0 I get:\\\\\n\n\\begin{align}\n\\psi_{1}^{n} - 2\\psi_{0}^{n} + \\psi_{-1}^{n} = \\zeta_0^n {\\Delta x^2}\n\\end{align}\\\\\n\n, where $\\psi_{-1}^{n}$ is the problem term. To solve it I utilize equation (18), by saying that\\\\ \n\n\\begin{align}\n\\partial_x \\psi_{0}^{n} = \\frac{\\psi_{1}^{n} - \\psi_{-1}^{n}}{2\\Delta x}\n\\end{align}\\\\\n \nRearranging and solving the equation in regards to \n$\\psi_{-1}^{n}$ I get:\\\\\n\n\\begin{align}\n\\psi_{-1}^{n} = \\psi_{1}^{n} - 2\\Delta x \\partial_x \\psi_{0}^{n}\n\\end{align}\\\\\n\nSubstituting this expression into the previous equation (21) I get:\\\\\n\n\\begin{align}\n\\psi_{1}^{n} - 2\\psi_{0}^{n} + \\psi_{1}^{n} - 2\\Delta x \\partial_x \\psi_{0}^{n} = \\zeta_0^n {\\Delta x^2}\n\\end{align}\n\nRearranging again I get the result of the boundary condition:\\\\\n\n\\begin{align}\n\\psi_{1}^{n} - \\psi_{0}^{n} = \\frac{\\zeta_0^n {\\Delta x^2} + 2\\Delta x \\partial_x \\psi_{0}^{n}}{2}\n\\end{align}\\\\\n\nNow we can introduce the vector $\\mathbf{F}$, as done in equation 5 of \\cite{poisson}. The elements of $\\mathbf{F}$ are $F_j$ defined by:\\\\\n\n\\begin{equation}\n\\begin{gathered}\nF_0 = \\frac{\\zeta_0^n {\\Delta x^2}}{2} + \\Delta x \\partial_x\\psi_0\\\\\nF_{j_{max}} = \\Delta x^2 \\zeta_{j_{max}} - \\psi_0\\\\\nF_j = \\Delta x^2 \\zeta_j\n\\end{gathered}\n\\end{equation}\n\n, where j = 1, 2, ..., $j_{max}-1$\\\\\n\nI obtain the following matrix equation:\\\\\n\n\\[\n\\begin{bmatrix}\n -1& 1& 0 &\\dots & \\dots &0 \\\\\n 1 & -2 & 1 &0 &\\dots &\\dots \\\\\n 0&1 &-2 & 1 & 0 & \\dots \\\\\n & \\dots & \\dots &\\dots &\\dots & \\dots \\\\\n 0&\\dots & &1 &-2& 1 \\\\\n 0&\\dots & & 0 &1 & -1 \\\\\n\\end{bmatrix}\n\\begin{bmatrix}\n\t\\psi_0 \\\\\n\t\\psi_1 \\\\\n\t\\psi_2 \\\\\n\t\\vdots \\\\\n\t\\psi_{j_{max}-1} \\\\\n\t\\psi_{j_{max}} \\\\ \n\\end{bmatrix} = \n\\Delta x^2\n\\begin{bmatrix}\n\t\\zeta_0 \\\\\n\t\\zeta_1 \\\\\n\t\\zeta_3 \\\\\n\t\\vdots \\\\\n\t\\zeta_{j_{max}-1} \\\\\n\t\\zeta_{j_{max}} \\\\ \n\\end{bmatrix}\n\\]\\\\\n\nThis tridiagonal matrix is then solved numerically with the Thomas algorithm as prescribed in \\cite{trisolve} or chapter 6.4 in \\cite{lecturenote}.\\\\\n\nEquation (6) is a prognostic equation, which will be solved numerically by using a time-stepping method.\n\n\nFor the time stepping, we will test two methods. One involves a\nforward difference:\n\n\\begin{equation}\n \\label{eq:Rossby3}\n \\partial_t\\psi \\approx \\frac{\\psi_{j}^{n+1} - \\psi_{j}^{n}}{\\Delta t} ,\n\\end{equation}\n\nwhile the second involves a centered difference:\n\n\\begin{align}\n \\label{eq:Rossby4}\n\t\\partial_t\\psi &\\approx \\frac{\\psi_{j}^{n+1} - \\psi_{j}^{n-1}}{2\\Delta t}.\n\\end{align}\\\\\n\nThe forward method is rearranged to be solved using the following algorithm\\\\\n\n\\begin{align}\n\\zeta_j^{n+1} = \\Delta t(\\frac{\\psi_{j+1}^n-\\psi_{0}^n}{\\Delta x})+\\zeta_j^{n}\n\\end{align}\\\\\n\nand the central method is rearranged to:\\\\\n\n\\begin{align}\n\\zeta_j^{n+1} = 2\\Delta t(\\frac{\\psi_{j+1}^n-\\psi_{j-1}^n}{2\\Delta x})+\\zeta_j^{n-1}\n\\end{align}\\\\\n\n\n \n\n\n\n\n\n\n\\newpage\n\\section{Implementation}\nFor all programs, see:\\\\\n$\\href{https://github.com/larsjbro/FYS4150/tree/master/project_5/source}{https://github.com/larsjbro/FYS4150/tree/master/project_5/source}$\n\n\n\\subsection{Tridiagonal matrix solver}\nThe Thomas method is implemented to find an expression for the vorticity. This method is implemented in the functions\n\n\\begin{verbatim}\ntridiagonal_solve_specific\n\\end{verbatim}\n\nis used for solving the finite domain\n\nand \n\n\\begin{verbatim}\ntridiagonal_solve\n\\end{verbatim}\n\nis used to solve for the periodic domain.\n\nThe result from the solver is then inserted into the Rossby wave equation and solved with time stepping methods.\n\n\\subsection{Rossby wave solution for finite and periodic domain}\nA solver for the barotropic Rossby wave equation for finite and perodic domain is implemented with the functions\n\n\\begin{verbatim}\nsolve_rossby_with_walls\n\\end{verbatim}\n\nand\n\n\\begin{verbatim}\nsolve_rossby_periodic\n\\end{verbatim}\n\nrespectively.\n\n%*Code/Implementations/test: Readability of code, implementation, testing and discussion of benchmarks. Total number of possible points 20*\n\n \n\n\\section{Results}\n%*Analysis: of results and the effectiveness of their selection and presentation. Are the results well understood and discussed? Total number of possible points: 20*\n\n\\subsection{Agreement between analytical and numerical simulations}\n\nTheoretically we expect the Rossby wave to travel westwards barring a strong mean flow to the east. From figure 1 and 2 I see that this case is confirmed, as I can see the wave moving westwards with increasing time. I can also see that the waves are interfering as the amplitude of the waves are changed with time for the finite domain!\n\n\\subsubsection{Finite domain}\nFigure 1 and 2 shows the Rossby wave propagation going westwards and also showing some change in amplitude due to the finite boundaries resulting in reflection of waves. \n\n\n\\FloatBarrier\n\\begin{figure}[!ht]\n\\centering\n\\FloatBarrier\n\\includegraphics[width=0.70\\textwidth]{task_5c_psi_Wall_central1000.png}\n\n\\caption{Plot of streamfunction for finite domain with central method, for three different times}\n\\label{fig:Earth_orbit_sun_Forward_Euler_k_2}\n\\end{figure}\n\\FloatBarrier\n\n\n\\FloatBarrier\n\\begin{figure}[!ht]\n\\centering\n\\FloatBarrier\n\\includegraphics[width=0.70\\textwidth]{task_5c_psi_Wall_forward1000.png}\n\n\\caption{Plot of streamfunction for finite domain with forward stepping method, for three different times.}\n\\label{fig:Earth_orbit_sun_Forward_Euler_k_2}\n\\end{figure}\n\\FloatBarrier\n\n\\subsubsection{Periodic domain}\nFigure 3 and 4 show that also the periodic waves travel westwards but are are not distorted in their shape, which is because there is no reflection at a wall.\n\n\n\\FloatBarrier\n\\begin{figure}[!ht]\n\\centering\n\\FloatBarrier\n\\includegraphics[width=0.70\\textwidth]{task_5c_psi_Periodic_central1000.png}\n\n\\caption{Plot of streamfunction for periodic domain with central stepping method, for three different times.}\n\\label{fig:Earth_orbit_sun_Forward_Euler_k_2}\n\\end{figure}\n\\FloatBarrier\n\n\n\\FloatBarrier\n\\begin{figure}[!ht]\n\\centering\n\\FloatBarrier\n\\includegraphics[width=0.70\\textwidth]{task_5c_psi_Periodic_forward1000.png}\n\n\\caption{Plot of streamfunction for periodic domain with forward stepping method, for three different times.}\n\\label{fig:Earth_orbit_sun_Forward_Euler_k_2}\n\\end{figure}\n\\FloatBarrier\n\n\n\n\n\n\n\n\n\n\\section{Conclusion}\nBarotropic Rossby waves travel in the western direction, but the numerical solution to the problem is quite difficult. Especially for the case of a periodic domain, when the boundary conditions introduced a stepping problem. \n\nI find that the central method was slightly better as a numerical method. I also find that the Rossby waves travel westwards for both the periodic and the finite domain. In the finite domain I can see that the amplitude of the wave is distorted which is a sign that there is reflection of waves at the walls resulting in resonance.\n\n\n%*Conclusions, discussions and critical comments: on what was learned about the method used and on the results obtained. Possible directions and future improvements? Total number of possible points: 10*\n\n\n\n\n\\begin{thebibliography}{99}\n\\bibitem{lecturenote}$\\href{https://github.com/CompPhysics/ComputationalPhysics/blob/gh-pages/doc/Lectures/lectures2015.pdf}{https://github.com/CompPhysics/ComputationalPhysics/blob/gh-pages/doc/Lectures/lectures2015.pdf}$, November 19 2017\\\\\n\\bibitem{equator}$\\href{https://en.wikipedia.org/wiki/Equatorial\\_wave}{https://en.wikipedia.org/wiki/Equatorial\\_wave}$\n\\bibitem{geofludyn}$\\href{http://folk.uio.no/josepl/papers/dynbook7.pdf}{http://folk.uio.no/josepl/papers/dynbook7.pdf}$\n\\bibitem{rossby}$\\href{https://en.wikipedia.org/wiki/Rossby\\_wave}{https://en.wikipedia.org/wiki/Rossby\\_wave}$\n\\bibitem{poisson}$\\href{http://file.scirp.org/pdf/JEMAA_2014092510103331.pdf}{http://file.scirp.org/pdf/JEMAA_2014092510103331.pdf}$\n\\bibitem{vorticity}$\\href{https://en.wikipedia.org/wiki/Vorticity}{https://en.wikipedia.org/wiki/Vorticity}$\n\\bibitem{trisolve}$\\href{https://www.cfd-online.com/Wiki/Tridiagonal\\_matrix\\_algorithm\\_-\\_TDMA\\_(Thomas\\_algorithm)}{https://www.cfd-online.com/Wiki/Tridiagonal\\_matrix\\_algorithm\\_-\\_TDMA\\_(Thomas\\_algorithm)}$\n\\end{thebibliography}\n\n\n\n\n%\\FloatBarrier\n%\\begin{figure}[!ht]\n%\\centering\n%\\FloatBarrier\n%\\includegraphics[width=0.45\\textwidth]{eigenvector_rho29n128omega500.png}\n%\n%\\caption{Normalized energy for the three lowest eigenvalues for repulsive Coulomb interaction with n=128 and $\\omega_r$=5}\n%\\label{fig:Eigenvalue_states_n_320_omega_500}\n%\\end{figure}\n%\\FloatBarrier\n\n\n", "meta": {"content_hash": "503b543e1660bd551c78341930468f63", "timestamp": "", "source": "github", "line_count": 515, "max_line_length": 516, "avg_line_length": 38.87766990291262, "alnum_prop": 0.7120667266007392, "repo_name": "larsjbro/FYS4150", "id": "48ce04613235ef461742751a985408a94cb2a507", "size": "20024", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "project_5/1.tex", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "C++", "bytes": "3835"}, {"name": "Python", "bytes": "169901"}, {"name": "Shell", "bytes": "369"}, {"name": "TeX", "bytes": "81829"}]}} +{"text": "namespace ct_common {\n\n// Class mapping typeid to class name.\nclass ClassNameMap final {\n public:\n ClassNameMap() = default;\n ~ClassNameMap() = default;\n\n template <typename T>\n static const std::string& GetClassName(const T& obj) {\n return GetInstance().GetClassNameInternal(typeid(obj));\n }\n\n static void Register(const std::type_index& info, const std::string& name) {\n GetInstance().RegisterInternal(info, name);\n }\n\n private:\n static ClassNameMap& GetInstance();\n\n const std::string& GetClassNameInternal(const std::type_index& idx) const;\n void RegisterInternal(const std::type_index& info, const std::string& name);\n\n using NameMap = std::unordered_map<std::type_index, std::string>;\n NameMap name_map_;\n};\n\nclass GlobalInitializer {\n public:\n using FuncType = std::function<void()>;\n explicit GlobalInitializer(FuncType func) {\n func();\n }\n};\n\n} // namespace ct_common\n\n#define REGISTER_CLASS_NAME(name) \\\n namespace { \\\n const ct_common::GlobalInitializer sClassNameRegisterer##name( \\\n std::bind(ClassNameMap::Register, \\\n std::type_index(typeid(name)), #name)); \\\n }\n\n#endif // CT_COMMON_BASE_CLASS_NAME_UTILS_H_\n", "meta": {"content_hash": "65a2fe2adaee3e072e1436f8d722a9bd", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 78, "avg_line_length": 29.42222222222222, "alnum_prop": 0.6140483383685801, "repo_name": "xxyzzzq/ct_common", "id": "f98689c4472f0cdf4e01eb7139f3fd8c2a541154", "size": "1586", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ct_common/base/class_name_utils.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "413"}, {"name": "C++", "bytes": "192453"}, {"name": "CMake", "bytes": "2053"}, {"name": "PAWN", "bytes": "2945"}, {"name": "Shell", "bytes": "3050"}]}} +{"text": "Compiled example\n----------------\n\n", "meta": {"content_hash": "d2759ecabe2e32b4f08dd64158bb1ccc", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 37, "avg_line_length": 24.0, "alnum_prop": 0.6111111111111112, "repo_name": "MartinThoma/LaTeX-examples", "id": "09150f4fee41583e9ea73de64e16dcbda9dcfd0b", "size": "72", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tikz/topology-cube-divided/README.md", "mode": "33188", "license": "mit", "language": [{"name": "Assembly", "bytes": "104"}, {"name": "Asymptote", "bytes": "16054"}, {"name": "Batchfile", "bytes": "187"}, {"name": "C", "bytes": "7885"}, {"name": "Gnuplot", "bytes": "383"}, {"name": "HTML", "bytes": "10585"}, {"name": "Haskell", "bytes": "9401"}, {"name": "Java", "bytes": "95574"}, {"name": "JavaScript", "bytes": "33665"}, {"name": "Jupyter Notebook", "bytes": "15400"}, {"name": "Makefile", "bytes": "403103"}, {"name": "Prolog", "bytes": "4515"}, {"name": "Python", "bytes": "58056"}, {"name": "Raku", "bytes": "357"}, {"name": "Scala", "bytes": "6990"}, {"name": "Shell", "bytes": "2783"}, {"name": "ShellSession", "bytes": "3837"}, {"name": "Smarty", "bytes": "572"}, {"name": "Tcl", "bytes": "250"}, {"name": "TeX", "bytes": "5244843"}, {"name": "X10", "bytes": "2354"}]}} +{"text": "import datetime\nimport os\nimport re\nimport tempfile\nimport urllib2\n\nfrom lxml import etree\nfrom optparse import make_option\nfrom tempfile import gettempdir\n\n\nfrom django.core.files import File\nfrom django.core.management.base import BaseCommand, CommandError\nfrom django.utils.timezone import utc\n\nfrom airmozilla.main.models import Category, Event, Tag, Template\n\nDEFAULT_VIDLY_TEMPLATE = \"\"\"\n<video controls width=\"100%\" controls preload=\"none\" poster=\"https://d3fenhwk93s16g.cloudfront.net/{{ tag }}/poster.jpg\">\n <source src=\"http://cf.cdn.vid.ly/{{ tag }}/mp4.mp4\" type=\"video/mp4\">\n <source src=\"http://cf.cdn.vid.ly/{{ tag }}/webm.webm\" type=\"video/webm\">\n <source src=\"http://cf.cdn.vid.ly/{{ tag }}/ogv.ogv\" type=\"video/ogg\">\n <a target=\"_blank\" href=\"http://vid.ly/{{ tag }}\"><img src=\"https://d3fenhwk93s16g.cloudfront.net/{{ tag }}/poster.jpg\" width=\"500\" alt=\"Video\"></a>\n</video>\n\"\"\"\nDEFAULT_VIDLY_NAME = \"Vid.ly\"\n\nDEFAULT_OGG_TEMPLATE = \"\"\"\n<video width=\"620\" height=\"350\" controls=\"controls\">\n <source src=\"{{ url }}\" type=\"video/ogg\" />\n</video>\n\"\"\"\nDEFAULT_OGG_NAME = \"Ogg Video\"\n\n\nclass Command(BaseCommand):\n args = '<wordpress_xml_dump.xml> <default_thumb>'\n option_list = BaseCommand.option_list + (\n make_option('--clear',\n action='store_true',\n dest='clear',\n default=False,\n help='Clear all events before running the migration.'),\n )\n nsmap = {\n 'wp': 'http://wordpress.org/export/1.2/',\n 'dc': 'http://purl.org/dc/elements/1.1/',\n 'content': 'http://purl.org/rss/1.0/modules/content/',\n 'excerpt': 'http://wordpress.org/export/1.2/excerpt/'\n }\n import_cache = tempfile.gettempdir()\n\n def _check_video_templates(self):\n # make sure we have some assumed Video templates in the database\n try:\n Template.objects.get(name=DEFAULT_VIDLY_NAME)\n except Template.DoesNotExist:\n Template.objects.create(\n name=DEFAULT_VIDLY_NAME,\n content=DEFAULT_VIDLY_TEMPLATE\n )\n try:\n Template.objects.get(name=DEFAULT_OGG_NAME)\n except Template.DoesNotExist:\n Template.objects.create(\n name=DEFAULT_OGG_NAME,\n content=DEFAULT_OGG_TEMPLATE\n )\n\n def handle(self, *args, **options):\n if options['clear']:\n for e in Event.objects.all():\n e.delete()\n self._check_video_templates()\n attachments = {}\n try:\n wordpress_xml_dump = args[0]\n item_parser = etree.iterparse(wordpress_xml_dump, tag='item')\n except IndexError:\n raise CommandError('Please provide an XML dump.')\n except IOError:\n raise CommandError('The provided file does not exist or is not'\n ' a valid Wordpress XML dump')\n try:\n self.default_thumb_path = args[1]\n self.default_thumb = open(self.default_thumb_path, 'rb')\n except IOError:\n raise CommandError('Please provide a valid default thumbnail.')\n\n for _, element in item_parser:\n fields = {\n 'title': 'title',\n 'status': 'wp:status',\n 'start_time': 'pubDate',\n 'description': 'content:encoded',\n 'short_description': 'excerpt:encoded',\n 'created': 'wp:post_date',\n 'slug': 'wp:post_name',\n 'type': 'wp:post_type',\n 'attachment': 'wp:attachment_url',\n 'post_id': 'wp:post_id'\n }\n item = self.extract_item(element, fields)\n if Event.objects.filter(slug=item['slug']).exists():\n self.stdout.write(\n 'Event %s already exists, skipping.\\n' % item['slug']\n )\n continue\n\n if item['type'] == 'attachment':\n # The item is a thumbnail attachment; save for later\n attachments[item['post_id']] = item['attachment']\n elif item['type'] == 'post':\n # Create and initiate a new event\n event = Event()\n event.title = item['title']\n event.slug = item['slug']\n try:\n event.start_time = datetime.datetime.strptime(\n item['start_time'],\n '%a, %d %b %Y %H:%M:%S +0000'\n ).replace(tzinfo=utc)\n except ValueError:\n event.start_time = datetime.datetime.strptime(\n item['created'],\n '%Y-%m-%d %H:%M:%S'\n ).replace(tzinfo=utc)\n event.archive_time = (\n event.start_time + datetime.timedelta(hours=1)\n )\n # Set status & public status from WP metadata\n event.status = Event.STATUS_INITIATED\n event.public = False\n if item['status'] == 'publish':\n event.status = Event.STATUS_SCHEDULED\n event.public = True\n elif item['status'] == 'private':\n event.status = Event.STATUS_SCHEDULED\n elif item['status'] == 'trash':\n event.status = Event.STATUS_REMOVED\n # Parse out the video from the event description\n event.description = 'n/a'\n if item['description']:\n self.parse_description(event, item['description'])\n event.short_description = item['short_description'] or ''\n # Add categories and tags\n event.save()\n for category in element.findall('category'):\n domain = category.attrib['domain']\n text = category.text\n if domain == 'category' and not event.category:\n cat, _ = Category.objects.get_or_create(name=text)\n event.category = cat\n else:\n tag = text.lower().strip()\n tag_add, _ = Tag.objects.get_or_create(name=tag)\n event.tags.add(tag_add)\n # Add thumbnail and save\n thumbnail_id = 0\n for meta in element.findall('wp:postmeta',\n namespaces=self.nsmap):\n meta_key, meta_val = meta.getchildren()\n if meta_key.text == '_thumbnail_id':\n thumbnail_id = meta_val.text\n if thumbnail_id in attachments:\n self.attach_thumbnail(event, attachments[thumbnail_id])\n else:\n self.attach_thumbnail(event)\n self.stdout.write(\n 'No thumb found for %s, used default.\\n' % event.slug\n )\n event.save()\n self.stdout.write('Saved event %s\\n' % event.slug)\n\n def extract_item(self, element, fields):\n \"\"\"Returns a shortcut dictionary of element's children parsed\n according to fields (destination_key: source_child_tag).\"\"\"\n item = {}\n for name, tag in fields.iteritems():\n child = element.find(tag, namespaces=self.nsmap)\n try:\n item[name] = child.text.encode('utf-8').strip()\n except AttributeError:\n item[name] = None\n return item\n\n def parse_description(self, event, description_raw):\n \"\"\"Parse out video embeds from the description, correctly set\n templates and their environments; leave descriptions clean.\"\"\"\n vidly_tag = re.compile('\\[vidly code=\"(\\w+)?\"\\]')\n vidly_template = Template.objects.get(name='Vid.ly')\n ogg_tag = re.compile('<video src=\"([^\"]*)\".*?>')\n ogg_template = Template.objects.get(name='Ogg Video')\n\n event.description = description_raw\n vidly_search = vidly_tag.search(description_raw)\n ogg_search = ogg_tag.search(description_raw)\n if vidly_search:\n event.description = event.description.replace(\n vidly_search.group(0), ''\n )\n event.template = vidly_template\n event.template_environment = {'tag': vidly_search.group(1)}\n elif ogg_search:\n event.description = event.description.replace(\n ogg_search.group(0), ''\n )\n event.template = ogg_template\n event.template_environment = {'url': ogg_search.group(1)}\n else:\n event.status = Event.STATUS_REMOVED\n event.description = event.description.strip()\n\n def attach_thumbnail(self, event, url=None):\n \"\"\"Download, cache, and attach an event's placeholder image.\"\"\"\n if not url:\n # Use a default image, provided\n _, ext = os.path.splitext(self.default_thumb_path)\n img_temp = File(self.default_thumb)\n else:\n _, ext = os.path.splitext(url)\n cache_path = os.path.join(self.import_cache, event.slug) + ext\n try:\n # Read a cached image\n img_temp = File(\n open(cache_path, 'rb')\n )\n except IOError:\n # Download and create the image\n img_temp = File(\n open(cache_path, 'wb+')\n )\n img_temp.write(urllib2.urlopen(url).read())\n img_temp.flush()\n event.placeholder_img.save('img%s' % ext, img_temp)\n", "meta": {"content_hash": "6eee4b1df86f795e424d5e91f0423b09", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 152, "avg_line_length": 41.276595744680854, "alnum_prop": 0.5261855670103093, "repo_name": "peterbe/airmozilla", "id": "e425491abf0a0084e37b60ca7ab86a09de60e97b", "size": "9700", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "airmozilla/manage/management/commands/wp_import.py", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "70585"}, {"name": "JavaScript", "bytes": "10192"}, {"name": "Puppet", "bytes": "6677"}, {"name": "Python", "bytes": "1235514"}, {"name": "Shell", "bytes": "3672"}]}} +{"text": "\ufeffusing System;\r\nusing System.Collections.Generic;\r\nusing System.Diagnostics;\r\nusing System.Linq;\r\nusing System.Reflection;\r\nusing System.Text;\r\n\r\nnamespace SpecAid.Helper\r\n{\r\n public static class AssemblyEntryFinderInUnitTests\r\n {\r\n // Because Assembly.GetEntryAssembly() doesn't work in UnitTests...\r\n public static Assembly Go()\r\n {\r\n var specAidAssembly = Assembly.GetExecutingAssembly();\r\n\r\n StackTrace stackTrace = new StackTrace(); // get call stack\r\n StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)\r\n\r\n Assembly assembly = null;\r\n foreach (var stackFrame in stackFrames)\r\n {\r\n try\r\n {\r\n var dType = stackFrame.GetMethod().DeclaringType;\r\n\r\n if (dType == null)\r\n continue;\r\n\r\n assembly = dType.Assembly;\r\n\r\n if (specAidAssembly.FullName != assembly.FullName)\r\n {\r\n return assembly;\r\n }\r\n }\r\n// ReSharper disable EmptyGeneralCatchClause\r\n catch\r\n// ReSharper restore EmptyGeneralCatchClause\r\n {\r\n // Throw away the exception... \r\n // Either we have the assembly in the Stack or we don't...\r\n }\r\n }\r\n\r\n return assembly;\r\n }\r\n }\r\n}\r\n", "meta": {"content_hash": "286a83a123f0f81a4853868b55021068", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 92, "avg_line_length": 30.448979591836736, "alnum_prop": 0.5073726541554959, "repo_name": "ITAGroup/SpecAid", "id": "063750ad2b71e3ba743cb776422c32dedb8c4aeb", "size": "1494", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/SpecAid/Helper/AssemblyEntryFinderInUnitTests.cs", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C#", "bytes": "275005"}, {"name": "Cucumber", "bytes": "37215"}]}} +{"text": "LongishDark Theme for Linux\n", "meta": {"content_hash": "2241282cb7d721abd1f8b57743b3e7e3", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 27, "avg_line_length": 28.0, "alnum_prop": 0.8571428571428571, "repo_name": "akalongman/linux-longishdark-theme", "id": "bb74ffcc94938570e8ac218014c65283f0810af1", "size": "54", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "324528"}]}} +{"text": "struct PapayaMemory;\nstruct Profile;\n\nenum PapayaUndoOp_ {\n PapayaUndoOp_Brush,\n PapayaUndoOp_COUNT\n};\n\nstruct UndoData {\n // TODO: Convert into a union of structs once multiple types of undo ops are required\n u8 op_code; // Stores enum of type PapayaUndoOp_\n UndoData* prev, *next;\n Vec2i pos, size; // Position and size of the suffixed data block\n bool IsSubRect; // If true, then the suffixed image data contains two subrects - before and after the brush\n Vec2 line_segment_start_uv;\n // Image data goes after this\n};\n\nstruct UndoBuffer {\n void* start; // Pointer to beginning of undo buffer memory block // TODO: Change pointer types to i8*?\n void* top; // Pointer to the top of the undo stack\n UndoData* base; // Pointer to the base of the undo stack\n UndoData* current; // Pointer to the current location in the undo stack. Goes back and forth during undo-redo.\n UndoData* last; // Last undo data block in the buffer. Should be located just before Top.\n size_t size; // Size of the undo buffer in bytes\n size_t count; // Number of undo ops in buffer\n size_t current_index; // Index of the current undo data block from the beginning\n};\n\nnamespace undo {\n void init(PapayaMemory* mem);\n void destroy(PapayaMemory* mem);\n void push(UndoBuffer* undo, Profile* profile, Vec2i pos, Vec2i size,\n i8* pre_brush_img, Vec2 line_segment_start_uv);\n void pop(PapayaMemory* mem, bool load_pre_brush_image);\n void visualize_undo_buffer(PapayaMemory* mem);\n}\n\n", "meta": {"content_hash": "11628ec7346622c95a9b77667de2c033", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 114, "avg_line_length": 40.63157894736842, "alnum_prop": 0.697538860103627, "repo_name": "ApoorvaJ/Papaya", "id": "f0c2a3002353757385ab5404f5b8a4f4a4b84421", "size": "1583", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ui/components/undo.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "518645"}, {"name": "C++", "bytes": "1028862"}, {"name": "Makefile", "bytes": "1110"}]}} +{"text": "/* Authenticating with Persona. */\n\napi.onLoginRequired = function() {\n var R = Route.replace(), self = this;\n R[\"persona/page\"]({ button: function(R) {\n\tR.$[0].onclick = function() {\n\t navigator.id.get(function(assertion){\n\t\tself.AUTH('people/auth/persona', {assertion:assertion}, function(r){\n\t\t Route.dispatch();\n\t\t});\t\t\n\t },{\n\t\tsiteName: i18n.title\t\t\n\t });\n\t};\n }});\n R.show();\n};\n", "meta": {"content_hash": "d8bf7535feccd9694f7bf18672cc73af", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 70, "avg_line_length": 24.058823529411764, "alnum_prop": 0.5794621026894865, "repo_name": "RunOrg/RunOrg", "id": "00d49c5aedfdd5ebf6c3c9bcbafe2c630e58d405", "size": "409", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sites/default/persona/persona.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "15641"}, {"name": "HTML", "bytes": "7273"}, {"name": "JavaScript", "bytes": "183305"}, {"name": "Makefile", "bytes": "1416"}, {"name": "OCaml", "bytes": "626227"}, {"name": "Shell", "bytes": "681"}, {"name": "Standard ML", "bytes": "369"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- $Revision: 336244 $ -->\n<refentry xml:id=\"pdo.errorcode\" xmlns=\"http://docbook.org/ns/docbook\">\n <refnamediv>\n <refname>PDO::errorCode</refname>\n <refpurpose>\n Fetch the SQLSTATE associated with the last operation on the database handle\n </refpurpose>\n </refnamediv>\n <refsect1 role=\"description\">\n &reftitle.description;\n <methodsynopsis>\n <modifier>public</modifier> <type>mixed</type><methodname>PDO::errorCode</methodname>\n <void/>\n </methodsynopsis>\n\n </refsect1>\n\n <refsect1 role=\"returnvalues\">\n &reftitle.returnvalues;\n <para>\n Returns an SQLSTATE, a five characters alphanumeric identifier defined in\n the ANSI SQL-92 standard. Briefly, an SQLSTATE consists of a\n two characters class value followed by a three characters subclass value. A\n class value of 01 indicates a warning and is accompanied by a return code\n of SQL_SUCCESS_WITH_INFO. Class values other than '01', except for the\n class 'IM', indicate an error. The class 'IM' is specific to warnings\n and errors that derive from the implementation of PDO (or perhaps ODBC,\n if you're using the ODBC driver) itself. The subclass value '000' in any\n class indicates that there is no subclass for that SQLSTATE.\n </para>\n <para>\n <function>PDO::errorCode</function> only retrieves error codes for operations\n performed directly on the database handle. If you create a PDOStatement\n object through <function>PDO::prepare</function> or\n <function>PDO::query</function> and invoke an error on the statement\n handle, <function>PDO::errorCode</function> will not reflect that error.\n You must call <function>PDOStatement::errorCode</function> to return the error\n code for an operation performed on a particular statement handle.\n </para>\n <para>\n Returns &null; if no operation has been run on the database handle.\n </para>\n </refsect1>\n\n <refsect1 role=\"examples\">\n &reftitle.examples;\n <para>\n <example><title>Retrieving an SQLSTATE code</title>\n <programlisting role=\"php\">\n<![CDATA[\n<?php\n/* Provoke an error -- the BONES table does not exist */\n$dbh->exec(\"INSERT INTO bones(skull) VALUES ('lucy')\");\n\necho \"\\nPDO::errorCode(): \", $dbh->errorCode();\n?>\n]]>\n </programlisting>\n &example.outputs;\n <screen>\n<![CDATA[\nPDO::errorCode(): 42S02\n]]>\n </screen>\n </example>\n </para>\n </refsect1>\n\n <refsect1 role=\"seealso\">\n &reftitle.seealso;\n <para>\n <simplelist>\n <member><function>PDO::errorInfo</function></member>\n <member><function>PDOStatement::errorCode</function></member>\n <member><function>PDOStatement::errorInfo</function></member>\n </simplelist>\n </para>\n </refsect1>\n\n</refentry>\n\n<!-- Keep this comment at the end of the file\nLocal variables:\nmode: sgml\nsgml-omittag:t\nsgml-shorttag:t\nsgml-minimize-attributes:nil\nsgml-always-quote-attributes:t\nsgml-indent-step:1\nsgml-indent-data:t\nindent-tabs-mode:nil\nsgml-parent-document:nil\nsgml-default-dtd-file:\"~/.phpdoc/manual.ced\"\nsgml-exposed-tags:nil\nsgml-local-catalogs:nil\nsgml-local-ecat-files:nil\nEnd:\nvim600: syn=xml fen fdm=syntax fdl=2 si\nvim: et tw=78 syn=sgml\nvi: ts=1 sw=1\n-->\n", "meta": {"content_hash": "73d8d946771fdcc14cf6998b1bd95cbc", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 88, "avg_line_length": 30.823529411764707, "alnum_prop": 0.7178753180661578, "repo_name": "mziyut/.vim", "id": "ea49883a4a97a97df6871d8a3b0796ed54f52e3e", "size": "3144", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "dict/.neocomplete-php/phpdoc/en/reference/pdo/pdo/errorcode.xml", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "2223"}, {"name": "Ruby", "bytes": "939"}, {"name": "Shell", "bytes": "582"}, {"name": "Vim script", "bytes": "22415"}]}} +{"text": "@class DBTEAMLOGShowcaseChangeEnabledPolicyDetails;\n@class DBTEAMLOGShowcaseEnabledPolicy;\n\nNS_ASSUME_NONNULL_BEGIN\n\n#pragma mark - API Object\n\n///\n/// The `ShowcaseChangeEnabledPolicyDetails` struct.\n///\n/// Enabled/disabled Dropbox Showcase for team.\n///\n/// This class implements the `DBSerializable` protocol (serialize and\n/// deserialize instance methods), which is required for all Obj-C SDK API route\n/// objects.\n///\n@interface DBTEAMLOGShowcaseChangeEnabledPolicyDetails : NSObject <DBSerializable, NSCopying>\n\n#pragma mark - Instance fields\n\n/// New Dropbox Showcase policy.\n@property (nonatomic, readonly) DBTEAMLOGShowcaseEnabledPolicy *dNewValue;\n\n/// Previous Dropbox Showcase policy.\n@property (nonatomic, readonly) DBTEAMLOGShowcaseEnabledPolicy *previousValue;\n\n#pragma mark - Constructors\n\n///\n/// Full constructor for the struct (exposes all instance variables).\n///\n/// @param dNewValue New Dropbox Showcase policy.\n/// @param previousValue Previous Dropbox Showcase policy.\n///\n/// @return An initialized instance.\n///\n- (instancetype)initWithDNewValue:(DBTEAMLOGShowcaseEnabledPolicy *)dNewValue\n previousValue:(DBTEAMLOGShowcaseEnabledPolicy *)previousValue;\n\n- (instancetype)init NS_UNAVAILABLE;\n\n@end\n\n#pragma mark - Serializer Object\n\n///\n/// The serialization class for the `ShowcaseChangeEnabledPolicyDetails` struct.\n///\n@interface DBTEAMLOGShowcaseChangeEnabledPolicyDetailsSerializer : NSObject\n\n///\n/// Serializes `DBTEAMLOGShowcaseChangeEnabledPolicyDetails` instances.\n///\n/// @param instance An instance of the\n/// `DBTEAMLOGShowcaseChangeEnabledPolicyDetails` API object.\n///\n/// @return A json-compatible dictionary representation of the\n/// `DBTEAMLOGShowcaseChangeEnabledPolicyDetails` API object.\n///\n+ (nullable NSDictionary<NSString *, id> *)serialize:(DBTEAMLOGShowcaseChangeEnabledPolicyDetails *)instance;\n\n///\n/// Deserializes `DBTEAMLOGShowcaseChangeEnabledPolicyDetails` instances.\n///\n/// @param dict A json-compatible dictionary representation of the\n/// `DBTEAMLOGShowcaseChangeEnabledPolicyDetails` API object.\n///\n/// @return An instantiation of the\n/// `DBTEAMLOGShowcaseChangeEnabledPolicyDetails` object.\n///\n+ (DBTEAMLOGShowcaseChangeEnabledPolicyDetails *)deserialize:(NSDictionary<NSString *, id> *)dict;\n\n@end\n\nNS_ASSUME_NONNULL_END\n", "meta": {"content_hash": "7cada704aa20edb2aaf6eaa74265757f", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 109, "avg_line_length": 30.84, "alnum_prop": 0.7803718115002162, "repo_name": "dropbox/dropbox-sdk-obj-c", "id": "4194d7d885826347bfae1c3a7df01dd0018d3a11", "size": "2499", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Source/ObjectiveDropboxOfficial/Shared/Generated/ApiObjects/TeamLog/Headers/DBTEAMLOGShowcaseChangeEnabledPolicyDetails.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "1288"}, {"name": "CSS", "bytes": "6608"}, {"name": "Objective-C", "bytes": "18903013"}, {"name": "Python", "bytes": "7087"}, {"name": "Ruby", "bytes": "1819"}, {"name": "Shell", "bytes": "4527"}]}} +{"text": "Colocation API\n==============\nThe colocation API wraps the [TransIP colocation SOAP service](https://api.transip.nl/wsdl/?service=ColocationService).\n\n### General\nThe colocation API is available through the `Client` and can be accessed by calling `colocation()` or `api('colocation')`.\n\n### Methods\n\n#### Request access to the data-center.\n````php\n$visitors = [\n 'Firstname Lastname',\n];\n\n$client->colocation()->requestAccess('2012-12-23 00:00:00', 60, $visitors, '+31612312399');\n````\n\n#### Request remote hands.\n````php\n$client->colocation()->requestRemoteHands('colocationFoo', 'Firstname Lastname', '+31612312399', 60, 'Instructions');\n````\n\n#### Get colocation names.\n````php\n$client->colocation()->getColocationNames();\n````\n\n#### Get active IP addresses for a colocation.\n````php\n$client->colocation()->getIpAddresses('colocationFoo');\n````\n\n#### Get IP ranges for a colocation.\n````php\n$client->colocation()->getIpRanges('colocationFoo');\n````\n\n#### Create a new ipv4 or ipv6 address.\n````php\n$client->colocation()->createIpAddress('127.0.0.1', '127.0.0.1.in-addr.arpa');\n````\n\n#### Delete an IP address.\n````php\n$client->colocation()->deleteIpAddress('127.0.0.1');\n````\n\n#### Get Reverse DNS for an IP address.\n````php\n$client->colocation()->getReverseDns('127.0.0.1');\n````\n\n#### Set Reverse DNS for an IP address.\n````php\n$client->colocation()->setReverseDns('127.0.0.1', '127.0.0.1.in-addr.arpa');\n````\n", "meta": {"content_hash": "3081602bc39969c3a6b0d85f0a71ef14", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 122, "avg_line_length": 24.87719298245614, "alnum_prop": 0.6600846262341326, "repo_name": "hiddeco/transip", "id": "cee6da357547f79bbf8580cadd64ca9ac297c4f0", "size": "1418", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/colocation.md", "mode": "33188", "license": "mit", "language": [{"name": "PHP", "bytes": "106376"}]}} +{"text": "In the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our project and\nour community a harassment-free experience for everyone, regardless of age, body\nsize, disability, ethnicity, gender identity and expression, level of experience,\nnationality, personal appearance, race, religion, or sexual identity and\norientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or\n advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic\n address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a\n professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable\nbehavior and are expected to take appropriate and fair corrective action in\nresponse to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or\nreject comments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem inappropriate,\nthreatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces\nwhen an individual is representing the project or its community. Examples of\nrepresenting a project or community include using an official project e-mail\naddress, posting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event. Representation of a project may be\nfurther defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at david.herman@gmail.com. All\ncomplaints will be reviewed and investigated and will result in a response that\nis deemed necessary and appropriate to the circumstances. The project team is\nobligated to maintain confidentiality with regard to the reporter of an incident.\nFurther details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,\navailable at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\n\n[homepage]: https://www.contributor-covenant.org\n\n", "meta": {"content_hash": "07b054ce31c8b22baf2186e437aae8e1", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 87, "avg_line_length": 44.885714285714286, "alnum_prop": 0.8220878421387651, "repo_name": "neon-bindings/neon", "id": "8d9ce17b0b061c2e65523438d2e02c0458115ef5", "size": "3197", "binary": false, "copies": "4", "ref": "refs/heads/main", "path": "CODE_OF_CONDUCT.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "535"}, {"name": "Handlebars", "bytes": "878"}, {"name": "JavaScript", "bytes": "76759"}, {"name": "Rust", "bytes": "376937"}, {"name": "TypeScript", "bytes": "12138"}]}} +{"text": "<!DOCTYPE html >\n<html>\n <head>\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\" />\n <title>ScalaTest 3.0.6 - org.scalatest.enablers.Futuristic</title>\n <meta name=\"description\" content=\"ScalaTest 3.0.6 - org.scalatest.enablers.Futuristic\" />\n <meta name=\"keywords\" content=\"ScalaTest 3.0.6 org.scalatest.enablers.Futuristic\" />\n <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n \n <link href=\"../../../lib/index.css\" media=\"screen\" type=\"text/css\" rel=\"stylesheet\" />\n <link href=\"../../../lib/template.css\" media=\"screen\" type=\"text/css\" rel=\"stylesheet\" />\n <link href=\"../../../lib/diagrams.css\" media=\"screen\" type=\"text/css\" rel=\"stylesheet\" id=\"diagrams-css\" />\n <script type=\"text/javascript\" src=\"../../../lib/jquery.js\"></script>\n <script type=\"text/javascript\" src=\"../../../lib/jquery.panzoom.min.js\"></script>\n <script type=\"text/javascript\" src=\"../../../lib/jquery.mousewheel.min.js\"></script>\n <script type=\"text/javascript\" src=\"../../../lib/index.js\"></script>\n <script type=\"text/javascript\" src=\"../../../index.js\"></script>\n <script type=\"text/javascript\" src=\"../../../lib/scheduler.js\"></script>\n <script type=\"text/javascript\" src=\"../../../lib/template.js\"></script>\n <script type=\"text/javascript\" src=\"../../../lib/tools.tooltip.js\"></script>\n \n <script type=\"text/javascript\">\n /* this variable can be used by the JS to determine the path to the root document */\n var toRoot = '../../../';\n </script>\n \n\n\n<!-- gtag [javascript] -->\n\n<script async src=\"https://www.googletagmanager.com/gtag/js?id=UA-71294502-1\"></script>\n\n<script defer>\n\nwindow.dataLayer = window.dataLayer || [];\n\nfunction gtag(){dataLayer.push(arguments);}\n\ngtag('js', new Date());\n\ngtag('config', 'UA-71294502-1');\n\n</script>\n </head>\n <body>\n <div id=\"search\">\n <span id=\"doc-title\">ScalaTest 3.0.6<span id=\"doc-version\"></span></span>\n <span class=\"close-results\"><span class=\"left\"><</span> Back</span>\n <div id=\"textfilter\">\n <span class=\"input\">\n <input autocapitalize=\"none\" placeholder=\"Search\" id=\"index-input\" type=\"text\" accesskey=\"/\" />\n <i class=\"clear material-icons\">\ue14c</i>\n <i id=\"search-icon\" class=\"material-icons\">\ue8b6</i>\n </span>\n </div>\n </div>\n <div id=\"search-results\">\n <div id=\"search-progress\">\n <div id=\"progress-fill\"></div>\n </div>\n <div id=\"results-content\">\n <div id=\"entity-results\"></div>\n <div id=\"member-results\"></div>\n </div>\n </div>\n <div id=\"content-scroll-container\" style=\"-webkit-overflow-scrolling: touch;\">\n <div id=\"content-container\" style=\"-webkit-overflow-scrolling: touch;\">\n <div id=\"subpackage-spacer\">\n <div id=\"packages\">\n <h1>Packages</h1>\n <ul>\n <li name=\"_root_.root\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"_root_\"></a><a id=\"root:_root_\"></a>\n <span class=\"permalink\">\n <a href=\"index.html#_root_\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\"></span>\n <span class=\"kind\">package</span>\n </span>\n <span class=\"symbol\">\n <a title=\"\" href=\"../../../index.html\"><span class=\"name\">root</span></a>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd><a href=\"../../../index.html\" class=\"extype\" name=\"_root_\">root</a></dd></dl></div>\n </li><li name=\"_root_.org\" visbl=\"pub\" class=\"indented1 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"org\"></a><a id=\"org:org\"></a>\n <span class=\"permalink\">\n <a href=\"index.html#org\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\"></span>\n <span class=\"kind\">package</span>\n </span>\n <span class=\"symbol\">\n <a title=\"\" href=\"../../index.html\"><span class=\"name\">org</span></a>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd><a href=\"../../../index.html\" class=\"extype\" name=\"_root_\">root</a></dd></dl></div>\n </li><li name=\"org.scalatest\" visbl=\"pub\" class=\"indented2 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"scalatest\"></a><a id=\"scalatest:scalatest\"></a>\n <span class=\"permalink\">\n <a href=\"../org/index.html#scalatest\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\"></span>\n <span class=\"kind\">package</span>\n </span>\n <span class=\"symbol\">\n <a title=\"ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter.\" href=\"../index.html\"><span class=\"name\">scalatest</span></a>\n </span>\n \n <p class=\"shortcomment cmt\">ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter.</p><div class=\"fullcomment\"><div class=\"comment cmt\"><p>ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter.\n</p></div><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd><a href=\"../../index.html\" class=\"extype\" name=\"org\">org</a></dd></dl></div>\n </li><li name=\"org.scalatest.enablers\" visbl=\"pub\" class=\"indented3 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"enablers\"></a><a id=\"enablers:enablers\"></a>\n <span class=\"permalink\">\n <a href=\"../../org/scalatest/index.html#enablers\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\"></span>\n <span class=\"kind\">package</span>\n </span>\n <span class=\"symbol\">\n <a title=\"\" href=\"index.html\"><span class=\"name\">enablers</span></a>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd><a href=\"../index.html\" class=\"extype\" name=\"org.scalatest\">scalatest</a></dd></dl></div>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Aggregating$.html\" title=\"Companion object for Aggregating that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Aggregating.html\" title=\"Typeclass that enables for aggregations certain contain syntax in the ScalaTest matchers DSL.\"></a>\n <a href=\"Aggregating.html\" title=\"Typeclass that enables for aggregations certain contain syntax in the ScalaTest matchers DSL.\">Aggregating</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"trait\" href=\"AggregatingHighPriorityImplicits.html\" title=\"\"></a>\n <a href=\"AggregatingHighPriorityImplicits.html\" title=\"\">AggregatingHighPriorityImplicits</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"trait\" href=\"AggregatingImpls.html\" title=\"\"></a>\n <a href=\"AggregatingImpls.html\" title=\"\">AggregatingImpls</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"trait\" href=\"AggregatingJavaImplicits.html\" title=\"\"></a>\n <a href=\"AggregatingJavaImplicits.html\" title=\"\">AggregatingJavaImplicits</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"trait\" href=\"AggregatingStandardImplicits.html\" title=\"\"></a>\n <a href=\"AggregatingStandardImplicits.html\" title=\"\">AggregatingStandardImplicits</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"CheckerAsserting$.html\" title=\"Companion object to CheckerAsserting that provides two implicit providers, a higher priority one for passed functions that have result type Assertion, which also yields result type Assertion, and one for any other type, which yields result type Unit.\"></a>\n <a class=\"trait\" href=\"CheckerAsserting.html\" title=\"Supertrait for CheckerAsserting typeclasses, which are used to implement and determine the result type of GeneratorDrivenPropertyChecks's apply and forAll method.\"></a>\n <a href=\"CheckerAsserting.html\" title=\"Supertrait for CheckerAsserting typeclasses, which are used to implement and determine the result type of GeneratorDrivenPropertyChecks's apply and forAll method.\">CheckerAsserting</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Collecting$.html\" title=\"Companion object for Collecting that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Collecting.html\" title=\"Supertrait for typeclasses that enable loneElement and inspectors syntax for collections.\"></a>\n <a href=\"Collecting.html\" title=\"Supertrait for typeclasses that enable loneElement and inspectors syntax for collections.\">Collecting</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Containing$.html\" title=\"Companion object for Containing that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Containing.html\" title=\"Supertrait for typeclasses that enable certain contain matcher syntax for containers.\"></a>\n <a href=\"Containing.html\" title=\"Supertrait for typeclasses that enable certain contain matcher syntax for containers.\">Containing</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"trait\" href=\"ContainingHighPriorityImplicits.html\" title=\"\"></a>\n <a href=\"ContainingHighPriorityImplicits.html\" title=\"\">ContainingHighPriorityImplicits</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"trait\" href=\"ContainingImpls.html\" title=\"\"></a>\n <a href=\"ContainingImpls.html\" title=\"\">ContainingImpls</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"trait\" href=\"ContainingStandardImplicits.html\" title=\"\"></a>\n <a href=\"ContainingStandardImplicits.html\" title=\"\">ContainingStandardImplicits</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Definition$.html\" title=\"Companion object for Definition that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Definition.html\" title=\"Supertrait for typeclasses that enable the be defined matcher syntax.\"></a>\n <a href=\"Definition.html\" title=\"Supertrait for typeclasses that enable the be defined matcher syntax.\">Definition</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Emptiness$.html\" title=\"Companion object for Emptiness that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Emptiness.html\" title=\"Supertrait for typeclasses that enable be empty matcher syntax.\"></a>\n <a href=\"Emptiness.html\" title=\"Supertrait for typeclasses that enable be empty matcher syntax.\">Emptiness</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Existence$.html\" title=\"Companion object for Existence that provides implicit implementations for java.io.File.\"></a>\n <a class=\"trait\" href=\"Existence.html\" title=\"Supertrait for typeclasses that enable the exist matcher syntax.\"></a>\n <a href=\"Existence.html\" title=\"Supertrait for typeclasses that enable the exist matcher syntax.\">Existence</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"\" title=\"Companion object for trait Futuristic that contains implicit Futuristic providers for FutureOutcome and Future[T] for any type T.\"></a>\n <a class=\"trait\" href=\"Futuristic.html\" title=\"Supertrait for Futureistic typeclasses.\"></a>\n <a href=\"Futuristic.html\" title=\"Supertrait for Futureistic typeclasses.\">Futuristic</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"InspectorAsserting$.html\" title=\"Companion object to InspectorAsserting that provides two implicit providers, a higher priority one for passed functions that have result type Assertion, which also yields result type Assertion, and one for any other type, which yields result type Unit.\"></a>\n <a class=\"trait\" href=\"InspectorAsserting.html\" title=\"Supertrait for InspectorAsserting typeclasses, which are used to implement and determine the result type of Inspectors methods such as forAll, forBetween, etc.\"></a>\n <a href=\"InspectorAsserting.html\" title=\"Supertrait for InspectorAsserting typeclasses, which are used to implement and determine the result type of Inspectors methods such as forAll, forBetween, etc.\">InspectorAsserting</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"trait\" href=\"JavaContainingImplicits.html\" title=\"\"></a>\n <a href=\"JavaContainingImplicits.html\" title=\"\">JavaContainingImplicits</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"KeyMapping$.html\" title=\"Companion object for KeyMapping that provides implicit implementations for scala.collection.GenMap and java.util.Map.\"></a>\n <a class=\"trait\" href=\"KeyMapping.html\" title=\"Supertrait for typeclasses that enable contain key matcher syntax.\"></a>\n <a href=\"KeyMapping.html\" title=\"Supertrait for typeclasses that enable contain key matcher syntax.\">KeyMapping</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Length$.html\" title=\"Companion object for Length that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Length.html\" title=\"Supertrait for Length typeclasses.\"></a>\n <a href=\"Length.html\" title=\"Supertrait for Length typeclasses.\">Length</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Messaging$.html\" title=\"Companion object for Messaging that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Messaging.html\" title=\"Supertrait for Messaging typeclasses.\"></a>\n <a href=\"Messaging.html\" title=\"Supertrait for Messaging typeclasses.\">Messaging</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Readability$.html\" title=\"Companion object for Readability that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Readability.html\" title=\"Supertrait for typeclasses that enable the be readable matcher syntax.\"></a>\n <a href=\"Readability.html\" title=\"Supertrait for typeclasses that enable the be readable matcher syntax.\">Readability</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Sequencing$.html\" title=\"Companion object for Sequencing that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Sequencing.html\" title=\"Typeclass that enables for sequencing certain contain syntax in the ScalaTest matchers DSL.\"></a>\n <a href=\"Sequencing.html\" title=\"Typeclass that enables for sequencing certain contain syntax in the ScalaTest matchers DSL.\">Sequencing</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Size$.html\" title=\"Companion object for Size that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Size.html\" title=\"Supertrait for Size typeclasses.\"></a>\n <a href=\"Size.html\" title=\"Supertrait for Size typeclasses.\">Size</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Sortable$.html\" title=\"Companion object for Sortable that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Sortable.html\" title=\"Supertrait for typeclasses that enable the be sorted matcher syntax.\"></a>\n <a href=\"Sortable.html\" title=\"Supertrait for typeclasses that enable the be sorted matcher syntax.\">Sortable</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"TableAsserting$.html\" title=\"Companion object to TableAsserting that provides two implicit providers, a higher priority one for passed functions that have result type Assertion, which also yields result type Assertion, and one for any other type, which yields result type Unit.\"></a>\n <a class=\"trait\" href=\"TableAsserting.html\" title=\"Supertrait for TableAsserting typeclasses, which are used to implement and determine the result type of TableDrivenPropertyChecks's forAll, forEvery and exists method.\"></a>\n <a href=\"TableAsserting.html\" title=\"Supertrait for TableAsserting typeclasses, which are used to implement and determine the result type of TableDrivenPropertyChecks's forAll, forEvery and exists method.\">TableAsserting</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Timed$.html\" title=\"Companion object for Timed typeclass that offers three implicit providers: one for FutureOutcome, one for Future of any type, and one for any other type.\"></a>\n <a class=\"trait\" href=\"Timed.html\" title=\"Trait that provides a timeoutAfter construct, which allows you to specify a timeout for an operation passed as a by-name parameter, as well as a way to signal/interrupt it if the operation exceeds its time limit.\"></a>\n <a href=\"Timed.html\" title=\"Trait that provides a timeoutAfter construct, which allows you to specify a timeout for an operation passed as a by-name parameter, as well as a way to signal/interrupt it if the operation exceeds its time limit.\">Timed</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"class\" href=\"UnitCheckerAsserting.html\" title=\"Class holding lowest priority CheckerAsserting implicit, which enables GeneratorDrivenPropertyChecks expressions that have result type Unit.\"></a>\n <a href=\"UnitCheckerAsserting.html\" title=\"Class holding lowest priority CheckerAsserting implicit, which enables GeneratorDrivenPropertyChecks expressions that have result type Unit.\">UnitCheckerAsserting</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"class\" href=\"UnitInspectorAsserting.html\" title=\"Class holding lowest priority InspectorAsserting implicit, which enables inspector expressions that have result type Unit.\"></a>\n <a href=\"UnitInspectorAsserting.html\" title=\"Class holding lowest priority InspectorAsserting implicit, which enables inspector expressions that have result type Unit.\">UnitInspectorAsserting</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"class\" href=\"UnitTableAsserting.html\" title=\"Class holding lowest priority TableAsserting implicit, which enables TableDrivenPropertyChecks expressions that have result type Unit.\"></a>\n <a href=\"UnitTableAsserting.html\" title=\"Class holding lowest priority TableAsserting implicit, which enables TableDrivenPropertyChecks expressions that have result type Unit.\">UnitTableAsserting</a>\n </li><li class=\"current-entities indented3\">\n <span class=\"separator\"></span>\n <a class=\"class\" href=\"UnitWheneverAsserting.html\" title=\"Class holding lowest priority WheneverAsserting implicit, which enables Whenever expressions that have result type Unit.\"></a>\n <a href=\"UnitWheneverAsserting.html\" title=\"Class holding lowest priority WheneverAsserting implicit, which enables Whenever expressions that have result type Unit.\">UnitWheneverAsserting</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"ValueMapping$.html\" title=\"Companion object for ValueMapping that provides implicit implementations for scala.collection.GenMap and java.util.Map.\"></a>\n <a class=\"trait\" href=\"ValueMapping.html\" title=\"Supertrait for typeclasses that enable contain value matcher syntax.\"></a>\n <a href=\"ValueMapping.html\" title=\"Supertrait for typeclasses that enable contain value matcher syntax.\">ValueMapping</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"WheneverAsserting$.html\" title=\"Companion object to WheneverAsserting that provides two implicit providers, a higher priority one for passed functions that have result type Assertion, which also yields result type Assertion, and one for any other type, which yields result type Unit.\"></a>\n <a class=\"trait\" href=\"WheneverAsserting.html\" title=\"Supertrait for WheneverAsserting typeclasses, which are used to implement and determine the result type of Whenever's whenever method.\"></a>\n <a href=\"WheneverAsserting.html\" title=\"Supertrait for WheneverAsserting typeclasses, which are used to implement and determine the result type of Whenever's whenever method.\">WheneverAsserting</a>\n </li><li class=\"current-entities indented3\">\n <a class=\"object\" href=\"Writability$.html\" title=\"Companion object for Writability that provides implicit implementations for the following types:\"></a>\n <a class=\"trait\" href=\"Writability.html\" title=\"Supertrait for typeclasses that enable the be writable matcher syntax.\"></a>\n <a href=\"Writability.html\" title=\"Supertrait for typeclasses that enable the be writable matcher syntax.\">Writability</a>\n </li>\n </ul>\n </div>\n </div>\n <div id=\"content\">\n <body class=\"object value\">\n\n<!-- Top of doc.scalatest.org [javascript] -->\n\n<script type=\"text/javascript\">\n\nvar rnd = window.rnd || Math.floor(Math.random()*10e6);\n\nvar pid204546 = window.pid204546 || rnd;\n\nvar plc204546 = window.plc204546 || 0;\n\nvar abkw = window.abkw || '';\n\nvar absrc = 'http://ab167933.adbutler-ikon.com/adserve/;ID=167933;size=468x60;setID=204546;type=js;sw='+screen.width+';sh='+screen.height+';spr='+window.devicePixelRatio+';kw='+abkw+';pid='+pid204546+';place='+(plc204546++)+';rnd='+rnd+';click=CLICK_MACRO_PLACEHOLDER';\n\ndocument.write('<scr'+'ipt src=\"'+absrc+'\" type=\"text/javascript\"></scr'+'ipt>');\n\n</script>\n\n <div id=\"definition\">\n <a href=\"Futuristic.html\" title=\"See companion trait\"><div class=\"big-circle object-companion-trait\">o</div></a>\n <p id=\"owner\"><a href=\"../../index.html\" class=\"extype\" name=\"org\">org</a>.<a href=\"../index.html\" class=\"extype\" name=\"org.scalatest\">scalatest</a>.<a href=\"index.html\" class=\"extype\" name=\"org.scalatest.enablers\">enablers</a></p>\n <h1><a href=\"Futuristic.html\" title=\"See companion trait\">Futuristic</a><span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span></h1>\n <h3><span class=\"morelinks\"><div>\n Companion <a href=\"Futuristic.html\" title=\"See companion trait\">trait Futuristic</a>\n </div></span></h3>\n </div>\n\n <h4 id=\"signature\" class=\"signature\">\n <span class=\"modifier_kind\">\n <span class=\"modifier\"></span>\n <span class=\"kind\">object</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">Futuristic</span>\n </span>\n </h4>\n\n \n <div id=\"comment\" class=\"fullcommenttop\"><div class=\"comment cmt\"><p>Companion object for trait <code>Futuristic</code> that contains implicit <code>Futuristic</code> providers for\n<code>FutureOutcome</code> and <code>Future[T]</code> for any type <code>T</code>.\n</p></div><dl class=\"attributes block\"> <dt>Source</dt><dd><a href=\"https://github.com/scalatest/scalatest/tree/release-3.0.6/scalatest//src/main/scala/org/scalatest/enablers/Futuristic.scala\" target=\"_blank\">Futuristic.scala</a></dd></dl><div class=\"toggleContainer block\">\n <span class=\"toggle\">\n Linear Supertypes\n </span>\n <div class=\"superTypes hiddenContent\"><span class=\"extype\" name=\"scala.AnyRef\">AnyRef</span>, <span class=\"extype\" name=\"scala.Any\">Any</span></div>\n </div></div>\n \n\n <div id=\"mbrsel\">\n <div class=\"toggle\"></div>\n <div id=\"memberfilter\">\n <i class=\"material-icons arrow\">\ue037</i>\n <span class=\"input\">\n <input id=\"mbrsel-input\" placeholder=\"Filter all members\" type=\"text\" accesskey=\"/\" />\n </span>\n <i class=\"clear material-icons\">\ue14c</i>\n </div>\n <div id=\"filterby\">\n <div id=\"order\">\n <span class=\"filtertype\">Ordering</span>\n <ol>\n \n <li class=\"alpha in\"><span>Alphabetic</span></li>\n <li class=\"inherit out\"><span>By Inheritance</span></li>\n </ol>\n </div>\n <div class=\"ancestors\">\n <span class=\"filtertype\">Inherited<br />\n </span>\n <ol id=\"linearization\">\n <li class=\"in\" name=\"org.scalatest.enablers.Futuristic\"><span>Futuristic</span></li><li class=\"in\" name=\"scala.AnyRef\"><span>AnyRef</span></li><li class=\"in\" name=\"scala.Any\"><span>Any</span></li>\n </ol>\n </div><div class=\"ancestors\">\n <span class=\"filtertype\"></span>\n <ol>\n <li class=\"hideall out\"><span>Hide All</span></li>\n <li class=\"showall in\"><span>Show All</span></li>\n </ol>\n </div>\n <div id=\"visbl\">\n <span class=\"filtertype\">Visibility</span>\n <ol><li class=\"public in\"><span>Public</span></li><li class=\"all out\"><span>All</span></li></ol>\n </div>\n </div>\n </div>\n\n <div id=\"template\">\n <div id=\"allMembers\">\n \n\n \n\n \n\n <div class=\"values members\">\n <h3>Value Members</h3>\n <ol>\n <li name=\"scala.AnyRef#!=\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"!=(x$1:Any):Boolean\"></a><a id=\"!=(Any):Boolean\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#!=(x$1:Any):Boolean\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span title=\"gt4s: $bang$eq\" class=\"name\">!=</span><span class=\"params\">(<span name=\"arg0\">arg0: <span class=\"extype\" name=\"scala.Any\">Any</span></span>)</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Boolean\">Boolean</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef \u2192 Any</dd></dl></div>\n </li><li name=\"scala.AnyRef###\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"##():Int\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html###():Int\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span title=\"gt4s: $hash$hash\" class=\"name\">##</span><span class=\"params\">()</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Int\">Int</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef \u2192 Any</dd></dl></div>\n </li><li name=\"scala.AnyRef#==\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"==(x$1:Any):Boolean\"></a><a id=\"==(Any):Boolean\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#==(x$1:Any):Boolean\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span title=\"gt4s: $eq$eq\" class=\"name\">==</span><span class=\"params\">(<span name=\"arg0\">arg0: <span class=\"extype\" name=\"scala.Any\">Any</span></span>)</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Boolean\">Boolean</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef \u2192 Any</dd></dl></div>\n </li><li name=\"scala.Any#asInstanceOf\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"asInstanceOf[T0]:T0\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#asInstanceOf[T0]:T0\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">asInstanceOf</span><span class=\"tparams\">[<span name=\"T0\">T0</span>]</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Any.asInstanceOf.T0\">T0</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>\n </li><li name=\"scala.AnyRef#clone\" visbl=\"prt\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"clone():Object\"></a><a id=\"clone():AnyRef\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#clone():Object\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\"></span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">clone</span><span class=\"params\">()</span><span class=\"result\">: <span class=\"extype\" name=\"scala.AnyRef\">AnyRef</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Attributes</dt><dd>protected[<a href=\"../../../java/lang/index.html\" class=\"extype\" name=\"java.lang\">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>\n <span class=\"name\">@native</span><span class=\"args\">()</span>\n \n <span class=\"name\">@throws</span><span class=\"args\">(<span>\n \n <span class=\"defval\" name=\"classOf[java.lang.CloneNotSupportedException]\">...</span>\n </span>)</span>\n \n </dd></dl></div>\n </li><li name=\"scala.AnyRef#eq\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"eq(x$1:AnyRef):Boolean\"></a><a id=\"eq(AnyRef):Boolean\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#eq(x$1:AnyRef):Boolean\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">eq</span><span class=\"params\">(<span name=\"arg0\">arg0: <span class=\"extype\" name=\"scala.AnyRef\">AnyRef</span></span>)</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Boolean\">Boolean</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>\n </li><li name=\"scala.AnyRef#equals\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"equals(x$1:Any):Boolean\"></a><a id=\"equals(Any):Boolean\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#equals(x$1:Any):Boolean\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\"></span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">equals</span><span class=\"params\">(<span name=\"arg0\">arg0: <span class=\"extype\" name=\"scala.Any\">Any</span></span>)</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Boolean\">Boolean</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef \u2192 Any</dd></dl></div>\n </li><li name=\"scala.AnyRef#finalize\" visbl=\"prt\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"finalize():Unit\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#finalize():Unit\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\"></span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">finalize</span><span class=\"params\">()</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Unit\">Unit</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Attributes</dt><dd>protected[<a href=\"../../../java/lang/index.html\" class=\"extype\" name=\"java.lang\">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>\n <span class=\"name\">@throws</span><span class=\"args\">(<span>\n \n <span class=\"symbol\">classOf[java.lang.Throwable]</span>\n </span>)</span>\n \n </dd></dl></div>\n </li><li name=\"org.scalatest.enablers.Futuristic#futuristicNatureOfFutureOf\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"futuristicNatureOfFutureOf[V](implicitexecutionContext:scala.concurrent.ExecutionContext):org.scalatest.enablers.Futuristic[scala.concurrent.Future[V]]\"></a><a id=\"futuristicNatureOfFutureOf[V](ExecutionContext):Futuristic[Future[V]]\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#futuristicNatureOfFutureOf[V](implicitexecutionContext:scala.concurrent.ExecutionContext):org.scalatest.enablers.Futuristic[scala.concurrent.Future[V]]\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">implicit </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">futuristicNatureOfFutureOf</span><span class=\"tparams\">[<span name=\"V\">V</span>]</span><span class=\"params\">(<span class=\"implicit\">implicit </span><span name=\"executionContext\">executionContext: <span class=\"extype\" name=\"scala.concurrent.ExecutionContext\">ExecutionContext</span></span>)</span><span class=\"result\">: <a href=\"Futuristic.html\" class=\"extype\" name=\"org.scalatest.enablers.Futuristic\">Futuristic</a>[<span class=\"extype\" name=\"scala.concurrent.Future\">Future</span>[<span class=\"extype\" name=\"org.scalatest.enablers.Futuristic.futuristicNatureOfFutureOf.V\">V</span>]]</span>\n </span>\n \n <p class=\"shortcomment cmt\">Provides a <code>Futuristic</code> value for <code>Future[V]</code> for any type <code>V</code> that performs cleanup using the\nimplicitly provided execution context.</p><div class=\"fullcomment\"><div class=\"comment cmt\"><p>Provides a <code>Futuristic</code> value for <code>Future[V]</code> for any type <code>V</code> that performs cleanup using the\nimplicitly provided execution context.\n</p></div><dl class=\"paramcmts block\"><dt class=\"param\">executionContext</dt><dd class=\"cmt\"><p>an execution context that provides a strategy for executing the cleanup function</p></dd><dt>returns</dt><dd class=\"cmt\"><p>a <code>Futuristic</code> instance for <code>Future[V]</code></p></dd></dl></div>\n </li><li name=\"org.scalatest.enablers.Futuristic#futuristicNatureOfFutureOutcome\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"futuristicNatureOfFutureOutcome(implicitexecutionContext:scala.concurrent.ExecutionContext):org.scalatest.enablers.Futuristic[org.scalatest.FutureOutcome]\"></a><a id=\"futuristicNatureOfFutureOutcome(ExecutionContext):Futuristic[FutureOutcome]\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#futuristicNatureOfFutureOutcome(implicitexecutionContext:scala.concurrent.ExecutionContext):org.scalatest.enablers.Futuristic[org.scalatest.FutureOutcome]\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">implicit </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">futuristicNatureOfFutureOutcome</span><span class=\"params\">(<span class=\"implicit\">implicit </span><span name=\"executionContext\">executionContext: <span class=\"extype\" name=\"scala.concurrent.ExecutionContext\">ExecutionContext</span></span>)</span><span class=\"result\">: <a href=\"Futuristic.html\" class=\"extype\" name=\"org.scalatest.enablers.Futuristic\">Futuristic</a>[<a href=\"../FutureOutcome.html\" class=\"extype\" name=\"org.scalatest.FutureOutcome\">FutureOutcome</a>]</span>\n </span>\n \n <p class=\"shortcomment cmt\">Provides a <code>Futuristic</code> value for <code>FutureOutcome</code> that performs cleanup using the\nimplicitly provided execution context.</p><div class=\"fullcomment\"><div class=\"comment cmt\"><p>Provides a <code>Futuristic</code> value for <code>FutureOutcome</code> that performs cleanup using the\nimplicitly provided execution context.\n</p></div><dl class=\"paramcmts block\"><dt class=\"param\">executionContext</dt><dd class=\"cmt\"><p>an execution context that provides a strategy for executing the cleanup function</p></dd><dt>returns</dt><dd class=\"cmt\"><p>a <code>Futuristic</code> instance for <code>FutureOutcome</code></p></dd></dl></div>\n </li><li name=\"scala.AnyRef#getClass\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"getClass():Class[_]\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#getClass():Class[_]\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">getClass</span><span class=\"params\">()</span><span class=\"result\">: <span class=\"extype\" name=\"java.lang.Class\">Class</span>[_]</span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef \u2192 Any</dd><dt>Annotations</dt><dd>\n <span class=\"name\">@native</span><span class=\"args\">()</span>\n \n </dd></dl></div>\n </li><li name=\"scala.AnyRef#hashCode\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"hashCode():Int\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#hashCode():Int\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\"></span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">hashCode</span><span class=\"params\">()</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Int\">Int</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef \u2192 Any</dd><dt>Annotations</dt><dd>\n <span class=\"name\">@native</span><span class=\"args\">()</span>\n \n </dd></dl></div>\n </li><li name=\"scala.Any#isInstanceOf\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"isInstanceOf[T0]:Boolean\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#isInstanceOf[T0]:Boolean\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">isInstanceOf</span><span class=\"tparams\">[<span name=\"T0\">T0</span>]</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Boolean\">Boolean</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>\n </li><li name=\"scala.AnyRef#ne\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"ne(x$1:AnyRef):Boolean\"></a><a id=\"ne(AnyRef):Boolean\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#ne(x$1:AnyRef):Boolean\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">ne</span><span class=\"params\">(<span name=\"arg0\">arg0: <span class=\"extype\" name=\"scala.AnyRef\">AnyRef</span></span>)</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Boolean\">Boolean</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>\n </li><li name=\"scala.AnyRef#notify\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"notify():Unit\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#notify():Unit\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">notify</span><span class=\"params\">()</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Unit\">Unit</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>\n <span class=\"name\">@native</span><span class=\"args\">()</span>\n \n </dd></dl></div>\n </li><li name=\"scala.AnyRef#notifyAll\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"notifyAll():Unit\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#notifyAll():Unit\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">notifyAll</span><span class=\"params\">()</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Unit\">Unit</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>\n <span class=\"name\">@native</span><span class=\"args\">()</span>\n \n </dd></dl></div>\n </li><li name=\"scala.AnyRef#synchronized\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"synchronized[T0](x$1:=>T0):T0\"></a><a id=\"synchronized[T0](\u21d2T0):T0\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#synchronized[T0](x$1:=>T0):T0\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">synchronized</span><span class=\"tparams\">[<span name=\"T0\">T0</span>]</span><span class=\"params\">(<span name=\"arg0\">arg0: \u21d2 <span class=\"extype\" name=\"java.lang.AnyRef.synchronized.T0\">T0</span></span>)</span><span class=\"result\">: <span class=\"extype\" name=\"java.lang.AnyRef.synchronized.T0\">T0</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>\n </li><li name=\"scala.AnyRef#toString\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"toString():String\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#toString():String\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\"></span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">toString</span><span class=\"params\">()</span><span class=\"result\">: <span class=\"extype\" name=\"java.lang.String\">String</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef \u2192 Any</dd></dl></div>\n </li><li name=\"scala.AnyRef#wait\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"wait():Unit\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#wait():Unit\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">wait</span><span class=\"params\">()</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Unit\">Unit</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>\n <span class=\"name\">@throws</span><span class=\"args\">(<span>\n \n <span class=\"defval\" name=\"classOf[java.lang.InterruptedException]\">...</span>\n </span>)</span>\n \n </dd></dl></div>\n </li><li name=\"scala.AnyRef#wait\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"wait(x$1:Long,x$2:Int):Unit\"></a><a id=\"wait(Long,Int):Unit\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#wait(x$1:Long,x$2:Int):Unit\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">wait</span><span class=\"params\">(<span name=\"arg0\">arg0: <span class=\"extype\" name=\"scala.Long\">Long</span></span>, <span name=\"arg1\">arg1: <span class=\"extype\" name=\"scala.Int\">Int</span></span>)</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Unit\">Unit</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>\n <span class=\"name\">@throws</span><span class=\"args\">(<span>\n \n <span class=\"defval\" name=\"classOf[java.lang.InterruptedException]\">...</span>\n </span>)</span>\n \n </dd></dl></div>\n </li><li name=\"scala.AnyRef#wait\" visbl=\"pub\" class=\"indented0 \" data-isabs=\"false\" fullComment=\"yes\" group=\"Ungrouped\">\n <a id=\"wait(x$1:Long):Unit\"></a><a id=\"wait(Long):Unit\"></a>\n <span class=\"permalink\">\n <a href=\"../../../org/scalatest/enablers/Futuristic$.html#wait(x$1:Long):Unit\" title=\"Permalink\">\n <i class=\"material-icons\">\ue157</i>\n </a>\n </span>\n <span class=\"modifier_kind\">\n <span class=\"modifier\">final </span>\n <span class=\"kind\">def</span>\n </span>\n <span class=\"symbol\">\n <span class=\"name\">wait</span><span class=\"params\">(<span name=\"arg0\">arg0: <span class=\"extype\" name=\"scala.Long\">Long</span></span>)</span><span class=\"result\">: <span class=\"extype\" name=\"scala.Unit\">Unit</span></span>\n </span>\n \n <div class=\"fullcomment\"><dl class=\"attributes block\"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>\n <span class=\"name\">@native</span><span class=\"args\">()</span>\n \n <span class=\"name\">@throws</span><span class=\"args\">(<span>\n \n <span class=\"defval\" name=\"classOf[java.lang.InterruptedException]\">...</span>\n </span>)</span>\n \n </dd></dl></div>\n </li>\n </ol>\n </div>\n\n \n\n \n </div>\n\n <div id=\"inheritedMembers\">\n <div class=\"parent\" name=\"scala.AnyRef\">\n <h3>Inherited from <span class=\"extype\" name=\"scala.AnyRef\">AnyRef</span></h3>\n </div><div class=\"parent\" name=\"scala.Any\">\n <h3>Inherited from <span class=\"extype\" name=\"scala.Any\">Any</span></h3>\n </div>\n \n </div>\n\n <div id=\"groupedMembers\">\n <div class=\"group\" name=\"Ungrouped\">\n <h3>Ungrouped</h3>\n \n </div>\n </div>\n\n </div>\n\n <div id=\"tooltip\"></div>\n\n <div id=\"footer\"> </div>\n </body>\n </div>\n </div>\n </div>\n </body>\n </html>\n", "meta": {"content_hash": "eeadef58937ad6a35ddd7048ab8de70d", "timestamp": "", "source": "github", "line_count": 801, "max_line_length": 617, "avg_line_length": 65.77153558052434, "alnum_prop": 0.6138412770723004, "repo_name": "scalatest/scalatest-website", "id": "21fd965f82e513f76bb7a68269f6f12270d9a4b4", "size": "52761", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/scaladoc/3.0.6/org/scalatest/enablers/Futuristic$.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "8401192"}, {"name": "HTML", "bytes": "4508833233"}, {"name": "JavaScript", "bytes": "12256885"}, {"name": "Procfile", "bytes": "62"}, {"name": "Scala", "bytes": "136544"}]}} +{"text": "<?php\n/**\n *\n * @author Alberto 'alb-i986' Scotto\n */\n\n\n#namespace BootstraPHPed;\n#use BootstraPHPed\\classes\\Persistence;\n\n/*\nspl_autoload_register( function( $class ) {\n\t$class_filename = 'models/class-' . strtolower($class) . '.php';\n\techo '<p>loading class '.$class_filename;\n require_once $class_filename;\n});\n*/\n\nrequire_once './config.inc.php';\n\n// sets the defaults for the constants that have not been defined in config.inc.php\nif( !defined('DEBUG_MODE') )\n\tdefine( 'DEBUG_MODE', false );\nif( !defined('HOSTNAME') )\n\tdefine( 'HOSTNAME', $_SERVER['HTTP_HOST'] );\nif( !defined('URL_BASE') )\n\tdefine( 'URL_BASE', '/' );\nif( !defined('SYSTEM_NAME') )\n\tdefine( 'SYSTEM_NAME', 'BootstraPHPed Web Site' );\nif( !defined('WEBMASTER_NAME') )\n\tdefine( 'WEBMASTER_NAME', 'webmaster' );\nif( !defined('WEBMASTER_EMAIL') )\n\tdefine( 'WEBMASTER_EMAIL', 'webmaster@'.HOSTNAME );\nif( !defined('TZ') )\n\tdefine( 'TZ', 'Europe/Rome' );\n\n// define some paths\ndefine( 'ROOT_ABSPATH', realpath(__DIR__ . '/..') );\t// absolute path of the root (not exposed by the web server)\ndefine( 'PUBLIC_ROOT_ABSPATH', __DIR__ );\t\t\t// absolute path of the public dir containing PHP scripts exposed by the web server\ndefine( 'CLASS_PATH', ROOT_ABSPATH . '/classes/');\ndefine( 'FORM_HANDLERS_RELPATH', './form_handlers/');\ndefine( 'VIEWS_PATH', ROOT_ABSPATH.'/views/');\ndefine( 'LOGS_PATH', ROOT_ABSPATH . '/logs/');\n\ndefine( 'URL_HOME', 'http://'. $_SERVER['HTTP_HOST'] . URL_BASE);\t// URL of the home page (useful for redirects)\n\n// Now, require all the core PHP scripts\n\n// 3rd party libraries\nrequire_once ROOT_ABSPATH.'/lib/adodb5/adodb.inc.php';\nrequire_once ROOT_ABSPATH.'/lib/log4php/Logger.php';\nrequire_once ROOT_ABSPATH.'/lib/phpass-0.3/PasswordHash.php';\n\n// CLASSES imports\n\n// EXCEPTIONS\nrequire_once CLASS_PATH.'class-exception-adodb.php';\nrequire_once CLASS_PATH.'class-exception-illegal-object-state.php';\nrequire_once CLASS_PATH.'class-exception-validation.php';\n\nrequire_once CLASS_PATH.'models/class-dao_core.php';\nrequire_once CLASS_PATH.'models/class-dao.php';\n// MODELS\nrequire_once CLASS_PATH.'models/class-model.php';\n\t// ELEMENTS\n\trequire_once CLASS_PATH.'models/class-element.php';\n\t\t//require_once CLASS_PATH.'models/class-role.php';\n\t\trequire_once CLASS_PATH.'models/class-user.php';\n\t\t//require_once CLASS_PATH.'models/class-post.php';\n\t// COLLECTIONS\n\t//require_once CLASS_PATH.'models/class-collection.php';\n\t//\trequire_once CLASS_PATH.'models/class-users.php';\n\nrequire_once './session.inc.php';\n\n\n$dao = DAO::getInstance();\n\n// default exception handler\nset_exception_handler( function($ex) {\n\tif( DEBUG_MODE == true )\n\t\t$msg = nl2br(\"Uncaught exception:\\n\" . $ex->getMessage() . \"\\n\". $ex->getTraceAsString() . \"\\n\");\n\telse\n\t\t$msg = nl2br(\"Uncaught exception:\\n\" . $ex->getMessage() . \"\\n\");\n\tshowErr(0, $msg);\n});\n\ndate_default_timezone_set(TZ);", "meta": {"content_hash": "baa426815e318e78755a6878466bca2d", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 127, "avg_line_length": 32.40909090909091, "alnum_prop": 0.6875876577840112, "repo_name": "alb-i986/BootstraPHPed", "id": "220758f0f18e16c85dd8d370d9d33c57d139b134", "size": "2852", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/globals.inc.php", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "2283"}, {"name": "JavaScript", "bytes": "18698"}, {"name": "PHP", "bytes": "1943328"}, {"name": "XSLT", "bytes": "28086"}]}} +{"text": "/*Jeu du pendu r\u00e9alis\u00e9 par Romain Dauby*/\n\n#ifndef FCT_H_INCLUDED\n#define FCT_H_INCLUDED\n\nint cpt;\n\n\nchar lireCaractere();\nvoid afficherCoups(int cpt);\nchar proposezLettre();\nvoid afficherMotSecret(int *table, const char *table2);\nvoid initialiser_motTrouve(int *table, int taille);\nvoid testLettre(char lettre, int *table1, const char *table2);\nint testGagne(int *motTrouve, const char *motSecret);\n\n#endif // FCT_H_INCLUDED\n", "meta": {"content_hash": "41d70a2b4f3c082da346dc5b85d9c2a0", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 62, "avg_line_length": 25.058823529411764, "alnum_prop": 0.7582159624413145, "repo_name": "r0mdau/boutsdeCodeBlocks", "id": "21cf174d834730b1693b8d838fc6186c54597ff0", "size": "426", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pendu/fct.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "9699"}, {"name": "C++", "bytes": "14433"}]}} +{"text": "\ufeff#nullable enable\nnamespace Gu.Reactive\n{\n using System;\n using System.Collections.ObjectModel;\n using System.ComponentModel;\n using System.Linq.Expressions;\n\n /// <summary>\n /// Factory methods for creating trackers for max value.\n /// </summary>\n public static class MaxTracker\n {\n /// <summary>\n /// Creates a <see cref=\"MaxTracker{TValue}\"/> for <paramref name=\"source\"/>\n /// </summary>\n /// <typeparam name=\"TItem\">The type of the items in <paramref name=\"source\"/></typeparam>\n /// <typeparam name=\"TValue\">The type of the max value.</typeparam>\n /// <param name=\"source\">The source collection.</param>\n /// <param name=\"selector\">The function used when producing a value from an item.</param>\n /// <returns>A tracker with Value synced with source.Max()</returns>\n public static MaxTracker<TValue> TrackMax<TItem, TValue>(this ObservableCollection<TItem> source, Expression<Func<TItem, TValue>> selector)\n where TItem : class, INotifyPropertyChanged\n where TValue : struct, IComparable<TValue>\n {\n return new MaxTracker<TValue>(new NestedChanges<ObservableCollection<TItem>, TItem, TValue>(source, selector));\n }\n\n /// <summary>\n /// Creates a <see cref=\"MaxTracker{TValue}\"/> for <paramref name=\"source\"/>\n /// </summary>\n /// <typeparam name=\"TValue\">The type of the max value.</typeparam>\n /// <param name=\"source\">The source collection.</param>\n /// <returns>A tracker with Value synced with source.Max()</returns>\n public static MaxTracker<TValue> TrackMax<TValue>(this ObservableCollection<TValue> source)\n where TValue : struct, IComparable<TValue>\n {\n return new MaxTracker<TValue>(new SimpleChanges<ObservableCollection<TValue>, TValue>(source));\n }\n\n /// <summary>\n /// Creates a <see cref=\"MaxTracker{TValue}\"/> for <paramref name=\"source\"/>\n /// </summary>\n /// <typeparam name=\"TItem\">The type of the items in <paramref name=\"source\"/></typeparam>\n /// <typeparam name=\"TValue\">The type of the max value.</typeparam>\n /// <param name=\"source\">The source collection.</param>\n /// <param name=\"selector\">The function used when producing a value from an item.</param>\n /// <returns>A tracker with Value synced with source.Max()</returns>\n public static MaxTracker<TValue> TrackMax<TItem, TValue>(this ReadOnlyObservableCollection<TItem> source, Expression<Func<TItem, TValue>> selector)\n where TItem : class, INotifyPropertyChanged\n where TValue : struct, IComparable<TValue>\n {\n return new MaxTracker<TValue>(new NestedChanges<ReadOnlyObservableCollection<TItem>, TItem, TValue>(source, selector));\n }\n\n /// <summary>\n /// Creates a <see cref=\"MaxTracker{TValue}\"/> for <paramref name=\"source\"/>\n /// </summary>\n /// <typeparam name=\"TValue\">The type of the max value.</typeparam>\n /// <param name=\"source\">The source collection.</param>\n /// <returns>A tracker with Value synced with source.Max()</returns>\n public static MaxTracker<TValue> TrackMax<TValue>(this ReadOnlyObservableCollection<TValue> source)\n where TValue : struct, IComparable<TValue>\n {\n return new MaxTracker<TValue>(new SimpleChanges<ReadOnlyObservableCollection<TValue>, TValue>(source));\n }\n\n /// <summary>\n /// Creates a <see cref=\"MaxTracker{TValue}\"/> for <paramref name=\"source\"/>\n /// </summary>\n /// <typeparam name=\"TItem\">The type of the items in <paramref name=\"source\"/></typeparam>\n /// <typeparam name=\"TValue\">The type of the max value.</typeparam>\n /// <param name=\"source\">The source collection.</param>\n /// <param name=\"selector\">The function used when producing a value from an item.</param>\n /// <returns>A tracker with Value synced with source.Max()</returns>\n public static MaxTracker<TValue> TrackMax<TItem, TValue>(this IReadOnlyObservableCollection<TItem> source, Expression<Func<TItem, TValue>> selector)\n where TItem : class, INotifyPropertyChanged\n where TValue : struct, IComparable<TValue>\n {\n return new MaxTracker<TValue>(new NestedChanges<IReadOnlyObservableCollection<TItem>, TItem, TValue>(source, selector));\n }\n\n /// <summary>\n /// Creates a <see cref=\"MaxTracker{TValue}\"/> for <paramref name=\"source\"/>\n /// </summary>\n /// <typeparam name=\"TValue\">The type of the max value.</typeparam>\n /// <param name=\"source\">The source collection.</param>\n /// <returns>A tracker with Value synced with source.Max()</returns>\n public static MaxTracker<TValue> TrackMax<TValue>(this IReadOnlyObservableCollection<TValue> source)\n where TValue : struct, IComparable<TValue>\n {\n return new MaxTracker<TValue>(new SimpleChanges<IReadOnlyObservableCollection<TValue>, TValue>(source));\n }\n }\n}", "meta": {"content_hash": "32a893d420758e4b40644752699f601c", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 156, "avg_line_length": 53.90526315789474, "alnum_prop": 0.6430384690490138, "repo_name": "JohanLarsson/Gu.Reactive", "id": "239061dad9939fc438c52f2d2f4c921594f1df6a", "size": "5123", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Gu.Reactive/Trackers/MaxTracker.generated.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "1929644"}, {"name": "PowerShell", "bytes": "2709"}]}} +{"text": "package com.jetbrains.python.inspections;\n\nimport com.jetbrains.python.fixtures.PyInspectionTestCase;\nimport org.jetbrains.annotations.NotNull;\n\npublic class PyTypedDictInspectionTest extends PyInspectionTestCase {\n\n public void testUnknownKey() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class Movie(TypedDict, total=False):\\n\" +\n \" name: str\\n\" +\n \" year: int\\n\" +\n \"Movie2 = TypedDict('Movie2', {'name': str, 'year': int}, total=False)\\n\" +\n \"movie = Movie2(name='Blade Runner')\\n\" +\n \"movie2 = Movie2(name='Blade Runner')\\n\" +\n \"movie['year'] = 42\\n\" +\n \"movie2['year'] = 42\\n\" +\n \"movie[<warning descr=\\\"TypedDict \\\\\\\"Movie2\\\\\\\" has no key 'id'\\\">'id'</warning>] = 43\\n\" +\n \"movie2[<warning descr=\\\"TypedDict \\\\\\\"Movie2\\\\\\\" has no key 'id'\\\">'id'</warning>] = 43\\n\");\n }\n\n public void testMetaclass() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"\\n\" +\n \"class Movie(TypedDict, <warning descr=\\\"Specifying a metaclass is not allowed in TypedDict\\\">metaclass=Meta</warning>):\\n\" +\n \" name: str\");\n }\n\n public void testExtraClassDeclarations() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class Movie(TypedDict):\\n\" +\n \" name: str\\n\" +\n \" def <weak_warning descr=\\\"Invalid statement in TypedDict definition; expected 'field_name: field_type'\\\">my_method</weak_warning>(self):\\n\" +\n \" pass\\n\" +\n \" class <weak_warning descr=\\\"Invalid statement in TypedDict definition; expected 'field_name: field_type'\\\">Horror</weak_warning>:\\n\" +\n \" def __init__(self):\\n\" +\n \" ...\");\n }\n\n public void testInitializer() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class Movie(TypedDict):\\n\" +\n \" name: str\\n\" +\n \" year: int = <warning descr=\\\"Right-hand side values are not supported in TypedDict\\\">42</warning>\");\n }\n\n public void testPass() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class Movie(TypedDict):\\n\" +\n \" <weak_warning descr=\\\"Invalid statement in TypedDict definition; expected 'field_name: field_type'\\\">...</weak_warning>\\n\" +\n \"class HorrorMovie(TypedDict):\\n\" +\n \" pass\");\n }\n\n public void testNonTypedDictAsSuperclass() {\n doTestByText(\"from typing import TypedDict, NamedTuple\\n\" +\n \"class Bastard:\\n\" +\n \" pass\\n\" +\n \"class X(TypedDict):\\n\" +\n \" x: int\\n\" +\n \"class Y(TypedDict):\\n\" +\n \" y: str\\n\" +\n \"class XYZ(X, <warning descr=\\\"TypedDict cannot inherit from a non-TypedDict base class\\\">Bastard</warning>):\\n\" +\n \" z: bool\\n\" +\n \"class MyNT(NamedTuple):\\n\" +\n \" a: str\");\n }\n\n public void testNameAndVariableNameDoNotMatch() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"Movie2 = TypedDict(<warning descr=\\\"First argument has to match the variable name\\\">'Movie'</warning>, {'name': str, 'year': int}, total=False)\");\n }\n\n public void testKeyTypesAlternativeSyntax() {\n doTestByText(\"from typing import TypedDict, Any, Optional\\n\" +\n \"Movie = TypedDict('Movie', {'name': Optional[int], 'smth': type, 'smthElse': Any, 'year': <weak_warning descr=\\\"Value must be a type\\\">2</weak_warning>}, total=False)\");\n }\n\n public void testKeyTypes() {\n doTestByText(\"from typing import TypedDict, Any, Optional\\n\" +\n \"class Movie(TypedDict):\\n\" +\n \" name: Optional[int]\\n\" +\n \" smth: type\\n\" +\n \" smthElse: Any\\n\" +\n \" year: <weak_warning descr=\\\"Value must be a type\\\">2</weak_warning>\");\n }\n\n public void testFinalKey() {\n doTestByText(\"from typing import TypedDict, Final\\n\" +\n \"class Movie(TypedDict):\\n\" +\n \" name: str\\n\" +\n \" year: int\\n\" +\n \"YEAR: Final = 'year'\\n\" +\n \"m = Movie(name='Alien', year=1979)\\n\" +\n \"years_since_epoch = m[YEAR] - 1970\");\n }\n\n public void testStringVariableAsKey() {\n doTestByText(\"from typing import TypedDict, Final\\n\" +\n \"class Movie(TypedDict):\\n\" +\n \" name: str\\n\" +\n \" year: int\\n\" +\n \"year = 'year'\\n\" +\n \"year2 = year\\n\" +\n \"m = Movie(name='Alien', year=1979)\\n\" +\n \"years_since_epoch = m[year2] - 1970\\n\" +\n \"year = 42\\n\" +\n \"print(m[<warning descr=\\\"TypedDict key must be a string literal; expected one of ('name', 'year')\\\">year</warning>])\");\n }\n\n public void testDelStatement() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class Movie(TypedDict):\\n\" +\n \" name: str\\n\" +\n \" year: int\\n\" +\n \"class HorrorMovie(Movie, total=False):\\n\" +\n \" based_on_book: bool\\n\" +\n \"year = 'year'\\n\" +\n \"year2 = year\\n\" +\n \"m = HorrorMovie(name='Alien', year=1979)\\n\" +\n \"del (m['based_on_book'], m[<warning descr=\\\"Key 'name' of TypedDict 'HorrorMovie' cannot be deleted\\\">'name'</warning>])\\n\" +\n \"del m[<warning descr=\\\"Key 'year' of TypedDict 'HorrorMovie' cannot be deleted\\\">year2</warning>], m['based_on_book']\");\n }\n\n public void testDictModificationMethods() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class Movie(TypedDict):\\n\" +\n \" name: str\\n\" +\n \" year: int\\n\" +\n \"class Horror(Movie, total=False):\\n\" +\n \" based_on_book: bool\\n\" +\n \"m = Horror(name='Alien', year=1979)\\n\" +\n \"m.<warning descr=\\\"This operation might break TypedDict consistency\\\">clear</warning>()\\n\" +\n \"name = 'name'\\n\" +\n \"m.pop('based_on_book')\\n\" +\n \"m.<warning descr=\\\"Key 'year' of TypedDict 'Horror' cannot be deleted\\\">pop</warning>('year')\\n\" +\n \"m.<weak_warning descr=\\\"This operation might break TypedDict consistency\\\">popitem</weak_warning>()\\n\" +\n \"m.setdefault('based_on_book', <warning descr=\\\"Expected type 'bool', got 'int' instead\\\">42</warning>)\");\n }\n\n public void testUpdateMethods() {\n doTestByText(\"from typing import TypedDict, Optional\\n\" +\n \"class Movie(TypedDict):\\n\" +\n \" name: str\\n\" +\n \" year: Optional[int]\\n\" +\n \"class Horror(Movie, total=False):\\n\" +\n \" based_on_book: bool\\n\" +\n \"m = Horror(name='Alien', year=1979)\\n\" +\n \"d={'name':'Garden State', 'year':2004}\\n\" +\n \"m.update(d)\\n\" +\n \"m.update({'name':'Garden State', 'year':<warning descr=\\\"Expected type 'int | None', got 'str' instead\\\">'2004'</warning>, <warning descr=\\\"TypedDict \\\\\\\"Horror\\\\\\\" cannot have key 'based_on'\\\">'based_on'</warning>: 'book'})\\n\" +\n \"m.update(name=<warning descr=\\\"Expected type 'str', got 'int' instead\\\">1984</warning>, year=1984, based_on_book=<warning descr=\\\"Expected type 'bool', got 'str' instead\\\">'yes'</warning>)\\n\" +\n \"m.update([('name',<warning descr=\\\"Expected type 'str', got 'int' instead\\\">1984</warning>), ('year',None)])\");\n }\n\n public void testDocString() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class Cinema(TypedDict):\\n\" +\n \" \\\"\\\"\\\"\\n\" +\n \" It's doc string\\n\" +\n \" \\\"\\\"\\\"\");\n }\n\n public void testFieldOverwrittenByInheritance() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class X(TypedDict):\\n\" +\n \" y: int\\n\" +\n \"class Y(TypedDict):\\n\" +\n \" y: str\\n\" +\n \"class XYZ<warning descr=\\\"Cannot overwrite TypedDict field 'y' while merging\\\">(X, Y)</warning>:\\n\" +\n \" <warning descr=\\\"Cannot overwrite TypedDict field\\\">y</warning>: bool\");\n }\n\n public void testIncorrectTypedDictArguments() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"c = TypedDict(\\\"c\\\", [1, 2, 3])\");\n }\n\n public void testTypedDictNonStringKey() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"Movie = TypedDict('Movie', {'name': str, 'year': int}, total=False)\\n\" +\n \"class Movie2(TypedDict, total=False):\\n\" +\n \" name: str\\n\" +\n \" year: int\\n\" +\n \"movie = Movie()\\n\" +\n \"movie2 = Movie2()\\n\" +\n \"movie[<warning descr=\\\"TypedDict key must be a string literal; expected one of ('name', 'year')\\\">2</warning>]\\n\" +\n \"movie2[<warning descr=\\\"TypedDict key must be a string literal; expected one of ('name', 'year')\\\">2</warning>]\");\n }\n\n public void testTypedDictKeyValueWrite() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"Movie = TypedDict('Movie', {'name': str, 'year': int}, total=False)\\n\" +\n \"class Movie2(TypedDict, total=False):\\n\" +\n \" name: str\\n\" +\n \" year: int\\n\" +\n \"movie = Movie()\\n\" +\n \"movie2 = Movie2()\\n\" +\n \"movie['year'], movie2['year'] = <warning descr=\\\"Expected type 'int', got 'str' instead\\\">'1984'</warning>, \" +\n \"<warning descr=\\\"Expected type 'int', got 'str' instead\\\">'1984'</warning>\\n\");\n }\n\n public void testTypedDictKeyValueWriteToTypedDictField() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"X = TypedDict('X', {'d': dict}, total=False)\\n\" +\n \"class X2(TypedDict, total=False):\\n\" +\n \" d: dict\\n\" +\n \"x = X()\\n\" +\n \"x2 = X2()\\n\" +\n \"x['d']['k'], x2['d']['k'] = 'v', 'v'\");\n }\n\n public void testIncorrectTotalityValue() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class X(TypedDict, total=<warning descr=\\\"Value of 'total' must be True or False\\\">1</warning>):\\n\" +\n \" x: int\\n\");\n }\n\n public void testIncorrectTotalityValueAlternativeSyntax() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"X = TypedDict('X', {'x': int}, total=<warning descr=\\\"Value of 'total' must be True or False\\\">1</warning>)\");\n }\n\n public void testGetWithIncorrectKeyType() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class X(TypedDict):\\n\" +\n \" x: int\\n\" +\n \"x = X()\\n\" +\n \"x.get(<warning descr=\\\"Key should be string\\\">42</warning>, 67)\");\n }\n\n public void testGetWithIncorrectKeyValue() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class X(TypedDict):\\n\" +\n \" x: int\\n\" +\n \"x = X()\\n\" +\n \"x.get(<warning descr=\\\"TypedDict \\\\\\\"X\\\\\\\" has no key 'y'\\\">'y'</warning>, 67)\\n\" +\n \"x.get('x', '')\");\n }\n\n // PY-39404\n public void testImportedTypedDict() {\n doMultiFileTest();\n }\n\n // PY-40906\n public void testLiteralAsTypedDictKey() {\n doTestByText(\"from typing import TypedDict, Literal, Union\\n\" +\n \"class Movie(TypedDict):\\n\" +\n \" name: str\\n\" +\n \" year: int\\n\" +\n \"def get_value(movie: Movie, key: Literal['year', 'name']) -> Union[int, str]:\\n\" +\n \" return movie[key]\\n\" +\n \"def get_value(movie: Movie, key: Literal['name']) -> Union[int, str]:\\n\" +\n \" return movie[key]\\n\" +\n \"def get_value(movie: Movie, key: Literal['name1']) -> Union[int, str]:\\n\" +\n \" return movie[<warning descr=\\\"TypedDict \\\\\\\"Movie\\\\\\\" has no key 'name1'\\\">key</warning>]\\n\" +\n \"def get_value(movie: Movie, key: Literal['year', 42]) -> Union[int, str]:\\n\" +\n \" return movie[<warning descr=\\\"TypedDict key must be a string literal; expected one of ('name', 'year')\\\">key</warning>]\\n\" +\n \"def get_value(movie: Movie, key: Literal['year', 'name1', '42']) -> Union[int, str]:\\n\" +\n \" return movie[<warning descr=\\\"TypedDict \\\\\\\"Movie\\\\\\\" has no keys ('name1', '42')\\\">key</warning>]\\n\" +\n \"def get_value(movie: Movie, key: Literal[42]) -> Union[int, str]:\\n\" +\n \" return movie[<warning descr=\\\"TypedDict key must be a string literal; expected one of ('name', 'year')\\\">key</warning>]\");\n }\n\n // PY-44714\n public void testNoneAsType() {\n doTestByText(\"from typing import TypedDict\\n\" +\n \"class X(TypedDict):\\n\" +\n \" n: None\\n\" +\n \"Y = TypedDict('Y', {'n': None})\\n\");\n }\n\n @NotNull\n @Override\n protected Class<? extends PyInspection> getInspectionClass() {\n return PyTypedDictInspection.class;\n }\n}", "meta": {"content_hash": "4c790b71c1daff47a0426ed91bf2f6b4", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 247, "avg_line_length": 48.272401433691755, "alnum_prop": 0.5145530145530145, "repo_name": "siosio/intellij-community", "id": "664124c047672c3023f13eab2e3fc4209858f3c2", "size": "13609", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "python/testSrc/com/jetbrains/python/inspections/PyTypedDictInspectionTest.java", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "from __future__ import unicode_literals\n\nimport unittest\nimport sys\n\nfrom bibtexparser.bparser import BibTexParser\nfrom bibtexparser.bwriter import BibTexWriter, to_bibtex\nfrom bibtexparser.customization import author\n\n\nclass TestBibtexWriterList(unittest.TestCase):\n\n ###########\n # ARTICLE\n ###########\n def test_article(self):\n with open('bibtexparser/tests/data/article.bib', 'r') as bibfile:\n bib = BibTexParser(bibfile.read())\n\n with open('bibtexparser/tests/data/article_output.bib', 'r') as bibfile:\n expected = bibfile.read()\n result = to_bibtex(bib)\n if not sys.version_info >= (3, 0):\n if isinstance(result, unicode):\n result = result.encode('utf-8')\n self.maxDiff = None\n self.assertEqual(expected, result)\n\n ###########\n # BOOK\n ###########\n def test_book(self):\n with open('bibtexparser/tests/data/book.bib', 'r') as bibfile:\n bib = BibTexParser(bibfile.read())\n\n with open('bibtexparser/tests/data/book_output.bib', 'r') as bibfile:\n expected = bibfile.read()\n result = to_bibtex(bib)\n self.maxDiff = None\n self.assertEqual(expected, result)\n\n ###########\n # COMMA FIRST\n ###########\n def test_comma_first(self):\n with open('bibtexparser/tests/data/book.bib', 'r') as bibfile:\n bib = BibTexParser(bibfile.read())\n\n with open('bibtexparser/tests/data/book_comma_first.bib', 'r') as bibfile:\n expected = bibfile.read()\n writer = BibTexWriter()\n writer.indent = ' '\n writer.comma_first = True\n result = writer.write(bib)\n self.maxDiff = None\n self.assertEqual(expected, result)\n\n ###########\n # MULTIPLE\n ###########\n def test_multiple(self):\n with open('bibtexparser/tests/data/multiple_entries.bib', 'r') as bibfile:\n bib = BibTexParser(bibfile.read())\n\n with open('bibtexparser/tests/data/multiple_entries_output.bib', 'r') as bibfile:\n expected = bibfile.read()\n result = to_bibtex(bib)\n self.maxDiff = None\n self.assertEqual(expected, result)\n\n ###########\n # Exception\n ###########\n def test_exception_typeerror(self):\n with open('bibtexparser/tests/data/article.bib', 'r') as bibfile:\n bib = BibTexParser(bibfile.read(), customization=author)\n self.assertRaises(TypeError, to_bibtex, bib)\n\n", "meta": {"content_hash": "59641d3fcf1bc8448fe562261846a1ea", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 89, "avg_line_length": 31.76923076923077, "alnum_prop": 0.5912025827280064, "repo_name": "Juvawa/bib2web", "id": "c5d026229b98ae7ce1694845123fe36bb660a0c0", "size": "2564", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bib2web/bibtexparser/tests/test_bwriter.py", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "210786"}, {"name": "TeX", "bytes": "8148"}]}} +{"text": "<?php\n\nnamespace Taskeet\\MainBundle\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Symfony\\Component\\HttpFoundation\\File\\File;\nuse Symfony\\Component\\Validator\\Constraints as Assert;\nuse Vich\\UploaderBundle\\Mapping\\Annotation as Vich;\n\n/**\n * EventCategory\n *\n * @ORM\\Table(name=\"event_category\")\n * @ORM\\Entity\n * @Vich\\Uploadable\n */\nclass EventCategory\n{\n /**\n * @var integer\n *\n * @ORM\\Column(name=\"id\", type=\"integer\")\n * @ORM\\Id\n * @ORM\\GeneratedValue(strategy=\"AUTO\")\n */\n private $id;\n\n /**\n * @var string\n *\n * @ORM\\Column(name=\"name\", type=\"string\", length=32)\n */\n private $name;\n\n /**\n * @Assert\\File(\n * maxSize=\"1M\",\n * mimeTypes={\"image/png\", \"image/jpeg\", \"image/pjpeg\"}\n * )\n * @Vich\\UploadableField(mapping=\"event_image\", fileNameProperty=\"imageName\")\n *\n * @var File $image\n */\n private $image;\n\n /**\n * @var string\n *\n * @ORM\\Column(name=\"imageName\", type=\"string\", length=255)\n */\n private $imageName;\n\n\n /**\n * Get id\n *\n * @return integer \n */\n public function getId()\n {\n return $this->id;\n }\n\n /**\n * Set name\n *\n * @param string $name\n * @return EventCategory\n */\n public function setName($name)\n {\n $this->name = $name;\n\n return $this;\n }\n\n /**\n * Get name\n *\n * @return string \n */\n public function getName()\n {\n return $this->name;\n }\n\n /**\n * @param \\Symfony\\Component\\HttpFoundation\\File\\File $image\n */\n public function setImage($image)\n {\n $this->image = $image;\n\n return $this;\n }\n\n /**\n * @return \\Symfony\\Component\\HttpFoundation\\File\\File\n */\n public function getImage()\n {\n return $this->image;\n }\n\n /**\n * Set imageName\n *\n * @param string $imageName\n * @return EventCategory\n */\n public function setImageName($imageName)\n {\n $this->imageName = $imageName;\n\n return $this;\n }\n\n /**\n * Get imageName\n *\n * @return string \n */\n public function getImageName()\n {\n return $this->imageName;\n }\n\n public function __toString()\n {\n return $this->name;\n }\n}\n", "meta": {"content_hash": "46b9811ccd02f612ac121a192106833f", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 81, "avg_line_length": 17.272727272727273, "alnum_prop": 0.5289473684210526, "repo_name": "jarmas8611/proyect", "id": "d6f37f2abc7c0737544d245d6988d4c000d1091a", "size": "2280", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Taskeet/MainBundle/Entity/EventCategory.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "178392"}, {"name": "HTML", "bytes": "101934"}, {"name": "JavaScript", "bytes": "354584"}, {"name": "PHP", "bytes": "209606"}]}} +{"text": "package chapter.sixteen\n\nimport ExerciseOne._\n\nimport org.scalatest._\nimport org.scalatest.junit.JUnitRunner\nimport org.junit.runner.RunWith\n\n@RunWith(classOf[JUnitRunner])\nclass ExerciseOneSpec extends FlatSpec with Matchers {\n\n \"function\" should \"\" in {\n }\n}\n", "meta": {"content_hash": "abe33f63c99ef6a840210be198899e9b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 54, "avg_line_length": 18.785714285714285, "alnum_prop": 0.779467680608365, "repo_name": "deekim/impatient-scala", "id": "dbc16e952ec11621b73119a580f89fba0420dca5", "size": "263", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/scala/chapter/sixteen/ExerciseOneSpec.scala", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Ruby", "bytes": "317"}, {"name": "Scala", "bytes": "130378"}, {"name": "Shell", "bytes": "1447"}]}} +{"text": "{% extends \"layout/default.html\" %}\n\n{% set active_page = 'events' %}\n\n{% block title %}\n Events{{ super() }}\n{% endblock %}\n\n{% block main_body %}\n<div class=\"row\">\n <!-- Blog Entries Column -->\n <div class=\"col-md-8\">\n\n <h2 class=\"ppage-header\">\n Upcoming events and presentations\n </h2>\n\n <ul>\n\t\t<li>\n\t 26 October 2016, \"Speech presentation in 19th century literature: A hands-on approach\" as part of the CCR Corpus Training Sessions, Johan de Joode \n\t\t</li>\n\t\t<li>\n\t\t1 November 2016, Michaela Mahlberg will deliver <a href=\"https://cardiffdigitalnetwork.org/2016/09/07/cfp-word-image-digital/\"/>a keynote</a> at the Cardiff Digital Cultures Network \n\t\t</li>\n\t\t<li>\n\t 30 November 2016, \"Discourse and dialogue: Annotating and aggregating corpus data\" as part of the CCR Corpus Training Sessions, Johan de Joode \n\t\t</li>\n \t </ul> \n\n\n\t<h2 class=\"ppage-header\">\n Past events and presentations\n </h2>\n\n <ul>\n \t\t<li>\n\t\t 16-18 September 2016, Michaela Mahlberg gave a keynote at the <a href=\"https://apling.engl.iastate.edu/conferences/aacl2016/\"> American Association for Corpus Linguistics (AACL) Conference</a>\n\t\t</li>\n \t\t<li>\n4 July 2016, CLiC Workshop at University of Kent \n\t\t</li>\n \t\t<li>\n20-24 June 2016 <a href=\"http://www.birmingham.ac.uk/research/activity/corpus/events/2016/corpus-linguistics-summer-school.aspx\">Corpus Linguistics Summer School at CCR</a>\n\t\t</li>\n \t\t<li>\n20 June 2016 Michaela Mahlberg delivers 11th Annual Sinclair Lecture:\nYou can watch a video of the lecture <a href=\"http://www.birmingham.ac.uk/research/activity/corpus/news/2016/sinclair-lecture-2016.aspx\">here</a>.\n\t\t</li>\n \t\t<li>\n4 June 2016 - Hay Festival, University of Birmingham series, <a href=\"https://www.hayfestival.com/p-11096-john-holmes-michaela-mahlberg-will-tattersdill.aspx\">\u2018Hot off the press\u2019</a> John Holmes, Michaela Mahlberg and Will Tattersdill \n\t\t</li>\n \t\t<li>\n14 March 2016, CLiC Workshop for the Schools Partnership Gateway, \u2018Corpus Stylistics for the English Classroom\u2019, University of Nottingham \n\t\t</li>\n \t\t<li>\n16 November 2015, CLiC Workshop hosted jointly organised the CCR and AQA, \u2018Corpus Stylistics for A-level Teachers\u2019 \u2013 see <a href=\"https://thedefinitearticle.aqa.org.uk/2016/01/25/corpus-stylistics-workshop-for-a-level-teachers/\">here</a> for a review </li>\n\t <!-- <li>16 November 2015: <a href=\"http://www.aqa.org.uk/professional-development/course-details?meta_E=SENGAlevelEnglishWorkshopCorpuslinguisticmethods\" class=\"sys_16\">Using corpus linguistic methods in the classroom: A one-day workshop for A level teachers</a></li> -->\n\t <li>12 November 2015, <a title=\"Advanced CLiC - User-defined annotation\" href=\"http://birmingham.ac.uk/schools/edacs/departments/englishlanguage/events/2015/de-joode-advanced-corpus-workshop.aspx\" class=\"sys_0 sys_t1491559\">Advanced CLiC – User-defined annotation</a>, Centre for Advanced Research in English, Johan de Joode</li>\n\t <li>29 October 2015, <a title=\"Using CLiC to study literature\" href=\"http://birmingham.ac.uk/schools/edacs/departments/englishlanguage/events/2015/de-joode-corpus-workshop.aspx\" class=\"sys_0 sys_t1491559\">Using CLiC to study literature</a>, Centre for Advanced Research in English, Johan de Joode</li>\n \t </ul> \n\n\n\n\n\n\n\n\n </div>\n\n <!-- Blog Sidebar Widgets Column -->\n {% include \"blocks/twitter.html\" %}\n</div>\n\n\n <!-- Footer -->\n\n{% endblock %}\n\n{% block scripts %}\n {{ super() }}\n{% endblock %}\n", "meta": {"content_hash": "4baf795a29d4274669b66ab122d60d6f", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 338, "avg_line_length": 42.1219512195122, "alnum_prop": 0.7101910828025477, "repo_name": "CentreForResearchInAppliedLinguistics/clic", "id": "f2649ac96c137a2a0cc22fe60062fad25e754fa2", "size": "3468", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "clic/web/templates/info/events.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "4449"}, {"name": "HTML", "bytes": "167472"}, {"name": "JavaScript", "bytes": "45975"}, {"name": "Mako", "bytes": "412"}, {"name": "Python", "bytes": "144586"}, {"name": "XSLT", "bytes": "12605"}]}} +{"text": "\n\n/*\n * drop the SQL schema used by org.apache.slide.impl.rdbms.PostgresAdapter.\n * Tested with Postgres 7.4.\n *\n */\n\nDROP VIEW LOCKS_VIEW;\nDROP VIEW PERMISSIONS_VIEW;\nDROP VIEW BINDING_VIEW;\nDROP VIEW OBJECT_VIEW;\nDROP TABLE PROPERTIES; \nDROP TABLE VERSION_CONTENT; \nDROP TABLE VERSION_PREDS;\nDROP TABLE VERSION_LABELS;\nDROP TABLE VERSION_HISTORY; \nDROP TABLE VERSION; \nDROP TABLE BINDING;\nDROP TABLE PARENT_BINDING;\nDROP TABLE LINKS;\nDROP TABLE LOCKS;\nDROP TABLE BRANCH;\nDROP TABLE LABEL; \nDROP TABLE PERMISSIONS; \nDROP TABLE OBJECT;\nDROP TABLE URI;\n", "meta": {"content_hash": "5a49349cb1560c2c23bb44af82aff019", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 75, "avg_line_length": 20.444444444444443, "alnum_prop": 0.7663043478260869, "repo_name": "integrated/jakarta-slide-server", "id": "1d803c82f407aacb3d91d9f1b1a07e4df3a20efc", "size": "1482", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/conf/schema/dropPostgresSchema.sql", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "7980335"}, {"name": "XSLT", "bytes": "19468"}]}} +{"text": "var fs = require('fs');\nvar gdal = require('gdal');\nvar in_file = process.argv[2];\nvar out_base_name = process.argv[3];\nvar ds = gdal.open(in_file);\nvar wgs84 = gdal.SpatialReference.fromEPSG(4326);\n\ngdal.verbose();\ngdal.config.set('CPL_DEBUG', 'ON');\ngdal.config.set('CPL_LOG_ERRORS', 'ON');\n\nds.layers.forEach(function (lyr) {\n\tconsole.log('processing: ', lyr.name);\n\tvar lyr_name = lyr.name.replace(':', ''); //strip invalid filename characters\n\tvar out_name = out_base_name + '_' + lyr_name + '.geojson';\n\tif (fs.existsSync(out_name)) { fs.unlink(out_name);}\n\tvar out_ds = gdal.open(out_name, 'w', 'GeoJSON');\n\tvar geojson = out_ds.layers.create(lyr_name, wgs84, lyr.geomType);\n\tlyr.features.forEach(function (in_feat) {\n\t\tgeojson.features.add(in_feat);\n\t})\n\tgeojson.flush();\n\tout_ds.flush();\n\tout_ds.close();\n});", "meta": {"content_hash": "baed8530c9febf2ec665a0162e12d3e2", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 78, "avg_line_length": 32.68, "alnum_prop": 0.6682986536107711, "repo_name": "BergWerkGIS/detect-corrupt-tiff", "id": "ddb31bb428eb3a0b2edf50820a4aab929478ebb3", "size": "817", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "nodejs/convert-to-geojson-via-gdal.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "10759"}, {"name": "Python", "bytes": "8714"}]}} +{"text": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2012 The Bitcoin developers\n// Copyright (c) 2013 ContinuumCoin developers\n// Distributed under the MIT/X11 software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include \"alert.h\"\n#include \"checkpoints.h\"\n#include \"db.h\"\n#include \"txdb.h\"\n#include \"net.h\"\n#include \"init.h\"\n#include \"ui_interface.h\"\n#include \"checkqueue.h\"\n#include \"chainparams.h\"\n#include <boost/algorithm/string/replace.hpp>\n#include <boost/filesystem.hpp>\n#include <boost/filesystem/fstream.hpp>\n\nusing namespace std;\nusing namespace boost;\n\n//\n// Global state\n//\n\nCCriticalSection cs_setpwalletRegistered;\nset<CWallet*> setpwalletRegistered;\n\nCCriticalSection cs_main;\n\nCTxMemPool mempool;\nunsigned int nTransactionsUpdated = 0;\n\nmap<uint256, CBlockIndex*> mapBlockIndex;\nstd::vector<CBlockIndex*> vBlockIndexByHeight;\nCBlockIndex* pindexGenesisBlock = NULL;\nint nBestHeight = -1;\nuint256 nBestChainWork = 0;\nuint256 nBestInvalidWork = 0;\nuint256 hashBestChain = 0;\nCBlockIndex* pindexBest = NULL;\nset<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexValid; // may contain all CBlockIndex*'s that have validness >=BLOCK_VALID_TRANSACTIONS, and must contain those who aren't failed\nint64 nTimeBestReceived = 0;\nint nScriptCheckThreads = 0;\nbool fImporting = false;\nbool fReindex = false;\nbool fBenchmark = false;\nbool fTxIndex = false;\nunsigned int nCoinCacheSize = 5000;\nbool fHaveGUI = false;\n\n/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */\nint64 CTransaction::nMinTxFee = 10000; // Override with -mintxfee\n/** Fees smaller than this (in satoshi) are considered zero fee (for relaying) */\nint64 CTransaction::nMinRelayTxFee = 10000;\n\nCMedianFilter<int> cPeerBlockCounts(8, 0); // Amount of blocks that other nodes claim to have\n\nmap<uint256, CBlock*> mapOrphanBlocks;\nmultimap<uint256, CBlock*> mapOrphanBlocksByPrev;\n\nmap<uint256, CDataStream*> mapOrphanTransactions;\nmap<uint256, map<uint256, CDataStream*> > mapOrphanTransactionsByPrev;\n\n// Constant stuff for coinbase transactions we create:\nCScript COINBASE_FLAGS;\n\nconst string strMessageMagic = \"ContinuumCoin Signed Message:\\n\";\n\ndouble dHashesPerSec = 0.0;\nint64 nHPSTimerStart = 0;\n\n// Settings\nint64 nTransactionFee = 0;\n\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// dispatching functions\n//\n\n// These functions dispatch to one or all registered wallets\n\n\nvoid RegisterWallet(CWallet* pwalletIn)\n{\n {\n LOCK(cs_setpwalletRegistered);\n setpwalletRegistered.insert(pwalletIn);\n }\n}\n\nvoid UnregisterWallet(CWallet* pwalletIn)\n{\n {\n LOCK(cs_setpwalletRegistered);\n setpwalletRegistered.erase(pwalletIn);\n }\n}\n\nvoid UnregisterAllWallets()\n{\n LOCK(cs_setpwalletRegistered);\n setpwalletRegistered.clear();\n}\n\n// get the wallet transaction with the given hash (if it exists)\nbool static GetTransaction(const uint256& hashTx, CWalletTx& wtx)\n{\n LOCK(cs_setpwalletRegistered);\n BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)\n if (pwallet->GetTransaction(hashTx,wtx))\n return true;\n return false;\n}\n\n// erases transaction with the given hash from all wallets\nvoid static EraseFromWallets(uint256 hash)\n{\n LOCK(cs_setpwalletRegistered);\n BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)\n pwallet->EraseFromWallet(hash);\n}\n\n// make sure all wallets know about the given transaction, in the given block\nvoid SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate)\n{\n LOCK(cs_setpwalletRegistered);\n BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)\n pwallet->AddToWalletIfInvolvingMe(hash, tx, pblock, fUpdate);\n}\n\n// notify wallets about a new best chain\nvoid static SetBestChain(const CBlockLocator& loc)\n{\n LOCK(cs_setpwalletRegistered);\n BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)\n pwallet->SetBestChain(loc);\n}\n\n// notify wallets about an updated transaction\nvoid static UpdatedTransaction(const uint256& hashTx)\n{\n LOCK(cs_setpwalletRegistered);\n BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)\n pwallet->UpdatedTransaction(hashTx);\n}\n\n// dump all wallets\nvoid static PrintWallets(const CBlock& block)\n{\n LOCK(cs_setpwalletRegistered);\n BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)\n pwallet->PrintWallet(block);\n}\n\n// notify wallets about an incoming inventory (for request counts)\nvoid static Inventory(const uint256& hash)\n{\n LOCK(cs_setpwalletRegistered);\n BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)\n pwallet->Inventory(hash);\n}\n\n// ask wallets to resend their transactions\nvoid static ResendWalletTransactions()\n{\n LOCK(cs_setpwalletRegistered);\n BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)\n pwallet->ResendWalletTransactions();\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// Registration of network node signals.\n//\n\nvoid RegisterNodeSignals(CNodeSignals& nodeSignals)\n{\n nodeSignals.ProcessMessages.connect(&ProcessMessages);\n nodeSignals.SendMessages.connect(&SendMessages);\n}\n\nvoid UnregisterNodeSignals(CNodeSignals& nodeSignals)\n{\n nodeSignals.ProcessMessages.disconnect(&ProcessMessages);\n nodeSignals.SendMessages.disconnect(&SendMessages);\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// CBlockLocator implementation\n//\n\nCBlockLocator::CBlockLocator(uint256 hashBlock)\n{\n std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);\n if (mi != mapBlockIndex.end())\n Set((*mi).second);\n}\n\nvoid CBlockLocator::Set(const CBlockIndex* pindex)\n{\n vHave.clear();\n int nStep = 1;\n while (pindex)\n {\n vHave.push_back(pindex->GetBlockHash());\n\n // Exponentially larger steps back\n for (int i = 0; pindex && i < nStep; i++)\n pindex = pindex->pprev;\n if (vHave.size() > 10)\n nStep *= 2;\n }\n vHave.push_back(Params().HashGenesisBlock());\n}\n\nint CBlockLocator::GetDistanceBack()\n{\n // Retrace how far back it was in the sender's branch\n int nDistance = 0;\n int nStep = 1;\n BOOST_FOREACH(const uint256& hash, vHave)\n {\n std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);\n if (mi != mapBlockIndex.end())\n {\n CBlockIndex* pindex = (*mi).second;\n if (pindex->IsInMainChain())\n return nDistance;\n }\n nDistance += nStep;\n if (nDistance > 10)\n nStep *= 2;\n }\n return nDistance;\n}\n\nCBlockIndex *CBlockLocator::GetBlockIndex()\n{\n // Find the first block the caller has in the main chain\n BOOST_FOREACH(const uint256& hash, vHave)\n {\n std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);\n if (mi != mapBlockIndex.end())\n {\n CBlockIndex* pindex = (*mi).second;\n if (pindex->IsInMainChain())\n return pindex;\n }\n }\n return pindexGenesisBlock;\n}\n\nuint256 CBlockLocator::GetBlockHash()\n{\n // Find the first block the caller has in the main chain\n BOOST_FOREACH(const uint256& hash, vHave)\n {\n std::map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);\n if (mi != mapBlockIndex.end())\n {\n CBlockIndex* pindex = (*mi).second;\n if (pindex->IsInMainChain())\n return hash;\n }\n }\n return Params().HashGenesisBlock();\n}\n\nint CBlockLocator::GetHeight()\n{\n CBlockIndex* pindex = GetBlockIndex();\n if (!pindex)\n return 0;\n return pindex->nHeight;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// CCoinsView implementations\n//\n\nbool CCoinsView::GetCoins(const uint256 &txid, CCoins &coins) { return false; }\nbool CCoinsView::SetCoins(const uint256 &txid, const CCoins &coins) { return false; }\nbool CCoinsView::HaveCoins(const uint256 &txid) { return false; }\nCBlockIndex *CCoinsView::GetBestBlock() { return NULL; }\nbool CCoinsView::SetBestBlock(CBlockIndex *pindex) { return false; }\nbool CCoinsView::BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex) { return false; }\nbool CCoinsView::GetStats(CCoinsStats &stats) { return false; }\n\n\nCCoinsViewBacked::CCoinsViewBacked(CCoinsView &viewIn) : base(&viewIn) { }\nbool CCoinsViewBacked::GetCoins(const uint256 &txid, CCoins &coins) { return base->GetCoins(txid, coins); }\nbool CCoinsViewBacked::SetCoins(const uint256 &txid, const CCoins &coins) { return base->SetCoins(txid, coins); }\nbool CCoinsViewBacked::HaveCoins(const uint256 &txid) { return base->HaveCoins(txid); }\nCBlockIndex *CCoinsViewBacked::GetBestBlock() { return base->GetBestBlock(); }\nbool CCoinsViewBacked::SetBestBlock(CBlockIndex *pindex) { return base->SetBestBlock(pindex); }\nvoid CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; }\nbool CCoinsViewBacked::BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex) { return base->BatchWrite(mapCoins, pindex); }\nbool CCoinsViewBacked::GetStats(CCoinsStats &stats) { return base->GetStats(stats); }\n\nCCoinsViewCache::CCoinsViewCache(CCoinsView &baseIn, bool fDummy) : CCoinsViewBacked(baseIn), pindexTip(NULL) { }\n\nbool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) {\n if (cacheCoins.count(txid)) {\n coins = cacheCoins[txid];\n return true;\n }\n if (base->GetCoins(txid, coins)) {\n cacheCoins[txid] = coins;\n return true;\n }\n return false;\n}\n\nstd::map<uint256,CCoins>::iterator CCoinsViewCache::FetchCoins(const uint256 &txid) {\n std::map<uint256,CCoins>::iterator it = cacheCoins.lower_bound(txid);\n if (it != cacheCoins.end() && it->first == txid)\n return it;\n CCoins tmp;\n if (!base->GetCoins(txid,tmp))\n return cacheCoins.end();\n std::map<uint256,CCoins>::iterator ret = cacheCoins.insert(it, std::make_pair(txid, CCoins()));\n tmp.swap(ret->second);\n return ret;\n}\n\nCCoins &CCoinsViewCache::GetCoins(const uint256 &txid) {\n std::map<uint256,CCoins>::iterator it = FetchCoins(txid);\n assert(it != cacheCoins.end());\n return it->second;\n}\n\nbool CCoinsViewCache::SetCoins(const uint256 &txid, const CCoins &coins) {\n cacheCoins[txid] = coins;\n return true;\n}\n\nbool CCoinsViewCache::HaveCoins(const uint256 &txid) {\n return FetchCoins(txid) != cacheCoins.end();\n}\n\nCBlockIndex *CCoinsViewCache::GetBestBlock() {\n if (pindexTip == NULL)\n pindexTip = base->GetBestBlock();\n return pindexTip;\n}\n\nbool CCoinsViewCache::SetBestBlock(CBlockIndex *pindex) {\n pindexTip = pindex;\n return true;\n}\n\nbool CCoinsViewCache::BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex) {\n for (std::map<uint256, CCoins>::const_iterator it = mapCoins.begin(); it != mapCoins.end(); it++)\n cacheCoins[it->first] = it->second;\n pindexTip = pindex;\n return true;\n}\n\nbool CCoinsViewCache::Flush() {\n bool fOk = base->BatchWrite(cacheCoins, pindexTip);\n if (fOk)\n cacheCoins.clear();\n return fOk;\n}\n\nunsigned int CCoinsViewCache::GetCacheSize() {\n return cacheCoins.size();\n}\n\n/** CCoinsView that brings transactions from a memorypool into view.\n It does not check for spendings by memory pool transactions. */\nCCoinsViewMemPool::CCoinsViewMemPool(CCoinsView &baseIn, CTxMemPool &mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { }\n\nbool CCoinsViewMemPool::GetCoins(const uint256 &txid, CCoins &coins) {\n if (base->GetCoins(txid, coins))\n return true;\n if (mempool.exists(txid)) {\n const CTransaction &tx = mempool.lookup(txid);\n coins = CCoins(tx, MEMPOOL_HEIGHT);\n return true;\n }\n return false;\n}\n\nbool CCoinsViewMemPool::HaveCoins(const uint256 &txid) {\n return mempool.exists(txid) || base->HaveCoins(txid);\n}\n\nCCoinsViewCache *pcoinsTip = NULL;\nCBlockTreeDB *pblocktree = NULL;\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// mapOrphanTransactions\n//\n\nbool AddOrphanTx(const CDataStream& vMsg)\n{\n CTransaction tx;\n CDataStream(vMsg) >> tx;\n uint256 hash = tx.GetHash();\n if (mapOrphanTransactions.count(hash))\n return false;\n\n CDataStream* pvMsg = new CDataStream(vMsg);\n\n // Ignore big transactions, to avoid a\n // send-big-orphans memory exhaustion attack. If a peer has a legitimate\n // large transaction with a missing parent then we assume\n // it will rebroadcast it later, after the parent transaction(s)\n // have been mined or received.\n // 10,000 orphans, each of which is at most 5,000 bytes big is\n // at most 500 megabytes of orphans:\n if (pvMsg->size() > 5000)\n {\n printf(\"ignoring large orphan tx (size: %\"PRIszu\", hash: %s)\\n\", pvMsg->size(), hash.ToString().c_str());\n delete pvMsg;\n return false;\n }\n\n mapOrphanTransactions[hash] = pvMsg;\n BOOST_FOREACH(const CTxIn& txin, tx.vin)\n mapOrphanTransactionsByPrev[txin.prevout.hash].insert(make_pair(hash, pvMsg));\n\n printf(\"stored orphan tx %s (mapsz %\"PRIszu\")\\n\", hash.ToString().c_str(),\n mapOrphanTransactions.size());\n return true;\n}\n\nvoid static EraseOrphanTx(uint256 hash)\n{\n if (!mapOrphanTransactions.count(hash))\n return;\n const CDataStream* pvMsg = mapOrphanTransactions[hash];\n CTransaction tx;\n CDataStream(*pvMsg) >> tx;\n BOOST_FOREACH(const CTxIn& txin, tx.vin)\n {\n mapOrphanTransactionsByPrev[txin.prevout.hash].erase(hash);\n if (mapOrphanTransactionsByPrev[txin.prevout.hash].empty())\n mapOrphanTransactionsByPrev.erase(txin.prevout.hash);\n }\n delete pvMsg;\n mapOrphanTransactions.erase(hash);\n}\n\nunsigned int LimitOrphanTxSize(unsigned int nMaxOrphans)\n{\n unsigned int nEvicted = 0;\n while (mapOrphanTransactions.size() > nMaxOrphans)\n {\n // Evict a random orphan:\n uint256 randomhash = GetRandHash();\n map<uint256, CDataStream*>::iterator it = mapOrphanTransactions.lower_bound(randomhash);\n if (it == mapOrphanTransactions.end())\n it = mapOrphanTransactions.begin();\n EraseOrphanTx(it->first);\n ++nEvicted;\n }\n return nEvicted;\n}\n\n\n\n\n\n\n\nbool IsStandardTx(const CTransaction& tx, string& reason)\n{\n if (tx.nVersion > CTransaction::CURRENT_VERSION) {\n reason = \"version\";\n return false;\n }\n\n if (!IsFinalTx(tx)) {\n reason = \"non-final\";\n return false;\n }\n\n // Extremely large transactions with lots of inputs can cost the network\n // almost as much to process as they cost the sender in fees, because\n // computing signature hashes is O(ninputs*txsize). Limiting transactions\n // to MAX_STANDARD_TX_SIZE mitigates CPU exhaustion attacks.\n unsigned int sz = tx.GetSerializeSize(SER_NETWORK, CTransaction::CURRENT_VERSION);\n if (sz >= MAX_STANDARD_TX_SIZE) {\n reason = \"tx-size\";\n return false;\n }\n\n BOOST_FOREACH(const CTxIn& txin, tx.vin)\n {\n // Biggest 'standard' txin is a 3-signature 3-of-3 CHECKMULTISIG\n // pay-to-script-hash, which is 3 ~80-byte signatures, 3\n // ~65-byte public keys, plus a few script ops.\n if (txin.scriptSig.size() > 500) {\n reason = \"scriptsig-size\";\n return false;\n }\n if (!txin.scriptSig.IsPushOnly()) {\n reason = \"scriptsig-not-pushonly\";\n return false;\n }\n }\n BOOST_FOREACH(const CTxOut& txout, tx.vout) {\n if (!::IsStandard(txout.scriptPubKey)) {\n reason = \"scriptpubkey\";\n return false;\n }\n if (txout.IsDust(CTransaction::nMinRelayTxFee)) {\n reason = \"dust\";\n return false;\n }\n }\n\n return true;\n}\n\nbool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64 nBlockTime)\n{\n // Time based nLockTime implemented in 0.1.6\n if (tx.nLockTime == 0)\n return true;\n if (nBlockHeight == 0)\n nBlockHeight = nBestHeight;\n if (nBlockTime == 0)\n nBlockTime = GetAdjustedTime();\n if ((int64)tx.nLockTime < ((int64)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64)nBlockHeight : nBlockTime))\n return true;\n BOOST_FOREACH(const CTxIn& txin, tx.vin)\n if (!txin.IsFinal())\n return false;\n return true;\n}\n\n/** Amount of bitcoins spent by the transaction.\n @return sum of all outputs (note: does not include fees)\n */\nint64 GetValueOut(const CTransaction& tx)\n{\n int64 nValueOut = 0;\n BOOST_FOREACH(const CTxOut& txout, tx.vout)\n {\n nValueOut += txout.nValue;\n if (!MoneyRange(txout.nValue) || !MoneyRange(nValueOut))\n throw std::runtime_error(\"GetValueOut() : value out of range\");\n }\n return nValueOut;\n}\n\n//\n// Check transaction inputs, and make sure any\n// pay-to-script-hash transactions are evaluating IsStandard scripts\n//\n// Why bother? To avoid denial-of-service attacks; an attacker\n// can submit a standard HASH... OP_EQUAL transaction,\n// which will get accepted into blocks. The redemption\n// script can be anything; an attacker could use a very\n// expensive-to-check-upon-redemption script like:\n// DUP CHECKSIG DROP ... repeated 100 times... OP_1\n//\nbool AreInputsStandard(const CTransaction& tx, CCoinsViewCache& mapInputs)\n{\n if (tx.IsCoinBase())\n return true; // Coinbases don't use vin normally\n\n for (unsigned int i = 0; i < tx.vin.size(); i++)\n {\n const CTxOut& prev = mapInputs.GetOutputFor(tx.vin[i]);\n\n vector<vector<unsigned char> > vSolutions;\n txnouttype whichType;\n // get the scriptPubKey corresponding to this input:\n const CScript& prevScript = prev.scriptPubKey;\n if (!Solver(prevScript, whichType, vSolutions))\n return false;\n int nArgsExpected = ScriptSigArgsExpected(whichType, vSolutions);\n if (nArgsExpected < 0)\n return false;\n\n // Transactions with extra stuff in their scriptSigs are\n // non-standard. Note that this EvalScript() call will\n // be quick, because if there are any operations\n // beside \"push data\" in the scriptSig the\n // IsStandard() call returns false\n vector<vector<unsigned char> > stack;\n if (!EvalScript(stack, tx.vin[i].scriptSig, tx, i, false, 0))\n return false;\n\n if (whichType == TX_SCRIPTHASH)\n {\n if (stack.empty())\n return false;\n CScript subscript(stack.back().begin(), stack.back().end());\n vector<vector<unsigned char> > vSolutions2;\n txnouttype whichType2;\n if (!Solver(subscript, whichType2, vSolutions2))\n return false;\n if (whichType2 == TX_SCRIPTHASH)\n return false;\n\n int tmpExpected;\n tmpExpected = ScriptSigArgsExpected(whichType2, vSolutions2);\n if (tmpExpected < 0)\n return false;\n nArgsExpected += tmpExpected;\n }\n\n if (stack.size() != (unsigned int)nArgsExpected)\n return false;\n }\n\n return true;\n}\n\nunsigned int GetLegacySigOpCount(const CTransaction& tx)\n{\n unsigned int nSigOps = 0;\n BOOST_FOREACH(const CTxIn& txin, tx.vin)\n {\n nSigOps += txin.scriptSig.GetSigOpCount(false);\n }\n BOOST_FOREACH(const CTxOut& txout, tx.vout)\n {\n nSigOps += txout.scriptPubKey.GetSigOpCount(false);\n }\n return nSigOps;\n}\n\nunsigned int GetP2SHSigOpCount(const CTransaction& tx, CCoinsViewCache& inputs)\n{\n if (tx.IsCoinBase())\n return 0;\n\n unsigned int nSigOps = 0;\n for (unsigned int i = 0; i < tx.vin.size(); i++)\n {\n const CTxOut &prevout = inputs.GetOutputFor(tx.vin[i]);\n if (prevout.scriptPubKey.IsPayToScriptHash())\n nSigOps += prevout.scriptPubKey.GetSigOpCount(tx.vin[i].scriptSig);\n }\n return nSigOps;\n}\n\nint CMerkleTx::SetMerkleBranch(const CBlock* pblock)\n{\n CBlock blockTmp;\n\n if (pblock == NULL) {\n CCoins coins;\n if (pcoinsTip->GetCoins(GetHash(), coins)) {\n CBlockIndex *pindex = FindBlockByHeight(coins.nHeight);\n if (pindex) {\n if (!ReadBlockFromDisk(blockTmp, pindex))\n return 0;\n pblock = &blockTmp;\n }\n }\n }\n\n if (pblock) {\n // Update the tx's hashBlock\n hashBlock = pblock->GetHash();\n\n // Locate the transaction\n for (nIndex = 0; nIndex < (int)pblock->vtx.size(); nIndex++)\n if (pblock->vtx[nIndex] == *(CTransaction*)this)\n break;\n if (nIndex == (int)pblock->vtx.size())\n {\n vMerkleBranch.clear();\n nIndex = -1;\n printf(\"ERROR: SetMerkleBranch() : couldn't find tx in block\\n\");\n return 0;\n }\n\n // Fill in merkle branch\n vMerkleBranch = pblock->GetMerkleBranch(nIndex);\n }\n\n // Is the tx in a block that's in the main chain\n map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);\n if (mi == mapBlockIndex.end())\n return 0;\n CBlockIndex* pindex = (*mi).second;\n if (!pindex || !pindex->IsInMainChain())\n return 0;\n\n return pindexBest->nHeight - pindex->nHeight + 1;\n}\n\n\n\n\n\n\n\nbool CheckTransaction(const CTransaction& tx, CValidationState &state)\n{\n // Basic checks that don't depend on any context\n if (tx.vin.empty())\n return state.DoS(10, error(\"CheckTransaction() : vin empty\"));\n if (tx.vout.empty())\n return state.DoS(10, error(\"CheckTransaction() : vout empty\"));\n // Size limits\n if (::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE)\n return state.DoS(100, error(\"CTransaction::CheckTransaction() : size limits failed\"));\n\n // Check for negative or overflow output values\n int64 nValueOut = 0;\n BOOST_FOREACH(const CTxOut& txout, tx.vout)\n {\n if (txout.nValue < 0)\n return state.DoS(100, error(\"CheckTransaction() : txout.nValue negative\"));\n if (txout.nValue > MAX_MONEY)\n return state.DoS(100, error(\"CheckTransaction() : txout.nValue too high\"));\n nValueOut += txout.nValue;\n if (!MoneyRange(nValueOut))\n return state.DoS(100, error(\"CTransaction::CheckTransaction() : txout total out of range\"));\n }\n\n // Check for duplicate inputs\n set<COutPoint> vInOutPoints;\n BOOST_FOREACH(const CTxIn& txin, tx.vin)\n {\n if (vInOutPoints.count(txin.prevout))\n return state.DoS(100, error(\"CTransaction::CheckTransaction() : duplicate inputs\"));\n vInOutPoints.insert(txin.prevout);\n }\n\n if (tx.IsCoinBase())\n {\n if (tx.vin[0].scriptSig.size() < 2 || tx.vin[0].scriptSig.size() > 100)\n return state.DoS(100, error(\"CheckTransaction() : coinbase script size\"));\n }\n else\n {\n BOOST_FOREACH(const CTxIn& txin, tx.vin)\n if (txin.prevout.IsNull())\n return state.DoS(10, error(\"CheckTransaction() : prevout is null\"));\n }\n\n return true;\n}\n\nint64 GetMinFee(const CTransaction& tx, bool fAllowFree, enum GetMinFee_mode mode)\n{\n // Base fee is either nMinTxFee or nMinRelayTxFee\n int64 nBaseFee = (mode == GMF_RELAY) ? tx.nMinRelayTxFee : tx.nMinTxFee;\n\n unsigned int nBytes = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);\n int64 nMinFee = (1 + (int64)nBytes / 1000) * nBaseFee;\n\n if (fAllowFree)\n {\n // There is a free transaction area in blocks created by most miners,\n // * If we are relaying we allow transactions up to DEFAULT_BLOCK_PRIORITY_SIZE - 1000\n // to be considered to fall into this category\n // * If we are creating a transaction we allow transactions up to DEFAULT_BLOCK_PRIORITY_SIZE - 17000\n // (= 10000) to be considered safe and assume they can likely make it into this section\n if (nBytes < (mode == GMF_SEND ? (DEFAULT_BLOCK_PRIORITY_SIZE - 17000) : (DEFAULT_BLOCK_PRIORITY_SIZE - 1000)))\n nMinFee = 0;\n }\n\n // To limit dust spam, require base fee if any output is less than 0.01\n if (nMinFee < nBaseFee)\n {\n BOOST_FOREACH(const CTxOut& txout, tx.vout)\n if (txout.nValue < CENT)\n nMinFee = nBaseFee;\n }\n\n if (!MoneyRange(nMinFee))\n nMinFee = MAX_MONEY;\n return nMinFee;\n}\n\nvoid CTxMemPool::pruneSpent(const uint256 &hashTx, CCoins &coins)\n{\n LOCK(cs);\n\n std::map<COutPoint, CInPoint>::iterator it = mapNextTx.lower_bound(COutPoint(hashTx, 0));\n\n // iterate over all COutPoints in mapNextTx whose hash equals the provided hashTx\n while (it != mapNextTx.end() && it->first.hash == hashTx) {\n coins.Spend(it->first.n); // and remove those outputs from coins\n it++;\n }\n}\n\nbool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fLimitFree,\n bool* pfMissingInputs)\n{\n if (pfMissingInputs)\n *pfMissingInputs = false;\n\n if (!CheckTransaction(tx, state))\n return error(\"CTxMemPool::accept() : CheckTransaction failed\");\n\n // Coinbase is only valid in a block, not as a loose transaction\n if (tx.IsCoinBase())\n return state.DoS(100, error(\"CTxMemPool::accept() : coinbase as individual tx\"));\n\n // To help v0.1.5 clients who would see it as a negative number\n if ((int64)tx.nLockTime > std::numeric_limits<int>::max())\n return error(\"CTxMemPool::accept() : not accepting nLockTime beyond 2038 yet\");\n\n // Rather not work on nonstandard transactions (unless -testnet)\n string reason;\n if (!TestNet() && !IsStandardTx(tx, reason))\n return error(\"CTxMemPool::accept() : nonstandard transaction: %s\",\n reason.c_str());\n\n // is it already in the memory pool?\n uint256 hash = tx.GetHash();\n {\n LOCK(cs);\n if (mapTx.count(hash))\n return false;\n }\n\n // Check for conflicts with in-memory transactions\n CTransaction* ptxOld = NULL;\n for (unsigned int i = 0; i < tx.vin.size(); i++)\n {\n COutPoint outpoint = tx.vin[i].prevout;\n if (mapNextTx.count(outpoint))\n {\n // Disable replacement feature for now\n return false;\n\n // Allow replacing with a newer version of the same transaction\n if (i != 0)\n return false;\n ptxOld = mapNextTx[outpoint].ptx;\n if (IsFinalTx(*ptxOld))\n return false;\n if (!tx.IsNewerThan(*ptxOld))\n return false;\n for (unsigned int i = 0; i < tx.vin.size(); i++)\n {\n COutPoint outpoint = tx.vin[i].prevout;\n if (!mapNextTx.count(outpoint) || mapNextTx[outpoint].ptx != ptxOld)\n return false;\n }\n break;\n }\n }\n\n {\n CCoinsView dummy;\n CCoinsViewCache view(dummy);\n\n {\n LOCK(cs);\n CCoinsViewMemPool viewMemPool(*pcoinsTip, *this);\n view.SetBackend(viewMemPool);\n\n // do we already have it?\n if (view.HaveCoins(hash))\n return false;\n\n // do all inputs exist?\n // Note that this does not check for the presence of actual outputs (see the next check for that),\n // only helps filling in pfMissingInputs (to determine missing vs spent).\n BOOST_FOREACH(const CTxIn txin, tx.vin) {\n if (!view.HaveCoins(txin.prevout.hash)) {\n if (pfMissingInputs)\n *pfMissingInputs = true;\n return false;\n }\n }\n\n // are the actual inputs available?\n if (!view.HaveInputs(tx))\n return state.Invalid(error(\"CTxMemPool::accept() : inputs already spent\"));\n\n // Bring the best block into scope\n view.GetBestBlock();\n\n // we have all inputs cached now, so switch back to dummy, so we don't need to keep lock on mempool\n view.SetBackend(dummy);\n }\n\n // Check for non-standard pay-to-script-hash in inputs\n if (!TestNet() && !AreInputsStandard(tx, view))\n return error(\"CTxMemPool::accept() : nonstandard transaction input\");\n\n // Note: if you modify this code to accept non-standard transactions, then\n // you should add code here to check that the transaction does a\n // reasonable number of ECDSA signature verifications.\n\n int64 nFees = view.GetValueIn(tx)-GetValueOut(tx);\n unsigned int nSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);\n\n // Don't accept it if it can't get into a block\n int64 txMinFee = GetMinFee(tx, true, GMF_RELAY);\n if (fLimitFree && nFees < txMinFee)\n return error(\"CTxMemPool::accept() : not enough fees %s, %\"PRI64d\" < %\"PRI64d,\n hash.ToString().c_str(),\n nFees, txMinFee);\n\n // Continuously rate-limit free transactions\n // This mitigates 'penny-flooding' -- sending thousands of free transactions just to\n // be annoying or make others' transactions take longer to confirm.\n if (fLimitFree && nFees < CTransaction::nMinRelayTxFee)\n {\n static double dFreeCount;\n static int64 nLastTime;\n int64 nNow = GetTime();\n\n LOCK(cs);\n\n // Use an exponentially decaying ~10-minute window:\n dFreeCount *= pow(1.0 - 1.0/600.0, (double)(nNow - nLastTime));\n nLastTime = nNow;\n // -limitfreerelay unit is thousand-bytes-per-minute\n // At default rate it would take over a month to fill 1GB\n if (dFreeCount >= GetArg(\"-limitfreerelay\", 15)*10*1000)\n return error(\"CTxMemPool::accept() : free transaction rejected by rate limiter\");\n if (fDebug)\n printf(\"Rate limit dFreeCount: %g => %g\\n\", dFreeCount, dFreeCount+nSize);\n dFreeCount += nSize;\n }\n\n // Check against previous transactions\n // This is done last to help prevent CPU exhaustion denial-of-service attacks.\n if (!CheckInputs(tx, state, view, true, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC))\n {\n return error(\"CTxMemPool::accept() : ConnectInputs failed %s\", hash.ToString().c_str());\n }\n }\n\n // Store transaction in memory\n {\n LOCK(cs);\n if (ptxOld)\n {\n printf(\"CTxMemPool::accept() : replacing tx %s with new version\\n\", ptxOld->GetHash().ToString().c_str());\n remove(*ptxOld);\n }\n addUnchecked(hash, tx);\n }\n\n ///// are we sure this is ok when loading transactions or restoring block txes\n // If updated, erase old tx from wallet\n if (ptxOld)\n EraseFromWallets(ptxOld->GetHash());\n SyncWithWallets(hash, tx, NULL, true);\n\n printf(\"CTxMemPool::accept() : accepted %s (poolsz %\"PRIszu\")\\n\",\n hash.ToString().c_str(),\n mapTx.size());\n return true;\n}\n\n\nbool CTxMemPool::addUnchecked(const uint256& hash, CTransaction &tx)\n{\n // Add to memory pool without checking anything. Don't call this directly,\n // call CTxMemPool::accept to properly check the transaction first.\n {\n mapTx[hash] = tx;\n for (unsigned int i = 0; i < tx.vin.size(); i++)\n mapNextTx[tx.vin[i].prevout] = CInPoint(&mapTx[hash], i);\n nTransactionsUpdated++;\n }\n return true;\n}\n\n\nbool CTxMemPool::remove(const CTransaction &tx, bool fRecursive)\n{\n // Remove transaction from memory pool\n {\n LOCK(cs);\n uint256 hash = tx.GetHash();\n if (mapTx.count(hash))\n {\n if (fRecursive) {\n for (unsigned int i = 0; i < tx.vout.size(); i++) {\n std::map<COutPoint, CInPoint>::iterator it = mapNextTx.find(COutPoint(hash, i));\n if (it != mapNextTx.end())\n remove(*it->second.ptx, true);\n }\n }\n BOOST_FOREACH(const CTxIn& txin, tx.vin)\n mapNextTx.erase(txin.prevout);\n mapTx.erase(hash);\n nTransactionsUpdated++;\n }\n }\n return true;\n}\n\nbool CTxMemPool::removeConflicts(const CTransaction &tx)\n{\n // Remove transactions which depend on inputs of tx, recursively\n LOCK(cs);\n BOOST_FOREACH(const CTxIn &txin, tx.vin) {\n std::map<COutPoint, CInPoint>::iterator it = mapNextTx.find(txin.prevout);\n if (it != mapNextTx.end()) {\n const CTransaction &txConflict = *it->second.ptx;\n if (txConflict != tx)\n remove(txConflict, true);\n }\n }\n return true;\n}\n\nvoid CTxMemPool::clear()\n{\n LOCK(cs);\n mapTx.clear();\n mapNextTx.clear();\n ++nTransactionsUpdated;\n}\n\nvoid CTxMemPool::queryHashes(std::vector<uint256>& vtxid)\n{\n vtxid.clear();\n\n LOCK(cs);\n vtxid.reserve(mapTx.size());\n for (map<uint256, CTransaction>::iterator mi = mapTx.begin(); mi != mapTx.end(); ++mi)\n vtxid.push_back((*mi).first);\n}\n\n\n\n\nint CMerkleTx::GetDepthInMainChain(CBlockIndex* &pindexRet) const\n{\n if (hashBlock == 0 || nIndex == -1)\n return 0;\n\n // Find the block it claims to be in\n map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);\n if (mi == mapBlockIndex.end())\n return 0;\n CBlockIndex* pindex = (*mi).second;\n if (!pindex || !pindex->IsInMainChain())\n return 0;\n\n // Make sure the merkle branch connects to this block\n if (!fMerkleVerified)\n {\n if (CBlock::CheckMerkleBranch(GetHash(), vMerkleBranch, nIndex) != pindex->hashMerkleRoot)\n return 0;\n fMerkleVerified = true;\n }\n\n pindexRet = pindex;\n return pindexBest->nHeight - pindex->nHeight + 1;\n}\n\n\nint CMerkleTx::GetBlocksToMaturity() const\n{\n if (!IsCoinBase())\n return 0;\n return max(0, (COINBASE_MATURITY+20) - GetDepthInMainChain());\n}\n\n\nbool CMerkleTx::AcceptToMemoryPool(bool fLimitFree)\n{\n CValidationState state;\n return mempool.accept(state, *this, fLimitFree, NULL);\n}\n\n\n\nbool CWalletTx::AcceptWalletTransaction()\n{\n {\n LOCK(mempool.cs);\n // Add previous supporting transactions first\n BOOST_FOREACH(CMerkleTx& tx, vtxPrev)\n {\n if (!tx.IsCoinBase())\n {\n uint256 hash = tx.GetHash();\n if (!mempool.exists(hash) && pcoinsTip->HaveCoins(hash))\n tx.AcceptToMemoryPool(false);\n }\n }\n return AcceptToMemoryPool(false);\n }\n return false;\n}\n\n\n// Return transaction in tx, and if it was found inside a block, its hash is placed in hashBlock\nbool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, bool fAllowSlow)\n{\n CBlockIndex *pindexSlow = NULL;\n {\n LOCK(cs_main);\n {\n LOCK(mempool.cs);\n if (mempool.exists(hash))\n {\n txOut = mempool.lookup(hash);\n return true;\n }\n }\n\n if (fTxIndex) {\n CDiskTxPos postx;\n if (pblocktree->ReadTxIndex(hash, postx)) {\n CAutoFile file(OpenBlockFile(postx, true), SER_DISK, CLIENT_VERSION);\n CBlockHeader header;\n try {\n file >> header;\n fseek(file, postx.nTxOffset, SEEK_CUR);\n file >> txOut;\n } catch (std::exception &e) {\n return error(\"%s() : deserialize or I/O error\", __PRETTY_FUNCTION__);\n }\n hashBlock = header.GetHash();\n if (txOut.GetHash() != hash)\n return error(\"%s() : txid mismatch\", __PRETTY_FUNCTION__);\n return true;\n }\n }\n\n if (fAllowSlow) { // use coin database to locate block that contains transaction, and scan it\n int nHeight = -1;\n {\n CCoinsViewCache &view = *pcoinsTip;\n CCoins coins;\n if (view.GetCoins(hash, coins))\n nHeight = coins.nHeight;\n }\n if (nHeight > 0)\n pindexSlow = FindBlockByHeight(nHeight);\n }\n }\n\n if (pindexSlow) {\n CBlock block;\n if (ReadBlockFromDisk(block, pindexSlow)) {\n BOOST_FOREACH(const CTransaction &tx, block.vtx) {\n if (tx.GetHash() == hash) {\n txOut = tx;\n hashBlock = pindexSlow->GetBlockHash();\n return true;\n }\n }\n }\n }\n\n return false;\n}\n\n\n\n\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// CBlock and CBlockIndex\n//\n\nstatic CBlockIndex* pblockindexFBBHLast;\nCBlockIndex* FindBlockByHeight(int nHeight)\n{\n if (nHeight >= (int)vBlockIndexByHeight.size())\n return NULL;\n return vBlockIndexByHeight[nHeight];\n}\n\nbool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos)\n{\n // Open history file to append\n CAutoFile fileout = CAutoFile(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION);\n if (!fileout)\n return error(\"WriteBlockToDisk() : OpenBlockFile failed\");\n\n // Write index header\n unsigned int nSize = fileout.GetSerializeSize(block);\n fileout << FLATDATA(Params().MessageStart()) << nSize;\n\n // Write block\n long fileOutPos = ftell(fileout);\n if (fileOutPos < 0)\n return error(\"WriteBlockToDisk() : ftell failed\");\n pos.nPos = (unsigned int)fileOutPos;\n fileout << block;\n\n // Flush stdio buffers and commit to disk before returning\n fflush(fileout);\n if (!IsInitialBlockDownload())\n FileCommit(fileout);\n\n return true;\n}\n\nbool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos)\n{\n block.SetNull();\n\n // Open history file to read\n CAutoFile filein = CAutoFile(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION);\n if (!filein)\n return error(\"ReadBlockFromDisk(CBlock&, CDiskBlockPos&) : OpenBlockFile failed\");\n\n // Read block\n try {\n filein >> block;\n }\n catch (std::exception &e) {\n return error(\"%s() : deserialize or I/O error\", __PRETTY_FUNCTION__);\n }\n\n // Check the header\n if (!CheckProofOfWork(block.GetHash(), block.nBits))\n return error(\"ReadBlockFromDisk(CBlock&, CDiskBlockPos&) : errors in block header\");\n\n return true;\n}\n\nbool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex)\n{\n if (!ReadBlockFromDisk(block, pindex->GetBlockPos()))\n return false;\n if (block.GetHash() != pindex->GetBlockHash())\n return error(\"ReadBlockFromDisk(CBlock&, CBlockIndex*) : GetHash() doesn't match index\");\n return true;\n}\n\nuint256 static GetOrphanRoot(const CBlockHeader* pblock)\n{\n // Work back to the first block in the orphan chain\n while (mapOrphanBlocks.count(pblock->hashPrevBlock))\n pblock = mapOrphanBlocks[pblock->hashPrevBlock];\n return pblock->GetHash();\n}\n\nstatic const int64 nStartSubsidy = 524288 * COIN;\nstatic const int64 nMinSubsidy = 1 * COIN;\n\nint64 static GetBlockValue(int nHeight, int64 nFees)\n{\n int64 nSubsidy = nStartSubsidy;\n if(nHeight < 121) {nSubsidy = 1 * COIN;} //minimal rewards for 1 diff change\n\n // Mining phase: Subsidy is cut in half every SubsidyHalvingInterval\n nSubsidy >>= (nHeight / Params().SubsidyHalvingInterval());\n \n // Inflation phase: Subsidy reaches minimum subsidy\n // Network is rewarded for transaction processing with transaction fees and \n // the inflationary subsidy\n if (nSubsidy < nMinSubsidy)\n {\n nSubsidy = nMinSubsidy;\n }\n\n return nSubsidy + nFees;\n}\n\nstatic const int64 nTargetTimespan = 60 * 60; // 1 hour\nstatic const int64 nTargetSpacing = 30; // 30 seconds\nstatic const int64 nInterval = nTargetTimespan / nTargetSpacing; // 120 blocks\n\nstatic const int64 nAveragingInterval = nInterval * 20; // 40 blocks\nstatic const int64 nAveragingTargetTimespan = nAveragingInterval * nTargetSpacing; // 40 minutes\n\nstatic const int64 nMaxAdjustDown = 400; // max of 400% adjustment down\nstatic const int64 nMaxAdjustUp = 400; // max of 400% adjustment up\n\nstatic const int64 nTargetTimespanAdjDown = nTargetTimespan * (100 + nMaxAdjustDown) / 100;\n\n//\n// minimum amount of work that could possibly be required nTime after\n// minimum work required was nBase\n//\nunsigned int ComputeMinWork(unsigned int nBase, int64 nTime)\n{\n const CBigNum &bnLimit = Params().ProofOfWorkLimit();\n // Testnet has min-difficulty blocks\n // after nTargetSpacing*2 time between blocks:\n if (TestNet() && nTime > nTargetSpacing*2)\n return bnLimit.GetCompact();\n\n CBigNum bnResult;\n bnResult.SetCompact(nBase);\n while (nTime > 0 && bnResult < bnLimit)\n {\n // Maximum adjustment...\n bnResult *= (100 + nMaxAdjustDown);\n bnResult /= 100;\n // ... in best-case exactly adjustment times-normal target time\n nTime -= nTargetTimespanAdjDown;\n }\n if (bnResult > bnLimit)\n bnResult = bnLimit;\n return bnResult.GetCompact();\n}\n\n\n\n////////////////////////////////////////////////////////////////////////////////////////////////////\n\nstatic const int64 nMinActualTimespan = nAveragingTargetTimespan * (100 - nMaxAdjustUp) / 100;\nstatic const int64 nMaxActualTimespan = nAveragingTargetTimespan * (100 + nMaxAdjustDown) / 100;\n \n// legacy diff-mode\nunsigned int static GetNextWorkRequired_V1(const CBlockIndex* pindexLast, const CBlockHeader *pblock)\n{\n unsigned int nProofOfWorkLimit = Params().ProofOfWorkLimit().GetCompact();\n\n // Genesis block\n if (pindexLast == NULL)\n return nProofOfWorkLimit;\n \n if (pindexLast->nHeight+1 < nAveragingInterval) \n return nProofOfWorkLimit;\n\n // Only change once per interval\n if ((pindexLast->nHeight+1) % nInterval != 0)\n {\n if (TestNet())\n {\n // Special difficulty rule for testnet:\n // If the new block's timestamp is more than 2* 10 minutes\n // then allow mining of a min-difficulty block.\n if (pblock->nTime > pindexLast->nTime + nTargetSpacing*2)\n return nProofOfWorkLimit;\n else\n {\n // Return the last non-special-min-difficulty-rules-block\n const CBlockIndex* pindex = pindexLast;\n while (pindex->pprev && pindex->nHeight % nInterval != 0 && pindex->nBits == nProofOfWorkLimit)\n pindex = pindex->pprev;\n return pindex->nBits;\n }\n }\n return pindexLast->nBits;\n }\n\n\n // This fixes an issue where a 51% attack can change difficulty at will.\n // Go back the full period unless it's the first retarget after genesis. Code courtesy of Art Forz\n int blockstogoback = nInterval-1;\n if ((pindexLast->nHeight+1) != nInterval)\n blockstogoback = nInterval;\n\n // Go back by what we want to be nAveragingInterval blocks\n const CBlockIndex* pindexFirst = pindexLast;\n for (int i = 0; pindexFirst && i < nAveragingInterval-1; i++)\n pindexFirst = pindexFirst->pprev;\n assert(pindexFirst);\n\n // Limit adjustment step\n int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();\n printf(\" nActualTimespan = %\"PRI64d\" before bounds\\n\", nActualTimespan);\n if (nActualTimespan < nMinActualTimespan)\n nActualTimespan = nMinActualTimespan;\n if (nActualTimespan > nMaxActualTimespan)\n nActualTimespan = nMaxActualTimespan;\n\n // Retarget\n CBigNum bnNew;\n bnNew.SetCompact(pindexLast->nBits);\n bnNew *= nActualTimespan;\n bnNew /= nAveragingTargetTimespan;\n\n if (bnNew > Params().ProofOfWorkLimit())\n bnNew = Params().ProofOfWorkLimit();\n\n /// debug print\n printf(\"GetNextWorkRequired (legacy)RETARGET\\n\");\n printf(\"nTargetTimespan = %\"PRI64d\" nActualTimespan = %\"PRI64d\"\\n\", nAveragingTargetTimespan, nActualTimespan);\n printf(\"Before: %08x %s\\n\", pindexLast->nBits, CBigNum().SetCompact(pindexLast->nBits).getuint256().ToString().c_str());\n printf(\"After: %08x %s\\n\", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());\n\n return bnNew.GetCompact();\n}\n\n\nunsigned int static KimotoGravityWell(const CBlockIndex* pindexLast, const CBlockHeader *pblock, uint64 TargetBlocksSpacingSeconds, uint64 PastBlocksMin, uint64 PastBlocksMax) {\n /* current difficulty formula - kimoto gravity well */\n const CBlockIndex *BlockLastSolved = pindexLast;\n const CBlockIndex *BlockReading = pindexLast;\n const CBlockHeader *BlockCreating = pblock;\n BlockCreating = BlockCreating;\n uint64 PastBlocksMass = 0;\n int64 PastRateActualSeconds = 0;\n int64 PastRateTargetSeconds = 0;\n double PastRateAdjustmentRatio = double(1);\n CBigNum PastDifficultyAverage;\n CBigNum PastDifficultyAveragePrev;\n double EventHorizonDeviation;\n double EventHorizonDeviationFast;\n double EventHorizonDeviationSlow;\n \n if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0 || (uint64)BlockLastSolved->nHeight < PastBlocksMin) { return Params().ProofOfWorkLimit().GetCompact(); }\n \n for (unsigned int i = 1; BlockReading && BlockReading->nHeight > 0; i++) {\n if (PastBlocksMax > 0 && i > PastBlocksMax) { break; }\n PastBlocksMass++;\n \n if (i == 1) { PastDifficultyAverage.SetCompact(BlockReading->nBits); }\n else { PastDifficultyAverage = ((CBigNum().SetCompact(BlockReading->nBits) - PastDifficultyAveragePrev) / i) + PastDifficultyAveragePrev; }\n PastDifficultyAveragePrev = PastDifficultyAverage;\n \n PastRateActualSeconds = BlockLastSolved->GetBlockTime() - BlockReading->GetBlockTime();\n PastRateTargetSeconds = TargetBlocksSpacingSeconds * PastBlocksMass;\n PastRateAdjustmentRatio = double(1);\n if (PastRateActualSeconds < 0) { PastRateActualSeconds = 0; }\n if (PastRateActualSeconds != 0 && PastRateTargetSeconds != 0) {\n PastRateAdjustmentRatio = double(PastRateTargetSeconds) / double(PastRateActualSeconds);\n }\n EventHorizonDeviation = 1 + (0.7084 * pow((double(PastBlocksMass)/double(144)), -1.228));\n EventHorizonDeviationFast = EventHorizonDeviation;\n EventHorizonDeviationSlow = 1 / EventHorizonDeviation;\n \n if (PastBlocksMass >= PastBlocksMin) {\n if ((PastRateAdjustmentRatio <= EventHorizonDeviationSlow) || (PastRateAdjustmentRatio >= EventHorizonDeviationFast)) { assert(BlockReading); break; }\n }\n if (BlockReading->pprev == NULL) { assert(BlockReading); break; }\n BlockReading = BlockReading->pprev;\n }\n \n CBigNum bnNew(PastDifficultyAverage);\n if (PastRateActualSeconds != 0 && PastRateTargetSeconds != 0) {\n bnNew *= PastRateActualSeconds;\n bnNew /= PastRateTargetSeconds;\n }\n if (bnNew > Params().ProofOfWorkLimit()) { bnNew = Params().ProofOfWorkLimit(); }\n \n /// debug print (commented out due to spamming logs when the loop above breaks)\nprintf(\"Difficulty Retarget - Kimoto Gravity Well\\n\");\nprintf(\"PastRateAdjustmentRatio = %g\\n\", PastRateAdjustmentRatio);\nprintf(\"Before: %08x %s\\n\", BlockLastSolved->nBits, CBigNum().SetCompact(BlockLastSolved->nBits).getuint256().ToString().c_str());\nprintf(\"After: %08x %s\\n\", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());\n \n return bnNew.GetCompact();\n}\n\n\n\n// Using KGW\nunsigned int static GetNextWorkRequired_V2(const CBlockIndex* pindexLast, const CBlockHeader *pblock)\n{\n static const int64 BlocksTargetSpacing = 0.5 *60; // 30 sec\n unsigned int TimeDaySeconds = 60 * 60 * 24;\n int64 PastSecondsMin = TimeDaySeconds * 0.25;\n int64 PastSecondsMax = TimeDaySeconds * 7;\n uint64 PastBlocksMin = PastSecondsMin / BlocksTargetSpacing;\n uint64 PastBlocksMax = PastSecondsMax / BlocksTargetSpacing;\n \n return KimotoGravityWell(pindexLast, pblock, BlocksTargetSpacing, PastBlocksMin, PastBlocksMax);\n}\n\n\n\nunsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock)\n{\n//Choose the right diffMode\n\t\n int DiffMode = 1; // legacy diff-mode\n if (TestNet()) {\n if (pindexLast->nHeight+1 >= 179) { DiffMode = 2; } //legacy\n }\n else {\n if (pindexLast->nHeight+1 >= 36000) { DiffMode = 2; } //kimoto\n }\n \n if (DiffMode == 1) { return GetNextWorkRequired_V1(pindexLast, pblock); } //legacy diff mode\n else if (DiffMode == 2) { return GetNextWorkRequired_V2(pindexLast, pblock); } // KGW\n return GetNextWorkRequired_V2(pindexLast, pblock); // KGW\n}\n\n\n////////////////////////////////////////////////////////////////////////////////////////////////////\n\nbool CheckProofOfWork(uint256 hash, unsigned int nBits)\n{\n CBigNum bnTarget;\n bnTarget.SetCompact(nBits);\n\n // Check range\n if (bnTarget <= 0 || bnTarget > Params().ProofOfWorkLimit())\n return error(\"CheckProofOfWork() : nBits below minimum work\");\n\n // Check proof of work matches claimed amount\n if (hash > bnTarget.getuint256())\n return error(\"CheckProofOfWork() : hash doesn't match nBits\");\n\n return true;\n}\n\n// Return maximum amount of blocks that other nodes claim to have\nint GetNumBlocksOfPeers()\n{\n return std::max(cPeerBlockCounts.median(), Checkpoints::GetTotalBlocksEstimate());\n}\n\nbool IsInitialBlockDownload()\n{\n if (pindexBest == NULL || fImporting || fReindex || nBestHeight < Checkpoints::GetTotalBlocksEstimate())\n return true;\n static int64 nLastUpdate;\n static CBlockIndex* pindexLastBest;\n if (pindexBest != pindexLastBest)\n {\n pindexLastBest = pindexBest;\n nLastUpdate = GetTime();\n }\n return (GetTime() - nLastUpdate < 10 &&\n pindexBest->GetBlockTime() < GetTime() - 24 * 60 * 60);\n}\n\nvoid static InvalidChainFound(CBlockIndex* pindexNew)\n{\n if (pindexNew->nChainWork > nBestInvalidWork)\n {\n nBestInvalidWork = pindexNew->nChainWork;\n pblocktree->WriteBestInvalidWork(CBigNum(nBestInvalidWork));\n uiInterface.NotifyBlocksChanged();\n }\n printf(\"InvalidChainFound: invalid block=%s height=%d log2_work=%.8g date=%s\\n\",\n pindexNew->GetBlockHash().ToString().c_str(), pindexNew->nHeight,\n log(pindexNew->nChainWork.getdouble())/log(2.0), DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\",\n pindexNew->GetBlockTime()).c_str());\n printf(\"InvalidChainFound: current best=%s height=%d log2_work=%.8g date=%s\\n\",\n hashBestChain.ToString().c_str(), nBestHeight, log(nBestChainWork.getdouble())/log(2.0),\n DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", pindexBest->GetBlockTime()).c_str());\n if (pindexBest && nBestInvalidWork > nBestChainWork + (pindexBest->GetBlockWork() * 6).getuint256())\n printf(\"InvalidChainFound: Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.\\n\");\n}\n\nvoid static InvalidBlockFound(CBlockIndex *pindex) {\n pindex->nStatus |= BLOCK_FAILED_VALID;\n pblocktree->WriteBlockIndex(CDiskBlockIndex(pindex));\n setBlockIndexValid.erase(pindex);\n InvalidChainFound(pindex);\n if (pindex->GetNextInMainChain()) {\n CValidationState stateDummy;\n ConnectBestBlock(stateDummy); // reorganise away from the failed block\n }\n}\n\nbool ConnectBestBlock(CValidationState &state) {\n do {\n CBlockIndex *pindexNewBest;\n\n {\n std::set<CBlockIndex*,CBlockIndexWorkComparator>::reverse_iterator it = setBlockIndexValid.rbegin();\n if (it == setBlockIndexValid.rend())\n return true;\n pindexNewBest = *it;\n }\n\n if (pindexNewBest == pindexBest || (pindexBest && pindexNewBest->nChainWork == pindexBest->nChainWork))\n return true; // nothing to do\n\n // check ancestry\n CBlockIndex *pindexTest = pindexNewBest;\n std::vector<CBlockIndex*> vAttach;\n do {\n if (pindexTest->nStatus & BLOCK_FAILED_MASK) {\n // mark descendants failed\n CBlockIndex *pindexFailed = pindexNewBest;\n while (pindexTest != pindexFailed) {\n pindexFailed->nStatus |= BLOCK_FAILED_CHILD;\n setBlockIndexValid.erase(pindexFailed);\n pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexFailed));\n pindexFailed = pindexFailed->pprev;\n }\n InvalidChainFound(pindexNewBest);\n break;\n }\n\n if (pindexBest == NULL || pindexTest->nChainWork > pindexBest->nChainWork)\n vAttach.push_back(pindexTest);\n\n if (pindexTest->pprev == NULL || pindexTest->GetNextInMainChain()) {\n reverse(vAttach.begin(), vAttach.end());\n BOOST_FOREACH(CBlockIndex *pindexSwitch, vAttach) {\n boost::this_thread::interruption_point();\n try {\n if (!SetBestChain(state, pindexSwitch))\n return false;\n } catch(std::runtime_error &e) {\n return state.Abort(_(\"System error: \") + e.what());\n }\n }\n return true;\n }\n pindexTest = pindexTest->pprev;\n } while(true);\n } while(true);\n}\n\nvoid UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev)\n{\n block.nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());\n\n // Updating time can change work required on testnet:\n if (TestNet())\n block.nBits = GetNextWorkRequired(pindexPrev, &block);\n}\n\n\n\n\n\n\n\n\n\n\n\nconst CTxOut &CCoinsViewCache::GetOutputFor(const CTxIn& input)\n{\n const CCoins &coins = GetCoins(input.prevout.hash);\n assert(coins.IsAvailable(input.prevout.n));\n return coins.vout[input.prevout.n];\n}\n\nint64 CCoinsViewCache::GetValueIn(const CTransaction& tx)\n{\n if (tx.IsCoinBase())\n return 0;\n\n int64 nResult = 0;\n for (unsigned int i = 0; i < tx.vin.size(); i++)\n nResult += GetOutputFor(tx.vin[i]).nValue;\n\n return nResult;\n}\n\nvoid UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight, const uint256 &txhash)\n{\n // mark inputs spent\n if (!tx.IsCoinBase()) {\n BOOST_FOREACH(const CTxIn &txin, tx.vin) {\n CCoins &coins = inputs.GetCoins(txin.prevout.hash);\n CTxInUndo undo;\n assert(coins.Spend(txin.prevout, undo));\n txundo.vprevout.push_back(undo);\n }\n }\n\n // add outputs\n assert(inputs.SetCoins(txhash, CCoins(tx, nHeight)));\n}\n\nbool CCoinsViewCache::HaveInputs(const CTransaction& tx)\n{\n if (!tx.IsCoinBase()) {\n // first check whether information about the prevout hash is available\n for (unsigned int i = 0; i < tx.vin.size(); i++) {\n const COutPoint &prevout = tx.vin[i].prevout;\n if (!HaveCoins(prevout.hash))\n return false;\n }\n\n // then check whether the actual outputs are available\n for (unsigned int i = 0; i < tx.vin.size(); i++) {\n const COutPoint &prevout = tx.vin[i].prevout;\n const CCoins &coins = GetCoins(prevout.hash);\n if (!coins.IsAvailable(prevout.n))\n return false;\n }\n }\n return true;\n}\n\nbool CScriptCheck::operator()() const {\n const CScript &scriptSig = ptxTo->vin[nIn].scriptSig;\n if (!VerifyScript(scriptSig, scriptPubKey, *ptxTo, nIn, nFlags, nHashType))\n return error(\"CScriptCheck() : %s VerifySignature failed\", ptxTo->GetHash().ToString().c_str());\n return true;\n}\n\nbool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType)\n{\n return CScriptCheck(txFrom, txTo, nIn, flags, nHashType)();\n}\n\nbool CheckInputs(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, std::vector<CScriptCheck> *pvChecks)\n{\n if (!tx.IsCoinBase())\n {\n if (pvChecks)\n pvChecks->reserve(tx.vin.size());\n\n // This doesn't trigger the DoS code on purpose; if it did, it would make it easier\n // for an attacker to attempt to split the network.\n if (!inputs.HaveInputs(tx))\n return state.Invalid(error(\"CheckInputs() : %s inputs unavailable\", tx.GetHash().ToString().c_str()));\n\n // While checking, GetBestBlock() refers to the parent block.\n // This is also true for mempool checks.\n int nSpendHeight = inputs.GetBestBlock()->nHeight + 1;\n int64 nValueIn = 0;\n int64 nFees = 0;\n for (unsigned int i = 0; i < tx.vin.size(); i++)\n {\n const COutPoint &prevout = tx.vin[i].prevout;\n const CCoins &coins = inputs.GetCoins(prevout.hash);\n\n // If prev is coinbase, check that it's matured\n if (coins.IsCoinBase()) {\n if (nSpendHeight - coins.nHeight < COINBASE_MATURITY)\n return state.Invalid(error(\"CheckInputs() : tried to spend coinbase at depth %d\", nSpendHeight - coins.nHeight));\n }\n\n // Check for negative or overflow input values\n nValueIn += coins.vout[prevout.n].nValue;\n if (!MoneyRange(coins.vout[prevout.n].nValue) || !MoneyRange(nValueIn))\n return state.DoS(100, error(\"CheckInputs() : txin values out of range\"));\n\n }\n\n if (nValueIn < GetValueOut(tx))\n return state.DoS(100, error(\"CheckInputs() : %s value in < value out\", tx.GetHash().ToString().c_str()));\n\n // Tally transaction fees\n int64 nTxFee = nValueIn - GetValueOut(tx);\n if (nTxFee < 0)\n return state.DoS(100, error(\"CheckInputs() : %s nTxFee < 0\", tx.GetHash().ToString().c_str()));\n nFees += nTxFee;\n if (!MoneyRange(nFees))\n return state.DoS(100, error(\"CheckInputs() : nFees out of range\"));\n\n // The first loop above does all the inexpensive checks.\n // Only if ALL inputs pass do we perform expensive ECDSA signature checks.\n // Helps prevent CPU exhaustion attacks.\n\n // Skip ECDSA signature verification when connecting blocks\n // before the last block chain checkpoint. This is safe because block merkle hashes are\n // still computed and checked, and any change will be caught at the next checkpoint.\n if (fScriptChecks) {\n for (unsigned int i = 0; i < tx.vin.size(); i++) {\n const COutPoint &prevout = tx.vin[i].prevout;\n const CCoins &coins = inputs.GetCoins(prevout.hash);\n\n // Verify signature\n CScriptCheck check(coins, tx, i, flags, 0);\n if (pvChecks) {\n pvChecks->push_back(CScriptCheck());\n check.swap(pvChecks->back());\n } else if (!check()) {\n if (flags & SCRIPT_VERIFY_STRICTENC) {\n // For now, check whether the failure was caused by non-canonical\n // encodings or not; if so, don't trigger DoS protection.\n CScriptCheck check(coins, tx, i, flags & (~SCRIPT_VERIFY_STRICTENC), 0);\n if (check())\n return state.Invalid();\n }\n return state.DoS(100,false);\n }\n }\n }\n }\n\n return true;\n}\n\n\n\nbool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& view, bool* pfClean)\n{\n assert(pindex == view.GetBestBlock());\n\n if (pfClean)\n *pfClean = false;\n\n bool fClean = true;\n\n CBlockUndo blockUndo;\n CDiskBlockPos pos = pindex->GetUndoPos();\n if (pos.IsNull())\n return error(\"DisconnectBlock() : no undo data available\");\n if (!blockUndo.ReadFromDisk(pos, pindex->pprev->GetBlockHash()))\n return error(\"DisconnectBlock() : failure reading undo data\");\n\n if (blockUndo.vtxundo.size() + 1 != block.vtx.size())\n return error(\"DisconnectBlock() : block and undo data inconsistent\");\n\n // undo transactions in reverse order\n for (int i = block.vtx.size() - 1; i >= 0; i--) {\n const CTransaction &tx = block.vtx[i];\n uint256 hash = tx.GetHash();\n\n // check that all outputs are available\n if (!view.HaveCoins(hash)) {\n fClean = fClean && error(\"DisconnectBlock() : outputs still spent? database corrupted\");\n view.SetCoins(hash, CCoins());\n }\n CCoins &outs = view.GetCoins(hash);\n\n CCoins outsBlock = CCoins(tx, pindex->nHeight);\n if (outs != outsBlock)\n fClean = fClean && error(\"DisconnectBlock() : added transaction mismatch? database corrupted\");\n\n // remove outputs\n outs = CCoins();\n\n // restore inputs\n if (i > 0) { // not coinbases\n const CTxUndo &txundo = blockUndo.vtxundo[i-1];\n if (txundo.vprevout.size() != tx.vin.size())\n return error(\"DisconnectBlock() : transaction and undo data inconsistent\");\n for (unsigned int j = tx.vin.size(); j-- > 0;) {\n const COutPoint &out = tx.vin[j].prevout;\n const CTxInUndo &undo = txundo.vprevout[j];\n CCoins coins;\n view.GetCoins(out.hash, coins); // this can fail if the prevout was already entirely spent\n if (undo.nHeight != 0) {\n // undo data contains height: this is the last output of the prevout tx being spent\n if (!coins.IsPruned())\n fClean = fClean && error(\"DisconnectBlock() : undo data overwriting existing transaction\");\n coins = CCoins();\n coins.fCoinBase = undo.fCoinBase;\n coins.nHeight = undo.nHeight;\n coins.nVersion = undo.nVersion;\n } else {\n if (coins.IsPruned())\n fClean = fClean && error(\"DisconnectBlock() : undo data adding output to missing transaction\");\n }\n if (coins.IsAvailable(out.n))\n fClean = fClean && error(\"DisconnectBlock() : undo data overwriting existing output\");\n if (coins.vout.size() < out.n+1)\n coins.vout.resize(out.n+1);\n coins.vout[out.n] = undo.txout;\n if (!view.SetCoins(out.hash, coins))\n return error(\"DisconnectBlock() : cannot restore coin inputs\");\n }\n }\n }\n\n // move best block pointer to prevout block\n view.SetBestBlock(pindex->pprev);\n\n if (pfClean) {\n *pfClean = fClean;\n return true;\n } else {\n return fClean;\n }\n}\n\nvoid static FlushBlockFile(bool fFinalize = false)\n{\n LOCK(cs_LastBlockFile);\n\n CDiskBlockPos posOld(nLastBlockFile, 0);\n\n FILE *fileOld = OpenBlockFile(posOld);\n if (fileOld) {\n if (fFinalize)\n TruncateFile(fileOld, infoLastBlockFile.nSize);\n FileCommit(fileOld);\n fclose(fileOld);\n }\n\n fileOld = OpenUndoFile(posOld);\n if (fileOld) {\n if (fFinalize)\n TruncateFile(fileOld, infoLastBlockFile.nUndoSize);\n FileCommit(fileOld);\n fclose(fileOld);\n }\n}\n\nbool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigned int nAddSize);\n\nstatic CCheckQueue<CScriptCheck> scriptcheckqueue(128);\n\nvoid ThreadScriptCheck() {\n RenameThread(\"bitcoin-scriptch\");\n scriptcheckqueue.Thread();\n}\n\nbool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, CCoinsViewCache& view, bool fJustCheck)\n{\n // Check it again in case a previous version let a bad block in\n if (!CheckBlock(block, state, !fJustCheck, !fJustCheck))\n return false;\n\n // verify that the view's current state corresponds to the previous block\n assert(pindex->pprev == view.GetBestBlock());\n\n // Special case for the genesis block, skipping connection of its transactions\n // (its coinbase is unspendable)\n if (block.GetHash() == Params().HashGenesisBlock()) {\n view.SetBestBlock(pindex);\n pindexGenesisBlock = pindex;\n return true;\n }\n\n bool fScriptChecks = pindex->nHeight >= Checkpoints::GetTotalBlocksEstimate();\n\n // Do not allow blocks that contain transactions which 'overwrite' older transactions,\n // unless those are already completely spent.\n // If such overwrites are allowed, coinbases and transactions depending upon those\n // can be duplicated to remove the ability to spend the first instance -- even after\n // being sent to another address.\n // See BIP30 and http://r6.ca/blog/20120206T005236Z.html for more information.\n // This logic is not necessary for memory pool transactions, as AcceptToMemoryPool\n // already refuses previously-known transaction ids entirely.\n // This rule was originally applied all blocks whose timestamp was after March 15, 2012, 0:00 UTC.\n // Now that the whole chain is irreversibly beyond that time it is applied to all blocks except the\n // two in the chain that violate it. This prevents exploiting the issue against nodes in their\n // initial block download.\n for (unsigned int i = 0; i < block.vtx.size(); i++) {\n uint256 hash = block.GetTxHash(i);\n if (view.HaveCoins(hash) && !view.GetCoins(hash).IsPruned())\n return state.DoS(100, error(\"ConnectBlock() : tried to overwrite transaction\"));\n }\n\n // BIP16 didn't become active until Apr 1 2012\n int64 nBIP16SwitchTime = 1333238400;\n bool fStrictPayToScriptHash = (pindex->nTime >= nBIP16SwitchTime);\n\n unsigned int flags = SCRIPT_VERIFY_NOCACHE |\n (fStrictPayToScriptHash ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE);\n\n CBlockUndo blockundo;\n\n CCheckQueueControl<CScriptCheck> control(fScriptChecks && nScriptCheckThreads ? &scriptcheckqueue : NULL);\n\n int64 nStart = GetTimeMicros();\n int64 nFees = 0;\n int nInputs = 0;\n unsigned int nSigOps = 0;\n CDiskTxPos pos(pindex->GetBlockPos(), GetSizeOfCompactSize(block.vtx.size()));\n std::vector<std::pair<uint256, CDiskTxPos> > vPos;\n vPos.reserve(block.vtx.size());\n for (unsigned int i = 0; i < block.vtx.size(); i++)\n {\n const CTransaction &tx = block.vtx[i];\n\n nInputs += tx.vin.size();\n nSigOps += GetLegacySigOpCount(tx);\n if (nSigOps > MAX_BLOCK_SIGOPS)\n return state.DoS(100, error(\"ConnectBlock() : too many sigops\"));\n\n if (!tx.IsCoinBase())\n {\n if (!view.HaveInputs(tx))\n return state.DoS(100, error(\"ConnectBlock() : inputs missing/spent\"));\n\n if (fStrictPayToScriptHash)\n {\n // Add in sigops done by pay-to-script-hash inputs;\n // this is to prevent a \"rogue miner\" from creating\n // an incredibly-expensive-to-validate block.\n nSigOps += GetP2SHSigOpCount(tx, view);\n if (nSigOps > MAX_BLOCK_SIGOPS)\n return state.DoS(100, error(\"ConnectBlock() : too many sigops\"));\n }\n\n nFees += view.GetValueIn(tx)-GetValueOut(tx);\n\n std::vector<CScriptCheck> vChecks;\n if (!CheckInputs(tx, state, view, fScriptChecks, flags, nScriptCheckThreads ? &vChecks : NULL))\n return false;\n control.Add(vChecks);\n }\n\n CTxUndo txundo;\n UpdateCoins(tx, state, view, txundo, pindex->nHeight, block.GetTxHash(i));\n if (!tx.IsCoinBase())\n blockundo.vtxundo.push_back(txundo);\n\n vPos.push_back(std::make_pair(block.GetTxHash(i), pos));\n pos.nTxOffset += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION);\n }\n int64 nTime = GetTimeMicros() - nStart;\n if (fBenchmark)\n printf(\"- Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin)\\n\", (unsigned)block.vtx.size(), 0.001 * nTime, 0.001 * nTime / block.vtx.size(), nInputs <= 1 ? 0 : 0.001 * nTime / (nInputs-1));\n\n if (GetValueOut(block.vtx[0]) > GetBlockValue(pindex->nHeight, nFees))\n return state.DoS(100, error(\"ConnectBlock() : coinbase pays too much (actual=%\"PRI64d\" vs limit=%\"PRI64d\")\", GetValueOut(block.vtx[0]), GetBlockValue(pindex->nHeight, nFees)));\n\n if (!control.Wait())\n return state.DoS(100, false);\n int64 nTime2 = GetTimeMicros() - nStart;\n if (fBenchmark)\n printf(\"- Verify %u txins: %.2fms (%.3fms/txin)\\n\", nInputs - 1, 0.001 * nTime2, nInputs <= 1 ? 0 : 0.001 * nTime2 / (nInputs-1));\n\n if (fJustCheck)\n return true;\n\n // Write undo information to disk\n if (pindex->GetUndoPos().IsNull() || (pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_SCRIPTS)\n {\n if (pindex->GetUndoPos().IsNull()) {\n CDiskBlockPos pos;\n if (!FindUndoPos(state, pindex->nFile, pos, ::GetSerializeSize(blockundo, SER_DISK, CLIENT_VERSION) + 40))\n return error(\"ConnectBlock() : FindUndoPos failed\");\n if (!blockundo.WriteToDisk(pos, pindex->pprev->GetBlockHash()))\n return state.Abort(_(\"Failed to write undo data\"));\n\n // update nUndoPos in block index\n pindex->nUndoPos = pos.nPos;\n pindex->nStatus |= BLOCK_HAVE_UNDO;\n }\n\n pindex->nStatus = (pindex->nStatus & ~BLOCK_VALID_MASK) | BLOCK_VALID_SCRIPTS;\n\n CDiskBlockIndex blockindex(pindex);\n if (!pblocktree->WriteBlockIndex(blockindex))\n return state.Abort(_(\"Failed to write block index\"));\n }\n\n if (fTxIndex)\n if (!pblocktree->WriteTxIndex(vPos))\n return state.Abort(_(\"Failed to write transaction index\"));\n\n // add this block to the view's block chain\n assert(view.SetBestBlock(pindex));\n\n // Watch for transactions paying to me\n for (unsigned int i = 0; i < block.vtx.size(); i++)\n SyncWithWallets(block.GetTxHash(i), block.vtx[i], &block, true);\n\n return true;\n}\n\nbool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)\n{\n // All modifications to the coin state will be done in this cache.\n // Only when all have succeeded, we push it to pcoinsTip.\n CCoinsViewCache view(*pcoinsTip, true);\n\n // Find the fork (typically, there is none)\n CBlockIndex* pfork = view.GetBestBlock();\n CBlockIndex* plonger = pindexNew;\n while (pfork && pfork != plonger)\n {\n while (plonger->nHeight > pfork->nHeight) {\n plonger = plonger->pprev;\n assert(plonger != NULL);\n }\n if (pfork == plonger)\n break;\n pfork = pfork->pprev;\n assert(pfork != NULL);\n }\n\n // List of what to disconnect (typically nothing)\n vector<CBlockIndex*> vDisconnect;\n for (CBlockIndex* pindex = view.GetBestBlock(); pindex != pfork; pindex = pindex->pprev)\n vDisconnect.push_back(pindex);\n\n // List of what to connect (typically only pindexNew)\n vector<CBlockIndex*> vConnect;\n for (CBlockIndex* pindex = pindexNew; pindex != pfork; pindex = pindex->pprev)\n vConnect.push_back(pindex);\n reverse(vConnect.begin(), vConnect.end());\n\n if (vDisconnect.size() > 0) {\n printf(\"REORGANIZE: Disconnect %\"PRIszu\" blocks; %s..\\n\", vDisconnect.size(), pfork->GetBlockHash().ToString().c_str());\n printf(\"REORGANIZE: Connect %\"PRIszu\" blocks; ..%s\\n\", vConnect.size(), pindexNew->GetBlockHash().ToString().c_str());\n }\n\n // Disconnect shorter branch\n vector<CTransaction> vResurrect;\n BOOST_FOREACH(CBlockIndex* pindex, vDisconnect) {\n CBlock block;\n if (!ReadBlockFromDisk(block, pindex))\n return state.Abort(_(\"Failed to read block\"));\n int64 nStart = GetTimeMicros();\n if (!DisconnectBlock(block, state, pindex, view))\n return error(\"SetBestBlock() : DisconnectBlock %s failed\", pindex->GetBlockHash().ToString().c_str());\n if (fBenchmark)\n printf(\"- Disconnect: %.2fms\\n\", (GetTimeMicros() - nStart) * 0.001);\n\n // Queue memory transactions to resurrect.\n // We only do this for blocks after the last checkpoint (reorganisation before that\n // point should only happen with -reindex/-loadblock, or a misbehaving peer.\n BOOST_FOREACH(const CTransaction& tx, block.vtx)\n if (!tx.IsCoinBase() && pindex->nHeight > Checkpoints::GetTotalBlocksEstimate())\n vResurrect.push_back(tx);\n }\n\n // Connect longer branch\n vector<CTransaction> vDelete;\n BOOST_FOREACH(CBlockIndex *pindex, vConnect) {\n CBlock block;\n if (!ReadBlockFromDisk(block, pindex))\n return state.Abort(_(\"Failed to read block\"));\n int64 nStart = GetTimeMicros();\n if (!ConnectBlock(block, state, pindex, view)) {\n if (state.IsInvalid()) {\n InvalidChainFound(pindexNew);\n InvalidBlockFound(pindex);\n }\n return error(\"SetBestBlock() : ConnectBlock %s failed\", pindex->GetBlockHash().ToString().c_str());\n }\n if (fBenchmark)\n printf(\"- Connect: %.2fms\\n\", (GetTimeMicros() - nStart) * 0.001);\n\n // Queue memory transactions to delete\n BOOST_FOREACH(const CTransaction& tx, block.vtx)\n vDelete.push_back(tx);\n }\n\n // Flush changes to global coin state\n int64 nStart = GetTimeMicros();\n int nModified = view.GetCacheSize();\n assert(view.Flush());\n int64 nTime = GetTimeMicros() - nStart;\n if (fBenchmark)\n printf(\"- Flush %i transactions: %.2fms (%.4fms/tx)\\n\", nModified, 0.001 * nTime, 0.001 * nTime / nModified);\n\n // Make sure it's successfully written to disk before changing memory structure\n bool fIsInitialDownload = IsInitialBlockDownload();\n if (!fIsInitialDownload || pcoinsTip->GetCacheSize() > nCoinCacheSize) {\n // Typical CCoins structures on disk are around 100 bytes in size.\n // Pushing a new one to the database can cause it to be written\n // twice (once in the log, and once in the tables). This is already\n // an overestimation, as most will delete an existing entry or\n // overwrite one. Still, use a conservative safety factor of 2.\n if (!CheckDiskSpace(100 * 2 * 2 * pcoinsTip->GetCacheSize()))\n return state.Error();\n FlushBlockFile();\n pblocktree->Sync();\n if (!pcoinsTip->Flush())\n return state.Abort(_(\"Failed to write to coin database\"));\n }\n\n // At this point, all changes have been done to the database.\n // Proceed by updating the memory structures.\n\n // Register new best chain\n vBlockIndexByHeight.resize(pindexNew->nHeight + 1);\n BOOST_FOREACH(CBlockIndex* pindex, vConnect)\n vBlockIndexByHeight[pindex->nHeight] = pindex;\n\n // Resurrect memory transactions that were in the disconnected branch\n BOOST_FOREACH(CTransaction& tx, vResurrect) {\n // ignore validation errors in resurrected transactions\n CValidationState stateDummy;\n mempool.accept(stateDummy, tx, false, NULL);\n }\n\n // Delete redundant memory transactions that are in the connected branch\n BOOST_FOREACH(CTransaction& tx, vDelete) {\n mempool.remove(tx);\n mempool.removeConflicts(tx);\n }\n\n // Update best block in wallet (so we can detect restored wallets)\n if ((pindexNew->nHeight % 20160) == 0 || (!fIsInitialDownload && (pindexNew->nHeight % 144) == 0))\n {\n const CBlockLocator locator(pindexNew);\n ::SetBestChain(locator);\n }\n\n // New best block\n hashBestChain = pindexNew->GetBlockHash();\n pindexBest = pindexNew;\n pblockindexFBBHLast = NULL;\n nBestHeight = pindexBest->nHeight;\n nBestChainWork = pindexNew->nChainWork;\n nTimeBestReceived = GetTime();\n nTransactionsUpdated++;\n printf(\"SetBestChain: new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f\\n\",\n hashBestChain.ToString().c_str(), nBestHeight, log(nBestChainWork.getdouble())/log(2.0), (unsigned long)pindexNew->nChainTx,\n DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", pindexBest->GetBlockTime()).c_str(),\n Checkpoints::GuessVerificationProgress(pindexBest));\n\n // Check the version of the last 100 blocks to see if we need to upgrade:\n if (!fIsInitialDownload)\n {\n int nUpgraded = 0;\n const CBlockIndex* pindex = pindexBest;\n for (int i = 0; i < 100 && pindex != NULL; i++)\n {\n if (pindex->nVersion > CBlock::CURRENT_VERSION)\n ++nUpgraded;\n pindex = pindex->pprev;\n }\n if (nUpgraded > 0)\n printf(\"SetBestChain: %d of last 100 blocks above version %d\\n\", nUpgraded, CBlock::CURRENT_VERSION);\n if (nUpgraded > 100/2)\n // strMiscWarning is read by GetWarnings(), called by Qt and the JSON-RPC code to warn the user:\n strMiscWarning = _(\"Warning: This version is obsolete, upgrade required!\");\n }\n\n std::string strCmd = GetArg(\"-blocknotify\", \"\");\n\n if (!fIsInitialDownload && !strCmd.empty())\n {\n boost::replace_all(strCmd, \"%s\", hashBestChain.GetHex());\n boost::thread t(runCommand, strCmd); // thread runs free\n }\n\n return true;\n}\n\n\nbool AddToBlockIndex(CBlock& block, CValidationState& state, const CDiskBlockPos& pos)\n{\n // Check for duplicate\n uint256 hash = block.GetHash();\n if (mapBlockIndex.count(hash))\n return state.Invalid(error(\"AddToBlockIndex() : %s already exists\", hash.ToString().c_str()));\n\n // Construct new block index object\n CBlockIndex* pindexNew = new CBlockIndex(block);\n assert(pindexNew);\n map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first;\n pindexNew->phashBlock = &((*mi).first);\n map<uint256, CBlockIndex*>::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock);\n if (miPrev != mapBlockIndex.end())\n {\n pindexNew->pprev = (*miPrev).second;\n pindexNew->nHeight = pindexNew->pprev->nHeight + 1;\n }\n pindexNew->nTx = block.vtx.size();\n pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + pindexNew->GetBlockWork().getuint256();\n pindexNew->nChainTx = (pindexNew->pprev ? pindexNew->pprev->nChainTx : 0) + pindexNew->nTx;\n pindexNew->nFile = pos.nFile;\n pindexNew->nDataPos = pos.nPos;\n pindexNew->nUndoPos = 0;\n pindexNew->nStatus = BLOCK_VALID_TRANSACTIONS | BLOCK_HAVE_DATA;\n setBlockIndexValid.insert(pindexNew);\n\n if (!pblocktree->WriteBlockIndex(CDiskBlockIndex(pindexNew)))\n return state.Abort(_(\"Failed to write block index\"));\n\n // New best?\n if (!ConnectBestBlock(state))\n return false;\n\n if (pindexNew == pindexBest)\n {\n // Notify UI to display prev block's coinbase if it was ours\n static uint256 hashPrevBestCoinBase;\n UpdatedTransaction(hashPrevBestCoinBase);\n hashPrevBestCoinBase = block.GetTxHash(0);\n }\n\n if (!pblocktree->Flush())\n return state.Abort(_(\"Failed to sync block index\"));\n\n uiInterface.NotifyBlocksChanged();\n return true;\n}\n\n\nbool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAddSize, unsigned int nHeight, uint64 nTime, bool fKnown = false)\n{\n bool fUpdatedLast = false;\n\n LOCK(cs_LastBlockFile);\n\n if (fKnown) {\n if (nLastBlockFile != pos.nFile) {\n nLastBlockFile = pos.nFile;\n infoLastBlockFile.SetNull();\n pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile);\n fUpdatedLast = true;\n }\n } else {\n while (infoLastBlockFile.nSize + nAddSize >= MAX_BLOCKFILE_SIZE) {\n printf(\"Leaving block file %i: %s\\n\", nLastBlockFile, infoLastBlockFile.ToString().c_str());\n FlushBlockFile(true);\n nLastBlockFile++;\n infoLastBlockFile.SetNull();\n pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile); // check whether data for the new file somehow already exist; can fail just fine\n fUpdatedLast = true;\n }\n pos.nFile = nLastBlockFile;\n pos.nPos = infoLastBlockFile.nSize;\n }\n\n infoLastBlockFile.nSize += nAddSize;\n infoLastBlockFile.AddBlock(nHeight, nTime);\n\n if (!fKnown) {\n unsigned int nOldChunks = (pos.nPos + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE;\n unsigned int nNewChunks = (infoLastBlockFile.nSize + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE;\n if (nNewChunks > nOldChunks) {\n if (CheckDiskSpace(nNewChunks * BLOCKFILE_CHUNK_SIZE - pos.nPos)) {\n FILE *file = OpenBlockFile(pos);\n if (file) {\n printf(\"Pre-allocating up to position 0x%x in blk%05u.dat\\n\", nNewChunks * BLOCKFILE_CHUNK_SIZE, pos.nFile);\n AllocateFileRange(file, pos.nPos, nNewChunks * BLOCKFILE_CHUNK_SIZE - pos.nPos);\n fclose(file);\n }\n }\n else\n return state.Error();\n }\n }\n\n if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, infoLastBlockFile))\n return state.Abort(_(\"Failed to write file info\"));\n if (fUpdatedLast)\n pblocktree->WriteLastBlockFile(nLastBlockFile);\n\n return true;\n}\n\nbool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigned int nAddSize)\n{\n pos.nFile = nFile;\n\n LOCK(cs_LastBlockFile);\n\n unsigned int nNewSize;\n if (nFile == nLastBlockFile) {\n pos.nPos = infoLastBlockFile.nUndoSize;\n nNewSize = (infoLastBlockFile.nUndoSize += nAddSize);\n if (!pblocktree->WriteBlockFileInfo(nLastBlockFile, infoLastBlockFile))\n return state.Abort(_(\"Failed to write block info\"));\n } else {\n CBlockFileInfo info;\n if (!pblocktree->ReadBlockFileInfo(nFile, info))\n return state.Abort(_(\"Failed to read block info\"));\n pos.nPos = info.nUndoSize;\n nNewSize = (info.nUndoSize += nAddSize);\n if (!pblocktree->WriteBlockFileInfo(nFile, info))\n return state.Abort(_(\"Failed to write block info\"));\n }\n\n unsigned int nOldChunks = (pos.nPos + UNDOFILE_CHUNK_SIZE - 1) / UNDOFILE_CHUNK_SIZE;\n unsigned int nNewChunks = (nNewSize + UNDOFILE_CHUNK_SIZE - 1) / UNDOFILE_CHUNK_SIZE;\n if (nNewChunks > nOldChunks) {\n if (CheckDiskSpace(nNewChunks * UNDOFILE_CHUNK_SIZE - pos.nPos)) {\n FILE *file = OpenUndoFile(pos);\n if (file) {\n printf(\"Pre-allocating up to position 0x%x in rev%05u.dat\\n\", nNewChunks * UNDOFILE_CHUNK_SIZE, pos.nFile);\n AllocateFileRange(file, pos.nPos, nNewChunks * UNDOFILE_CHUNK_SIZE - pos.nPos);\n fclose(file);\n }\n }\n else\n return state.Error();\n }\n\n return true;\n}\n\n\nbool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bool fCheckMerkleRoot)\n{\n // These are checks that are independent of context\n // that can be verified before saving an orphan block.\n\n // Size limits\n if (block.vtx.empty() || block.vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE)\n return state.DoS(100, error(\"CheckBlock() : size limits failed\"));\n\n // Check proof of work matches claimed amount\n if (fCheckPOW && !CheckProofOfWork(block.GetHash(), block.nBits))\n return state.DoS(50, error(\"CheckBlock() : proof of work failed\"));\n\n // Check timestamp\n if (block.GetBlockTime() > GetAdjustedTime() + 2 * 60 * 60)\n return state.Invalid(error(\"CheckBlock() : block timestamp too far in the future\"));\n\n // First transaction must be coinbase, the rest must not be\n if (block.vtx.empty() || !block.vtx[0].IsCoinBase())\n return state.DoS(100, error(\"CheckBlock() : first tx is not coinbase\"));\n for (unsigned int i = 1; i < block.vtx.size(); i++)\n if (block.vtx[i].IsCoinBase())\n return state.DoS(100, error(\"CheckBlock() : more than one coinbase\"));\n\n // Check transactions\n BOOST_FOREACH(const CTransaction& tx, block.vtx)\n if (!CheckTransaction(tx, state))\n return error(\"CheckBlock() : CheckTransaction failed\");\n\n // Build the merkle tree already. We need it anyway later, and it makes the\n // block cache the transaction hashes, which means they don't need to be\n // recalculated many times during this block's validation.\n block.BuildMerkleTree();\n\n // Check for duplicate txids. This is caught by ConnectInputs(),\n // but catching it earlier avoids a potential DoS attack:\n set<uint256> uniqueTx;\n for (unsigned int i = 0; i < block.vtx.size(); i++) {\n uniqueTx.insert(block.GetTxHash(i));\n }\n if (uniqueTx.size() != block.vtx.size())\n return state.DoS(100, error(\"CheckBlock() : duplicate transaction\"));\n\n unsigned int nSigOps = 0;\n BOOST_FOREACH(const CTransaction& tx, block.vtx)\n {\n nSigOps += GetLegacySigOpCount(tx);\n }\n if (nSigOps > MAX_BLOCK_SIGOPS)\n return state.DoS(100, error(\"CheckBlock() : out-of-bounds SigOpCount\"));\n\n // Check merkle root\n if (fCheckMerkleRoot && block.hashMerkleRoot != block.BuildMerkleTree())\n return state.DoS(100, error(\"CheckBlock() : hashMerkleRoot mismatch\"));\n\n return true;\n}\n\nbool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp)\n{\n // Check for duplicate\n uint256 hash = block.GetHash();\n if (mapBlockIndex.count(hash))\n return state.Invalid(error(\"AcceptBlock() : block already in mapBlockIndex\"));\n\n // Get prev block index\n CBlockIndex* pindexPrev = NULL;\n int nHeight = 0;\n if (hash != Params().HashGenesisBlock()) {\n map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(block.hashPrevBlock);\n if (mi == mapBlockIndex.end())\n return state.DoS(10, error(\"AcceptBlock() : prev block not found\"));\n pindexPrev = (*mi).second;\n nHeight = pindexPrev->nHeight+1;\n\n // Check proof of work\n if (block.nBits != GetNextWorkRequired(pindexPrev, &block))\n return state.DoS(100, error(\"AcceptBlock() : incorrect proof of work\"));\n\n // Check timestamp against prev\n if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast())\n return state.Invalid(error(\"AcceptBlock() : block's timestamp is too early\"));\n\n // Check that all transactions are finalized\n BOOST_FOREACH(const CTransaction& tx, block.vtx)\n if (!IsFinalTx(tx, nHeight, block.GetBlockTime()))\n return state.DoS(10, error(\"AcceptBlock() : contains a non-final transaction\"));\n\n // Check that the block chain matches the known block chain up to a checkpoint\n if (!Checkpoints::CheckBlock(nHeight, hash))\n return state.DoS(100, error(\"AcceptBlock() : rejected by checkpoint lock-in at %d\", nHeight));\n\n // Reject block.nVersion=1 blocks when 95% (75% on testnet) of the network has upgraded:\n if (block.nVersion < 2)\n {\n if ((!TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 950, 1000)) ||\n (TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 75, 100)))\n {\n return state.Invalid(error(\"AcceptBlock() : rejected nVersion=1 block\"));\n }\n }\n // Enforce block.nVersion=2 rule that the coinbase starts with serialized block height\n if (block.nVersion >= 2)\n {\n // if 750 of the last 1,000 blocks are version 2 or greater (51/100 if testnet):\n if ((!TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 750, 1000)) ||\n (TestNet() && CBlockIndex::IsSuperMajority(2, pindexPrev, 51, 100)))\n {\n CScript expect = CScript() << nHeight;\n if (!std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin()))\n return state.DoS(100, error(\"AcceptBlock() : block height mismatch in coinbase\"));\n }\n }\n }\n\n // Write block to history file\n try {\n unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);\n CDiskBlockPos blockPos;\n if (dbp != NULL)\n blockPos = *dbp;\n if (!FindBlockPos(state, blockPos, nBlockSize+8, nHeight, block.nTime, dbp != NULL))\n return error(\"AcceptBlock() : FindBlockPos failed\");\n if (dbp == NULL)\n if (!WriteBlockToDisk(block, blockPos))\n return state.Abort(_(\"Failed to write block\"));\n if (!AddToBlockIndex(block, state, blockPos))\n return error(\"AcceptBlock() : AddToBlockIndex failed\");\n } catch(std::runtime_error &e) {\n return state.Abort(_(\"System error: \") + e.what());\n }\n\n // Relay inventory, but don't relay old inventory during initial block download\n int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate();\n if (hashBestChain == hash)\n {\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate))\n pnode->PushInventory(CInv(MSG_BLOCK, hash));\n }\n\n return true;\n}\n\nbool CBlockIndex::IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned int nRequired, unsigned int nToCheck)\n{\n unsigned int nFound = 0;\n for (unsigned int i = 0; i < nToCheck && nFound < nRequired && pstart != NULL; i++)\n {\n if (pstart->nVersion >= minVersion)\n ++nFound;\n pstart = pstart->pprev;\n }\n return (nFound >= nRequired);\n}\n\nvoid PushGetBlocks(CNode* pnode, CBlockIndex* pindexBegin, uint256 hashEnd)\n{\n // Filter out duplicate requests\n if (pindexBegin == pnode->pindexLastGetBlocksBegin && hashEnd == pnode->hashLastGetBlocksEnd)\n return;\n pnode->pindexLastGetBlocksBegin = pindexBegin;\n pnode->hashLastGetBlocksEnd = hashEnd;\n\n pnode->PushMessage(\"getblocks\", CBlockLocator(pindexBegin), hashEnd);\n}\n\nbool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp)\n{\n // Check for duplicate\n uint256 hash = pblock->GetHash();\n if (mapBlockIndex.count(hash))\n return state.Invalid(error(\"ProcessBlock() : already have block %d %s\", mapBlockIndex[hash]->nHeight, hash.ToString().c_str()));\n if (mapOrphanBlocks.count(hash))\n return state.Invalid(error(\"ProcessBlock() : already have block (orphan) %s\", hash.ToString().c_str()));\n\n // Preliminary checks\n if (!CheckBlock(*pblock, state))\n return error(\"ProcessBlock() : CheckBlock FAILED\");\n\n CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(mapBlockIndex);\n if (pcheckpoint && pblock->hashPrevBlock != hashBestChain)\n {\n // Extra checks to prevent \"fill up memory by spamming with bogus blocks\"\n int64 deltaTime = pblock->GetBlockTime() - pcheckpoint->nTime;\n if (deltaTime < 0)\n {\n return state.DoS(100, error(\"ProcessBlock() : block with timestamp before last checkpoint\"));\n }\n CBigNum bnNewBlock;\n bnNewBlock.SetCompact(pblock->nBits);\n CBigNum bnRequired;\n bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime));\n if (bnNewBlock > bnRequired)\n {\n return state.DoS(100, error(\"ProcessBlock() : block with too little proof-of-work\"));\n }\n }\n\n\n // If we don't already have its previous block, shunt it off to holding area until we get it\n if (pblock->hashPrevBlock != 0 && !mapBlockIndex.count(pblock->hashPrevBlock))\n {\n printf(\"ProcessBlock: ORPHAN BLOCK, prev=%s\\n\", pblock->hashPrevBlock.ToString().c_str());\n\n // Accept orphans as long as there is a node to request its parents from\n if (pfrom) {\n CBlock* pblock2 = new CBlock(*pblock);\n mapOrphanBlocks.insert(make_pair(hash, pblock2));\n mapOrphanBlocksByPrev.insert(make_pair(pblock2->hashPrevBlock, pblock2));\n\n // Ask this guy to fill in what we're missing\n PushGetBlocks(pfrom, pindexBest, GetOrphanRoot(pblock2));\n }\n return true;\n }\n\n // Store to disk\n if (!AcceptBlock(*pblock, state, dbp))\n return error(\"ProcessBlock() : AcceptBlock FAILED\");\n\n // Recursively process any orphan blocks that depended on this one\n vector<uint256> vWorkQueue;\n vWorkQueue.push_back(hash);\n for (unsigned int i = 0; i < vWorkQueue.size(); i++)\n {\n uint256 hashPrev = vWorkQueue[i];\n for (multimap<uint256, CBlock*>::iterator mi = mapOrphanBlocksByPrev.lower_bound(hashPrev);\n mi != mapOrphanBlocksByPrev.upper_bound(hashPrev);\n ++mi)\n {\n CBlock* pblockOrphan = (*mi).second;\n // Use a dummy CValidationState so someone can't setup nodes to counter-DoS based on orphan resolution (that is, feeding people an invalid block based on LegitBlockX in order to get anyone relaying LegitBlockX banned)\n CValidationState stateDummy;\n if (AcceptBlock(*pblockOrphan, stateDummy))\n vWorkQueue.push_back(pblockOrphan->GetHash());\n mapOrphanBlocks.erase(pblockOrphan->GetHash());\n delete pblockOrphan;\n }\n mapOrphanBlocksByPrev.erase(hashPrev);\n }\n\n printf(\"ProcessBlock: ACCEPTED\\n\");\n return true;\n}\n\n\n\n\n\n\n\n\nCMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter)\n{\n header = block.GetBlockHeader();\n\n vector<bool> vMatch;\n vector<uint256> vHashes;\n\n vMatch.reserve(block.vtx.size());\n vHashes.reserve(block.vtx.size());\n\n for (unsigned int i = 0; i < block.vtx.size(); i++)\n {\n uint256 hash = block.vtx[i].GetHash();\n if (filter.IsRelevantAndUpdate(block.vtx[i], hash))\n {\n vMatch.push_back(true);\n vMatchedTxn.push_back(make_pair(i, hash));\n }\n else\n vMatch.push_back(false);\n vHashes.push_back(hash);\n }\n\n txn = CPartialMerkleTree(vHashes, vMatch);\n}\n\n\n\n\n\n\n\n\nuint256 CPartialMerkleTree::CalcHash(int height, unsigned int pos, const std::vector<uint256> &vTxid) {\n if (height == 0) {\n // hash at height 0 is the txids themself\n return vTxid[pos];\n } else {\n // calculate left hash\n uint256 left = CalcHash(height-1, pos*2, vTxid), right;\n // calculate right hash if not beyong the end of the array - copy left hash otherwise1\n if (pos*2+1 < CalcTreeWidth(height-1))\n right = CalcHash(height-1, pos*2+1, vTxid);\n else\n right = left;\n // combine subhashes\n return Hash(BEGIN(left), END(left), BEGIN(right), END(right));\n }\n}\n\nvoid CPartialMerkleTree::TraverseAndBuild(int height, unsigned int pos, const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch) {\n // determine whether this node is the parent of at least one matched txid\n bool fParentOfMatch = false;\n for (unsigned int p = pos << height; p < (pos+1) << height && p < nTransactions; p++)\n fParentOfMatch |= vMatch[p];\n // store as flag bit\n vBits.push_back(fParentOfMatch);\n if (height==0 || !fParentOfMatch) {\n // if at height 0, or nothing interesting below, store hash and stop\n vHash.push_back(CalcHash(height, pos, vTxid));\n } else {\n // otherwise, don't store any hash, but descend into the subtrees\n TraverseAndBuild(height-1, pos*2, vTxid, vMatch);\n if (pos*2+1 < CalcTreeWidth(height-1))\n TraverseAndBuild(height-1, pos*2+1, vTxid, vMatch);\n }\n}\n\nuint256 CPartialMerkleTree::TraverseAndExtract(int height, unsigned int pos, unsigned int &nBitsUsed, unsigned int &nHashUsed, std::vector<uint256> &vMatch) {\n if (nBitsUsed >= vBits.size()) {\n // overflowed the bits array - failure\n fBad = true;\n return 0;\n }\n bool fParentOfMatch = vBits[nBitsUsed++];\n if (height==0 || !fParentOfMatch) {\n // if at height 0, or nothing interesting below, use stored hash and do not descend\n if (nHashUsed >= vHash.size()) {\n // overflowed the hash array - failure\n fBad = true;\n return 0;\n }\n const uint256 &hash = vHash[nHashUsed++];\n if (height==0 && fParentOfMatch) // in case of height 0, we have a matched txid\n vMatch.push_back(hash);\n return hash;\n } else {\n // otherwise, descend into the subtrees to extract matched txids and hashes\n uint256 left = TraverseAndExtract(height-1, pos*2, nBitsUsed, nHashUsed, vMatch), right;\n if (pos*2+1 < CalcTreeWidth(height-1))\n right = TraverseAndExtract(height-1, pos*2+1, nBitsUsed, nHashUsed, vMatch);\n else\n right = left;\n // and combine them before returning\n return Hash(BEGIN(left), END(left), BEGIN(right), END(right));\n }\n}\n\nCPartialMerkleTree::CPartialMerkleTree(const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch) : nTransactions(vTxid.size()), fBad(false) {\n // reset state\n vBits.clear();\n vHash.clear();\n\n // calculate height of tree\n int nHeight = 0;\n while (CalcTreeWidth(nHeight) > 1)\n nHeight++;\n\n // traverse the partial tree\n TraverseAndBuild(nHeight, 0, vTxid, vMatch);\n}\n\nCPartialMerkleTree::CPartialMerkleTree() : nTransactions(0), fBad(true) {}\n\nuint256 CPartialMerkleTree::ExtractMatches(std::vector<uint256> &vMatch) {\n vMatch.clear();\n // An empty set will not work\n if (nTransactions == 0)\n return 0;\n // check for excessively high numbers of transactions\n if (nTransactions > MAX_BLOCK_SIZE / 60) // 60 is the lower bound for the size of a serialized CTransaction\n return 0;\n // there can never be more hashes provided than one for every txid\n if (vHash.size() > nTransactions)\n return 0;\n // there must be at least one bit per node in the partial tree, and at least one node per hash\n if (vBits.size() < vHash.size())\n return 0;\n // calculate height of tree\n int nHeight = 0;\n while (CalcTreeWidth(nHeight) > 1)\n nHeight++;\n // traverse the partial tree\n unsigned int nBitsUsed = 0, nHashUsed = 0;\n uint256 hashMerkleRoot = TraverseAndExtract(nHeight, 0, nBitsUsed, nHashUsed, vMatch);\n // verify that no problems occured during the tree traversal\n if (fBad)\n return 0;\n // verify that all bits were consumed (except for the padding caused by serializing it as a byte sequence)\n if ((nBitsUsed+7)/8 != (vBits.size()+7)/8)\n return 0;\n // verify that all hashes were consumed\n if (nHashUsed != vHash.size())\n return 0;\n return hashMerkleRoot;\n}\n\n\n\n\n\n\n\nbool AbortNode(const std::string &strMessage) {\n strMiscWarning = strMessage;\n printf(\"*** %s\\n\", strMessage.c_str());\n uiInterface.ThreadSafeMessageBox(strMessage, \"\", CClientUIInterface::MSG_ERROR);\n StartShutdown();\n return false;\n}\n\nbool CheckDiskSpace(uint64 nAdditionalBytes)\n{\n uint64 nFreeBytesAvailable = filesystem::space(GetDataDir()).available;\n\n // Check for nMinDiskSpace bytes (currently 50MB)\n if (nFreeBytesAvailable < nMinDiskSpace + nAdditionalBytes)\n return AbortNode(_(\"Error: Disk space is low!\"));\n\n return true;\n}\n\nCCriticalSection cs_LastBlockFile;\nCBlockFileInfo infoLastBlockFile;\nint nLastBlockFile = 0;\n\nFILE* OpenDiskFile(const CDiskBlockPos &pos, const char *prefix, bool fReadOnly)\n{\n if (pos.IsNull())\n return NULL;\n boost::filesystem::path path = GetDataDir() / \"blocks\" / strprintf(\"%s%05u.dat\", prefix, pos.nFile);\n boost::filesystem::create_directories(path.parent_path());\n FILE* file = fopen(path.string().c_str(), \"rb+\");\n if (!file && !fReadOnly)\n file = fopen(path.string().c_str(), \"wb+\");\n if (!file) {\n printf(\"Unable to open file %s\\n\", path.string().c_str());\n return NULL;\n }\n if (pos.nPos) {\n if (fseek(file, pos.nPos, SEEK_SET)) {\n printf(\"Unable to seek to position %u of %s\\n\", pos.nPos, path.string().c_str());\n fclose(file);\n return NULL;\n }\n }\n return file;\n}\n\nFILE* OpenBlockFile(const CDiskBlockPos &pos, bool fReadOnly) {\n return OpenDiskFile(pos, \"blk\", fReadOnly);\n}\n\nFILE* OpenUndoFile(const CDiskBlockPos &pos, bool fReadOnly) {\n return OpenDiskFile(pos, \"rev\", fReadOnly);\n}\n\nCBlockIndex * InsertBlockIndex(uint256 hash)\n{\n if (hash == 0)\n return NULL;\n\n // Return existing\n map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hash);\n if (mi != mapBlockIndex.end())\n return (*mi).second;\n\n // Create new\n CBlockIndex* pindexNew = new CBlockIndex();\n if (!pindexNew)\n throw runtime_error(\"LoadBlockIndex() : new CBlockIndex failed\");\n mi = mapBlockIndex.insert(make_pair(hash, pindexNew)).first;\n pindexNew->phashBlock = &((*mi).first);\n\n return pindexNew;\n}\n\nbool static LoadBlockIndexDB()\n{\n if (!pblocktree->LoadBlockIndexGuts())\n return false;\n\n boost::this_thread::interruption_point();\n\n // Calculate nChainWork\n vector<pair<int, CBlockIndex*> > vSortedByHeight;\n vSortedByHeight.reserve(mapBlockIndex.size());\n BOOST_FOREACH(const PAIRTYPE(uint256, CBlockIndex*)& item, mapBlockIndex)\n {\n CBlockIndex* pindex = item.second;\n vSortedByHeight.push_back(make_pair(pindex->nHeight, pindex));\n }\n sort(vSortedByHeight.begin(), vSortedByHeight.end());\n BOOST_FOREACH(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight)\n {\n CBlockIndex* pindex = item.second;\n pindex->nChainWork = (pindex->pprev ? pindex->pprev->nChainWork : 0) + pindex->GetBlockWork().getuint256();\n pindex->nChainTx = (pindex->pprev ? pindex->pprev->nChainTx : 0) + pindex->nTx;\n if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TRANSACTIONS && !(pindex->nStatus & BLOCK_FAILED_MASK))\n setBlockIndexValid.insert(pindex);\n }\n\n // Load block file info\n pblocktree->ReadLastBlockFile(nLastBlockFile);\n printf(\"LoadBlockIndexDB(): last block file = %i\\n\", nLastBlockFile);\n if (pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile))\n printf(\"LoadBlockIndexDB(): last block file info: %s\\n\", infoLastBlockFile.ToString().c_str());\n\n // Load nBestInvalidWork, OK if it doesn't exist\n CBigNum bnBestInvalidWork;\n pblocktree->ReadBestInvalidWork(bnBestInvalidWork);\n nBestInvalidWork = bnBestInvalidWork.getuint256();\n\n // Check whether we need to continue reindexing\n bool fReindexing = false;\n pblocktree->ReadReindexing(fReindexing);\n fReindex |= fReindexing;\n\n // Check whether we have a transaction index\n pblocktree->ReadFlag(\"txindex\", fTxIndex);\n printf(\"LoadBlockIndexDB(): transaction index %s\\n\", fTxIndex ? \"enabled\" : \"disabled\");\n\n // Load hashBestChain pointer to end of best chain\n pindexBest = pcoinsTip->GetBestBlock();\n if (pindexBest == NULL)\n return true;\n hashBestChain = pindexBest->GetBlockHash();\n nBestHeight = pindexBest->nHeight;\n nBestChainWork = pindexBest->nChainWork;\n\n // register best chain\n CBlockIndex *pindex = pindexBest;\n vBlockIndexByHeight.resize(pindexBest->nHeight + 1);\n while(pindex != NULL) {\n vBlockIndexByHeight[pindex->nHeight] = pindex;\n pindex = pindex->pprev;\n }\n printf(\"LoadBlockIndexDB(): hashBestChain=%s height=%d date=%s\\n\",\n hashBestChain.ToString().c_str(), nBestHeight,\n DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", pindexBest->GetBlockTime()).c_str());\n\n return true;\n}\n\nbool VerifyDB(int nCheckLevel, int nCheckDepth)\n{\n if (pindexBest == NULL || pindexBest->pprev == NULL)\n return true;\n\n // Verify blocks in the best chain\n if (nCheckDepth <= 0)\n nCheckDepth = 1000000000; // suffices until the year 19000\n if (nCheckDepth > nBestHeight)\n nCheckDepth = nBestHeight;\n nCheckLevel = std::max(0, std::min(4, nCheckLevel));\n printf(\"Verifying last %i blocks at level %i\\n\", nCheckDepth, nCheckLevel);\n CCoinsViewCache coins(*pcoinsTip, true);\n CBlockIndex* pindexState = pindexBest;\n CBlockIndex* pindexFailure = NULL;\n int nGoodTransactions = 0;\n CValidationState state;\n for (CBlockIndex* pindex = pindexBest; pindex && pindex->pprev; pindex = pindex->pprev)\n {\n boost::this_thread::interruption_point();\n if (pindex->nHeight < nBestHeight-nCheckDepth)\n break;\n CBlock block;\n // check level 0: read from disk\n if (!ReadBlockFromDisk(block, pindex))\n return error(\"VerifyDB() : *** ReadBlockFromDisk failed at %d, hash=%s\", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());\n // check level 1: verify block validity\n if (nCheckLevel >= 1 && !CheckBlock(block, state))\n return error(\"VerifyDB() : *** found bad block at %d, hash=%s\\n\", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());\n // check level 2: verify undo validity\n if (nCheckLevel >= 2 && pindex) {\n CBlockUndo undo;\n CDiskBlockPos pos = pindex->GetUndoPos();\n if (!pos.IsNull()) {\n if (!undo.ReadFromDisk(pos, pindex->pprev->GetBlockHash()))\n return error(\"VerifyDB() : *** found bad undo data at %d, hash=%s\\n\", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());\n }\n }\n // check level 3: check for inconsistencies during memory-only disconnect of tip blocks\n if (nCheckLevel >= 3 && pindex == pindexState && (coins.GetCacheSize() + pcoinsTip->GetCacheSize()) <= 2*nCoinCacheSize + 32000) {\n bool fClean = true;\n if (!DisconnectBlock(block, state, pindex, coins, &fClean))\n return error(\"VerifyDB() : *** irrecoverable inconsistency in block data at %d, hash=%s\", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());\n pindexState = pindex->pprev;\n if (!fClean) {\n nGoodTransactions = 0;\n pindexFailure = pindex;\n } else\n nGoodTransactions += block.vtx.size();\n }\n }\n if (pindexFailure)\n return error(\"VerifyDB() : *** coin database inconsistencies found (last %i blocks, %i good transactions before that)\\n\", pindexBest->nHeight - pindexFailure->nHeight + 1, nGoodTransactions);\n\n // check level 4: try reconnecting blocks\n if (nCheckLevel >= 4) {\n CBlockIndex *pindex = pindexState;\n while (pindex != pindexBest) {\n boost::this_thread::interruption_point();\n pindex = pindex->GetNextInMainChain();\n CBlock block;\n if (!ReadBlockFromDisk(block, pindex))\n return error(\"VerifyDB() : *** ReadBlockFromDisk failed at %d, hash=%s\", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());\n if (!ConnectBlock(block, state, pindex, coins))\n return error(\"VerifyDB() : *** found unconnectable block at %d, hash=%s\", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());\n }\n }\n\n printf(\"No coin database inconsistencies in last %i blocks (%i transactions)\\n\", pindexBest->nHeight - pindexState->nHeight, nGoodTransactions);\n\n return true;\n}\n\nvoid UnloadBlockIndex()\n{\n mapBlockIndex.clear();\n setBlockIndexValid.clear();\n pindexGenesisBlock = NULL;\n nBestHeight = 0;\n nBestChainWork = 0;\n nBestInvalidWork = 0;\n hashBestChain = 0;\n pindexBest = NULL;\n}\n\nbool LoadBlockIndex()\n{\n // Load block index from databases\n if (!fReindex && !LoadBlockIndexDB())\n return false;\n return true;\n}\n\n\nbool InitBlockIndex() {\n // Check whether we're already initialized\n if (pindexGenesisBlock != NULL)\n return true;\n\n // Use the provided setting for -txindex in the new database\n fTxIndex = GetBoolArg(\"-txindex\", false);\n pblocktree->WriteFlag(\"txindex\", fTxIndex);\n printf(\"Initializing databases...\\n\");\n\n // Only add the genesis block if not reindexing (in which case we reuse the one already on disk)\n if (!fReindex) {\n try {\n CBlock &block = const_cast<CBlock&>(Params().GenesisBlock());\n // Start new block file\n unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);\n CDiskBlockPos blockPos;\n CValidationState state;\n if (!FindBlockPos(state, blockPos, nBlockSize+8, 0, block.nTime))\n return error(\"LoadBlockIndex() : FindBlockPos failed\");\n if (!WriteBlockToDisk(block, blockPos))\n return error(\"LoadBlockIndex() : writing genesis block to disk failed\");\n if (!AddToBlockIndex(block, state, blockPos))\n return error(\"LoadBlockIndex() : genesis block not accepted\");\n } catch(std::runtime_error &e) {\n return error(\"LoadBlockIndex() : failed to initialize block database: %s\", e.what());\n }\n }\n\n return true;\n}\n\n\n\nvoid PrintBlockTree()\n{\n // pre-compute tree structure\n map<CBlockIndex*, vector<CBlockIndex*> > mapNext;\n for (map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)\n {\n CBlockIndex* pindex = (*mi).second;\n mapNext[pindex->pprev].push_back(pindex);\n // test\n //while (rand() % 3 == 0)\n // mapNext[pindex->pprev].push_back(pindex);\n }\n\n vector<pair<int, CBlockIndex*> > vStack;\n vStack.push_back(make_pair(0, pindexGenesisBlock));\n\n int nPrevCol = 0;\n while (!vStack.empty())\n {\n int nCol = vStack.back().first;\n CBlockIndex* pindex = vStack.back().second;\n vStack.pop_back();\n\n // print split or gap\n if (nCol > nPrevCol)\n {\n for (int i = 0; i < nCol-1; i++)\n printf(\"| \");\n printf(\"|\\\\\\n\");\n }\n else if (nCol < nPrevCol)\n {\n for (int i = 0; i < nCol; i++)\n printf(\"| \");\n printf(\"|\\n\");\n }\n nPrevCol = nCol;\n\n // print columns\n for (int i = 0; i < nCol; i++)\n printf(\"| \");\n\n // print item\n CBlock block;\n ReadBlockFromDisk(block, pindex);\n printf(\"%d (blk%05u.dat:0x%x) %s tx %\"PRIszu\"\",\n pindex->nHeight,\n pindex->GetBlockPos().nFile, pindex->GetBlockPos().nPos,\n DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", block.GetBlockTime()).c_str(),\n block.vtx.size());\n\n PrintWallets(block);\n\n // put the main time-chain first\n vector<CBlockIndex*>& vNext = mapNext[pindex];\n for (unsigned int i = 0; i < vNext.size(); i++)\n {\n if (vNext[i]->GetNextInMainChain())\n {\n swap(vNext[0], vNext[i]);\n break;\n }\n }\n\n // iterate children\n for (unsigned int i = 0; i < vNext.size(); i++)\n vStack.push_back(make_pair(nCol+i, vNext[i]));\n }\n}\n\nbool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)\n{\n int64 nStart = GetTimeMillis();\n\n int nLoaded = 0;\n try {\n CBufferedFile blkdat(fileIn, 2*MAX_BLOCK_SIZE, MAX_BLOCK_SIZE+8, SER_DISK, CLIENT_VERSION);\n uint64 nStartByte = 0;\n if (dbp) {\n // (try to) skip already indexed part\n CBlockFileInfo info;\n if (pblocktree->ReadBlockFileInfo(dbp->nFile, info)) {\n nStartByte = info.nSize;\n blkdat.Seek(info.nSize);\n }\n }\n uint64 nRewind = blkdat.GetPos();\n while (blkdat.good() && !blkdat.eof()) {\n boost::this_thread::interruption_point();\n\n blkdat.SetPos(nRewind);\n nRewind++; // start one byte further next time, in case of failure\n blkdat.SetLimit(); // remove former limit\n unsigned int nSize = 0;\n try {\n // locate a header\n unsigned char buf[4];\n blkdat.FindByte(Params().MessageStart()[0]);\n nRewind = blkdat.GetPos()+1;\n blkdat >> FLATDATA(buf);\n if (memcmp(buf, Params().MessageStart(), 4))\n continue;\n // read size\n blkdat >> nSize;\n if (nSize < 80 || nSize > MAX_BLOCK_SIZE)\n continue;\n } catch (std::exception &e) {\n // no valid block header found; don't complain\n break;\n }\n try {\n // read block\n uint64 nBlockPos = blkdat.GetPos();\n blkdat.SetLimit(nBlockPos + nSize);\n CBlock block;\n blkdat >> block;\n nRewind = blkdat.GetPos();\n\n // process block\n if (nBlockPos >= nStartByte) {\n LOCK(cs_main);\n if (dbp)\n dbp->nPos = nBlockPos;\n CValidationState state;\n if (ProcessBlock(state, NULL, &block, dbp))\n nLoaded++;\n if (state.IsError())\n break;\n }\n } catch (std::exception &e) {\n printf(\"%s() : Deserialize or I/O error caught during load\\n\", __PRETTY_FUNCTION__);\n }\n }\n fclose(fileIn);\n } catch(std::runtime_error &e) {\n AbortNode(_(\"Error: system error: \") + e.what());\n }\n if (nLoaded > 0)\n printf(\"Loaded %i blocks from external file in %\"PRI64d\"ms\\n\", nLoaded, GetTimeMillis() - nStart);\n return nLoaded > 0;\n}\n\n\n\n\n\n\n\n\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// CAlert\n//\n\nextern map<uint256, CAlert> mapAlerts;\nextern CCriticalSection cs_mapAlerts;\n\nstring GetWarnings(string strFor)\n{\n int nPriority = 0;\n string strStatusBar;\n string strRPC;\n\n if (GetBoolArg(\"-testsafemode\", false))\n strRPC = \"test\";\n\n if (!CLIENT_VERSION_IS_RELEASE)\n strStatusBar = _(\"This is a pre-release test build - use at your own risk - do not use for mining or merchant applications\");\n\n // Misc warnings like out of disk space and clock is wrong\n if (strMiscWarning != \"\")\n {\n nPriority = 1000;\n strStatusBar = strMiscWarning;\n }\n\n // Longer invalid proof-of-work chain\n if (pindexBest && nBestInvalidWork > nBestChainWork + (pindexBest->GetBlockWork() * 6).getuint256())\n {\n nPriority = 2000;\n strStatusBar = strRPC = _(\"Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.\");\n }\n\n // Alerts\n {\n LOCK(cs_mapAlerts);\n BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)\n {\n const CAlert& alert = item.second;\n if (alert.AppliesToMe() && alert.nPriority > nPriority)\n {\n nPriority = alert.nPriority;\n strStatusBar = alert.strStatusBar;\n }\n }\n }\n\n if (strFor == \"statusbar\")\n return strStatusBar;\n else if (strFor == \"rpc\")\n return strRPC;\n assert(!\"GetWarnings() : invalid parameter\");\n return \"error\";\n}\n\n\n\n\n\n\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// Messages\n//\n\n\nbool static AlreadyHave(const CInv& inv)\n{\n switch (inv.type)\n {\n case MSG_TX:\n {\n bool txInMap = false;\n {\n LOCK(mempool.cs);\n txInMap = mempool.exists(inv.hash);\n }\n return txInMap || mapOrphanTransactions.count(inv.hash) ||\n pcoinsTip->HaveCoins(inv.hash);\n }\n case MSG_BLOCK:\n return mapBlockIndex.count(inv.hash) ||\n mapOrphanBlocks.count(inv.hash);\n }\n // Don't know what it is, just say we already got one\n return true;\n}\n\n\n\n\nvoid static ProcessGetData(CNode* pfrom)\n{\n std::deque<CInv>::iterator it = pfrom->vRecvGetData.begin();\n\n vector<CInv> vNotFound;\n\n while (it != pfrom->vRecvGetData.end()) {\n // Don't bother if send buffer is too full to respond anyway\n if (pfrom->nSendSize >= SendBufferSize())\n break;\n\n const CInv &inv = *it;\n {\n boost::this_thread::interruption_point();\n it++;\n\n if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK)\n {\n // Send block from disk\n map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(inv.hash);\n if (mi != mapBlockIndex.end())\n {\n CBlock block;\n ReadBlockFromDisk(block, (*mi).second);\n if (inv.type == MSG_BLOCK)\n pfrom->PushMessage(\"block\", block);\n else // MSG_FILTERED_BLOCK)\n {\n LOCK(pfrom->cs_filter);\n if (pfrom->pfilter)\n {\n CMerkleBlock merkleBlock(block, *pfrom->pfilter);\n pfrom->PushMessage(\"merkleblock\", merkleBlock);\n // CMerkleBlock just contains hashes, so also push any transactions in the block the client did not see\n // This avoids hurting performance by pointlessly requiring a round-trip\n // Note that there is currently no way for a node to request any single transactions we didnt send here -\n // they must either disconnect and retry or request the full block.\n // Thus, the protocol spec specified allows for us to provide duplicate txn here,\n // however we MUST always provide at least what the remote peer needs\n typedef std::pair<unsigned int, uint256> PairType;\n BOOST_FOREACH(PairType& pair, merkleBlock.vMatchedTxn)\n if (!pfrom->setInventoryKnown.count(CInv(MSG_TX, pair.second)))\n pfrom->PushMessage(\"tx\", block.vtx[pair.first]);\n }\n // else\n // no response\n }\n\n // Trigger them to send a getblocks request for the next batch of inventory\n if (inv.hash == pfrom->hashContinue)\n {\n // Bypass PushInventory, this must send even if redundant,\n // and we want it right after the last block so they don't\n // wait for other stuff first.\n vector<CInv> vInv;\n vInv.push_back(CInv(MSG_BLOCK, hashBestChain));\n pfrom->PushMessage(\"inv\", vInv);\n pfrom->hashContinue = 0;\n }\n }\n }\n else if (inv.IsKnownType())\n {\n // Send stream from relay memory\n bool pushed = false;\n {\n LOCK(cs_mapRelay);\n map<CInv, CDataStream>::iterator mi = mapRelay.find(inv);\n if (mi != mapRelay.end()) {\n pfrom->PushMessage(inv.GetCommand(), (*mi).second);\n pushed = true;\n }\n }\n if (!pushed && inv.type == MSG_TX) {\n LOCK(mempool.cs);\n if (mempool.exists(inv.hash)) {\n CTransaction tx = mempool.lookup(inv.hash);\n CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);\n ss.reserve(1000);\n ss << tx;\n pfrom->PushMessage(\"tx\", ss);\n pushed = true;\n }\n }\n if (!pushed) {\n vNotFound.push_back(inv);\n }\n }\n\n // Track requests for our stuff.\n Inventory(inv.hash);\n }\n }\n\n pfrom->vRecvGetData.erase(pfrom->vRecvGetData.begin(), it);\n\n if (!vNotFound.empty()) {\n // Let the peer know that we didn't find what it asked for, so it doesn't\n // have to wait around forever. Currently only SPV clients actually care\n // about this message: it's needed when they are recursively walking the\n // dependencies of relevant unconfirmed transactions. SPV clients want to\n // do that because they want to know about (and store and rebroadcast and\n // risk analyze) the dependencies of transactions relevant to them, without\n // having to download the entire memory pool.\n pfrom->PushMessage(\"notfound\", vNotFound);\n }\n}\n\nbool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)\n{\n RandAddSeedPerfmon();\n if (fDebug)\n printf(\"received: %s (%\"PRIszu\" bytes)\\n\", strCommand.c_str(), vRecv.size());\n if (mapArgs.count(\"-dropmessagestest\") && GetRand(atoi(mapArgs[\"-dropmessagestest\"])) == 0)\n {\n printf(\"dropmessagestest DROPPING RECV MESSAGE\\n\");\n return true;\n }\n\n\n\n\n\n if (strCommand == \"version\")\n {\n // Each connection can only send one version message\n if (pfrom->nVersion != 0)\n {\n pfrom->Misbehaving(1);\n return false;\n }\n\n int64 nTime;\n CAddress addrMe;\n CAddress addrFrom;\n uint64 nNonce = 1;\n vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe;\n if (pfrom->nVersion < MIN_PROTO_VERSION)\n {\n // Since February 20, 2012, the protocol is initiated at version 209,\n // and earlier versions are no longer supported\n printf(\"partner %s using obsolete version %i; disconnecting\\n\", pfrom->addr.ToString().c_str(), pfrom->nVersion);\n pfrom->fDisconnect = true;\n return false;\n }\n\n if (pfrom->nVersion == 10300)\n pfrom->nVersion = 300;\n if (!vRecv.empty())\n vRecv >> addrFrom >> nNonce;\n if (!vRecv.empty())\n vRecv >> pfrom->strSubVer;\n if (!vRecv.empty())\n vRecv >> pfrom->nStartingHeight;\n if (!vRecv.empty())\n vRecv >> pfrom->fRelayTxes; // set to true after we get the first filter* message\n else\n pfrom->fRelayTxes = true;\n\n if (pfrom->fInbound && addrMe.IsRoutable())\n {\n pfrom->addrLocal = addrMe;\n SeenLocal(addrMe);\n }\n\n // Disconnect if we connected to ourself\n if (nNonce == nLocalHostNonce && nNonce > 1)\n {\n printf(\"connected to self at %s, disconnecting\\n\", pfrom->addr.ToString().c_str());\n pfrom->fDisconnect = true;\n return true;\n }\n\n // Be shy and don't send version until we hear\n if (pfrom->fInbound)\n pfrom->PushVersion();\n\n pfrom->fClient = !(pfrom->nServices & NODE_NETWORK);\n\n AddTimeData(pfrom->addr, nTime);\n\n // Change version\n pfrom->PushMessage(\"verack\");\n pfrom->ssSend.SetVersion(min(pfrom->nVersion, PROTOCOL_VERSION));\n\n if (!pfrom->fInbound)\n {\n // Advertise our address\n if (!fNoListen && !IsInitialBlockDownload())\n {\n CAddress addr = GetLocalAddress(&pfrom->addr);\n if (addr.IsRoutable())\n pfrom->PushAddress(addr);\n }\n\n // Get recent addresses\n if (pfrom->fOneShot || pfrom->nVersion >= CADDR_TIME_VERSION || addrman.size() < 1000)\n {\n pfrom->PushMessage(\"getaddr\");\n pfrom->fGetAddr = true;\n }\n addrman.Good(pfrom->addr);\n } else {\n if (((CNetAddr)pfrom->addr) == (CNetAddr)addrFrom)\n {\n addrman.Add(addrFrom, addrFrom);\n addrman.Good(addrFrom);\n }\n }\n\n // Relay alerts\n {\n LOCK(cs_mapAlerts);\n BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts)\n item.second.RelayTo(pfrom);\n }\n\n pfrom->fSuccessfullyConnected = true;\n\n printf(\"receive version message: version %d, blocks=%d, us=%s, them=%s, peer=%s\\n\", pfrom->nVersion, pfrom->nStartingHeight, addrMe.ToString().c_str(), addrFrom.ToString().c_str(), pfrom->addr.ToString().c_str());\n\n cPeerBlockCounts.input(pfrom->nStartingHeight);\n }\n\n\n else if (pfrom->nVersion == 0)\n {\n // Must have a version message before anything else\n pfrom->Misbehaving(1);\n return false;\n }\n\n\n else if (strCommand == \"verack\")\n {\n pfrom->SetRecvVersion(min(pfrom->nVersion, PROTOCOL_VERSION));\n }\n\n\n else if (strCommand == \"addr\")\n {\n vector<CAddress> vAddr;\n vRecv >> vAddr;\n\n // Don't want addr from older versions unless seeding\n if (pfrom->nVersion < CADDR_TIME_VERSION && addrman.size() > 1000)\n return true;\n if (vAddr.size() > 1000)\n {\n pfrom->Misbehaving(20);\n return error(\"message addr size() = %\"PRIszu\"\", vAddr.size());\n }\n\n // Store the new addresses\n vector<CAddress> vAddrOk;\n int64 nNow = GetAdjustedTime();\n int64 nSince = nNow - 10 * 60;\n BOOST_FOREACH(CAddress& addr, vAddr)\n {\n boost::this_thread::interruption_point();\n\n if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)\n addr.nTime = nNow - 5 * 24 * 60 * 60;\n pfrom->AddAddressKnown(addr);\n bool fReachable = IsReachable(addr);\n if (addr.nTime > nSince && !pfrom->fGetAddr && vAddr.size() <= 10 && addr.IsRoutable())\n {\n // Relay to a limited number of other nodes\n {\n LOCK(cs_vNodes);\n // Use deterministic randomness to send to the same nodes for 24 hours\n // at a time so the setAddrKnowns of the chosen nodes prevent repeats\n static uint256 hashSalt;\n if (hashSalt == 0)\n hashSalt = GetRandHash();\n uint64 hashAddr = addr.GetHash();\n uint256 hashRand = hashSalt ^ (hashAddr<<32) ^ ((GetTime()+hashAddr)/(24*60*60));\n hashRand = Hash(BEGIN(hashRand), END(hashRand));\n multimap<uint256, CNode*> mapMix;\n BOOST_FOREACH(CNode* pnode, vNodes)\n {\n if (pnode->nVersion < CADDR_TIME_VERSION)\n continue;\n unsigned int nPointer;\n memcpy(&nPointer, &pnode, sizeof(nPointer));\n uint256 hashKey = hashRand ^ nPointer;\n hashKey = Hash(BEGIN(hashKey), END(hashKey));\n mapMix.insert(make_pair(hashKey, pnode));\n }\n int nRelayNodes = fReachable ? 2 : 1; // limited relaying of addresses outside our network(s)\n for (multimap<uint256, CNode*>::iterator mi = mapMix.begin(); mi != mapMix.end() && nRelayNodes-- > 0; ++mi)\n ((*mi).second)->PushAddress(addr);\n }\n }\n // Do not store addresses outside our network\n if (fReachable)\n vAddrOk.push_back(addr);\n }\n addrman.Add(vAddrOk, pfrom->addr, 2 * 60 * 60);\n if (vAddr.size() < 1000)\n pfrom->fGetAddr = false;\n if (pfrom->fOneShot)\n pfrom->fDisconnect = true;\n }\n\n\n else if (strCommand == \"inv\")\n {\n vector<CInv> vInv;\n vRecv >> vInv;\n if (vInv.size() > MAX_INV_SZ)\n {\n pfrom->Misbehaving(20);\n return error(\"message inv size() = %\"PRIszu\"\", vInv.size());\n }\n\n // find last block in inv vector\n unsigned int nLastBlock = (unsigned int)(-1);\n for (unsigned int nInv = 0; nInv < vInv.size(); nInv++) {\n if (vInv[vInv.size() - 1 - nInv].type == MSG_BLOCK) {\n nLastBlock = vInv.size() - 1 - nInv;\n break;\n }\n }\n for (unsigned int nInv = 0; nInv < vInv.size(); nInv++)\n {\n const CInv &inv = vInv[nInv];\n\n boost::this_thread::interruption_point();\n pfrom->AddInventoryKnown(inv);\n\n bool fAlreadyHave = AlreadyHave(inv);\n if (fDebug)\n printf(\" got inventory: %s %s\\n\", inv.ToString().c_str(), fAlreadyHave ? \"have\" : \"new\");\n\n if (!fAlreadyHave) {\n if (!fImporting && !fReindex)\n pfrom->AskFor(inv);\n } else if (inv.type == MSG_BLOCK && mapOrphanBlocks.count(inv.hash)) {\n PushGetBlocks(pfrom, pindexBest, GetOrphanRoot(mapOrphanBlocks[inv.hash]));\n } else if (nInv == nLastBlock) {\n // In case we are on a very long side-chain, it is possible that we already have\n // the last block in an inv bundle sent in response to getblocks. Try to detect\n // this situation and push another getblocks to continue.\n PushGetBlocks(pfrom, mapBlockIndex[inv.hash], uint256(0));\n if (fDebug)\n printf(\"force request: %s\\n\", inv.ToString().c_str());\n }\n\n // Track requests for our stuff\n Inventory(inv.hash);\n }\n }\n\n\n else if (strCommand == \"getdata\")\n {\n vector<CInv> vInv;\n vRecv >> vInv;\n if (vInv.size() > MAX_INV_SZ)\n {\n pfrom->Misbehaving(20);\n return error(\"message getdata size() = %\"PRIszu\"\", vInv.size());\n }\n\n if (fDebugNet || (vInv.size() != 1))\n printf(\"received getdata (%\"PRIszu\" invsz)\\n\", vInv.size());\n\n if ((fDebugNet && vInv.size() > 0) || (vInv.size() == 1))\n printf(\"received getdata for: %s\\n\", vInv[0].ToString().c_str());\n\n pfrom->vRecvGetData.insert(pfrom->vRecvGetData.end(), vInv.begin(), vInv.end());\n ProcessGetData(pfrom);\n }\n\n\n else if (strCommand == \"getblocks\")\n {\n CBlockLocator locator;\n uint256 hashStop;\n vRecv >> locator >> hashStop;\n\n // Find the last block the caller has in the main chain\n CBlockIndex* pindex = locator.GetBlockIndex();\n\n // Send the rest of the chain\n if (pindex)\n pindex = pindex->GetNextInMainChain();\n int nLimit = 500;\n printf(\"getblocks %d to %s limit %d\\n\", (pindex ? pindex->nHeight : -1), hashStop.ToString().c_str(), nLimit);\n for (; pindex; pindex = pindex->GetNextInMainChain())\n {\n if (pindex->GetBlockHash() == hashStop)\n {\n printf(\" getblocks stopping at %d %s\\n\", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());\n break;\n }\n pfrom->PushInventory(CInv(MSG_BLOCK, pindex->GetBlockHash()));\n if (--nLimit <= 0)\n {\n // When this block is requested, we'll send an inv that'll make them\n // getblocks the next batch of inventory.\n printf(\" getblocks stopping at limit %d %s\\n\", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());\n pfrom->hashContinue = pindex->GetBlockHash();\n break;\n }\n }\n }\n\n\n else if (strCommand == \"getheaders\")\n {\n CBlockLocator locator;\n uint256 hashStop;\n vRecv >> locator >> hashStop;\n\n CBlockIndex* pindex = NULL;\n if (locator.IsNull())\n {\n // If locator is null, return the hashStop block\n map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashStop);\n if (mi == mapBlockIndex.end())\n return true;\n pindex = (*mi).second;\n }\n else\n {\n // Find the last block the caller has in the main chain\n pindex = locator.GetBlockIndex();\n if (pindex)\n pindex = pindex->GetNextInMainChain();\n }\n\n // we must use CBlocks, as CBlockHeaders won't include the 0x00 nTx count at the end\n vector<CBlock> vHeaders;\n int nLimit = 2000;\n printf(\"getheaders %d to %s\\n\", (pindex ? pindex->nHeight : -1), hashStop.ToString().c_str());\n for (; pindex; pindex = pindex->GetNextInMainChain())\n {\n vHeaders.push_back(pindex->GetBlockHeader());\n if (--nLimit <= 0 || pindex->GetBlockHash() == hashStop)\n break;\n }\n pfrom->PushMessage(\"headers\", vHeaders);\n }\n\n\n else if (strCommand == \"tx\")\n {\n vector<uint256> vWorkQueue;\n vector<uint256> vEraseQueue;\n CDataStream vMsg(vRecv);\n CTransaction tx;\n vRecv >> tx;\n\n CInv inv(MSG_TX, tx.GetHash());\n pfrom->AddInventoryKnown(inv);\n\n // Truncate messages to the size of the tx in them\n unsigned int nSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);\n unsigned int oldSize = vMsg.size();\n if (nSize < oldSize) {\n vMsg.resize(nSize);\n printf(\"truncating oversized TX %s (%u -> %u)\\n\",\n tx.GetHash().ToString().c_str(),\n oldSize, nSize);\n }\n\n bool fMissingInputs = false;\n CValidationState state;\n if (mempool.accept(state, tx, true, &fMissingInputs))\n {\n RelayTransaction(tx, inv.hash, vMsg);\n mapAlreadyAskedFor.erase(inv);\n vWorkQueue.push_back(inv.hash);\n vEraseQueue.push_back(inv.hash);\n\n // Recursively process any orphan transactions that depended on this one\n for (unsigned int i = 0; i < vWorkQueue.size(); i++)\n {\n uint256 hashPrev = vWorkQueue[i];\n for (map<uint256, CDataStream*>::iterator mi = mapOrphanTransactionsByPrev[hashPrev].begin();\n mi != mapOrphanTransactionsByPrev[hashPrev].end();\n ++mi)\n {\n const CDataStream& vMsg = *((*mi).second);\n CTransaction tx;\n CDataStream(vMsg) >> tx;\n CInv inv(MSG_TX, tx.GetHash());\n bool fMissingInputs2 = false;\n // Use a dummy CValidationState so someone can't setup nodes to counter-DoS based on orphan resolution (that is, feeding people an invalid transaction based on LegitTxX in order to get anyone relaying LegitTxX banned)\n CValidationState stateDummy;\n\n if (mempool.accept(stateDummy, tx, true, &fMissingInputs2))\n {\n printf(\" accepted orphan tx %s\\n\", inv.hash.ToString().c_str());\n RelayTransaction(tx, inv.hash, vMsg);\n mapAlreadyAskedFor.erase(inv);\n vWorkQueue.push_back(inv.hash);\n vEraseQueue.push_back(inv.hash);\n }\n else if (!fMissingInputs2)\n {\n // invalid or too-little-fee orphan\n vEraseQueue.push_back(inv.hash);\n printf(\" removed orphan tx %s\\n\", inv.hash.ToString().c_str());\n }\n }\n }\n\n BOOST_FOREACH(uint256 hash, vEraseQueue)\n EraseOrphanTx(hash);\n }\n else if (fMissingInputs)\n {\n AddOrphanTx(vMsg);\n\n // DoS prevention: do not allow mapOrphanTransactions to grow unbounded\n unsigned int nEvicted = LimitOrphanTxSize(MAX_ORPHAN_TRANSACTIONS);\n if (nEvicted > 0)\n printf(\"mapOrphan overflow, removed %u tx\\n\", nEvicted);\n }\n int nDoS;\n if (state.IsInvalid(nDoS))\n pfrom->Misbehaving(nDoS);\n }\n\n\n else if (strCommand == \"block\" && !fImporting && !fReindex) // Ignore blocks received while importing\n {\n CBlock block;\n vRecv >> block;\n\n printf(\"received block %s\\n\", block.GetHash().ToString().c_str());\n // block.print();\n\n CInv inv(MSG_BLOCK, block.GetHash());\n pfrom->AddInventoryKnown(inv);\n\n CValidationState state;\n if (ProcessBlock(state, pfrom, &block))\n mapAlreadyAskedFor.erase(inv);\n int nDoS;\n if (state.IsInvalid(nDoS))\n pfrom->Misbehaving(nDoS);\n }\n\n\n else if (strCommand == \"getaddr\")\n {\n pfrom->vAddrToSend.clear();\n vector<CAddress> vAddr = addrman.GetAddr();\n BOOST_FOREACH(const CAddress &addr, vAddr)\n pfrom->PushAddress(addr);\n }\n\n\n else if (strCommand == \"mempool\")\n {\n std::vector<uint256> vtxid;\n LOCK2(mempool.cs, pfrom->cs_filter);\n mempool.queryHashes(vtxid);\n vector<CInv> vInv;\n BOOST_FOREACH(uint256& hash, vtxid) {\n CInv inv(MSG_TX, hash);\n if ((pfrom->pfilter && pfrom->pfilter->IsRelevantAndUpdate(mempool.lookup(hash), hash)) ||\n (!pfrom->pfilter))\n vInv.push_back(inv);\n if (vInv.size() == MAX_INV_SZ)\n break;\n }\n if (vInv.size() > 0)\n pfrom->PushMessage(\"inv\", vInv);\n }\n\n\n else if (strCommand == \"ping\")\n {\n if (pfrom->nVersion > BIP0031_VERSION)\n {\n uint64 nonce = 0;\n vRecv >> nonce;\n // Echo the message back with the nonce. This allows for two useful features:\n //\n // 1) A remote node can quickly check if the connection is operational\n // 2) Remote nodes can measure the latency of the network thread. If this node\n // is overloaded it won't respond to pings quickly and the remote node can\n // avoid sending us more work, like chain download requests.\n //\n // The nonce stops the remote getting confused between different pings: without\n // it, if the remote node sends a ping once per second and this node takes 5\n // seconds to respond to each, the 5th ping the remote sends would appear to\n // return very quickly.\n pfrom->PushMessage(\"pong\", nonce);\n }\n }\n\n\n else if (strCommand == \"alert\")\n {\n CAlert alert;\n vRecv >> alert;\n\n uint256 alertHash = alert.GetHash();\n if (pfrom->setKnown.count(alertHash) == 0)\n {\n if (alert.ProcessAlert())\n {\n // Relay\n pfrom->setKnown.insert(alertHash);\n {\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n alert.RelayTo(pnode);\n }\n }\n else {\n // Small DoS penalty so peers that send us lots of\n // duplicate/expired/invalid-signature/whatever alerts\n // eventually get banned.\n // This isn't a Misbehaving(100) (immediate ban) because the\n // peer might be an older or different implementation with\n // a different signature key, etc.\n pfrom->Misbehaving(10);\n }\n }\n }\n\n\n else if (strCommand == \"filterload\")\n {\n CBloomFilter filter;\n vRecv >> filter;\n\n if (!filter.IsWithinSizeConstraints())\n // There is no excuse for sending a too-large filter\n pfrom->Misbehaving(100);\n else\n {\n LOCK(pfrom->cs_filter);\n delete pfrom->pfilter;\n pfrom->pfilter = new CBloomFilter(filter);\n }\n pfrom->fRelayTxes = true;\n }\n\n\n else if (strCommand == \"filteradd\")\n {\n vector<unsigned char> vData;\n vRecv >> vData;\n\n // Nodes must NEVER send a data item > 520 bytes (the max size for a script data object,\n // and thus, the maximum size any matched object can have) in a filteradd message\n if (vData.size() > MAX_SCRIPT_ELEMENT_SIZE)\n {\n pfrom->Misbehaving(100);\n } else {\n LOCK(pfrom->cs_filter);\n if (pfrom->pfilter)\n pfrom->pfilter->insert(vData);\n else\n pfrom->Misbehaving(100);\n }\n }\n\n\n else if (strCommand == \"filterclear\")\n {\n LOCK(pfrom->cs_filter);\n delete pfrom->pfilter;\n pfrom->pfilter = NULL;\n pfrom->fRelayTxes = true;\n }\n\n\n else\n {\n // Ignore unknown commands for extensibility\n }\n\n\n // Update the last seen time for this node's address\n if (pfrom->fNetworkNode)\n if (strCommand == \"version\" || strCommand == \"addr\" || strCommand == \"inv\" || strCommand == \"getdata\" || strCommand == \"ping\")\n AddressCurrentlyConnected(pfrom->addr);\n\n\n return true;\n}\n\n// requires LOCK(cs_vRecvMsg)\nbool ProcessMessages(CNode* pfrom)\n{\n //if (fDebug)\n // printf(\"ProcessMessages(%zu messages)\\n\", pfrom->vRecvMsg.size());\n\n //\n // Message format\n // (4) message start\n // (12) command\n // (4) size\n // (4) checksum\n // (x) data\n //\n bool fOk = true;\n\n if (!pfrom->vRecvGetData.empty())\n ProcessGetData(pfrom);\n\n std::deque<CNetMessage>::iterator it = pfrom->vRecvMsg.begin();\n while (!pfrom->fDisconnect && it != pfrom->vRecvMsg.end()) {\n // Don't bother if send buffer is too full to respond anyway\n if (pfrom->nSendSize >= SendBufferSize())\n break;\n\n // get next message\n CNetMessage& msg = *it;\n\n //if (fDebug)\n // printf(\"ProcessMessages(message %u msgsz, %zu bytes, complete:%s)\\n\",\n // msg.hdr.nMessageSize, msg.vRecv.size(),\n // msg.complete() ? \"Y\" : \"N\");\n\n // end, if an incomplete message is found\n if (!msg.complete())\n break;\n\n // at this point, any failure means we can delete the current message\n it++;\n\n // Scan for message start\n if (memcmp(msg.hdr.pchMessageStart, Params().MessageStart(), MESSAGE_START_SIZE) != 0) {\n printf(\"\\n\\nPROCESSMESSAGE: INVALID MESSAGESTART\\n\\n\");\n fOk = false;\n break;\n }\n\n // Read header\n CMessageHeader& hdr = msg.hdr;\n if (!hdr.IsValid())\n {\n printf(\"\\n\\nPROCESSMESSAGE: ERRORS IN HEADER %s\\n\\n\\n\", hdr.GetCommand().c_str());\n continue;\n }\n string strCommand = hdr.GetCommand();\n\n // Message size\n unsigned int nMessageSize = hdr.nMessageSize;\n\n // Checksum\n CDataStream& vRecv = msg.vRecv;\n uint256 hash = Hash(vRecv.begin(), vRecv.begin() + nMessageSize);\n unsigned int nChecksum = 0;\n memcpy(&nChecksum, &hash, sizeof(nChecksum));\n if (nChecksum != hdr.nChecksum)\n {\n printf(\"ProcessMessages(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\\n\",\n strCommand.c_str(), nMessageSize, nChecksum, hdr.nChecksum);\n continue;\n }\n\n // Process message\n bool fRet = false;\n try\n {\n {\n LOCK(cs_main);\n fRet = ProcessMessage(pfrom, strCommand, vRecv);\n }\n boost::this_thread::interruption_point();\n }\n catch (std::ios_base::failure& e)\n {\n if (strstr(e.what(), \"end of data\"))\n {\n // Allow exceptions from under-length message on vRecv\n printf(\"ProcessMessages(%s, %u bytes) : Exception '%s' caught, normally caused by a message being shorter than its stated length\\n\", strCommand.c_str(), nMessageSize, e.what());\n }\n else if (strstr(e.what(), \"size too large\"))\n {\n // Allow exceptions from over-long size\n printf(\"ProcessMessages(%s, %u bytes) : Exception '%s' caught\\n\", strCommand.c_str(), nMessageSize, e.what());\n }\n else\n {\n PrintExceptionContinue(&e, \"ProcessMessages()\");\n }\n }\n catch (boost::thread_interrupted) {\n throw;\n }\n catch (std::exception& e) {\n PrintExceptionContinue(&e, \"ProcessMessages()\");\n } catch (...) {\n PrintExceptionContinue(NULL, \"ProcessMessages()\");\n }\n\n if (!fRet)\n printf(\"ProcessMessage(%s, %u bytes) FAILED\\n\", strCommand.c_str(), nMessageSize);\n }\n\n // In case the connection got shut down, its receive buffer was wiped\n if (!pfrom->fDisconnect)\n pfrom->vRecvMsg.erase(pfrom->vRecvMsg.begin(), it);\n\n return fOk;\n}\n\n\nbool SendMessages(CNode* pto, bool fSendTrickle)\n{\n TRY_LOCK(cs_main, lockMain);\n if (lockMain) {\n // Don't send anything until we get their version message\n if (pto->nVersion == 0)\n return true;\n\n // Keep-alive ping. We send a nonce of zero because we don't use it anywhere\n // right now.\n if (pto->nLastSend && GetTime() - pto->nLastSend > 30 * 60 && pto->vSendMsg.empty()) {\n uint64 nonce = 0;\n if (pto->nVersion > BIP0031_VERSION)\n pto->PushMessage(\"ping\", nonce);\n else\n pto->PushMessage(\"ping\");\n }\n\n // Start block sync\n if (pto->fStartSync && !fImporting && !fReindex) {\n pto->fStartSync = false;\n PushGetBlocks(pto, pindexBest, uint256(0));\n }\n\n // Resend wallet transactions that haven't gotten in a block yet\n // Except during reindex, importing and IBD, when old wallet\n // transactions become unconfirmed and spams other nodes.\n if (!fReindex && !fImporting && !IsInitialBlockDownload())\n {\n ResendWalletTransactions();\n }\n\n // Address refresh broadcast\n static int64 nLastRebroadcast;\n if (!IsInitialBlockDownload() && (GetTime() - nLastRebroadcast > 24 * 60 * 60))\n {\n {\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n {\n // Periodically clear setAddrKnown to allow refresh broadcasts\n if (nLastRebroadcast)\n pnode->setAddrKnown.clear();\n\n // Rebroadcast our address\n if (!fNoListen)\n {\n CAddress addr = GetLocalAddress(&pnode->addr);\n if (addr.IsRoutable())\n pnode->PushAddress(addr);\n }\n }\n }\n nLastRebroadcast = GetTime();\n }\n\n //\n // Message: addr\n //\n if (fSendTrickle)\n {\n vector<CAddress> vAddr;\n vAddr.reserve(pto->vAddrToSend.size());\n BOOST_FOREACH(const CAddress& addr, pto->vAddrToSend)\n {\n // returns true if wasn't already contained in the set\n if (pto->setAddrKnown.insert(addr).second)\n {\n vAddr.push_back(addr);\n // receiver rejects addr messages larger than 1000\n if (vAddr.size() >= 1000)\n {\n pto->PushMessage(\"addr\", vAddr);\n vAddr.clear();\n }\n }\n }\n pto->vAddrToSend.clear();\n if (!vAddr.empty())\n pto->PushMessage(\"addr\", vAddr);\n }\n\n\n //\n // Message: inventory\n //\n vector<CInv> vInv;\n vector<CInv> vInvWait;\n {\n LOCK(pto->cs_inventory);\n vInv.reserve(pto->vInventoryToSend.size());\n vInvWait.reserve(pto->vInventoryToSend.size());\n BOOST_FOREACH(const CInv& inv, pto->vInventoryToSend)\n {\n if (pto->setInventoryKnown.count(inv))\n continue;\n\n // trickle out tx inv to protect privacy\n if (inv.type == MSG_TX && !fSendTrickle)\n {\n // 1/4 of tx invs blast to all immediately\n static uint256 hashSalt;\n if (hashSalt == 0)\n hashSalt = GetRandHash();\n uint256 hashRand = inv.hash ^ hashSalt;\n hashRand = Hash(BEGIN(hashRand), END(hashRand));\n bool fTrickleWait = ((hashRand & 3) != 0);\n\n // always trickle our own transactions\n if (!fTrickleWait)\n {\n CWalletTx wtx;\n if (GetTransaction(inv.hash, wtx))\n if (wtx.fFromMe)\n fTrickleWait = true;\n }\n\n if (fTrickleWait)\n {\n vInvWait.push_back(inv);\n continue;\n }\n }\n\n // returns true if wasn't already contained in the set\n if (pto->setInventoryKnown.insert(inv).second)\n {\n vInv.push_back(inv);\n if (vInv.size() >= 1000)\n {\n pto->PushMessage(\"inv\", vInv);\n vInv.clear();\n }\n }\n }\n pto->vInventoryToSend = vInvWait;\n }\n if (!vInv.empty())\n pto->PushMessage(\"inv\", vInv);\n\n\n //\n // Message: getdata\n //\n vector<CInv> vGetData;\n int64 nNow = GetTime() * 1000000;\n while (!pto->mapAskFor.empty() && (*pto->mapAskFor.begin()).first <= nNow)\n {\n const CInv& inv = (*pto->mapAskFor.begin()).second;\n if (!AlreadyHave(inv))\n {\n if (fDebugNet)\n printf(\"sending getdata: %s\\n\", inv.ToString().c_str());\n vGetData.push_back(inv);\n if (vGetData.size() >= 1000)\n {\n pto->PushMessage(\"getdata\", vGetData);\n vGetData.clear();\n }\n }\n pto->mapAskFor.erase(pto->mapAskFor.begin());\n }\n if (!vGetData.empty())\n pto->PushMessage(\"getdata\", vGetData);\n\n }\n return true;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// BitcoinMiner\n//\n\nint static FormatHashBlocks(void* pbuffer, unsigned int len)\n{\n unsigned char* pdata = (unsigned char*)pbuffer;\n unsigned int blocks = 1 + ((len + 8) / 64);\n unsigned char* pend = pdata + 64 * blocks;\n memset(pdata + len, 0, 64 * blocks - len);\n pdata[len] = 0x80;\n unsigned int bits = len * 8;\n pend[-1] = (bits >> 0) & 0xff;\n pend[-2] = (bits >> 8) & 0xff;\n pend[-3] = (bits >> 16) & 0xff;\n pend[-4] = (bits >> 24) & 0xff;\n return blocks;\n}\n\nstatic const unsigned int pSHA256InitState[8] =\n{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};\n\nvoid SHA256Transform(void* pstate, void* pinput, const void* pinit)\n{\n SHA256_CTX ctx;\n unsigned char data[64];\n\n SHA256_Init(&ctx);\n\n for (int i = 0; i < 16; i++)\n ((uint32_t*)data)[i] = ByteReverse(((uint32_t*)pinput)[i]);\n\n for (int i = 0; i < 8; i++)\n ctx.h[i] = ((uint32_t*)pinit)[i];\n\n SHA256_Update(&ctx, data, sizeof(data));\n for (int i = 0; i < 8; i++)\n ((uint32_t*)pstate)[i] = ctx.h[i];\n}\n\n//\n// ScanHash scans nonces looking for a hash with at least some zero bits.\n// It operates on big endian data. Caller does the byte reversing.\n// All input buffers are 16-byte aligned. nNonce is usually preserved\n// between calls, but periodically or if nNonce is 0xffff0000 or above,\n// the block is rebuilt and nNonce starts over at zero.\n//\nunsigned int static ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1, char* phash, unsigned int& nHashesDone)\n{\n unsigned int& nNonce = *(unsigned int*)(pdata + 12);\n for (;;)\n {\n // Crypto++ SHA256\n // Hash pdata using pmidstate as the starting state into\n // pre-formatted buffer phash1, then hash phash1 into phash\n nNonce++;\n SHA256Transform(phash1, pdata, pmidstate);\n SHA256Transform(phash, phash1, pSHA256InitState);\n\n // Return the nonce if the hash has at least some zero bits,\n // caller will check if it has enough to reach the target\n if (((unsigned short*)phash)[14] == 0)\n return nNonce;\n\n // If nothing found after trying for a while, return -1\n if ((nNonce & 0xffff) == 0)\n {\n nHashesDone = 0xffff+1;\n return (unsigned int) -1;\n }\n if ((nNonce & 0xfff) == 0)\n boost::this_thread::interruption_point();\n }\n}\n\n// Some explaining would be appreciated\nclass COrphan\n{\npublic:\n CTransaction* ptx;\n set<uint256> setDependsOn;\n double dPriority;\n double dFeePerKb;\n\n COrphan(CTransaction* ptxIn)\n {\n ptx = ptxIn;\n dPriority = dFeePerKb = 0;\n }\n\n void print() const\n {\n printf(\"COrphan(hash=%s, dPriority=%.1f, dFeePerKb=%.1f)\\n\",\n ptx->GetHash().ToString().c_str(), dPriority, dFeePerKb);\n BOOST_FOREACH(uint256 hash, setDependsOn)\n printf(\" setDependsOn %s\\n\", hash.ToString().c_str());\n }\n};\n\n\nuint64 nLastBlockTx = 0;\nuint64 nLastBlockSize = 0;\n\n// We want to sort transactions by priority and fee, so:\ntypedef boost::tuple<double, double, CTransaction*> TxPriority;\nclass TxPriorityCompare\n{\n bool byFee;\npublic:\n TxPriorityCompare(bool _byFee) : byFee(_byFee) { }\n bool operator()(const TxPriority& a, const TxPriority& b)\n {\n if (byFee)\n {\n if (a.get<1>() == b.get<1>())\n return a.get<0>() < b.get<0>();\n return a.get<1>() < b.get<1>();\n }\n else\n {\n if (a.get<0>() == b.get<0>())\n return a.get<1>() < b.get<1>();\n return a.get<0>() < b.get<0>();\n }\n }\n};\n\nCBlockTemplate* CreateNewBlock(CReserveKey& reservekey)\n{\n // Create new block\n auto_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());\n if(!pblocktemplate.get())\n return NULL;\n CBlock *pblock = &pblocktemplate->block; // pointer for convenience\n\n // Create coinbase tx\n CTransaction txNew;\n txNew.vin.resize(1);\n txNew.vin[0].prevout.SetNull();\n txNew.vout.resize(1);\n CPubKey pubkey;\n if (!reservekey.GetReservedKey(pubkey))\n return NULL;\n txNew.vout[0].scriptPubKey << pubkey << OP_CHECKSIG;\n\n // Add our coinbase tx as first transaction\n pblock->vtx.push_back(txNew);\n pblocktemplate->vTxFees.push_back(-1); // updated at end\n pblocktemplate->vTxSigOps.push_back(-1); // updated at end\n\n // Largest block you're willing to create:\n unsigned int nBlockMaxSize = GetArg(\"-blockmaxsize\", MAX_BLOCK_SIZE_GEN/2);\n // Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity:\n nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize));\n\n // How much of the block should be dedicated to high-priority transactions,\n // included regardless of the fees they pay\n unsigned int nBlockPrioritySize = GetArg(\"-blockprioritysize\", DEFAULT_BLOCK_PRIORITY_SIZE);\n nBlockPrioritySize = std::min(nBlockMaxSize, nBlockPrioritySize);\n\n // Minimum block size you want to create; block will be filled with free transactions\n // until there are no more or the block reaches this size:\n unsigned int nBlockMinSize = GetArg(\"-blockminsize\", 0);\n nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize);\n\n // Collect memory pool transactions into the block\n int64 nFees = 0;\n {\n LOCK2(cs_main, mempool.cs);\n CBlockIndex* pindexPrev = pindexBest;\n CCoinsViewCache view(*pcoinsTip, true);\n\n // Priority order to process transactions\n list<COrphan> vOrphan; // list memory doesn't move\n map<uint256, vector<COrphan*> > mapDependers;\n bool fPrintPriority = GetBoolArg(\"-printpriority\", false);\n\n // This vector will be sorted into a priority queue:\n vector<TxPriority> vecPriority;\n vecPriority.reserve(mempool.mapTx.size());\n for (map<uint256, CTransaction>::iterator mi = mempool.mapTx.begin(); mi != mempool.mapTx.end(); ++mi)\n {\n CTransaction& tx = (*mi).second;\n if (tx.IsCoinBase() || !IsFinalTx(tx))\n continue;\n\n COrphan* porphan = NULL;\n double dPriority = 0;\n int64 nTotalIn = 0;\n bool fMissingInputs = false;\n BOOST_FOREACH(const CTxIn& txin, tx.vin)\n {\n // Read prev transaction\n if (!view.HaveCoins(txin.prevout.hash))\n {\n // This should never happen; all transactions in the memory\n // pool should connect to either transactions in the chain\n // or other transactions in the memory pool.\n if (!mempool.mapTx.count(txin.prevout.hash))\n {\n printf(\"ERROR: mempool transaction missing input\\n\");\n if (fDebug) assert(\"mempool transaction missing input\" == 0);\n fMissingInputs = true;\n if (porphan)\n vOrphan.pop_back();\n break;\n }\n\n // Has to wait for dependencies\n if (!porphan)\n {\n // Use list for automatic deletion\n vOrphan.push_back(COrphan(&tx));\n porphan = &vOrphan.back();\n }\n mapDependers[txin.prevout.hash].push_back(porphan);\n porphan->setDependsOn.insert(txin.prevout.hash);\n nTotalIn += mempool.mapTx[txin.prevout.hash].vout[txin.prevout.n].nValue;\n continue;\n }\n const CCoins &coins = view.GetCoins(txin.prevout.hash);\n\n int64 nValueIn = coins.vout[txin.prevout.n].nValue;\n nTotalIn += nValueIn;\n\n int nConf = pindexPrev->nHeight - coins.nHeight + 1;\n\n dPriority += (double)nValueIn * nConf;\n }\n if (fMissingInputs) continue;\n\n // Priority is sum(valuein * age) / txsize\n unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);\n dPriority /= nTxSize;\n\n // This is a more accurate fee-per-kilobyte than is used by the client code, because the\n // client code rounds up the size to the nearest 1K. That's good, because it gives an\n // incentive to create smaller transactions.\n double dFeePerKb = double(nTotalIn-GetValueOut(tx)) / (double(nTxSize)/1000.0);\n\n if (porphan)\n {\n porphan->dPriority = dPriority;\n porphan->dFeePerKb = dFeePerKb;\n }\n else\n vecPriority.push_back(TxPriority(dPriority, dFeePerKb, &(*mi).second));\n }\n\n // Collect transactions into block\n uint64 nBlockSize = 1000;\n uint64 nBlockTx = 0;\n int nBlockSigOps = 100;\n bool fSortedByFee = (nBlockPrioritySize <= 0);\n\n TxPriorityCompare comparer(fSortedByFee);\n std::make_heap(vecPriority.begin(), vecPriority.end(), comparer);\n\n while (!vecPriority.empty())\n {\n // Take highest priority transaction off the priority queue:\n double dPriority = vecPriority.front().get<0>();\n double dFeePerKb = vecPriority.front().get<1>();\n CTransaction& tx = *(vecPriority.front().get<2>());\n\n std::pop_heap(vecPriority.begin(), vecPriority.end(), comparer);\n vecPriority.pop_back();\n\n // Size limits\n unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);\n if (nBlockSize + nTxSize >= nBlockMaxSize)\n continue;\n\n // Legacy limits on sigOps:\n unsigned int nTxSigOps = GetLegacySigOpCount(tx);\n if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)\n continue;\n\n // Skip free transactions if we're past the minimum block size:\n if (fSortedByFee && (dFeePerKb < CTransaction::nMinTxFee) && (nBlockSize + nTxSize >= nBlockMinSize))\n continue;\n\n // Prioritize by fee once past the priority size or we run out of high-priority\n // transactions:\n if (!fSortedByFee &&\n ((nBlockSize + nTxSize >= nBlockPrioritySize) || !AllowFree(dPriority)))\n {\n fSortedByFee = true;\n comparer = TxPriorityCompare(fSortedByFee);\n std::make_heap(vecPriority.begin(), vecPriority.end(), comparer);\n }\n\n if (!view.HaveInputs(tx))\n continue;\n\n int64 nTxFees = view.GetValueIn(tx)-GetValueOut(tx);\n\n nTxSigOps += GetP2SHSigOpCount(tx, view);\n if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)\n continue;\n\n CValidationState state;\n if (!CheckInputs(tx, state, view, true, SCRIPT_VERIFY_P2SH))\n continue;\n\n CTxUndo txundo;\n uint256 hash = tx.GetHash();\n UpdateCoins(tx, state, view, txundo, pindexPrev->nHeight+1, hash);\n\n // Added\n pblock->vtx.push_back(tx);\n pblocktemplate->vTxFees.push_back(nTxFees);\n pblocktemplate->vTxSigOps.push_back(nTxSigOps);\n nBlockSize += nTxSize;\n ++nBlockTx;\n nBlockSigOps += nTxSigOps;\n nFees += nTxFees;\n\n if (fPrintPriority)\n {\n printf(\"priority %.1f feeperkb %.1f txid %s\\n\",\n dPriority, dFeePerKb, tx.GetHash().ToString().c_str());\n }\n\n // Add transactions that depend on this one to the priority queue\n if (mapDependers.count(hash))\n {\n BOOST_FOREACH(COrphan* porphan, mapDependers[hash])\n {\n if (!porphan->setDependsOn.empty())\n {\n porphan->setDependsOn.erase(hash);\n if (porphan->setDependsOn.empty())\n {\n vecPriority.push_back(TxPriority(porphan->dPriority, porphan->dFeePerKb, porphan->ptx));\n std::push_heap(vecPriority.begin(), vecPriority.end(), comparer);\n }\n }\n }\n }\n }\n\n nLastBlockTx = nBlockTx;\n nLastBlockSize = nBlockSize;\n printf(\"CreateNewBlock(): total size %\"PRI64u\"\\n\", nBlockSize);\n\n pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);\n pblocktemplate->vTxFees[0] = -nFees;\n\n // Fill in header\n pblock->hashPrevBlock = pindexPrev->GetBlockHash();\n UpdateTime(*pblock, pindexPrev);\n pblock->nBits = GetNextWorkRequired(pindexPrev, pblock);\n pblock->nNonce = 0;\n pblock->vtx[0].vin[0].scriptSig = CScript() << OP_0 << OP_0;\n pblocktemplate->vTxSigOps[0] = GetLegacySigOpCount(pblock->vtx[0]);\n\n CBlockIndex indexDummy(*pblock);\n indexDummy.pprev = pindexPrev;\n indexDummy.nHeight = pindexPrev->nHeight + 1;\n CCoinsViewCache viewNew(*pcoinsTip, true);\n CValidationState state;\n if (!ConnectBlock(*pblock, state, &indexDummy, viewNew, true))\n throw std::runtime_error(\"CreateNewBlock() : ConnectBlock failed\");\n }\n\n return pblocktemplate.release();\n}\n\n\nvoid IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce)\n{\n // Update nExtraNonce\n static uint256 hashPrevBlock;\n if (hashPrevBlock != pblock->hashPrevBlock)\n {\n nExtraNonce = 0;\n hashPrevBlock = pblock->hashPrevBlock;\n }\n ++nExtraNonce;\n unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2\n pblock->vtx[0].vin[0].scriptSig = (CScript() << nHeight << CBigNum(nExtraNonce)) + COINBASE_FLAGS;\n assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);\n\n pblock->hashMerkleRoot = pblock->BuildMerkleTree();\n}\n\n\nvoid FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1)\n{\n //\n // Pre-build hash buffers\n //\n struct\n {\n struct unnamed2\n {\n int nVersion;\n uint256 hashPrevBlock;\n uint256 hashMerkleRoot;\n unsigned int nTime;\n unsigned int nBits;\n unsigned int nNonce;\n }\n block;\n unsigned char pchPadding0[64];\n uint256 hash1;\n unsigned char pchPadding1[64];\n }\n tmp;\n memset(&tmp, 0, sizeof(tmp));\n\n tmp.block.nVersion = pblock->nVersion;\n tmp.block.hashPrevBlock = pblock->hashPrevBlock;\n tmp.block.hashMerkleRoot = pblock->hashMerkleRoot;\n tmp.block.nTime = pblock->nTime;\n tmp.block.nBits = pblock->nBits;\n tmp.block.nNonce = pblock->nNonce;\n\n FormatHashBlocks(&tmp.block, sizeof(tmp.block));\n FormatHashBlocks(&tmp.hash1, sizeof(tmp.hash1));\n\n // Byte swap all the input buffer\n for (unsigned int i = 0; i < sizeof(tmp)/4; i++)\n ((unsigned int*)&tmp)[i] = ByteReverse(((unsigned int*)&tmp)[i]);\n\n // Precalc the first half of the first hash, which stays constant\n SHA256Transform(pmidstate, &tmp.block, pSHA256InitState);\n\n memcpy(pdata, &tmp.block, 128);\n memcpy(phash1, &tmp.hash1, 64);\n}\n\n\nbool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)\n{\n uint256 hash = pblock->GetHash();\n uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();\n\n if (hash > hashTarget)\n return false;\n\n //// debug print\n printf(\"ContinuumCoinMiner:\\n\");\n printf(\"proof-of-work found \\n hash: %s \\ntarget: %s\\n\", hash.GetHex().c_str(), hashTarget.GetHex().c_str());\n pblock->print();\n printf(\"generated %s\\n\", FormatMoney(pblock->vtx[0].vout[0].nValue).c_str());\n\n // Found a solution\n {\n LOCK(cs_main);\n if (pblock->hashPrevBlock != hashBestChain)\n return error(\"ContinuumCoinMiner : generated block is stale\");\n\n // Remove key from key pool\n reservekey.KeepKey();\n\n // Track how many getdata requests this block gets\n {\n LOCK(wallet.cs_wallet);\n wallet.mapRequestCount[pblock->GetHash()] = 0;\n }\n\n // Process this block the same as if we had received it from another node\n CValidationState state;\n if (!ProcessBlock(state, NULL, pblock))\n return error(\"ContinuumCoinMiner : ProcessBlock, block not accepted\");\n }\n\n return true;\n}\n\nvoid static BitcoinMiner(CWallet *pwallet)\n{\n printf(\"ContinuumCoinMiner started\\n\");\n SetThreadPriority(THREAD_PRIORITY_LOWEST);\n RenameThread(\"bitcoin-miner\");\n\n // Each thread has its own key and counter\n CReserveKey reservekey(pwallet);\n unsigned int nExtraNonce = 0;\n\n try { loop {\n if (Params().NetworkID() != CChainParams::REGTEST) {\n // Busy-wait for the network to come online so we don't waste time mining\n // on an obsolete chain. In regtest mode we expect to fly solo.\n while (vNodes.empty())\n MilliSleep(1000);\n }\n\n //\n // Create new block\n //\n unsigned int nTransactionsUpdatedLast = nTransactionsUpdated;\n CBlockIndex* pindexPrev = pindexBest;\n\n auto_ptr<CBlockTemplate> pblocktemplate(CreateNewBlock(reservekey));\n if (!pblocktemplate.get())\n return;\n CBlock *pblock = &pblocktemplate->block;\n IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);\n\n printf(\"Running ContinuumCoinMiner with %\"PRIszu\" transactions in block (%u bytes)\\n\", pblock->vtx.size(),\n ::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION));\n\n //\n // Pre-build hash buffers\n //\n char pmidstatebuf[32+16]; char* pmidstate = alignup<16>(pmidstatebuf);\n char pdatabuf[128+16]; char* pdata = alignup<16>(pdatabuf);\n char phash1buf[64+16]; char* phash1 = alignup<16>(phash1buf);\n\n FormatHashBuffers(pblock, pmidstate, pdata, phash1);\n\n unsigned int& nBlockTime = *(unsigned int*)(pdata + 64 + 4);\n unsigned int& nBlockBits = *(unsigned int*)(pdata + 64 + 8);\n unsigned int& nBlockNonce = *(unsigned int*)(pdata + 64 + 12);\n\n\n //\n // Search\n //\n int64 nStart = GetTime();\n uint256 hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();\n uint256 hashbuf[2];\n uint256& hash = *alignup<16>(hashbuf);\n loop\n {\n unsigned int nHashesDone = 0;\n unsigned int nNonceFound;\n\n // Crypto++ SHA256\n nNonceFound = ScanHash_CryptoPP(pmidstate, pdata + 64, phash1,\n (char*)&hash, nHashesDone);\n\n // Check if something found\n if (nNonceFound != (unsigned int) -1)\n {\n for (unsigned int i = 0; i < sizeof(hash)/4; i++)\n ((unsigned int*)&hash)[i] = ByteReverse(((unsigned int*)&hash)[i]);\n\n if (hash <= hashTarget)\n {\n // Found a solution\n pblock->nNonce = ByteReverse(nNonceFound);\n assert(hash == pblock->GetHash());\n\n SetThreadPriority(THREAD_PRIORITY_NORMAL);\n CheckWork(pblock, *pwalletMain, reservekey);\n SetThreadPriority(THREAD_PRIORITY_LOWEST);\n\n // In regression test mode, stop mining after a block is found. This\n // allows developers to controllably generate a block on demand.\n if (Params().NetworkID() == CChainParams::REGTEST)\n throw boost::thread_interrupted();\n\n break;\n }\n }\n\n // Meter hashes/sec\n static int64 nHashCounter;\n if (nHPSTimerStart == 0)\n {\n nHPSTimerStart = GetTimeMillis();\n nHashCounter = 0;\n }\n else\n nHashCounter += nHashesDone;\n if (GetTimeMillis() - nHPSTimerStart > 4000)\n {\n static CCriticalSection cs;\n {\n LOCK(cs);\n if (GetTimeMillis() - nHPSTimerStart > 4000)\n {\n dHashesPerSec = 1000.0 * nHashCounter / (GetTimeMillis() - nHPSTimerStart);\n nHPSTimerStart = GetTimeMillis();\n nHashCounter = 0;\n static int64 nLogTime;\n if (GetTime() - nLogTime > 30 * 60)\n {\n nLogTime = GetTime();\n printf(\"hashmeter %6.0f khash/s\\n\", dHashesPerSec/1000.0);\n }\n }\n }\n }\n\n // Check for stop or if block needs to be rebuilt\n boost::this_thread::interruption_point();\n if (vNodes.empty() && Params().NetworkID() != CChainParams::REGTEST)\n break;\n if (nBlockNonce >= 0xffff0000)\n break;\n if (nTransactionsUpdated != nTransactionsUpdatedLast && GetTime() - nStart > 60)\n break;\n if (pindexPrev != pindexBest)\n break;\n\n // Update nTime every few seconds\n UpdateTime(*pblock, pindexPrev);\n nBlockTime = ByteReverse(pblock->nTime);\n if (TestNet())\n {\n // Changing pblock->nTime can change work required on testnet:\n nBlockBits = ByteReverse(pblock->nBits);\n hashTarget = CBigNum().SetCompact(pblock->nBits).getuint256();\n }\n }\n } }\n catch (boost::thread_interrupted)\n {\n printf(\"ContinuumCoinMiner terminated\\n\");\n throw;\n }\n}\n\nvoid GenerateBitcoins(bool fGenerate, CWallet* pwallet)\n{\n static boost::thread_group* minerThreads = NULL;\n\n int nThreads = GetArg(\"-genproclimit\", -1);\n if (nThreads < 0) {\n if (Params().NetworkID() == CChainParams::REGTEST)\n nThreads = 1;\n else\n nThreads = boost::thread::hardware_concurrency();\n }\n\n if (minerThreads != NULL)\n {\n minerThreads->interrupt_all();\n delete minerThreads;\n minerThreads = NULL;\n }\n\n if (nThreads == 0 || !fGenerate)\n return;\n\n minerThreads = new boost::thread_group();\n for (int i = 0; i < nThreads; i++)\n minerThreads->create_thread(boost::bind(&BitcoinMiner, pwallet));\n}\n\n\n\nclass CMainCleanup\n{\npublic:\n CMainCleanup() {}\n ~CMainCleanup() {\n // block headers\n std::map<uint256, CBlockIndex*>::iterator it1 = mapBlockIndex.begin();\n for (; it1 != mapBlockIndex.end(); it1++)\n delete (*it1).second;\n mapBlockIndex.clear();\n\n // orphan blocks\n std::map<uint256, CBlock*>::iterator it2 = mapOrphanBlocks.begin();\n for (; it2 != mapOrphanBlocks.end(); it2++)\n delete (*it2).second;\n mapOrphanBlocks.clear();\n\n // orphan transactions\n std::map<uint256, CDataStream*>::iterator it3 = mapOrphanTransactions.begin();\n for (; it3 != mapOrphanTransactions.end(); it3++)\n delete (*it3).second;\n mapOrphanTransactions.clear();\n }\n} instance_of_cmaincleanup;\n", "meta": {"content_hash": "bdc8afa52858a5c1f481a39a7c7e0365", "timestamp": "", "source": "github", "line_count": 4939, "max_line_length": 237, "avg_line_length": 35.52237294998988, "alnum_prop": 0.588514919205449, "repo_name": "continuumcoin/CTM", "id": "e4774974afd6223375d37020759c2ca980d22e55", "size": "175445", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main.cpp", "mode": "33261", "license": "mit", "language": [{"name": "C", "bytes": "102674"}, {"name": "C++", "bytes": "13319852"}, {"name": "CSS", "bytes": "1127"}, {"name": "IDL", "bytes": "13858"}, {"name": "Nu", "bytes": "264"}, {"name": "Objective-C", "bytes": "5711"}, {"name": "Perl", "bytes": "12210"}, {"name": "Python", "bytes": "3773"}, {"name": "Shell", "bytes": "8172"}, {"name": "TypeScript", "bytes": "5258516"}]}} +{"text": "<?php\n//require_once('includes/checksession.php');\nrequire_once('includes/connection.php');\nrequire_once('includes/template.php');\n/*require_once('includes/func.getUserID.php');\n$id_user = getUserID($connection);\nif (!$id_user){\n\techo 'Error: login';\n\texit();\n}*/\n\nopenHeader('Project XYZ', '/project-xyz/styles/styles.css');\nopenBody('Categorias disponibles','mainPage', $connection);\n\n$query = <<<EOD\nSELECT *\nFROM categories_photos cp, photos p\nWHERE p.id_photo=cp.id_photo\nAND p.status_photo=1\nORDER BY cp.id_category_photo ASC\nEOD;\n\nif(!($res = mysql_query($query, $connection))){\n\techo 'KO';\n\texit();\n}\n\n$array_cat_photo = array();\n\nwhile ($file = mysql_fetch_assoc($res)){\n\t\n$array_cat_photo[$file['id_category']] = $file['name_photo'];\n}\n\n\n$query = <<<EOD\nSELECT *\nFROM categories\nWHERE status = 1\nORDER BY name_category\nEOD;\n\n$res = mysql_query($query,$connection);\n$categoryList = '';\nwhile ($category = mysql_fetch_assoc($res)){\n$photo = $array_cat_photo[$category['id_category']];\n$id_category = $category['id_category'];\n\t$categoryList .= <<<EOD\n<div class=\"category\">\n\t<a href=\"categories_games.php?id_category={$id_category}\"><img class=\"image_category\" src=\"images/{$photo}\" /><p class=\"name_category\" rel=\"{$category['id_category']}\">{$category['name_category']}</p></a>\n</div>\nEOD;\n}\n?>\n\n<div id=\"global_category\">\n<?php\necho $categoryList;\n?>\n</div>\n\n<?php\ncloseBody();\n?>\n", "meta": {"content_hash": "18ca79c16374c24b07eaf9ac28155ce5", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 205, "avg_line_length": 21.75, "alnum_prop": 0.6745689655172413, "repo_name": "csalva/project-XYZ", "id": "b503d318b3851f3e4f68a209b405bb2262eb9884", "size": "1392", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "categories.php", "mode": "33261", "license": "mit", "language": [{"name": "CSS", "bytes": "101093"}, {"name": "Java", "bytes": "40505"}, {"name": "JavaScript", "bytes": "613372"}, {"name": "PHP", "bytes": "1195636"}, {"name": "Perl", "bytes": "26"}, {"name": "Rust", "bytes": "231"}]}} +{"text": "Currency.create currency: 'USD'\nCurrency.create currency: 'EUR'\n\nOptionType.create option_type: 'ETO'\nOptionType.create option_type: 'OTC'\n\nQuoteName.create quote_name: 'IPE Brent'\nQuoteName.create quote_name: 'IPE Gas Oil'\nQuoteName.create quote_name: 'NYMEX WTI'\nQuoteName.create quote_name: 'NYMEX Heat'\nQuoteName.create quote_name: 'NYMEX Brent'\nQuoteName.create quote_name: 'NYMEX RBOB'\nQuoteName.create quote_name: 'ICE WTI'\nQuoteName.create quote_name: 'ICE RBOB'\nQuoteName.create quote_name: 'ICE Heat'\n\n", "meta": {"content_hash": "6fdec2d2a83f183aed7128f53be4c040", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 42, "avg_line_length": 32.0, "alnum_prop": 0.775390625, "repo_name": "lshift/diffa-rails-adapter-tutorial", "id": "85ec0065d7930e178f7fe1def7aa09949e7a3d0e", "size": "855", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/seeds.rb", "mode": "33188", "license": "apache-2.0", "language": [{"name": "JavaScript", "bytes": "189937"}, {"name": "Ruby", "bytes": "47872"}]}} +{"text": "// # Client API\n// RESTful API for the Client resource\nvar Promise = require('bluebird'),\n _ = require('lodash'),\n pipeline = require('../utils/pipeline'),\n apiUtils = require('./utils'),\n models = require('../models'),\n common = require('../lib/common'),\n docName = 'clients',\n clients;\n\n/**\n * ### Clients API Methods\n *\n * **See:** [API Methods](events.js.html#api%20methods)\n */\nclients = {\n\n /**\n * ## Read\n * @param {{id}} options\n * @return {Promise<Client>} Client\n */\n read: function read(options) {\n var attrs = ['id', 'slug'],\n tasks;\n\n /**\n * ### Model Query\n * Make the call to the Model layer\n * @param {Object} options\n * @returns {Object} options\n */\n function doQuery(options) {\n // only User Agent (type = `ua`) clients are available at the moment.\n options.data = _.extend(options.data, {type: 'ua'});\n\n return models.Client.findOne(options.data, _.omit(options, ['data']))\n .then(function onModelResponse(model) {\n if (!model) {\n return Promise.reject(new common.errors.NotFoundError({\n message: common.i18n.t('common.api.clients.clientNotFound')\n }));\n }\n\n return {\n clients: [model.toJSON(options)]\n };\n });\n }\n\n // Push all of our tasks into a `tasks` array in the correct order\n tasks = [\n apiUtils.validate(docName, {attrs: attrs}),\n // TODO: add permissions\n // utils.handlePublicPermissions(docName, 'read'),\n doQuery\n ];\n\n // Pipeline calls each task passing the result of one to be the arguments for the next\n return pipeline(tasks, options);\n }\n};\n\nmodule.exports = clients;\n", "meta": {"content_hash": "42dce0018ae9c1a2b51b6b58ccbf5497", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 94, "avg_line_length": 29.907692307692308, "alnum_prop": 0.5108024691358025, "repo_name": "kpsuperplane/personal-website", "id": "c511da4a618e7a01c1b63f38f421906783a246b8", "size": "1944", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "versions/1.19.0/core/server/api/clients.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "18318"}, {"name": "HTML", "bytes": "139091"}, {"name": "Handlebars", "bytes": "48136"}, {"name": "JavaScript", "bytes": "950569"}, {"name": "Procfile", "bytes": "14"}, {"name": "SCSS", "bytes": "36725"}, {"name": "Shell", "bytes": "483"}, {"name": "TypeScript", "bytes": "67274"}, {"name": "XSLT", "bytes": "7177"}]}} +{"text": "<?xml version=\"1.0\" ?><!DOCTYPE TS><TS language=\"fr_CA\" version=\"2.0\">\n<defaultcodec>UTF-8</defaultcodec>\n<context>\n <name>AboutDialog</name>\n <message>\n <location filename=\"../forms/aboutdialog.ui\" line=\"+14\"/>\n <source>About potatocoin</source>\n <translation>A propos de potatocoin</translation>\n </message>\n <message>\n <location line=\"+39\"/>\n <source><b>potatocoin</b> version</source>\n <translation><b>potatocoin</b> version</translation>\n </message>\n <message>\n <location line=\"+57\"/>\n <source>\nThis is experimental software.\n\nDistributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nThis product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>\n <translation>\nCe logiciel est en phase exp\u00e9rimentale.\n\nDistribu\u00e9 sous licence MIT/X11, voir le fichier COPYING ou http://www.opensource.org/licenses/mit-license.php.\n\nCe produit comprend des logiciels d\u00e9velopp\u00e9s par le projet OpenSSL pour \u00eatre utilis\u00e9s dans la bo\u00eete \u00e0 outils OpenSSL (http://www.openssl.org/), un logiciel cryptographique \u00e9crit par Eric Young (eay@cryptsoft.com) et un logiciel UPnP \u00e9crit par Thomas Bernard.</translation>\n </message>\n <message>\n <location filename=\"../aboutdialog.cpp\" line=\"+14\"/>\n <source>Copyright</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>The potatocoin developers</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>AddressBookPage</name>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"+14\"/>\n <source>Address Book</source>\n <translation>Carnet d'adresses</translation>\n </message>\n <message>\n <location line=\"+19\"/>\n <source>Double-click to edit address or label</source>\n <translation>Double-cliquez afin de modifier l'adress ou l'\u00e9tiquette</translation>\n </message>\n <message>\n <location line=\"+27\"/>\n <source>Create a new address</source>\n <translation>Cr\u00e9er une nouvelle adresse</translation>\n </message>\n <message>\n <location line=\"+14\"/>\n <source>Copy the currently selected address to the system clipboard</source>\n <translation>Copier l'adresse surlign\u00e9 a votre presse-papier</translation>\n </message>\n <message>\n <location line=\"-11\"/>\n <source>&New Address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../addressbookpage.cpp\" line=\"+63\"/>\n <source>These are your potatocoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>\n <translation>Ceux-ci sont vos adresses potatocoin qui vous permettent de recevoir des paiements. Vous pouvez en donner une diff\u00e9rente \u00e0 chaque exp\u00e9dieur afin de savoir qui vous payent.</translation>\n </message>\n <message>\n <location filename=\"../forms/addressbookpage.ui\" line=\"+14\"/>\n <source>&Copy Address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+11\"/>\n <source>Show &QR Code</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+11\"/>\n <source>Sign a message to prove you own a potatocoin address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Sign &Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+25\"/>\n <source>Delete the currently selected address from the list</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+27\"/>\n <source>Export the data in the current tab to a file</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>&Export</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-44\"/>\n <source>Verify a message to ensure it was signed with a specified potatocoin address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>&Verify Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+14\"/>\n <source>&Delete</source>\n <translation>&Supprimer</translation>\n </message>\n <message>\n <location filename=\"../addressbookpage.cpp\" line=\"-5\"/>\n <source>These are your potatocoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+13\"/>\n <source>Copy &Label</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>&Edit</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Send &Coins</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+260\"/>\n <source>Export Address Book Data</source>\n <translation>Exporter les donn\u00e9es du carnet d'adresses</translation>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Comma separated file (*.csv)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+13\"/>\n <source>Error exporting</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Could not write to file %1.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>AddressTableModel</name>\n <message>\n <location filename=\"../addresstablemodel.cpp\" line=\"+144\"/>\n <source>Label</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+36\"/>\n <source>(no label)</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>AskPassphraseDialog</name>\n <message>\n <location filename=\"../forms/askpassphrasedialog.ui\" line=\"+26\"/>\n <source>Passphrase Dialog</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+21\"/>\n <source>Enter passphrase</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+14\"/>\n <source>New passphrase</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+14\"/>\n <source>Repeat new passphrase</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../askpassphrasedialog.cpp\" line=\"+33\"/>\n <source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Encrypt wallet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Unlock wallet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Decrypt wallet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Change passphrase</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Enter the old and new passphrase to the wallet.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+46\"/>\n <source>Confirm wallet encryption</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR DARKCOINS</b>!</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Are you sure you wish to encrypt your wallet?</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+15\"/>\n <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+100\"/>\n <location line=\"+24\"/>\n <source>Warning: The Caps Lock key is on!</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-130\"/>\n <location line=\"+58\"/>\n <source>Wallet encrypted</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-56\"/>\n <source>potatocoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your potatocoins from being stolen by malware infecting your computer.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+13\"/>\n <location line=\"+7\"/>\n <location line=\"+42\"/>\n <location line=\"+6\"/>\n <source>Wallet encryption failed</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-54\"/>\n <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <location line=\"+48\"/>\n <source>The supplied passphrases do not match.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-37\"/>\n <source>Wallet unlock failed</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <location line=\"+11\"/>\n <location line=\"+19\"/>\n <source>The passphrase entered for the wallet decryption was incorrect.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-20\"/>\n <source>Wallet decryption failed</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+14\"/>\n <source>Wallet passphrase was successfully changed.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>BitcoinGUI</name>\n <message>\n <location filename=\"../bitcoingui.cpp\" line=\"+233\"/>\n <source>Sign &message...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+280\"/>\n <source>Synchronizing with network...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-349\"/>\n <source>&Overview</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Show general overview of wallet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+20\"/>\n <source>&Transactions</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Browse transaction history</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Edit the list of stored addresses and labels</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-14\"/>\n <source>Show the list of addresses for receiving payments</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+31\"/>\n <source>E&xit</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Quit application</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>Show information about potatocoin</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>About &Qt</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Show information about Qt</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>&Options...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>&Encrypt Wallet...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>&Backup Wallet...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>&Change Passphrase...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+285\"/>\n <source>Importing blocks from disk...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Reindexing blocks on disk...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-347\"/>\n <source>Send coins to a potatocoin address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+49\"/>\n <source>Modify configuration options for potatocoin</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+9\"/>\n <source>Backup wallet to another location</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Change the passphrase used for wallet encryption</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>&Debug window</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Open debugging and diagnostic console</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-4\"/>\n <source>&Verify message...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-165\"/>\n <location line=\"+530\"/>\n <source>potatocoin</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-530\"/>\n <source>Wallet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+101\"/>\n <source>&Send</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>&Receive</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+14\"/>\n <source>&Addresses</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+22\"/>\n <source>&About potatocoin</source>\n <translation>&A propos de potatocoin</translation>\n </message>\n <message>\n <location line=\"+9\"/>\n <source>&Show / Hide</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Show or hide the main Window</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Encrypt the private keys that belong to your wallet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Sign messages with your potatocoin addresses to prove you own them</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Verify messages to ensure they were signed with specified potatocoin addresses</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+28\"/>\n <source>&File</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>&Settings</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>&Help</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+9\"/>\n <source>Tabs toolbar</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+17\"/>\n <location line=\"+10\"/>\n <source>[testnet]</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+47\"/>\n <source>potatocoin client</source>\n <translation type=\"unfinished\"/>\n </message>\n <message numerus=\"yes\">\n <location line=\"+141\"/>\n <source>%n active connection(s) to potatocoin network</source>\n <translation type=\"unfinished\"><numerusform></numerusform><numerusform></numerusform></translation>\n </message>\n <message>\n <location line=\"+22\"/>\n <source>No block source available...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+12\"/>\n <source>Processed %1 of %2 (estimated) blocks of transaction history.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>Processed %1 blocks of transaction history.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message numerus=\"yes\">\n <location line=\"+20\"/>\n <source>%n hour(s)</source>\n <translation type=\"unfinished\"><numerusform></numerusform><numerusform></numerusform></translation>\n </message>\n <message numerus=\"yes\">\n <location line=\"+4\"/>\n <source>%n day(s)</source>\n <translation type=\"unfinished\"><numerusform></numerusform><numerusform></numerusform></translation>\n </message>\n <message numerus=\"yes\">\n <location line=\"+4\"/>\n <source>%n week(s)</source>\n <translation type=\"unfinished\"><numerusform></numerusform><numerusform></numerusform></translation>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>%1 behind</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+14\"/>\n <source>Last received block was generated %1 ago.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Transactions after this will not yet be visible.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+22\"/>\n <source>Error</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Warning</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Information</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+70\"/>\n <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-140\"/>\n <source>Up to date</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+31\"/>\n <source>Catching up...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+113\"/>\n <source>Confirm transaction fee</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+8\"/>\n <source>Sent transaction</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Incoming transaction</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Date: %1\nAmount: %2\nType: %3\nAddress: %4\n</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+33\"/>\n <location line=\"+23\"/>\n <source>URI handling</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-23\"/>\n <location line=\"+23\"/>\n <source>URI can not be parsed! This can be caused by an invalid potatocoin address or malformed URI parameters.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+17\"/>\n <source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+8\"/>\n <source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../bitcoin.cpp\" line=\"+111\"/>\n <source>A fatal error occurred. potatocoin can no longer continue safely and will quit.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>ClientModel</name>\n <message>\n <location filename=\"../clientmodel.cpp\" line=\"+104\"/>\n <source>Network Alert</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>EditAddressDialog</name>\n <message>\n <location filename=\"../forms/editaddressdialog.ui\" line=\"+14\"/>\n <source>Edit Address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+11\"/>\n <source>&Label</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <source>The label associated with this address book entry</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>&Address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <source>The address associated with this address book entry. This can only be modified for sending addresses.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../editaddressdialog.cpp\" line=\"+21\"/>\n <source>New receiving address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>New sending address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Edit receiving address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>Edit sending address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+76\"/>\n <source>The entered address "%1" is already in the address book.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-5\"/>\n <source>The entered address "%1" is not a valid potatocoin address.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <source>Could not unlock wallet.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>New key generation failed.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>GUIUtil::HelpMessageBox</name>\n <message>\n <location filename=\"../guiutil.cpp\" line=\"+424\"/>\n <location line=\"+12\"/>\n <source>potatocoin-Qt</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-12\"/>\n <source>version</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Usage:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>command-line options</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>UI options</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Set language, for example "de_DE" (default: system locale)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Start minimized</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Show splash screen on startup (default: 1)</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>OptionsDialog</name>\n <message>\n <location filename=\"../forms/optionsdialog.ui\" line=\"+14\"/>\n <source>Options</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+16\"/>\n <source>&Main</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+15\"/>\n <source>Pay transaction &fee</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+31\"/>\n <source>Automatically start potatocoin after logging in to the system.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>&Start potatocoin on system login</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+35\"/>\n <source>Reset all client options to default.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>&Reset Options</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+13\"/>\n <source>&Network</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>Automatically open the potatocoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Map port using &UPnP</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Connect to the potatocoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>&Connect through SOCKS proxy:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+9\"/>\n <source>Proxy &IP:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+19\"/>\n <source>IP address of the proxy (e.g. 127.0.0.1)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>&Port:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+19\"/>\n <source>Port of the proxy (e.g. 9050)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>SOCKS &Version:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+13\"/>\n <source>SOCKS version of the proxy (e.g. 5)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+36\"/>\n <source>&Window</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>Show only a tray icon after minimizing the window.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>&Minimize to the tray instead of the taskbar</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>M&inimize on close</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+21\"/>\n <source>&Display</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+8\"/>\n <source>User Interface &language:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+13\"/>\n <source>The user interface language can be set here. This setting will take effect after restarting potatocoin.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+11\"/>\n <source>&Unit to show amounts in:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+13\"/>\n <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+9\"/>\n <source>Whether to show potatocoin addresses in the transaction list or not.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>&Display addresses in transaction list</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+71\"/>\n <source>&OK</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>&Cancel</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <source>&Apply</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../optionsdialog.cpp\" line=\"+53\"/>\n <source>default</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+130\"/>\n <source>Confirm options reset</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Some settings may require a client restart to take effect.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Do you want to proceed?</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+42\"/>\n <location line=\"+9\"/>\n <source>Warning</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-9\"/>\n <location line=\"+9\"/>\n <source>This setting will take effect after restarting potatocoin.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+29\"/>\n <source>The supplied proxy address is invalid.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>OverviewPage</name>\n <message>\n <location filename=\"../forms/overviewpage.ui\" line=\"+14\"/>\n <source>Form</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+50\"/>\n <location line=\"+166\"/>\n <source>The displayed information may be out of date. Your wallet automatically synchronizes with the potatocoin network after a connection is established, but this process has not completed yet.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-124\"/>\n <source>Balance:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+29\"/>\n <source>Unconfirmed:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-78\"/>\n <source>Wallet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+107\"/>\n <source>Immature:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+13\"/>\n <source>Mined balance that has not yet matured</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+46\"/>\n <source><b>Recent transactions</b></source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-101\"/>\n <source>Your current balance</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+29\"/>\n <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../overviewpage.cpp\" line=\"+116\"/>\n <location line=\"+1\"/>\n <source>out of sync</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>PaymentServer</name>\n <message>\n <location filename=\"../paymentserver.cpp\" line=\"+107\"/>\n <source>Cannot start potatocoin: click-to-pay handler</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>QRCodeDialog</name>\n <message>\n <location filename=\"../forms/qrcodedialog.ui\" line=\"+14\"/>\n <source>QR Code Dialog</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+59\"/>\n <source>Request Payment</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+56\"/>\n <source>Amount:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-44\"/>\n <source>Label:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+19\"/>\n <source>Message:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+71\"/>\n <source>&Save As...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../qrcodedialog.cpp\" line=\"+62\"/>\n <source>Error encoding URI into QR Code.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+40\"/>\n <source>The entered amount is invalid, please check.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+23\"/>\n <source>Resulting URI too long, try to reduce the text for label / message.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+25\"/>\n <source>Save QR Code</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>PNG Images (*.png)</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>RPCConsole</name>\n <message>\n <location filename=\"../forms/rpcconsole.ui\" line=\"+46\"/>\n <source>Client name</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <location line=\"+23\"/>\n <location line=\"+26\"/>\n <location line=\"+23\"/>\n <location line=\"+23\"/>\n <location line=\"+36\"/>\n <location line=\"+53\"/>\n <location line=\"+23\"/>\n <location line=\"+23\"/>\n <location filename=\"../rpcconsole.cpp\" line=\"+339\"/>\n <source>N/A</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-217\"/>\n <source>Client version</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-45\"/>\n <source>&Information</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+68\"/>\n <source>Using OpenSSL version</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+49\"/>\n <source>Startup time</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+29\"/>\n <source>Network</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Number of connections</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+23\"/>\n <source>On testnet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+23\"/>\n <source>Block chain</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Current number of blocks</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+23\"/>\n <source>Estimated total blocks</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+23\"/>\n <source>Last block time</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+52\"/>\n <source>&Open</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+16\"/>\n <source>Command-line options</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Show the potatocoin-Qt help message to get a list with possible potatocoin command-line options.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>&Show</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+24\"/>\n <source>&Console</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-260\"/>\n <source>Build date</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-104\"/>\n <source>potatocoin - Debug window</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+25\"/>\n <source>potatocoin Core</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+279\"/>\n <source>Debug log file</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Open the potatocoin debug log file from the current data directory. This can take a few seconds for large log files.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+102\"/>\n <source>Clear console</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../rpcconsole.cpp\" line=\"-30\"/>\n <source>Welcome to the potatocoin RPC console.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Type <b>help</b> for an overview of available commands.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>SendCoinsDialog</name>\n <message>\n <location filename=\"../forms/sendcoinsdialog.ui\" line=\"+14\"/>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"+124\"/>\n <location line=\"+5\"/>\n <location line=\"+5\"/>\n <location line=\"+5\"/>\n <location line=\"+6\"/>\n <location line=\"+5\"/>\n <location line=\"+5\"/>\n <source>Send Coins</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+50\"/>\n <source>Send to multiple recipients at once</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Add &Recipient</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+20\"/>\n <source>Remove all transaction fields</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Clear &All</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+22\"/>\n <source>Balance:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <source>123.456 BTC</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+31\"/>\n <source>Confirm the send action</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>S&end</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../sendcoinsdialog.cpp\" line=\"-59\"/>\n <source><b>%1</b> to %2 (%3)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Confirm send coins</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Are you sure you want to send %1?</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source> and </source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+23\"/>\n <source>The recipient address is not valid, please recheck.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>The amount to pay must be larger than 0.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>The amount exceeds your balance.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>Duplicate address found, can only send to each address once per send operation.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Error: Transaction creation failed!</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>SendCoinsEntry</name>\n <message>\n <location filename=\"../forms/sendcoinsentry.ui\" line=\"+14\"/>\n <source>Form</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+15\"/>\n <source>A&mount:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+13\"/>\n <source>Pay &To:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+34\"/>\n <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+60\"/>\n <location filename=\"../sendcoinsentry.cpp\" line=\"+26\"/>\n <source>Enter a label for this address to add it to your address book</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-78\"/>\n <source>&Label:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+28\"/>\n <source>Choose address from address book</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <source>Alt+A</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Paste address from clipboard</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <source>Alt+P</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Remove this recipient</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../sendcoinsentry.cpp\" line=\"+1\"/>\n <source>Enter a potatocoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>SignVerifyMessageDialog</name>\n <message>\n <location filename=\"../forms/signverifymessagedialog.ui\" line=\"+14\"/>\n <source>Signatures - Sign / Verify a Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+13\"/>\n <source>&Sign Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+18\"/>\n <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <location line=\"+213\"/>\n <source>Choose an address from the address book</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-203\"/>\n <location line=\"+213\"/>\n <source>Alt+A</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-203\"/>\n <source>Paste address from clipboard</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <source>Alt+P</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+12\"/>\n <source>Enter the message you want to sign here</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Signature</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+27\"/>\n <source>Copy the current signature to the system clipboard</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+21\"/>\n <source>Sign the message to prove you own this potatocoin address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Sign &Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+14\"/>\n <source>Reset all sign message fields</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <location line=\"+146\"/>\n <source>Clear &All</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-87\"/>\n <source>&Verify Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+21\"/>\n <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+40\"/>\n <source>Verify the message to ensure it was signed with the specified potatocoin address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Verify &Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+14\"/>\n <source>Reset all verify message fields</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location filename=\"../signverifymessagedialog.cpp\" line=\"+27\"/>\n <location line=\"+3\"/>\n <source>Enter a potatocoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-2\"/>\n <source>Click "Sign Message" to generate signature</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Enter potatocoin signature</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+82\"/>\n <location line=\"+81\"/>\n <source>The entered address is invalid.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-81\"/>\n <location line=\"+8\"/>\n <location line=\"+73\"/>\n <location line=\"+8\"/>\n <source>Please check the address and try again.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-81\"/>\n <location line=\"+81\"/>\n <source>The entered address does not refer to a key.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-73\"/>\n <source>Wallet unlock was cancelled.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+8\"/>\n <source>Private key for the entered address is not available.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+12\"/>\n <source>Message signing failed.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Message signed.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+59\"/>\n <source>The signature could not be decoded.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <location line=\"+13\"/>\n <source>Please check the signature and try again.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>The signature did not match the message digest.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Message verification failed.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Message verified.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>SplashScreen</name>\n <message>\n <location filename=\"../splashscreen.cpp\" line=\"+22\"/>\n <source>The potatocoin developers</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>[testnet]</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>TransactionDesc</name>\n <message>\n <location filename=\"../transactiondesc.cpp\" line=\"+20\"/>\n <source>Open until %1</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>%1/offline</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>%1/unconfirmed</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>%1 confirmations</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+18\"/>\n <source>Status</source>\n <translation type=\"unfinished\"/>\n </message>\n <message numerus=\"yes\">\n <location line=\"+7\"/>\n <source>, broadcast through %n node(s)</source>\n <translation type=\"unfinished\"><numerusform></numerusform><numerusform></numerusform></translation>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>Date</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Source</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Generated</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <location line=\"+17\"/>\n <source>From</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <location line=\"+22\"/>\n <location line=\"+58\"/>\n <source>To</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-77\"/>\n <location line=\"+2\"/>\n <source>own address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-2\"/>\n <source>label</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+37\"/>\n <location line=\"+12\"/>\n <location line=\"+45\"/>\n <location line=\"+17\"/>\n <location line=\"+30\"/>\n <source>Credit</source>\n <translation type=\"unfinished\"/>\n </message>\n <message numerus=\"yes\">\n <location line=\"-102\"/>\n <source>matures in %n more block(s)</source>\n <translation type=\"unfinished\"><numerusform></numerusform><numerusform></numerusform></translation>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>not accepted</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+44\"/>\n <location line=\"+8\"/>\n <location line=\"+15\"/>\n <location line=\"+30\"/>\n <source>Debit</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-39\"/>\n <source>Transaction fee</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+16\"/>\n <source>Net amount</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>Message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Comment</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Transaction ID</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Debug information</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+8\"/>\n <source>Transaction</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Inputs</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+23\"/>\n <source>Amount</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>true</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>false</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-209\"/>\n <source>, has not been successfully broadcast yet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message numerus=\"yes\">\n <location line=\"-35\"/>\n <source>Open for %n more block(s)</source>\n <translation type=\"unfinished\"><numerusform></numerusform><numerusform></numerusform></translation>\n </message>\n <message>\n <location line=\"+70\"/>\n <source>unknown</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>TransactionDescDialog</name>\n <message>\n <location filename=\"../forms/transactiondescdialog.ui\" line=\"+14\"/>\n <source>Transaction details</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>This pane shows a detailed description of the transaction</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>TransactionTableModel</name>\n <message>\n <location filename=\"../transactiontablemodel.cpp\" line=\"+225\"/>\n <source>Date</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Type</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Amount</source>\n <translation type=\"unfinished\"/>\n </message>\n <message numerus=\"yes\">\n <location line=\"+57\"/>\n <source>Open for %n more block(s)</source>\n <translation type=\"unfinished\"><numerusform></numerusform><numerusform></numerusform></translation>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Open until %1</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Offline (%1 confirmations)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Unconfirmed (%1 of %2 confirmations)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Confirmed (%1 confirmations)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message numerus=\"yes\">\n <location line=\"+8\"/>\n <source>Mined balance will be available when it matures in %n more block(s)</source>\n <translation type=\"unfinished\"><numerusform></numerusform><numerusform></numerusform></translation>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>This block was not received by any other nodes and will probably not be accepted!</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Generated but not accepted</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+43\"/>\n <source>Received with</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Received from</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Sent to</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Payment to yourself</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Mined</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+38\"/>\n <source>(n/a)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+199\"/>\n <source>Transaction status. Hover over this field to show number of confirmations.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Date and time that the transaction was received.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Type of transaction.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Destination address of transaction.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Amount removed from or added to balance.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>TransactionView</name>\n <message>\n <location filename=\"../transactionview.cpp\" line=\"+52\"/>\n <location line=\"+16\"/>\n <source>All</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-15\"/>\n <source>Today</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>This week</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>This month</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Last month</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>This year</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Range...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+11\"/>\n <source>Received with</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Sent to</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>To yourself</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Mined</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Other</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Enter address or label to search</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Min amount</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+34\"/>\n <source>Copy address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Copy label</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Copy amount</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Copy transaction ID</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Edit label</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Show transaction details</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+139\"/>\n <source>Export Transaction Data</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Comma separated file (*.csv)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+8\"/>\n <source>Confirmed</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Date</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Type</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Label</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Amount</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>ID</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>Error exporting</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Could not write to file %1.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+100\"/>\n <source>Range:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+8\"/>\n <source>to</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>WalletModel</name>\n <message>\n <location filename=\"../walletmodel.cpp\" line=\"+193\"/>\n <source>Send Coins</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>WalletView</name>\n <message>\n <location filename=\"../walletview.cpp\" line=\"+42\"/>\n <source>&Export</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Export the data in the current tab to a file</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+193\"/>\n <source>Backup Wallet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>Wallet Data (*.dat)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Backup Failed</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>There was an error trying to save the wallet data to the new location.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>Backup Successful</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+0\"/>\n <source>The wallet data was successfully saved to the new location.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n<context>\n <name>bitcoin-core</name>\n <message>\n <location filename=\"../bitcoinstrings.cpp\" line=\"+94\"/>\n <source>potatocoin version</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+102\"/>\n <source>Usage:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-29\"/>\n <source>Send command to -server or potatocoind</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-23\"/>\n <source>List commands</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-12\"/>\n <source>Get help for a command</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+24\"/>\n <source>Options:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+24\"/>\n <source>Specify configuration file (default: potatocoin.conf)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Specify pid file (default: potatocoind.pid)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-1\"/>\n <source>Specify data directory</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-9\"/>\n <source>Set database cache size in megabytes (default: 25)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-28\"/>\n <source>Listen for connections on <port> (default: 41015 or testnet: 22220)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Maintain at most <n> connections to peers (default: 125)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-48\"/>\n <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+82\"/>\n <source>Specify your own public address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Threshold for disconnecting misbehaving peers (default: 100)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-134\"/>\n <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-29\"/>\n <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+27\"/>\n <source>Listen for JSON-RPC connections on <port> (default: 51015 or testnet: 22022)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+37\"/>\n <source>Accept command line and JSON-RPC commands</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+76\"/>\n <source>Run in the background as a daemon and accept commands</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+37\"/>\n <source>Use the test network</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-112\"/>\n <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-80\"/>\n <source>%s, you must set a rpcpassword in the configuration file:\n%s\nIt is recommended you use the following random password:\nrpcuser=potatocoinrpc\nrpcpassword=%s\n(you do not need to remember this password)\nThe username and password MUST NOT be the same.\nIf the file does not exist, create it with owner-readable-only file permissions.\nIt is also recommended to set alertnotify so you are notified of problems;\nfor example: alertnotify=echo %%s | mail -s "potatocoin Alert" admin@foo.com\n</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+17\"/>\n <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Cannot obtain a lock on data directory %s. potatocoin is probably already running.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+11\"/>\n <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Warning: Please check that your computer's date and time are correct! If your clock is wrong potatocoin will not work properly.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+14\"/>\n <source>Attempt to recover private keys from a corrupt wallet.dat</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Block creation options:</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Connect only to the specified node(s)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Corrupted block database detected</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Discover own IP address (default: 1 when listening and no -externalip)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Do you want to rebuild the block database now?</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Error initializing block database</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Error initializing wallet database environment %s!</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Error loading block database</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>Error opening block database</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Error: Disk space is low!</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Error: Wallet locked, unable to create transaction!</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Error: system error: </source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to read block info</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to read block</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to sync block index</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to write block index</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to write block info</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to write block</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to write file info</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to write to coin database</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to write transaction index</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Failed to write undo data</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Find peers using DNS lookup (default: 1 unless -connect)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Generate coins (default: 0)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>How many blocks to check at startup (default: 288, 0 = all)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>How thorough the block verification is (0-4, default: 3)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+19\"/>\n <source>Not enough file descriptors available.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+8\"/>\n <source>Rebuild block chain index from current blk000??.dat files</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+16\"/>\n <source>Set the number of threads to service RPC calls (default: 4)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+26\"/>\n <source>Verifying blocks...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Verifying wallet...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-69\"/>\n <source>Imports blocks from external blk000??.dat file</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-76\"/>\n <source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+77\"/>\n <source>Information</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Invalid -tor address: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Invalid amount for -mintxfee=<amount>: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+8\"/>\n <source>Maintain a full transaction index (default: 0)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Only accept block chain matching built-in checkpoints (default: 1)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Output extra debugging information. Implies all other -debug* options</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Output extra network debugging information</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Prepend debug output with timestamp</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>SSL options: (see the potatocoin Wiki for SSL setup instructions)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Select the version of socks proxy to use (4-5, default: 5)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Send trace/debug info to console instead of debug.log file</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Send trace/debug info to debugger</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+5\"/>\n <source>Set maximum block size in bytes (default: 250000)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Set minimum block size in bytes (default: 0)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Signing transaction failed</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Specify connection timeout in milliseconds (default: 5000)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>System error: </source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>Transaction amount too small</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Transaction amounts must be positive</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Transaction too large</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+7\"/>\n <source>Use UPnP to map the listening port (default: 0)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Use UPnP to map the listening port (default: 1 when listening)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Use proxy to reach tor hidden services (default: same as -proxy)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+2\"/>\n <source>Username for JSON-RPC connections</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+4\"/>\n <source>Warning</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Warning: This version is obsolete, upgrade required!</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>You need to rebuild the databases using -reindex to change -txindex</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>wallet.dat corrupt, salvage failed</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-50\"/>\n <source>Password for JSON-RPC connections</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-67\"/>\n <source>Allow JSON-RPC connections from specified IP address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+76\"/>\n <source>Send commands to node running on <ip> (default: 127.0.0.1)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-120\"/>\n <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+147\"/>\n <source>Upgrade wallet to latest format</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-21\"/>\n <source>Set key pool size to <n> (default: 100)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-12\"/>\n <source>Rescan the block chain for missing wallet transactions</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+35\"/>\n <source>Use OpenSSL (https) for JSON-RPC connections</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-26\"/>\n <source>Server certificate file (default: server.cert)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Server private key (default: server.pem)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-151\"/>\n <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+165\"/>\n <source>This help message</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+6\"/>\n <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-91\"/>\n <source>Connect through socks proxy</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-10\"/>\n <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+55\"/>\n <source>Loading addresses...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-35\"/>\n <source>Error loading wallet.dat: Wallet corrupted</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Error loading wallet.dat: Wallet requires newer version of potatocoin</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+93\"/>\n <source>Wallet needed to be rewritten: restart potatocoin to complete</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-95\"/>\n <source>Error loading wallet.dat</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+28\"/>\n <source>Invalid -proxy address: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+56\"/>\n <source>Unknown network specified in -onlynet: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-1\"/>\n <source>Unknown -socks proxy version requested: %i</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-96\"/>\n <source>Cannot resolve -bind address: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Cannot resolve -externalip address: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+44\"/>\n <source>Invalid amount for -paytxfee=<amount>: '%s'</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+1\"/>\n <source>Invalid amount</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-6\"/>\n <source>Insufficient funds</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+10\"/>\n <source>Loading block index...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-57\"/>\n <source>Add a node to connect to and attempt to keep the connection open</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-25\"/>\n <source>Unable to bind to %s on this computer. potatocoin is probably already running.</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+64\"/>\n <source>Fee per KB to add to transactions you send</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+19\"/>\n <source>Loading wallet...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-52\"/>\n <source>Cannot downgrade wallet</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+3\"/>\n <source>Cannot write default address</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+64\"/>\n <source>Rescanning...</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-57\"/>\n <source>Done loading</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"+82\"/>\n <source>To use the %s option</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-74\"/>\n <source>Error</source>\n <translation type=\"unfinished\"/>\n </message>\n <message>\n <location line=\"-31\"/>\n <source>You must set rpcpassword=<password> in the configuration file:\n%s\nIf the file does not exist, create it with owner-readable-only file permissions.</source>\n <translation type=\"unfinished\"/>\n </message>\n</context>\n</TS>", "meta": {"content_hash": "dd32067a22b152ba47a131d63ced2826", "timestamp": "", "source": "github", "line_count": 2922, "max_line_length": 395, "avg_line_length": 33.33709787816564, "alnum_prop": 0.5876954348071574, "repo_name": "Open-Source-Coins/potato", "id": "5f3b407354faef8bcf378698738c01f511366a3c", "size": "97428", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_fr_CA.ts", "mode": "33261", "license": "mit", "language": [{"name": "Batchfile", "bytes": "267"}, {"name": "C", "bytes": "700929"}, {"name": "C++", "bytes": "2598511"}, {"name": "CSS", "bytes": "1127"}, {"name": "Groff", "bytes": "18289"}, {"name": "HTML", "bytes": "50615"}, {"name": "Makefile", "bytes": "13478"}, {"name": "NSIS", "bytes": "5273"}, {"name": "Objective-C", "bytes": "858"}, {"name": "Objective-C++", "bytes": "5864"}, {"name": "Python", "bytes": "69726"}, {"name": "QMake", "bytes": "14840"}, {"name": "Shell", "bytes": "9701"}]}} +{"text": "\n#ifndef __FILTER_IMPL_HPP__\n#define __FILTER_IMPL_HPP__\n\n#include \"MediaElementImpl.hpp\"\n#include \"Filter.hpp\"\n#include <EventHandler.hpp>\n\nnamespace kurento\n{\n\nclass FilterImpl;\n\nvoid Serialize (std::shared_ptr<FilterImpl> &object,\n JsonSerializer &serializer);\n\nclass FilterImpl : public MediaElementImpl, public virtual Filter\n{\n\npublic:\n\n FilterImpl (const boost::property_tree::ptree &config,\n std::shared_ptr<MediaObjectImpl> parent);\n\n virtual ~FilterImpl () {};\n\n /* Next methods are automatically implemented by code generator */\n using MediaElementImpl::connect;\n virtual bool connect (const std::string &eventType,\n std::shared_ptr<EventHandler> handler) override;\n\n virtual void invoke (std::shared_ptr<MediaObjectImpl> obj,\n const std::string &methodName, const Json::Value ¶ms,\n Json::Value &response) override;\n\n virtual void Serialize (JsonSerializer &serializer) override;\n\nprivate:\n\n class StaticConstructor\n {\n public:\n StaticConstructor();\n };\n\n static StaticConstructor staticConstructor;\n\n};\n\n} /* kurento */\n\n#endif /* __FILTER_IMPL_HPP__ */\n", "meta": {"content_hash": "8844050fc92b2c41d05771ddfecaa850", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 80, "avg_line_length": 22.71153846153846, "alnum_prop": 0.676545300592718, "repo_name": "ESTOS/kms-core", "id": "1fdd02e642023c3f15f92432bb260b3097e6f13d", "size": "1798", "binary": false, "copies": "2", "ref": "refs/heads/estos6.2", "path": "src/server/implementation/objects/FilterImpl.hpp", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "1579013"}, {"name": "C++", "bytes": "269385"}, {"name": "CMake", "bytes": "73201"}, {"name": "Python", "bytes": "8726"}, {"name": "Shell", "bytes": "4714"}]}} +{"text": "package LeetCode;\r\n\r\nimport java.util.Arrays;\r\n\r\nimport LeetCode.BinaryTreeInorderTraversal.TreeNode;\r\n\r\npublic class ConstructBTfromInPostTraversal {\r\n public TreeNode buildTree(int[] inorder, int[] postorder) {\r\n if (inorder.length == 0)\r\n return null;\r\n if (inorder.length == 1)\r\n return new TreeNode(inorder[0]);\r\n\r\n // the last item in postorder is root\r\n TreeNode root = new TreeNode(postorder[postorder.length - 1]);\r\n\r\n int i = inorder.length - 1;\r\n for (; inorder[i] != root.val; i--)\r\n ;\r\n\r\n // inorder.length == postorder.length\r\n if (i < inorder.length - 1) {\r\n root.right = buildTree(\r\n Arrays.copyOfRange(inorder, i + 1, inorder.length),\r\n Arrays.copyOfRange(postorder, i, postorder.length - 1));\r\n }\r\n if (i > 0) {\r\n root.left = buildTree(Arrays.copyOfRange(inorder, 0, i),\r\n Arrays.copyOfRange(postorder, 0, i));\r\n }\r\n\r\n return root;\r\n }\r\n\r\n /**\r\n * @param args\r\n */\r\n public static void main(String[] args) {\r\n // TODO Auto-generated method stub\r\n\r\n }\r\n\r\n}\r\n", "meta": {"content_hash": "5729bb0553f5b75f0d8fde00a9cba282", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 76, "avg_line_length": 27.930232558139537, "alnum_prop": 0.537052456286428, "repo_name": "dingxwsimon/codingquestions", "id": "c8a16d98ab73c57c3c23de58462f13c5c8eecc5a", "size": "1201", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/LeetCode/ConstructBTfromInPostTraversal.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "1148288"}]}} +{"text": "<?php\n\nnamespace Application\\Migrations;\n\nuse Doctrine\\DBAL\\Migrations\\AbstractMigration,\n Doctrine\\DBAL\\Schema\\Schema;\n\n/**\n * Auto-generated Migration: Please modify to your need!\n */\nclass Version20120124153843 extends AbstractMigration\n{\n public function up(Schema $schema)\n {\n // this up() migration is autogenerated, please modify it to your needs\n $this->abortIf($this->connection->getDatabasePlatform()->getName() != \"mysql\");\n \n $this->addSql(\"ALTER TABLE blog ADD slug VARCHAR(255) NOT NULL\");\n }\n\n public function down(Schema $schema)\n {\n // this down() migration is autogenerated, please modify it to your needs\n $this->abortIf($this->connection->getDatabasePlatform()->getName() != \"mysql\");\n \n $this->addSql(\"ALTER TABLE blog DROP slug\");\n }\n}\n", "meta": {"content_hash": "57239e0ef26ff376c83b4ff628d9f812", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 87, "avg_line_length": 29.821428571428573, "alnum_prop": 0.6646706586826348, "repo_name": "miranetworks/symblog-test", "id": "eab73fa9b6ff7a5ddeadb3919e5d6a7a0c3ea6d6", "size": "835", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/DoctrineMigrations/Version20120124153843.php", "mode": "33261", "license": "mit", "language": [{"name": "C", "bytes": "400591"}, {"name": "Java", "bytes": "250852"}, {"name": "JavaScript", "bytes": "10962"}, {"name": "PHP", "bytes": "84735"}, {"name": "Shell", "bytes": "353127"}, {"name": "VimL", "bytes": "2119"}]}} +{"text": "\n\n// Based on Eclipse Paho.\n/*******************************************************************************\n * Copyright (c) 2014 IBM Corp.\n *\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * and Eclipse Distribution License v1.0 which accompany this distribution.\n *\n * The Eclipse Public License is available at\n * http://www.eclipse.org/legal/epl-v10.html\n * and the Eclipse Distribution License is available at\n * http://www.eclipse.org/org/documents/edl-v10.php.\n *\n * Contributors:\n * Ian Craggs - initial API and implementation and/or initial documentation\n * Sergio R. Caprile - non-blocking packet read functions for stream transport\n *******************************************************************************/\n\n/**\n * @file aws_iot_mqtt_client_common_internal.c\n * @brief MQTT client internal API definitions\n */\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <aws_iot_mqtt_client.h>\n#include \"aws_iot_mqtt_client_common_internal.h\"\n\n/* Max length of packet header */\n#define MAX_NO_OF_REMAINING_LENGTH_BYTES 4\n\n/**\n * Encodes the message length according to the MQTT algorithm\n * @param buf the buffer into which the encoded data is written\n * @param length the length to be encoded\n * @return the number of bytes written to buffer\n */\nsize_t aws_iot_mqtt_internal_write_len_to_buffer(unsigned char *buf, uint32_t length) {\n\tsize_t outLen = 0;\n\tunsigned char encodedByte;\n\n\tFUNC_ENTRY;\n\tdo {\n\t\tencodedByte = (unsigned char) (length % 128);\n\t\tlength /= 128;\n\t\t/* if there are more digits to encode, set the top bit of this digit */\n\t\tif(length > 0) {\n\t\t\tencodedByte |= 0x80;\n\t\t}\n\t\tbuf[outLen++] = encodedByte;\n\t} while(length > 0);\n\n\tFUNC_EXIT_RC(outLen);\n}\n\n/**\n * Decodes the message length according to the MQTT algorithm\n * @param the buffer containing the message\n * @param value the decoded length returned\n * @return the number of bytes read from the socket\n */\nIoT_Error_t aws_iot_mqtt_internal_decode_remaining_length_from_buffer(unsigned char *buf, uint32_t *decodedLen,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t uint32_t *readBytesLen) {\n\tunsigned char encodedByte;\n\tuint32_t multiplier, len;\n\tFUNC_ENTRY;\n\n\tmultiplier = 1;\n\tlen = 0;\n\t*decodedLen = 0;\n\n\tdo {\n\t\tif(++len > MAX_NO_OF_REMAINING_LENGTH_BYTES) {\n\t\t\t/* bad data */\n\t\t\tFUNC_EXIT_RC(MQTT_DECODE_REMAINING_LENGTH_ERROR);\n\t\t}\n\t\tencodedByte = *buf;\n\t\tbuf++;\n\t\t*decodedLen += (encodedByte & 127) * multiplier;\n\t\tmultiplier *= 128;\n\t} while((encodedByte & 128) != 0);\n\n\t*readBytesLen = len;\n\n\tFUNC_EXIT_RC(SUCCESS);\n}\n\nuint32_t aws_iot_mqtt_internal_get_final_packet_length_from_remaining_length(uint32_t rem_len) {\n\trem_len += 1; /* header byte */\n\t/* now remaining_length field (MQTT 3.1.1 - 2.2.3)*/\n\tif(rem_len < 128) {\n\t\trem_len += 1;\n\t} else if(rem_len < 16384) {\n\t\trem_len += 2;\n\t} else if(rem_len < 2097152) {\n\t\trem_len += 3;\n\t} else {\n\t\trem_len += 4;\n\t}\n\treturn rem_len;\n}\n\n/**\n * Calculates uint16 packet id from two bytes read from the input buffer\n * Checks Endianness at runtime\n *\n * @param pptr pointer to the input buffer - incremented by the number of bytes used & returned\n * @return the value calculated\n */\nuint16_t aws_iot_mqtt_internal_read_uint16_t(unsigned char **pptr) {\n\tunsigned char *ptr = *pptr;\n\tuint16_t len = 0;\n\tuint8_t firstByte = (uint8_t) (*ptr);\n\tuint8_t secondByte = (uint8_t) (*(ptr + 1));\n\tlen = (uint16_t) (secondByte + (256 * firstByte));\n\n\t*pptr += 2;\n\treturn len;\n}\n\n/**\n * Writes an integer as 2 bytes to an output buffer.\n * @param pptr pointer to the output buffer - incremented by the number of bytes used & returned\n * @param anInt the integer to write\n */\nvoid aws_iot_mqtt_internal_write_uint_16(unsigned char **pptr, uint16_t anInt) {\n\t**pptr = (unsigned char) (anInt / 256);\n\t(*pptr)++;\n\t**pptr = (unsigned char) (anInt % 256);\n\t(*pptr)++;\n}\n\n/**\n * Reads one character from the input buffer.\n * @param pptr pointer to the input buffer - incremented by the number of bytes used & returned\n * @return the character read\n */\nunsigned char aws_iot_mqtt_internal_read_char(unsigned char **pptr) {\n\tunsigned char c = **pptr;\n\t(*pptr)++;\n\treturn c;\n}\n\n/**\n * Writes one character to an output buffer.\n * @param pptr pointer to the output buffer - incremented by the number of bytes used & returned\n * @param c the character to write\n */\nvoid aws_iot_mqtt_internal_write_char(unsigned char **pptr, unsigned char c) {\n\t**pptr = c;\n\t(*pptr)++;\n}\n\nvoid aws_iot_mqtt_internal_write_utf8_string(unsigned char **pptr, const char *string, uint16_t stringLen) {\n\t/* Nothing that calls this function will have a stringLen with a size larger than 2 bytes (MQTT 3.1.1 - 1.5.3) */\n\taws_iot_mqtt_internal_write_uint_16(pptr, stringLen);\n\tif(stringLen > 0) {\n\t\tmemcpy(*pptr, string, stringLen);\n\t\t*pptr += stringLen;\n\t}\n}\n\n/**\n * Initialize the MQTTHeader structure. Used to ensure that Header bits are\n * always initialized using the proper mappings. No Endianness issues here since\n * the individual fields are all less than a byte. Also generates no warnings since\n * all fields are initialized using hex constants\n */\nIoT_Error_t aws_iot_mqtt_internal_init_header(MQTTHeader *pHeader, MessageTypes message_type,\n\t\t\t\t\t\t\t\t\t\t\t QoS qos, uint8_t dup, uint8_t retained) {\n\tFUNC_ENTRY;\n\n\tif(NULL == pHeader) {\n\t\tFUNC_EXIT_RC(NULL_VALUE_ERROR);\n\t}\n\n\t/* Set all bits to zero */\n\tpHeader->byte = 0;\n\tuint8_t type = 0;\n\tswitch(message_type) {\n\t\tcase UNKNOWN:\n\t\t\t/* Should never happen */\n\t\t\treturn FAILURE;\n\t\tcase CONNECT:\n\t\t\ttype = 0x01;\n\t\t\tbreak;\n\t\tcase CONNACK:\n\t\t\ttype = 0x02;\n\t\t\tbreak;\n\t\tcase PUBLISH:\n\t\t\ttype = 0x03;\n\t\t\tbreak;\n\t\tcase PUBACK:\n\t\t\ttype = 0x04;\n\t\t\tbreak;\n\t\tcase PUBREC:\n\t\t\ttype = 0x05;\n\t\t\tbreak;\n\t\tcase PUBREL:\n\t\t\ttype = 0x06;\n\t\t\tbreak;\n\t\tcase PUBCOMP:\n\t\t\ttype = 0x07;\n\t\t\tbreak;\n\t\tcase SUBSCRIBE:\n\t\t\ttype = 0x08;\n\t\t\tbreak;\n\t\tcase SUBACK:\n\t\t\ttype = 0x09;\n\t\t\tbreak;\n\t\tcase UNSUBSCRIBE:\n\t\t\ttype = 0x0A;\n\t\t\tbreak;\n\t\tcase UNSUBACK:\n\t\t\ttype = 0x0B;\n\t\t\tbreak;\n\t\tcase PINGREQ:\n\t\t\ttype = 0x0C;\n\t\t\tbreak;\n\t\tcase PINGRESP:\n\t\t\ttype = 0x0D;\n\t\t\tbreak;\n\t\tcase DISCONNECT:\n\t\t\ttype = 0x0E;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* Should never happen */\n\t\tFUNC_EXIT_RC(FAILURE);\n\t}\n\n\tpHeader->byte = type << 4;\n\tpHeader->byte |= dup << 3;\n\n\tswitch(qos) {\n\t\tcase QOS0:\n\t\t\tbreak;\n\t\tcase QOS1:\n\t\t\tpHeader->byte |= 1 << 1;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* Using QOS0 as default */\n\t\t\tbreak;\n\t}\n\n\tpHeader->byte |= (1 == retained) ? 0x01 : 0x00;\n\n\tFUNC_EXIT_RC(SUCCESS);\n}\n\nIoT_Error_t aws_iot_mqtt_internal_send_packet(AWS_IoT_Client *pClient, size_t length, Timer *pTimer) {\n\n\tsize_t sentLen, sent;\n\tIoT_Error_t rc;\n\n\tFUNC_ENTRY;\n\n\tif(NULL == pClient || NULL == pTimer) {\n\t\tFUNC_EXIT_RC(NULL_VALUE_ERROR);\n\t}\n\n\tif(length >= pClient->clientData.writeBufSize) {\n\t\tFUNC_EXIT_RC(MQTT_TX_BUFFER_TOO_SHORT_ERROR);\n\t}\n\n#ifdef _ENABLE_THREAD_SUPPORT_\n\trc = aws_iot_mqtt_client_lock_mutex(pClient, &(pClient->clientData.tls_write_mutex));\n\tif(SUCCESS != rc) {\n\t\tFUNC_EXIT_RC(rc);\n\t}\n#endif\n\n\tsentLen = 0;\n\tsent = 0;\n\n\twhile(sent < length && !has_timer_expired(pTimer)) {\n\t\trc = pClient->networkStack.write(&(pClient->networkStack),\n\t\t\t\t\t\t &pClient->clientData.writeBuf[sent],\n\t\t\t\t\t\t (length - sent),\n\t\t\t\t\t\t pTimer,\n\t\t\t\t\t\t &sentLen);\n\t\tif(SUCCESS != rc) {\n\t\t\t/* there was an error writing the data */\n\t\t\tbreak;\n\t\t}\n\t\tsent += sentLen;\n\t}\n\n#ifdef _ENABLE_THREAD_SUPPORT_\n\trc = aws_iot_mqtt_client_unlock_mutex(pClient, &(pClient->clientData.tls_write_mutex));\n\tif(SUCCESS != rc) {\n\t\tFUNC_EXIT_RC(rc);\n\t}\n#endif\n\n\tif(sent == length) {\n\t\t/* record the fact that we have successfully sent the packet */\n\t\t//countdown_sec(&c->pingTimer, c->clientData.keepAliveInterval);\n\t\tFUNC_EXIT_RC(SUCCESS);\n\t}\n\n\tFUNC_EXIT_RC(rc);\n}\n\nstatic IoT_Error_t _aws_iot_mqtt_internal_readWrapper( AWS_IoT_Client *pClient, size_t offset, size_t size, Timer *pTimer, size_t * read_len ) {\n IoT_Error_t rc;\n int byteToRead;\n size_t byteRead = 0;\n\n byteToRead = ( offset + size ) - pClient->clientData.readBufIndex;\n\n if ( byteToRead > 0 )\n {\n rc = pClient->networkStack.read( &( pClient->networkStack ),\n pClient->clientData.readBuf + pClient->clientData.readBufIndex,\n (size_t)byteToRead,\n pTimer,\n &byteRead );\n pClient->clientData.readBufIndex += byteRead;\n\n /* refresh byte to read */\n byteToRead = ( offset + size ) - ((int)pClient->clientData.readBufIndex);\n *read_len = size - (size_t)byteToRead;\n }\n else\n {\n *read_len = size;\n rc = SUCCESS;\n }\n\n \n\n return rc;\n}\nstatic IoT_Error_t _aws_iot_mqtt_internal_decode_packet_remaining_len(AWS_IoT_Client *pClient, size_t * offset,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t size_t *rem_len, Timer *pTimer) {\n\tsize_t multiplier, len;\n\tIoT_Error_t rc;\n size_t read_len;\n\n\tFUNC_ENTRY;\n\n\tmultiplier = 1;\n\tlen = 0;\n\t*rem_len = 0;\n\n\tdo {\n\t\tif(++len > MAX_NO_OF_REMAINING_LENGTH_BYTES) {\n\t\t\t/* bad data */\n\t\t\tFUNC_EXIT_RC(MQTT_DECODE_REMAINING_LENGTH_ERROR);\n\t\t}\n rc = _aws_iot_mqtt_internal_readWrapper( pClient, len, 1, pTimer, &read_len );\n\n\t\tif(SUCCESS != rc) {\n\t\t\tFUNC_EXIT_RC(rc);\n\t\t}\n\n\t\t*rem_len += (( pClient->clientData.readBuf[len] & 127) * multiplier);\n\t\tmultiplier *= 128;\n\t} while(( pClient->clientData.readBuf[len] & 128) != 0);\n *offset = len + 1;\n\tFUNC_EXIT_RC(rc);\n}\n\nstatic IoT_Error_t _aws_iot_mqtt_internal_read_packet(AWS_IoT_Client *pClient, Timer *pTimer, uint8_t *pPacketType) {\n\tsize_t rem_len, total_bytes_read, bytes_to_be_read, read_len;\n\tIoT_Error_t rc;\n size_t offset = 0;\n\tMQTTHeader header = {0};\n\tTimer packetTimer;\n\tinit_timer(&packetTimer);\n\tcountdown_ms(&packetTimer, pClient->clientData.packetTimeoutMs);\n\n\trem_len = 0;\n\ttotal_bytes_read = 0;\n\tbytes_to_be_read = 0;\n\tread_len = 0;\n\n rc = _aws_iot_mqtt_internal_readWrapper( pClient, offset, 1, pTimer, &read_len );\n\t/* 1. read the header byte. This has the packet type in it */\n\tif(NETWORK_SSL_NOTHING_TO_READ == rc) {\n\t\treturn MQTT_NOTHING_TO_READ;\n\t} else if(SUCCESS != rc) {\n\t\treturn rc;\n\t}\n\n\t/* 2. read the remaining length. This is variable in itself */\n\trc = _aws_iot_mqtt_internal_decode_packet_remaining_len(pClient, &offset, &rem_len, pTimer);\n\tif(SUCCESS != rc) {\n\t\treturn rc;\n\t} \n \n\t/* if the buffer is too short then the message will be dropped silently */\n\tif((rem_len + offset) >= pClient->clientData.readBufSize) {\n\t\tbytes_to_be_read = pClient->clientData.readBufSize;\n\t\tdo {\n\t\t\trc = pClient->networkStack.read(&(pClient->networkStack), pClient->clientData.readBuf, bytes_to_be_read,\n\t\t\t\t\t\t\t\t\t\t\tpTimer, &read_len);\n\t\t\tif(SUCCESS == rc) {\n\t\t\t\ttotal_bytes_read += read_len;\n\t\t\t\tif((rem_len - total_bytes_read) >= pClient->clientData.readBufSize) {\n\t\t\t\t\tbytes_to_be_read = pClient->clientData.readBufSize;\n\t\t\t\t} else {\n\t\t\t\t\tbytes_to_be_read = rem_len - total_bytes_read;\n\t\t\t\t}\n\t\t\t}\n\t\t} while(total_bytes_read < rem_len && SUCCESS == rc);\n\n /* Check buffer was correctly emptied, otherwise, return error message. */\n if ( total_bytes_read == rem_len )\n {\n aws_iot_mqtt_internal_flushBuffers( pClient );\n return MQTT_RX_BUFFER_TOO_SHORT_ERROR;\n }\n else\n {\n return rc;\n }\n\t}\n\n\t/* 3. read the rest of the buffer using a callback to supply the rest of the data */\n\tif(rem_len > 0) {\n rc = _aws_iot_mqtt_internal_readWrapper( pClient, offset, rem_len, pTimer, &read_len );\n\t\tif(SUCCESS != rc || read_len != rem_len) {\n\t\t\treturn FAILURE;\n\t\t}\n\t}\n\n /* Pack has been received, we can flush the buffers for next call. */\n aws_iot_mqtt_internal_flushBuffers( pClient );\n\theader.byte = pClient->clientData.readBuf[0];\n\t*pPacketType = MQTT_HEADER_FIELD_TYPE(header.byte);\n\n\tFUNC_EXIT_RC(rc);\n}\n\n// assume topic filter and name is in correct format\n// # can only be at end\n// + and # can only be next to separator\nstatic bool _aws_iot_mqtt_internal_is_topic_matched(char *pTopicFilter, char *pTopicName, uint16_t topicNameLen) {\n\n\tchar *curf, *curn, *curn_end;\n\n\tif(NULL == pTopicFilter || NULL == pTopicName) {\n\t\treturn false;\n\t}\n\n\tcurf = pTopicFilter;\n\tcurn = pTopicName;\n\tcurn_end = curn + topicNameLen;\n\n\twhile(*curf && (curn < curn_end)) {\n\t\tif(*curn == '/' && *curf != '/') {\n\t\t\tbreak;\n\t\t}\n\t\tif(*curf != '+' && *curf != '#' && *curf != *curn) {\n\t\t\tbreak;\n\t\t}\n\t\tif(*curf == '+') {\n\t\t\t/* skip until we meet the next separator, or end of string */\n\t\t\tchar *nextpos = curn + 1;\n\t\t\twhile(nextpos < curn_end && *nextpos != '/')\n\t\t\t\tnextpos = ++curn + 1;\n\t\t} else if(*curf == '#') {\n\t\t\t/* skip until end of string */\n\t\t\tcurn = curn_end - 1;\n\t\t}\n\n\t\tcurf++;\n\t\tcurn++;\n\t};\n\n\treturn (curn == curn_end) && (*curf == '\\0');\n}\n\nstatic IoT_Error_t _aws_iot_mqtt_internal_deliver_message(AWS_IoT_Client *pClient, char *pTopicName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t uint16_t topicNameLen,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t IoT_Publish_Message_Params *pMessageParams) {\n\tuint32_t itr;\n\tIoT_Error_t rc;\n\tClientState clientState;\n\n\tFUNC_ENTRY;\n\n\tif(NULL == pTopicName) {\n\t\tFUNC_EXIT_RC(NULL_VALUE_ERROR);\n\t}\n\n\t/* This function can be called from all MQTT APIs\n\t * But while callback return is in progress, Yield should not be called.\n\t * The state for CB_RETURN accomplishes that, as yield cannot be called while in that state */\n\tclientState = aws_iot_mqtt_get_client_state(pClient);\n\taws_iot_mqtt_set_client_state(pClient, clientState, CLIENT_STATE_CONNECTED_WAIT_FOR_CB_RETURN);\n\n\t/* Find the right message handler - indexed by topic */\n\tfor(itr = 0; itr < AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS; ++itr) {\n\t\tif(NULL != pClient->clientData.messageHandlers[itr].topicName) {\n\t\t\tif(((topicNameLen == pClient->clientData.messageHandlers[itr].topicNameLen)\n\t\t\t\t&&\n\t\t\t\t(strncmp(pTopicName, (char *) pClient->clientData.messageHandlers[itr].topicName, topicNameLen) == 0))\n\t\t\t || _aws_iot_mqtt_internal_is_topic_matched((char *) pClient->clientData.messageHandlers[itr].topicName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t pTopicName, topicNameLen)) {\n\t\t\t\tif(NULL != pClient->clientData.messageHandlers[itr].pApplicationHandler) {\n\t\t\t\t\tpClient->clientData.messageHandlers[itr].pApplicationHandler(pClient, pTopicName, topicNameLen,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t pMessageParams,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t pClient->clientData.messageHandlers[itr].pApplicationHandlerData);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\trc = aws_iot_mqtt_set_client_state(pClient, CLIENT_STATE_CONNECTED_WAIT_FOR_CB_RETURN, clientState);\n\n\tFUNC_EXIT_RC(rc);\n}\n\nstatic IoT_Error_t _aws_iot_mqtt_internal_handle_publish(AWS_IoT_Client *pClient, Timer *pTimer) {\n\tchar *topicName;\n\tuint16_t topicNameLen;\n\tuint32_t len;\n\tIoT_Error_t rc;\n\tIoT_Publish_Message_Params msg;\n\n\tFUNC_ENTRY;\n\n\ttopicName = NULL;\n\ttopicNameLen = 0;\n\tlen = 0;\n\n\trc = aws_iot_mqtt_internal_deserialize_publish(&msg.isDup, &msg.qos, &msg.isRetained,\n\t\t\t\t\t\t\t\t\t\t\t\t &msg.id, &topicName, &topicNameLen,\n\t\t\t\t\t\t\t\t\t\t\t\t (unsigned char **) &msg.payload, &msg.payloadLen,\n\t\t\t\t\t\t\t\t\t\t\t\t pClient->clientData.readBuf,\n\t\t\t\t\t\t\t\t\t\t\t\t pClient->clientData.readBufSize);\n\n\tif(SUCCESS != rc) {\n\t\tFUNC_EXIT_RC(rc);\n\t}\n\n\trc = _aws_iot_mqtt_internal_deliver_message(pClient, topicName, topicNameLen, &msg);\n\tif(SUCCESS != rc) {\n\t\tFUNC_EXIT_RC(rc);\n\t}\n\n\tif(QOS0 == msg.qos) {\n\t\t/* No further processing required for QoS0 */\n\t\tFUNC_EXIT_RC(SUCCESS);\n\t}\n\n\t/* Message assumed to be QoS1 since we do not support QoS2 at this time */\n\trc = aws_iot_mqtt_internal_serialize_ack(pClient->clientData.writeBuf, pClient->clientData.writeBufSize,\n\t\t\t\t\t\t\t\t\t\t\t PUBACK, 0, msg.id, &len);\n\n\tif(SUCCESS != rc) {\n\t\tFUNC_EXIT_RC(rc);\n\t}\n\n\trc = aws_iot_mqtt_internal_send_packet(pClient, len, pTimer);\n\tif(SUCCESS != rc) {\n\t\tFUNC_EXIT_RC(rc);\n\t}\n\n\tFUNC_EXIT_RC(SUCCESS);\n}\n\nIoT_Error_t aws_iot_mqtt_internal_cycle_read(AWS_IoT_Client *pClient, Timer *pTimer, uint8_t *pPacketType) {\n\tIoT_Error_t rc;\n\n#ifdef _ENABLE_THREAD_SUPPORT_\n\tIoT_Error_t threadRc;\n#endif\n\n\tif(NULL == pClient || NULL == pTimer) {\n\t\treturn NULL_VALUE_ERROR;\n\t}\n\n#ifdef _ENABLE_THREAD_SUPPORT_\n\tthreadRc = aws_iot_mqtt_client_lock_mutex(pClient, &(pClient->clientData.tls_read_mutex));\n\tif(SUCCESS != threadRc) {\n\t\tFUNC_EXIT_RC(threadRc);\n\t}\n#endif\n\n\t/* read the socket, see what work is due */\n\trc = _aws_iot_mqtt_internal_read_packet(pClient, pTimer, pPacketType);\n\n#ifdef _ENABLE_THREAD_SUPPORT_\n\tthreadRc = aws_iot_mqtt_client_unlock_mutex(pClient, &(pClient->clientData.tls_read_mutex));\n\tif(SUCCESS != threadRc && (MQTT_NOTHING_TO_READ == rc || SUCCESS == rc)) {\n\t\treturn threadRc;\n\t}\n#endif\n\n\tif(MQTT_NOTHING_TO_READ == rc) {\n\t\t/* Nothing to read, not a cycle failure */\n\t\treturn SUCCESS;\n\t} else if(SUCCESS != rc) {\n\t\treturn rc;\n\t}\n\n\tswitch(*pPacketType) {\n\t\tcase CONNACK:\n\t\tcase PUBACK:\n\t\tcase SUBACK:\n\t\tcase UNSUBACK:\n\t\t\t/* SDK is blocking, these responses will be forwarded to calling function to process */\n\t\t\tbreak;\n\t\tcase PUBLISH: {\n\t\t\trc = _aws_iot_mqtt_internal_handle_publish(pClient, pTimer);\n\t\t\tbreak;\n\t\t}\n\t\tcase PUBREC:\n\t\tcase PUBCOMP:\n\t\t\t/* QoS2 not supported at this time */\n\t\t\tbreak;\n\t\tcase PINGRESP: {\n\t\t\tpClient->clientStatus.isPingOutstanding = 0;\n\t\t\tcountdown_sec(&pClient->pingTimer, pClient->clientData.keepAliveInterval);\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\t/* Either unknown packet type or Failure occurred\n * Should not happen */\n\t\t\trc = MQTT_RX_MESSAGE_PACKET_TYPE_INVALID_ERROR;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn rc;\n}\n\nIoT_Error_t aws_iot_mqtt_internal_flushBuffers( AWS_IoT_Client *pClient ) {\n pClient->clientData.readBufIndex = 0;\n return SUCCESS;\n}\n\n/* only used in single-threaded mode where one command at a time is in process */\nIoT_Error_t aws_iot_mqtt_internal_wait_for_read(AWS_IoT_Client *pClient, uint8_t packetType, Timer *pTimer) {\n\tIoT_Error_t rc;\n\tuint8_t read_packet_type;\n\n\tFUNC_ENTRY;\n\tif(NULL == pClient || NULL == pTimer) {\n\t\tFUNC_EXIT_RC(NULL_VALUE_ERROR);\n\t}\n\n\tread_packet_type = 0;\n\tdo {\n\t\tif(has_timer_expired(pTimer)) {\n\t\t\t/* we timed out */\n\t\t\trc = MQTT_REQUEST_TIMEOUT_ERROR;\n\t\t\tbreak;\n\t\t}\n\t\trc = aws_iot_mqtt_internal_cycle_read(pClient, pTimer, &read_packet_type);\n\t} while(((SUCCESS == rc) || (MQTT_NOTHING_TO_READ == rc)) && (read_packet_type != packetType));\n\n\t/* If rc is SUCCESS, we have received the expected\n\t * MQTT packet. Otherwise rc tells the error. */\n\tFUNC_EXIT_RC(rc);\n}\n\n/**\n * Serializes a 0-length packet into the supplied buffer, ready for writing to a socket\n * @param buf the buffer into which the packet will be serialized\n * @param buflen the length in bytes of the supplied buffer, to avoid overruns\n * @param packettype the message type\n * @param serialized length\n * @return IoT_Error_t indicating function execution status\n */\nIoT_Error_t aws_iot_mqtt_internal_serialize_zero(unsigned char *pTxBuf, size_t txBufLen, MessageTypes packetType,\n\t\t\t\t\t\t\t\t\t\t\t\t size_t *pSerializedLength) {\n\tunsigned char *ptr;\n\tIoT_Error_t rc;\n\tMQTTHeader header = {0};\n\n\tFUNC_ENTRY;\n\tif(NULL == pTxBuf || NULL == pSerializedLength) {\n\t\tFUNC_EXIT_RC(NULL_VALUE_ERROR);\n\t}\n\n\t/* Buffer should have at least 2 bytes for the header */\n\tif(4 > txBufLen) {\n\t\tFUNC_EXIT_RC(MQTT_TX_BUFFER_TOO_SHORT_ERROR);\n\t}\n\n\tptr = pTxBuf;\n\n\trc = aws_iot_mqtt_internal_init_header(&header, packetType, QOS0, 0, 0);\n\tif(SUCCESS != rc) {\n\t\tFUNC_EXIT_RC(rc);\n\t}\n\n\t/* write header */\n\taws_iot_mqtt_internal_write_char(&ptr, header.byte);\n\n\t/* write remaining length */\n\tptr += aws_iot_mqtt_internal_write_len_to_buffer(ptr, 0);\n\t*pSerializedLength = (uint32_t) (ptr - pTxBuf);\n\n\tFUNC_EXIT_RC(SUCCESS);\n}\n\n#ifdef __cplusplus\n}\n#endif\n", "meta": {"content_hash": "28f79ff7b36a8928fdfe68902c3b34fa", "timestamp": "", "source": "github", "line_count": 707, "max_line_length": 144, "avg_line_length": 27.342291371994342, "alnum_prop": 0.654027210180539, "repo_name": "bouffalolab/bl_iot_sdk_matter", "id": "6251dcfcd27bb819b26ca3bf448bf47d74017d94", "size": "19901", "binary": false, "copies": "1", "ref": "refs/heads/release_spiwifi_bl602", "path": "components/3rdparty/aws-iot/aws-iot-device-sdk-embedded-C/src/aws_iot_mqtt_client_common_internal.c", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "46671"}, {"name": "Batchfile", "bytes": "1603"}, {"name": "C", "bytes": "24837905"}, {"name": "C++", "bytes": "14471862"}, {"name": "CMake", "bytes": "124252"}, {"name": "HTML", "bytes": "24826"}, {"name": "Makefile", "bytes": "114632"}, {"name": "Perl", "bytes": "2589"}, {"name": "Python", "bytes": "273291"}, {"name": "Roff", "bytes": "3255873"}, {"name": "Shell", "bytes": "27722"}, {"name": "XC", "bytes": "18410"}]}} +{"text": "<?php\n\nrequire __DIR__ . '/../src/ControlClient.php';\nrequire __DIR__ . '/../src/TorCurlWrapper.php';\n\n// list of country codes to use\n$countries = array('US', 'FR', 'RU', 'GB', 'CA');\n\n// get new control client for connecting to Tor's control port\n$tc = new Dapphp\\TorUtils\\ControlClient();\n\n$tc->connect(); // connect\n$tc->authenticate('password'); // authenticate\n\nforeach($countries as $country) {\n $country = '{' . $country . '}'; // e.g. {US}\n\n $tc->setConf(array('ExitNodes' => $country)); // set config to use exit node from country\n\n // get new curl wrapped through Tor SOCKS5 proxy\n $curl = new Dapphp\\TorUtils\\TorCurlWrapper();\n $curl->setopt(CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox 41.0');\n\n // make request - should go through exit node from specified country\n if ($curl->httpGet('http://whatismycountry.com')) {\n echo $curl->getResponseBody();\n }\n}\n", "meta": {"content_hash": "24295db58ae14e3b45b1944a35aa3684", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 117, "avg_line_length": 33.785714285714285, "alnum_prop": 0.6479915433403806, "repo_name": "dapphp/TorUtils", "id": "a12680e17ca64b2fb015a1c9d91ddbf8fac242ab", "size": "946", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/CurlCountry.php", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "PHP", "bytes": "226858"}]}} +{"text": "using namespace fs;\n\nTEST_SUITE(recursive_directory_iterator_depth_tests)\n\nTEST_CASE(test_depth)\n{\n const path testDir = StaticEnv::Dir;\n const path DirDepth1 = StaticEnv::Dir2;\n const path DirDepth2 = StaticEnv::Dir3;\n const recursive_directory_iterator endIt{};\n\n std::error_code ec;\n recursive_directory_iterator it(testDir, ec);\n TEST_REQUIRE(!ec);\n TEST_CHECK(it.depth() == 0);\n\n bool seen_d1, seen_d2;\n seen_d1 = seen_d2 = false;\n\n while (it != endIt) {\n const path entry = *it;\n const path parent = entry.parent_path();\n if (parent == testDir) {\n TEST_CHECK(it.depth() == 0);\n } else if (parent == DirDepth1) {\n TEST_CHECK(it.depth() == 1);\n seen_d1 = true;\n } else if (parent == DirDepth2) {\n TEST_CHECK(it.depth() == 2);\n seen_d2 = true;\n } else {\n TEST_CHECK(!\"Unexpected depth while iterating over static env\");\n }\n ++it;\n }\n TEST_REQUIRE(seen_d1 && seen_d2);\n TEST_CHECK(it == endIt);\n}\n\nTEST_SUITE_END()\n", "meta": {"content_hash": "8b4629d2b3e4e3d3b71a7a534b2b8f63", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 76, "avg_line_length": 27.025, "alnum_prop": 0.5661424606845513, "repo_name": "youtube/cobalt_sandbox", "id": "9b239c6bf441cf6f712e10eaa000349ba723e397", "size": "1732", "binary": false, "copies": "4", "ref": "refs/heads/main", "path": "third_party/llvm-project/libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/depth.pass.cpp", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "describe ManageIQ::Providers::AnsibleRoleWorkflow do\n let(:job) { described_class.create_job(*options).tap { |job| job.state = state } }\n let(:role_options) { {:role_name => 'role_name', :roles_path => 'path/role', :role_skip_facts => true } }\n let(:options) { [{\"ENV\" => \"VAR\"}, {\"arg1\" => \"val1\"}, role_options, {:verbosity => 4}] }\n let(:state) { \"waiting_to_start\" }\n\n context \".create_job\" do\n it \"leaves job waiting to start\" do\n expect(job.state).to eq(\"waiting_to_start\")\n end\n end\n\n context \".signal\" do\n %w[start pre_execute execute poll_runner post_execute finish abort_job cancel error].each do |signal|\n shared_examples_for \"allows #{signal} signal\" do\n it signal.to_s do\n expect(job).to receive(signal.to_sym)\n job.signal(signal.to_sym)\n end\n end\n end\n\n %w[start pre_execute execute poll_runner post_execute].each do |signal|\n shared_examples_for \"doesn't allow #{signal} signal\" do\n it signal.to_s do\n expect { job.signal(signal.to_sym) }.to raise_error(RuntimeError, /#{signal} is not permitted at state #{job.state}/)\n end\n end\n end\n\n context \"waiting_to_start\" do\n let(:state) { \"waiting_to_start\" }\n\n it_behaves_like \"allows start signal\"\n it_behaves_like \"allows finish signal\"\n it_behaves_like \"allows abort_job signal\"\n it_behaves_like \"allows cancel signal\"\n it_behaves_like \"allows error signal\"\n\n it_behaves_like \"doesn't allow execute signal\"\n it_behaves_like \"doesn't allow poll_runner signal\"\n it_behaves_like \"doesn't allow post_execute signal\"\n end\n\n context \"per_role\" do\n let(:state) { \"pre_execute\" }\n\n it_behaves_like \"allows execute signal\"\n it_behaves_like \"allows finish signal\"\n it_behaves_like \"allows abort_job signal\"\n it_behaves_like \"allows cancel signal\"\n it_behaves_like \"allows error signal\"\n\n it_behaves_like \"doesn't allow start signal\"\n it_behaves_like \"doesn't allow poll_runner signal\"\n it_behaves_like \"doesn't allow post_execute signal\"\n end\n\n context \"running\" do\n let(:state) { \"running\" }\n\n it_behaves_like \"allows poll_runner signal\"\n it_behaves_like \"allows finish signal\"\n it_behaves_like \"allows abort_job signal\"\n it_behaves_like \"allows cancel signal\"\n it_behaves_like \"allows error signal\"\n\n it_behaves_like \"doesn't allow start signal\"\n it_behaves_like \"doesn't allow pre_execute signal\"\n end\n\n context \"post_execute\" do\n let(:state) { \"post_execute\" }\n\n it_behaves_like \"allows finish signal\"\n it_behaves_like \"allows abort_job signal\"\n it_behaves_like \"allows cancel signal\"\n it_behaves_like \"allows error signal\"\n\n it_behaves_like \"doesn't allow start signal\"\n it_behaves_like \"doesn't allow pre_execute signal\"\n it_behaves_like \"doesn't allow execute signal\"\n it_behaves_like \"doesn't allow poll_runner signal\"\n it_behaves_like \"doesn't allow post_execute signal\"\n end\n end\n\n context \".execute\" do\n let(:state) { \"pre_execute\" }\n let(:response_async) { Ansible::Runner::ResponseAsync.new(:base_dir => \"/path/to/results\") }\n\n it \"ansible-runner succeeds\" do\n response_async = Ansible::Runner::ResponseAsync.new(:base_dir => \"/path/to/results\")\n runner_options = [\n {\"ENV\" => \"VAR\"},\n {\"arg1\" => \"val1\"},\n \"role_name\",\n {\n :roles_path => \"path/role\",\n :role_skip_facts => true\n }\n ]\n\n expect(Ansible::Runner).to receive(:run_role_async).with(*runner_options).and_return(response_async)\n expect(job).to receive(:queue_signal).with(:poll_runner)\n\n job.signal(:execute)\n\n expect(job.context[:ansible_runner_response]).to eq(response_async.dump)\n end\n\n it \"ansible-runner fails\" do\n expect(Ansible::Runner).to receive(:run_role_async).and_return(nil)\n expect(job).to receive(:queue_signal).with(:abort, \"Failed to run ansible role\", \"error\")\n\n job.signal(:execute)\n end\n end\n\n context \"#current_job_timeout\" do\n it \"sets the job current timeout\" do\n expect(job.current_job_timeout).to eq(1.hour)\n end\n end\n\n context \".poll_runner\" do\n let(:state) { \"running\" }\n let(:response_async) { Ansible::Runner::ResponseAsync.new(:base_dir => \"/path/to/results\") }\n\n before do\n allow(Ansible::Runner::ResponseAsync).to receive(:new).and_return(response_async)\n\n job.context[:ansible_runner_response] = response_async.dump\n job.started_on = Time.now.utc\n job.save!\n end\n\n it \"ansible-runner completed\" do\n expect(response_async).to receive(:running?).and_return(false)\n\n response = Ansible::Runner::Response.new(response_async.dump.merge(:return_code => 0))\n expect(response_async).to receive(:response).and_return(response)\n expect(job).to receive(:queue_signal).with(:post_execute)\n\n job.signal(:poll_runner)\n end\n\n it \"ansible-runner still running\" do\n now = Time.now.utc\n allow(Time).to receive(:now).and_return(now)\n expect(response_async).to receive(:running?).and_return(true)\n expect(job).to receive(:queue_signal).with(:poll_runner, :deliver_on => now + 1.second)\n\n job.signal(:poll_runner)\n end\n\n it \"fails if the role has been running too long\" do\n time = job.started_on + job.options[:timeout] + 5.minutes\n\n Timecop.travel(time) do\n expect(response_async).to receive(:running?).and_return(true)\n expect(response_async).to receive(:stop)\n expect(job).to receive(:queue_signal).with(:abort, \"ansible role has been running longer than timeout\", \"error\")\n\n job.signal(:poll_runner)\n end\n end\n\n context \".deliver_on\" do\n let(:options) { [{\"ENV\" => \"VAR\"}, {\"arg1\" => \"val1\"}, {:roles_path => \"/path/to/role\"}, :poll_interval => 5.minutes] }\n\n it \"uses the option to queue poll_runner\" do\n now = Time.now.utc\n allow(Time).to receive(:now).and_return(now)\n expect(response_async).to receive(:running?).and_return(true)\n expect(job).to receive(:queue_signal).with(:poll_runner, :deliver_on => now + 5.minutes)\n\n job.signal(:poll_runner)\n end\n end\n end\nend\n", "meta": {"content_hash": "8b481f1ba064f655a2a5900901dada8b", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 127, "avg_line_length": 34.57692307692308, "alnum_prop": 0.6367392340696011, "repo_name": "branic/manageiq", "id": "6a5e182fd1769019477da73356775b076f8b1d6c", "size": "6293", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/models/manageiq/providers/ansible_role_workflow_spec.rb", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "3042"}, {"name": "Dockerfile", "bytes": "2925"}, {"name": "HTML", "bytes": "2167"}, {"name": "JavaScript", "bytes": "183"}, {"name": "Ruby", "bytes": "7674578"}, {"name": "Shell", "bytes": "22469"}]}} +{"text": "\npackage com.google.javascript.jscomp;\n\nimport static com.google.javascript.jscomp.AstFactory.type;\nimport static com.google.javascript.jscomp.Es6ToEs3Util.cannotConvertYet;\n\nimport com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback;\nimport com.google.javascript.jscomp.parsing.parser.FeatureSet;\nimport com.google.javascript.jscomp.parsing.parser.FeatureSet.Feature;\nimport com.google.javascript.rhino.Node;\nimport com.google.javascript.rhino.Token;\n\n/** Transpiles away `new.target`. */\nfinal class RewriteNewDotTarget implements CompilerPass {\n private static final FeatureSet TRANSPILED_FEATURES =\n FeatureSet.BARE_MINIMUM.with(Feature.NEW_TARGET);\n\n private final AbstractCompiler compiler;\n private final AstFactory astFactory;\n\n RewriteNewDotTarget(AbstractCompiler compiler) {\n this.compiler = compiler;\n this.astFactory = compiler.createAstFactory();\n }\n\n private class RewriteNewDotTargetCallback extends AbstractPostOrderCallback {\n @Override\n public void visit(NodeTraversal t, Node n, Node parent) {\n if (n.getToken() == Token.NEW_TARGET) {\n final Node enclosingNonArrowFunction = NodeUtil.getEnclosingNonArrowFunction(n);\n if (enclosingNonArrowFunction != null\n && NodeUtil.isEs6Constructor(enclosingNonArrowFunction)) {\n // Within an ES6 class constructor that we're about to transpile.\n // `new.target` -> `this.constructor`\n Node enclosingClass = enclosingNonArrowFunction.getParent().getGrandparent();\n n.replaceWith(\n astFactory\n .createGetProp(\n astFactory.createThisForEs6Class(enclosingClass), \"constructor\", type(n))\n .srcrefTree(n));\n t.reportCodeChange();\n } else {\n // Getting new.target correct in functions other than transpiled ES6 class constructors\n // requires determining whether the function was called with `new` or not, which is more\n // hassle than its worth. There's no good reason to use `new.target` in such places\n // anyway.\n cannotConvertYet(compiler, n, \"new.target\");\n }\n }\n }\n }\n\n @Override\n public void process(Node externs, Node root) {\n TranspilationPasses.processTranspile(\n compiler, root, TRANSPILED_FEATURES, new RewriteNewDotTargetCallback());\n TranspilationPasses.maybeMarkFeaturesAsTranspiledAway(compiler, TRANSPILED_FEATURES);\n }\n}\n", "meta": {"content_hash": "3203ff54df229c1abb34049c1d2b8021", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 98, "avg_line_length": 41.66101694915254, "alnum_prop": 0.7160292921074044, "repo_name": "googlechromelabs/chromeos_smart_card_connector", "id": "d674d2e29f8d35cee5e0d220682f6070e810d805", "size": "3070", "binary": false, "copies": "3", "ref": "refs/heads/main", "path": "third_party/closure-compiler/src/src/com/google/javascript/jscomp/RewriteNewDotTarget.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "4254"}, {"name": "C++", "bytes": "722639"}, {"name": "CSS", "bytes": "9725"}, {"name": "HTML", "bytes": "17393"}, {"name": "JavaScript", "bytes": "361786"}, {"name": "Lua", "bytes": "1704"}, {"name": "Makefile", "bytes": "116814"}, {"name": "Python", "bytes": "27331"}, {"name": "Shell", "bytes": "12794"}]}} +{"text": "\ufeff# generated vars\n$packageName = 'keepass.portable'\n$url = 'https://sourceforge.net/projects/keepass/files/KeePass%202.x/2.38/KeePass-2.38.zip'\n$checksum = 'DB71CBA72C321ECAEDA7EEC6F4E71E215864D4113AB9E29DC97AD4D56C80A7A9'\n\n# static vars\n$checksumType = 'sha256'\n$toolsDir = \"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\"\n\n# $Env:ChocolateyInstall\\helpers\\functions\nInstall-ChocolateyZipPackage -PackageName \"$packageName\" `\n -Url \"$url\" `\n -UnzipLocation \"$toolsDir\" `\n -Checksum \"$checksum\" `\n -ChecksumType \"$checksumType\"\n\n# create empty sidecar so shimgen creates shim for GUI rather than console\n$installFile = Join-Path -Path $toolsDir `\n -ChildPath \"KeePass.exe.gui\"\nSet-Content -Path $installFile `\n -Value $null", "meta": {"content_hash": "08e577d31dae3e6d80f034171fa5cef3", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 91, "avg_line_length": 41.904761904761905, "alnum_prop": 0.6386363636363637, "repo_name": "dtgm/chocolatey-packages", "id": "52ceff69ed39a522c048eadb9c426fc1505475e3", "size": "882", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "automatic/_output/keepass.portable/2.38/tools/chocolateyInstall.ps1", "mode": "33188", "license": "apache-2.0", "language": [{"name": "AutoHotkey", "bytes": "347616"}, {"name": "AutoIt", "bytes": "13530"}, {"name": "Batchfile", "bytes": "1404"}, {"name": "C#", "bytes": "8134"}, {"name": "HTML", "bytes": "80818"}, {"name": "PowerShell", "bytes": "13124493"}]}} +{"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 1.0 Transitional//EN\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <link rel=\"stylesheet\" href=\"../includes/main.css\" type=\"text/css\">\n <link rel=\"shortcut icon\" href=\"../favicon.ico\" type=\"image/x-icon\">\n <title>Apache CloudStack | The Power Behind Your Cloud</title>\n </head>\n <body>\n <div id=\"insidetopbg\">\n <div id=\"inside_wrapper\">\n <div class=\"uppermenu_panel\">\n <div class=\"uppermenu_box\"></div>\n </div>\n <div id=\"main_master\">\n <div id=\"inside_header\">\n <div class=\"header_top\">\n <a class=\"cloud_logo\" href=\"http://cloudstack.org\"></a>\n <div class=\"mainemenu_panel\"></div>\n </div>\n </div>\n <div id=\"main_content\">\n <div class=\"inside_apileftpanel\">\n <div class=\"inside_contentpanel\" style=\"width:930px;\">\n <div class=\"api_titlebox\">\n <div class=\"api_titlebox_left\">\n <span>\n\t\t\t\t\t\tApache CloudStack 4.15.0.0 Root Admin API Reference\n\t\t\t\t\t</span>\n <p></p>\n <h1>createCondition</h1>\n <p>Creates a condition</p>\n </div>\n <div class=\"api_titlebox_right\">\n <a class=\"api_backbutton\" href=\"../index.html\"></a>\n </div>\n </div>\n <div class=\"api_tablepanel\">\n <h2>Request parameters</h2>\n <table class=\"apitable\">\n <tr class=\"hed\">\n <td style=\"width:200px;\"><strong>Parameter Name</strong></td><td style=\"width:500px;\">Description</td><td style=\"width:180px;\">Required</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>counterid</strong></td><td style=\"width:500px;\"><strong>ID of the Counter.</strong></td><td style=\"width:180px;\"><strong>true</strong></td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>relationaloperator</strong></td><td style=\"width:500px;\"><strong>Relational Operator to be used with threshold.</strong></td><td style=\"width:180px;\"><strong>true</strong></td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>threshold</strong></td><td style=\"width:500px;\"><strong>Threshold value.</strong></td><td style=\"width:180px;\"><strong>true</strong></td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><i>account</i></td><td style=\"width:500px;\"><i>the account of the condition. Must be used with the domainId parameter.</i></td><td style=\"width:180px;\"><i>false</i></td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><i>domainid</i></td><td style=\"width:500px;\"><i>the domain ID of the account.</i></td><td style=\"width:180px;\"><i>false</i></td>\n </tr>\n </table>\n </div>\n <div class=\"api_tablepanel\">\n <h2>Response Tags</h2>\n <table class=\"apitable\">\n <tr class=\"hed\">\n <td style=\"width:200px;\"><strong>Response Name</strong></td><td style=\"width:500px;\">Description</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>id</strong></td><td style=\"width:500px;\">the id of the Condition</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>account</strong></td><td style=\"width:500px;\">the owner of the Condition.</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>counter</strong></td><td style=\"width:500px;\">Details of the Counter.</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>domain</strong></td><td style=\"width:500px;\">the domain name of the owner.</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>domainid</strong></td><td style=\"width:500px;\">the domain id of the Condition owner</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>project</strong></td><td style=\"width:500px;\">the project name of the Condition</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>projectid</strong></td><td style=\"width:500px;\">the project id of the Condition.</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>relationaloperator</strong></td><td style=\"width:500px;\">Relational Operator to be used with threshold.</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>threshold</strong></td><td style=\"width:500px;\">Threshold Value for the counter.</td>\n </tr>\n <tr>\n <td style=\"width:200px;\"><strong>zoneid</strong></td><td style=\"width:500px;\">zone id of counter</td>\n </tr>\n </table>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div id=\"footer\">\n <div id=\"comments_thread\">\n <script type=\"text/javascript\" src=\"https://comments.apache.org/show_comments.lua?site=test\" async=\"true\"></script>\n <noscript>\n <iframe width=\"930\" height=\"500\" src=\"https://comments.apache.org/iframe.lua?site=test&page=4.2.0/rootadmin\"></iframe>\n </noscript>\n </div>\n <div id=\"footer_mainmaster\">\n <p>\n Copyright © 2015 The Apache Software Foundation, Licensed under the\n <a href=\"http://www.apache.org/licenses/LICENSE-2.0\">Apache License, Version 2.0.</a>\n <br>\n Apache, CloudStack, Apache CloudStack, the Apache CloudStack logo, the CloudMonkey logo and the Apache feather logo are trademarks of The Apache Software Foundation.\n </p>\n </div>\n </div>\n </div>\n </div>\n </body>\n</html>\n", "meta": {"content_hash": "d5bb686f7cef5e7575a56e95e4772eca", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 253, "avg_line_length": 67.869918699187, "alnum_prop": 0.38236703402012456, "repo_name": "apache/cloudstack-www", "id": "95dae97d397a5fefb80d9c840ba4d3634f1a39b9", "size": "8348", "binary": false, "copies": "4", "ref": "refs/heads/main", "path": "content/api/apidocs-4.15/apis/createCondition.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "568290"}, {"name": "HTML", "bytes": "222229805"}, {"name": "JavaScript", "bytes": "61116"}, {"name": "Python", "bytes": "3284"}, {"name": "Ruby", "bytes": "1973"}, {"name": "Shell", "bytes": "873"}]}} +{"text": "{% extends \"xblog/blog_base.html\" %}\n{% block maincontent %}\n<form action=\"\" method=\"post\">{% csrf_token %}\n <button type=\"submit\">Save</button>\n</form>\n\n{% endblock %}\n\n", "meta": {"content_hash": "b04f11482951afefef9f52440da6ea38", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 46, "avg_line_length": 22.125, "alnum_prop": 0.6045197740112994, "repo_name": "rubeon/django-xblog", "id": "a6d7d2442ec3977dfad1a57ea3fc36c5f8767cd0", "size": "177", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "xblog/templates/xblog/author_form.html", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "CSS", "bytes": "73797"}, {"name": "HTML", "bytes": "11830"}, {"name": "JavaScript", "bytes": "498"}, {"name": "Python", "bytes": "242211"}]}} +{"text": "package com.ezweather.app.activity;\n\nimport android.app.Activity;\nimport android.app.ProgressDialog;\nimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport android.os.Bundle;\nimport android.preference.PreferenceManager;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.View;\nimport android.view.Window;\nimport android.widget.AdapterView;\nimport android.widget.ArrayAdapter;\nimport android.widget.ListView;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport com.ezweather.app.R;\nimport com.ezweather.app.model.City;\nimport com.ezweather.app.model.County;\nimport com.ezweather.app.db.EzWeatherDB;\nimport com.ezweather.app.model.Province;\nimport com.ezweather.app.util.HttpCallbackListener;\nimport com.ezweather.app.util.HttpUtil;\nimport com.ezweather.app.util.Utility;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Created by Oniros on 2016/4/8.\n */\npublic class ChooseAreaActivity extends Activity {\n\n public static final int LEVEL_PROVINCE = 0;\n public static final int LEVEL_CITY = 1;\n public static final int LEVEL_COUNTY = 2;\n\n private ProgressDialog progressDialog;\n private TextView titleText;\n private ListView listView;\n private ArrayAdapter<String> adapter;\n private EzWeatherDB ezWeatherDB;\n private List<String> dataList = new ArrayList<String>();\n /**\n * \u7701\u5217\u8868\n */\n private List<Province> provinceList;\n /**\n * \u5e02\u5217\u8868\n */\n private List<City> cityList;\n /**\n * \u53bf\u5217\u8868\n */\n private List<County> countyList;\n /**\n * \u9009\u4e2d\u7684\u7701\u4efd\n */\n private Province selectedProvince;\n /**\n * \u9009\u4e2d\u7684\u57ce\u5e02\n */\n private City selectedCity;\n /**\n * \u5f53\u524d\u9009\u4e2d\u7684\u7ea7\u522b\n */\n private int currentLevel;\n /**\n * \u662f\u5426\u4eceWeatherActivity\u4e2d\u8df3\u8f6c\u8fc7\u6765\u3002\n */\n private boolean isFromWeatherActivity;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n isFromWeatherActivity = getIntent().getBooleanExtra(\"from_weather_activity\", false);\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n if (prefs.getBoolean(\"city_selected\", false) && !isFromWeatherActivity) {\n Intent intent = new Intent(this, WeatherActivity.class);\n startActivity(intent);\n finish();\n return;\n }\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n setContentView(R.layout.choose_area);\n listView = (ListView) findViewById(R.id.list_view);\n titleText = (TextView) findViewById(R.id.title_text);\n adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, dataList);\n listView.setAdapter(adapter);\n ezWeatherDB = EzWeatherDB.getInstance(this);\n listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> arg0, View view, int index,\n long arg3) {\n if (currentLevel == LEVEL_PROVINCE) {\n selectedProvince = provinceList.get(index);\n queryCities();\n } else if (currentLevel == LEVEL_CITY) {\n selectedCity = cityList.get(index);\n queryCounties();\n } else if (currentLevel == LEVEL_COUNTY) {\n String countyCode = countyList.get(index).getCountyCode();\n Intent intent = new Intent(ChooseAreaActivity.this, WeatherActivity.class);\n intent.putExtra(\"county_code\", countyCode);\n startActivity(intent);\n finish();\n }\n }\n });\n queryProvinces(); // \u52a0\u8f7d\u7701\u7ea7\u6570\u636e\n }\n\n /**\n * \u67e5\u8be2\u5168\u56fd\u6240\u6709\u7684\u7701\uff0c\u4f18\u5148\u4ece\u6570\u636e\u5e93\u67e5\u8be2\uff0c\u5982\u679c\u6ca1\u6709\u67e5\u8be2\u5230\u518d\u53bb\u670d\u52a1\u5668\u4e0a\u67e5\u8be2\u3002\n */\n private void queryProvinces() {\n provinceList =ezWeatherDB .loadProvince();\n if (provinceList.size() > 0) {\n dataList.clear();\n for (Province province : provinceList) {\n dataList.add(province.getProvinceName());\n }\n adapter.notifyDataSetChanged();\n listView.setSelection(0);\n titleText.setText(\"\u4e2d\u56fd\");\n currentLevel = LEVEL_PROVINCE;\n } else {\n queryFromServer(null, \"province\");\n }\n }\n\n /**\n * \u67e5\u8be2\u9009\u4e2d\u7701\u5185\u6240\u6709\u7684\u5e02\uff0c\u4f18\u5148\u4ece\u6570\u636e\u5e93\u67e5\u8be2\uff0c\u5982\u679c\u6ca1\u6709\u67e5\u8be2\u5230\u518d\u53bb\u670d\u52a1\u5668\u4e0a\u67e5\u8be2\u3002\n */\n private void queryCities() {\n cityList = ezWeatherDB.loadCities(selectedProvince.getId());\n if (cityList.size() > 0) {\n dataList.clear();\n for (City city : cityList) {\n dataList.add(city.getCityName());\n }\n adapter.notifyDataSetChanged();\n listView.setSelection(0);\n titleText.setText(selectedProvince.getProvinceName());\n currentLevel = LEVEL_CITY;\n } else {\n queryFromServer(selectedProvince.getProvinceCode(), \"city\");\n }\n }\n\n /**\n * \u67e5\u8be2\u9009\u4e2d\u5e02\u5185\u6240\u6709\u7684\u53bf\uff0c\u4f18\u5148\u4ece\u6570\u636e\u5e93\u67e5\u8be2\uff0c\u5982\u679c\u6ca1\u6709\u67e5\u8be2\u5230\u518d\u53bb\u670d\u52a1\u5668\u4e0a\u67e5\u8be2\u3002\n */\n private void queryCounties() {\n countyList = ezWeatherDB.loadCounties(selectedCity.getId());\n if (countyList.size() > 0) {\n dataList.clear();\n for (County county : countyList) {\n dataList.add(county.getCountyName());\n }\n adapter.notifyDataSetChanged();\n listView.setSelection(0);\n titleText.setText(selectedCity.getCityName());\n currentLevel = LEVEL_COUNTY;\n } else {\n queryFromServer(selectedCity.getCityCode(), \"county\");\n }\n }\n\n /**\n * \u6839\u636e\u4f20\u5165\u7684\u4ee3\u53f7\u548c\u7c7b\u578b\u4ece\u670d\u52a1\u5668\u4e0a\u67e5\u8be2\u7701\u5e02\u53bf\u6570\u636e\u3002\n */\n private void queryFromServer(final String code, final String type) {\n String address;\n if (!TextUtils.isEmpty(code)) {\n address = \"http://www.weather.com.cn/data/list3/city\" + code + \".xml\";\n } else {\n address = \"http://www.weather.com.cn/data/list3/city.xml\";\n }\n showProgressDialog();\n HttpUtil.sendHttpRequest(address, new HttpCallbackListener() {\n @Override\n public void onFinish(String response) {\n boolean result = false;\n if (\"province\".equals(type)) {\n result = Utility.handleProvinceResponse(ezWeatherDB,\n response);\n } else if (\"city\".equals(type)) {\n result = Utility.handleCitiesResponse(ezWeatherDB,\n response, selectedProvince.getId());\n } else if (\"county\".equals(type)) {\n result = Utility.handleCountiesResponse(ezWeatherDB,\n response, selectedCity.getId());\n }\n if (result) {\n // \u901a\u8fc7runOnUiThread()\u65b9\u6cd5\u56de\u5230\u4e3b\u7ebf\u7a0b\u5904\u7406\u903b\u8f91\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n closeProgressDialog();\n if (\"province\".equals(type)) {\n queryProvinces();\n } else if (\"city\".equals(type)) {\n queryCities();\n } else if (\"county\".equals(type)) {\n queryCounties();\n }\n }\n });\n }\n }\n\n @Override\n public void onError(Exception e) {\n // \u901a\u8fc7runOnUiThread()\u65b9\u6cd5\u56de\u5230\u4e3b\u7ebf\u7a0b\u5904\u7406\u903b\u8f91\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n closeProgressDialog();\n Toast.makeText(ChooseAreaActivity.this,\n \"\u52a0\u8f7d\u5931\u8d25\", Toast.LENGTH_SHORT).show();\n }\n });\n }\n });\n }\n\n /**\n * \u663e\u793a\u8fdb\u5ea6\u5bf9\u8bdd\u6846\n */\n private void showProgressDialog() {\n if (progressDialog == null) {\n progressDialog = new ProgressDialog(this);\n progressDialog.setMessage(\"\u6b63\u5728\u52a0\u8f7d...\");\n progressDialog.setCanceledOnTouchOutside(false);\n }\n progressDialog.show();\n }\n\n /**\n * \u5173\u95ed\u8fdb\u5ea6\u5bf9\u8bdd\u6846\n */\n private void closeProgressDialog() {\n if (progressDialog != null) {\n progressDialog.dismiss();\n }\n }\n\n /**\n * \u6355\u83b7Back\u6309\u952e\uff0c\u6839\u636e\u5f53\u524d\u7684\u7ea7\u522b\u6765\u5224\u65ad\uff0c\u6b64\u65f6\u5e94\u8be5\u8fd4\u56de\u5e02\u5217\u8868\u3001\u7701\u5217\u8868\u3001\u8fd8\u662f\u76f4\u63a5\u9000\u51fa\u3002\n */\n @Override\n public void onBackPressed() {\n if (currentLevel == LEVEL_COUNTY) {\n queryCities();\n } else if (currentLevel == LEVEL_CITY) {\n queryProvinces();\n } else {\n if (isFromWeatherActivity) {\n// Intent intent = new Intent(this, WeatherActivity.class);\n// startActivity(intent);\n }\n finish();\n }\n }\n\n}", "meta": {"content_hash": "56caf12ddd93e032926c8c13d38247b9", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 96, "avg_line_length": 33.152416356877325, "alnum_prop": 0.554047992823503, "repo_name": "Oniros6/EZweather", "id": "214a3f813e79026dda311f952e041527230eca2a", "size": "9432", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/ezweather/app/activity/ChooseAreaActivity.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "33766"}]}} +{"text": "namespace crashpad {\n\nclass ProcessReaderWin;\n\nnamespace internal {\n\nclass ExceptionSnapshotWin final : public ExceptionSnapshot {\n public:\n ExceptionSnapshotWin();\n ~ExceptionSnapshotWin() override;\n\n //! \\brief Initializes the object.\n //!\n //! \\param[in] process_reader A ProcessReader for the process that sustained\n //! the exception.\n //! \\param[in] thread_id The thread ID in which the exception occurred.\n //! \\param[in] exception_pointers_address The address of an\n //! `EXCEPTION_POINTERS` record in the target process, passed through from\n //! the exception handler.\n //!\n //! \\return `true` if the snapshot could be created, `false` otherwise with\n //! an appropriate message logged.\n bool Initialize(ProcessReaderWin* process_reader,\n DWORD thread_id,\n WinVMAddress exception_pointers);\n\n // ExceptionSnapshot:\n\n const CPUContext* Context() const override;\n uint64_t ThreadID() const override;\n uint32_t Exception() const override;\n uint32_t ExceptionInfo() const override;\n uint64_t ExceptionAddress() const override;\n const std::vector<uint64_t>& Codes() const override;\n\n private:\n#if defined(ARCH_CPU_X86_FAMILY)\n union {\n CPUContextX86 x86;\n CPUContextX86_64 x86_64;\n } context_union_;\n#endif\n CPUContext context_;\n std::vector<uint64_t> codes_;\n uint64_t thread_id_;\n uint64_t exception_address_;\n uint32_t exception_flags_;\n DWORD exception_code_;\n InitializationStateDcheck initialized_;\n\n DISALLOW_COPY_AND_ASSIGN(ExceptionSnapshotWin);\n};\n\n} // namespace internal\n} // namespace crashpad\n\n#endif // CRASHPAD_SNAPSHOT_WIN_EXCEPTION_SNAPSHOT_WIN_H_\n", "meta": {"content_hash": "773c56745f5f05e787f04e40773ce653", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 80, "avg_line_length": 29.12280701754386, "alnum_prop": 0.7096385542168675, "repo_name": "Teamxrtc/webrtc-streaming-node", "id": "588c4ac9f642452d54534bf6c1916a7022b5de8c", "size": "2659", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "third_party/webrtc/src/chromium/src/third_party/crashpad/crashpad/snapshot/win/exception_snapshot_win.h", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "44"}, {"name": "C++", "bytes": "221840"}, {"name": "HTML", "bytes": "2383"}, {"name": "JavaScript", "bytes": "37396"}, {"name": "Python", "bytes": "2860"}, {"name": "Shell", "bytes": "104"}]}} +{"text": "\r\n\r\n/*\r\n * timeval.h 1.0 01/12/19\r\n *\r\n * Defines gettimeofday, timeval, etc. for Win32\r\n *\r\n * By Wu Yongwei\r\n *\r\n */\r\n\r\n#ifndef _TIMEVAL_H\r\n#define _TIMEVAL_H\r\n\r\n#ifdef _WIN32\r\n\r\n/* Modified to compile as ANSI C without include of windows.h\r\n If this gives problems with future Windows/MSC versions, then\r\n uncomment the USE_WINDOWS_H definition to switch back. */\r\n/* #define USE_WINDOWS_H */\r\n#ifdef USE_WINDOWS_H\r\n #define WIN32_LEAN_AND_MEAN\r\n #include <windows.h>\r\n#else\r\n#ifndef _INC_WINDOWS\r\n #define VOID void\r\n #define WINAPI __stdcall\r\n #define OUT\r\n #define WINBASEAPI\r\n\r\n typedef long LONG;\r\n typedef unsigned long DWORD;\r\n typedef __int64 LONGLONG;\r\n\r\n typedef struct _FILETIME {\r\n DWORD dwLowDateTime;\r\n DWORD dwHighDateTime;\r\n } FILETIME, *LPFILETIME;\r\n\r\n typedef union _LARGE_INTEGER {\r\n /* Removed unnamed struct,\r\n it is not ANSI C compatible*/\r\n /* struct {\r\n DWORD LowPart;\r\n LONG HighPart;\r\n }; */\r\n struct {\r\n DWORD LowPart;\r\n LONG HighPart;\r\n } u;\r\n LONGLONG QuadPart;\r\n } LARGE_INTEGER;\r\n\r\n WINBASEAPI VOID WINAPI\r\n GetSystemTimeAsFileTime(OUT LPFILETIME lpSystemTimeAsFileTime);\r\n#endif /* _INC_WINDOWS */\r\n#endif /* USE_WINDOWS_H */\r\n\r\n#include <time.h>\r\n\r\n#ifndef __GNUC__\r\n#define EPOCHFILETIME (116444736000000000i64)\r\n#else\r\n#define EPOCHFILETIME (116444736000000000LL)\r\n#endif\r\n\r\nstruct timeval {\r\n long tv_sec; /* seconds */\r\n long tv_usec; /* microseconds */\r\n};\r\n\r\nstruct timezone {\r\n int tz_minuteswest; /* minutes W of Greenwich */\r\n int tz_dsttime; /* type of dst correction */\r\n};\r\n\r\n__inline int gettimeofday(struct timeval *tv, struct timezone *tz)\r\n{\r\n FILETIME ft;\r\n LARGE_INTEGER li;\r\n __int64 t;\r\n static int tzflag;\r\n\r\n if (tv)\r\n {\r\n GetSystemTimeAsFileTime(&ft);\r\n\r\n /* The following two lines have been modified to use the named\r\n union member. Unnamed members are not ANSI C compatible. */\r\n li.u.LowPart = ft.dwLowDateTime;\r\n li.u.HighPart = ft.dwHighDateTime;\r\n t = li.QuadPart; /* In 100-nanosecond intervals */\r\n t -= EPOCHFILETIME; /* Offset to the Epoch time */\r\n t /= 10; /* In microseconds */\r\n tv->tv_sec = (long)(t / 1000000);\r\n tv->tv_usec = (long)(t % 1000000);\r\n }\r\n\r\n if (tz)\r\n {\r\n if (!tzflag)\r\n {\r\n _tzset();\r\n tzflag++;\r\n }\r\n tz->tz_minuteswest = _timezone / 60;\r\n tz->tz_dsttime = _daylight;\r\n }\r\n\r\n return 0;\r\n}\r\n\r\n#else /* _WIN32 */\r\n\r\n#include <sys/time.h>\r\n\r\n#endif /* _WIN32 */\r\n\r\n#endif /* _TIMEVAL_H */\r\n", "meta": {"content_hash": "1a6559bbdae2ef5db88bf00c8b922f71", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 70, "avg_line_length": 23.352941176470587, "alnum_prop": 0.5588341129902843, "repo_name": "egorpushkin/neurolab", "id": "58b1f24f0b3ce0ab671619f2d25379db8e17208f", "size": "3639", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "source/Plugins/ScriptEnv/LuaNeuroApi/Extensions/Training/fann_1.2.1/Engine/compat_time.h", "mode": "33261", "license": "mit", "language": [{"name": "Batchfile", "bytes": "112"}, {"name": "C", "bytes": "1787692"}, {"name": "C++", "bytes": "9312245"}, {"name": "CSS", "bytes": "44465"}, {"name": "Clarion", "bytes": "5268"}, {"name": "HTML", "bytes": "408820"}, {"name": "JavaScript", "bytes": "5476"}, {"name": "Makefile", "bytes": "39256"}, {"name": "Objective-C", "bytes": "97952"}, {"name": "TeX", "bytes": "3128"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:id=\"@+id/poi_description_container\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"vertical\"\n android:visibility=\"visible\"\n tools:visibility=\"visible\">\n\n <TextView\n android:id=\"@+id/poi_description\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_marginEnd=\"@dimen/margin_base\"\n android:layout_marginLeft=\"@dimen/margin_base\"\n android:layout_marginRight=\"@dimen/margin_base\"\n android:layout_marginStart=\"@dimen/margin_base\"\n android:layout_marginTop=\"@dimen/margin_base\"\n android:maxLength=\"2000\"\n android:textAppearance=\"?android:attr/textAppearance\"/>\n\n <TextView\n android:id=\"@+id/more_btn\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"start|bottom\"\n android:layout_marginEnd=\"@dimen/margin_base\"\n android:layout_marginLeft=\"@dimen/margin_base\"\n android:layout_marginRight=\"@dimen/margin_base\"\n android:layout_marginStart=\"@dimen/margin_base\"\n android:textAppearance=\"?android:attr/textAppearance\"\n android:gravity=\"start|top\"\n android:textColor=\"?attr/colorAccent\"\n android:text=\"@string/category_desc_more\"\n android:background=\"@android:color/transparent\"/>\n <include\n layout=\"@layout/divider_horizontal\"/>\n</LinearLayout>\n", "meta": {"content_hash": "80daabfb0b4835ea145f6d3ece59d905", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 60, "avg_line_length": 38.225, "alnum_prop": 0.7325049051667757, "repo_name": "alexzatsepin/omim", "id": "cf02975a35749ef615c2a85fc58f923ac78992db", "size": "1529", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "android/res/layout/place_page_description_layout.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Awk", "bytes": "3962"}, {"name": "Batchfile", "bytes": "5586"}, {"name": "C", "bytes": "13984459"}, {"name": "C++", "bytes": "148411082"}, {"name": "CMake", "bytes": "249320"}, {"name": "CSS", "bytes": "26798"}, {"name": "Common Lisp", "bytes": "17587"}, {"name": "DIGITAL Command Language", "bytes": "36710"}, {"name": "GLSL", "bytes": "58384"}, {"name": "Gherkin", "bytes": "305230"}, {"name": "Go", "bytes": "12771"}, {"name": "HTML", "bytes": "9503594"}, {"name": "Inno Setup", "bytes": "4337"}, {"name": "Java", "bytes": "2486120"}, {"name": "JavaScript", "bytes": "29076"}, {"name": "Lua", "bytes": "57672"}, {"name": "M4", "bytes": "53992"}, {"name": "Makefile", "bytes": "429637"}, {"name": "Metal", "bytes": "77540"}, {"name": "Module Management System", "bytes": "2080"}, {"name": "Objective-C", "bytes": "2046640"}, {"name": "Objective-C++", "bytes": "1300948"}, {"name": "PHP", "bytes": "2841"}, {"name": "Perl", "bytes": "57807"}, {"name": "PowerShell", "bytes": "1885"}, {"name": "Python", "bytes": "584274"}, {"name": "Roff", "bytes": "13545"}, {"name": "Ruby", "bytes": "66800"}, {"name": "Shell", "bytes": "1317925"}, {"name": "Swift", "bytes": "511409"}, {"name": "sed", "bytes": "236"}]}} +{"text": "\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <sys/mman.h>\n#include <sys/socket.h>\n#include <sys/time.h>\n#include <fcntl.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <stdint.h>\n#include <arpa/inet.h>\n\n#include <pcap.h>\n#include <ccn/ccn.h>\n#include <ccn/ccnd.h>\n\n#define LLC_LENGTH 4\n#define IP_OFFSET LLC_LENGTH\n#define IP_ADDR_LENGTH 4\n#define IP_HDR_LENGTH 20\n#define IP_LENGTH_OFFSET IP_OFFSET + 2\n#define IP_CHKSUM_OFFSET IP_OFFSET + 10\n#define IP_SRC_ADDR_OFFSET IP_CHKSUM_OFFSET + 2\n#define IP_DEST_ADDR_OFFSET IP_CHKSUM_OFFSET + IP_ADDR_LENGTH\n\n#define UDP_OFFSET IP_OFFSET + IP_HDR_LENGTH\n#define UDP_HDR_LENGTH 8\n#define UDP_LENGTH_OFFSET UDP_OFFSET + 4\n#define UDP_CHKSUM_OFFSET UDP_OFFSET + 6\n#define DATA_OFFSET UDP_OFFSET + UDP_HDR_LENGTH\n#define MAX_PACKET 65536\n#define DEFAULT_SRC_PORT 55555\n#define DEFAULT_DEST_PORT CCN_DEFAULT_UNICAST_PORT_NUMBER\n\nstatic void\nusage(const char *progname)\n{\n fprintf(stderr,\n \"%s <infile> [<infile> ...]\\n\"\n \" Reads ccnb blocks from one or more files, and writes them in pcap format\\n\"\n \" to stdout.\\n\"\n \" ccnb blocks can be generated by any of the other utility programs.\\n\",\n progname);\n exit(1);\n}\n\nstatic int\ndump_udp_packet(pcap_dumper_t *dump_file, \n unsigned char *ip_src_addr, /* ipv4, localhost if NULL */\n unsigned char *ip_dest_addr, /* localhost if NULL */\n unsigned short udp_src_port, /* 55555 if 0 */\n unsigned short udp_dest_port,\n const unsigned char *data, size_t data_len, /* data; could be whole ccnb, could\n just be contents */\n struct timeval *ts) { /* timing info */\n\n unsigned char pktbuf[MAX_PACKET];\n uint32_t llc_val = PF_INET; // in host byte order\n\n uint16_t nsrc_port = htons((0 == udp_src_port) ? DEFAULT_SRC_PORT : udp_src_port);\n uint16_t ndest_port = htons((0 == udp_dest_port) ? DEFAULT_DEST_PORT : udp_dest_port);\n uint16_t nudp_len = htons(data_len + UDP_HDR_LENGTH);\n uint16_t nip_len = htons(data_len + UDP_HDR_LENGTH + IP_HDR_LENGTH);\n\n size_t frame_len = data_len + UDP_HDR_LENGTH + IP_HDR_LENGTH + LLC_LENGTH;\n struct pcap_pkthdr pcap_header;\n \n const unsigned char ipHdr[] = {\n // IP header, localhost to localhost\n 0x45, // IPv4, 20 byte header\n 0x00, // diff serv field\n 0x00, 0x00, // length -- UDP length + 20\n 0x1a, 0x62, // identification\n 0x00, // flags\n 0x00, // fragment offset\n 0x40, // TTL (64)\n 0x11, // proto (UDP=11)\n 0x00, 0x00, // ip checksum (calculate, or leave 0 for validation disabled)\n 0x7f, 0x00, 0x00, 0x01, // source, localhost if not overwritten\n 0x7f, 0x00, 0x00, 0x01 // dest, localhost if not overwritten\n };\n\n unsigned char udpHdr[UDP_HDR_LENGTH];\n memset(udpHdr, 0, UDP_HDR_LENGTH);\n \n memcpy(&pktbuf[0], (unsigned char *)&llc_val, LLC_LENGTH);\n memcpy(&pktbuf[IP_OFFSET], ipHdr, IP_HDR_LENGTH);\n memcpy(&pktbuf[IP_LENGTH_OFFSET], &nip_len, 2);\n if (NULL != ip_src_addr) {\n memcpy(&pktbuf[IP_SRC_ADDR_OFFSET], ip_src_addr, IP_ADDR_LENGTH);\n }\n if (NULL != ip_dest_addr) {\n memcpy(&pktbuf[IP_DEST_ADDR_OFFSET], ip_dest_addr, IP_ADDR_LENGTH);\n }\n\n memcpy(&pktbuf[UDP_OFFSET], &nsrc_port, sizeof(unsigned short));\n memcpy(&pktbuf[UDP_OFFSET + sizeof(unsigned short)], &ndest_port, sizeof(unsigned short));\n memcpy(&pktbuf[UDP_LENGTH_OFFSET], &nudp_len, sizeof(unsigned short));\n\n memcpy(&pktbuf[DATA_OFFSET], data, data_len);\n\n pcap_header.len = pcap_header.caplen = frame_len;\n if (NULL != ts) {\n pcap_header.ts.tv_sec = ts->tv_sec;\n pcap_header.ts.tv_usec = ts->tv_usec;\n }\n\n pcap_dump((unsigned char *)dump_file, &pcap_header, &pktbuf[0]);\n\n if (0 != pcap_dump_flush(dump_file)) {\n fprintf(stderr, \"Error flushing pcap dump...\\n\");\n return -1;\n }\n return 0;\n}\n\nstatic int\nprocess_test(pcap_dumper_t *pcap_out, int content_only,\n unsigned char *ip_src_addr, /* ipv4, localhost if NULL */\n unsigned char *ip_dest_addr, /* localhost if NULL */\n unsigned short udp_src_port, /* 55555 if 0 */\n unsigned short udp_dest_port,\n unsigned char *data, size_t n)\n{\n struct ccn_skeleton_decoder skel_decoder = {0};\n struct ccn_skeleton_decoder *d = &skel_decoder;\n struct ccn_parsed_ContentObject content;\n struct ccn_indexbuf *comps = ccn_indexbuf_create();\n const unsigned char * content_value;\n size_t content_length;\n int res = 0;\n size_t s;\n\nretry:\n s = ccn_skeleton_decode(d, data, n);\n if (d->state < 0) {\n res = 1;\n fprintf(stderr, \"error state %d after %d of %d chars\\n\",\n (int)d->state, (int)s, (int)n);\n } else if (s == 0) {\n fprintf(stderr, \"nothing to do\\n\");\n } else {\n if (s < n) {\n if (!content_only) {\n if (dump_udp_packet(pcap_out, ip_src_addr, ip_dest_addr, \n udp_src_port, udp_dest_port, data, s, NULL) != 0) {\n res = 2;\n }\n } else {\n if (ccn_parse_ContentObject(data, s, &content, comps) != 0) {\n fprintf(stderr, \"unable to parse content object\\n\");\n res = 1;\n } else if (ccn_content_get_value(data, s, &content, &content_value, &content_length) != 0) {\n fprintf(stderr, \"unable to retrieve content value\\n\");\n res = 1;\n } else if (dump_udp_packet(pcap_out, ip_src_addr, ip_dest_addr, \n udp_src_port, udp_dest_port, \n content_value, content_length, NULL) != 0) {\n res = 2;\n }\n }\n /* fprintf(stderr, \"resuming at index %d\\n\", (int)d->index); */\n data += s;\n n -= s;\n if (res != 0) {\n fprintf(stderr, \"Error dumping content.\\n\");\n return res;\n }\n goto retry;\n }\n fprintf(stderr, \"\\n\");\n }\n if (!CCN_FINAL_DSTATE(d->state)) {\n res = 1;\n fprintf(stderr, \"incomplete state %d after %d of %d chars\\n\",\n (int)d->state, (int)s, (int)n);\n } else {\n if (!content_only) {\n if (dump_udp_packet(pcap_out, ip_src_addr, ip_dest_addr, \n udp_src_port, udp_dest_port, data, s, NULL) != 0) {\n res = 2;\n }\n } else {\n if (ccn_parse_ContentObject(data, s, &content, comps) != 0) {\n fprintf(stderr, \"unable to parse content object\\n\");\n res = 1;\n } else if (ccn_content_get_value(data, s, &content, &content_value, &content_length) != 0) {\n fprintf(stderr, \"unable to retrieve content value\\n\");\n res = 1;\n } else if (dump_udp_packet(pcap_out, ip_src_addr, ip_dest_addr, \n udp_src_port, udp_dest_port, content_value, content_length, NULL) != 0) {\n res = 2;\n }\n }\n\n res = 1;\n }\n return(res);\n}\n\nstatic int\nprocess_fd(pcap_dumper_t *pcap_out, int fd, int content_only,\n unsigned char *ip_src_addr, /* ipv4, localhost if NULL */\n unsigned char *ip_dest_addr, /* localhost if NULL */\n unsigned short udp_src_port, /* 55555 if 0 */\n unsigned short udp_dest_port\n )\n{\n unsigned char *buf;\n ssize_t len;\n struct stat s;\n int res = 0;\n\n res = fstat(fd, &s);\n len = s.st_size;\n buf = (unsigned char *)mmap((void *)NULL, len, PROT_READ, MAP_PRIVATE, fd, 0);\n if (buf == (void *)-1) return (1);\n fprintf(stderr, \" <!-- input is %6lu bytes -->\\n\", (unsigned long)len);\n res |= process_test(pcap_out, content_only,\n ip_src_addr, ip_dest_addr, udp_src_port, udp_dest_port,\n buf, len);\n munmap((void *)buf, len);\n return(res);\n}\n\nint\nmain(int argc, char **argv)\n{\n pcap_t *pcap = NULL;\n pcap_dumper_t *pcap_out = NULL;\n int fd;\n int i;\n int res = 0;\n \n if (argc < 2) {\n usage(argv[0]);\n }\n\n pcap = pcap_open_dead(DLT_NULL, MAX_PACKET);\n if (NULL == pcap) {\n fprintf(stderr, \"Cannot open pcap descriptor!\\n\");\n exit(-1);\n }\n\n pcap_out = pcap_dump_open(pcap, \"-\");\n if (NULL == pcap_out) {\n fprintf(stderr, \"Cannot open output stdout!\\n\");\n usage(argv[0]);\n }\n\n for (i = 1; argv[i] != 0; i++) {\n fprintf(stderr, \"<!-- Processing %s -->\\n\", argv[i]);\n\n fd = open(argv[i], O_RDONLY);\n if (-1 == fd) {\n perror(argv[i]);\n return(1);\n }\n\n /* DKS -- eventually take IP addresses and ports from command line,\n as well as whether to dump only the ccn content. */\n res |= process_fd(pcap_out, fd, 0, NULL, NULL, 0, 0);\n }\n\n pcap_dump_close(pcap_out);\n pcap_close(pcap);\n return res;\n}\n", "meta": {"content_hash": "cc28a4f4531eaeeff9aee329ef682888", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 112, "avg_line_length": 34.3457249070632, "alnum_prop": 0.5437817945665115, "repo_name": "MobileCloudNetworking/icnaas", "id": "4298759f2cfb6a8773cf192f3c60466857107815", "size": "10164", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "mcn-ccn-router/ccnx-0.8.2/android/CCNx-Android-Services/jni/csrc/cmd/ccndumppcap.c", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "5189410"}, {"name": "C++", "bytes": "6050"}, {"name": "Groff", "bytes": "152559"}, {"name": "HTML", "bytes": "1686578"}, {"name": "Java", "bytes": "4146221"}, {"name": "Makefile", "bytes": "224881"}, {"name": "Perl", "bytes": "1513"}, {"name": "Python", "bytes": "193499"}, {"name": "Shell", "bytes": "180150"}, {"name": "Smarty", "bytes": "2619"}]}} +{"text": "<?php\n\n\nnamespace Google\\Service\\CloudSearch;\n\nclass PrivateMessageInfo extends \\Google\\Collection\n{\n protected $collection_key = 'gsuiteIntegrationMetadata';\n protected $annotationsType = Annotation::class;\n protected $annotationsDataType = 'array';\n protected $attachmentsType = Attachment::class;\n protected $attachmentsDataType = 'array';\n protected $contextualAddOnMarkupType = GoogleChatV1ContextualAddOnMarkup::class;\n protected $contextualAddOnMarkupDataType = 'array';\n protected $gsuiteIntegrationMetadataType = GsuiteIntegrationMetadata::class;\n protected $gsuiteIntegrationMetadataDataType = 'array';\n /**\n * @var string\n */\n public $text;\n protected $userIdType = UserId::class;\n protected $userIdDataType = '';\n\n /**\n * @param Annotation[]\n */\n public function setAnnotations($annotations)\n {\n $this->annotations = $annotations;\n }\n /**\n * @return Annotation[]\n */\n public function getAnnotations()\n {\n return $this->annotations;\n }\n /**\n * @param Attachment[]\n */\n public function setAttachments($attachments)\n {\n $this->attachments = $attachments;\n }\n /**\n * @return Attachment[]\n */\n public function getAttachments()\n {\n return $this->attachments;\n }\n /**\n * @param GoogleChatV1ContextualAddOnMarkup[]\n */\n public function setContextualAddOnMarkup($contextualAddOnMarkup)\n {\n $this->contextualAddOnMarkup = $contextualAddOnMarkup;\n }\n /**\n * @return GoogleChatV1ContextualAddOnMarkup[]\n */\n public function getContextualAddOnMarkup()\n {\n return $this->contextualAddOnMarkup;\n }\n /**\n * @param GsuiteIntegrationMetadata[]\n */\n public function setGsuiteIntegrationMetadata($gsuiteIntegrationMetadata)\n {\n $this->gsuiteIntegrationMetadata = $gsuiteIntegrationMetadata;\n }\n /**\n * @return GsuiteIntegrationMetadata[]\n */\n public function getGsuiteIntegrationMetadata()\n {\n return $this->gsuiteIntegrationMetadata;\n }\n /**\n * @param string\n */\n public function setText($text)\n {\n $this->text = $text;\n }\n /**\n * @return string\n */\n public function getText()\n {\n return $this->text;\n }\n /**\n * @param UserId\n */\n public function setUserId(UserId $userId)\n {\n $this->userId = $userId;\n }\n /**\n * @return UserId\n */\n public function getUserId()\n {\n return $this->userId;\n }\n}\n\n// Adding a class alias for backwards compatibility with the previous class name.\nclass_alias(PrivateMessageInfo::class, 'Google_Service_CloudSearch_PrivateMessageInfo');\n", "meta": {"content_hash": "b19234ca59175992c3a0db5ef398403d", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 88, "avg_line_length": 22.576576576576578, "alnum_prop": 0.6879489225857941, "repo_name": "googleapis/google-api-php-client-services", "id": "ca297a1e082d1b15c1a37812b81e1e997b732ff2", "size": "3096", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "src/CloudSearch/PrivateMessageInfo.php", "mode": "33188", "license": "apache-2.0", "language": [{"name": "PHP", "bytes": "55414116"}, {"name": "Python", "bytes": "427325"}, {"name": "Shell", "bytes": "787"}]}} +{"text": "\npackage java.lang.constant;\n\nimport java.lang.invoke.CallSite;\nimport java.lang.invoke.MethodHandle;\nimport java.lang.invoke.MethodHandles;\nimport java.util.Arrays;\nimport java.util.Objects;\nimport java.util.stream.Stream;\n\nimport static java.lang.constant.ConstantDescs.CD_String;\nimport static java.lang.constant.ConstantUtils.EMPTY_CONSTANTDESC;\nimport static java.lang.constant.ConstantUtils.validateMemberName;\nimport static java.util.Objects.requireNonNull;\nimport static java.util.stream.Collectors.joining;\n\n/**\n * A <a href=\"package-summary.html#nominal\">nominal descriptor</a> for an\n * {@code invokedynamic} call site.\n *\n * <p>Concrete subtypes of {@linkplain DynamicCallSiteDesc} should be immutable\n * and their behavior should not rely on object identity.\n *\n * @since 12\n */\npublic class DynamicCallSiteDesc {\n\n private final DirectMethodHandleDesc bootstrapMethod;\n private final ConstantDesc[] bootstrapArgs;\n private final String invocationName;\n private final MethodTypeDesc invocationType;\n\n /**\n * Creates a nominal descriptor for an {@code invokedynamic} call site.\n *\n * @param bootstrapMethod a {@link DirectMethodHandleDesc} describing the\n * bootstrap method for the {@code invokedynamic}\n * @param invocationName The unqualified name that would appear in the {@code NameAndType}\n * operand of the {@code invokedynamic}\n * @param invocationType a {@link MethodTypeDesc} describing the invocation\n * type that would appear in the {@code NameAndType}\n * operand of the {@code invokedynamic}\n * @param bootstrapArgs {@link ConstantDesc}s describing the static arguments\n * to the bootstrap, that would appear in the\n * {@code BootstrapMethods} attribute\n * @throws NullPointerException if any parameter or its contents are {@code null}\n * @throws IllegalArgumentException if the invocation name has the incorrect\n * format\n * @jvms 4.2.2 Unqualified Names\n */\n private DynamicCallSiteDesc(DirectMethodHandleDesc bootstrapMethod,\n String invocationName,\n MethodTypeDesc invocationType,\n ConstantDesc[] bootstrapArgs) {\n this.invocationName = validateMemberName(requireNonNull(invocationName), true);\n this.invocationType = requireNonNull(invocationType);\n this.bootstrapMethod = requireNonNull(bootstrapMethod);\n this.bootstrapArgs = requireNonNull(bootstrapArgs.clone());\n for (int i = 0; i < this.bootstrapArgs.length; i++) {\n requireNonNull(this.bootstrapArgs[i]);\n }\n if (invocationName.length() == 0)\n throw new IllegalArgumentException(\"Illegal invocation name: \" + invocationName);\n }\n\n /**\n * Creates a nominal descriptor for an {@code invokedynamic} call site.\n *\n * @param bootstrapMethod a {@link DirectMethodHandleDesc} describing the\n * bootstrap method for the {@code invokedynamic}\n * @param invocationName The unqualified name that would appear in the {@code NameAndType}\n * operand of the {@code invokedynamic}\n * @param invocationType a {@link MethodTypeDesc} describing the invocation\n * type that would appear in the {@code NameAndType}\n * operand of the {@code invokedynamic}\n * @param bootstrapArgs {@link ConstantDesc}s describing the static arguments\n * to the bootstrap, that would appear in the\n * {@code BootstrapMethods} attribute\n * @return the nominal descriptor\n * @throws NullPointerException if any parameter or its contents are {@code null}\n * @throws IllegalArgumentException if the invocation name has the incorrect\n * format\n * @jvms 4.2.2 Unqualified Names\n */\n public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod,\n String invocationName,\n MethodTypeDesc invocationType,\n ConstantDesc... bootstrapArgs) {\n return new DynamicCallSiteDesc(bootstrapMethod, invocationName, invocationType, bootstrapArgs);\n }\n\n /**\n * Creates a nominal descriptor for an {@code invokedynamic} call site whose\n * bootstrap method has no static arguments.\n *\n * @param bootstrapMethod The bootstrap method for the {@code invokedynamic}\n * @param invocationName The invocationName that would appear in the\n * {@code NameAndType} operand of the {@code invokedynamic}\n * @param invocationType The invocation invocationType that would appear\n * in the {@code NameAndType} operand of the {@code invokedynamic}\n * @return the nominal descriptor\n * @throws NullPointerException if any parameter is null\n * @throws IllegalArgumentException if the invocation name has the incorrect\n * format\n */\n public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod,\n String invocationName,\n MethodTypeDesc invocationType) {\n return new DynamicCallSiteDesc(bootstrapMethod, invocationName, invocationType, EMPTY_CONSTANTDESC);\n }\n\n /**\n * Creates a nominal descriptor for an {@code invokedynamic} call site whose\n * bootstrap method has no static arguments and for which the name parameter\n * is {@link ConstantDescs#DEFAULT_NAME}.\n *\n * @param bootstrapMethod a {@link DirectMethodHandleDesc} describing the\n * bootstrap method for the {@code invokedynamic}\n * @param invocationType a {@link MethodTypeDesc} describing the invocation\n * type that would appear in the {@code NameAndType}\n * operand of the {@code invokedynamic}\n * @return the nominal descriptor\n * @throws NullPointerException if any parameter is null\n */\n public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod,\n MethodTypeDesc invocationType) {\n return of(bootstrapMethod, ConstantDescs.DEFAULT_NAME, invocationType);\n }\n\n /**\n * Returns a nominal descriptor for an {@code invokedynamic} call site whose\n * bootstrap method, name, and invocation type are the same as this one, but\n * with the specified bootstrap arguments.\n *\n * @param bootstrapArgs {@link ConstantDesc}s describing the static arguments\n * to the bootstrap, that would appear in the\n * {@code BootstrapMethods} attribute\n * @return the nominal descriptor\n * @throws NullPointerException if the argument or its contents are {@code null}\n */\n public DynamicCallSiteDesc withArgs(ConstantDesc... bootstrapArgs) {\n return new DynamicCallSiteDesc(bootstrapMethod, invocationName, invocationType, bootstrapArgs);\n }\n\n /**\n * Returns a nominal descriptor for an {@code invokedynamic} call site whose\n * bootstrap and bootstrap arguments are the same as this one, but with the\n * specified invocationName and invocation invocationType\n *\n * @param invocationName The unqualified name that would appear in the {@code NameAndType}\n * operand of the {@code invokedynamic}\n * @param invocationType a {@link MethodTypeDesc} describing the invocation\n * type that would appear in the {@code NameAndType}\n * operand of the {@code invokedynamic}\n * @return the nominal descriptor\n * @throws NullPointerException if any parameter is null\n * @throws IllegalArgumentException if the invocation name has the incorrect\n * format\n * @jvms 4.2.2 Unqualified Names\n */\n public DynamicCallSiteDesc withNameAndType(String invocationName,\n MethodTypeDesc invocationType) {\n return new DynamicCallSiteDesc(bootstrapMethod, invocationName, invocationType, bootstrapArgs);\n }\n\n /**\n * Returns the invocation name that would appear in the {@code NameAndType}\n * operand of the {@code invokedynamic}.\n *\n * @return the invocation name\n */\n public String invocationName() {\n return invocationName;\n }\n\n /**\n * Returns a {@link MethodTypeDesc} describing the invocation type that\n * would appear in the {@code NameAndType} operand of the {@code invokedynamic}.\n *\n * @return the invocation type\n */\n public MethodTypeDesc invocationType() {\n return invocationType;\n }\n\n /**\n * Returns a {@link MethodHandleDesc} describing the bootstrap method for\n * the {@code invokedynamic}.\n *\n * @return the bootstrap method for the {@code invokedynamic}\n */\n public MethodHandleDesc bootstrapMethod() { return bootstrapMethod; }\n\n /**\n * Returns {@link ConstantDesc}s describing the bootstrap arguments for the\n * {@code invokedynamic}. The returned array is always non-null. A zero\n * length array is returned if this {@linkplain DynamicCallSiteDesc} has no\n * bootstrap arguments.\n *\n * @return the bootstrap arguments for the {@code invokedynamic}\n */\n public ConstantDesc[] bootstrapArgs() { return bootstrapArgs.clone(); }\n\n /**\n * Reflectively invokes the bootstrap method with the specified arguments,\n * and return the resulting {@link CallSite}\n *\n * @param lookup The {@link MethodHandles.Lookup} used to resolve class names\n * @return the {@link CallSite}\n * @throws Throwable if any exception is thrown by the bootstrap method\n */\n public CallSite resolveCallSiteDesc(MethodHandles.Lookup lookup) throws Throwable {\n assert bootstrapMethod.invocationType().parameterType(1).equals(CD_String);\n MethodHandle bsm = (MethodHandle) bootstrapMethod.resolveConstantDesc(lookup);\n Object[] args = new Object[bootstrapArgs.length + 3];\n args[0] = lookup;\n args[1] = invocationName;\n args[2] = invocationType.resolveConstantDesc(lookup);\n System.arraycopy(bootstrapArgs, 0, args, 3, bootstrapArgs.length);\n return (CallSite) bsm.invokeWithArguments(args);\n }\n\n /**\n * Compares the specified object with this descriptor for equality. Returns\n * {@code true} if and only if the specified object is also a\n * {@linkplain DynamicCallSiteDesc}, and both descriptors have equal\n * bootstrap methods, bootstrap argument lists, invocation name, and\n * invocation type.\n *\n * @param o the {@code DynamicCallSiteDesc} to compare to this\n * {@code DynamicCallSiteDesc}\n * @return {@code true} if the specified {@code DynamicCallSiteDesc}\n * is equal to this {@code DynamicCallSiteDesc}.\n */\n @Override\n public final boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n DynamicCallSiteDesc specifier = (DynamicCallSiteDesc) o;\n return Objects.equals(bootstrapMethod, specifier.bootstrapMethod) &&\n Arrays.equals(bootstrapArgs, specifier.bootstrapArgs) &&\n Objects.equals(invocationName, specifier.invocationName) &&\n Objects.equals(invocationType, specifier.invocationType);\n }\n\n @Override\n public final int hashCode() {\n int result = Objects.hash(bootstrapMethod, invocationName, invocationType);\n result = 31 * result + Arrays.hashCode(bootstrapArgs);\n return result;\n }\n\n /**\n * Returns a compact textual description of this call site description,\n * including the bootstrap method, the invocation name and type, and\n * the static bootstrap arguments.\n *\n * @return A compact textual description of this call site descriptor\n */\n @Override\n public String toString() {\n return String.format(\"DynamicCallSiteDesc[%s::%s(%s%s):%s]\",\n bootstrapMethod.owner().displayName(),\n bootstrapMethod.methodName(),\n invocationName.equals(ConstantDescs.DEFAULT_NAME) ? \"\" : invocationName + \"/\",\n Stream.of(bootstrapArgs).map(Object::toString).collect(joining(\",\")),\n invocationType.displayDescriptor());\n }\n}\n", "meta": {"content_hash": "c07078b65059e63f64bc4f4f1fd9a656", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 108, "avg_line_length": 46.95539033457249, "alnum_prop": 0.6559258966035943, "repo_name": "mirkosertic/Bytecoder", "id": "cf6d09c14b396056c3ced98c22382e926ebc807d", "size": "13843", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "classlib/java.base/src/main/resources/META-INF/modules/java.base/classes/java/lang/constant/DynamicCallSiteDesc.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "153"}, {"name": "C++", "bytes": "1301"}, {"name": "CSS", "bytes": "5154"}, {"name": "Clojure", "bytes": "87"}, {"name": "HTML", "bytes": "599386"}, {"name": "Java", "bytes": "106011215"}, {"name": "Kotlin", "bytes": "15858"}, {"name": "LLVM", "bytes": "2839"}, {"name": "Shell", "bytes": "164"}]}} +{"text": "module(\"wrapper\", package.seeall)\nlocal json = require(\"cjson.safe\")\n\n-- by default, only call json lib for encoding and decoding\n\nfunction encode(object)\n\treturn json.encode(object)\nend\n\nfunction decode(object)\n\treturn json.decode(object)\nend\n", "meta": {"content_hash": "6d1add8d6dda455f84ea07da89b59215", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 59, "avg_line_length": 20.333333333333332, "alnum_prop": 0.7663934426229508, "repo_name": "paintsnow/luainsight", "id": "f86b6d3bf4614a4ab51e44ded69b59c88789d27c", "size": "244", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "run/lua/wrapper.lua", "mode": "33188", "license": "mit", "language": [{"name": "Common Lisp", "bytes": "973"}, {"name": "Lua", "bytes": "4774"}]}} +{"text": "package pl.darknessNight.AutoUpdateLauncher;\n\nimport org.apache.commons.net.ftp.FTP;\nimport org.apache.commons.net.ftp.FTPReply;\n\nimport java.io.IOException;\nimport java.io.OutputStream;\n\nclass LoginException extends RuntimeException{}\n\npublic class FTPClient {\n org.apache.commons.net.ftp.FTPClient ftpLowLevelClient = null;\n FTPClient(){\n ftpLowLevelClient =new org.apache.commons.net.ftp.FTPClient();\n }\n FTPClient(org.apache.commons.net.ftp.FTPClient client) {\n ftpLowLevelClient =client;\n }\n\n public void RetrieveDataToStreamFromUrl(String url, OutputStream stream) throws IOException{\n ConnectToServerFromUrl(url);\n String filename=getFilenameFromUrl(url);\n RetrieveFile(filename,stream);\n Disconnect();\n }\n\n private static String getFilenameFromUrl(String url){\n return new String();\n }\n\n public void ConnectToServerFromUrl(String url) throws IOException {\n String host=getHostFromUrl(url);\n String user=getUserFromUrl(url);\n String pass=getPassFromUrl(url);\n if(user.isEmpty())\n ConnectToServerAnonymousAndPrepareConnection(host);\n else\n ConnectToServerAndPrepareConnection(host,user,pass);\n }\n\n private static String getHostFromUrl(String url){\n return new String();\n }\n\n private static String getUserFromUrl(String url){\n return new String();\n }\n\n private static String getPassFromUrl(String url){\n return new String();\n }\n\n public void ConnectToServerAndPrepareConnection(String host, String user, String pwd) throws IOException {\n ConnectToServer(host);\n LoginToServer(user, pwd);\n PrepareConnection();\n }\n\n private void LoginToServer(String user, String pwd) throws IOException {\n if(!ftpLowLevelClient.login(user, pwd))\n throw new LoginException();\n }\n\n public void ConnectToServer(String host) throws IOException {\n int reply;\n ftpLowLevelClient.connect(host);\n reply = ftpLowLevelClient.getReplyCode();\n if (!FTPReply.isPositiveCompletion(reply)) {\n ftpLowLevelClient.disconnect();\n throw new IOException(\"Exception in connecting to FTP Server\");\n }\n }\n\n public void ConnectToServerAnonymousAndPrepareConnection(String host) throws IOException {\n ConnectToServer(host);\n PrepareConnection();\n }\n\n private void PrepareConnection() throws IOException {\n ftpLowLevelClient.setFileType(FTP.BINARY_FILE_TYPE);\n ftpLowLevelClient.enterLocalPassiveMode();\n }\n\n public void RetrieveFile(String remoteFilePath, OutputStream stream) throws IOException {\n this.ftpLowLevelClient.retrieveFile(remoteFilePath, stream);\n }\n\n public void Disconnect() {\n if (ftpLowLevelClient.isConnected()) {\n try {\n ftpLowLevelClient.logout();\n } catch (IOException f) {\n //pass\n }\n try {\n ftpLowLevelClient.disconnect();\n } catch (IOException f) {\n //pass\n }\n }\n }\n}\n", "meta": {"content_hash": "525da33418b41da4939c7048b448f470", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 110, "avg_line_length": 30.833333333333332, "alnum_prop": 0.6597774244833068, "repo_name": "darknessNight/AutoUpdateLauncher", "id": "443966e8f5e556196345c5583e92f2f4a55dec01", "size": "3145", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AutoUpdateLauncher/src/main/java/pl/darknessNight/AutoUpdateLauncher/FTPClient.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "33976"}]}} +{"text": "\ufeffusing System;\r\nusing System.Linq;\r\nusing System.Threading.Tasks;\r\nusing ECommon.Components;\r\nusing ECommon.Dapper;\r\nusing ECommon.IO;\r\nusing ECommon.Logging;\r\nusing ECommon.Utilities;\r\nusing ENode.Eventing;\r\nusing ENode.Infrastructure;\r\nusing MySql.Data.MySqlClient;\r\n\r\nnamespace ENode.MySQL\r\n{\r\n public class MySqlPublishedVersionStore : IPublishedVersionStore\r\n {\r\n private const string EventSingleTableNameFormat = \"`{0}`\";\r\n private const string EventTableNameFormat = \"`{0}_{1}`\";\r\n\r\n #region Private Variables\r\n\r\n private string _connectionString;\r\n private string _tableName;\r\n private int _tableCount;\r\n private string _uniqueIndexName;\r\n private ILogger _logger;\r\n private ITimeProvider _timeProvider;\r\n private IOHelper _ioHelper;\r\n\r\n #endregion\r\n\r\n public MySqlPublishedVersionStore Initialize(string connectionString, string tableName = \"PublishedVersion\", int tableCount = 1, string uniqueIndexName = \"IX_PublishedVersion_AggId_Version\")\r\n {\r\n _connectionString = connectionString;\r\n _tableName = tableName;\r\n _tableCount = tableCount;\r\n _uniqueIndexName = uniqueIndexName;\r\n\r\n Ensure.NotNull(_connectionString, \"_connectionString\");\r\n Ensure.NotNull(_tableName, \"_tableName\");\r\n Ensure.Positive(_tableCount, \"_tableCount\");\r\n Ensure.NotNull(_uniqueIndexName, \"_uniqueIndexName\");\r\n\r\n _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);\r\n _timeProvider = ObjectContainer.Resolve<ITimeProvider>();\r\n _ioHelper = ObjectContainer.Resolve<IOHelper>();\r\n\r\n return this;\r\n }\r\n public async Task UpdatePublishedVersionAsync(string processorName, string aggregateRootTypeName, string aggregateRootId, int publishedVersion)\r\n {\r\n await _ioHelper.TryIOActionAsync(async () =>\r\n {\r\n if (publishedVersion == 1)\r\n {\r\n try\r\n {\r\n using (var connection = GetConnection())\r\n {\r\n var currentTime = _timeProvider.GetCurrentTime();\r\n await connection.OpenAsync().ConfigureAwait(false);\r\n await connection.InsertAsync(new\r\n {\r\n ProcessorName = processorName,\r\n AggregateRootTypeName = aggregateRootTypeName,\r\n AggregateRootId = aggregateRootId,\r\n Version = 1,\r\n CreatedOn = currentTime,\r\n UpdatedOn = currentTime\r\n }, GetTableName(aggregateRootId)).ConfigureAwait(false);\r\n }\r\n }\r\n catch (MySqlException ex)\r\n {\r\n if (ex.Number == 1062 && ex.Message.Contains(_uniqueIndexName))\r\n {\r\n return;\r\n }\r\n var errorMessage = string.Format(\"Insert aggregate published version has sql exception, aggregateRootType: {0}, aggregateRootId: {1}\", aggregateRootTypeName, aggregateRootId);\r\n _logger.Error(errorMessage, ex);\r\n throw;\r\n }\r\n catch (Exception ex)\r\n {\r\n var errorMessage = string.Format(\"Insert aggregate published version has unknown exception, aggregateRootType: {0}, aggregateRootId: {1}\", aggregateRootTypeName, aggregateRootId);\r\n _logger.Error(errorMessage, ex);\r\n throw;\r\n }\r\n }\r\n else\r\n {\r\n try\r\n {\r\n using (var connection = GetConnection())\r\n {\r\n await connection.OpenAsync().ConfigureAwait(false);\r\n await connection.UpdateAsync(\r\n new\r\n {\r\n Version = publishedVersion,\r\n UpdatedOn = _timeProvider.GetCurrentTime()\r\n },\r\n new\r\n {\r\n ProcessorName = processorName,\r\n AggregateRootId = aggregateRootId,\r\n Version = publishedVersion - 1\r\n }, GetTableName(aggregateRootId)).ConfigureAwait(false);\r\n }\r\n }\r\n catch (MySqlException ex)\r\n {\r\n var errorMessage = string.Format(\"Update aggregate published version has sql exception, aggregateRootType: {0}, aggregateRootId: {1}\", aggregateRootTypeName, aggregateRootId);\r\n _logger.Error(errorMessage, ex);\r\n throw;\r\n }\r\n catch (Exception ex)\r\n {\r\n var errorMessage = string.Format(\"Update aggregate published version has unknown exception, aggregateRootType: {0}, aggregateRootId: {1}\", aggregateRootTypeName, aggregateRootId);\r\n _logger.Error(errorMessage, ex);\r\n throw;\r\n }\r\n }\r\n }, \"UpdatePublishedVersionAsync\");\r\n }\r\n public async Task<int> GetPublishedVersionAsync(string processorName, string aggregateRootTypeName, string aggregateRootId)\r\n {\r\n return await _ioHelper.TryIOFuncAsync(async () =>\r\n {\r\n try\r\n {\r\n using (var connection = GetConnection())\r\n {\r\n await connection.OpenAsync().ConfigureAwait(false);\r\n var result = await connection.QueryListAsync<int>(new\r\n {\r\n ProcessorName = processorName,\r\n AggregateRootId = aggregateRootId\r\n }, GetTableName(aggregateRootId), \"Version\").ConfigureAwait(false);\r\n return result.SingleOrDefault();\r\n }\r\n }\r\n catch (MySqlException ex)\r\n {\r\n var errorMessage = string.Format(\"Get aggregate published version has sql exception, aggregateRootType: {0}, aggregateRootId: {1}\", aggregateRootTypeName, aggregateRootId);\r\n _logger.Error(errorMessage, ex);\r\n throw;\r\n }\r\n catch (Exception ex)\r\n {\r\n var errorMessage = string.Format(\"Get aggregate published version has unknown exception, aggregateRootType: {0}, aggregateRootId: {1}\", aggregateRootTypeName, aggregateRootId);\r\n _logger.Error(errorMessage, ex);\r\n throw;\r\n }\r\n }, \"GetPublishedVersionAsync\");\r\n }\r\n\r\n private int GetTableIndex(string aggregateRootId)\r\n {\r\n int hash = 23;\r\n foreach (char c in aggregateRootId)\r\n {\r\n hash = (hash << 5) - hash + c;\r\n }\r\n if (hash < 0)\r\n {\r\n hash = Math.Abs(hash);\r\n }\r\n return hash % _tableCount;\r\n }\r\n private string GetTableName(string aggregateRootId)\r\n {\r\n if (_tableCount <= 1)\r\n {\r\n return string.Format(EventSingleTableNameFormat, _tableName);\r\n }\r\n\r\n var tableIndex = GetTableIndex(aggregateRootId);\r\n\r\n return string.Format(EventTableNameFormat, _tableName, tableIndex);\r\n }\r\n private MySqlConnection GetConnection()\r\n {\r\n return new MySqlConnection(_connectionString);\r\n }\r\n }\r\n}\r\n", "meta": {"content_hash": "c233f89332dc3bfb0ef1a1df06d23501", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 203, "avg_line_length": 43.94652406417112, "alnum_prop": 0.4930640058408372, "repo_name": "tangxuehua/enode", "id": "53854d4f526deae3e922635a002e225481ad539c", "size": "8220", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ENode.MySQL/MySqlPublishedVersionStore.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "570099"}, {"name": "TSQL", "bytes": "1681"}]}} +{"text": "package com.wuyin.supermarket.httpresult;\n\nimport com.wuyin.supermarket.httpresult.base.BaseHttpRequest;\nimport com.wuyin.supermarket.model.AppInfo;\n\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Created by yinlong on 2016/5/11.\n */\npublic class DetailHttpRequest extends BaseHttpRequest<AppInfo> {\n\n String packageName;\n\n public DetailHttpRequest(String packageName) {\n this.packageName = packageName;\n }\n\n @Override\n public AppInfo parseJson(String results) {\n\n try {\n JSONObject result = new JSONObject(results);\n String id = result.getString(\"id\");\n String name = result.getString(\"name\");\n String packageName = result.getString(\"packageName\");\n String iconUrl = result.getString(\"iconUrl\");\n float stars = result.getLong(\"stars\");\n long size = result.getLong(\"size\");\n String downLoadUrl = result.getString(\"downloadUrl\");\n String des = result.getString(\"des\");\n\n String downloadNum = result.getString(\"downloadNum\");\n String version = result.getString(\"version\");\n String date = result.getString(\"date\");\n String author = result.getString(\"author\");\n\n List<String> screen = new ArrayList<>();\n JSONArray screenArray = result.getJSONArray(\"screen\");\n for (int i = 0; i < screenArray.length(); i++) {\n screen.add(screenArray.getString(i));\n }\n\n List<String> safeUrl = new ArrayList<>();\n List<String> safeDesUrl = new ArrayList<>();\n List<String> safeDes = new ArrayList<>();\n List<Integer> safeDesColor = new ArrayList<>();\n JSONArray safeUrlArray = result.getJSONArray(\"safe\");\n for (int i = 0; i < safeUrlArray.length(); i++) {\n JSONObject jsonObject = safeUrlArray.getJSONObject(i);\n safeUrl.add(jsonObject.getString(\"safeUrl\"));\n safeDesUrl.add(jsonObject.getString(\"safeDesUrl\"));\n safeDes.add(jsonObject.getString(\"safeDes\"));\n safeDesColor.add(jsonObject.getInt(\"safeDesColor\"));\n }\n\n AppInfo appInfo = new AppInfo(id, name, packageName, iconUrl, stars, size, downLoadUrl, des,\n downloadNum, version, date, author, screen,\n safeUrl, safeDesUrl, safeDes, safeDesColor);\n\n return appInfo;\n } catch (JSONException e) {\n e.printStackTrace();\n return null;\n }\n }\n\n @Override\n public String getKey() {\n return \"detail\";\n }\n\n /**\n * \u989d\u5916\u5e26\u7684\u53c2\u6570\n *\n * @return\n */\n @Override\n public String getParams() {\n return \"&packageName=\" + packageName;\n }\n}\n", "meta": {"content_hash": "354dff053eb2155a5581ef3414b7f243", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 104, "avg_line_length": 33.10344827586207, "alnum_prop": 0.5954861111111112, "repo_name": "wuyinlei/SuperMarket", "id": "88cfe134012b38ecdb5e26f4757c018e8dc8b213", "size": "2892", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/wuyin/supermarket/httpresult/DetailHttpRequest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Groff", "bytes": "1625"}, {"name": "Java", "bytes": "173264"}]}} +{"text": "\ufeffusing System;\n\nnamespace Tasks\n{\n\tpublic interface IConsole\n\t{\n\t\tstring ReadLine();\n\n\t\tvoid Write(string format, params object[] args);\n\n\t\tvoid WriteLine(string format, params object[] args);\n\n\t\tvoid WriteLine();\n\t}\n}\n", "meta": {"content_hash": "2b2314003fa642ad3a768aa5c9cd5761", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 54, "avg_line_length": 14.6, "alnum_prop": 0.6986301369863014, "repo_name": "codurance/task-list", "id": "05fc18cbe670b34a4360ad8eb5adba8da46d53a4", "size": "221", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "csharp/Tasks/IConsole.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "11356"}, {"name": "Go", "bytes": "8897"}, {"name": "Java", "bytes": "12921"}, {"name": "Kotlin", "bytes": "3918"}, {"name": "Python", "bytes": "7146"}, {"name": "Ruby", "bytes": "5730"}, {"name": "Scala", "bytes": "5911"}, {"name": "Shell", "bytes": "531"}, {"name": "TypeScript", "bytes": "8608"}]}} +{"text": "\npackage business;\n\nimport business.category.CategoryDao;\nimport business.category.CategoryDaoGuava;\nimport business.category.CategoryDaoJdbc;\nimport business.category.CategoryService;\nimport business.category.DefaultCategoryService;\nimport business.customer.CustomerDao;\nimport business.customer.CustomerDaoJdbc;\nimport business.customer.CustomerService;\nimport business.customer.DefaultCustomerService;\nimport business.order.CustomerOrderDao;\nimport business.order.CustomerOrderDaoJdbc;\nimport business.order.CustomerOrderLineItemDao;\nimport business.order.CustomerOrderLineItemDaoJdbc;\nimport business.order.CustomerOrderService;\nimport business.order.DefaultCustomerOrderService;\nimport business.product.DefaultProductService;\nimport business.product.ProductDao;\nimport business.product.ProductDaoGuava;\nimport business.product.ProductDaoJdbc;\nimport business.product.ProductService;\nimport java.util.concurrent.ScheduledExecutorService;\nimport java.util.concurrent.ScheduledThreadPoolExecutor;\nimport java.util.concurrent.TimeUnit;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n/**\n */\npublic final class ApplicationContext {\n\n private final Logger logger = LoggerFactory.getLogger(getClass());\n\n private ProductService productService;\n\n private CategoryService categoryService;\n\n private CustomerService customerService;\n\n private CustomerOrderService customerOrderService;\n\n private ScheduledExecutorService executorService;\n\n public static ApplicationContext INSTANCE = new ApplicationContext();\n\n private ApplicationContext() {\n\n executorService = new ScheduledThreadPoolExecutor(Runtime.getRuntime().availableProcessors());\n\n // wire up the business.dao layer \"by hand\"\n ProductDao productDao = new ProductDaoJdbc();\n\n ProductDaoGuava cachedProductDao = new ProductDaoGuava(productDao);\n\n productService = new DefaultProductService();\n ((DefaultProductService) productService).setProductDao(cachedProductDao);\n\n CategoryDao categoryDao = new CategoryDaoJdbc();\n\n CategoryDaoGuava cachedCategoryDao = new CategoryDaoGuava(categoryDao);\n\n categoryService = new DefaultCategoryService();\n ((DefaultCategoryService) categoryService).setCategoryDao(cachedCategoryDao);\n\n CustomerDao customerDao = new CustomerDaoJdbc();\n customerService = new DefaultCustomerService();\n ((DefaultCustomerService) customerService).setCustomerDao(customerDao);\n\n CustomerOrderLineItemDao customerOrderLineItemDao = new CustomerOrderLineItemDaoJdbc();\n CustomerOrderDao customerOrderDao = new CustomerOrderDaoJdbc();\n\n customerOrderService = new DefaultCustomerOrderService();\n DefaultCustomerOrderService service = (DefaultCustomerOrderService) customerOrderService;\n service.setProductDao(cachedProductDao);\n service.setCustomerService(customerService);\n service.setCustomerOrderDao(customerOrderDao);\n service.setCustomerOrderLineItemDao(customerOrderLineItemDao);\n\n executorService.scheduleWithFixedDelay(() -> {\n try {\n logger.info(\"Refreshing category and product caches....commencing\");\n cachedCategoryDao.bulkload();\n cachedProductDao.clear();\n logger.info(\"Refreshing category and product caches....complete!\");\n } catch (Throwable t) {\n logger.error(\"Encountered trouble refreshing category and product caches.\", t);\n }\n }, 10, 60, TimeUnit.MINUTES);\n }\n\n\n\n public ProductService getProductService() {\n return productService;\n }\n\n public CategoryService getCategoryService() {\n return categoryService;\n }\n\n public CustomerService getCustomerService() {\n return customerService;\n }\n\n public CustomerOrderService getCustomerOrderService() {\n return customerOrderService;\n }\n\n public void shutdown() {\n executorService.shutdown();\n }\n}\n", "meta": {"content_hash": "2e5e5491b83058a8f3e193d14d4514b9", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 102, "avg_line_length": 35.41228070175438, "alnum_prop": 0.7485756750061927, "repo_name": "nowucca/SimpleAffableBean", "id": "94fc291274aed1406f2df203c0ba6f1c017344ae", "size": "5660", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/business/ApplicationContext.java", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "9504"}, {"name": "Java", "bytes": "343995"}, {"name": "JavaScript", "bytes": "4976"}]}} +{"text": "package org.zstack.sdk.iam2.api;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.zstack.sdk.*;\n\npublic class AddAttributesToIAM2VirtualIDGroupAction extends AbstractAction {\n\n private static final HashMap<String, Parameter> parameterMap = new HashMap<>();\n\n private static final HashMap<String, Parameter> nonAPIParameterMap = new HashMap<>();\n\n public static class Result {\n public ErrorCode error;\n public org.zstack.sdk.iam2.api.AddAttributesToIAM2VirtualIDGroupResult value;\n\n public Result throwExceptionIfError() {\n if (error != null) {\n throw new ApiException(\n String.format(\"error[code: %s, description: %s, details: %s]\", error.code, error.description, error.details)\n );\n }\n \n return this;\n }\n }\n\n @Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false)\n public java.lang.String uuid;\n\n @Param(required = true, nonempty = true, nullElements = false, emptyString = true, noTrim = false)\n public java.util.List attributes;\n\n @Param(required = false)\n public java.util.List systemTags;\n\n @Param(required = false)\n public java.util.List userTags;\n\n @Param(required = false)\n public String sessionId;\n\n @Param(required = false)\n public String accessKeyId;\n\n @Param(required = false)\n public String accessKeySecret;\n\n @Param(required = false)\n public String requestIp;\n\n @NonAPIParam\n public long timeout = -1;\n\n @NonAPIParam\n public long pollingInterval = -1;\n\n\n private Result makeResult(ApiResult res) {\n Result ret = new Result();\n if (res.error != null) {\n ret.error = res.error;\n return ret;\n }\n \n org.zstack.sdk.iam2.api.AddAttributesToIAM2VirtualIDGroupResult value = res.getResult(org.zstack.sdk.iam2.api.AddAttributesToIAM2VirtualIDGroupResult.class);\n ret.value = value == null ? new org.zstack.sdk.iam2.api.AddAttributesToIAM2VirtualIDGroupResult() : value; \n\n return ret;\n }\n\n public Result call() {\n ApiResult res = ZSClient.call(this);\n return makeResult(res);\n }\n\n public void call(final Completion<Result> completion) {\n ZSClient.call(this, new InternalCompletion() {\n @Override\n public void complete(ApiResult res) {\n completion.complete(makeResult(res));\n }\n });\n }\n\n protected Map<String, Parameter> getParameterMap() {\n return parameterMap;\n }\n\n protected Map<String, Parameter> getNonAPIParameterMap() {\n return nonAPIParameterMap;\n }\n\n protected RestInfo getRestInfo() {\n RestInfo info = new RestInfo();\n info.httpMethod = \"POST\";\n info.path = \"/iam2/projects/groups/{uuid}/attributes\";\n info.needSession = true;\n info.needPoll = true;\n info.parameterName = \"params\";\n return info;\n }\n\n}\n", "meta": {"content_hash": "09c352ce3b0910ad195b63ff810302eb", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 165, "avg_line_length": 28.951923076923077, "alnum_prop": 0.6343407505812022, "repo_name": "zstackorg/zstack", "id": "a5bb512701d861945cdf0827326af451608d0112", "size": "3011", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "sdk/src/main/java/org/zstack/sdk/iam2/api/AddAttributesToIAM2VirtualIDGroupAction.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "AspectJ", "bytes": "54952"}, {"name": "Batchfile", "bytes": "1132"}, {"name": "Groovy", "bytes": "832169"}, {"name": "Java", "bytes": "15798995"}, {"name": "Shell", "bytes": "152829"}]}} +{"text": "FROM balenalib/surface-go-fedora:32-build\n\n# http://bugs.python.org/issue19846\n# > At the moment, setting \"LANG=C\" on a Linux system *fundamentally breaks Python 3*, and that's not OK.\nENV LANG C.UTF-8\n\nRUN dnf install -y \\\n\t\tpython-pip \\\n\t\tpython-dbus \\\n\t&& dnf clean all\n\n# install \"virtualenv\", since the vast majority of users of this image will want it\nRUN pip install -U --no-cache-dir --ignore-installed pip setuptools \\\n\t&& pip install --no-cache-dir virtualenv\n\nRUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'As of January 1st, 2020, Python 2 was end-of-life, we will change the latest tag for Balenalib Python base image to Python 3.x and drop support for Python 2 soon. So after 1st July, 2020, all the balenalib Python latest tag will point to the latest Python 3 version and no changes, or fixes will be made to balenalib Python 2 base image. If you are using Python 2 for your application, please upgrade to Python 3 before 1st July.' > /.balena/messages/python-deprecation-warning\n\nCMD [\"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\"]\n\n RUN curl -SLO \"https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh\" \\\n && echo \"Running test-stack@python\" \\\n && chmod +x test-stack@python.sh \\\n && bash test-stack@python.sh \\\n && rm -rf test-stack@python.sh \n\nRUN [ ! -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: Intel 64-bit (x86-64) \\nOS: Fedora 32 \\nVariant: build variant \\nDefault variable(s): UDEV=off \\nThe following software stack is preinstalled: \\nPython v2.7.18, Pip v21.0.1, Setuptools v56.0.0 \\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\n\nRUN echo $'#!/bin/sh.real\\nbalena-info\\nrm -f /bin/sh\\ncp /bin/sh.real /bin/sh\\n/bin/sh \"$@\"' > /bin/sh-shim \\\n\t&& chmod +x /bin/sh-shim \\\n\t&& cp /bin/sh /bin/sh.real \\\n\t&& mv /bin/sh-shim /bin/sh", "meta": {"content_hash": "ddfcb8d79b3743fee522f3d7d4815a8f", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 723, "avg_line_length": 78.3225806451613, "alnum_prop": 0.7327018121911038, "repo_name": "nghiant2710/base-images", "id": "b2d05371eeaac3c8ba49fecf515ff9924ba7265c", "size": "2449", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/python/surface-go/fedora/32/2.7.18/build/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Dockerfile", "bytes": "144558581"}, {"name": "JavaScript", "bytes": "16316"}, {"name": "Shell", "bytes": "368690"}]}} +{"text": "/* IBM_PROLOG_BEGIN_TAG */\n/* This is an automatically generated prolog. */\n/* */\n/* $Source: src/import/generic/memory/lib/utils/omi/gen_omi_traits.H $ */\n/* */\n/* OpenPOWER HostBoot Project */\n/* */\n/* Contributors Listed Below - COPYRIGHT 2019,2022 */\n/* [+] International Business Machines Corp. */\n/* */\n/* */\n/* Licensed under the Apache License, Version 2.0 (the \"License\"); */\n/* you may not use this file except in compliance with the License. */\n/* You may obtain a copy of the License at */\n/* */\n/* http://www.apache.org/licenses/LICENSE-2.0 */\n/* */\n/* Unless required by applicable law or agreed to in writing, software */\n/* distributed under the License is distributed on an \"AS IS\" BASIS, */\n/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */\n/* implied. See the License for the specific language governing */\n/* permissions and limitations under the License. */\n/* */\n/* IBM_PROLOG_END_TAG */\n\n///\n/// @file gen_omi_traits.H\n/// @brief Generic Traits file for OMI code\n///\n// *HWP HWP Owner: Geetha Pisapati <Geetha.Pisapati@ibm.com>\n// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com>\n// *HWP Team: Memory\n// *HWP Level: 3\n// *HWP Consumed by: HB:FSP\n// EKB-Mirror-To: hostboot\n\n#ifndef _GEN_OMI_TRAITS_H_\n#define _GEN_OMI_TRAITS_H_\n\n#include <fapi2.H>\n\nnamespace mss\n{\nnamespace omi\n{\n///\n/// @class omiTraits\n/// @tparam MC the mc type\n/// @brief A MC to MC_TARGET_TYPE mapping\n///\ntemplate< mss::mc_type MC >\nclass omiTraits;\n\n\n} // end omi ns\n\n} // end mss ns\n#endif\n", "meta": {"content_hash": "e35ec671ba774cc82c7fc6c525b0dd9b", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 76, "avg_line_length": 41.93103448275862, "alnum_prop": 0.41776315789473684, "repo_name": "open-power/hostboot", "id": "1b773aebb7d2f240ab1dce4ae6d8ebe4ae9ea040", "size": "2432", "binary": false, "copies": "1", "ref": "refs/heads/master-p10", "path": "src/import/generic/memory/lib/utils/omi/gen_omi_traits.H", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "84276"}, {"name": "C", "bytes": "29945981"}, {"name": "C++", "bytes": "126613976"}, {"name": "CMake", "bytes": "1852"}, {"name": "Lex", "bytes": "8996"}, {"name": "M4", "bytes": "5738"}, {"name": "Makefile", "bytes": "772285"}, {"name": "Meson", "bytes": "23911"}, {"name": "Perl", "bytes": "2605582"}, {"name": "Python", "bytes": "2602753"}, {"name": "Shell", "bytes": "290164"}, {"name": "Tcl", "bytes": "76031"}, {"name": "XSLT", "bytes": "9553"}, {"name": "Yacc", "bytes": "29440"}]}} +{"text": "<?php\r\n\r\n\r\nnamespace Zend\\Form\\Annotation;\r\n\r\n/**\r\n * Hydrator annotation\r\n *\r\n * Use this annotation to specify a specific hydrator class to use with the form.\r\n * The value should be a string indicating the fully qualified class name of the\r\n * hydrator to use.\r\n *\r\n * @Annotation\r\n * @package Zend_Form\r\n * @subpackage Annotation\r\n */\r\nclass Hydrator extends AbstractStringAnnotation\r\n{\r\n /**\r\n * Retrieve the hydrator class\r\n *\r\n * @return null|string\r\n */\r\n public function getHydrator()\r\n {\r\n return $this->value;\r\n }\r\n}\r\n", "meta": {"content_hash": "d0f1135f8efd4553b6283dbcafed1f77", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 81, "avg_line_length": 20.25, "alnum_prop": 0.6313932980599647, "repo_name": "OtsList/OtsList.eu-AAC-for-OpenTibia", "id": "42ec55d4e50e1931c623413dca441e207231e652", "size": "900", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "vendor/ZF2/library/Zend/Form/Annotation/Hydrator.php", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "PHP", "bytes": "464533"}]}} +{"text": "[](https://github.com/RichardLitt/standard-readme)\n[][Gitter]\n[][Releases]\n\n> Ethereum miner with OpenCL, CUDA and stratum support\n\nThe ethminer is an Ethereum GPU mining worker. This is the actively maintained version of ethminer. It originates from [cpp-ethereum] project (where GPU mining has been discontinued) and builds on the improvements made in [Genoil's fork]. See [FAQ](#faq) for more details.\n\n### Features\n\n- OpenCL mining\n- Nvidia CUDA mining\n- realistic benchmarking against arbitrary epoch/DAG/blocknumber\n- on-GPU DAG generation (no more DAG files on disk)\n- stratum mining without proxy\n- OpenCL devices picking\n- farm failover (getwork + stratum)\n\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [Build](#build)\n - [Continuous Integration and development builds](#continuous-integration-and-development-builds)\n - [Building from source](#building-from-source)\n - [CMake configuration options](#cmake-configuration-options)\n- [Maintainer](#maintainer) \n- [Contribute](#contribute)\n- [F.A.Q.](#faq)\n\n\n## Install\n\n[][Releases]\n\nStandalone **executables** for _Linux_, _macOS_ and _Windows_ are provided in\nthe [Releases] section.\nDownload an archive for your operating system and unpack the content to a place\naccessible from command line. The ethminer is ready to go.\n\n\n## Usage\n\nThe **ethminer** is a command line program. This means you launch it either\nfrom a Windows command prompt or Linux console, or create shortcuts to\npredefined command lines using a Linux Bash script or Windows batch/cmd file.\nFor a full list of available command, please run\n\n```sh\nethminer --help\n```\n\n\n## Build\n\n### Continuous Integration and development builds\n\n| CI | OS | Status | Development builds |\n| ------------- | ------------- | ----- | ----------------- |\n| [Travis CI] | Linux, macOS | [][Travis CI] | \u2717 No build artifacts, [Amazon S3 is needed] for this |\n| [AppVeyor] | Windows | [][AppVeyor] | \u2713 Build artifacts available for all PRs and branches |\n\nThe AppVeyor system automatically builds a Windows .exe for every commit. The latest version is always available [on the landing page](https://ci.appveyor.com/project/ethereum-mining/ethminer) or you can [browse the history](https://ci.appveyor.com/project/ethereum-mining/ethminer/history) to access previous builds.\n\nTo download the .exe on a build under 'JOB NAME' select 'Configuration: Release', choose 'ARTIFACTS' then download the zip file.\n\n\n### Building from source\n\nThis project uses [CMake] and [Hunter] package manager.\n\n1. Create a build directory.\n\n ```sh\n mkdir build; cd build\n ```\n\n2. Configure the project with CMake. Check out additional\n [configuration options](#cmake-configuration-options).\n\n ```sh\n cmake ..\n ```\n\n3. Build the project using [CMake Build Tool Mode]. This is a portable variant\n of `make`.\n\n ```sh\n cmake --build .\n ```\n\n4. _(Optional, Linux only)_ Install the built executable.\n\n ```sh\n sudo make install\n ```\n\n#### OpenCL support on Linux\n\nIf you're planning to use [OpenCL on Linux](https://github.com/ruslo/hunter/wiki/pkg.opencl#pitfalls)\nyou have to install OpenGL libraries. E.g. on Ubuntu run:\n\n```sh\nsudo apt-get install mesa-common-dev\n```\n\n#### Disable Hunter\n\nIf you want to install dependencies yourself or use system package manager\nyou can disable Hunter by adding\n[-DHUNTER_ENABLED=OFF](https://docs.hunter.sh/en/latest/reference/user-variables.html#hunter-enabled)\nto configuration options.\n\n### CMake configuration options\n\nPass these options to CMake configuration command, e.g.\n\n```sh\ncmake .. -DETHASHCUDA=ON -DETHASHCL=OFF\n```\n\n- `-DETHASHCL=ON` - enable OpenCL mining, `ON` by default,\n- `-DETHASHCUDA=ON` - enable CUDA mining, `OFF` by default,\n- `-DETHSTRATUM=ON` - build with Stratum protocol support, `ON` by default.\n\n\n## Maintainer\n\n[][Gitter]\n\n- Pawe\u0142 Bylica [@chfast](https://github.com/chfast)\n\n\n## Contribute\n\n[][Gitter]\n\nTo meet the community, ask general questions and chat about ethminer join [the ethminer channel on Gitter][Gitter].\n\nAll bug reports, pull requests and code reviews are very much welcome.\n\n\n## F.A.Q\n\n1. Why is my hashrate with Nvidia cards on Windows 10 so low?\n\n The new WDDM 2.x driver on Windows 10 uses a different way of addressing the GPU. This is good for a lot of things, but not for ETH mining.\n For Kepler GPUs: I actually don't know. Please let me know what works best for good old Kepler.\n For Maxwell 1 GPUs: Unfortunately the issue is a bit more serious on the GTX750Ti, already causing suboptimal performance on Win7 and Linux. Apparently about 4MH/s can still be reached on Linux, which, depending on ETH price, could still be profitable, considering the relatively low power draw.\n For Maxwell 2 GPUs: There is a way of mining ETH at Win7/8/Linux speeds on Win10, by downgrading the GPU driver to a Win7 one (350.12 recommended) and using a build that was created using CUDA 6.5.\n For Pascal GPUs: You have to use the latest WDDM 2.1 compatible drivers in combination with Windows 10 Anniversary edition in order to get the full potential of your Pascal GPU.\n\n2. Why is a GTX 1080 slower than a GTX 1070?\n\n Because of the GDDR5X memory, which can't be fully utilized for ETH mining (yet).\n\n3. Are AMD cards also affected by slowdowns with increasing DAG size?\n\n Only GCN 1.0 GPUs (78x0, 79x0, 270, 280), but in a different way. You'll see that on each new epoch (30K blocks), the hashrate will go down a little bit.\n\n4. Can I still mine ETH with my 2GB GPU?\n\n No.\n\n5. What are the optimal launch parameters?\n\n The default parameters are fine in most scenario's (CUDA). For OpenCL it varies a bit more. Just play around with the numbers and use powers of 2. GPU's like powers of 2.\n \n6. What does the ```--cuda-parallel-hash``` flag do?\n\n @davilizh made improvements to the CUDA kernel hashing process and added this flag to allow changing the number of tasks it runs in parallel. These improvements were optimised for GTX 1060 GPUs which saw a large increase in hashrate, GTX 1070 and GTX 1080/Ti GPUs saw some, but less, improvement. The default value is 4 (which does not need to be set with the flag) and in most cases this will provide the best performance.\n\n7. What is ethminer's relationship with [Genoil's fork]?\n\n [Genoil's fork] was the original source of this version, but as Genoil is no longer consistently maintaining that fork it became almost impossible for developers to get new code merged there. In the interests of progressing development without waiting for reviews this fork should be considered the active one and Genoil's as legacy code.\n\n\n\n\n\n[Amazon S3 is needed]: https://docs.travis-ci.com/user/uploading-artifacts/\n[AppVeyor]: https://ci.appveyor.com/project/ethereum-mining/ethminer\n[CMake]: https://cmake.org\n[CMake Build Tool Mode]: https://cmake.org/cmake/help/latest/manual/cmake.1.html#build-tool-mode\n[cpp-ethereum]: https://github.com/ethereum/cpp-ethereum\n[Genoil's fork]: https://github.com/Genoil/cpp-ethereum\n[Gitter]: https://gitter.im/ethereum-mining/ethminer\n[Hunter]: https://docs.hunter.sh\n[Releases]: https://github.com/ethereum-mining/ethminer/releases\n[Travis CI]: https://travis-ci.org/ethereum-mining/ethminer\n", "meta": {"content_hash": "7bc9a67494e3a0bcbb22bad87d85e9fd", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 426, "avg_line_length": 41.068062827225134, "alnum_prop": 0.7389087200407956, "repo_name": "quantumpayment/bopminer", "id": "8829082aa5823a7d4c1bc9b86b11dd211f98e202", "size": "7861", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "87464"}, {"name": "C++", "bytes": "568233"}, {"name": "CMake", "bytes": "34069"}, {"name": "Cuda", "bytes": "50365"}, {"name": "Shell", "bytes": "2560"}]}} +{"text": "from accessData import getHDFData\nfrom voronoi import voronoi\nimport inSituCluster as clusterLib\nimport matplotlib.pyplot as plt\nfrom IPython import embed\nimport numpy as np\n#import cv2\nimport os\nimport scipy.spatial as kd\n\nkdt = None\narr = None\ngradx = None\ngrady = None\ngrad = None\nimgCntr = 0\nyPts = None\nxPts = None\n\n\ndef createHist(inputData, lowerBound=None, upperBound=None, ignore=None):\n \"\"\" Create Histogram with matplotlib\n Parameters:\n data - The input data to be processed\n lowerBound - The smallest value to consider for the histogram\n upperBound - the largest value to consider for the histogram\n ignore - A list of values to ignore from the histogram\n \"\"\"\n\n data = inputData.copy()\n if ignore is not None:\n for val in ignore: # Consecutively remove the values to be ignored\n data = data[np.where(data != val)]\n if lowerBound is None:\n lowerBound = data.min()\n if upperBound is None:\n upperBound = data.max()\n sampleData = data[np.where(data < upperBound)]\n sampleData = sampleData[np.where(sampleData >= lowerBound)]\n sampleSize = sampleData.size\n# Scott's (1979) bin width. Based on the standard deviation\n# and the data size\n n = np.power(sampleSize, 1.0 / 3)\n std = np.std(sampleData)\n bin_width = (3.49 * std) / n\n histSize = int((upperBound - lowerBound) / bin_width)\n ranges = (lowerBound, upperBound)\n hist = plt.hist(sampleData, histSize, ranges)\n plt.axes().set_aspect('equal')\n plt.show()\n\n return hist\n\n\ndef quantize(data, cutoff, numRegions=8, tolerance=0.0001):\n\n newData = data[::4, ::4] # Downsample data to speed up by a factor of 16\n # Next remove clouds poorly represented data\n cleanData = newData[np.logical_and(newData > 0, newData < cutoff)]\n\n tess = voronoi(cleanData, numRegions, tolerance, data)\n\n thresh = []\n for val in tess.values():\n thresh.append(np.min(val))\n thresh = np.sort(thresh)\n\n (rows, cols) = data.shape\n qData = np.ndarray((rows, cols), dtype='uint8')\n qData.fill(255)\n\n for val, t in enumerate(thresh):\n qData[data > t] = val + 1\n\n qData[data == 0] = 0 # Put back the land values\n qData[data == -1] = 255 # Put back the cloud values\n\n return qData\n\n\ndef colorMap(data):\n\n colors = [(123, 0, 255), (0, 0, 255), (0, 255, 255), (0, 255, 0),\n (123, 255, 0), (255, 255, 0), (255, 123, 0), (255, 0, 0)]\n\n (rows, cols) = data.shape\n color = np.ndarray((rows, cols, 3), dtype='uint8')\n color.fill(255)\n\n # Fill land with black\n color[data == 0] = (0, 0, 0)\n\n for i, c in enumerate(colors):\n color[data == i + 1] = c\n #plt.imshow(color)\n #plt.show()\n\n return color\n\n\ndef writeClouds(data):\n\n # Only clouds should be left as -1\n locs = np.where(data == -1)\n numPts = locs[0].size\n with open(\"data/clouds.dat\", 'w') as fd:\n for i in xrange(numPts):\n if i % 100000 == 0:\n print i\n x = locs[0][i]\n y = locs[1][i]\n fd.write(\"%d %d\\n\" % (x, y))\n\n\ndef findSurroundingVal(qData, cluster, clusterVal=255):\n \"\"\" Summary:\n Check and see if the cluster is surrounded by a solid value, if it\n is, return the value which surrounds it. This one checks for border\n conditions\n Parameters:\n qData: The quantized satellite data.\n cluster: A 2D array of shape (2,n) where n is the number of points\n composing the cluster. The two rows are parallel arrays of x\n then y coordinates respectively.\n Returns:\n theValue: The surrounding value found.\n \"\"\"\n\n theValue = None\n\n lk = set([(0, 1), (1, 1), (1, 0), (-1, 0), (-1, 1)]) # Left Kernel\n rk = set([(1, -1), (1, 0), (-1, 0), (-1, -1), (0, -1)]) # Right Kernel\n tk = set([(1, -1), (0, 1), (1, 1), (0, -1), (1, 0)]) # Top Kernel\n bk = set([(-1, -1), (0, 1), (-1, 1), (0, -1), (-1, 0)]) # Bottom Kernel\n mk = np.array(tuple(lk.union(rk))) # Middle Kernel\n tlk = np.array(tuple(tk.intersection(lk))) # Top Left Kernel\n trk = np.array(tuple(tk.intersection(rk))) # Top Right Kernel\n blk = np.array(tuple(bk.intersection(lk))) # Bottom Left Kernel\n brk = np.array(tuple(bk.intersection(rk))) # Bottom Right Kernel\n lk = np.array(tuple(lk))\n rk = np.array(tuple(rk))\n tk = np.array(tuple(tk))\n bk = np.array(tuple(bk))\n\n rows, cols = qData.shape\n neighbors = {}\n\n for pt in cluster.T:\n row, col = pt\n k = None\n kused = None\n if row > 0:\n if col > 0:\n if row < rows - 1:\n if col < cols - 1:\n k = (mk + pt).T\n kused = \"middle\"\n else:\n k = (rk + pt).T\n kused = \"right\"\n elif col < cols - 1:\n k = (bk + pt).T\n kused = \"bottom\"\n else:\n k = (brk + pt).T\n kused = \"bottom right\"\n elif row < rows - 1:\n k = (lk + pt).T\n kused = \"left\"\n else:\n k = (blk + pt).T\n kused = \"bottom left\"\n elif col > 0:\n if col < cols - 1:\n k = (tk + pt).T\n kused = \"top\"\n else:\n k = (trk + pt).T\n kused = \"top right\"\n else:\n k = (tlk + pt).T\n kused = \"top left\"\n\n try:\n values = qData[tuple(k)]\n except:\n print \"row %d out of %d\" % (row, rows)\n print \"col %d out of %d\" % (col, cols)\n print \"pt = \", pt\n print \"k used = \", kused\n print \"resulting k = \", k\n qData.fill(0)\n qData[tuple(pt)] = 255\n plt.imshow(qData)\n plt.axes().set_aspect('equal')\n plt.show()\n\n if clusterVal == 255:\n for value in values:\n if value == clusterVal or value == 0 or value == 255:\n continue\n\n if theValue is None:\n theValue = value\n elif value != theValue:\n return None\n else:\n for value in values:\n if value == clusterVal or value == 0:\n continue\n\n if value in neighbors.keys():\n neighbors[value] += 1\n else:\n neighbors[value] = 1\n\n maximum = 0\n for k, v in neighbors.iteritems():\n if v > maximum:\n theValue = k\n\n if theValue is None:\n return clusterVal\n else:\n return theValue\n\n\ndef filter(img):\n \"\"\"\n Summary: A filter to remove all points with less than 3 neighbors.\n Parameters:\n img - The image to be filtered\n Returns:\n output - The filtered dataset. Same dimensions as img\n \"\"\"\n\n # Add the border mask\n cpy = np.ndarray((img.shape[0] + 2, img.shape[1] + 2))\n cpy[:, 0] = 0\n cpy[0, :] = 0\n cpy[:, -1] = 0\n cpy[-1, :] = 0\n cpy[1:-1, 1:-1] = img.copy()\n h, w = cpy.shape\n for y in xrange(1, h - 2):\n for x in xrange(1, w - 2):\n val = img[y, x]\n # Extract a 3x3 sub matrix\n submat = cpy[y - 1:y + 2, x - 1:x + 2]\n #print \"submat \\n\", submat\n #print \"kernel \\n\", kernel\n numOccurence = submat[submat == val].size\n\n if numOccurence < 3:\n cpy[y, x] = 0.0 # So remove it!\n\n output = np.where(cpy == 1)\n\n return output\n\n\ndef findMaximama(array):\n \"\"\" Find the maxima of a 1D array \"\"\"\n\n binSizes = array[0]\n binVals = array[1][:-1]\n c = (np.diff(np.sign(np.diff(binSizes))) < 0).nonzero()[0] + 1 # local max\n\n # Set to True to plot the maxima\n if False:\n plt.plot(binVals, binSizes)\n plt.plot(binVals[c], binSizes[c], \"o\", label=\"max\")\n plt.legend()\n plt.axes().set_aspect('equal')\n plt.show()\n\n return binVals[c]\n\n\ndef extractStepEdges(img):\n \"\"\"\n Summary: A filter to find all step edges in the dataset:\n img - The image to be filtered\n Returns:\n output - The filtered dataset. Same dimensions as img\n \"\"\"\n\n subImg = img[1:-1, 1:-1]\n pts = np.array(np.where(subImg == 1))\n\n yVals = []\n xVals = []\n for y, x in pts.T:\n y += 1 # Pts were found with borders extracted\n x += 1 # Pts were found with borders extracted\n val = img[y,x]\n # Extract a 3x3 sub matrix\n submat = img[y - 1:y + 2, x - 1:x + 2]\n targetPts = np.logical_and(submat != val, submat != 255)\n numOccurence = submat[targetPts].size\n\n if numOccurence > 0:\n yVals.append(y)\n xVals.append(x)\n\n edgePts = np.array((yVals, xVals))\n\n #img[(yVals, xVals)] = 8\n #plt.imshow(colorMap(img))\n #plt.show()\n\n return edgePts\n\n\ndef buildKDTree(data):\n global kdt, arr\n\n arr = np.asarray(zip(data[0], data[1]))\n kdt = kd.cKDTree(arr)\n\n\ndef getGrads(img, kernelSize):\n global gradx, grady, grad\n\n print \"Computing xderiv\"\n gradx = xDeriv(img, kernelSize)\n print \"Computing yderiv\"\n grady = yDeriv(img, kernelSize)\n\n\ndef getSobelKernel(size, direction):\n if size % 2 == 0:\n print \"\\nKernel size must be odd!\\n\"\n exit()\n\n magic = size / 2\n kernel = list()\n for i in xrange(-magic, magic + 1):\n row = list()\n if i < 0:\n pivot = i - magic\n for j in xrange(-magic, magic + 1):\n e = pivot + np.abs(j)\n row.append(e)\n kernel.append(row)\n elif i == 0:\n row = [0] * size\n kernel.append(row)\n else:\n pivot = i + magic\n for j in xrange(-magic, magic + 1):\n e = pivot - np.abs(j)\n row.append(e)\n kernel.append(row)\n\n if direction == 'y':\n return np.asarray(kernel)\n elif direction == 'x':\n return np.asarray(kernel).T\n\n\ndef xDeriv(img, kernelSize):\n\n s = kernelSize\n if s % 2 == 0:\n sys.exit(\"Kernel size must be odd!\\n\")\n kx = getSobelKernel(s, 'x')\n\n h, w = img.shape\n xgrad = np.zeros(img.shape)\n sigma = s / 2\n #blurImg = cv2.GaussianBlur(img, (s, s), sigma)\n for j in xrange(s / 2, h - s / 2):\n for i in xrange(s / 2, w - s / 2):\n submat = blurImg[j - s / 2: j + s / 2 + 1, i - s / 2: i + s / 2 + 1]\n val = (kx * submat).sum()\n xgrad[j, i] = val\n\n return xgrad\n\n\ndef yDeriv(img, kernelSize):\n\n s = kernelSize\n if s % 2 == 0:\n sys.exit(\"Kernel size must be odd!\\n\")\n ky = getSobelKernel(s, 'y')\n\n h, w = img.shape\n ygrad = np.zeros(img.shape)\n sigma = s / 2\n #blurImg = cv2.GaussianBlur(img, (s, s), sigma)\n for j in xrange(s / 2, h - s / 2):\n for i in xrange(s / 2, w - s / 2):\n submat = blurImg[j - s / 2: j + s / 2 + 1, i - s / 2: i + s / 2 + 1]\n val = (ky * submat).sum()\n ygrad[j, i] = val\n\n return ygrad\n\n\ndef preprocess(data, cutoff):\n\n global kdt\n\n numRegions = 8\n clustDist = 1\n\n print \"Quantizing the Data...\\n\"\n qData = quantize(data, cutoff, numRegions)\n\n #plt.figure(0)\n #plt.title(\"After Quantization\")\n #plt.imshow(colorMap(qData))\n\n # Cluster the Clouds using efficient KDT\n print \"Clustering Clouds...\\n\"\n cloudsB4 = np.array(np.where(qData == 255))\n C = clusterLib.Cluster()\n cloudClusters = C.clusterGrid(cloudsB4, clustDist)\n\n # Remove the clouds once and prepare for filtering\n print \"Removing clouds...\\n\"\n cloudsB4 = np.array(np.where(qData == 255))\n for cluster in cloudClusters:\n c = type(cluster)\n if c is int:\n c = [cluster]\n else:\n c = list(cluster)\n\n cloud = cloudsB4[:, c]\n val = findSurroundingVal(qData, cloud)\n if val is not None:\n qData[tuple(cloud)] = val\n\n #plt.figure(1)\n #plt.title(\"After Removing Clouds\")\n #plt.imshow(colorMap(qData))\n\n # Filter the data\n print \"Filtering out Small Clusters...\\n\"\n for region in xrange(numRegions):\n clusterVal = numRegions - region\n if not clusterVal in qData:\n continue\n dataPts = np.array(np.where(qData == clusterVal))\n print \"\\tFiltering %d Data Points in Region %d...\" % \\\n (dataPts[0].size, clusterVal)\n C = clusterLib.Cluster()\n regionClusters = C.clusterGrid(dataPts, clustDist)\n for cluster in regionClusters:\n if type(cluster) is int or len(cluster) > 250:\n continue\n r = dataPts[:, tuple(cluster)]\n val = findSurroundingVal(qData, r, clusterVal)\n qData[tuple(r)] = val\n\n #plt.figure(2)\n #plt.title(\"After Filtering Data\")\n #plt.imshow(colorMap(qData))\n\n # Remove the clouds again\n print \"Removing Clouds Again...\"\n cloudsB4 = np.array(np.where(qData == 255))\n C = clusterLib.Cluster()\n cloudClusters = C.clusterGrid(cloudsB4, clustDist)\n\n for cluster in cloudClusters:\n c = type(cluster)\n if c is int:\n c = [cluster]\n else:\n c = list(cluster)\n try:\n cloud = cloudsB4[:, c]\n except:\n embed()\n val = findSurroundingVal(qData, cloud)\n if val is not None:\n qData[tuple(cloud)] = val\n\n #plt.figure(3)\n #plt.title(\"After Removing Clouds After Filtering Data\")\n #plt.imshow(colorMap(qData))\n #plt.axes().set_aspect('equal')\n #plt.show()\n\n #print \"Getting Gradient Values...\\n\"\n #if gradx is None or grady is None:\n #getGrads(qData, ptsBtwnKnts)\n\n print \"Extracting Edges...\\n\"\n edgePts = extractStepEdges(qData)\n\n #colorData = colorMap(qData)\n #plt.imshow(colorData)\n #plt.axes().set_aspect('equal')\n #plt.show()\n\n return edgePts\n", "meta": {"content_hash": "bca4c9d2224948497feaa31b3040fee1", "timestamp": "", "source": "github", "line_count": 501, "max_line_length": 80, "avg_line_length": 28.167664670658684, "alnum_prop": 0.5290532879818595, "repo_name": "mathnathan/smartQuantization", "id": "22b52df90cff7a73ff37c8378d4906a4518c9525", "size": "14112", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "preprocessing.py", "mode": "33261", "license": "mit", "language": [{"name": "Python", "bytes": "45169"}]}} +{"text": "\"\"\"Expectation value for a diagonal observable using a sampler primitive.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Callable, Sequence, Mapping\nfrom typing import Any\n\nfrom dataclasses import dataclass\n\nimport numpy as np\nfrom qiskit.algorithms.algorithm_job import AlgorithmJob\nfrom qiskit.circuit import QuantumCircuit\nfrom qiskit.primitives import BaseSampler, BaseEstimator, EstimatorResult\nfrom qiskit.primitives.utils import init_observable, _circuit_key\nfrom qiskit.opflow import PauliSumOp\nfrom qiskit.quantum_info import SparsePauliOp\nfrom qiskit.quantum_info.operators.base_operator import BaseOperator\n\n\n@dataclass(frozen=True)\nclass _DiagonalEstimatorResult(EstimatorResult):\n \"\"\"A result from an expectation of a diagonal observable.\"\"\"\n\n # TODO make each measurement a dataclass rather than a dict\n best_measurements: Sequence[Mapping[str, Any]] | None = None\n\n\nclass _DiagonalEstimator(BaseEstimator):\n \"\"\"An estimator for diagonal observables.\"\"\"\n\n def __init__(\n self,\n sampler: BaseSampler,\n aggregation: float | Callable[[Sequence[tuple[float, float]]], float] | None = None,\n callback: Callable[[Sequence[Mapping[str, Any]]], None] | None = None,\n **options,\n ) -> None:\n r\"\"\"Evaluate the expectation of quantum state with respect to a diagonal operator.\n\n Args:\n sampler: The sampler used to evaluate the circuits.\n aggregation: The aggregation function to aggregate the measurement outcomes. If a float\n this specified the CVaR :math:`\\alpha` parameter.\n callback: A callback which is given the best measurements of all circuits in each\n evaluation.\n run_options: Options for the sampler.\n\n \"\"\"\n super().__init__(options=options)\n self.sampler = sampler\n if not callable(aggregation):\n aggregation = _get_cvar_aggregation(aggregation)\n\n self.aggregation = aggregation\n self.callback = callback\n\n def _run(\n self,\n circuits: Sequence[QuantumCircuit],\n observables: Sequence[BaseOperator | PauliSumOp],\n parameter_values: Sequence[Sequence[float]],\n **run_options,\n ) -> AlgorithmJob:\n circuit_indices = []\n for circuit in circuits:\n key = _circuit_key(circuit)\n index = self._circuit_ids.get(key)\n if index is not None:\n circuit_indices.append(index)\n else:\n circuit_indices.append(len(self._circuits))\n self._circuit_ids[key] = len(self._circuits)\n self._circuits.append(circuit)\n self._parameters.append(circuit.parameters)\n observable_indices = []\n for observable in observables:\n index = self._observable_ids.get(id(observable))\n if index is not None:\n observable_indices.append(index)\n else:\n observable_indices.append(len(self._observables))\n self._observable_ids[id(observable)] = len(self._observables)\n converted_observable = init_observable(observable)\n _check_observable_is_diagonal(converted_observable) # check it's diagonal\n self._observables.append(converted_observable)\n job = AlgorithmJob(\n self._call, circuit_indices, observable_indices, parameter_values, **run_options\n )\n job.submit()\n return job\n\n def _call(\n self,\n circuits: Sequence[int],\n observables: Sequence[int],\n parameter_values: Sequence[Sequence[float]],\n **run_options,\n ) -> _DiagonalEstimatorResult:\n job = self.sampler.run(\n [self._circuits[i] for i in circuits],\n parameter_values,\n **run_options,\n )\n sampler_result = job.result()\n samples = sampler_result.quasi_dists\n\n # a list of dictionaries containing: {state: (measurement probability, value)}\n evaluations = [\n {\n state: (probability, _evaluate_sparsepauli(state, self._observables[i]))\n for state, probability in sampled.items()\n }\n for i, sampled in zip(observables, samples)\n ]\n\n results = np.array([self.aggregation(evaluated.values()) for evaluated in evaluations])\n\n # get the best measurements\n best_measurements = []\n num_qubits = self._circuits[0].num_qubits\n for evaluated in evaluations:\n best_result = min(evaluated.items(), key=lambda x: x[1][1])\n best_measurements.append(\n {\n \"state\": best_result[0],\n \"bitstring\": bin(best_result[0])[2:].zfill(num_qubits),\n \"value\": best_result[1][1],\n \"probability\": best_result[1][0],\n }\n )\n\n if self.callback is not None:\n self.callback(best_measurements)\n\n return _DiagonalEstimatorResult(\n values=results, metadata=sampler_result.metadata, best_measurements=best_measurements\n )\n\n\ndef _get_cvar_aggregation(alpha):\n \"\"\"Get the aggregation function for CVaR with confidence level ``alpha``.\"\"\"\n if alpha is None:\n alpha = 1\n elif not 0 <= alpha <= 1:\n raise ValueError(f\"alpha must be in [0, 1] but was {alpha}\")\n\n # if alpha is close to 1 we can avoid the sorting\n if np.isclose(alpha, 1):\n\n def aggregate(measurements):\n return sum(probability * value for probability, value in measurements)\n\n else:\n\n def aggregate(measurements):\n # sort by values\n sorted_measurements = sorted(measurements, key=lambda x: x[1])\n\n accumulated_percent = 0 # once alpha is reached, stop\n cvar = 0\n for probability, value in sorted_measurements:\n cvar += value * max(probability, alpha - accumulated_percent)\n accumulated_percent += probability\n if accumulated_percent >= alpha:\n break\n\n return cvar / alpha\n\n return aggregate\n\n\ndef _evaluate_sparsepauli(state: int, observable: SparsePauliOp) -> complex:\n return sum(\n coeff * _evaluate_bitstring(state, paulistring)\n for paulistring, coeff in observable.label_iter()\n )\n\n\ndef _evaluate_bitstring(state: int, paulistring: str) -> float:\n \"\"\"Evaluate a bitstring on a Pauli label.\"\"\"\n n = len(paulistring) - 1\n return np.prod(\n [-1 if state & (1 << (n - i)) else 1 for i, pauli in enumerate(paulistring) if pauli == \"Z\"]\n )\n\n\ndef _check_observable_is_diagonal(observable: SparsePauliOp) -> bool:\n is_diagonal = not np.any(observable.paulis.x)\n if not is_diagonal:\n raise ValueError(\"The observable must be diagonal.\")\n", "meta": {"content_hash": "65b388c6e4cb2fc3e560d64bc8354443", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 100, "avg_line_length": 36.26315789473684, "alnum_prop": 0.6169811320754717, "repo_name": "QISKit/qiskit-sdk-py", "id": "67835c9e55a04dca65879ec5c4a4440f6699cc5c", "size": "7368", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "qiskit/algorithms/minimum_eigensolvers/diagonal_estimator.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2582"}, {"name": "C++", "bytes": "327518"}, {"name": "CMake", "bytes": "19294"}, {"name": "Makefile", "bytes": "5608"}, {"name": "Pascal", "bytes": "2444"}, {"name": "Python", "bytes": "1312801"}, {"name": "Shell", "bytes": "8385"}]}} +{"text": "/*jslint es5:true, indent:2, maxlen:80, node:true*/\n/*global suite:true, test:true, suiteSetup:true, suiteTeardown:true, setup:true,\n teardown:true*/ // Mocha\n'use strict';\n\n// this module\n\n// http://stackoverflow.com/questions/1606797\nfunction construct(constructor, args) {\n function F() {\n return constructor.apply(this, args);\n }\n F.prototype = constructor.prototype;\n return new F();\n}\n\n// exports\n\nmodule.exports = function (SubArray, suite, test, assert) {\n [\n [],\n ['a', 'b', 'c']\n ].forEach(function (args) {\n suite('constructed with: ' + JSON.stringify(args), function () {\n var subArray;\n\n test('constructed without incident', function () {\n subArray = construct(SubArray, args);\n assert(true, 'made it without throwing errors');\n });\n\n test('detectable as an Array', function () {\n assert.equal(Object.prototype.toString.call(subArray),\n '[object Array]');\n });\n\n test('inherits from global Array', function () {\n assert(subArray instanceof Array, 'instanceof Array');\n });\n\n test('initial length is correct', function () {\n assert.equal(subArray.length, args.length);\n });\n\n test('\"last\" method returns last of initial args', function () {\n var last = args.length ? args[args.length - 1] : undefined;\n assert(subArray.last, '\"last\" method exists');\n assert.equal(subArray.last(), last);\n });\n\n test('\"push\" adds a new last element', function () {\n subArray.push('last');\n assert(subArray.last, '\"last\" method exists');\n assert.equal(subArray.last(), 'last');\n });\n\n test('length is incremented post-\"push\"', function () {\n assert.equal(subArray.length, args.length + 1);\n });\n\n test('\"pop\" returns last element', function () {\n assert.equal(subArray.pop(), 'last');\n });\n\n test('\"last\" method returns last of initial args', function () {\n var last = args.length ? args[args.length - 1] : undefined;\n assert(subArray.last, '\"last\" method exists');\n assert.equal(subArray.last(), last);\n });\n\n test('length is decremented post-\"pop\"', function () {\n assert.equal(subArray.length, args.length);\n });\n\n test('setting length higher changes highest index', function () {\n subArray.length = 10;\n assert.equal(subArray.length, 10);\n subArray.push('last');\n assert.equal(subArray.length, 11);\n assert.equal(subArray[10], 'last');\n });\n\n test('setting length lower changes highest index', function () {\n subArray.length = 0;\n assert.equal(subArray.length, 0);\n subArray.push('last');\n assert.equal(subArray.length, 1);\n assert.equal(subArray[0], 'last');\n });\n\n test('add an element by direct index', function () {\n subArray[0] = 'abc';\n assert.equal(subArray.length, 1, 'length is updated');\n assert.equal(subArray[0], 'abc', 'element was stored/retrieved');\n assert.equal(subArray.last(), 'abc', '\"last\" finds element');\n });\n\n test('add an element by higher direct index', function () {\n subArray[2] = 'abc';\n assert.equal(subArray.length, 3, 'length is updated');\n assert(!subArray[1], 'skipped index is falsey');\n assert.equal(subArray[2], 'abc', 'element was stored/retrieved');\n assert.equal(subArray.last(), 'abc', '\"last\" finds element');\n });\n });\n });\n }\n", "meta": {"content_hash": "4502a50c40fc200d1512c0d3ebed7d6c", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 80, "avg_line_length": 36.728971962616825, "alnum_prop": 0.5302798982188295, "repo_name": "jokeyrhyme/js-sub-array-tests", "id": "329976486606c177cb08a3f9cac3436c4852483d", "size": "3930", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/tests.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "9598"}]}} +{"text": "\n\n/**\n * Keyboard class handles the keyboard state for the InputHandler\n */\nclass Keyboard {\n /**\n * Constructor for the Keyboard class\n */\n constructor() {\n // Store state\n this.keys = {};\n\n // Setup listeners for key events\n document.addEventListener('keydown', (e) => this._onKeyDown(e), false);\n document.addEventListener('keyup', (e) => this._onKeyUp(e), false);\n }\n\n /**\n * Callback listener for keydown event\n */\n _onKeyDown(e) {\n this.keys[e.key.toLowerCase()] = true;\n e.preventDefault();\n e.stopPropagation();\n }\n\n /**\n * Callback listener for keyup event\n */\n _onKeyUp(e) {\n this.keys[e.key.toLowerCase()] = false;\n }\n\n /**\n * Check if a key is down,\n * @param {string} key The key to check\n */\n keyIsPressed(key) {\n if (this.keys[key.toLowerCase()]) {\n return true;\n } else {\n return false;\n }\n }\n}\n\nexport { Keyboard as default };\n", "meta": {"content_hash": "63ea91615a683d532076681bf5b12a47", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 75, "avg_line_length": 19.166666666666668, "alnum_prop": 0.592391304347826, "repo_name": "nicholasnelson/uncondemned", "id": "858d33ae2fcb2ec0f40ac4f109b9b20cff96f1e7", "size": "2052", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/scripts/GameObjects/Player/InputHandler/Keyboard.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "2095"}, {"name": "JavaScript", "bytes": "1503530"}]}} +{"text": "--TEST--\nphpunit-skelgen --class -- BankAccountTest _fixture/BankAccountTest.php BankAccount php://stdout\n--FILE--\n<?php\n$_SERVER['argv'][1] = '--class';\n$_SERVER['argv'][2] = '--';\n$_SERVER['argv'][3] = 'BankAccountTest';\n$_SERVER['argv'][4] = __DIR__ . DIRECTORY_SEPARATOR . '_fixture' . DIRECTORY_SEPARATOR . 'BankAccountTest.php';\n$_SERVER['argv'][5] = 'BankAccount';\n$_SERVER['argv'][6] = 'php://stdout';\n\nrequire __DIR__ . '/../src/autoload.php';\n$textui = new SebastianBergmann\\PHPUnit\\SkeletonGenerator\\Command;\n$textui->main();\n?>\n--EXPECTF--\nPHPUnit Skeleton Generator %s by Sebastian Bergmann.\n\n<?php\n/**\n * Generated by PHPUnit_SkeletonGenerator %s on %s at %s.\n */\nclass BankAccount\n{\n /**\n * @todo Implement depositMoney().\n */\n public function depositMoney()\n {\n // Remove the following line when you implement this method.\n throw new RuntimeException('Not yet implemented.');\n }\n\n /**\n * @todo Implement getBalance().\n */\n public function getBalance()\n {\n // Remove the following line when you implement this method.\n throw new RuntimeException('Not yet implemented.');\n }\n\n /**\n * @todo Implement withdrawMoney().\n */\n public function withdrawMoney()\n {\n // Remove the following line when you implement this method.\n throw new RuntimeException('Not yet implemented.');\n }\n}\nWrote skeleton for \"BankAccount\" to \"php://stdout\".\n", "meta": {"content_hash": "1261fd1db4c76b20988bb45b6c3c37f5", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 111, "avg_line_length": 27.78846153846154, "alnum_prop": 0.6359861591695501, "repo_name": "kolodny/phpunit-skeleton-tester", "id": "9f0516e502f406b8ca8a3711f92758bce66d523a", "size": "1445", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/class-from-test.phpt", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "PHP", "bytes": "66277"}]}} +{"text": "'use strict';\n\nimport Promise from 'bluebird';\nimport Joi from 'joi';\n\nexport default [\n {\n path: '/v1/teams',\n method: 'GET',\n config: {\n handler: {\n async: Promise.coroutine(function* (request, reply) {\n let result = yield Promise.resolve([]);\n reply(result);\n })\n }\n }\n },\n {\n path: '/v1/teams',\n method: 'POST',\n config: {\n validate: {\n payload: Joi.object({\n name: Joi.string().required().min(2).description('Team Name'),\n description: Joi.string().description('Team description'),\n members: Joi.array().unique().min(1).items(Joi.string().required()).description('Team Members'),\n isPublic: Joi.boolean().default(false).description('Is Public'),\n isActive: Joi.boolean().default(true).description('Is Active')\n })\n },\n handler: {\n async: Promise.coroutine(function* (request, reply) {\n let result = yield Promise.resolve({});\n reply(result);\n })\n }\n }\n },\n {\n path: '/v1/teams/:id',\n method: 'GET',\n config: {\n validate: {\n params: {\n id: Joi.string()\n }\n },\n handler: {\n async: Promise.coroutine(function* (request, reply) {\n let result = yield Promise.resolve({});\n reply(result);\n })\n }\n }\n },\n {\n path: '/v1/teams/:id',\n method: 'PUT',\n config: {\n validate: {\n params: {\n id: Joi.string()\n },\n payload: Joi.object({\n name: Joi.string().required().min(2).description('Team Name'),\n description: Joi.string().description('Team description'),\n isPublic: Joi.boolean().default(false).description('Is Public'),\n isActive: Joi.boolean().default(true).description('Is Active')\n })\n },\n handler: {\n async: Promise.coroutine(function* (request, reply) {\n let result = yield Promise.resolve({});\n reply(result);\n })\n }\n }\n },\n {\n path: '/v1/teams/:id',\n method: 'DELETE',\n config: {\n validate: {\n params: {\n id: Joi.string()\n }\n },\n handler: {\n async: Promise.coroutine(function* (request, reply) {\n let result = yield Promise.resolve({});\n reply(result);\n })\n }\n }\n },\n {\n path: '/v1/teams/:id/users/:userId',\n method: 'POST',\n config: {\n validate: {\n params: {\n id: Joi.string(),\n userId: Joi.string()\n },\n payload: Joi.array().items(Joi.string())\n },\n handler: {\n async: Promise.coroutine(function* (request, reply) {\n let result = yield Promise.resolve({});\n reply(result);\n })\n }\n }\n },\n {\n path: '/v1/teams/:id/users/:userId',\n method: 'DELETE',\n config: {\n validate: {\n params: {\n id: Joi.string(),\n userId: Joi.string()\n }\n },\n handler: {\n async: Promise.coroutine(function* (request, reply) {\n let result = yield Promise.resolve({});\n reply(result);\n })\n }\n }\n }\n]", "meta": {"content_hash": "69accbb792f0b5ab68a4cdaf8038a09e", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 106, "avg_line_length": 23.67910447761194, "alnum_prop": 0.49196344153797666, "repo_name": "TylerGarlick/convergent-api", "id": "6e9ba9f4fbf7bbec0bc78cc65849d7ac7bfb89e2", "size": "3173", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "routes/teams.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "12617"}]}} +{"text": "<!-- partial HTML of patch panel app -->\n<div id=\"ov-sample-custom\" ng-controller=\"OvSampleCustomCtrl\">\n <div class=\"button-panel\">\n <div class=\"my-button\" ng-click=\"getData()\">\n Load Devices\n </div>\n\n </div>\n <div class=\"data-panel\">\n <div>\n <label>Devices:\n <select ng-model=\"myDev\" ng-options=\"dev.name for dev in devices\"></select>\n </label>\n\n </div>\n </div>\n <div class=\"button-panel\">\n <div class=\"my-button\" ng-click=\"loadPorts()\">\n Load Ports\n </div>\n </div>\n <div class=\"data-panel2\">\n <label>First Port:\n <select ng-model=\"myPort1\" ng-options=\"port.name for port in ports\"></select>\n </label>\n <label>Second Port:\n <select ng-model=\"myPort2\" ng-options=\"port.name for port in ports\"></select>\n </label>\n </div>\n <div class=\"button-panel\">\n <div class=\"my-button\" ng-click=\"done()\">\n Patch!\n </div>\n </div>\n <div class=\"data-panel3\">\n <p>\n <span class=\"quote\">{{data.message}} </span>\n </p>\n <pre>\n\n\n </pre>\n </div>\n <div class=\"button-panel\">\n <div class=\"my-button\" ng-click=\"used()\">\n ConnectPoints in use\n </div>\n </div>\n <div class=\"data-panel4\">\n <p>\n <span class=\"quote\">{{data.cpoints}} </span>\n </p>\n </div>\n</div>", "meta": {"content_hash": "a1c33d0a615ef548ab9826888cf05960", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 91, "avg_line_length": 26.77777777777778, "alnum_prop": 0.4972337482710927, "repo_name": "wuwenbin2/onos_bgp_evpn", "id": "34204b4de3f2e852583e1fe73660d07897c2cf37", "size": "1446", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "apps/patchpanel/src/main/resources/app/view/sampleCustom/sampleCustom.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "211779"}, {"name": "Groff", "bytes": "1090"}, {"name": "HTML", "bytes": "177259"}, {"name": "Java", "bytes": "25432628"}, {"name": "JavaScript", "bytes": "2970699"}, {"name": "Protocol Buffer", "bytes": "8451"}, {"name": "Python", "bytes": "126671"}, {"name": "Shell", "bytes": "913"}, {"name": "Thrift", "bytes": "16641"}]}} +{"text": "export const REQUESTS_BEGIN = 'REQUESTS_BEGIN';\nexport const REQUESTS_END = 'REQUESTS_END';\nexport const REQUESTS_ERROR = 'REQUESTS_ERROR';\n\n// UI\nexport const UPDATE_EQUIPMENT_LIST_UI = 'UPDATE_EQUIPMENT_LIST_UI';\nexport const UPDATE_PHYSICAL_ATTACHMENTS_UI = 'UPDATE_PHYSICAL_ATTACHMENTS_UI';\nexport const UPDATE_OWNERS_UI = 'UPDATE_OWNERS_UI';\nexport const UPDATE_OWNER_CONTACTS_UI = 'UPDATE_OWNER_CONTACTS_UI';\nexport const UPDATE_OWNER_EQUIPMENT_UI = 'UPDATE_OWNER_EQUIPMENT_UI';\nexport const UPDATE_USERS_UI = 'UPDATE_USERS_UI';\nexport const UPDATE_PROJECTS_UI = 'UPDATE_PROJECTS_UI';\nexport const UPDATE_PROJECT_CONTACTS_UI = 'UPDATE_PROJECT_CONTACTS_UI';\nexport const UPDATE_RENTAL_REQUESTS_UI = 'UPDATE_RENTAL_REQUESTS_UI';\nexport const UPDATE_USER_ROLES_UI = 'UPDATE_USER_ROLES_UI';\nexport const UPDATE_GROUPS_LOOKUP = 'UPDATE_GROUPS_LOOKUP';\nexport const UPDATE_PERMISSIONS_LOOKUP = 'UPDATE_PERMISSIONS_LOOKUP';\nexport const UPDATE_ROLES_UI = 'UPDATE_ROLES_UI';\nexport const UPDATE_HISTORY_UI = 'UPDATE_HISTORY_UI';\nexport const UPDATE_DOCUMENTS_UI = 'UPDATE_DOCUMENTS_UI';\n\n// Search\nexport const UPDATE_EQUIPMENT_LIST_SEARCH = 'UPDATE_EQUIPMENT_LIST_SEARCH';\nexport const UPDATE_OWNERS_SEARCH = 'UPDATE_OWNERS_SEARCH';\nexport const UPDATE_PROJECTS_SEARCH = 'UPDATE_PROJECTS_SEARCH';\nexport const UPDATE_RENTAL_REQUESTS_SEARCH = 'UPDATE_RENTAL_REQUESTS_SEARCH';\nexport const UPDATE_USERS_SEARCH = 'UPDATE_USERS_SEARCH';\nexport const UPDATE_ROLES_SEARCH = 'UPDATE_ROLES_SEARCH';\n\n// Lookups\nexport const UPDATE_CITIES_LOOKUP = 'UPDATE_CITIES';\nexport const UPDATE_DISTRICTS_LOOKUP = 'UPDATE_DISTRICTS';\nexport const UPDATE_REGIONS_LOOKUP = 'UPDATE_REGIONS';\nexport const UPDATE_SERVICE_AREAS_LOOKUP = 'UPDATE_SERVICE_AREAS';\nexport const UPDATE_LOCAL_AREAS_LOOKUP = 'UPDATE_LOCAL_AREAS';\nexport const UPDATE_OWNERS_LOOKUP = 'UPDATE_OWNERS_LOOKUP';\nexport const UPDATE_DISTRICT_EQUIPMENT_TYPES_LOOKUP = 'UPDATE_DISTRICT_EQUIPMENT_TYPES_LOOKUP';\nexport const UPDATE_EQUIPMENT_TYPES_LOOKUP = 'UPDATE_EQUIPMENT_TYPES_LOOKUP';\nexport const UPDATE_ROLES_LOOKUP = 'UPDATE_ROLES_LOOKUP';\nexport const UPDATE_PROJECTS_LOOKUP = 'UPDATE_PROJECTS_LOOKUP';\nexport const UPDATE_USERS_LOOKUP = 'UPDATE_USERS_LOOKUP';\n\n// Current User\nexport const UPDATE_CURRENT_USER = 'UPDATE_CURRENT_USER';\n\n// Users\nexport const UPDATE_USERS = 'UPDATE_USERS';\nexport const UPDATE_USER = 'UPDATE_USER';\nexport const ADD_USER = 'ADD_USER';\nexport const DELETE_USER = 'DELETE_USER';\n\n// Favourites\nexport const UPDATE_FAVOURITES = 'UPDATE_FAVOURITES';\nexport const ADD_FAVOURITE = 'ADD_FAVOURITE';\nexport const UPDATE_FAVOURITE = 'UPDATE_FAVOURITE';\nexport const DELETE_FAVOURITE = 'DELETE_FAVOURITE';\n\n// Contacts\nexport const UPDATE_CONTACTS = 'UPDATE_CONTACTS';\nexport const ADD_CONTACT = 'ADD_CONTACT';\nexport const UPDATE_CONTACT = 'UPDATE_CONTACT';\nexport const DELETE_CONTACT = 'DELETE_CONTACT';\n\n// Documents\nexport const UPDATE_DOCUMENTS = 'UPDATE_DOCUMENTS';\nexport const ADD_DOCUMENT = 'ADD_DOCUMENT';\nexport const UPDATE_DOCUMENT = 'UPDATE_DOCUMENT';\nexport const DELETE_DOCUMENT = 'DELETE_DOCUMENT';\n\n// Roles, Permissions\nexport const UPDATE_ROLES = 'UPDATE_ROLES';\nexport const UPDATE_ROLE = 'UPDATE_ROLE';\nexport const ADD_ROLE = 'ADD_ROLE';\nexport const DELETE_ROLE = 'DELETE_ROLE';\nexport const UPDATE_ROLE_PERMISSIONS = 'UPDATE_ROLE_PERMISSIONS';\n\n// Equipment\nexport const UPDATE_EQUIPMENT_LIST = 'UPDATE_EQUIPMENT_LIST';\nexport const ADD_EQUIPMENT = 'ADD_EQUIPMENT';\nexport const UPDATE_EQUIPMENT = 'UPDATE_EQUIPMENT';\n\n// Owners\nexport const UPDATE_OWNERS = 'UPDATE_OWNERS';\nexport const UPDATE_OWNER = 'UPDATE_OWNER';\nexport const ADD_OWNER = 'ADD_OWNER';\nexport const DELETE_OWNER = 'DELETE_OWNER';\n\n// Projects\nexport const UPDATE_PROJECTS = 'UPDATE_PROJECTS';\nexport const UPDATE_PROJECT = 'UPDATE_PROJECT';\nexport const ADD_PROJECT = 'ADD_PROJECT';\n\n// Rental Requests\nexport const UPDATE_RENTAL_REQUESTS = 'UPDATE_RENTAL_REQUESTS';\nexport const UPDATE_RENTAL_REQUEST = 'UPDATE_RENTAL_REQUEST';\nexport const ADD_RENTAL_REQUEST = 'ADD_RENTAL_REQUEST';\n\n// Rotation List\nexport const UPDATE_RENTAL_REQUEST_ROTATION_LIST = 'UPDATE_RENTAL_REQUEST_ROTATION_LIST';\n\n// Rental Agreements\nexport const UPDATE_RENTAL_AGREEMENT = 'UPDATE_RENTAL_AGREEMENT';\nexport const ADD_RENTAL_AGREEMENT = 'ADD_RENTAL_AGREEMENT';\n\n// Rental Rates, Conditions\nexport const ADD_RENTAL_RATE = 'ADD_RENTAL_RATE';\nexport const UPDATE_RENTAL_RATE = 'UPDATE_RENTAL_RATE';\nexport const DELETE_RENTAL_RATE = 'DELETE_RENTAL_RATE';\nexport const ADD_RENTAL_CONDITION = 'ADD_RENTAL_CONDITION';\nexport const UPDATE_RENTAL_CONDITION = 'UPDATE_RENTAL_CONDITION';\nexport const DELETE_RENTAL_CONDITION = 'DELETE_RENTAL_CONDITION';\n\n// Version\nexport const UPDATE_VERSION = 'UPDATE_VERSION';\n\n// History\nexport const UPDATE_HISTORY = 'UPDATE_HISTORY';\n", "meta": {"content_hash": "176b50923ec8745d4f6e2a8f58e9967f", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 95, "avg_line_length": 41.162393162393165, "alnum_prop": 0.7693106312292359, "repo_name": "plavoieBC/hets", "id": "b05fd770c24c5837e698b0e4cf863c91f5ebb686", "size": "4832", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Client/src/js/actionTypes.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "9077"}, {"name": "C#", "bytes": "4126242"}, {"name": "CSS", "bytes": "60442"}, {"name": "HTML", "bytes": "343352"}, {"name": "JavaScript", "bytes": "475168"}, {"name": "PowerShell", "bytes": "805"}, {"name": "Python", "bytes": "4784"}, {"name": "Shell", "bytes": "5609"}]}} +{"text": "'use strict';\n\ndescribe('Controller: MainCtrl', function () {\n\n // load the controller's module\n beforeEach(module('autocompleteApp'));\n\n var MainCtrl,\n scope;\n\n // Initialize the controller and a mock scope\n beforeEach(inject(function ($controller, $rootScope) {\n scope = $rootScope.$new();\n MainCtrl = $controller('MainCtrl', {\n $scope: scope\n });\n }));\n\n it('should attach a list of awesomeThings to the scope', function () {\n expect(scope.awesomeThings.length).toBe(3);\n });\n});\n", "meta": {"content_hash": "3ff1f6cd980772cf590a61f6e9038f5e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 72, "avg_line_length": 23.227272727272727, "alnum_prop": 0.6516634050880626, "repo_name": "theoinglis/controls", "id": "0c1d617c2f9130e104fdd7ff679bc11ec23f78b1", "size": "511", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/spec/controllers/main.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "3936"}, {"name": "JavaScript", "bytes": "81966"}]}} +{"text": "import {LocalStore} from \"fluxx\"\nimport * as actions from \"./playFormActions\"\nimport {\n defaultFieldValidation, FieldValidation, updateFieldValidation,\n updateUnchangedFieldValidation, Valid\n} from \"../../../framework/utils/Validation\"\nimport {\n validateFuture, validateNonBlank, validateNonEmptyArray,\n validateNotNull, validatePositiveNumber\n} from \"../../../common/commonValidations\"\nimport {copy} from \"../../../framework/utils/object\";\nimport {Theater} from \"../../theater/theaterModel\";\nimport messages from \"../../../framework/messages\";\nimport * as arrays from \"../../../framework/utils/arrays\";\nimport {Company} from \"../../company/companyModel\";\nimport {Show} from \"../../show/showModel\";\n\nexport interface PlayFormState {\n step: \"loading\" | \"form\" | \"success\"\n company: Company\n show: Show\n availableTheaters: Array<Theater>\n id?: string\n theater: FieldValidation<string>\n dates: FieldValidation<Array<DateValidation>>\n prices: FieldValidation<Array<PriceValidation>>\n errors?: Array<string>\n}\n\nexport interface PriceValidation {\n name: FieldValidation<string>\n value: FieldValidation<number>\n condition: FieldValidation<string>\n}\n\nexport interface DateValidation {\n date: FieldValidation<Date>\n reservationEndDate: FieldValidation<Date>\n}\n\nconst defaultDateValidation: DateValidation = {\n date: defaultFieldValidation(null),\n reservationEndDate: defaultFieldValidation(null)\n}\n\nconst defaultPriceValidation: PriceValidation = {\n name: defaultFieldValidation(\"\"),\n value: defaultFieldValidation(0),\n condition: defaultFieldValidation(\"\")\n}\n\nconst initialState: PlayFormState = {\n step: \"loading\",\n company: null,\n show: null,\n availableTheaters: [],\n theater: defaultFieldValidation(\"\"),\n dates: defaultFieldValidation([defaultDateValidation]),\n prices: defaultFieldValidation([defaultPriceValidation])\n}\n\nexport const playFormStore = () => LocalStore(initialState, on => {\n on(actions.initialize, (state, {company, show, play, theaters}) => {\n if (play) {\n return copy(state, {\n step: \"form\",\n company,\n show,\n availableTheaters: theaters,\n id: play.id,\n theater: defaultFieldValidation(play.theater.id),\n dates: defaultFieldValidation([{\n date: defaultFieldValidation(play.date),\n reservationEndDate: defaultFieldValidation(play.reservationEndDate)\n }]),\n prices: defaultFieldValidation(\n play.prices.map(price => ({\n name: defaultFieldValidation(price.name),\n value: defaultFieldValidation(price.value),\n condition: defaultFieldValidation(price.condition)\n }))\n )\n })\n } else {\n return copy(state, {step: \"form\", company, show, availableTheaters: theaters})\n }\n })\n\n on(actions.updateTheater, (state, value) => {\n return copy(state, {\n theater: updateFieldValidation(state.theater, value, validateNonBlank(value))\n })\n })\n\n on(actions.addDate, (state) => {\n return updateDates(state, arrays.append(state.dates.value, defaultDateValidation))\n })\n\n on(actions.removeDate, (state, index) => {\n return updateDates(state, arrays.remove(state.dates.value, index))\n })\n\n on(actions.updateDate, (state, {index, value}) => {\n const currentDate = state.dates.value[index]\n return updateDates(state, arrays.replace(state.dates.value, index, copy(currentDate, {\n date: updateFieldValidation(currentDate.date, value, validateNotNull(value).flatMap(validateFuture)),\n reservationEndDate: updateUnchangedFieldValidation(currentDate.reservationEndDate, currentDate.reservationEndDate.value, validateReservationEndDate(currentDate.reservationEndDate.value, value))\n })))\n })\n\n on(actions.updateReservationEndDate, (state, {index, value}) => {\n const currentDate = state.dates.value[index]\n return updateDates(state, arrays.replace(state.dates.value, index, copy(currentDate, {\n reservationEndDate: updateFieldValidation(currentDate.reservationEndDate, value, validateReservationEndDate(value, currentDate.date.value))\n })))\n })\n\n on(actions.addPrice, (state) => {\n return updatePrices(state, arrays.append(state.prices.value, defaultPriceValidation))\n })\n\n on(actions.removePrice, (state, index) => {\n return updatePrices(state, arrays.remove(state.prices.value, index))\n })\n\n on(actions.updatePriceName, (state, {index, value}) => {\n const currentPrice = state.prices.value[index]\n return updatePrices(state, arrays.replace(state.prices.value, index, copy(currentPrice, {\n name: updateFieldValidation(currentPrice.name, value, validateNonBlank(value))\n })))\n })\n\n on(actions.updatePriceValue, (state, {index, value}) => {\n const currentPrice = state.prices.value[index]\n return updatePrices(state, arrays.replace(state.prices.value, index, copy(currentPrice, {\n value: updateFieldValidation(currentPrice.value, value, validatePositiveNumber(value))\n })))\n })\n\n on(actions.updatePriceCondition, (state, {index, value}) => {\n const currentPrice = state.prices.value[index]\n return updatePrices(state, arrays.replace(state.prices.value, index, copy(currentPrice, {\n condition: updateFieldValidation(currentPrice.condition, value, Valid(value))\n })))\n })\n\n on(actions.closeErrors, (state) => {\n return copy(state, {errors: null})\n })\n\n on(actions.success, (state) => {\n return copy(state, {step: \"success\"})\n })\n})\n\nfunction validateReservationEndDate(reservationEndDate: Date, date: Date) {\n return validateNotNull(reservationEndDate)\n .flatMap(validateFuture)\n .filter(reservationEndDate => reservationEndDate < date, messages.production.play.form.reservationEndDateAfterDate)\n}\n\nfunction updateDates(state: PlayFormState, dates: Array<DateValidation>) {\n return copy(state, {\n dates: updateFieldValidation(state.dates, dates, validateDates(dates))\n })\n}\n\nfunction validateDates(dates: Array<DateValidation>) {\n return validateNonEmptyArray(dates)\n}\n\nfunction updatePrices(state: PlayFormState, prices: Array<PriceValidation>) {\n return copy(state, {\n prices: updateFieldValidation(state.prices, prices, validatePrices(prices))\n })\n}\n\nfunction validatePrices(prices: Array<PriceValidation>) {\n return validateNonEmptyArray(prices)\n}", "meta": {"content_hash": "289114cbb8eef6641f0314e1ad35e0e0", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 199, "avg_line_length": 34.833333333333336, "alnum_prop": 0.7207336523125997, "repo_name": "kneelnrise/vep", "id": "5858c3ce17fdfd9bbedaacdd09a2d323d9471be1", "size": "6270", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/client/app/production/play/playForm/playFormStore.ts", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1507"}, {"name": "HTML", "bytes": "86391"}, {"name": "JavaScript", "bytes": "69698"}, {"name": "Scala", "bytes": "430360"}, {"name": "Shell", "bytes": "1778"}]}} +{"text": "[](https://github.com/RichardLitt/standard-readme)\n\n> HTTP frontend to the Cisco Webex JS SDK\n\nWhy would we put an http server in front of our SDK? Encryption is hard and this lets all of our client test suites (potentially written in languages for which we do not have sdks) do encrypted things without a major time expenditure\n\n- [Install](#install)\n- [Usage](#usage)\n- [Contribute](#contribute)\n- [Maintainers](#maintainers)\n- [License](#license)\n\n## Install\n\n```bash\n npm install -g @webex/webex-server\n```\n\n## Usage\n\nStart the daemon\n\n```bash\nwebex-server\n```\n\nCreate a session (make sure to copy your set cookie header)\n\n```bash\ncurl -X POST \\\n -H \"Content-Type: application/json\" \\\n -d '{\"clientId\":\"<your client id>\",\"clientSecret\":\"<your client secret>\",\"redirectUri\":\"<your redirect_uri>\",\"scope\":\"<your scopes>\"}' \\\n http://localhost:3000/api/v1/session\n```\n\n(optional) Create a conversation\n\n> SDK: webex.internal.conversation.create({comment: 'first comment', displayName: 'title', participants: ['<userId1>', '<userId2>', '<userId3>']})\n\n```\ncurl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Cookie: <connect.sid cookie from step one>\" \\\n -d '[{\"comment\":\"first message\",\"displayName\":\"title\",\"participants\":[\"userId1\",\"userId2\",\"userId3\"]}]'\n -v \\\n http://localhost:3000/api/v1/session/invoke/internal/conversation/create\n```\n\n(optional) Post a message\n\n> SDK: `webex.inernal.conversation.post({url: '<conversation url>', {displayName: 'second comment'}})`\n\n```\ncurl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Cookie: <connect.sid cookie from step one>\" \\\n -d [{\"url\":\"<conversation url>\"},{\"displayName\":\"second comment\"}]\n -v \\\n http://localhost:3000/api/v1/session/invoke/internal/conversation/post\n```\n\n(optional) Fetch a conversation\n\n> SDK: `webex.internal.conversation.get({url: '<conversation url>'})`\n> SDK: `webex.internal.conversation.get({url: '<conversation url>'})`\n\n```\ncurl -X POST \\\n -H \"Content-Type: application/json\" \\\n -H \"Cookie: <connect.sid cookie from step one>\" \\\n -d [{\"url\":\"<conversation url>\"}]\n -v \\\n http://localhost:3000/api/v1/session/invoke/internal/conversation/get\n```\n\nClean up your session (If you don't do this, you'll have a bunch of long-running web socket connections)\n\n```\ncurl -X DELETE \\\n -H \"Content-Type: application/json\" \\\n -H \"Cookie: <connect.sid cookie from step one>\" \\\n -v \\\n http://localhost:3000/api/v1/session\n```\n\n## Maintainers\n\nThis package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).\n\n## Contribute\n\nPull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.\n\n## License\n\n\u00a9 2016-2019 Cisco and/or its affiliates. All Rights Reserved.\n", "meta": {"content_hash": "3973dcd97084c8ce044d305421e07c44", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 233, "avg_line_length": 30.020833333333332, "alnum_prop": 0.7002081887578071, "repo_name": "bbender/spark-js-sdk", "id": "d409b7632c7179312aeeb871649f17e4e36a7ac0", "size": "2906", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/node_modules/@webex/webex-server/README.md", "mode": "33188", "license": "mit", "language": [{"name": "Dockerfile", "bytes": "877"}, {"name": "JavaScript", "bytes": "112240"}, {"name": "Python", "bytes": "4743"}, {"name": "Shell", "bytes": "21329"}]}} +{"text": "cmake_minimum_required( VERSION 2.6.3 )\n\nif( DEFINED CMAKE_CROSSCOMPILING )\n # subsequent toolchain loading is not really needed\n return()\nendif()\n\nif( CMAKE_TOOLCHAIN_FILE )\n # touch toolchain variable only to suppress \"unused variable\" warning\nendif()\n\nget_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )\nif( _CMAKE_IN_TRY_COMPILE )\n include( \"${CMAKE_CURRENT_SOURCE_DIR}/../android.toolchain.config.cmake\" OPTIONAL )\nendif()\n\n# this one is important\nset( CMAKE_SYSTEM_NAME Linux )\n# this one not so much\nset( CMAKE_SYSTEM_VERSION 1 )\n\n# rpath makes low sence for Android\nset( CMAKE_SKIP_RPATH TRUE CACHE BOOL \"If set, runtime paths are not added when using shared libraries.\" )\n\nset( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 \"\" )\nif(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)\n if( CMAKE_HOST_WIN32 )\n file( TO_CMAKE_PATH \"$ENV{PROGRAMFILES}\" ANDROID_NDK_SEARCH_PATHS )\n set( ANDROID_NDK_SEARCH_PATHS \"${ANDROID_NDK_SEARCH_PATHS}/android-ndk\" \"$ENV{SystemDrive}/NVPACK/android-ndk\" )\n else()\n file( TO_CMAKE_PATH \"$ENV{HOME}\" ANDROID_NDK_SEARCH_PATHS )\n set( ANDROID_NDK_SEARCH_PATHS /opt/android-ndk \"${ANDROID_NDK_SEARCH_PATHS}/NVPACK/android-ndk\" )\n endif()\nendif()\nif(NOT DEFINED ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH)\n set( ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH /opt/android-toolchain )\nendif()\n\nset( ANDROID_SUPPORTED_ABIS_arm \"armeabi-v7a;armeabi;armeabi-v7a with NEON;armeabi-v7a with VFPV3;armeabi-v6 with VFP\" )\nset( ANDROID_SUPPORTED_ABIS_x86 \"x86\" )\nset( ANDROID_SUPPORTED_ABIS_mipsel \"mips\" )\n\nset( ANDROID_DEFAULT_NDK_API_LEVEL 15 )\nset( ANDROID_DEFAULT_NDK_API_LEVEL_x86 15 )\nset( ANDROID_DEFAULT_NDK_API_LEVEL_mips 15 )\n\n\nmacro( __LIST_FILTER listvar regex )\n if( ${listvar} )\n foreach( __val ${${listvar}} )\n if( __val MATCHES \"${regex}\" )\n list( REMOVE_ITEM ${listvar} \"${__val}\" )\n endif()\n endforeach()\n endif()\nendmacro()\n\nmacro( __INIT_VARIABLE var_name )\n set( __test_path 0 )\n foreach( __var ${ARGN} )\n if( __var STREQUAL \"PATH\" )\n set( __test_path 1 )\n break()\n endif()\n endforeach()\n if( __test_path AND NOT EXISTS \"${${var_name}}\" )\n unset( ${var_name} CACHE )\n endif()\n if( \"${${var_name}}\" STREQUAL \"\" )\n set( __values 0 )\n foreach( __var ${ARGN} )\n if( __var STREQUAL \"VALUES\" )\n set( __values 1 )\n elseif( NOT __var STREQUAL \"PATH\" )\n set( __obsolete 0 )\n if( __var MATCHES \"^OBSOLETE_.*$\" )\n string( REPLACE \"OBSOLETE_\" \"\" __var \"${__var}\" )\n set( __obsolete 1 )\n endif()\n if( __var MATCHES \"^ENV_.*$\" )\n string( REPLACE \"ENV_\" \"\" __var \"${__var}\" )\n set( __value \"$ENV{${__var}}\" )\n elseif( DEFINED ${__var} )\n set( __value \"${${__var}}\" )\n else()\n if( __values )\n set( __value \"${__var}\" )\n else()\n set( __value \"\" )\n endif()\n endif()\n if( NOT \"${__value}\" STREQUAL \"\" )\n if( __test_path )\n if( EXISTS \"${__value}\" )\n file( TO_CMAKE_PATH \"${__value}\" ${var_name} )\n if( __obsolete AND NOT _CMAKE_IN_TRY_COMPILE )\n message( WARNING \"Using value of obsolete variable ${__var} as initial value for ${var_name}. Please note, that ${__var} can be completely removed in future versions of the toolchain.\" )\n endif()\n break()\n endif()\n else()\n set( ${var_name} \"${__value}\" )\n if( __obsolete AND NOT _CMAKE_IN_TRY_COMPILE )\n message( WARNING \"Using value of obsolete variable ${__var} as initial value for ${var_name}. Please note, that ${__var} can be completely removed in future versions of the toolchain.\" )\n endif()\n break()\n endif()\n endif()\n endif()\n endforeach()\n unset( __value )\n unset( __values )\n unset( __obsolete )\n elseif( __test_path )\n file( TO_CMAKE_PATH \"${${var_name}}\" ${var_name} )\n endif()\n unset( __test_path )\nendmacro()\n\nmacro( __DETECT_NATIVE_API_LEVEL _var _path )\n SET( __ndkApiLevelRegex \"^[\\t ]*#define[\\t ]+__ANDROID_API__[\\t ]+([0-9]+)[\\t ]*$\" )\n FILE( STRINGS ${_path} __apiFileContent REGEX \"${__ndkApiLevelRegex}\" )\n if( NOT __apiFileContent )\n message( SEND_ERROR \"Could not get Android native API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken.\" )\n endif()\n string( REGEX REPLACE \"${__ndkApiLevelRegex}\" \"\\\\1\" ${_var} \"${__apiFileContent}\" )\n unset( __apiFileContent )\n unset( __ndkApiLevelRegex )\nendmacro()\n\nmacro( __DETECT_TOOLCHAIN_MACHINE_NAME _var _root )\n if( EXISTS \"${_root}\" )\n file( GLOB __gccExePath RELATIVE \"${_root}/bin/\" \"${_root}/bin/*-gcc${TOOL_OS_SUFFIX}\" )\n __LIST_FILTER( __gccExePath \"^[.].*\" )\n list( LENGTH __gccExePath __gccExePathsCount )\n if( NOT __gccExePathsCount EQUAL 1 AND NOT _CMAKE_IN_TRY_COMPILE )\n message( WARNING \"Could not determine machine name for compiler from ${_root}\" )\n set( ${_var} \"\" )\n else()\n get_filename_component( __gccExeName \"${__gccExePath}\" NAME_WE )\n string( REPLACE \"-gcc\" \"\" ${_var} \"${__gccExeName}\" )\n endif()\n unset( __gccExePath )\n unset( __gccExePathsCount )\n unset( __gccExeName )\n else()\n set( ${_var} \"\" )\n endif()\nendmacro()\n\n\n# fight against cygwin\nset( ANDROID_FORBID_SYGWIN TRUE CACHE BOOL \"Prevent cmake from working under cygwin and using cygwin tools\")\nmark_as_advanced( ANDROID_FORBID_SYGWIN )\nif( ANDROID_FORBID_SYGWIN )\n if( CYGWIN )\n message( FATAL_ERROR \"Android NDK and android-cmake toolchain are not welcome Cygwin. It is unlikely that this cmake toolchain will work under cygwin. But if you want to try then you can set cmake variable ANDROID_FORBID_SYGWIN to FALSE and rerun cmake.\" )\n endif()\n\n if( CMAKE_HOST_WIN32 )\n # remove cygwin from PATH\n set( __new_path \"$ENV{PATH}\")\n __LIST_FILTER( __new_path \"cygwin\" )\n set(ENV{PATH} \"${__new_path}\")\n unset(__new_path)\n endif()\nendif()\n\n\n# detect current host platform\nif( NOT DEFINED ANDROID_NDK_HOST_X64 AND (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES \"amd64|x86_64|AMD64\" OR CMAKE_HOST_APPLE) )\n set( ANDROID_NDK_HOST_X64 1 CACHE BOOL \"Try to use 64-bit compiler toolchain\" )\n mark_as_advanced( ANDROID_NDK_HOST_X64 )\nendif()\n\nset( TOOL_OS_SUFFIX \"\" )\nif( CMAKE_HOST_APPLE )\n set( ANDROID_NDK_HOST_SYSTEM_NAME \"darwin-x86_64\" )\n set( ANDROID_NDK_HOST_SYSTEM_NAME2 \"darwin-x86\" )\nelseif( CMAKE_HOST_WIN32 )\n set( ANDROID_NDK_HOST_SYSTEM_NAME \"windows-x86_64\" )\n set( ANDROID_NDK_HOST_SYSTEM_NAME2 \"windows\" )\n set( TOOL_OS_SUFFIX \".exe\" )\nelseif( CMAKE_HOST_UNIX )\n set( ANDROID_NDK_HOST_SYSTEM_NAME \"linux-x86_64\" )\n set( ANDROID_NDK_HOST_SYSTEM_NAME2 \"linux-x86\" )\nelse()\n message( FATAL_ERROR \"Cross-compilation on your platform is not supported by this cmake toolchain\" )\nendif()\n\nif( NOT ANDROID_NDK_HOST_X64 )\n set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} )\nendif()\n\n# see if we have path to Android NDK\n__INIT_VARIABLE( ANDROID_NDK PATH ENV_ANDROID_NDK )\nif( NOT ANDROID_NDK )\n # see if we have path to Android standalone toolchain\n __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ENV_ANDROID_STANDALONE_TOOLCHAIN OBSOLETE_ANDROID_NDK_TOOLCHAIN_ROOT OBSOLETE_ENV_ANDROID_NDK_TOOLCHAIN_ROOT )\n\n if( NOT ANDROID_STANDALONE_TOOLCHAIN )\n #try to find Android NDK in one of the the default locations\n set( __ndkSearchPaths )\n foreach( __ndkSearchPath ${ANDROID_NDK_SEARCH_PATHS} )\n foreach( suffix ${ANDROID_SUPPORTED_NDK_VERSIONS} )\n list( APPEND __ndkSearchPaths \"${__ndkSearchPath}${suffix}\" )\n endforeach()\n endforeach()\n __INIT_VARIABLE( ANDROID_NDK PATH VALUES ${__ndkSearchPaths} )\n unset( __ndkSearchPaths )\n\n if( ANDROID_NDK )\n message( STATUS \"Using default path for Android NDK: ${ANDROID_NDK}\" )\n message( STATUS \" If you prefer to use a different location, please define a cmake or environment variable: ANDROID_NDK\" )\n else()\n #try to find Android standalone toolchain in one of the the default locations\n __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH )\n\n if( ANDROID_STANDALONE_TOOLCHAIN )\n message( STATUS \"Using default path for standalone toolchain ${ANDROID_STANDALONE_TOOLCHAIN}\" )\n message( STATUS \" If you prefer to use a different location, please define the variable: ANDROID_STANDALONE_TOOLCHAIN\" )\n endif( ANDROID_STANDALONE_TOOLCHAIN )\n endif( ANDROID_NDK )\n endif( NOT ANDROID_STANDALONE_TOOLCHAIN )\nendif( NOT ANDROID_NDK )\n\n# remember found paths\nif( ANDROID_NDK )\n get_filename_component( ANDROID_NDK \"${ANDROID_NDK}\" ABSOLUTE )\n set( ANDROID_NDK \"${ANDROID_NDK}\" CACHE INTERNAL \"Path of the Android NDK\" FORCE )\n set( BUILD_WITH_ANDROID_NDK True )\n if( EXISTS \"${ANDROID_NDK}/RELEASE.TXT\" )\n file( STRINGS \"${ANDROID_NDK}/RELEASE.TXT\" ANDROID_NDK_RELEASE_FULL LIMIT_COUNT 1 REGEX r[0-9]+[a-z]? )\n string( REGEX MATCH r[0-9]+[a-z]? ANDROID_NDK_RELEASE \"${ANDROID_NDK_RELEASE_FULL}\" )\n else()\n set( ANDROID_NDK_RELEASE \"r1x\" )\n set( ANDROID_NDK_RELEASE_FULL \"unreleased\" )\n endif()\nelseif( ANDROID_STANDALONE_TOOLCHAIN )\n get_filename_component( ANDROID_STANDALONE_TOOLCHAIN \"${ANDROID_STANDALONE_TOOLCHAIN}\" ABSOLUTE )\n # try to detect change\n if( CMAKE_AR )\n string( LENGTH \"${ANDROID_STANDALONE_TOOLCHAIN}\" __length )\n string( SUBSTRING \"${CMAKE_AR}\" 0 ${__length} __androidStandaloneToolchainPreviousPath )\n if( NOT __androidStandaloneToolchainPreviousPath STREQUAL ANDROID_STANDALONE_TOOLCHAIN )\n message( FATAL_ERROR \"It is not possible to change path to the Android standalone toolchain on subsequent run.\" )\n endif()\n unset( __androidStandaloneToolchainPreviousPath )\n unset( __length )\n endif()\n set( ANDROID_STANDALONE_TOOLCHAIN \"${ANDROID_STANDALONE_TOOLCHAIN}\" CACHE INTERNAL \"Path of the Android standalone toolchain\" FORCE )\n set( BUILD_WITH_STANDALONE_TOOLCHAIN True )\nelse()\n list(GET ANDROID_NDK_SEARCH_PATHS 0 ANDROID_NDK_SEARCH_PATH)\n message( FATAL_ERROR \"Could not find neither Android NDK nor Android standalone toolchain.\n You should either set an environment variable:\n export ANDROID_NDK=~/my-android-ndk\n or\n export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain\n or put the toolchain or NDK in the default path:\n sudo ln -s ~/my-android-ndk ${ANDROID_NDK_SEARCH_PATH}\n sudo ln -s ~/my-android-toolchain ${ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH}\" )\nendif()\n\n# android NDK layout\nif( BUILD_WITH_ANDROID_NDK )\n if( NOT DEFINED ANDROID_NDK_LAYOUT )\n # try to automatically detect the layout\n if( EXISTS \"${ANDROID_NDK}/RELEASE.TXT\")\n set( ANDROID_NDK_LAYOUT \"RELEASE\" )\n elseif( EXISTS \"${ANDROID_NDK}/../../linux-x86/toolchain/\" )\n set( ANDROID_NDK_LAYOUT \"LINARO\" )\n elseif( EXISTS \"${ANDROID_NDK}/../../gcc/\" )\n set( ANDROID_NDK_LAYOUT \"ANDROID\" )\n endif()\n endif()\n set( ANDROID_NDK_LAYOUT \"${ANDROID_NDK_LAYOUT}\" CACHE STRING \"The inner layout of NDK\" )\n mark_as_advanced( ANDROID_NDK_LAYOUT )\n if( ANDROID_NDK_LAYOUT STREQUAL \"LINARO\" )\n set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} ) # only 32-bit at the moment\n set( ANDROID_NDK_TOOLCHAINS_PATH \"${ANDROID_NDK}/../../${ANDROID_NDK_HOST_SYSTEM_NAME}/toolchain\" )\n set( ANDROID_NDK_TOOLCHAINS_SUBPATH \"\" )\n set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 \"\" )\n elseif( ANDROID_NDK_LAYOUT STREQUAL \"ANDROID\" )\n set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} ) # only 32-bit at the moment\n set( ANDROID_NDK_TOOLCHAINS_PATH \"${ANDROID_NDK}/../../gcc/${ANDROID_NDK_HOST_SYSTEM_NAME}/arm\" )\n set( ANDROID_NDK_TOOLCHAINS_SUBPATH \"\" )\n set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 \"\" )\n else() # ANDROID_NDK_LAYOUT STREQUAL \"RELEASE\"\n set( ANDROID_NDK_TOOLCHAINS_PATH \"${ANDROID_NDK}/toolchains\" )\n set( ANDROID_NDK_TOOLCHAINS_SUBPATH \"/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}\" )\n set( ANDROID_NDK_TOOLCHAINS_SUBPATH2 \"/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME2}\" )\n endif()\n get_filename_component( ANDROID_NDK_TOOLCHAINS_PATH \"${ANDROID_NDK_TOOLCHAINS_PATH}\" ABSOLUTE )\n\n # try to detect change of NDK\n if( CMAKE_AR )\n string( LENGTH \"${ANDROID_NDK_TOOLCHAINS_PATH}\" __length )\n string( SUBSTRING \"${CMAKE_AR}\" 0 ${__length} __androidNdkPreviousPath )\n if( NOT __androidNdkPreviousPath STREQUAL ANDROID_NDK_TOOLCHAINS_PATH )\n message( FATAL_ERROR \"It is not possible to change the path to the NDK on subsequent CMake run. You must remove all generated files from your build folder first.\n \" )\n endif()\n unset( __androidNdkPreviousPath )\n unset( __length )\n endif()\nendif()\n\n\n# get all the details about standalone toolchain\nif( BUILD_WITH_STANDALONE_TOOLCHAIN )\n __DETECT_NATIVE_API_LEVEL( ANDROID_SUPPORTED_NATIVE_API_LEVELS \"${ANDROID_STANDALONE_TOOLCHAIN}/sysroot/usr/include/android/api-level.h\" )\n set( ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )\n set( __availableToolchains \"standalone\" )\n __DETECT_TOOLCHAIN_MACHINE_NAME( __availableToolchainMachines \"${ANDROID_STANDALONE_TOOLCHAIN}\" )\n if( NOT __availableToolchainMachines )\n message( FATAL_ERROR \"Could not determine machine name of your toolchain. Probably your Android standalone toolchain is broken.\" )\n endif()\n if( __availableToolchainMachines MATCHES i686 )\n set( __availableToolchainArchs \"x86\" )\n elseif( __availableToolchainMachines MATCHES arm )\n set( __availableToolchainArchs \"arm\" )\n elseif( __availableToolchainMachines MATCHES mipsel )\n set( __availableToolchainArchs \"mipsel\" )\n endif()\n execute_process( COMMAND \"${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}\" -dumpversion\n OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE )\n string( REGEX MATCH \"[0-9]+[.][0-9]+([.][0-9]+)?\" __availableToolchainCompilerVersions \"${__availableToolchainCompilerVersions}\" )\n if( EXISTS \"${ANDROID_STANDALONE_TOOLCHAIN}/bin/clang${TOOL_OS_SUFFIX}\" )\n list( APPEND __availableToolchains \"standalone-clang\" )\n list( APPEND __availableToolchainMachines ${__availableToolchainMachines} )\n list( APPEND __availableToolchainArchs ${__availableToolchainArchs} )\n list( APPEND __availableToolchainCompilerVersions ${__availableToolchainCompilerVersions} )\n endif()\nendif()\n\nmacro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar __availableToolchainsLst __toolchain_subpath )\n foreach( __toolchain ${${__availableToolchainsLst}} )\n if( \"${__toolchain}\" MATCHES \"-clang3[.][0-9]$\" AND NOT EXISTS \"${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}${__toolchain_subpath}\" )\n string( REGEX REPLACE \"-clang3[.][0-9]$\" \"-4.6\" __gcc_toolchain \"${__toolchain}\" )\n else()\n set( __gcc_toolchain \"${__toolchain}\" )\n endif()\n __DETECT_TOOLCHAIN_MACHINE_NAME( __machine \"${ANDROID_NDK_TOOLCHAINS_PATH}/${__gcc_toolchain}${__toolchain_subpath}\" )\n if( __machine )\n string( REGEX MATCH \"[0-9]+[.][0-9]+([.][0-9x]+)?$\" __version \"${__gcc_toolchain}\" )\n if( __machine MATCHES i686 )\n set( __arch \"x86\" )\n elseif( __machine MATCHES arm )\n set( __arch \"arm\" )\n elseif( __machine MATCHES mipsel )\n set( __arch \"mipsel\" )\n endif()\n list( APPEND __availableToolchainMachines \"${__machine}\" )\n list( APPEND __availableToolchainArchs \"${__arch}\" )\n list( APPEND __availableToolchainCompilerVersions \"${__version}\" )\n list( APPEND ${__availableToolchainsVar} \"${__toolchain}\" )\n endif()\n unset( __gcc_toolchain )\n endforeach()\nendmacro()\n\n# get all the details about NDK\nif( BUILD_WITH_ANDROID_NDK )\n file( GLOB ANDROID_SUPPORTED_NATIVE_API_LEVELS RELATIVE \"${ANDROID_NDK}/platforms\" \"${ANDROID_NDK}/platforms/android-*\" )\n string( REPLACE \"android-\" \"\" ANDROID_SUPPORTED_NATIVE_API_LEVELS \"${ANDROID_SUPPORTED_NATIVE_API_LEVELS}\" )\n set( __availableToolchains \"\" )\n set( __availableToolchainMachines \"\" )\n set( __availableToolchainArchs \"\" )\n set( __availableToolchainCompilerVersions \"\" )\n if( ANDROID_TOOLCHAIN_NAME AND EXISTS \"${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_TOOLCHAIN_NAME}/\" )\n # do not go through all toolchains if we know the name\n set( __availableToolchainsLst \"${ANDROID_TOOLCHAIN_NAME}\" )\n __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst \"${ANDROID_NDK_TOOLCHAINS_SUBPATH}\" )\n if( NOT __availableToolchains AND NOT ANDROID_NDK_TOOLCHAINS_SUBPATH STREQUAL ANDROID_NDK_TOOLCHAINS_SUBPATH2 )\n __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst \"${ANDROID_NDK_TOOLCHAINS_SUBPATH2}\" )\n if( __availableToolchains )\n set( ANDROID_NDK_TOOLCHAINS_SUBPATH ${ANDROID_NDK_TOOLCHAINS_SUBPATH2} )\n endif()\n endif()\n endif()\n if( NOT __availableToolchains )\n file( GLOB __availableToolchainsLst RELATIVE \"${ANDROID_NDK_TOOLCHAINS_PATH}\" \"${ANDROID_NDK_TOOLCHAINS_PATH}/*\" )\n if( __availableToolchains )\n list(SORT __availableToolchainsLst) # we need clang to go after gcc\n endif()\n __LIST_FILTER( __availableToolchainsLst \"^[.]\" )\n __LIST_FILTER( __availableToolchainsLst \"llvm\" )\n __LIST_FILTER( __availableToolchainsLst \"renderscript\" )\n __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst \"${ANDROID_NDK_TOOLCHAINS_SUBPATH}\" )\n if( NOT __availableToolchains AND NOT ANDROID_NDK_TOOLCHAINS_SUBPATH STREQUAL ANDROID_NDK_TOOLCHAINS_SUBPATH2 )\n __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst \"${ANDROID_NDK_TOOLCHAINS_SUBPATH2}\" )\n if( __availableToolchains )\n set( ANDROID_NDK_TOOLCHAINS_SUBPATH ${ANDROID_NDK_TOOLCHAINS_SUBPATH2} )\n endif()\n endif()\n endif()\n if( NOT __availableToolchains )\n message( FATAL_ERROR \"Could not find any working toolchain in the NDK. Probably your Android NDK is broken.\" )\n endif()\nendif()\n\n# build list of available ABIs\nset( ANDROID_SUPPORTED_ABIS \"\" )\nset( __uniqToolchainArchNames ${__availableToolchainArchs} )\nlist( REMOVE_DUPLICATES __uniqToolchainArchNames )\nlist( SORT __uniqToolchainArchNames )\nforeach( __arch ${__uniqToolchainArchNames} )\n list( APPEND ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${__arch}} )\nendforeach()\nunset( __uniqToolchainArchNames )\nif( NOT ANDROID_SUPPORTED_ABIS )\n message( FATAL_ERROR \"No one of known Android ABIs is supported by this cmake toolchain.\" )\nendif()\n\n# choose target ABI\n__INIT_VARIABLE( ANDROID_ABI OBSOLETE_ARM_TARGET OBSOLETE_ARM_TARGETS VALUES ${ANDROID_SUPPORTED_ABIS} )\n# verify that target ABI is supported\nlist( FIND ANDROID_SUPPORTED_ABIS \"${ANDROID_ABI}\" __androidAbiIdx )\nif( __androidAbiIdx EQUAL -1 )\n string( REPLACE \";\" \"\\\", \\\"\" PRINTABLE_ANDROID_SUPPORTED_ABIS \"${ANDROID_SUPPORTED_ABIS}\" )\n message( FATAL_ERROR \"Specified ANDROID_ABI = \\\"${ANDROID_ABI}\\\" is not supported by this cmake toolchain or your NDK/toolchain.\n Supported values are: \\\"${PRINTABLE_ANDROID_SUPPORTED_ABIS}\\\"\n \" )\nendif()\nunset( __androidAbiIdx )\n\n# set target ABI options\nif( ANDROID_ABI STREQUAL \"x86\" )\n set( X86 true )\n set( ANDROID_NDK_ABI_NAME \"x86\" )\n set( ANDROID_ARCH_NAME \"x86\" )\n set( ANDROID_ARCH_FULLNAME \"x86\" )\n set( ANDROID_LLVM_TRIPLE \"i686-none-linux-android\" )\n set( CMAKE_SYSTEM_PROCESSOR \"i686\" )\nelseif( ANDROID_ABI STREQUAL \"mips\" )\n set( MIPS true )\n set( ANDROID_NDK_ABI_NAME \"mips\" )\n set( ANDROID_ARCH_NAME \"mips\" )\n set( ANDROID_ARCH_FULLNAME \"mipsel\" )\n set( ANDROID_LLVM_TRIPLE \"mipsel-none-linux-android\" )\n set( CMAKE_SYSTEM_PROCESSOR \"mips\" )\nelseif( ANDROID_ABI STREQUAL \"armeabi\" )\n set( ARMEABI true )\n set( ANDROID_NDK_ABI_NAME \"armeabi\" )\n set( ANDROID_ARCH_NAME \"arm\" )\n set( ANDROID_ARCH_FULLNAME \"arm\" )\n set( ANDROID_LLVM_TRIPLE \"armv5te-none-linux-androideabi\" )\n set( CMAKE_SYSTEM_PROCESSOR \"armv5te\" )\nelseif( ANDROID_ABI STREQUAL \"armeabi-v6 with VFP\" )\n set( ARMEABI_V6 true )\n set( ANDROID_NDK_ABI_NAME \"armeabi\" )\n set( ANDROID_ARCH_NAME \"arm\" )\n set( ANDROID_ARCH_FULLNAME \"arm\" )\n set( ANDROID_LLVM_TRIPLE \"armv5te-none-linux-androideabi\" )\n set( CMAKE_SYSTEM_PROCESSOR \"armv6\" )\n # need always fallback to older platform\n set( ARMEABI true )\nelseif( ANDROID_ABI STREQUAL \"armeabi-v7a\")\n set( ARMEABI_V7A true )\n set( ANDROID_NDK_ABI_NAME \"armeabi-v7a\" )\n set( ANDROID_ARCH_NAME \"arm\" )\n set( ANDROID_ARCH_FULLNAME \"arm\" )\n set( ANDROID_LLVM_TRIPLE \"armv7-none-linux-androideabi\" )\n set( CMAKE_SYSTEM_PROCESSOR \"armv7-a\" )\nelseif( ANDROID_ABI STREQUAL \"armeabi-v7a with VFPV3\" )\n set( ARMEABI_V7A true )\n set( ANDROID_NDK_ABI_NAME \"armeabi-v7a\" )\n set( ANDROID_ARCH_NAME \"arm\" )\n set( ANDROID_ARCH_FULLNAME \"arm\" )\n set( ANDROID_LLVM_TRIPLE \"armv7-none-linux-androideabi\" )\n set( CMAKE_SYSTEM_PROCESSOR \"armv7-a\" )\n set( VFPV3 true )\nelseif( ANDROID_ABI STREQUAL \"armeabi-v7a with NEON\" )\n set( ARMEABI_V7A true )\n set( ANDROID_NDK_ABI_NAME \"armeabi-v7a\" )\n set( ANDROID_ARCH_NAME \"arm\" )\n set( ANDROID_ARCH_FULLNAME \"arm\" )\n set( ANDROID_LLVM_TRIPLE \"armv7-none-linux-androideabi\" )\n set( CMAKE_SYSTEM_PROCESSOR \"armv7-a\" )\n set( VFPV3 true )\n set( NEON true )\nelse()\n message( SEND_ERROR \"Unknown ANDROID_ABI=\\\"${ANDROID_ABI}\\\" is specified.\" )\nendif()\n\nif( CMAKE_BINARY_DIR AND EXISTS \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake\" )\n # really dirty hack\n # it is not possible to change CMAKE_SYSTEM_PROCESSOR after the first run...\n file( APPEND \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake\" \"SET(CMAKE_SYSTEM_PROCESSOR \\\"${CMAKE_SYSTEM_PROCESSOR}\\\")\\n\" )\nendif()\n\nif( ANDROID_ARCH_NAME STREQUAL \"arm\" AND NOT ARMEABI_V6 )\n __INIT_VARIABLE( ANDROID_FORCE_ARM_BUILD OBSOLETE_FORCE_ARM VALUES OFF )\n set( ANDROID_FORCE_ARM_BUILD ${ANDROID_FORCE_ARM_BUILD} CACHE BOOL \"Use 32-bit ARM instructions instead of Thumb-1\" FORCE )\n mark_as_advanced( ANDROID_FORCE_ARM_BUILD )\nelse()\n unset( ANDROID_FORCE_ARM_BUILD CACHE )\nendif()\n\n# choose toolchain\nif( ANDROID_TOOLCHAIN_NAME )\n list( FIND __availableToolchains \"${ANDROID_TOOLCHAIN_NAME}\" __toolchainIdx )\n if( __toolchainIdx EQUAL -1 )\n list( SORT __availableToolchains )\n string( REPLACE \";\" \"\\n * \" toolchains_list \"${__availableToolchains}\" )\n set( toolchains_list \" * ${toolchains_list}\")\n message( FATAL_ERROR \"Specified toolchain \\\"${ANDROID_TOOLCHAIN_NAME}\\\" is missing in your NDK or broken. Please verify that your NDK is working or select another compiler toolchain.\nTo configure the toolchain set CMake variable ANDROID_TOOLCHAIN_NAME to one of the following values:\\n${toolchains_list}\\n\" )\n endif()\n list( GET __availableToolchainArchs ${__toolchainIdx} __toolchainArch )\n if( NOT __toolchainArch STREQUAL ANDROID_ARCH_FULLNAME )\n message( SEND_ERROR \"Selected toolchain \\\"${ANDROID_TOOLCHAIN_NAME}\\\" is not able to compile binaries for the \\\"${ANDROID_ARCH_NAME}\\\" platform.\" )\n endif()\nelse()\n set( __toolchainIdx -1 )\n set( __applicableToolchains \"\" )\n set( __toolchainMaxVersion \"0.0.0\" )\n list( LENGTH __availableToolchains __availableToolchainsCount )\n math( EXPR __availableToolchainsCount \"${__availableToolchainsCount}-1\" )\n foreach( __idx RANGE ${__availableToolchainsCount} )\n list( GET __availableToolchainArchs ${__idx} __toolchainArch )\n if( __toolchainArch STREQUAL ANDROID_ARCH_FULLNAME )\n list( GET __availableToolchainCompilerVersions ${__idx} __toolchainVersion )\n string( REPLACE \"x\" \"99\" __toolchainVersion \"${__toolchainVersion}\")\n if( __toolchainVersion VERSION_GREATER __toolchainMaxVersion )\n set( __toolchainMaxVersion \"${__toolchainVersion}\" )\n set( __toolchainIdx ${__idx} )\n endif()\n endif()\n endforeach()\n unset( __availableToolchainsCount )\n unset( __toolchainMaxVersion )\n unset( __toolchainVersion )\nendif()\nunset( __toolchainArch )\nif( __toolchainIdx EQUAL -1 )\n message( FATAL_ERROR \"No one of available compiler toolchains is able to compile for ${ANDROID_ARCH_NAME} platform.\" )\nendif()\nlist( GET __availableToolchains ${__toolchainIdx} ANDROID_TOOLCHAIN_NAME )\nlist( GET __availableToolchainMachines ${__toolchainIdx} ANDROID_TOOLCHAIN_MACHINE_NAME )\nlist( GET __availableToolchainCompilerVersions ${__toolchainIdx} ANDROID_COMPILER_VERSION )\n\nunset( __toolchainIdx )\nunset( __availableToolchains )\nunset( __availableToolchainMachines )\nunset( __availableToolchainArchs )\nunset( __availableToolchainCompilerVersions )\n\n# choose native API level\n__INIT_VARIABLE( ANDROID_NATIVE_API_LEVEL ENV_ANDROID_NATIVE_API_LEVEL ANDROID_API_LEVEL ENV_ANDROID_API_LEVEL ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME} ANDROID_DEFAULT_NDK_API_LEVEL )\nstring( REGEX MATCH \"[0-9]+\" ANDROID_NATIVE_API_LEVEL \"${ANDROID_NATIVE_API_LEVEL}\" )\n# adjust API level\nset( __real_api_level ${ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME}} )\nforeach( __level ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )\n if( NOT __level GREATER ANDROID_NATIVE_API_LEVEL AND NOT __level LESS __real_api_level )\n set( __real_api_level ${__level} )\n endif()\nendforeach()\nif( __real_api_level AND NOT ANDROID_NATIVE_API_LEVEL EQUAL __real_api_level )\n message( STATUS \"Adjusting Android API level 'android-${ANDROID_NATIVE_API_LEVEL}' to 'android-${__real_api_level}'\")\n set( ANDROID_NATIVE_API_LEVEL ${__real_api_level} )\nendif()\nunset(__real_api_level)\n# validate\nlist( FIND ANDROID_SUPPORTED_NATIVE_API_LEVELS \"${ANDROID_NATIVE_API_LEVEL}\" __levelIdx )\nif( __levelIdx EQUAL -1 )\n message( SEND_ERROR \"Specified Android native API level 'android-${ANDROID_NATIVE_API_LEVEL}' is not supported by your NDK/toolchain.\" )\nelse()\n if( BUILD_WITH_ANDROID_NDK )\n __DETECT_NATIVE_API_LEVEL( __realApiLevel \"${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h\" )\n if( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL )\n message( SEND_ERROR \"Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken.\" )\n endif()\n unset( __realApiLevel )\n endif()\n set( ANDROID_NATIVE_API_LEVEL \"${ANDROID_NATIVE_API_LEVEL}\" CACHE STRING \"Android API level for native code\" FORCE )\n if( CMAKE_VERSION VERSION_GREATER \"2.8\" )\n list( SORT ANDROID_SUPPORTED_NATIVE_API_LEVELS )\n set_property( CACHE ANDROID_NATIVE_API_LEVEL PROPERTY STRINGS ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )\n endif()\nendif()\nunset( __levelIdx )\n\n\n# remember target ABI\nset( ANDROID_ABI \"${ANDROID_ABI}\" CACHE STRING \"The target ABI for Android. If arm, then armeabi-v7a is recommended for hardware floating point.\" FORCE )\nif( CMAKE_VERSION VERSION_GREATER \"2.8\" )\n list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME} )\n set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} )\nendif()\n\n\n# runtime choice (STL, rtti, exceptions)\nif( NOT ANDROID_STL )\n # honor legacy ANDROID_USE_STLPORT\n if( DEFINED ANDROID_USE_STLPORT )\n if( ANDROID_USE_STLPORT )\n set( ANDROID_STL stlport_static )\n endif()\n message( WARNING \"You are using an obsolete variable ANDROID_USE_STLPORT to select the STL variant. Use -DANDROID_STL=stlport_static instead.\" )\n endif()\n if( NOT ANDROID_STL )\n set( ANDROID_STL gnustl_static )\n endif()\nendif()\nset( ANDROID_STL \"${ANDROID_STL}\" CACHE STRING \"C++ runtime\" )\nset( ANDROID_STL_FORCE_FEATURES ON CACHE BOOL \"automatically configure rtti and exceptions support based on C++ runtime\" )\nmark_as_advanced( ANDROID_STL ANDROID_STL_FORCE_FEATURES )\n\nif( BUILD_WITH_ANDROID_NDK )\n if( NOT \"${ANDROID_STL}\" MATCHES \"^(none|system|system_re|gabi\\\\+\\\\+_static|gabi\\\\+\\\\+_shared|stlport_static|stlport_shared|gnustl_static|gnustl_shared)$\")\n message( FATAL_ERROR \"ANDROID_STL is set to invalid value \\\"${ANDROID_STL}\\\".\nThe possible values are:\n none -> Do not configure the runtime.\n system -> Use the default minimal system C++ runtime library.\n system_re -> Same as system but with rtti and exceptions.\n gabi++_static -> Use the GAbi++ runtime as a static library.\n gabi++_shared -> Use the GAbi++ runtime as a shared library.\n stlport_static -> Use the STLport runtime as a static library.\n stlport_shared -> Use the STLport runtime as a shared library.\n gnustl_static -> (default) Use the GNU STL as a static library.\n gnustl_shared -> Use the GNU STL as a shared library.\n\" )\n endif()\nelseif( BUILD_WITH_STANDALONE_TOOLCHAIN )\n if( NOT \"${ANDROID_STL}\" MATCHES \"^(none|gnustl_static|gnustl_shared)$\")\n message( FATAL_ERROR \"ANDROID_STL is set to invalid value \\\"${ANDROID_STL}\\\".\nThe possible values are:\n none -> Do not configure the runtime.\n gnustl_static -> (default) Use the GNU STL as a static library.\n gnustl_shared -> Use the GNU STL as a shared library.\n\" )\n endif()\nendif()\n\nunset( ANDROID_RTTI )\nunset( ANDROID_EXCEPTIONS )\nunset( ANDROID_STL_INCLUDE_DIRS )\nunset( __libstl )\nunset( __libsupcxx )\n\nif( NOT _CMAKE_IN_TRY_COMPILE AND ANDROID_NDK_RELEASE STREQUAL \"r7b\" AND ARMEABI_V7A AND NOT VFPV3 AND ANDROID_STL MATCHES \"gnustl\" )\n message( WARNING \"The GNU STL armeabi-v7a binaries from NDK r7b can crash non-NEON devices. The files provided with NDK r7b were not configured properly, resulting in crashes on Tegra2-based devices and others when trying to use certain floating-point functions (e.g., cosf, sinf, expf).\nYou are strongly recommended to switch to another NDK release.\n\" )\nendif()\n\nif( NOT _CMAKE_IN_TRY_COMPILE AND X86 AND ANDROID_STL MATCHES \"gnustl\" AND ANDROID_NDK_RELEASE STREQUAL \"r6\" )\n message( WARNING \"The x86 system header file from NDK r6 has incorrect definition for ptrdiff_t. You are recommended to upgrade to a newer NDK release or manually patch the header:\nSee https://android.googlesource.com/platform/development.git f907f4f9d4e56ccc8093df6fee54454b8bcab6c2\n diff --git a/ndk/platforms/android-9/arch-x86/include/machine/_types.h b/ndk/platforms/android-9/arch-x86/include/machine/_types.h\n index 5e28c64..65892a1 100644\n --- a/ndk/platforms/android-9/arch-x86/include/machine/_types.h\n +++ b/ndk/platforms/android-9/arch-x86/include/machine/_types.h\n @@ -51,7 +51,11 @@ typedef long int ssize_t;\n #endif\n #ifndef _PTRDIFF_T\n #define _PTRDIFF_T\n -typedef long ptrdiff_t;\n +# ifdef __ANDROID__\n + typedef int ptrdiff_t;\n +# else\n + typedef long ptrdiff_t;\n +# endif\n #endif\n\" )\nendif()\n\n\n# setup paths and STL for standalone toolchain\nif( BUILD_WITH_STANDALONE_TOOLCHAIN )\n set( ANDROID_TOOLCHAIN_ROOT \"${ANDROID_STANDALONE_TOOLCHAIN}\" )\n set( ANDROID_CLANG_TOOLCHAIN_ROOT \"${ANDROID_STANDALONE_TOOLCHAIN}\" )\n set( ANDROID_SYSROOT \"${ANDROID_STANDALONE_TOOLCHAIN}/sysroot\" )\n\n if( NOT ANDROID_STL STREQUAL \"none\" )\n set( ANDROID_STL_INCLUDE_DIRS \"${ANDROID_STANDALONE_TOOLCHAIN}/include/c++/${ANDROID_COMPILER_VERSION}\" )\n if( NOT EXISTS \"${ANDROID_STL_INCLUDE_DIRS}\" )\n # old location ( pre r8c )\n set( ANDROID_STL_INCLUDE_DIRS \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}\" )\n endif()\n if( ARMEABI_V7A AND EXISTS \"${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/bits\" )\n list( APPEND ANDROID_STL_INCLUDE_DIRS \"${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}\" )\n elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS \"${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb/bits\" )\n list( APPEND ANDROID_STL_INCLUDE_DIRS \"${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb\" )\n else()\n list( APPEND ANDROID_STL_INCLUDE_DIRS \"${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}\" )\n endif()\n # always search static GNU STL to get the location of libsupc++.a\n if( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a\" )\n set( __libstl \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb\" )\n elseif( ARMEABI_V7A AND EXISTS \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libstdc++.a\" )\n set( __libstl \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}\" )\n elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libstdc++.a\" )\n set( __libstl \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb\" )\n elseif( EXISTS \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libstdc++.a\" )\n set( __libstl \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib\" )\n endif()\n if( __libstl )\n set( __libsupcxx \"${__libstl}/libsupc++.a\" )\n set( __libstl \"${__libstl}/libstdc++.a\" )\n endif()\n if( NOT EXISTS \"${__libsupcxx}\" )\n message( FATAL_ERROR \"The required libstdsupc++.a is missing in your standalone toolchain.\n Usually it happens because of bug in make-standalone-toolchain.sh script from NDK r7, r7b and r7c.\n You need to either upgrade to newer NDK or manually copy\n $ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a\n to\n ${__libsupcxx}\n \" )\n endif()\n if( ANDROID_STL STREQUAL \"gnustl_shared\" )\n if( ARMEABI_V7A AND EXISTS \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so\" )\n set( __libstl \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so\" )\n elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so\" )\n set( __libstl \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so\" )\n elseif( EXISTS \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so\" )\n set( __libstl \"${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so\" )\n endif()\n endif()\n endif()\nendif()\n\n# clang\nif( \"${ANDROID_TOOLCHAIN_NAME}\" STREQUAL \"standalone-clang\" )\n set( ANDROID_COMPILER_IS_CLANG 1 )\n execute_process( COMMAND \"${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/clang${TOOL_OS_SUFFIX}\" --version OUTPUT_VARIABLE ANDROID_CLANG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE )\n string( REGEX MATCH \"[0-9]+[.][0-9]+\" ANDROID_CLANG_VERSION \"${ANDROID_CLANG_VERSION}\")\nelseif( \"${ANDROID_TOOLCHAIN_NAME}\" MATCHES \"-clang3[.][0-9]?$\" )\n string( REGEX MATCH \"3[.][0-9]$\" ANDROID_CLANG_VERSION \"${ANDROID_TOOLCHAIN_NAME}\")\n string( REGEX REPLACE \"-clang${ANDROID_CLANG_VERSION}$\" \"-4.6\" ANDROID_GCC_TOOLCHAIN_NAME \"${ANDROID_TOOLCHAIN_NAME}\" )\n if( NOT EXISTS \"${ANDROID_NDK_TOOLCHAINS_PATH}/llvm-${ANDROID_CLANG_VERSION}${ANDROID_NDK_TOOLCHAINS_SUBPATH}/bin/clang${TOOL_OS_SUFFIX}\" )\n message( FATAL_ERROR \"Could not find the Clang compiler driver\" )\n endif()\n set( ANDROID_COMPILER_IS_CLANG 1 )\n set( ANDROID_CLANG_TOOLCHAIN_ROOT \"${ANDROID_NDK_TOOLCHAINS_PATH}/llvm-${ANDROID_CLANG_VERSION}${ANDROID_NDK_TOOLCHAINS_SUBPATH}\" )\nelse()\n set( ANDROID_GCC_TOOLCHAIN_NAME \"${ANDROID_TOOLCHAIN_NAME}\" )\n unset( ANDROID_COMPILER_IS_CLANG CACHE )\nendif()\n\nstring( REPLACE \".\" \"\" _clang_name \"clang${ANDROID_CLANG_VERSION}\" )\nif( NOT EXISTS \"${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}\" )\n set( _clang_name \"clang\" )\nendif()\n\n\n# setup paths and STL for NDK\nif( BUILD_WITH_ANDROID_NDK )\n set( ANDROID_TOOLCHAIN_ROOT \"${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}${ANDROID_NDK_TOOLCHAINS_SUBPATH}\" )\n set( ANDROID_SYSROOT \"${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}\" )\n\n if( ANDROID_STL STREQUAL \"none\" )\n # do nothing\n elseif( ANDROID_STL STREQUAL \"system\" )\n set( ANDROID_RTTI OFF )\n set( ANDROID_EXCEPTIONS OFF )\n set( ANDROID_STL_INCLUDE_DIRS \"${ANDROID_NDK}/sources/cxx-stl/system/include\" )\n elseif( ANDROID_STL STREQUAL \"system_re\" )\n set( ANDROID_RTTI ON )\n set( ANDROID_EXCEPTIONS ON )\n set( ANDROID_STL_INCLUDE_DIRS \"${ANDROID_NDK}/sources/cxx-stl/system/include\" )\n elseif( ANDROID_STL MATCHES \"gabi\" )\n if( ANDROID_NDK_RELEASE STRLESS \"r7\" )\n message( FATAL_ERROR \"gabi++ is not awailable in your NDK. You have to upgrade to NDK r7 or newer to use gabi++.\")\n endif()\n set( ANDROID_RTTI ON )\n set( ANDROID_EXCEPTIONS OFF )\n set( ANDROID_STL_INCLUDE_DIRS \"${ANDROID_NDK}/sources/cxx-stl/gabi++/include\" )\n set( __libstl \"${ANDROID_NDK}/sources/cxx-stl/gabi++/libs/${ANDROID_NDK_ABI_NAME}/libgabi++_static.a\" )\n elseif( ANDROID_STL MATCHES \"stlport\" )\n if( NOT ANDROID_NDK_RELEASE STRLESS \"r8d\" )\n set( ANDROID_EXCEPTIONS ON )\n else()\n set( ANDROID_EXCEPTIONS OFF )\n endif()\n if( ANDROID_NDK_RELEASE STRLESS \"r7\" )\n set( ANDROID_RTTI OFF )\n else()\n set( ANDROID_RTTI ON )\n endif()\n set( ANDROID_STL_INCLUDE_DIRS \"${ANDROID_NDK}/sources/cxx-stl/stlport/stlport\" )\n set( __libstl \"${ANDROID_NDK}/sources/cxx-stl/stlport/libs/${ANDROID_NDK_ABI_NAME}/libstlport_static.a\" )\n elseif( ANDROID_STL MATCHES \"gnustl\" )\n set( ANDROID_EXCEPTIONS ON )\n set( ANDROID_RTTI ON )\n if( EXISTS \"${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}\" )\n if( ARMEABI_V7A AND ANDROID_COMPILER_VERSION VERSION_EQUAL \"4.7\" AND ANDROID_NDK_RELEASE STREQUAL \"r8d\" )\n # gnustl binary for 4.7 compiler is buggy :(\n # TODO: look for right fix\n set( __libstl \"${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.6\" )\n else()\n set( __libstl \"${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}\" )\n endif()\n else()\n set( __libstl \"${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++\" )\n endif()\n set( ANDROID_STL_INCLUDE_DIRS \"${__libstl}/include\" \"${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/include\" )\n if( EXISTS \"${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libgnustl_static.a\" )\n set( __libstl \"${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libgnustl_static.a\" )\n else()\n set( __libstl \"${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libstdc++.a\" )\n endif()\n else()\n message( FATAL_ERROR \"Unknown runtime: ${ANDROID_STL}\" )\n endif()\n # find libsupc++.a - rtti & exceptions\n if( ANDROID_STL STREQUAL \"system_re\" OR ANDROID_STL MATCHES \"gnustl\" )\n set( __libsupcxx \"${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a\" ) # r8b or newer\n if( NOT EXISTS \"${__libsupcxx}\" )\n set( __libsupcxx \"${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a\" ) # r7-r8\n endif()\n if( NOT EXISTS \"${__libsupcxx}\" ) # before r7\n if( ARMEABI_V7A )\n if( ANDROID_FORCE_ARM_BUILD )\n set( __libsupcxx \"${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libsupc++.a\" )\n else()\n set( __libsupcxx \"${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libsupc++.a\" )\n endif()\n elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD )\n set( __libsupcxx \"${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libsupc++.a\" )\n else()\n set( __libsupcxx \"${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libsupc++.a\" )\n endif()\n endif()\n if( NOT EXISTS \"${__libsupcxx}\")\n message( ERROR \"Could not find libsupc++.a for a chosen platform. Either your NDK is not supported or is broken.\")\n endif()\n endif()\nendif()\n\n\n# case of shared STL linkage\nif( ANDROID_STL MATCHES \"shared\" AND DEFINED __libstl )\n string( REPLACE \"_static.a\" \"_shared.so\" __libstl \"${__libstl}\" )\n # TODO: check if .so file exists before the renaming\nendif()\n\n\n# ccache support\n__INIT_VARIABLE( _ndk_ccache NDK_CCACHE ENV_NDK_CCACHE )\nif( _ndk_ccache )\n if( DEFINED NDK_CCACHE AND NOT EXISTS NDK_CCACHE )\n unset( NDK_CCACHE CACHE )\n endif()\n find_program( NDK_CCACHE \"${_ndk_ccache}\" DOC \"The path to ccache binary\")\nelse()\n unset( NDK_CCACHE CACHE )\nendif()\nunset( _ndk_ccache )\n\n\n# setup the cross-compiler\nif( NOT CMAKE_C_COMPILER )\n if( NDK_CCACHE AND NOT ANDROID_SYSROOT MATCHES \"[ ;\\\"]\" )\n set( CMAKE_C_COMPILER \"${NDK_CCACHE}\" CACHE PATH \"ccache as C compiler\" )\n set( CMAKE_CXX_COMPILER \"${NDK_CCACHE}\" CACHE PATH \"ccache as C++ compiler\" )\n if( ANDROID_COMPILER_IS_CLANG )\n set( CMAKE_C_COMPILER_ARG1 \"${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}\" CACHE PATH \"C compiler\")\n set( CMAKE_CXX_COMPILER_ARG1 \"${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}\" CACHE PATH \"C++ compiler\")\n else()\n set( CMAKE_C_COMPILER_ARG1 \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}\" CACHE PATH \"C compiler\")\n set( CMAKE_CXX_COMPILER_ARG1 \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}\" CACHE PATH \"C++ compiler\")\n endif()\n else()\n if( ANDROID_COMPILER_IS_CLANG )\n set( CMAKE_C_COMPILER \"${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}\" CACHE PATH \"C compiler\")\n set( CMAKE_CXX_COMPILER \"${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}\" CACHE PATH \"C++ compiler\")\n else()\n set( CMAKE_C_COMPILER \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}\" CACHE PATH \"C compiler\" )\n set( CMAKE_CXX_COMPILER \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}\" CACHE PATH \"C++ compiler\" )\n endif()\n endif()\n set( CMAKE_ASM_COMPILER \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}\" CACHE PATH \"assembler\" )\n set( CMAKE_STRIP \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-strip${TOOL_OS_SUFFIX}\" CACHE PATH \"strip\" )\n set( CMAKE_AR \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ar${TOOL_OS_SUFFIX}\" CACHE PATH \"archive\" )\n set( CMAKE_LINKER \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ld${TOOL_OS_SUFFIX}\" CACHE PATH \"linker\" )\n set( CMAKE_NM \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-nm${TOOL_OS_SUFFIX}\" CACHE PATH \"nm\" )\n set( CMAKE_OBJCOPY \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objcopy${TOOL_OS_SUFFIX}\" CACHE PATH \"objcopy\" )\n set( CMAKE_OBJDUMP \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objdump${TOOL_OS_SUFFIX}\" CACHE PATH \"objdump\" )\n set( CMAKE_RANLIB \"${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ranlib${TOOL_OS_SUFFIX}\" CACHE PATH \"ranlib\" )\nendif()\n\nset( _CMAKE_TOOLCHAIN_PREFIX \"${ANDROID_TOOLCHAIN_MACHINE_NAME}-\" )\nif( CMAKE_VERSION VERSION_LESS 2.8.5 )\n set( CMAKE_ASM_COMPILER_ARG1 \"-c\" )\nendif()\nif( APPLE )\n find_program( CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool )\n if( NOT CMAKE_INSTALL_NAME_TOOL )\n message( FATAL_ERROR \"Could not find install_name_tool, please check your installation.\" )\n endif()\n mark_as_advanced( CMAKE_INSTALL_NAME_TOOL )\nendif()\n\n# Force set compilers because standard identification works badly for us\ninclude( CMakeForceCompiler )\nCMAKE_FORCE_C_COMPILER( \"${CMAKE_C_COMPILER}\" GNU )\nif( ANDROID_COMPILER_IS_CLANG )\n set( CMAKE_C_COMPILER_ID Clang)\nendif()\nset( CMAKE_C_PLATFORM_ID Linux )\nset( CMAKE_C_SIZEOF_DATA_PTR 4 )\nset( CMAKE_C_HAS_ISYSROOT 1 )\nset( CMAKE_C_COMPILER_ABI ELF )\nCMAKE_FORCE_CXX_COMPILER( \"${CMAKE_CXX_COMPILER}\" GNU )\nif( ANDROID_COMPILER_IS_CLANG )\n set( CMAKE_CXX_COMPILER_ID Clang)\nendif()\nset( CMAKE_CXX_PLATFORM_ID Linux )\nset( CMAKE_CXX_SIZEOF_DATA_PTR 4 )\nset( CMAKE_CXX_HAS_ISYSROOT 1 )\nset( CMAKE_CXX_COMPILER_ABI ELF )\nset( CMAKE_CXX_SOURCE_FILE_EXTENSIONS cc cp cxx cpp CPP c++ C )\n# force ASM compiler (required for CMake < 2.8.5)\nset( CMAKE_ASM_COMPILER_ID_RUN TRUE )\nset( CMAKE_ASM_COMPILER_ID GNU )\nset( CMAKE_ASM_COMPILER_WORKS TRUE )\nset( CMAKE_ASM_COMPILER_FORCED TRUE )\nset( CMAKE_COMPILER_IS_GNUASM 1)\nset( CMAKE_ASM_SOURCE_FILE_EXTENSIONS s S asm )\n\n# flags and definitions\nremove_definitions( -DANDROID )\nadd_definitions( -DANDROID )\n\nif( ANDROID_SYSROOT MATCHES \"[ ;\\\"]\" )\n if( CMAKE_HOST_WIN32 )\n # try to convert path to 8.3 form\n file( WRITE \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cvt83.cmd\" \"@echo %~s1\" )\n execute_process( COMMAND \"$ENV{ComSpec}\" /c \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cvt83.cmd\" \"${ANDROID_SYSROOT}\"\n OUTPUT_VARIABLE __path OUTPUT_STRIP_TRAILING_WHITESPACE\n RESULT_VARIABLE __result ERROR_QUIET )\n if( __result EQUAL 0 )\n file( TO_CMAKE_PATH \"${__path}\" ANDROID_SYSROOT )\n set( ANDROID_CXX_FLAGS \"--sysroot=${ANDROID_SYSROOT}\" )\n else()\n set( ANDROID_CXX_FLAGS \"--sysroot=\\\"${ANDROID_SYSROOT}\\\"\" )\n endif()\n else()\n set( ANDROID_CXX_FLAGS \"'--sysroot=${ANDROID_SYSROOT}'\" )\n endif()\n if( NOT _CMAKE_IN_TRY_COMPILE )\n # quotes can break try_compile and compiler identification\n message(WARNING \"Path to your Android NDK (or toolchain) has non-alphanumeric symbols.\\nThe build might be broken.\\n\")\n endif()\nelse()\n set( ANDROID_CXX_FLAGS \"--sysroot=${ANDROID_SYSROOT}\" )\nendif()\n\n# NDK flags\nif( ARMEABI OR ARMEABI_V7A )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -fpic -funwind-tables\" )\n if( NOT ANDROID_FORCE_ARM_BUILD AND NOT ARMEABI_V6 )\n set( ANDROID_CXX_FLAGS_RELEASE \"-mthumb -fomit-frame-pointer -fno-strict-aliasing\" )\n set( ANDROID_CXX_FLAGS_DEBUG \"-marm -fno-omit-frame-pointer -fno-strict-aliasing\" )\n if( NOT ANDROID_COMPILER_IS_CLANG )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -finline-limit=64\" )\n endif()\n else()\n # always compile ARMEABI_V6 in arm mode; otherwise there is no difference from ARMEABI\n set( ANDROID_CXX_FLAGS_RELEASE \"-marm -fomit-frame-pointer -fstrict-aliasing\" )\n set( ANDROID_CXX_FLAGS_DEBUG \"-marm -fno-omit-frame-pointer -fno-strict-aliasing\" )\n if( NOT ANDROID_COMPILER_IS_CLANG )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300\" )\n endif()\n endif()\nelseif( X86 )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -funwind-tables\" )\n if( NOT ANDROID_COMPILER_IS_CLANG )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300\" )\n else()\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -fPIC\" )\n endif()\n set( ANDROID_CXX_FLAGS_RELEASE \"-fomit-frame-pointer -fstrict-aliasing\" )\n set( ANDROID_CXX_FLAGS_DEBUG \"-fno-omit-frame-pointer -fno-strict-aliasing\" )\nelseif( MIPS )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0\" )\n set( ANDROID_CXX_FLAGS_RELEASE \"-fomit-frame-pointer\" )\n set( ANDROID_CXX_FLAGS_DEBUG \"-fno-omit-frame-pointer\" )\n if( NOT ANDROID_COMPILER_IS_CLANG )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers\" )\n set( ANDROID_CXX_FLAGS_RELEASE \"${ANDROID_CXX_FLAGS_RELEASE} -funswitch-loops -finline-limit=300\" )\n endif()\nelseif()\n set( ANDROID_CXX_FLAGS_RELEASE \"\" )\n set( ANDROID_CXX_FLAGS_DEBUG \"\" )\nendif()\n\nset( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -fsigned-char\" ) # good/necessary when porting desktop libraries\n\nif( NOT X86 AND NOT ANDROID_COMPILER_IS_CLANG )\n set( ANDROID_CXX_FLAGS \"-Wno-psabi ${ANDROID_CXX_FLAGS}\" )\nendif()\n\nif( NOT ANDROID_COMPILER_VERSION VERSION_LESS \"4.6\" )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -no-canonical-prefixes\" ) # see https://android-review.googlesource.com/#/c/47564/\nendif()\n\n# ABI-specific flags\nif( ARMEABI_V7A )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -march=armv7-a -mfloat-abi=softfp\" )\n if( NEON )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -mfpu=neon\" )\n elseif( VFPV3 )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -mfpu=vfpv3\" )\n else()\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -mfpu=vfpv3-d16\" )\n endif()\nelseif( ARMEABI_V6 )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -march=armv6 -mfloat-abi=softfp -mfpu=vfp\" ) # vfp == vfpv2\nelseif( ARMEABI )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -march=armv5te -mtune=xscale -msoft-float\" )\nendif()\n\nif( ANDROID_STL MATCHES \"gnustl\" AND (EXISTS \"${__libstl}\" OR EXISTS \"${__libsupcxx}\") )\n set( CMAKE_CXX_CREATE_SHARED_LIBRARY \"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>\" )\n set( CMAKE_CXX_CREATE_SHARED_MODULE \"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>\" )\n set( CMAKE_CXX_LINK_EXECUTABLE \"<CMAKE_C_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>\" )\nelse()\n set( CMAKE_CXX_CREATE_SHARED_LIBRARY \"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>\" )\n set( CMAKE_CXX_CREATE_SHARED_MODULE \"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>\" )\n set( CMAKE_CXX_LINK_EXECUTABLE \"<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>\" )\nendif()\n\n# STL\nif( EXISTS \"${__libstl}\" OR EXISTS \"${__libsupcxx}\" )\n if( EXISTS \"${__libstl}\" )\n set( CMAKE_CXX_CREATE_SHARED_LIBRARY \"${CMAKE_CXX_CREATE_SHARED_LIBRARY} \\\"${__libstl}\\\"\" )\n set( CMAKE_CXX_CREATE_SHARED_MODULE \"${CMAKE_CXX_CREATE_SHARED_MODULE} \\\"${__libstl}\\\"\" )\n set( CMAKE_CXX_LINK_EXECUTABLE \"${CMAKE_CXX_LINK_EXECUTABLE} \\\"${__libstl}\\\"\" )\n endif()\n if( EXISTS \"${__libsupcxx}\" )\n set( CMAKE_CXX_CREATE_SHARED_LIBRARY \"${CMAKE_CXX_CREATE_SHARED_LIBRARY} \\\"${__libsupcxx}\\\"\" )\n set( CMAKE_CXX_CREATE_SHARED_MODULE \"${CMAKE_CXX_CREATE_SHARED_MODULE} \\\"${__libsupcxx}\\\"\" )\n set( CMAKE_CXX_LINK_EXECUTABLE \"${CMAKE_CXX_LINK_EXECUTABLE} \\\"${__libsupcxx}\\\"\" )\n # C objects:\n set( CMAKE_C_CREATE_SHARED_LIBRARY \"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>\" )\n set( CMAKE_C_CREATE_SHARED_MODULE \"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>\" )\n set( CMAKE_C_LINK_EXECUTABLE \"<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>\" )\n set( CMAKE_C_CREATE_SHARED_LIBRARY \"${CMAKE_C_CREATE_SHARED_LIBRARY} \\\"${__libsupcxx}\\\"\" )\n set( CMAKE_C_CREATE_SHARED_MODULE \"${CMAKE_C_CREATE_SHARED_MODULE} \\\"${__libsupcxx}\\\"\" )\n set( CMAKE_C_LINK_EXECUTABLE \"${CMAKE_C_LINK_EXECUTABLE} \\\"${__libsupcxx}\\\"\" )\n endif()\n if( ANDROID_STL MATCHES \"gnustl\" )\n if( NOT EXISTS \"${ANDROID_LIBM_PATH}\" )\n set( ANDROID_LIBM_PATH -lm )\n endif()\n set( CMAKE_CXX_CREATE_SHARED_LIBRARY \"${CMAKE_CXX_CREATE_SHARED_LIBRARY} ${ANDROID_LIBM_PATH}\" )\n set( CMAKE_CXX_CREATE_SHARED_MODULE \"${CMAKE_CXX_CREATE_SHARED_MODULE} ${ANDROID_LIBM_PATH}\" )\n set( CMAKE_CXX_LINK_EXECUTABLE \"${CMAKE_CXX_LINK_EXECUTABLE} ${ANDROID_LIBM_PATH}\" )\n endif()\nendif()\n\n# variables controlling optional build flags\nif (ANDROID_NDK_RELEASE STRLESS \"r7\")\n # libGLESv2.so in NDK's prior to r7 refers to missing external symbols.\n # So this flag option is required for all projects using OpenGL from native.\n __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES ON )\nelse()\n __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES OFF )\nendif()\n__INIT_VARIABLE( ANDROID_NO_UNDEFINED OBSOLETE_NO_UNDEFINED VALUES ON )\n__INIT_VARIABLE( ANDROID_FUNCTION_LEVEL_LINKING VALUES ON )\n__INIT_VARIABLE( ANDROID_GOLD_LINKER VALUES ON )\n__INIT_VARIABLE( ANDROID_NOEXECSTACK VALUES ON )\n__INIT_VARIABLE( ANDROID_RELRO VALUES ON )\n\nset( ANDROID_NO_UNDEFINED ${ANDROID_NO_UNDEFINED} CACHE BOOL \"Show all undefined symbols as linker errors\" )\nset( ANDROID_SO_UNDEFINED ${ANDROID_SO_UNDEFINED} CACHE BOOL \"Allows or disallows undefined symbols in shared libraries\" )\nset( ANDROID_FUNCTION_LEVEL_LINKING ${ANDROID_FUNCTION_LEVEL_LINKING} CACHE BOOL \"Allows or disallows undefined symbols in shared libraries\" )\nset( ANDROID_GOLD_LINKER ${ANDROID_GOLD_LINKER} CACHE BOOL \"Enables gold linker (only avaialble for NDK r8b for ARM and x86 architectures on linux-86 and darwin-x86 hosts)\" )\nset( ANDROID_NOEXECSTACK ${ANDROID_NOEXECSTACK} CACHE BOOL \"Allows or disallows undefined symbols in shared libraries\" )\nset( ANDROID_RELRO ${ANDROID_RELRO} CACHE BOOL \"Enables RELRO - a memory corruption mitigation technique\" )\nmark_as_advanced( ANDROID_NO_UNDEFINED ANDROID_SO_UNDEFINED ANDROID_FUNCTION_LEVEL_LINKING ANDROID_GOLD_LINKER ANDROID_NOEXECSTACK ANDROID_RELRO )\n\n# linker flags\nset( ANDROID_LINKER_FLAGS \"\" )\n\nif( ARMEABI_V7A )\n # this is *required* to use the following linker flags that routes around\n # a CPU bug in some Cortex-A8 implementations:\n set( ANDROID_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} -Wl,--fix-cortex-a8\" )\nendif()\n\nif( ANDROID_NO_UNDEFINED )\n if( MIPS )\n # there is some sysroot-related problem in mips linker...\n if( NOT ANDROID_SYSROOT MATCHES \"[ ;\\\"]\" )\n set( ANDROID_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} -Wl,--no-undefined -Wl,-rpath-link,${ANDROID_SYSROOT}/usr/lib\" )\n endif()\n else()\n set( ANDROID_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} -Wl,--no-undefined\" )\n endif()\nendif()\n\nif( ANDROID_SO_UNDEFINED )\n set( ANDROID_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} -Wl,-allow-shlib-undefined\" )\nendif()\n\nif( ANDROID_FUNCTION_LEVEL_LINKING )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -fdata-sections -ffunction-sections\" )\n set( ANDROID_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} -Wl,--gc-sections\" )\nendif()\n\nif( ANDROID_COMPILER_VERSION VERSION_EQUAL \"4.6\" )\n if( ANDROID_GOLD_LINKER AND (CMAKE_HOST_UNIX OR ANDROID_NDK_RELEASE STRGREATER \"r8b\") AND (ARMEABI OR ARMEABI_V7A OR X86) )\n set( ANDROID_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} -fuse-ld=gold\" )\n elseif( ANDROID_NDK_RELEASE STRGREATER \"r8b\")\n set( ANDROID_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} -fuse-ld=bfd\" )\n elseif( ANDROID_NDK_RELEASE STREQUAL \"r8b\" AND ARMEABI AND NOT _CMAKE_IN_TRY_COMPILE )\n message( WARNING \"The default bfd linker from arm GCC 4.6 toolchain can fail with 'unresolvable R_ARM_THM_CALL relocation' error message. See https://code.google.com/p/android/issues/detail?id=35342\n On Linux and OS X host platform you can workaround this problem using gold linker (default).\n Rerun cmake with -DANDROID_GOLD_LINKER=ON option in case of problems.\n\" )\n endif()\nendif() # version 4.6\n\nif( ANDROID_NOEXECSTACK )\n if( ANDROID_COMPILER_IS_CLANG )\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -Xclang -mnoexecstack\" )\n else()\n set( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS} -Wa,--noexecstack\" )\n endif()\n set( ANDROID_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} -Wl,-z,noexecstack\" )\nendif()\n\nif( ANDROID_RELRO )\n set( ANDROID_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now\" )\nendif()\n\nif( ANDROID_COMPILER_IS_CLANG )\n set( ANDROID_CXX_FLAGS \"-Qunused-arguments ${ANDROID_CXX_FLAGS}\" )\n if( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD )\n set( ANDROID_CXX_FLAGS_RELEASE \"-target thumbv7-none-linux-androideabi ${ANDROID_CXX_FLAGS_RELEASE}\" )\n set( ANDROID_CXX_FLAGS_DEBUG \"-target ${ANDROID_LLVM_TRIPLE} ${ANDROID_CXX_FLAGS_DEBUG}\" )\n else()\n set( ANDROID_CXX_FLAGS \"-target ${ANDROID_LLVM_TRIPLE} ${ANDROID_CXX_FLAGS}\" )\n endif()\n if( BUILD_WITH_ANDROID_NDK )\n set( ANDROID_CXX_FLAGS \"-gcc-toolchain ${ANDROID_TOOLCHAIN_ROOT} ${ANDROID_CXX_FLAGS}\" )\n endif()\nendif()\n\n# cache flags\nset( CMAKE_CXX_FLAGS \"\" CACHE STRING \"c++ flags\" )\nset( CMAKE_C_FLAGS \"\" CACHE STRING \"c flags\" )\nset( CMAKE_CXX_FLAGS_RELEASE \"-O3 -DNDEBUG\" CACHE STRING \"c++ Release flags\" )\nset( CMAKE_C_FLAGS_RELEASE \"-O3 -DNDEBUG\" CACHE STRING \"c Release flags\" )\nset( CMAKE_CXX_FLAGS_DEBUG \"-O0 -g -DDEBUG -D_DEBUG\" CACHE STRING \"c++ Debug flags\" )\nset( CMAKE_C_FLAGS_DEBUG \"-O0 -g -DDEBUG -D_DEBUG\" CACHE STRING \"c Debug flags\" )\nset( CMAKE_SHARED_LINKER_FLAGS \"\" CACHE STRING \"shared linker flags\" )\nset( CMAKE_MODULE_LINKER_FLAGS \"\" CACHE STRING \"module linker flags\" )\nset( CMAKE_EXE_LINKER_FLAGS \"-Wl,-z,nocopyreloc\" CACHE STRING \"executable linker flags\" )\n\n# put flags to cache (for debug purpose only)\nset( ANDROID_CXX_FLAGS \"${ANDROID_CXX_FLAGS}\" CACHE INTERNAL \"Android specific c/c++ flags\" )\nset( ANDROID_CXX_FLAGS_RELEASE \"${ANDROID_CXX_FLAGS_RELEASE}\" CACHE INTERNAL \"Android specific c/c++ Release flags\" )\nset( ANDROID_CXX_FLAGS_DEBUG \"${ANDROID_CXX_FLAGS_DEBUG}\" CACHE INTERNAL \"Android specific c/c++ Debug flags\" )\nset( ANDROID_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS}\" CACHE INTERNAL \"Android specific c/c++ linker flags\" )\n\n# finish flags\nset( CMAKE_CXX_FLAGS \"${ANDROID_CXX_FLAGS} ${CMAKE_CXX_FLAGS}\" )\nset( CMAKE_C_FLAGS \"${ANDROID_CXX_FLAGS} ${CMAKE_C_FLAGS}\" )\nset( CMAKE_CXX_FLAGS_RELEASE \"${ANDROID_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_RELEASE}\" )\nset( CMAKE_C_FLAGS_RELEASE \"${ANDROID_CXX_FLAGS_RELEASE} ${CMAKE_C_FLAGS_RELEASE}\" )\nset( CMAKE_CXX_FLAGS_DEBUG \"${ANDROID_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_DEBUG}\" )\nset( CMAKE_C_FLAGS_DEBUG \"${ANDROID_CXX_FLAGS_DEBUG} ${CMAKE_C_FLAGS_DEBUG}\" )\nset( CMAKE_SHARED_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}\" )\nset( CMAKE_MODULE_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}\" )\nset( CMAKE_EXE_LINKER_FLAGS \"${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}\" )\n\nif( MIPS AND BUILD_WITH_ANDROID_NDK AND ANDROID_NDK_RELEASE STREQUAL \"r8\" )\n set( CMAKE_SHARED_LINKER_FLAGS \"-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_SHARED_LINKER_FLAGS}\" )\n set( CMAKE_MODULE_LINKER_FLAGS \"-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_MODULE_LINKER_FLAGS}\" )\n set( CMAKE_EXE_LINKER_FLAGS \"-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.x ${CMAKE_EXE_LINKER_FLAGS}\" )\nendif()\n\n# configure rtti\nif( DEFINED ANDROID_RTTI AND ANDROID_STL_FORCE_FEATURES )\n if( ANDROID_RTTI )\n set( CMAKE_CXX_FLAGS \"-frtti ${CMAKE_CXX_FLAGS}\" )\n else()\n set( CMAKE_CXX_FLAGS \"-fno-rtti ${CMAKE_CXX_FLAGS}\" )\n endif()\nendif()\n\n# configure exceptios\nif( DEFINED ANDROID_EXCEPTIONS AND ANDROID_STL_FORCE_FEATURES )\n if( ANDROID_EXCEPTIONS )\n set( CMAKE_CXX_FLAGS \"-fexceptions ${CMAKE_CXX_FLAGS}\" )\n set( CMAKE_C_FLAGS \"-fexceptions ${CMAKE_C_FLAGS}\" )\n else()\n set( CMAKE_CXX_FLAGS \"-fno-exceptions ${CMAKE_CXX_FLAGS}\" )\n set( CMAKE_C_FLAGS \"-fno-exceptions ${CMAKE_C_FLAGS}\" )\n endif()\nendif()\n\n# global includes and link directories\ninclude_directories( SYSTEM \"${ANDROID_SYSROOT}/usr/include\" ${ANDROID_STL_INCLUDE_DIRS} )\nget_filename_component(__android_install_path \"${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}\" ABSOLUTE) # avoid CMP0015 policy warning\nlink_directories( \"${__android_install_path}\" )\n\n# detect if need link crtbegin_so.o explicitly\nif( NOT DEFINED ANDROID_EXPLICIT_CRT_LINK )\n set( __cmd \"${CMAKE_CXX_CREATE_SHARED_LIBRARY}\" )\n string( REPLACE \"<CMAKE_CXX_COMPILER>\" \"${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}\" __cmd \"${__cmd}\" )\n string( REPLACE \"<CMAKE_C_COMPILER>\" \"${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}\" __cmd \"${__cmd}\" )\n string( REPLACE \"<CMAKE_SHARED_LIBRARY_CXX_FLAGS>\" \"${CMAKE_CXX_FLAGS}\" __cmd \"${__cmd}\" )\n string( REPLACE \"<LANGUAGE_COMPILE_FLAGS>\" \"\" __cmd \"${__cmd}\" )\n string( REPLACE \"<LINK_FLAGS>\" \"${CMAKE_SHARED_LINKER_FLAGS}\" __cmd \"${__cmd}\" )\n string( REPLACE \"<CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>\" \"-shared\" __cmd \"${__cmd}\" )\n string( REPLACE \"<CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG>\" \"\" __cmd \"${__cmd}\" )\n string( REPLACE \"<TARGET_SONAME>\" \"\" __cmd \"${__cmd}\" )\n string( REPLACE \"<TARGET>\" \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toolchain_crtlink_test.so\" __cmd \"${__cmd}\" )\n string( REPLACE \"<OBJECTS>\" \"\\\"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\\\"\" __cmd \"${__cmd}\" )\n string( REPLACE \"<LINK_LIBRARIES>\" \"\" __cmd \"${__cmd}\" )\n separate_arguments( __cmd )\n foreach( __var ANDROID_NDK ANDROID_NDK_TOOLCHAINS_PATH ANDROID_STANDALONE_TOOLCHAIN )\n if( ${__var} )\n set( __tmp \"${${__var}}\" )\n separate_arguments( __tmp )\n string( REPLACE \"${__tmp}\" \"${${__var}}\" __cmd \"${__cmd}\")\n endif()\n endforeach()\n string( REPLACE \"'\" \"\" __cmd \"${__cmd}\" )\n string( REPLACE \"\\\"\" \"\" __cmd \"${__cmd}\" )\n execute_process( COMMAND ${__cmd} RESULT_VARIABLE __cmd_result OUTPUT_QUIET ERROR_QUIET )\n if( __cmd_result EQUAL 0 )\n set( ANDROID_EXPLICIT_CRT_LINK ON )\n else()\n set( ANDROID_EXPLICIT_CRT_LINK OFF )\n endif()\nendif()\n\nif( ANDROID_EXPLICIT_CRT_LINK )\n set( CMAKE_CXX_CREATE_SHARED_LIBRARY \"${CMAKE_CXX_CREATE_SHARED_LIBRARY} \\\"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\\\"\" )\n set( CMAKE_CXX_CREATE_SHARED_MODULE \"${CMAKE_CXX_CREATE_SHARED_MODULE} \\\"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\\\"\" )\nendif()\n\n# setup output directories\nset( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH \"root for library output, set this to change where android libs are installed to\" )\nset( CMAKE_INSTALL_PREFIX \"${ANDROID_TOOLCHAIN_ROOT}/user\" CACHE STRING \"path for installing\" )\n\nif(NOT _CMAKE_IN_TRY_COMPILE)\n if( EXISTS \"${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt\" )\n set( EXECUTABLE_OUTPUT_PATH \"${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}\" CACHE PATH \"Output directory for applications\" )\n else()\n set( EXECUTABLE_OUTPUT_PATH \"${LIBRARY_OUTPUT_PATH_ROOT}/bin\" CACHE PATH \"Output directory for applications\" )\n endif()\n set( LIBRARY_OUTPUT_PATH \"${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}\" CACHE PATH \"path for android libs\" )\nendif()\n\n# copy shaed stl library to build directory\nif( NOT _CMAKE_IN_TRY_COMPILE AND __libstl MATCHES \"[.]so$\" )\n get_filename_component( __libstlname \"${__libstl}\" NAME )\n execute_process( COMMAND \"${CMAKE_COMMAND}\" -E copy_if_different \"${__libstl}\" \"${LIBRARY_OUTPUT_PATH}/${__libstlname}\" RESULT_VARIABLE __fileCopyProcess )\n if( NOT __fileCopyProcess EQUAL 0 OR NOT EXISTS \"${LIBRARY_OUTPUT_PATH}/${__libstlname}\")\n message( SEND_ERROR \"Failed copying of ${__libstl} to the ${LIBRARY_OUTPUT_PATH}/${__libstlname}\" )\n endif()\n unset( __fileCopyProcess )\n unset( __libstlname )\nendif()\n\n\n# set these global flags for cmake client scripts to change behavior\nset( ANDROID True )\nset( BUILD_ANDROID True )\n\n# where is the target environment\nset( CMAKE_FIND_ROOT_PATH \"${ANDROID_TOOLCHAIN_ROOT}/bin\" \"${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}\" \"${ANDROID_SYSROOT}\" \"${CMAKE_INSTALL_PREFIX}\" \"${CMAKE_INSTALL_PREFIX}/share\" )\n\n# only search for libraries and includes in the ndk toolchain\nset( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )\nset( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )\nset( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )\n\n\n# macro to find packages on the host OS\nmacro( find_host_package )\n set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )\n set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER )\n set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER )\n if( CMAKE_HOST_WIN32 )\n SET( WIN32 1 )\n SET( UNIX )\n elseif( CMAKE_HOST_APPLE )\n SET( APPLE 1 )\n SET( UNIX )\n endif()\n find_package( ${ARGN} )\n SET( WIN32 )\n SET( APPLE )\n SET( UNIX 1 )\n set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )\n set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )\n set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )\nendmacro()\n\n\n# macro to find programs on the host OS\nmacro( find_host_program )\n set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )\n set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER )\n set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER )\n if( CMAKE_HOST_WIN32 )\n SET( WIN32 1 )\n SET( UNIX )\n elseif( CMAKE_HOST_APPLE )\n SET( APPLE 1 )\n SET( UNIX )\n endif()\n find_program( ${ARGN} )\n SET( WIN32 )\n SET( APPLE )\n SET( UNIX 1 )\n set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )\n set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )\n set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )\nendmacro()\n\n\nmacro( ANDROID_GET_ABI_RAWNAME TOOLCHAIN_FLAG VAR )\n if( \"${TOOLCHAIN_FLAG}\" STREQUAL \"ARMEABI\" )\n set( ${VAR} \"armeabi\" )\n elseif( \"${TOOLCHAIN_FLAG}\" STREQUAL \"ARMEABI_V7A\" )\n set( ${VAR} \"armeabi-v7a\" )\n elseif( \"${TOOLCHAIN_FLAG}\" STREQUAL \"X86\" )\n set( ${VAR} \"x86\" )\n elseif( \"${TOOLCHAIN_FLAG}\" STREQUAL \"MIPS\" )\n set( ${VAR} \"mips\" )\n else()\n set( ${VAR} \"unknown\" )\n endif()\nendmacro()\n\n\n# export toolchain settings for the try_compile() command\nif( NOT PROJECT_NAME STREQUAL \"CMAKE_TRY_COMPILE\" )\n set( __toolchain_config \"\")\n foreach( __var NDK_CCACHE LIBRARY_OUTPUT_PATH_ROOT ANDROID_FORBID_SYGWIN ANDROID_SET_OBSOLETE_VARIABLES\n ANDROID_NDK_HOST_X64\n ANDROID_NDK\n ANDROID_NDK_LAYOUT\n ANDROID_STANDALONE_TOOLCHAIN\n ANDROID_TOOLCHAIN_NAME\n ANDROID_ABI\n ANDROID_NATIVE_API_LEVEL\n ANDROID_STL\n ANDROID_STL_FORCE_FEATURES\n ANDROID_FORCE_ARM_BUILD\n ANDROID_NO_UNDEFINED\n ANDROID_SO_UNDEFINED\n ANDROID_FUNCTION_LEVEL_LINKING\n ANDROID_GOLD_LINKER\n ANDROID_NOEXECSTACK\n ANDROID_RELRO\n ANDROID_LIBM_PATH\n ANDROID_EXPLICIT_CRT_LINK\n )\n if( DEFINED ${__var} )\n if( \"${__var}\" MATCHES \" \")\n set( __toolchain_config \"${__toolchain_config}set( ${__var} \\\"${${__var}}\\\" CACHE INTERNAL \\\"\\\" )\\n\" )\n else()\n set( __toolchain_config \"${__toolchain_config}set( ${__var} ${${__var}} CACHE INTERNAL \\\"\\\" )\\n\" )\n endif()\n endif()\n endforeach()\n file( WRITE \"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/android.toolchain.config.cmake\" \"${__toolchain_config}\" )\n unset( __toolchain_config )\nendif()\n\n\n# force cmake to produce / instead of \\ in build commands for Ninja generator\nif( CMAKE_GENERATOR MATCHES \"Ninja\" AND CMAKE_HOST_WIN32 )\n # it is a bad hack after all\n # CMake generates Ninja makefiles with UNIX paths only if it thinks that we are going to build with MinGW\n set( CMAKE_COMPILER_IS_MINGW TRUE ) # tell CMake that we are MinGW\n set( CMAKE_CROSSCOMPILING TRUE ) # stop recursion\n enable_language( C )\n enable_language( CXX )\n # unset( CMAKE_COMPILER_IS_MINGW ) # can't unset because CMake does not convert back-slashes in response files without it\n unset( MINGW )\nendif()\n\n\n# set some obsolete variables for backward compatibility\nset( ANDROID_SET_OBSOLETE_VARIABLES ON CACHE BOOL \"Define obsolete Andrid-specific cmake variables\" )\nmark_as_advanced( ANDROID_SET_OBSOLETE_VARIABLES )\nif( ANDROID_SET_OBSOLETE_VARIABLES )\n set( ANDROID_API_LEVEL ${ANDROID_NATIVE_API_LEVEL} )\n set( ARM_TARGET \"${ANDROID_ABI}\" )\n set( ARMEABI_NDK_NAME \"${ANDROID_NDK_ABI_NAME}\" )\nendif()\n\n\n# Variables controlling behavior or set by cmake toolchain:\n# ANDROID_ABI : \"armeabi-v7a\" (default), \"armeabi\", \"armeabi-v7a with NEON\", \"armeabi-v7a with VFPV3\", \"armeabi-v6 with VFP\", \"x86\", \"mips\"\n# ANDROID_NATIVE_API_LEVEL : 3,4,5,8,9,14 (depends on NDK version)\n# ANDROID_STL : gnustl_static/gnustl_shared/stlport_static/stlport_shared/gabi++_static/gabi++_shared/system_re/system/none\n# ANDROID_FORBID_SYGWIN : ON/OFF\n# ANDROID_NO_UNDEFINED : ON/OFF\n# ANDROID_SO_UNDEFINED : OFF/ON (default depends on NDK version)\n# ANDROID_FUNCTION_LEVEL_LINKING : ON/OFF\n# ANDROID_GOLD_LINKER : ON/OFF\n# ANDROID_NOEXECSTACK : ON/OFF\n# ANDROID_RELRO : ON/OFF\n# ANDROID_FORCE_ARM_BUILD : ON/OFF\n# ANDROID_STL_FORCE_FEATURES : ON/OFF\n# ANDROID_SET_OBSOLETE_VARIABLES : ON/OFF\n# Can be set only at the first run:\n# ANDROID_NDK\n# ANDROID_STANDALONE_TOOLCHAIN\n# ANDROID_TOOLCHAIN_NAME : the NDK name of compiler toolchain\n# ANDROID_NDK_HOST_X64 : try to use x86_64 toolchain (default for x64 host systems)\n# ANDROID_NDK_LAYOUT : the inner NDK structure (RELEASE, LINARO, ANDROID)\n# LIBRARY_OUTPUT_PATH_ROOT : <any valid path>\n# NDK_CCACHE : <path to your ccache executable>\n# Obsolete:\n# ANDROID_API_LEVEL : superseded by ANDROID_NATIVE_API_LEVEL\n# ARM_TARGET : superseded by ANDROID_ABI\n# ARM_TARGETS : superseded by ANDROID_ABI (can be set only)\n# ANDROID_NDK_TOOLCHAIN_ROOT : superseded by ANDROID_STANDALONE_TOOLCHAIN (can be set only)\n# ANDROID_USE_STLPORT : superseded by ANDROID_STL=stlport_static\n# ANDROID_LEVEL : superseded by ANDROID_NATIVE_API_LEVEL (completely removed)\n#\n# Primary read-only variables:\n# ANDROID : always TRUE\n# ARMEABI : TRUE for arm v6 and older devices\n# ARMEABI_V6 : TRUE for arm v6\n# ARMEABI_V7A : TRUE for arm v7a\n# NEON : TRUE if NEON unit is enabled\n# VFPV3 : TRUE if VFP version 3 is enabled\n# X86 : TRUE if configured for x86\n# MIPS : TRUE if configured for mips\n# BUILD_ANDROID : always TRUE\n# BUILD_WITH_ANDROID_NDK : TRUE if NDK is used\n# BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used\n# ANDROID_NDK_HOST_SYSTEM_NAME : \"windows\", \"linux-x86\" or \"darwin-x86\" depending on host platform\n# ANDROID_NDK_ABI_NAME : \"armeabi\", \"armeabi-v7a\", \"x86\" or \"mips\" depending on ANDROID_ABI\n# ANDROID_NDK_RELEASE : one of r5, r5b, r5c, r6, r6b, r7, r7b, r7c, r8, r8b, r8c, r8d, r8e, r9, r9b, r9c, r9d; set only for NDK\n# ANDROID_ARCH_NAME : \"arm\" or \"x86\" or \"mips\" depending on ANDROID_ABI\n# ANDROID_SYSROOT : path to the compiler sysroot\n# TOOL_OS_SUFFIX : \"\" or \".exe\" depending on host platform\n# ANDROID_COMPILER_IS_CLANG : TRUE if clang compiler is used\n# Obsolete:\n# ARMEABI_NDK_NAME : superseded by ANDROID_NDK_ABI_NAME\n#\n# Secondary (less stable) read-only variables:\n# ANDROID_COMPILER_VERSION : GCC version used\n# ANDROID_CXX_FLAGS : C/C++ compiler flags required by Android platform\n# ANDROID_SUPPORTED_ABIS : list of currently allowed values for ANDROID_ABI\n# ANDROID_TOOLCHAIN_MACHINE_NAME : \"arm-linux-androideabi\", \"arm-eabi\" or \"i686-android-linux\"\n# ANDROID_TOOLCHAIN_ROOT : path to the top level of toolchain (standalone or placed inside NDK)\n# ANDROID_CLANG_TOOLCHAIN_ROOT : path to clang tools\n# ANDROID_SUPPORTED_NATIVE_API_LEVELS : list of native API levels found inside NDK\n# ANDROID_STL_INCLUDE_DIRS : stl include paths\n# ANDROID_RTTI : if rtti is enabled by the runtime\n# ANDROID_EXCEPTIONS : if exceptions are enabled by the runtime\n# ANDROID_GCC_TOOLCHAIN_NAME : read-only, differs from ANDROID_TOOLCHAIN_NAME only if clang is used\n# ANDROID_CLANG_VERSION : version of clang compiler if clang is used\n# ANDROID_LIBM_PATH : path to libm.so (set to something like $(TOP)/out/target/product/<product_name>/obj/lib/libm.so) to workaround unresolved `sincos`\n#\n# Defaults:\n# ANDROID_DEFAULT_NDK_API_LEVEL\n# ANDROID_DEFAULT_NDK_API_LEVEL_${ARCH}\n# ANDROID_NDK_SEARCH_PATHS\n# ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH\n# ANDROID_SUPPORTED_ABIS_${ARCH}\n# ANDROID_SUPPORTED_NDK_VERSIONS\n", "meta": {"content_hash": "572927fa0aeabea778f166726d21e712", "timestamp": "", "source": "github", "line_count": 1471, "max_line_length": 289, "avg_line_length": 48.53229095853161, "alnum_prop": 0.6988415906766959, "repo_name": "dinahmoe/dm-cmake", "id": "c2000f487fcf15ea66a46698950906cf4c14642a", "size": "86390", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "android.toolchain.cmake", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CMake", "bytes": "114910"}]}} +{"text": "LWM (compressed PlayCanvas model) file format toolset\n------\n\n* Live demo can be found here: https://playcanvas.com/project/358306/overview/lwm-model-example\n* Downloadable SDK can be found here: https://github.com/PsichiX/PlayCanvasLWM/releases\n\nTool usage:\n------\n\n1. To convert PlayCanvas JSON model into LWM model, first you need to get JSON file of your model uploaded into PlayCanvas Editor.\n\n2. Then you have to process it with `convertlwm.exe` tool (found in: `/tools/`; it'swritten in C#, so .NET 4.5 is needed to be installed on your machine):\n\n ```bash\n convertlwm.exe -v -i truck.json -o truck.lwm -r -jtb -sspd -ipq 64\n ```\n * `-v` - process will be verbose;\n * `-i truck.json` - path to input JSON file;\n * `-o truck.lwm` - path to output LWM file;\n * `-r` - overwrite output file if already exists;\n * `-jtb` - convert from JSON to LWM (if you want to convert from LWM to JSON, then you use `-btj`);\n * `-sspd` - enables Small Size of Packed Data mode (model will be compressed, not just translated into binary);\n * `-ipq 64` - defines Items Per Quant count (when used with `-sspd` it will quantize data into chunks that can be compressed even more than without quantization: small chunks - better compression);\n\n3. Upload compressed LWM model onto external server that support CORS (cross-origin) - if your server cannot support CORS for LWM files, you can use `getlwmfile.php` and `.htaccess` files from `/cors/` folder.\n\n4. Add `lib/lwm.js`(debug) or `lib/lwm.min.js`(release) LWM scripts into root object in scene (this library hooks into PlayCanvas engine and allow to decompress and convert LWM files into `pc.Model` instances).\n\n5. Add `components/LWMModel.js` component script into your entity scripts and put address of externally hosted LWM model file into `url` attribute (note that because you cannot upload LWM model files into PlayCanvas Editor, you have to host them externally).\n\n6. Create new JSON file with LWM materials maping description content, that will looks like:\n\n ```json\n {\n \"meshInstancesMapping\": [\n \"Right_Wiper\",\n \"Left_Wiper\",\n \"Right_Rear\",\n \"Left_Rear\",\n \"Left_Front\",\n \"Right_Front\",\n \"TruckBody\"\n ],\n \"materialsMapping\": {\n \"Right_Wiper\": \"Pickup Truck Texture\",\n \"Left_Wiper\": \"Pickup Truck Texture\",\n \"Right_Rear\": \"Pickup Truck Texture\",\n \"Left_Rear\": \"Pickup Truck Texture\",\n \"Left_Front\": \"Pickup Truck Texture\",\n \"Right_Front\": \"Pickup Truck Texture\",\n \"TruckBody\": \"Pickup Truck Texture\"\n }\n }\n ```\n * meshInstancesMapping tells which mesh instance index will have which name;\n * materialsMapping tells which mesh instance name will have which material (material can be either string name or assed id number);\n\n7. Attach that JSON into `materialsMapping` attribute.\n\n8. Run your game and check if there is no errors. If you will get an error during LWM model loading, the most reason is that your server does not support CORS correctly - check details in browser debug console!\n\nTODO:\n------\n\n* Add skin and animation data support\n", "meta": {"content_hash": "18a32d01c5c94f1317392dfa2356d6a4", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 258, "avg_line_length": 47.50769230769231, "alnum_prop": 0.7117875647668394, "repo_name": "PsichiX/PlayCanvasLWM", "id": "0c5b267f1dac4ac8e7025572c05b10502387b898", "size": "3088", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "221"}, {"name": "Batchfile", "bytes": "81"}, {"name": "JavaScript", "bytes": "4741"}, {"name": "PHP", "bytes": "1293"}, {"name": "Shell", "bytes": "75"}]}} +{"text": "namespace Microsoft.Azure.CognitiveServices.Vision.Face\n{\n using Microsoft.Rest;\n using Microsoft.Rest.Serialization;\n using Models;\n using Newtonsoft.Json;\n using System.Collections;\n using System.Collections.Generic;\n using System.Net;\n using System.Net.Http;\n\n /// <summary>\n /// An API for face detection, verification, and identification.\n /// </summary>\n public partial class FaceAPI : ServiceClient<FaceAPI>, IFaceAPI\n {\n /// <summary>\n /// The base URI of the service.\n /// </summary>\n internal string BaseUri {get; set;}\n\n /// <summary>\n /// Gets or sets json serialization settings.\n /// </summary>\n public JsonSerializerSettings SerializationSettings { get; private set; }\n\n /// <summary>\n /// Gets or sets json deserialization settings.\n /// </summary>\n public JsonSerializerSettings DeserializationSettings { get; private set; }\n\n /// <summary>\n /// Supported Azure regions for Cognitive Services endpoints. Possible values\n /// include: 'westus', 'westeurope', 'southeastasia', 'eastus2',\n /// 'westcentralus', 'westus2', 'eastus', 'southcentralus', 'northeurope',\n /// 'eastasia', 'australiaeast', 'brazilsouth'\n /// </summary>\n public AzureRegions AzureRegion { get; set; }\n\n /// <summary>\n /// Subscription credentials which uniquely identify client subscription.\n /// </summary>\n public ServiceClientCredentials Credentials { get; private set; }\n\n /// <summary>\n /// Gets the IFaceOperations.\n /// </summary>\n public virtual IFaceOperations Face { get; private set; }\n\n /// <summary>\n /// Gets the IPersonGroupPerson.\n /// </summary>\n public virtual IPersonGroupPerson PersonGroupPerson { get; private set; }\n\n /// <summary>\n /// Gets the IPersonGroupOperations.\n /// </summary>\n public virtual IPersonGroupOperations PersonGroup { get; private set; }\n\n /// <summary>\n /// Gets the IFaceListOperations.\n /// </summary>\n public virtual IFaceListOperations FaceList { get; private set; }\n\n /// <summary>\n /// Initializes a new instance of the FaceAPI class.\n /// </summary>\n /// <param name='handlers'>\n /// Optional. The delegating handlers to add to the http client pipeline.\n /// </param>\n protected FaceAPI(params DelegatingHandler[] handlers) : base(handlers)\n {\n Initialize();\n }\n\n /// <summary>\n /// Initializes a new instance of the FaceAPI class.\n /// </summary>\n /// <param name='rootHandler'>\n /// Optional. The http client handler used to handle http transport.\n /// </param>\n /// <param name='handlers'>\n /// Optional. The delegating handlers to add to the http client pipeline.\n /// </param>\n protected FaceAPI(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)\n {\n Initialize();\n }\n\n /// <summary>\n /// Initializes a new instance of the FaceAPI class.\n /// </summary>\n /// <param name='credentials'>\n /// Required. Subscription credentials which uniquely identify client subscription.\n /// </param>\n /// <param name='handlers'>\n /// Optional. The delegating handlers to add to the http client pipeline.\n /// </param>\n /// <exception cref=\"System.ArgumentNullException\">\n /// Thrown when a required parameter is null\n /// </exception>\n public FaceAPI(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)\n {\n if (credentials == null)\n {\n throw new System.ArgumentNullException(\"credentials\");\n }\n Credentials = credentials;\n if (Credentials != null)\n {\n Credentials.InitializeServiceClient(this);\n }\n }\n\n /// <summary>\n /// Initializes a new instance of the FaceAPI class.\n /// </summary>\n /// <param name='credentials'>\n /// Required. Subscription credentials which uniquely identify client subscription.\n /// </param>\n /// <param name='rootHandler'>\n /// Optional. The http client handler used to handle http transport.\n /// </param>\n /// <param name='handlers'>\n /// Optional. The delegating handlers to add to the http client pipeline.\n /// </param>\n /// <exception cref=\"System.ArgumentNullException\">\n /// Thrown when a required parameter is null\n /// </exception>\n public FaceAPI(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)\n {\n if (credentials == null)\n {\n throw new System.ArgumentNullException(\"credentials\");\n }\n Credentials = credentials;\n if (Credentials != null)\n {\n Credentials.InitializeServiceClient(this);\n }\n }\n\n /// <summary>\n /// An optional partial-method to perform custom initialization.\n ///</summary>\n partial void CustomInitialize();\n /// <summary>\n /// Initializes client properties.\n /// </summary>\n private void Initialize()\n {\n Face = new FaceOperations(this);\n PersonGroupPerson = new PersonGroupPerson(this);\n PersonGroup = new PersonGroupOperations(this);\n FaceList = new FaceListOperations(this);\n BaseUri = \"https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0\";\n SerializationSettings = new JsonSerializerSettings\n {\n Formatting = Newtonsoft.Json.Formatting.Indented,\n DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,\n DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,\n NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,\n ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,\n ContractResolver = new ReadOnlyJsonContractResolver(),\n Converters = new List<JsonConverter>\n {\n new Iso8601TimeSpanConverter()\n }\n };\n DeserializationSettings = new JsonSerializerSettings\n {\n DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,\n DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,\n NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,\n ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,\n ContractResolver = new ReadOnlyJsonContractResolver(),\n Converters = new List<JsonConverter>\n {\n new Iso8601TimeSpanConverter()\n }\n };\n CustomInitialize();\n }\n }\n}\n", "meta": {"content_hash": "69e8a4581f958be9653e7bbb60732c95", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 158, "avg_line_length": 39.32432432432432, "alnum_prop": 0.5869415807560138, "repo_name": "DheerendraRathor/azure-sdk-for-net", "id": "ea63df3ce11e2bef12e46a6677a052bfdf05ea92", "size": "7628", "binary": false, "copies": "2", "ref": "refs/heads/psSdkJson6", "path": "src/SDKs/CognitiveServices/dataPlane/Vision/Face/Face/Generated/FaceAPI.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "118"}, {"name": "Batchfile", "bytes": "15938"}, {"name": "C#", "bytes": "74830057"}, {"name": "CSS", "bytes": "685"}, {"name": "JavaScript", "bytes": "7875"}, {"name": "PowerShell", "bytes": "21530"}, {"name": "Shell", "bytes": "9959"}, {"name": "XSLT", "bytes": "6114"}]}} +{"text": "$(document).ready(function() {\n $(\"#add-note\").on(\"submit\", function(event) {\n event.preventDefault();\n var action = $(this).attr(\"action\");\n var method = $(this).attr(\"method\");\n var data = $(this).serialize();\n var request = $.ajax(action, {\"method\": method, \"data\": data});\n request.done(function(response) {\n $(\"#private-notes\").append(response)\n })\n })\n\n $(\".delete\").on(\"click\", function(event) {\n event.preventDefault();\n \n var action = $(this).attr(\"href\");\n var method = \"delete\";\n var data = \"note_id=\" + $(this).attr(\"id\");\n var deleted_element = $(this).parent()\n // debugger;\n var request = $.ajax(action, {\"method\": method, \"data\": data});\n request.done(function() {\n deleted_element.remove();\n })\n })\n\n});\n", "meta": {"content_hash": "e7b418ace4155a63d0d452715ab2b5dd", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 67, "avg_line_length": 29.11111111111111, "alnum_prop": 0.5661577608142494, "repo_name": "helin24/FS-Momentum", "id": "1fab55c903800b2034ede1d5b80e9614be7b7f2e", "size": "786", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/js/skill.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "3484"}, {"name": "JavaScript", "bytes": "2123"}, {"name": "Ruby", "bytes": "17810"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Data;\nusing System.Linq.Expressions;\n\nnamespace ServiceStack.OrmLite\n{\n public static class OrmLiteWriteExpressionsApi\n {\n /// <summary>\n /// Use an SqlExpression to select which fields to update and construct the where expression, E.g: \n /// \n /// var q = db.From>Person<());\n /// db.UpdateOnly(new Person { FirstName = \"JJ\" }, q.Update(p => p.FirstName).Where(x => x.FirstName == \"Jimi\"));\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ' WHERE (\"FirstName\" = 'Jimi')\n /// \n /// What's not in the update expression doesn't get updated. No where expression updates all rows. E.g:\n /// \n /// db.UpdateOnly(new Person { FirstName = \"JJ\", LastName = \"Hendo\" }, ev.Update(p => p.FirstName));\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ'\n /// </summary>\n public static int UpdateOnly<T>(this IDbConnection dbConn, T model, SqlExpression<T> onlyFields, Action<IDbCommand> commandFilter = null)\n {\n return dbConn.Exec(dbCmd => dbCmd.UpdateOnly(model, onlyFields, commandFilter));\n }\n\n /// <summary>\n /// Update only fields in the specified expression that matches the where condition (if any), E.g:\n /// \n /// db.UpdateOnly(() => new Person { FirstName = \"JJ\" }, where: p => p.LastName == \"Hendrix\");\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ' WHERE (\"LastName\" = 'Hendrix')\n ///\n /// db.UpdateOnly(() => new Person { FirstName = \"JJ\" });\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ'\n /// </summary>\n public static int UpdateOnly<T>(this IDbConnection dbConn, \n Expression<Func<T>> updateFields,\n Expression<Func<T, bool>> where = null,\n Action<IDbCommand> commandFilter = null)\n {\n return dbConn.Exec(dbCmd => dbCmd.UpdateOnly(updateFields, dbCmd.GetDialectProvider().SqlExpression<T>().Where(where), commandFilter));\n }\n\n /// <summary>\n /// Update only fields in the specified expression that matches the where condition (if any), E.g:\n /// \n /// db.UpdateOnly(() => new Person { FirstName = \"JJ\" }, db.From>Person<().Where(p => p.LastName == \"Hendrix\"));\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ' WHERE (\"LastName\" = 'Hendrix')\n /// </summary>\n public static int UpdateOnly<T>(this IDbConnection dbConn,\n Expression<Func<T>> updateFields,\n SqlExpression<T> q,\n Action<IDbCommand> commandFilter = null)\n {\n return dbConn.Exec(dbCmd => dbCmd.UpdateOnly(updateFields, q, commandFilter));\n }\n\n /// <summary>\n /// Update only fields in the specified expression that matches the where condition (if any), E.g:\n ///\n /// var q = db.From>Person<().Where(p => p.LastName == \"Hendrix\");\n /// db.UpdateOnly(() => new Person { FirstName = \"JJ\" }, q.WhereExpression, q.Params);\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ' WHERE (\"LastName\" = 'Hendrix')\n /// </summary>\n public static int UpdateOnly<T>(this IDbConnection dbConn,\n Expression<Func<T>> updateFields,\n string whereExpression,\n IEnumerable<IDbDataParameter> sqlParams,\n Action<IDbCommand> commandFilter = null)\n {\n return dbConn.Exec(dbCmd => dbCmd.UpdateOnly(updateFields, whereExpression, sqlParams, commandFilter));\n }\n\n /// <summary>\n /// Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g:\n /// \n /// db.UpdateOnly(new Person { FirstName = \"JJ\" }, p => p.FirstName, p => p.LastName == \"Hendrix\");\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ' WHERE (\"LastName\" = 'Hendrix')\n ///\n /// db.UpdateOnly(new Person { FirstName = \"JJ\" }, p => p.FirstName);\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ'\n ///\n /// db.UpdateOnly(new Person { FirstName = \"JJ\", Age = 27 }, p => new { p.FirstName, p.Age );\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ', \"Age\" = 27\n /// </summary>\n public static int UpdateOnly<T>(this IDbConnection dbConn, T obj,\n Expression<Func<T, object>> onlyFields = null,\n Expression<Func<T, bool>> where = null,\n Action<IDbCommand> commandFilter = null)\n {\n return dbConn.Exec(dbCmd => dbCmd.UpdateOnly(obj, onlyFields, where, commandFilter));\n }\n\n /// <summary>\n /// Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g:\n /// \n /// db.UpdateOnly(new Person { FirstName = \"JJ\" }, new[]{ \"FirstName\" }, p => p.LastName == \"Hendrix\");\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ' WHERE (\"LastName\" = 'Hendrix')\n /// </summary>\n public static int UpdateOnly<T>(this IDbConnection dbConn, T obj,\n string[] onlyFields,\n Expression<Func<T, bool>> where = null,\n Action<IDbCommand> commandFilter = null)\n {\n return dbConn.Exec(dbCmd => dbCmd.UpdateOnly(obj, onlyFields, where, commandFilter));\n }\n\n /// <summary>\n /// Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g:\n /// Numeric fields generates an increment sql which is useful to increment counters, etc...\n /// avoiding concurrency conflicts\n /// \n /// db.UpdateAdd(() => new Person { Age = 5 }, where: p => p.LastName == \"Hendrix\");\n /// UPDATE \"Person\" SET \"Age\" = \"Age\" + 5 WHERE (\"LastName\" = 'Hendrix')\n ///\n /// db.UpdateAdd(() => new Person { Age = 5 });\n /// UPDATE \"Person\" SET \"Age\" = \"Age\" + 5\n /// </summary>\n public static int UpdateAdd<T>(this IDbConnection dbConn,\n Expression<Func<T>> updateFields,\n Expression<Func<T, bool>> where = null,\n Action<IDbCommand> commandFilter = null)\n {\n return dbConn.Exec(dbCmd => dbCmd.UpdateAdd(updateFields, dbCmd.GetDialectProvider().SqlExpression<T>().Where(where), commandFilter));\n }\n\n /// <summary>\n /// Update record, updating only fields specified in updateOnly that matches the where condition (if any), E.g:\n /// Numeric fields generates an increment sql which is useful to increment counters, etc...\n /// avoiding concurrency conflicts\n /// \n /// db.UpdateAdd(() => new Person { Age = 5 }, db.From<Person>().Where(p => p.LastName == \"Hendrix\"));\n /// UPDATE \"Person\" SET \"Age\" = \"Age\" + 5 WHERE (\"LastName\" = 'Hendrix')\n /// </summary>\n public static int UpdateAdd<T>(this IDbConnection dbConn,\n Expression<Func<T>> updateFields,\n SqlExpression<T> q,\n Action<IDbCommand> commandFilter = null)\n {\n return dbConn.Exec(dbCmd => dbCmd.UpdateAdd(updateFields, q, commandFilter));\n }\n\n /// <summary>\n /// Updates all values from Object Dictionary matching the where condition. E.g\n /// \n /// db.UpdateOnly<Person>(new Dictionary<string,object< { {\"FirstName\", \"JJ\"} }, where:p => p.FirstName == \"Jimi\");\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ' WHERE (\"FirstName\" = 'Jimi')\n /// </summary>\n public static int UpdateOnly<T>(this IDbConnection dbConn, Dictionary<string, object> updateFields, Expression<Func<T, bool>> obj)\n {\n return dbConn.Exec(dbCmd => dbCmd.UpdateOnly(updateFields, obj));\n }\n\n /// <summary>\n /// Updates all non-default values set on item matching the where condition (if any). E.g\n /// \n /// db.UpdateNonDefaults(new Person { FirstName = \"JJ\" }, p => p.FirstName == \"Jimi\");\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ' WHERE (\"FirstName\" = 'Jimi')\n /// </summary>\n public static int UpdateNonDefaults<T>(this IDbConnection dbConn, T item, Expression<Func<T, bool>> obj)\n {\n return dbConn.Exec(dbCmd => dbCmd.UpdateNonDefaults(item, obj));\n }\n\n /// <summary>\n /// Updates all values set on item matching the where condition (if any). E.g\n /// \n /// db.Update(new Person { Id = 1, FirstName = \"JJ\" }, p => p.LastName == \"Hendrix\");\n /// UPDATE \"Person\" SET \"Id\" = 1,\"FirstName\" = 'JJ',\"LastName\" = NULL,\"Age\" = 0 WHERE (\"LastName\" = 'Hendrix')\n /// </summary>\n public static int Update<T>(this IDbConnection dbConn, T item, Expression<Func<T, bool>> where, Action<IDbCommand> commandFilter = null)\n {\n return dbConn.Exec(dbCmd => dbCmd.Update(item, where, commandFilter));\n }\n\n /// <summary>\n /// Updates the entity using the primary key as the filter\n /// </summary>\n public static int Update<T>(this IDbConnection dbConn, object entity)\n {\n return dbConn.Exec(dbCmd => dbCmd.Update<T>(entity, where:null, commandFilter:null));\n }\n\n /// <summary>\n /// Updates all matching fields populated on anonymousType that matches where condition (if any). E.g:\n /// \n /// db.Update<Person>(new { FirstName = \"JJ\" }, p => p.LastName == \"Hendrix\");\n /// UPDATE \"Person\" SET \"FirstName\" = 'JJ' WHERE (\"LastName\" = 'Hendrix')\n /// </summary>\n public static int Update<T>(this IDbConnection dbConn, object updateOnly, Expression<Func<T, bool>> where, Action<IDbCommand> commandFilter = null)\n {\n return dbConn.Exec(dbCmd => dbCmd.Update<T>(updateOnly, where, commandFilter));\n }\n\n /// <summary>\n /// Using an SqlExpression to only Insert the fields specified, e.g:\n /// \n /// db.InsertOnly(new Person { FirstName = \"Amy\" }, p => p.FirstName));\n /// INSERT INTO \"Person\" (\"FirstName\") VALUES ('Amy');\n /// \n /// db.InsertOnly(new Person { Id =1 , FirstName=\"Amy\" }, p => new { p.Id, p.FirstName }));\n /// INSERT INTO \"Person\" (\"Id\", \"FirstName\") VALUES (1, 'Amy');\n /// </summary>\n public static long InsertOnly<T>(this IDbConnection dbConn, T obj, Expression<Func<T, object>> onlyFields, bool selectIdentity = false)\n {\n return dbConn.Exec(dbCmd => dbCmd.InsertOnly(obj, onlyFields.GetFieldNames(), selectIdentity));\n }\n\n /// <summary>\n /// Using an SqlExpression to only Insert the fields specified, e.g:\n /// \n /// db.InsertOnly(new Person { FirstName = \"Amy\" }, new[]{ \"FirstName\" }));\n /// INSERT INTO \"Person\" (\"FirstName\") VALUES ('Amy');\n /// </summary>\n public static long InsertOnly<T>(this IDbConnection dbConn, T obj, string[] onlyFields, bool selectIdentity = false)\n {\n return dbConn.Exec(dbCmd => dbCmd.InsertOnly(obj, onlyFields, selectIdentity));\n }\n\n /// <summary>\n /// Using an SqlExpression to only Insert the fields specified, e.g:\n /// \n /// db.InsertOnly(() => new Person { FirstName = \"Amy\" }));\n /// INSERT INTO \"Person\" (\"FirstName\") VALUES (@FirstName);\n /// </summary>\n public static long InsertOnly<T>(this IDbConnection dbConn, Expression<Func<T>> insertFields, bool selectIdentity = false)\n {\n return dbConn.Exec(dbCmd => dbCmd.InsertOnly(insertFields, selectIdentity));\n }\n\n /// <summary>\n /// Delete the rows that matches the where expression, e.g:\n /// \n /// db.Delete<Person>(p => p.Age == 27);\n /// DELETE FROM \"Person\" WHERE (\"Age\" = 27)\n /// </summary>\n public static int Delete<T>(this IDbConnection dbConn, Expression<Func<T, bool>> where)\n {\n return dbConn.Exec(dbCmd => dbCmd.Delete(where));\n }\n\n /// <summary>\n /// Delete the rows that matches the where expression, e.g:\n /// \n /// var q = db.From<Person>());\n /// db.Delete<Person>(q.Where(p => p.Age == 27));\n /// DELETE FROM \"Person\" WHERE (\"Age\" = 27)\n /// </summary>\n public static int Delete<T>(this IDbConnection dbConn, SqlExpression<T> where)\n {\n return dbConn.Exec(dbCmd => dbCmd.Delete(where));\n }\n }\n}", "meta": {"content_hash": "b9e0f6c6088382028c5e3bbadfbd6ecc", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 155, "avg_line_length": 49.25984251968504, "alnum_prop": 0.5728101023017903, "repo_name": "Pathfinder-Fr/YAFNET", "id": "0e47d06e0b057909bd41e636c4356ac7f807766e", "size": "12514", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "yafsrc/ServiceStack/ServiceStack.OrmLite/OrmLiteWriteExpressionsApi.cs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ASP", "bytes": "1160769"}, {"name": "Batchfile", "bytes": "4612"}, {"name": "C#", "bytes": "32268813"}, {"name": "CSS", "bytes": "1119799"}, {"name": "HTML", "bytes": "14854"}, {"name": "JavaScript", "bytes": "5789303"}, {"name": "PLSQL", "bytes": "34218"}, {"name": "PLpgSQL", "bytes": "53478"}, {"name": "TSQL", "bytes": "706921"}]}} +{"text": "SharePoint Add-in Recipe - Yammer Integration\n=============================================\n\nSummary\n-------\n\nThe approach you take to integrate Yammer with SharePoint is the same in the new SharePoint Add-in model as it is with Full Trust Code.\n\nHigh Level Guidelines\n---------------------\n\nAs a rule of a thumb, we would like to provide the following high level guidelines to integrate Yammer with SharePoint.\n\n- Yammer integration may be used in both on-premises and Office 365 SharePoint environments.\n- You can use the remote provisioning pattern to create Yammer groups and/or Yammer OpenGraph objects to facilitate conversations when you create new SharePoint sites.\n- You can use the out-of-the-box embed functionality to quickly and easily integrate Yammer with SharePoint.\n\t+ To use embed you need a HTML container 400 pixels or larger in your application.\n- You can use the Yammer SDKs and REST APIs to create customized integration functionality.\n\nOptions to integrate Yammer with SharePoint\n-------------------------------------------\n\nYou have a few options to integrate Yammer with SharePoint.\n\n- Embed\n\t+ Group, Topic, My, and User Feeds\n\t+ OpenGraph Feeds\n- Yammer OpenGraph API and/or Yammer REST API with Yammer SDKs\n\t\nEmbed\n-----\n\nIn this option you embed a Yammer feed in a SharePoint web page.\n\t\n- This option is quickly and easily implemented.\n- This option allows you to control limited aspects of the feed and how it appears.\n\nUsing embed looks like this in your SharePoint page:\n\n\n\nThe following table describes each type of Yammer feed you can access with embed out-of-the-box.\n\nFeed | Description | FeedType | Use Case\n---- | ----------- | -------- | --------\nMy Feed | My Feeds are where conversations are delivered for Yammer users. | MyFeed | My Site homepage or workspace site.\nUser Feed | All the conversations posted by a specific user in Yammer. | User | Profile pages for users in a system directory.\nTopic Feed | A feed of conversations that have been tagged with a topic in Yammer. | Topic | An event page on an intranet.\nGroup Feed | A feed of conversations that have been posted in a specified group. | Group | A team page on an intranet.\n\nIf you need to go beyond the capabilities of the out-of-the-box Yammer feeds in the table above you can use the OpenGraph embed option. This option gives you more control of the feed. The following table illustrates such an example.\n\nFeed | Description | FeedType | Use Case\n---- | ----------- | -------- | --------\nComment Feed | Uses Yammer\u2019s Open Graph API to facilitate conversation around an application object. | Custom | An opportunity in a custom CRM application, or a media detail page in a digital asset management system.\n\n**When is it a good fit?**\n\nWhen you are trying to integrate Yammer feeds with SharePoint sites and the out-of-the-box capabilities of the embed feed meet your needs.\n\n**Getting Started**\n\nThe following sample demonstrates how to provision sites with a Yammer feed associated with the site in place of the default news feed for the site.\n\n- [Provisioning.Yammer (O365 PnP Sample)](https://github.com/OfficeDev/PnP/tree/master/Scenarios/Provisioning.Yammer)\n\nThe **CreateYammerGroupDiscussionPartXml** method in the [YammerUtility.cs](https://github.com/OfficeDev/PnP/blob/master/OfficeDevPnP.Core/OfficeDevPnP.Core/Utilities/YammerUtility.cs) class comes from the [OfficeDevPnP.Core](https://github.com/OfficeDev/PnP/blob/master/OfficeDevPnP.Core/OfficeDevPnP.Core) sample. This method creates the XML for an App Part definition that is added to a SharePoint page when a site is provisioned. Notice the **feedType: 'group'** portion of the code. Here you can see the feedType is set to use the out-of-the-box group feedType.\n\n\tpublic static string CreateYammerGroupDiscussionPartXml(string yammerNetworkName, int yammerGroupId, bool showHeader, bool showFooter, bool useSSO = true)\n {\n StringBuilder wp = new StringBuilder(100);\n wp.Append(\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\");\n wp.Append(\"<webParts>\");\n wp.Append(\"\t<webPart xmlns='http://schemas.microsoft.com/WebPart/v3'>\");\n wp.Append(\"\t\t<metaData>\");\n wp.Append(\"\t\t\t<type name='Microsoft.SharePoint.WebPartPages.ScriptEditorWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' />\");\n wp.Append(\"\t\t\t<importErrorMessage>Cannot import this Web Part.</importErrorMessage>\");\n wp.Append(\"\t\t</metaData>\");\n wp.Append(\"\t\t<data>\");\n wp.Append(\"\t\t\t<properties>\");\n wp.Append(\"\t\t\t\t<property name='Title' type='string'>$Resources:core,ScriptEditorWebPartTitle;</property>\");\n wp.Append(\"\t\t\t\t<property name='Description' type='string'>$Resources:core,ScriptEditorWebPartDescription;</property>\");\n wp.Append(\"\t\t\t\t<property name='ChromeType' type='chrometype'>None</property>\");\n wp.Append(\"\t\t\t\t<property name='Content' type='string'>\");\n wp.Append(\"\t\t\t\t<![CDATA[\");\n wp.Append(\"\t\t\t\t <div id='embedded-feed' style='height: 500px;'></div>\");\n wp.Append(\"\t\t\t\t <script type='text/javascript' src='https://assets.yammer.com/assets/platform_embed.js'></script>\");\n wp.Append(\"\t\t\t\t <script type='text/javascript'> \n\t\t\t\t\t\t\t\t\t\tyam.connect.embedFeed({ container: '#embedded-feed', network: '\"\n\t\t\t\t\t\t\t\t\t\t+ yammerNetworkName\n\t\t\t\t\t\t\t\t\t\t+ @\"', feedType: 'group', feedId: '\" + yammerGroupId\t\t\t\n\t\t\t\t\t\t\t\t\t\t+ @\"', config: { use_sso: \" + useSSO.ToString().ToLower()\t\t\t\n\t\t\t\t\t\t\t\t\t\t+ @\", header: \" + showHeader.ToString().ToLower()\n\t\t\t\t\t\t\t\t\t\t+ @\", footer: \" + showFooter.ToString().ToLower()\n\t\t\t\t\t\t\t\t\t\t+ \" }}); </script>\");\n wp.Append(\"\t\t\t\t]]>\");\n wp.Append(\"\t\t\t\t</property>\");\n wp.Append(\"\t\t\t</properties>\");\n wp.Append(\"\t\t</data>\");\n wp.Append(\"\t</webPart>\");\n wp.Append(\"</webParts>\");\n\n return wp.ToString();\n }\n\nThe **CreateYammerOpenGraphDiscussionPartXml** method in the [YammerUtility.cs](https://github.com/OfficeDev/PnP/blob/master/OfficeDevPnP.Core/OfficeDevPnP.Core/Utilities/YammerUtility.cs) class comes from the [OfficeDevPnP.Core](https://github.com/OfficeDev/PnP/blob/master/OfficeDevPnP.Core/OfficeDevPnP.Core) sample. This method creates the XML for an App Part definition that is added to a SharePoint page when a site is provisioned. Notice the **feedType: 'open-graph'** portion of the code. Here you can see the feedType is set to use the OpenGraph API.\n\n\tpublic static string CreateYammerOpenGraphDiscussionPartXml(string yammerNetworkName, string url, bool showHeader, \n bool showFooter, string postTitle=\"\", string postImageUrl=\"\", \n bool useSso = true, string groupId = \"\")\n {\n StringBuilder wp = new StringBuilder(100);\n wp.Append(\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\");\n wp.Append(\"<webParts>\");\n wp.Append(\"\t<webPart xmlns='http://schemas.microsoft.com/WebPart/v3'>\");\n wp.Append(\"\t\t<metaData>\");\n wp.Append(\"\t\t\t<type name='Microsoft.SharePoint.WebPartPages.ScriptEditorWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' />\");\n wp.Append(\"\t\t\t<importErrorMessage>Cannot import this Web Part.</importErrorMessage>\");\n wp.Append(\"\t\t</metaData>\");\n wp.Append(\"\t\t<data>\");\n wp.Append(\"\t\t\t<properties>\");\n wp.Append(\"\t\t\t\t<property name='Title' type='string'>$Resources:core,ScriptEditorWebPartTitle;</property>\");\n wp.Append(\"\t\t\t\t<property name='Description' type='string'>$Resources:core,ScriptEditorWebPartDescription;</property>\");\n wp.Append(\"\t\t\t\t<property name='ChromeType' type='chrometype'>None</property>\");\n wp.Append(\"\t\t\t\t<property name='Content' type='string'>\");\n wp.Append(\"\t\t\t\t<![CDATA[\");\n wp.Append(\"\t\t\t\t <div id='embedded-feed' style='height: 500px;'></div>\");\n wp.Append(\"\t\t\t\t <script type='text/javascript' src='https://assets.yammer.com/assets/platform_embed.js'></script>\");\n wp.Append(\"\t\t\t\t <script>\");\n wp.Append(\"\t\t\t\t yam.connect.embedFeed({\");\n wp.Append(\"\t\t\t\t container: '#embedded-feed'\");\n wp.Append(\"\t\t\t\t , feedType: 'open-graph'\");\n wp.Append(\"\t\t\t\t , feedId: ''\");\n wp.Append(\"\t\t\t\t , config: {\");\n wp.Append(\"\t\t\t\t use_sso: \" + useSso.ToString().ToLower());\n wp.Append(\"\t\t\t\t , header: \" + showHeader.ToString().ToLower());\n wp.Append(\"\t\t\t\t , footer: \" + showFooter.ToString().ToLower());\n wp.Append(\"\t\t\t\t , showOpenGraphPreview: false\");\n wp.Append(\"\t\t\t\t , defaultToCanonical: false\");\n wp.Append(\"\t\t\t\t , hideNetworkName: false\");\n wp.Append(\"\t\t\t\t , promptText: 'Start a conversation'\");\n if (!string.IsNullOrEmpty(groupId))\n {\n wp.Append(\"\t\t\t\t , defaultGroupId: '\" + groupId + \"'\"); \n }\n wp.Append(\"\t\t\t\t }\");\n wp.Append(\"\t\t\t\t , objectProperties: {\"); \n wp.Append(\"\t\t\t\t url: '\" + url + \"'\");\n wp.Append(\"\t\t\t\t , type: 'page'\");\n wp.Append(\"\t\t\t\t , title: '\" + postTitle + \"'\");\n wp.Append(\"\t\t\t\t , image: '\" + postImageUrl + \"'\");\n wp.Append(\"\t\t\t\t }\");\n wp.Append(\"\t\t\t\t });\");\n wp.Append(\"\t\t\t\t </script>\");\n wp.Append(\"\t\t\t\t]]>\");\n wp.Append(\"\t\t\t\t</property>\");\n wp.Append(\"\t\t\t</properties>\");\n wp.Append(\"\t\t</data>\");\n wp.Append(\"\t</webPart>\");\n wp.Append(\"</webParts>\");\n\n return wp.ToString();\n }\n\nWatch the [Integrate Yammer feeds to SharePoint sites (O365 PnP Video)](https://channel9.msdn.com/blogs/OfficeDevPnP/Integrate-Yammer-feeds-to-SharePoint-sites) to see a walk through of the - [Provisioning.Yammer (O365 PnP Sample)](https://github.com/OfficeDev/PnP/tree/master/Scenarios/Provisioning.Yammer).\n\nFor more information about Yammer embed see the [Yammer Embed Feed (Yammer Developer Center)](https://developer.yammer.com/v1.0/docs/embed) article.\n\nFor more information about Yammer OpenGraph see the [Open Graph Introduction & Format (Yammer Developer Center)](https://developer.yammer.com/v1.0/docs/open-graph) article.\n\nYammer OpenGraph API & Yammer REST API with Yammer SDKs\n-------------------------------------------------------\n\nIn this option you use the Yammer OpenGraph API and/or Yammer REST API with Yammer SDKs to integrate Yammer with SharePoint. These APIs may also be used to integrate Yammer with processes outside of web pages. Examples of such scenarios include services and long running operations. \n\t\n- This option takes longer to implement.\n- This option allows you to control all aspects of the feed and how it appears and how you interact with it.\n\n**When is it a good fit?**\n\n- When you are trying to integrate Yammer feeds with SharePoint sites and the out-of-the-box capabilities of the embed feeds do not meet your needs.\n- When you are trying to integrate Yammer feeds into services or long running operations.\n\n**Getting Started**\n\nFor more information about Yammer OpenGraph see the [Open Graph Introduction & Format (Yammer Developer Center)](https://developer.yammer.com/v1.0/docs/open-graph) article.\n\nYammer SDKs provide you the ability to authenticate to Yammer. For more information about the Yammer SDKs see the following articles:\n\n- [JavaScript SDK](https://developer.yammer.com/v1.0/docs/js-sdk)\n- [Ruby SDK](https://developer.yammer.com/v1.0/docs/ruby-sdk)\n- [Python SDK](https://developer.yammer.com/v1.0/docs/python-sdk)\n- [iOS SDK](https://developer.yammer.com/v1.0/docs/ios-sdk)\n- [.NET SDK](https://developer.yammer.com/v1.0/docs/net-sdk)\n- [Windows Phone 8 SDK](https://developer.yammer.com/v1.0/docs/windows-phone-8-sdk)\n\nAfter you have authenticated to Yammer via the Yammer SDKs you can call the Yammer REST APIs. \n\nFor more information about Yammer REST APIs see the [REST API & Rate Limits (Yammer Developer Center)](https://developer.yammer.com/v1.0/docs/rest-api-rate-limits) article.\n\n**Authentication Note**\n\nIn a scenario where you sign into SharePoint with credentials that differ from the credentials you use to sign into SharePoint with you may wish to develop a single-sign-on capability for your users. An example of such a scenario is when you sign into SharePoint with a LiveID and you need to sign into Yammer with a Microsoft personal or work account.\n\nTo implement a single-sign-on scenario you can direct your users to sign into Yammer the first time they come to a SharePoint page with your custom Yammer component on it. After the user signs into Yammer via the Yammer SDK you can store the refresh token for the user in their user profile. Then, on subsequent visits to the page you can retrieve the refresh token from the user profile and use it to authenticate. With this approach your end users only need to sign into Yammer when their refresh token expires.\n\nRelated links\n=============\n- [Integrate Yammer feeds to SharePoint sites (O365 PnP Video)](https://channel9.msdn.com/blogs/OfficeDevPnP/Integrate-Yammer-feeds-to-SharePoint-sites)\n- [Yammer Embed Feed (Yammer Developer Center)](https://developer.yammer.com/v1.0/docs/embed)\n- [Open Graph Introduction & Format (Yammer Developer Center)](https://developer.yammer.com/v1.0/docs/open-graph)\n- Guidance articles at [http://aka.ms/OfficeDevPnPGuidance](http://aka.ms/OfficeDevPnPGuidance \"Guidance Articles\")\n- References in MSDN at [http://aka.ms/OfficeDevPnPMSDN](http://aka.ms/OfficeDevPnPMSDN \"References in MSDN\")\n- Videos at [http://aka.ms/OfficeDevPnPVideos](http://aka.ms/OfficeDevPnPVideos \"Videos\")\n\nRelated PnP samples\n===================\n- [Provisioning.Yammer (O365 PnP Sample)](https://github.com/OfficeDev/PnP/tree/master/Scenarios/Provisioning.Yammer)\n- [OfficeDevPnP.Core](https://github.com/OfficeDev/PnP/blob/master/OfficeDevPnP.Core/OfficeDevPnP.Core)\n- Samples and content at [http://aka.ms/OfficeDevPnP](http://aka.ms/OfficeDevPnP)\n\nApplies to\n==========\n- Office 365 Multi Tenant (MT)\n- Office 365 Dedicated (D)\n- SharePoint 2013 on-premises\n\nAuthor\n------\nTodd Baginski (Canviz LLC) - [@toddbaginski](https://twitter.com/toddbaginski)\n\nVersion history\n---------------\nVersion | Date | Comments | Author\n---------| -----| ---------| ------\n0.1 | July 6, 2015 | Initial draft | Todd Baginski (Canviz LLC)\n\n", "meta": {"content_hash": "c07bd269c801bd0184ef56c00e2c0eb5", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 569, "avg_line_length": 63.19409282700422, "alnum_prop": 0.6536689590705749, "repo_name": "weshackett/PnP-Guidance", "id": "ab788b050a2436f49033347666e6203dc906b845", "size": "14979", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "articles/SharePoint-Add-In-Recipe-yammer-integration.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Reflection;\n\nnamespace Ploeh.AutoFixture.Kernel\n{\n /// <summary>\n /// A specification that determines whether the request is a request\n /// for a <see cref=\"FieldInfo\"/> matching the specified name and <see cref=\"Type\"/>.\n /// </summary>\n public class FieldSpecification : IRequestSpecification\n {\n private readonly Type targetType;\n private readonly string targetName;\n private readonly IEquatable<FieldInfo> target;\n\n /// <summary>\n /// Initializes a new instance of the <see cref=\"FieldSpecification\"/> class.\n /// </summary>\n /// <param name=\"targetType\">\n /// The <see cref=\"Type\"/> with which the requested\n /// <see cref=\"FieldInfo\"/> type should be compatible.\n /// </param>\n /// <param name=\"targetName\">\n /// The name which the requested <see cref=\"FieldInfo\"/> name\n /// should match exactly.\n /// </param>\n /// <exception cref=\"ArgumentNullException\">\n /// <paramref name=\"targetType\"/> or\n /// <paramref name=\"targetName\"/> is <see langword=\"null\"/>.\n /// </exception>\n public FieldSpecification(Type targetType, string targetName)\n : this(CreateDefaultTarget(targetType, targetName))\n {\n this.targetType = targetType;\n this.targetName = targetName;\n }\n\n private static IEquatable<FieldInfo> CreateDefaultTarget(\n Type targetType,\n string targetName)\n {\n if (targetType == null)\n throw new ArgumentNullException(\"targetType\");\n if (targetName == null)\n throw new ArgumentNullException(\"targetName\");\n\n return new FieldTypeAndNameCriterion(\n new Criterion<Type>(\n targetType,\n new DerivesFromTypeComparer()),\n new Criterion<string>(\n targetName,\n EqualityComparer<string>.Default));\n }\n\n /// <summary>\n /// Initializes a new instance of the <see cref=\"FieldSpecification\"/> class.\n /// </summary>\n /// <param name=\"target\">\n /// The criteria used to match the requested\n /// <see cref=\"FieldInfo\"/>.\n /// </param>\n /// <exception cref=\"ArgumentNullException\">\n /// <paramref name=\"target\"/> is <see langword=\"null\"/>.\n /// </exception>\n public FieldSpecification(IEquatable<FieldInfo> target)\n {\n if (target == null)\n throw new ArgumentNullException(\"target\");\n\n this.target = target;\n }\n\n /// <summary>\n /// The <see cref=\"Type\"/> with which the requested\n /// <see cref=\"FieldInfo\"/> type should be compatible.\n /// </summary>\n [Obsolete(\"This value is only available if the constructor taking a target type and name is used. Otherwise, it'll be null. Use with caution. This propery will be removed in a future version of AutoFixture.\", false)]\n public Type TargetType\n {\n get { return this.targetType; }\n }\n\n /// <summary>\n /// The name which the requested <see cref=\"FieldInfo\"/> name\n /// should match exactly.\n /// </summary>\n [Obsolete(\"This value is only available if the constructor taking a target type and name is used. Otherwise, it'll be null. Use with caution. This propery will be removed in a future version of AutoFixture.\", false)]\n public string TargetName\n {\n get { return this.targetName; }\n }\n\n /// <summary>\n /// Evaluates a request for a specimen.\n /// </summary>\n /// <param name=\"request\">The specimen request.</param>\n /// <returns>\n /// <see langword=\"true\"/> if <paramref name=\"request\"/> is satisfied by the Specification;\n /// otherwise, <see langword=\"false\"/>.\n /// </returns>\n public bool IsSatisfiedBy(object request)\n {\n if (request == null)\n throw new ArgumentNullException(\"request\");\n\n var f = request as FieldInfo;\n if (f == null)\n return false;\n\n return this.target.Equals(f);\n }\n\n private class DerivesFromTypeComparer : IEqualityComparer<Type>\n {\n public bool Equals(Type x, Type y)\n {\n if (y == null && x == null)\n return true;\n if (y == null)\n return false;\n return y.IsAssignableFrom(x);\n }\n\n public int GetHashCode(Type obj)\n {\n return 0;\n }\n }\n }\n}\n", "meta": {"content_hash": "61f5e6b4d20ee0fbf466e8559b7b5856", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 224, "avg_line_length": 36.22727272727273, "alnum_prop": 0.5529067335842743, "repo_name": "yuva2achieve/AutoFixture", "id": "fe012e6d83d0d9d3f20f2ad57e6bbfd9152a0dd6", "size": "4784", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Src/AutoFixture/Kernel/FieldSpecification.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "3713467"}, {"name": "F#", "bytes": "43535"}, {"name": "PowerShell", "bytes": "675"}, {"name": "Puppet", "bytes": "170"}, {"name": "Shell", "bytes": "309"}, {"name": "Smalltalk", "bytes": "2018"}, {"name": "XSLT", "bytes": "17270"}]}} +{"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html lang=\"en-GB\" xml:lang=\"en-GB\" xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"/>\n <title>Statistics of Polarity in UD_Uyghur-UDT</title>\n <link rel=\"root\" href=\"\"/> <!-- for JS -->\n <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css\">\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/jquery-ui-redmond.css\"/>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/style.css\"/>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/style-vis.css\"/>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/hint.css\"/>\n <script type=\"text/javascript\" src=\"../../lib/ext/head.load.min.js\"></script>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js\"></script>\n <script>document.addEventListener(\"DOMContentLoaded\", function(event) {anchors.add();});</script>\n <!-- Set up this custom Google search at https://cse.google.com/cse/business/settings?cx=001145188882102106025:dl1mehhcgbo -->\n <!-- DZ 2021-01-22: I am temporarily hiding the search field to find out whether it slows down loading of the title page.\n <script>\n (function() {\n var cx = '001145188882102106025:dl1mehhcgbo';\n var gcse = document.createElement('script');\n gcse.type = 'text/javascript';\n gcse.async = true;\n gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;\n var s = document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(gcse, s);\n })();\n </script> -->\n<!-- <link rel=\"shortcut icon\" href=\"favicon.ico\"/> -->\n\n\n </head>\n <body>\n <div id=\"main\" class=\"center\">\n\n <div id=\"hp-header\">\n <table width=\"100%\"><tr><td width=\"50%\">\n <span class=\"header-text\"><a href=\"http://universaldependencies.org/#language-\">home</a></span>\n\n <span class=\"header-text\"><a href=\"https://github.com/universaldependencies/docs/edit/pages-source/treebanks/ug_udt/ug_udt-feat-Polarity.md\" target=\"#\">edit page</a></span>\n <span class=\"header-text\"><a href=\"https://github.com/universaldependencies/docs/issues\">issue tracker</a></span>\n </td><td>\n <gcse:search></gcse:search>\n </td></tr></table>\n </div>\n\n <hr/>\n\n \n <div class=\"v2complete\">\n This page pertains to UD version 2.\n </div>\n \n\n <div id=\"content\">\n <noscript>\n <div id=\"noscript\">\n It appears that you have Javascript disabled.\n Please consider enabling Javascript for this page to see the visualizations.\n </div>\n </noscript>\n\n <!-- The content may include scripts and styles, hence we must load the shared libraries before the content. -->\n <script type=\"text/javascript\">\n console.time('loading libraries');\n var root = '../../'; // filled in by jekyll\n head.js(\n // External libraries\n // DZ: Copied from embedding.html. I don't know which one is needed for what, so I'm currently keeping them all.\n root + 'lib/ext/jquery.min.js',\n root + 'lib/ext/jquery.svg.min.js',\n root + 'lib/ext/jquery.svgdom.min.js',\n root + 'lib/ext/jquery.timeago.js',\n root + 'lib/ext/jquery-ui.min.js',\n root + 'lib/ext/waypoints.min.js',\n root + 'lib/ext/jquery.address.min.js'\n );\n </script>\n <h2 id=\"treebank-statistics-ud_uyghur-udt-features-polarity\">Treebank Statistics: UD_Uyghur-UDT: Features: <code class=\"language-plaintext highlighter-rouge\">Polarity</code></h2>\n\n<p>This feature is universal.\nIt occurs with 1 different values: <code class=\"language-plaintext highlighter-rouge\">Neg</code>.</p>\n\n<p>193 tokens (0%) have a non-empty value of <code class=\"language-plaintext highlighter-rouge\">Polarity</code>.\n89 types (1%) occur at least once with a non-empty value of <code class=\"language-plaintext highlighter-rouge\">Polarity</code>.\n49 lemmas (2%) occur at least once with a non-empty value of <code class=\"language-plaintext highlighter-rouge\">Polarity</code>.\nThe feature is used with 2 part-of-speech tags: <tt><a href=\"ug_udt-pos-VERB.html\">VERB</a></tt> (135; 0% instances), <tt><a href=\"ug_udt-pos-AUX.html\">AUX</a></tt> (58; 0% instances).</p>\n\n<h3 id=\"verb\"><code class=\"language-plaintext highlighter-rouge\">VERB</code></h3>\n\n<p>135 <tt><a href=\"ug_udt-pos-VERB.html\">VERB</a></tt> tokens (2% of all <code class=\"language-plaintext highlighter-rouge\">VERB</code> tokens) have a non-empty value of <code class=\"language-plaintext highlighter-rouge\">Polarity</code>.</p>\n\n<p>The most frequent other feature values with which <code class=\"language-plaintext highlighter-rouge\">VERB</code> and <code class=\"language-plaintext highlighter-rouge\">Polarity</code> co-occurred: <tt><a href=\"ug_udt-feat-Case.html\">Case</a></tt><tt>=EMPTY</tt> (135; 100%), <tt><a href=\"ug_udt-feat-VerbForm.html\">VerbForm</a></tt><tt>=Fin</tt> (114; 84%), <tt><a href=\"ug_udt-feat-Mood.html\">Mood</a></tt><tt>=Ind</tt> (109; 81%), <tt><a href=\"ug_udt-feat-Person.html\">Person</a></tt><tt>=3</tt> (108; 80%), <tt><a href=\"ug_udt-feat-Aspect.html\">Aspect</a></tt><tt>=EMPTY</tt> (102; 76%), <tt><a href=\"ug_udt-feat-Number.html\">Number</a></tt><tt>=Sing</tt> (85; 63%), <tt><a href=\"ug_udt-feat-Tense.html\">Tense</a></tt><tt>=Past</tt> (76; 56%).</p>\n\n<p><code class=\"language-plaintext highlighter-rouge\">VERB</code> tokens may have the following values of <code class=\"language-plaintext highlighter-rouge\">Polarity</code>:</p>\n\n<ul>\n <li><code class=\"language-plaintext highlighter-rouge\">Neg</code> (135; 100% of non-empty <code class=\"language-plaintext highlighter-rouge\">Polarity</code>): \u0628\u0648\u0644\u0645\u0649\u063a\u0627\u0646\u060c \u0628\u0648\u0644\u0645\u0627\u064a\u062f\u06c7\u060c \u0628\u0627\u0642\u0645\u0649\u063a\u0627\u0646\u060c \u0628\u0648\u0644\u0645\u0649\u0633\u0627\u060c \u0642\u0649\u0644\u0645\u0649\u062f\u0649\u060c \u0626\u0648\u062e\u0634\u0649\u0645\u0649\u063a\u0627\u0646\u060c \u0626\u0648\u064a\u0644\u0649\u0645\u0649\u063a\u0627\u0646\u060c \u062f\u06d0\u0645\u0649\u0633\u0649\u0645\u06c7\u060c \u0642\u0627\u0631\u0649\u0645\u0627\u064a\u062f\u06c7\u060c \u0643\u06d5\u0644\u0645\u06d5\u064a\u062f\u06c7</li>\n <li><code class=\"language-plaintext highlighter-rouge\">EMPTY</code> (8193): \u062f\u06d5\u067e\u060c \u062f\u06d0\u062f\u0649\u060c \u0628\u0648\u0644\u06c7\u067e\u060c \u0642\u0649\u0644\u0649\u067e\u060c \u062f\u06d5\u067e\u062a\u06c7\u060c \u0642\u0627\u0631\u0627\u067e\u060c \u0628\u0627\u0631\u060c \u0626\u06d0\u0644\u0649\u067e\u060c \u062f\u06d0\u06af\u06d5\u0646\u060c \u0643\u06d0\u0644\u0649\u067e</li>\n</ul>\n\n<p><code class=\"language-plaintext highlighter-rouge\">Polarity</code> seems to be <strong>lexical feature</strong> of <code class=\"language-plaintext highlighter-rouge\">VERB</code>. 100% lemmas (48) occur only with one value of <code class=\"language-plaintext highlighter-rouge\">Polarity</code>.</p>\n\n<h3 id=\"aux\"><code class=\"language-plaintext highlighter-rouge\">AUX</code></h3>\n\n<p>58 <tt><a href=\"ug_udt-pos-AUX.html\">AUX</a></tt> tokens (6% of all <code class=\"language-plaintext highlighter-rouge\">AUX</code> tokens) have a non-empty value of <code class=\"language-plaintext highlighter-rouge\">Polarity</code>.</p>\n\n<p>The most frequent other feature values with which <code class=\"language-plaintext highlighter-rouge\">AUX</code> and <code class=\"language-plaintext highlighter-rouge\">Polarity</code> co-occurred: <tt><a href=\"ug_udt-feat-Person.html\">Person</a></tt><tt>=3</tt> (56; 97%), <tt><a href=\"ug_udt-feat-Number.html\">Number</a></tt><tt>=Sing</tt> (55; 95%), <tt><a href=\"ug_udt-feat-Aspect.html\">Aspect</a></tt><tt>=EMPTY</tt> (44; 76%), <tt><a href=\"ug_udt-feat-Tense.html\">Tense</a></tt><tt>=EMPTY</tt> (39; 67%), <tt><a href=\"ug_udt-feat-Mood.html\">Mood</a></tt><tt>=EMPTY</tt> (36; 62%), <tt><a href=\"ug_udt-feat-VerbForm.html\">VerbForm</a></tt><tt>=EMPTY</tt> (36; 62%).</p>\n\n<p><code class=\"language-plaintext highlighter-rouge\">AUX</code> tokens may have the following values of <code class=\"language-plaintext highlighter-rouge\">Polarity</code>:</p>\n\n<ul>\n <li><code class=\"language-plaintext highlighter-rouge\">Neg</code> (58; 100% of non-empty <code class=\"language-plaintext highlighter-rouge\">Polarity</code>): \u0626\u06d5\u0645\u06d5\u0633\u060c \u0628\u0648\u0644\u0645\u0627\u064a\u062f\u06c7\u060c \u0626\u06d5\u0645\u06d5\u0633\u0645\u06c7\u060c \u0628\u0648\u0644\u0645\u0649\u063a\u0627\u0646\u060c \u0642\u0627\u0644\u0645\u0627\u064a\u062f\u06c7\u060c \u0628\u0648\u0644\u0645\u0627\u0645\u062f\u06c7\u060c \u0628\u0648\u0644\u0645\u0649\u0633\u0627\u060c \u0628\u0648\u0644\u0645\u0649\u0633\u0649\u0645\u06c7\u060c \u062a\u06c7\u0631\u0645\u0627\u0645\u062f\u06c7\u060c \u0642\u0627\u0644\u0645\u0649\u062f\u06c7\u0642</li>\n <li><code class=\"language-plaintext highlighter-rouge\">EMPTY</code> (852): \u0626\u0649\u062f\u0649\u060c \u0628\u0648\u0644\u06c7\u067e\u060c \u0626\u0649\u0643\u06d5\u0646\u060c \u0643\u06d5\u062a\u062a\u0649\u060c \u0642\u0627\u0644\u062f\u0649\u060c \u0628\u0648\u0644\u0633\u0627\u060c \u0628\u0648\u0644\u062f\u0649\u060c \u0628\u0648\u0644\u0649\u062f\u06c7\u060c \u0642\u0627\u0644\u062f\u0649\u0645\u060c \u062a\u06c7\u0631\u06c7\u067e</li>\n</ul>\n\n\n </div>\n\n<!-- support for embedded visualizations -->\n<script type=\"text/javascript\">\n var root = '../../'; // filled in by jekyll\n head.js(\n // We assume that external libraries such as jquery.min.js have already been loaded outside!\n // (See _layouts/base.html.)\n\n // brat helper modules\n root + 'lib/brat/configuration.js',\n root + 'lib/brat/util.js',\n root + 'lib/brat/annotation_log.js',\n root + 'lib/ext/webfont.js',\n // brat modules\n root + 'lib/brat/dispatcher.js',\n root + 'lib/brat/url_monitor.js',\n root + 'lib/brat/visualizer.js',\n\n // embedding configuration\n root + 'lib/local/config.js',\n // project-specific collection data\n root + 'lib/local/collections.js',\n\n // Annodoc\n root + 'lib/annodoc/annodoc.js',\n\n // NOTE: non-local libraries\n 'https://spyysalo.github.io/conllu.js/conllu.js'\n );\n\n var webFontURLs = [\n// root + 'static/fonts/Astloch-Bold.ttf',\n root + 'static/fonts/PT_Sans-Caption-Web-Regular.ttf',\n root + 'static/fonts/Liberation_Sans-Regular.ttf'\n ];\n\n var setupTimeago = function() {\n jQuery(\"time.timeago\").timeago();\n };\n\n head.ready(function() {\n setupTimeago();\n\n // mark current collection (filled in by Jekyll)\n Collections.listing['_current'] = '';\n\n\t// perform all embedding and support functions\n\tAnnodoc.activate(Config.bratCollData, Collections.listing);\n });\n</script>\n\n\n<!-- google analytics -->\n<script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n ga('create', 'UA-55233688-1', 'auto');\n ga('send', 'pageview');\n\n</script>\n\n\n <div id=\"footer\">\n <p class=\"footer-text\">© 2014\u20132021\n <a href=\"http://universaldependencies.org/introduction.html#contributors\" style=\"color:gray\">Universal Dependencies contributors</a>.\n Site powered by <a href=\"http://spyysalo.github.io/annodoc\" style=\"color:gray\">Annodoc</a> and <a href=\"http://brat.nlplab.org/\" style=\"color:gray\">brat</a></p>.\n </div>\n </div>\n </body>\n</html>\n", "meta": {"content_hash": "ab2b5d4326226616abf4c1a7abfa5377", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 753, "avg_line_length": 55.18324607329843, "alnum_prop": 0.6471537001897533, "repo_name": "UniversalDependencies/universaldependencies.github.io", "id": "7eaa83f3b8c1e691deb33d56696de7140371fd23", "size": "10833", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "treebanks/ug_udt/ug_udt-feat-Polarity.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "64420"}, {"name": "HTML", "bytes": "383191916"}, {"name": "JavaScript", "bytes": "687350"}, {"name": "Perl", "bytes": "7788"}, {"name": "Python", "bytes": "21203"}, {"name": "Shell", "bytes": "7253"}]}} +{"text": "'use strict';\n// mailgun messaging module\n// requires account from www.mailgun.com\n// Free email service for up to 400 messages a day\n\n// require config for environment variables\nvar config = require(\"../../config\");\n\n// set config variables\nvar api_key = config.mailgunPrivateApiKey;\nvar domain = config.mailgunDomain;\nvar fromEmail = config.mailgunFromEmail;\n\n// initialize mailgun service\nvar mailgun = require('mailgun-js')({\n\tapiKey: api_key,\n\tdomain: domain\n});\n\n// create messaging module export object\nvar mailer = {};\n\n// sendOne\n// sends one email, requires paramater object :\n// params = {\n// to: \"Blah blah <blah@blah.net>\",\n// subject: \"Blah dee blah\",\n// text: \"Blah deedee blah\",\n// html: \"<h1>Blah deedee blah</h1>\"\n// };\nmailer.sendOne = function(params, callback) {\n\n\tvar data = {\n\t\tfrom: fromEmail,\n\t\tto: params.to,\n\t\tsubject: params.subject,\n\t\ttext: params.text,\n\t\thtml: params.html\n\t};\n\n\t// send message; if there is a callback let it handle the err, else handle err\n\tmailgun.messages().send(data, function(err) {\n\t\tif (callback) {\n\t\t\tcallback(err);\n\t\t} else if (err) {\n\t\t\tconsole.log(err);\n\t\t} else {\n\t\t\tconsole.log('email sent!');\n\t\t}\n\t});\n};\n\n// export\nmodule.exports = mailer;\n", "meta": {"content_hash": "9509f2a773189dac292fd801580db52d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 79, "avg_line_length": 22.40740740740741, "alnum_prop": 0.6735537190082644, "repo_name": "wtabikeshare/open-bike-project", "id": "b3bc4a1abc22c7e9152592f0096aa1aec386b12d", "size": "1210", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/mailgun/index.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "259"}, {"name": "HTML", "bytes": "25553"}, {"name": "JavaScript", "bytes": "42672"}]}} +{"text": "The tool is designed to query the [PassiveTotal - Get Passive DNS](http://api.passivetotal.org/api/docs/#api-Passive_DNS-GetV2DnsPassive) and [VirusTotal - IP Address Report](https://developers.virustotal.com/v2.0/reference#ip-address-report) APIs to return all domains associated with an IP. Then each site is retrieved live to attempt to detect web technologies in use on each record. The web technology detection is based on a python port of [Wappalyzer](https://wappalyzer.com/) that has been modified to work with Python 3.6.2.\n\n**Warning:** This will reach out to all domains associated with an IP, including possibily malicious domains. Use with caution.\nTo reduce the number of malicious domains, the `MALWARE` config can be set to False to remove VirusTotal's \"detected urls.\"\n\n*Note:* PassiveTotal's Community API only supports 15 lookups a day. VirusTotal's Public API caps at 4 queries a minute.\n\n## Inputs\n* IP or List of IPs\n* Job ID for tracking\n\n## Outputs\nWeb Technologies in use on domains seen in passive DNS records for each IP\n\nUp-to-date apps.json:\n https://raw.githubusercontent.com/AliasIO/Wappalyzer/master/src/apps.json\n \n## Install\n1. Install Python 3.6.2 \n2. pip3 install six\n3. pip3 install requests\n4. pip3 install flask\n5. Update configs.cfg with API keys\n6. python3 getwt.py\n7. Web browse to the IP and Port configured in configs\n\n### Modules in Use\n* Python\n * Version: 3.6.2\n * Use: Code Base\n* flask\n * Version: 0.12.2\n * Use: User Interface\n* sqlite3\n * Version: 2.6.0\n * Use: Backend Database\n* [wad](https://pypi.python.org/pypi/wad)\n * Version: Custom modified\n * Use: Web technology scanner\n * Notes: Modified to work with Python 3.6.2\n* six\n * Version: 1.10.0\n* requests\n * Version 2.18.4\n * Use: Retrieve online apps.json\n \n#### TODO:\n* Convert legacy WAD code to beautifulSoup/requests\n* Support other databases\n* Handle sites with tarpit-style responses\n* Add [PassiveTotal - Host_Attributes - Get Components](http://api.passivetotal.org/api/docs/#api-Host_Attributes-GetV2HostAttributesComponents) Integration\n* Add support for \"Last Seen Date\"\n\n", "meta": {"content_hash": "ceaac205a83cf8eef0c732bcd0914adf", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 532, "avg_line_length": 39.79245283018868, "alnum_prop": 0.7496443812233285, "repo_name": "import-au/GetWT", "id": "2c77b34aa6f1d09ff131b462de9967a90cbfa24d", "size": "2133", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "5579"}, {"name": "Python", "bytes": "38791"}]}} +{"text": "\npackage com.opengamma.analytics.financial.interestrate.bond.provider;\n\nimport static com.opengamma.financial.convention.yield.SimpleYieldConvention.INDEX_LINKED_FLOAT;\nimport static com.opengamma.financial.convention.yield.SimpleYieldConvention.UK_IL_BOND;\nimport static com.opengamma.financial.convention.yield.SimpleYieldConvention.US_IL_REAL;\n\nimport org.apache.commons.lang.Validate;\n\nimport com.opengamma.analytics.financial.instrument.inflation.CouponInflationGearing;\nimport com.opengamma.analytics.financial.interestrate.bond.definition.BondCapitalIndexedSecurity;\nimport com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflationZeroCouponInterpolationGearing;\nimport com.opengamma.analytics.financial.interestrate.inflation.derivative.CouponInflationZeroCouponMonthlyGearing;\nimport com.opengamma.analytics.financial.interestrate.payments.derivative.Coupon;\nimport com.opengamma.analytics.financial.provider.calculator.inflation.NetAmountInflationCalculator;\nimport com.opengamma.analytics.financial.provider.calculator.inflation.PresentValueCurveSensitivityDiscountingInflationCalculator;\nimport com.opengamma.analytics.financial.provider.calculator.inflation.PresentValueDiscountingInflationCalculator;\nimport com.opengamma.analytics.financial.provider.description.inflation.InflationIssuerProviderInterface;\nimport com.opengamma.analytics.financial.provider.description.inflation.InflationIssuerProviderIssuerDecoratedSpread;\nimport com.opengamma.analytics.financial.provider.description.inflation.InflationProviderDecoratedIssuer;\nimport com.opengamma.analytics.financial.provider.description.inflation.InflationProviderInterface;\nimport com.opengamma.analytics.financial.provider.sensitivity.inflation.MultipleCurrencyInflationSensitivity;\nimport com.opengamma.analytics.math.function.Function1D;\nimport com.opengamma.analytics.math.rootfinding.BracketRoot;\nimport com.opengamma.analytics.math.rootfinding.BrentSingleRootFinder;\nimport com.opengamma.analytics.math.rootfinding.RealSingleRootFinder;\nimport com.opengamma.financial.convention.yield.YieldConvention;\nimport com.opengamma.util.ArgumentChecker;\nimport com.opengamma.util.money.Currency;\nimport com.opengamma.util.money.MultipleCurrencyAmount;\n\n/**\n * Pricing method for inflation bond. The price is computed by index estimation and discounting.\n */\npublic final class BondCapitalIndexedSecurityDiscountingMethod {\n\n /**\n * The unique instance of the class.\n */\n private static final BondCapitalIndexedSecurityDiscountingMethod INSTANCE = new BondCapitalIndexedSecurityDiscountingMethod();\n\n /**\n * Return the class instance.\n * \n * @return The instance.\n */\n public static BondCapitalIndexedSecurityDiscountingMethod getInstance() {\n return INSTANCE;\n }\n\n /**\n * The present value inflation calculator (for the different parts of the bond transaction).\n */\n private static final PresentValueDiscountingInflationCalculator PVIC = PresentValueDiscountingInflationCalculator.getInstance();\n private static final NetAmountInflationCalculator NAIC = NetAmountInflationCalculator.getInstance();\n private static final PresentValueCurveSensitivityDiscountingInflationCalculator PVCSIC = PresentValueCurveSensitivityDiscountingInflationCalculator\n .getInstance();\n // TODO: REVIEW: Method depends on Calculator; Calculator would depend on Method (code duplicated to avoid circularity).\n /**\n * The root bracket used for yield finding.\n */\n private static final BracketRoot BRACKETER = new BracketRoot();\n /**\n * The root finder used for yield finding.\n */\n private static final RealSingleRootFinder ROOT_FINDER = new BrentSingleRootFinder();\n\n /**\n * Computes the present value of a capital indexed bound by index estimation and discounting. The value is the value of the nominal and the coupons but not\n * the settlement.\n * \n * @param bond\n * The bond.\n * @param provider\n * The provider.\n * @return The present value.\n */\n public MultipleCurrencyAmount presentValue(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface provider) {\n ArgumentChecker.notNull(bond, \"Bond\");\n final InflationProviderInterface creditDiscounting = new InflationProviderDecoratedIssuer(provider, bond.getCurrency(), bond.getIssuerEntity());\n final MultipleCurrencyAmount pvNominal = bond.getNominal().accept(PVIC, creditDiscounting);\n final MultipleCurrencyAmount pvCoupon = bond.getCoupon().accept(PVIC, creditDiscounting);\n return pvNominal.plus(pvCoupon);\n }\n\n /**\n * Computes the security present value from a quoted clean real price. The real accrued are added to the clean real price, the result is multiplied by the\n * inflation index ratio and then discounted from settlement time to 0 with the discounting curve.\n * \n * @param bond\n * The bond security.\n * @param market\n * The market.\n * @param cleanPriceReal\n * The real clean price.\n * @return The present value.\n */\n public MultipleCurrencyAmount presentValueFromCleanRealPrice(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface market,\n final double cleanPriceReal) {\n Validate.notNull(bond, \"Coupon\");\n Validate.notNull(market, \"Market\");\n final double settlement = bond.getSettlement().accept(PVIC, market.getInflationProvider()).getAmount(bond.getCurrency());\n final double cleanPriceNominal = cleanPriceReal * settlement;\n return presentValueFromCleanNominalPrice(bond, market, cleanPriceNominal);\n }\n\n /**\n * Computes the security present value from a quoted clean real price. The real accrued are added to the clean real price, the result is multiplied by the\n * inflation index ratio and then discounted from settlement time to 0 with the discounting curve.\n * \n * @param bond\n * The bond security.\n * @param market\n * The market.\n * @param cleanPriceNominal\n * The nominal clean price.\n * @return The present value.\n */\n public MultipleCurrencyAmount presentValueFromCleanNominalPrice(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface market,\n final double cleanPriceNominal) {\n Validate.notNull(bond, \"Coupon\");\n Validate.notNull(market, \"Market\");\n final double notional = bond.getCoupon().getNthPayment(0).getNotional();\n final MultipleCurrencyAmount nominalAccruedInterest = bond.getSettlement().accept(PVIC, market.getInflationProvider())\n .multipliedBy(bond.getAccruedInterest() / notional);\n final double dirtyPriceNominal = cleanPriceNominal + nominalAccruedInterest.getAmount(bond.getCurrency());\n return MultipleCurrencyAmount.of(bond.getCurrency(), dirtyPriceNominal);\n }\n\n /**\n * Calculates the accrued interest for a fixed-coupon bond using the clean price. The accrued interest is defined as dirty price - clean price.\n * \n * @param bond\n * The bond, not null\n * @param cleanPrice\n * The clean price\n * @return The accrued interest\n */\n public double accruedInterestFromCleanRealPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice) {\n ArgumentChecker.notNull(bond, \"bond\");\n return dirtyRealPriceFromCleanRealPrice(bond, cleanPrice) - cleanPrice;\n }\n\n /**\n * Calculates the accrued interest for a fixed-coupon bond using the clean price. The accrued interest is defined as dirty price - clean price.\n * \n * @param bond\n * The bond, not null\n * @param yield\n * The yield\n * @return The accrued interest\n */\n public double accruedInterestFromCleanYield(final BondCapitalIndexedSecurity<?> bond, final double yield) {\n ArgumentChecker.notNull(bond, \"bond\");\n return dirtyPriceFromRealYield(bond, yield) - cleanPriceFromYield(bond, yield);\n }\n\n /**\n * Computes the clean real price of a bond security from a dirty real price.\n * \n * @param bond\n * The bond security.\n * @param dirtyPrice\n * The dirty price.\n * @return The clean price.\n */\n public double cleanRealPriceFromDirtyRealPrice(final BondCapitalIndexedSecurity<?> bond, final double dirtyPrice) {\n final double notional = bond.getCoupon().getNthPayment(0).getNotional();\n return dirtyPrice - bond.getAccruedInterest() / notional;\n }\n\n /**\n * Computes the clean nominal price of a bond security from a dirty real price.\n * \n * @param bond\n * The bond security.\n * @param dirtyPrice\n * The dirty price.\n * @return The clean price.\n */\n public double cleanNominalPriceFromDirtyNominalPrice(final BondCapitalIndexedSecurity<?> bond, final double dirtyPrice) {\n final double notional = bond.getCoupon().getNthPayment(0).getNotional();\n final double indexRatio = bond.getIndexRatio();\n return dirtyPrice - bond.getAccruedInterest() / notional * indexRatio;\n }\n\n /**\n * Computes the clean price of a bond security from curves.\n * \n * @param bond\n * The bond security.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @return The clean price.\n */\n public double cleanRealPriceFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves) {\n final double indexRatio = bond.getIndexRatio();\n final double notional = bond.getCoupon().getNthPayment(0).getNotional();\n final double df = issuerMulticurves.getMulticurveProvider().getDiscountFactor(bond.getCurrency(), bond.getSettlementTime());\n final double pvReal = presentValue(bond, issuerMulticurves).getAmount(bond.getCurrency()) / indexRatio / df / notional;\n return pvReal - bond.getAccruedInterest() / notional;\n }\n\n /**\n * Computes the clean price of a bond security from curves.\n * \n * @param bond\n * The bond security.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @return The clean price.\n */\n public double cleanNominalPriceFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves) {\n final double dirtyNominalPrice = dirtyNominalPriceFromCurves(bond, issuerMulticurves);\n return cleanNominalPriceFromDirtyNominalPrice(bond, dirtyNominalPrice);\n }\n\n /**\n * Computes the clean real price of a bond security from a dirty real price.\n * \n * @param bond\n * The bond security.\n * @param cleanNominalPrice\n * The clean nominal price.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @return The clean price.\n */\n public double cleanRealPriceFromCleanNominalPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanNominalPrice,\n final InflationIssuerProviderInterface issuerMulticurves) {\n final double indexRatio = bond.getIndexRatio();\n return cleanNominalPrice / indexRatio;\n }\n\n /**\n * Compute the dirty price of a bond security from curves.\n * \n * @param bond\n * The bond security.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @return The dirty price.\n */\n public double dirtyNominalPriceFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves) {\n ArgumentChecker.notNull(bond, \"Bond\");\n ArgumentChecker.notNull(issuerMulticurves, \"Issuer and multi-curves provider\");\n final MultipleCurrencyAmount pv = presentValue(bond, issuerMulticurves);\n final double df = issuerMulticurves.getMulticurveProvider().getDiscountFactor(bond.getCurrency(), bond.getSettlementTime());\n final double notional = bond.getCoupon().getNthPayment(0).getNotional();\n return pv.getAmount(bond.getCurrency()) / df / notional;\n }\n\n /**\n * Compute the dirty price of a bond security from curves.\n * \n * @param bond\n * The bond security.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @return The dirty price.\n */\n public double dirtyRealPriceFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves) {\n ArgumentChecker.notNull(bond, \"Bond\");\n ArgumentChecker.notNull(issuerMulticurves, \"Issuer and multi-curves provider\");\n final MultipleCurrencyAmount pv = presentValue(bond, issuerMulticurves);\n final double settlement = bond.getIndexRatio();\n final double notional = bond.getCoupon().getNthPayment(0).getNotional();\n return pv.getAmount(bond.getCurrency()) / settlement / notional;\n }\n\n /**\n * Computes the dirty real price of a bond security from the clean real price.\n * \n * @param bond\n * The bond security.\n * @param cleanPrice\n * The clean price.\n * @return The clean price.\n */\n public double dirtyRealPriceFromCleanRealPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice) {\n final double notional = bond.getCoupon().getNthPayment(0).getNotional();\n return cleanPrice + bond.getAccruedInterest() / notional;\n }\n\n /**\n * The net amount paid at settlement date for a given clean real price.\n * \n * @param bond\n * The bond.\n * @param market\n * The market.\n * @param cleanPriceReal\n * The clean real price.\n * @return The net amount.\n */\n public MultipleCurrencyAmount netAmount(final BondCapitalIndexedSecurity<Coupon> bond, final InflationIssuerProviderInterface market,\n final double cleanPriceReal) {\n final double notional = bond.getCoupon().getNthPayment(0).getNotional();\n final double netAmountRealByUnit = cleanPriceReal + bond.getAccruedInterest() / notional;\n final MultipleCurrencyAmount netAmount = bond.getSettlement().accept(NAIC, market.getInflationProvider());\n return netAmount.multipliedBy(netAmountRealByUnit);\n\n }\n\n /**\n * Computes the dirty (real or nominal depending of the convention) price from the conventional real yield.\n * \n * @param bond\n * The bond security.\n * @param yield\n * The bond yield.\n * @return The dirty price.\n */\n public double dirtyPriceFromRealYield(final BondCapitalIndexedSecurity<?> bond, final double yield) {\n Validate.isTrue(bond.getNominal().getNumberOfPayments() == 1, \"Yield: more than one nominal repayment.\");\n final int nbCoupon = bond.getCoupon().getNumberOfPayments();\n final YieldConvention yieldConvention = bond.getYieldConvention();\n if (yieldConvention.equals(US_IL_REAL)) {\n // Coupon period rate to next coupon and simple rate from next coupon to settlement.\n double pvAtFirstCoupon;\n if (Math.abs(yield) > 1.0E-8) {\n final double factorOnPeriod = 1 + yield / bond.getCouponPerYear();\n final double vn = Math.pow(factorOnPeriod, 1 - nbCoupon);\n pvAtFirstCoupon = ((CouponInflationGearing) bond.getCoupon().getNthPayment(0)).getFactor() / yield * (factorOnPeriod - vn) + vn;\n } else {\n pvAtFirstCoupon = ((CouponInflationGearing) bond.getCoupon().getNthPayment(0)).getFactor() / bond.getCouponPerYear() * nbCoupon + 1;\n }\n return pvAtFirstCoupon / (1 + bond.getAccrualFactorToNextCoupon() * yield / bond.getCouponPerYear());\n }\n\n if (yieldConvention.equals(INDEX_LINKED_FLOAT)) {\n final double realRate = ((CouponInflationGearing) bond.getCoupon().getNthPayment(1)).getFactor();\n final double firstYearFraction = bond.getCoupon().getNthPayment(0).getPaymentYearFraction();\n double firstCouponEndFixingTime = 0.0;\n double firstCouponPayementTime = 0.0;\n if (bond.getCoupon().getNthPayment(1) instanceof CouponInflationZeroCouponInterpolationGearing) {\n firstCouponEndFixingTime = ((CouponInflationZeroCouponInterpolationGearing) bond.getCoupon().getNthPayment(1)).getReferenceEndTime()[1];\n firstCouponPayementTime = ((CouponInflationZeroCouponInterpolationGearing) bond.getCoupon().getNthPayment(1)).getPaymentTime();\n } else if (bond.getCoupon().getNthPayment(1) instanceof CouponInflationZeroCouponMonthlyGearing) {\n firstCouponEndFixingTime = ((CouponInflationZeroCouponMonthlyGearing) bond.getCoupon().getNthPayment(1)).getReferenceEndTime();\n firstCouponPayementTime = ((CouponInflationZeroCouponMonthlyGearing) bond.getCoupon().getNthPayment(1)).getPaymentTime();\n }\n final double lag = firstCouponPayementTime - firstCouponEndFixingTime;\n final double v = 1 / (1 + yield / bond.getCouponPerYear());\n final double rpibase = bond.getIndexStartValue();\n final double rpiLast = bond.getLastIndexKnownFixing();\n final double indexRatio = rpiLast / rpibase;\n final int nbMonth = (int) Math.max(Math.round((bond.getLastKnownFixingTime() - bond.getCoupon().getNthPayment(0).getPaymentTime() + lag) * 12), 0.0);\n final double u = Math.pow(1 / (1 + .03), .5);\n final double a = indexRatio * Math.pow(u, 2.0 * nbMonth / 12.0);\n final double firstCashFlow = firstYearFraction * realRate * indexRatio;\n if (bond.getCoupon().getNumberOfPayments() == 1) {\n return Math.pow(u * v, bond.getAccrualFactorToNextCoupon()) * (firstCashFlow + 1) * a / u;\n }\n final double secondYearFraction = bond.getCoupon().getNthPayment(1).getPaymentYearFraction();\n final double secondCashFlow = secondYearFraction * realRate * indexRatio;\n final double vn = Math.pow(v, nbCoupon - 1);\n final double pvAtFirstCoupon = firstCashFlow + secondCashFlow * u * v + a * realRate * v * v * (1 - vn / v) / (1 - v) + a * vn;\n return pvAtFirstCoupon * Math.pow(u * v, bond.getRatioPeriodToNextCoupon());\n }\n if (yieldConvention.equals(UK_IL_BOND)) {\n final double firstYearFraction = bond.getCoupon().getNthPayment(0).getPaymentYearFraction();\n final double realRate = ((CouponInflationGearing) bond.getCoupon().getNthPayment(1)).getFactor();\n // Real rate adjusted by the number of coupons, i.e. annual rate / 2 for UK bonds\n final double firstCashFlow = firstYearFraction * realRate;\n final double v = 1 / (1 + yield / bond.getCouponPerYear());\n if (bond.getCoupon().getNumberOfPayments() == 1) {\n return Math.pow(v, bond.getAccrualFactorToNextCoupon()) * (firstCashFlow + 1);\n }\n final double secondYearFraction = bond.getCoupon().getNthPayment(1).getPaymentYearFraction();\n final double secondCashFlow = secondYearFraction * realRate;\n final double vn = Math.pow(v, nbCoupon - 1);\n final double pvAtFirstCoupon = firstCashFlow + secondCashFlow * v + realRate * v * v * (1 - vn / v) / (1 - v) + vn;\n return pvAtFirstCoupon * Math.pow(v, bond.getAccrualFactorToNextCoupon());\n }\n throw new UnsupportedOperationException(\"The convention \" + bond.getYieldConvention().getName() + \" is not supported.\");\n }\n\n /**\n * Computes the clean price (real or nominal depending on the convention) from the conventional real yield.\n * \n * @param bond\n * The bond security.\n * @param yield\n * The bond yield.\n * @return The clean price.\n */\n public double cleanPriceFromYield(final BondCapitalIndexedSecurity<?> bond, final double yield) {\n Validate.isTrue(bond.getNominal().getNumberOfPayments() == 1, \"Yield: more than one nominal repayment.\");\n final double dirtyPrice = dirtyPriceFromRealYield(bond, yield);\n if (bond.getYieldConvention().equals(INDEX_LINKED_FLOAT)) {\n return cleanNominalPriceFromDirtyNominalPrice(bond, dirtyPrice);\n }\n return cleanRealPriceFromDirtyRealPrice(bond, dirtyPrice);\n }\n\n /**\n * Compute the conventional yield from the dirty price.\n * \n * @param bond\n * The bond security.\n * @param dirtyPrice\n * The bond dirty price.\n * @return The yield.\n */\n public double yieldRealFromDirtyRealPrice(final BondCapitalIndexedSecurity<?> bond, final double dirtyPrice) {\n /**\n * Inner function used to find the yield.\n */\n final Function1D<Double, Double> priceResidual = new Function1D<Double, Double>() {\n @Override\n public Double evaluate(final Double y) {\n return dirtyPriceFromRealYield(bond, y) - dirtyPrice;\n }\n };\n final double[] range = BRACKETER.getBracketedPoints(priceResidual, -0.05, 0.10);\n final double yield = ROOT_FINDER.getRoot(priceResidual, range[0], range[1]);\n return yield;\n }\n\n /**\n * Computes the present value sensitivity of a capital indexed bound by index estimation and discounting. The sensitivity is the sensitivity of the nominal\n * and the coupons but not the settlement.\n * \n * @param bond\n * The bond.\n * @param provider\n * The provider.\n * @return The present value.\n */\n public MultipleCurrencyInflationSensitivity presentValueCurveSensitivity(final BondCapitalIndexedSecurity<?> bond,\n final InflationIssuerProviderInterface provider) {\n ArgumentChecker.notNull(bond, \"Bond\");\n final InflationProviderInterface creditDiscounting = new InflationProviderDecoratedIssuer(provider, bond.getCurrency(), bond.getIssuerEntity());\n final MultipleCurrencyInflationSensitivity sensitivityNominal = bond.getNominal().accept(PVCSIC, creditDiscounting);\n final MultipleCurrencyInflationSensitivity sensitivityCoupon = bond.getCoupon().accept(PVCSIC, creditDiscounting);\n return sensitivityNominal.plus(sensitivityCoupon);\n }\n\n /**\n * Compute the conventional yield from the clean price.\n * \n * @param bond\n * The bond security.\n * @param cleanPrice\n * The bond clean price.\n * @return The yield.\n */\n public double yieldRealFromCleanPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice) {\n /**\n * Inner function used to find the yield.\n */\n final Function1D<Double, Double> priceResidual = new Function1D<Double, Double>() {\n @Override\n public Double evaluate(final Double y) {\n return cleanPriceFromYield(bond, y) - cleanPrice;\n }\n };\n final double[] range = BRACKETER.getBracketedPoints(priceResidual, -0.05, 0.10);\n final double yield = ROOT_FINDER.getRoot(priceResidual, range[0], range[1]);\n return yield;\n }\n\n /**\n * Calculates the modified duration from a standard yield.\n * \n * @param bond\n * The bond\n * @param yield\n * The yield\n * @return The modified duration\n */\n public double modifiedDurationFromYieldStandard(final BondCapitalIndexedSecurity<?> bond, final double yield) {\n ArgumentChecker.isTrue(bond.getNominal().getNumberOfPayments() == 1, \"Yield: more than one nominal repayment.\");\n final int nbCoupon = bond.getCoupon().getNumberOfPayments();\n final double nominal = bond.getNominal().getNthPayment(0).getNotional();\n final double factorOnPeriod = 1 + yield / bond.getCouponPerYear();\n double mdAtFirstCoupon = 0;\n double pvAtFirstCoupon = 0;\n for (int loopcpn = 0; loopcpn < nbCoupon; loopcpn++) {\n mdAtFirstCoupon += bond.getCoupon().getNthPayment(loopcpn).getNotional() / Math.pow(factorOnPeriod, loopcpn + 1)\n * (loopcpn + bond.getAccrualFactorToNextCoupon()) / bond.getCouponPerYear();\n pvAtFirstCoupon += bond.getCoupon().getNthPayment(loopcpn).getNotional() / Math.pow(factorOnPeriod, loopcpn);\n }\n mdAtFirstCoupon += nominal / Math.pow(factorOnPeriod, nbCoupon) * (nbCoupon - 1 + bond.getAccrualFactorToNextCoupon()) / bond.getCouponPerYear();\n pvAtFirstCoupon += nominal / Math.pow(factorOnPeriod, nbCoupon - 1);\n final double pv = pvAtFirstCoupon * Math.pow(factorOnPeriod, -bond.getAccrualFactorToNextCoupon());\n final double md = mdAtFirstCoupon * Math.pow(factorOnPeriod, -bond.getAccrualFactorToNextCoupon()) / pv;\n return md;\n }\n\n /**\n * Calculates the modified duration from a standard yield.\n * \n * @param bond\n * The bond\n * @param yield\n * The yield\n * @return The modified duration\n */\n public double modifiedDurationFromYieldFiniteDifference(final BondCapitalIndexedSecurity<?> bond, final double yield) {\n ArgumentChecker.isTrue(bond.getNominal().getNumberOfPayments() == 1, \"Yield: more than one nominal repayment.\");\n final double price = cleanPriceFromYield(bond, yield);\n final double priceplus = cleanPriceFromYield(bond, yield + 10e-6);\n final double priceminus = cleanPriceFromYield(bond, yield - 10e-6);\n return -(priceplus - priceminus) / (2 * price * 10e-6);\n }\n\n /**\n * Calculates the modified duration from a standard yield.\n * \n * @param bond\n * The bond\n * @param yield\n * The yield\n * @return The modified duration\n */\n public double convexityFromYieldFiniteDifference(final BondCapitalIndexedSecurity<?> bond, final double yield) {\n ArgumentChecker.isTrue(bond.getNominal().getNumberOfPayments() == 1, \"Yield: more than one nominal repayment.\");\n ArgumentChecker.isTrue(bond.getNominal().getNumberOfPayments() == 1, \"Yield: more than one nominal repayment.\");\n final double price = cleanPriceFromYield(bond, yield);\n final double priceplus = cleanPriceFromYield(bond, yield + 10e-6);\n final double priceminus = cleanPriceFromYield(bond, yield - 10e-6);\n return (priceplus - 2 * price + priceminus) / (price * 10e-6 * 10e-6);\n }\n\n /**\n * Computes the bill yield from the curves. The yield is in the bill yield convention.\n * \n * @param bond\n * The bond.\n * @param provider\n * The inflation and multi-curves provider.\n * @return The yield.\n */\n public double yieldRealFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface provider) {\n ArgumentChecker.notNull(bond, \"Bond\");\n ArgumentChecker.notNull(provider, \"inflation and multi-curves provider\");\n double dirtyPrice;\n if (bond.getYieldConvention().equals(INDEX_LINKED_FLOAT)) {\n dirtyPrice = dirtyNominalPriceFromCurves(bond, provider);\n } else {\n dirtyPrice = dirtyRealPriceFromCurves(bond, provider);\n }\n final double yield = yieldRealFromDirtyRealPrice(bond, dirtyPrice);\n return yield;\n }\n\n /**\n * Computes the modified duration of a bond from the curves.\n * \n * @param bond\n * The bond security.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @return The modified duration.\n */\n public double modifiedDurationFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves) {\n final double yield = yieldRealFromCurves(bond, issuerMulticurves);\n return modifiedDurationFromYieldFiniteDifference(bond, yield);\n }\n\n /**\n * Compute the conventional yield from the clean price.\n * \n * @param bond\n * The bond security.\n * @param cleanPrice\n * The bond clean price.\n * @return The yield.\n */\n public double yieldRealFromCleanRealPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice) {\n final double dirtyPrice = dirtyRealPriceFromCleanRealPrice(bond, cleanPrice);\n final double yield = yieldRealFromDirtyRealPrice(bond, dirtyPrice);\n return yield;\n }\n\n /**\n * Computes the modified duration of a bond from the clean price.\n * \n * @param bond\n * The bond security.\n * @param cleanPrice\n * The bond clean price.\n * @return The modified duration.\n */\n public double modifiedDurationFromCleanPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice) {\n final double yield = yieldRealFromCleanPrice(bond, cleanPrice);\n return modifiedDurationFromYieldFiniteDifference(bond, yield);\n }\n\n /**\n * Calculates the convexity from a standard yield.\n * \n * @param bond\n * The bond\n * @param yield\n * The yield\n * @return The convexity\n */\n public double convexityFromYieldStandard(final BondCapitalIndexedSecurity<?> bond, final double yield) {\n ArgumentChecker.isTrue(bond.getNominal().getNumberOfPayments() == 1, \"Yield: more than one nominal repayment.\");\n final int nbCoupon = bond.getCoupon().getNumberOfPayments();\n final double nominal = bond.getNominal().getNthPayment(bond.getNominal().getNumberOfPayments() - 1).getNotional();\n final double factorOnPeriod = 1 + yield / bond.getCouponPerYear();\n double cvAtFirstCoupon = 0;\n double pvAtFirstCoupon = 0;\n for (int loopcpn = 0; loopcpn < nbCoupon; loopcpn++) {\n cvAtFirstCoupon += bond.getCoupon().getNthPayment(loopcpn).getNotional() / Math.pow(factorOnPeriod, loopcpn + 2)\n * (loopcpn + bond.getAccrualFactorToNextCoupon()) * (loopcpn + bond.getAccrualFactorToNextCoupon() + 1)\n / (bond.getCouponPerYear() * bond.getCouponPerYear());\n pvAtFirstCoupon += bond.getCoupon().getNthPayment(loopcpn).getNotional() / Math.pow(factorOnPeriod, loopcpn);\n }\n cvAtFirstCoupon += nominal / Math.pow(factorOnPeriod, nbCoupon + 1) * (nbCoupon - 1 + bond.getAccrualFactorToNextCoupon())\n * (nbCoupon + bond.getAccrualFactorToNextCoupon()) / (bond.getCouponPerYear() * bond.getCouponPerYear());\n pvAtFirstCoupon += nominal / Math.pow(factorOnPeriod, nbCoupon - 1);\n final double pv = pvAtFirstCoupon * Math.pow(factorOnPeriod, -bond.getAccrualFactorToNextCoupon());\n final double cv = cvAtFirstCoupon * Math.pow(factorOnPeriod, -bond.getAccrualFactorToNextCoupon()) / pv;\n return cv;\n }\n\n /**\n * Computes the convexity of a bond from the curves.\n * \n * @param bond\n * The bond security.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @return The convexity.\n */\n public double convexityFromCurves(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves) {\n final double yield = yieldRealFromCurves(bond, issuerMulticurves);\n return convexityFromYieldFiniteDifference(bond, yield);\n }\n\n /**\n * Computes the convexity of a bond from the clean price.\n * \n * @param bond\n * The bond security.\n * @param cleanPrice\n * The bond clean price.\n * @return The convexity.\n */\n public double convexityFromCleanPrice(final BondCapitalIndexedSecurity<?> bond, final double cleanPrice) {\n final double yield = yieldRealFromCleanPrice(bond, cleanPrice);\n return convexityFromYieldFiniteDifference(bond, yield);\n }\n\n /**\n * Computes the present value of a bond security from z-spread. The z-spread is a parallel shift applied to the discounting curve associated to the bond\n * (Issuer Entity). The parallel shift is done in the curve convention.\n * \n * @param bond\n * The bond security.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @param zSpread\n * The z-spread.\n * @return The present value.\n */\n public MultipleCurrencyAmount presentValueFromZSpread(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves,\n final double zSpread) {\n final InflationIssuerProviderIssuerDecoratedSpread issuerShifted = new InflationIssuerProviderIssuerDecoratedSpread(issuerMulticurves,\n bond.getIssuerEntity(), zSpread);\n return presentValue(bond, issuerShifted);\n }\n\n /**\n * Computes the present value of a bond security from z-spread. The z-spread is a parallel shift applied to the discounting curve associated to the bond\n * (Issuer Entity). The parallel shift is done in the curve convention.\n * \n * @param bond\n * The bond security.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @param zSpread\n * The z-spread.\n * @return The present value.\n */\n public double cleanPriceFromZSpread(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves,\n final double zSpread) {\n final InflationIssuerProviderIssuerDecoratedSpread issuerShifted = new InflationIssuerProviderIssuerDecoratedSpread(issuerMulticurves,\n bond.getIssuerEntity(), zSpread);\n return cleanRealPriceFromCurves(bond, issuerShifted);\n }\n\n /**\n * Computes a bond z-spread from the curves and a present value. The z-spread is a parallel shift applied to the discounting curve associated to the bond\n * (Issuer Entity) to match the present value.\n * \n * @param bond\n * The bond.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @param cleanPrice\n * The target clean price.\n * @return The z-spread.\n */\n // TODO : this function have been created specially to match the clean price as it come from bloomberg (ie without specification if it is real or nominal),\n // maybe remove at one point.\n public double zSpreadFromCurvesAndCleanPriceDirect(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves,\n final double cleanPrice) {\n\n ArgumentChecker.notNull(bond, \"Bond\");\n ArgumentChecker.notNull(issuerMulticurves, \"Issuer and multi-curves provider\");\n final Function1D<Double, Double> residual = new Function1D<Double, Double>() {\n @Override\n public Double evaluate(final Double z) {\n final InflationIssuerProviderIssuerDecoratedSpread issuerShifted = new InflationIssuerProviderIssuerDecoratedSpread(issuerMulticurves,\n bond.getIssuerEntity(), z);\n if (bond.getYieldConvention().equals(INDEX_LINKED_FLOAT)) {\n return cleanNominalPriceFromCurves(bond, issuerShifted) - cleanPrice;\n }\n return cleanRealPriceFromCurves(bond, issuerShifted) - cleanPrice;\n }\n };\n\n final double[] range = BRACKETER.getBracketedPoints(residual, -0.5, 0.5); // Starting range is [-1%, 1%]\n return ROOT_FINDER.getRoot(residual, range[0], range[1]);\n }\n\n /**\n * Computes a bond z-spread from the curves and a present value. The z-spread is a parallel shift applied to the discounting curve associated to the bond\n * (Issuer Entity) to match the present value.\n * \n * @param bond\n * The bond.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @param cleanRealPrice\n * The target clean real price.\n * @return The z-spread.\n */\n public double zSpreadFromCurvesAndCleanRealPriceDirect(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves,\n final double cleanRealPrice) {\n return zSpreadFromCurvesAndPV(bond, issuerMulticurves, presentValueFromCleanRealPrice(bond, issuerMulticurves, cleanRealPrice));\n }\n\n /**\n * Computes a bond z-spread from the curves and a present value. The z-spread is a parallel shift applied to the discounting curve associated to the bond\n * (Issuer Entity) to match the present value.\n * \n * @param bond\n * The bond.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @param cleanRealPrice\n * The target clean real price.\n * @return The z-spread.\n */\n public double zSpreadFromCurvesAndCleanNominalPriceDirect(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves,\n final double cleanRealPrice) {\n return zSpreadFromCurvesAndPV(bond, issuerMulticurves, presentValueFromCleanNominalPrice(bond, issuerMulticurves, cleanRealPrice));\n }\n\n /**\n * Computes a bond z-spread from the curves and a present value. The z-spread is a parallel shift applied to the discounting curve associated to the bond\n * (Issuer Entity) to match the present value.\n * \n * @param bond\n * The bond.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @param pv\n * The target present value.\n * @return The z-spread.\n */\n public double zSpreadFromCurvesAndPV(final BondCapitalIndexedSecurity<?> bond, final InflationIssuerProviderInterface issuerMulticurves,\n final MultipleCurrencyAmount pv) {\n ArgumentChecker.notNull(bond, \"Bond\");\n ArgumentChecker.notNull(issuerMulticurves, \"Issuer and multi-curves provider\");\n final Currency ccy = bond.getCurrency();\n\n final Function1D<Double, Double> residual = new Function1D<Double, Double>() {\n @Override\n public Double evaluate(final Double z) {\n return presentValueFromZSpread(bond, issuerMulticurves, z).getAmount(ccy) - pv.getAmount(ccy);\n }\n };\n\n final double[] range = BRACKETER.getBracketedPoints(residual, -0.5, 0.5); // Starting range is [-1%, 1%]\n return ROOT_FINDER.getRoot(residual, range[0], range[1]);\n }\n\n /**\n * Computes a bond z-spread from the curves and a clean price. The z-spread is a parallel shift applied to the discounting curve associated to the bond\n * (Issuer Entity) to match the CleanPrice present value.\n * \n * @param bond\n * The bond.\n * @param issuerMulticurves\n * The issuer and multi-curves provider.\n * @param cleanPrice\n * The target clean price.\n * @return The z-spread.\n */\n public double zSpreadFromCurvesAndCleanPrice(final BondCapitalIndexedSecurity<Coupon> bond, final InflationIssuerProviderInterface issuerMulticurves,\n final double cleanPrice) {\n return zSpreadFromCurvesAndPV(bond, issuerMulticurves, presentValueFromCleanRealPrice(bond, issuerMulticurves, cleanPrice));\n }\n\n}\n", "meta": {"content_hash": "bf41cecbb9b17767ce1c32de08ed3c2e", "timestamp": "", "source": "github", "line_count": 803, "max_line_length": 159, "avg_line_length": 46.39975093399751, "alnum_prop": 0.7211680399366596, "repo_name": "McLeodMoores/starling", "id": "75c2be71172ed67d5e22d850113a1b455ad8ea62", "size": "37396", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "projects/analytics/src/main/java/com/opengamma/analytics/financial/interestrate/bond/provider/BondCapitalIndexedSecurityDiscountingMethod.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2505"}, {"name": "CSS", "bytes": "213501"}, {"name": "FreeMarker", "bytes": "310184"}, {"name": "GAP", "bytes": "1490"}, {"name": "Groovy", "bytes": "11518"}, {"name": "HTML", "bytes": "318295"}, {"name": "Java", "bytes": "79541905"}, {"name": "JavaScript", "bytes": "1511230"}, {"name": "PLSQL", "bytes": "398"}, {"name": "PLpgSQL", "bytes": "26901"}, {"name": "Shell", "bytes": "11481"}, {"name": "TSQL", "bytes": "604117"}]}} +{"text": "\ufeffusing System.Windows.Controls;\n\nnamespace EveMarket.Views\n{\n /// <summary>\n /// Interaction logic for ItemInfoView.xaml\n /// </summary>\n public partial class ItemInfoView : UserControl\n {\n public ItemInfoView()\n {\n InitializeComponent();\n }\n }\n}", "meta": {"content_hash": "7ba1f05fd37f11bdb5e380117173db13", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 51, "avg_line_length": 19.733333333333334, "alnum_prop": 0.5945945945945946, "repo_name": "Capgemini/Cauldron", "id": "a53b3cb45e415caef3f0f5bc85b72982a46f8614", "size": "298", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "Old/Desktop/Samples/EveMarket.Views/ItemInfoView.xaml.cs", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "603"}, {"name": "C#", "bytes": "6246714"}, {"name": "PowerShell", "bytes": "8223"}]}} +{"text": "/**\n * \n */\npackage com.aspose.cloud.sdk.slides.api;\n\nimport android.net.Uri;\n\nimport com.aspose.cloud.sdk.common.AsposeApp;\nimport com.aspose.cloud.sdk.common.Utils;\nimport com.aspose.cloud.sdk.slides.model.MergePresentationsRequest;\nimport com.aspose.cloud.sdk.slides.model.MergeSelectedSlidesOfPowerPointPresentationsRequest;\nimport com.aspose.cloud.sdk.slides.model.SplitPowerPointPresentationsResponse;\nimport com.aspose.cloud.sdk.slides.model.SplitPowerPointPresentationsResponse.SplitResult;\nimport com.aspose.cloud.sdk.slides.model.ValidSlidesFormats;\nimport com.aspose.cloud.sdk.slides.model.DocumentResponse;\nimport com.aspose.cloud.sdk.slides.model.DocumentResponse.DocumentModel;\nimport com.aspose.cloud.sdk.slides.model.ValidFormatsEnum;\n\nimport com.google.gson.Gson;\nimport com.google.gson.GsonBuilder;\n\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.security.InvalidKeyException;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.HashMap;\n\n/**\n * Document --- Using this class you can create a new empty PowerPoint presentation, convert PowerPoint document to other File formats, \n * merge multiple PowerPoint presentation files and split all or specific slides of a presentation file\n * @author M. Sohail Ismail\n */\npublic class Document {\n\t\n\tprivate static final String SLIDES_URI = AsposeApp.BASE_PRODUCT_URI + \"/slides/\";\n\tpublic static final String TEXTCOMPRESSION_KEY = \"TextCompression\";\n\tpublic static final String EMBEDFULLFONTS_KEY = \"EmbedFullFonts\";\n\tpublic static final String COMPLIANCE_KEY = \"Compliance\";\n\tpublic static final String JPEGQUALITY_KEY = \"JpegQuality\";\n\tpublic static final String SAVEMETAFILESASPNG_KEY = \"SaveMetafilesAsPng\";\n\tpublic static final String PDFPASSWORD_KEY = \"PdfPassword\";\n\tpublic static final String EMBEDTRUETYPEFONTSFORASCII_KEY = \"EmbedTrueTypeFontsForASCII\";\n\t\n\t/**\n\t * Create a new empty PowerPoint presentation\n\t * @param fileName Name of the file stored on cloud\n\t * @throws java.security.InvalidKeyException If initialization fails because the provided key is null.\n\t * @throws java.security.NoSuchAlgorithmException If the specified algorithm (HmacSHA1) is not available by any provider.\n\t * @throws java.io.IOException If there is an IO error\n\t * @return An object that contains URLs to document properties, slides and images and alternative links to download document in other formats\n\t*/ \n\tpublic static DocumentModel createEmptyPowerPointPresentation(String fileName) throws InvalidKeyException, NoSuchAlgorithmException, IOException {\n\t\t\n\t\tDocumentModel document = null;\n\t\t\n\t\tif(fileName == null || fileName.length() == 0) {\n\t\t\tthrow new IllegalArgumentException(\"File name cannot be null or empty\");\n\t\t}\n\t\t\n\t\t//build URL\n\t\tString strURL = SLIDES_URI + Uri.encode(fileName);\n\t\t//sign URL\n\t\tString signedURL = Utils.sign(strURL);\n\t\tInputStream responseStream = Utils.processCommand(signedURL, \"PUT\");\n\t\tString jsonStr = Utils.streamToString(responseStream);\n\t\t\n\t\t//Parsing JSON\n\t\tGson gson = new Gson();\n\t\tDocumentResponse documentResponse = gson.fromJson(jsonStr, DocumentResponse.class);\n\t\tif(documentResponse.getCode().equals(\"201\") && documentResponse.getStatus().equals(\"Created\")) {\n\t\t\tdocument = documentResponse.document;\n\t\t}\n\t\t\n\t\treturn document;\n\t}\n\t\n\t/**\n\t * Convert PowerPoint document to other File formats \n\t * @param fileName Name of the file stored on cloud\n\t * @param designatedFormat Valid formats are tiff, pdf, xps, odp, ppsx, pptm, ppsm, potx, potm and html\n\t * @param storageName If file is stored at third party storage e.g. Amazon S3, Azure, Dropbox, Google Drive or FTP\n\t * @param folderName Path to file if file is not stored at root\n\t * @throws java.security.InvalidKeyException If initialization fails because the provided key is null.\n\t * @throws java.security.NoSuchAlgorithmException If the specified algorithm (HmacSHA1) is not available by any provider.\n\t * @throws java.io.IOException If there is an IO error\n\t * @return A path to converted document\n\t*/ \n\tpublic static String convertPowerPointDocumentToOtherFileFormats(String fileName, ValidFormatsEnum designatedFormat, String storageName, String folderName) throws InvalidKeyException, NoSuchAlgorithmException, IOException {\n\t\t\n\t\tString localFilePath = null;\n\t\t\n\t\tif(fileName == null || fileName.length() == 0) {\n\t\t\tthrow new IllegalArgumentException(\"File name cannot be null or empty\");\n\t\t}\n\t\t\n\t\tif(designatedFormat == null) {\n\t\t\tthrow new IllegalArgumentException(\"Designated format cannot be null\");\n\t\t}\n\t\t\n\t\t//build URL\n\t\tStringBuilder strURL = new StringBuilder(SLIDES_URI + Uri.encode(fileName) + \"?format=\" + designatedFormat);\n\t\t//If document is on the third party storage\n\t\tif(storageName != null && storageName.length() != 0) {\n\t\t\tstrURL.append(\"&storage=\" + storageName);\n\t\t}\n\t\t//In case if file is not at root folder\n\t\tif(folderName != null && folderName.length() != 0) {\n\t\t\tstrURL.append(\"&folder=\" + folderName);\n\t\t}\n\n\t\t//sign URL\n\t\tString signedURL = Utils.sign(strURL.toString());\n\t\tInputStream responseStream = Utils.processCommand(signedURL, \"GET\");\n\t\t\n\t\t//Replace fileName extension with designated format \n\t\tString[] fileNameAndItsExtensionArray = fileName.split(\"\\\\.\");\n\t\tfileName = fileNameAndItsExtensionArray[0] + \".\" + designatedFormat;\n\t\t\n\t\t//Save file on Disk\n\t\tlocalFilePath = Utils.saveStreamToFile(responseStream, fileName);\n\t\treturn localFilePath;\n\t}\n\t\n\t/**\n\t * Convert PowerPoint document to other file formats with additional settings\n\t * @param fileName Name of the file stored on cloud\n\t * @param designatedFormat Valid formats are tiff, pdf, xps, odp, ppsx, pptm, ppsm, potx, potm and html\n\t * @param exportOptions Depends of parameter \"format\" service can receive export options\n\t * @throws java.security.InvalidKeyException If initialization fails because the provided key is null.\n\t * @throws java.security.NoSuchAlgorithmException If the specified algorithm (HmacSHA1) is not available by any provider.\n\t * @throws java.io.IOException If there is an IO error\n\t * @return A path to converted document\n\t*/ \n\tpublic static String convertPowerPointDocumentToOtherFileFormatsWithAdditionalSettings(String fileName, ValidFormatsEnum designatedFormat, HashMap<String, String> exportOptions) throws InvalidKeyException, NoSuchAlgorithmException, IOException {\n\t\t\n\t\tString localFilePath = null;\n\t\t\n\t\tif(fileName == null || fileName.length() <= 3) {\n\t\t\tthrow new IllegalArgumentException(\"File name cannot be null or empty\");\n\t\t}\n\t\t\n\t\tif(designatedFormat == null) {\n\t\t\tthrow new IllegalArgumentException(\"Designated format cannot be null\");\n\t\t}\n\t\t\n\t\t//build URL\n\t\tStringBuilder strURL = new StringBuilder(SLIDES_URI + Uri.encode(fileName) + \"?format=\" + designatedFormat);\n\t\tif(exportOptions.get(TEXTCOMPRESSION_KEY) != null) {\n\t\t\tstrURL.append(\"&TextCompression=\" + exportOptions.get(TEXTCOMPRESSION_KEY));\n\t\t}\n\t\tif(exportOptions.get(EMBEDFULLFONTS_KEY) != null) {\n\t\t\tstrURL.append(\"&EmbedFullFonts=\" + exportOptions.get(EMBEDFULLFONTS_KEY));\n\t\t}\n\t\tif(exportOptions.get(COMPLIANCE_KEY) != null) {\n\t\t\tstrURL.append(\"&Compliance=\" + exportOptions.get(COMPLIANCE_KEY));\n\t\t}\n\t\tif(exportOptions.get(JPEGQUALITY_KEY) != null) {\n\t\t\tstrURL.append(\"&JpegQuality=\" + exportOptions.get(JPEGQUALITY_KEY));\n\t\t}\n\t\tif(exportOptions.get(SAVEMETAFILESASPNG_KEY) != null) {\n\t\t\tstrURL.append(\"&SaveMetafilesAsPng=\" + exportOptions.get(SAVEMETAFILESASPNG_KEY));\n\t\t}\n\t\tif(exportOptions.get(PDFPASSWORD_KEY) != null) {\n\t\t\tstrURL.append(\"&PdfPassword=\" + exportOptions.get(PDFPASSWORD_KEY));\n\t\t}\n\t\tif(exportOptions.get(EMBEDTRUETYPEFONTSFORASCII_KEY) != null) {\n\t\t\tstrURL.append(\"&EmbedTrueTypeFontsForASCII=\" + exportOptions.get(EMBEDTRUETYPEFONTSFORASCII_KEY));\n\t\t}\n\t\t\n\t\t//sign URL\n\t\tString signedURL = Utils.sign(strURL.toString());\n\t\tInputStream responseStream = Utils.processCommand(signedURL, \"GET\");\n\t\t\n\t\t//Replace fileName extension with designated format \n\t\tString[] fileNameAndItsExtensionArray = fileName.split(\"\\\\.\");\n\t\tfileName = fileNameAndItsExtensionArray[0] + \".\" + designatedFormat;\n\t\t\n\t\t//Save file on Disk\n\t\tlocalFilePath = Utils.saveStreamToFile(responseStream, fileName);\n\t\treturn localFilePath;\n\t}\n\n\t/**\n\t * Convert PowerPoint document stored on device to other file formats\n\t * @param localFilePath Name of the file stored on device\n\t * @param designatedFormat Valid formats are tiff, pdf, xps, odp, ppsx, pptm, ppsm, potx, potm and html\n\t * @throws java.security.InvalidKeyException If initialization fails because the provided key is null.\n\t * @throws java.security.NoSuchAlgorithmException If the specified algorithm (HmacSHA1) is not available by any provider.\n\t * @throws java.io.IOException If there is an IO error\n\t * @return A path to converted document\n\t*/ \n\tpublic static String convertLocallyStoredPowerPointDocumentToOtherFileFormats(String localFilePath, ValidFormatsEnum designatedFormat) throws InvalidKeyException, NoSuchAlgorithmException, IOException {\n\t\t\n\t\tString updatedFilePath = null;\n\t\t\n\t\tif(localFilePath == null || localFilePath.length() == 0) {\n\t\t\tthrow new IllegalArgumentException(\"Local file path cannot be null or empty\");\n\t\t}\n\t\t\n\t\tif(designatedFormat == null) {\n\t\t\tthrow new IllegalArgumentException(\"Designated format cannot be null\");\n\t\t}\n\t\t\n\t\t//Build URI \n\t\tString strURL = SLIDES_URI + \"convert?format=\" + designatedFormat;\n\t\t//Sign the request URI\n\t\tString signedURL = Utils.sign(strURL);\t\n\t\t//Convert the local file to InputStream\n\t\tInputStream fileStream = new FileInputStream(localFilePath);\n\t\t//Process the request on server\n\t\tInputStream responseStream = Utils.processCommand(signedURL, \"POST\", fileStream);\n\t\t//Get fileName from localFilePath\n\t\tString fileName;\n\t\tint index = localFilePath.lastIndexOf(\"/\");\n\t\tif(index != -1) {\n\t\t\tfileName = localFilePath.substring(index+1);\n\t\t} else {\n\t\t\tfileName = localFilePath;\n\t\t}\n\t\t//Replace fileName extension with designated format \n\t\tString[] fileNameAndItsExtensionArray = fileName.split(\"\\\\.\");\n\t\tfileName = fileNameAndItsExtensionArray[0] + \".\" + designatedFormat;\n\t\t\t\t\n\t\t//Save the stream in response to the disk\n\t\tupdatedFilePath = Utils.saveStreamToFile(responseStream, fileName);\n\t\t\n\t\treturn updatedFilePath;\n\t}\n\t\n\t/**\n\t * You can merge multiple PowerPoint presentation files\n\t * @param fileName Name of the file stored on cloud\n\t * @param mergePresentationsRequest Contains an array of PowerPoint presentations to be merged with\n\t * @throws java.security.InvalidKeyException If initialization fails because the provided key is null.\n\t * @throws java.security.NoSuchAlgorithmException If the specified algorithm (HmacSHA1) is not available by any provider.\n\t * @throws java.io.IOException If there is an IO error\n\t * @return An object that contains URLs to document properties, slides and images and alternative links to download document in other formats\n\t*/ \n\tpublic static DocumentModel mergePowerPointPresentations(String fileName, MergePresentationsRequest mergePresentationsRequest) throws InvalidKeyException, NoSuchAlgorithmException, IOException {\n\t\t\n\t\tDocumentModel document = null;\n\t\t\n\t\tif(fileName == null || fileName.length() == 0) {\n\t\t\tthrow new IllegalArgumentException(\"File name cannot be null or empty\");\n\t\t}\n\t\t\n\t\tif(mergePresentationsRequest == null) {\n\t\t\tthrow new IllegalArgumentException(\"Merge presentations request cannot be null\");\n\t\t}\n\t\t\n\t\tGsonBuilder builder = new GsonBuilder();\n Gson gson = builder.create();\n String requestJSONString = gson.toJson(mergePresentationsRequest, MergePresentationsRequest.class);\n \n //Build URI \n \tString strURL = SLIDES_URI + Uri.encode(fileName) + \"/merge\";\n \t//Sign the request URI\n \tString signedURL = Utils.sign(strURL);\t\n \t\t\n InputStream responseStream = Utils.processCommand(signedURL, \"POST\", requestJSONString);\n String responseJSONString = Utils.streamToString(responseStream);\n\t\t\n //Parsing JSON\n\t\tDocumentResponse documentResponse = gson.fromJson(responseJSONString, DocumentResponse.class);\n\t\tif(documentResponse.getCode().equals(\"200\") && documentResponse.getStatus().equals(\"OK\")) {\n\t\t\tdocument = documentResponse.document;\n\t\t}\n\t\t\n\t\treturn document;\n\t}\n\t\n\t/**\n\t * Take selected slides from multiple presentation files and merge into another presentation\n\t * @param fileName Name of the file stored on cloud\n\t * @param mergePresentationsRequest Contains an array of PowerPoint presentations to be merged with\n\t * @throws java.security.InvalidKeyException If initialization fails because the provided key is null.\n\t * @throws java.security.NoSuchAlgorithmException If the specified algorithm (HmacSHA1) is not available by any provider.\n\t * @throws java.io.IOException If there is an IO error\n\t * @return An object that contains URLs to document properties, slides and images and alternative links to download document in other formats\n\t*/ \n\tpublic static DocumentModel mergeSelectedSlidesOfPowerPointPresentations(String fileName, MergeSelectedSlidesOfPowerPointPresentationsRequest mergePresentationsRequest) throws InvalidKeyException, NoSuchAlgorithmException, IOException {\n\t\t\n\t\tDocumentModel document = null;\n\t\t\n\t\tif(fileName == null || fileName.length() == 0) {\n\t\t\tthrow new IllegalArgumentException(\"File name cannot be null or empty\");\n\t\t}\n\t\t\n\t\tif(mergePresentationsRequest == null) {\n\t\t\tthrow new IllegalArgumentException(\"Merge presentations request cannot be null\");\n\t\t}\n\t\t\n\t\tGsonBuilder builder = new GsonBuilder();\n Gson gson = builder.create();\n String requestJSONString = gson.toJson(mergePresentationsRequest, MergeSelectedSlidesOfPowerPointPresentationsRequest.class);\n \n //Build URI \n \tString strURL = SLIDES_URI + Uri.encode(fileName) + \"/merge\";\n \t//Sign the request URI\n \tString signedURL = Utils.sign(strURL);\t\n \t\t\n InputStream responseStream = Utils.processCommand(signedURL, \"PUT\", requestJSONString);\n String responseJSONString = Utils.streamToString(responseStream);\n\t\t\n //Parsing JSON\n\t\tDocumentResponse documentResponse = gson.fromJson(responseJSONString, DocumentResponse.class);\n\t\tif(documentResponse.getCode().equals(\"200\") && documentResponse.getStatus().equals(\"OK\")) {\n\t\t\tdocument = documentResponse.document;\n\t\t}\n\t\t\n\t\treturn document;\n\t}\n\t\n\t/**\n\t * Split all slides of a presentation file and save each slide as a new HTML or any supported image format\n\t * @param fileName Name of the file stored on cloud\n\t * @throws java.security.InvalidKeyException If initialization fails because the provided key is null.\n\t * @throws java.security.NoSuchAlgorithmException If the specified algorithm (HmacSHA1) is not available by any provider.\n\t * @throws java.io.IOException If there is an IO error\n\t * @return An object that contains URLs to slides\n\t*/ \n\tpublic static SplitResult splitPowerPointPresentations(String fileName) throws InvalidKeyException, NoSuchAlgorithmException, IOException {\n\t\t\n\t\tSplitResult splitResult = null;\n\t\t\n\t\tif(fileName == null || fileName.length() <= 3) {\n\t\t\tthrow new IllegalArgumentException(\"File name cannot be null or empty\");\n\t\t}\n\t\t\n\t\t//build URL\n\t\tString strURL = SLIDES_URI + Uri.encode(fileName) + \"/split\";\n\t\t//sign URL\n\t\tString signedURL = Utils.sign(strURL);\n\t\t\n\t\tInputStream responseStream = Utils.processCommand(signedURL, \"POST\");\n\t\tString responseJSONString = Utils.streamToString(responseStream);\n\t\t\n\t\t//Parsing JSON\n\t\tGson gson = new Gson();\n\t\tSplitPowerPointPresentationsResponse splitPowerPointPresentationResponse = gson.fromJson(responseJSONString, SplitPowerPointPresentationsResponse.class);\n\t\tif(splitPowerPointPresentationResponse.getCode().equals(\"200\") && splitPowerPointPresentationResponse.getStatus().equals(\"OK\")) {\n\t\t\tsplitResult = splitPowerPointPresentationResponse.splitResult;\n\t\t}\n\t\t\n\t\treturn splitResult;\n\t}\n\t\n\t/**\n\t * Split specific slides of a presentation file and save each slide as a new HTML or any supported image format\n\t * @param fileName Name of the file stored on cloud\n\t * @param from The start slide number for splitting\n\t * @param to The last slide number for splitting\n\t * @param designatedFormat Valid formats are tiff, jpeg, png, bmp and gif\n\t * @throws java.security.InvalidKeyException If initialization fails because the provided key is null.\n\t * @throws java.security.NoSuchAlgorithmException If the specified algorithm (HmacSHA1) is not available by any provider.\n\t * @throws java.io.IOException If there is an IO error\n\t * @return An object that contains URLs to slides\n\t*/\n\tpublic static SplitResult splitPowerPointPresentations(String fileName, int from, int to, ValidSlidesFormats designatedFormat) throws InvalidKeyException, NoSuchAlgorithmException, IOException {\n\t\t\n\t\tSplitResult splitResult = null;\n\t\t\n\t\tif(fileName == null || fileName.length() <= 3) {\n\t\t\tthrow new IllegalArgumentException(\"File name cannot be null or empty\");\n\t\t}\n\t\t\n\t\tif(designatedFormat == null) {\n\t\t\tthrow new IllegalArgumentException(\"Designated format cannot be null\");\n\t\t}\n\t\t\n\t\t//build URL\n\t\tString strURL = SLIDES_URI + Uri.encode(fileName) + \"/split?from=\" + from + \"&to=\" + to + \"&format=\" + designatedFormat;\n\t\t//sign URL\n\t\tString signedURL = Utils.sign(strURL);\n\t\t\n\t\tInputStream responseStream = Utils.processCommand(signedURL, \"POST\");\n\t\tString responseJSONString = Utils.streamToString(responseStream);\n\t\t\n\t\t//Parsing JSON\n\t\tGson gson = new Gson();\n\t\tSplitPowerPointPresentationsResponse splitPowerPointPresentationResponse = gson.fromJson(responseJSONString, SplitPowerPointPresentationsResponse.class);\n\t\tif(splitPowerPointPresentationResponse.getCode().equals(\"200\") && splitPowerPointPresentationResponse.getStatus().equals(\"OK\")) {\n\t\t\tsplitResult = splitPowerPointPresentationResponse.splitResult;\n\t\t}\n\t\t\n\t\treturn splitResult;\n\t}\n}", "meta": {"content_hash": "4e9a9c40037494141cc182d3d22182b4", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 246, "avg_line_length": 45.52956298200514, "alnum_prop": 0.7584551973349896, "repo_name": "asposeforcloud/Aspose_Cloud_SDK_For_Android", "id": "910d43031fde05302ba3e225638fc69affb2ed36", "size": "17711", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "asposecloudsdk/src/main/java/com/aspose/cloud/sdk/slides/api/Document.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "1039150"}]}} +{"text": "import React from 'react'\r\nimport ReactDOM from 'react-dom'\r\nimport {Provider} from 'react-redux'\r\nimport store from './store'\r\nimport AppContainer from './components/containers/AppContainer'\r\nimport './css/index.css'\r\n\r\nReactDOM.render(\r\n <Provider store={store} >\r\n <AppContainer />\r\n </Provider>, \r\n document.getElementById('root')\r\n);", "meta": {"content_hash": "a1e7a363296d902730d59fc1d1902d6a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 63, "avg_line_length": 26.46153846153846, "alnum_prop": 0.7063953488372093, "repo_name": "TheHappyKoala/Gravity-Playground", "id": "0b57d94f377e15bf5a05bd5c9b2d64d07cd55ca0", "size": "344", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/index.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "4821"}, {"name": "HTML", "bytes": "1018"}, {"name": "JavaScript", "bytes": "73640"}]}} +{"text": "package org.jeo.feature;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport org.osgeo.proj4j.CoordinateReferenceSystem;\n\nimport com.vividsolutions.jts.geom.Geometry;\n\n/**\n * An object consisting of a set of named attributes, any of which may be a vector geometry. \n * \n * @see ListFeature\n * @see MapFeature\n * \n * @author Justin Deoliveira, OpenGeo\n */\npublic interface Feature {\n\n /**\n * Feature identifier.\n */\n String getId();\n\n /**\n * Coordinate reference system for the feature.\n * <p>\n * Generally the method {@link #crs()} should be used.\n * </p>\n * @return The crs, or <code>null</code> if none been set.\n */\n CoordinateReferenceSystem getCRS();\n\n /**\n * Sets the coordinate reference system for the feature.\n */\n void setCRS(CoordinateReferenceSystem crs);\n\n /**\n * The derived coordinate reference system for the feature.\n * <p>\n * If {@link #getCRS()} returns a value it is returned, otherwise if the feature has a \n * schema object then {@link Schema#crs()} is returned. Otherwise this method returns \n * <code>null</code>.\n * </p>\n * @return The derived crs.\n */\n CoordinateReferenceSystem crs();\n\n /**\n * Gets a named attribute of the feature.\n * <p>\n * This method should return <code>null</code> if no such attribute named <tt>key</tt> exists.\n * </p>\n * @param key The key or name of the attribute.\n * \n * @return The attribute value or <code>null</code>.\n */\n Object get(String key);\n\n /**\n * Geometry of the feature.\n *\n * @return a {@link Geometry} object, or <code>null</code> if the feature has no geometry.\n */\n Geometry geometry();\n\n /**\n * Sets a named attribute of the feature.\n *\n * @param key The key or name of the attribute. \n * @param val The new value of the attribute. \n */\n void put(String key, Object val);\n\n /**\n * Sets the geometry of the feature.\n */\n void put(Geometry g);\n\n /**\n * The created schema for the feature. \n */\n Schema schema();\n\n /**\n * Returns an immutable list view of the feature\n */\n abstract List<Object> list();\n\n /**\n * Returns an immutable map view of the feature.\n */\n abstract Map<String,Object> map();\n}\n", "meta": {"content_hash": "25b85ea7cf0616e0c9a13c9dc7e429af", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 98, "avg_line_length": 24.305263157894736, "alnum_prop": 0.6071892594196622, "repo_name": "geosolutions-it/jeo", "id": "74c496f62ee7efccdc5715f2f38fcd9106a3008b", "size": "2309", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/main/java/org/jeo/feature/Feature.java", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\npackage org.hl7.hibernate;\n\nimport java.lang.reflect.Method;\nimport java.util.List;\nimport org.hl7.types.BAG;\nimport org.hl7.types.impl.BAGjuListAdapter;\nimport org.hl7.types.impl.BAGnull;\n\n/**\n * Access a BAG property and wrap/unwrap the underlying bag.\n * \n * @author Gunther Schadow\n */\npublic class WrappingBagAccessor extends StrategicPropertyAccessor {\n\n private static class BAGWrapper implements\n\t\t\t\t StrategicPropertyAccessor.FieldWrappingStrategy {\n\n public Object bean2DBValue(Object beanValue) {\n if (beanValue == null) {\n\treturn null;\n } else if (beanValue instanceof BAG) {\n\tfinal BAG bagValue = (BAG) beanValue;\n\tif (bagValue.isNull().isTrue()) {\n\t return null;\n\t} else if (bagValue instanceof BAGjuListAdapter) {\n\t return ((BAGjuListAdapter) bagValue)._hibernateUnwrap();\n\t}\n }\n\n throw new RuntimeException(\"class not supported here: \" + beanValue.getClass());\n }\n\n public Object db2BeanValue(Object dbValue) {\n return dbValue == null ? BAGnull.NI : BAGjuListAdapter._hibernateWrap((List) dbValue);\n }\n\n }\n \n @Override\n public StrategicPropertyAccessor.FieldWrappingStrategy getWrappingStrategy() {\n return new BAGWrapper();\n }\n}\n", "meta": {"content_hash": "9518e9df3676f438cab9914e3904dada", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 92, "avg_line_length": 26.666666666666668, "alnum_prop": 0.7208333333333333, "repo_name": "markusgumbel/dshl7", "id": "d61c50bee9ffa8a9167a68a55c859b9be95ddbd7", "size": "1942", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hl7-javasig/src/org/hl7/hibernate/WrappingBagAccessor.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Groovy", "bytes": "25055"}, {"name": "Java", "bytes": "3897443"}, {"name": "Perl", "bytes": "9821"}, {"name": "Python", "bytes": "3285"}, {"name": "Scala", "bytes": "100505"}, {"name": "Shell", "bytes": "974"}]}} +{"text": "/*\n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n */\npackage MyProcess;\n\nimport java.io.BufferedInputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.InputStream;\nimport java.net.URL;\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.ResultSet;\nimport java.sql.Statement;\n\n/**\n *\n * @author amungen\n */\npublic class GetImagesT extends Thread {\n\n String generalpath = \"/Volumes/Levent-Taha/Flicker/\";\n\n public void run() {\n allprocess();\n }\n\n public static void main(String[] args) {\n GetImagesT g = new GetImagesT();\n g.allprocess();\n // g.deleteimage(\"adadada\");\n }\n\n public void allprocess() {\n // for (int i = 400; i < 700; i++) { createnewfolder(i+\"\"); }\n // for (int i = 0; i < 1000; i++) {\n\n downloadimages();\n // }\n }\n\n public void downloadimages() {\n Connection conn = null;\n Statement st = null;\n ResultSet rs = null;\n try {\n Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\n String dbUrl = \"jdbc:mysql://omitechnology.com/omitechn_flick?useUnicode=true&characterEncode=UTF-8\";\n conn = DriverManager.getConnection(dbUrl, \"omite_flick\", \"flick\");\n conn.createStatement();\n st = conn.createStatement();\n int sayac = 0;\n rs = st.executeQuery(\"Select url_o,ID,PHOTOID FROM photos WHERE downimage=0\");\n int id;\n String folderpath = \"1\";\n String photoid;\n String link;\n\n while (rs.next()) {\n id = rs.getInt(\"id\");\n photoid = rs.getString(\"photoid\");\n folderpath = ((id / 500) + 1) + \"/\";\n link = rs.getString(\"url_o\");\n if (link.length() > 10) {\n singledownloadimage(id, link, folderpath, photoid);\n sayac++;\n if (sayac % 10 == 0) {\n System.out.println(\"Toplam Basarili Download = \" + sayac);\n }\n if (sayac % 4 == 0) {\n System.out.println(\"Break\");\n break;\n\n }\n\n\n\n }\n }\n conn.close();\n rs.close();\n st.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n\n\n\n }\n\n public void singledownloadimage(int ID, String link, String folderpath, String photoid) {\n try {\n // System.out.println(\"link = \" + link);\n // System.out.println(\"1 = \" + link.lastIndexOf(\".\"));\n // System.out.println(\"2 = \" + link.length());\n String extention = link.substring(link.lastIndexOf(\".\"), link.length());\n // System.out.println(\"extention = \" + extention);\n URL url = new URL(link);\n InputStream in = new BufferedInputStream(url.openStream());\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n byte[] buf = new byte[1024];\n int n = 0;\n while (-1 != (n = in.read(buf))) {\n out.write(buf, 0, n);\n }\n out.close();\n in.close();\n byte[] response = out.toByteArray();\n if (response.length > 10000) {\n FileOutputStream fos = new FileOutputStream(generalpath + folderpath + photoid + extention);\n fos.write(response);\n fos.close();\n updateimagestatus(ID);\n } else {\n deleteimage(photoid);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n\n public void createnewfolder(String foldername) {\n try {\n // File newDir = new File(\"/Users/amungen/Desktop/flicker/\" + foldername);\n File newDir = new File(generalpath + foldername);\n boolean success = newDir.mkdir();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n\n public void updateimagestatus(int ID) {\n Connection conn = null;\n Statement st = null;\n ResultSet rs = null;\n try {\n // omitechn_youtubecraw\t\tomite_youtubecra\t ahmet\n\n Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\n String dbUrl = \"jdbc:mysql://omitechnology.com/omitechn_flick?useUnicode=true&characterEncode=UTF-8\";\n conn = DriverManager.getConnection(dbUrl, \"omite_flick\", \"flick\");\n st = conn.createStatement();\n st.executeUpdate(\"UPDATE photos set downimage=1 WHERE id='\" + ID + \"'\");\n\n\n if (rs != null) {\n rs.close();\n }\n if (st != null) {\n st.close();\n }\n if (conn != null) {\n conn.close();\n }\n\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }\n\n public void deleteimage(String imageID) {\n //DELETE FROM photos WHERE photoid='+imageID;\n Connection conn = null;\n Statement st = null;\n ResultSet rs = null;\n try {\n\n Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\n String dbUrl = \"jdbc:mysql://omitechnology.com/omitechn_flick?useUnicode=true&characterEncode=UTF-8\";\n conn = DriverManager.getConnection(dbUrl, \"omite_flick\", \"flick\");\n st = conn.createStatement();\n String sql = \"DELETE FROM photos WHERE photoid='\" + imageID + \"'\";\n // System.out.println(\"sql = \" + sql);\n st.executeUpdate(sql);\n statisticdeletefile();\n\n if (rs != null) {\n rs.close();\n }\n if (st != null) {\n st.close();\n }\n if (conn != null) {\n conn.close();\n }\n\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n\n public void statisticdeletefile() {\n //UPDATE WRONG SET WrongSize = WrongSize + 1 \n\n Connection conn = null;\n Statement st = null;\n\n try {\n\n\n Class.forName(\"com.mysql.jdbc.Driver\").newInstance();\n String dbUrl = \"jdbc:mysql://omitechnology.com/omitechn_flick?useUnicode=true&characterEncode=UTF-8\";\n conn = DriverManager.getConnection(dbUrl, \"omite_flick\", \"flick\");\n st = conn.createStatement();\n String sqlquery = \"UPDATE statistic SET deletedimagesize = deletedimagesize + 1\";\n\n st.execute(sqlquery);\n conn.close();\n st.close();\n // System.out.println(\"link yok\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n\n\n\n }\n}\n", "meta": {"content_hash": "c8c9d5e01a9027a5daa5f6df40ce6862", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 113, "avg_line_length": 29.44206008583691, "alnum_prop": 0.5112244897959184, "repo_name": "pcvlab/Flicker-Data-Integration", "id": "78e9093fd6abe915bd718f22546ed634f29cf49c", "size": "6860", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "FlickerWeb3/src/java/MyProcess/GetImagesT.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "172413"}]}} +{"text": "import rethinkdb as r\nconn = r.connect('localhost', 28015)\n\nr.db('rethinkdb').table('cluster_config').get('auth').update(\n {'auth_key': 'cloudroutes'}\n).run(conn)\n", "meta": {"content_hash": "a5210b21ba9d9f65439026c2688fd29d", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 61, "avg_line_length": 27.666666666666668, "alnum_prop": 0.6746987951807228, "repo_name": "Runbook/runbook", "id": "f823089a6e019a470d8c7217fba30608b30d2096", "size": "166", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "src/bridge/mgmtscripts/set_rethink_auth_key.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "17816"}, {"name": "HTML", "bytes": "227999"}, {"name": "JavaScript", "bytes": "4250"}, {"name": "Python", "bytes": "754910"}, {"name": "Shell", "bytes": "5859"}]}} +{"text": "using namespace v8;\n\nPersistent<Function> PriorityQ::constructor;\n\n\nPriorityQ::PriorityQ() {\n\n auto compare = [](const std::shared_ptr<QObjectHolder> &lhs, const std::shared_ptr<QObjectHolder> &rhs) -> bool {\n\n return lhs->priority < rhs->priority;\n };\n\n hq_ = std::make_shared<HolderQ>(compare);\n}\n\n\nPriorityQ::PriorityQ(Isolate *isolate, Local<Function> cmp) {\n\n HandleScope handle_scope(isolate);\n LOGD(\"Setting up comparotor\")\n if (cmp.IsEmpty()) {\n LOGD(\"cmp is EMPTY!\");\n } else {\n LOGD(\"CMP WAS NOT EMPTY\")\n }\n\n hasComparator_ = true;\n\n CopyablePersistentObject pcmp;\n pcmp.Reset(isolate, cmp);\n\n auto ptrCmp = std::make_shared<CopyablePersistentObject>(std::move(pcmp));\n\n auto compare = [ptrCmp, isolate](const std::shared_ptr<QObjectHolder> &lhs,\n const std::shared_ptr<QObjectHolder> &rhs) -> bool {\n //return lhs->priority < rhs->priority;\n LOGD(\"CALLING JS COMPARATOR !\")\n Local<Object> g = ptrCmp->Get(isolate);\n if (g.IsEmpty()) {\n LOGD(\"comparotor was empty inside persistent\")\n } else {\n LOGD(\"cmp was NOT empty in persistent\")\n }\n Local<Function> fn = Local<Function>::Cast(g);\n LOGD(\"CP AFTER CAST\")\n Handle<Value> argv[2];\n\n Local<Value> o1 = lhs->cpo.Get(isolate);\n argv[0] = o1;\n LOGD(\"AFTER ARG0\")\n\n Local<Value> o2 = rhs->cpo.Get(isolate);\n argv[1] = o2;\n LOGD(\"ADTER ARG2\")\n\n MaybeLocal<Value> res = fn->Call(Null(isolate), 2, argv);\n if (res.IsEmpty()) {\n LOGD(\"!!!!!!!!!!!!!! BAD FUNCTION CALL. No RESULT !!!!!!!!\")\n return false;\n } else {\n return res.ToLocalChecked()->BooleanValue();\n }\n\n };\n\n hq_ = std::make_shared<HolderQ>(compare);\n}\n\n\nvoid PriorityQ::Init(v8::Local<v8::Object> exports) {\n\n Isolate *isolate = exports->GetIsolate();\n\n // Prepare constructor template\n Local<FunctionTemplate> tpl = FunctionTemplate::New(isolate, New);\n tpl->SetClassName(String::NewFromUtf8(isolate, \"priority_queue_native\"));\n tpl->InstanceTemplate()->SetInternalFieldCount(1);\n\n NODE_SET_PROTOTYPE_METHOD(tpl, \"push\", Push);\n NODE_SET_PROTOTYPE_METHOD(tpl, \"top\", Top);\n NODE_SET_PROTOTYPE_METHOD(tpl, \"pop\", Pop);\n NODE_SET_PROTOTYPE_METHOD(tpl, \"size\", Size);\n NODE_SET_PROTOTYPE_METHOD(tpl, \"next\", Next);\n\n NODE_SET_ITERATOR_METHOD(tpl, GetIterator);\n\n constructor.Reset(isolate, tpl->GetFunction());\n exports->Set(String::NewFromUtf8(isolate, \"PriorityQueue\"),\n tpl->GetFunction());\n\n exports->Set(String::NewFromUtf8(isolate, \"PriorityQueueCompare\"),\n tpl->GetFunction());\n\n}\n\n\nvoid PriorityQ::New(const v8::FunctionCallbackInfo<v8::Value> &args) {\n\n Isolate *isolate = args.GetIsolate();\n\n if (args.IsConstructCall()) {\n PriorityQ *obj;\n // Invoked as constructor\n if (args[0]->IsFunction()) {\n Local<Function> cmp = Local<Function>::Cast(args[0]);\n obj = new PriorityQ(isolate, cmp);\n } else {\n obj = new PriorityQ();\n }\n\n obj->Wrap(args.This());\n args.GetReturnValue().Set(args.This());\n } else {\n\n // Invoked as plain function, turn into construct call.\n const int argc = 1;\n Local<Value> argv[argc] = {args[0]};\n Local<Function> cons = Local<Function>::New(isolate, constructor);\n\n MaybeLocal<Object> o = cons->NewInstance(isolate->GetCurrentContext(), argc, argv);\n args.GetReturnValue().Set(o.ToLocalChecked());\n }\n\n}\n\n\nvoid PriorityQ::Push(const v8::FunctionCallbackInfo<v8::Value> &args) {\n Isolate *isolate = args.GetIsolate();\n PriorityQ *obj = Unwrap<PriorityQ>(args.Holder());\n double d = 0;\n LocalType t;\n Local<Value> lo;\n if (args[0]->IsNumber()) {\n t = LocalType::NUMBER;\n lo = args[0]->ToNumber(isolate);\n } else if (args[0]->IsString()) {\n t = LocalType::STRING;\n lo = args[0]->ToString(isolate);\n } else if (args[0]->IsBoolean()) {\n t = LocalType::BOOLEAN;\n lo = args[0]->ToBoolean(isolate);\n } else {\n t = LocalType::OBJECT;\n lo = args[0]->ToObject(isolate);\n }\n\n\n // Check for second arg requirements\n // its required ONLY if there is no comparator\n if (!obj->hasComparator_) {\n Local<Number> ln = args[1]->ToNumber(isolate);\n d = ln->NumberValue();\n LOGD2(\"~ Adding to hq_ with priority=\", d);\n }\n\n obj->hq_->push(std::make_shared<QObjectHolder>(d, isolate, lo, t));\n LOGD(\"Item pushed to queue\");\n}\n\n\nLocal<Value> PriorityQ::Top_(const v8::FunctionCallbackInfo<v8::Value> &args) {\n\n Isolate *isolate = args.GetIsolate();\n EscapableHandleScope my_handle_scope(isolate);\n PriorityQ *obj = Unwrap<PriorityQ>(args.Holder());\n\n\n // Very important to check size first\n // if queue is empty then calling top and pop\n // will result in segmentation fault\n // wrapping this inside native try/catch will not help\n if (obj->hq_->size() > 0) {\n LOGD(\"Inside Top :: Have items in queue\")\n\n auto top = obj->hq_->top();\n Local<Value> lo = top->cpo.Get(isolate);\n LocalType t = top->T_;\n\n switch (t) {\n case LocalType::NUMBER:\n LOGD(\"RETURNING AS NUMBER\")\n return my_handle_scope.Escape(lo->ToNumber(isolate));\n\n case LocalType::STRING:\n LOGD(\"RETURNING AS STRING\")\n return my_handle_scope.Escape(lo->ToString(isolate));\n\n case LocalType::BOOLEAN:\n LOGD(\"RETURNING AS BOOLEAN\")\n return my_handle_scope.Escape(lo->ToBoolean(isolate));\n\n default:\n LOGD(\"RETURNING AS OBJECT\")\n return my_handle_scope.Escape(lo->ToObject(isolate));\n\n }\n\n } else {\n LOGD(\"NO ITEMS IN QUEUE. WILL RETURN UNDEFINED TO TOP\")\n return my_handle_scope.Escape(Undefined(isolate));\n }\n\n}\n\n\nvoid PriorityQ::Top(const v8::FunctionCallbackInfo<v8::Value> &args) {\n\n args.GetReturnValue().Set(Top_(args));\n\n}\n\n\nvoid PriorityQ::Pop(const v8::FunctionCallbackInfo<v8::Value> &args) {\n LOGD(\"ENTERED POP\");\n PriorityQ *obj = Unwrap<PriorityQ>(args.Holder());\n\n args.GetReturnValue().Set(Top_(args));\n if (obj->hq_->size() > 0) {\n\n obj->hq_->pop();\n }\n\n}\n\n\nvoid PriorityQ::Size(const v8::FunctionCallbackInfo<v8::Value> &args) {\n Isolate *isolate = args.GetIsolate();\n PriorityQ *obj = Unwrap<PriorityQ>(args.Holder());\n\n\n LOGD(\"Looking for size\")\n size_t sz = obj->hq_->size();\n\n args.GetReturnValue().Set(Number::New(isolate, sz));\n}\n\n\nvoid PriorityQ::GetIterator(const v8::FunctionCallbackInfo<v8::Value> &args) {\n\n args.GetReturnValue().Set(args.This());\n}\n\n\nvoid PriorityQ::Next(const FunctionCallbackInfo<Value> &args) {\n\n Isolate *isolate = args.GetIsolate();\n PriorityQ *obj = Unwrap<PriorityQ>(args.Holder());\n\n Local<Object> retObj = Object::New(isolate);\n\n Local<Value> lv;\n\n if (obj->hq_->size() > 0) {\n LOGD(\"Inside Pop :: Have items in queue\")\n lv = Top_(args);\n obj->hq_->pop();\n // now we must create local object with properties that iterator\n // is expected to return\n //\n retObj->Set(String::NewFromUtf8(isolate, ITER_VALUE), lv);\n retObj->Set(String::NewFromUtf8(isolate, ITER_DONE), Boolean::New(isolate, false));\n\n\n } else {\n LOGD(\"ITERATOR::NEXT NO ITEMS IN QUEUE\")\n retObj->Set(String::NewFromUtf8(isolate, ITER_VALUE), Undefined(isolate));\n retObj->Set(String::NewFromUtf8(isolate, ITER_DONE), Boolean::New(isolate, true));\n }\n\n args.GetReturnValue().Set(retObj);\n}\n\n\n// If implementing optional return method of iterator\n// its very important that it returns IteratorResult from it, otherwise\n// some v8 versions will crash.\nvoid PriorityQ::Return(const v8::FunctionCallbackInfo<v8::Value> &args) {\n LOGD(\"^^^^^^^^^^^^^ ITER::Return called ^^^^^^^^^^^^^\");\n Isolate *isolate = args.GetIsolate();\n Local<Object> retObj = Object::New(isolate);\n retObj->Set(String::NewFromUtf8(isolate, ITER_DONE), Boolean::New(isolate, true));\n args.GetReturnValue().Set(retObj);\n}\n\n\nvoid InitAll(Local<Object> exports) {\n PriorityQ::Init(exports);\n}\n\nNODE_MODULE(mypq, InitAll)\n\n\n\n", "meta": {"content_hash": "8e1f35c79a2a3bd0980c13350f82478b", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 117, "avg_line_length": 28.75085324232082, "alnum_prop": 0.6043447293447294, "repo_name": "snytkine/node_priority_queue_native", "id": "7c5034ccfd29d0c9defe8926612c7f11e66f5d01", "size": "8576", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/priorityqueue_native.cpp", "mode": "33188", "license": "mit", "language": [{"name": "C++", "bytes": "14573"}, {"name": "CMake", "bytes": "511"}, {"name": "Python", "bytes": "631"}]}} +{"text": "/*\n This file is part of the WebKit open source project.\n This file has been generated by generate-bindings.pl. DO NOT MODIFY!\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Library General Public\n License as published by the Free Software Foundation; either\n version 2 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Library General Public License for more details.\n\n You should have received a copy of the GNU Library General Public License\n along with this library; see the file COPYING.LIB. If not, write to\n the Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n Boston, MA 02111-1307, USA.\n*/\n\n#include \"config.h\"\n#include \"V8SVGFETurbulenceElement.h\"\n\n#if ENABLE(SVG) && ENABLE(FILTERS)\n\n#include \"CSSMutableStyleDeclaration.h\"\n#include \"ExceptionCode.h\"\n#include \"RuntimeEnabledFeatures.h\"\n#include \"V8Binding.h\"\n#include \"V8BindingMacros.h\"\n#include \"V8BindingState.h\"\n#include \"V8CSSStyleDeclaration.h\"\n#include \"V8CSSValue.h\"\n#include \"V8DOMWrapper.h\"\n#include \"V8IsolatedContext.h\"\n#include \"V8Proxy.h\"\n#include \"V8SVGAnimatedEnumeration.h\"\n#include \"V8SVGAnimatedInteger.h\"\n#include \"V8SVGAnimatedLength.h\"\n#include \"V8SVGAnimatedNumber.h\"\n#include \"V8SVGAnimatedString.h\"\n#include \"V8SVGElement.h\"\n#include <wtf/GetPtr.h>\n#include <wtf/RefCounted.h>\n#include <wtf/RefPtr.h>\n\nnamespace WebCore {\n\nWrapperTypeInfo V8SVGFETurbulenceElement::info = { V8SVGFETurbulenceElement::GetTemplate, V8SVGFETurbulenceElement::derefObject, 0, &V8SVGElement::info };\n\nnamespace SVGFETurbulenceElementInternal {\n\ntemplate <typename T> void V8_USE(T) { }\n\nstatic v8::Handle<v8::Value> baseFrequencyXAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.baseFrequencyX._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->baseFrequencyXAnimated());\n}\n\nstatic v8::Handle<v8::Value> baseFrequencyYAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.baseFrequencyY._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->baseFrequencyYAnimated());\n}\n\nstatic v8::Handle<v8::Value> numOctavesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.numOctaves._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->numOctavesAnimated());\n}\n\nstatic v8::Handle<v8::Value> seedAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.seed._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->seedAnimated());\n}\n\nstatic v8::Handle<v8::Value> stitchTilesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.stitchTiles._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(static_pointer_cast<SVGAnimatedEnumeration>(imp->stitchTilesAnimated()));\n}\n\nstatic v8::Handle<v8::Value> typeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.type._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(static_pointer_cast<SVGAnimatedEnumeration>(imp->typeAnimated()));\n}\n\nstatic v8::Handle<v8::Value> xAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.x._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->xAnimated());\n}\n\nstatic v8::Handle<v8::Value> yAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.y._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->yAnimated());\n}\n\nstatic v8::Handle<v8::Value> widthAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.width._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->widthAnimated());\n}\n\nstatic v8::Handle<v8::Value> heightAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.height._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->heightAnimated());\n}\n\nstatic v8::Handle<v8::Value> resultAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.result._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->resultAnimated());\n}\n\nstatic v8::Handle<v8::Value> classNameAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.className._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->classNameAnimated());\n}\n\nstatic v8::Handle<v8::Value> styleAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.style._get\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(info.Holder());\n return toV8(imp->style());\n}\n\nstatic v8::Handle<v8::Value> getPresentationAttributeCallback(const v8::Arguments& args)\n{\n INC_STATS(\"DOM.SVGFETurbulenceElement.getPresentationAttribute\");\n SVGFETurbulenceElement* imp = V8SVGFETurbulenceElement::toNative(args.Holder());\n STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, name, MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined));\n return toV8(imp->getPresentationAttribute(name));\n}\n\n} // namespace SVGFETurbulenceElementInternal\n\nstatic const BatchedAttribute SVGFETurbulenceElementAttrs[] = {\n // Attribute 'baseFrequencyX' (Type: 'readonly attribute' ExtAttr: '')\n {\"baseFrequencyX\", SVGFETurbulenceElementInternal::baseFrequencyXAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'baseFrequencyY' (Type: 'readonly attribute' ExtAttr: '')\n {\"baseFrequencyY\", SVGFETurbulenceElementInternal::baseFrequencyYAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'numOctaves' (Type: 'readonly attribute' ExtAttr: '')\n {\"numOctaves\", SVGFETurbulenceElementInternal::numOctavesAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'seed' (Type: 'readonly attribute' ExtAttr: '')\n {\"seed\", SVGFETurbulenceElementInternal::seedAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'stitchTiles' (Type: 'readonly attribute' ExtAttr: '')\n {\"stitchTiles\", SVGFETurbulenceElementInternal::stitchTilesAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'type' (Type: 'readonly attribute' ExtAttr: '')\n {\"type\", SVGFETurbulenceElementInternal::typeAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'x' (Type: 'readonly attribute' ExtAttr: '')\n {\"x\", SVGFETurbulenceElementInternal::xAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'y' (Type: 'readonly attribute' ExtAttr: '')\n {\"y\", SVGFETurbulenceElementInternal::yAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'width' (Type: 'readonly attribute' ExtAttr: '')\n {\"width\", SVGFETurbulenceElementInternal::widthAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'height' (Type: 'readonly attribute' ExtAttr: '')\n {\"height\", SVGFETurbulenceElementInternal::heightAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'result' (Type: 'readonly attribute' ExtAttr: '')\n {\"result\", SVGFETurbulenceElementInternal::resultAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'className' (Type: 'readonly attribute' ExtAttr: '')\n {\"className\", SVGFETurbulenceElementInternal::classNameAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n // Attribute 'style' (Type: 'readonly attribute' ExtAttr: '')\n {\"style\", SVGFETurbulenceElementInternal::styleAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},\n};\n\nstatic const BatchedCallback SVGFETurbulenceElementCallbacks[] = {\n {\"getPresentationAttribute\", SVGFETurbulenceElementInternal::getPresentationAttributeCallback},\n};\n\nstatic const BatchedConstant SVGFETurbulenceElementConsts[] = {\n {\"SVG_TURBULENCE_TYPE_UNKNOWN\", static_cast<signed int>(0)},\n {\"SVG_TURBULENCE_TYPE_FRACTALNOISE\", static_cast<signed int>(1)},\n {\"SVG_TURBULENCE_TYPE_TURBULENCE\", static_cast<signed int>(2)},\n {\"SVG_STITCHTYPE_UNKNOWN\", static_cast<signed int>(0)},\n {\"SVG_STITCHTYPE_STITCH\", static_cast<signed int>(1)},\n {\"SVG_STITCHTYPE_NOSTITCH\", static_cast<signed int>(2)},\n};\n\nstatic v8::Persistent<v8::FunctionTemplate> ConfigureV8SVGFETurbulenceElementTemplate(v8::Persistent<v8::FunctionTemplate> desc)\n{\n desc->ReadOnlyPrototype();\n\n v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, \"SVGFETurbulenceElement\", V8SVGElement::GetTemplate(), V8SVGFETurbulenceElement::internalFieldCount,\n SVGFETurbulenceElementAttrs, WTF_ARRAY_LENGTH(SVGFETurbulenceElementAttrs),\n SVGFETurbulenceElementCallbacks, WTF_ARRAY_LENGTH(SVGFETurbulenceElementCallbacks));\n v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();\n v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();\n \n batchConfigureConstants(desc, proto, SVGFETurbulenceElementConsts, WTF_ARRAY_LENGTH(SVGFETurbulenceElementConsts));\n\n // Custom toString template\n desc->Set(getToStringName(), getToStringTemplate());\n return desc;\n}\n\nv8::Persistent<v8::FunctionTemplate> V8SVGFETurbulenceElement::GetRawTemplate()\n{\n V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();\n V8BindingPerIsolateData::TemplateMap::iterator result = data->rawTemplateMap().find(&info);\n if (result != data->rawTemplateMap().end())\n return result->second;\n\n v8::HandleScope handleScope;\n v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();\n data->rawTemplateMap().add(&info, templ);\n return templ;\n}\n\nv8::Persistent<v8::FunctionTemplate> V8SVGFETurbulenceElement::GetTemplate()\n{\n V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();\n V8BindingPerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);\n if (result != data->templateMap().end())\n return result->second;\n\n v8::HandleScope handleScope;\n v8::Persistent<v8::FunctionTemplate> templ =\n ConfigureV8SVGFETurbulenceElementTemplate(GetRawTemplate());\n data->templateMap().add(&info, templ);\n return templ;\n}\n\nbool V8SVGFETurbulenceElement::HasInstance(v8::Handle<v8::Value> value)\n{\n return GetRawTemplate()->HasInstance(value);\n}\n\n\nv8::Handle<v8::Object> V8SVGFETurbulenceElement::wrapSlow(SVGFETurbulenceElement* impl)\n{\n v8::Handle<v8::Object> wrapper;\n V8Proxy* proxy = 0;\n if (impl->document()) {\n proxy = V8Proxy::retrieve(impl->document()->frame());\n if (proxy && static_cast<Node*>(impl->document()) == static_cast<Node*>(impl)) {\n if (proxy->windowShell()->initContextIfNeeded()) {\n // initContextIfNeeded may have created a wrapper for the object, retry from the start.\n return V8SVGFETurbulenceElement::wrap(impl);\n }\n }\n }\n\n\n v8::Handle<v8::Context> context;\n if (proxy)\n context = proxy->context();\n\n // Enter the node's context and create the wrapper in that context.\n if (!context.IsEmpty())\n context->Enter();\n wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);\n // Exit the node's context if it was entered.\n if (!context.IsEmpty())\n context->Exit();\n if (wrapper.IsEmpty())\n return wrapper;\n\n impl->ref();\n v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper);\n\n if (!hasDependentLifetime)\n wrapperHandle.MarkIndependent();\n wrapperHandle.SetWrapperClassId(v8DOMSubtreeClassId);\n getDOMNodeMap().set(impl, wrapperHandle);\n return wrapper;\n}\n\nvoid V8SVGFETurbulenceElement::derefObject(void* object)\n{\n static_cast<SVGFETurbulenceElement*>(object)->deref();\n}\n\n} // namespace WebCore\n\n#endif // ENABLE(SVG) && ENABLE(FILTERS)\n", "meta": {"content_hash": "c86795024df3a1976bbfa5591ff239ed", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 213, "avg_line_length": 47.54081632653061, "alnum_prop": 0.7255491164055233, "repo_name": "Treeeater/WebPermission", "id": "2639810f3f0f575252c83425bb27d61b77f2fe2b", "size": "13977", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src_chrome_Release_obj_global_intermediate_webcore/bindings/V8SVGFETurbulenceElement.cpp", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Assembly", "bytes": "1301"}, {"name": "C", "bytes": "1820540"}, {"name": "C++", "bytes": "38574524"}, {"name": "Java", "bytes": "4882"}, {"name": "JavaScript", "bytes": "2238901"}, {"name": "Objective-C", "bytes": "1768529"}, {"name": "PHP", "bytes": "606"}, {"name": "Perl", "bytes": "699893"}, {"name": "Prolog", "bytes": "142937"}, {"name": "Python", "bytes": "131318"}, {"name": "R", "bytes": "290"}, {"name": "Ruby", "bytes": "3798"}, {"name": "Shell", "bytes": "52312"}]}} +{"text": "\"\"\"\nThe `compat` module provides support for backwards compatibility with older\nversions of Django/Python, and compatibility wrappers around optional packages.\n\"\"\"\n\n# flake8: noqa\nfrom __future__ import unicode_literals\n\nimport inspect\n\nimport django\nfrom django.apps import apps\nfrom django.conf import settings\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.db import connection, models, transaction\nfrom django.template import Context, RequestContext, Template\nfrom django.utils import six\nfrom django.views.generic import View\n\n\ntry:\n from django.urls import (\n NoReverseMatch, RegexURLPattern, RegexURLResolver, ResolverMatch, Resolver404, get_script_prefix, reverse, reverse_lazy, resolve\n )\nexcept ImportError:\n from django.core.urlresolvers import ( # Will be removed in Django 2.0\n NoReverseMatch, RegexURLPattern, RegexURLResolver, ResolverMatch, Resolver404, get_script_prefix, reverse, reverse_lazy, resolve\n )\n\n\ntry:\n import urlparse # Python 2.x\nexcept ImportError:\n import urllib.parse as urlparse\n\n\ndef unicode_repr(instance):\n # Get the repr of an instance, but ensure it is a unicode string\n # on both python 3 (already the case) and 2 (not the case).\n if six.PY2:\n return repr(instance).decode('utf-8')\n return repr(instance)\n\n\ndef unicode_to_repr(value):\n # Coerce a unicode string to the correct repr return type, depending on\n # the Python version. We wrap all our `__repr__` implementations with\n # this and then use unicode throughout internally.\n if six.PY2:\n return value.encode('utf-8')\n return value\n\n\ndef unicode_http_header(value):\n # Coerce HTTP header value to unicode.\n if isinstance(value, six.binary_type):\n return value.decode('iso-8859-1')\n return value\n\n\ndef total_seconds(timedelta):\n # TimeDelta.total_seconds() is only available in Python 2.7\n if hasattr(timedelta, 'total_seconds'):\n return timedelta.total_seconds()\n else:\n return (timedelta.days * 86400.0) + float(timedelta.seconds) + (timedelta.microseconds / 1000000.0)\n\n\ndef distinct(queryset, base):\n if settings.DATABASES[queryset.db][\"ENGINE\"] == \"django.db.backends.oracle\":\n # distinct analogue for Oracle users\n return base.filter(pk__in=set(queryset.values_list('pk', flat=True)))\n return queryset.distinct()\n\n\n# Obtaining manager instances and names from model options differs after 1.10.\ndef get_names_and_managers(options):\n if django.VERSION >= (1, 10):\n # Django 1.10 onwards provides a `.managers` property on the Options.\n return [\n (manager.name, manager)\n for manager\n in options.managers\n ]\n # For Django 1.8 and 1.9, use the three-tuple information provided\n # by .concrete_managers and .abstract_managers\n return [\n (manager_info[1], manager_info[2])\n for manager_info\n in (options.concrete_managers + options.abstract_managers)\n ]\n\n\n# field.rel is deprecated from 1.9 onwards\ndef get_remote_field(field, **kwargs):\n if 'default' in kwargs:\n if django.VERSION < (1, 9):\n return getattr(field, 'rel', kwargs['default'])\n return getattr(field, 'remote_field', kwargs['default'])\n\n if django.VERSION < (1, 9):\n return field.rel\n return field.remote_field\n\n\ndef _resolve_model(obj):\n \"\"\"\n Resolve supplied `obj` to a Django model class.\n\n `obj` must be a Django model class itself, or a string\n representation of one. Useful in situations like GH #1225 where\n Django may not have resolved a string-based reference to a model in\n another model's foreign key definition.\n\n String representations should have the format:\n 'appname.ModelName'\n \"\"\"\n if isinstance(obj, six.string_types) and len(obj.split('.')) == 2:\n app_name, model_name = obj.split('.')\n resolved_model = apps.get_model(app_name, model_name)\n if resolved_model is None:\n msg = \"Django did not return a model for {0}.{1}\"\n raise ImproperlyConfigured(msg.format(app_name, model_name))\n return resolved_model\n elif inspect.isclass(obj) and issubclass(obj, models.Model):\n return obj\n raise ValueError(\"{0} is not a Django model\".format(obj))\n\n\ndef is_authenticated(user):\n if django.VERSION < (1, 10):\n return user.is_authenticated()\n return user.is_authenticated\n\n\ndef is_anonymous(user):\n if django.VERSION < (1, 10):\n return user.is_anonymous()\n return user.is_anonymous\n\n\ndef get_related_model(field):\n if django.VERSION < (1, 9):\n return _resolve_model(field.rel.to)\n return field.remote_field.model\n\n\ndef value_from_object(field, obj):\n if django.VERSION < (1, 9):\n return field._get_val_from_obj(obj)\n return field.value_from_object(obj)\n\n\n# contrib.postgres only supported from 1.8 onwards.\ntry:\n from django.contrib.postgres import fields as postgres_fields\nexcept ImportError:\n postgres_fields = None\n\n\n# JSONField is only supported from 1.9 onwards\ntry:\n from django.contrib.postgres.fields import JSONField\nexcept ImportError:\n JSONField = None\n\n\n# coreapi is optional (Note that uritemplate is a dependency of coreapi)\ntry:\n import coreapi\n import uritemplate\nexcept (ImportError, SyntaxError):\n # SyntaxError is possible under python 3.2\n coreapi = None\n uritemplate = None\n\n\n# coreschema is optional\ntry:\n import coreschema\nexcept ImportError:\n coreschema = None\n\n\n# django-filter is optional\ntry:\n import django_filters\nexcept ImportError:\n django_filters = None\n\n\n# django-crispy-forms is optional\ntry:\n import crispy_forms\nexcept ImportError:\n crispy_forms = None\n\n\n# requests is optional\ntry:\n import requests\nexcept ImportError:\n requests = None\n\n\n# Django-guardian is optional. Import only if guardian is in INSTALLED_APPS\n# Fixes (#1712). We keep the try/except for the test suite.\nguardian = None\ntry:\n if 'guardian' in settings.INSTALLED_APPS:\n import guardian\nexcept ImportError:\n pass\n\n\n# PATCH method is not implemented by Django\nif 'patch' not in View.http_method_names:\n View.http_method_names = View.http_method_names + ['patch']\n\n\n# Markdown is optional\ntry:\n import markdown\n\n if markdown.version <= '2.2':\n HEADERID_EXT_PATH = 'headerid'\n LEVEL_PARAM = 'level'\n elif markdown.version < '2.6':\n HEADERID_EXT_PATH = 'markdown.extensions.headerid'\n LEVEL_PARAM = 'level'\n else:\n HEADERID_EXT_PATH = 'markdown.extensions.toc'\n LEVEL_PARAM = 'baselevel'\n\n def apply_markdown(text):\n \"\"\"\n Simple wrapper around :func:`markdown.markdown` to set the base level\n of '#' style headers to <h2>.\n \"\"\"\n extensions = [HEADERID_EXT_PATH]\n extension_configs = {\n HEADERID_EXT_PATH: {\n LEVEL_PARAM: '2'\n }\n }\n md = markdown.Markdown(\n extensions=extensions, extension_configs=extension_configs\n )\n return md.convert(text)\nexcept ImportError:\n apply_markdown = None\n markdown = None\n\n\ntry:\n import pygments\n from pygments.lexers import get_lexer_by_name\n from pygments.formatters import HtmlFormatter\n\n def pygments_highlight(text, lang, style):\n lexer = get_lexer_by_name(lang, stripall=False)\n formatter = HtmlFormatter(nowrap=True, style=style)\n return pygments.highlight(text, lexer, formatter)\n\n def pygments_css(style):\n formatter = HtmlFormatter(style=style)\n return formatter.get_style_defs('.highlight')\n\nexcept ImportError:\n pygments = None\n\n def pygments_highlight(text, lang, style):\n return text\n\n def pygments_css(style):\n return None\n\n# `separators` argument to `json.dumps()` differs between 2.x and 3.x\n# See: http://bugs.python.org/issue22767\nif six.PY3:\n SHORT_SEPARATORS = (',', ':')\n LONG_SEPARATORS = (', ', ': ')\n INDENT_SEPARATORS = (',', ': ')\nelse:\n SHORT_SEPARATORS = (b',', b':')\n LONG_SEPARATORS = (b', ', b': ')\n INDENT_SEPARATORS = (b',', b': ')\n\ntry:\n # DecimalValidator is unavailable in Django < 1.9\n from django.core.validators import DecimalValidator\nexcept ImportError:\n DecimalValidator = None\n\n\ndef set_rollback():\n if hasattr(transaction, 'set_rollback'):\n if connection.settings_dict.get('ATOMIC_REQUESTS', False):\n # If running in >=1.6 then mark a rollback as required,\n # and allow it to be handled by Django.\n if connection.in_atomic_block:\n transaction.set_rollback(True)\n elif transaction.is_managed():\n # Otherwise handle it explicitly if in managed mode.\n if transaction.is_dirty():\n transaction.rollback()\n transaction.leave_transaction_management()\n else:\n # transaction not managed\n pass\n\n\ndef template_render(template, context=None, request=None):\n \"\"\"\n Passing Context or RequestContext to Template.render is deprecated in 1.9+,\n see https://github.com/django/django/pull/3883 and\n https://github.com/django/django/blob/1.9/django/template/backends/django.py#L82-L84\n\n :param template: Template instance\n :param context: dict\n :param request: Request instance\n :return: rendered template as SafeText instance\n \"\"\"\n if isinstance(template, Template):\n if request:\n context = RequestContext(request, context)\n else:\n context = Context(context)\n return template.render(context)\n # backends template, e.g. django.template.backends.django.Template\n else:\n return template.render(context, request=request)\n\n\ndef set_many(instance, field, value):\n if django.VERSION < (1, 10):\n setattr(instance, field, value)\n else:\n field = getattr(instance, field)\n field.set(value)\n\ndef include(module, namespace=None, app_name=None):\n from django.conf.urls import include\n if django.VERSION < (1,9):\n return include(module, namespace, app_name)\n else:\n return include((module, app_name), namespace)\n", "meta": {"content_hash": "0bdefcfe7929383e99b8e6e17e3d101a", "timestamp": "", "source": "github", "line_count": 347, "max_line_length": 136, "avg_line_length": 29.259365994236312, "alnum_prop": 0.6717226435536294, "repo_name": "BassantMorsi/finderApp", "id": "45ac498417378ba92e6968d4026d473c8dfca7b3", "size": "10153", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "lib/python2.7/site-packages/rest_framework/compat.py", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "220402"}, {"name": "C++", "bytes": "96699"}, {"name": "CSS", "bytes": "84455"}, {"name": "Fortran", "bytes": "7439"}, {"name": "HTML", "bytes": "217197"}, {"name": "JavaScript", "bytes": "365169"}, {"name": "Objective-C", "bytes": "567"}, {"name": "Python", "bytes": "14137616"}, {"name": "Shell", "bytes": "3238"}]}} +{"text": "\n\npackage org.drools.core.base.accumulators;\n\nimport java.io.Externalizable;\nimport java.io.IOException;\nimport java.io.ObjectInput;\nimport java.io.ObjectOutput;\n\n/**\n * An implementation of an accumulator capable of calculating maximum values\n */\npublic class MaxAccumulateFunction extends AbstractAccumulateFunction<MaxAccumulateFunction.MaxData> {\n\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n\n }\n\n public void writeExternal(ObjectOutput out) throws IOException {\n\n }\n\n protected static class MaxData implements Externalizable {\n public Comparable max = null;\n\n public MaxData() {}\n\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n max = (Comparable) in.readObject();\n }\n\n public void writeExternal(ObjectOutput out) throws IOException {\n out.writeObject(max);\n }\n\n @Override\n public String toString() {\n return \"max\";\n }\n }\n\n public MaxData createContext() {\n return new MaxData();\n }\n\n public void init(MaxData data) {\n data.max = null;\n }\n\n public void accumulate(MaxData data,\n Object value) {\n if (value != null) {\n data.max = data.max == null || data.max.compareTo( value ) < 0 ?\n (Comparable) value :\n data.max;\n }\n }\n\n public void reverse(MaxData data,\n Object value) {\n }\n\n public Object getResult(MaxData data) {\n return data.max;\n }\n\n public boolean supportsReverse() {\n return false;\n }\n\n public Class<?> getResultType() {\n return Comparable.class;\n }\n}\n", "meta": {"content_hash": "1562e44275c09a6af042ef699efb7972", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 102, "avg_line_length": 23.783783783783782, "alnum_prop": 0.6102272727272727, "repo_name": "droolsjbpm/drools", "id": "64873471281cc3964259e5d29164d9b26f61aecb", "size": "2380", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "drools-core/src/main/java/org/drools/core/base/accumulators/MaxAccumulateFunction.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2554"}, {"name": "CSS", "bytes": "1412"}, {"name": "GAP", "bytes": "197127"}, {"name": "HTML", "bytes": "9298"}, {"name": "Java", "bytes": "26871006"}, {"name": "Protocol Buffer", "bytes": "13855"}, {"name": "Python", "bytes": "4555"}, {"name": "Ruby", "bytes": "491"}, {"name": "Shell", "bytes": "1120"}, {"name": "Standard ML", "bytes": "82260"}, {"name": "XSLT", "bytes": "24302"}]}} +{"text": "\n\n/**\n * @file safety.c\n * Safety button logic.\n */\n\n#include <px4_config.h>\n\n#include <stdbool.h>\n\n#include <drivers/drv_hrt.h>\n\n#include \"px4io.h\"\n\nstatic struct hrt_call arming_call;\nstatic struct hrt_call failsafe_call;\n\n/*\n * Count the number of times in a row that we see the arming button\n * held down.\n */\nstatic unsigned counter = 0;\n\n/*\n * Define the various LED flash sequences for each system state.\n */\n#define LED_PATTERN_FMU_OK_TO_ARM \t\t0x0003\t\t/**< slow blinking\t\t\t*/\n#define LED_PATTERN_FMU_REFUSE_TO_ARM \t\t0x5555\t\t/**< fast blinking\t\t\t*/\n#define LED_PATTERN_IO_ARMED \t\t\t0x5050\t\t/**< long off, then double blink \t*/\n#define LED_PATTERN_FMU_ARMED \t\t\t0x5500\t\t/**< long off, then quad blink \t\t*/\n#define LED_PATTERN_IO_FMU_ARMED \t\t0xffff\t\t/**< constantly on\t\t\t*/\n\nstatic unsigned blink_counter = 0;\n\n/*\n * IMPORTANT: The arming state machine critically\n * \t depends on using the same threshold\n * for arming and disarming. Since disarming\n * is quite deadly for the system, a similar\n * length can be justified.\n */\n#define ARM_COUNTER_THRESHOLD\t10\n\nstatic bool safety_button_pressed;\n\nstatic void safety_check_button(void *arg);\nstatic void failsafe_blink(void *arg);\n\nvoid\nsafety_init(void)\n{\n\t/* arrange for the button handler to be called at 10Hz */\n\thrt_call_every(&arming_call, 1000, 100000, safety_check_button, NULL);\n}\n\nvoid\nfailsafe_led_init(void)\n{\n\t/* arrange for the failsafe blinker to be called at 8Hz */\n\thrt_call_every(&failsafe_call, 1000, 125000, failsafe_blink, NULL);\n}\n\nstatic void\nsafety_check_button(void *arg)\n{\n\t/*\n\t * Debounce the safety button, change state if it has been held for long enough.\n\t *\n\t */\n\tsafety_button_pressed = BUTTON_SAFETY;\n\n\t/*\n\t * Keep pressed for a while to arm.\n\t *\n\t * Note that the counting sequence has to be same length\n\t * for arming / disarming in order to end up as proper\n\t * state machine, keep ARM_COUNTER_THRESHOLD the same\n\t * length in all cases of the if/else struct below.\n\t */\n\tif (safety_button_pressed && !(r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF) &&\n\t (r_setup_arming & PX4IO_P_SETUP_ARMING_IO_ARM_OK)) {\n\n\t\tif (counter < ARM_COUNTER_THRESHOLD) {\n\t\t\tcounter++;\n\n\t\t} else if (counter == ARM_COUNTER_THRESHOLD) {\n\t\t\t/* switch to armed state */\n\t\t\tr_status_flags |= PX4IO_P_STATUS_FLAGS_SAFETY_OFF;\n\t\t\tcounter++;\n\t\t}\n\n\t} else if (safety_button_pressed && (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF)) {\n\n\t\tif (counter < ARM_COUNTER_THRESHOLD) {\n\t\t\tcounter++;\n\n\t\t} else if (counter == ARM_COUNTER_THRESHOLD) {\n\t\t\t/* change to disarmed state and notify the FMU */\n\t\t\tr_status_flags &= ~PX4IO_P_STATUS_FLAGS_SAFETY_OFF;\n\t\t\tcounter++;\n\t\t}\n\n\t} else {\n\t\tcounter = 0;\n\t}\n\n\t/* Select the appropriate LED flash pattern depending on the current IO/FMU arm state */\n\tuint16_t pattern = LED_PATTERN_FMU_REFUSE_TO_ARM;\n\n\tif (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF) {\n\t\tif (r_setup_arming & PX4IO_P_SETUP_ARMING_FMU_ARMED) {\n\t\t\tpattern = LED_PATTERN_IO_FMU_ARMED;\n\n\t\t} else {\n\t\t\tpattern = LED_PATTERN_IO_ARMED;\n\t\t}\n\n\t} else if (r_setup_arming & PX4IO_P_SETUP_ARMING_FMU_ARMED) {\n\t\tpattern = LED_PATTERN_FMU_ARMED;\n\n\t} else if (r_setup_arming & PX4IO_P_SETUP_ARMING_IO_ARM_OK) {\n\t\tpattern = LED_PATTERN_FMU_OK_TO_ARM;\n\n\t}\n\n\t/* Turn the LED on if we have a 1 at the current bit position */\n\tLED_SAFETY(pattern & (1 << blink_counter++));\n\n\tif (blink_counter > 15) {\n\t\tblink_counter = 0;\n\t}\n}\n\nstatic void\nfailsafe_blink(void *arg)\n{\n\t/* indicate that a serious initialisation error occured */\n\tif (!(r_status_flags & PX4IO_P_STATUS_FLAGS_INIT_OK)) {\n\t\tLED_AMBER(true);\n\t\treturn;\n\t}\n\n\tstatic bool failsafe = false;\n\n\t/* blink the failsafe LED if we don't have FMU input */\n\tif (!(r_status_flags & PX4IO_P_STATUS_FLAGS_FMU_OK)) {\n\t\tfailsafe = !failsafe;\n\n\t} else {\n\t\tfailsafe = false;\n\t}\n\n\tLED_AMBER(failsafe);\n}\n", "meta": {"content_hash": "4a2ea0d2b2a9a3a5d3fccc2d5f4342ba", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 90, "avg_line_length": 24.787096774193547, "alnum_prop": 0.6717855283706403, "repo_name": "darknight-007/Firmware", "id": "f4ab74a45a6c347140b937064aa1ef4876ea7789", "size": "5579", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "src/modules/px4iofirmware/safety.c", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "2610222"}, {"name": "C++", "bytes": "5712694"}, {"name": "CMake", "bytes": "548423"}, {"name": "GDB", "bytes": "785"}, {"name": "Io", "bytes": "241"}, {"name": "Makefile", "bytes": "45018"}, {"name": "Matlab", "bytes": "43628"}, {"name": "Python", "bytes": "646848"}, {"name": "Scilab", "bytes": "1502"}, {"name": "Shell", "bytes": "70591"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!--NewPage-->\n<HTML>\n<HEAD>\n<!-- Generated by javadoc (build 1.5.0_22) on Wed May 30 16:48:33 EEST 2012 -->\n<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<TITLE>\nUses of Class org.apache.wicket.util.tester.DummyPanelPage (Wicket Parent 1.5.7 API)\n</TITLE>\n\n\n<LINK REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"../../../../../../stylesheet.css\" TITLE=\"Style\">\n\n<SCRIPT type=\"text/javascript\">\nfunction windowTitle()\n{\n parent.document.title=\"Uses of Class org.apache.wicket.util.tester.DummyPanelPage (Wicket Parent 1.5.7 API)\";\n}\n</SCRIPT>\n<NOSCRIPT>\n</NOSCRIPT>\n\n</HEAD>\n\n<BODY BGCOLOR=\"white\" onload=\"windowTitle();\">\n\n\n<!-- ========= START OF TOP NAVBAR ======= -->\n<A NAME=\"navbar_top\"><!-- --></A>\n<A HREF=\"#skip-navbar_top\" title=\"Skip navigation links\"></A>\n<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"1\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR>\n<TD COLSPAN=2 BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\">\n<A NAME=\"navbar_top_firstrow\"><!-- --></A>\n<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\" SUMMARY=\"\">\n <TR ALIGN=\"center\" VALIGN=\"top\">\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../overview-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../package-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Package</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../org/apache/wicket/util/tester/DummyPanelPage.html\" title=\"class in org.apache.wicket.util.tester\"><FONT CLASS=\"NavBarFont1\"><B>Class</B></FONT></A> </TD>\n <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Use</B></FONT> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../package-tree.html\"><FONT CLASS=\"NavBarFont1\"><B>Tree</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../deprecated-list.html\"><FONT CLASS=\"NavBarFont1\"><B>Deprecated</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../index-all.html\"><FONT CLASS=\"NavBarFont1\"><B>Index</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../help-doc.html\"><FONT CLASS=\"NavBarFont1\"><B>Help</B></FONT></A> </TD>\n </TR>\n</TABLE>\n</TD>\n<TD ALIGN=\"right\" VALIGN=\"top\" ROWSPAN=3><EM>\n</EM>\n</TD>\n</TR>\n\n<TR>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n PREV \n NEXT</FONT></TD>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n <A HREF=\"../../../../../../index.html?org/apache/wicket/util/tester/class-use/DummyPanelPage.html\" target=\"_top\"><B>FRAMES</B></A> \n <A HREF=\"DummyPanelPage.html\" target=\"_top\"><B>NO FRAMES</B></A> \n <SCRIPT type=\"text/javascript\">\n <!--\n if(window==top) {\n document.writeln('<A HREF=\"../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>');\n }\n //-->\n</SCRIPT>\n<NOSCRIPT>\n <A HREF=\"../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>\n</NOSCRIPT>\n\n\n</FONT></TD>\n</TR>\n</TABLE>\n<A NAME=\"skip-navbar_top\"></A>\n<!-- ========= END OF TOP NAVBAR ========= -->\n\n<HR>\n<CENTER>\n<H2>\n<B>Uses of Class<br>org.apache.wicket.util.tester.DummyPanelPage</B></H2>\n</CENTER>\nNo usage of org.apache.wicket.util.tester.DummyPanelPage\n<P>\n<HR>\n\n\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<A NAME=\"navbar_bottom\"><!-- --></A>\n<A HREF=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></A>\n<TABLE BORDER=\"0\" WIDTH=\"100%\" CELLPADDING=\"1\" CELLSPACING=\"0\" SUMMARY=\"\">\n<TR>\n<TD COLSPAN=2 BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\">\n<A NAME=\"navbar_bottom_firstrow\"><!-- --></A>\n<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"3\" SUMMARY=\"\">\n <TR ALIGN=\"center\" VALIGN=\"top\">\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../overview-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../package-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Package</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../org/apache/wicket/util/tester/DummyPanelPage.html\" title=\"class in org.apache.wicket.util.tester\"><FONT CLASS=\"NavBarFont1\"><B>Class</B></FONT></A> </TD>\n <TD BGCOLOR=\"#FFFFFF\" CLASS=\"NavBarCell1Rev\"> <FONT CLASS=\"NavBarFont1Rev\"><B>Use</B></FONT> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../package-tree.html\"><FONT CLASS=\"NavBarFont1\"><B>Tree</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../deprecated-list.html\"><FONT CLASS=\"NavBarFont1\"><B>Deprecated</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../index-all.html\"><FONT CLASS=\"NavBarFont1\"><B>Index</B></FONT></A> </TD>\n <TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"../../../../../../help-doc.html\"><FONT CLASS=\"NavBarFont1\"><B>Help</B></FONT></A> </TD>\n </TR>\n</TABLE>\n</TD>\n<TD ALIGN=\"right\" VALIGN=\"top\" ROWSPAN=3><EM>\n</EM>\n</TD>\n</TR>\n\n<TR>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n PREV \n NEXT</FONT></TD>\n<TD BGCOLOR=\"white\" CLASS=\"NavBarCell2\"><FONT SIZE=\"-2\">\n <A HREF=\"../../../../../../index.html?org/apache/wicket/util/tester/class-use/DummyPanelPage.html\" target=\"_top\"><B>FRAMES</B></A> \n <A HREF=\"DummyPanelPage.html\" target=\"_top\"><B>NO FRAMES</B></A> \n <SCRIPT type=\"text/javascript\">\n <!--\n if(window==top) {\n document.writeln('<A HREF=\"../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>');\n }\n //-->\n</SCRIPT>\n<NOSCRIPT>\n <A HREF=\"../../../../../../allclasses-noframe.html\"><B>All Classes</B></A>\n</NOSCRIPT>\n\n\n</FONT></TD>\n</TR>\n</TABLE>\n<A NAME=\"skip-navbar_bottom\"></A>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n\n<HR>\nCopyright © 2006-2012 <a href=\"http://apache.org\">Apache Software Foundation</a>. All Rights Reserved.\n</BODY>\n</HTML>\n", "meta": {"content_hash": "c8641c978838a780d9b05db9dc38a548", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 233, "avg_line_length": 43.46808510638298, "alnum_prop": 0.6165769293522597, "repo_name": "afiantara/apache-wicket-1.5.7", "id": "656a7e16f22cd07b917dcbc0126511bd187d4541", "size": "6129", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "apidocs/org/apache/wicket/util/tester/class-use/DummyPanelPage.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Groovy", "bytes": "17122"}, {"name": "Java", "bytes": "10812577"}, {"name": "JavaScript", "bytes": "232484"}]}} +{"text": "layout: post\ndate: 2015-11-27\ntitle: \"Camille La Vie Beaded Mesh Two-Tone Dress Sleeveless Floor-Length Mermaid/Trumpet\"\ncategory: Camille La Vie\ntags: [Camille La Vie,Mermaid/Trumpet,Spaghetti Straps,Floor-Length,Sleeveless]\n---\n### Camille La Vie Beaded Mesh Two-Tone Dress\nJust **$279.99**\n### Sleeveless Floor-Length Mermaid/Trumpet \n<table><tr><td>BRANDS</td><td>Camille La Vie</td></tr><tr><td>Silhouette</td><td>Mermaid/Trumpet</td></tr><tr><td>Neckline</td><td>Spaghetti Straps</td></tr><tr><td>Hemline/Train</td><td>Floor-Length</td></tr><tr><td>Sleeve</td><td>Sleeveless</td></tr></table>\n<a href=\"https://www.readybrides.com/en/camille-la-vie/10191-camille-la-vie-beaded-mesh-two-tone-dress.html\"><img src=\"//img.readybrides.com/23347/camille-la-vie-beaded-mesh-two-tone-dress.jpg\" alt=\"Camille La Vie Beaded Mesh Two-Tone Dress\" style=\"width:100%;\" /></a>\n\n<!-- break --><a href=\"https://www.readybrides.com/en/camille-la-vie/10191-camille-la-vie-beaded-mesh-two-tone-dress.html\"><img src=\"//img.readybrides.com/23346/camille-la-vie-beaded-mesh-two-tone-dress.jpg\" alt=\"Camille La Vie Beaded Mesh Two-Tone Dress\" style=\"width:100%;\" /></a>\nBuy it: [https://www.readybrides.com/en/camille-la-vie/10191-camille-la-vie-beaded-mesh-two-tone-dress.html](https://www.readybrides.com/en/camille-la-vie/10191-camille-la-vie-beaded-mesh-two-tone-dress.html)\n", "meta": {"content_hash": "32cfb1d4c19b5facf3a4c6174d0137bc", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 282, "avg_line_length": 97.35714285714286, "alnum_prop": 0.7351430667644901, "repo_name": "HOLEIN/HOLEIN.github.io", "id": "7a714faf1774f6d00daa209332c1f8094ed3ddf2", "size": "1367", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2015-11-27-Camille-La-Vie-Beaded-Mesh-TwoTone-Dress-Sleeveless-FloorLength-MermaidTrumpet.md", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "83876"}, {"name": "HTML", "bytes": "14547"}, {"name": "Ruby", "bytes": "897"}]}} +{"text": "import React from 'react'\nimport { useLocation } from 'react-router'\n\nimport Modal from 'v2/components/UI/Modal/Portal'\nimport ModalFullscreenDialog from 'v2/components/UI/ModalFullscreenDialog'\nimport { ModalFullBlock } from 'v2/components/ModalFullBlock'\nimport { useParams } from 'react-router'\n\nexport const ModalBlockWrapper: React.FC = () => {\n const location = useLocation()\n const params = useParams()\n\n const state = location.state as any\n const context = state.context\n\n const set = new Set<string>(\n context\n ?.filter(\n k =>\n k?.__typename !== 'Channel' &&\n k?.__typename !== 'Group' &&\n k?.__typename !== 'User' &&\n !!k?.id\n )\n .map(k => k.id.toString())\n )\n\n const ids = Array.from(set)\n\n return (\n <Modal Dialog={ModalFullscreenDialog} bg=\"utility.opaque\">\n <ModalFullBlock id={parseInt(params.id)} ids={ids} />\n </Modal>\n )\n}\n", "meta": {"content_hash": "67d9517c01ffc14b4752ab4dca458196", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 74, "avg_line_length": 26.34285714285714, "alnum_prop": 0.6290672451193059, "repo_name": "aredotna/ervell", "id": "448d862a2d81e6d6e04e61f1d40c6db302ec835f", "size": "922", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/v2/pages/block/ModalBlockWrapper.tsx", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1214"}, {"name": "CoffeeScript", "bytes": "115860"}, {"name": "HTML", "bytes": "808"}, {"name": "JavaScript", "bytes": "589816"}, {"name": "Procfile", "bytes": "70"}, {"name": "Pug", "bytes": "89001"}, {"name": "Shell", "bytes": "1210"}, {"name": "Stylus", "bytes": "49151"}, {"name": "Swift", "bytes": "15963"}, {"name": "TypeScript", "bytes": "1251781"}]}} +{"text": "from led import LED, MAX_BRIGHTNESS\n\n\ndef set_all(num, red, green, blue, brightness=MAX_BRIGHTNESS):\n states = []\n for i in range(num):\n states.append(LED(red, green, blue, brightness))\n return states\n\n\ndef all_off(num):\n return set_all(num, 0, 0, 0, 0)\n", "meta": {"content_hash": "24ce121efb93fb4ba9f2a661efd24f8f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 62, "avg_line_length": 22.75, "alnum_prop": 0.6446886446886447, "repo_name": "DavidAntliff/apa102", "id": "d1828a32dd236378d5b609fee0f852dfe036fa7f", "size": "273", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "led_list.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Python", "bytes": "18505"}]}} +{"text": "================================\nFor this assignment, write an http server that will act as a simple data store. It should respond to GET/POST/PUT/PATCH/DELETE requests for a single resource of your choosing. The data coming in from a post request should be saved to a json file in a data folder in your repository, do not commit your data folder to git. For example if a request is sent to /notes with a body of {noteBody: 'hello world'} the json data in the body should be stored in it's own json file. You can pick a naming scheme for the file but I would recommend using the number of files that you have received so far. Submit as a pull request to your own repository.\n\nRubric:\n\nHandles REST requests: 3pts\n\nJSON storage: 3pts\n\nTests: 2pts\n\nProject Organization and Development Files: 2pts\n", "meta": {"content_hash": "1fd017f40a1a5fc32cd9de307b4774dd", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 641, "avg_line_length": 66.33333333333333, "alnum_prop": 0.75, "repo_name": "kasimsiddiqui/HTTP_server_simple_persistence", "id": "2d3097181ad0c0ae6599518e8a7ee678ced8db98", "size": "829", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "3399"}]}} +{"text": "\ufeff' Licensed to the .NET Foundation under one or more agreements.\n' The .NET Foundation licenses this file to you under the MIT license.\n' See the LICENSE file in the project root for more information.\n\nImports System.Composition\nImports System.Threading\nImports Microsoft.CodeAnalysis.SignatureHelp\nImports Microsoft.CodeAnalysis.VisualBasic.Syntax\nImports Microsoft.CodeAnalysis.VisualBasic.Utilities.IntrinsicOperators\n\nNamespace Microsoft.CodeAnalysis.VisualBasic.SignatureHelp\n <ExportSignatureHelpProvider(\"PredefinedCastExpressionSignatureHelpProvider\", LanguageNames.VisualBasic), [Shared]>\n Partial Friend Class PredefinedCastExpressionSignatureHelpProvider\n Inherits AbstractIntrinsicOperatorSignatureHelpProvider(Of PredefinedCastExpressionSyntax)\n\n <ImportingConstructor>\n Public Sub New()\n End Sub\n\n Protected Overrides Function GetIntrinsicOperatorDocumentationAsync(node As PredefinedCastExpressionSyntax, document As Document, cancellationToken As CancellationToken) As ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))\n Return New ValueTask(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))(GetIntrinsicOperatorDocumentationImplAsync(node, document, cancellationToken))\n End Function\n\n Private Async Function GetIntrinsicOperatorDocumentationImplAsync(node As PredefinedCastExpressionSyntax, document As Document, cancellationToken As CancellationToken) As Task(Of IEnumerable(Of AbstractIntrinsicOperatorDocumentation))\n Return SpecializedCollections.SingletonEnumerable(New PredefinedCastExpressionDocumentation(node.Keyword.Kind, Await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(False)))\n End Function\n\n Protected Overrides Function IsTriggerToken(token As SyntaxToken) As Boolean\n Return token.IsChildToken(Of PredefinedCastExpressionSyntax)(Function(ce) ce.OpenParenToken)\n End Function\n\n Public Overrides Function IsTriggerCharacter(ch As Char) As Boolean\n Return ch = \"(\"c\n End Function\n\n Public Overrides Function IsRetriggerCharacter(ch As Char) As Boolean\n Return ch = \")\"c\n End Function\n\n Protected Overrides Function IsArgumentListToken(node As PredefinedCastExpressionSyntax, token As SyntaxToken) As Boolean\n Return node.Keyword <> token AndAlso\n node.CloseParenToken <> token\n End Function\n End Class\nEnd Namespace\n", "meta": {"content_hash": "7cda3dd24f3eba5bfe688239efcef120", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 249, "avg_line_length": 55.644444444444446, "alnum_prop": 0.7891373801916933, "repo_name": "abock/roslyn", "id": "1a48d05e3573fd6aa77431a7e2f3e064e7c66868", "size": "2506", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Features/VisualBasic/Portable/SignatureHelp/PredefinedCastExpressionSignatureHelpProvider.vb", "mode": "33188", "license": "mit", "language": [{"name": "1C Enterprise", "bytes": "289100"}, {"name": "Batchfile", "bytes": "9059"}, {"name": "C#", "bytes": "126276814"}, {"name": "C++", "bytes": "5602"}, {"name": "CMake", "bytes": "8276"}, {"name": "Dockerfile", "bytes": "2450"}, {"name": "F#", "bytes": "549"}, {"name": "PowerShell", "bytes": "236203"}, {"name": "Shell", "bytes": "94929"}, {"name": "Visual Basic .NET", "bytes": "70520200"}]}} +{"text": "<?php\r\n$test = isset( $_GET['variant-test'] ) ? $_GET['variant-test'] : 'main';\r\nswitch($test){\r\n\tcase 'new':\r\n\t\trequire_once('variant/new.php');\r\n\t\tbreak;\r\n\tcase 'edit':\r\n\t\trequire_once('variant/edit.php');\r\n\t\tbreak;\r\n\tcase 'main':\r\n\tdefault:\r\n\t\trequire_once('variant/variant.php');\r\n\t\tbreak;\r\n}", "meta": {"content_hash": "6cc1dfcef8465141ae16882b31a7aa34", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 72, "avg_line_length": 21.142857142857142, "alnum_prop": 0.5945945945945946, "repo_name": "20steps/alexa", "id": "710d6ae89a30ce9e7a87bad4b436d82c24e0a17d", "size": "296", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/wp-content/plugins/modules/modal/views/variant.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "4889348"}, {"name": "CoffeeScript", "bytes": "8023"}, {"name": "Gherkin", "bytes": "4336"}, {"name": "HTML", "bytes": "357026"}, {"name": "JavaScript", "bytes": "9076289"}, {"name": "PHP", "bytes": "33450039"}, {"name": "Perl", "bytes": "365"}, {"name": "Ruby", "bytes": "3054"}, {"name": "Shell", "bytes": "30158"}, {"name": "TypeScript", "bytes": "35051"}, {"name": "VCL", "bytes": "22958"}, {"name": "XSLT", "bytes": "5437"}]}} +{"text": "clones all public repositories of a github profile to local fs", "meta": {"content_hash": "5afc309e0a962b2f0e5349dc2228df8a", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 62, "avg_line_length": 62.0, "alnum_prop": 0.8387096774193549, "repo_name": "garmann/playground", "id": "fde850d1e75d25d1dc73e6ac35615842f16659f2", "size": "72", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "python/github-repo-checkout/README.md", "mode": "33188", "license": "mit", "language": [{"name": "Dockerfile", "bytes": "394"}, {"name": "Go", "bytes": "2566"}, {"name": "HTML", "bytes": "16705"}, {"name": "JavaScript", "bytes": "5479"}, {"name": "Python", "bytes": "18233"}, {"name": "Ruby", "bytes": "2336"}, {"name": "Shell", "bytes": "1176"}, {"name": "TSQL", "bytes": "1834"}]}} +{"text": "package end2end\n\nimport pb \"github.com/poy/talaria/api/v1\"\n\n//go:generate hel\n\ntype NodeServer interface {\n\tpb.NodeServer\n}\n", "meta": {"content_hash": "64e82398bc0b6e1e2879e86965bde684", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 41, "avg_line_length": 13.777777777777779, "alnum_prop": 0.7580645161290323, "repo_name": "apoydence/loggrebutterfly", "id": "23b140b056383d19bef0714786a31d5ab4ca217e", "size": "124", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "datanode/internal/end2end/doc.go", "mode": "33188", "license": "mit", "language": [{"name": "Go", "bytes": "192742"}, {"name": "Protocol Buffer", "bytes": "2421"}, {"name": "Shell", "bytes": "1219"}]}} +{"text": "package com.github.st1hy.countthemcalories.core.meals;\n\nimport com.github.st1hy.countthemcalories.R;\n\nimport org.joda.time.DateTime;\nimport org.joda.time.DateTimeZone;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.junit.Assert.assertThat;\n\npublic class DefaultNamePlTest {\n\n\n DefaultNamePl defaultNameEn;\n\n @Before\n public void setUp() {\n DateTimeZone.setDefault(DateTimeZone.UTC);\n defaultNameEn = new DefaultNamePl();\n }\n\n @Test\n public void matchDate() throws Exception {\n assertThat(defaultNameEn.matchDate(new DateTime().withTime(8,0,0,0)),\n equalTo(R.string.add_meal_name_breakfast));\n assertThat(defaultNameEn.matchDate(new DateTime().withTime(12,0,0,0)),\n equalTo(R.string.add_meal_name_dinner));\n assertThat(defaultNameEn.matchDate(new DateTime().withTime(16,0,0,0)),\n equalTo(R.string.add_meal_name_dinner));\n assertThat(defaultNameEn.matchDate(new DateTime().withTime(17,0,0,0)),\n equalTo(R.string.add_meal_name_supper));\n assertThat(defaultNameEn.matchDate(new DateTime().withTime(0,0,0,0)),\n equalTo(R.string.add_meal_name_supper));\n }\n\n}", "meta": {"content_hash": "15db395b61576638a7f388920b88fd18", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 78, "avg_line_length": 33.21052631578947, "alnum_prop": 0.6862123613312203, "repo_name": "st1hy/Count-Them-Calories", "id": "ee4897c41e62cb65f4fe0d3db75bb73b20118fc6", "size": "1262", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/src/test/java/com/github/st1hy/countthemcalories/core/meals/DefaultNamePlTest.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "780367"}]}} +{"text": "ACCEPTED\n\n#### According to\nNUB Generator [autonym]\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "89f56c52d78acb06e17e1e8b193afcca", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 23, "avg_line_length": 9.076923076923077, "alnum_prop": 0.6779661016949152, "repo_name": "mdoering/backbone", "id": "60b97884fc7d447b3233bcbb479d7fe6c075e796", "size": "178", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Pteridophyta/Polypodiopsida/Hymenophyllales/Hymenophyllaceae/Hymenophyllum/Hymenophyllum hirsutum/Hymenophyllum ciliatum ciliatum/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ivy-module version=\"2.0\" xmlns:e=\"http://ant.apache.org/ivy/extra\">\n\t<info organisation=\"org.scala-sbt.temp\"\n\t\tmodule=\"temp-module-98ec89c315ed408f615fff2c4774286d17323b01\"\n\t\trevision=\"1.1.7\"\n\t\tstatus=\"integration\"\n\t\tpublication=\"20180731110715\"\n\t/>\n\t<configurations>\n\t\t<conf name=\"compile\" visibility=\"public\" description=\"\"/>\n\t\t<conf name=\"runtime\" visibility=\"public\" description=\"\" extends=\"compile\"/>\n\t\t<conf name=\"test\" visibility=\"public\" description=\"\" extends=\"runtime\"/>\n\t\t<conf name=\"provided\" visibility=\"public\" description=\"\"/>\n\t\t<conf name=\"optional\" visibility=\"public\" description=\"\"/>\n\t</configurations>\n\t<publications>\n\t</publications>\n\t<dependencies>\n\t\t<dependency org=\"org.scala-sbt\" name=\"compiler-bridge_2.12\" rev=\"1.1.7\" conf=\"compile->default(compile)\">\n\t\t\t<artifact name=\"compiler-bridge_2.12\" type=\"src\" ext=\"jar\" conf=\"*\" e:classifier=\"sources\"/>\n\t\t</dependency>\n\t</dependencies>\n</ivy-module>\n", "meta": {"content_hash": "650d078e4607e24c11d53184eac16278", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 107, "avg_line_length": 41.82608695652174, "alnum_prop": 0.7110187110187111, "repo_name": "Bigsby/PoC", "id": "c9218f98e57ff80e3ff80f42283f5e138ff1ec9e", "size": "962", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java/sbting/first-play/target/scala-2.12/resolution-cache/org.scala-sbt.temp/temp-module-98ec89c315ed408f615fff2c4774286d17323b01/1.1.7/resolved.xml.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ASP.NET", "bytes": "1063"}, {"name": "Assembly", "bytes": "1596"}, {"name": "Batchfile", "bytes": "239"}, {"name": "C", "bytes": "3627"}, {"name": "C#", "bytes": "1224655"}, {"name": "C++", "bytes": "3472"}, {"name": "CSS", "bytes": "463261"}, {"name": "Dockerfile", "bytes": "604"}, {"name": "EJS", "bytes": "551"}, {"name": "F#", "bytes": "32014"}, {"name": "Gherkin", "bytes": "306"}, {"name": "HTML", "bytes": "1768740"}, {"name": "Java", "bytes": "6809"}, {"name": "JavaScript", "bytes": "19893309"}, {"name": "Less", "bytes": "82171"}, {"name": "Makefile", "bytes": "1185"}, {"name": "Perl", "bytes": "414"}, {"name": "PowerShell", "bytes": "18992"}, {"name": "Python", "bytes": "9118"}, {"name": "Ruby", "bytes": "953"}, {"name": "Rust", "bytes": "45"}, {"name": "SCSS", "bytes": "80"}, {"name": "Scala", "bytes": "14006"}, {"name": "Shell", "bytes": "469"}, {"name": "TypeScript", "bytes": "89628"}, {"name": "Visual Basic .NET", "bytes": "13131"}, {"name": "Vue", "bytes": "11685"}, {"name": "XSLT", "bytes": "62979"}]}} +{"text": "http_path = \"/\"\ncss_dir = \"css\"\nsass_dir = \"scss\"\nimages_dir = \"images\"\njavascripts_dir = \"js\"\n\n# You can select your preferred output style here (can be overridden via the command line):\noutput_style = :expanded\n\t\t\t #:compressed\n\t\t\t #:compact \n\n# To enable relative paths to assets via compass helper functions. Uncomment:\nrelative_assets = true\n\n# To disable debugging comments that display the original location of your selectors. Uncomment:\n line_comments = false\n\n\n# If you prefer the indented syntax, you might want to regenerate this\n# project again passing --syntax sass, or you can uncomment this:\n# preferred_syntax = :sass\n# and then run:\n# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass\n", "meta": {"content_hash": "067f69a088f73733a1d295232c16214e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 96, "avg_line_length": 31.956521739130434, "alnum_prop": 0.7238095238095238, "repo_name": "jo32/Retina-Sprites-for-Compass", "id": "4e19bf989371379f4f5d7e82f23e9bfcab524f0e", "size": "839", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "demo/config.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "11505"}, {"name": "HTML", "bytes": "563"}, {"name": "Ruby", "bytes": "839"}]}} +{"text": "\ufeffusing System.Collections.Generic;\nusing System.Text;\nusing SchoolSystemLogic.Core;\n\nnamespace SchoolSystemLogic.Commands\n{\n public class StudentListMarksCommand : ICommand\n {\n public string Execute(IList<string> parameters)\n {\n var indexOfTheStudent = int.Parse(parameters[0]);\n var marks = Engine.Students[indexOfTheStudent].ListMarks();\n\n var result = new StringBuilder();\n\n if (marks.Length == 0)\n {\n result.Append(\"This student has no marks.\");\n }\n else\n {\n result.AppendLine(\"The student has these marks:\");\n result.AppendLine(marks);\n }\n\n return result.ToString();\n }\n }\n}\n", "meta": {"content_hash": "9836c370df33b1dc6003136cd33783b3", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 71, "avg_line_length": 26.379310344827587, "alnum_prop": 0.5607843137254902, "repo_name": "RuzmanovDev/Telerik-Academy-Season-2016-2017", "id": "b43a72cd516f2cc472e0798473e24c90fcd9a66b", "size": "767", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Modul-II/01.High-Quality-Code/03.HQC-Part-Two/Exam/SchoolSystem/Exam/SchoolSystemLogic/Commands/StudentListMarksCommand.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "156062"}, {"name": "C#", "bytes": "6854317"}, {"name": "CSS", "bytes": "151173"}, {"name": "CoffeeScript", "bytes": "3700"}, {"name": "HTML", "bytes": "3848453"}, {"name": "JavaScript", "bytes": "2098645"}, {"name": "PowerShell", "bytes": "287"}, {"name": "SQLPL", "bytes": "4671"}, {"name": "XSLT", "bytes": "3306"}]}} +{"text": "<?php\n\nnamespace SilverStripe\\Security;\n\nuse Controller;\nuse Form;\nuse Member;\nuse Object;\n\n/**\n * Abstract base class for an authentication method\n *\n * This class is used as a base class for the different authentication\n * methods like {@link MemberAuthenticator} or {@link OpenIDAuthenticator}.\n *\n * @author Markus Lanthaler <markus@silverstripe.com>\n * @package framework\n * @subpackage security\n */\nabstract class Authenticator extends Object\n{\n\n\t/**\n\t * This variable holds all full namespaced authenticators that should be used\n\t *\n\t * @var array\n\t */\n\tprivate static $authenticators = array('SilverStripe\\Security\\MemberAuthenticator');\n\n\t/**\n\t * Used to influence the order of authenticators on the login-screen\n\t * (default shows first).\n\t *\n\t * @var string\n\t */\n\tprivate static $default_authenticator = 'SilverStripe\\Security\\MemberAuthenticator';\n\n\n\t/**\n\t * Method to authenticate an user\n\t *\n\t * @param array $RAW_data Raw data to authenticate the user\n\t * @param Form $form Optional: If passed, better error messages can be\n\t * produced by using\n\t * {@link Form::sessionMessage()}\n\t *\n\t * @return bool|Member Returns FALSE if authentication fails, otherwise\n\t * the member object\n\t */\n\tpublic static function authenticate($RAW_data, Form $form = null)\n\t{\n\t}\n\n\t/**\n\t * Method that creates the login form for this authentication method\n\t *\n\t * @param Controller $controller The parent controller, necessary to create the\n\t * appropriate form action tag\n\t *\n\t * @return Form Returns the login form to use with this authentication\n\t * method\n\t */\n\tpublic static function get_login_form(Controller $controller)\n\t{\n\t}\n\n\t/**\n\t * Method that creates the re-authentication form for the in-CMS view\n\t *\n\t * @param Controller $controller\n\t */\n\tpublic static function get_cms_login_form(Controller $controller)\n\t{\n\t}\n\n\t/**\n\t * Determine if this authenticator supports in-cms reauthentication\n\t *\n\t * @return bool\n\t */\n\tpublic static function supports_cms()\n\t{\n\t\treturn false;\n\t}\n\n\n\t/**\n\t * Get the name of the authentication method\n\t *\n\t * @return string Returns the name of the authentication method.\n\t */\n\tpublic static function get_name()\n\t{\n\t}\n\n\tpublic static function register($authenticator)\n\t{\n\t\tself::register_authenticator($authenticator);\n\t}\n\n\n\t/**\n\t * Register a new authenticator\n\t *\n\t * The new authenticator has to exist and to be derived from the\n\t * {@link Authenticator}.\n\t * Every authenticator can be registered only once.\n\t *\n\t * @param string $authenticator Name of the authenticator class to\n\t * register\n\t *\n\t * @return bool Returns TRUE on success, FALSE otherwise.\n\t */\n\tpublic static function register_authenticator($authenticator)\n\t{\n\t\t$authenticator = trim($authenticator);\n\n\t\tif (class_exists($authenticator) === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_subclass_of($authenticator, 'Authenticator') === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (in_array($authenticator, self::$authenticators, null) === false) {\n\t\t\tif (call_user_func(array($authenticator, 'on_register')) === true) {\n\t\t\t\tself::$authenticators[] = $authenticator;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic static function unregister($authenticator)\n\t{\n\t\tself::unregister_authenticator($authenticator);\n\t}\n\n\t/**\n\t * Remove a previously registered authenticator\n\t *\n\t * @param string $authenticator Name of the authenticator class to register\n\t *\n\t * @return bool Returns TRUE on success, FALSE otherwise.\n\t */\n\tpublic static function unregister_authenticator($authenticator)\n\t{\n\t\tif (call_user_func(array($authenticator, 'on_unregister')) === true\n\t\t\t&& in_array($authenticator, self::$authenticators, null)\n\t\t) {\n\t\t\tunset(self::$authenticators[array_search($authenticator, self::$authenticators, null)]);\n\t\t}\n\n\t}\n\n\n\t/**\n\t * Check if a given authenticator is registered\n\t *\n\t * @param string $authenticator Name of the authenticator class to check\n\t *\n\t * @return bool Returns TRUE if the authenticator is registered, FALSE\n\t * otherwise.\n\t */\n\tpublic static function is_registered($authenticator)\n\t{\n\t\treturn in_array($authenticator, self::$authenticators, null);\n\t}\n\n\n\t/**\n\t * Get all registered authenticators\n\t *\n\t * @return array Returns an array with the class names of all registered\n\t * authenticators.\n\t */\n\tpublic static function get_authenticators()\n\t{\n\t\t// put default authenticator first (mainly for tab-order on loginform)\n\t\tif ($key = array_search(self::$default_authenticator, self::$authenticators, null)) {\n\t\t\tunset(self::$authenticators[$key]);\n\t\t\tarray_unshift(self::$authenticators, self::$default_authenticator);\n\t\t}\n\n\t\treturn self::$authenticators;\n\t}\n\n\t/**\n\t * Set a default authenticator (shows first in tabs)\n\t *\n\t * @param string\n\t */\n\tpublic static function set_default_authenticator($authenticator)\n\t{\n\t\tself::$default_authenticator = $authenticator;\n\n\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic static function get_default_authenticator()\n\t{\n\t\treturn self::$default_authenticator;\n\t}\n\n\n\t/**\n\t * Callback function that is called when the authenticator is registered\n\t *\n\t * Use this method for initialization of a newly registered authenticator.\n\t * Just overload this method and it will be called when the authenticator\n\t * is registered.\n\t * <b>If the method returns FALSE, the authenticator won't be\n\t * registered!</b>\n\t *\n\t * @return bool Returns TRUE on success, FALSE otherwise.\n\t */\n\tprotected static function on_register()\n\t{\n\t\treturn true;\n\t}\n\n\t/**\n\t * Callback function that is called when an authenticator is removed.\n\t *\n\t * @return bool\n\t */\n\tprotected static function on_unregister()\n\t{\n\t\treturn true;\n\t}\n}\n\n", "meta": {"content_hash": "5633d6e839d8db5ecfdb8a8c160b881b", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 91, "avg_line_length": 24.071428571428573, "alnum_prop": 0.6844126374585443, "repo_name": "CasaLaguna/silverstripe-security", "id": "c1169657f9287ceb93143c97c360cdcad04c39f4", "size": "5729", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code/Authentication/Authenticator.php", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "PHP", "bytes": "386361"}]}} +{"text": "package php.runtime;\n\nimport org.junit.Assert;\nimport org.junit.FixMethodOrder;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.junit.runners.JUnit4;\nimport org.junit.runners.MethodSorters;\nimport php.runtime.memory.*;\n\n@RunWith(JUnit4.class)\n@FixMethodOrder(MethodSorters.NAME_ASCENDING)\npublic class MemoryTest {\n\n @Test\n public void testNull(){\n Memory memory = Memory.NULL;\n\n Assert.assertEquals(Memory.Type.NULL, memory.type);\n Assert.assertFalse(memory.toBoolean());\n Assert.assertEquals(\"\", memory.toString());\n Assert.assertEquals(0.0, memory.toDouble(), 0.000001);\n Assert.assertEquals(0, memory.toLong());\n\n Assert.assertNotNull(memory.toNumeric());\n Assert.assertEquals(Memory.Type.INT, memory.toNumeric().type);\n Assert.assertEquals(0, memory.toNumeric().toLong());\n\n Assert.assertEquals(memory, memory.toImmutable());\n Assert.assertTrue(memory.isImmutable());\n }\n\n @Test\n public void testFalse(){\n Memory memory = Memory.FALSE;\n\n Assert.assertEquals(Memory.Type.BOOL, memory.type);\n Assert.assertFalse(memory.toBoolean());\n Assert.assertEquals(\"\", memory.toString());\n Assert.assertEquals(0.0, memory.toDouble(), 0.000001);\n Assert.assertEquals(0, memory.toLong());\n\n Assert.assertNotNull(memory.toNumeric());\n Assert.assertEquals(Memory.Type.INT, memory.toNumeric().type);\n Assert.assertEquals(0, memory.toNumeric().toLong());\n\n Assert.assertEquals(memory, memory.toImmutable());\n Assert.assertTrue(memory.isImmutable());\n }\n\n @Test\n public void testTrue(){\n Memory memory = Memory.TRUE;\n\n Assert.assertEquals(Memory.Type.BOOL, memory.type);\n Assert.assertTrue(memory.toBoolean());\n Assert.assertEquals(\"1\", memory.toString());\n Assert.assertEquals(1.0, memory.toDouble(), 0.000001);\n Assert.assertEquals(1, memory.toLong());\n\n Assert.assertNotNull(memory.toNumeric());\n Assert.assertEquals(Memory.Type.INT, memory.toNumeric().type);\n Assert.assertEquals(1, memory.toNumeric().toLong());\n\n Assert.assertEquals(memory, memory.toImmutable());\n Assert.assertTrue(memory.isImmutable());\n }\n\n @Test\n public void testLong(){\n LongMemory memory = new LongMemory(100);\n\n Assert.assertEquals(Memory.Type.INT, memory.type);\n Assert.assertTrue(memory.toBoolean());\n Assert.assertEquals(\"100\", memory.toString());\n Assert.assertEquals(100, memory.toDouble(), 0.000001);\n Assert.assertEquals(100, memory.toLong());\n\n Assert.assertNotNull(memory.toNumeric());\n Assert.assertEquals(Memory.Type.INT, memory.toNumeric().type);\n Assert.assertEquals(100, memory.toNumeric().toLong());\n\n Assert.assertEquals(memory, memory.toImmutable());\n Assert.assertTrue(memory.isImmutable());\n }\n\n @Test\n public void testDouble(){\n DoubleMemory memory = new DoubleMemory(50);\n\n Assert.assertEquals(Memory.Type.DOUBLE, memory.type);\n Assert.assertTrue(memory.toBoolean());\n Assert.assertEquals(\"50\", memory.toString());\n Assert.assertEquals(50, memory.toDouble(), 0.000001);\n Assert.assertEquals(50, memory.toLong());\n\n Assert.assertNotNull(memory.toNumeric());\n Assert.assertEquals(Memory.Type.DOUBLE, memory.toNumeric().type);\n Assert.assertEquals(50, memory.toNumeric().toLong());\n\n Assert.assertEquals(memory, memory.toImmutable());\n Assert.assertTrue(memory.isImmutable());\n }\n\n @Test\n public void testString(){\n StringMemory memory = new StringMemory(\"foobar\");\n\n Assert.assertEquals(Memory.Type.STRING, memory.type);\n Assert.assertTrue(memory.toBoolean());\n Assert.assertEquals(\"foobar\", memory.toString());\n Assert.assertEquals(0.0, memory.toDouble(), 0.000001);\n Assert.assertEquals(0, memory.toLong());\n\n Assert.assertNotNull(memory.toNumeric());\n Assert.assertEquals(Memory.Type.INT, memory.toNumeric().type);\n Assert.assertEquals(0, memory.toNumeric().toLong());\n\n Assert.assertEquals(memory, memory.toImmutable());\n Assert.assertTrue(memory.isImmutable());\n\n Assert.assertNull(StringMemory.toLong(\"-\"));\n Assert.assertEquals(-1, StringMemory.toLong(\"-1\").toLong());\n Assert.assertEquals(32, StringMemory.toLong(\"32\").toLong());\n\n Assert.assertTrue(new BinaryMemory(new byte[]{1,2}).toBoolean());\n Assert.assertFalse(new BinaryMemory(new byte[]{}).toBoolean());\n Assert.assertFalse(new BinaryMemory().toBoolean());\n Assert.assertFalse(new BinaryMemory(new byte[]{'0'}).toBoolean());\n\n Assert.assertEquals(StringMemory.valueOf(\"-\").toNumeric().toLong(), 0);\n Assert.assertEquals(StringMemory.valueOf(\"-\").toLong(), 0);\n }\n\n @Test\n public void testReference(){\n ReferenceMemory memory = new ReferenceMemory(Memory.TRUE);\n\n Assert.assertEquals(Memory.Type.REFERENCE, memory.type);\n Assert.assertTrue(memory.toBoolean());\n Assert.assertEquals(\"1\", memory.toString());\n Assert.assertEquals(1, memory.toDouble(), 0.000001);\n Assert.assertEquals(1, memory.toLong());\n\n Assert.assertNotNull(memory.toNumeric());\n Assert.assertEquals(Memory.Type.INT, memory.toNumeric().type);\n Assert.assertEquals(1, memory.toNumeric().toLong());\n\n Assert.assertNotEquals(memory, memory.toImmutable());\n Assert.assertEquals(Memory.TRUE, memory.toImmutable());\n Assert.assertFalse(memory.isImmutable());\n }\n}\n", "meta": {"content_hash": "cc2290b486b161933e9b12a4c53e4943", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 79, "avg_line_length": 37.03921568627451, "alnum_prop": 0.6656079054173284, "repo_name": "jphp-compiler/jphp", "id": "8fd727785024cbdb6904cef7e30d4edb33edeff8", "size": "5667", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jphp-core/tests/php/runtime/MemoryTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2124"}, {"name": "HTML", "bytes": "4259"}, {"name": "Inno Setup", "bytes": "2041"}, {"name": "Java", "bytes": "4396883"}, {"name": "PHP", "bytes": "1570052"}, {"name": "Shell", "bytes": "5234"}]}} +{"text": "package controllers\n\nimport (\n\t\"github.com/revel/examples/chat/app/chatroom\"\n\t\"github.com/revel/revel\"\n)\n\ntype LongPolling struct {\n\t*revel.Controller\n}\n\nfunc (c LongPolling) Room(user string) revel.Result {\n\tchatroom.Join(user)\n\treturn c.Render(user)\n}\n\nfunc (c LongPolling) Say(user, message string) revel.Result {\n\tchatroom.Say(user, message)\n\treturn nil\n}\n\nfunc (c LongPolling) WaitMessages(lastReceived int) revel.Result {\n\tsubscription := chatroom.Subscribe()\n\tdefer subscription.Cancel()\n\n\t// See if anything is new in the archive.\n\tvar events []chatroom.Event\n\tfor _, event := range subscription.Archive {\n\t\tif event.Timestamp > lastReceived {\n\t\t\tevents = append(events, event)\n\t\t}\n\t}\n\n\t// If we found one, grand.\n\tif len(events) > 0 {\n\t\treturn c.RenderJSON(events)\n\t}\n\n\t// Else, wait for something new.\n\tevent := <-subscription.New\n\treturn c.RenderJSON([]chatroom.Event{event})\n}\n\nfunc (c LongPolling) Leave(user string) revel.Result {\n\tchatroom.Leave(user)\n\treturn c.Redirect(Application.Index)\n}\n", "meta": {"content_hash": "4e9e12d93a9c60b9b959157cdbb905cc", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 66, "avg_line_length": 21.425531914893618, "alnum_prop": 0.7239324726911619, "repo_name": "zhyhang/gofirst", "id": "49a238d3f1041c63a492152cdbc23955ad0a0c38", "size": "1007", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "example/revel/chat/app/controllers/longpolling.go", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "2056"}, {"name": "Go", "bytes": "95000"}, {"name": "HTML", "bytes": "10530"}, {"name": "JavaScript", "bytes": "1192"}]}} +{"text": "ACCEPTED\n\n#### According to\nIndex Fungorum\n\n#### Published in\nNuovo Giorn. Bot. Ital. 8: 161 (1892)\n\n#### Original name\nCytospora oleina Berl.\n\n### Remarks\nnull", "meta": {"content_hash": "a79765625d8b2727b7002af9c65a696c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 37, "avg_line_length": 12.307692307692308, "alnum_prop": 0.6875, "repo_name": "mdoering/backbone", "id": "f4a467fe14952d23a5ff507a1d6ca73d02ca5221", "size": "206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Sordariomycetes/Diaporthales/Valsaceae/Cytospora/Cytospora oleina/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "CREATE TABLE `users` (\n\t`id` int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t`access` int NOT NULL DEFAULT 1,\n\t`created` int(10) unsigned NOT NULL,\n\t`last_seen` int(10) unsigned NOT NULL\n) ENGINE='InnoDB';", "meta": {"content_hash": "5823964ee6e3a982725d5ecd1c16311e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 55, "avg_line_length": 34.666666666666664, "alnum_prop": 0.7211538461538461, "repo_name": "daGrevis/daGrevis.lv-PHP", "id": "9226aa667ca66671bd2d474251617a8fb54d085b", "size": "208", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/sql/users.sql", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "3145"}, {"name": "PHP", "bytes": "50433"}, {"name": "Perl", "bytes": "529"}]}} +{"text": "#ifndef _flint_h_\r\n#define _flint_h_\r\n\r\n\r\n#include <math.h>\r\n\r\n/*\r\n\tFor real-time applications you need big integers: the number\r\n\tof recorded samples will exceed the maximum 32-bit signed integer\r\n\tafter only 13.5 hours. So having int64_t would be best,\r\n\tand that is indeed what Praat uses for these same purposes,\r\n\tbut the Vokaturi library has to be able to run with old compilers and linkers.\r\n\tNot all old compilers support int64_t, and not all old linkers\r\n\tsupport 64-bit division without calling external functions.\r\n\tSo we simply employ the type \"double\", which can contain signed integers\r\n\tup to 54 bits.\r\n*/\r\ntypedef double flint;\r\n/*\r\n\tOn these high-precision \"integers\",\r\n\tthe integer division (with its rounding down) and the modulo function\r\n\tcannot be performed with the usual operator symbols for integer types\r\n\t(which are \"/\" and \"%\", respectively),\r\n\tso for those operations we use inline functions instead.\r\n*/\r\ninline static flint flint_div (flint a, flint b) { return floor (a / b); }\r\ninline static flint flint_mod (flint a, flint b) { return a - floor (a / b) * b; }\r\n\r\n/* End of file flint.h */\r\n#endif\r\n", "meta": {"content_hash": "68d3df25c82141c73c7e3d6fb0ac1dab", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 82, "avg_line_length": 37.733333333333334, "alnum_prop": 0.7217314487632509, "repo_name": "equilibrium-catalyst/yadayada-rest-api", "id": "978dfc7f3308bc7a3097e124e2be4b57d0e529a9", "size": "1940", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "restapi/speech/src/flint.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Python", "bytes": "21030"}]}} +{"text": "\ufeffnamespace PetFinder.Data.Migrations\n{\n using System.Data.Entity.Migrations;\n using System.Linq;\n\n public sealed class Configuration : DbMigrationsConfiguration<AppDbContext>\n {\n public Configuration()\n {\n this.AutomaticMigrationsEnabled = true;\n this.AutomaticMigrationDataLossAllowed = false;\n }\n\n protected override void Seed(AppDbContext context)\n {\n if (context.Users.Any())\n {\n return;\n }\n\n var dataSeed = new DataSeed(context); \n dataSeed.SeedRoles();\n dataSeed.SeedAdmin();\n dataSeed.SeedUsers();\n dataSeed.SeedRegions();\n dataSeed.SeedPostCategories();\n dataSeed.SeedPets();\n dataSeed.SeedPostsWithComments(\n context.Users.ToList(), \n context.PostCategories.ToList(), \n context.Pets.ToList(),\n context.Regions.ToList());\n dataSeed.SeedImages(context.Posts.ToList());\n }\n }\n}\n", "meta": {"content_hash": "991f9cb39b01a28858e3f71c18617a1f", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 79, "avg_line_length": 30.02777777777778, "alnum_prop": 0.5504162812210915, "repo_name": "DennyGD/PetFinder", "id": "ce7745cbd097fdea31bc2926bab80a7c0a1ea2ec", "size": "1083", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/Data/PetFinder.Data/Migrations/Configuration.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "104"}, {"name": "C#", "bytes": "232406"}, {"name": "CSS", "bytes": "513"}, {"name": "JavaScript", "bytes": "1116"}]}} +{"text": "using SurgSim::Graphics::OsgTexture1d;\n\nOsgTexture1d::OsgTexture1d() : OsgTexture(new osg::Texture1D())\n{\n}\n\nvoid OsgTexture1d::setSize(int width)\n{\n\tgetOsgTexture1d()->setTextureWidth(width);\n}\n\nvoid OsgTexture1d::getSize(int* width) const\n{\n\t*width = getOsgTexture1d()->getTextureWidth();\n\tif (*width == 0 && getOsgTexture()->getNumImages() > 0)\n\t{\n\t\t*width = getOsgTexture()->getImage(0)->s();\n\t}\n}\n", "meta": {"content_hash": "272594718947a868e6f9dcfae58792f1", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 63, "avg_line_length": 21.157894736842106, "alnum_prop": 0.6965174129353234, "repo_name": "simquest/opensurgsim", "id": "e0263cd888c5839f4b7f04b2b05afa9a4ade5175", "size": "1099", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SurgSim/Graphics/OsgTexture1d.cpp", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "75121"}, {"name": "C++", "bytes": "7422720"}, {"name": "CMake", "bytes": "198446"}, {"name": "GLSL", "bytes": "72925"}, {"name": "JavaScript", "bytes": "2659"}, {"name": "Python", "bytes": "56744"}]}} +{"text": "\npackage com.asakusafw.testdriver.html;\n\nimport static org.hamcrest.Matchers.*;\nimport static org.junit.Assert.*;\n\nimport java.io.File;\nimport java.io.IOException;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TemporaryFolder;\n\nimport com.asakusafw.testdriver.core.DataModelDefinition;\nimport com.asakusafw.testdriver.core.Difference;\nimport com.asakusafw.testdriver.core.DifferenceSink;\nimport com.asakusafw.testdriver.core.DifferenceSinkFactory;\nimport com.asakusafw.testdriver.core.TestContext;\nimport com.asakusafw.testdriver.core.TestToolRepository;\nimport com.asakusafw.testdriver.excel.Simple;\nimport com.asakusafw.testdriver.model.SimpleDataModelDefinition;\n\n/**\n * Test for {@link HtmlDifferenceSinkProvider}.\n */\npublic class HtmlDifferenceSinkProviderTest {\n\n static final DataModelDefinition<Simple> SIMPLE = new SimpleDataModelDefinition<>(Simple.class);\n\n /**\n * temporary folder.\n */\n @Rule\n public final TemporaryFolder temp = new TemporaryFolder();\n\n /**\n * Load the provider via SPI.\n * @throws Exception if failed\n */\n @Test\n public void spi() throws Exception {\n TestToolRepository repo = new TestToolRepository(getClass().getClassLoader());\n\n File file = temp.newFile(\"example.html\");\n file.delete();\n\n DifferenceSinkFactory factory = repo.getDifferenceSinkFactory(file.toURI());\n try (DifferenceSink sink = factory.createSink(SIMPLE, new TestContext.Empty())) {\n Simple expected = new Simple();\n expected.text = \"expected\";\n Simple actual = new Simple();\n actual.text = \"actual\";\n sink.put(new Difference(\n SIMPLE.toReflection(expected),\n SIMPLE.toReflection(actual),\n \"testing\"));\n }\n\n assertThat(file.exists(), is(true));\n }\n\n /**\n * Attempt to load the provider via SPI, but its extension is wrong.\n * @throws Exception if failed\n */\n @Test\n public void spi_wrong_extension() throws Exception {\n TestToolRepository repo = new TestToolRepository(getClass().getClassLoader());\n\n File file = temp.newFile(\"example.invalid\");\n file.delete();\n\n DifferenceSinkFactory factory = repo.getDifferenceSinkFactory(file.toURI());\n try (DifferenceSink sink = factory.createSink(SIMPLE, new TestContext.Empty())) {\n sink.close();\n fail();\n } catch (IOException e) {\n // ok.\n }\n }\n}\n", "meta": {"content_hash": "06ba7d52dc3272f5a8656026c07a2459", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 100, "avg_line_length": 31.19753086419753, "alnum_prop": 0.66798575385833, "repo_name": "akirakw/asakusafw", "id": "f7eb1cebdf6f0b727632f7d81ab06632039a0382", "size": "3139", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "testing-project/asakusa-test-data-provider/src/test/java/com/asakusafw/testdriver/html/HtmlDifferenceSinkProviderTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "31"}, {"name": "CSS", "bytes": "650"}, {"name": "Groovy", "bytes": "275943"}, {"name": "Java", "bytes": "12250766"}, {"name": "Lex", "bytes": "12506"}, {"name": "Shell", "bytes": "10149"}]}} +{"text": "//Love on the web\nvar Love;\nLove = Love || defineLove();\n\n//TODO: Look into Web Audio API for more advanced compatibility\nLove.Audio = (function() {\n function Audio() {\n define(this);\n }\n \n function define(self) {\n var ctx = new AudioContext() || new webkitAudioContext();\n var volNode = ctx.createGain();\n volNode.connect(ctx.destination);\n \n var panNode = ctx.createPanner();\n panNode.connect(volNode);\n \n var orientation = [ 0, 0, -1, 0, 1, 0 ];\n var position = [ 0, 0, 0 ];\n var velocity = [ 0, 0, 0 ];\n \n self.getDistanceModel = function() {\n return panNode.distanceModel;\n };\n \n self.getDopplerScale = function() {\n return 0;\n };\n \n self.getOrientation = function() {\n return orientation;\n };\n \n self.getPosition = function() {\n return position;\n };\n \n self.getSourceCount = function() {\n return 0;\n };\n \n self.getVelocity = function() {\n return velocity;\n };\n \n self.getVolume = function() {\n return volNode.gain.volume;\n };\n \n self.newSource = function(name) {\n return new Love.Audio.Source(name, ctx);\n };\n \n self.pause = function(source) {\n \n };\n \n self.play = function(source) {\n \n };\n \n self.resume = function(source) {\n \n };\n \n self.rewind = function(source) {\n \n };\n \n self.setDistanceModel = function() {\n unimplemented(\"love.audio.setDistanceModel\");\n };\n \n self.setDopplerScale = function() {\n unimplemented(\"love.audio.setDopplerScale\");\n };\n \n self.setOrientation = function() {\n unimplemented(\"love.audio.setOrientation\");\n };\n \n self.setPosition = function() {\n unimplemented(\"love.audio.setPosition\");\n };\n \n self.setVelocity = function() {\n unimplemented(\"love.audio.setVelocity\");\n };\n \n self.setVolume = function(volume) {\n volNode.gain.volume = volume;\n };\n \n self.stop = function(source) {\n \n };\n }\n\n return Audio;\n})();\n\nLove.Audio.Source = (function() {\n function ASource(path, ctx) {\n this.panner = ctx.createPanner();\n \n var req = new XMLHttpRequest();\n req.open(\"GET\", \"lua/\" + path, true);\n req.responseType = \"arraybuffer\";\n req.onload = wrap(this, function(e) {\n ctx.decodeAudioData(req.response, wrap(this, function(buffer) {\n this.buffer = buffer;\n }));\n });\n req.send();\n }\n \n ASource.prototype.clone = function(self) {\n \n };\n \n ASource.prototype.getAttenuationDistance = function(self) {\n unimplemented(\"Source:getAttenuationDistance\");\n };\n \n ASource.prototype.getChannels = function(self) {\n if(self.buffer == null) return 0;\n return self.buffer.numberOfChannels;\n };\n \n ASource.prototype.getCone = function() {\n };\n \n return ASource;\n})();;Love = Love || defineLove();\n\nLove.Color = (function() {\n function Color(r, g, b, a) {\n if (typeof r != \"number\") {\n if(typeof r == \"string\") {\n var d = parseInt(/#([A-Fa-f0-9]*)/.exec(r)[1], 16);\n this.r = d >> 16;\n this.g = (d >> 8) & 255;\n this.b = d & 255;\n this.a = 255;\n } else {\n this.r = r.getMember(1) || 0;\n this.g = r.getMember(2) || 0;\n this.b = r.getMember(3) || 0;\n this.a = r.getMember(4) || 255;\n }\n } else {\n this.r = r || 0;\n this.g = g || 0;\n this.b = b || 0;\n this.a = a || 255;\n }\n //this.as_string = (this.r << 16 | this.g << 8 | this.b).toString(16);\n this.as_string = \"rgb(\" + this.r + \",\" + this.g + \",\" + this.b + \")\";\n }\n\n return Color;\n})();;Love = Love || defineLove();\n\nLove.Event = (function() {\n function Event() {\n define(this);\n this.queue = [];\n }\n\n function define(self) {\n self.clear = function() {\n self.queue = [];\n };\n\n self.push = function(eType, a1, a2, a3, a4) {\n var event = [eType, a1, a2, a3, a4];\n self.queue.push(event);\n };\n\n self.quit = function() {\n self.push(\"quit\");\n };\n\n self.pump = function() { /* Uneeded In JS */ };\n\n self.poll = function() {\n unimplemented(\"love.event.poll\");\n };\n\n self.wait = function() {\n unimplemented(\"love.event.wait\");\n }\n }\n\n return Event;\n})();\n;Love = Love || defineLove();\n\n//Most of FileSystem can't be reinplemented but local storage will help\nLove.FileSystem = (function() {\n function FileSystem() {\n define(this);\n }\n \n function define(self) {\n //Things that will work\n self.append = function(name, data) {\n localStorage[name] += data;\n };\n \n self.areSymlinksEnabled = function() {\n return false;\n };\n \n self.createDirectory = function(name) {\n //Unneeded in JS\n };\n \n self.exists = function(name) {\n return localStorage.getItem(name) != null;\n };\n \n self.getAppdataDirectory = function() {\n return \"\";\n };\n \n self.getDirectoryItems = function(dir) {\n return new shine.Table();\n };\n \n self.getIdentity = function() {\n return \"\"; \n };\n \n self.getSaveDirectory = function() {\n return \"\"; \n };\n \n self.getSourceBaseDirectory = function() {\n return \"\"; \n };\n \n self.getUserDirectory = function() {\n return \"\"; \n };\n \n self.getWorkingDirectory = function() {\n return \"\"; \n };\n \n self.init = function() {\n //Unneeded in JS \n };\n \n self.isDirectory = function(name) {\n return false;\n };\n \n self.isFile = function(name) {\n return typeof localStorage[name] == \"string\";\n };\n \n self.isFused = function() {\n return false;\n };\n \n self.isSymlink = function() {\n return false; \n };\n \n self.lines = function(filename) {\n return new shine.Table(localStorage[filename].split(\"\\n\"));\n };\n \n self.read = function(filename) {\n return localStorage[filename];\n };\n \n self.remove = function(name) {\n localStorage.removeItem(name);\n };\n \n self.write = function(name, data) {\n localStorage.setItem(name, data);\n };\n \n //Things that won't work\n self.getLastModified = function() {\n neverimplemented(\"love.filesystem.getLastModified\"); \n };\n \n self.getRealDirectory = function() {\n neverimplemented(\"love.filesystem.getRealDirectory\");\n };\n \n self.getSize = function() {\n neverimplemented(\"love.filesystem.getSize\"); \n };\n \n self.load = function() {\n neverimplemented(\"love.filesystem.load\"); \n };\n \n self.mount = function() {\n neverimplemented(\"love.filesystem.mount\"); \n };\n \n self.newFile = function() {\n neverimplemented(\"love.filesystem.newFile\");\n };\n \n self.newFileData = function() {\n neverimplemented(\"love.filesystem.newFileData\"); \n };\n \n self.setIdentity = function() {\n neverimplemented(\"love.filsystem.setIdentity\");\n };\n \n self.setSource = function() {\n neverimplemented(\"love.filesystem.setSource\"); \n };\n \n self.setSymlinkEnabled = function() {\n neverimplemented(\"love.filesystem.setSymlinkEnabled\"); \n };\n \n self.unmount = function() {\n neverimplemented(\"love.filesystem.unmount\"); \n };\n }\n\n return FileSystem;\n})();\n;Love = Love || defineLove();\n\nLove.Font = (function() {\n function Font() {\n define(this);\n }\n \n function define(self) {\n self.newGlyphData = function() {\n neverimplemented(\"love.font.newGlyphData\"); \n };\n \n self.newRasterizer = function() {\n neverimplemented(\"love.font.newRasterizer\"); \n };\n }\n\n return Font;\n})();\n;Love = Love || defineLove();\n\nLove.Graphics = (function() {\n function Graphics(width, height) {\n define(this);\n\n if(Love.element == null) {\n this.canvas = new Love.Graphics.Canvas2D(width, height, null, this);\n document.body.appendChild(this.canvas.elem);\n Love.element = this.canvas.elem;\n }\n else {\n this.canvas = new Love.Graphics.Canvas2D(width, height, Love.element, this);\n }\n //Show the canvas that will be on screen\n this.canvas.elem.style.display = \"block\";\n\n this.__mainCanvas = this.canvas;\n this.ctx = this.canvas.ctx;\n this.__matrix = this.canvas.matrix;\n\n this.setColor(255, 255, 255);\n this.setBackgroundColor(0, 0, 0);\n }\n \n function define(self) {\n self.arc = function(mode, x, y, rad, a1, a2, segments) {\n segments = segments || 10;\n var ctx = self.ctx, interval, i, cx, cy;\n ctx.beginPath();\n if(mode == \"fill\") {\n ctx.moveTo(x, y);\n } else { \n ctx.moveTo(x + Math.cos(a1) * rad, y + Math.sin(a1) * rad);\n } \n interval = (a2 - a1) / segments;\n for(i = a1; i <= a2; i += interval) {\n cx = Math.cos(i) * rad + x;\n cy = Math.sin(i) * rad + y;\n ctx.lineTo(cx, cy);\n }\n if(mode == \"fill\") {\n ctx.closePath();\n ctx.fill();\n } else {\n ctx.stroke();\n }\n };\n\n self.circle = function(mode, x, y, rad, segments) {\n if(rad < 0) return;\n self.arc(mode, x, y, rad, 0, Math.PI * 2, segments);\n };\n\n self.clear = function(r, g, b, a) {\n var c, ctx = self.ctx;\n if(r == null) {\n c = self.canvas.backgroundColor;\n } else {\n if(typeof r == \"number\") {\n c = new Love.Color(r, g, b, a);\n } else {\n c = new Love.Color(r);\n }\n }\n if(c.a == 0) { return; }\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.fillStyle = c.as_string;\n ctx.globalAlpha = c.a / 255;\n ctx.fillRect(0, 0, self.canvas.width, self.canvas.height);\n ctx.restore();\n };\n\n self.draw = function(drawable, quad, x, y, r, sx, sy, ox, oy, kx, ky) {\n if(typeof quad == \"number\") {\n __drawWhole(drawable, quad || 0, x || 0, y || 0, r || 1, sx || 1, sy || 0, ox || 0, oy || 0, kx || 0);\n } else {\n __drawWithQuad(drawable, quad, x || 0, y || 0, r || 0, sx || 1, sy || 1, ox || 0, oy || 0, kx || 0, ky || 0);\n }\n };\n \n var __drawWhole = function(drawable, x, y, r, sx, sy, ox, oy, kx, ky) {\n var ctx = self.ctx;\n var c = r == 0 ? 1 : Math.cos(r);\n var s = r == 0 ? 0 : Math.sin(r);\n var matrix = self.__matrix.x($M([\n [sx * c - kx * sy * s, ky * sx * c - sy * s, x - ox],\n [sx * s + kx * sy * c, ky * sx * s + sy * c, y - oy],\n [0, 0, 1 ]\n ]));\n \n ctx.save();\n self.__updateTransform(matrix);\n ctx.drawImage(drawable.elem, 0, 0);\n ctx.restore();\n };\n \n var __drawWithQuad = function(drawable, quad, x, y, r, sx, sy, ox, oy, kx, ky) {\n var ctx = self.ctx, w = drawable.getWidth(), h = drawable.getHeight();\n var c = r == 0 ? 1 : Math.cos(r);\n var s = r == 0 ? 0 : Math.sin(r);\n var matrix = self.__matrix.x($M([\n [sx * c - kx * sy * s, ky * sx * c - sy * s, x - ox],\n [sx * s + kx * sy * c, ky * sx * s + sy * c, y - oy],\n [0, 0, 1 ]\n ]));\n \n ctx.save();\n self.__updateTransform(matrix);\n ctx.drawImage(drawable.elem, quad.x, quad.y, quad.w, quad.h, 0, 0, w, h);\n ctx.restore();\n };\n \n self.line = function(x1, y1, x2, y2) {\n var ctx = self.ctx;\n ctx.beginPath();\n if(typeof x1 == \"number\") {\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n } else {\n ctx.moveTo(x1.getMember(1), x1.getMember(2));\n ctx.lineTo(x1.getMember(3), x1.getMember(4));\n ctx.stroke();\n }\n ctx.closePath();\n };\n \n self.point = function(x, y) {\n self.ctx.fillRect(x, y, 1, 1);\n };\n \n self.polygon = function(mode, verts) {\n var ctx = self.ctx, i, x, y;\n ctx.beginPath();\n ctx.moveTo(verts.getMember(1), verts.getMember(2));\n for(i = 3; i <= verts.__shine.numValues.length; i += 2) {\n x = verts.getMember(i);\n y = verts.getMember(i + 1);\n ctx.lineTo(x, y);\n }\n ctx.closePath();\n if(mode == \"fill\") {\n ctx.fill();\n } else {\n ctx.stroke();\n }\n };\n \n self.present = function() { /*Uneeded in JS*/ };\n \n self.print = function(text, x, y, r, sx, sy, ox, oy, kx, ky) {\n };\n \n self.printf = function(text, x, y, limit, align, r, sx, sy, ox, oy, kx, ky) {\n };\n \n self.rectangle = function(mode, x, y, w, h) {\n if(mode == \"fill\") {\n self.ctx.fillRect(x, y, w, h);\n } else {\n self.ctx.strokeRect(x, y, w, h);\n }\n };\n \n //Transformations\n self.__updateTransform = function(m) {\n var matrix = m || self.__matrix;\n self.ctx.setTransform(matrix.e(1, 1), matrix.e(2, 1), matrix.e(1, 2), matrix.e(2, 2), matrix.e(1, 3), matrix.e(2, 3)); \n };\n \n self.origin = function() {\n self.__matrix = Matrix.I(3);\n self.__updateTransform();\n };\n \n self.pop = function() {\n self.ctx.restore();\n };\n \n self.push = function() {\n self.ctx.save();\n };\n \n self.scale = function(x, y) {\n self.__matrix = self.__matrix.x($M([\n [x, 0, 0],\n [0, y, 0],\n [0, 0, 1]\n ]));\n self.__updateTransform();\n };\n \n self.translate = function(x, y) {\n self.__matrix = self.__matrix.x($M([\n [1, 0, x],\n [0, 1, y],\n [0, 0, 1]\n ]));\n self.__updateTransform();\n };\n \n self.rotate = function(rad) {\n var c = Math.cos(rad);\n var s = Math.sin(rad);\n self.__matrix = self.__matrix.x($M([\n [c, -s, 0],\n [s, c, 0],\n [0, 0, 1]\n ]));\n self.__updateTransform();\n };\n \n self.shear = function(x, y) {\n self.__matrix = self.__matrix.x($M([\n [1, y, 0],\n [x, 1, 0],\n [0, 0, 1]\n ])); \n self.__updateTransform();\n };\n \n //Constructors\n self.newCanvas = function(width, height) {\n return new Love.Graphics.Canvas2D(width, height, this);\n };\n \n self.newImage = function(path) {\n return new Love.Graphics.Image(path); \n };\n \n self.newQuad = function(x, y, w, h, sw, sh) {\n return new Love.Graphics.Quad(x, y, w, h); \n };\n \n self.newFont = function(name, size) {\n return new Love.Graphics.Font(name, size); \n };\n \n self.newImageFont = function(name, glyphs) {\n return new Love.Graphics.ImageFont(name, glyphs); \n };\n \n //Window type things\n self.getWidth = function() {\n return self.canvas.width;\n };\n \n self.getHeight = function() {\n return self.canvas.height;\n };\n \n self.getDimensions = function() {\n return self.canvas.getDimensions();\n };\n\n //State\n //TODO: Implement all state functions\n self.getBackgroundColor = function() {\n var c = self.canvas.backgroundColor;\n return [ c.r, c.g, c.b, c.a ]; \n };\n \n self.getBlendMode = function() {\n var c = self.ctx;\n if(c.globalCompositeOperation == \"source-over\") {\n return \"alpha\";\n } else if(c.globalCompositeOperation == \"multiply\") {\n return \"multiplicative\";\n } else if(c.globalCompositeOperation == \"lighten\") {\n return \"additive\";\n } else {\n return \"normal\";\n }\n };\n \n self.getCanvas = function() {\n return self.canvas; \n };\n \n self.getColor = function() {\n var c = new Love.Color(self.ctx.fillStyle);\n return [c.r, c.g, c.b, self.ctx.globalAlpha * 255];\n };\n \n self.setCanvas = function(canvas) {\n self.canvas = canvas || self.__mainCanvas;\n self.ctx = self.canvas.ctx;\n self.__matrix = self.canvas.matrix;\n self.__updateTransform();\n };\n \n self.setColor = function(r, g, b, a) {\n var c = new Love.Color(r, g, b, a), ctx = self.ctx;\n ctx.fillStyle = c.as_string;\n ctx.strokeStyle = c.as_string;\n ctx.globalAlpha = c.a / 255;\n };\n\n self.setBackgroundColor = function(r, g, b, a) {\n self.canvas.setBackgroundColor(r, g, b, a);\n };\n }\n \n return Graphics;\n})();\n\n\n//TODO: Look at the pull request on punchdrunk for ideas to make this proper\nLove.Graphics.Font = (function() {\n function Font(name, size) {\n define(this);\n \n this.name = name;\n this.size = size;\n \n this.code = size + \"px \" + name;\n }\n \n function define(self) {\n //Most of these functions will not be properly implemented\n self.getAscent = function() {\n return 0;\n };\n \n self.getBaseline = function() {\n return 0;\n };\n \n self.getDescent = function() {\n return 0;\n };\n \n self.getFilter = function() {\n return [\"nearest\", \"nearest\", 1];\n };\n \n self.getHeight = function() {\n return self.size;\n };\n \n self.getLineHeight = function() {\n return self.size;\n };\n \n self.getWidth = function(_, line) {\n unimplemented(\"Font:getWidth\");\n };\n \n self.getWrap = function(_, lines, width) {\n unimplemented(\"Font:getWrap\");\n };\n \n self.hasGlyphs = function() {\n return false; \n };\n \n self.setFilter = function() {\n unimplemented(\"Font:setFilter\");\n };\n \n self.setLineHeight = function() {\n unimplemented(\"Font:setLineHeight\"); \n };\n }\n \n return Font;\n})();\n\nLove.Graphics.ImageFont = (function() {\n function ImageFont(name, glyphs) {\n this.name = name;\n this.glyphs = glyphs;\n this.chars = {};\n \n define(this);\n }\n \n function define(self) {\n new Love.Graphics.Image(self.name, function(img) {\n self.__img = img;\n \n var charwidth = img.getWidth() / self.glyphs.length,\n i;\n for(i = 0; i < self.glyphs.length; i++) {\n self.chars[self.glyphs.charAt(i)] = new Love.Graphics.Quad(i * charwidth, 0, charwidth, img.getHeight());\n }\n });\n \n //Most of these functions will not be properly implemented\n self.getAscent = function() {\n return 0;\n };\n \n self.getBaseline = function() {\n return 0;\n };\n \n self.getDescent = function() {\n return 0; \n };\n \n self.getFilter = function() {\n return [\"nearest\", \"nearest\", 1];\n };\n \n self.getHeight = function() {\n return self.__img.getHeight();\n };\n \n self.getLineHeight = function() {\n return self.__img.getHeight();\n };\n \n self.getWidth = function(_, line) {\n return self.__img.getWidth() / self.glyphs.length;\n };\n \n self.getWrap = function(_, lines, width) {\n unimplemented(\"ImageFont:getWrap\");\n };\n \n self.hasGlyphs = function() {\n return false;\n };\n \n self.setFilter = function() {\n unimplemented(\"ImageFont:setFilter\");\n };\n \n self.setLineHeight = function() {\n unimplemented(\"ImageFont:setLineHeight\");\n };\n }\n \n return ImageFont;\n})();\n\nLove.Graphics.Image = (function() {\n function LImage(path, onload) {\n define(this);\n \n var cFunc = wrap(this, function() {\n if(onload) onload.call(null, this);\n });\n \n if(typeof path == \"string\") {\n this.elem = document.querySelector(\"[src='lua/\"+path+\"']\");\n if(this.elem == null) {\n this.elem = document.createElement(\"img\");\n this.elem.src = \"lua/\" + path;\n this.elem.onload = cFunc;\n } else {\n cFunc.call();\n }\n } else {\n this.elem = document.createElement(\"img\");\n this.elem.src = \"data:image/\" + path.getExtension(path) + \";base64,\" + path.getString(path);\n this.elem.onload = cFunc;\n }\n }\n \n function define(self) {\n self.getData = function() {\n return new shine.Table();\n };\n \n self.getDimensions = function() {\n return [self.elem.width, self.elem.height]; \n };\n \n self.getFilter = function() {\n neverimplemented(\"Image:getFilter\"); \n };\n \n self.getHeight = function() {\n return self.elem.height; \n };\n \n self.getMipmapFilter = function() {\n neverimplemented(\"Image:getMipmapFilter\"); \n };\n \n self.getWidth = function() {\n return self.elem.width; \n };\n \n self.getWrap = function() {\n return \"none\"; \n };\n \n self.isCompressed = function() {\n return false; \n };\n \n self.refresh = function() {\n unimplemented(\"Image:refresh\"); \n };\n \n self.setFilter = function() {\n neverimplemented(\"Image:setFilter\"); \n };\n \n self.setMipmapFilter = function() {\n neverimplemented(\"Image:setMipmapFilter\"); \n };\n \n self.setWrap = function() {\n neverimplemented(\"Image:setWrap\");\n };\n }\n \n return LImage;\n})();\n\nLove.Graphics.Quad = (function() {\n function Quad(x, y, w, h) {\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n }\n \n Quad.prototype.getViewport = function(self) {\n return [self.x, self.y, self.w, self.h];\n };\n \n Quad.prototype.setViewport = function(self, x, y, w, h) {\n self.x = x;\n self.y = y;\n self.w = w;\n self.h = h;\n };\n \n return Quad;\n})();\n\nLove.Graphics.Canvas2D = (function() {\n function Canvas2D(width, height, elem, graphics) {\n define(this, graphics);\n\n this.elem = elem || document.createElement(\"canvas\");\n //Hide canvas by default for off-screen rendering\n this.elem.style.display = \"none\";\n this.setDimensions(width, height);\n \n this.matrix = $M([\n [1, 0, 0],\n [0, 1, 0],\n [0, 0, 1]\n ]);\n\n this.ctx = elem.getContext(\"2d\");\n this.setBackgroundColor(0, 0, 0, 255);\n }\n \n function define(self, graphics) {\n self.getDimensions = function() {\n return [self.width, self.height];\n };\n \n self.getFilter = function() {\n if(self.ctx.imageSmoothingEnabled) {\n return \"linear\";\n } else {\n return \"nearest\";\n }\n };\n \n self.getFormat = function() {\n return \"normal\"; \n };\n \n self.getHeight = function() {\n return self.height;\n };\n \n self.getImageData = function() {\n var data = self.ctx.getImageData(0, 0, self.width, self.height);\n return new ImageData(data);\n };\n \n self.getMSAA = function() {\n return 0; \n };\n \n self.getPixel = function(_, x, y) {\n var data = self.ctx.getImageData(x, y, 1, 1);\n return [data[0], data[1], data[2], data[3]];\n };\n \n self.getWidth = function() {\n return self.width;\n };\n \n self.getWrap = function() {\n return \"none\";\n };\n \n self.renderTo = function(_, func) {\n graphics.setCanvas(self);\n func.call();\n graphics.setCanvas();\n };\n \n self.setFilter = function(_, filter) {\n var smoothing = filter == \"linear\", ctx = self.ctx;\n ctx.imageSmoothingEnabled = smoothing;\n ctx.mozImageSmoothingEnabled = smoothing;\n ctx.webkitImageSmoothingEnabled = smoothing;\n ctx.msImageSmoothingEnabled = smoothing;\n };\n \n self.setWrap = function() {\n unimplemented(\"Canvas:setWrap\"); \n };\n\n //These are non-standard but are used thoughout the engine\n self.setDimensions = function(width, height) {\n self.setWidth(width);\n self.setHeight(height);\n };\n\n self.setWidth = function(width) {\n self.width = width;\n self.elem.setAttribute('width', width);\n };\n\n self.setHeight = function(height) {\n self.height = height;\n self.elem.setAttribute('height', height);\n };\n \n self.setBackgroundColor = function(r, g, b, a) {\n var c = new Love.Color(r, g, b, a);\n self.backgroundColor = c;\n };\n }\n \n return Canvas2D;\n})();\n;Love = Love || defineLove();\n\nLove.Joystick = (function() {\n function Joystick() {\n\n }\n\n return Joystick;\n})();;Love = Love || defineLove();\n\n//TODO: Add key repeating and text-input\nLove.Keyboard = (function() {\n function Keyboard(event) {\n define(this, event);\n }\n \n function define(self, event) {\n var keysDown = {};\n var repeat = false;\n \n document.addEventListener(\"keydown\", function(e) {\n e.preventDefault();\n e.stopPropagation();\n \n key = getKey(e);\n if(keysDown[key] && repeat) {\n event.push(\"keypressed\", key, true);\n }\n if(!keysDown[key] && !repeat) {\n event.push(\"keypressed\", key, false);\n }\n keysDown[key] = true;\n }, true);\n \n document.addEventListener(\"keyup\", function(e) {\n e.preventDefault();\n e.stopPropagation();\n \n key = getKey(e);\n keysDown[key] = false;\n \n event.push(\"keyreleased\", key);\n }, true);\n \n var keys = {\n 8: \"backspace\",\n 9: \"tab\",\n 13: \"return\",\n 16: \"shift\",\n 17: \"ctrl\",\n 18: \"alt\",\n 19: \"pause\", 20: \"capslock\", 27: \"escape\",\n 33: \"pageup\", 34: \"pagedown\", 35: \"end\", 36: \"home\", 45: \"insert\", 46: \"delete\",\n 37: \"left\", 38: \"up\", 39: \"right\", 40: \"down\",\n 91: \"lmeta\", 92: \"rmeta\", 93: \"mode\",\n 96: \"kp0\", 97: \"kp1\", 98: \"kp2\", 99: \"kp3\", 100: \"kp4\", 101: \"kp5\",\n 102: \"kp6\", 103: \"kp7\", 104: \"kp8\", 105: \"kp9\",\n 106: \"kp*\", 107: \"kp+\", 109: \"kp-\", 110: \"kp.\", 111: \"kp/\",\n 112: \"f1\", 113: \"f2\", 114: \"f3\", 115: \"f4\", 116: \"f5\", 117: \"f6\", 118: \"f7\",\n 119: \"f8\", 120: \"f9\", 121: \"f10\", 122: \"f11\", 123: \"f12\",\n 144: \"numlock\", 145: \"scrolllock\",\n 186: \",\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\",\n 219: \"[\", 220: \"\\\\\",221: \"]\", 222: \"'\"\n };\n \n var shiftKeys = {\n 192:\"~\", 48:\")\", 49:\"!\", 50:\"@\", 51:\"#\", 52:\"$\", 53:\"%\", 54:\"^\", 55:\"&\", 56:\"*\", 57:\"(\", 109:\"_\", 61:\"+\",\n 219:\"{\", 221:\"}\", 220:\"|\", 59:\":\", 222:\"\\\"\", 188:\"<\", 189:\">\", 191:\"?\",\n 96:\"insert\", 97:\"end\", 98:\"down\", 99:\"pagedown\", 100:\"left\", 102:\"right\", 103:\"home\", 104:\"up\", 105:\"pageup\"\n };\n \n var rightKeys = {\n 16: \"rshift\", 17: \"rctrl\", 18: \"ralt\"\n };\n \n function getKey(e) {\n var code, key;\n code = e.which;\n if(event.location && event.location > 1) {\n key = rightKeys[code];\n } else if(event.shiftKey) {\n key = shiftKeys[code] || keys[code];\n } else {\n key = keys[code];\n }\n \n if (typeof key == \"undefined\") {\n key = String.fromCharCode(code);\n if(!e.shiftKey) {\n key = key.toLowerCase();\n }\n }\n return key;\n }\n \n self.hasKeyRepeat = function() {\n return repeat;\n };\n \n self.hasTextInput = function() {\n return false;\n };\n \n self.isDown = function(key) {\n if(!keysDown[key]) {\n return false;\n } else {\n return keysDown[key];\n }\n };\n \n self.setKeyRepeat = function(r) {\n repeat = r;\n };\n \n self.setTextInput = function() {\n unimplemented(\"love.keyboard.setTextInput\"); \n };\n \n self.getScancodeFromKey = function() {\n neverimplemented(\"love.keyboard.getScancodeFromKey\"); \n };\n \n self.getKeyFromScancode = function() {\n neverimplemented(\"love.keyboard.getKeyFromScancode\"); \n };\n }\n\n return Keyboard;\n})();;function defineLove() {\n return (function() {\n function Love(elem, conf) {\n wrap = function(t, f) {\n return function() {\n f.apply(t, arguments);\n }\n };\n \n unimplemented = function(name) {\n console.warn(\"[\", name, \"] hasn't been implemented yet\"); \n };\n \n neverimplemented = function(name) {\n console.warn(\"[\", name, \"] can not be implemented in JS\");\n };\n \n elem = elem || null;\n Love.element = elem;\n \n this.graphics = new Love.Graphics(conf.width, conf.height);\n this.event = new Love.Event();\n this.window = new Love.Window(this.graphics, this.event);\n this.audio = new Love.Audio();\n this.filesystem = new Love.FileSystem();\n this.font = new Love.Font();\n this.joystick = new Love.Joystick();\n this.keyboard = new Love.Keyboard(this.event);\n this.math = new Love.Math();\n this.mouse = new Love.Mouse(this.event, this.window);\n this.sound = new Love.Sound();\n this.system = new Love.System();\n this.timer = new Love.Timer();\n \n this.run = wrap(this, this.run);\n }\n \n Love.prototype.load = function() { };\n Love.prototype.update = function() { };\n Love.prototype.draw = function() { };\n Love.prototype.quit = function() { };\n Love.prototype.keypressed = function() { };\n Love.prototype.keyreleased = function() { };\n Love.prototype.mousefocus = function() { };\n Love.prototype.mousemoved = function() { };\n Love.prototype.mousepressed = function() { };\n Love.prototype.mousereleased = function() { };\n Love.prototype.resize = function() { };\n Love.prototype.run = function() {\n this.load.call();\n this.timer.step(); // Step the timer so it doesn't count load time\n \n var i = 0, e;\n var gameloop = (function(self) {\n return function() {\n for(i = 0; i < self.event.queue.length; i++) {\n e = self.event.queue[i];\n self[e[0]].apply(null, e.slice(1, e.length));\n }\n self.event.clear();\n \n self.timer.step();\n self.update.call(null, self.timer.getDelta());\n \n self.graphics.origin()\n self.graphics.clear();\n self.draw.call();\n \n self.timer.nextFrame(gameloop);\n };\n })(this);\n \n this.timer.nextFrame(gameloop);\n };\n Love.prototype.visible = function() { };\n \n return Love;\n })();\n \n};Love = Love || defineLove();\n\nLove.Math = (function() {\n function LMath() {\n define(this);\n }\n \n function define(self) {\n \n }\n\n return LMath;\n})();;Love = Love || defineLove();\n\n//TODO: Implement Pointer-lock api for setGrabbed\nLove.Mouse = (function() {\n function Mouse(event, win) {\n define(this, event, win);\n } \n \n function define(self, event, win) {\n var buttons = {\n \"l\" : false,\n \"m\" : false,\n \"r\" : false,\n \"wd\": false,\n \"wu\": false,\n \"x1\": false,\n \"x2\": false\n };\n \n var love_buttons = [\"l\", \"m\", \"r\", \"x1\", \"x2\"];\n \n var __x = 0;\n var __y = 0;\n var __cursor = new Love.Mouse.Cursor();\n \n Love.element.addEventListener(\"mousedown\", function(e) {\n var x, y, dims, rect = Love.element.getBoundingClientRect();\n e.preventDefault();\n e.stopPropagation();\n x = e.clientX - rect.left;\n y = e.clientY - rect.top;\n if(win.getFullscreen()) {\n dims = win.getDimensions();\n x *= (dims[0] / window.innerWidth);\n y *= (dims[1] / window.innerHeight);\n }\n \n buttons[e.which] = true;\n \n __x = x;\n __y = y;\n event.push(\"mousepressed\", x, y, love_buttons[e.which - 1]);\n }, true);\n \n Love.element.addEventListener(\"mouseup\", function(e) {\n var x, y, dims, rect = Love.element.getBoundingClientRect();\n e.preventDefault();\n e.stopPropagation();\n x = e.clientX - rect.left;\n y = e.clientY - rect.top;\n if(win.getFullscreen()) {\n dims = win.getDimensions();\n x *= (dims[0] / window.innerWidth);\n y *= (dims[1] / window.innerHeight);\n }\n \n buttons[e.which] = false;\n \n __x = x;\n __y = y;\n event.push(\"mousereleased\", x, y, love_buttons[e.which - 1]);\n }, true);\n \n Love.element.addEventListener(\"mousemove\", function(e) {\n var x, y, dims, dx, dy, rect = Love.element.getBoundingClientRect();\n e.preventDefault();\n e.stopPropagation();\n x = e.clientX - rect.left;\n y = e.clientY - rect.top;\n if(win.getFullscreen()) {\n dims = win.getDimensions();\n x *= (dims[0] / window.innerWidth);\n y *= (dims[1] / window.innerHeight);\n }\n dx = x - __x;\n dy = y - __y;\n \n __x = x;\n __y = y;\n event.push(\"mousemoved\", x, y, dx, dy);\n }, true);\n \n Love.element.addEventListener(\"wheel\", function(e) {\n var x, y, dims, rect = Love.element.getBoundingClientRect(), up;\n e.preventDefault();\n e.stopPropagation();\n x = e.clientX - rect.left;\n y = e.clientY - rect.top;\n if(win.getFullscreen()) {\n dims = win.getDimensions();\n x *= (dims[0] / window.innerWidth);\n y *= (dims[1] / window.innerHeight);\n }\n up = e.deltaY < 0;\n event.push(\"mousepressed\", x, y, up ? \"wu\" : \"wd\");\n }, true);\n \n self.getCursor = function() {\n return __cursor;\n };\n \n self.getPosition = function() {\n return [__x, __y]; \n };\n \n self.getRelativeMode = function() {\n return false; \n };\n \n self.getSystemCursor = function(type) {\n return new Love.Mouse.Cursor(type); \n };\n \n self.getX = function() {\n return __x;\n };\n \n self.getY = function() {\n return __y;\n };\n \n self.isDown = function(button) {\n return buttons[button];\n };\n \n self.isGrabbed = function() {\n return false; \n };\n \n self.isVisible = function() {\n return __cursor.__visible;\n };\n \n self.newCursor = function(data) {\n unimplemented(\"love.mouse.newCursor\"); \n };\n \n self.setCursor = function(cursor) {\n __cursor = cursor;\n Love.element.style.cursor = __cursor.__getHtmlType();\n };\n \n self.setGrabbed = function() {\n neverimplemented(\"love.mouse.setGrabbed\"); \n };\n \n self.setPosition = function() {\n neverimplemented(\"love.mouse.setPosition\"); \n };\n \n self.setRelativeMode = function() {\n neverimplemented(\"love.mouse.setRelativeMode\"); \n };\n \n self.setVisible = function(visible) {\n __cursor.__visible = visible;\n Love.element.style.cursor = __cursor.__getHtmlType();\n };\n \n self.setX = function() {\n neverimplemented(\"love.mouse.setX\");\n };\n \n self.setY = function() {\n neverimplemented(\"love.mouse.setY\"); \n };\n }\n\n return Mouse;\n})();\n\nLove.Mouse.Cursor = (function() {\n function Cursor(type, visible) {\n this.type = type || \"arrow\";\n this.__visible = visible != null ? visible : true;\n }\n \n var htmlcursor = {\n \"arrow\" : \"default\",\n \"ibeam\" : \"text\",\n \"wait\" : \"wait\",\n \"waitarrow\" : \"progress\",\n \"crosshair\" : \"crosshair\",\n \"sizenwse\" : \"nwse-resize\",\n \"sizenesw\" : \"nesw-resize\",\n \"sizewe\" : \"ew-resize\",\n \"sizens\" : \"ns-resize\",\n \"sizeall\" : \"move\",\n \"no\" : \"not-allowed\",\n \"hand\" : \"grab\"\n }\n \n Cursor.prototype.__getHtmlType = function() {\n return !this.__visible ? \"none\" : htmlcursor[this.type];\n };\n \n Cursor.prototype.getType = function(self) {\n return self.type;\n };\n \n return Cursor;\n})();;//Ha ha ha ha ha no....;Love = Love || defineLove();\n\nLove.Sound = (function() {\n function Sound() {\n define(this);\n }\n \n function define(self) {\n self.newDecoder = function() {\n neverimplemented(\"love.sound.newDecoder\"); \n };\n \n self.newSoundData = function() {\n neverimplemented(\"love.sound.newSoundData\"); \n };\n }\n\n return Sound;\n})();;Love = Love || defineLove();\n\nLove.System = (function() {\n function System() {\n define(this);\n \n navigator.battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery || navigator.msBattery;\n if(!navigator.battery) {\n //NOTE: This will not update as the program continues\n navigator.getBattery().then(function(battery) {\n navigator.battery = battery; \n });\n }\n }\n \n function define(self) {\n var clipboardText = \"\";\n \n self.getClipboardText = function() {\n return clipboardText;\n };\n \n self.setClipboardText = function(text) {\n clipboardText = text; \n };\n \n self.getOS = function() {\n return \"Web \" + navigator.appVersion;\n };\n \n self.getPowerInfo = function() {\n if(navigator.battery) {\n var state = \"\",\n percent = Math.floor(navigator.battery.level * 100),\n discharge = navigator.battery.dischargingTime;\n if(navigator.battery.charging) {\n if(percent >= 99) {\n state = \"charged\";\n } else {\n state = \"charging\";\n }\n } else {\n state = \"battery\";\n }\n return [state, percent, discharge];\n } else {\n return [\"nobattery\", null, null];\n }\n };\n \n self.getProcessorCount = function() {\n return navigator.hardwareConcurrency || 1;\n };\n \n self.openURL = function(url) {\n window.open(url);\n };\n }\n\n return System;\n})();;Love = Love || defineLove();\n\nLove.Timer = (function() {\n function Timer() {\n define(this);\n \n window.requestAnimationFrame = window.requestAnimationFrame || function(c) {\n setTimeout(c, 60/1000);\n };\n }\n \n function define(self) {\n var dtLimit = 0.25;\n \n var dt = 0;\n var tp = Date.now();\n \n self.getDelta = function() {\n return dt;\n };\n \n self.getTime = function() {\n return tp;\n };\n \n self.getFPS = function() {\n if(dt == 0) { return 0; }\n return 1 / dt;\n };\n \n self.sleep = function() {\n unimplemented(\"love.timer.sleep\"); \n };\n \n self.step = function() {\n var delta = (Date.now() - tp) / 1000;\n dt = Math.max(0, Math.min(dtLimit, delta));\n tp += dt * 1000;\n };\n \n self.nextFrame = function(callback) {\n window.requestAnimationFrame(callback);\n };\n }\n\n return Timer;\n})();;Love = Love || defineLove();\n\nLove.Window = (function() {\n function Window(graphics, event) {\n define(this, graphics);\n \n window.onbeforeunload = function() {\n event.quit();\n };\n \n window.onblur = function() {\n event.push(\"visible\", false);\n event.push(\"mousefocus\", false);\n };\n \n window.onfocus = function() {\n event.push(\"visible\", true);\n event.push(\"mousefocus\", true);\n };\n \n document.oncontextmenu = function(e) {\n e.preventDefault();\n };\n }\n \n function define(self, graphics) {\n var ts = 0;\n var handler = function() {\n var elem = document.fullscreenElement\n || document.mozFullScreenElement\n || document.webkitFullscreenElement\n || document.msFullScreenElement;\n if(elem != Love.element) {\n fullscreen = false;\n self.setFullscreen(false, true);\n } else {\n fullscreen = true;\n }\n };\n document.addEventListener(\"webkitfullscreenchange\", handler, true);\n document.addEventListener(\"mozfullscreenchange\", handler, true);\n document.addEventListener(\"fullscreenchange\", handler, true);\n document.addEventListener(\"MSFullscreenchange\", handler, true);\n \n var fullscreen = false;\n \n self.fromPixels = function() {\n unimplemented(\"love.window.fromPixels\"); \n };\n \n self.getDesktopDimensions = function() {\n return [window.screen.width, window.screen.height];\n };\n \n self.getDimensions = function() {\n return graphics.getDimensions(); \n };\n \n self.getDisplayCount = function() {\n return 1;\n };\n \n self.getDisplayNames = function() {\n return window.document.title; \n };\n \n self.getFullscreen = function() {\n return fullscreen;\n };\n \n self.getFullscreenModes = function() {\n return [ new shine.Table({\n width: window.screen.width,\n height: window.screen.height \n }) ];\n };\n \n self.getHeight = function() {\n return graphics.getHeight(); \n };\n \n self.getIcon = function() {\n unimplemented(\"love.window.getIcon\"); \n };\n \n self.getMode = function() {\n return [self.getWidth(), self.getHeight(), null]; \n };\n \n self.getPixelScale = function() {\n return window.devicePixelRatio; \n };\n \n self.getPosition = function() {\n return [0, 0, 1]; \n };\n \n self.getTitle = function() {\n return window.document.title; \n };\n \n self.getWidth = function() {\n return graphics.getWidth(); \n };\n \n self.hasFocus = function() {\n return document.activeElement == Love.element; \n };\n \n self.hasMouseFocus = function() {\n return document.activeElement == Love.element; \n };\n \n self.isCreated = function() {\n return true; \n };\n \n self.isVisible = function() {\n return true; \n };\n \n self.setFullscreen = function(fs, fromCallback) {\n fromCallback = fromCallback == null ? false : fromCallback;\n if(fs) {\n Love.element.requestFullscreen = Love.element.mozRequestFullScreen\n || Love.element.webkitRequestFullscreen\n || Love.element.msRequestFullscreen\n || Love.element.requestFullscreen;\n document.getElementById(\"fs-text\").setAttribute(\"style\", \"display: block;\");\n document.getElementById(\"fs-btn\").addEventListener(\"click\", function() {\n ts = Date.now();\n Love.element.requestFullscreen();\n var dims = self.getDesktopDimensions();\n Love.element.setAttribute(\"style\", \"width: \" + dims[0] + \"px; height: \" + dims[1] + \"px;\");\n });\n } else {\n document.exitFullscreen = document.exitFullscreen\n || document.mozCancelFullScreen\n || document.webkitExitFullscreen\n || document.msExitFullscreen;\n document.exitFullscreen();\n var dims = self.getDimensions();\n Love.element.setAttribute(\"style\", \"width: \" + dims[0] + \"px; height: \" + dims[1] + \"px;\");\n //Dont remove the message unless the love2d program says to\n if(!fromCallback) {\n document.getElementById(\"fs-text\").setAttribute(\"style\", \"display: none;\");\n document.getElementById(\"fs-btn\").removeEventListener(\"click\", null);\n }\n }\n };\n \n self.setIcon = function() {\n unimplemented(\"love.window.setIcon\"); \n };\n \n self.setMode = function(width, height, flags) {\n graphics.__mainCanvas.setDimensions(width, height);\n if(flags.getMember(\"fullscreen\")) {\n self.setFullscreen(flags.getMember(\"fullscreen\"));\n }\n };\n \n self.setPosition = function(x, y) {\n //Unneeded in JS \n };\n \n self.setTitle = function(title) {\n window.document.title = title; \n };\n \n self.showMessageBox = function(title, message, type, attachtowindow) {\n window.alert(title + \"\\n \" + message); \n };\n \n self.toPixels = function() {\n unimplemented(\"love.window.toPixels\"); \n };\n }\n\n return Window;\n})();\n", "meta": {"content_hash": "51738947df609d3ca9e82f1f2349fc74", "timestamp": "", "source": "github", "line_count": 1722, "max_line_length": 131, "avg_line_length": 29.42624854819977, "alnum_prop": 0.4500710451531418, "repo_name": "brendanfh/love-web", "id": "e7198c6d82261a1f14ccbf82b4ca7c033d76a5a0", "size": "50672", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/love.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "824"}, {"name": "JavaScript", "bytes": "294458"}, {"name": "Lua", "bytes": "1510"}]}} +{"text": "\"\"\"\n Kubernetes\n\n No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)\n\n OpenAPI spec version: v1.6.1\n \n Generated by: https://github.com/swagger-api/swagger-codegen.git\n\"\"\"\n\n\nfrom __future__ import absolute_import\n\nimport os\nimport sys\nimport unittest\n\nimport kubernetes.client\nfrom kubernetes.client.rest import ApiException\nfrom kubernetes.client.models.extensions_v1beta1_deployment_rollback import ExtensionsV1beta1DeploymentRollback\n\n\nclass TestExtensionsV1beta1DeploymentRollback(unittest.TestCase):\n \"\"\" ExtensionsV1beta1DeploymentRollback unit test stubs \"\"\"\n\n def setUp(self):\n pass\n\n def tearDown(self):\n pass\n\n def testExtensionsV1beta1DeploymentRollback(self):\n \"\"\"\n Test ExtensionsV1beta1DeploymentRollback\n \"\"\"\n model = kubernetes.client.models.extensions_v1beta1_deployment_rollback.ExtensionsV1beta1DeploymentRollback()\n\n\nif __name__ == '__main__':\n unittest.main()\n", "meta": {"content_hash": "706052f5d4357e068cdc389fdc624aa2", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 117, "avg_line_length": 25.1, "alnum_prop": 0.7390438247011952, "repo_name": "skuda/client-python", "id": "0a54b2cb12592a727de268f5093fcae0e9a866b1", "size": "1021", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "kubernetes/test/test_extensions_v1beta1_deployment_rollback.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Python", "bytes": "5907789"}, {"name": "Shell", "bytes": "8195"}]}} +{"text": "<resources>\n <string name=\"app_name\">UserGuideLibrary</string>\n</resources>\n", "meta": {"content_hash": "585a3d12bd733597d6a0547746be7cd1", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 53, "avg_line_length": 26.333333333333332, "alnum_prop": 0.7215189873417721, "repo_name": "binarylife/Ydkd", "id": "07be03c67f6be7890f8e8c32517df94f16108a3d", "size": "79", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/UserGuide/src/main/res/values/strings.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "902080"}]}} +{"text": "package govaluate\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\t\"unicode\"\n)\n\n/*\n\tRepresents a test of parsing all tokens correctly from a string\n*/\ntype TokenParsingTest struct {\n\tName string\n\tInput string\n\tFunctions map[string]ExpressionFunction\n\tExpected []ExpressionToken\n}\n\nfunc TestConstantParsing(test *testing.T) {\n\n\ttokenParsingTests := []TokenParsingTest{\n\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single numeric\",\n\t\t\tInput: \"1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single two-digit numeric\",\n\t\t\tInput: \"50\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 50.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Zero\",\n\t\t\tInput: \"0\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 0.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"One digit hex\",\n\t\t\tInput: \"0x1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Two digit hex\",\n\t\t\tInput: \"0x10\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 16.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Hex with lowercase\",\n\t\t\tInput: \"0xabcdef\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 11259375.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Hex with uppercase\",\n\t\t\tInput: \"0xABCDEF\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 11259375.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single string\",\n\t\t\tInput: \"'foo'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single time, RFC3339, only date\",\n\t\t\tInput: \"'2014-01-02'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: TIME,\n\t\t\t\t\tValue: time.Date(2014, time.January, 2, 0, 0, 0, 0, time.Local),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single time, RFC3339, with hh:mm\",\n\t\t\tInput: \"'2014-01-02 14:12'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: TIME,\n\t\t\t\t\tValue: time.Date(2014, time.January, 2, 14, 12, 0, 0, time.Local),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single time, RFC3339, with hh:mm:ss\",\n\t\t\tInput: \"'2014-01-02 14:12:22'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: TIME,\n\t\t\t\t\tValue: time.Date(2014, time.January, 2, 14, 12, 22, 0, time.Local),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single boolean\",\n\t\t\tInput: \"true\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: true,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single large numeric\",\n\t\t\tInput: \"1234567890\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1234567890.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single floating-point\",\n\t\t\tInput: \"0.5\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 0.5,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single large floating point\",\n\t\t\tInput: \"3.14567471\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 3.14567471,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single false boolean\",\n\t\t\tInput: \"false\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: false,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Single internationalized string\",\n\t\t\tInput: \"'\u00c6\u0166\u01fd\u0d08\u16a5\u0b87\u0e04\u0678'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"\u00c6\u0166\u01fd\u0d08\u16a5\u0b87\u0e04\u0678\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Single internationalized parameter\",\n\t\t\tInput: \"\u00c6\u0166\u01fd\u0d08\u16a5\u0b87\u0e04\u0678\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"\u00c6\u0166\u01fd\u0d08\u16a5\u0b87\u0e04\u0678\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Parameterless function\",\n\t\t\tInput: \"foo()\",\n\t\t\tFunctions: map[string]ExpressionFunction{\"foo\": noop},\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: FUNCTION,\n\t\t\t\t\tValue: noop,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Single parameter function\",\n\t\t\tInput: \"foo('bar')\",\n\t\t\tFunctions: map[string]ExpressionFunction{\"foo\": noop},\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: FUNCTION,\n\t\t\t\t\tValue: noop,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"bar\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Multiple parameter function\",\n\t\t\tInput: \"foo('bar', 1.0)\",\n\t\t\tFunctions: map[string]ExpressionFunction{\"foo\": noop},\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: FUNCTION,\n\t\t\t\t\tValue: noop,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"bar\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: SEPARATOR,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Nested function\",\n\t\t\tInput: \"foo(foo('bar'), 1.0, foo(2.0))\",\n\t\t\tFunctions: map[string]ExpressionFunction{\"foo\": noop},\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: FUNCTION,\n\t\t\t\t\tValue: noop,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: FUNCTION,\n\t\t\t\t\tValue: noop,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"bar\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: SEPARATOR,\n\t\t\t\t},\n\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: SEPARATOR,\n\t\t\t\t},\n\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: FUNCTION,\n\t\t\t\t\tValue: noop,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 2.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Function with modifier afterwards (#28)\",\n\t\t\tInput: \"foo() + 1\",\n\t\t\tFunctions: map[string]ExpressionFunction{\"foo\": noop},\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: FUNCTION,\n\t\t\t\t\tValue: noop,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"+\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Function with modifier afterwards and comparator\",\n\t\t\tInput: \"(foo()-1) > 3\",\n\t\t\tFunctions: map[string]ExpressionFunction{\"foo\": noop},\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: FUNCTION,\n\t\t\t\t\tValue: noop,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"-\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \">\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 3.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Double-quoted string added to square-brackted param (#59)\",\n\t\t\tInput: \"\\\"a\\\" + [foo]\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"a\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"+\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Accessor variable\",\n\t\t\tInput: \"foo.Var\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: ACCESSOR,\n\t\t\t\t\tValue: []string{\"foo\", \"Var\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\t\t\tName: \"Accessor function\",\n\t\t\tInput: \"foo.Operation()\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: ACCESSOR,\n\t\t\t\t\tValue: []string{\"foo\", \"Operation\"},\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\ttokenParsingTests = combineWhitespaceExpressions(tokenParsingTests)\n\trunTokenParsingTest(tokenParsingTests, test)\n}\n\nfunc TestLogicalOperatorParsing(test *testing.T) {\n\n\ttokenParsingTests := []TokenParsingTest{\n\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Boolean AND\",\n\t\t\tInput: \"true && false\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: true,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: LOGICALOP,\n\t\t\t\t\tValue: \"&&\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: false,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Boolean OR\",\n\t\t\tInput: \"true || false\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: true,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: LOGICALOP,\n\t\t\t\t\tValue: \"||\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: false,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Multiple logical operators\",\n\t\t\tInput: \"true || false && true\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: true,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: LOGICALOP,\n\t\t\t\t\tValue: \"||\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: false,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: LOGICALOP,\n\t\t\t\t\tValue: \"&&\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: true,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\ttokenParsingTests = combineWhitespaceExpressions(tokenParsingTests)\n\trunTokenParsingTest(tokenParsingTests, test)\n}\n\nfunc TestComparatorParsing(test *testing.T) {\n\n\ttokenParsingTests := []TokenParsingTest{\n\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric EQ\",\n\t\t\tInput: \"1 == 2\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"==\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 2.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric NEQ\",\n\t\t\tInput: \"1 != 2\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"!=\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 2.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric GT\",\n\t\t\tInput: \"1 > 0\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \">\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 0.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric LT\",\n\t\t\tInput: \"1 < 2\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"<\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 2.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric GTE\",\n\t\t\tInput: \"1 >= 2\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \">=\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 2.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric LTE\",\n\t\t\tInput: \"1 <= 2\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"<=\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 2.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"String LT\",\n\t\t\tInput: \"'ab.cd' < 'abc.def'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"ab.cd\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"<\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"abc.def\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"String LTE\",\n\t\t\tInput: \"'ab.cd' <= 'abc.def'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"ab.cd\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"<=\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"abc.def\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"String GT\",\n\t\t\tInput: \"'ab.cd' > 'abc.def'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"ab.cd\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \">\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"abc.def\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"String GTE\",\n\t\t\tInput: \"'ab.cd' >= 'abc.def'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"ab.cd\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \">=\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"abc.def\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"String REQ\",\n\t\t\tInput: \"'foobar' =~ 'bar'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foobar\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"=~\",\n\t\t\t\t},\n\n\t\t\t\t// it's not particularly clean to test for the contents of a pattern, (since it means modifying the harness below)\n\t\t\t\t// so pattern contents are left untested.\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: PATTERN,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"String NREQ\",\n\t\t\tInput: \"'foobar' !~ 'bar'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foobar\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"!~\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: PATTERN,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Comparator against modifier string additive (#22)\",\n\t\t\tInput: \"'foo' == '+'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"==\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"+\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Comparator against modifier string multiplicative (#22)\",\n\t\t\tInput: \"'foo' == '/'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"==\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"/\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Comparator against modifier string exponential (#22)\",\n\t\t\tInput: \"'foo' == '**'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"==\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"**\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Comparator against modifier string bitwise (#22)\",\n\t\t\tInput: \"'foo' == '^'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"==\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"^\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Comparator against modifier string shift (#22)\",\n\t\t\tInput: \"'foo' == '>>'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"==\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \">>\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Comparator against modifier string ternary (#22)\",\n\t\t\tInput: \"'foo' == '?'\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"==\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"?\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Array membership lowercase\",\n\t\t\tInput: \"'foo' in ('foo', 'bar')\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"in\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: SEPARATOR,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"bar\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Array membership uppercase\",\n\t\t\tInput: \"'foo' IN ('foo', 'bar')\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"in\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: SEPARATOR,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"bar\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: CLAUSE_CLOSE,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\ttokenParsingTests = combineWhitespaceExpressions(tokenParsingTests)\n\trunTokenParsingTest(tokenParsingTests, test)\n}\n\nfunc TestModifierParsing(test *testing.T) {\n\n\ttokenParsingTests := []TokenParsingTest{\n\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric PLUS\",\n\t\t\tInput: \"1 + 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"+\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric MINUS\",\n\t\t\tInput: \"1 - 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"-\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric MULTIPLY\",\n\t\t\tInput: \"1 * 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"*\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric DIVIDE\",\n\t\t\tInput: \"1 / 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"/\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric MODULUS\",\n\t\t\tInput: \"1 % 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"%\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric BITWISE_AND\",\n\t\t\tInput: \"1 & 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"&\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric BITWISE_OR\",\n\t\t\tInput: \"1 | 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"|\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric BITWISE_XOR\",\n\t\t\tInput: \"1 ^ 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"^\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric BITWISE_LSHIFT\",\n\t\t\tInput: \"1 << 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \"<<\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Numeric BITWISE_RSHIFT\",\n\t\t\tInput: \"1 >> 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: MODIFIER,\n\t\t\t\t\tValue: \">>\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\ttokenParsingTests = combineWhitespaceExpressions(tokenParsingTests)\n\trunTokenParsingTest(tokenParsingTests, test)\n}\n\nfunc TestPrefixParsing(test *testing.T) {\n\n\ttestCases := []TokenParsingTest{\n\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Sign prefix\",\n\t\t\tInput: \"-1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: PREFIX,\n\t\t\t\t\tValue: \"-\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Sign prefix on variable\",\n\t\t\tInput: \"-foo\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: PREFIX,\n\t\t\t\t\tValue: \"-\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Boolean prefix\",\n\t\t\tInput: \"!true\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: PREFIX,\n\t\t\t\t\tValue: \"!\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: true,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Boolean prefix on variable\",\n\t\t\tInput: \"!foo\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: PREFIX,\n\t\t\t\t\tValue: \"!\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Bitwise not prefix\",\n\t\t\tInput: \"~1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: PREFIX,\n\t\t\t\t\tValue: \"~\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Bitwise not prefix on variable\",\n\t\t\tInput: \"~foo\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: PREFIX,\n\t\t\t\t\tValue: \"~\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\ttestCases = combineWhitespaceExpressions(testCases)\n\trunTokenParsingTest(testCases, test)\n}\n\nfunc TestEscapedParameters(test *testing.T) {\n\n\ttestCases := []TokenParsingTest{\n\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single escaped parameter\",\n\t\t\tInput: \"[foo]\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single escaped parameter with whitespace\",\n\t\t\tInput: \"[foo bar]\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"foo bar\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Single escaped parameter with escaped closing bracket\",\n\t\t\tInput: \"[foo[bar\\\\]]\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"foo[bar]\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Escaped parameters and unescaped parameters\",\n\t\t\tInput: \"[foo] > bar\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"foo\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \">\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"bar\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Unescaped parameter with space\",\n\t\t\tInput: \"foo\\\\ bar > bar\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"foo bar\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \">\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"bar\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Unescaped parameter with space\",\n\t\t\tInput: \"response\\\\-time > bar\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"response-time\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \">\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"bar\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Parameters with snake_case\",\n\t\t\tInput: \"foo_bar > baz_quux\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"foo_bar\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \">\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: VARIABLE,\n\t\t\t\t\tValue: \"baz_quux\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"String literal uses backslash to escape\",\n\t\t\tInput: \"\\\"foo\\\\'bar\\\"\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: STRING,\n\t\t\t\t\tValue: \"foo'bar\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\trunTokenParsingTest(testCases, test)\n}\n\nfunc TestTernaryParsing(test *testing.T) {\n\ttokenParsingTests := []TokenParsingTest{\n\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Ternary after Boolean\",\n\t\t\tInput: \"true ? 1\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: true,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: TERNARY,\n\t\t\t\t\tValue: \"?\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Ternary after Comperator\",\n\t\t\tInput: \"1 == 0 ? true\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: COMPARATOR,\n\t\t\t\t\tValue: \"==\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 0.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: TERNARY,\n\t\t\t\t\tValue: \"?\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: BOOLEAN,\n\t\t\t\t\tValue: true,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tTokenParsingTest{\n\n\t\t\tName: \"Null coalesce left\",\n\t\t\tInput: \"1 ?? 2\",\n\t\t\tExpected: []ExpressionToken{\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 1.0,\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: TERNARY,\n\t\t\t\t\tValue: \"??\",\n\t\t\t\t},\n\t\t\t\tExpressionToken{\n\t\t\t\t\tKind: NUMERIC,\n\t\t\t\t\tValue: 2.0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\trunTokenParsingTest(tokenParsingTests, test)\n}\n\n/*\n\tTests to make sure that the String() reprsentation of an expression exactly matches what is given to the parse function.\n*/\nfunc TestOriginalString(test *testing.T) {\n\n\t// include all the token types, to be sure there's no shenaniganery going on.\n\texpressionString := \"2 > 1 &&\" +\n\t\t\"'something' != 'nothing' || \" +\n\t\t\"'2014-01-20' < 'Wed Jul 8 23:07:35 MDT 2015' && \" +\n\t\t\"[escapedVariable name with spaces] <= unescaped\\\\-variableName &&\" +\n\t\t\"modifierTest + 1000 / 2 > (80 * 100 % 2) && true ? true : false\"\n\n\texpression, err := NewEvaluableExpression(expressionString)\n\tif err != nil {\n\n\t\ttest.Logf(\"failed to parse original string test: %v\", err)\n\t\ttest.Fail()\n\t\treturn\n\t}\n\n\tif expression.String() != expressionString {\n\t\ttest.Logf(\"String() did not give the same expression as given to parse\")\n\t\ttest.Fail()\n\t}\n}\n\n/*\n\tTests to make sure that the Vars() reprsentation of an expression identifies all variables contained within the expression.\n*/\nfunc TestOriginalVars(test *testing.T) {\n\n\t// include all the token types, to be sure there's no shenaniganery going on.\n\texpressionString := \"2 > 1 &&\" +\n\t\t\"'something' != 'nothing' || \" +\n\t\t\"'2014-01-20' < 'Wed Jul 8 23:07:35 MDT 2015' && \" +\n\t\t\"[escapedVariable name with spaces] <= unescaped\\\\-variableName &&\" +\n\t\t\"modifierTest + 1000 / 2 > (80 * 100 % 2) && true ? true : false\"\n\n\texpectedVars := [3]string{\"escapedVariable name with spaces\",\n\t\t\"modifierTest\",\n\t\t\"unescaped-variableName\"}\n\n\texpression, err := NewEvaluableExpression(expressionString)\n\tif err != nil {\n\n\t\ttest.Logf(\"failed to parse original var test: %v\", err)\n\t\ttest.Fail()\n\t\treturn\n\t}\n\n\tif len(expression.Vars()) == len(expectedVars) {\n\t\tvariableMap := make(map[string]string)\n\t\tfor _, v := range expression.Vars() {\n\t\t\tvariableMap[v] = v\n\t\t}\n\t\tfor _, v := range expectedVars {\n\t\t\tif _, ok := variableMap[v]; !ok {\n\t\t\t\ttest.Logf(\"Vars() did not correctly identify all variables contained within the expression\")\n\t\t\t\ttest.Fail()\n\t\t\t}\n\t\t}\n\t} else {\n\t\ttest.Logf(\"Vars() did not correctly identify all variables contained within the expression\")\n\t\ttest.Fail()\n\t}\n}\n\nfunc combineWhitespaceExpressions(testCases []TokenParsingTest) []TokenParsingTest {\n\n\tvar currentCase, strippedCase TokenParsingTest\n\tvar caseLength int\n\n\tcaseLength = len(testCases)\n\n\tfor i := 0; i < caseLength; i++ {\n\n\t\tcurrentCase = testCases[i]\n\n\t\tstrippedCase = TokenParsingTest{\n\n\t\t\tName: (currentCase.Name + \" (without whitespace)\"),\n\t\t\tInput: stripUnquotedWhitespace(currentCase.Input),\n\t\t\tExpected: currentCase.Expected,\n\t\t\tFunctions: currentCase.Functions,\n\t\t}\n\n\t\ttestCases = append(testCases, strippedCase, currentCase)\n\t}\n\n\treturn testCases\n}\n\nfunc stripUnquotedWhitespace(expression string) string {\n\n\tvar expressionBuffer bytes.Buffer\n\tvar quoted bool\n\n\tfor _, character := range expression {\n\n\t\tif !quoted && unicode.IsSpace(character) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif character == '\\'' {\n\t\t\tquoted = !quoted\n\t\t}\n\n\t\texpressionBuffer.WriteString(string(character))\n\t}\n\n\treturn expressionBuffer.String()\n}\n\nfunc runTokenParsingTest(tokenParsingTests []TokenParsingTest, test *testing.T) {\n\n\tvar parsingTest TokenParsingTest\n\tvar expression *EvaluableExpression\n\tvar actualTokens []ExpressionToken\n\tvar actualToken ExpressionToken\n\tvar expectedTokenKindString, actualTokenKindString string\n\tvar expectedTokenLength, actualTokenLength int\n\tvar err error\n\n\tfmt.Printf(\"Running %d parsing test cases...\\n\", len(tokenParsingTests))\n\t// defer func() {\n\t// if r := recover(); r != nil {\n\t// test.Logf(\"Panic in test '%s': %v\", parsingTest.Name, r)\n\t// \t\ttest.Fail()\n\t// }\n\t// }()\n\n\t// Run the test cases.\n\tfor _, parsingTest = range tokenParsingTests {\n\n\t\tif parsingTest.Functions != nil {\n\t\t\texpression, err = NewEvaluableExpressionWithFunctions(parsingTest.Input, parsingTest.Functions)\n\t\t} else {\n\t\t\texpression, err = NewEvaluableExpression(parsingTest.Input)\n\t\t}\n\n\t\tif err != nil {\n\n\t\t\ttest.Logf(\"Test '%s' failed to parse: %s\", parsingTest.Name, err)\n\t\t\ttest.Logf(\"Expression: '%s'\", parsingTest.Input)\n\t\t\ttest.Fail()\n\t\t\tcontinue\n\t\t}\n\n\t\tactualTokens = expression.Tokens()\n\n\t\texpectedTokenLength = len(parsingTest.Expected)\n\t\tactualTokenLength = len(actualTokens)\n\n\t\tif actualTokenLength != expectedTokenLength {\n\n\t\t\ttest.Logf(\"Test '%s' failed:\", parsingTest.Name)\n\t\t\ttest.Logf(\"Expected %d tokens, actually found %d\", expectedTokenLength, actualTokenLength)\n\t\t\ttest.Fail()\n\t\t\tcontinue\n\t\t}\n\n\t\tfor i, expectedToken := range parsingTest.Expected {\n\n\t\t\tactualToken = actualTokens[i]\n\t\t\tif actualToken.Kind != expectedToken.Kind {\n\n\t\t\t\tactualTokenKindString = actualToken.Kind.String()\n\t\t\t\texpectedTokenKindString = expectedToken.Kind.String()\n\n\t\t\t\ttest.Logf(\"Test '%s' failed:\", parsingTest.Name)\n\t\t\t\ttest.Logf(\"Expected token kind '%v' does not match '%v'\", expectedTokenKindString, actualTokenKindString)\n\t\t\t\ttest.Fail()\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif expectedToken.Value == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\treflectedKind := reflect.TypeOf(expectedToken.Value).Kind()\n\t\t\tif reflectedKind == reflect.Func {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// gotta be an accessor\n\t\t\tif reflectedKind == reflect.Slice {\n\n\t\t\t\tif actualToken.Value == nil {\n\t\t\t\t\ttest.Logf(\"Test '%s' failed:\", parsingTest.Name)\n\t\t\t\t\ttest.Logf(\"Expected token value '%v' does not match nil\", expectedToken.Value)\n\t\t\t\t\ttest.Fail()\n\t\t\t\t}\n\n\t\t\t\tfor z, actual := range actualToken.Value.([]string) {\n\n\t\t\t\t\tif actual != expectedToken.Value.([]string)[z] {\n\n\t\t\t\t\t\ttest.Logf(\"Test '%s' failed:\", parsingTest.Name)\n\t\t\t\t\t\ttest.Logf(\"Expected token value '%v' does not match '%v'\", expectedToken.Value, actualToken.Value)\n\t\t\t\t\t\ttest.Fail()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif actualToken.Value != expectedToken.Value {\n\n\t\t\t\ttest.Logf(\"Test '%s' failed:\", parsingTest.Name)\n\t\t\t\ttest.Logf(\"Expected token value '%v' does not match '%v'\", expectedToken.Value, actualToken.Value)\n\t\t\t\ttest.Fail()\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc noop(arguments ...interface{}) (interface{}, error) {\n\treturn nil, nil\n}\n", "meta": {"content_hash": "2f197242f4e79a647b8c0f4765e351d5", "timestamp": "", "source": "github", "line_count": 1670, "max_line_length": 124, "avg_line_length": 19.104191616766467, "alnum_prop": 0.582246740220662, "repo_name": "Knetic/govaluate", "id": "d57b80967d3223c5feb5a32e4d61b88fe1ea23d8", "size": "31952", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "parsing_test.go", "mode": "33188", "license": "mit", "language": [{"name": "Go", "bytes": "177418"}, {"name": "Shell", "bytes": "760"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<!-- - Sample namespace-based configuration - -->\n\n<beans:beans xmlns=\"http://www.springframework.org/schema/security\"\n\txmlns:beans=\"http://www.springframework.org/schema/beans\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\txmlns:oauth2=\"http://www.springframework.org/schema/security/oauth2\"\n\txmlns:mvc=\"http://www.springframework.org/schema/mvc\" xmlns:context=\"http://www.springframework.org/schema/context\"\n\txsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd\n\thttp://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd\n http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd\n http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd\n http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd\">\n\n\t<http pattern=\"/resource/**\" create-session=\"never\"\n\t\tentry-point-ref=\"oauth2AuthenticationEntryPoint\"\n\t\taccess-decision-manager-ref=\"oauth2AccessDecisionManager\">\n\t\t<anonymous enabled=\"false\" />\n\t\t<intercept-url pattern=\"/resource/**\" access=\"ROLE_USER,SCOPE_READ\" />\n\t\t<custom-filter ref=\"picResourceServer\" before=\"PRE_AUTH_FILTER\" />\n\t\t<access-denied-handler ref=\"oauthAccessDeniedHandler\" />\n\t</http>\n\n\t<oauth2:resource-server id=\"picResourceServer\"\n\t\tresource-id=\"pic-resource\" token-services-ref=\"tokenServices\" />\n\n\t<http pattern=\"/oauth/token\" create-session=\"stateless\"\n\t\tauthentication-manager-ref=\"clientAuthenticationManager\"\n\t\tentry-point-ref=\"oauth2AuthenticationEntryPoint\">\n\t\t<intercept-url pattern=\"/oauth/token\" access=\"IS_AUTHENTICATED_FULLY\" />\n\t\t<anonymous enabled=\"false\" />\n\t\t<http-basic entry-point-ref=\"oauth2AuthenticationEntryPoint\" />\n\t\t<custom-filter ref=\"clientCredentialsTokenEndpointFilter\"\n\t\t\tbefore=\"BASIC_AUTH_FILTER\" />\n\t\t<access-denied-handler ref=\"oauthAccessDeniedHandler\" />\n\t</http>\n\n\t<http access-denied-page=\"/login.jsp?error=true\"\n\t\tauthentication-manager-ref=\"authenticationManager\">\n\t\t<intercept-url pattern=\"/oauth/**\" access=\"ROLE_USER\" />\n\t\t<intercept-url pattern=\"/**\" access=\"IS_AUTHENTICATED_ANONYMOUSLY\" />\n\t\t<form-login login-page=\"/login.jsp\"\n\t\t\tauthentication-failure-url=\"/login.jsp?error=true\"\n\t\t\tdefault-target-url=\"/index.jsp\" />\n\t\t<anonymous />\n\t</http>\n\n\t<authentication-manager alias=\"authenticationManager\">\n\t\t<authentication-provider>\n\t\t\t<user-service id=\"userService\">\n\t\t\t\t<user name=\"admin\" password=\"admin\" authorities=\"ROLE_USER\" />\n\t\t\t</user-service>\n\t\t</authentication-provider>\n\t</authentication-manager>\n\n\n\t<beans:bean id=\"clientCredentialsTokenEndpointFilter\"\n\t\tclass=\"org.springframework.security.oauth2.provider.client.ClientCredentialsTokenEndpointFilter\">\n\t\t<beans:property name=\"authenticationManager\" ref=\"clientAuthenticationManager\" />\n\t</beans:bean>\n\n\t<beans:bean id=\"oauth2AuthenticationEntryPoint\"\n\t\tclass=\"org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint\" />\n\n\t<beans:bean id=\"oauthAccessDeniedHandler\"\n\t\tclass=\"org.springframework.security.oauth2.provider.error.OAuth2AccessDeniedHandler\" />\n\n\t<authentication-manager id=\"clientAuthenticationManager\">\n\t\t<authentication-provider user-service-ref=\"oauth2ClientDetailsUserService\" />\n\t</authentication-manager>\n\n\t<beans:bean id=\"oauth2ClientDetailsUserService\"\n\t\tclass=\"org.springframework.security.oauth2.provider.client.ClientDetailsUserDetailsService\">\n\t\t<beans:constructor-arg ref=\"clientDetailsService\" />\n\t</beans:bean>\n\n\t<oauth2:client-details-service id=\"clientDetailsService\">\n\t\t<oauth2:client client-id=\"m1\"\n\t\t\tauthorized-grant-types=\"password,authorization_code,refresh_token,implicit\"\n\t\t\tsecret=\"s1\" scope=\"read,write,trust\" authorities=\"ROLE_CLIENT, ROLE_TRUSTED_CLIENT\"\n\t\t\tresource-ids=\"pic-resource\" />\n\t</oauth2:client-details-service>\n\n\t<beans:bean id=\"tokenServices\"\n\t\tclass=\"org.springframework.security.oauth2.provider.token.DefaultTokenServices\">\n\t\t<beans:property name=\"tokenStore\" ref=\"tokenStore\" />\n\t\t<beans:property name=\"supportRefreshToken\" value=\"true\" />\n\t\t<beans:property name=\"clientDetailsService\" ref=\"clientDetailsService\" />\n\t</beans:bean>\n\t<beans:bean id=\"tokenStore\"\n\t\tclass=\"org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore\">\n\t</beans:bean>\n\n\t<oauth2:authorization-server\n\t\tclient-details-service-ref=\"clientDetailsService\" token-services-ref=\"tokenServices\"\n\t\tuser-approval-handler-ref=\"oauthUserApprovalHandler\"\n\t\tuser-approval-page=\"oauth_approval\" error-page=\"oauth_error\">\n\t\t<oauth2:authorization-code />\n\t\t<oauth2:implicit />\n\t\t<oauth2:refresh-token />\n\t\t<oauth2:client-credentials />\n\t\t<oauth2:password />\n\t</oauth2:authorization-server>\n\n\t<beans:bean id=\"oauthUserApprovalHandler\"\n\t\tclass=\"org.springframework.security.oauth2.provider.approval.DefaultUserApprovalHandler\" />\n\n\t<beans:bean id=\"oauth2AccessDecisionManager\"\n\t\tclass=\"org.springframework.security.access.vote.UnanimousBased\">\n\t\t<beans:constructor-arg>\n\t\t\t<beans:list>\n\t\t\t\t<beans:bean\n\t\t\t\t\tclass=\"org.springframework.security.oauth2.provider.vote.ScopeVoter\" />\n\t\t\t\t<beans:bean class=\"org.springframework.security.access.vote.RoleVoter\" />\n\t\t\t\t<beans:bean\n\t\t\t\t\tclass=\"org.springframework.security.access.vote.AuthenticatedVoter\" />\n\t\t\t</beans:list>\n\t\t</beans:constructor-arg>\n\t</beans:bean>\n\n</beans:beans>\n", "meta": {"content_hash": "84a595ed63f81e80daa1d2cf1e760b5c", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 157, "avg_line_length": 45.83471074380165, "alnum_prop": 0.7601875225387666, "repo_name": "levioZ/springSecurityOauth2", "id": "885eaeb627d6ca89f96e72a4ff6510ae8859fc00", "size": "5546", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "appDemo/target/appDemo/WEB-INF/applicationContext-security.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "25367"}]}} +{"text": "FROM balenalib/solidrun-imx6-ubuntu:eoan-build\n\nENV NODE_VERSION 14.15.4\nENV YARN_VERSION 1.22.4\n\nRUN for key in \\\n\t6A010C5166006599AA17F08146C2130DFD2497F5 \\\n\t; do \\\n\t\tgpg --keyserver pgp.mit.edu --recv-keys \"$key\" || \\\n\t\tgpg --keyserver keyserver.pgp.com --recv-keys \"$key\" || \\\n\t\tgpg --keyserver ha.pool.sks-keyservers.net --recv-keys \"$key\" ; \\\n\tdone \\\n\t&& curl -SLO \"http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-armv7l.tar.gz\" \\\n\t&& echo \"ffce90b07675434491361dfc74eee230f9ffc65c6c08efb88a18781bcb931871 node-v$NODE_VERSION-linux-armv7l.tar.gz\" | sha256sum -c - \\\n\t&& tar -xzf \"node-v$NODE_VERSION-linux-armv7l.tar.gz\" -C /usr/local --strip-components=1 \\\n\t&& rm \"node-v$NODE_VERSION-linux-armv7l.tar.gz\" \\\n\t&& curl -fSLO --compressed \"https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz\" \\\n\t&& curl -fSLO --compressed \"https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc\" \\\n\t&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \\\n\t&& mkdir -p /opt/yarn \\\n\t&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \\\n\t&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \\\n\t&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \\\n\t&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \\\n\t&& npm config set unsafe-perm true -g --unsafe-perm \\\n\t&& rm -rf /tmp/*\n\nCMD [\"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\"]\n\n RUN curl -SLO \"https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh\" \\\n && echo \"Running test-stack@node\" \\\n && chmod +x test-stack@node.sh \\\n && bash test-stack@node.sh \\\n && rm -rf test-stack@node.sh \n\nRUN [ ! -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 v7 \\nOS: Ubuntu eoan \\nVariant: build variant \\nDefault variable(s): UDEV=off \\nThe following software stack is preinstalled: \\nNode.js v14.15.4, 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\n\nRUN echo '#!/bin/sh.real\\nbalena-info\\nrm -f /bin/sh\\ncp /bin/sh.real /bin/sh\\n/bin/sh \"$@\"' > /bin/sh-shim \\\n\t&& chmod +x /bin/sh-shim \\\n\t&& cp /bin/sh /bin/sh.real \\\n\t&& mv /bin/sh-shim /bin/sh", "meta": {"content_hash": "c8a01e4b75bd5de09af8b5745a3f2309", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 692, "avg_line_length": 66.85365853658537, "alnum_prop": 0.7099598686610726, "repo_name": "nghiant2710/base-images", "id": "ce2d4d127f7bb93b26d59fbf176b02e348c9ccd4", "size": "2762", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/node/solidrun-imx6/ubuntu/eoan/14.15.4/build/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Dockerfile", "bytes": "144558581"}, {"name": "JavaScript", "bytes": "16316"}, {"name": "Shell", "bytes": "368690"}]}} +{"text": "var Sources = $CL.namespace('SqlConnect.View.Sources');\n\n$CL.require('Cl.Backbone.BlockingView');\n\nSources.Options = function() {};\n\nSources.Options = $CL.extendClass(Sources.Options, Cl.Backbone.BlockingView, {\n render : function() {\n this.parent.prototype.render.apply(this);\n\n if (!$CL.isEmpty(this.data.options)) {\n this.$el.find('select[name=sqlconnect-source-count-column]').val(this.data.options.countColumn);\n \n if (this.data.options.customSql) {\n this.$el.find('textarea[name=sqlconnect-source-custom-sql]').val(this.data.options.customSql);\n }\n }\n }\n});\n", "meta": {"content_hash": "ee72d599010347b3f988d5d873d71c76", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 110, "avg_line_length": 34.21052631578947, "alnum_prop": 0.6276923076923077, "repo_name": "codeliner/ginger-ims", "id": "081d1dc6469d2b881b15d969899987621caacf57", "size": "650", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "module/SqlConnect/src/SqlConnect/Javascript/View/Sources/Options.js", "mode": "33261", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "84729"}, {"name": "JavaScript", "bytes": "265425"}, {"name": "PHP", "bytes": "523207"}, {"name": "Shell", "bytes": "809"}]}} +{"text": "include(FindPackageHandleStandardArgs)\n\nfind_path(FFTW_INCLUDE_DIR\n NAMES fftw3.h\n PATH_SUFFIXES include include/fftw\n HINTS ENV MKLROOT\n HINTS ENV FFTWROOT\n HINTS ENV FFTW_INC\n )\n\nfind_library(FFTW_LIBRARIES\n NAMES fftw3\n PATH_SUFFIXES lib\n HINTS ENV MKLROOT\n HINTS ENV FFTW_DIR\n HINTS ENV FFTWROOT\n )\n\nset(FFTW_INCLUDE_DIRS ${FFTW_INCLUDE_DIR})\n\nif(FFTW_LIBRARIES MATCHES \"NOTFOUND\")\n # ok, fftw libraries not found.\n # MKL contains fftw, lets assume we use MKL\n # TODO: handle this properly\n set(FFTW_LIBRARIES \"\")\n find_package_handle_standard_args(FFTW\n REQUIRED_VARS FFTW_INCLUDE_DIR )\n mark_as_advanced(FFTW_FOUND FFTW_INCLUDE_DIR)\nelse()\n find_package_handle_standard_args(FFTW\n REQUIRED_VARS FFTW_INCLUDE_DIR FFTW_LIBRARIES)\n mark_as_advanced(FFTW_FOUND FFTW_INCLUDE_DIR FFTW_LIBRARIES)\nendif()\n", "meta": {"content_hash": "48fa9a8857e7df31546b884bdba04a16", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 62, "avg_line_length": 25.151515151515152, "alnum_prop": 0.7506024096385542, "repo_name": "electronic-structure/sirius", "id": "d261546f9ec8feb2a9b4a3d4b1bfb6ff23712246", "size": "830", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cmake/modules/FindFFTW.cmake", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "C", "bytes": "80256"}, {"name": "C++", "bytes": "2742135"}, {"name": "CSS", "bytes": "99478"}, {"name": "Cuda", "bytes": "85058"}, {"name": "FORTRAN", "bytes": "904229"}, {"name": "Groff", "bytes": "3046"}, {"name": "HTML", "bytes": "25527"}, {"name": "JavaScript", "bytes": "1451"}, {"name": "Makefile", "bytes": "17141"}, {"name": "PHP", "bytes": "2203"}, {"name": "Python", "bytes": "343602"}, {"name": "Shell", "bytes": "314"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc (1.8.0_122-ea) on Thu Mar 02 11:05:13 PST 2017 -->\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>Uses of Package com.fasterxml.jackson.datatype.jsr310.ser.key (Jackson datatype: JSR310 2.9.0.pr1 API)</title>\n<meta name=\"date\" content=\"2017-03-02\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../../../../stylesheet.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"../../../../../../../script.js\"></script>\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n try {\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"Uses of Package com.fasterxml.jackson.datatype.jsr310.ser.key (Jackson datatype: JSR310 2.9.0.pr1 API)\";\n }\n }\n catch(err) {\n }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar.top\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.top.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li>Class</li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../../index.html?com/fasterxml/jackson/datatype/jsr310/ser/key/package-use.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"package-use.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip.navbar.top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h1 title=\"Uses of Package com.fasterxml.jackson.datatype.jsr310.ser.key\" class=\"title\">Uses of Package<br>com.fasterxml.jackson.datatype.jsr310.ser.key</h1>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use table, listing packages, and an explanation\">\n<caption><span>Packages that use <a href=\"../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/key/package-summary.html\">com.fasterxml.jackson.datatype.jsr310.ser.key</a></span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Package</th>\n<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a href=\"#com.fasterxml.jackson.datatype.jsr310.ser.key\">com.fasterxml.jackson.datatype.jsr310.ser.key</a></td>\n<td class=\"colLast\"> </td>\n</tr>\n</tbody>\n</table>\n</li>\n<li class=\"blockList\"><a name=\"com.fasterxml.jackson.datatype.jsr310.ser.key\">\n<!-- -->\n</a>\n<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use table, listing classes, and an explanation\">\n<caption><span>Classes in <a href=\"../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/key/package-summary.html\">com.fasterxml.jackson.datatype.jsr310.ser.key</a> used by <a href=\"../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/key/package-summary.html\">com.fasterxml.jackson.datatype.jsr310.ser.key</a></span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Class and Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"../../../../../../../com/fasterxml/jackson/datatype/jsr310/ser/key/class-use/ZonedDateTimeKeySerializer.html#com.fasterxml.jackson.datatype.jsr310.ser.key\">ZonedDateTimeKeySerializer</a> </td>\n</tr>\n</tbody>\n</table>\n</li>\n</ul>\n</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar.bottom\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.bottom.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li>Class</li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../../index.html?com/fasterxml/jackson/datatype/jsr310/ser/key/package-use.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"package-use.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip.navbar.bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n<p class=\"legalCopy\"><small>Copyright © 2017 <a href=\"http://fasterxml.com/\">FasterXML</a>. All rights reserved.</small></p>\n</body>\n</html>\n", "meta": {"content_hash": "e92b46947571eda7b2ef917761e295fe", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 380, "avg_line_length": 39.0251572327044, "alnum_prop": 0.6288477034649477, "repo_name": "kevinjom/jackson-modules-java8", "id": "14578e2fabfd180c6f49236394292c4badeba137", "size": "6205", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/javadoc/datetime/2.9.pr1/com/fasterxml/jackson/datatype/jsr310/ser/key/package-use.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "699284"}]}} +{"text": "#ifndef _TEST_H_\n#define _TEST_H_\n\n/********************* Header Files ***********************/\n/* C Headers */\n//#include <stdio.h>\n//#include <string.h>\n//#include <stdlib.h> /* atof, rand, malloc... */\n//#include <stddef.h> /* size_t, NULL */\n//#include <stdarg.h> /* Variable argument functions */\n//#include <ctype.h> /* Character check functions */\n//#include <limits.h>\n//#include <assert.h>\n//$include <math.h>\n//$include <stdint.h> /* C11, standard u_int16 & such */\n\n/* Project Headers */\n\n/******************* Constants/Macros *********************/\n\n\n/******************* Type Declarations ********************/\n/* For enums: Try to namesapce the common elements.\n * typedef enum {\n *\tVAL_,\n * } name_e;\n */\n\n/* For structs:\n * typedef struct name_s {\n *\tint index;\n * } name_t;\n */\n\n/********************** Prototypes ************************/\n\n#endif /* _TEST_H_ */\n\n", "meta": {"content_hash": "882e76a4f5e8c4327fceaa481c14f98f", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 60, "avg_line_length": 23.18421052631579, "alnum_prop": 0.49148694665153236, "repo_name": "starcraftman/.my_scripts", "id": "476ec6e0fb6258f7ca90bf4d60991d40b24ca43c", "size": "881", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bin/templates/c_template.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "914"}, {"name": "C++", "bytes": "4884"}, {"name": "Common Lisp", "bytes": "3217"}, {"name": "Makefile", "bytes": "14820"}, {"name": "Objective-C", "bytes": "881"}, {"name": "Perl", "bytes": "14953"}, {"name": "Python", "bytes": "87094"}, {"name": "Ruby", "bytes": "11415"}, {"name": "Shell", "bytes": "15604"}]}} +{"text": "\npackage org.owasp.webgoat.plugin.db_cross_site;\n\nimport org.owasp.webgoat.plugin.GoatHillsFinancial.DefaultLessonAction;\nimport org.owasp.webgoat.plugin.GoatHillsFinancial.Employee;\nimport org.owasp.webgoat.plugin.GoatHillsFinancial.GoatHillsFinancial;\nimport org.owasp.webgoat.plugin.GoatHillsFinancial.LessonAction;\nimport org.owasp.webgoat.session.ParameterNotFoundException;\nimport org.owasp.webgoat.session.UnauthenticatedException;\nimport org.owasp.webgoat.session.UnauthorizedException;\nimport org.owasp.webgoat.session.ValidationException;\nimport org.owasp.webgoat.session.WebSession;\n\nimport javax.servlet.http.HttpServletRequest;\nimport java.sql.CallableStatement;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSet;\nimport java.sql.SQLException;\nimport java.sql.Statement;\n\n\n\npublic class UpdateProfileDBCrossSiteScripting extends DefaultLessonAction\n{\n\n private LessonAction chainedAction;\n\n public UpdateProfileDBCrossSiteScripting(GoatHillsFinancial lesson, String lessonName, String actionName, LessonAction chainedAction)\n {\n super(lesson, lessonName, actionName);\n this.chainedAction = chainedAction;\n }\n\n public void handleRequest(WebSession s) throws ParameterNotFoundException, UnauthenticatedException,\n UnauthorizedException, ValidationException\n {\n if (isAuthenticated(s))\n {\n int userId = getIntSessionAttribute(s, getLessonName() + \".\" + GoatHillsFinancial.USER_ID);\n\n HttpServletRequest request = s.getRequest();\n int subjectId = Integer.parseInt(request.getParameter(DBCrossSiteScripting.EMPLOYEE_ID));\n String firstName = request.getParameter(DBCrossSiteScripting.FIRST_NAME);\n String lastName = request.getParameter(DBCrossSiteScripting.LAST_NAME);\n String ssn = request.getParameter(DBCrossSiteScripting.SSN);\n String title = request.getParameter(DBCrossSiteScripting.TITLE);\n String phone = request.getParameter(DBCrossSiteScripting.PHONE_NUMBER);\n String address1 = request.getParameter(DBCrossSiteScripting.ADDRESS1);\n String address2 = request.getParameter(DBCrossSiteScripting.ADDRESS2);\n int manager = Integer.parseInt(request.getParameter(DBCrossSiteScripting.MANAGER));\n String startDate = request.getParameter(DBCrossSiteScripting.START_DATE);\n int salary = Integer.parseInt(request.getParameter(DBCrossSiteScripting.SALARY));\n String ccn = request.getParameter(DBCrossSiteScripting.CCN);\n int ccnLimit = Integer.parseInt(request.getParameter(DBCrossSiteScripting.CCN_LIMIT));\n String disciplinaryActionDate = request.getParameter(DBCrossSiteScripting.DISCIPLINARY_DATE);\n String disciplinaryActionNotes = request.getParameter(DBCrossSiteScripting.DISCIPLINARY_NOTES);\n String personalDescription = request.getParameter(DBCrossSiteScripting.DESCRIPTION);\n\n Employee employee = new Employee(subjectId, firstName, lastName, ssn, title, phone, address1, address2,\n manager, startDate, salary, ccn, ccnLimit, disciplinaryActionDate, disciplinaryActionNotes,\n personalDescription);\n\n try\n {\n if (subjectId > 0)\n {\n this.changeEmployeeProfile(s, userId, subjectId, employee);\n setRequestAttribute(s, getLessonName() + \".\" + DBCrossSiteScripting.EMPLOYEE_ID, Integer\n .toString(subjectId));\n if (DBCrossSiteScripting.STAGE1.equals(getStage(s)))\n {\n address1 = address1.toLowerCase();\n boolean pass = address1.contains(\"<script>\");\n pass &= address1.contains(\"alert\");\n pass &= address1.contains(\"</script>\");\n if (pass)\n {\n setStageComplete(s, DBCrossSiteScripting.STAGE1);\n }\n }\n }\n else\n this.createEmployeeProfile(s, userId, employee);\n } catch (SQLException e)\n {\n s.setMessage(\"Error updating employee profile\");\n e.printStackTrace();\n if (DBCrossSiteScripting.STAGE2.equals(getStage(s))\n && (e.getMessage().contains(\"ORA-06512\") || e.getMessage().contains(\"Illegal characters\"))\n && !employee.getAddress1().matches(\"^[a-zA-Z0-9,\\\\. ]{0,80}$\"))\n {\n setStageComplete(s, DBCrossSiteScripting.STAGE2);\n }\n\n }\n\n try\n {\n chainedAction.handleRequest(s);\n } catch (UnauthenticatedException ue1)\n {\n // System.out.println(\"Internal server error\");\n ue1.printStackTrace();\n } catch (UnauthorizedException ue2)\n {\n // System.out.println(\"Internal server error\");\n ue2.printStackTrace();\n }\n }\n else\n throw new UnauthenticatedException();\n }\n\n public String getNextPage(WebSession s)\n {\n return DBCrossSiteScripting.VIEWPROFILE_ACTION;\n }\n\n public void changeEmployeeProfile(WebSession s, int userId, int subjectId, Employee employee) throws SQLException\n {\n String update = \" { CALL UPDATE_EMPLOYEE(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) }\";\n CallableStatement call = WebSession.getConnection(s).prepareCall(update);\n // Note: The password field is ONLY set by ChangePassword\n call.setInt(1, userId);\n call.setString(2, employee.getFirstName());\n call.setString(3, employee.getLastName());\n call.setString(4, employee.getSsn());\n call.setString(5, employee.getTitle());\n call.setString(6, employee.getPhoneNumber());\n call.setString(7, employee.getAddress1());\n call.setString(8, employee.getAddress2());\n call.setInt(9, employee.getManager());\n call.setString(10, employee.getStartDate());\n call.setInt(11, employee.getSalary());\n call.setString(12, employee.getCcn());\n call.setInt(13, employee.getCcnLimit());\n call.setString(14, employee.getDisciplinaryActionDate());\n call.setString(15, employee.getDisciplinaryActionNotes());\n call.setString(16, employee.getPersonalDescription());\n call.executeUpdate();\n }\n\n public void createEmployeeProfile(WebSession s, int userId, Employee employee) throws UnauthorizedException\n {\n try\n {\n int nextId = getNextUID(s);\n String query = \"INSERT INTO employee VALUES ( \" + nextId + \", ?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\n try\n {\n PreparedStatement ps = WebSession.getConnection(s).prepareStatement(query);\n\n ps.setString(1, employee.getFirstName().toLowerCase());\n ps.setString(2, employee.getLastName());\n ps.setString(3, employee.getSsn());\n ps.setString(4, employee.getTitle());\n ps.setString(5, employee.getPhoneNumber());\n ps.setString(6, employee.getAddress1());\n ps.setString(7, employee.getAddress2());\n ps.setInt(8, employee.getManager());\n ps.setString(9, employee.getStartDate());\n ps.setString(10, employee.getCcn());\n ps.setInt(11, employee.getCcnLimit());\n ps.setString(12, employee.getDisciplinaryActionDate());\n ps.setString(13, employee.getDisciplinaryActionNotes());\n ps.setString(14, employee.getPersonalDescription());\n\n ps.execute();\n } catch (SQLException sqle)\n {\n s.setMessage(\"Error updating employee profile\");\n sqle.printStackTrace();\n }\n } catch (Exception e)\n {\n s.setMessage(\"Error updating employee profile\");\n e.printStackTrace();\n }\n }\n\n private int getNextUID(WebSession s)\n {\n int uid = -1;\n try\n {\n Statement statement = WebSession.getConnection(s).createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,\n ResultSet.CONCUR_READ_ONLY);\n ResultSet results = statement.executeQuery(\"select max(userid) as uid from employee\");\n results.first();\n uid = results.getInt(\"uid\");\n } catch (SQLException sqle)\n {\n sqle.printStackTrace();\n s.setMessage(\"Error updating employee profile\");\n }\n return uid + 1;\n }\n}\n", "meta": {"content_hash": "eec0d297b3bc76e40f3130914ef500bb", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 137, "avg_line_length": 44.90954773869347, "alnum_prop": 0.6055723397113125, "repo_name": "aseemsbapat/test", "id": "a14823155fce0d70c961109dda0149c9c3cafeba", "size": "10166", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "UpdateProfileDBCrossSiteScripting.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C#", "bytes": "522"}, {"name": "CSS", "bytes": "32037"}, {"name": "HTML", "bytes": "1085343"}, {"name": "Java", "bytes": "1094660"}, {"name": "JavaScript", "bytes": "372790"}, {"name": "PHP", "bytes": "172910"}, {"name": "Roff", "bytes": "22608"}]}} +{"text": "<?php\n\nnamespace app\\models;\n\nuse Yii;\nuse yii\\base\\Model;\nuse yii\\data\\ActiveDataProvider;\nuse app\\models\\Clientes;\n\n/**\n * ClientesSearch represents the model behind the search form about `app\\models\\Clientes`.\n */\nclass ClientesSearch extends Clientes\n{\n /**\n * @inheritdoc\n */\n public function rules()\n {\n return [\n [['idClientes', 'prioridad', 'telefono'], 'integer'],\n [['ci_cliente', 'nombre', 'horario_atencion', 'email'], 'safe'],\n ];\n }\n\n /**\n * @inheritdoc\n */\n public function scenarios()\n {\n // bypass scenarios() implementation in the parent class\n return Model::scenarios();\n }\n\n /**\n * Creates data provider instance with search query applied\n *\n * @param array $params\n *\n * @return ActiveDataProvider\n */\n public function search($params)\n {\n $query = Clientes::find();\n\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'idClientes' => $this->idClientes,\n 'prioridad' => $this->prioridad,\n 'telefono' => $this->telefono,\n ]);\n\n $query->andFilterWhere(['like', 'ci_cliente', $this->ci_cliente])\n ->andFilterWhere(['like', 'nombre', $this->nombre])\n ->andFilterWhere(['like', 'horario_atencion', $this->horario_atencion])\n ->andFilterWhere(['like', 'email', $this->email]);\n\n return $dataProvider;\n }\n}\n", "meta": {"content_hash": "b37fd0dd039133410e0d765b85b31774", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 106, "avg_line_length": 25.18918918918919, "alnum_prop": 0.5574034334763949, "repo_name": "Nacho2126/php20162", "id": "c1cd90f235b749d1d52827dc04a0d6b9754115d1", "size": "1864", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "backend/models/ClientesSearch.php", "mode": "33261", "license": "bsd-3-clause", "language": [{"name": "ApacheConf", "bytes": "342"}, {"name": "Batchfile", "bytes": "1546"}, {"name": "CSS", "bytes": "161818"}, {"name": "HTML", "bytes": "25298"}, {"name": "JavaScript", "bytes": "364350"}, {"name": "PHP", "bytes": "240791"}, {"name": "Shell", "bytes": "3256"}]}} +{"text": "package pivkey\n\nimport (\n\t\"github.com/go-piv/piv-go/piv\"\n)\n\nfunc SlotForName(slotName string) *piv.Slot {\n\tswitch slotName {\n\tcase \"\":\n\t\treturn &piv.SlotSignature\n\tcase \"authentication\":\n\t\treturn &piv.SlotAuthentication\n\tcase \"signature\":\n\t\treturn &piv.SlotSignature\n\tcase \"card-authentication\":\n\t\treturn &piv.SlotCardAuthentication\n\tcase \"key-management\":\n\t\treturn &piv.SlotKeyManagement\n\tdefault:\n\t\treturn nil\n\t}\n}\n\nfunc PINPolicyForName(policyName string, slot piv.Slot) piv.PINPolicy {\n\tswitch policyName {\n\tcase \"\":\n\t\treturn defaultPINPolicyForSlot(slot)\n\tcase \"never\":\n\t\treturn piv.PINPolicyNever\n\tcase \"once\":\n\t\treturn piv.PINPolicyOnce\n\tcase \"always\":\n\t\treturn piv.PINPolicyAlways\n\tdefault:\n\t\treturn -1\n\t}\n}\n\nfunc TouchPolicyForName(policyName string, slot piv.Slot) piv.TouchPolicy {\n\tswitch policyName {\n\tcase \"\":\n\t\treturn defaultTouchPolicyForSlot(slot)\n\tcase \"never\":\n\t\treturn piv.TouchPolicyNever\n\tcase \"cached\":\n\t\treturn piv.TouchPolicyCached\n\tcase \"always\":\n\t\treturn piv.TouchPolicyAlways\n\tdefault:\n\t\treturn -1\n\t}\n}\n\nfunc defaultPINPolicyForSlot(slot piv.Slot) piv.PINPolicy {\n\t//\n\t// Defaults from https://developers.yubico.com/PIV/Introduction/Certificate_slots.html\n\t//\n\n\tswitch slot {\n\tcase piv.SlotAuthentication:\n\t\treturn piv.PINPolicyOnce\n\tcase piv.SlotSignature:\n\t\treturn piv.PINPolicyAlways\n\tcase piv.SlotKeyManagement:\n\t\treturn piv.PINPolicyOnce\n\tcase piv.SlotCardAuthentication:\n\t\treturn piv.PINPolicyNever\n\tdefault:\n\t\t// This should never happen\n\t\tpanic(\"invalid value for slot\")\n\t}\n}\n\nfunc defaultTouchPolicyForSlot(slot piv.Slot) piv.TouchPolicy {\n\t//\n\t// Defaults from https://developers.yubico.com/PIV/Introduction/Certificate_slots.html\n\t//\n\n\tswitch slot {\n\tcase piv.SlotAuthentication:\n\t\treturn piv.TouchPolicyCached\n\tcase piv.SlotSignature:\n\t\treturn piv.TouchPolicyAlways\n\tcase piv.SlotKeyManagement:\n\t\treturn piv.TouchPolicyCached\n\tcase piv.SlotCardAuthentication:\n\t\treturn piv.TouchPolicyNever\n\tdefault:\n\t\t// This should never happen\n\t\tpanic(\"invalid value for slot\")\n\t}\n}\n", "meta": {"content_hash": "776ea3c863945fe997a86eb7014ae009", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 87, "avg_line_length": 21.83695652173913, "alnum_prop": 0.7610751617720258, "repo_name": "tektoncd/operator", "id": "a323716e6b4d31588890f94ad9ab34da28b70d05", "size": "2655", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "vendor/github.com/sigstore/cosign/pkg/cosign/pivkey/util.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Dockerfile", "bytes": "1972"}, {"name": "Go", "bytes": "1049401"}, {"name": "Makefile", "bytes": "7852"}, {"name": "Python", "bytes": "14477"}, {"name": "Shell", "bytes": "42938"}, {"name": "Smarty", "bytes": "4243"}]}} +{"text": "<macros>\n <token name=\"@TOOL_VERSION@\">3.4</token>\n <token name=\"@GALAXY_TOOL_VERSION@\">galaxy1</token>\n <xml name=\"edam_ontology\">\n <edam_topics> \n <edam_topic>topic_0632</edam_topic>\n </edam_topics>\n <edam_operations>\n <edam_operation>operation_0231</edam_operation>\n </edam_operations>\n </xml>\n <xml name=\"requirements\">\n <requirements>\n <requirement type=\"package\" version=\"@TOOL_VERSION@\">cutadapt</requirement>\n </requirements>\n </xml>\n <xml name=\"citations\">\n <citations>\n <citation type=\"doi\">10.14806/ej.17.1.200</citation>\n </citations>\n </xml>\n <xml name=\"xrefs\">\n <xrefs>\n <xref type='bio.tools'>cutadapt</xref>\n </xrefs>\n </xml>\n <token name=\"@read1_options@\"><![CDATA[\n\n ## Read1 trimming\n\n #for $a in $library.r1.adapters\n #if $a.adapter_source.adapter_source_list == 'builtin':\n -a '${a.adapter_source.adapter.fields.name}'='${a.adapter_source.adapter}${adapter_options.internal}'\n #else if $a.adapter_source.adapter_source_list == 'file':\n -a file:'${a.adapter_source.adapter_file}${adapter_options.internal}'\n #else if str($a.adapter_source.adapter_name) != \"\":\n -a '${a.adapter_source.adapter_name}'='${a.adapter_source.adapter}${adapter_options.internal}'\n #else\n -a '${a.adapter_source.adapter}${adapter_options.internal}'\n #end if\n #end for\n #for $aa in $library.r1.anywhere_adapters\n #if $aa.anywhere_adapter_source.anywhere_adapter_source_list == 'builtin':\n -b '${aa.anywhere_adapter_source.anywhere_adapter.fields.name}'='${aa.anywhere_adapter_source.anywhere_adapter}'\n #else if $aa.anywhere_adapter_source.anywhere_adapter_source_list == 'file':\n -b file:'${aa.anywhere_adapter_source.anywhere_adapter_file}'\n #else if str($aa.anywhere_adapter_source.anywhere_adapter_name) != \"\":\n -b '${aa.anywhere_adapter_source.anywhere_adapter_name}'='${aa.anywhere_adapter_source.anywhere_adapter}'\n #else\n -b '${aa.anywhere_adapter_source.anywhere_adapter}'\n #end if\n #end for\n #for $fa in $library.r1.front_adapters\n #if $fa.front_adapter_source.front_adapter_source_list == 'builtin':\n -g '${fa.front_adapter_source.front_adapter.fields.name}'='${adapter_options.internal}${fa.front_adapter_source.front_adapter}'\n #else if $fa.front_adapter_source.front_adapter_source_list == 'file':\n -g file:'${adapter_options.internal}${fa.front_adapter_source.front_adapter_file}'\n #else if str($fa.front_adapter_source.front_adapter_name) != \"\":\n -g '${fa.front_adapter_source.front_adapter_name}'='${adapter_options.internal}${fa.front_adapter_source.front_adapter}'\n #else\n -g '${adapter_options.internal}${fa.front_adapter_source.front_adapter}'\n #end if\n #end for\n\n #if str($library.r1.cut) != '0':\n -u $library.r1.cut\n #end if\n\n ## Additional Outputs\n\n #if 'info_file' in $output_selector:\n --info-file=$info_file\n #end if\n #if 'rest_file' in $output_selector:\n --rest-file='${rest_output}'\n #end if\n #if 'wildcard_file' in $output_selector:\n --wildcard-file='${wild_output}'\n #end if\n #if 'too_short_file' in $output_selector:\n --too-short-output='${too_short_output}'\n #end if\n #if 'too_long_file' in $output_selector:\n --too-long-output='${too_long_output}'\n #end if\n #if 'untrimmed_file' in $output_selector:\n --untrimmed-output='${untrimmed_output}'\n #end if\n\n ]]></token>\n\n <token name=\"@read2_options@\"><![CDATA[\n\n ## Read2 trimming\n\n #for $a in $library.r2.adapters2\n #if $a.adapter_source2.adapter_source_list2 == 'builtin':\n -A '${a.adapter_source2.adapter2.fields.name}'='${a.adapter_source2.adapter2}${adapter_options.internal}'\n #else if $a.adapter_source2.adapter_source_list2 == 'file':\n -A file:'${a.adapter_source2.adapter_file2}${adapter_options.internal}'\n #else if str($a.adapter_source2.adapter_name2) != \"\":\n -A '${a.adapter_source2.adapter_name2}'='${a.adapter_source2.adapter2}${adapter_options.internal}'\n #else\n -A '${a.adapter_source2.adapter2}${adapter_options.internal}'\n #end if\n #end for\n #for $aa in $library.r2.anywhere_adapters2\n #if $aa.anywhere_adapter_source2.anywhere_adapter_source_list2 == 'builtin':\n -B '${aa.anywhere_adapter_source2.anywhere_adapter2.fields.name}'='${aa.anywhere_adapter_source2.anywhere_adapter2}'\n #else if $aa.anywhere_adapter_source2.anywhere_adapter_source_list2 == 'file':\n -B file:'${aa.anywhere_adapter_source2.anywhere_adapter_file2}'\n #else if str($aa.anywhere_adapter_source2.anywhere_adapter_name2) != \"\":\n -B '${aa.anywhere_adapter_source2.anywhere_adapter_name2}'='${aa.anywhere_adapter_source2.anywhere_adapter2}'\n #else\n -B '${aa.anywhere_adapter_source2.anywhere_adapter2}'\n #end if\n #end for\n #for $fa in $library.r2.front_adapters2\n #if $fa.front_adapter_source2.front_adapter_source_list2 == 'builtin':\n -G '${fa.front_adapter_source2.front_adapter2.fields.name}'='${adapter_options.internal}${fa.front_adapter_source2.front_adapter2}'\n #else if $fa.front_adapter_source2.front_adapter_source_list2 == 'file':\n -G file:'${adapter_options.internal}${fa.front_adapter_source2.front_adapter_file2}'\n #else if str($fa.front_adapter_source2.front_adapter_name2) != \"\":\n -G '${fa.front_adapter_source2.front_adapter_name2}'='${adapter_options.internal}${fa.front_adapter_source2.front_adapter2}'\n #else\n -G '${adapter_options.internal}${fa.front_adapter_source2.front_adapter2}'\n #end if\n #end for\n\n #if str($library.r2.cut2) != '0':\n -U $library.r2.cut2\n #end if\n\n ## Additional Outputs - Read 2\n\n #if 'too_short_file' in $output_selector:\n --too-short-paired-output='${too_short_paired_output}'\n #end if\n #if 'too_long_file' in $output_selector:\n --too-long-paired-output='${too_long_paired_output}'\n #end if\n #if 'untrimmed_file' in $output_selector:\n --untrimmed-paired-output='${untrimmed_paired_output}'\n #end if\n\n ]]></token>\n\n <xml name=\"adapter_sanitizer\">\n <sanitizer>\n <valid initial=\"string.digits\">\n <add value=\"A\"/><!--standard nucleotides-->\n <add value=\"T\"/>\n <add value=\"C\"/>\n <add value=\"G\"/>\n \n <add value=\"U\"/><!--ambiguous nucleotides-->\n <add value=\"R\"/>\n <add value=\"Y\"/>\n <add value=\"S\"/>\n <add value=\"W\"/>\n <add value=\"K\"/>\n <add value=\"M\"/>\n <add value=\"B\"/>\n <add value=\"D\"/>\n <add value=\"H\"/>\n <add value=\"V\"/>\n <add value=\"N\"/>\n\n <add value=\"X\"/><!-- don't match any nucleotide-->\n \n <add value=\"{\"/><!--specify repeats .. needs digits which are added as default-->\n <add value=\"}\"/>\n\n <add value=\"^\"/><!--anchoring-->\n <add value=\"$\"/>\n <add value=\".\"/>\n <add value=\"(\"/><!--specify what to keep-->\n <add value=\")\"/>\n\n </valid>\n </sanitizer>\n </xml>\n \n <xml name=\"adapter\" token_name=\"\" token_argument=\"\" token_value=\"\" token_label=\"\">\n <param name=\"@NAME@\" argument=\"@ARGUMENT@\" type=\"text\" value=\"@VALUE@\" label=\"@LABEL@\">\n <expand macro=\"adapter_sanitizer\"/>\n </param>\n </xml>\n \n <xml name=\"adapter_select\" token_name=\"\" token_argument=\"\" token_label=\"\">\n <param name=\"@NAME@\" argument=\"@ARGUMENT@\" type=\"select\" label=\"@LABEL@\">\n <options from_data_table=\"adapters\">\n <filter type=\"sort_by\" column=\"1\" />\n </options>\n <expand macro=\"adapter_sanitizer\"/>\n </param>\n </xml>\n\n <xml name=\"single_end_options\" >\n\n <section name=\"r1\" title=\"Read 1 Options\" expanded=\"True\">\n\n <repeat name=\"adapters\" title=\"3' (End) Adapters\" help=\"Sequence of an adapter ligated to the 3' end (paired data: of the first read). The adapter and subsequent bases are trimmed. If a '$' character is appended ('anchoring'), the adapter is only found if it is a suffix of the read. To search for a linked adapter, separate the 2 sequences with 3 dots (ADAPTER1...ADAPTER2), see Help below.\">\n <conditional name=\"adapter_source\">\n <param name=\"adapter_source_list\" type=\"select\" label=\"Source\" >\n <option value=\"builtin\" selected=\"True\">Standard (select from the list below)</option>\n <option value=\"user\">Enter custom sequence</option>\n <option value=\"file\">File from history</option>\n </param>\n\n <when value=\"user\">\n <param name=\"adapter_name\" type=\"text\" value=\"\" optional=\"True\" label=\"Enter custom 3' adapter name (Optional if Multiple output is 'No')\" />\n <expand macro=\"adapter\" name=\"adapter\" argument=\"-a\" type=\"text\" value=\"AATTGGCC\" label=\"Enter custom 3' adapter sequence\" />\n </when>\n\n <when value=\"builtin\">\n <expand macro=\"adapter_select\" name=\"adapter\" argument=\"-a\" label=\"Choose 3' adapter\"/>\n </when>\n\n <when value=\"file\">\n <param name=\"adapter_file\" argument=\"-a\" format=\"fasta\" type=\"data\" help=\"Should be of datatype FASTA\" label=\"Choose file containing 3' adapters\" />\n </when>\n </conditional>\n </repeat>\n\n <repeat name=\"front_adapters\" title=\"5' (Front) Adapters\" help=\"Sequence of an adapter ligated to the 5' end (paired data: of the first read). The adapter and any preceding bases are trimmed. Partial matches at the 5' end are allowed. If a '^' character is prepended ('anchoring'), the adapter is only found if it is a prefix of the read. To search for a linked adapter, separate the 2 sequences with 3 dots (ADAPTER1...ADAPTER2), see Help below.\">\n <conditional name=\"front_adapter_source\">\n <param name=\"front_adapter_source_list\" type=\"select\" label=\"Source\">\n <option value=\"builtin\" selected=\"True\">Standard (select from the list below)</option>\n <option value=\"user\">Enter custom sequence</option>\n <option value=\"file\">File from history</option>\n </param>\n\n <when value=\"user\">\n <param name=\"front_adapter_name\" type=\"text\" value=\"\" optional=\"True\" label=\"Enter custom 5' adapter name (Optional if Multiple output is 'No')\" />\n <expand macro=\"adapter\" name=\"front_adapter\" argument=\"-g\" value=\"AATTGGCC\" label=\"Enter custom 5' adapter sequence\" />\n </when>\n <when value=\"builtin\">\n <expand macro=\"adapter_select\" name=\"front_adapter\" argument=\"-g\" label=\"Choose 5' adapter\"/>\n </when>\n <when value=\"file\">\n <param name=\"front_adapter_file\" argument=\"-g\" format=\"fasta\" type=\"data\" help=\"Should be of datatype "FASTA"\" label=\"Choose file containing 5' adapters\" />\n </when>\n </conditional>\n </repeat>\n\n <repeat name=\"anywhere_adapters\" title=\"5' or 3' (Anywhere) Adapters\" help=\"Sequence of an adapter that may be ligated to the 5' or 3' end (paired data: of the first read). Both types of matches as described under 3' und 5' Adapters are allowed. If the first base of the read is part of the match, the behavior is as with 5' Adapters, otherwise as with 3' Adapters. This option is mostly for rescuing failed library preparations - do not use if you know which end your adapter was ligated to!\">\n <conditional name=\"anywhere_adapter_source\">\n <param name=\"anywhere_adapter_source_list\" type=\"select\" label=\"Source\">\n <option value=\"builtin\" selected=\"True\">Standard (select from the list below)</option>\n <option value=\"user\">Enter custom sequence</option>\n <option value=\"file\">File from history</option>\n </param>\n\n <when value=\"user\">\n <param name=\"anywhere_adapter_name\" type=\"text\" value=\"\" optional=\"True\" label=\"Enter custom 5' or 3' adapter name (Optional if Multiple output is 'No')\" />\n <expand macro=\"adapter\" name=\"anywhere_adapter\" argument=\"-b\" value=\"AATTGGCC\" label=\"Enter custom 5' or 3' adapter sequence\" />\n </when>\n <when value=\"builtin\">\n <expand macro=\"adapter_select\" name=\"anywhere_adapter\" argument=\"-b\" label=\"Choose 5' or 3' adapter\"/>\n </when>\n <when value=\"file\">\n <param name=\"anywhere_adapter_file\" argument=\"-b\" format=\"fasta\" type=\"data\" help=\"Should be of datatype "FASTA"\" label=\"Choose file containing 3' or 5' adapters\" />\n </when>\n </conditional>\n </repeat>\n\n <param name=\"cut\" argument=\"--cut\" type=\"integer\" value=\"0\" optional=\"True\" label=\"Cut bases from reads before adapter trimming\" help=\"Remove bases from each read (first read only if paired). If positive, remove bases from the beginning. If negative, remove bases from the end. This is applied *before* adapter trimming.\" />\n\n </section>\n\n </xml>\n\n <xml name=\"paired_end_options\" >\n\n <!-- Read 1 Options -->\n <expand macro=\"single_end_options\" />\n\n <!-- Read 2 Options -->\n <section name=\"r2\" title=\"Read 2 Options\" expanded=\"True\">\n\n <repeat name=\"adapters2\" title=\"3' (End) Adapters\" help=\"Sequence of an adapter ligated to the 3' end of the second read in each pair. The adapter and subsequent bases are trimmed. If a '$' character is appended ('anchoring'), the adapter is only found if it is a suffix of the read. To search for a linked adapter, separate the 2 sequences with 3 dots (ADAPTER1...ADAPTER2), see Help below.\">\n <conditional name=\"adapter_source2\">\n <param name=\"adapter_source_list2\" type=\"select\" label=\"Source\" >\n <option value=\"builtin\" selected=\"True\">Standard (select from the list below)</option>\n <option value=\"user\">Enter custom sequence</option>\n <option value=\"file\">File from history</option>\n </param>\n\n <when value=\"user\">\n <param name=\"adapter_name2\" type=\"text\" value=\"\" optional=\"True\" label=\"Enter custom 3' adapter name (Optional)\" />\n <expand macro=\"adapter\" name=\"adapter2\" argument=\"-A\" label=\"Enter custom 3' adapter sequence\" value=\"AATTGGCC\" />\n </when>\n\n <when value=\"builtin\">\n <expand macro=\"adapter_select\" name=\"adapter2\" argument=\"-A\" label=\"Choose 3' adapter\"/>\n </when>\n <when value=\"file\">\n <param name=\"adapter_file2\" argument=\"-a\" format=\"fasta\" type=\"data\" help=\"Should be of datatype "FASTA"\" label=\"Choose file containing 3' adapters\" />\n </when>\n </conditional>\n </repeat>\n\n <repeat name=\"front_adapters2\" title=\"5' (Front) Adapters\" help=\"Sequence of an adapter ligated to the 5' end of the second read in each pair. The adapter and any preceding bases are trimmed. Partial matches at the 5' end are allowed. If a '^' character is prepended ('anchoring'), the adapter is only found if it is a prefix of the read. To search for a linked adapter, separate the 2 sequences with 3 dots (ADAPTER1...ADAPTER2), see Help below.\">\n <conditional name=\"front_adapter_source2\">\n <param name=\"front_adapter_source_list2\" type=\"select\" label=\"Source\">\n <option value=\"builtin\" selected=\"True\">Standard (select from the list below)</option>\n <option value=\"user\">Enter custom sequence</option>\n <option value=\"file\">File from history</option>\n </param>\n\n <when value=\"user\">\n <param name=\"front_adapter_name2\" type=\"text\" value=\"\" label=\"Enter custom 5' adapter name (Optional)\" />\n <expand macro=\"adapter\" name=\"front_adapter2\" argument=\"-G\" value=\"AATTGGCC\" label=\"Enter custom 5' adapter sequence\" />\n </when>\n <when value=\"builtin\">\n <expand macro=\"adapter_select\" name=\"front_adapter2\" argument=\"-G\" label=\"Choose 5' adapter\"/>\n </when>\n <when value=\"file\">\n <param name=\"front_adapter_file2\" argument=\"-g\" format=\"fasta\" type=\"data\" help=\"Should be of datatype "FASTA"\" label=\"Choose file containing 5' adapters\" />\n </when>\n </conditional>\n </repeat>\n\n <repeat name=\"anywhere_adapters2\" title=\"5' or 3' (Anywhere) Adapters\" help=\"Sequence of an adapter that may be ligated to the 5' or 3' end of the second read in each pair. Both types of matches as described under under 3' und 5' Adapters are allowed. If the first base of the read is part of the match, the behavior is as with 5' Adapters, otherwise as with 3' Adapters. This option is mostly for rescuing failed library preparations - do not use if you know which end your adapter was ligated to!\">\n <conditional name=\"anywhere_adapter_source2\">\n <param name=\"anywhere_adapter_source_list2\" type=\"select\" label=\"Source\">\n <option value=\"builtin\" selected=\"True\">Standard (select from the list below)</option>\n <option value=\"user\">Enter custom sequence</option>\n <option value=\"file\">File from history</option>\n </param>\n\n <when value=\"user\">\n <param name=\"anywhere_adapter_name2\" type=\"text\" value=\"\" optional=\"True\" label=\"Enter custom 5' or 3' adapter name (Optional)\" />\n <expand macro=\"adapter\" name=\"anywhere_adapter2\" argument=\"-B\" label=\"Enter custom 5' or 3' adapter sequence\" value=\"AATTGGCC\" />\n </when>\n <when value=\"builtin\">\n <expand macro=\"adapter_select\" name=\"anywhere_adapter2\" argument=\"-B\" type=\"select\" label=\"Choose 5' or 3' adapter\"/>\n </when>\n <when value=\"file\">\n <param name=\"anywhere_adapter_file2\" argument=\"-b\" format=\"fasta\" type=\"data\" help=\"Should be of datatype "FASTA"\" label=\"Choose file containing 3' or 5' adapters\" />\n </when>\n </conditional>\n </repeat>\n\n <param name=\"cut2\" argument=\"-U\" type=\"integer\" value=\"0\" optional=\"True\" label=\"Cut bases from the second read in each pair.\" help=\"Remove bases from the beginning or end of each read before trimming adapters. If positive, the bases are removed from the beginning of each read. If negative, the bases are removed from the end of each read.\" />\n\n </section>\n\n </xml>\n\n <xml name=\"inherit_format_1\">\n <actions>\n <conditional name=\"library.type\">\n <when value=\"single\">\n <action type=\"format\">\n <option type=\"from_param\" name=\"library.input_1\" param_attribute=\"ext\" />\n </action>\n </when>\n <when value=\"paired\">\n <action type=\"format\">\n <option type=\"from_param\" name=\"library.input_1\" param_attribute=\"ext\" />\n </action>\n </when>\n </conditional>\n </actions>\n </xml>\n\n <xml name=\"inherit_format_2\">\n <actions>\n <conditional name=\"library.type\">\n <when value=\"paired\">\n <action type=\"format\">\n <option type=\"from_param\" name=\"library.input_2\" param_attribute=\"ext\" />\n </action>\n </when>\n </conditional>\n </actions>\n </xml>\n\n</macros>\n", "meta": {"content_hash": "7273be33487bd7118b51d835119d7da2", "timestamp": "", "source": "github", "line_count": 381, "max_line_length": 516, "avg_line_length": 58.55380577427822, "alnum_prop": 0.5371374781478327, "repo_name": "pjbriggs/tools-iuc", "id": "ba2b0fa5f8f53a75a531ba72d37f85cc9aaac6df", "size": "22309", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tools/cutadapt/macros.xml", "mode": "33188", "license": "mit", "language": [{"name": "C++", "bytes": "4220"}, {"name": "HTML", "bytes": "11558401"}, {"name": "Mako", "bytes": "2116"}, {"name": "Max", "bytes": "140358"}, {"name": "OpenEdge ABL", "bytes": "1960016"}, {"name": "Pep8", "bytes": "87474"}, {"name": "Perl", "bytes": "58627"}, {"name": "Python", "bytes": "741604"}, {"name": "R", "bytes": "268177"}, {"name": "Rebol", "bytes": "1225"}, {"name": "Roff", "bytes": "3011"}, {"name": "Shell", "bytes": "84319"}, {"name": "UnrealScript", "bytes": "660637"}, {"name": "eC", "bytes": "24"}]}} +{"text": "'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar React = require('react');\nvar tooltip = require('primereact/tooltip');\nvar utils = require('primereact/utils');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n}\n\nvar React__namespace = /*#__PURE__*/_interopNamespace(React);\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nvar InputSwitch = /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {\n var _React$useState = React__namespace.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n focusedState = _React$useState2[0],\n setFocusedState = _React$useState2[1];\n\n var elementRef = React__namespace.useRef(null);\n var inputRef = React__namespace.useRef(props.inputRef);\n var checked = props.checked === props.trueValue;\n\n var onClick = function onClick(event) {\n if (props.disabled) {\n return;\n }\n\n toggle(event);\n utils.DomHandler.focus(inputRef.current);\n event.preventDefault();\n };\n\n var toggle = function toggle(event) {\n if (props.onChange) {\n var value = checked ? props.falseValue : props.trueValue;\n props.onChange({\n originalEvent: event,\n value: value,\n stopPropagation: function stopPropagation() {},\n preventDefault: function preventDefault() {},\n target: {\n name: props.name,\n id: props.id,\n value: value\n }\n });\n }\n };\n\n var onFocus = function onFocus(event) {\n setFocusedState(true);\n props.onFocus && props.onFocus(event);\n };\n\n var onBlur = function onBlur(event) {\n setFocusedState(false);\n props.onBlur && props.onBlur(event);\n };\n\n React__namespace.useImperativeHandle(ref, function () {\n return _objectSpread({\n getElement: function getElement() {\n return elementRef.current;\n },\n getInput: function getInput() {\n return elementRef.current;\n }\n }, props);\n });\n React__namespace.useEffect(function () {\n utils.ObjectUtils.combinedRefs(inputRef, props.inputRef);\n }, [inputRef, props.inputRef]);\n var hasTooltip = utils.ObjectUtils.isNotEmpty(props.tooltip);\n var otherProps = utils.ObjectUtils.findDiffKeys(props, InputSwitch.defaultProps);\n var className = utils.classNames('p-inputswitch p-component', {\n 'p-inputswitch-checked': checked,\n 'p-disabled': props.disabled,\n 'p-focus': focusedState\n }, props.className);\n return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(\"div\", _extends({\n ref: elementRef,\n id: props.id,\n className: className,\n style: props.style\n }, otherProps, {\n onClick: onClick,\n role: \"checkbox\",\n \"aria-checked\": checked\n }), /*#__PURE__*/React__namespace.createElement(\"div\", {\n className: \"p-hidden-accessible\"\n }, /*#__PURE__*/React__namespace.createElement(\"input\", {\n ref: inputRef,\n type: \"checkbox\",\n id: props.inputId,\n name: props.name,\n checked: checked,\n onChange: toggle,\n onFocus: onFocus,\n onBlur: onBlur,\n disabled: props.disabled,\n role: \"switch\",\n tabIndex: props.tabIndex,\n \"aria-checked\": checked,\n \"aria-labelledby\": props['aria-labelledby'],\n \"aria-label\": props['aria-label']\n })), /*#__PURE__*/React__namespace.createElement(\"span\", {\n className: \"p-inputswitch-slider\"\n })), hasTooltip && /*#__PURE__*/React__namespace.createElement(tooltip.Tooltip, _extends({\n target: elementRef,\n content: props.tooltip\n }, props.tooltipOptions)));\n}));\nInputSwitch.displayName = 'InputSwitch';\nInputSwitch.defaultProps = {\n __TYPE: 'InputSwitch',\n id: null,\n inputRef: null,\n style: null,\n className: null,\n inputId: null,\n name: null,\n tabIndex: null,\n checked: false,\n trueValue: true,\n falseValue: false,\n disabled: false,\n tooltip: null,\n tooltipOptions: null,\n 'aria-label': null,\n 'aria-labelledby': null,\n onChange: null,\n onFocus: null,\n onBlur: null\n};\n\nexports.InputSwitch = InputSwitch;\n", "meta": {"content_hash": "094e587a17c4ee77902e347534369fb8", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 506, "avg_line_length": 30.248995983935743, "alnum_prop": 0.6319702602230484, "repo_name": "cdnjs/cdnjs", "id": "b263e1fd46e8ff5512b9d5b112066e325aa0c9ac", "size": "7532", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ajax/libs/primereact/8.3.0/inputswitch/inputswitch.cjs.js", "mode": "33188", "license": "mit", "language": []}} +{"text": "var Event = function Event(Title, WorldWar, SocialStability, TechnologicalProgress, Message, Event_Variable) {\n this.Title = Title;\n this.WorldWar = WorldWar;\n this.SocialStability = SocialStability;\n this.TechnologicalProgress = TechnologicalProgress;\n this.Message = Message;\n this.Event_Variable = Event_Variable;\n}\n\n//Protoype allows us to implement pseudoclasses into Javascript.\n//It is necessary to define the 'call' method on the Event Constructor so that we can trigger the\n//event's effects.\nEvent.prototype = {\n call: function() {\n Metrics.WorldWar += this.WorldWar;\n Metrics.SocialStability += this.SocialStability;\n Metrics.TechnologicalProgress += this.TechnologicalProgress;\n if (this.Event_Variable == \"CityFive\")\n {\n CityFive = true;\n }\n return (this.Message + \"<button class='deleteEvent' id='\"+this.Title+\"'>Delete</button>\")\n }\n};\n\n\n//An EmptyEvent exist if you delete an event from the Timeline. It is created\n//so that I don't have to worry about calling \"undefined\" events.\nvar EmptyEvent = function () {\n}\n\n//At the beginning of the game, the following four events are inserted into the Timeline and are triggered.\n//new Event(WorldWar, SocialStability, TechnologicalProgress, Message, optional Event_Varaible)\nvar CityFiveBuilt = new Event(\"CityFiveBuilt\",-20,0,20, CITY_FIVE_BUILT,\"CityFive\")\n\nvar TheOrder = new Event(\"TheOrder\",0,20,-20, THE_ORDER);\n//In the original version of Zybourne Clock, Dr. Zybourne developed his time-travelling Clock after the World War. But I do not want to implement events being dependent on each other until AFTER the MVP.\nvar ClockInvented = new Event(\"ClockInvented\", -20,0,20, CLOCK_INVENTED);\n\nvar Zepplins = new Event(\"Zepplins\",-20,20,0, ZEPPLINS);\n\n//These events are in the Player's hand at the start of Zybourne Clock Redux. This is just a MVP, so I only have two events here for now.\nvar ChildSpybots = new Event(\"ChildSpybots\",20,-20,0, CHILD_SPYBOTS)\n\nvar Vaundermause = new Event(\"Vaundermause\",20,0,-20, VAUNDERMAUSE)\n\nvar SocialPlanningRevolution = new Event(\"SocialPlanningRevolution\",-40,20,20, SOCIAL_PLANNING)\n\nvar Nanotech = new Event(\"Nanotech\",20,-40,20, NANOTECH)\n\nvar LuddistCrusade = new Event(\"LuddistCrusade\",0,40,-40, LUDDIST_CRUSADE)\n\nvar Timeline = []\n\nvar PlayerHand = [ChildSpybots, Vaundermause, SocialPlanningRevolution, Nanotech, LuddistCrusade]\n", "meta": {"content_hash": "14b4e1f5ba710e7c0cdf6fef5a72fcd1", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 203, "avg_line_length": 43.163636363636364, "alnum_prop": 0.7502106149957877, "repo_name": "tra38/Zybourne-Clock-Redux", "id": "37a1a89af37f147eccff2172bb4682b95be13b1b", "size": "2533", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/assets/javascripts/timeline_events.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "928"}, {"name": "CoffeeScript", "bytes": "211"}, {"name": "HTML", "bytes": "7737"}, {"name": "JavaScript", "bytes": "22687"}, {"name": "Ruby", "bytes": "21100"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing MonoTouch.Foundation;\nusing MonoTouch.UIKit;\n\nnamespace Linq2TwitterSample\n{\n\t// The UIApplicationDelegate for the application. This class is responsible for launching the\n\t// User Interface of the application, as well as listening (and optionally responding) to\n\t// application events from iOS.\n\t[Register (\"AppDelegate\")]\n\tpublic partial class AppDelegate : UIApplicationDelegate\n\t{\n\t\t// class-level declarations\n\t\t\n\t\tpublic override UIWindow Window {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\t\t\n\t\t// This method is invoked when the application is about to move from active to inactive state.\n\t\t// OpenGL applications should use this method to pause.\n\t\tpublic override void OnResignActivation (UIApplication application)\n\t\t{\n\t\t}\n\t\t\n\t\t// This method should be used to release shared resources and it should store the application state.\n\t\t// If your application supports background exection this method is called instead of WillTerminate\n\t\t// when the user quits.\n\t\tpublic override void DidEnterBackground (UIApplication application)\n\t\t{\n\t\t}\n\t\t\n\t\t// This method is called as part of the transiton from background to active state.\n\t\tpublic override void WillEnterForeground (UIApplication application)\n\t\t{\n\t\t}\n\t\t\n\t\t// This method is called when the application is about to terminate. Save data, if needed.\n\t\tpublic override void WillTerminate (UIApplication application)\n\t\t{\n\t\t}\n\t}\n}\n\n", "meta": {"content_hash": "dcc28da19aa0881a6b9bc1aa83aad202", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 102, "avg_line_length": 30.595744680851062, "alnum_prop": 0.7600834492350487, "repo_name": "SotoiGhost/Linq2TwitterSample", "id": "4197deb07c8adc0a020d77dec7abc30d27d93584", "size": "1440", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Linq2TwitterSample/AppDelegate.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "6431"}]}} +{"text": "package nl.soccar.library.test;\r\n\r\nimport java.time.LocalTime;\r\nimport java.util.Optional;\r\nimport nl.soccar.library.Event;\r\nimport nl.soccar.library.Game;\r\nimport nl.soccar.library.Player;\r\nimport nl.soccar.library.enumeration.CarType;\r\nimport nl.soccar.library.enumeration.Duration;\r\nimport nl.soccar.library.enumeration.EventType;\r\nimport nl.soccar.library.enumeration.GameStatus;\r\nimport nl.soccar.library.enumeration.Privilege;\r\nimport nl.soccar.ui.DisplayConstants;\r\nimport org.junit.Before;\r\nimport org.junit.Test;\r\nimport static org.junit.Assert.*;\r\n\r\n/**\r\n * JUnit test that tests the nl.soccar.library.Game class.\r\n *\r\n * @author PTS34A\r\n */\r\npublic class GameTest {\r\n\r\n // Declaration of test objects.\r\n private Player player;\r\n private Event event;\r\n private Game game;\r\n\r\n /**\r\n * Instantiation of test objects.\r\n */\r\n @Before\r\n public void setUp() {\r\n player = new Player(\"username\", Privilege.NORMAL, CarType.CASUAL);\r\n event = new Event(EventType.GOAL_RED, LocalTime.of(13, 55, 03), player);\r\n game = new Game();\r\n }\r\n\r\n /**\r\n * Tests the start method.\r\n */\r\n @Test\r\n public void startTest() {\r\n game.start();\r\n assertEquals(GameStatus.RUNNING, game.getStatus());\r\n }\r\n\r\n /**\r\n * Tests the stop method.\r\n */\r\n @Test\r\n public void stopTest() {\r\n game.stop();\r\n assertEquals(GameStatus.STOPPED, game.getStatus());\r\n }\r\n\r\n /**\r\n * Tests the addEvent and getEvents methods.\r\n */\r\n @Test\r\n public void addEventAndGetEventsTest() {\r\n game.addEvent(event);\r\n assertEquals(event, game.getEvents().get(0));\r\n }\r\n\r\n /**\r\n * Tests the getStarttime method.\r\n */\r\n @Test\r\n public void getStartTimeTest() {\r\n assertEquals(Optional.empty(), game.getStartTime());\r\n }\r\n\r\n /**\r\n * Tests the getStatus and setStatus methods.\r\n */\r\n @Test\r\n public void getStatusAndSetStatusTest() {\r\n assertEquals(GameStatus.STOPPED, game.getStatus());\r\n game.setStatus(GameStatus.SCORED);\r\n assertEquals(GameStatus.SCORED, game.getStatus());\r\n }\r\n\r\n /**\r\n * Tests the getDuration and setDuration methods.\r\n */\r\n @Test\r\n public void getDurationAndSetDurationTest() {\r\n game.setDuration(Duration.MINUTES_3);\r\n assertEquals(Duration.MINUTES_3, game.getDuration());\r\n }\r\n\r\n /**\r\n * Tests the getMap method.\r\n */\r\n @Test\r\n public void getMapTest() {\r\n assertEquals(0, Math.round(game.getMap().getSize().getX()));\r\n assertEquals(0, Math.round(game.getMap().getSize().getY()));\r\n assertEquals(Math.round(DisplayConstants.MAP_WIDTH), Math.round(game.getMap().getSize().getWidth()));\r\n assertEquals(Math.round(DisplayConstants.MAP_HEIGHT), Math.round(game.getMap().getSize().getHeight()));\r\n }\r\n \r\n /**\r\n * Tests the getLastBallTouched andSetLastBallTouched methods.\r\n */\r\n @Test\r\n public void getLastBallTouchedAndSetLastBallTouchedTest() {\r\n game.setLastBallTouched(player);\r\n assertEquals(player, game.getLastBallTouched());\r\n }\r\n \r\n}\r\n", "meta": {"content_hash": "efcaef1e7ed640ec248955d49738e987", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 111, "avg_line_length": 27.69298245614035, "alnum_prop": 0.6262274311054798, "repo_name": "PTS3-S34A/Soccar", "id": "c2bb3a3834ae9819ea3957941f620832347a8138", "size": "3157", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Soccar [Client]/test/nl/soccar/library/test/GameTest.java", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1119"}, {"name": "Java", "bytes": "191451"}]}} +{"text": "\r\n// tjh Headers\r\n#include \"../src/Publisher.h\"\r\n\r\n// System Headers\r\n#include <functional>\r\n#include <memory>\r\n#include <iostream>\r\n#include <string>\r\n\r\nnamespace tjh\r\n{\r\nnamespace example\r\n{\r\n\r\n//! A listener class which subscribes to an exterior publication.\r\nclass Client\r\n{\r\npublic:\r\n //! @note: There is no constraint requiring an IPublisher to be passed into the\r\n //! constructor of a listener, this pattern was simply used to demonstrate the \r\n //! mechanism of subscription. The shared_ptr callback and the IPublisher object\r\n //! just, at some point, need to exist in the same scope.\r\n Client(IPublisher<int, const std::string&>& publisher)\r\n {\r\n // If the Client is going to subsribe to publications, it needs to create\r\n // a callback object. This callback object is a shared_ptr owned by the \r\n // Client; the callback will have the same life-span as the naked\r\n // \"this\" created within the bound function. This ensures that the\r\n // bound function is either valid, or its parent shared_ptr has\r\n // already been destructed because the object itself no longer exists.\r\n _callback =\r\n tjh::make_callback(&Client::handler, this);\r\n\r\n // The shared_ptr is provided to the IPublisher interface, and the IPublisher\r\n // interface holds a weak_ptr that is checked for validity before the callback is\r\n // fired.\r\n publisher.subscribe(_callback);\r\n }\r\n\r\nprivate:\r\n void handler(int a, const std::string& b)\r\n {\r\n // Published arguments!\r\n std::cout << __FUNCTION__ << \": a=\" << a << \", b=\" << b << std::endl;\r\n\r\n // Upon receiving a publication from the subscriber, the listener has determined\r\n // it no longer needs to exist, so it deletes itself. This deletion nulls the\r\n // weak_ptr held in the IPublisher object which will be cleaned up during the\r\n // next publication.\r\n // @note: The below line ONLY works if the object was heap allocated; if the \r\n // object was allocated on the stack, a double deletion will occur.\r\n delete this;\r\n }\r\n\r\n // The callback object enforces the requirement that this instance's lifetime is the\r\n // same as the contained function's lifetime.\r\n std::shared_ptr<std::function<void(int, const std::string&)>> _callback;\r\n};\r\n\r\nclass Primary : public IPublisher<int, const std::string&>\r\n{\r\npublic:\r\n virtual void subscribe(std::weak_ptr<std::function<void(int, const std::string&)> > callback)\r\n {\r\n // This is a simple pass through to the composed publisher.\r\n _publisher.subscribe(callback);\r\n }\r\n\r\n void doSomething(int a, const std::string& b)\r\n {\r\n // Publish the contents of a and b to any listeners.\r\n _publisher.publish(a, b);\r\n }\r\n\r\nprivate:\r\n tjh::Publisher<Primary, int, const std::string&> _publisher;\r\n};\r\n\r\n} // end example\r\n} // end tjh\r\n\r\n#endif // EXAMPLE_H", "meta": {"content_hash": "38729259009835b30d73bdffd602ffb1", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 97, "avg_line_length": 35.734939759036145, "alnum_prop": 0.6429534726904923, "repo_name": "tjhalva/Publisher", "id": "e5f194b73824ab8ce47569e6a7eb58272522308b", "size": "3004", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/Example.h", "mode": "33188", "license": "mit", "language": [{"name": "C++", "bytes": "13338"}]}} +{"text": "module RspecWiki\n class Markdown\n\n attr_reader :context\n\n def initialize context\n @context = context\n end\n\n def anchor_link\n { anchor_group => \"* [#{title_with_status}](#{RspecWiki.configuration.wiki_page_url}##{title_anchor})\"}\n end\n\n def anchor_group\n return \"#{h3}#{context.metadata[:group]}\" if context.metadata[:group].present?\n described_class = context.described_class.split(\"::\").last\n described_class.gsub!('Controller', '')\n described_class.underscore.humanize.prepend(h3)\n end\n\n def print\n <<-EOC\n#{header}\n#{body}\n#{footer}\n EOC\n end\n\n def header\n \"#{h3}#{title}\"\n end\n\n def body\n <<-EOC\n#{description}\n#{url} | #{request_method}\n\n#{parameters}\n\nResponse\n#{status}\n#{javascript(context.response_body)}\n EOC\n end\n\n def footer\n <<-EOC\n#{ back_to_table_of_content }\n\n#{ '='*100 }\n EOC\n end\n\n\n def description\n <<-EOC\n`#{context.content}`\n EOC\n end\n\n def status\n \"Status: \\`#{context.response_status}\\`\"\n end\n\n def parameters\n \"Parameters: #{format_params}\"\n end\n\n def url\n \"URL: __#{context.request_path}__\"\n end\n\n def request_method\n \"Method: \\`#{context.request_method}\\`\"\n end\n\n private\n\n def title\n (context.metadata[:title] || context.content).humanize\n end\n\n def title_with_status\n status = context.response_success? ? \"(SUCCESS)\" : \"(ERROR)\"\n \"#{title} #{status}\"\n end\n\n def title_anchor\n title.downcase.gsub(/\\s+/, '-')\n end\n\n def format_params\n context.params.collect do |key, value|\n \"\\`#{key}\\` => #{value}\"\n end.join(\"\\n\\n\")\n end\n\n def h3\n '###'\n end\n\n def javascript content\n <<-EOC\n```javascript\n#{content}\n```\n EOC\n end\n\n def back_to_table_of_content\n \"[Back to table of contents](#{RspecWiki.configuration.wiki_page_url}#table-of-contents)\"\n end\n end\nend", "meta": {"content_hash": "8be93f2c1b0eacfea0fd5da8a1eefd47", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 109, "avg_line_length": 17.13157894736842, "alnum_prop": 0.5734767025089605, "repo_name": "nlds90/rspec_wiki", "id": "91ac239716d4a828d05ed2680bc618fa37860b8b", "size": "1953", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/rspec_wiki/formatter/markdown.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "683"}, {"name": "HTML", "bytes": "4883"}, {"name": "JavaScript", "bytes": "599"}, {"name": "Ruby", "bytes": "26134"}]}} +{"text": "ACCEPTED\n\n#### According to\nIndex Fungorum\n\n#### Published in\nnull\n\n#### Original name\nGraphina chloroleuca M\u00fcll. Arg.\n\n### Remarks\nnull", "meta": {"content_hash": "b6d01ef3643e7f4bb4be5fd89fb77ee0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 10.461538461538462, "alnum_prop": 0.7058823529411765, "repo_name": "mdoering/backbone", "id": "808b6cdb5c3858b5bb710b66ea453efb4233e682", "size": "193", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Lecanoromycetes/Ostropales/Graphidaceae/Graphina/Graphina chloroleuca/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "//===----------------------------------------------------------------------===//\n//\n// Peloton\n//\n// abstract_scan_executor.h\n//\n// Identification: src/include/executor/abstract_scan_executor.h\n//\n// Copyright (c) 2015-17, Carnegie Mellon University Database Group\n//\n//===----------------------------------------------------------------------===//\n\n#pragma once\n\n#include \"executor/abstract_executor.h\"\n#include \"planner/abstract_scan_plan.h\"\n#include \"type/types.h\"\n\nnamespace peloton {\nnamespace executor {\n\n/**\n * Super class for different kinds of scan executor.\n * It provides common codes for all kinds of scan:\n * evaluate generic predicates and simple projections.\n */\nclass AbstractScanExecutor : public AbstractExecutor {\n public:\n AbstractScanExecutor(const AbstractScanExecutor &) = delete;\n AbstractScanExecutor &operator=(const AbstractScanExecutor &) = delete;\n AbstractScanExecutor(AbstractScanExecutor &&) = delete;\n AbstractScanExecutor &operator=(AbstractScanExecutor &&) = delete;\n\n explicit AbstractScanExecutor(const planner::AbstractPlan *node,\n ExecutorContext *executor_context);\n\n virtual void UpdatePredicate(const std::vector<oid_t> &column_ids\n UNUSED_ATTRIBUTE,\n const std::vector<type::Value> &values\n UNUSED_ATTRIBUTE) {}\n\n virtual void ResetState() {}\n\n protected:\n bool DInit();\n\n virtual bool DExecute() = 0;\n\n protected:\n //===--------------------------------------------------------------------===//\n // Plan Info\n //===--------------------------------------------------------------------===//\n\n /** @brief Selection predicate. */\n const expression::AbstractExpression *predicate_ = nullptr;\n\n /** @brief Columns from tile group to be added to logical tile output. */\n std::vector<oid_t> column_ids_;\n};\n\n} // namespace executor\n} // namespace peloton\n", "meta": {"content_hash": "2960e75f46996173b93b6cc917f7d2b6", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 80, "avg_line_length": 31.629032258064516, "alnum_prop": 0.5599184089750128, "repo_name": "prashasthip/peloton", "id": "44269c196dcea5898cbb03956693af6e9aef5d43", "size": "1961", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/include/executor/abstract_scan_executor.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "44625"}, {"name": "C++", "bytes": "5767040"}, {"name": "CMake", "bytes": "109338"}, {"name": "Java", "bytes": "44640"}, {"name": "Objective-C", "bytes": "4030"}, {"name": "PLpgSQL", "bytes": "5855"}, {"name": "Python", "bytes": "63317"}, {"name": "Ruby", "bytes": "1310"}, {"name": "Shell", "bytes": "14149"}]}} +{"text": "\"\"\"\nTest for controlnet.py\n\"\"\"\n\nimport unittest\nfrom mininet.util import pexpect\n\nfrom sys import stdout\n\nclass testControlNet( unittest.TestCase ):\n\n prompt = 'mininet>'\n\n def testPingall( self ):\n \"Simple pingall test that verifies 0% packet drop in data network\"\n p = pexpect.spawn( 'python -m mininet.examples.controlnet', logfile=stdout)\n p.expect( self.prompt )\n p.sendline( 'pingall' )\n p.expect ( '(\\d+)% dropped' )\n percent = int( p.match.group( 1 ) ) if p.match else -1\n self.assertEqual( percent, 0 )\n p.expect( self.prompt )\n p.sendline( 'exit' )\n p.wait()\n\n def testFailover( self ):\n \"Kill controllers and verify that switch, s1, fails over properly\"\n count = 1\n p = pexpect.spawn( 'python -m mininet.examples.controlnet', logfile=stdout )\n p.expect( self.prompt )\n lp = pexpect.spawn( 'tail -f /tmp/s1-ofp.log', logfile=stdout )\n lp.expect( 'tcp:\\d+\\.\\d+\\.\\d+\\.(\\d+):\\d+: connected' )\n ip = int( lp.match.group( 1 ) )\n self.assertEqual( count, ip )\n count += 1\n for c in [ 'c0', 'c1' ]:\n p.sendline( '%s ifconfig %s-eth0 down' % ( c, c) )\n p.expect( self.prompt )\n lp.expect( 'tcp:\\d+\\.\\d+\\.\\d+\\.(\\d+):\\d+: connected' )\n ip = int( lp.match.group( 1 ) )\n self.assertEqual( count, ip )\n count += 1\n p.sendline( 'exit' )\n p.wait()\n\nif __name__ == '__main__':\n unittest.main()\n", "meta": {"content_hash": "dcd1b25ea0159b021904f1dcfe18f9f6", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 84, "avg_line_length": 32.340425531914896, "alnum_prop": 0.5473684210526316, "repo_name": "mininet/mininet", "id": "7e7ce9a6ba6f8fc8254b1ac5348350c7707a9ff2", "size": "1543", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/test/test_controlnet.py", "mode": "33261", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "49941"}, {"name": "Makefile", "bytes": "2620"}, {"name": "Python", "bytes": "305497"}, {"name": "Shell", "bytes": "42436"}]}} +{"text": "\npackage org.apache.activemq.plugin.util;\n\nimport java.util.Set;\n\nimport org.apache.activemq.broker.region.Destination;\nimport org.apache.activemq.broker.region.DestinationFilter;\nimport org.apache.activemq.broker.region.Queue;\nimport org.apache.activemq.broker.region.RegionBroker;\nimport org.apache.activemq.broker.region.Topic;\nimport org.apache.activemq.broker.region.policy.PolicyEntry;\nimport org.apache.activemq.broker.region.policy.PolicyMap;\nimport org.apache.activemq.plugin.AbstractRuntimeConfigurationBroker;\n\n\npublic class PolicyEntryUtil {\n\n\n /**\n * Find a matching PolicyEntry by looking up the Set of entries from the map and\n * then comparing the destination to find the exact match. This lets us be able to\n * find the correct policy entry to update even though there might be multiple that\n * are returned from the get method of the PolicyMap.\n *\n * @param runtimeBroker\n * @param entry\n * @return\n */\n public static PolicyEntry findEntryByDestination(AbstractRuntimeConfigurationBroker runtimeBroker,\n PolicyEntry entry) {\n\n PolicyMap existingMap = runtimeBroker.getBrokerService().getDestinationPolicy();\n @SuppressWarnings(\"unchecked\")\n Set<PolicyEntry> existingEntries = existingMap.get(entry.getDestination());\n\n //First just look up by the destination type to see if anything matches\n PolicyEntry existingEntry = null;\n for (PolicyEntry ee: existingEntries) {\n if (ee.getDestination().equals(entry.getDestination())) {\n existingEntry = ee;\n break;\n }\n }\n return existingEntry;\n }\n\n /**\n * Utility to properly apply an updated policy entry to all existing destinations that\n * match this entry. The destination will only be updated if the policy is the exact\n * policy (most specific) that matches the destination.\n *\n * @param runtimeBroker\n * @param updatedEntry\n */\n public static void applyRetrospectively(AbstractRuntimeConfigurationBroker runtimeBroker,\n PolicyEntry updatedEntry) {\n PolicyEntryUtil.applyRetrospectively(runtimeBroker, updatedEntry, null);\n }\n\n /**\n *\n * Utility to properly apply an updated policy entry to all existing destinations that\n * match this entry. The destination will only be updated if the policy is the exact\n * policy (most specific) that matches the destination.\n *\n * The includedProperties List is optional and is used to specify a list of properties\n * to apply retrospectively to the matching destinations. This allows only certain properties\n * to be reapplied. If the list is null then all properties will be applied.\n *\n * @param runtimeBroker\n * @param updatedEntry\n * @param includedProperties\n */\n public static void applyRetrospectively(AbstractRuntimeConfigurationBroker runtimeBroker,\n PolicyEntry updatedEntry, Set<String> includedProperties) {\n RegionBroker regionBroker = (RegionBroker) runtimeBroker.getBrokerService().getRegionBroker();\n for (Destination destination : regionBroker.getDestinations(updatedEntry.getDestination())) {\n //Look up the policy that applies to the destination\n PolicyEntry specificyPolicy = regionBroker.getDestinationPolicy().getEntryFor(\n destination.getActiveMQDestination());\n\n //only update the destination if it matches the specific policy being updated\n //currently just an identity check which is what we want\n if (updatedEntry.equals(specificyPolicy)){\n Destination target = destination;\n while (target instanceof DestinationFilter) {\n target = ((DestinationFilter)target).getNext();\n }\n //If we are providing a list of properties to set then use them\n //to set eligible properties that are in the includedProperties list\n if (target.getActiveMQDestination().isQueue()) {\n updatedEntry.update((Queue) target, includedProperties);\n } else if (target.getActiveMQDestination().isTopic()) {\n updatedEntry.update((Topic) target, includedProperties);\n }\n runtimeBroker.debug(\"applied update to:\" + target);\n }\n }\n }\n}\n", "meta": {"content_hash": "e5788ae49aded600bd76b08b5bfa8db1", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 102, "avg_line_length": 44.22, "alnum_prop": 0.6840796019900498, "repo_name": "chirino/activemq", "id": "64d752810dda8af64641ce340e80c1bc5389316c", "size": "5225", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "activemq-runtime-config/src/main/java/org/apache/activemq/plugin/util/PolicyEntryUtil.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "17712"}, {"name": "C#", "bytes": "27536"}, {"name": "C++", "bytes": "17404"}, {"name": "CSS", "bytes": "34997"}, {"name": "HTML", "bytes": "158883"}, {"name": "Java", "bytes": "25304453"}, {"name": "JavaScript", "bytes": "438641"}, {"name": "PHP", "bytes": "3665"}, {"name": "Perl", "bytes": "4128"}, {"name": "Protocol Buffer", "bytes": "13867"}, {"name": "Python", "bytes": "14547"}, {"name": "Ruby", "bytes": "6594"}, {"name": "Scala", "bytes": "302023"}, {"name": "Shell", "bytes": "87001"}]}} +{"text": "module Syntax where\n\ndata Type =\n TyBool\n | TyNat\n deriving (Show, Eq)\n\ndata Term =\n TmTrue\n | TmFalse\n | TmIf Term Term Term\n | TmZero\n | TmSucc Term\n | TmPred Term\n | TmIsZero Term\n deriving Show\n\ntype Error = String\n", "meta": {"content_hash": "9fb7a16903e2a0e71f1533024c613e85", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 29, "avg_line_length": 13.88888888888889, "alnum_prop": 0.608, "repo_name": "kellino/TypeSystems", "id": "030956f76a40bfff9cad12cb7446bef6451120a3", "size": "250", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "typedArith/Syntax.hs", "mode": "33188", "license": "mit", "language": [{"name": "Agda", "bytes": "27249"}, {"name": "Haskell", "bytes": "103038"}]}} +{"text": "<?php\n\nnamespace App\\ApiModule\\Presenters;\n\n\nuse Nette\\Application\\UI\\Presenter;\nuse Nette\\Http;\n\nabstract class BasePresenter extends Presenter\n{\n public function error($message = NULL, $code = Http\\IResponse::S404_NOT_FOUND)\n {\n $this->getHttpResponse()->setCode($code);\n\n $this->sendJson([\n 'success' => false,\n 'error' => $code,\n 'message' => $message\n ]);\n }\n\n}", "meta": {"content_hash": "4d242af7c0728bb13a675e53ae740a3e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 82, "avg_line_length": 19.5, "alnum_prop": 0.5920745920745921, "repo_name": "vitush93/rocnikac", "id": "8f9b7b86302ee26da7fec9f36ac31e32c5a0f5de", "size": "429", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/ApiModule/presenters/BasePresenter.php", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ApacheConf", "bytes": "884"}, {"name": "CSS", "bytes": "533582"}, {"name": "HTML", "bytes": "149898"}, {"name": "JavaScript", "bytes": "1152173"}, {"name": "PHP", "bytes": "202353"}, {"name": "Shell", "bytes": "165"}]}} +{"text": "<?php\n\nif (!defined('CC_CRON')) { echo \"NO DICE\"; exit; }\n\ninclude_once(dirname(__FILE__).DIRECTORY_SEPARATOR.\"config.php\");\n\nif ((!empty($_REQUEST['cron']['type']) && $_REQUEST['cron']['type'] == \"all\") || !empty($_REQUEST['cron']['modules'])) {\n\tchatrooms();\n\tchatroommessages();\n\tchatroomsusers();\n} else {\n\tif(isset($_REQUEST['cron']['inactiverooms'])){chatrooms();}\n\tif(isset($_REQUEST['cron']['chatroommessages'])){chatroommessages();}\n\tif(isset($_REQUEST['cron']['inactiveusers'])){chatroomsusers();}\n}\n\nfunction chatrooms() {\n\tglobal $chatroomTimeout;\n\t$sql = (\"delete from cometchat_chatrooms where createdby <> 0 and lastactivity < (\".getTimeStamp().\"- \".$chatroomTimeout.\" )\");\n\t$query = mysqli_query($GLOBALS['dbh'],$sql);\n\tif (defined('DEV_MODE') && DEV_MODE == '1') { echo mysqli_error($GLOBALS['dbh']); }\n}\n\nfunction chatroommessages() {\n\t$sql = (\"delete from cometchat_chatroommessages where sent < (\".getTimeStamp().\"-10800)\");\n\t$query = mysqli_query($GLOBALS['dbh'],$sql);\n\tif (defined('DEV_MODE') && DEV_MODE == '1') { echo mysqli_error($GLOBALS['dbh']); }\n}\n\nfunction chatroomsusers() {\n\t$sql = (\"delete from cometchat_chatrooms_users where lastactivity < (\".getTimeStamp().\"-3600)\");\n\t$query = mysqli_query($GLOBALS['dbh'],$sql);\n\tif (defined('DEV_MODE') && DEV_MODE == '1') { echo mysqli_error($GLOBALS['dbh']); }\n}\n", "meta": {"content_hash": "8e0b23f3352032d87953dc785769ea1b", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 128, "avg_line_length": 39.35294117647059, "alnum_prop": 0.6434977578475336, "repo_name": "networksoft/erp.wellnet", "id": "3c6df67a6c6cd7a1f410f8f7f952e99499aa8f3b", "size": "1338", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cometchat/modules/chatrooms/cron.php", "mode": "33261", "license": "apache-2.0", "language": [{"name": "ApacheConf", "bytes": "383"}, {"name": "Batchfile", "bytes": "310"}, {"name": "C", "bytes": "479526"}, {"name": "CSS", "bytes": "916036"}, {"name": "Groff", "bytes": "60910"}, {"name": "HTML", "bytes": "7195685"}, {"name": "JavaScript", "bytes": "1616267"}, {"name": "Makefile", "bytes": "16519"}, {"name": "PHP", "bytes": "12824429"}, {"name": "Perl", "bytes": "50950"}, {"name": "Shell", "bytes": "27957"}]}} +{"text": "package io.advantageous.qbit.service.dispatchers;\n\nimport io.advantageous.qbit.service.ServiceBuilder;\nimport io.advantageous.qbit.service.ServiceQueue;\n\nimport java.util.concurrent.TimeUnit;\nimport java.util.function.Supplier;\n\n\npublic class ShardedServiceWorkerBuilder {\n\n /**\n * Shard rule, if you don't set a shard rule, you get shard of first argument.\n * Shard rule by default.\n */\n private ShardRule shardRule;\n private ServiceBuilder serviceBuilder;\n private ServiceWorkers serviceDispatcher;\n private int workerCount = -1;\n private int flushInterval = -1;\n private TimeUnit timeUnit = TimeUnit.MILLISECONDS;\n private Supplier<Object> serviceObjectSupplier;\n\n public static ShardedServiceWorkerBuilder shardedServiceWorkerBuilder() {\n return new ShardedServiceWorkerBuilder();\n }\n\n public Supplier<Object> getServiceObjectSupplier() {\n return serviceObjectSupplier;\n }\n\n public ShardedServiceWorkerBuilder setServiceObjectSupplier(Supplier<Object> serviceObjectSupplier) {\n this.serviceObjectSupplier = serviceObjectSupplier;\n return this;\n }\n\n public int getWorkerCount() {\n if (workerCount == -1) {\n workerCount = Runtime.getRuntime().availableProcessors();\n }\n return workerCount;\n }\n\n public ShardedServiceWorkerBuilder setWorkerCount(int workerCount) {\n this.workerCount = workerCount;\n return this;\n }\n\n public ShardRule getShardRule() {\n if (shardRule == null) {\n final int workerCount = this.getWorkerCount();\n shardRule = (methodName, methodArgs, numWorkers) -> methodArgs[0].hashCode() % workerCount;\n }\n return shardRule;\n }\n\n public ShardedServiceWorkerBuilder setShardRule(ShardRule shardRule) {\n this.shardRule = shardRule;\n return this;\n }\n\n public ServiceBuilder getServiceBuilder() {\n if (serviceBuilder == null) {\n serviceBuilder = ServiceBuilder.serviceBuilder();\n return serviceBuilder;\n }\n return serviceBuilder.copy();\n }\n\n public ShardedServiceWorkerBuilder setServiceBuilder(ServiceBuilder serviceBuilder) {\n this.serviceBuilder = serviceBuilder;\n return this;\n }\n\n\n public ServiceWorkers getServiceDispatcher() {\n if (serviceDispatcher == null) {\n\n if (this.flushInterval == -1) {\n serviceDispatcher = ServiceWorkers.shardedWorkers(getShardRule());\n } else {\n serviceDispatcher = ServiceWorkers.shardedWorkers(getFlushInterval(),\n getTimeUnit(), getShardRule());\n }\n }\n return serviceDispatcher;\n }\n\n public ShardedServiceWorkerBuilder setServiceDispatcher(ServiceWorkers serviceDispatcher) {\n this.serviceDispatcher = serviceDispatcher;\n return this;\n }\n\n public int getFlushInterval() {\n return flushInterval;\n }\n\n public ShardedServiceWorkerBuilder setFlushInterval(int flushInterval) {\n this.flushInterval = flushInterval;\n return this;\n }\n\n public TimeUnit getTimeUnit() {\n return timeUnit;\n }\n\n public ShardedServiceWorkerBuilder setTimeUnit(TimeUnit timeUnit) {\n this.timeUnit = timeUnit;\n return this;\n }\n\n public ServiceMethodDispatcher build() {\n\n if (getServiceObjectSupplier() == null) {\n throw new IllegalStateException(\"serviceObjectSupplier must be set\");\n }\n final ServiceBuilder serviceBuilder = getServiceBuilder();\n\n for (int index = 0; index < getWorkerCount(); index++) {\n final ServiceQueue serviceQueue = serviceBuilder\n .setServiceObject(getServiceObjectSupplier().get()).build();\n getServiceDispatcher().addServices(serviceQueue);\n\n }\n return getServiceDispatcher();\n\n }\n}\n", "meta": {"content_hash": "d4cab8ca09c8232b1e52995429ac3ec7", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 105, "avg_line_length": 30.53125, "alnum_prop": 0.6665813715455476, "repo_name": "advantageous/qbit", "id": "39f38897bffec165bc1dd1b51ed008adfbaecca0", "size": "3908", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "qbit/core/src/main/java/io/advantageous/qbit/service/dispatchers/ShardedServiceWorkerBuilder.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "1064"}, {"name": "Java", "bytes": "2713914"}, {"name": "JavaScript", "bytes": "1141"}, {"name": "Lua", "bytes": "110"}, {"name": "Shell", "bytes": "181"}]}} +{"text": "<?php\n\n\n\nnamespace Opulence\\Routing\\Routes\\Compilers;\n\nuse Opulence\\Http\\Requests\\Request;\nuse Opulence\\Routing\\Routes\\CompiledRoute;\nuse Opulence\\Routing\\Routes\\Compilers\\Matchers\\HostMatcher;\nuse Opulence\\Routing\\Routes\\Compilers\\Matchers\\IRouteMatcher;\nuse Opulence\\Routing\\Routes\\Compilers\\Matchers\\PathMatcher;\nuse Opulence\\Routing\\Routes\\ParsedRoute;\n\n/**\n * Defines a route compiler\n */\nclass Compiler implements ICompiler\n{\n /** @var IRouteMatcher[] The list of route matchers used by the compiler */\n private $routeMatchers = [];\n\n /**\n * @param IRouteMatcher[] $routeMatchers The list of route matchers to use\n */\n public function __construct(array $routeMatchers)\n {\n $this->routeMatchers = $routeMatchers;\n }\n\n /**\n * @inheritdoc\n */\n public function compile(ParsedRoute $route, Request $request) : CompiledRoute\n {\n $hostMatches = [];\n $pathMatches = [];\n\n foreach ($this->routeMatchers as $routeMatcher) {\n if ($routeMatcher instanceof HostMatcher && !$routeMatcher->isMatch($route, $request, $hostMatches)) {\n return new CompiledRoute($route, false);\n } elseif ($routeMatcher instanceof PathMatcher && !$routeMatcher->isMatch($route, $request, $pathMatches)) {\n return new CompiledRoute($route, false);\n } elseif (!$routeMatcher->isMatch($route, $request)) {\n return new CompiledRoute($route, false);\n }\n }\n\n // If we've gotten here, then all the matchers matched\n $pathVars = array_merge($hostMatches, $pathMatches);\n\n return new CompiledRoute($route, true, $pathVars);\n }\n}\n", "meta": {"content_hash": "432d9d45e55b086ec1390ece1a209d21", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 120, "avg_line_length": 31.735849056603772, "alnum_prop": 0.6563614744351962, "repo_name": "opulencephp/Opulence", "id": "83a3bfc80eb3d3b7b2c2823a137d52215e81641e", "size": "1864", "binary": false, "copies": "1", "ref": "refs/heads/1.2", "path": "src/Opulence/Routing/Routes/Compilers/Compiler.php", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "2098"}, {"name": "Hack", "bytes": "979"}, {"name": "PHP", "bytes": "2407691"}, {"name": "Shell", "bytes": "1733"}]}} +{"text": "/**\n * Generate HTTP headers from auth credentials\n * @param {AuthCredentials} props\n * @return {Promise} - promise that resolves with the headers\n */\nexport function getAuthenticationHeaders(props) {\n if (!props) {\n throw new Error('Must provide authentication information.');\n }\n\n // JWT always have priority over a simple app token\n if (props.jwt) {\n return {\n 'Authorization': 'Bearer ' + props.jwt\n };\n } else if (props.appToken) {\n return {\n 'app-token': props.appToken\n };\n }\n\n throw new Error('Must provide a JWT or a app token');\n}\n", "meta": {"content_hash": "83384ec27e3f4ced2c1873f6906535fe", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 68, "avg_line_length": 27.17391304347826, "alnum_prop": 0.6016, "repo_name": "bobhami/payrollbot", "id": "4c4eef679c0c2d72a65a89d8df74bb2fc21691d6", "size": "625", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "node_modules/smooch-bot/node_modules/smooch-core/src/utils/auth.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "213"}, {"name": "JavaScript", "bytes": "7625"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n <modelVersion>4.0.0</modelVersion>\n\n <groupId>org.apache</groupId>\n <artifactId>rocketmq-hbase</artifactId>\n <packaging>pom</packaging>\n <version>1.0-SNAPSHOT</version>\n <modules>\n <module>rocketmq-hbase-sink</module>\n <module>rocketmq-hbase-source</module>\n </modules>\n\n <properties>\n <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>\n\n <maven.test.skip>false</maven.test.skip>\n <maven.javadoc.skip>true</maven.javadoc.skip>\n <maven.compiler.source>1.8</maven.compiler.source>\n <maven.compiler.target>1.8</maven.compiler.target>\n <rocketmq.version>4.2.0</rocketmq.version>\n <hbase.version>1.4.4</hbase.version>\n </properties>\n\n <dependencies>\n <dependency>\n <groupId>org.apache.rocketmq</groupId>\n <artifactId>rocketmq-client</artifactId>\n <version>${rocketmq.version}</version>\n </dependency>\n <dependency>\n <groupId>org.slf4j</groupId>\n <artifactId>slf4j-api</artifactId>\n <version>1.7.5</version>\n </dependency>\n <dependency>\n <groupId>org.apache.hbase</groupId>\n <artifactId>hbase-server</artifactId>\n <version>${hbase.version}</version>\n </dependency>\n\n <!-- test -->\n <dependency>\n <groupId>org.apache.hbase</groupId>\n <artifactId>hbase-testing-util</artifactId>\n <version>${hbase.version}</version>\n <scope>test</scope>\n </dependency>\n <dependency>\n <groupId>org.apache.rocketmq</groupId>\n <artifactId>rocketmq-namesrv</artifactId>\n <version>${rocketmq.version}</version>\n <scope>test</scope>\n <exclusions>\n <exclusion>\n <groupId>ch.qos.logback</groupId>\n <artifactId>logback-classic</artifactId>\n </exclusion>\n </exclusions>\n </dependency>\n <dependency>\n <groupId>org.apache.rocketmq</groupId>\n <artifactId>rocketmq-broker</artifactId>\n <version>${rocketmq.version}</version>\n <scope>test</scope>\n <exclusions>\n <exclusion>\n <groupId>ch.qos.logback</groupId>\n <artifactId>logback-classic</artifactId>\n </exclusion>\n <exclusion>\n <groupId>io.netty</groupId>\n <artifactId>netty-tcnative</artifactId>\n </exclusion>\n </exclusions>\n </dependency>\n\n </dependencies>\n\n <build>\n <plugins>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-shade-plugin</artifactId>\n <version>3.1.1</version>\n <executions>\n <execution>\n <phase>package</phase>\n <goals>\n <goal>shade</goal>\n </goals>\n <configuration>\n </configuration>\n </execution>\n </executions>\n </plugin>\n <plugin>\n <artifactId>maven-checkstyle-plugin</artifactId>\n <version>2.17</version>\n <executions>\n <execution>\n <id>verify</id>\n <phase>verify</phase>\n <configuration>\n <configLocation>style/rmq_checkstyle.xml</configLocation>\n <encoding>UTF-8</encoding>\n <consoleOutput>true</consoleOutput>\n <failsOnError>true</failsOnError>\n <includeTestSourceDirectory>false</includeTestSourceDirectory>\n <includeTestResources>false</includeTestResources>\n </configuration>\n <goals>\n <goal>check</goal>\n </goals>\n </execution>\n </executions>\n </plugin>\n </plugins>\n </build>\n</project>\n", "meta": {"content_hash": "2db8e8db004b0f67e2ed7c5523164a2a", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 108, "avg_line_length": 37.6260162601626, "alnum_prop": 0.5084269662921348, "repo_name": "StyleTang/incubator-rocketmq-externals", "id": "b2ba196528df2805f6e6a3071aaffdff782fbbad", "size": "4628", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "rocketmq-hbase/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "768"}, {"name": "C", "bytes": "1804"}, {"name": "C++", "bytes": "1075014"}, {"name": "CSS", "bytes": "60479"}, {"name": "Go", "bytes": "276304"}, {"name": "HTML", "bytes": "86942"}, {"name": "Java", "bytes": "554421"}, {"name": "JavaScript", "bytes": "76515"}, {"name": "Makefile", "bytes": "2349"}, {"name": "PHP", "bytes": "29834"}, {"name": "Python", "bytes": "17496"}, {"name": "Scala", "bytes": "60754"}, {"name": "Shell", "bytes": "2982"}]}} +{"text": "class CertDbInitializer;\n\n// Factory that manages creation of CertDbInitializer. The initialization is\n// handled differently depending on the environment:\n// * On real ChromeOS devices with TPMs:\n// ** if the user is affiliated: CertDbInitializer is automatically\n// created right after its profile is created. It receives a path to software\n// cert database and slot IDs for Chaps from Ash and uses them.\n// ** if the user is not affiliated: TODO(b/197082753): not officially supported\n// yet, handled as if there's no TPM.\n// * In emulated environments (e.g. when running ChromeOS on Linux) and in the\n// future on ChromeOS without TPMs: Same as real ChromeOS, but Ash only sends\n// the software database path.\n// * In browsertests: CertDbInitializer is not created by default because it\n// requires crosapi mojo interface. It is configured through the\n// `SetCreateWithBrowserContextForTesting()` method. This can be overridden by\n// individual tests or they can create their own instances of the service.\n// * In unittests: CertDbInitializer is not created by default (see\n// `ServiceIsNULLWhileTesting()`).\nclass CertDbInitializerFactory : public BrowserContextKeyedServiceFactory {\n public:\n static CertDbInitializerFactory* GetInstance();\n static CertDbInitializer* GetForBrowserContext(\n content::BrowserContext* context);\n\n // Configures whether CertDbInitializer should be automatically created on\n // profile creation in browser tests.\n // Currently it is configured that in browser tests the service is not created\n // by default. Individual tests can override it when needed.\n void SetCreateWithBrowserContextForTesting(bool should_create);\n\n private:\n friend class base::NoDestructor<CertDbInitializerFactory>;\n\n CertDbInitializerFactory();\n ~CertDbInitializerFactory() override = default;\n\n // BrowserStateKeyedServiceFactory\n bool ServiceIsCreatedWithBrowserContext() const override;\n KeyedService* BuildServiceInstanceFor(\n content::BrowserContext* context) const override;\n bool ServiceIsNULLWhileTesting() const override;\n content::BrowserContext* GetBrowserContextToUse(\n content::BrowserContext* context) const override;\n\n bool should_create_with_browser_context_ = true;\n};\n\n#endif // CHROME_BROWSER_LACROS_CERT_DB_INITIALIZER_FACTORY_H_\n", "meta": {"content_hash": "61ceabbd404882a9f131dabf6d3a6508", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 80, "avg_line_length": 46.795918367346935, "alnum_prop": 0.7836894897514174, "repo_name": "ric2b/Vivaldi-browser", "id": "f0bc2dfa2893f0641a44664dca58ae0733ea7e0e", "size": "2699", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chromium/chrome/browser/lacros/cert_db_initializer_factory.h", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "module Azure::ARM::ServiceBus\n module Models\n #\n # Parameters supplied to the Create Or Update Subscription operation.\n #\n class SubscriptionCreateOrUpdateParameters\n\n include MsRestAzure\n\n # @return [String] Subscription data center location.\n attr_accessor :location\n\n # @return [String] Resource manager type of the resource.\n attr_accessor :type\n\n # @return [DateTime] Last time there was a receive request to this\n # subscription.\n attr_accessor :accessed_at\n\n # @return [String] TimeSpan idle interval after which the topic is\n # automatically deleted. The minimum duration is 5 minutes.\n attr_accessor :auto_delete_on_idle\n\n # @return [MessageCountDetails]\n attr_accessor :count_details\n\n # @return [DateTime] Exact time the message was created.\n attr_accessor :created_at\n\n # @return [String] Default message time to live value. This is the\n # duration after which the message expires, starting from when the\n # message is sent to Service Bus. This is the default value used when\n # TimeToLive is not set on a message itself.\n attr_accessor :default_message_time_to_live\n\n # @return [Boolean] Value that indicates whether a subscription has dead\n # letter support on filter evaluation exceptions.\n attr_accessor :dead_lettering_on_filter_evaluation_exceptions\n\n # @return [Boolean] Value that indicates whether a subscription has dead\n # letter support when a message expires.\n attr_accessor :dead_lettering_on_message_expiration\n\n # @return [Boolean] Value that indicates whether server-side batched\n # operations are enabled.\n attr_accessor :enable_batched_operations\n\n # @return [EntityAvailabilityStatus] Entity availability status for the\n # topic. Possible values include: 'Available', 'Limited', 'Renaming',\n # 'Restoring', 'Unknown'\n attr_accessor :entity_availability_status\n\n # @return [Boolean] Value that indicates whether the entity description\n # is read-only.\n attr_accessor :is_read_only\n\n # @return [String] The lock duration time span for the subscription.\n attr_accessor :lock_duration\n\n # @return [Integer] Number of maximum deliveries.\n attr_accessor :max_delivery_count\n\n # @return [Integer] Number of messages.\n attr_accessor :message_count\n\n # @return [Boolean] Value indicating if a subscription supports the\n # concept of sessions.\n attr_accessor :requires_session\n\n # @return [EntityStatus] Enumerates the possible values for the status of\n # a messaging entity. Possible values include: 'Active', 'Creating',\n # 'Deleting', 'Disabled', 'ReceiveDisabled', 'Renaming', 'Restoring',\n # 'SendDisabled', 'Unknown'\n attr_accessor :status\n\n # @return [DateTime] The exact time the message was updated.\n attr_accessor :updated_at\n\n\n #\n # Mapper for SubscriptionCreateOrUpdateParameters class as Ruby Hash.\n # This will be used for serialization/deserialization.\n #\n def self.mapper()\n {\n required: false,\n serialized_name: 'SubscriptionCreateOrUpdateParameters',\n type: {\n name: 'Composite',\n class_name: 'SubscriptionCreateOrUpdateParameters',\n model_properties: {\n location: {\n required: true,\n serialized_name: 'location',\n type: {\n name: 'String'\n }\n },\n type: {\n required: false,\n serialized_name: 'type',\n type: {\n name: 'String'\n }\n },\n accessed_at: {\n required: false,\n serialized_name: 'properties.accessedAt',\n type: {\n name: 'DateTime'\n }\n },\n auto_delete_on_idle: {\n required: false,\n serialized_name: 'properties.autoDeleteOnIdle',\n type: {\n name: 'String'\n }\n },\n count_details: {\n required: false,\n serialized_name: 'properties.countDetails',\n type: {\n name: 'Composite',\n class_name: 'MessageCountDetails'\n }\n },\n created_at: {\n required: false,\n serialized_name: 'properties.createdAt',\n type: {\n name: 'DateTime'\n }\n },\n default_message_time_to_live: {\n required: false,\n serialized_name: 'properties.defaultMessageTimeToLive',\n type: {\n name: 'String'\n }\n },\n dead_lettering_on_filter_evaluation_exceptions: {\n required: false,\n serialized_name: 'properties.deadLetteringOnFilterEvaluationExceptions',\n type: {\n name: 'Boolean'\n }\n },\n dead_lettering_on_message_expiration: {\n required: false,\n serialized_name: 'properties.deadLetteringOnMessageExpiration',\n type: {\n name: 'Boolean'\n }\n },\n enable_batched_operations: {\n required: false,\n serialized_name: 'properties.enableBatchedOperations',\n type: {\n name: 'Boolean'\n }\n },\n entity_availability_status: {\n required: false,\n serialized_name: 'properties.entityAvailabilityStatus',\n type: {\n name: 'Enum',\n module: 'EntityAvailabilityStatus'\n }\n },\n is_read_only: {\n required: false,\n serialized_name: 'properties.isReadOnly',\n type: {\n name: 'Boolean'\n }\n },\n lock_duration: {\n required: false,\n serialized_name: 'properties.lockDuration',\n type: {\n name: 'String'\n }\n },\n max_delivery_count: {\n required: false,\n serialized_name: 'properties.maxDeliveryCount',\n type: {\n name: 'Number'\n }\n },\n message_count: {\n required: false,\n serialized_name: 'properties.messageCount',\n type: {\n name: 'Number'\n }\n },\n requires_session: {\n required: false,\n serialized_name: 'properties.requiresSession',\n type: {\n name: 'Boolean'\n }\n },\n status: {\n required: false,\n serialized_name: 'properties.status',\n type: {\n name: 'Enum',\n module: 'EntityStatus'\n }\n },\n updated_at: {\n required: false,\n serialized_name: 'properties.updatedAt',\n type: {\n name: 'DateTime'\n }\n }\n }\n }\n }\n end\n end\n end\nend\n", "meta": {"content_hash": "463cf306d2ba57e2d7af248322101698", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 88, "avg_line_length": 33.44933920704846, "alnum_prop": 0.5073093638877914, "repo_name": "devigned/azure-sdk-for-ruby", "id": "bbdaacd695508b209e59bb962749182086822315", "size": "7764", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "management/azure_mgmt_service_bus/lib/generated/azure_mgmt_service_bus/models/subscription_create_or_update_parameters.rb", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Ruby", "bytes": "11168894"}, {"name": "Shell", "bytes": "157"}]}} +{"text": "'use strict';\n/* jshint maxlen: false */\n\n/**\n * @ngdoc overview\n * @name ngAnimate\n * @description\n *\n * # ngAnimate\n *\n * The `ngAnimate` module provides support for JavaScript, CSS3 transition and CSS3 keyframe animation hooks within existing core and custom directives.\n *\n * {@installModule animate}\n *\n * <div doc-module-components=\"ngAnimate\"></div>\n *\n * # Usage\n *\n * To see animations in action, all that is required is to define the appropriate CSS classes\n * or to register a JavaScript animation via the myModule.animation() function. The directives that support animation automatically are:\n * `ngRepeat`, `ngInclude`, `ngIf`, `ngSwitch`, `ngShow`, `ngHide`, `ngView` and `ngClass`. Custom directives can take advantage of animation\n * by using the `$animate` service.\n *\n * Below is a more detailed breakdown of the supported animation events provided by pre-existing ng directives:\n *\n * | Directive | Supported Animations |\n * |---------------------------------------------------------- |----------------------------------------------------|\n * | {@link ng.directive:ngRepeat#usage_animations ngRepeat} | enter, leave and move |\n * | {@link ngRoute.directive:ngView#usage_animations ngView} | enter and leave |\n * | {@link ng.directive:ngInclude#usage_animations ngInclude} | enter and leave |\n * | {@link ng.directive:ngSwitch#usage_animations ngSwitch} | enter and leave |\n * | {@link ng.directive:ngIf#usage_animations ngIf} | enter and leave |\n * | {@link ng.directive:ngClass#usage_animations ngClass} | add and remove |\n * | {@link ng.directive:ngShow#usage_animations ngShow & ngHide} | add and remove (the ng-hide class value) |\n *\n * You can find out more information about animations upon visiting each directive page.\n *\n * Below is an example of how to apply animations to a directive that supports animation hooks:\n *\n * <pre>\n * <style type=\"text/css\">\n * .slide.ng-enter, .slide.ng-leave {\n * -webkit-transition:0.5s linear all;\n * transition:0.5s linear all;\n * }\n *\n * .slide.ng-enter { } /* starting animations for enter */\n * .slide.ng-enter-active { } /* terminal animations for enter */\n * .slide.ng-leave { } /* starting animations for leave */\n * .slide.ng-leave-active { } /* terminal animations for leave */\n * </style>\n *\n * <!--\n * the animate service will automatically add .ng-enter and .ng-leave to the element\n * to trigger the CSS transition/animations\n * -->\n * <ANY class=\"slide\" ng-include=\"...\"></ANY>\n * </pre>\n *\n * Keep in mind that if an animation is running, any child elements cannot be animated until the parent element's\n * animation has completed.\n *\n * <h2>CSS-defined Animations</h2>\n * The animate service will automatically apply two CSS classes to the animated element and these two CSS classes\n * are designed to contain the start and end CSS styling. Both CSS transitions and keyframe animations are supported\n * and can be used to play along with this naming structure.\n *\n * The following code below demonstrates how to perform animations using **CSS transitions** with Angular:\n *\n * <pre>\n * <style type=\"text/css\">\n * /*\n * The animate class is apart of the element and the ng-enter class\n * is attached to the element once the enter animation event is triggered\n * */\n * .reveal-animation.ng-enter {\n * -webkit-transition: 1s linear all; /* Safari/Chrome */\n * transition: 1s linear all; /* All other modern browsers and IE10+ */\n *\n * /* The animation preparation code */\n * opacity: 0;\n * }\n *\n * /*\n * Keep in mind that you want to combine both CSS\n * classes together to avoid any CSS-specificity\n * conflicts\n * */\n * .reveal-animation.ng-enter.ng-enter-active {\n * /* The animation code itself */\n * opacity: 1;\n * }\n * </style>\n *\n * <div class=\"view-container\">\n * <div ng-view class=\"reveal-animation\"></div>\n * </div>\n * </pre>\n *\n * The following code below demonstrates how to perform animations using **CSS animations** with Angular:\n *\n * <pre>\n * <style type=\"text/css\">\n * .reveal-animation.ng-enter {\n * -webkit-animation: enter_sequence 1s linear; /* Safari/Chrome */\n * animation: enter_sequence 1s linear; /* IE10+ and Future Browsers */\n * }\n * @-webkit-keyframes enter_sequence {\n * from { opacity:0; }\n * to { opacity:1; }\n * }\n * @keyframes enter_sequence {\n * from { opacity:0; }\n * to { opacity:1; }\n * }\n * </style>\n *\n * <div class=\"view-container\">\n * <div ng-view class=\"reveal-animation\"></div>\n * </div>\n * </pre>\n *\n * Both CSS3 animations and transitions can be used together and the animate service will figure out the correct duration and delay timing.\n *\n * Upon DOM mutation, the event class is added first (something like `ng-enter`), then the browser prepares itself to add\n * the active class (in this case `ng-enter-active`) which then triggers the animation. The animation module will automatically\n * detect the CSS code to determine when the animation ends. Once the animation is over then both CSS classes will be\n * removed from the DOM. If a browser does not support CSS transitions or CSS animations then the animation will start and end\n * immediately resulting in a DOM element that is at its final state. This final state is when the DOM element\n * has no CSS transition/animation classes applied to it.\n *\n * <h3>CSS Staggering Animations</h3>\n * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a\n * curtain-like effect. The ngAnimate module, as of 1.2.0, supports staggering animations and the stagger effect can be\n * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for\n * the animation. The style property expected within the stagger class can either be a **transition-delay** or an\n * **animation-delay** property (or both if your animation contains both transitions and keyframe animations).\n *\n * <pre>\n * .my-animation.ng-enter {\n * /* standard transition code */\n * -webkit-transition: 1s linear all;\n * transition: 1s linear all;\n * opacity:0;\n * }\n * .my-animation.ng-enter-stagger {\n * /* this will have a 100ms delay between each successive leave animation */\n * -webkit-transition-delay: 0.1s;\n * transition-delay: 0.1s;\n *\n * /* in case the stagger doesn't work then these two values\n * must be set to 0 to avoid an accidental CSS inheritance */\n * -webkit-transition-duration: 0s;\n * transition-duration: 0s;\n * }\n * .my-animation.ng-enter.ng-enter-active {\n * /* standard transition styles */\n * opacity:1;\n * }\n * </pre>\n *\n * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations\n * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this\n * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation\n * will also be reset if more than 10ms has passed after the last animation has been fired.\n *\n * The following code will issue the **ng-leave-stagger** event on the element provided:\n *\n * <pre>\n * var kids = parent.children();\n *\n * $animate.leave(kids[0]); //stagger index=0\n * $animate.leave(kids[1]); //stagger index=1\n * $animate.leave(kids[2]); //stagger index=2\n * $animate.leave(kids[3]); //stagger index=3\n * $animate.leave(kids[4]); //stagger index=4\n *\n * $timeout(function() {\n * //stagger has reset itself\n * $animate.leave(kids[5]); //stagger index=0\n * $animate.leave(kids[6]); //stagger index=1\n * }, 100, false);\n * </pre>\n *\n * Stagger animations are currently only supported within CSS-defined animations.\n *\n * <h2>JavaScript-defined Animations</h2>\n * In the event that you do not want to use CSS3 transitions or CSS3 animations or if you wish to offer animations on browsers that do not\n * yet support CSS transitions/animations, then you can make use of JavaScript animations defined inside of your AngularJS module.\n *\n * <pre>\n * //!annotate=\"YourApp\" Your AngularJS Module|Replace this or ngModule with the module that you used to define your application.\n * var ngModule = angular.module('YourApp', []);\n * ngModule.animation('.my-crazy-animation', function() {\n * return {\n * enter: function(element, done) {\n * //run the animation here and call done when the animation is complete\n * return function(cancelled) {\n * //this (optional) function will be called when the animation\n * //completes or when the animation is cancelled (the cancelled\n * //flag will be set to true if cancelled).\n * }\n * }\n * leave: function(element, done) { },\n * move: function(element, done) { },\n *\n * //animation that can be triggered before the class is added\n * beforeAddClass: function(element, className, done) { },\n *\n * //animation that can be triggered after the class is added\n * addClass: function(element, className, done) { },\n *\n * //animation that can be triggered before the class is removed\n * beforeRemoveClass: function(element, className, done) { },\n *\n * //animation that can be triggered after the class is removed\n * removeClass: function(element, className, done) { }\n * }\n * });\n * </pre>\n *\n * JavaScript-defined animations are created with a CSS-like class selector and a collection of events which are set to run\n * a javascript callback function. When an animation is triggered, $animate will look for a matching animation which fits\n * the element's CSS class attribute value and then run the matching animation event function (if found).\n * In other words, if the CSS classes present on the animated element match any of the JavaScript animations then the callback function will\n * be executed. It should be also noted that only simple, single class selectors are allowed (compound class selectors are not supported).\n *\n * Within a JavaScript animation, an object containing various event callback animation functions is expected to be returned.\n * As explained above, these callbacks are triggered based on the animation event. Therefore if an enter animation is run,\n * and the JavaScript animation is found, then the enter callback will handle that animation (in addition to the CSS keyframe animation\n * or transition code that is defined via a stylesheet).\n *\n */\n\nangular.module('ngAnimate', ['ng'])\n\n /**\n * @ngdoc object\n * @name ngAnimate.$animateProvider\n * @description\n *\n * The `$animateProvider` allows developers to register JavaScript animation event handlers directly inside of a module.\n * When an animation is triggered, the $animate service will query the $animate service to find any animations that match\n * the provided name value.\n *\n * Requires the {@link ngAnimate `ngAnimate`} module to be installed.\n *\n * Please visit the {@link ngAnimate `ngAnimate`} module overview page learn more about how to use animations in your application.\n *\n */\n .config(['$provide', '$animateProvider', function($provide, $animateProvider) {\n var noop = angular.noop;\n var forEach = angular.forEach;\n var selectors = $animateProvider.$$selectors;\n\n var ELEMENT_NODE = 1;\n var NG_ANIMATE_STATE = '$$ngAnimateState';\n var NG_ANIMATE_CLASS_NAME = 'ng-animate';\n var rootAnimateState = {running: true};\n\n $provide.decorator('$animate', ['$delegate', '$injector', '$sniffer', '$rootElement', '$timeout', '$rootScope', '$document',\n function($delegate, $injector, $sniffer, $rootElement, $timeout, $rootScope, $document) {\n\n $rootElement.data(NG_ANIMATE_STATE, rootAnimateState);\n\n // disable animations during bootstrap, but once we bootstrapped, enable animations\n $rootScope.$$postDigest(function() {\n rootAnimateState.running = false;\n });\n\n function lookup(name) {\n if (name) {\n var matches = [],\n flagMap = {},\n classes = name.substr(1).split('.');\n\n //the empty string value is the default animation\n //operation which performs CSS transition and keyframe\n //animations sniffing. This is always included for each\n //element animation procedure if the browser supports\n //transitions and/or keyframe animations\n if ($sniffer.transitions || $sniffer.animations) {\n classes.push('');\n }\n\n for(var i=0; i < classes.length; i++) {\n var klass = classes[i],\n selectorFactoryName = selectors[klass];\n if(selectorFactoryName && !flagMap[klass]) {\n matches.push($injector.get(selectorFactoryName));\n flagMap[klass] = true;\n }\n }\n return matches;\n }\n }\n\n /**\n * @ngdoc object\n * @name ngAnimate.$animate\n * @function\n *\n * @description\n * The `$animate` service provides animation detection support while performing DOM operations (enter, leave and move) as well as during addClass and removeClass operations.\n * When any of these operations are run, the $animate service\n * will examine any JavaScript-defined animations (which are defined by using the $animateProvider provider object)\n * as well as any CSS-defined animations against the CSS classes present on the element once the DOM operation is run.\n *\n * The `$animate` service is used behind the scenes with pre-existing directives and animation with these directives\n * will work out of the box without any extra configuration.\n *\n * Requires the {@link ngAnimate `ngAnimate`} module to be installed.\n *\n * Please visit the {@link ngAnimate `ngAnimate`} module overview page learn more about how to use animations in your application.\n *\n */\n return {\n /**\n * @ngdoc function\n * @name ngAnimate.$animate#enter\n * @methodOf ngAnimate.$animate\n * @function\n *\n * @description\n * Appends the element to the parentElement element that resides in the document and then runs the enter animation. Once\n * the animation is started, the following CSS classes will be present on the element for the duration of the animation:\n *\n * Below is a breakdown of each step that occurs during enter animation:\n *\n * | Animation Step | What the element class attribute looks like |\n * |----------------------------------------------------------------------------------------------|---------------------------------------------|\n * | 1. $animate.enter(...) is called | class=\"my-animation\" |\n * | 2. element is inserted into the parentElement element or beside the afterElement element | class=\"my-animation\" |\n * | 3. $animate runs any JavaScript-defined animations on the element | class=\"my-animation ng-animate\" |\n * | 4. the .ng-enter class is added to the element | class=\"my-animation ng-animate ng-enter\" |\n * | 5. $animate scans the element styles to get the CSS transition/animation duration and delay | class=\"my-animation ng-animate ng-enter\" |\n * | 6. $animate waits for 10ms (this performs a reflow) | class=\"my-animation ng-animate ng-enter\" |\n * | 7. the .ng-enter-active and .ng-animate-active classes are added (this triggers the CSS transition/animation) | class=\"my-animation ng-animate ng-animate-active ng-enter ng-enter-active\" |\n * | 8. $animate waits for X milliseconds for the animation to complete | class=\"my-animation ng-animate ng-animate-active ng-enter ng-enter-active\" |\n * | 9. The animation ends and all generated CSS classes are removed from the element | class=\"my-animation\" |\n * | 10. The doneCallback() callback is fired (if provided) | class=\"my-animation\" |\n *\n * @param {jQuery/jqLite element} element the element that will be the focus of the enter animation\n * @param {jQuery/jqLite element} parentElement the parent element of the element that will be the focus of the enter animation\n * @param {jQuery/jqLite element} afterElement the sibling element (which is the previous element) of the element that will be the focus of the enter animation\n * @param {function()=} doneCallback the callback function that will be called once the animation is complete\n */\n enter : function(element, parentElement, afterElement, doneCallback) {\n this.enabled(false, element);\n $delegate.enter(element, parentElement, afterElement);\n $rootScope.$$postDigest(function() {\n performAnimation('enter', 'ng-enter', element, parentElement, afterElement, noop, doneCallback);\n });\n },\n\n /**\n * @ngdoc function\n * @name ngAnimate.$animate#leave\n * @methodOf ngAnimate.$animate\n * @function\n *\n * @description\n * Runs the leave animation operation and, upon completion, removes the element from the DOM. Once\n * the animation is started, the following CSS classes will be added for the duration of the animation:\n *\n * Below is a breakdown of each step that occurs during enter animation:\n *\n * | Animation Step | What the element class attribute looks like |\n * |----------------------------------------------------------------------------------------------|---------------------------------------------|\n * | 1. $animate.leave(...) is called | class=\"my-animation\" |\n * | 2. $animate runs any JavaScript-defined animations on the element | class=\"my-animation ng-animate\" |\n * | 3. the .ng-leave class is added to the element | class=\"my-animation ng-animate ng-leave\" |\n * | 4. $animate scans the element styles to get the CSS transition/animation duration and delay | class=\"my-animation ng-animate ng-leave\" |\n * | 5. $animate waits for 10ms (this performs a reflow) | class=\"my-animation ng-animate ng-leave\" |\n * | 6. the .ng-leave-active and .ng-animate-active classes is added (this triggers the CSS transition/animation) | class=\"my-animation ng-animate ng-animate-active ng-leave ng-leave-active\" |\n * | 7. $animate waits for X milliseconds for the animation to complete | class=\"my-animation ng-animate ng-animate-active ng-leave ng-leave-active\" |\n * | 8. The animation ends and all generated CSS classes are removed from the element | class=\"my-animation\" |\n * | 9. The element is removed from the DOM | ... |\n * | 10. The doneCallback() callback is fired (if provided) | ... |\n *\n * @param {jQuery/jqLite element} element the element that will be the focus of the leave animation\n * @param {function()=} doneCallback the callback function that will be called once the animation is complete\n */\n leave : function(element, doneCallback) {\n cancelChildAnimations(element);\n this.enabled(false, element);\n $rootScope.$$postDigest(function() {\n performAnimation('leave', 'ng-leave', element, null, null, function() {\n $delegate.leave(element);\n }, doneCallback);\n });\n },\n\n /**\n * @ngdoc function\n * @name ngAnimate.$animate#move\n * @methodOf ngAnimate.$animate\n * @function\n *\n * @description\n * Fires the move DOM operation. Just before the animation starts, the animate service will either append it into the parentElement container or\n * add the element directly after the afterElement element if present. Then the move animation will be run. Once\n * the animation is started, the following CSS classes will be added for the duration of the animation:\n *\n * Below is a breakdown of each step that occurs during move animation:\n *\n * | Animation Step | What the element class attribute looks like |\n * |----------------------------------------------------------------------------------------------|---------------------------------------------|\n * | 1. $animate.move(...) is called | class=\"my-animation\" |\n * | 2. element is moved into the parentElement element or beside the afterElement element | class=\"my-animation\" |\n * | 3. $animate runs any JavaScript-defined animations on the element | class=\"my-animation ng-animate\" |\n * | 4. the .ng-move class is added to the element | class=\"my-animation ng-animate ng-move\" |\n * | 5. $animate scans the element styles to get the CSS transition/animation duration and delay | class=\"my-animation ng-animate ng-move\" |\n * | 6. $animate waits for 10ms (this performs a reflow) | class=\"my-animation ng-animate ng-move\" |\n * | 7. the .ng-move-active and .ng-animate-active classes is added (this triggers the CSS transition/animation) | class=\"my-animation ng-animate ng-animate-active ng-move ng-move-active\" |\n * | 8. $animate waits for X milliseconds for the animation to complete | class=\"my-animation ng-animate ng-animate-active ng-move ng-move-active\" |\n * | 9. The animation ends and all generated CSS classes are removed from the element | class=\"my-animation\" |\n * | 10. The doneCallback() callback is fired (if provided) | class=\"my-animation\" |\n *\n * @param {jQuery/jqLite element} element the element that will be the focus of the move animation\n * @param {jQuery/jqLite element} parentElement the parentElement element of the element that will be the focus of the move animation\n * @param {jQuery/jqLite element} afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation\n * @param {function()=} doneCallback the callback function that will be called once the animation is complete\n */\n move : function(element, parentElement, afterElement, doneCallback) {\n cancelChildAnimations(element);\n this.enabled(false, element);\n $delegate.move(element, parentElement, afterElement);\n $rootScope.$$postDigest(function() {\n performAnimation('move', 'ng-move', element, parentElement, afterElement, noop, doneCallback);\n });\n },\n\n /**\n * @ngdoc function\n * @name ngAnimate.$animate#addClass\n * @methodOf ngAnimate.$animate\n *\n * @description\n * Triggers a custom animation event based off the className variable and then attaches the className value to the element as a CSS class.\n * Unlike the other animation methods, the animate service will suffix the className value with {@type -add} in order to provide\n * the animate service the setup and active CSS classes in order to trigger the animation (this will be skipped if no CSS transitions\n * or keyframes are defined on the -add or base CSS class).\n *\n * Below is a breakdown of each step that occurs during addClass animation:\n *\n * | Animation Step | What the element class attribute looks like |\n * |------------------------------------------------------------------------------------------------|---------------------------------------------|\n * | 1. $animate.addClass(element, 'super') is called | class=\"my-animation\" |\n * | 2. $animate runs any JavaScript-defined animations on the element | class=\"my-animation ng-animate\" |\n * | 3. the .super-add class are added to the element | class=\"my-animation ng-animate super-add\" |\n * | 4. $animate scans the element styles to get the CSS transition/animation duration and delay | class=\"my-animation ng-animate super-add\" |\n * | 5. $animate waits for 10ms (this performs a reflow) | class=\"my-animation ng-animate super-add\" |\n * | 6. the .super, .super-add-active and .ng-animate-active classes are added (this triggers the CSS transition/animation) | class=\"my-animation ng-animate ng-animate-active super super-add super-add-active\" |\n * | 7. $animate waits for X milliseconds for the animation to complete | class=\"my-animation super-add super-add-active\" |\n * | 8. The animation ends and all generated CSS classes are removed from the element | class=\"my-animation super\" |\n * | 9. The super class is kept on the element | class=\"my-animation super\" |\n * | 10. The doneCallback() callback is fired (if provided) | class=\"my-animation super\" |\n *\n * @param {jQuery/jqLite element} element the element that will be animated\n * @param {string} className the CSS class that will be added to the element and then animated\n * @param {function()=} doneCallback the callback function that will be called once the animation is complete\n */\n addClass : function(element, className, doneCallback) {\n performAnimation('addClass', className, element, null, null, function() {\n $delegate.addClass(element, className);\n }, doneCallback);\n },\n\n /**\n * @ngdoc function\n * @name ngAnimate.$animate#removeClass\n * @methodOf ngAnimate.$animate\n *\n * @description\n * Triggers a custom animation event based off the className variable and then removes the CSS class provided by the className value\n * from the element. Unlike the other animation methods, the animate service will suffix the className value with {@type -remove} in\n * order to provide the animate service the setup and active CSS classes in order to trigger the animation (this will be skipped if\n * no CSS transitions or keyframes are defined on the -remove or base CSS classes).\n *\n * Below is a breakdown of each step that occurs during removeClass animation:\n *\n * | Animation Step | What the element class attribute looks like |\n * |-----------------------------------------------------------------------------------------------|---------------------------------------------|\n * | 1. $animate.removeClass(element, 'super') is called | class=\"my-animation super\" |\n * | 2. $animate runs any JavaScript-defined animations on the element | class=\"my-animation super ng-animate\" |\n * | 3. the .super-remove class are added to the element | class=\"my-animation super ng-animate super-remove\"|\n * | 4. $animate scans the element styles to get the CSS transition/animation duration and delay | class=\"my-animation super ng-animate super-remove\" |\n * | 5. $animate waits for 10ms (this performs a reflow) | class=\"my-animation super ng-animate super-remove\" |\n * | 6. the .super-remove-active and .ng-animate-active classes are added and .super is removed (this triggers the CSS transition/animation) | class=\"my-animation ng-animate ng-animate-active super-remove super-remove-active\" |\n * | 7. $animate waits for X milliseconds for the animation to complete | class=\"my-animation ng-animate ng-animate-active super-remove super-remove-active\" |\n * | 8. The animation ends and all generated CSS classes are removed from the element | class=\"my-animation\" |\n * | 9. The doneCallback() callback is fired (if provided) | class=\"my-animation\" |\n *\n *\n * @param {jQuery/jqLite element} element the element that will be animated\n * @param {string} className the CSS class that will be animated and then removed from the element\n * @param {function()=} doneCallback the callback function that will be called once the animation is complete\n */\n removeClass : function(element, className, doneCallback) {\n performAnimation('removeClass', className, element, null, null, function() {\n $delegate.removeClass(element, className);\n }, doneCallback);\n },\n\n /**\n * @ngdoc function\n * @name ngAnimate.$animate#enabled\n * @methodOf ngAnimate.$animate\n * @function\n *\n * @param {boolean=} value If provided then set the animation on or off.\n * @param {jQuery/jqLite element=} element If provided then the element will be used to represent the enable/disable operation\n * @return {boolean} Current animation state.\n *\n * @description\n * Globally enables/disables animations.\n *\n */\n enabled : function(value, element) {\n switch(arguments.length) {\n case 2:\n if(value) {\n cleanup(element);\n } else {\n var data = element.data(NG_ANIMATE_STATE) || {};\n data.disabled = true;\n element.data(NG_ANIMATE_STATE, data);\n }\n break;\n\n case 1:\n rootAnimateState.disabled = !value;\n break;\n\n default:\n value = !rootAnimateState.disabled;\n break;\n }\n return !!value;\n }\n };\n\n /*\n all animations call this shared animation triggering function internally.\n The animationEvent variable refers to the JavaScript animation event that will be triggered\n and the className value is the name of the animation that will be applied within the\n CSS code. Element, parentElement and afterElement are provided DOM elements for the animation\n and the onComplete callback will be fired once the animation is fully complete.\n */\n function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, doneCallback) {\n var currentClassName = element.attr('class') || '';\n var classes = currentClassName + ' ' + className;\n var animationLookup = (' ' + classes).replace(/\\s+/g,'.');\n if (!parentElement) {\n parentElement = afterElement ? afterElement.parent() : element.parent();\n }\n\n var matches = lookup(animationLookup);\n var isClassBased = animationEvent == 'addClass' || animationEvent == 'removeClass';\n var ngAnimateState = element.data(NG_ANIMATE_STATE) || {};\n\n //skip the animation if animations are disabled, a parent is already being animated,\n //the element is not currently attached to the document body or then completely close\n //the animation if any matching animations are not found at all.\n //NOTE: IE8 + IE9 should close properly (run closeAnimation()) in case a NO animation is not found.\n if (animationsDisabled(element, parentElement) || matches.length === 0) {\n fireDOMOperation();\n closeAnimation();\n return;\n }\n\n var animations = [];\n //only add animations if the currently running animation is not structural\n //or if there is no animation running at all\n if(!ngAnimateState.running || !(isClassBased && ngAnimateState.structural)) {\n forEach(matches, function(animation) {\n //add the animation to the queue to if it is allowed to be cancelled\n if(!animation.allowCancel || animation.allowCancel(element, animationEvent, className)) {\n var beforeFn, afterFn = animation[animationEvent];\n\n //Special case for a leave animation since there is no point in performing an\n //animation on a element node that has already been removed from the DOM\n if(animationEvent == 'leave') {\n beforeFn = afterFn;\n afterFn = null; //this must be falsy so that the animation is skipped for leave\n } else {\n beforeFn = animation['before' + animationEvent.charAt(0).toUpperCase() + animationEvent.substr(1)];\n }\n animations.push({\n before : beforeFn,\n after : afterFn\n });\n }\n });\n }\n\n //this would mean that an animation was not allowed so let the existing\n //animation do it's thing and close this one early\n if(animations.length === 0) {\n fireDOMOperation();\n fireDoneCallbackAsync();\n return;\n }\n\n //this value will be searched for class-based CSS className lookup. Therefore,\n //we prefix and suffix the current className value with spaces to avoid substring\n //lookups of className tokens\n var futureClassName = ' ' + currentClassName + ' ';\n if(ngAnimateState.running) {\n //if an animation is currently running on the element then lets take the steps\n //to cancel that animation and fire any required callbacks\n $timeout.cancel(ngAnimateState.closeAnimationTimeout);\n cleanup(element);\n cancelAnimations(ngAnimateState.animations);\n\n //if the class is removed during the reflow then it will revert the styles temporarily\n //back to the base class CSS styling causing a jump-like effect to occur. This check\n //here ensures that the domOperation is only performed after the reflow has commenced\n if(ngAnimateState.beforeComplete) {\n (ngAnimateState.done || noop)(true);\n } else if(isClassBased && !ngAnimateState.structural) {\n //class-based animations will compare element className values after cancelling the\n //previous animation to see if the element properties already contain the final CSS\n //class and if so then the animation will be skipped. Since the domOperation will\n //be performed only after the reflow is complete then our element's className value\n //will be invalid. Therefore the same string manipulation that would occur within the\n //DOM operation will be performed below so that the class comparison is valid...\n futureClassName = ngAnimateState.event == 'removeClass' ?\n futureClassName.replace(ngAnimateState.className, '') :\n futureClassName + ngAnimateState.className + ' ';\n }\n }\n\n //There is no point in perform a class-based animation if the element already contains\n //(on addClass) or doesn't contain (on removeClass) the className being animated.\n //The reason why this is being called after the previous animations are cancelled\n //is so that the CSS classes present on the element can be properly examined.\n var classNameToken = ' ' + className + ' ';\n if((animationEvent == 'addClass' && futureClassName.indexOf(classNameToken) >= 0) ||\n (animationEvent == 'removeClass' && futureClassName.indexOf(classNameToken) == -1)) {\n fireDOMOperation();\n fireDoneCallbackAsync();\n return;\n }\n\n //the ng-animate class does nothing, but it's here to allow for\n //parent animations to find and cancel child animations when needed\n element.addClass(NG_ANIMATE_CLASS_NAME);\n\n element.data(NG_ANIMATE_STATE, {\n running:true,\n event:animationEvent,\n className:className,\n structural:!isClassBased,\n animations:animations,\n done:onBeforeAnimationsComplete\n });\n\n //first we run the before animations and when all of those are complete\n //then we perform the DOM operation and run the next set of animations\n invokeRegisteredAnimationFns(animations, 'before', onBeforeAnimationsComplete);\n\n function onBeforeAnimationsComplete(cancelled) {\n fireDOMOperation();\n if(cancelled === true) {\n closeAnimation();\n return;\n }\n\n //set the done function to the final done function\n //so that the DOM event won't be executed twice by accident\n //if the after animation is cancelled as well\n var data = element.data(NG_ANIMATE_STATE);\n if(data) {\n data.done = closeAnimation;\n element.data(NG_ANIMATE_STATE, data);\n }\n invokeRegisteredAnimationFns(animations, 'after', closeAnimation);\n }\n\n function invokeRegisteredAnimationFns(animations, phase, allAnimationFnsComplete) {\n var endFnName = phase + 'End';\n forEach(animations, function(animation, index) {\n var animationPhaseCompleted = function() {\n progress(index, phase);\n };\n\n //there are no before functions for enter + move since the DOM\n //operations happen before the performAnimation method fires\n if(phase == 'before' && (animationEvent == 'enter' || animationEvent == 'move')) {\n animationPhaseCompleted();\n return;\n }\n\n if(animation[phase]) {\n animation[endFnName] = isClassBased ?\n animation[phase](element, className, animationPhaseCompleted) :\n animation[phase](element, animationPhaseCompleted);\n } else {\n animationPhaseCompleted();\n }\n });\n\n function progress(index, phase) {\n var phaseCompletionFlag = phase + 'Complete';\n var currentAnimation = animations[index];\n currentAnimation[phaseCompletionFlag] = true;\n (currentAnimation[endFnName] || noop)();\n\n for(var i=0;i<animations.length;i++) {\n if(!animations[i][phaseCompletionFlag]) return;\n }\n\n allAnimationFnsComplete();\n }\n }\n\n function fireDoneCallbackAsync() {\n doneCallback && $timeout(doneCallback, 0, false);\n }\n\n //it is less complicated to use a flag than managing and cancelling\n //timeouts containing multiple callbacks.\n function fireDOMOperation() {\n if(!fireDOMOperation.hasBeenRun) {\n fireDOMOperation.hasBeenRun = true;\n domOperation();\n }\n }\n\n function closeAnimation() {\n if(!closeAnimation.hasBeenRun) {\n closeAnimation.hasBeenRun = true;\n var data = element.data(NG_ANIMATE_STATE);\n if(data) {\n /* only structural animations wait for reflow before removing an\n animation, but class-based animations don't. An example of this\n failing would be when a parent HTML tag has a ng-class attribute\n causing ALL directives below to skip animations during the digest */\n if(isClassBased) {\n cleanup(element);\n } else {\n data.closeAnimationTimeout = $timeout(function() {\n cleanup(element);\n }, 0, false);\n element.data(NG_ANIMATE_STATE, data);\n }\n }\n fireDoneCallbackAsync();\n }\n }\n }\n\n function cancelChildAnimations(element) {\n var node = element[0];\n if(node.nodeType != ELEMENT_NODE) {\n return;\n }\n\n forEach(node.querySelectorAll('.' + NG_ANIMATE_CLASS_NAME), function(element) {\n element = angular.element(element);\n var data = element.data(NG_ANIMATE_STATE);\n if(data) {\n cancelAnimations(data.animations);\n cleanup(element);\n }\n });\n }\n\n function cancelAnimations(animations) {\n var isCancelledFlag = true;\n forEach(animations, function(animation) {\n if(!animations.beforeComplete) {\n (animation.beforeEnd || noop)(isCancelledFlag);\n }\n if(!animations.afterComplete) {\n (animation.afterEnd || noop)(isCancelledFlag);\n }\n });\n }\n\n function cleanup(element) {\n if(element[0] == $rootElement[0]) {\n if(!rootAnimateState.disabled) {\n rootAnimateState.running = false;\n rootAnimateState.structural = false;\n }\n } else {\n element.removeClass(NG_ANIMATE_CLASS_NAME);\n element.removeData(NG_ANIMATE_STATE);\n }\n }\n\n function animationsDisabled(element, parentElement) {\n if (rootAnimateState.disabled) return true;\n\n if(element[0] == $rootElement[0]) {\n return rootAnimateState.disabled || rootAnimateState.running;\n }\n\n do {\n //the element did not reach the root element which means that it\n //is not apart of the DOM. Therefore there is no reason to do\n //any animations on it\n if(parentElement.length === 0) break;\n\n var isRoot = parentElement[0] == $rootElement[0];\n var state = isRoot ? rootAnimateState : parentElement.data(NG_ANIMATE_STATE);\n var result = state && (!!state.disabled || !!state.running);\n if(isRoot || result) {\n return result;\n }\n\n if(isRoot) return true;\n }\n while(parentElement = parentElement.parent());\n\n return true;\n }\n }]);\n\n $animateProvider.register('', ['$window', '$sniffer', '$timeout', function($window, $sniffer, $timeout) {\n // Detect proper transitionend/animationend event names.\n var CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;\n\n // If unprefixed events are not supported but webkit-prefixed are, use the latter.\n // Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.\n // Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`\n // but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.\n // Register both events in case `window.onanimationend` is not supported because of that,\n // do the same for `transitionend` as Safari is likely to exhibit similar behavior.\n // Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit\n // therefore there is no reason to test anymore for other vendor prefixes: http://caniuse.com/#search=transition\n if (window.ontransitionend === undefined && window.onwebkittransitionend !== undefined) {\n CSS_PREFIX = '-webkit-';\n TRANSITION_PROP = 'WebkitTransition';\n TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';\n } else {\n TRANSITION_PROP = 'transition';\n TRANSITIONEND_EVENT = 'transitionend';\n }\n\n if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) {\n CSS_PREFIX = '-webkit-';\n ANIMATION_PROP = 'WebkitAnimation';\n ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';\n } else {\n ANIMATION_PROP = 'animation';\n ANIMATIONEND_EVENT = 'animationend';\n }\n\n var DURATION_KEY = 'Duration';\n var PROPERTY_KEY = 'Property';\n var DELAY_KEY = 'Delay';\n var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';\n var NG_ANIMATE_PARENT_KEY = '$$ngAnimateKey';\n var NG_ANIMATE_CSS_DATA_KEY = '$$ngAnimateCSS3Data';\n var NG_ANIMATE_FALLBACK_CLASS_NAME = 'ng-animate-start';\n var NG_ANIMATE_FALLBACK_ACTIVE_CLASS_NAME = 'ng-animate-active';\n\n var lookupCache = {};\n var parentCounter = 0;\n\n var animationReflowQueue = [], animationTimer, timeOut = false;\n function afterReflow(callback) {\n animationReflowQueue.push(callback);\n $timeout.cancel(animationTimer);\n animationTimer = $timeout(function() {\n forEach(animationReflowQueue, function(fn) {\n fn();\n });\n animationReflowQueue = [];\n animationTimer = null;\n lookupCache = {};\n }, 10, false);\n }\n\n function applyStyle(node, style) {\n var oldStyle = node.getAttribute('style') || '';\n var newStyle = (oldStyle.length > 0 ? '; ' : '') + style;\n node.setAttribute('style', newStyle);\n return oldStyle;\n }\n\n function getElementAnimationDetails(element, cacheKey) {\n var data = cacheKey ? lookupCache[cacheKey] : null;\n if(!data) {\n var transitionDuration = 0;\n var transitionDelay = 0;\n var animationDuration = 0;\n var animationDelay = 0;\n var transitionDelayStyle;\n var animationDelayStyle;\n var transitionDurationStyle;\n var transitionPropertyStyle;\n\n //we want all the styles defined before and after\n forEach(element, function(element) {\n if (element.nodeType == ELEMENT_NODE) {\n var elementStyles = $window.getComputedStyle(element) || {};\n\n transitionDurationStyle = elementStyles[TRANSITION_PROP + DURATION_KEY];\n\n transitionDuration = Math.max(parseMaxTime(transitionDurationStyle), transitionDuration);\n\n transitionPropertyStyle = elementStyles[TRANSITION_PROP + PROPERTY_KEY];\n\n transitionDelayStyle = elementStyles[TRANSITION_PROP + DELAY_KEY];\n\n transitionDelay = Math.max(parseMaxTime(transitionDelayStyle), transitionDelay);\n\n animationDelayStyle = elementStyles[ANIMATION_PROP + DELAY_KEY];\n\n animationDelay = Math.max(parseMaxTime(animationDelayStyle), animationDelay);\n\n var aDuration = parseMaxTime(elementStyles[ANIMATION_PROP + DURATION_KEY]);\n\n if(aDuration > 0) {\n aDuration *= parseInt(elementStyles[ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY], 10) || 1;\n }\n\n animationDuration = Math.max(aDuration, animationDuration);\n }\n });\n data = {\n total : 0,\n transitionPropertyStyle: transitionPropertyStyle,\n transitionDurationStyle: transitionDurationStyle,\n transitionDelayStyle: transitionDelayStyle,\n transitionDelay: transitionDelay,\n transitionDuration: transitionDuration,\n animationDelayStyle: animationDelayStyle,\n animationDelay: animationDelay,\n animationDuration: animationDuration\n };\n if(cacheKey) {\n lookupCache[cacheKey] = data;\n }\n }\n return data;\n }\n\n function parseMaxTime(str) {\n var maxValue = 0;\n var values = angular.isString(str) ?\n str.split(/\\s*,\\s*/) :\n [];\n forEach(values, function(value) {\n maxValue = Math.max(parseFloat(value) || 0, maxValue);\n });\n return maxValue;\n }\n\n function getCacheKey(element) {\n var parentElement = element.parent();\n var parentID = parentElement.data(NG_ANIMATE_PARENT_KEY);\n if(!parentID) {\n parentElement.data(NG_ANIMATE_PARENT_KEY, ++parentCounter);\n parentID = parentCounter;\n }\n return parentID + '-' + element[0].className;\n }\n\n function animateSetup(element, className) {\n var cacheKey = getCacheKey(element);\n var eventCacheKey = cacheKey + ' ' + className;\n var stagger = {};\n var ii = lookupCache[eventCacheKey] ? ++lookupCache[eventCacheKey].total : 0;\n\n if(ii > 0) {\n var staggerClassName = className + '-stagger';\n var staggerCacheKey = cacheKey + ' ' + staggerClassName;\n var applyClasses = !lookupCache[staggerCacheKey];\n\n applyClasses && element.addClass(staggerClassName);\n\n stagger = getElementAnimationDetails(element, staggerCacheKey);\n\n applyClasses && element.removeClass(staggerClassName);\n }\n\n element.addClass(className);\n\n var timings = getElementAnimationDetails(element, eventCacheKey);\n\n /* there is no point in performing a reflow if the animation\n timeout is empty (this would cause a flicker bug normally\n in the page. There is also no point in performing an animation\n that only has a delay and no duration */\n var maxDuration = Math.max(timings.transitionDuration, timings.animationDuration);\n if(maxDuration === 0) {\n element.removeClass(className);\n return false;\n }\n\n var node = element[0];\n //temporarily disable the transition so that the enter styles\n //don't animate twice (this is here to avoid a bug in Chrome/FF).\n var activeClassName = '';\n if(timings.transitionDuration > 0) {\n element.addClass(NG_ANIMATE_FALLBACK_CLASS_NAME);\n activeClassName += NG_ANIMATE_FALLBACK_ACTIVE_CLASS_NAME + ' ';\n blockTransitions(element);\n } else {\n blockKeyframeAnimations(element);\n }\n\n forEach(className.split(' '), function(klass, i) {\n activeClassName += (i > 0 ? ' ' : '') + klass + '-active';\n });\n\n element.data(NG_ANIMATE_CSS_DATA_KEY, {\n className : className,\n activeClassName : activeClassName,\n maxDuration : maxDuration,\n classes : className + ' ' + activeClassName,\n timings : timings,\n stagger : stagger,\n ii : ii\n });\n\n return true;\n }\n\n function blockTransitions(element) {\n element[0].style[TRANSITION_PROP + PROPERTY_KEY] = 'none';\n }\n\n function blockKeyframeAnimations(element) {\n element[0].style[ANIMATION_PROP] = 'none 0s';\n }\n\n function unblockTransitions(element) {\n var node = element[0], prop = TRANSITION_PROP + PROPERTY_KEY;\n if(node.style[prop] && node.style[prop].length > 0) {\n node.style[prop] = '';\n }\n }\n\n function unblockKeyframeAnimations(element) {\n element[0].style[ANIMATION_PROP] = '';\n }\n\n function animateRun(element, className, activeAnimationComplete) {\n var data = element.data(NG_ANIMATE_CSS_DATA_KEY);\n if(!element.hasClass(className) || !data) {\n activeAnimationComplete();\n return;\n }\n\n var node = element[0];\n var timings = data.timings;\n var stagger = data.stagger;\n var maxDuration = data.maxDuration;\n var activeClassName = data.activeClassName;\n var maxDelayTime = Math.max(timings.transitionDelay, timings.animationDelay) * 1000;\n var startTime = Date.now();\n var css3AnimationEvents = ANIMATIONEND_EVENT + ' ' + TRANSITIONEND_EVENT;\n var formerStyle;\n var ii = data.ii;\n\n var applyFallbackStyle, style = '';\n if(timings.transitionDuration > 0) {\n var propertyStyle = timings.transitionPropertyStyle;\n if(propertyStyle.indexOf('all') == -1) {\n applyFallbackStyle = true;\n var fallbackProperty = $sniffer.msie ? '-ms-zoom' : 'border-spacing';\n style += CSS_PREFIX + 'transition-property: ' + propertyStyle + ', ' + fallbackProperty + '; ';\n style += CSS_PREFIX + 'transition-duration: ' + timings.transitionDurationStyle + ', ' + timings.transitionDuration + 's; ';\n }\n } else {\n unblockKeyframeAnimations(element);\n }\n\n if(ii > 0) {\n if(stagger.transitionDelay > 0 && stagger.transitionDuration === 0) {\n var delayStyle = timings.transitionDelayStyle;\n if(applyFallbackStyle) {\n delayStyle += ', ' + timings.transitionDelay + 's';\n }\n\n style += CSS_PREFIX + 'transition-delay: ' +\n prepareStaggerDelay(delayStyle, stagger.transitionDelay, ii) + '; ';\n }\n\n if(stagger.animationDelay > 0 && stagger.animationDuration === 0) {\n style += CSS_PREFIX + 'animation-delay: ' +\n prepareStaggerDelay(timings.animationDelayStyle, stagger.animationDelay, ii) + '; ';\n }\n }\n\n if(style.length > 0) {\n formerStyle = applyStyle(node, style);\n }\n\n element.on(css3AnimationEvents, onAnimationProgress);\n element.addClass(activeClassName);\n\n // This will automatically be called by $animate so\n // there is no need to attach this internally to the\n // timeout done method.\n return function onEnd(cancelled) {\n element.off(css3AnimationEvents, onAnimationProgress);\n element.removeClass(activeClassName);\n animateClose(element, className);\n if(formerStyle != null) {\n formerStyle.length > 0 ?\n node.setAttribute('style', formerStyle) :\n node.removeAttribute('style');\n }\n };\n\n function onAnimationProgress(event) {\n event.stopPropagation();\n var ev = event.originalEvent || event;\n var timeStamp = ev.$manualTimeStamp || ev.timeStamp || Date.now();\n /* $manualTimeStamp is a mocked timeStamp value which is set\n * within browserTrigger(). This is only here so that tests can\n * mock animations properly. Real events fallback to event.timeStamp,\n * or, if they don't, then a timeStamp is automatically created for them.\n * We're checking to see if the timeStamp surpasses the expected delay,\n * but we're using elapsedTime instead of the timeStamp on the 2nd\n * pre-condition since animations sometimes close off early */\n if(Math.max(timeStamp - startTime, 0) >= maxDelayTime && ev.elapsedTime >= maxDuration) {\n activeAnimationComplete();\n }\n }\n }\n\n function prepareStaggerDelay(delayStyle, staggerDelay, index) {\n var style = '';\n forEach(delayStyle.split(','), function(val, i) {\n style += (i > 0 ? ',' : '') +\n (index * staggerDelay + parseInt(val, 10)) + 's';\n });\n return style;\n }\n\n function animateBefore(element, className) {\n if(animateSetup(element, className)) {\n return function(cancelled) {\n cancelled && animateClose(element, className);\n };\n }\n }\n\n function animateAfter(element, className, afterAnimationComplete) {\n if(element.data(NG_ANIMATE_CSS_DATA_KEY)) {\n return animateRun(element, className, afterAnimationComplete);\n } else {\n animateClose(element, className);\n afterAnimationComplete();\n }\n }\n\n function animate(element, className, animationComplete) {\n //If the animateSetup function doesn't bother returning a\n //cancellation function then it means that there is no animation\n //to perform at all\n var preReflowCancellation = animateBefore(element, className);\n if(!preReflowCancellation) {\n animationComplete();\n return;\n }\n\n //There are two cancellation functions: one is before the first\n //reflow animation and the second is during the active state\n //animation. The first function will take care of removing the\n //data from the element which will not make the 2nd animation\n //happen in the first place\n var cancel = preReflowCancellation;\n afterReflow(function() {\n unblockTransitions(element);\n //once the reflow is complete then we point cancel to\n //the new cancellation function which will remove all of the\n //animation properties from the active animation\n cancel = animateAfter(element, className, animationComplete);\n });\n\n return function(cancelled) {\n (cancel || noop)(cancelled);\n };\n }\n\n function animateClose(element, className) {\n element.removeClass(className);\n element.removeClass(NG_ANIMATE_FALLBACK_CLASS_NAME);\n element.removeData(NG_ANIMATE_CSS_DATA_KEY);\n }\n\n return {\n allowCancel : function(element, animationEvent, className) {\n //always cancel the current animation if it is a\n //structural animation\n var oldClasses = (element.data(NG_ANIMATE_CSS_DATA_KEY) || {}).classes;\n if(!oldClasses || ['enter','leave','move'].indexOf(animationEvent) >= 0) {\n return true;\n }\n\n var parentElement = element.parent();\n var clone = angular.element(element[0].cloneNode());\n\n //make the element super hidden and override any CSS style values\n clone.attr('style','position:absolute; top:-9999px; left:-9999px');\n clone.removeAttr('id');\n clone.html('');\n\n forEach(oldClasses.split(' '), function(klass) {\n clone.removeClass(klass);\n });\n\n var suffix = animationEvent == 'addClass' ? '-add' : '-remove';\n clone.addClass(suffixClasses(className, suffix));\n parentElement.append(clone);\n\n var timings = getElementAnimationDetails(clone);\n clone.remove();\n\n return Math.max(timings.transitionDuration, timings.animationDuration) > 0;\n },\n\n enter : function(element, animationCompleted) {\n return animate(element, 'ng-enter', animationCompleted);\n },\n\n leave : function(element, animationCompleted) {\n return animate(element, 'ng-leave', animationCompleted);\n },\n\n move : function(element, animationCompleted) {\n return animate(element, 'ng-move', animationCompleted);\n },\n\n beforeAddClass : function(element, className, animationCompleted) {\n var cancellationMethod = animateBefore(element, suffixClasses(className, '-add'));\n if(cancellationMethod) {\n afterReflow(function() {\n unblockTransitions(element);\n animationCompleted();\n });\n return cancellationMethod;\n }\n animationCompleted();\n },\n\n addClass : function(element, className, animationCompleted) {\n return animateAfter(element, suffixClasses(className, '-add'), animationCompleted);\n },\n\n beforeRemoveClass : function(element, className, animationCompleted) {\n var cancellationMethod = animateBefore(element, suffixClasses(className, '-remove'));\n if(cancellationMethod) {\n afterReflow(function() {\n unblockTransitions(element);\n animationCompleted();\n });\n return cancellationMethod;\n }\n animationCompleted();\n },\n\n removeClass : function(element, className, animationCompleted) {\n return animateAfter(element, suffixClasses(className, '-remove'), animationCompleted);\n }\n };\n\n function suffixClasses(classes, suffix) {\n var className = '';\n classes = angular.isArray(classes) ? classes : classes.split(/\\s+/);\n forEach(classes, function(klass, i) {\n if(klass && klass.length > 0) {\n className += (i > 0 ? ' ' : '') + klass + suffix;\n }\n });\n return className;\n }\n }]);\n }]);\n", "meta": {"content_hash": "ed82e7ac286038fb9ede14c272a09167", "timestamp": "", "source": "github", "line_count": 1279, "max_line_length": 244, "avg_line_length": 48.320562939796716, "alnum_prop": 0.5992362706708521, "repo_name": "songlinjava/angular.js", "id": "81d200431b5933cfd15f8d8accec62cc63e5388d", "size": "61802", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ngAnimate/animate.js", "mode": "33188", "license": "mit", "language": []}} +{"text": "namespace base { class Thread; }\n\nnamespace sandbox {\n\nclass SANDBOX_EXPORT ThreadHelpers {\n public:\n // Check whether the current process is single threaded. |proc_fd|\n // must be a file descriptor to /proc/ and remains owned by the\n // caller.\n static bool IsSingleThreaded(int proc_fd);\n static bool IsSingleThreaded();\n\n // Crash if the current process is not single threaded. This will wait\n // on /proc to be updated. In the case where this doesn't crash, this will\n // return promptly. In the case where this does crash, this will first wait\n // for a few ms in Debug mode, a few seconds in Release mode.\n static void AssertSingleThreaded(int proc_fd);\n static void AssertSingleThreaded();\n\n // Stop |thread| and ensure that it does not have an entry in\n // /proc/self/task/ from the point of view of the current thread. This is\n // the way to stop threads before calling IsSingleThreaded().\n static bool StopThreadAndWatchProcFS(int proc_fd, base::Thread* thread);\n\n static const char* GetAssertSingleThreadedErrorMessageForTests();\n\n private:\n DISALLOW_IMPLICIT_CONSTRUCTORS(ThreadHelpers);\n};\n\n} // namespace sandbox\n\n#endif // SANDBOX_LINUX_SERVICES_THREAD_HELPERS_H_\n", "meta": {"content_hash": "7284ed8fa925d757aa39452492f6c8fe", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 77, "avg_line_length": 36.303030303030305, "alnum_prop": 0.7420701168614358, "repo_name": "Fireblend/chromium-crosswalk", "id": "f4abdffd03b418b15b07f08a6b32b3b08d499db9", "size": "1525", "binary": false, "copies": "13", "ref": "refs/heads/master", "path": "sandbox/linux/services/thread_helpers.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "AppleScript", "bytes": "6973"}, {"name": "Arduino", "bytes": "464"}, {"name": "Assembly", "bytes": "34367"}, {"name": "Batchfile", "bytes": "8451"}, {"name": "C", "bytes": "9397825"}, {"name": "C++", "bytes": "235052525"}, {"name": "CSS", "bytes": "951745"}, {"name": "DM", "bytes": "60"}, {"name": "Emacs Lisp", "bytes": "988"}, {"name": "Groff", "bytes": "2494"}, {"name": "HTML", "bytes": "29070071"}, {"name": "Java", "bytes": "10089056"}, {"name": "JavaScript", "bytes": "20170506"}, {"name": "Makefile", "bytes": "68234"}, {"name": "Objective-C", "bytes": "1639405"}, {"name": "Objective-C++", "bytes": "9478782"}, {"name": "PHP", "bytes": "97817"}, {"name": "PLpgSQL", "bytes": "178732"}, {"name": "Perl", "bytes": "63937"}, {"name": "Protocol Buffer", "bytes": "465313"}, {"name": "Python", "bytes": "8146950"}, {"name": "Shell", "bytes": "473684"}, {"name": "Standard ML", "bytes": "5034"}, {"name": "XSLT", "bytes": "418"}, {"name": "nesC", "bytes": "18347"}]}} +{"text": "package io.leangen.graphql.generator.mapping;\n\nimport io.leangen.graphql.util.ClassUtils;\n\nimport java.lang.reflect.AnnotatedType;\n\npublic abstract class AbstractSimpleTypeAdapter<T, S> extends AbstractTypeAdapter<T, S> {\n\n @SuppressWarnings(\"WeakerAccess\")\n protected final Class<?> rawSourceType;\n\n protected AbstractSimpleTypeAdapter() {\n this.rawSourceType = ClassUtils.getRawType(sourceType.getType());\n }\n\n @Override\n public boolean supports(AnnotatedType type) {\n return ClassUtils.isSuperClass(rawSourceType, type);\n }\n}\n", "meta": {"content_hash": "f88b0e383bb1f5c93b8afee69ad8b315", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 89, "avg_line_length": 28.2, "alnum_prop": 0.74822695035461, "repo_name": "leangen/GraphQL-SPQR", "id": "5dc471494ab5746d371c3c433df2d3e081b89162", "size": "564", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/io/leangen/graphql/generator/mapping/AbstractSimpleTypeAdapter.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "1016834"}]}} +{"text": "<?php\n/**\n * Adds methods for limited kinds of faceting using the silverstripe ORM.\n * This is used by the default ShopSearchSimple adapter but also can\n * be added to other contexts (such as ProductCategory).\n *\n * TODO: Facet class + subclasses\n *\n * @author Mark Guinn <mark@adaircreative.com>\n * @date 10.21.2013\n * @package shop_search\n * @subpackage helpers\n */\nclass FacetHelper extends Object\n{\n /** @var bool - if this is turned on it will use an algorithm that doesn't require traversing the data set if possible */\n private static $faster_faceting = false;\n\n /** @var bool - should the facets (link and checkbox only) be sorted - this can mess with things like category lists */\n private static $sort_facet_values = true;\n\n /** @var string - I don't know why you'd want to override this, but you could if you wanted */\n private static $attribute_facet_regex = '/^ATT(\\d+)$/';\n\n /** @var bool - For checkbox facets, is the initial state all checked or all unchecked? */\n private static $default_checkbox_state = true;\n\n\n /**\n * @return FacetHelper\n */\n public static function inst()\n {\n return Injector::inst()->get('FacetHelper');\n }\n\n\n /**\n * Performs some quick pre-processing on filters from any source\n *\n * @param array $filters\n * @return array\n */\n public function scrubFilters($filters)\n {\n if (!is_array($filters)) {\n $filters = array();\n }\n\n foreach ($filters as $k => $v) {\n if (empty($v)) {\n unset($filters[$k]);\n }\n // this allows you to send an array as a comma-separated list, which is easier on the query string length\n if (is_string($v) && strpos($v, 'LIST~') === 0) {\n $filters[$k] = explode(',', substr($v, 5));\n }\n }\n\n return $filters;\n }\n\n\n /**\n * @param DataList $list\n * @param array $filters\n * @param DataObject|string $sing - just a singleton object we can get information off of\n * @return DataList\n */\n public function addFiltersToDataList($list, array $filters, $sing=null)\n {\n if (!$sing) {\n $sing = singleton($list->dataClass());\n }\n if (is_string($sing)) {\n $sing = singleton($sing);\n }\n\n if (!empty($filters)) {\n foreach ($filters as $filterField => $filterVal) {\n if ($sing->hasExtension('HasStaticAttributes') && preg_match(self::config()->attribute_facet_regex, $filterField, $matches)) {\n //\t\t\t\t\t$sav = $sing->StaticAttributeValues();\n//\t\t\t\t\tDebug::log(\"sav = {$sav->getJoinTable()}, {$sav->getLocalKey()}, {$sav->getForeignKey()}\");\n//\t\t\t\t\t$list = $list\n//\t\t\t\t\t\t->innerJoin($sav->getJoinTable(), \"\\\"{$sing->baseTable()}\\\".\\\"ID\\\" = \\\"{$sav->getJoinTable()}\\\".\\\"{$sav->getLocalKey()}\\\"\")\n//\t\t\t\t\t\t->filter(\"\\\"{$sav->getJoinTable()}\\\".\\\"{$sav->getForeignKey()}\\\"\", $filterVal)\n//\t\t\t\t\t;\n // TODO: This logic should be something like the above, but I don't know\n // how to get the join table from a singleton (which returns an UnsavedRelationList\n // instead of a ManyManyList). I've got a deadline to meet, though, so this\n // will catch the majority of cases as long as the extension is applied to the\n // Product class instead of a subclass.\n $list = $list\n ->innerJoin('Product_StaticAttributeTypes', \"\\\"SiteTree\\\".\\\"ID\\\" = \\\"Product_StaticAttributeTypes\\\".\\\"ProductID\\\"\")\n ->innerJoin('ProductAttributeValue', \"\\\"Product_StaticAttributeTypes\\\".\\\"ProductAttributeTypeID\\\" = \\\"ProductAttributeValue\\\".\\\"TypeID\\\"\")\n ->innerJoin('Product_StaticAttributeValues', \"\\\"SiteTree\\\".\\\"ID\\\" = \\\"Product_StaticAttributeValues\\\".\\\"ProductID\\\" AND \\\"ProductAttributeValue\\\".\\\"ID\\\" = \\\"Product_StaticAttributeValues\\\".\\\"ProductAttributeValueID\\\"\")\n ->filter(\"Product_StaticAttributeValues.ProductAttributeValueID\", $filterVal);\n } else {\n $list = $list->filter($this->processFilterField($sing, $filterField, $filterVal));\n }\n }\n }\n\n return $list;\n }\n\n\n /**\n * @param DataObject $rec This would normally just be a singleton but we don't want to have to create it over and over\n * @param string $filterField\n * @param mixed $filterVal\n * @return array - returns the new filter added\n */\n public function processFilterField($rec, $filterField, $filterVal)\n {\n // First check for VFI fields\n if ($rec->hasExtension('VirtualFieldIndex') && ($spec = $rec->getVFISpec($filterField))) {\n if ($spec['Type'] == VirtualFieldIndex::TYPE_LIST) {\n // Lists have to be handled a little differently\n $f = $rec->getVFIFieldName($filterField) . ':PartialMatch';\n if (is_array($filterVal)) {\n foreach ($filterVal as &$val) {\n $val = '|' . $val . '|';\n }\n return array($f => $filterVal);\n } else {\n return array($f => '|' . $filterVal . '|');\n }\n } else {\n // Simples are simple\n $filterField = $rec->getVFIFieldName($filterField);\n }\n }\n\n // Next check for regular db fields\n if ($rec->dbObject($filterField)) {\n // Is it a range value?\n if (is_string($filterVal) && preg_match('/^RANGE\\~(.+)\\~(.+)$/', $filterVal, $m)) {\n $filterField .= ':Between';\n $filterVal = array_slice($m, 1, 2);\n }\n\n return array($filterField => $filterVal);\n }\n\n return array();\n }\n\n\n /**\n * Processes the facet spec and removes any shorthand (field => label).\n * @param array $facetSpec\n * @return array\n */\n public function expandFacetSpec(array $facetSpec)\n {\n if (is_null($facetSpec)) {\n return array();\n }\n $facets = array();\n\n foreach ($facetSpec as $field => $label) {\n if (is_array($label)) {\n $facets[$field] = $label;\n } else {\n $facets[$field] = array('Label' => $label);\n }\n\n if (empty($facets[$field]['Source'])) {\n $facets[$field]['Source'] = $field;\n }\n if (empty($facets[$field]['Type'])) {\n $facets[$field]['Type'] = ShopSearch::FACET_TYPE_LINK;\n }\n\n if (empty($facets[$field]['Values'])) {\n $facets[$field]['Values'] = array();\n } else {\n $vals = $facets[$field]['Values'];\n if (is_string($vals)) {\n $vals = eval('return ' . $vals . ';');\n }\n $facets[$field]['Values'] = array();\n foreach ($vals as $val => $lbl) {\n $facets[$field]['Values'][$val] = new ArrayData(array(\n 'Label' => $lbl,\n 'Value' => $val,\n 'Count' => 0,\n ));\n }\n }\n }\n\n return $facets;\n }\n\n\n /**\n * This is super-slow. I'm assuming if you're using facets you\n * probably also ought to be using Solr or something else. Or\n * maybe you have unlimited time and can refactor this feature\n * and submit a pull request...\n *\n * TODO: If this is going to be used for categories we're going\n * to have to really clean it up and speed it up.\n * Suggestion:\n * - option to turn off counts\n * - switch order of nested array so we don't go through results unless needed\n * - if not doing counts, min/max and link facets can be handled w/ queries\n * - separate that bit out into a new function\n * NOTE: This is partially done with the \"faster_faceting\" config\n * option but more could be done, particularly by covering link facets as well.\n *\n * Output - list of ArrayData in the format:\n * Label - name of the facet\n * Source - field name of the facet\n * Type - one of the ShopSearch::FACET_TYPE_XXXX constants\n * Values - SS_List of possible values for this facet\n *\n * @param SS_List $matches\n * @param array $facetSpec\n * @param bool $autoFacetAttributes [optional]\n * @return ArrayList\n */\n public function buildFacets(SS_List $matches, array $facetSpec, $autoFacetAttributes=false)\n {\n $facets = $this->expandFacetSpec($facetSpec);\n if (!$autoFacetAttributes && (empty($facets) || !$matches || !$matches->count())) {\n return new ArrayList();\n }\n $fasterMethod = (bool)$this->config()->faster_faceting;\n\n // fill them in\n foreach ($facets as $field => &$facet) {\n if (preg_match(self::config()->attribute_facet_regex, $field, $m)) {\n $this->buildAttributeFacet($matches, $facet, $m[1]);\n continue;\n }\n\n // NOTE: using this method range and checkbox facets don't get counts\n if ($fasterMethod && $facet['Type'] != ShopSearch::FACET_TYPE_LINK) {\n if ($facet['Type'] == ShopSearch::FACET_TYPE_RANGE) {\n if (isset($facet['RangeMin'])) {\n $facet['MinValue'] = $facet['RangeMin'];\n }\n if (isset($facet['RangeMax'])) {\n $facet['MaxValue'] = $facet['RangeMax'];\n }\n }\n\n continue;\n }\n\n foreach ($matches as $rec) {\n // If it's a range facet, set up the min/max\n if ($facet['Type'] == ShopSearch::FACET_TYPE_RANGE) {\n if (isset($facet['RangeMin'])) {\n $facet['MinValue'] = $facet['RangeMin'];\n }\n if (isset($facet['RangeMax'])) {\n $facet['MaxValue'] = $facet['RangeMax'];\n }\n }\n\n // If the field is accessible via normal methods, including\n // a user-defined getter, prefer that\n $fieldValue = $rec->relObject($field);\n if (is_null($fieldValue) && $rec->hasMethod($meth = \"get{$field}\")) {\n $fieldValue = $rec->$meth();\n }\n\n // If not, look for a VFI field\n if (!$fieldValue && $rec->hasExtension('VirtualFieldIndex')) {\n $fieldValue = $rec->getVFI($field);\n }\n\n // If we found something, process it\n if (!empty($fieldValue)) {\n // normalize so that it's iterable\n if (!is_array($fieldValue) && !$fieldValue instanceof SS_List) {\n $fieldValue = array($fieldValue);\n }\n\n foreach ($fieldValue as $obj) {\n if (empty($obj)) {\n continue;\n }\n\n // figure out the right label\n if (is_object($obj) && $obj->hasMethod('Nice')) {\n $lbl = $obj->Nice();\n } elseif (is_object($obj) && !empty($obj->Title)) {\n $lbl = $obj->Title;\n } elseif (\n is_numeric($obj) &&\n !empty($facet['LabelFormat']) &&\n $facet['LabelFormat'] === 'Currency' &&\n $facet['Type'] !== ShopSearch::FACET_TYPE_RANGE // this one handles it via javascript\n ) {\n $tmp = Currency::create($field);\n $tmp->setValue($obj);\n $lbl = $tmp->Nice();\n } else {\n $lbl = (string)$obj;\n }\n\n // figure out the value for sorting\n if (is_object($obj) && $obj->hasMethod('getAmount')) {\n $val = $obj->getAmount();\n } elseif (is_object($obj) && !empty($obj->ID)) {\n $val = $obj->ID;\n } else {\n $val = (string)$obj;\n }\n\n // if it's a range facet, calculate the min and max\n if ($facet['Type'] == ShopSearch::FACET_TYPE_RANGE) {\n if (!isset($facet['MinValue']) || $val < $facet['MinValue']) {\n $facet['MinValue'] = $val;\n $facet['MinLabel'] = $lbl;\n }\n if (!isset($facet['RangeMin']) || $val < $facet['RangeMin']) {\n $facet['RangeMin'] = $val;\n }\n if (!isset($facet['MaxValue']) || $val > $facet['MaxValue']) {\n $facet['MaxValue'] = $val;\n $facet['MaxLabel'] = $lbl;\n }\n if (!isset($facet['RangeMax']) || $val > $facet['RangeMax']) {\n $facet['RangeMax'] = $val;\n }\n }\n\n // Tally the value in the facets\n if (!isset($facet['Values'][$val])) {\n $facet['Values'][$val] = new ArrayData(array(\n 'Label' => $lbl,\n 'Value' => $val,\n 'Count' => 1,\n ));\n } elseif ($facet['Values'][$val]) {\n $facet['Values'][$val]->Count++;\n }\n }\n }\n }\n }\n\n // if we're auto-building the facets based on attributes,\n if ($autoFacetAttributes) {\n $facets = array_merge($this->buildAllAttributeFacets($matches), $facets);\n }\n\n // convert values to arraylist\n $out = new ArrayList();\n $sortValues = self::config()->sort_facet_values;\n foreach ($facets as $f) {\n if ($sortValues) {\n ksort($f['Values']);\n }\n $f['Values'] = new ArrayList($f['Values']);\n $out->push(new ArrayData($f));\n }\n\n return $out;\n }\n\n\n /**\n * NOTE: this will break if applied to something that's not a SiteTree subclass.\n * @param DataList|PaginatedList $matches\n * @param array $facet\n * @param int $typeID\n */\n protected function buildAttributeFacet($matches, array &$facet, $typeID)\n {\n $q = $matches instanceof PaginatedList ? $matches->getList()->dataQuery()->query() : $matches->dataQuery()->query();\n\n if (empty($facet['Label'])) {\n $type = ProductAttributeType::get()->byID($typeID);\n $facet['Label'] = $type->Label;\n }\n\n $baseTable = $q->getFrom();\n if (is_array($baseTable)) {\n $baseTable = reset($baseTable);\n }\n\n $q = $q->setSelect(array())\n ->selectField('\"ProductAttributeValue\".\"ID\"', 'Value')\n ->selectField('\"ProductAttributeValue\".\"Value\"', 'Label')\n ->selectField('count(distinct '.$baseTable.'.\"ID\")', 'Count')\n ->selectField('\"ProductAttributeValue\".\"Sort\"')\n ->addInnerJoin('Product_StaticAttributeValues', $baseTable.'.\"ID\" = \"Product_StaticAttributeValues\".\"ProductID\"')\n ->addInnerJoin('ProductAttributeValue', '\"Product_StaticAttributeValues\".\"ProductAttributeValueID\" = \"ProductAttributeValue\".\"ID\"')\n ->addWhere(sprintf(\"\\\"ProductAttributeValue\\\".\\\"TypeID\\\" = '%d'\", $typeID))\n ->setOrderBy('\"ProductAttributeValue\".\"Sort\"', 'ASC')\n ->setGroupBy('\"ProductAttributeValue\".\"ID\"')\n ->execute()\n ;\n\n $facet['Values'] = array();\n foreach ($q as $row) {\n $facet['Values'][ $row['Value'] ] = new ArrayData($row);\n }\n }\n\n\n /**\n * Builds facets from all attributes present in the data set.\n * @param DataList|PaginatedList $matches\n * @return array\n */\n protected function buildAllAttributeFacets($matches)\n {\n $q = $matches instanceof PaginatedList ? $matches->getList()->dataQuery()->query() : $matches->dataQuery()->query();\n\n // this is the easiest way to get SiteTree vs SiteTree_Live\n $baseTable = $q->getFrom();\n if (is_array($baseTable)) {\n $baseTable = reset($baseTable);\n }\n\n $q = $q->setSelect(array())\n ->selectField('\"ProductAttributeType\".\"ID\"', 'TypeID')\n ->selectField('\"ProductAttributeType\".\"Label\"', 'TypeLabel')\n ->selectField('\"ProductAttributeValue\".\"ID\"', 'Value')\n ->selectField('\"ProductAttributeValue\".\"Value\"', 'Label')\n ->selectField('count(distinct '.$baseTable.'.\"ID\")', 'Count')\n ->selectField('\"ProductAttributeValue\".\"Sort\"')\n ->addInnerJoin('Product_StaticAttributeTypes', $baseTable.'.\"ID\" = \"Product_StaticAttributeTypes\".\"ProductID\"')\n ->addInnerJoin('ProductAttributeType', '\"Product_StaticAttributeTypes\".\"ProductAttributeTypeID\" = \"ProductAttributeType\".\"ID\"')\n ->addInnerJoin('Product_StaticAttributeValues', $baseTable.'.\"ID\" = \"Product_StaticAttributeValues\".\"ProductID\"')\n ->addInnerJoin('ProductAttributeValue', '\"Product_StaticAttributeValues\".\"ProductAttributeValueID\" = \"ProductAttributeValue\".\"ID\"'\n . ' AND \"ProductAttributeValue\".\"TypeID\" = \"ProductAttributeType\".\"ID\"')\n ->setOrderBy(array(\n '\"ProductAttributeType\".\"Label\"' => 'ASC',\n '\"ProductAttributeValue\".\"Sort\"' => 'ASC',\n ))\n ->setGroupBy(array('\"ProductAttributeValue\".\"ID\"', '\"ProductAttributeType\".\"ID\"'))\n ->execute()\n ;\n\n\n $curType = 0;\n $facets = array();\n $curFacet = null;\n foreach ($q as $row) {\n if ($curType != $row['TypeID']) {\n if ($curType > 0) {\n $facets['ATT'.$curType] = $curFacet;\n }\n $curType = $row['TypeID'];\n $curFacet = array(\n 'Label' => $row['TypeLabel'],\n 'Source' => 'ATT'.$curType,\n 'Type' => ShopSearch::FACET_TYPE_LINK,\n 'Values' => array(),\n );\n }\n\n unset($row['TypeID']);\n unset($row['TypeLabel']);\n $curFacet['Values'][ $row['Value'] ] = new ArrayData($row);\n }\n\n if ($curType > 0) {\n $facets['ATT'.$curType] = $curFacet;\n }\n return $facets;\n }\n\n\n /**\n * Inserts a \"Link\" field into the values for each facet which can be\n * used to get a filtered search based on that facets\n *\n * @param ArrayList $facets\n * @param array $baseParams\n * @param string $baseLink\n * @return ArrayList\n */\n public function insertFacetLinks(ArrayList $facets, array $baseParams, $baseLink)\n {\n $qs_f = Config::inst()->get('ShopSearch', 'qs_filters');\n $qs_t = Config::inst()->get('ShopSearch', 'qs_title');\n\n foreach ($facets as $facet) {\n switch ($facet->Type) {\n case ShopSearch::FACET_TYPE_RANGE:\n $params = array_merge($baseParams, array());\n if (!isset($params[$qs_f])) {\n $params[$qs_f] = array();\n }\n $params[$qs_f][$facet->Source] = 'RANGEFACETVALUE';\n $params[$qs_t] = $facet->Label . ': RANGEFACETLABEL';\n $facet->Link = $baseLink . '?' . http_build_query($params);\n break;\n\n case ShopSearch::FACET_TYPE_CHECKBOX;\n $facet->LinkDetails = json_encode(array(\n 'filter' => $qs_f,\n 'source' => $facet->Source,\n 'leaves' => $facet->FilterOnlyLeaves,\n ));\n\n // fall through on purpose\n\n default:\n foreach ($facet->Values as $value) {\n // make a copy of the existing params\n $params = array_merge($baseParams, array());\n\n // add the filter for this value\n if (!isset($params[$qs_f])) {\n $params[$qs_f] = array();\n }\n if ($facet->Type == ShopSearch::FACET_TYPE_CHECKBOX) {\n unset($params[$qs_f][$facet->Source]); // this will be figured out via javascript\n $params[$qs_t] = ($value->Active ? 'Remove ' : '') . $facet->Label . ': ' . $value->Label;\n } else {\n $params[$qs_f][$facet->Source] = $value->Value;\n $params[$qs_t] = $facet->Label . ': ' . $value->Label;\n }\n\n // build a new link\n $value->Link = $baseLink . '?' . http_build_query($params);\n }\n }\n }\n\n return $facets;\n }\n\n\n /**\n * @param ArrayList $children\n * @return array\n */\n protected function getRecursiveChildValues(ArrayList $children)\n {\n $out = array();\n\n foreach ($children as $child) {\n $out[$child->Value] = $child->Value;\n if (!empty($child->Children)) {\n $out += $this->getRecursiveChildValues($child->Children);\n }\n }\n\n return $out;\n }\n\n\n /**\n * For checkbox and range facets, this updates the state (checked and min/max)\n * based on current filter values.\n *\n * @param ArrayList $facets\n * @param array $filters\n * @return ArrayList\n */\n public function updateFacetState(ArrayList $facets, array $filters)\n {\n foreach ($facets as $facet) {\n if ($facet->Type == ShopSearch::FACET_TYPE_CHECKBOX) {\n if (empty($filters[$facet->Source])) {\n // If the filter is not being used at all, we count\n // all values as active.\n foreach ($facet->Values as $value) {\n $value->Active = (bool)FacetHelper::config()->default_checkbox_state;\n }\n } else {\n $filterVals = $filters[$facet->Source];\n if (!is_array($filterVals)) {\n $filterVals = array($filterVals);\n }\n $this->updateCheckboxFacetState(\n !empty($facet->NestedValues) ? $facet->NestedValues : $facet->Values,\n $filterVals,\n !empty($facet->FilterOnlyLeaves));\n }\n } elseif ($facet->Type == ShopSearch::FACET_TYPE_RANGE) {\n if (!empty($filters[$facet->Source]) && preg_match('/^RANGE\\~(.+)\\~(.+)$/', $filters[$facet->Source], $m)) {\n $facet->MinValue = $m[1];\n $facet->MaxValue = $m[2];\n }\n }\n }\n\n return $facets;\n }\n\n\n /**\n * For checkboxes, updates the state based on filters. Handles hierarchies and FilterOnlyLeaves\n * @param ArrayList $values\n * @param array $filterVals\n * @param bool $filterOnlyLeaves [optional]\n * @return bool - true if any of the children are true, false if all children are false\n */\n protected function updateCheckboxFacetState(ArrayList $values, array $filterVals, $filterOnlyLeaves=false)\n {\n $out = false;\n\n foreach ($values as $value) {\n if ($filterOnlyLeaves && !empty($value->Children)) {\n if (in_array($value->Value, $filterVals)) {\n // This wouldn't be normal, but even if it's not a leaf, we want to handle\n // the case where a filter might be set for this node. It should still show up correctly.\n $value->Active = true;\n foreach ($value->Children as $c) {\n $c->Active = true;\n }\n // TODO: handle more than one level of recursion here\n } else {\n $value->Active = $this->updateCheckboxFacetState($value->Children, $filterVals, $filterOnlyLeaves);\n }\n } else {\n $value->Active = in_array($value->Value, $filterVals);\n }\n\n if ($value->Active) {\n $out = true;\n }\n }\n\n return $out;\n }\n\n\n /**\n * If there are any facets (link or checkbox) that have a HierarchyDivider field\n * in the spec, transform them into a hierarchy so they can be displayed as such.\n *\n * @param ArrayList $facets\n * @return ArrayList\n */\n public function transformHierarchies(ArrayList $facets)\n {\n foreach ($facets as $facet) {\n if (!empty($facet->HierarchyDivider)) {\n $out = new ArrayList();\n $parentStack = array();\n\n foreach ($facet->Values as $value) {\n if (empty($value->Label)) {\n continue;\n }\n $value->FullLabel = $value->Label;\n\n // Look for the most recent parent that matches the beginning of this one\n while (count($parentStack) > 0) {\n $curParent = $parentStack[ count($parentStack)-1 ];\n if (strpos($value->Label, $curParent->FullLabel) === 0) {\n if (!isset($curParent->Children)) {\n $curParent->Children = new ArrayList();\n }\n\n // Modify the name so we only show the last component\n $value->FullLabel = $value->Label;\n $p = strrpos($value->Label, $facet->HierarchyDivider);\n if ($p > -1) {\n $value->Label = trim(substr($value->Label, $p + 1));\n }\n\n $curParent->Children->push($value);\n break;\n } else {\n array_pop($parentStack);\n }\n }\n\n // If we went all the way back to the root without a match, this is\n // a new parent item\n if (count($parentStack) == 0) {\n $out->push($value);\n }\n\n // Each item could be a potential parent. If it's not it will get popped\n // immediately on the next iteration\n $parentStack[] = $value;\n }\n\n $facet->NestedValues = $out;\n }\n }\n\n return $facets;\n }\n}\n", "meta": {"content_hash": "6478753a7729571cecfad83c1a477ed7", "timestamp": "", "source": "github", "line_count": 691, "max_line_length": 242, "avg_line_length": 40.04920405209841, "alnum_prop": 0.4753559297535593, "repo_name": "markguinn/silverstripe-shop-search", "id": "bfb09294dcb715bc4cacf98092967be2b163a30f", "size": "27674", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code/helpers/FacetHelper.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "3858"}, {"name": "JavaScript", "bytes": "16835"}, {"name": "PHP", "bytes": "152023"}, {"name": "Scheme", "bytes": "3171"}, {"name": "Shell", "bytes": "463"}]}} +{"text": "package org.jetbrains.plugins.hocon.misc\n\nimport com.intellij.psi.PsiElement\nimport com.intellij.xml.breadcrumbs.BreadcrumbsInfoProvider\nimport org.jetbrains.plugins.hocon.lang.HoconLanguage\nimport org.jetbrains.plugins.hocon.psi.HKeyedField\n\nclass HoconBreadcrumbsInfoProvider extends BreadcrumbsInfoProvider {\n def getElementTooltip(e: PsiElement) = null\n\n def getElementInfo(e: PsiElement): String = e match {\n case kf: HKeyedField => kf.key.map(_.stringValue).getOrElse(\"\")\n case _ => \"\"\n }\n\n def acceptElement(e: PsiElement): Boolean = e match {\n case _: HKeyedField => true\n case _ => false\n }\n\n def getLanguages = Array(HoconLanguage)\n}\n", "meta": {"content_hash": "5a63083ddf29feded05294f5a117eca1", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 68, "avg_line_length": 30.09090909090909, "alnum_prop": 0.7522658610271903, "repo_name": "loskutov/intellij-scala", "id": "0fc95d7dcab59656b53fc4efed2ef81453c363f6", "size": "662", "binary": false, "copies": "2", "ref": "refs/heads/idea172.x-better-implicits", "path": "src/org/jetbrains/plugins/hocon/misc/HoconBreadcrumbsInfoProvider.scala", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "55566"}, {"name": "Java", "bytes": "1397858"}, {"name": "Lex", "bytes": "35728"}, {"name": "Scala", "bytes": "11387086"}, {"name": "Shell", "bytes": "537"}]}} +{"text": "export default connect()(App)\n", "meta": {"content_hash": "e182d1add0a3d11793f891809b401601", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 29, "avg_line_length": 30.0, "alnum_prop": 0.7666666666666667, "repo_name": "yp/eslint-plugin-import", "id": "9c1d8d40706b16077e1649bf8f5d1f4e44f8b275", "size": "45", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tests/files/redux.js", "mode": "33188", "license": "mit", "language": [{"name": "CoffeeScript", "bytes": "27"}, {"name": "JavaScript", "bytes": "141336"}]}} +{"text": "\n\npackage com.google.cloud.resourcemanager.v3.samples;\n\n// [START cloudresourcemanager_v3_generated_TagValuesSettings_GetTagValue_sync]\nimport com.google.cloud.resourcemanager.v3.TagValuesSettings;\nimport java.time.Duration;\n\npublic class SyncGetTagValue {\n\n public static void main(String[] args) throws Exception {\n syncGetTagValue();\n }\n\n public static void syncGetTagValue() throws Exception {\n // This snippet has been automatically generated and should be regarded as a code template only.\n // It will require modifications to work:\n // - It may require correct/in-range values for request initialization.\n // - It may require specifying regional endpoints when creating the service client as shown in\n // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library\n TagValuesSettings.Builder tagValuesSettingsBuilder = TagValuesSettings.newBuilder();\n tagValuesSettingsBuilder\n .getTagValueSettings()\n .setRetrySettings(\n tagValuesSettingsBuilder.getTagValueSettings().getRetrySettings().toBuilder()\n .setTotalTimeout(Duration.ofSeconds(30))\n .build());\n TagValuesSettings tagValuesSettings = tagValuesSettingsBuilder.build();\n }\n}\n// [END cloudresourcemanager_v3_generated_TagValuesSettings_GetTagValue_sync]\n", "meta": {"content_hash": "833ec22440066f5c5dafb7a349d47bd2", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 100, "avg_line_length": 42.806451612903224, "alnum_prop": 0.7550866616428034, "repo_name": "googleapis/google-cloud-java", "id": "ea1e9e42c96dd58cbd5ddf466800e5f454236899", "size": "1922", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "java-resourcemanager/samples/snippets/generated/com/google/cloud/resourcemanager/v3/tagvaluessettings/gettagvalue/SyncGetTagValue.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Dockerfile", "bytes": "2614"}, {"name": "HCL", "bytes": "28592"}, {"name": "Java", "bytes": "826434232"}, {"name": "Jinja", "bytes": "2292"}, {"name": "Python", "bytes": "200408"}, {"name": "Shell", "bytes": "97954"}]}} +{"text": "{% extends \"base.html\" %}\n{% import \"bootstrap/wtf.html\" as wtf %}\n\n\n{% block title %}Flasky{% endblock %}\n\n{% block page_content %}\n\n<div>\n\n {{ wtf.quick_form(form) }}\n\n</div>\n\n\n\n\n<div class=\"text-center\">\n<br>\n <table class=\"table-bordered table-hover\">\n <thead>\n <tr>\n <th style=\"text-align:center\">#</th>\n {% for date_tmp in date_range_response %}\n <th style=\"text-align:center\">{{ date_tmp.strftime( '%m-%d' ) }}<br>{{ date_tmp.strftime( '%a' ) }}</th>\n {% endfor %}\n <th>SUM</th>\n </tr>\n </thead>\n\n <tbody>\n\n {% for teacher in teacher_sum_response_data%}\n\n <tr>\n <td><strong>{{ teacher}}</strong></td>\n\n {% for date_tmp in date_range_response %}\n {% if teacher_sum_response_data[teacher][date_tmp] %}\n <td><a href=\"/get_teacher_one_day_sum_detail?teacher_name={{ teacher }}&date={{ date_tmp }}\" target=\"_blank\">{{ teacher_sum_response_data[teacher][date_tmp].total_seconds()/3600 }}</a></td>\n {% else %}\n <td></td>\n {% endif %}\n {% endfor %}\n\n <td>{{ teacher_sum_response_data[teacher]['total_classes_time'].total_seconds()/3600 }}</td>\n\n\n </tr>\n {% endfor %}\n </tbody>\n\n </table>\n\n\n</div>\n\n\n\n\n{% endblock %}\n\n{% block scripts %}\n{{ super() }}\n{{ pagedown.include_pagedown() }}\n{% endblock %}\n", "meta": {"content_hash": "8badc6e348235cedb484327ffd9fd265", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 217, "avg_line_length": 24.242424242424242, "alnum_prop": 0.446875, "repo_name": "phillinzzz/flasky", "id": "a4e9af2dfae3a02f8147746149befd42794468ec", "size": "1600", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/templates/generate_sum_teacher_classes.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1855"}, {"name": "HTML", "bytes": "64919"}, {"name": "Mako", "bytes": "412"}, {"name": "Python", "bytes": "134813"}]}} +{"text": "<select>\n\t<option value=\"FR\">Fran\u00e7aise</option>\n\t<option value=\"CH\">Suisse</option>\n\t<option value=\"BE\">Belge</option>\n\t<option value=\"DE\">Allemande</option>\n\t<option value=\"IT\">Italienne</option>\n\t<option value=\"AF\">Afghane</option>\n\t<option value=\"AL\">Albanaise</option>\n\t<option value=\"DZ\">Algerienne</option>\n\t<option value=\"US\">Americaine</option>\n\t<option value=\"AD\">Andorrane</option>\n\t<option value=\"AO\">Angolaise</option>\n\t<option value=\"AG\">Antiguaise et barbudienne</option>\n\t<option value=\"AR\">Argentine</option>\n\t<option value=\"AM\">Armenienne</option>\n\t<option value=\"AU\">Australienne</option>\n\t<option value=\"AT\">Autrichienne</option>\n\t<option value=\"AZ\">Azerba\u00efdjanaise</option>\n\t<option value=\"BS\">Bahamienne</option>\n\t<option value=\"BH\">Bahreinienne</option>\n\t<option value=\"BD\">Bangladaise</option>\n\t<option value=\"BB\">Barbadienne</option>\n\t<option value=\"BZ\">Belizienne</option>\n\t<option value=\"BJ\">Beninoise</option>\n\t<option value=\"BT\">Bhoutanaise</option>\n\t<option value=\"BY\">Bielorusse</option>\n\t<option value=\"MM\">Birmane</option>\n\t<option value=\"GW\">Bissau-Guin\u00e9enne</option>\n\t<option value=\"BO\">Bolivienne</option>\n\t<option value=\"BA\">Bosnienne</option>\n\t<option value=\"BW\">Botswanaise</option>\n\t<option value=\"BR\">Bresilienne</option>\n\t<option value=\"GB\">Britannique</option>\n\t<option value=\"BN\">Bruneienne</option>\n\t<option value=\"BG\">Bulgare</option>\n\t<option value=\"BF\">Burkinabe</option>\n\t<option value=\"BI\">Burundaise</option>\n\t<option value=\"KH\">Cambodgienne</option>\n\t<option value=\"CM\">Camerounaise</option>\n\t<option value=\"CA\">Canadienne</option>\n\t<option value=\"CV\">Cap-verdienne</option>\n\t<option value=\"CF\">Centrafricaine</option>\n\t<option value=\"CL\">Chilienne</option>\n\t<option value=\"CN\">Chinoise</option>\n\t<option value=\"CY\">Chypriote</option>\n\t<option value=\"CO\">Colombienne</option>\n\t<option value=\"KM\">Comorienne</option>\n\t<option value=\"CG\">Congolaise</option>\n\t<option value=\"CR\">Costaricaine</option>\n\t<option value=\"HR\">Croate</option>\n\t<option value=\"CU\">Cubaine</option>\n\t<option value=\"DK\">Danoise</option>\n\t<option value=\"DJ\">Djiboutienne</option>\n\t<option value=\"DO\">Dominicaine</option>\n\t<option value=\"DM\">Dominiquaise</option>\n\t<option value=\"EG\">Egyptienne</option>\n\t<option value=\"AE\">Emirienne</option>\n\t<option value=\"GQ\">Equato-guineenne</option>\n\t<option value=\"EC\">Equatorienne</option>\n\t<option value=\"ER\">Erythreenne</option>\n\t<option value=\"ES\">Espagnole</option>\n\t<option value=\"TL\">Est-timoraise</option>\n\t<option value=\"EE\">Estonienne</option>\n\t<option value=\"ET\">Ethiopienne</option>\n\t<option value=\"FJ\">Fidjienne</option>\n\t<option value=\"FI\">Finlandaise</option>\n\t<option value=\"GA\">Gabonaise</option>\n\t<option value=\"GM\">Gambienne</option>\n\t<option value=\"GE\">Georgienne</option>\n\t<option value=\"GH\">Ghaneenne</option>\n\t<option value=\"GD\">Grenadienne</option>\n\t<option value=\"GT\">Guatemalteque</option>\n\t<option value=\"GN\">Guineenne</option>\n\t<option value=\"GF\">Guyanienne</option>\n\t<option value=\"HT\">Ha\u00eftienne</option>\n\t<option value=\"GR\">Hellenique</option>\n\t<option value=\"HN\">Hondurienne</option>\n\t<option value=\"HU\">Hongroise</option>\n\t<option value=\"IN\">Indienne</option>\n\t<option value=\"ID\">Indonesienne</option>\n\t<option value=\"IQ\">Irakienne</option>\n\t<option value=\"IE\">Irlandaise</option>\n\t<option value=\"IS\">Islandaise</option>\n\t<option value=\"IL\">Isra\u00e9lienne</option>\n\t<option value=\"CI\">Ivoirienne</option>\n\t<option value=\"JM\">Jama\u00efcaine</option>\n\t<option value=\"JP\">Japonaise</option>\n\t<option value=\"JO\">Jordanienne</option>\n\t<option value=\"KZ\">Kazakhstanaise</option>\n\t<option value=\"KE\">Kenyane</option>\n\t<option value=\"KG\">Kirghize</option>\n\t<option value=\"KI\">Kiribatienne</option>\n\t<option value=\"KN\">Kittitienne-et-nevicienne</option>\n\t<option value=\"KW\">Koweitienne</option>\n\t<option value=\"LA\">Laotienne</option>\n\t<option value=\"LS\">Lesothane</option>\n\t<option value=\"LV\">Lettone</option>\n\t<option value=\"LB\">Libanaise</option>\n\t<option value=\"LR\">Liberienne</option>\n\t<option value=\"LY\">Libyenne</option>\n\t<option value=\"LI\">Liechtensteinoise</option>\n\t<option value=\"LT\">Lituanienne</option>\n\t<option value=\"LU\">Luxembourgeoise</option>\n\t<option value=\"MK\">Macedonienne</option>\n\t<option value=\"MY\">Malaisienne</option>\n\t<option value=\"MW\">Malawienne</option>\n\t<option value=\"MV\">Maldivienne</option>\n\t<option value=\"MG\">Malgache</option>\n\t<option value=\"ML\">Malienne</option>\n\t<option value=\"MT\">Maltaise</option>\n\t<option value=\"MA\">Marocaine</option>\n\t<option value=\"MH\">Marshallaise</option>\n\t<option value=\"MU\">Mauricienne</option>\n\t<option value=\"MR\">Mauritanienne</option>\n\t<option value=\"MX\">Mexicaine</option>\n\t<option value=\"FM\">Micronesienne</option>\n\t<option value=\"MD\">Moldave</option>\n\t<option value=\"MC\">Monegasque</option>\n\t<option value=\"MN\">Mongole</option>\n\t<option value=\"ME\">Montenegrine</option>\n\t<option value=\"MZ\">Mozambicaine</option>\n\t<option value=\"NA\">Namibienne</option>\n\t<option value=\"NR\">Nauruane</option>\n\t<option value=\"NL\">Neerlandaise</option>\n\t<option value=\"NZ\">Neo-zelandaise</option>\n\t<option value=\"NP\">Nepalaise</option>\n\t<option value=\"NI\">Nicaraguayenne</option>\n\t<option value=\"NG\">Nigeriane</option>\n\t<option value=\"NE\">Nigerienne</option>\n\t<option value=\"KP\">Nord-cor\u00e9enne</option>\n\t<option value=\"NO\">Norvegienne</option>\n\t<option value=\"OM\">Omanaise</option>\n\t<option value=\"UG\">Ougandaise</option>\n\t<option value=\"UZ\">Ouzbeke</option>\n\t<option value=\"PK\">Pakistanaise</option>\n\t<option value=\"PW\">Palau</option>\n\t<option value=\"PS\">Palestinienne</option>\n\t<option value=\"PA\">Panameenne</option>\n\t<option value=\"PG\">Papouane-neoguineenne</option>\n\t<option value=\"PY\">Paraguayenne</option>\n\t<option value=\"PE\">Peruvienne</option>\n\t<option value=\"PH\">Philippine</option>\n\t<option value=\"PL\">Polonaise</option>\n\t<option value=\"PR\">Portoricaine</option>\n\t<option value=\"PT\">Portugaise</option>\n\t<option value=\"QA\">Qatarienne</option>\n\t<option value=\"RO\">Roumaine</option>\n\t<option value=\"RU\">Russe</option>\n\t<option value=\"RW\">Rwandaise</option>\n\t<option value=\"LC\">Saint-Lucienne</option>\n\t<option value=\"SM\">Saint-Marinaise</option>\n\t<option value=\"VC\">Saint-Vincentaise-et-Grenadine</option>\n\t<option value=\"SB\">Salomonaise</option>\n\t<option value=\"SV\">Salvadorienne</option>\n\t<option value=\"WS\">Samoane</option>\n\t<option value=\"ST\">Santomeenne</option>\n\t<option value=\"SA\">Saoudienne</option>\n\t<option value=\"SN\">Senegalaise</option>\n\t<option value=\"RS\">Serbe</option>\n\t<option value=\"SC\">Seychelloise</option>\n\t<option value=\"SL\">Sierra-leonaise</option>\n\t<option value=\"SG\">Singapourienne</option>\n\t<option value=\"SK\">Slovaque</option>\n\t<option value=\"SI\">Slovene</option>\n\t<option value=\"SO\">Somalienne</option>\n\t<option value=\"SD\">Soudanaise</option>\n\t<option value=\"LK\">Sri-lankaise</option>\n\t<option value=\"ZA\">Sud-africaine</option>\n\t<option value=\"KR\">Sud-cor\u00e9enne</option>\n\t<option value=\"SE\">Suedoise</option>\n\t<option value=\"SR\">Surinamaise</option>\n\t<option value=\"SZ\">Swazie</option>\n\t<option value=\"SY\">Syrienne</option>\n\t<option value=\"TJ\">Tadjike</option>\n\t<option value=\"TW\">Taiwanaise</option>\n\t<option value=\"TZ\">Tanzanienne</option>\n\t<option value=\"TD\">Tchadienne</option>\n\t<option value=\"CZ\">Tcheque</option>\n\t<option value=\"TH\">Tha\u00eflandaise</option>\n\t<option value=\"TG\">Tonguienne</option>\n\t<option value=\"TT\">Trinidadienne</option>\n\t<option value=\"TN\">Tunisienne</option>\n\t<option value=\"TM\">Turkmene</option>\n\t<option value=\"TR\">Turque</option>\n\t<option value=\"TV\">Tuvaluane</option>\n\t<option value=\"UA\">Ukrainienne</option>\n\t<option value=\"UY\">Uruguayenne</option>\n\t<option value=\"VU\">Vanuatuane</option>\n\t<option value=\"VE\">Venezuelienne</option>\n\t<option value=\"VN\">Vietnamienne</option>\n\t<option value=\"YE\">Yemenite</option>\n\t<option value=\"ZM\">Zambienne</option>\n\t<option value=\"ZW\">Zimbabweenne</option>\n</select>\n", "meta": {"content_hash": "901da9e709d0010b5d0bcb5cce18571f", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 59, "avg_line_length": 40.16494845360825, "alnum_prop": 0.7254876796714579, "repo_name": "nicolanrizzo/nationalitylist", "id": "6d6f933730fc0ddd971e1ce1f1233d49581a257d", "size": "7801", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "HTMLdropdown/fr.html", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "16790"}]}} +{"text": " \n\npackage com.june.dto.back.demo;\n\nimport java.io.Serializable;\nimport java.util.List;\n\nimport com.june.common.PageDTO;\n\npublic class TreeGridDto extends PageDTO<TreeGridDto> implements Serializable{\n\t/**\n\t * long serialVersionUID\n\t */\n\tprivate static final long serialVersionUID = 4936747688639597710L;\n\tprivate String id; //\u8282\u70b9id\n private String pid;//\u7236\u8282\u70b9id\n\tprivate String name;\n\tprivate String persons;\n\tprivate String begin;\n\tprivate String end;\n\tprivate List<TreeGridDto> children;\n\tprivate String iconCls;//\u8282\u70b9\u7684\u56fe\u6807\n\tprivate String state; //\u8282\u70b9\u7684\u72b6\u6001\uff0c\u5c55\u5f00(open)\u8fd8\u662f\u95ed\u5408(closed)\uff0c\n\tpublic String getName() {\n\t\treturn name;\n\t}\n\tpublic void setName(String name) {\n\t\tthis.name = name;\n\t}\n\tpublic String getPersons() {\n\t\treturn persons;\n\t}\n\tpublic void setPersons(String persons) {\n\t\tthis.persons = persons;\n\t}\n\tpublic String getBegin() {\n\t\treturn begin;\n\t}\n\tpublic void setBegin(String begin) {\n\t\tthis.begin = begin;\n\t}\n\tpublic String getEnd() {\n\t\treturn end;\n\t}\n\tpublic void setEnd(String end) {\n\t\tthis.end = end;\n\t}\n\tpublic List<TreeGridDto> getChildren() {\n\t\treturn children;\n\t}\n\tpublic void setChildren(List<TreeGridDto> children) {\n\t\tthis.children = children;\n\t}\n\tpublic String getIconCls() {\n\t\treturn iconCls;\n\t}\n\tpublic void setIconCls(String iconCls) {\n\t\tthis.iconCls = iconCls;\n\t}\n\tpublic String getState() {\n\t\treturn state;\n\t}\n\tpublic void setState(String state) {\n\t\tthis.state = state;\n\t}\n\tpublic String getId() {\n\t\treturn id;\n\t}\n\tpublic void setId(String id) {\n\t\tthis.id = id;\n\t}\n\tpublic String getPid() {\n\t\treturn pid;\n\t}\n\tpublic void setPid(String pid) {\n\t\tthis.pid = pid;\n\t}\n\t@Override\n\tprotected String getDtoName() {\n\t\treturn \"TreeGridDto\";\n\t}\n}\n", "meta": {"content_hash": "17b9633ac5cab6e196f0418cd3455537", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 78, "avg_line_length": 20.182926829268293, "alnum_prop": 0.7087613293051359, "repo_name": "junehappylove/june_web_new", "id": "1636c9f674bd5ebcc2c7442302d4e13c5dd56ea2", "size": "2024", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/june/dto/back/demo/TreeGridDto.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "256048"}, {"name": "FreeMarker", "bytes": "74"}, {"name": "HTML", "bytes": "18205"}, {"name": "Java", "bytes": "582281"}, {"name": "JavaScript", "bytes": "883753"}, {"name": "PHP", "bytes": "178445"}]}} +{"text": "@implementation MoodMessageCell\n\n- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{\n \n if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {\n \n self.tagImageView = [[UIImageView alloc] initWithFrame:CGRectZero];\n //self.tagImageView.backgroundColor = [UIColor redColor];\n [self.contentView addSubview:self.tagImageView];\n \n self.backImageView = [[UIImageView alloc] initWithFrame:CGRectZero];\n [self.contentView addSubview:self.backImageView];\n \n self.emptyImageView = [[UIImageView alloc] initWithFrame:CGRectZero];\n [self.contentView addSubview:self.emptyImageView];\n \n self.tagLabel = [[UILabel alloc] initWithFrame:CGRectZero];\n self.tagLabel.textColor = [UIColor whiteColor];\n [self.contentView addSubview:self.tagLabel];\n \n self.descriptionLabel = [[UILabel alloc] initWithFrame:CGRectZero];\n self.descriptionLabel.numberOfLines = 0;\n self.descriptionLabel.textColor = [UIColor colorWithWhite:0.510 alpha:1.000];\n [self.contentView addSubview:self.descriptionLabel];\n \n \n self.timeThread = [[UIImageView alloc] initWithFrame:CGRectZero];\n self.timeThread.backgroundColor = [UIColor grayColor];\n [self.contentView addSubview:self.timeThread];\n \n \n \n }\n \n return self;\n}\n\n- (void)setValueWithModel:(dayModel *)model{\n \n //\u6807\u8bb0\u56fe\u7247\n self.tagImageView.frame = CGRectMake(15, 2, 20, 20);\n self.tagImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@\"%ld\", model.moodDay]];\n\n //\u6807\u8bb0\u80cc\u666f\n self.backImageView.frame = CGRectMake(CGRectGetMaxX(self.tagImageView.frame), self.tagImageView.frame.origin.y, jjScreenWidth - 70, 100);\n //\u80cc\u666f\u56fe\u7247\u5904\u7406\n UIImage *backImage = [UIImage imageNamed:@\"background\"];\n UIEdgeInsets edgeInsets = UIEdgeInsetsMake(5, 15, 0, 5);\n // \u62c9\u4f38\u56fe\u7247\n UIImage *newImage = [backImage resizableImageWithCapInsets:edgeInsets resizingMode:UIImageResizingModeStretch];\n self.backImageView.image = newImage;\n\n //\u6807\u8bb0\u5185\u5bb9\n self.tagLabel.frame = CGRectMake(self.backImageView.frame.origin.x+15, self.backImageView.frame.origin.y + 8, self.backImageView.frame.size.width - 5, 30);\n self.tagLabel.font = [UIFont systemFontOfSize:17 weight:10];\n self.tagLabel.text = [NSString getTagStringTag:model.tagDay];\n \n \n //\u8bb0\u5f55\u5185\u5bb9\n self.descriptionLabel.text = [NSString stringWithFormat:@\"%@\\n%@\",[NSString getDateStringFromDate:model.dateDay],model.content];\n self.descriptionLabel.font = [UIFont systemFontOfSize:14];\n \n CGFloat labelHeight = [GetHeightTool getHeightForText:self.descriptionLabel.text font:[UIFont systemFontOfSize:14] width:jjScreenWidth - 100];\n self.descriptionLabel.frame = CGRectMake(CGRectGetMinX(self.backImageView.frame) + 15, CGRectGetMaxY(self.tagLabel.frame)+ 5, self.backImageView.frame.size.width - 20, labelHeight);\n self.emptyImageView.frame = CGRectMake(self.backImageView.frame.origin.x + 7, CGRectGetMaxY(self.tagLabel.frame), self.backImageView.frame.size.width - 8, self.descriptionLabel.frame.size.height + 10);\n \n //\u80cc\u666f\u56fe\u7247\u5904\u7406\n UIImage *image = [UIImage imageNamed:@\"empty\"];\n //\u4e0a, \u5de6, \u4e0b, \u53f3\u90e8\u5206\u4e0d\u53ef\u62c9\u4f38\u7684\u533a\u57df\n UIEdgeInsets edgeInsets1 = UIEdgeInsetsMake(0, 10, 10, 10);\n UIImage *newimage = [image resizableImageWithCapInsets:edgeInsets1 resizingMode:UIImageResizingModeStretch];\n self.emptyImageView.image = newimage;\n \n \n //\u65f6\u95f4\u8f74\n self.timeThread.frame = CGRectMake(self.tagImageView.center.x - 1, CGRectGetMaxY(self.tagImageView.frame)+1, 2, self.descriptionLabel.frame.size.height + 33);\n\n \n \n}\n\n- (void)awakeFromNib {\n // Initialization code\n}\n\n- (void)setSelected:(BOOL)selected animated:(BOOL)animated {\n [super setSelected:selected animated:animated];\n\n // Configure the view for the selected state\n}\n\n@end\n", "meta": {"content_hash": "896a8222b5596bd706c245acc79ac0f6", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 205, "avg_line_length": 42.68478260869565, "alnum_prop": 0.7119938884644768, "repo_name": "YunZhiJunXiPeng/ShreddedBread", "id": "5c6850e14e4f8d181c1e31cd4918254cbdcc5286", "size": "4247", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ShreddedBread/Scenes/JJStatistics/CustomView/MoodMessageCell.m", "mode": "33261", "license": "mit", "language": [{"name": "Objective-C", "bytes": "260862"}, {"name": "Ruby", "bytes": "159"}]}} +{"text": "\npackage org.eclipse.rdf4j.rio.hdt;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.zip.CheckedInputStream;\n\nimport org.eclipse.rdf4j.common.io.UncloseableInputStream;\n\n/**\n * Log64\n *\n * It contains the data part of the {@link HDTArray}, followed by the 32-bit CRC calculated over this data.\n *\n * Data structure:\n *\n * <pre>\n * ...+---------+-------+\n * | entries | CRC32 |\n * ...+---------+-------+\n * </pre>\n *\n * Entries are stored little-endian, with each entry using <code>nrbits</code> bits\n *\n * @author Bart Hanssens\n */\nclass HDTArrayLog64 extends HDTArray {\n\tprivate byte buffer[];\n\n\t@Override\n\tprotected int getType() {\n\t\treturn HDTArray.Type.LOG64.getValue();\n\t}\n\n\t@Override\n\tprotected int get(int i) {\n\t\t// start byte of the value, and start bit in that start byte\n\t\tint bytePos = (i * nrbits) / 8;\n\t\tint bitPos = (i * nrbits) % 8;\n\n\t\t// value bits may be encoded across boundaries of bytes\n\t\tint tmplen = (bitPos + nrbits + 7) / 8;\n\n\t\tlong val = 0L;\n\t\t// little-endian to big-endian\n\t\tfor (int j = 0; j < tmplen; j++) {\n\t\t\tval |= (buffer[bytePos + j] & 0xFFL) << (j * 8);\n\t\t}\n\n\t\tval >>= bitPos;\n\t\tval &= 0xFFFFFFFFFFFFFFFFL >>> (64 - nrbits);\n\n\t\treturn (int) val;\n\t}\n\n\t@Override\n\tprotected void parse(InputStream is) throws IOException {\n\t\tsuper.parse(is);\n\n\t\t// don't close CheckedInputStream, as it will close the underlying inputstream\n\t\ttry (UncloseableInputStream uis = new UncloseableInputStream(is);\n\t\t\t\tCheckedInputStream cis = new CheckedInputStream(uis, new CRC32())) {\n\t\t\t// read bytes, minimum 1\n\t\t\tlong bytes = (nrbits * entries + 7) / 8;\n\t\t\tif (bytes > Integer.MAX_VALUE) {\n\t\t\t\tthrow new UnsupportedOperationException(\"Maximum number of bytes in array exceeded: \" + bytes);\n\t\t\t}\n\n\t\t\tbuffer = new byte[(int) bytes];\n\t\t\tcis.read(buffer);\n\n\t\t\tcheckCRC(cis, is, 4);\n\t\t}\n\t}\n}\n", "meta": {"content_hash": "b1116b8f592c0b17f9ca3a314d25a6b9", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 107, "avg_line_length": 24.4, "alnum_prop": 0.6513661202185792, "repo_name": "eclipse/rdf4j", "id": "a571f89d1475b121f9881d7849e470c3c4ee2969", "size": "2349", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "core/rio/hdt/src/main/java/org/eclipse/rdf4j/rio/hdt/HDTArrayLog64.java", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "23587"}, {"name": "Dockerfile", "bytes": "791"}, {"name": "HTML", "bytes": "70935"}, {"name": "Java", "bytes": "15830881"}, {"name": "JavaScript", "bytes": "375102"}, {"name": "Ruby", "bytes": "36145"}, {"name": "Shell", "bytes": "23631"}, {"name": "TypeScript", "bytes": "52940"}, {"name": "XSLT", "bytes": "144185"}]}} +{"text": "\n\npackage com.thoughtworks.go.util;\n\nimport com.thoughtworks.go.agent.ServerUrlGenerator;\nimport com.thoughtworks.go.domain.JobIdentifier;\nimport org.springframework.stereotype.Component;\n\nimport java.net.URI;\nimport java.net.URISyntaxException;\n\nimport static java.lang.String.format;\n\n@Component\npublic class URLService implements ServerUrlGenerator{\n private String baseRemotingURL;\n\n public URLService() {\n String url = new SystemEnvironment().getServiceUrl();\n if (url.endsWith(\"/\")) {\n url = url.substring(0, url.length() - 1);\n }\n baseRemotingURL = url;\n }\n\n public URLService(String baseRemotingURL) {\n this.baseRemotingURL = baseRemotingURL;\n }\n\n public String baseRemoteURL() {\n return baseRemotingURL;\n }\n\n public String getBuildRepositoryURL() {\n return baseRemotingURL + \"/remoting/remoteBuildRepository\";\n }\n\n public String getAgentRegistrationURL() {\n return baseRemotingURL + \"/admin/agent\";\n }\n \n public String getAgentLatestStatusUrl() {\n return baseRemotingURL + \"/admin/latest-agent.status\";\n }\n\n public String getUploadUrlOfAgent(JobIdentifier jobIdentifier, String filePath) {\n return getUploadUrlOfAgent(jobIdentifier, filePath, 1);\n }\n\n public String getComponentVersionsOnServerUrl() {\n return String.format(\"%s/%s\", baseRemotingURL, \"admin/component-versions-on-server\");\n }\n\n\n // TODO - keep buildId for now because currently we do not support 'jobcounter' \n // and therefore cannot locate job correctly when it is rescheduled\n public String getUploadUrlOfAgent(JobIdentifier jobIdentifier, String filePath, int attempt) {\n return format(\"%s/%s/%s/%s?attempt=%d&buildId=%d\", baseRemotingURL, \"remoting\", \"files\", jobIdentifier.artifactLocator(filePath), attempt, jobIdentifier.getBuildId());\n }\n\n /*\n * Server will use this method, the base url is in the request.\n */\n public String getRestfulArtifactUrl(JobIdentifier jobIdentifier, String filePath) {\n return format(\"/%s/%s\", \"files\", jobIdentifier.artifactLocator(filePath));\n }\n\n\n public String getUploadBaseUrlOfAgent(JobIdentifier jobIdentifier) {\n return format(\"%s/%s/%s/%s\", baseRemotingURL, \"remoting\", \"files\", jobIdentifier.artifactLocator(\"\"));\n }\n\n /*\n * Agent will use this method, the baseUrl will be injected from config xml in agent side.\n * This is used to fix security issues with the agent uploading artifacts when security is enabled.\n */\n public String getPropertiesUrl(JobIdentifier jobIdentifier, String propertyName) {\n return format(\"%s/%s/%s/%s\",\n baseRemotingURL, \"remoting\", \"properties\", jobIdentifier.propertyLocator(propertyName));\n }\n\n public String serverUrlFor(String subPath) {\n return format(\"%s/%s\", baseRemotingURL, subPath);\n }\n\n public String serverSslBaseUrl(int serverHttpsPort) {\n return baseRemotingURL;\n }\n\n public String getAgentRemoteWebSocketUrl() {\n return format(\"%s/%s\", getWebSocketBaseUrl(), \"agent-websocket\");\n }\n public String getWebSocketBaseUrl() {\n try {\n URI uri = new URI(baseRemotingURL);\n StringBuffer ret = new StringBuffer(\"wss://\");\n ret.append(uri.getHost()).append(\":\").append(uri.getPort());\n if (uri.getPath() != null) {\n ret.append(uri.getPath());\n }\n return ret.toString();\n } catch (URISyntaxException e) {\n throw new RuntimeException(\"Invalid Go Server url\", e);\n }\n }\n\n public String prefixPartialUrl(String url) {\n if(url.startsWith(\"/\")) {\n return format(\"%s%s\", baseRemoteURL(), url);\n }\n return url;\n }\n}\n", "meta": {"content_hash": "093951f53db590dc065c8ab7abe36e5a", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 175, "avg_line_length": 33.61946902654867, "alnum_prop": 0.6635956830744932, "repo_name": "VibyJocke/gocd", "id": "7a35ec79a46b08e4c52e08741ac03af6ad8a4b8e", "size": "4545", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "common/src/com/thoughtworks/go/util/URLService.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "8248"}, {"name": "CSS", "bytes": "502291"}, {"name": "FreeMarker", "bytes": "182"}, {"name": "HTML", "bytes": "647411"}, {"name": "Java", "bytes": "16221590"}, {"name": "JavaScript", "bytes": "2878258"}, {"name": "NSIS", "bytes": "19386"}, {"name": "PowerShell", "bytes": "743"}, {"name": "Ruby", "bytes": "2954955"}, {"name": "SQLPL", "bytes": "9050"}, {"name": "Shell", "bytes": "240291"}, {"name": "XSLT", "bytes": "153049"}]}} +{"text": "'use strict';\n\nmodule.exports = function () {\n this.alert = function () {\n throw 'Doh! You used a real notifier rather than a test double!';\n };\n};\n", "meta": {"content_hash": "df60aba531d968f6828a52645e113116", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 69, "avg_line_length": 21.857142857142858, "alnum_prop": 0.6274509803921569, "repo_name": "dwhelan/training", "id": "b619376c1ad029817c41c04ba5a8fa1d345467a2", "size": "153", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/bartender/notifier.js", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "12876"}, {"name": "Java", "bytes": "8799"}, {"name": "JavaScript", "bytes": "7733"}, {"name": "Ruby", "bytes": "987"}, {"name": "Shell", "bytes": "131"}]}} +{"text": "\n\npackage rest\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/golang/glog\"\n\n\t\"k8s.io/kubernetes/pkg/api\"\n\t\"k8s.io/kubernetes/pkg/api/rest\"\n\t\"k8s.io/kubernetes/pkg/apis/extensions\"\n\textensionsapiv1beta1 \"k8s.io/kubernetes/pkg/apis/extensions/v1beta1\"\n\textensionsclient \"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion\"\n\t\"k8s.io/kubernetes/pkg/genericapiserver\"\n\thorizontalpodautoscaleretcd \"k8s.io/kubernetes/pkg/registry/autoscaling/horizontalpodautoscaler/etcd\"\n\tjobetcd \"k8s.io/kubernetes/pkg/registry/batch/job/etcd\"\n\texpcontrolleretcd \"k8s.io/kubernetes/pkg/registry/extensions/controller/etcd\"\n\tdaemonetcd \"k8s.io/kubernetes/pkg/registry/extensions/daemonset/etcd\"\n\tdeploymentetcd \"k8s.io/kubernetes/pkg/registry/extensions/deployment/etcd\"\n\tingressetcd \"k8s.io/kubernetes/pkg/registry/extensions/ingress/etcd\"\n\tnetworkpolicyetcd \"k8s.io/kubernetes/pkg/registry/extensions/networkpolicy/etcd\"\n\tpspetcd \"k8s.io/kubernetes/pkg/registry/extensions/podsecuritypolicy/etcd\"\n\treplicasetetcd \"k8s.io/kubernetes/pkg/registry/extensions/replicaset/etcd\"\n\tthirdpartyresourceetcd \"k8s.io/kubernetes/pkg/registry/extensions/thirdpartyresource/etcd\"\n\tutilruntime \"k8s.io/kubernetes/pkg/util/runtime\"\n\t\"k8s.io/kubernetes/pkg/util/wait\"\n)\n\ntype RESTStorageProvider struct {\n\tResourceInterface ResourceInterface\n}\n\nvar _ genericapiserver.RESTStorageProvider = &RESTStorageProvider{}\n\nfunc (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter genericapiserver.RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool) {\n\tapiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(extensions.GroupName)\n\n\tif apiResourceConfigSource.AnyResourcesForVersionEnabled(extensionsapiv1beta1.SchemeGroupVersion) {\n\t\tapiGroupInfo.VersionedResourcesStorageMap[extensionsapiv1beta1.SchemeGroupVersion.Version] = p.v1beta1Storage(apiResourceConfigSource, restOptionsGetter)\n\t\tapiGroupInfo.GroupMeta.GroupVersion = extensionsapiv1beta1.SchemeGroupVersion\n\t}\n\n\treturn apiGroupInfo, true\n}\n\nfunc (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource genericapiserver.APIResourceConfigSource, restOptionsGetter genericapiserver.RESTOptionsGetter) map[string]rest.Storage {\n\tversion := extensionsapiv1beta1.SchemeGroupVersion\n\n\tstorage := map[string]rest.Storage{}\n\n\tif apiResourceConfigSource.ResourceEnabled(version.WithResource(\"horizontalpodautoscalers\")) {\n\t\thpaStorage, hpaStatusStorage := horizontalpodautoscaleretcd.NewREST(restOptionsGetter(extensions.Resource(\"horizontalpodautoscalers\")))\n\t\tstorage[\"horizontalpodautoscalers\"] = hpaStorage\n\t\tstorage[\"horizontalpodautoscalers/status\"] = hpaStatusStorage\n\n\t\tcontrollerStorage := expcontrolleretcd.NewStorage(restOptionsGetter(api.Resource(\"replicationControllers\")))\n\t\tstorage[\"replicationcontrollers\"] = controllerStorage.ReplicationController\n\t\tstorage[\"replicationcontrollers/scale\"] = controllerStorage.Scale\n\t}\n\tif apiResourceConfigSource.ResourceEnabled(version.WithResource(\"thirdpartyresources\")) {\n\t\tthirdPartyResourceStorage := thirdpartyresourceetcd.NewREST(restOptionsGetter(extensions.Resource(\"thirdpartyresources\")))\n\t\tstorage[\"thirdpartyresources\"] = thirdPartyResourceStorage\n\t}\n\n\tif apiResourceConfigSource.ResourceEnabled(version.WithResource(\"daemonsets\")) {\n\t\tdaemonSetStorage, daemonSetStatusStorage := daemonetcd.NewREST(restOptionsGetter(extensions.Resource(\"daemonsets\")))\n\t\tstorage[\"daemonsets\"] = daemonSetStorage\n\t\tstorage[\"daemonsets/status\"] = daemonSetStatusStorage\n\t}\n\tif apiResourceConfigSource.ResourceEnabled(version.WithResource(\"deployments\")) {\n\t\tdeploymentStorage := deploymentetcd.NewStorage(restOptionsGetter(extensions.Resource(\"deployments\")))\n\t\tstorage[\"deployments\"] = deploymentStorage.Deployment\n\t\tstorage[\"deployments/status\"] = deploymentStorage.Status\n\t\tstorage[\"deployments/rollback\"] = deploymentStorage.Rollback\n\t\tstorage[\"deployments/scale\"] = deploymentStorage.Scale\n\t}\n\tif apiResourceConfigSource.ResourceEnabled(version.WithResource(\"jobs\")) {\n\t\tjobsStorage, jobsStatusStorage := jobetcd.NewREST(restOptionsGetter(extensions.Resource(\"jobs\")))\n\t\tstorage[\"jobs\"] = jobsStorage\n\t\tstorage[\"jobs/status\"] = jobsStatusStorage\n\t}\n\tif apiResourceConfigSource.ResourceEnabled(version.WithResource(\"ingresses\")) {\n\t\tingressStorage, ingressStatusStorage := ingressetcd.NewREST(restOptionsGetter(extensions.Resource(\"ingresses\")))\n\t\tstorage[\"ingresses\"] = ingressStorage\n\t\tstorage[\"ingresses/status\"] = ingressStatusStorage\n\t}\n\tif apiResourceConfigSource.ResourceEnabled(version.WithResource(\"podsecuritypolicy\")) {\n\t\tpodSecurityExtensionsStorage := pspetcd.NewREST(restOptionsGetter(extensions.Resource(\"podsecuritypolicy\")))\n\t\tstorage[\"podSecurityPolicies\"] = podSecurityExtensionsStorage\n\t}\n\tif apiResourceConfigSource.ResourceEnabled(version.WithResource(\"replicasets\")) {\n\t\treplicaSetStorage := replicasetetcd.NewStorage(restOptionsGetter(extensions.Resource(\"replicasets\")))\n\t\tstorage[\"replicasets\"] = replicaSetStorage.ReplicaSet\n\t\tstorage[\"replicasets/status\"] = replicaSetStorage.Status\n\t\tstorage[\"replicasets/scale\"] = replicaSetStorage.Scale\n\t}\n\tif apiResourceConfigSource.ResourceEnabled(version.WithResource(\"networkpolicies\")) {\n\t\tnetworkExtensionsStorage := networkpolicyetcd.NewREST(restOptionsGetter(extensions.Resource(\"networkpolicies\")))\n\t\tstorage[\"networkpolicies\"] = networkExtensionsStorage\n\t}\n\n\treturn storage\n}\n\nfunc (p RESTStorageProvider) PostStartHook() (string, genericapiserver.PostStartHookFunc, error) {\n\treturn \"extensions/third-party-resources\", p.postStartHookFunc, nil\n}\nfunc (p RESTStorageProvider) postStartHookFunc(hookContext genericapiserver.PostStartHookContext) error {\n\tclientset, err := extensionsclient.NewForConfig(hookContext.LoopbackClientConfig)\n\tif err != nil {\n\t\tutilruntime.HandleError(fmt.Errorf(\"unable to initialize clusterroles: %v\", err))\n\t\treturn nil\n\t}\n\n\tthirdPartyControl := ThirdPartyController{\n\t\tmaster: p.ResourceInterface,\n\t\tclient: clientset,\n\t}\n\tgo wait.Forever(func() {\n\t\tif err := thirdPartyControl.SyncResources(); err != nil {\n\t\t\tglog.Warningf(\"third party resource sync failed: %v\", err)\n\t\t}\n\t}, 10*time.Second)\n\n\treturn nil\n}\n", "meta": {"content_hash": "8b3f61eaebe03acd27711fe244102bd2", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 203, "avg_line_length": 48.390625, "alnum_prop": 0.8224087826929286, "repo_name": "linearregression/kubernetes", "id": "f7e4497b5edcd195cb2915bd1158290f75fed077", "size": "6763", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pkg/registry/extensions/rest/storage_extensions.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "978"}, {"name": "Go", "bytes": "44736541"}, {"name": "HTML", "bytes": "2530253"}, {"name": "Makefile", "bytes": "72431"}, {"name": "Nginx", "bytes": "1013"}, {"name": "Protocol Buffer", "bytes": "580076"}, {"name": "Python", "bytes": "918751"}, {"name": "SaltStack", "bytes": "54088"}, {"name": "Shell", "bytes": "1542252"}]}} +{"text": "\n/*\r\n * Copyright 2005 Jenia org.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\npackage org.fckfaces.util;\r\n\r\nimport java.io.BufferedInputStream;\r\nimport java.io.IOException;\r\nimport java.io.InputStream;\r\nimport java.io.OutputStream;\r\nimport java.text.SimpleDateFormat;\r\nimport java.util.Date;\r\nimport java.util.Locale;\r\nimport java.util.TimeZone;\r\n\r\nimport javax.servlet.ServletConfig;\r\nimport javax.servlet.ServletException;\r\nimport javax.servlet.http.HttpServlet;\r\nimport javax.servlet.http.HttpServletRequest;\r\nimport javax.servlet.http.HttpServletResponse;\r\n\r\n/**\r\n * @author srecinto\r\n */\r\npublic class Servlet extends HttpServlet {\r\n\r\n\tprivate static final long serialVersionUID = 7260045528613530636L;\r\n\r\n\tprivate static final String modify=calcModify();\r\n\t\r\n\tprivate volatile String customResourcePath;\r\n\t\r\n\tprivate static final String calcModify() {\r\n\t\tDate mod = new Date(System.currentTimeMillis());\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"EEE, d MMM yyyy HH:mm:ss z\",Locale.ENGLISH);\r\n\t\tsdf.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\r\n\t\treturn sdf.format(mod);\r\n\t}\r\n\t\r\n\tpublic void init(ServletConfig config) throws ServletException { \r\n\t\tsuper.init(config); \r\n\t\tsetCustomResourcePath(config.getInitParameter(\"customResourcePath\"));\r\n\t} \r\n\r\n\tpublic void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n // search the resource in classloader\r\n ClassLoader cl = this.getClass().getClassLoader();\r\n String uri = request.getRequestURI();\r\n String path = uri.substring(uri.indexOf(Util.FCK_FACES_RESOURCE_PREFIX)+Util.FCK_FACES_RESOURCE_PREFIX.length()+1);\r\n \r\n if(getCustomResourcePath() != null) { //Use custom path to FCKeditor\r\n \tthis.getServletContext().getRequestDispatcher(getCustomResourcePath() + path).forward(request,response);\r\n } else { //Use default FCKeditor bundled up in the jar\r\n \tif (uri.endsWith(\".jsf\") || uri.endsWith(\".html\")) {\r\n\t \tresponse.setContentType(\"text/html;charset=UTF-8\");\r\n\t } else {\r\n\t response.setHeader(\"Cache-Control\", \"public\");\r\n\t response.setHeader(\"Last-Modified\", modify);\r\n\t }\r\n\t if (uri.endsWith(\".css\")) {\r\n\t \tresponse.setContentType(\"text/css;charset=UTF-8\");\r\n\t } else if (uri.endsWith(\".js\")) {\r\n\t \tresponse.setContentType(\"text/javascript;charset=UTF-8\");\r\n\t } else if (uri.endsWith(\".gif\")) {\r\n\t \tresponse.setContentType(\"image/gif;\");\r\n\t } else if (uri.endsWith(\".xml\")) {\r\n\t \tresponse.setContentType(\"text/xml;charset=UTF-8\");\r\n\t } \r\n\t \r\n\t InputStream is = cl.getResourceAsStream(path);\r\n\t // if no resource found in classloader return nothing\r\n\t if (is==null) return;\r\n\t // resource found, copying on output stream\r\n\t OutputStream out = response.getOutputStream();\r\n\t byte[] buffer = new byte[2048];\r\n\t BufferedInputStream bis = new BufferedInputStream(is);\r\n\t try {\r\n\t \tint read = 0;\r\n\t \tread = bis.read(buffer);\r\n\t \twhile (read!=-1) {\r\n\t \t\tout.write(buffer,0,read);\r\n\t \t\tread = bis.read(buffer);\r\n\t \t}\r\n\t } finally {\r\n\t \tbis.close();\r\n\t }\r\n\t out.flush();\r\n\t out.close();\r\n }\r\n }\r\n\r\n\tpublic String getCustomResourcePath() {\r\n\t\treturn customResourcePath;\r\n\t}\r\n\r\n\tpublic void setCustomResourcePath(String customResourcePath) {\r\n\t\tsynchronized (this) {\r\n\t\t\tthis.customResourcePath = customResourcePath;\r\n\t\t}\r\n\t}\r\n\r\n}\r\n", "meta": {"content_hash": "6ed42d7c56e7b81ce6d2b58bc6d4a0ab", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 123, "avg_line_length": 35.44827586206897, "alnum_prop": 0.6551556420233463, "repo_name": "GIP-RECIA/esco-grouper-ui", "id": "27e498d6a8afc95cc0fca7adba5b38bfd7c7dc9d", "size": "4898", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ext/esup-commons/src/main/java/org/fckfaces/util/Servlet.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "218175"}, {"name": "Java", "bytes": "6786611"}, {"name": "JavaScript", "bytes": "1616913"}, {"name": "Shell", "bytes": "3445"}, {"name": "XSLT", "bytes": "3601"}]}} +{"text": "namespace performance_manager {\n\nNodeAttachedData::NodeAttachedData() = default;\n\nNodeAttachedData::~NodeAttachedData() = default;\n\n// static\nvoid NodeAttachedDataMapHelper::AttachInMap(\n const Node* node,\n std::unique_ptr<NodeAttachedData> data) {\n GraphImpl* graph = GraphImpl::FromGraph(node->GetGraph());\n DCHECK_CALLED_ON_VALID_SEQUENCE(graph->sequence_checker_);\n const NodeBase* node_base = NodeBase::FromNode(node);\n DCHECK(graph->NodeInGraph(node_base));\n GraphImpl::NodeAttachedDataKey data_key =\n std::make_pair(node, data->GetKey());\n auto& map = graph->node_attached_data_map_;\n DCHECK(!base::Contains(map, data_key));\n map[data_key] = std::move(data);\n}\n\n// static\nNodeAttachedData* NodeAttachedDataMapHelper::GetFromMap(const Node* node,\n const void* key) {\n GraphImpl* graph = GraphImpl::FromGraph(node->GetGraph());\n DCHECK_CALLED_ON_VALID_SEQUENCE(graph->sequence_checker_);\n const NodeBase* node_base = NodeBase::FromNode(node);\n DCHECK(graph->NodeInGraph(node_base));\n GraphImpl::NodeAttachedDataKey data_key = std::make_pair(node, key);\n auto& map = graph->node_attached_data_map_;\n auto it = map.find(data_key);\n if (it == map.end())\n return nullptr;\n DCHECK_EQ(key, it->second->GetKey());\n return it->second.get();\n}\n\n// static\nstd::unique_ptr<NodeAttachedData> NodeAttachedDataMapHelper::DetachFromMap(\n const Node* node,\n const void* key) {\n GraphImpl* graph = GraphImpl::FromGraph(node->GetGraph());\n DCHECK_CALLED_ON_VALID_SEQUENCE(graph->sequence_checker_);\n const NodeBase* node_base = NodeBase::FromNode(node);\n DCHECK(graph->NodeInGraph(node_base));\n GraphImpl::NodeAttachedDataKey data_key = std::make_pair(node, key);\n auto& map = graph->node_attached_data_map_;\n auto it = map.find(data_key);\n\n std::unique_ptr<NodeAttachedData> data;\n if (it != map.end()) {\n data = std::move(it->second);\n map.erase(it);\n }\n\n return data;\n}\n\n} // namespace performance_manager\n", "meta": {"content_hash": "d91851c7c5cd4f0c2fd415f222c6fd67", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 75, "avg_line_length": 34.016949152542374, "alnum_prop": 0.6885899352267065, "repo_name": "scheib/chromium", "id": "666e7ba3a732469d807ea3b7ac06677e581efc11", "size": "2452", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "components/performance_manager/graph/node_attached_data.cc", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "\n\nimport { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'app-comp-4914',\n templateUrl: './comp-4914.component.html',\n styleUrls: ['./comp-4914.component.css']\n})\nexport class Comp4914Component implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n", "meta": {"content_hash": "a64eea122cb5b0989b2721b78d29778c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 50, "avg_line_length": 16.58823529411765, "alnum_prop": 0.6666666666666666, "repo_name": "angular/angular-cli-stress-test", "id": "12ea09fdbaa297c871b09ec8014594b826b15282", "size": "484", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/components/comp-4914/comp-4914.component.ts", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1040888"}, {"name": "HTML", "bytes": "300322"}, {"name": "JavaScript", "bytes": "2404"}, {"name": "TypeScript", "bytes": "8535506"}]}} +{"text": "\n\npackage org.apache.flink.runtime.webmonitor;\n\nimport org.apache.flink.api.common.JobID;\nimport org.apache.flink.api.common.time.Time;\nimport org.apache.flink.api.java.tuple.Tuple2;\nimport org.apache.flink.runtime.checkpoint.CompletedCheckpoint;\nimport org.apache.flink.runtime.clusterframework.types.ResourceID;\nimport org.apache.flink.runtime.executiongraph.AccessExecutionGraph;\nimport org.apache.flink.runtime.jobgraph.JobStatus;\nimport org.apache.flink.runtime.jobgraph.JobVertexID;\nimport org.apache.flink.runtime.jobmaster.JobResult;\nimport org.apache.flink.runtime.jobmaster.RescalingBehaviour;\nimport org.apache.flink.runtime.messages.Acknowledge;\nimport org.apache.flink.runtime.messages.FlinkJobNotFoundException;\nimport org.apache.flink.runtime.messages.webmonitor.ClusterOverview;\nimport org.apache.flink.runtime.messages.webmonitor.MultipleJobsDetails;\nimport org.apache.flink.runtime.metrics.dump.MetricQueryService;\nimport org.apache.flink.runtime.rest.handler.legacy.backpressure.OperatorBackPressureStatsResponse;\nimport org.apache.flink.runtime.rpc.RpcEndpoint;\nimport org.apache.flink.runtime.rpc.RpcGateway;\nimport org.apache.flink.runtime.rpc.RpcTimeout;\n\nimport java.util.Collection;\nimport java.util.concurrent.CompletableFuture;\n\n/**\n * Gateway for restful endpoints.\n *\n * <p>Gateways which implement this method run a REST endpoint which is reachable\n * under the returned address.\n */\npublic interface RestfulGateway extends RpcGateway {\n\n\t/**\n\t * Cancel the given job.\n\t *\n\t * @param jobId identifying the job to cancel\n\t * @param timeout of the operation\n\t * @return A future acknowledge if the cancellation succeeded\n\t */\n\tCompletableFuture<Acknowledge> cancelJob(JobID jobId, @RpcTimeout Time timeout);\n\n\t/**\n\t * Stop the given job.\n\t *\n\t * @param jobId identifying the job to stop\n\t * @param timeout of the operation\n\t * @return A future acknowledge if the stopping succeeded\n\t */\n\tCompletableFuture<Acknowledge> stopJob(JobID jobId, @RpcTimeout Time timeout);\n\n\t/**\n\t * Requests the REST address of this {@link RpcEndpoint}.\n\t *\n\t * @param timeout for this operation\n\t * @return Future REST endpoint address\n\t */\n\tCompletableFuture<String> requestRestAddress(@RpcTimeout Time timeout);\n\n\t/**\n\t * Requests the {@link AccessExecutionGraph} for the given jobId. If there is no such graph, then\n\t * the future is completed with a {@link FlinkJobNotFoundException}.\n\t *\n\t * @param jobId identifying the job whose AccessExecutionGraph is requested\n\t * @param timeout for the asynchronous operation\n\t * @return Future containing the AccessExecutionGraph for the given jobId, otherwise {@link FlinkJobNotFoundException}\n\t */\n\tCompletableFuture<? extends AccessExecutionGraph> requestJob(JobID jobId, @RpcTimeout Time timeout);\n\n\t/**\n\t * Requests the {@link JobResult} of a job specified by the given jobId.\n\t *\n\t * @param jobId identifying the job for which to retrieve the {@link JobResult}.\n\t * @param timeout for the asynchronous operation\n\t * @return Future which is completed with the job's {@link JobResult} once the job has finished\n\t */\n\tCompletableFuture<JobResult> requestJobResult(JobID jobId, @RpcTimeout Time timeout);\n\n\t/**\n\t * Requests job details currently being executed on the Flink cluster.\n\t *\n\t * @param timeout for the asynchronous operation\n\t * @return Future containing the job details\n\t */\n\tCompletableFuture<MultipleJobsDetails> requestMultipleJobDetails(\n\t\t@RpcTimeout Time timeout);\n\n\t/**\n\t * Requests the cluster status overview.\n\t *\n\t * @param timeout for the asynchronous operation\n\t * @return Future containing the status overview\n\t */\n\tCompletableFuture<ClusterOverview> requestClusterOverview(@RpcTimeout Time timeout);\n\n\t/**\n\t * Requests the paths for the {@link MetricQueryService} to query.\n\t *\n\t * @param timeout for the asynchronous operation\n\t * @return Future containing the collection of metric query service paths to query\n\t */\n\tCompletableFuture<Collection<String>> requestMetricQueryServicePaths(@RpcTimeout Time timeout);\n\n\t/**\n\t * Requests the paths for the TaskManager's {@link MetricQueryService} to query.\n\t *\n\t * @param timeout for the asynchronous operation\n\t * @return Future containing the collection of instance ids and the corresponding metric query service path\n\t */\n\tCompletableFuture<Collection<Tuple2<ResourceID, String>>> requestTaskManagerMetricQueryServicePaths(@RpcTimeout Time timeout);\n\n\t/**\n\t * Triggers a savepoint with the given savepoint directory as a target.\n\t *\n\t * @param jobId ID of the job for which the savepoint should be triggered.\n\t * @param targetDirectory Target directory for the savepoint.\n\t * @param timeout Timeout for the asynchronous operation\n\t * @return A future to the {@link CompletedCheckpoint#getExternalPointer() external pointer} of\n\t * the savepoint.\n\t */\n\tdefault CompletableFuture<String> triggerSavepoint(\n\t\t\tJobID jobId,\n\t\t\tString targetDirectory,\n\t\t\tboolean cancelJob,\n\t\t\t@RpcTimeout Time timeout) {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t/**\n\t * Dispose the given savepoint.\n\t *\n\t * @param savepointPath identifying the savepoint to dispose\n\t * @param timeout RPC timeout\n\t * @return A future acknowledge if the disposal succeeded\n\t */\n\tdefault CompletableFuture<Acknowledge> disposeSavepoint(\n\t\t\tfinal String savepointPath,\n\t\t\t@RpcTimeout final Time timeout) {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t/**\n\t * Request the {@link JobStatus} of the given job.\n\t *\n\t * @param jobId identifying the job for which to retrieve the JobStatus\n\t * @param timeout for the asynchronous operation\n\t * @return A future to the {@link JobStatus} of the given job\n\t */\n\tdefault CompletableFuture<JobStatus> requestJobStatus(\n\t\t\tJobID jobId,\n\t\t\t@RpcTimeout Time timeout) {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t/**\n\t * Requests the statistics on operator back pressure.\n\t *\n\t * @param jobId Job for which the stats are requested.\n\t * @param jobVertexId JobVertex for which the stats are requested.\n\t * @return A Future to the {@link OperatorBackPressureStatsResponse} or {@code null} if the stats are\n\t * not available (yet).\n\t */\n\tdefault CompletableFuture<OperatorBackPressureStatsResponse> requestOperatorBackPressureStats(\n\t\t\tJobID jobId,\n\t\t\tJobVertexID jobVertexId) {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t/**\n\t * Trigger rescaling of the given job.\n\t *\n\t * @param jobId specifying the job to rescale\n\t * @param newParallelism new parallelism of the job\n\t * @param rescalingBehaviour defining how strict the rescaling has to be executed\n\t * @param timeout of this operation\n\t * @return Future which is completed with {@link Acknowledge} once the rescaling was successful\n\t */\n\tdefault CompletableFuture<Acknowledge> rescaleJob(\n\t\t\tJobID jobId,\n\t\t\tint newParallelism,\n\t\t\tRescalingBehaviour rescalingBehaviour,\n\t\t\t@RpcTimeout Time timeout) {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\tdefault CompletableFuture<Acknowledge> shutDownCluster() {\n\t\tthrow new UnsupportedOperationException();\n\t}\n}\n", "meta": {"content_hash": "5bf4160c1bf25c03ed67dd1d109e915f", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 127, "avg_line_length": 36.58115183246073, "alnum_prop": 0.7688564476885644, "repo_name": "zhangminglei/flink", "id": "6a6c34b90db227e5e19f530d1f253b8ddc8af25c", "size": "7792", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/RestfulGateway.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "5666"}, {"name": "CSS", "bytes": "18100"}, {"name": "Clojure", "bytes": "63105"}, {"name": "CoffeeScript", "bytes": "91220"}, {"name": "Dockerfile", "bytes": "3528"}, {"name": "HTML", "bytes": "86821"}, {"name": "Java", "bytes": "39364056"}, {"name": "JavaScript", "bytes": "8267"}, {"name": "Python", "bytes": "249644"}, {"name": "Scala", "bytes": "7201411"}, {"name": "Shell", "bytes": "282124"}]}} +{"text": "# Kinvey GeoTag\nThis is a Kinvey sample app, to location-based search, 3rd-Party location services, Push notifications, and Business Logic with Collection Hooks and Custom Endpoints. \n\nIn particular in addition to showing location-based data, this app allows user actions to trigger push notifications to other users that are near new notes and are interested in certain tags. \n\nFor more details about location, see the blog post at http://goo.gl/9dyMm.\nFor more details about business logic, see http://devcenter.kinvey.com/ios/guides/business-logic.\n\n## Using the App\nThe app shows a map highlighting the user's current location. The map is annotated with nearby hotels (from the 3rd-paty location service) as well as yours and other user's notes that match your selected tags. \n\nTap the \"page curl\" button to see a list of nearby tags. Selecting a tag will cause the user to subscribe to be notified for new notes with that tag as well as display those notes on the map. \n\nTo enter a new note, type in the text field. Any word preceded by a `#` will be added as a tag. \n\n## Set-up\n\n### Set up the App in Xcode\n\nAlso, you have to update `app-key` and `app-secret` in the file `KGAAppDelegate.m` to your app-key and app-secret from the Kinvey console. \n\nTo enable push, you need a push certificate from the Apple developer portal. Upload to Kinvey (under the push configuration) and enter the `Push Key` and `Push Secret` in the file `KGAAppDelegate.m. \n\n### Set up Locations services\n\nTo enable Data Integration with this app, just\n\n* Go to the **Locations** Add-On and select a provider. For example, choose \"FourSquare\" \n* Name the endpoint `hotels` and enter your foursquare credentials. Then press `Create Configuration`. \n\n### Set up Collection Hook To Automatically Push to Nearby users\n1. From the `Addons` -> `Data & Storage` -> `Data Store` menu, add a new collection and call it `mapNotes`.\n2. From the `Addons` -> `Business Logic` -> `Collection Hooks` menu, select the `mapNotes` collection in the left menu. \n3. Select __`After` every `Save` run this function__ from the javascript area.\n4. Enter the code from [`after_save_mapnotes.js`](https://github.com/KinveyApps/GeoTag-iOS/raw/master/after_save_mapnotes.js) in the code window:\n\n```\nfunction onPostSave(request, response, modules){\n var push = modules.push, collectionAccess = modules.collectionAccess, logger = modules.logger;\n var userCollection = collectionAccess.collection('user');\n var body = request.body;\n if (body.tags && body._geoloc) {\n logger.info(\"added map note with tags: \" + body.tags +\", location: \"+ body._geoloc);\n var distanceInMiles = 5.0 /*5 mi radius*/ / 3963.192;\n var query = {\"tags\": {\"$in\":body.tags}, \"_geoloc\":{\"$nearSphere\": body._geoloc,\"$maxDistance\":distanceInMiles}};\n userCollection.find(query, function (err, userColl) {\n logger.info(\"got \" + userColl.length + \" users with matching tags.\");\n if (err) {\n logger.error('Query failed: '+ err);\n } else {\n userColl.forEach(function (user) {\n logger.info('Pushing message to ' + user.username);\n push.send(user, \"New notes for tag(s): \" + body.tags);\n });\n }\n response.continue();\n });\n } else {\n logger.info(\"no tags in \" + body);\n response.continue();\n }\n}\n```\n\nThis code does the following:\n\n1. Extracts any tags and location from the just saved `MapNote` object. \n2. Searches the user collection for users that are (a) last within 5 miles of the note, and (b) have subscribed at least of the new note's tags in it's `tags` field.\n3. For each of the users that satisfy these requirements, send a push notification letting them know a new note is available for those tags.\n4. __Next Step:__ An even better form of the push notification would be include the note's `_id` and just reload that note. Right now the app just displays an alert and reloads all the notes. \n\n\n### Set up Custom Endpoint\n1. From the `Addons` -> `Business Logic` -> `Custom Endpoints` menu, create a new endpoint called `tagsNearMe`.\n2. Enter the code from [`tagsNearMe.js`](https://github.com/KinveyApps/GeoTag-iOS/raw/master/tagsNearMe.js) in the code window:\n\n```\nfunction getTags(request,response,modules,user) {\n var headers = {\"Authorization\":request.headers.authorization}; //re-use the current user's ACLs rather than master secret\n var loc = user._geoloc;\n var qs = '{\"_geoloc\":{\"$nearSphere\":['+loc+'],\"$maxDistance\":\"10\"}}'; //find notes within 10 miles\n var uri = 'https://' + request.headers.host + '/appdata/'+request.appKey+'/mapNotes/?query='+qs; //build the request\n modules.request.get({uri: uri, headers: headers}, function(error, res, body){\n\tif (error){\n\t modules.logger.error(error);\n\t response.body = {error: error.message};\n response.complete(res.status);\n\t} else {\n\t //iterate through all the notes and count the tags\n\t var elements = JSON.parse(body);\n\t var tags = {};\n\t elements.forEach(function(doc){\n\t\tdoc.tags.forEach(function(tagar) {\n\t\t if (tags[tagar]) {\n\t\t\ttags[tagar]++;\n\t\t } else {\n\t\t\ttags[tagar] = 1;\n\t\t }\n\t\t});\n\t });\n\t response.body = tags; //return all the tags with their count, could create a count threshold in the future\n\t response.complete(200);\n\t}\n});\n}\n\nfunction onRequest(request, response, modules){\n var collectionAccess = modules.collectionAccess;\n //find the current user in the user collection\n collectionAccess.collection('user').find({\"username\": request.username}, function (err, userColl) {\n if (err) {\n response.body = {error: error.message};\n response.complete(434);\n } else {\n getTags(request,response,modules,userColl[0]);\n }\n });\n}\n``` \n\nThis code does the following:\n\n1. The `onRequest` method is called when the request comes in. \n2. This method looks up the user using `collectionAccess`. The user object is needed to obtain the user's location.\n3. In `getTags()` a call is made \"as the user\" using the user's `Authorization` header to `mapNotes` collection. This is done in order to respect the user's ACLs (as collectionAccess is done as the \"master secret\"). For GeoTag, this should not make a difference since `mapNotes` is globally readable by default.\n4. If the response is successful, it will be an array of `MapNotes` objects. This array is iterated over and the each of the tags is counted in a running total.\n5. After all the notes are counted, the totals object is returned to the app. \n6. __Next Step:__ A good next step is to limit the tags to the 20 most popular, or only display tags that have been used 5 or more times in order to limit the noisiness of the data. \n\n__NOTE:__ it is important to `complete()` the response in all terminal branches, or the client will timeout waiting for a response. \n\n## System Requirements\n* Xcode 4.5+\n* iPad/iPhone/iPod Touch\n* iOS 6+\n* KinveyKit 1.17.0+\n\n## Contact\nWebsite: [www.kinvey.com](http://www.kinvey.com)\n\nSupport: [support@kinvey.com](http://docs.kinvey.com/mailto:support@kinvey.com)\n\n## License\n\nCopyright (c) 2013 Kinvey, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.", "meta": {"content_hash": "ddb5b564568a45b03101ca899f155f7f", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 311, "avg_line_length": 49.67515923566879, "alnum_prop": 0.7218874214642903, "repo_name": "hraschke/spotl_kinvstart_loc", "id": "1e02cb366a1543528b77a0dd1b5ca6e4a0583b67", "size": "7799", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "1050"}, {"name": "C++", "bytes": "1771"}, {"name": "JavaScript", "bytes": "2531"}, {"name": "Objective-C", "bytes": "261794"}, {"name": "Shell", "bytes": "1993"}]}} +{"text": "\n#ifndef __parserclass__\n#define __parserclass__\n\n#include <pelet/LexicalAnalyzerClass.h>\n#include <pelet/TokenClass.h>\n#include <pelet/ParserTypeClass.h>\n#include <unicode/unistr.h>\n#include <pelet/Api.h>\n\n/**\n\\mainpage pelet: Php Easy LanguagE Toolkit. A C++ library for analyzing PHP source code\n\\section Overview\nThis doc briefly describes the major design of the pelet parser library.\n\npelet has the folowing major components:\n\n- Parser\n- Lexer\n- Parser Implementation\n\n\\section Parser\nThe pelet::ParserClass, along with pelet::ClassObserverClass, pelet::ClassMemberObserverClass, \npelet::FunctionObserverClass, pelet::VariableObserverClass, and pelet::ExpressionObserverClass, make up\nthe \"driver\" (or main entry point) to pelet. ParserClass takes as input a string (or file) of PHP source code and \nextracts artifacts from it (classes, functions, methods, etc..).\n\nTo use the parser, a user will create a class that defines the callbacks for each PHP artifact (class, function,\nmethod, etc). The user will register these callbacks with the parser. When pelet::ParserClass::ScanFile is called, \nthe bison parser rules start looking for syntax rules. The parser will ask the lexer for tokens. As soon as a \nspecific rule is hit, then the proper parser observer callback gets called. For example, when the parser hits \nthe \"class\" rule (ie \"class MyClass {\") then the class observer will get called; and the observer will get the \nidentifer (\"MyClass\") along with other info (signature, comment).\n\nThe important thing to note here is that the callbacks happen while ParserClass::ScanFile still has control.\nParserClass::ScanFile does not return control until the entire file has been parsed; multiple callbacks will have\nbeen called before ParserClass::ScanFile returns. For this reason, it is important that ParserClass::ScanFile\nshould not be called within any of the observers.\n\nA word on concurrency: The pelet parser does not keep global state (it is a \"pure\" bison parser), but the pelet\nparser is not thread-safe. If pelet is used on a multi-threaded app, each thread should have its own instance\nof pelet::ParserClass.\n\n\\section Lexer \nThe pelet::LexicalAnalyzerClass is used to tokenize the source code (turn strings into tokens). The\ndetails of the implementation can be found in the \\ref LexerDetailsPage page.\n\n\\section ParserImplementation Parser Implementation\nThis is a parser generated with the help of Bison. This used to follow the PHP rules; \nfor example after \"function\" comes the function name; after \"if\" comes a \"(\" and so on...)\nWhen the syntax rules hit an artifact (for example a class) the syntax rules will call the proper observer.\nThe details of the implementation can be found in the \\ref ParserImplementationDetailsPage page.\n*/\nnamespace pelet {\n\n/**\n * Holds the results of the lint check. Currently lint check will stop when \n * the first error is encountered.\n */\nclass PELET_API LintResultsClass {\npublic:\n\n\t/**\n\t * A short description of the error; this is generated by the bison parser and is\n\t * not the most user-friendly but it is exactly what PHP displays; might as well\n\t * keep it consistant.\n\t */\n\tUnicodeString Error;\n\n\t/**\n\t * Path to the file in which the error ocurred. \n\t * This is what was given to the LintFile() method or ScanFile(std::string, LintResultsClass&) method. \n\t * For LintString() results this will be the empty string.\n\t */\n\tstd::string File;\n\n\t/**\n\t * Path to the file in which the error ocurred. \n\t * This is what was given to the LintFile() or ScanFile(FILE*, UnicodeString, LintResultsClass&) method.\n\t * For LintString() results this will be the empty string.\n\t */\n\tUnicodeString UnicodeFilename;\n\t\n\t/**\n\t * If the parser encountered a syntax error, then this object will be filled with \n\t * the last known class/method/function where the error occurred.\n\t */\n\tpelet::ScopeClass Scope;\n\n\t/**\n\t * The line in which the error ocurred. This is 1-based.\n\t */\n\tint LineNumber;\n\n\t/**\n\t * The character offset in which the error ocurred (with regargs to the start of\n\t * the file). This is 0-based.\n\t */\n\tint CharacterPosition;\n\n\tLintResultsClass();\n\n\t/**\n\t * copy the attributes from src to this object.\n\t */\n\tvoid Copy(const LintResultsClass& src);\n\t\n\t/**\n\t * remove any error string\n\t */\n\tvoid Clear();\n};\n\n/**\n * The parser class is designed in a way that can utilized by different pieces of code. The parser will analyze\n * given code and make calls to the different registered observers. There are observers for classes, functions, and \n * methods. Not all observers have to be set; for example if a FunctionObserverClass is never registered then the \n * parser will not notify when a function has been found in a piece of code.\n * \n * @code\n * class EchoAndObserverClass : public ClassObserverClass {\n * \n * virtual void ClassFound(const UnicodeString& className, const UnicodeString& signature, \n * const UnicodeString& comment) {\n * printf(\"Found Class %s\\n\", (const char*)className.ToUTF8());\n * }\n * }\n * \n * EchoAndObserverClass echoObserver;\n * ParserClass parser;\n * parser.SetClassObserver(&echoObserver);\n * wxString someFileName = wxT(\"/some/file.php\");\n * if (!parser.ScanFile(someFileName)) {\n * puts(\"Could not find file to parse!\");\n * }\n * @endcode\n * \n * Observers follow the PHP parsing rules to the letter. If source code is not valid; then observers may not\n * get called.\n *\n * Lint functionality\n * \n * The parser class has the ability to check PHP code for syntax errors. This is done via the LintXXX() methods.\n * \n * @code\n * ParserClass parser;\n * std::string file = \"/path/to/phpfile.php\";\n * LintResultsClass lintResults;\n * if (parser.LintFile(file, parserResults)) {\n * printf(\"No syntax errors in file %s\", (const char*)file.c_str());\n * }\n * else {\n * printf(\"%s. Error found in file %s on line %d.\\n\", parserResults.Error, file.c_str(), parserResults.LineNumber);\n * }\n * @endcode\n */\nclass PELET_API ParserClass {\n\n\npublic:\n\t\n\tParserClass();\n\t\n\t/**\n\t * Opens and scans the given file; This function will return once the entire\n\t * file has been parsed; it will call the proper observers when it encounters\n\t * a class, function, or variable declaration. This means that this\n\t * parser should not be modified in the observer calls.\n\t * \n\t * This is a convenience method, it does no handle unicode file names. For that,\n\t * see ScanFile(FILE*, UnicodeString, LintResultsClass)\n\t *\n\t * @param file the file to parse. Must be a full path.\n\t * @param LintResultsClass& results any error message will be populated here\n\t * @return bool if file was found and could be parsed successfully\n\t */\n\tbool ScanFile(const std::string& file, LintResultsClass& results);\n\n\t/**\n\t * Opens and scans the given file; This function will return once the entire\n\t * file has been parsed; it will call the proper observers when it encounters\n\t * a class, function, or variable declaration. This means that this\n\t * parser should not be modified in the observer calls. \n\t * This method is given a file pointer, it is useful for example when a file\n\t * with a unicode filename is opened by the caller.\n\t * \n\t * @param file the file to parse, this class will NOT own the file pointer\n\t * @param fileName this is the name that will be set in results.UnicodeFilename when an error happens\n\t * @param LintResultsClass& results any error message will be populated here\n\t * @return bool if file was found and could be parsed successfully\n\t */\n\tbool ScanFile(FILE* file, const UnicodeString& fileName, LintResultsClass& results);\n\t\n\t/**\n\t * Scans the given string. This function will return once the entire\n\t * string has been parsed; it will call the proper observers when it encounters\n\t * a class, function, or variable declaration. This means that this\n\t * parser should not be modified in the observer calls.\n\t * \n\t * @param const UnicodeString& code the code to parse.\n\t * @param LintResultsClass& results any error message will be populated here\n\t * @return bool if string could be parsed successfully\n\t */\n\tbool ScanString(const UnicodeString& code, LintResultsClass& results);\n\t\n\t/**\n\t * Change the version that this parser can handle. This needs to be called BEFORE ScanFile() or\n\t * ScanString()\n\t */\n\tvoid SetVersion(Versions version);\n\t\n\t/**\n\t * Set the class observer. The observer will get notified when a class is encountered.\n\t * Memory management of this pointer should be done by the caller.\n\t * \n\t * @param ClassObserverClass* observer the object to sent notifications to \n\t */\n\tvoid SetClassObserver(ClassObserverClass* observer);\n\t\n\t/**\n\t * Set the class member observer. The observer will get notified when a class member is encountered.\n\t * Memory management of this pointer should be done by the caller.\n\t * \n\t * @param ClassMemberObserverClass* observer the object to sent notifications to \n\t */\n\tvoid SetClassMemberObserver(ClassMemberObserverClass* observer);\n\t\n\t/**\n\t * Set the function observer. The observer will get notified when a function is encountered.\n\t * Memory management of this pointer should be done by the caller.\n\t * \n\t * @param FunctionObserverClass* observer the object to sent notifications to \n\t */\n\tvoid SetFunctionObserver(FunctionObserverClass* observer);\n\t\n\t/**\n\t * Set the variable observer. The observer will get notified when a new variable has been created.\n\t * Memory management of this pointer should be done by the caller.\n\t * \n\t * There are performance implications if you call this method; if you want to be notified \n\t * of variables then the full PHP parser is used; and parsing a file can be memory intensive.\n\t *\n\t * @param VariableObserverClass* observer the object to sent notifications to \n\t */\n\tvoid SetVariableObserver(VariableObserverClass* observer);\n\t\n\t/**\n\t * Set the expression observer. The observer will get notified when a new expression has been created.\n\t * Memory management of this pointer should be done by the caller.\n\t *\n\t * There are performance implications if you call this method; if you want to be notified \n\t * of expressions then the full PHP parser is used; and parsing a file can be memory intensive.\n\t *\n\t * @param ExpressionObserverClass* observer the object to sent notifications to \n\t */\n\tvoid SetExpressionObserver(ExpressionObserverClass* expressionObserver);\n\t\n\t/**\n\t * Perform a TRUE PHP syntax check on the entire file. This syntax check is based on PHP 5.3\n\t * or PHP 5.4 depending on whether SetVersion() was called.\n\t *\n\t * Note that this is not entirely the same as 'php -l' command; the PHP lint command detects \n\t * duplicate function / class names where as this lint check method does not.\n\t *\n\t * Returns true if the file had no syntax errors. Note that a file that does not have\n\t * any PHP code will be considered a good file (a PHP file that has only HTML is\n\t * considered good and true will be returned).\n\t *\n\t * This is a convenience method; unicode filenames are not handled.\n\t * \n\t * @param file the file to parse. Must be a full path.\n\t * @param LintResultsClass& results any error message will be populated here\n\t * @return bool true if file was found and had no syntax errors.\n\t */\n\tbool LintFile(const std::string& file, LintResultsClass& results);\n\n\t/**\n\t * Perform a TRUE PHP syntax check on the entire file. This syntax check is based on PHP 5.3\n\t * or PHP 5.4 depending on whether SetVersion() was called.\n\t *\n\t * Note that this is not entirely the same as 'php -l' command; the PHP lint command detects \n\t * duplicate function / class names where as this lint check method does not.\n\t *\n\t * Returns true if the file had no syntax errors. Note that a file that does not have\n\t * any PHP code will be considered a good file (a PHP file that has only HTML is\n\t * considered good and true will be returned).\n\t * \n\t * @param FILE* file the file to parse. Must be an opened file pointer, this class will NOT own the file pointer\n\t * @param fileName this is the name that will be set in results.UnicodeFilename when an error happens\n\t * @param LintResultsClass& results any error message will be populated here\n\t * @return bool true if file was found and had no syntax errors.\n\t */\n\tbool LintFile(FILE* file, const UnicodeString& filename, LintResultsClass& results);\n\t\n\t/**\n\t * Perform a syntax check on the given source code. Source code is assumed to be\n\t * all code (HTML will not be skipped, and will result in syntax errors). The PHP \n\t * open tag is optional.\n\t * Returns true if the code had no syntax errors.\n\t * \n\t * @param const UnicodeString& code the actual code to parse.\n\t * @param LintResultsClass& results any error message will be populated here\n\t * @return bool true if the code has no syntax errors.\n\t */\n\tbool LintString(const UnicodeString& code, LintResultsClass& results);\n\n\t/**\n\t * @return the character position where the parser is currently parsing. This can be called\n\t * inside an observer callback; in which case the character position is right PAST the\n\t * current token.\n\t */\n\tint GetCharacterPosition() const;\n\n\t\n\t/**\n\t * Parses a given PHP expression. This method will parse the given expression into a list of\n\t * of \"chained\" calls.\n\t *\n\t * A PHP expression is \n\t * - a variable ($obj)\n\t * - a function call (myFunc())\n\t * - an object operation (\"$obj->prop\")\n\t * - a static object operation (\"MyClass::Prop\")\n\t * \n\t * Object operations can be chained; like \"$obj->prop->anotherFunc()\". While indirect variables are allowed\n\t * in PHP (ie $this->$prop) this method will not handle them as it is nearly impossible to resolve them at parse time.\n\t *\n\t * The most extreme example is this expression: \"$obj->prop->anotherFunc()\"\n\t * This method will parse the expression into\n\t * $obj\n\t * ->prop\n\t * ->anotherFunc()\n\n\t * For example, if sourceCode represented this string:\n\t * \n\t * @code\n\t * UnicodeString sourceCode = UNICODE_STRING_SIMPLE(\"\n\t * class UserClass {\n\t * private $name;\n\t * \n\t * function getName() {\n\t * return $this->\n\t * \");\n\t * @endcode\n\t * then the following C++ code can be used to find a variable's type\n\t * \n\t * @code\n\t * ParserClass parser;\n\t * UnicodeString expression = UNICODE_STRING_SIMPLE(\"$this->\");\n\t * pelet::SymbolClass exprResult;\n\t * if (parser.ParseExpression(expression, exprResult)) {\n\t * \t// if successful, symbol.Lexeme will be set to \"$this\"\n\t * }\n\t * @endcode\n\t * \n\t * \n\t * @param expression the code string of the expression to resolve. This must be the code for a single expression.\n\t * Examples:\n\t * $anObject\n\t * $this->prop\n\t * $this->work()->another\n\t * $this->\n\t *\t\t work()->another\n\t *\t\t work()\n\t * self::prop\n\t * self::prop::\n\t * self::func()->prop\n\t * parent::prop\n\t * parent::fun()->prop\n\t * aFunction\n\t * An expression can have whitespace like this\n\t * $anObject\n\t *\t\t\t->method1()\n\t *\t\t\t->method2()\n\t *\t\t\t->method3()\n\t *\n\t * A special case that happens when the given expression ends with the object operator:\n\t * $this->\n\t * MyClass::\n\t * In this case, the operator will be added the chain list; this way the client code can determine that\n\t * the variable name actually ended.\n\t * @param expression the expression's name and \"chain\" list. The properties of this object will be reset every call.\n\t */\n\tvoid ParseExpression(UnicodeString expressionString, pelet::VariableClass& variable);\n\t\nprivate:\n\n\t/**\n\t * Clean up any resources after parsing a file. This is also very important if the \n\t * parser opens a string; without closing the string will not be released (if it's a\n\t * long string).\n\t */\n\tvoid Close();\n\n\t/**\n\t * Used to tokenize code\n\t */\n\tLexicalAnalyzerClass Lexer;\n\t\n\t/**\n\t * Notify the ClassObserver when a class has been found. Memory management of this pointer should be\n\t * done by the caller.\n\t */\n\tClassObserverClass* ClassObserver;\n\n\t/**\n\t * Notify the ClassMemberObserver when a class member has been found. Memory management of this pointer should be\n\t * done by the caller.\n\t */\n\tClassMemberObserverClass* ClassMemberObserver;\n\t\n\t/**\n\t * Notify the FunctionObserver when a function has been found. Memory management of this pointer should be\n\t * done by the caller.\n\t */\t\n\tFunctionObserverClass* FunctionObserver;\n\t\n\t/**\n\t * Notify the VariableObserver when a variable has been created. Memory management of this pointer should be\n\t * done by the caller.\n\t */\t\t\n\tVariableObserverClass* VariableObserver;\n\t\n\t\n\t/**\n\t * Notify the ExpressionObserver when an expressionhas been found. Memory management of this pointer should be\n\t * done by the caller.\n\t */\t\t\n\tExpressionObserverClass* ExpressionObserver;\n\t\n\t/**\n\t * The PHP version to handle\n\t */\n\tVersions Version;\n};\n\n\n\n}\n#endif // __parserclass__\n", "meta": {"content_hash": "f0e910471a31c351c4c7c7f1841f2b0f", "timestamp": "", "source": "github", "line_count": 440, "max_line_length": 120, "avg_line_length": 38.12954545454546, "alnum_prop": 0.7174107408952732, "repo_name": "robertop/pelet", "id": "c673ac60abd37abe03ad58f7e01f296b5b3a3b78", "size": "18051", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/pelet/ParserClass.h", "mode": "33188", "license": "mit", "language": [{"name": "C++", "bytes": "6035243"}, {"name": "HTML", "bytes": "12620"}, {"name": "Lua", "bytes": "15806"}, {"name": "Makefile", "bytes": "2367"}, {"name": "PHP", "bytes": "2884"}, {"name": "Shell", "bytes": "1468"}, {"name": "Yacc", "bytes": "661554"}]}} +{"text": "\n#pragma once\n\nextern \"C\"\n{\n\n /*!\n * \n * \\brief Data structure to capture X-12-ARIMA options\n */\n typedef struct __X12ARIMA_OPTIONS__\n {\n // Data section\n long lStartDate; ///< is the serial date number for the start date of the time series.\n BOOL monthly; ///< is a flag to indicate whether data is monthly/quarterly.\n size_t nObs; ///< is the number of observations in the input time series.\n\n \n int transform; ///< Transform section (1=Log, 2=Auto and 3=None)\n\n // Outlier\n BOOL AOOutlier; ///< additive outlier adjustment\n BOOL TCOutlier; ///< temporary \n BOOL LSOutlier; ///< level shift outlier adjustment\n int LSRun; ///< level shift run\n\n // Regression section\n BOOL tradingDayRegression; ///< Calendar adjustment: trading days\n BOOL EasterRegression; ///< Calendar adjustment: easter holidays\n BOOL ConstantIntercept; ///< Add a linear trend?\n\n // ARIMA Modeling\n BOOL AutoSelect; ///< RegARIMA Modeling: Automodeling?\n int P; ///< RegARIMA Modeling: Manual, set the order of AR process\n int Q; ///< RegARIMA Modeling: Manual, set the order of MA process\n int D; ///< RegARIMA Modeling: Manual, differencing\n int PP; ///< RegARIMA Modeling: Manual, the order of seasonal AR process\n int QQ; ///< RegARIMA Modeling: Manual, the order of seasonal MA process\n int DD; ///< RegARIMA Modeling: Manual, Seasonal differencing\n\n // Forecast\n int nForecastYears; ///< [in] is the number of years to forecast for.\n double fAlpha; ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n\n // Seasonal Adjustment\n BOOL bSeasonalAdjustFilter; ///< is a switch to include seasonal adjustment in the analysis.\n int nX11Mode; ///< 1=mult, 2=add, 3=pseudoadd, 4=logadd\n int nX11Options; ///< 1= x11default, 2=s3x1, 3=s3x3, 4=s3x5, 5=s3x9, 6=s3x15, 7=stable\n\n int henderson; ///< henderson filter setting, default=13\n\n }X12ARIMA_OPTIONS;\n\n /*!\n * \\sa NDK_GLM_GOF()\n */\n typedef enum\n {\n GOF_LLF=1, ///< Log-likelihood goodness of fit measure\n GOF_AIC=2, ///< Akaike information criterion goodness of fit measure\n GOF_BIC=3, ///< Bayesian or Schwartz information criterion goodness of fit measure\n GOF_HQC=4, ///< Hannan\u0096Quinn information criterion goodness of fit measure\n GOF_RSQ=5, ///< R-squared goodness of fit measure\n GOF_ARSQ=6 ///< Adjusted R-squared goodness of fit measure\n }GOODNESS_OF_FIT_FUNC;\n\n /*!\n * \\sa NDK_ARMA_FIT()\n */\n typedef enum\n {\n FIT_MEAN=1, ///< Fitted conditional mean\n FIT_STDEV=2, ///< Fitted conditional volatility or standard deviation\n FIT_RESID=3, ///< Raw residuals (actual - fitted mean)\n FIT_STD_RESID=4 ///< Standardized residuals - (actual - fitted mean)/fitted volatility\n }FIT_RETVAL_FUNC;\n\n /*!\n * \\sa NDK_ARMA_RESID()\n */\n typedef enum\n {\n RESIDS_STD=1, ///< Standardized residuals \n RESIDS_RAW=2 ///< Raw residuals\n }RESID_RETVAL_FUNC;\n\n /*!\n * \\sa NDK_ARMA_PARAM()\n */\n typedef enum\n {\n PARAM_GUESS=1, ///< Quick guess (non-optimal) of parameters values\n PARAM_CALIBRATE=2, ///< Run a calibration process to find optimal values for the model's parameters\n PARAM_ERROR=3 ///< Compute the standard error of the parameters' values\n }MODEL_RETVAL_FUNC;\n\n /*!\n * \\sa NDK_ARMA_FORE()\n */\n typedef enum\n {\n FORECAST_MEAN=1, ///< Mean forecast value\n FORECAST_STDEV=2, ///< Forecast standard error (aka local volatility)\n FORECAST_TS_STDEV=3, ///< Volatility term structure\n FORECAST_LL=4, ///< Lower limit of the forecast confidence interval\n FORECAST_UL=5 ///< Upper limit of the forecast confidence interval\n }FORECAST_RETVAL_FUNC;\n\n /*!\n * \\ingroup statistical testing\n * \\brief Supported statistical test outputs\n * \\sa NDK_MEANTEST()\n */\n typedef enum\n {\n TEST_PVALUE=1, ///< P-value\n TEST_SCORE=2, ///< Test statistics (aka score)\n TEST_CRITICALVALUE=3 ///< Critical value\n }TEST_RETURN;\n\n\n /*!\n * \\ingroup statistical testing\n * \\sa NDK_NORMALTEST()\n */\n typedef enum \n {\n NORMALTEST_JB=1, ///< Jacque-Berra\n NORMALTEST_WS=2, ///< Shapiro-Wilson\n NORMALTEST_CHISQ=3 ///< Chi-Square test - Doornik and Hansen, \"An Omnibus Test for Normality\", 1994.\n }NORMALTEST_METHOD;\n\n\n /*!\n * \\ingroup statistical testing\n * \\sa NDK_ADFTEST()\n */\n typedef enum \n {\n ADFTEST_DRIFT_ONLY=1, ///< Model 1: A stochastic drift\n ADFTEST_DRIFT_N_CONST=2, ///< Model II: A deterministic constant and stochastic drift\n ADFTEST_DRIFT_N_TREND =3, ///< Model III: A deterministic trend and stochastic drift\n ADFTEST_DRIFT_N_CONST_N_TREND =4, ///< Model IV: A deterministic constant, trend and stochastic drift\n ADFTEST_DRIFT_N_CONST_TREND_TREND2 =5 ///< Model V: A deterministic constant, trend, trend^2 and stochastic drift\n }ADFTEST_OPTION;\n\n\n\n/*!\n * \\brief Support correlation methods\n * \\sa NDK_XCFTEST(), NDK_XCF()\n */\n typedef enum \n {\n XCF_PEARSON=1, ///< Pearson\n XCF_SPEARMAN=2, ///< Spearman\n XCF_KENDALL=3 ///< Kendall\n }CORRELATION_METHOD;\n\n\n /*!\n * \\brief Supported Link function\n * \\sa NDK_GLM_GOF()\n */\n typedef enum\n {\n GLM_LVK_IDENTITY=1, ///< Identity (default)\n GLM_LVK_LOG=2, ///< Log\n GLM_LVK_LOGIT=3, ///< Logit\n GLM_LVK_PROBIT=4, ///< Probit\n GLM_LVK_CLOGLOG=5 ///< Complementary log-log\n }GLM_LINK_FUNC;\n\n /*!\n * \\brief Supported innovation types\n * \\sa NDK_GARCH_PARAM(), \n */\n typedef enum\n {\n INNOVATION_GAUSSIAN=1, ///< Gaussian or normal distribution\n INNOVATION_TDIST=2, ///< Standardized student's T-distribution\n INNOVATION_GED=3 ///< Standardized generalized error distribution (GED)\n }INNOVATION_TYPE;\n\n /*!\n * \\brief Supported innovation types\n * \\sa NDK_TREND()\n */\n typedef enum\n {\n TREND_LINEAR=1, ///< Linear time trend\n TREND_POLYNOMIAL=2, ///< Polynomial time trend\n TREND_EXPONENTIAL=3, ///< Exponential time trend\n TREND_LOGARITHMIC=4, ///< Logarithmic time trend\n TREND_POWER=5 ///< Power time trend\n }TREND_TYPE;\n\n /*!\n * \\brief multi-colinearity test method\n * \\sa NDK_COLNRTY_TEST()\n */\n typedef enum\n {\n COLNRTY_CN=1, ///< Condition Number\n COLNRTY_VIF=2, ///< Variation Inflation Factor (VIF)\n COLNRTY_DET=3, ///< Determinant\n COLNRTY_EIGEN=4 ///< Eigenvalues\n }COLNRTY_TEST_TYPE;\n\n /*!\n * \\brief Periodogram method options\n * \\sa NDK_PERIODOGRAM()\n */\n typedef enum\n {\n PERIODOGRAM_NONE=1, ///< don't process the input data\n PERIODOGRAM_DETREND=2, ///< detrend the input data\n PERIODOGRAM_DIFFERENCE=3, ///< difference the time series (1,1)\n PERIODOGRAM_AUTOPROC=4 ///< Auto-process (e.g. detrend, difference, etc.) the input data.\n }PERIODOGRAM_OPTION_TYPE;\n\n\n /*!\n * \\brief Imputation methods for resampling\n * \\sa NDK_RESAMPLE()\n */\n typedef enum\n {\n IMPUTATION_NONE = 0, ///< don't process the input data\n IMPUTATION_INTERPOLATE_FWD = 1, ///< flat forward\n IMPUTATION_INTERPOLATE_BKWD = 2, ///< flat backward\n IMPUTATION_INTERPOLATE_LINEAR = 3, ///< Linear interpolation\n IMPUTATION_INTERPOLATE_CSPLINE = 4, ///< cubic spline\n IMPUTATION_FFT = 5 ///< Fast Fourier transform\n }IMPUTATION_METHOD;\n\n typedef enum\n {\n X13TRANSFOR_NONE = 0, ///< don't process the input data\n X13TRANSFOR_AUTO = 1, ///< don't process the input data\n X13TRANSFOR_LOG = 2, ///< don't process the input data\n X13TRANSFOR_SQRT = 3, ///< don't process the input data\n X13TRANSFOR_INV = 4, ///< don't process the input data\n X13TRANSFOR_LOGIST = 5, ///< don't process the input data\n X13TRANSFOR_BOXCOX = 6 ///< don't process the input data\n }X13TRANSFORM_METHOD;\n\n typedef enum\n {\n X13PRIORADJUST_RATIO = 0, ///< \n X13PRIORADJUST_PERCENT = 1, ///< \n X13PRIORADJUST_DIFF = 2 ///< \n }X13PRIORADJUST_TYPE;\n\n typedef enum\n {\n X11_MODE_MULT = 0, ///< \n X11_MODE_ADD = 1, ///< \n X11_MODE_PSEUDOADD = 2, ///< \n X11_MODE_LOGADD = 3 ///< \n }X11_MODE_TYPE;\n\n\n typedef enum\n {\n X11_SEASONALMA_3x1 = 0, ///< \n X11_SEASONALMA_3x3 = 1, ///< \n X11_SEASONALMA_3x5 = 2, ///< \n X11_SEASONALMA_3x9 = 3, ///< \n X11_SEASONALMA_3x15 = 4, ///< \n X11_SEASONALMA_STABLE = 5, ///< \n X11_SEASONALMA_DEFAULT = 6, ///< 3x3 MA and 3x5\n X11_SEASONALMA_MSR=7 ///< X-11-ARIMA88\n }X11_SEASONALMA_TYPE;\n\n\n\n}\n\n// Functions API\nextern \"C\"\n{\n\n /// \\name Initialization APIs\n /// @{\n /*! \n * @brief Initializes the SFSDK Library\n * @details This function should be the first API called in the SDK; It initializes the SDK library dependencies:\n * 1. Logging system\n * 2. License system\n * 3. Database system\n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n *\n * \\sa SFMacros.h, NDK_Shutdown()\n */\n /*! \n @note 1. This is the first SDK API\n\n @code\n int nRet = NDK_FAILED;\n\n char szAppName[]=\"MyApp\";\n nRet = NDK_Init( szAppName, // we have a MyApp.conf file\n NULL, // use the license key in the license file (NumXL.lic)\n NULL, // use the activation code in the license file (NumXL.lic)\n NULL); // use the temp directory in current user's profile \n // (Windows 7) (c:\\users\\(username)\\AppData\\Local\\MyApp)\n // (Windows XP) (c:\\Local Settings\\(username)\\AppData\\Local\\MyApp)\n\n if( nRet >= NDK_SUCCES){\n ...\n ....\n }\n @endcode\n */\n int __stdcall NDK_Init( LPCTSTR szAppName, ///< [in] is the application name (user-defined), but must match the configuration base filename.\n LPCTSTR szKey, ///< [in, optional] is the NumXL license key. If missing (NULL), NDK_Init will attempt to locate the license key & activation code in the system.\n LPCTSTR szActCode, ///< [in, optional] is the license activation code. If missing (NULL), NDK_Init will attempt to locate the license key & activation code in the system.\n LPCTSTR szTmpPath ///< [in, optional] is the full path of the log file directory. If NULL, NDK reverts to the temporary directory in the current user's profile.\n ); \n \n \n /*! \n * @brief Shutdown and release resources used by the SFSDK Library\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful\n * \\retval Others see \\ref SFMacros.h\n * \\sa SFMacros.h, NDK_Init()\n */\n /*! \n @code\n int nRet = NDK_FAILED;\n\n ...\n nRet= NDK_Shutdown(); // This is the last SDK API called.\n // Check for error\n if( nRet < NDK_SUCCESS){\n ...\n }\n\n @endcode\n */\n int __stdcall NDK_Shutdown(void); \n\n // Examples\n /// \\example sdk_init.cpp\n\n /// @}\n\n /// \\name Descriptive Statistics\n /// @{\n\n // Time series statistics\n // General statistics\n /*! \n * \\brief Calculates the sample excess kurtosis.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n The time series is homogeneous or equally spaced. \n * \\note 1. The data sample may include missing values (e.g. #N/A).\n * \\note 2. The test hypothesis for the population excess kurtosis:\n\t\t\t\t\\f$H_{o}: K=0\\f$\n\t\t\t\t\\f$H_{1}: K\\neq 0\\f$, where:\n\t\t\t\t\t\\f$H_{o}\\f$ is the null hypothesis.\n\t\t\t\t\t\\f$H_{1}\\f$ is the alternate hypothesis.\n * \\note 3. For the case in which the underlying population distribution is normal, the sample excess kurtosis also has a normal sampling distribution:\n\t\t\t\t\\f$\\hat K \\sim N(0,\\frac{24}{T})\\f$, where:\n\t\t\t\t\t\\f$\\hat k\\f$ is the sample excess kurtosis (i.e. 4th moment).\n\t\t\t\t\t\\f$T\\f$ is the number of non-missing values in the data sample.\n\t\t\t\t\t\\f$N(.)\\f$ is the normal (i.e. gaussian) probability distribution function.\n * \\note 4. Using a given data sample, the sample excess kurtosis is calculated as:\n\t\t\t\t\\f$\\hat K (x)= \\frac{\\sum_{t=1}^T(x_t-\\bar x)^4}{(T-1)\\hat \\sigma^4}-3\\f$, where:\n\t\t\t\t\t\\f$\\hat K(x)\\f$ is the sample excess kurtosis.\n\t\t\t\t\t\\f$x_i\\f$ is the i-th non-missing value in the data sample.\n\t\t\t\t\t\\f$T\\f$ is the number of non-missing values in the data sample.\n\t\t\t\t\t\\f$\\hat \\sigma\\f$ is the sample standard deviation.\n * \\note 5. The underlying population distribution is assumed normal (gaussian)..\n * \\note 6. This is a two-sides (i.e. two-tails) test, so the computed p-value should be compared with half of the significance level \\f$\\frac{\\alpha}{2}\\f$.\n\n * \\sa NDK_XKURTTEST(), NDK_GED_XCF(), NDK_TDIST_XKURT()\n */\n int __stdcall NDK_XKURT(double* X, ///< [in] is the input data sample (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD reserved, ///< [in] This parameter is reserved and must be 1.\n double* retVal ///< [out] is the calculated sample excess-kurtosis value.\n );\n /*! \n * \\brief Calculates the sample skewness.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_ACF_SKEWTEST()\n */\n int __stdcall NDK_SKEW( double* X, ///< [in] is the input data sample (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD reserved, ///< [in] This parameter is reserved and must be 1.\n double* retVal ///< [out] is the calculated sample skew value.\n );\n /*! \n * \\brief Calculates the sample average.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_ACF_MEANTEST()\n */\n int __stdcall NDK_AVERAGE(double* X, ///< [in] is the input data sample (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD reserved, ///< [in] This parameter is reserved and must be 1.\n double* retVal ///< [out] is the calculated average value.\n );\n\n /*!\n * \\brief Calculates the geometric mean of the sample\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_AVERAGE()\n */\n int __stdcall NDK_GMEAN(double* X, ///< [in] is the input data sample (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD reserved, ///< [in] This parameter is reserved and must be 1.\n double* retVal ///< [out] is the calculated geometric average value.\n );\n\n /*! \n * \\brief Calculates the sample variance.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_ACF_STDEVTEST()\n */\n int __stdcall NDK_VARIANCE(double* X, ///< [in] is the input data sample (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD reserved, ///< [in] This parameter is reserved and must be 1.\n double* retVal ///< [out] is the calculated variance value.\n );\n\n /*! \n * \\brief Calculates the minimum value in a given sample.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_MAX(), NDK_QAUNTILE(), NDK_IQR()\n */\n int __stdcall NDK_MIN( double* X, ///< [in] is the input data sample (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD reserved, ///< [in] This parameter is reserved and must be 1.\n double* retVal ///< [out] is the calculated minimum value.\n );\n /*! \n * \\brief Calculates the maximum value in a given sample.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_MIN(), NDK_QAUNTILE()\n */\n int __stdcall NDK_MAX(double* X, ///< [in] is the input data sample (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD reserved, ///< [in] This parameter is reserved and must be 1.\n double* retVal ///< [out] is the calculated maximum value.\n );\n /*! \n * \\brief Returns the sample p-quantile of the non-missing observations (i.e. divides the sample data into equal parts determined by the percentage p). \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The time series may include missing values (NaN), but they will not be included in the calculations.\n * \\note 2. The quantile function for any distribution is defined between 0 and 1. Its function is the inverse of the cumulative distribution function (CDF).\n * \\note 3. The quantile function returns the sample median when \\f$p=0.5\\f$.\n * \\note 4. The quantile function returns the sample minimum when \\f$p=0\\f$.\n * \\note 5. The quantile function returns the sample maximum when \\f$p=1\\f$.\n * \\note 6. For any probability distribution, the following holds true for the probability \\f$p\\f$:\n\t\t\t\t-\\f$P(X< q)\\geq p\\f$, where: \n\t\t\t\t\t-\\f$q\\f$ is the sample \\f$p\\f$-quantile.\n * \\sa NDK_IQR(), NDK_MIN(), NDK_MAX()\n */\n int __stdcall NDK_QUANTILE( double* X, ///< [in] is the input data sample (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n double p, ///< [in] is a scalar value between 0 and 1 (exclusive).\n double* retVal ///< [out] is the calculated p-th quantile value.\n );\n /*! \n * \\brief Returns the interquartile range (IQR), also called the midspread or middle fifty. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The input time series data may include missing values (NaN), but they will not be included in the calculations.\n * \\note 2. The interquartile range is defined as follows:\n\t\t\t\t-\\f$\\textup{IQR}=Q_3-Q_1\\f$, where:\n\t\t\t\t\t-\\f$Q_3\\f$ is the third quartile.\n\t\t\t\t\t-\\f$Q_1\\f$ is the first quartile.\n * \\note 3. Interquartile range (IQR) is a robust statistic because it has a break down point of 25%. It is often preferred to the total range.\n * \\sa NDK_QUANTILE(), NDK_MIN(), NDK_MAX()\n */\n int __stdcall NDK_IQR(double* X, ///< [in] is the input data sample (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n double* retVal ///< [out] is the calculated IQR value.\n );\n\n /*! \n * \\brief Returns the sorted sample data\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_SORT_ASC( double* X, ///< [inout] is the input data sample (a one dimensional array).\n size_t N ///< [in] is the number of observations in X.\n );\n /*! \n * \\brief Calculates the Hurst exponent (a measure of persistence or long memory) for time series.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n */\n /*!\n * \\htmlonly\n * <h3>References</h3>\n * <ul>\n * <li>[1] A.A.Anis, E.H.Lloyd (1976) The expected value of the adjusted rescaled Hurst range of independent normal summands, Biometrica 63, 283-298.</li>\n * <li>[2] H.E.Hurst (1951) Long-term storage capacity of reservoirs, Transactions of the American Society of Civil Engineers 116, 770-808.</li>\n * <li>[3] E.E.Peters (1994) Fractal Market Analysis, Wiley.</li>\n * <li>[4] R.Weron (2002) Estimating long range dependence: finite sample properties and confidence intervals, Physica A 312, 285-299.</li>\n * </ul>\n * \\endhtmlonly \n */\n /*!\n *\t \\note 1. The input data series must have at least 9 non-missing values. Otherwise, Hurst function returns #NDK_FAILED.\n * \\note 2. The input data series may include missing values (NaN), but they will not be included in the calculations. \n * \\note 3. The Hurst exponent, \\f$h\\f$, is defined in terms of the rescaled range as follows:\n\t\t\t\t\\f$E \\left [ \\frac{R(n)}{S(n)} \\right ]=Cn^H \\textup{ as } n \\to \\infty \\f$\n * \\note 4. Where:\n\t\t\t\t-\\f$\\left [ \\frac{R(n)}{S(n)} \\right ]\\f$ is the Rescaled Range. \n\t\t\t\t-\\f$E \\left [x \\right ]\\f$ is the expected value.\n\t\t\t\t-\\f$n\\f$ is the time of the last observation (e.g. it corresponds to \\f$X_n\\f$ in the input time series data.) \n\t\t\t\t-\\f$h\\f$ is a constant. of\n * \\note 5. The Hurst exponent is a measure autocorrelation (persistence and long memory):\n\t\t\t\t-A value of \\f$0<H<0.5\\f$ indicates a time series with negative autocorrelation (e.g. a decrease between values will probably be followed by another decrease). \n\t\t\t\t-A value of \\f$0.5<H<1\\f$ indicates a time series with positive autocorrelation (e.g. an increase between values will probably be followed by another increase). \n\t\t\t\t-A value of \\f$H=0.5\\f$ indicates a \"true random walk,\" where it is equally likely that a decrease or an increase will follow from any particular value (e.g. the time series has no memory of previous values).\n * \\note 6. The Hurst exponent's namesake, Harold Edwin Hurst (1880-1978), was a British hydrologist who researched reservoir capacity along the Nile river. \n * \\note 7. The rescaled range is calculated for a time series, \\f$X=X_1,X_2,\\dots, X_n\\f$, as follows:\n\t\t\t\t1. Calculate the mean:<BR>\n\t\t\t\t\\f$m=\\dfrac{1}{n} \\sum_{i=1}^{n} X_i\\f$\n\t\t\t\t2. Create a mean adjusted series:<BR>\n\t\t\t\t\\f$Y_t=X_{t}-m \\textup{ for } t=1,2, \\dots ,n\\f$\n\t\t\t\t3. Calculate the cumulative deviate series Z:<BR>\n\t\t\t\t\\f$Z_t= \\sum_{i=1}^{t} Y_{i} \\textup{ for } t=1,2, \\dots ,n\\f$\n\t\t\t\t4. Create a range series R:<BR>\n\t\t\t\t\\f$R_t = max\\left (Z_1, Z_2, \\dots, Z_t \\right )- min\\left (Z_1, Z_2, \\dots, Z_t \\right ) \\textup{ for } t=1,2, \\dots, n\\f$\n\t\t\t\t5. Create a standard deviation series R:<BR>\n\t\t\t\t\\f$S_{t}= \\sqrt{\\dfrac{1}{t} \\sum_{i=1}^{t}\\left ( X_{i} - u \\right )^{2}} \\textup{ for } t=1,2, \\dots ,n\\f$\n\t\t\t\tWhere:<BR>\n\t\t\t\t\\f$h\\f$ is the mean for the time series values \\f$X_1,X_2, \\dots, X_t\\f$\n * \\note 8. Calculate the rescaled range series (R/S):<BR>\n\t\t\t\t\\f$\\left ( R/S \\right )_{t} = \\frac{R_{t}}{S_{t}} \\textup{ for } t=1,2, \\dots, n\\f$\n * \\sa NDK_GINI()\n */\n int __stdcall NDK_HURST_EXPONENT( double* X, ///< [in] is the input data sample (a one dimensional array). \n size_t N, ///< [in] is the number of observations in X.\n double alpha, ///< [in] is the statistical significance level (1%, 5%, 10%). If missing, a default of 5% is assumed.\n WORD retType, ///< [in] is a number that determines the type of return value: \n /// 1 = Empirical Hurst exponent (R/S method)\n /// 2 = Anis-Lloyd/Peters corrected Hurst exponent\n /// 3 = Theoretical Hurst exponent\n /// 4 = Upper limit of the confidence interval\n /// 5 = Lower limit of the confidence interval\n double* retVal ///< [out] is the calculated value of this function.\n );\n\n /*! \n * \\brief Returns the sample Gini coefficient, a measure of statistical dispersion. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n *\t \\note 1. A low Gini coefficient indicates a more equal distribution, with 0 corresponding to complete equality. Higher Gini coefficients indicate more unequal distributions, with 1 corresponding to complete inequality. \n * \\note 2. The input data series may include missing values (NaN), but they will not be included in the calculations. \n * \\note 3. The values in the input data series must be non-negative.\n * \\note 4. The Gini coefficient is computed as follows:\n \\f$G(S)=1-\\frac{2}{n-1}\\left ( n-\\frac{\\sum_{i=1}^{n}iy_i}{\\sum_{i=1}^{n}y_i} \\right )\\f$\n * \\note 5. Where:\n\t\t\t\t- \\f$h\\f$ is the input data series (\\f$h\\f$) arranged in descending order, so that \\f$y_i\\leq y_{i+1}\\f$. \n\t\t\t\t- \\f$n\\f$ is the number of non-missing values in the input time series data sample. \n\n * \\note 6. The Gini coefficient value can range from 0 to 1 and is half the NDK_RMD().\n * \\note 7. \\f$G(S)\\f$ is a consistent estimator of the population Gini coefficient, but is generally unbiased (except when the population mean is known).\n * \\note 8. Developed by the Italian statistician Corrado Gini in 1912, the Gini coefficient is commonly used as a measure of comparative income or wealth. Where zero (0) corresponds to complete equality and one (1) to complete inequality.\n * \\sa NDK_HURST_EXPONENT()\n */\n int __stdcall NDK_GINI(double* x, ///< [in] is the input data sample (must be non-negative) (a one dimensional array of values). \n\t\t\t\t\t\t size_t N, ///< [in] is the number of observations in X.\n\t\t\t\t\t\t double* retVal ///< [out] is the calculated value of this function.\n );\n\n /*! \n * \\brief Calculates the cross-correlation function between two time series. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The time series is homogeneous or equally spaced. \n * \\note 2. The two time series must be identical in size. \n * \\note 3. The Pearson correlation, \\f$r_{xy}\\f$, is defined as follows:\n\t\t\t\t-\\f$r_{xy}= \\frac{\\sum_{i=1}^N(x_i-\\bar{x})(y_i-\\bar{y})}{\\sqrt{\\sum_{i=1}^N(x_i-\\bar{x})^2\\times\\sum_{i=1}^N(y_i-\\bar{y})^2}}\\f$, where:\n\t\t\t\t\t-\\f$\\bar{x}\\f$ is the sample average of time series X.\n\t\t\t\t\t-\\f$\\bar{y}\\f$ is the sample average of time series Y.\n\t\t\t\t\t-\\f$x_i \\in X\\f$ is a value from the first input time series data.\n\t\t\t\t\t-\\f$y_i \\in Y\\f$ is a value from the second input time series data.\n\t\t\t\t\t-\\f$N\\f$ is the number of pairs \\f$\\left ( x_i,y_i \\right )\\f$ that do not contain a missing observation.\n * \\sa NDK_ACF(), NDK_XCF()\n */\n int __stdcall NDK_XCF(double* X, ///< [in] is the first univariate time series data (a one dimensional array). \n\t\t\t\t\t\tdouble* Y, ///< [in] is the second univariate time series data (a one dimensional array). \n\t\t\t\t\t\tsize_t N, ///< [in] is the number of observations in X.\n\t\t\t\t\t\tsize_t K, ///< [in] is the lag order (e.g. 0=no lag, 1=1st lag, etc.) to use with the second time series input (X). If missing, a default lag order of zero (i.e. no-lag) is assumed. \n\t\t\t\t\t\tWORD method, ///< [in] is the algorithm to use for calculating the correlation (see #CORRELATION_METHOD)\n\t\t\t\t\t\tWORD retType, ///< [in] is a switch to select the return output (1 = correlation value(default), 2 = std error).\n\t\t\t\t\t\tdouble* retVal ///< [out] is the calculated value of this function.\n ); \n\n /*! \n * \\brief Returns the sample root mean square (RMS).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The input time series data may include missing values (NaN), but they will not be included in the calculations. \n * \\note 2. The root mean square (RMS) is defined as follows for a set of \\f$n\\f$ values \\f${x_1,x_2,...,x_n}\\f$:\n\t\t\t\t- \\f$\\textrm{RMS}=\\sqrt{\\frac{x_1^2+x_2^2+\\cdots +x_N^2}{N}} =\\sqrt{\\frac{\\sum_{i=1}^N {x_i^2}}{N}}\\f$\n * \\note 3. Where:\n\t\t\t\t- \\f$x_i\\f$ is the value of the i-th non-missing observation.\n\t\t\t\t- \\f$N\\f$ is the number of non-missing observations in the input sample data.\n * \\note 4. The root mean square (RMS) is a statistical measure of the magnitude of a varying quantity.\n * \\note 5. The root mean square (RMS) has an interesting relationship to the mean (\\f$\\bar{x}\\f$) and the population standard deviation (\\f$\\sigma\\f$), such that:\n\t\t\t\t- \\f$\\textrm{RMS}^2=\\bar{x}^2+\\sigma^2\\f$\n * \\sa NDK_MD(), NDK_RMD()\n */\n int __stdcall NDK_RMS(double* X, ///< [in] is the input data sample (a one/two dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD reserved, ///< [in] This parameter is reserved and must be 1.\n double* retVal ///< [out] is the calculated value of this function.\n );\n\n /*! \n * \\brief Returns the mean difference of the input data series.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n \\note 1. The time series may include missing values (NaN), but they will not be included in the calculations. \n * \\note 2. The sample mean difference (MD) is computed as follows:\n\t\t\t\t- \\f$\\Delta = \\textup{MD} = \\frac{\\sum_{i=1}^n \\sum_{j=1}^n \\| x_i - x_j \\|}{n \\times \\left ( n-1 \\right )}\\f$\n * \\note 3. Where:\n\t\t\t\t- \\f$x_i\\f$ is the value of the i-th non-missing observation.\n\t\t\t\t- \\f$n\\f$ is the number of non-missing observations in the sample.\n * \\note 4. The mean difference is the product of the sample mean and the relative mean difference (RMD) and so can also be expressed in terms of the NDK_GINI:\n\t\t\t\t- \\f$\\textup{MD}= 2 \\times G \\times \\bar{x}\\f$\n * \\note 5. Where:\n\t\t\t\t- \\f$\\bar{x}\\f$ is the arithmetic sample mean. \n\t\t\t\t- \\f$G\\f$ is the NDK_GINI.\n * \\note 6. Because of its ties to the Gini coefficient, the mean difference is also called the \"Gini mean difference.\" It is also known as the \"absolute mean difference.\" \n * \\note 7. The sample mean difference is not dependent on a specific measure of central tendency like the standard deviation. \n * \\note 8. The mean difference of a sample is an unbiased and consistent estimator of the population mean difference. \n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_MD(double* pData, ///< [in] is the input data series (one/two dimensional array).\n\t\t\t\t\t size_t nSize, ///< [in] is the number of observations in pData.\n\t\t\t\t\t WORD reserved, ///< [in] This parameter is reserved and must be 1.\n\t\t\t\t\t double* retVal ///< [out] is the computed value.\n\t\t\t\t\t );\n\n /*! \n * \\brief Returns the sample relative mean difference.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The time series may include missing values (NaN), but they will not be included in the calculations.\n * \\note 2. The relative mean difference is defined in terms of the NDK_MD as follows:\n\t\t\t\t- \\f$\\textup{RMD}= \\frac{\\textup{MD}}{\\bar{x}}\\f$\n\n * \\note 3: Where:\n\t\t\t\t-\\f$\\bar{x}\\f$ is the sample mean (average) of the time series.\n\t\t\t\t-\\f$\\textup{MD}\\f$ is the mean difference of the time series.\n * \\note 4: The RMD is also equal to twice the NDK_GINI. \n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_RMD(double* X, ///< [in] is the input data sample (a one/two dimensional array).\n\t\t\t\t\t\tsize_t N, ///< [in] is the number of observations in X.\n\t\t\t\t\t\tWORD reserved, ///< [in] This parameter is reserved and must be 1.\n\t\t\t\t\t\tdouble* retVal ///< [out] is the calculated value of this function.\n\t\t\t\t\t\t);\n\n /*! \n * \\brief Returns the sample median of absolute deviation (MAD).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The input data series may include missing values (NaN), but they will not be included in the calculations.\n * \\note 2. The median of absolute deviation (MAD) is defined as follows:\n\t\t\t\t-\\f$\\operatorname{MAD} = \\operatorname{median}_{i}\\left(\\ \\left| X_{i} - \\operatorname{median}_{j} (X_{j}) \\right|\\ \\right)\\f$\n * \\note 3. In short, starting with the deviations from the data's median, the MAD is the median of their absolute values.\n * \\note 4. The median of absolute deviation (MAD) is a measure of statistical dispersion.\n * \\note 5. MAD is a more robust estimator of scale than the sample variance or standard deviation.\n * \\note 6. MAD is especially useful with distributions that have neither mean nor variance (e.g. the Cauchy distribution.)\n * \\note 7. MAD is a robust statistic because it is less sensitive to outliers in a data series than standard deviation.\n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_MAD(double* X, ///< [in] is the input data sample (a one/two dimensional array).\n\t\t\t\t\t\tsize_t N, ///< [in] is the number of observations in X.\n\t\t\t\t\t\tWORD reserved, ///< [in] This parameter is reserved and must be 1.\n\t\t\t\t\t\tdouble* retVal ///< [out] is the calculated value of this function.\n\t\t\t\t\t\t);\n\n /*! \n * \\brief Returns the long-run variance using a Bartlett kernel with window size k.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The input time series data may include missing values (NaN), but they will not be included in the calculations.\n * \\note 2. The long-run variance is computed as follows:\n\t\t\t\t-\\f$\\sigma^2=\\frac{1}{T}\\sum_{t=k}^{T-k}\\sum_{i=-k}^k w_i(x_t-\\bar{x})(x_{t-i}-\\bar{x})\\f$\n * \\note 3. Where:\n\t\t\t\t-\\f$x_{t} \\in X\\f$ is a value from the input time series data.\n\t\t\t\t-\\f$\\bar{x}\\f$ is the mean of the input time series data. \n\t\t\t\t-The weight \\f$w_i\\f$ in Bartlett kernel is defined as follows:\n\t\t\t\t\t-\\f$w_i= 1- \\frac{\\left | i \\right |}{k+1}\\f$\n\t\t\t\t-\\f$k\\f$ is the input window size for the Bartlett kernel.\n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_LRVAR(double* X, ///< [in] is the input data sample (a one/two dimensional array).\n\t\t\t\t\t size_t N, ///< [in] is the number of observations in X.\n\t\t\t\t\t\t size_t w, ///< [in] is the input Bartlett kernel window size. If omitted, the default value is the cubic root of the sample data size.\n\t\t\t\t\t\t double* retVal ///< [out] is the calculated value of this function.\n\t\t\t\t\t\t );\n\n /*! \n * \\brief Calculates the sum of absolute errors (SAE) between the forecast and the eventual outcomes.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The two time series must be identical in size.\n * \\note 3. A missing value (say \\f$x_k\\f$ or \\f$\\hat x_k\\f$) in either time series will exclude the data point \\f$(x_k,\\hat x_k)\\f$ from the SSE.\n * \\note 4. The sum of absolute errors (SAE) or deviations (SAD), is defined as follows:\n\t\t\t\t-\\f$\\mathrm{SAE}=\\mathrm{SAD}=\\sum_{i=1}^N \\left | x_i-\\hat x_i \\right |\\f$, where:\n\t\t\t\t\t-\\f$\\{x_i\\}\\f$ is the actual observations time series.\n\t\t\t\t\t-\\f$\\{\\hat x_i\\}\\f$ is the estimated or forecasted time series.\n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_SAD(double* X, ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n\t\t\t\t\t\tdouble* Y, ///< [in] is the forecast time series data (a one dimensional array). \n\t\t\t\t\t\tsize_t N, ///< [in] is the number of observations in X.\n\t\t\t\t\t\tdouble* retVal ///< [out] is the calculated value of this function.\n\t\t\t\t\t\t);\n\n /*! \n * \\brief Calculates the mean absolute error function for the forecast and the eventual outcomes. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The mean absolute error is a common measure of forecast error in time series analysis.\n * \\note 2. The time series is homogeneous or equally spaced.\n * \\note 3. The two time series must be identical in size.\n * \\note 4. The mean absolute error is given by:\n\t\t\t\t-\\f$\\mathrm{MAE}=\\frac{\\mathrm{SAE}}{N}=\\frac{\\sum_{i=1}^N \\left | x_i - \\hat x_i \\right |}{N}\\f$, where:\n\t\t\t\t\t-\\f$\\{x_i\\}\\f$ is the actual observations time series.\n\t\t\t\t\t-\\f$\\{\\hat x_i\\}\\f$ is the estimated or forecasted time series.\n\t\t\t\t\t-\\f$\\mathrm{SAE}\\f$ is the sum of the absolute errors (or deviations).\n\t\t\t\t\t-\\f$N\\f$ is the number of non-missing data points.\n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_MAE(double* X, ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n\t\t\t\t\t\tdouble* Y, ///< [in] is the forecast time series data (a one dimensional array). \n\t\t\t\t\t\tsize_t N, ///< [in] is the number of observations in X.\n\t\t\t\t\t\tdouble* retVal ///< [out] is the calculated value of this function.\n\t\t\t\t\t\t);\n\n\n int __stdcall NDK_MASE(double* X, ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n double* Y, ///< [in] is the forecast time series data (a one dimensional array). \n size_t N, ///< [in] is the number of observations in X.\n size_t M, ///< [in] is the seasonal period (for non-seasonal time series, set M=1).\n double* retVal ///< [out] is the calculated value of this function.\n );\n\n\n\n\n /*! \n * \\brief Calculates the mean absolute percentage error (deviation) function for the forecast and the eventual outcomes.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. MAPE is also referred to as MAPD. \n * \\note 2. The time series is homogeneous or equally spaced. \n * \\note 3. For a plain MAPE calculation, in the event that an observation value (i.e. \\f$x_k\\f$) is equal to zero, the MAPE function skips that data point. \n * \\note 4. The mean absolute percentage error (MAPE), also known as mean absolute percentage deviation (MAPD), measures the accuracy of a method for constructing fitted time series values in statistics. \n * \\note 5. The two time series must be identical in size. \n * \\note 6. The mean absolute percentage error (MAPE) is defined as follows:\n\t\t\t\t-\\f$\\mathrm{MAPE}=\\frac{100}{N}\\times \\sum_{i=1}^N \\left | \\frac{x_i - \\hat x_i}{x_i} \\right |\\f$, where:\n\t\t\t\t\t-\\f$\\{x_i\\}\\f$ is the actual observations time series. \n\t\t\t\t\t-\\f$\\{\\hat x_i\\}\\f$ is the estimated or forecasted time series.\n\t\t\t\t\t-\\f$N\\f$ is the number of non-missing data points.\n * \\note 7. When calculating the average MAPE for a number of time series, you may encounter a problem: a few of the series that have a very high MAPE might distort a comparison between the average MAPE of a time series fitted with one method compared to the average MAPE when using another method. \n * \\note 8. In order to avoid this problem, other measures have been defined, for example the SMAPE (symmetrical MAPE), weighted absolute percentage error (WAPE), real aggregated percentage error and relative measure of accuracy (ROMA). \n * \\note 9. The symmetrical mean absolute percentage error (SMAPE) is defined as follows:\n\t\t\t\t-\\f$\\mathrm{SMAPE}=\\frac{200}{N}\\times \\sum_{i=1}^N \\left | \\frac{x_i - \\hat x_i}{x_i+\\hat x_i} \\right |\\f$\n * \\note 10. The SMAPE is easier to work with than MAPE, as it has a lower bound of 0% and an upper bound of 200%. \n * \\note 11. The SMAPE does not treat over-forecast and under-forecast equally.\n * \\note 12. For a SMAPE calculation, in the event the sum of the observation and forecast values (i.e. \\f$x_k + \\hat x_k\\f$) equals zero, the MAPE function skips that data point. \n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_MAPE(double* X, ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n\t\t\t\t\t\t double* Y, ///< [in] is the forecast time series data (a one dimensional array). \n\t\t\t\t\t\t size_t N, ///< [in] is the number of observations in X.\n\t\t\t\t\t\t BOOL SMAPE, ///< [in] is a switch to select the return output (FALSE=MAPE (default), TRUE=Symmetric MAPE (SMAPI)). \n\t\t\t\t\t\t double* retVal ///< [out] is the calculated value of this function.\n\t\t\t\t\t\t );\n\n\n int __stdcall NDK_MdAPE(double* X, ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n double* Y, ///< [in] is the forecast time series data (a one dimensional array). \n size_t N, ///< [in] is the number of observations in X.\n BOOL SMAPE, ///< [in] is a switch to select the scale to divide on: FALSE = Actual obs., TRUE= Average (Actual, Forecast)\n double* retVal ///< [out] is the calculated value of this function.\n );\n\n int __stdcall NDK_MAAPE(double* X, ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n double* Y, ///< [in] is the forecast time series data (a one dimensional array). \n size_t N, ///< [in] is the number of observations in X.\n double* retVal ///< [out] is the calculated value of this function.\n );\n\n\n\n /*! \n * \\brief Calculates the root mean squared error (aka root mean squared deviation (RMSD)) function.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The RMSE is also known as root mean squared deviation (RMSD). \n * \\note 2. Please see NDK_RMSD for definition and notes. \n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_RMSE(double* X, ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array).\n\t\t\t\t\t\t double* Y, ///< [in] is the forecast time series data (a one dimensional array). \n\t\t\t\t\t\t size_t N, ///< [In] is the number of observations in X.\n\t\t\t\t\t\t WORD retType, ///< [In] is a switch to select the return output (1=RMSE (default), 2=NRMSE, 3=CV(RMSE)).\n\t\t\t\t\t\t double* retVal ///< [out] is the calculated value of this function.\n\t\t\t\t\t\t );\n\n \n \n int __stdcall NDK_GRMSE(double* X, ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array).\n double* Y, ///< [in] is the forecast time series data (a one dimensional array). \n size_t N, ///< [In] is the number of observations in X.\n double* retVal ///< [out] is the calculated value of this function.\n );\n \n \n /*! \n * \\brief Calculates the sum of the squared errors of the prediction function.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n *\t \\note 1. The time series is homogeneous or equally spaced. \n *\t \\note 2. The two time series must be identical in size. \n * \\note 3. A missing value (e.g. \\f$x_k\\f$ or \\f$\\hat x_k\\f$) in either time series will exclude the data point \\f$(x_k,\\hat x_k)\\f$ from the SSE. \n * \\note 4. The sum of the squared errors, \\f$\\mathrm{SSE}\\f$, is defined as follows:\n\t\t\t\t\\f$\\mathrm{SSE}=\\sum_{i=1}^N \\left(x_i-\\hat x_i \\right )^2\\f$, where:\n\t\t\t\t\t-\\f$\\{x_i\\}\\f$ is the actual observations time series.\n\t\t\t\t\t-\\f$\\{\\hat x_i\\}\\f$ is the estimated or forecasted time series.\n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_SSE(double* X,\t\t ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n\t\t\t\t\t\tdouble* Y,\t\t ///< [in] is the forecasted time series data (a one dimensional array). \n\t\t\t\t\t\tsize_t N,\t\t ///< [in] is the number of observations in X.\n\t\t\t\t\t\tdouble* retVal\t ///< [out] is the calculated sum of squared errors.\n\t\t\t\t\t\t);\n\n\n /*!\n * \\brief Calculates the mean squared errors of the prediction function.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n *\t \\note 1. The two data sets must be identical in size.\n * \\note 2. A missing value (e.g. \\f$x_k\\f$ or \\f$\\hat x_k\\f$) in either time series will exclude the data point \\f$(x_k,\\hat x_k)\\f$ from the MSE.\n * \\sa NDK_SSE()\n */\n int __stdcall NDK_MSE(double* X,\t\t ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n double* Y,\t\t ///< [in] is the forecasted time series data (a one dimensional array). \n size_t N,\t\t ///< [in] is the number of observations in X.\n double* retVal\t///< [out] is the calculated mean of squared errors.\n );\n\n\n int __stdcall NDK_GMSE(double* X,\t\t ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n double* Y,\t\t ///< [in] is the forecasted time series data (a one dimensional array). \n size_t N,\t\t ///< [in] is the number of observations in X.\n double* retVal\t///< [out] is the calculated mean of squared errors.\n );\n\n\n\n\n int __stdcall NDK_MRAE(double* X,\t\t ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n double* Y,\t\t ///< [in] is the forecasted time series data (a one dimensional array). \n size_t N,\t\t ///< [in] is the number of observations in X.\n size_t period, ///< [in] is the seasonal period (for non-seasonal time series, set M=1).\n double* retVal\t ///< [out] is the calculated mean of relative absolute error\n );\n\n int __stdcall NDK_MdRAE(double* X,\t\t///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n double* Y,\t\t ///< [in] is the forecasted time series data (a one dimensional array). \n size_t N,\t\t ///< [in] is the number of observations in X.\n size_t period, ///< [in] is the seasonal period (for non-seasonal time series, set M=1).\n double* retVal\t ///< [out] is the calculated median of relative absolute error\n );\n\n\n\n int __stdcall NDK_GMRAE(double* X,\t\t ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n double* Y,\t\t ///< [in] is the forecasted time series data (a one dimensional array). \n size_t N,\t\t ///< [in] is the number of observations in X.\n size_t period, ///< [in] is the seasonal period (for non-seasonal time series, set M=1).\n double* retVal\t ///< [out] is the calculated geometric mean of relative absolute error\n );\n\n\n\n int __stdcall NDK_PB(double* X,\t\t ///< [in] is the original (eventual outcomes) time series sample data (a one dimensional array). \n double* Y,\t\t ///< [in] is the forecasted time series data (a one dimensional array). \n size_t N,\t\t ///< [in] is the number of observations in X.\n size_t period, ///< [in] is the seasonal period (for non-seasonal time series, set M=1).\n WORD basis, ///< [in] is the switch to specify the metric used for comparison: 0=absolute error, 1=MAE, 2=MSE\n double* retVal\t ///< [out] is the calculated geometric mean of relative absolute error\n );\n\n\n\n /*! \n * \\brief Calculates the sample autocorrelation function (ACF) of a stationary time series.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The time series is homogeneous or equally spaced. \n * \\note 2. The time series may include missing values (NaN) at either end. \n * \\note 3. The lag order (k) must be less than the time series size or else an error value (#NDK_FAILED) is returned. \n * \\note 4. The ACF values are bound between -1 and 1, inclusive.\n * \\note 5. The sample autocorrelation is computed as:\n\t\t\t\t-\\f$\\hat{\\rho}(h)=\\frac{\\sum_{k=h}^T{(y_{k}-\\bar y)(y_{k-h}-\\bar y)}}{\\sum_{k=h}^T(y_{k}-\\bar y)^2}\\f$, where:\n\t\t\t\t\t-\\f$y_{t}\\f$ is the value of the time series at time t.\n\t\t\t\t\t-\\f$h\\f$ is the lag order.\n\t\t\t\t\t-\\f$T\\f$ is the number of non-missing values in the time series data.\n\t\t\t\t\t-\\f$\\bar y\\f$ is the sample average/mean of the time series.\n * \\note 6. Special cases:\n\t\t\t\t-By definition, \\f$\\hat{\\rho}(0) \\equiv 1.0\\f$\n * \\sa NDK_ACF_ERROR(), NDK_XCF()\n */\n int __stdcall NDK_ACF(double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n size_t K, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n WORD method, ///< [in] is the method selecor (0 = sample autocorrelation, 1= periodogram-based estimate, 2= cross-correlation based estimate).\n double* retVal ///< [out] is the calculated sample autocorrelation value. \n );\n\n\n /*! \n * \\brief Calculates the standard error in the sample autocorrelation function.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_ACF(), NDK_ACFCI()\n */\n int __stdcall NDK_ACF_ERROR(double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n size_t K, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n WORD method, ///< [in] is the method selecor (0 = sample autocorrelation, 1= periodogram-based estimate, 2= cross-correlation based estimate).\n double* retVal ///< [out] is the standard error in the sample autocorrelation value. \n );\n\n\n /*! \n * \\brief Calculates the confidence interval limits (upper/lower) for the autocorrelation function.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The time series is homogeneous or equally spaced. \n * \\note 2. The time series may include missing values (NaN) at either end. \n * \\note 3. The lag order (k) must be less than the time series size, or else an error value (#NDK_FAILED) is returned. \n * \\note 4. The ACFCI function calculates the confidence limits as:\n\t\t\t\t-\\f$\\hat\\rho_k - Z_{\\alpha/2}\\times \\sigma_{\\rho_k} \\leq \\rho_k \\leq \\hat\\rho_k+ Z_{\\alpha/2}\\times \\sigma_{\\rho_k}\\f$, where:\n\t\t\t\t\t-\\f$\\rho_k\\f$ is the population autocorrelation function.\n\t\t\t\t\t-\\f$\\sigma_{\\rho_k}\\f$ is the standard error of the sample autocorrelation.\n\t\t\t\t\t-\\f$\\hat{\\rho_{k}}\\f$ is the sample autocorrelation function for lag k.\n\t\t\t\t\t-\\f$Z\\sim N(0,1)\\f$\n\t\t\t\t\t-\\f$P(\\left|Z\\right|\\geq Z_{\\alpha/2}) = \\alpha\\f$\n * \\note 5. For the case in which the underlying population distribution is normal, the sample autocorrelation also has a normal distribution: \n\t\t\t\t-\\f$\\hat \\rho_k \\sim N(\\rho_k,\\sigma_{\\rho_k}^2)\\f$, where:\n\t\t\t\t\t-\\f$\\hat \\rho_k\\f$ is the sample autocorrelation for lag k.\n\t\t\t\t\t-\\f$\\rho_k\\f$ is the population autocorrelation for lag k.\n\t\t\t\t\t-\\f$\\sigma_{\\rho_k}\\f$ is the standard error of the sample autocorrelation for lag k.\n * \\note 6. Bartlett proved that the variance of the sample autocorrelation of a stationary normal stochastic process (i.e. independent, identically normal distributed errors) can be formulated as:\n\t\t\t\t-\\f$\\sigma_{\\rho_k}^2 = \\frac{\\sum_{j=-\\infty}^{\\infty}\\rho_j^2+\\rho_{j+k}\\rho_{j-k}-4\\rho_j\\rho_k\\rho_{i-k}+2\\rho_j^2\\rho_k^2}{T}\\f$\n * \\note 7. Furthermore, the variance of the sample autocorrelation is reformulated: \n\t\t\t\t-\\f$\\sigma_{\\rho_k}^2 = \\frac{1+\\sum_{j=1}^{k-1}\\hat\\rho_j^2}{T}\\f$, where:\n\t\t\t\t\t-\\f$\\sigma_{\\rho_k}\\f$ is the standard error of the sample autocorrelation for lag k. \n\t\t\t\t\t-\\f$T\\f$ is the sample data size.\n\t\t\t\t\t-\\f$\\hat\\rho_j\\f$ is the sample autocorrelation function for lag j.\n\t\t\t\t\t-\\f$k\\f$ is the lag order. \n * \\sa NDK_ACF(), NDK_ACF_ERROR()\n */\n int __stdcall NDK_ACFCI(double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n size_t K, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n WORD method, ///< [in] is the method selecor (0 = sample autocorrelation, 1= periodogram-based estimate, 2= cross-correlation based estimate).\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n double* ULCI, ///< [out] is the upper limit value of the confidence interval \n double* LLCI ///< [out] is the lower limit value of the confidence interval.\n );\n\n /*! \n * \\brief Calculates the sample partial autocorrelation function (PACF). \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_ACF(), NDK_PACF_ERROR(),NDK_PACFCI() \n */\n int __stdcall NDK_PACF( double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n size_t K, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n double* retVal ///< [out] is the calculated sample partial-autocorrelation value.\n );\n /*! \n * \\brief Calculates the standard error of the sample partial autocorrelation function (PACF). \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_PACF(), NDK_PACFCI()\n */\n int __stdcall NDK_PACF_ERROR( double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n size_t K, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n double* retVal ///< [out] is the standard error in the sample partial-autocorrelation value. \n );\n\n /*! \n * \\brief Calculates the confidence interval limits (upper/lower) for the partial-autocorrelation function.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_ACF(), NDK_ACF_ERROR()\n */\n int __stdcall NDK_PACFCI( double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n size_t K, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n double* ULCI, ///< [out] is the upper limit value of the confidence interval.\n double* LLCI ///< [out] is the lower limit value of the confidence interval.\n );\n\n\n\n /*! \n * \\brief Calculates the periodgram value for different lags.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_ACF(), NDK_PACF()\n */\n int __stdcall NDK_PERIODOGRAM(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in pData. \n PERIODOGRAM_OPTION_TYPE option, ///< [in] is the pre-processing option to the time series (e.g. detrend, difference, auto, etc.)\n double alpha, ///< [in] is the statistical significance level (used in the auto-process procedure). If missing, a default of 5% is assumed.\n double* retVal, ///< [out] is the periodogram values for this series\n size_t nOutSize ///< [in] is the size of the output buffer (i.e. retVal)\n );\n\n\n /*! \n * \\brief Calculates the estimated value of the exponential-weighted volatility (EWV). \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The time series is homogeneous or equally spaced. \n * \\note 2. The time series may include missing values (NaN) at either end. \n * \\note 3. The EWMA function assumes that the time series has an average equal to zero. \n * \\note 4. The exponential-weighted moving average is calculated as:\n\t\t\t\t-\\f$\\sigma_t^2=\\lambda \\sigma_{t-1}^2+(1-\\lambda)x_{t-1}^2\\f$, where:\n\t\t\t\t\t-\\f$x_t\\f$ is the value of the time series value at time t. \n\t\t\t\t\t-\\f$\\lambda\\f$ is the smoothing parameter (i.e. a non-negative constant between 0 and 1).\n * \\note 5. The size of the EWMA time series is equal to the input time series, but with the first observation (or last, if the original series is reversed) set to missing (NaN). \n * \\sa NDK_WMA(), NDK_EWXCF()\n */\n int __stdcall NDK_EWMA(double *X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n double lambda, ///< [in] is the smoothing parameter used for the exponential-weighting scheme. If missing, a default value of 0.94 is assumed \n size_t step, ///< [in] is the forecast time/horizon (expressed in terms of steps beyond the end of the time series X). If missing, a default value of 0 is assumed. \n double* retVal ///< [out] is the estimated value of the exponential-weighted volatility.\n );\n\n /*! \n * \\brief Computes the correlation factor using the exponential-weighted correlation function.\n * \\details NDK_EWXCF computes the correlation estimate using the exponential-weighted covariance (EWCOV) and volatility (EWMA/EWV) method for each time series.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The two time series must have identical size and time order. \n * \\note 3. The correlation is defined as:\n\t\t\t\t-\\f$\\rho^{(xy)}_t=\\frac{\\sigma_t^{(xy)}}{{_x\\sigma_t}\\times{_y\\sigma_t}}\\f$\n\t\t\t\t-\\f$\\sigma_t^{(xy)} = \\lambda\\sigma_{t-1}^{(xy)}+(1-\\lambda)x_{t-1}y_{t-1}\\f$\n\t\t\t\t-\\f$_x\\sigma_t^2=\\lambda\\times{_x\\sigma_{t-1}^2}+(1-\\lambda)x_{t-1}^2\\f$\n\t\t\t\t-\\f$_y\\sigma_t^2=\\lambda\\times{_y\\sigma_{t-1}^2}+(1-\\lambda)y_{t-1}^2\\f$, where:\n\t\t\t\t\t-\\f$\\rho^{(xy)}_t\\f$ is the sample correlation between X and Y at time t.\n\t\t\t\t\t-\\f$\\sigma_t^{(xy)}\\f$ is the sample exponential-weighted covariance between X and Y at time t.\n\t\t\t\t\t-\\f$_x\\sigma_t\\f$ is the sample exponential-weighted volatility for the time series X at time t.\n\t\t\t\t\t-\\f$_y\\sigma_t\\f$ is the sample exponential-weighted volatility for the time series Y at time t.\n\t\t\t\t\t-\\f$\\lambda\\f$ is the smoothing factor used in the exponential-weighted volatility and covariance calculations.\n * \\sa SFMacros.h, NDK_WMA(), NDK_EWMA()\n */\n int __stdcall NDK_EWXCF( double *X, ///< [in] is the first univariate time series data (a one dimensional array).\n double *Y, ///< [in] is the second univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X (or Y).\n double lambda, ///< [in] is the smoothing parameter used for the exponential-weighting scheme. If missing, a default value of 0.94 is assumed. \n size_t step, ///< [in] is the forecast time/horizon (expressed in terms of steps beyond the end of the time series X). If missing, a default value of 0 is assumed. \n double* retVal ///< [out] is the estimated value of the correlation factor.\n );\n\n\n ///@}\n\n /// \\name Statistical Distribution\n /// Statistical distribution\n /// @{\n\n /*! \n * \\brief Calculates the excess kurtosis of the generalized error distribution (GED).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_TDIST_XKURT(), NDK_XKURTTEST()\n */\n int __stdcall NDK_GED_XKURT(double df, ///< [in] is the shape parameter (or degrees of freedom) of the distribution (V > 1). \n double* retVal ///< [out] is the computed value\n );\n\n /*! \n * \\brief Calculates the excess kurtosis of the student's t-distribution.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_TDIST_XKURT(), NDK_XKURTTEST()\n */\n int __stdcall NDK_TDIST_XKURT(double df, ///< [in] is the degrees of freedom of the student's t-distribution (v > 4). \n double* retVal ///< [out] is the computed value.\n );\n\n /*! \n * \\brief Calculates the empirical distribution function (or empirical cdf) of the sample data.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_KERNEL_DENSITY_ESTIMATE(), NDK_HISTOGRAM()\n */\n int __stdcall NDK_EDF(double* pData, ///< [in] is the input data series (one/two dimensional array). \n size_t nSize, ///< [in] is the number of elements in pData.\n double targetVal, ///< [in] is the target value to compute the underlying cdf for. \n WORD retType, ///< [in] is a switch to select the return output (1=CDF (default), 2=Inverse CDF). \n double* retVal ///< [out] is the computed value.\n );\n\n /*! \n * \\brief Returns the number of histogram bins using a given method. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_HIST_BIN_LIMIT(), NDK_HISTOGRAM()\n */\n int __stdcall NDK_HIST_BINS(double* pData, ///< [in] is the input data series (one/two dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n WORD argMethod, ///< [in] is a switch to select the calculation method (1=Sturges's formula, 2=Square-root, 3=Scott's Choice, 4=Freedman-Diaconis choice, 5=Optimal (default)). \n size_t* retVal ///< [out] is the computed value.\n );\n\n /*! \n * \\brief Returns the upper/lower limit or center value of the k-th histogram bin. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_HIST_BINS(), NDK_HISTOGRAM()\n */\n int __stdcall NDK_HIST_BIN_LIMIT( double* pData, ///< [in] is the input data series (one/two dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n size_t nBins, ///< [in] is the input number of bins for the histogram.\n size_t index, ///< [in] is the bin index or order; e.g. 0=1st bin (default),1=2nd bin,..., N-1. \n WORD argRetTYpe, ///< [in] is a switch to select the return output (0=lower limit (default), 1=upper limit of the bin, 2=center of the bin). \n double* retVal ///< [out] is the computed value.\n );\n\n /*! \n * \\brief Calculates the histogram or cumulative histogram function for a given bin. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_HIST_BINS(), NDK_HISTOGRAM()\n */\n int __stdcall NDK_HISTOGRAM( double* pData, ///< [in] is the input data series (one/two dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n size_t nBins, ///< [in] is the input number of bins for the histogram.\n size_t index, ///< [in] is the bin index or order; e.g. 0=1st bin (default),1=2nd bin,..., N. \n WORD argRetTYpe, ///< [in] is a switch to select the return output:\n /// 0. histogram \n /// 1. cumulative histogram (default)). \n double* retVal ///< [out] is the computed value.\n );\n\n\n /*! \n * \\brief Returns the upper/lower limit or center value of the k-th histogram bin. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_HIST_BINS(), NDK_HISTOGRAM()\n */\n int __stdcall NDK_KERNEL_DENSITY_ESTIMATE(double* pData, ///< [in] is the input data series (one/two dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n double targetVal, ///< [in] is the target value to compute the underlying cdf for. \n double bandwidth, ///< [in] is the smoothing parameter (bandwidth) of the kernel density estimator. If missing, the KDE function calculates an optimal value.\n WORD argKernelFunc, ///< [in] is a switch to select the kernel function:\n /// 1=Gaussian (default),\n /// 2=Uniform\n /// 3=Triangular \n /// 4=Biweight (Quatric)\n /// 5=Triweight\n /// 6=Epanechnikov\n double* retVal ///< [out] is the computed value.\n );\n\n\n /*! \n * \\brief Returns a sequence of random numbers drawn from Normal distribution\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_GAUSS_FORECI()\n */\n int __stdcall NDK_GAUSS_RNG( double mean, ///< [in] is the mean of the Gaussian distribution.\n double sigma, ///< [in] is the standard deviation of the Gaussian distribution.\n UINT seed, ///< [in] is a number to initialize the psuedorandom number generator. \n double* retArray, ///< [out] are the generated random values.\n UINT nArraySize ///< [in] is the number of elements in retArray\n );\n\n\n /*! \n * \\brief Returns the upper & lower limit of the confidence interval for the Gaussian distribution.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_TSTUDENT_FORECI(), NDK_GED_FORECI()\n */\n int __stdcall NDK_GAUSS_FORECI( double mean, ///< [in] is the mean of the Gaussian distribution.\n double sigma, ///< [in] is the standard deviation of the Gaussian distribution.\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n BOOL upper, ///< [in] is a switch to select the limit (upper/lower).\n double* retVal ///< [out] is the computed value.\n );\n\n /*! \n * \\brief Returns the upper & lower limit of the confidence interval for the student\\'s t-distribution\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_GAUSS_FORECI(), NDK_GED_FORECI()\n */\n int __stdcall NDK_TSTUDENT_FORECI(double mean, ///< [in] is the mean of the student's t-distribution.\n double sigma, ///< [in] is the standard deviation of the student's t-distribution.\n double df, ///< [in] is the degrees of freedom (nu) of the student's t-distribution.\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n BOOL upper, ///< [in] is a switch to select the limit (upper/lower).\n double* retVal ///< [out] is the computed value.\n );\n\n\n\n /*! \n * \\brief Returns the upper & lower limit of the confidence interval for the Generalized Error Distribution (GED) distribution\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_TSTUDENT_FORECI(), NDK_GAUSS_FORECI()\n */\n int __stdcall NDK_GED_FORECI( double mean, ///< [in] is the mean of the GED distribution.\n double sigma, ///< [in] is the standard deviation of the GED distribution.\n double df, ///< [in] is the degrees of freedom (nu) of the GED distribution.\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n BOOL upper, ///< [in] is a switch to select the limit (upper/lower).\n double* retVal ///< [out] is the computed value.\n );\n ///@}\n\n\n /// \\name Statistical Testing\n /// Statistical/hypothesis testing is a common method of drawing inferences about a population based on statistical evidence from a sample.\n /// @{\n\n /*! \n * \\brief Calculates the p-value of the statistical test for the population autocorrelation function.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa SFMacros.h, NDK_WMA(), NDK_EWMA()\n */\n int __stdcall NDK_ACFTEST(double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n int K, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n WORD method, ///< [in] is the type of test: parametric or non-parametric.\n double target, ///< [in] is the assumed autocorrelation function value. If missing, the default of zero is assumed.\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n WORD retType, ///< [in] is a switch to select the return output: (\\ref #TEST_RETURN)\n /// 1. P-value\n /// 2. Test statistics (aka score)\n /// 3. Critical value\n double* retVal ///< [out] is the calculated test statistics.\n );\n\n /*! \n * \\brief Returns the p-value of the normality test (i.e. whether a data set is well-modeled by a normal distribution).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_MEANTEST(), NDK_SKEWTEST(), #NORMALTEST_METHOD, #TEST_RETURN\n */\n int __stdcall NDK_NORMALTEST( double* X, ///< [in] is the sample data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n WORD method, ///< [in] is the statistical test to perform (1=Jarque-Bera, 2=Shapiro-Wilk, 3=Chi-Square (Doornik and Hansen)). \n WORD retType, ///< [in] is a switch to select the return output: (\\ref #TEST_RETURN)\n /// 1. P-value\n /// 2. Test statistics (aka score)\n /// 3. Critical value\n double* retVal ///< [out] is the calculated test statistics.\n );\n\n /*! \n * \\brief Computes the p-value of the statistical portmanteau test (i.e. whether any of a group of autocorrelations of a time series are different from zero).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_NORMALTEST(), NDK_ARCHTEST()\n */\n int __stdcall NDK_WNTEST( double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n size_t K, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n WORD method, ///< [in] is the statistical test to perform (1=Ljung-Box). \n WORD retType, ///< [in] is a switch to select the return output: (\\ref #TEST_RETURN)\n /// 1. P-value\n /// 2. Test statistics (aka score)\n /// 3. Critical value\n double* retVal ///< [out] is the calculated test statistics.\n );\n\n /*! \n * \\brief Calculates the p-value of the ARCH effect test (i.e. the white-noise test for the squared time series).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_NORMALTEST(), NDK_ARCHTEST(), \n */\n int __stdcall NDK_ARCHTEST( double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n size_t K, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n WORD method, ///< [in] is the statistical test to perform (1=Ljung-Box).\n WORD retType, ///< [in] is a switch to select the return output: (\\ref #TEST_RETURN)\n /// 1. P-value\n /// 2. Test statistics (aka score)\n /// 3. Critical value\n double* retVal ///< [out] is the calculated test statistics.\n );\n /*! \n * \\brief Calculates the p-value of the statistical test for the population mean.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_SKEWTEST(), NDK_STDEVTEST()\n */\n int __stdcall NDK_MEANTEST( double* X, ///< [in] is the sample data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n double target, ///< [in] is the assumed mean value. If missing, a default of zero is assumed.\n double alpha, ///< [in] is the statistical significance level. If missing, the default of 5% is assumed.\n WORD method, ///< [in] is the statistical test to perform (1=parametric).\n WORD retType, ///< [in] is a switch to select the return output: (\\ref #TEST_RETURN)\n /// 1. P-value\n /// 2. Test statistics (aka score)\n /// 3. Critical value\n double* retVal ///< [out] is the calculated test statistics.\n );\n /*! \n * \\brief Calculates the p-value of the statistical test for the population standard deviation.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_MEANTEST(), NDK_SKEWTEST(), NDK_XKURTTEST()\n */\n int __stdcall NDK_STDEVTEST(double* X, ///< [in] is the sample data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n double target, ///< [in] is the assumed standard deviation value. If missing, a default of one is assumed\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n WORD method, ///< [in] is the statistical test to perform (1=parametric). \n WORD retType, ///< [in] is a switch to select the return output: (\\ref #TEST_RETURN)\n /// 1. P-value\n /// 2. Test statistics (aka score)\n /// 3. Critical value\n double* retVal ///< [out] is the calculated test statistics.\n );\n\n /*! \n * \\brief Calculates the p-value of the statistical test for the population skew (i.e. 3rd moment).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_NORMALTEST(), NDK_MEANTEST(), NDK_STDEVTEST(), NDK_XKURTTEST()\n */\n int __stdcall NDK_SKEWTEST( double* X, ///< [in] is the sample data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n double alpha, ///< [in] is the statistical significance level. If missing, the default of 5% is assumed.\n WORD method, ///< [in] is the statistical test to perform (1=parametric). \n WORD retType, ///< [in] is a switch to select the return output: (\\ref #TEST_RETURN)\n /// 1. P-value\n /// 2. Test statistics (aka score)\n /// 3. Critical value\n double* retVal ///< [out] is the calculated test statistics.\n );\n\n /*! \n * \\brief Calculates the p-value of the statistical test for the population excess kurtosis (4th moment).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa SFMacros.h, NDK_NORMALTEST(), NDK_MEANTEST(), NDK_STDEVTEST(), NDK_SKEWTEST()\n */\n int __stdcall NDK_XKURTTEST(double* X, ///< [in] is the sample data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n WORD method, ///< [in] is the statistical test to perform (1=parametric). \n WORD retType, ///< [in] is a switch to select the return output: (\\ref #TEST_RETURN)\n /// 1. P-value\n /// 2. Test statistics (aka score)\n /// 3. Critical value\n double* retVal ///< [out] is the calculated test statistics.\n );\n /*! \n * \\brief Calculates the test stats, p-value or critical value of the correlation test.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_NORMALTEST(), NDK_MEANTEST(), NDK_STDEVTEST(), NDK_SKEWTEST()\n */\n int __stdcall NDK_XCFTEST(double* X, ///< [in] is the first univariate time series data (a one dimensional array).\n double *Y, ///< [in] is the second univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X (or Y).\n int K, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n double target, ///< [in] is the assumed correlation value. If missing, a default of zero is assumed.\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n WORD method, ///< [in] is the desired correlation coefficient (1=Pearson (default), 2=Spearman, 3=Kendall). If missing, a Pearson coefficient is assumed.\n WORD retType, ///< [in] is a switch to select the return output: (\\ref #TEST_RETURN)\n /// 1. P-value\n /// 2. Test statistics (aka score)\n /// 3. Critical value\n double* retVal ///< [out] is the calculated test statistics.\n );\n\n\n /*! \n * \\brief Returns the p-value of the Augmented Dickey-Fuller (ADF) test, which tests for a unit root in the time series sample.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_NORMALTEST(), NDK_MEANTEST(), NDK_STDEVTEST(), NDK_SKEWTEST()\n */\n int __stdcall NDK_ADFTEST(double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD K, ///< [in] is the lag length of the autoregressive process. If missing, an initial value equal to the cubic root of the input data size is used.\n ADFTEST_OPTION options, ///< [in] is the model description flag for the Dickey-Fuller test variant (1=no constant, 2=contant-only, 3=trend only, 4=constant and trend, 5=const, trend and trend squared). \n BOOL testDown, ///< [in] is the mode of testing. If set to TRUE (default), ADFTest performs a series of tests. The test starts with the input length lag, but the actual length lag order used is obtained by testing down. \n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n WORD method, ///< [in] is the statistical test to perform (1=ADF).\n WORD retType, ///< [in] is a switch to select the return output: (\\ref #TEST_RETURN)\n /// 1. P-value\n /// 2. Test statistics (aka score)\n /// 3. Critical value\n\n double* retVal ///< [inout] is the calculated test statistics.\n );\n int __stdcall NDK_KPSSTEST(double* pData, size_t nSize, WORD maxOrder, WORD option, BOOL testDown, WORD argMethod, WORD retType, double alpha, double* retVal);\n\n\n /*! \n * \\brief Returns the Johansen (cointegration) test statistics for two or more time series.\n * \\note 1. Each column in the input matrix corresponds to a separate time series variable.\n * \\note 2. The input matrix can have no more than twelve (12) columns (or variables).\n * \\note 3. Each row in the input matrix corresponds to an observation.\n * \\note 4. The number of cointegrating relationships should be no greater than the number of input variables.\n * \\note 5. The time series data are homogeneous or equally spaced.\n * \\note 6. The time series may include missing values (e.g. NaN) at either end.\n * \\note 7. There are two types of Johansen tests - with trace or with eigenvalue - and the inferences might be a bit different for each.\n * - The null hypothesis for the trace test is the number of cointegration vectors r <= ?\n * - The null hypothesis for the eigenvalue test is r = ?\n * \\note 8. The function was added in version 1.62 DEWDROP.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_ADFTEST(), NDK_MEANTEST(), NDK_STDEVTEST(), NDK_SKEWTEST()\n * \n */\n int __stdcall NDK_JOHANSENTEST(double** XX, ///< [in] is the multivariate time series matrix data (two dimensional).\n size_t N, ///< [in] is the number of observations in XX.\n size_t M, ///< [in] is the number of variables in XX.\n size_t K, ///< [in] is the number of lagged difference terms used when computing the estimator.\n short nPolyOrder, ///< [in] is the order of the polynomial: (-1=no constant, 0=contant-only (default), 1=constant and trend).\n BOOL tracetest, ///< [in] is a flag to select test: TRUE=trace, FALSE=maximal eignvalue test.\n WORD R, ///< [in] is the assumed number of cointegrating relationships between the variables (if missing, r=1). \n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n double* retStat, ///< [out] is the calculated test statistics score.\n double *retCV ///< [out] is the calculated test critical value.\n ); /// \\example sdk_cointegration.cpp\n\n /*! \n * \\brief Returns the collinearity test statistics for a set of input variables.\n * \\note 1. Each column in the input matrix corresponds to a separate time series variable.\n * \\note 2. The input matrix can have no more than twelve (12) columns (or variables).\n * \\note 3. Each row in the input matrix corresponds to an observation.\n * \\note 4. The input data may include missing values (e.g. NaN).\n * \\note 5. In the variance inflation factor (VIF) method, a series of regressions models are constructed, where one variable is the dependent variable against the remaining predictors.\n * \\note 6. A tolerance of less than 0.20 or 0.10 and/or a VIF of 5 or 10 and above indicates a multicollinearity problem. \n * \\note 7. As a rule of thumb, a condition number (\\f$\\kappa\\f$) greater or equal to 30 indicates a severe multi-collinearity problem.\n * \\note 8. The CollinearityTest function is available starting with version 1.60 APACHE.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_CHOWTEST()\n * \n */\n int __stdcall\tNDK_COLNRTY_TEST (double** XX, ///< [in] is the input variables matrix data (two dimensional).\n size_t N, ///< [in] is the number of rows (observations) in XX.\n size_t M, ///< [in] is the number of columns (variables) in XX.\n LPBYTE mask, ///< [in] is the boolean array to select a subset of the input variables in X. If NULL, all variables in X are included.\n size_t nMaskLen, ///< [in] is the number of elements in the mask. Must be zero or equal to M.\n COLNRTY_TEST_TYPE nMethod, ///< [in] is the multi-colinearity measure to compute (see #COLNRTY_TEST_TYPE).\n WORD nColIndex, ///< [in] is a switch to designate the explanatory variable to examine (not required for condition number).\n double* retVal ///< [out] is the calculated statistics of collinearity.\n );\n /*! \n * \\brief Returns the p-value of the regression stability test (i.e. whether the coefficients in two linear regressions on different data sets are equal). \n * \\note 1. Each column in the input matrix corresponds to a separate time series variable.\n * \\note 2. The input matrix can have no more than twelve (12) columns (or variables). \n * \\note 3. Each row in the input matrix corresponds to an observation.\n * \\note 4. The input data may include missing values (e.g. NaN).\n * \\note 5. Observations (i.e. row) with missing values in X or Y are removed.\n * \\note 6. The number of observations of each data set must be larger than the number of explanatory variables. \n * \\note 8. The CollinearityTest function is available starting with version 1.60 APACHE.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful. see \\ref SFMacros.h\n * \\sa NDK_COLNRTY_TEST()\n * \n */\n int __stdcall NDK_CHOWTEST( double** XX1, ///< [in] is the independent variables data matrix of the first data set (two dimensional).\n size_t M, ///< [in] is the number of variables (columns) in XX1 and XX2.\n double* Y1, ///< [in] is the response or the dependent variable data array for the first data set (one dimensional array).\n size_t N1, ///< [in] is the number of observations (rows) in the first data set.\n double** XX2, ///< [in] is the independent variables data matrix of the second data set, such that each column represents one variable.\n double* Y2, ///< [in] is the response or the dependent variable data array of the second data set (one dimensional array).\n size_t N2, ///< [in] is the number of observations (rows) in the second data set.\n LPBYTE mask, ///< [in] is the boolean array to select a subset of the input variables in X. If NULL, all variables in X are included. \n size_t nMaskLen, ///< [in] is the number of elements in the mask, which must be zero or equal to M.\n double intercept, ///< [in] is the regression constant or the intercept value (e.g. zero). If missing, an intercept is not fixed and will be computed from the data set.\n TEST_RETURN retType, ///< [in] is a switch to select the return output (see #TEST_RETURN for more details).\n double* retVal ///< [in] is the calculated Chow test statistics.\n );\n\n\n ///@}\n\n\n /*!\n * \\name Transfom\n * @{\n */\n /*! \n * \\brief Returns an array of cells for the backward shifted, backshifted or lagged time series.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_DIFF()\n */\n int __stdcall NDK_LAG(double* X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n size_t K ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n );\n /*! \n * \\brief Returns an array of cells for the differenced time series (i.e. (1-L^S)^D).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_LAG(), NDK_INTEG\n */\n int __stdcall NDK_DIFF( double* X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n size_t S, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n size_t D ///< [in] is the number of repeated differencing (e.g. d=0 (none), d=1 (difference once), 2=(difference twice), etc.).\n );\n /*! \n * \\brief Returns an array of cells for the integrated time series (inverse operator of NDK_DIFF).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_LAG(), NDK_DIFF\n */\n int __stdcall NDK_INTEG(double* X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n size_t S, ///< [in] is the lag order (e.g. k=0 (no lag), k=1 (1st lag), etc.).\n size_t D, ///< [in] is the number of repeated differencing (e.g. d=0 (none), d=1 (difference once), 2=(difference twice), etc.).\n double* X0, ///< [in,optional] is the initial (un-differenced) univariate time series data (a one dimensional array). If missing (i.e. NULL), zeros are assumed.\n size_t N0 ///< [in] is the number of observations in X0.\n );\n\n\n /*! \n * \\brief Returns an array of cells of a time series after removing all missing values. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_LAG(), NDK_DIFF\n */\n int __stdcall NDK_RMNA( double *X, ///< [inout] is the univariate sample data (a one dimensional array).\n size_t* N ///< [inout] is the number of observations in X.\n );\n\n /*! \n * \\brief Returns the time-reversed order time series (i.e. the first observation is swapped with the last observation, etc.): both missing and non-missing values.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_LAG(), NDK_DIFF\n */\n int __stdcall NDK_REVERSE(double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N ///< [in] is the number of observations in X.\n );\n\n /*! \n * \\brief Returns an array of cells for the scaled time series. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_ADD(), NDK_SUB()\n */\n int __stdcall NDK_SCALE(double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n double K ///< [in] is the scalar/multiplier value.\n );\n\n\n /*! \n * \\brief Returns an array of the difference between two time series. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_ADD(), NDK_SCALE()\n */\n int __stdcall NDK_SUB(double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N1, ///< [in] is the number of observations in X. \n const double *Y, ///< [in] is the second univariate time series data (a one dimensional array).\n size_t N2 ///< [in] is the number of observations in Y. \n );\n\n /*! \n * \\brief Returns an array of cells for the sum of two time series. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_SUB(), NDK_SCALE()\n */\n int __stdcall NDK_ADD(double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N1, ///< [in] is the number of observations in X. \n const double *Y, ///< [in] is the second univariate time series data (a one dimensional array).\n size_t N2 ///< [in] is the number of observations in Y. \n ); \n\n\n\n /*! \n * \\brief Computes the complementary log-log transformation, including its inverse.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_HodrickPrescotFilter(), NDK_DFT(), NDK_IDFT()\n */\n int __stdcall NDK_CLOGLOG(double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n WORD retTYpe ///< [in] is a number that determines the type of return value: 1 (or missing)=C-log-log , 2=inverse C-log-log.\n );\n\n /*! \n * \\brief Computes the probit transformation, including its inverse.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_HodrickPrescotFilter(), NDK_DFT(), NDK_IDFT()\n */\n int __stdcall NDK_PROBIT(double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD retTYpe ///< [in] is a number that determines the type of return value: 1 (or missing)=probit , 2=inverse probit.\n );\n\n /*! \n * \\brief Computes the complementary log-log transformation, including its inverse.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_PROBIT(), NDK_BOXCOX(), NDK_CLOGLOG()\n */\n int __stdcall NDK_LOGIT(double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n WORD retTYpe ///< [in] is a number that determines the type of return value: 1 (or missing)=logit, 2=inverse logit.\n );\n\n\n /*! \n * \\brief Computes the complementary log-log transformation, including its inverse.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_LOGIT(), NDK_PROBIT(), NDK_CLOGLOG()\n */\n int __stdcall NDK_BOXCOX( double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n double* lambda, ///< [in] is the input power parameter of the transformation, on a scale from 1 to 0. If omitted, a default value of 0 is assumed. \n double* alpha, ///< [in] is the input shift parameter for X. If omitted, the default value is 0. \n int retTYpe, ///< [in] is a number that determines the type of return value: 1 (or missing)=Box-Cox, 2=inverse Box-Cox, 3= LLF of Box-Cox.\n double *retVal ///< [out] is the calculated log-likelihood value of the transform (retType=3).\n );\n\n /*! \n * \\brief Detrends a time series using a regression of y against a polynomial time trend of order p.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_BOXCOX(), NDK_RMSEASONAL(), NDK_DIFF()\n */\n int __stdcall NDK_DETREND(double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n WORD polyOrder ///< [in] is the order of the polynomial time trend:\n /// 0. subtracts mean (default)\n /// 1. constant plus trend model\n /// 2. constant plus trend and squared trend model\n );\n\n /*! \n * \\brief Returns an array of the deseasonalized time series, assuming a linear model.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_DETREND(), NDK_DIFF()\n */\n int __stdcall NDK_RMSEASONAL( double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X.\n size_t period ///< [in] is the number of observations(i.e. points) in one season.\n );\n\n\n\n /*! \n * \\brief Returns an array of a time series after substituting all missing values with the mean/median.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_RMNA(), NDK_INTERPOLATE()\n */\n int __stdcall\tNDK_INTERP_NAN( double* X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n WORD nMethod, ///< [in] is an identifier for the method used to generate values for any missing data:\n /// 1. Mean (default)\n /// 2. Median\n /// 3. Constant\n /// 4. Forward flat \n /// 5. Backward flat\n /// 6. Linear\n /// 7. Cubic spline\n /// 8. Weighted moving average\n /// 9. Exponential smoothing\n /// 10. Brownian bridge\n double plug ///< [in] is the data argument related to the selected treatment method (if applicable). For instance, if the method is constant, then the value would be the actual value.\n );\n\n /*! \n * \\brief Examine whether the given array has one or more missing values.\n * \\return status code of the operation\n * \\retval #NDK_TRUE One or more missing value are detected.\n * \\retval #NDK_FALSE No missing value is found.\n * \\retval #NDK_FAILED Operation unsuccessful. See \\ref SFMacros.h for more details.\n * \\sa NDK_RMNA(), NDK_INTERP_NAN()\n */\n int __stdcall\tNDK_HASNA(const double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n BOOL intermediate ///< [in] is a switch to tune the search for missng values:\n /// - TRUE = Only search for intermediate missing values.\n /// - FALSE = Search for all missing values in X.\n );\n\n\n /// \\name Resampling\n /// resampling API functions calls\n /// @{\n\n /*!\n * \\brief Returns the resampled time series.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SESMTH(), NDK_EWMA(), NDK_DESMTH(), NDK_TESMTH, NDK_LESMTH()\n */\n int __stdcall NDK_RESAMPLE(double* pData, size_t nSize, BOOL isStock, double relSampling, IMPUTATION_METHOD method, double* pOutData, size_t *newSize);\n\n int __stdcall\tNDK_INTERP_BROWN(double* pData , size_t nSize);\n ///@}\n\n\n /// \\name Smoothing\n /// Smoothing API functions calls\n /// @{\n\n /*! \n * \\brief Returns the weighted moving (rolling/running) average using the previous m data points.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SESMTH(), NDK_EWMA(), NDK_DESMTH(), NDK_TESMTH, NDK_LESMTH()\n */\n int __stdcall NDK_WMA(double *pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n BOOL bAscending, ///< [in] is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). \n double* weights, ///< [in] is the size of the equal-weighted window or an array of multiplying factors (i.e. weights) of the moving/rolling window. \n size_t nwSize, ///< [in] is the number of elements in the weights array.\n int nHorizon, ///< [in] is the forecast time/horizon beyond the end of X. If missing, a default value of 0 (Latest or end of X) is assumed.\n double* retVal ///< [out] is the calculated value of the weighted moving average.\n );\n\n\n /*! \n * \\brief Returns the (Brown's) simple exponential (EMA) smoothing estimate of the value of X at time t+m (based on the raw data up to time t).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_WMA(), NDK_EWMA(), NDK_DESMTH(), NDK_TESMTH, NDK_LESMTH()\n */\n int __stdcall NDK_SESMTH(double *pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n BOOL bAscending, ///< [in] is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).\n double* alpha, ///< [inout] is the smoothing factor (alpha should be between zero and one (exclusive)). If missing or omitted, a value of 0.333 is used.\n int nHorizon, ///< [in] is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.\n BOOL bOptimize, ///< [in] is a flag (True/False) for searching and using the optimal value of the smoothing factor. If missing or omitted, optimize is assumed false.\n double* internals, ///< [out,opt] is an array of the intermediate forecast calculation.\n size_t nInternalsSize, ///< [inout,opt] size of the output buffer, and number or values to return.\n double* retVal ///< [out] is the calculated value of this function.\n );\n\n /*! \n * \\brief Returns the (Holt-Winter's) double exponential smoothing estimate of the value of X at time T+m.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_WMA(), NDK_EWMA(), NDK_SESMTH(), NDK_TESMTH, NDK_LESMTH()\n */\n int __stdcall NDK_DESMTH(double *pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n BOOL bAscending, ///< [in] is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).\n double *alpha, ///< [in] is the data smoothing factor (alpha should be between zero and one (exclusive)).\n double *beta, ///< [in] is the trend smoothing factor (beta should be between zero and one (exclusive)).\n int xlHorizon, ///< [in] is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.\n BOOL bOptimize, ///< [in] is a flag (True/False) for searching and using the optimal value of the smoothing factor. If missing or omitted, optimize is assumed false. \n double* internals, ///< [out,opt] is an array of the intermediate forecast calculation.\n size_t nInternalsSize, ///< [in,opt] size of the output buffer, and number or values to return.\n WORD wInternalSeries, ///< [in, opt] a switch to select the series to return in internals ( 0 = Smoothing forecast, 1=level, 2=trend)\n double* retVal ///< [out] is the calculated value of this function.\n );\n\n /*! \n * \\brief Returns the (Brown's) linear exponential smoothing estimate of the value of X at time T+m (based on the raw data up to time t).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_WMA(), NDK_EWMA(), NDK_SESMTH(), NDK_TESMTH, NDK_DESMTH()\n */\n int __stdcall NDK_LESMTH( double *pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n BOOL bAscending, ///< [in] is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).\n double *alpha, ///< [in] is the smoothing factor (alpha should be between zero and one (exclusive)). If missing or omitted, a value of 0.333 is used.\n int xlHorizon, ///< [in] is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.\n BOOL bOptimize, ///< [in] is a flag (True/False) for searching and using the optimal value of the smoothing factor. If missing or omitted, optimize is assumed false. \n double* internals, ///< [out,opt] is an array of the intermediate forecast calculation.\n size_t nInternalsSize, ///< [in,opt] size of the output buffer, and number or values to return.\n WORD wInternalSeries, ///< [in, opt] a switch to select the series to return in internals ( 0 = Smoothing forecast, 1=level, 2=trend)\n double* retVal ///< [out] is the calculated value of this function.\n );\n\n /*! \n * \\brief Returns the (Winters's) triple exponential smoothing estimate of the value of X at time T+m.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_WMA(), NDK_EWMA(), NDK_SESMTH(), NDK_LESMTH, NDK_DESMTH()\n */\n int __stdcall NDK_TESMTH(double *pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n BOOL bAscending, ///< [in] is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).\n double *alpha, ///< [in] is the data smoothing factor (alpha should be between zero and one (exclusive)).\n double *beta, ///< [in] is the trend smoothing factor (beta should be between zero and one (exclusive)).\n double *gamma, ///< [in] is the seasonal change smoothing factor (Gamma should be between zero and one (exclusive)).\n int L, ///< [in] is the season length.\n int nHorizon, ///< [in] is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.\n BOOL bOptimize, ///< [in] is a flag (True/False) for searching and using optimal value of the smoothing factor. If missing or omitted, optimize is assumed false. \n double* internals, ///< [out,opt] is an array of the intermediate forecast calculation.\n size_t nInternalsSize, ///< [in,opt] size of the output buffer, and number or values to return.\n WORD wInternalSeries, ///< [in, opt] a switch to select the series to return in internals ( 0 = Smoothing forecast, 1=level, 2=trend)\n double* retVal ///< [out] is the calculated value of this function.\n );\n\n\n /*!\n * \\brief Returns the (Winters's) triple exponential smoothing estimate of the value of X at time T+m.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_WMA(), NDK_EWMA(), NDK_SESMTH(), NDK_LESMTH, NDK_DESMTH()\n */\n int __stdcall NDK_GESMTH(double *pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n BOOL bAscending, ///< [in] is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).\n double *alpha, ///< [in] is the data smoothing factor (alpha should be between zero and one (exclusive)).\n double *beta, ///< [in] is the trend smoothing factor (beta should be between zero and one (exclusive)).\n double *gamma, ///< [in] is the seasonal change smoothing factor (Gamma should be between zero and one (exclusive)).\n double *phi, ///< [in] is the damping coefficient for the trend.\n double *lambda, ///< [in] is the coefficient value for the autocorrelation adjustment\n WORD TrendType, ///< [in] is the type of trend in the model (0=none, 1=additive, 2- damped additive, 3=multiplicative, 4=damped multiplicative)\n WORD SeasonalityType, ///< [in] is the type of seasonality in the modem (0=none, 1=additive, 2=multiplicative)\n int seasonLength, ///< [in] is the season length.\n int nHorizon, ///< [in] is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.\n BOOL bOptimize, ///< [in] is a flag (True/False) for searching and using optimal value of the smoothing factor. If missing or omitted, optimize is assumed false. \n BOOL bAutoCorrelationAdj, ///< [in] is a flag (True/False) for adding a correction term for the 1st ourder autocorrelation in the\n BOOL bLogTransform, ///< [in] is a flag (True/False) for applying natural log transform to the input data prior to smoothing.\n double* internals, ///< [out,opt] is an array of the intermediate forecast calculation.\n size_t nInternalsSize, ///< [in,opt] size of the output buffer, and number or values to return.\n WORD wInternalSeries, ///< [in, opt] a switch to select the series to return in internals ( 0 = one-step forecasting, 1=level, 2=trend, 3=seasonality)\n double* retVal ///< [out] is the calculated value of this function.\n );\n\n /*! \n * \\brief Returns values along a trend curve (e.g. linear, quadratic, exponential, etc.) at time T+m.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_WMA(), NDK_EWMA(), NDK_SESMTH(), NDK_LESMTH, NDK_DESMTH(), NDK_TESMTH\n */\n int __stdcall NDK_TREND(double *pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of elements in pData.\n BOOL bAscending, ///< [in] is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)).\n WORD nTrendType, ///< [in] is the model description flag for the trend function:\n /// 1. Linear\n /// 2. Polynomial\n /// 3. Exponential\n /// 4. Logarithmic\n /// 5. Power\n\n WORD argPolyOrder, ///< [in] is the polynomial order. This is only relevant for a polynomial trend type and is ignored for all others. If missing, POrder = 1. \n BOOL AllowIntercep, ///< [in] is a switch to include or exclude an intercept in the regression.\n double InterceptVal, ///< [in] is the constant or the intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.\n int nHorizon, ///< [in] is the forecast time horizon beyond the end of X. If missing, a default value of 0 (latest or end of X) is assumed.\n WORD retType, ///< [in] is a switch to select the return output: \n /// 1. Forecast value\n /// 2. Upper limit of the confidence interval\n /// 3. Lower limit of the confidence interval\n /// 4. R-Squared\n double argAlpha, ///< [in] is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.\n double* retVal ///< [out] is the calculated value of this function.\n );\n ///@}\n\n\n\n\n /// \\name Multiple Linear Regression (MLR)\n /// @{\n int __stdcall\tNDK_SLR_PARAM (double* pXData, size_t nXSize, \n double* pYData, size_t nYSize,\n double intercept,\n double alpha,\n WORD nRetType,\n WORD ParamIndex,\n double* retVal);\n int __stdcall\tNDK_SLR_FORE (double* pXData, size_t nXSize, \n double* pYData, size_t nYSize,\n double intercept,\n double target,\n double alpha,\n WORD nRetType,\n double* retVal);\n int __stdcall\tNDK_SLR_FITTED (double* pXData, size_t nXSize, \n double* pYData, size_t nYSize,\n double intercept,\n WORD nRetType);\n int __stdcall\tNDK_SLR_ANOVA ( double* pXData, size_t nXSize, \n double* pYData, size_t nYSize,\n double intercept,\n WORD nRetType,\n double* retVal);\n int __stdcall\tNDK_SLR_GOF ( double* pXData, size_t nXSize, \n double* pYData, size_t nYSize,\n double intercept,\n WORD nRetType,\n double* retVal);\n \n /*! \n * \\brief Calculates the OLS regression coefficients values.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_MLR_FORE(), NDK_MLR_FITTED(), NDK_MLR_ANOVA(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE\n */\n int __stdcall\tNDK_MLR_PARAM (double** X, ///< [in] is the independent (explanatory) variables data matrix, such that each column represents one variable.\n size_t nXSize, ///< [in] is the number of observations (rows) in X.\n size_t nXVars, ///< [in] is the number of independent (explanatory) variables (columns) in X.\n LPBYTE mask, ///< [in] is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.\n size_t nMaskLen, ///< [in] is the number of elements in the \"mask.\"\n double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array of cells).\n size_t nYSize, ///< [in] is the number of observations in Y.\n double intercept, ///< [in] is the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.\n double alpha, ///< [in] is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.\n WORD nRetType, ///< [in] is a switch to select the return output (1=value (default), 2=std. error, 3=t-stat, 4=P-value, 5=upper limit (CI), 6=lower limit (CI)):\n /// 1. Value (mean)\n /// 2. Std error\n /// 3. Test score\n /// 4. P-value\n /// 5. Upper limit of the confidence interval\n /// 6. Lower limit of the confidence interval\n WORD nParamIndex, ///< [in] is a switch to designate the target parameter (0=intercept (default), 1=first variable, 2=2nd variable, etc.).\n double* retVal ///< [out] is the computed statistics of the regression coefficient.\n );\n\n /*! \n * \\brief Calculates the forecast mean, error and confidence interval. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_MLR_PARAM(), NDK_MLR_FITTED(), NDK_MLR_ANOVA(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE\n */\n int __stdcall\tNDK_MLR_FORE (double** X, ///< [in] is the independent (explanatory) variables data matrix, such that each column represents one variable.\n size_t nXSize, ///< [in] is the number of observations (rows) in X.\n size_t nXVars, ///< [in] is the number of independent (explanatory) variables (columns) in X.\n LPBYTE mask, ///< [in] is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.\n size_t nMaskLen, ///< [in] is the number of elements in the \"mask.\"\n double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array of cells).\n size_t nYSize, ///< [in] is the number of observations in Y.\n double intercept, ///< [in] is the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.\n double* target, ///< [in] is the value of the explanatory variables (a one dimensional array).\n double alpha, ///< [in] is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.\n WORD nRetType, ///< [in] is a switch to select the return output (1=forecast (default), 2=error, 3=upper limit, 4=lower limit):\n /// 1. Forecast (mean)\n /// 2. Std error\n /// 3. Upper limit of the confidence interval\n /// 4. Lower limit of the conficence interval\n double* retVal ///< [out] is the computed forecast statistics.\n\n );\n\n /*! \n * \\brief Returns the fitted values of the conditional mean, residuals or leverage measures.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_MLR_FORE(), NDK_MLR_PARAM(), NDK_MLR_ANOVA(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE\n */\n int __stdcall\tNDK_MLR_FITTED (double** X, ///< [in] is the independent (explanatory) variables data matrix, such that each column represents one variable.\n size_t nXSize, ///< [in] is the number of observations (rows) in X.\n size_t nXVars, ///< [in] is the number of independent (explanatory) variables (columns) in X.\n LPBYTE mask, ///< [in] is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.\n size_t nMaskLen, ///< [in] is the number of elements in the \"mask.\"\n double* Y, ///< [in] is the response or dependent variable data array (one dimensional array of cells).\n size_t nYSize, ///< [in] is the number of observations in Y.\n double intercept, ///< [in] is the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.\n WORD nRetType ///< [in] is a switch to select the return output (1=fitted values (default), 2=residuals, 3=standardized residuals, 4=leverage, 5=Cook's distance).\n /// 1. Fitted/conditional mean\n /// 2. Residuals\n /// 3. Standardized residuals\n /// 4. Leverage factor (H)\n /// 5. Cook's distance (D)\n );\n\n /*! \n * \\brief Calculates the regression model analysis of the variance (ANOVA) values. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_MLR_FORE(), NDK_MLR_PARAM(), NDK_MLR_FITTED(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE\n */\n int __stdcall\tNDK_MLR_ANOVA (double** pXData, ///< [in] is the independent (explanatory) variables data matrix, such that each column represents one variable.\n size_t nXSize, ///< [in] is the number of observations (rows) in X\n size_t nXVars, ///< [in] is the number of independent (explanatory) variables (columns) in X.\n LPBYTE mask, ///< [in] is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.\n size_t nMaskLen, ///< [in] is the number of elements in the \"mask.\"\n double* Y, ///< [in] is the response or dependent variable data array (one dimensional array of cells).\n size_t nYSize, ///< [in] is the number of observations in Y.\n double intercept, ///< [in] is the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.\n WORD nRetType, ///< [in] is a switch to select the output (1=SSR (default), 2=SSE, 3=SST, 4=MSR, 5=MSE, 6=F-stat, 7=P-value):\n /// 1. SSR (sum of squares of the regression)\n /// 2. SSE (sum of squares of the residuals)\n /// 3. SST (sum of squares of the dependent variable)\n /// 4. MSR (mean squares of the regression)\n /// 5. MSE (mean squares error or residuals)\n /// 6. F-stat (test score)\n /// 7. Significance F (P-value of the test)\n double* retVal ///< [out] is the calculated statistics ANOVA output.\n );\n\n /*! \n * \\brief Calculates a measure for the goodness of fit (e.g. R^2). \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_MLR_FORE(), NDK_MLR_PARAM(), NDK_MLR_FITTED(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE\n */\n int __stdcall\tNDK_MLR_GOF ( double** X, ///< [in] is the independent (explanatory) variables data matrix, such that each column represents one variable.\n size_t nXSize, ///< [in] is the number of observations (rows) in X.\n size_t nXVars, ///< [in] is the number of independent (explanatory) variables (columns) in X.\n LPBYTE mask, ///< [in] is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.\n size_t nMaskLen, ///< [in] is the number of elements in the \"mask.\"\n double* Y, ///< [in] is the response or dependent variable data array (one dimensional array of cells).\n size_t nYSize, ///< [in] is the number of observations in Y.\n double intercept, ///< [in] is the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.\n WORD nRetType, ///< [in] is a switch to select a fitness measure (1=R-square (default), 2=adjusted R-square, 3=RMSE, 4=LLF, 5=AIC, 6=BIC/SIC):\n /// 1. R-square (coefficient of determination)\n /// 2. Adjusted R-square\n /// 3. Regression Error (RMSE)\n /// 4. Log-likelihood (LLF)\n /// 5. Akaike information criterion (AIC)\n /// 6. Schwartz/Bayesian information criterion (SIC/BIC)\n double* retVal ///< [out] is the calculated goodness-of-fit statistics.\n );\n /*! \n * \\brief Calculates the p-value and related statistics of the partial f-test (used for testing the inclusion/exclusion variables).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_MLR_FORE(), NDK_MLR_PARAM(), NDK_MLR_ANOVA(), NDK_MLR_GOF, NDK_MLR_FITTED, NDK_MLR_STEPWISE\n */\n int __stdcall\tNDK_MLR_PRFTest ( double** X, ///< [in] is the independent (explanatory) variables data matrix, such that each column represents one variable.\n size_t nXSize, ///< [in] is the number of observations (rows) in X.\n size_t nXVars, ///< [in] is the number of independent (explanatory) variables (columns) in X.\n double* Y, ///< [in] is the response or dependent variable data array (one dimensional array of cells).\n size_t nYSize, ///< [in] is the number of observations in Y.\n double intercept, ///< [in] is the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.\n LPBYTE mask1, ///< [in] is the boolean array to choose the explanatory variables in model 1. If missing, all variables in X are included.\n size_t nMaskLen1, ///< [in] is the number of elements in \"mask1.\"\n LPBYTE mask2, ///< [in] is the boolean array to choose the explanatory variables in model 2. If missing, all variables in X are included.\n size_t nMaskLen2, ///< [in] is the number of elements in \"mask2.\"\n double alpha, ///< [in] is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.\n WORD nRetType, ///< [in] is a switch to select the return output (1 = P-Value (default), 2 = Test Stats, 3 = Critical Value.) \n double* retVal ///< [out] is the calculated test statistics/\n );\n\n /*! \n * \\brief Returns a list of the selected variables after performing the stepwise regression.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_MLR_FORE(), NDK_MLR_PARAM(), NDK_MLR_ANOVA(), NDK_MLR_GOF, NDK_MLR_PRFTest, NDK_MLR_STEPWISE\n */\n int __stdcall\tNDK_MLR_STEPWISE (double** X, ///< [in] is the independent (explanatory) variables data matrix, such that each column represents one variable.\n size_t nXSize, ///< [in] is the number of observations (rows) in X.\n size_t nXVars, ///< [in] is the number of independent (explanatory) variables (columns) in X.\n LPBYTE mask, ///< [inout] is the boolean array to choose the explanatory variables in the model. If missing, all variables in X are included.\n size_t nMaskLen, ///< [in] is the number of elements in the \"mask.\"\n double* Y, ///< [in] is the response or dependent variable data array (one dimensional array of cells).\n size_t nYSize, ///< [in] is the number of observations in Y.\n double intercept, ///< [in] is the constant or intercept value to fix (e.g. zero). If missing (i.e. NaN), an intercept will not be fixed and is computed normally.\n double alpha, ///< [in] is the statistical significance of the test (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed.\n WORD nMode ///< [in] is a switch to select the variable's inclusion/exclusion approach (1=forward selection (default), 2=backward elimination , 3=bi-directional elimination):\n /// 1. Forward selection\n /// 2. Bacward elemination\n /// 3. Bi-directional elemination\n );\n ///@}\n\n\n /// \\name Principal Component Analysis (PCA) \n /// @{\n /*! \n * \\brief Returns an array of cells for the i-th principal component (or residuals).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()\n */\n int __stdcall\tNDK_PCA_COMP (double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nXSize, ///< [in] is the number of observations (i.e. rows) in X\n size_t nXVars, ///< [in] is the number of variables (i.e. columns) in X\n LPBYTE mask, ///< [in] is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. \n size_t nMaskLen, ///< [in] is the number of elements in \n WORD standardize, ///< [in] is a flag or switch to standardize the input variables prior to the analysis:\n /// 1. standardize ((subtract mean and divide by standard deviation)\n /// 2. subtract mean. \n WORD nCompIndex, ///< [in] is the component number to return.\n WORD retType, ///< [in] is a switch to select the return output \n /// 1. proportion of variance, \n /// 2. variance, \n /// 3. eigenvalue, \n /// 4. loadings, \n /// 5. Principal Component (PC) data. \n double* retVal, ///< [out] is the calculated value or data\n size_t nOutSize ///< [in] is the size of retVal\n );\n\n /*! \n * \\brief Returns an array of cells for the fitted values of the i-th input variable.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()\n */\n int __stdcall\tNDK_PCA_VAR ( double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nXSize, ///< [in] is the number of observations (i.e. rows) in X\n size_t nXVars, ///< [in] is the number of variables (i.e. columns) in X\n LPBYTE varMask, ///< [in] is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. \n size_t nMaskLen, ///< [in] is the number of elements in mask\n WORD standardize, ///< [in] is a flag or switch to standardize the input variables prior to the analysis:\n /// 1. standardize ((subtract mean and divide by standard deviation)\n /// 2. subtract mean. \n WORD nVarIndex, ///< [in] is the input variable number\n WORD wMacPC, ///< [in] is the number of principal components (PC) to include\n WORD retType, ///< [in] is a switch to select the return output:\n /// 1. final communality \n /// 2. loading/weights\n /// 3. fitted values \n /// 4. residuals\n double* retVal, ///< [out] is the calculated value or data\n size_t nOutSize ///< [in] is the size of retVal\n );\n /*! \n * \\brief Calculates the regression coefficients values for a given input variable.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()\n */\n int __stdcall\tNDK_PCR_PARAM ( double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nXSize, ///< [in] is the number of observations (i.e. rows) in X\n size_t nXVars, ///< [in] is the number of variables (i.e. columns) in X\n LPBYTE mask, ///< [in] is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. \n size_t nMaskLen, ///< [in] is the number of elements in mask\n double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array)\n size_t nYSize, ///< [in] is the number of elements in Y\n double intercept, ///< [in] is the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally\n double alpha, ///< [in] is the statistical significance of the test (i.e. alpha)\n WORD nRetType, ///< [in] is a switch to select the return output:\n /// 1. Value (default), \n /// 2. Std. Error \n /// 3. t-stat \n /// 4. P-Value\n /// 5. Upper Limit (CI)\n /// 6. Lower Limit (CI)) \n WORD nParamIndex, ///< [in] is a switch to designate the target parameter (0 = intercept (default), 1 = first variable, 2 = 2nd variable, etc.). \n double* retVal ///< [out] is the calculated parameter value or statistics.\n );\n\n /*! \n * \\brief Calculates the model's estimated values, std. errors and related statistics.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()\n */\n int __stdcall\tNDK_PCR_FORE (double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nXSize, ///< [in] is the number of observations (i.e. rows) in X\n size_t nXVars, ///< [in] is the number of variables (i.e. columns) in X\n LPBYTE mask, ///< [in] is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. \n size_t nMaskLen, ///< [in] is the number of elements in mask\n double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array)\n size_t nYSize, ///< [in] is the number of elements in Y \n double intercept, ///< [in] is the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally\n double* target, ///< [in] is the value of the explanatory variables (a one dimensional array) \n double alpha, ///< [in] is the statistical significance of the test (i.e. alpha)\n WORD nRetType, ///< [in] is a switch to select the return output (1 = forecast (default), 2 = error, 3 = upper limit, 4 = lower limit). \n double* retVal ///< [out] is the calculated forecast value or statistics. \n );\n\n /*! \n * \\brief Returns an array of cells for the i-th principal component (or residuals).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()\n */\n int __stdcall\tNDK_PCR_FITTED (double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nXSize, ///< [in] is the number of observations (i.e. rows) in X\n size_t nXVars, ///< [in] is the number of variables (i.e. columns) in X\n LPBYTE mask, ///< [in] is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. \n size_t nMaskLen, ///< [in] is the number of elements in mask\n double* Y, ///< [inout] is the response or the dependent variable data array (one dimensional array)\n size_t nYSize, ///< [in] is the number of elements in Y \n double intercept, ///< [in] is the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally\n WORD nRetType ///< [in] is a switch to select the return output \n /// 1. fitted values (default), \n /// 2. residuals, \n /// 3. standardized residuals, \n /// 4. leverage (H), \n /// 5. Cook's distance. \n );\n\n /*! \n * \\brief Returns an array of cells for the i-th principal component (or residuals).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()\n */\n int __stdcall\tNDK_PCR_ANOVA ( double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nXSize, ///< [in] is the number of observations (i.e. rows) in X\n size_t nXVars, ///< [in] is the number of variables (i.e. columns) in X\n LPBYTE mask, ///< [in] is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. \n size_t nMaskLen, ///< [in] is the number of elements in mask\n double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array)\n size_t nYSize, ///< [in] is the number of elements in Y \n double intercept, ///< [in] is the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally\n WORD nRetType, ///< [in] is a switch to select the return output:\n /// 1. SSR (sum of squares of the regression)\n /// 2. SSE (sum of squares of the residuals)\n /// 3. SST (sum of squares of the dependent variable)\n /// 4. MSR (mean squares of the regression)\n /// 5. MSE (mean squares error or residuals)\n /// 6. F-stat (test score)\n /// 7. Significance F (P-value of the test)\n double* retVal ///< [out] is the calculated statistics ANOVA output.\n );\n\n /*! \n * \\brief Returns an array of cells for the i-th principal component (or residuals).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()\n */\n int __stdcall\tNDK_PCR_GOF ( double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nXSize, ///< [in] is the number of observations (i.e. rows) in X\n size_t nXVars, ///< [in] is the number of variables (i.e. columns) in X\n LPBYTE mask, ///< [in] is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. \n size_t nMaskLen, ///< [in] is the number of elements in mask\n double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array)\n size_t nYSize, ///< [in] is the number of elements in Y \n double intercept, ///< [in] is the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally\n WORD nRetType, ///< [in] is a switch to select a fitness measure (1 = R-Square (default), 2 = Adjusted R Square, 3 = RMSE, 4 = LLF, 5 = AIC, 6 = BIC/SIC ). \n /// 1. R-square (coefficient of determination)\n /// 2. Adjusted R-square\n /// 3. Regression Error (RMSE)\n /// 4. Log-likelihood (LLF)\n /// 5. Akaike information criterion (AIC)\n /// 6. Schwartz/Bayesian information criterion (SIC/BIC)\n double* retVal ///< [out] is the calculated goodness of fit measure\n );\n /*! \n * \\brief Returns an array of cells for the i-th principal component (or residuals).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()\n */\n int __stdcall\tNDK_PCR_PRFTest ( double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nXSize, ///< [in] is the number of observations (i.e. rows) in X\n size_t nXVars, ///< [in] is the number of variables (i.e. columns) in X\n double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array)\n size_t nYSize, ///< [in] is the number of elements in Y \n double intercept, ///< [in] is the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally\n LPBYTE mask1, ///< [in] is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. \n size_t nMaskLen1, ///< [in] is the number of elements in mask1\n LPBYTE mask2, ///< [in] is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. \n size_t nMaskLen2, ///< [in] is the number of elements in mask2\n double alpha, ///< [in] is the statistical significance of the test (i.e. alpha)\n WORD nRetType, ///< [in] is a switch to select the return output (1 = P-Value (default), 2 = Test Stats, 3 = Critical Value.) \n double* retVal ///< [out] is the calculated test statistics/\n );\n\n /*! \n * \\brief Returns an array of cells for the i-th principal component (or residuals).\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_PCA_VAR(), NDK_PCR_PARAM(), NDK_PCR_FORE(), NDK_PCR_FITTED(), NDK_PCR_ANOVA(), NDK_PCR_GOF(), NDK_PCR_PRFTest(), NDK_PCR_STEPWISE()\n */\n int __stdcall\tNDK_PCR_STEPWISE (double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nXSize, ///< [in] is the number of observations (i.e. rows) in X\n size_t nXVars, ///< [in] is the number of variables (i.e. columns) in X\n LPBYTE mask, ///< [in] is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. \n size_t nMaskLen, ///< [in] is the number of elements in mask\n double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array)\n size_t nYSize, ///< [in] is the number of elements in Y \n double intercept, ///< [in] is the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally\n double alpha, ///< [in] is the statistical significance of the test (i.e. alpha)\n WORD nMode ///< [in] is a switch to select the variable's inclusion/exclusion approach (1=forward selection (default), 2=backward elimination , 3=bi-directional elimination):\n /// 1. Forward selection\n /// 2. Bacward elemination\n /// 3. Bi-directional elemination\n );\n ///@}\n\n\n\n\n\n /// \\name GLM\n /// Gneralized Linear Model Functions\n /// @{\n \n\n /*! \n * \\brief Examines the model's parameters for constraints (e.g. positive variance, etc.).\n * \\details\n * \\htmlonly\n <h4>Notes</h4>\n <ol>\n <li>The number of betas must be equal to the number of explanatory variables (i.e. X) plus one (intercept). </li>\n <li>\n For GLM with Poisson distribution:\n <ul>\n <li>The values of the response variables must be non-negative integers.</li>\n <li>The value of the dispersion factor (Phi) value must be either missing or equal to one.</li>\n </ul>\n </li>\n <li>\n For GLM with Binomial distribution,\n <ul>\n <li>The values of the response variable must be non-negative fractions between zero and one, inclusive.</li>\n <li>The value of the dispersion factor (Phi) must be a positive fraction (greater than zero, and less than one).</li>\n </ul>\n </li>\n <li>For GLM with Guassian distribution, the dispersion factor (Phi) value must be positive.</li>\n </ol>\n * \\endhtmlonly\n * \\return status code of the operation\n * \\retval #NDK_TRUE GLM model is valid\n * \\retval #NDK_FALSE GLM model in invalid. For other return values, see \\ref SFMacros.h\n * \\sa NDK_GLM_FITTED(), NDK_GLM_RESID(), NDK_GLM_PARAM(), NDK_GLM_FORE\n */\n int __stdcall NDK_GLM_VALIDATE(double* betas, ///< [in] are the coefficients of the GLM model (a one dimensional array)\n size_t nBetas, ///< [in] is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1\n double phi, ///< [in] is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance). \n /// - Binomial : phi = Reciprocal of the batch/trial size.\n /// - Gaussion : phi = variance.\n /// - Poisson : phi = 1.0\n WORD Lvk ///< [in] is the link function that describes how the mean depends on the linear predictor (see #GLM_LINK_FUNC). \n /// 1. Identity (default)\n /// 2. Log\n /// 3. Logit\n /// 4. Probit\n /// 5. Complementary log-log\n );\n\n\n\n /*! \n * \\brief Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit function of the GLM model. \n * \n \\htmlonly\n <h4>Notes</h4>\n <ol>\n <li>Missng values (i.e. #N/A!) are not allowed in the either response(Y) or the explanatory input arrays.</li>\n <li>The number of rows in response variable (Y) must be equal to number of rows of the explanatory variables (X).</li>\n <li>The number of betas must equal to the number of explanatory variables (i.e. X) plus one (intercept). </li>\n <li>\n For GLM with Poisson distribution,\n <ul>\n <li>The values of response variable must be non-negative integers.</li>\n <li>The value of the dispersion factor (Phi) value must be either missing or equal to one.</li>\n </ul>\n </li>\n <li>\n For GLM with Binomial distribution,\n <ul>\n <li>The values of the response variable must be non-negative fractions between zero and one, inclusive.</li>\n <li>The value of the dispersion factor (Phi) must be a positive fraction (greater than zero, and less than one).</li>\n </ul>\n </li>\n <li>For GLM with Guassian distribution, the dispersion factor (Phi) value must be positive.</li>\n </ol>\n \\endhtmlonly\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GLM_FITTED(), NDK_GLM_RESID(), NDK_GLM_PARAM(), NDK_GLM_FORE\n */\n int __stdcall NDK_GLM_GOF( double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array)\n size_t nSize, ///< [in] is the number of observations \n double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nVars, ///< [in] is the number of independent variables (or columns in X)\n double* betas, ///< [in] are the coefficients of the GLM model (a one dimensional array)\n size_t nBetas, ///< [in] is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1\n double phi, ///< [in] is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance). \n /// - Binomial : phi = Reciprocal of the batch/trial size.\n /// - Gaussion : phi = variance.\n /// - Poisson : phi = 1.0\n WORD Lvk, ///< [in] is the link function that describes how the mean depends on the linear predictor (see #GLM_LINK_FUNC). \n /// 1. Identity (default)\n /// 2. Log\n /// 3. Logit\n /// 4. Probit\n /// 5. Complementary log-log\n WORD retType, ///< [in] is a switch to select a fitness measure ( see \\ref #GOODNESS_OF_FIT_FUNC)\n double* retVal ///< [out] is the calculated goodness of fit measure.\n );\n\n /*! \n * \\brief Returns the standardized residuals/errors of a given GLM. \n * \n \\htmlonly\n <h4>Notes</h4>\n <ol>\n <li>Missng values (i.e. #N/A!) are not allowed in the either response(Y) or the explanatory input arrays.</li>\n <li>The number of rows in response variable (Y) must be equal to number of rows of the explanatory variables (X).</li>\n <li>The number of betas must equal to the number of explanatory variables (i.e. X) plus one (intercept). </li>\n <li>\n For GLM with Poisson distribution,\n <ul>\n <li>The values of response variable must be non-negative integers.</li>\n <li>The value of the dispersion factor (Phi) value must be either missing or equal to one.</li>\n </ul>\n </li>\n <li>\n For GLM with Binomial distribution,\n <ul>\n <li>The values of the response variable must be non-negative fractions between zero and one, inclusive.</li>\n <li>The value of the dispersion factor (Phi) must be a positive fraction (greater than zero, and less than one).</li>\n </ul>\n </li>\n <li>For GLM with Guassian distribution, the dispersion factor (Phi) value must be positive.</li>\n </ol>\n \\endhtmlonly\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GLM_FITTED(), NDK_GLM_RESID(), NDK_GLM_PARAM(), NDK_GLM_FORE\n */\n int __stdcall NDK_GLM_RESID( double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array)\n size_t nSize, ///< [in] is the number of observations \n double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nVars, ///< [in] is the number of independent variables (or columns in X)\n double* betas, ///< [in] are the coefficients of the GLM model (a one dimensional array)\n size_t nBetas, ///< [in] is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1\n double phi, ///< [in] is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance). \n /// - Binomial : phi = Reciprocal of the batch/trial size.\n /// - Gaussion : phi = variance.\n /// - Poisson : phi = 1.0\n WORD Lvk, ///< [in] is the link function that describes how the mean depends on the linear predictor (see #GLM_LINK_FUNC). \n /// 1. Identity (default)\n /// 2. Log\n /// 3. Logit\n /// 4. Probit\n /// 5. Complementary log-log\n WORD retType ///< [in] is a switch to select a residuals-type:raw or standardized. see \\ref #RESID_RETVAL_FUNC\n );\n\n /*! \n * \\brief Returns an array of cells for the initial (non-optimal), optimal or standard errors of the model's parameters \n * \n \\htmlonly\n <h4>Notes</h4>\n <ol>\n <li>Missng values (i.e. #N/A!) are not allowed in the either response(Y) or the explanatory input arrays.</li>\n <li>The number of rows in response variable (Y) must be equal to number of rows of the explanatory variables (X).</li>\n <li>The number of betas must equal to the number of explanatory variables (i.e. X) plus one (intercept). </li>\n <li>\n For GLM with Poisson distribution,\n <ul>\n <li>The values of response variable must be non-negative integers.</li>\n <li>The value of the dispersion factor (Phi) value must be either missing or equal to one.</li>\n </ul>\n </li>\n <li>\n For GLM with Binomial distribution,\n <ul>\n <li>The values of the response variable must be non-negative fractions between zero and one, inclusive.</li>\n <li>The value of the dispersion factor (Phi) must be a positive fraction (greater than zero, and less than one).</li>\n </ul>\n </li>\n <li>For GLM with Guassian distribution, the dispersion factor (Phi) value must be positive.</li>\n </ol>\n \\endhtmlonly\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GLM_FITTED(), NDK_GLM_RESID(), NDK_GLM_GOF(), NDK_GLM_FORE\n */\n int __stdcall NDK_GLM_PARAM( double* Y, ///< [in] is the response or the dependent variable data array (one dimensional array)\n size_t nSize, ///< [in] is the number of observations \n double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nVars, ///< [in] is the number of independent variables (or columns in X)\n double* betas, ///< [inout] are the coefficients of the GLM model (a one dimensional array)\n size_t nBetas, ///< [in] is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1\n double* phi, ///< [inout] is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance). \n /// - Binomial : phi = Reciprocal of the batch/trial size.\n /// - Gaussion : phi = variance.\n /// - Poisson : phi = 1.0\n WORD Lvk, ///< [in] is the link function that describes how the mean depends on the linear predictor (see #GLM_LINK_FUNC). \n /// 1. Identity (default)\n /// 2. Log\n /// 3. Logit\n /// 4. Probit\n /// 5. Complementary log-log\n WORD retType, ///< [in] is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see \\ref #MODEL_RETVAL_FUNC)\n size_t maxIter ///< [in] is the maximum number of iterations used to calibrate the model. If missing, the default maximum of 100 is assumed. \n );\n \n\n /*! \n * \\brief calculates the expected response (i.e. mean) value; given the GLM model and the values of the explanatory variables. \n *\n * \\htmlonly\n <h4>Notes</h4>\n <ol>\n <li>Missng values (i.e. #N/A!) are not allowed in the either response(Y) or the explanatory input arrays.</li>\n <li>The number of rows in response variable (Y) must be equal to number of rows of the explanatory variables (X).</li>\n <li>The number of betas must equal to the number of explanatory variables (i.e. X) plus one (intercept).</li>\n <li>For GLM with Poisson distribution,\n <ul>\n <li>The values of response variable must be non-negative integers.</li>\n <li>The value of the dispersion factor (Phi) value must be either missing or equal to one.</li>\n </ul>\n </li>\n <li>For GLM with Binomial distribution,\n <ul>\n <li>The values of the response variable must be non-negative fractions between zero and one, inclusive.</li>\n <li>The value of the dispersion factor (Phi) must be a positive fraction (greater than zero, and less than one).</li>\n </ul>\n </li>\n <li>For GLM with Guassian distribution, the dispersion factor (Phi) value must be positive.</li>\n </ol>\n \\endhtmlonly\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GLM_FITTED(), NDK_GLM_RESID(), NDK_GLM_GOF(), NDK_GLM_FORE\n */\n int __stdcall NDK_GLM_FORE( double* X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nVars, ///< [in] is the number of independent variables (or columns in X)\n double* betas, ///< [inout] are the coefficients of the GLM model (a one dimensional array)\n size_t nBetas, ///< [in] is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1\n double phi, ///< [inout] is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance). \n /// - Binomial : phi = Reciprocal of the batch/trial size.\n /// - Gaussion : phi = variance.\n /// - Poisson : phi = 1.0\n WORD Lvk, ///< [in] is the link function that describes how the mean depends on the linear predictor (see #GLM_LINK_FUNC). \n /// 1. Identity (default)\n /// 2. Log\n /// 3. Logit\n /// 4. Probit\n /// 5. Complementary log-log\n WORD retType, ///< [in] is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see \\ref # FORECAST_RETVAL_FUNC)\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n double* retval ///< [out] is the calculated forecast value\n );\n\n\n int __stdcall NDK_GLM_FITTED( double* Y, ///< [inout] is the response or the dependent variable data array (one dimensional array)\n size_t nSize, ///< [in] is the number of observations \n double** X, ///< [in] is the independent variables data matrix, such that each column represents one variable\n size_t nVars, ///< [in] is the number of independent variables (or columns in X)\n double* betas, ///< [in] are the coefficients of the GLM model (a one dimensional array)\n size_t nBetas, ///< [in] is the number of the coefficients in betas. Note that nBetas must be equal to nVars+1\n double phi, ///< [in] is the GLM dispersion paramter. Phi is only meaningful for Binomial (1/batch or trial size) and for Guassian (variance). \n /// - Binomial : phi = Reciprocal of the batch/trial size.\n /// - Gaussion : phi = variance.\n /// - Poisson : phi = 1.0\n WORD Lvk, ///< [in] is the link function that describes how the mean depends on the linear predictor (see #GLM_LINK_FUNC). \n /// 1. Identity (default)\n /// 2. Log\n /// 3. Logit\n /// 4. Probit\n /// 5. Complementary log-log\n WORD retType ///< [in] is a switch to select a output type ( see \\ref #FIT_RETVAL_FUNC)\n );\n ///@}\n\n /// \\name ARMA\n /// The ARMA model is a tool for understanding and forecasting future values in a given time series. The model consists of two parts: an autoregressive component, i.e. AR(p), and a moving average component, i.e. MA(q), and it is referred to as ARMA(p,q). \n /// @{\n \n /*! \n * \\brief Computes the log-likelihood (LLF), Akaike Information Criterion (AIC) or other goodness of fit functions of the ARMA model.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run mean can take any value or be omitted, in which case a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_FORE(), NDK_ARMA_RESID()\n */\n int __stdcall NDK_ARMA_GOF( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the ARMA model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q, ///< [in] is the number of elements in thetas (order of MA component).\n WORD retType, ///< [in] is a switch to select a fitness measure ( see \\ref #GOODNESS_OF_FIT_FUNC).\n double* retVal ///< [out] is the calculated goodness of fit value.\n );\n\n /*! \n * \\brief Returns the standardized residuals of a given ARMA model \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\deprecated this function is being replaced by NDK_ARMA_FITTED()\n * \\sa NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_FORE(), NDK_ARMA_GOF()\n */\n int __stdcall NDK_ARMA_RESID( double* pData, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double mean, ///< [in] is the ARMA model mean (i.e. mu). \n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations. \n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in phis (order of AR component)\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in thetas (order of MA component)\n WORD retType ///< [in] is a switch to select a residuals-type:raw or standardized. see \\ref #RESID_RETVAL_FUNC\n );\n\n\n /*! \n * \\brief Returns the initial (non-optimal), optimal or standard errors of the model's parameters.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARMA_GOF(), NDK_ARMA_VALIDATE(), NDK_ARMA_FORE(), NDK_ARMA_RESID()\n */\n int __stdcall NDK_ARMA_PARAM( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double* mean, ///< [inout] is the ARMA model mean (i.e. mu).\n double* sigma, ///< [inout] is the standard deviation of the model's residuals/innovations.\n double* phis, ///< [inout] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [inout] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q, ///< [in] is the number of elements in thetas (order of MA component).\n MODEL_RETVAL_FUNC retType, ///< [in] is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see \\ref #MODEL_RETVAL_FUNC).\n size_t maxIter ///< [in] is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. \n );\n\n\n /*! \n * \\brief Calculates the out-of-sample forecast statistics.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run mean can take any value or be omitted, in which case a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_GOF(), NDK_ARMA_RESID()\n */\n int __stdcall NDK_ARMA_FORE( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the ARMA model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q, ///< [in] is the number of elements in thetas (order of MA component).\n size_t nStep, ///< [in] is the forecast time/horizon (expressed in terms of steps beyond end of the time series).\n FORECAST_RETVAL_FUNC retType, ///< [in] is a switch to select the type of value returned (FORECAST_MEAN, FORECAST_STDEV , ..)\n /// (see \\ref #FORECAST_RETVAL_FUNC).\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n double* retVal ///< [out] is the calculated forecast value.\n );\n\n\n /*! \n * \\brief Returns the fitted values (i.e. mean, volatility and residuals).\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run mean can take any value or be omitted, in which case a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_GOF(), NDK_ARMA_RESID(), NDK_ARMA_GOF()\n */\n int __stdcall NDK_ARMA_FITTED( double* pData, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the ARMA model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q, ///< [in] is the number of elements in thetas (order of MA component).\n FIT_RETVAL_FUNC retType ///< [in] is a switch to select a output type ( see \\ref #FIT_RETVAL_FUNC).\n );\n\n /*! \n * \\brief Examines the model's parameters for stability constraints (e.g. stationarity, invertibility, causality, etc.). \n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run mean can take any value or be omitted, in which case a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero\n *\n * \\return status code of the operation\n * \\retval #NDK_TRUE model is stable\n * \\retval #NDK_FALSE model is instable\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_GOF(), NDK_ARMA_RESID(), NDK_ARMA_GOF()\n */\n int __stdcall NDK_ARMA_VALIDATE(double mean, ///< [in] is the ARMA model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q ///< [in] is the number of elements in thetas (order of MA component).\n );\n\n /*! \n * \\brief Returns the simulated values.\n * \n * \\note 1. ARMA_SIM returns an array of one simulation path starting from the end of the input data.\n * \\note 2. The input data argument (i.e. latest observations) is optional. If omitted, an array of zeroes is assumed.\n * \\note 3. The time series is homogeneous or equally spaced.\n * \\note 4. The time series may include missing values (e.g. NaN) at either end.\n * \\note 5. The long-run mean can take any value or be omitted, in which case a zero value is assumed.\n * \\note 6. The residuals/innovations standard deviation (sigma) must be greater than zero.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARMA_PARAM(), NDK_ARMA_VALIDATE(), NDK_ARMA_GOF(), NDK_ARMA_RESID(), NDK_ARMA_GOF()\n */\n int __stdcall NDK_ARMA_SIM(double mean, ///< [in] is the ARMA model long-run mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q, ///< [in] is the number of elements in thetas (order of MA component).\n double* pData, ///< [in] are the values of the latest (most recent) observations.\n size_t nSize, ///< [in] is the number elements in pData.\n UINT nSeed, ///< [in] is an unsigned integer to initialize the psuedorandom number generator.\n double* retArray, ///< [out] is the output array to hold nSteps future simulations.\n size_t nSteps ///< [in] is the number of future steps to simulate for.\n );\n\n ///@}\n\n /// \\name ARIMA\n /// ARIMA model functions\n /// @{\n\n /*! \n * \\brief Examines the model's parameters for stability constraints (e.g. stationarity, invertibility, causality, etc.).\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The integration order argument (d) must be a positive integer.\n * \\note 3. The time series may include missing values (e.g. NaN) at either end.\n * \\note 4. The long-run mean can take any value or may be omitted, in which case a zero value is assumed.\n * \\note 5. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARIMA_GOF(), NDK_ARIMA_PARAM(), NDK_ARIMA_FORE(), NDK_ARIMA_FITTED(), NDK_ARIMA_SIM()\n */\n\n int __stdcall NDK_ARIMA_VALIDATE( double mean, ///< [in] is the ARMA model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the integration order.\n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q ///< [in] is the number of elements in thetas (order of MA component).\n );\n /*! \n * \\brief Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit functions of the ARIMA model.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run mean can take any value or be omitted, in which case a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARIMA_VALIDATE(), NDK_ARIMA_PARAM(), NDK_ARIMA_FORE(), NDK_ARIMA_FITTED(), NDK_ARIMA_SIM()\n */\n int __stdcall NDK_ARIMA_GOF( double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the ARMA model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the model's integration order.\n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q, ///< [in] is the number of elements in thetas (order of MA component).\n GOODNESS_OF_FIT_FUNC retType, ///< [in] is a switch to select a fitness measure ( see \\ref #GOODNESS_OF_FIT_FUNC).\n double* retVal ///< [out] is the calculated GOF return value.\n );\n /*! \n * \\brief Returns the quick guess, optimal (calibrated) or std. errors of the values of the model's parameters.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The integration order argument (d) must be a positive integer.\n * \\note 4. The long-run mean can take any value or may be omitted, in which case a zero value is assumed.\n * \\note 5. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARIMA_VALIDATE(), NDK_ARIMA_GOF(), NDK_ARIMA_FORE(), NDK_ARIMA_FITTED(), NDK_ARIMA_SIM()\n */\n int __stdcall NDK_ARIMA_PARAM( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double* mean, ///< [inout] is the ARMA model mean (i.e. mu).\n double* sigma, ///< [inout] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the model's integration order.\n double* phis, ///< [inout] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [inout] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q, ///< [in] is the number of elements in thetas (order of MA component).\n MODEL_RETVAL_FUNC retType, ///< [in] is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see \\ref #MODEL_RETVAL_FUNC).\n size_t maxIter ///< [in] is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed.\n );\n\n\n /*! \n * \\brief Calculates the out-of-sample simulated values. \n * \n * \\note 1. The input data argument (i.e. latest observations) is optional. If omitted, an array of zeroes is assumed. \n * \\note 2. The time series is homogeneous or equally spaced.\n * \\note 3. The time series may include missing values (e.g. NaN) at either end.\n * \\note 4. The input data argument (i.e. latest observations) is optional. If omitted, an array of zeroes is assumed. \n * \\note 5. The residuals/innovations standard deviation (sigma) must be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARIMA_VALIDATE(), NDK_ARIMA_GOF(), NDK_ARIMA_FORE(), NDK_ARIMA_FITTED(), NDK_ARIMA_PARAM()\n */\n int __stdcall NDK_ARIMA_SIM( double mean, ///< [in] is the ARMA model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the model's integration order.\n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q, ///< [in] is the number of elements in thetas (order of MA component).\n double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n UINT nSeed, ///< [in] is an unsigned integer for setting up the random number generators.\n double* retVal, ///< [out] is the calculated simulation value.\n size_t nSteps ///< [in] is the number of future steps to simulate for.\n );\n /*! \n * \\brief Calculates the out-of-sample conditional forecast (i.e. mean, error, and confidence interval).\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The integration order argument (d) must be a positive integer.\n * \\note 4. The long-run mean can take any value or may be omitted, in which case a zero value is assumed.\n * \\note 5. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARIMA_VALIDATE(), NDK_ARIMA_GOF(), NDK_ARIMA_SIM(), NDK_ARIMA_FITTED(), NDK_ARIMA_PARAM()\n */\n int __stdcall NDK_ARIMA_FORE( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the ARMA model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the model's integration order.\n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q, ///< [in] is the number of elements in thetas (order of MA component).\n size_t nStep, ///< [in] is the forecast time/horizon (expressed in terms of steps beyond end of the time series).\n FORECAST_RETVAL_FUNC retType, ///< [in] is a switch to select the type of value returned (see \\ref #FORECAST_RETVAL_FUNC).\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n double* retVal ///< [out] is the calculated forecast value.\n );\n /*! \n * \\brief Returns the in-sample model fitted values of the conditional mean, volatility or residuals.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The integration order argument (d) must be a positive integer.\n * \\note 4. The long-run mean can take any value or may be omitted, in which case a zero value is assumed.\n * \\note 5. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_ARIMA_VALIDATE(), NDK_ARIMA_GOF(), NDK_ARIMA_SIM(), NDK_ARIMA_FORE(), NDK_ARIMA_PARAM()\n */\n int __stdcall NDK_ARIMA_FITTED( double* pData, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the ARMA model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the model's integration order.\n double* phis, ///< [in] are the parameters of the AR(p) component model (starting with the lowest lag).\n size_t p, ///< [in] is the number of elements in phis (order of AR component).\n double* thetas, ///< [in] are the parameters of the MA(q) component model (starting with the lowest lag).\n size_t q, ///< [in] is the number of elements in thetas (order of MA component).\n FIT_RETVAL_FUNC retType ///< [in] is a switch to select a output type ( see \\ref #FIT_RETVAL_FUNC).\n );\n ///@}\n\n\n /// \\name FARIMA\n /// Fractional ARIMA model functions\n /// @{\n /*! \n * \\brief Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit function of the FARIMA model. \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()\n */\n int __stdcall NDK_FARIMA_GOF( double* pData, size_t nSize, double mean, double sigma, double nIntegral, double* phis, size_t p, double* thetas, size_t q, WORD retType, double* retVal);\n /*! \n * \\brief Returns the standardized residuals of a given FARIMA model \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_GOF(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()\n */\n int __stdcall NDK_FARIMA_RESID( double* pData/*IN-OUT*/, size_t nSize, double mean, double sigma, double nIntegral, double* phis, size_t p, double* thetas, size_t q, WORD retType);\n /*! \n * \\brief Returns the initial (non-optimal), optimal or standard errors of the model's parameters.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()\n */\n int __stdcall NDK_FARIMA_PARAM( double* pData, size_t nSize, double* mean, double* sigma, double nIntegral, double* phis, size_t p, double* thetas, size_t q, WORD retType, size_t maxIter);\n\n /*! \n * \\brief Returns a simulated data series the underlying FARIMA process.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_FARIMA_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()\n */\n int __stdcall NDK_FARIMA_SIM( double* pData, size_t nSize, double mean, double sigma, double nIntegral, double* phis, size_t p, double* thetas, size_t q, size_t nStep , size_t nSeed, double* retVal);\n\n /*! \n * \\brief Calculates the out-of-sample forecast statistics.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_FARIMA_GOF(), NDK_FARIMA_RESID(), NDK_FARIMA_PARAM(), NDK_FARIMA_FITTED(), NDK_FARIMA_VALIDATE()\n */\n int __stdcall NDK_FARIMA_FORE( double* pData, size_t nSize, double mean, double sigma, double nIntegral, double* phis, size_t p, double* thetas, size_t q, size_t nStep , WORD retType, double* retVal);\n /*! \n * \\brief Returns an array of cells for the fitted values (i.e. mean, volatility and residuals)\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_FARIMA_GOF(), NDK_FARIMA_RESID(), NDK_FARIMA_PARAM(), NDK_FARIMA_FORE(), NDK_FARIMA_VALIDATE()\n */\n int __stdcall NDK_FARIMA_FITTED( double* pData, size_t nSize, double mean, double sigma, double nIntegral, double* phis, size_t p, double* thetas, size_t q, WORD retType);\n ///@}\n\n\n /// \\name SARIMA\n /// Seasonal ARIMA model functions\n /// @{\n\n /*! \n * \\brief Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit function of the SARIMA model.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 4. The maximum likelihood estimation (MLE) is a statistical method for fitting a model to the data and provides estimates for the model's parameters.\n * \\note 5. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.\n * \\note 6. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.\n * \\note 7. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.\n * \\note 8. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()\n */\n int __stdcall NDK_SARIMA_GOF( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [in] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [in] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [in] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [in] are the coefficients's values of the seasonal MA component.\n size_t sQ, ///< [in] is the order of the seasonal MA component.\n GOODNESS_OF_FIT_FUNC retType, ///< [in] is a switch to select a fitness measure ( see \\ref #GOODNESS_OF_FIT_FUNC).\n double* retVal ///< [out] is the calculated goodness of fit value.\n );\n /*! \n * \\brief Returns the quick guess, optimal (calibrated) or std. errors of the values of model's parameters.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 5. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.\n * \\note 6. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.\n * \\note 7. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()\n */\n int __stdcall NDK_SARIMA_PARAM( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double* mean, ///< [inout] is the mean of the ARMA process.\n double* sigma, ///< [inout] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [inout] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [inout] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [inout] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [inout] are the coefficients's values of the seasonal MA component.\n size_t sQ, ///< [in] is the order of the seasonal MA component.\n MODEL_RETVAL_FUNC retType, ///< [in] is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see \\ref #MODEL_RETVAL_FUNC).\n size_t maxIter ///< [in] is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed.\n );\n\n\n /*! \n * \\brief Returns the initial (non-optimal), optimal or standard errors of the model's parameters.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. SARIMA_SIM returns an array of one simulation path starting from the end of the input data.\n * \\note 3. The time series may include missing values (e.g. NaN) at either end.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 5. The input data argument (i.e. latest observations) is optional. If omitted, an array of zeroes is assumed.\n * \\note 6. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.\n * \\note 7. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.\n * \\note 8. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.\n * \\note 9. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. Plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()\n */\n int __stdcall NDK_SARIMA_SIM( double mean, ///< [in] is the model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [in] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [in] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [in] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [in] are the coefficients's values of the seasonal MA component.\n size_t sQ, ///< [in] is the order of the seasonal MA component.\n double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n size_t nSeed, ///< [in] is an unsigned integer for setting up the random number generators.\n double* retVal, ///< [out] is the simulated value.\n size_t nStep ///< [in] is the simulation time/horizon (expressed in terms of steps beyond end of the time series).\n );\n /*! \n * \\brief Calculates the out-of-sample conditional forecast (i.e. mean, error, and confidence interval).\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 5. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.\n * \\note 6. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.\n * \\note 7. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. plain ARIMA). \n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()\n */\n int __stdcall NDK_SARIMA_FORE(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [in] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [in] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [in] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [in] are the coefficients's values of the seasonal MA component.\n size_t sQ, ///< [in] is the order of the seasonal MA component.\n size_t nStep, ///< [in] is the forecast time/horizon (expressed in terms of steps beyond end of the time series).\n FORECAST_RETVAL_FUNC retType, ///< [in] is a switch to select the type of value returned (see \\ref #FORECAST_RETVAL_FUNC).\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n double* retVal ///< [out] is the calculated forecast value.\n );\n /*! \n * \\brief Returns the in-sample model fitted values of the conditional mean, volatility or residuals.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 5. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.\n * \\note 6. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.\n * \\note 7. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FORE(), NDK_SARIMA_VALIDATE()\n */\n int __stdcall NDK_SARIMA_FITTED(double* pData, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [in] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [in] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [in] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [in] are the coefficients's values of the seasonal MA component.\n size_t sQ, ///< [in] is the order of the seasonal MA component.\n FIT_RETVAL_FUNC retType ///< [in] is a switch to select a output type ( see \\ref #FIT_RETVAL_FUNC).\n );\n /*! \n * \\brief Examines the model's parameters for stability constraints (e.g. stationarity, invertibility, causality, etc.).\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 4. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.\n * \\note 5. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed to be zero.\n * \\note 6. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed to be zero.\n * \\note 7. The season length - s - is optional and can be omitted, in which case s is assumed to be zero (i.e. plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED()\n */\n int __stdcall NDK_SARIMA_VALIDATE(double mean, ///< [in] is the model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [in] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [in] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [in] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [in] are the coefficients's values of the seasonal MA component.\n size_t sQ ///< [in] is the order of the seasonal MA component.\n );\n ///@}\n\n /// \\name AirLine\n ///AirLine model functions\n /// @{\n\n /*! \n * \\brief Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit functions of the AirLine model.\n * \n * \\note 1. The Airline model is a special case of multiplicative seasonal ARIMA model, and it assumes independent and normally distributed residuals with constant variance.\n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()\n */\n int __stdcall NDK_AIRLINE_GOF(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the model mean (i.e. \\f$\\mu\\f$).\n double sigma, ///< [in] is the standard deviation (\\f$\\sigma\\f$) of the model's residuals/innovations.\n WORD S, ///< [in] is the length of seasonality (expressed in terms of lags, where s > 1).\n double theta, ///< [in] is the coefficient of first-lagged innovation (\\f$\\theta\\f$)(see model description).\n double theta2, ///< [in] is the coefficient of s-lagged innovation (\\f$\\Theta\\f$) (see model description).\n GOODNESS_OF_FIT_FUNC retType, ///< [in] is a switch to select a fitness measure ( see \\ref #GOODNESS_OF_FIT_FUNC).\n double* retVal ///< [out] is the calculated value of the goodness of fit.\n );\n\n /*! \n * \\brief Returns an array of cells for the standardized residuals of a given AirLine model.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\deprecated this function is being replaced by NDK_AIRLINE_FITTED()\n * \\sa NDK_AIRLINE_GOF(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()\n */\n int __stdcall NDK_AIRLINE_RESID( double* pData, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD S, ///< [in] is the length of seasonality (expressed in terms of lags, where s > 1).\n double theta, ///< [in] is the coefficient of first-lagged innovation (see model description).\n double theta2, ///< [in] is the coefficient of s-lagged innovation (see model description).\n RESID_RETVAL_FUNC retType ///< [in] is a switch to select a residuals-type:raw or standardized. see \\ref #RESID_RETVAL_FUNC.\n );\n\n\n /*! \n * \\brief Returns the initial/quick guess of the model's parameters.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()\n */\n int __stdcall NDK_AIRLINE_PARAM( double* pData, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double* mean, ///< [inout] is the model mean (i.e. mu).\n double* sigma, ///< [inout] is the standard deviation of the model's residuals/innovations.\n WORD S, ///< [in] is the length of seasonality (expressed in terms of lags, where s > 1).\n double* theta, ///< [inout] is the coefficient of first-lagged innovation (see model description).\n double* theta2, ///< [inout] is the coefficient of s-lagged innovation (see model description.\n MODEL_RETVAL_FUNC retType, ///< [in] is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see \\ref #MODEL_RETVAL_FUNC).\n size_t maxIter ///< [in] is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. \n );\n\n /*! \n * \\brief Calculates the out-of-sample forecast statistics.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 5. The season length must be greater than one.\n * \\note 6. The input argument for the non-seasonal MA parameter - theta - is optional and can be omitted, in which case no non-seasonal MA component is included.\n * \\note 7. The input argument for the seasonal MA parameter - theta2 - is optional and can be omitted, in which case no seasonal MA component is included.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_VALIDATE()\n */\n int __stdcall NDK_AIRLINE_FORE( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD S, ///< [in] is the length of seasonality (expressed in terms of lags, where s > 1).\n double theta, ///< [in] is the coefficient of first-lagged innovation (see model description).\n double theta2, ///< [in] is the coefficient of s-lagged innovation (see model description).\n size_t nStep, ///< [in] is the forecast time/horizon (expressed in terms of steps beyond end of the time series).\n FORECAST_RETVAL_FUNC retType, ///< [in] is a switch to select the type of value returned (see \\ref #FORECAST_RETVAL_FUNC).\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n double* retVal ///< [out] is the calculated forecast value.\n );\n\n /*! \n * \\brief Calculates the out-of-sample conditional mean forecast.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The input data argument (i.e. latest observations) is optional. If omitted, a value of zero is assumed.\n * \\note 3. The time series may include missing values (e.g. NaN) at either end.\n * \\note 4. The \\f$\\epsilon\\f$ are normally distributed with mean zero and unit standard deviation.\n * \\note 5. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.\n * \\note 6. The value of the residuals/innovations standard deviation (sigma) must be positive.\n * \\note 7. The season length must be greater than one.\n * \\note 8. The input argument for the non-seasonal MA parameter - theta - is optional and can be omitted, in which case no non-seasonal MA component is included.\n * \\note 9. The input argument for the seasonal MA parameter - theta2 - is optional and can be omitted, in which case no seasonal MA component is included. \n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_VALIDATE(), NDK_AIRLINE_GOF(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED(), NDK_AIRLINE_PARAM()\n */\n int __stdcall NDK_AIRLINE_SIM( double* pData, ///< [in] is a univariate time series of the initial values (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD S, ///< [in] is the length of seasonality (expressed in terms of lags, where s > 1).\n double theta, ///< [in] is the coefficient of first-lagged innovation (see model description).\n double theta2, ///< [in] is the coefficient of s-lagged innovation (see model description).\n UINT nSeed, ///< [in] is an unsigned integer for setting up the random number generators.\n double* retArray, ///< [out] is the calculated simulation value.\n size_t nSteps ///< [in] is the number of future steps to simulate for.\n );\n\n\n\n /*! \n * \\brief Returns the fitted values of the conditional mean.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run mean argument (mean) can take any value or be omitted, in which case a zero value is assumed.\n * \\note 4. The season length must be greater than one.\n * \\note 5. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 6. The input argument for the non-seasonal MA parameter - theta - is optional and can be omitted, in which case no non-seasonal MA component is included.\n * \\note 7. The input argument for the seasonal MA parameter - theta2 - is optional and can be omitted, in which case no seasonal MA component is included.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_VALIDATE()\n */\n int __stdcall NDK_AIRLINE_FITTED( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double mean, ///< [in] is the model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD S, ///< [in] is the length of seasonality (expressed in terms of lags, where s > 1).\n double theta, ///< [in] is the coefficient of first-lagged innovation (see model description).\n double theta2, ///< [in] is the coefficient of s-lagged innovation (see model description).\n FIT_RETVAL_FUNC retType ///< [in] is a switch to select a output type ( see \\ref #FIT_RETVAL_FUNC).\n );\n\n /*! \n * \\brief Examines the model's parameters for stability constraints (e.g. stationarity, etc.).\n * \n * \\note 1. The Airline model is a special case of multiplicative seasonal ARIMA model, and it assumes independent and normally distributed residuals with constant variance.\n * \\note 2. The time series is homogeneous or equally spaced.\n * \\note 3. The time series may include missing values (e.g. NaN) at either end.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED()\n */\n int __stdcall NDK_AIRLINE_VALIDATE( double mean, ///< [in] is the model mean (i.e. mu).\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD S, ///< [in] is the length of seasonality (expressed in terms of lags, where s > 1).\n double theta, ///< [in] is the coefficient of first-lagged innovation (see model description).\n double theta2 ///< [in] is the coefficient of s-lagged innovation (see model description).\n );\n ///@}\n\n /// \\name X12-ARIMA\n /// Seasonal ajustments using X12-ARIMA API functions calls\n /// @{\n\n /*! \n * \\brief Initialize the filesystem environment on the local machine for the current user \n * \n * \\note 1. This function creates a subfolder under the current user local profile for X12ARIMA models, and copy all the scripts needed to run the x12a program.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_ENV_INIT(BOOL override ///< [in] is a boolean flag to wipe our existing files and copy new ones.\n );\n /*! \n * \\brief Finalize the X12A environment and release any resources allocated \n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_ENV_CLEANUP(void);\n\n /*! \n * \\brief Initialize the required files for the given scenario/model\n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_SCEN_INIT(LPCTSTR szScenarioName, ///< [in] is the scenario name, must be unique\n LPVOID X12Options ///< [in] (optional) is an instance of #X12ARIMA_OPTIONS structure with all X12 model options.\n );\n /*! \n * \\brief Finalize the given scenario/model and free allocated resources\n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_SCEN_CLEAUP(LPCTSTR szScenarioName /*!< [in] is the scenario name or the model unique identifier */);\n\n\n /*! \n * \\brief Write the given data into an X12a formatted data file\n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_DATA_FILE( LPCTSTR szScenarioName, \n double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nLen, ///< [in] is the number of observations in X\n BOOL monthly, ///< [in] is a boolean flag for whether the data is monthly/quartelry sampled.\n LONG startDate, ///< [in] is the serial date number of the 1st observation in the series\n WORD reserved ///< [in] is a reserved argument for future releases. must be set to 1\n );\n /*! \n * \\brief Create or updates the x12a specification file using the options selected \n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_SPC_FILE(LPCTSTR szScenarioName, LPVOID X12Options);\n\n /*! \n * \\brief Run a batch file in x12a environment\n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_RUN_BATCH(LPCTSTR szScenarioName, LPCTSTR szBatchFile, LPWORD status);\n\n /*! \n * \\brief Run a x12a program for the given model or scenrio\n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_RUN_SCENARIO(LPCTSTR szScenarioName, LPWORD status);\n\n /*! \n * \\brief Read the status file generated by x12a program\n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_RUN_STAT(LPCTSTR szScenarioName, LPWORD status, LPTSTR szMsg, size_t* nLen);\n\n /*! \n * \\brief Return the full path of the output file generated by x12a program\n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_OUT_FILE(LPCTSTR szScenarioName, ///< [in] is the scenaio.model name\n WORD retType, ///< [in] is a switch to designate the desired specific output file.\n /// 0. The X12 specification file (*.spc)\n /// 1. The X12 log file\n /// 2. The output file\n /// 3. The error file\n LPTSTR szOutFile, ///< [out] is a buffer to hold the return full path\n size_t* nLen, ///< [inout] is the length of the szOutFile. Upon return, this argument stores the actual number of bytes used.\n BOOL OpenFileFlag ///< [in] is a switch to instruct the functiona whether it should open the file using system default editor (e.g. notepad)\n );\n /*! \n * \\brief Read the output time series (e.g. seasonal adjusted data) generated by x12a program\n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X12_OUT_SERIES(LPCTSTR szScenarioName, ///< [in] is the given scenario/model\n WORD nComponent, ///< [in] is the desired output of the X12a output\n /// 1. Final seasonal factors (d11)\n /// 2. final trend-cycle (d12)\n /// 3. final irregular component (d13)\n /// 4. final seasonal factors (d10)\n /// 5. combined holiday and trading day factors (d18)\n /// 6. combined seasonal and trading day factors (d16)\n double* pData, ///< [out] is the output buffer to hold the data series\n size_t* nLen ///< [inout] is the original size of the output buffer. Upon return, nLen will have the actual number of data copied.\n );\n\n /*! \n * \\brief Read the output forecaste series generated by x12a program\n * \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_SCEN_CLEAUP(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES()\n */\n int __stdcall NDK_X12_FORE_SERIES( LPCTSTR szScenarioName, ///< [in] is the given X12-ARIMA scenario/model identifier\n size_t nStep, ///< [in] is the forecast horizon\n WORD retType, ///< [in] is the switch to designate desired output\n /// 1. Mean\n /// 2. Lower limit value of the conficent interval\n /// 3. Upper limit value of the confidence interval\n double* pData ///< [out] is the forecast output value\n );\n ///@}\n\n\n /// \\name X13ARIMA-SEATS\n /// X13ARIMA-SEATS model functions\n /// @{\n\n /*!\n * \\brief Initialize the filesystem environment on the local machine for the current user\n *\n * \\note 1. This function creates a subfolder under the current user local profile for X13ARIMA models, and copy all the scripts needed to run the x13as program.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X13_ENV_CLEANUP()\n */\n int __stdcall NDK_X13_ENV_INIT(BOOL override ///< [in] is a boolean flag to wipe our existing files and copy new ones.\n );\n\n /*!\n * \\brief Finalize the X13AS environment and release any resources allocated\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X13_ENV_INIT()\n */\n int __stdcall NDK_X13_ENV_CLEANUP(void);\n\n /*!\n * \\brief Initialize the required files for the given scenario/model\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X13_ENV_INIT(), NDK_X13_ENV_CLEANUP(), NDK_X13_SCEN_CLEAUP()\n */\n int __stdcall NDK_X13_SCEN_INIT(LPCTSTR szScenarioName, ///< [in] is the scenario name, must be unique\n LPVOID X13Options ///< [in] (optional) is an instance of #X13ARIMA_OPTIONS structure with all X13 model options.\n );\n\n\n /*!\n * \\brief reconstruct the different (input/intermediate/output) files\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X13_ENV_INIT(), NDK_X13_ENV_CLEANUP(), NDK_X13_SCEN_CLEAUP()\n */\n int __stdcall NDK_X13_SCEN_REFRESH(LPCTSTR szScenarioName);\n\n /*!\n * \\brief Finalize the given scenario/model and free allocated resources\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X12_ENV_INIT(), NDK_X12_ENV_CLEANUP(), NDK_X12_SCEN_INIT(), NDK_X12_DATA_FILE(), NDK_X12_SPC_FILE(), NDK_X12_RUN_BATCH(), NDK_X12_RUN_SCENARIO(), NDK_X12_RUN_STAT(), NDK_X12_OUT_FILE(), NDK_X12_OUT_SERIES(), NDK_X12_FORE_SERIES()\n */\n int __stdcall NDK_X13_SCEN_CLEAUP(LPCTSTR szScenarioName /*!< [in] is the scenario name or the model unique identifier */\n );\n\n\n /*!\n * \\brief Write the given data into an X13as formatted data file\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X13_ENV_INIT(), NDK_X13_ENV_CLEANUP(), NDK_X13_SCEN_INIT(), NDK_X13_SCEN_CLEAUP()\n */\n int __stdcall NDK_X13_DATA_FILE(LPCTSTR szScenarioName, LPCTSTR szOutputFile,\n double* X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nLen, ///< [in] is the number of observations in X\n BOOL monthly, ///< [in] is a boolean flag for whether the data is monthly/quartelry sampled.\n LONG startDate, ///< [in] is the serial date number of the 1st observation in the series\n WORD reserved ///< [in] is a reserved argument for future releases. must be set to 1\n );\n\n /*!\n * \\brief Write the actual holidays dates into an genhol formatted data file\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X13_ENV_INIT(), NDK_X13_ENV_CLEANUP(), NDK_X13_SCEN_INIT(), NDK_X13_SCEN_CLEAUP()\n */\n int __stdcall NDK_X13_HOLIDAY_FILE( LPCTSTR szScenarioName, ///< [in] is the scenario name or the model unique identifier\n LPCTSTR szHoliday, ///< [in] is the holiday code (unique identifier) to get dates for.\n LONG startDate, ///< [in] is the serial date number of the beginning of the search interval\n LONG endDate ///< [in] is the serial date number of the end of the search interval\n );\n\n\n /*!\n * \\brief Write the (user) holidays dates into an genhol formatted data file\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_X13_HOLIDAY_FILE(), NDK_X13_SCEN_INIT(), NDK_X13_SCEN_CLEAUP()\n */\n int __stdcall NDK_X13_USER_EVENT_FILE(LPCTSTR szScenarioName, ///< [in] is the scenario name or the model unique identifier\n LPCTSTR szName, ///< [in] is the user-defined name (unique identifier) of the event.\n PLONG holidays, ///< [in] is an array of dates serial numbers.\n size_t nLen ///< [in] is the number of elements in the [holidays] array.\n );\n\n\n int __stdcall NDK_X13_ADD_EVENT_FACTOR( LPCTSTR szScenarioName, ///< [in] is the scenario name or the model unique identifier\n LPCTSTR szName, ///< [in] is the user-defined name (unique identifier) of the event.\n PLONG holidays, ///< [in] (optional, uer-defined only) is an array of dates serial numbers.\n size_t nLen, ///< [in] (optional, uer-defined only) is the number of elements in the [holidays] array.\n double begbefore, ///< [in] Denotes the position relative to the holiday of the beginning of the window used to generate the before-holiday regressor. This value should be negative, and less than or equal to the value for the endbefore argument. The minimum value that can be specified is -42.\n double endbefore, ///< [in] Denotes the position relative to the holiday of the end of the window used to generate the before-holiday regressor. This value should be negative.\n double begAfter, ///< [in] Denotes the position relative to the holiday of the beginning of the window used to generate the after-holiday regressor. Since this effect occurs after the holiday, the value should be non-negative.\n double endAfter, ///< [in] Denotes the position relative to the holiday of the end of the window used to generate the after-holiday regressor. This value should be positive, and greater than or equal to the value for the begafter argument. The maximum value that can be specified is 49\n double zeroBefore, ///< [in] Defines the year before which all values in the regressor are set to be zero. If this argument is set, first < zerobefore <= last, and if zeroafter is set, then zerobefore < zeroafter.\n double zeroAfter, ///< [in] Defines the year on or after which all values in the regressor are set to be zero. If this argument is set, first < zeroafter <= last, and if zeroafter is set, then zerobefore < zeroafter.\n WORD wCenter ///< [in] Specifies the removal of the (sample) mean or the seasonal means from the user-defined regression variables.\n ///< 0 = None, 1=mean, 2=calendar (only with ratio type of data)\n );\n\n\n int __stdcall NDK_X13_REGRESSORS_SETTING( LPCTSTR szScenarioName, ///< [in] is the scenario name or the model unique identifier\n double dwFirstYear,\n double dwLastYear,\n double dwFirstMeanYear,\n double dwLastMeanYear,\n DWORD dwPeriod,\n BOOL bRatio,\n double dwStockDay\n );\n \n int __stdcall NDK_X13_RUN_GENHOL(LPCTSTR szScenarioName);\n int __stdcall NDK_X13_RUN_BATCH(LPCTSTR szScenarioName, LPCTSTR szBatchFile, LPWORD status);\n int __stdcall NDK_X13_SPC_SERIES_SETTING(LPCTSTR szScenarioName, LPCTSTR szSeriesName, double* pData, size_t nLen, BOOL stock, BOOL monthly, LONG startDate, WORD fileType);\n int __stdcall NDK_X13_SPC_TRANSFORM_SETTING(LPCTSTR szScenarioName, X13TRANSFORM_METHOD zTransform, double zPower);\n int __stdcall NDK_X13_SPC_PRIOR_ADJUST_SETTING( LPCTSTR szScenarioName, BOOL lom, BOOL loq, BOOL leapYear,\n double* pTempData, size_t nTempLen, LONG zTempStartDate, X13PRIORADJUST_TYPE nTempDataType,\n double* pPermData, size_t nPermLen, LONG zPermStartDate, X13PRIORADJUST_TYPE nPermDataType);\n int __stdcall NDK_X13_SPC_X11_SETTING(LPCTSTR szScenarioName, BOOL enable, X11_MODE_TYPE mode, X11_SEASONALMA_TYPE seasonalma, int trendma, double sigmaLL, double sigmaUL);\n int __stdcall NDK_X13_SPC_SEATS_SETTING(LPCTSTR szScenarioName, BOOL enable, BOOL hpCycle, BOOL infiniteFilter, BOOL bAdmissableCompositionApprox, BOOL bAcceptSeasonStationary, double maxLBQStat);\n int __stdcall NDK_X13_WRITE_SPC_FILE(LPCTSTR szScenarioName);\n int __stdcall NDK_X13_RUN_SPC_FILE(LPCTSTR szScenarioName);\n int __stdcall NDK_X13AS_OUT_FILE(LPCTSTR szScenarioName, WORD retType, LPTSTR szOutFile, size_t* nLen, BOOL OpenFileFlag);\n int __stdcall NDK_X13AS_OUT_SERIES(LPCTSTR szScenarioName, LPCTSTR szComponent, double* pData, size_t* nLen);\n\n ///@}\n\n /// \\name SARIMAX\n /// Seasonal ARIMA-X model functions\n /// @{\n\n /*! \n * \\brief Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit functions of the SARIMA-X model.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 4. The maximum likelihood estimation (MLE) is a statistical method for fitting a model to the data and provides estimates for the model's parameters.\n * \\note 5. The intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed. \n * \\note 6. The long-run mean argumen (mean) of the differenced regression residuals can take any value. If omitted, a zero value is assumed.\n * \\note 7. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.\n * \\note 8. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.\n * \\note 9. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMAX_FITTED(), NDK_SARIMAX_PARAM(), NDK_SARIMAX_FORE(), NDK_SARIMAX_FORE(), NDK_SARIMAX_VALIDATE()\n */\n int __stdcall NDK_SARIMAX_GOF(double* pData, ///< [in] is the response univariate time series data (a one dimensional array).\n double** pFactors, ///< [in] is the exogneous factors time series data (each column is a separate factor, and each row is an observation).\n size_t nSize, ///< [in] is the number of observations.\n size_t nFactors, ///< [in] is the number of exognous factors.\n double* fBetas, ///< [in] is the weights or loading of the exogneous factors.\n double mean, ///< [in] is the ARIMA/SARIMA model's long-run mean/trend (i.e. mu). If missing (i.e. NaN), then it is assumed zero.\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [in] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [in] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [in] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [in] are the coefficients's values of the seasonal MA component.\n size_t sQ, ///< [in] is the order of the seasonal MA component.\n GOODNESS_OF_FIT_FUNC retType, ///< [in] is a switch to select a fitness measure ( see \\ref #GOODNESS_OF_FIT_FUNC).\n double* retVal ///< [out] is the calculated goodness of fit value.\n );\n\n\n /*! \n * \\brief Examines the model's parameters for stability constraints (e.g. causality, invertability, stationary, etc.).\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 5. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.\n * \\note 6. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.\n * \\note 7. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED()\n */\n int __stdcall NDK_SARIMAX_VALIDATE(double mean, ///< [in] is the model mean (i.e. mu) for the differenced series.\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [in] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [in] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [in] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [in] are the coefficients's values of the seasonal MA component.\n size_t sQ ///< [in] is the order of the seasonal MA component.\n );\n\n /*! \n * \\brief Returns the in-sample model fitted values of the conditional mean, volatility or residuals.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 5. The long-run mean argument (mean) of the differenced regression residuals can take any value. If omitted, a zero value is assumed. \n * \\note 6. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.\n * \\note 7. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.\n * \\note 8. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMAX_GOF(), NDK_SARIMAX_RESID(), NDK_SARIMAX_PARAM(), NDK_SARIMAX_FORE(), NDK_SARIMAX_VALIDATE()\n */\n int __stdcall NDK_SARIMAX_FITTED( double* pData, ///< [inout] is the univariate time series data (a one dimensional array).\n double** pFactors, ///< [in] is the exogneous factors time series data (each column is a separate factor, and each row is an observation).\n size_t nSize, ///< [in] is the number of observations.\n size_t nFactors, ///< [in] is the number of exognous factors.\n double* fBetas, ///< [in] is the weights or loading of the exogneous factors.\n double mean, ///< [in] is the ARIMA/SARIMA model's long-run mean/trend (i.e. mu). If missing (i.e. NaN), then it is assumed zero.\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [in] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [in] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [in] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [in] are the coefficients's values of the seasonal MA component.\n size_t sQ, ///< [in] is the order of the seasonal MA component.\n FIT_RETVAL_FUNC retType ///< [in] is a switch to select a output type ( see \\ref #FIT_RETVAL_FUNC).\n );\n\n\n /*! \n * \\brief Returns the quick guess, optimal (calibrated) or std. errors of the values of model's parameters.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.\n * \\note 4. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 5. The long-run mean argument (mean) of the differenced regression residuals can take any value. If omitted, a zero value is assumed.\n * \\note 6. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.\n * \\note 7. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.\n * \\note 8. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMAX_GOF(), NDK_SARIMAX_RESID(), NDK_SARIMAX_FORE(), NDK_SARIMAX_FITTED(), NDK_SARIMAX_VALIDATE()\n */\n int __stdcall NDK_SARIMAX_PARAM( double* pData, ///< [inout] is the univariate time series data (a one dimensional array).\n double** pFactors, ///< [in] is the exogneous factors time series data (each column is a separate factor, and each row is an observation).\n size_t nSize, ///< [in] is the number of observations.\n size_t nFactors, ///< [in] is the number of exognous factors.\n double* fBetas, ///< [inout] is the weights or loading of the exogneous factors.\n double* mean, ///< [inout] is the mean of the differenced time series process.\n double* sigma, ///< [inout] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [inout] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [inout] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [inout] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [inout] are the coefficients's values of the seasonal MA component.\n size_t sQ, ///< [in] is the order of the seasonal MA component.\n MODEL_RETVAL_FUNC retType, ///< [in] is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see \\ref #MODEL_RETVAL_FUNC).\n size_t maxIter ///< [in] is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed.\n );\n\n\n /*! \n * \\brief Calculates the out-of-sample forecast statistics.\n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 4. The exogneous factors input are expected to have at least n-more observations than the reponse variable.\n * \\note 5. The intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.\n * \\note 6. The long-run mean argument (mean) of the differenced regression residuals can take any value. If omitted, a zero value is assumed.\n * \\note 7. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.\n * \\note 8. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.\n * \\note 9. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_PARAM(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()\n */\n int __stdcall NDK_SARIMAX_FORE(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n double** pFactors, ///< [in] is the exogneous factors time series data (each column is a separate factor, and each row is an observation).\n size_t nSize, ///< [in] is the number of observations.\n size_t nFactors, ///< [in] is the number of exognous factors.\n double* fBetas, ///< [inout] is the weights or loading of the exogneous factors.\n double mean, ///< [inout] is the mean of the ARMA process.\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [in] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [in] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [in] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [in] are the coefficients's values of the seasonal MA component.\n size_t sQ, ///< [in] is the order of the seasonal MA component.\n size_t nStep, ///< [in] is the forecast time/horizon (expressed in terms of steps beyond end of the time series).\n FORECAST_RETVAL_FUNC retType, ///< [in] is a switch to select the type of value returned (see \\ref #FORECAST_RETVAL_FUNC).\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed.\n double* retVal ///< [out] is the calculated forecast value.\n );\n\n\n /*! \n * \\brief Calculates the out-of-sample simulated values. \n * \n * \\note 1. The time series is homogeneous or equally spaced.\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The residuals/innovations standard deviation (i.e.\\f$\\sigma\\f$) should be greater than zero.\n * \\note 4. The intercept or the regression constant term input argument is optional. If omitted, a zero value is assumed.\n * \\note 5. The exogenous factors input are expected to have at least n-more observations than the reponse variable.\n * \\note 6. The long-run mean argument (mean) of the differenced regression residuals can take any value. If omitted, a zero value is assumed.\n * \\note 7. The non-seasonal integration order - d - is optional and can be omitted, in which case d is assumed zero.\n * \\note 8. The seasonal integration order - sD - is optional and can be omitted, in which case sD is assumed zero.\n * \\note 9. The season length - s - is optional and can be omitted, in which case s is assumed zero (i.e. Plain ARIMA).\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_SARIMA_GOF(), NDK_SARIMA_RESID(), NDK_SARIMA_FORE(), NDK_SARIMA_FITTED(), NDK_SARIMA_VALIDATE()\n */\n int __stdcall NDK_SARIMAX_SIM(double* fBetas, ///< [inout] is the weights or loading of the exogneous factors.\n size_t nFactors, ///< [in] is the number of exognous factors.\n double mean, ///< [inout] is the mean of the ARMA process.\n double sigma, ///< [in] is the standard deviation of the model's residuals/innovations.\n WORD nIntegral, ///< [in] is the non-seasonal difference order.\n double* phis, ///< [in] are the coefficients's values of the non-seasonal AR component.\n size_t p, ///< [in] is the order of the non-seasonal AR component.\n double* thetas, ///< [in] are the coefficients's values of the non-seasonal MA component.\n size_t q, ///< [in] is the order of the non-seasonal MA component.\n WORD nSIntegral, ///< [in] is the seasonal difference.\n WORD nSPeriod, ///< [in] is the number of observations per one period (e.g. 12=Annual, 4=Quarter).\n double* sPhis, ///< [in] are the coefficients's values of the seasonal AR component.\n size_t sP, ///< [in] is the order of the seasonal AR component.\n double* sThetas, ///< [in] are the coefficients's values of the seasonal MA component.\n size_t sQ, ///< [in] is the order of the seasonal MA component.\n double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n double** pFactors, ///< [in] is the past exogneous factors time series data (each column is a separate factor, and each row is an observation).\n size_t nSize, ///< [in] is the number of observations in X. \n UINT nSeed, ///< [in] is an unsigned integer for setting up the random number generators.\n size_t nStep, ///< [in] is the simulation time/horizon (expressed in terms of steps beyond end of the time series).\n double* retVal ///< [out] is the simulated value.\n );\n\n\n ///@}\n\n\n /// \\name GARCH\n ///GARCH Functions\n /// @{\n\n /*! \n * \\brief Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit function of the GARCH model. \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCH_GOF(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType, ///< [in] is a switch to select a fitness measure ( see \\ref #GOODNESS_OF_FIT_FUNC)\n double* retVal ///< [out] is the calculated goodness of fit value. \n );\n /*! \n * \\brief Returns an array of cells for the standardized residuals of a given GARCH model \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\deprecated this function is being replaced by NDK_GARCH_FITTED()\n * \\sa NDK_GARCH_GOF(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCH_RESID(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType ///< [in] is a switch to select a residuals-type:raw or standardized. see \\ref #RESID_RETVAL_FUNC\n );\n /*! \n * \\brief Returns an array of cells for the initial (non-optimal), optimal or standard errors of the model's parameters.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCH_PARAM(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double* mu, ///< [inout] is the GARCH model conditional mean (i.e. mu). \n double* Alphas, ///< [inout] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n double* Betas, ///< [inout] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double* nu, ///< [inout] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType, ///< [in] is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see \\ref #MODEL_RETVAL_FUNC)\n size_t maxIter ///< [in] is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. \n );\n /*! \n * \\brief Returns a simulated data series the underlying GARCH process.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCH_SIM(double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n double* pData, ///< [in] is the univariate time series of the latest observations (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double* sigmas, ///< [in] is the univariate time series of the latest observations (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. \n size_t nSigmaSize, ///< [in] is the number of elements in sigmas. Only the latest q observations are used.\n UINT nSeed, ///< [in] is an unsigned integer for setting up the random number generators\n double* retArray, ///< [out] is the calculated simulation value\n size_t nSteps ///< [in] is the number of future steps to simulate for. \n );\n /*! \n * \\brief Calculates the out-of-sample forecast statistics.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCH_FORE( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double* sigmas, ///< [in] is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. \n size_t nSigmaSize, ///< [in] is the number of elements in sigmas. Only the latest q observations are used.\n double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian or Normal Distribution \n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n size_t nStep , ///< [in] is the forecast time/horizon (expressed in terms of steps beyond end of the time series). \n WORD retType, ///< [in] is a switch to select the type of value returned\n /// 1. Mean forecast \n /// 2. Forecast Error\n /// 3. Volatility term structure\n /// 4. Confidence interval lower limit\n /// 5. Confidence interval upper limit \n /// (see \\ref #FORECAST_RETVAL_FUNC)\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n double* retVal ///< [out] is the calculated forecast value\n );\n /*! \n * \\brief Returns an array of cells for the fitted values (i.e. mean, volatility and residuals)\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCH_FITTED( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType ///< [in] is a switch to select a output type ( see \\ref #FIT_RETVAL_FUNC)\n );\n\n /*! \n * \\brief Calculates the long-run average volatility for the given GARCH model\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run variance is not affected by our choice of shock/innovation distribution\n * \\note 4. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCH_LRVAR( double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n double* retVal ///< [out] is the calculated long run value\n );\n /*! \n * \\brief Examines the model's parameters for stability constraints (e.g. variance stationary, positive variance, etc.). \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_TRUE Model is stable (i.e. variance process is stationary and yield positive values)\n * \\retval #NDK_FALSE Model is unstable.\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED()\n */\n int __stdcall NDK_GARCH_VALIDATE(double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n );\n ///@}\n\n /// \\name EGARCH\n ///EGARCH Functions\n /// @{\n\n /*! \n * \\brief Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit function of the GARCH model. \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.\n * \\note 5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_EGARCH_RESID(), NDK_EGARCH_PARAM(), NDK_EGARCH_FORE(), NDK_EGARCH_FITTED(), NDK_EGARCH_VALIDATE()\n */\n int __stdcall NDK_EGARCH_GOF( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double mu, ///< [in] is the EGARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Gammas, ///< [in] are the leverage parameters (starting with the lowest lag).\n size_t g, ///< [in] is the number of elements in Gammas. Must be equal to (p-1).\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType, ///< [in] is a switch to select a fitness measure ( see \\ref #GOODNESS_OF_FIT_FUNC)\n double* retVal ///< [out] is the calculated goodness of fit value. \n );\n /*! \n * \\brief Returns an array of cells for the standardized residuals of a given GARCH model \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.\n * \\note 5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\deprecated this function is being replaced by NDK_EGARCH_FITTED()\n * \\sa NDK_GARCH_GOF(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_EGARCH_RESID( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double mu, ///< [in] is the EGARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Gammas, ///< [in] are the leverage parameters (starting with the lowest lag).\n size_t g, ///< [in] is the number of elements in Gammas. Must be equal to (p-1).\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType ///< [in] is a switch to select a residuals-type:raw or standardized. see \\ref #RESID_RETVAL_FUNC\n );\n /*! \n * \\brief Returns an array of cells for the initial (non-optimal), optimal or standard errors of the model's parameters.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.\n * \\note 5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_EGARCH_GOF(), NDK_EGARCH_RESID(), NDK_EGARCH_FORE(), NDK_EGARCH_FITTED(), NDK_EGARCH_VALIDATE()\n */\n int __stdcall NDK_EGARCH_PARAM( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double* mu, ///< [inout] is the EGARCH model conditional mean (i.e. mu). \n double* Alphas, ///< [inout] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n double* Gammas, ///< [inout] are the leverage parameters (starting with the lowest lag).\n size_t g, ///< [in] is the number of elements in Gammas. Must be equal to (p-1).\n double* Betas, ///< [inout] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double* nu, ///< [inout] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType, ///< [in] is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see \\ref #MODEL_RETVAL_FUNC)\n size_t maxIter ///< [in] is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. \n );\n /*! \n * \\brief Returns a simulated data series the underlying EGARCH process.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.\n * \\note 5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_EGARCH_RESID(), NDK_EGARCH_PARAM(), NDK_EGARCH_FORE(), NDK_EGARCH_FITTED(), NDK_EGARCH_VALIDATE()\n */\n int __stdcall NDK_EGARCH_SIM( double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Gammas, ///< [in] are the leverage parameters (starting with the lowest lag).\n size_t g, ///< [in] is the number of elements in Gammas. Must be equal to (p-1).\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double* sigmas, ///< [in] is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. \n size_t nSigmaSize, ///< [in] is the number of elements in sigmas. Only the latest q observations are used.\n UINT nSeed, ///< [in] is an unsigned integer for setting up the random number generators\n double* retArray, ///< [out] is the calculated simulation value\n size_t nSteps ///< [in] is the number of future steps to simulate for. \n );\n /*! \n * \\brief Calculates the out-of-sample forecast statistics.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.\n * \\note 5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_EGARCH_GOF(), NDK_EGARCH_RESID(), NDK_EGARCH_PARAM(), NDK_EGARCH_FITTED(), NDK_EGARCH_VALIDATE()\n */\n int __stdcall NDK_EGARCH_FORE(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double* sigmas, ///< [in] is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. \n size_t nSigmaSize, ///< [in] is the number of elements in sigmas. Only the latest q observations are used.\n double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Gammas, ///< [inout] are the leverage parameters (starting with the lowest lag).\n size_t g, ///< [in] is the number of elements in Gammas. Must be equal to (p-1).\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n size_t nStep , ///< [in] is the forecast time/horizon (expressed in terms of steps beyond end of the time series). \n WORD retType, ///< [in] is a switch to select the type of value returned\n /// 1. Mean forecast \n /// 2. Forecast Error\n /// 3. Volatility term structure\n /// 4. Confidence interval lower limit\n /// 5. Confidence interval upper limit \n /// (see \\ref #FORECAST_RETVAL_FUNC)\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n double* retVal ///< [out] is the simulated value for the GARCH process.\n );\n /*! \n * \\brief Returns an array of cells for the fitted values (i.e. mean, volatility and residuals)\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.\n * \\note 5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_EGARCH_FITTED( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Gammas, ///< [in] are the leverage parameters (starting with the lowest lag).\n size_t g, ///< [in] is the number of elements in Gammas. Must be equal to (p-1).\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType ///< [in] is a switch to select a output type ( see \\ref #FIT_RETVAL_FUNC)\n );\n\n\n /*! \n * \\brief Calculates the long-run average volatility for a given E-GARCH model.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The long-run variance is not affected by our choice of shock/innovation distribution\n * \\note 4. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 5. The number of gamma-coefficients must match the number of alpha-coefficients minus one.\n * \\note 6. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_EGARCH_GOF(), NDK_EGARCH_RESID(), NDK_EGARCH_PARAM(), NDK_EGARCH_FORE(), NDK_EGARCH_VALIDATE()\n */\n int __stdcall NDK_EGARCH_LRVAR( double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Gammas, ///< [inout] are the leverage parameters (starting with the lowest lag).\n size_t g, ///< [in] is the number of elements in Gammas. Must be equal to (p-1).\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n double* retVal ///< [out] is the calculated Long run volatility.\n );\n /*! \n * \\brief Examines the model's parameters for stability constraints (e.g. stationary, positive variance, etc.). \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model.\n * \\note 4. The number of gamma-coefficients must match the number of alpha-coefficients minus one.\n * \\note 5. The number of parameters in the input argument - beta - determines the order of the GARCH component model.\n *\n * \\return status code of the operation\n * \\retval #NDK_TRUE Model is stable (i.e. variance process is stationary and yield positive values)\n * \\retval #NDK_FALSE Model is unstable.\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_AIRLINE_GOF(), NDK_AIRLINE_RESID(), NDK_AIRLINE_PARAM(), NDK_AIRLINE_FORE(), NDK_AIRLINE_FITTED()\n */\n int __stdcall NDK_EGARCH_VALIDATE( double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Gammas, ///< [inout] are the leverage parameters (starting with the lowest lag).\n size_t g, ///< [in] is the number of elements in Gammas. Must be equal to (p-1).\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n );\n ///@}\n\n\n /// \\name GARCH-M\n ///GARCH-M Functions\n /// @{\n\n /*! \n * \\brief Computes the log-likelihood ((LLF), Akaike Information Criterion (AIC) or other goodness of fit function of the GARCH model. \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model. \n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCHM_RESID(), NDK_GARCHM_PARAM(), NDK_GARCHM_FORE(), NDK_GARCHM_FITTED(), NDK_GARCHM_VALIDATE()\n */\n int __stdcall NDK_GARCHM_GOF(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n double flambda, ///< [in] is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.\n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType, ///< [in] is a switch to select a fitness measure ( see \\ref #GOODNESS_OF_FIT_FUNC)\n double* retVal ///< [out] is the calculated goodness of fit value. \n );\n /*! \n * \\brief Returns an array of cells for the standardized residuals of a given GARCH model \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model. \n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\deprecated this function is being replaced by NDK_GARCHM_FITTED()\n * \\sa NDK_GARCHM_GOF(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCHM_RESID( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n double flambda, ///< [in] is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.\n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType ///< [in] is a switch to select a residuals-type:raw or standardized. see \\ref #RESID_RETVAL_FUNC\n );\n /*! \n * \\brief Returns an array of cells for the initial (non-optimal), optimal or standard errors of the model's parameters.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model. \n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCHM_PARAM( double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double* mu, ///< [inout] is the GARCH model conditional mean (i.e. mu). \n double* flambda, ///< [inout] is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.\n double* Alphas, ///< [inout] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n double* Betas, ///< [inout] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double* nu, ///< [inout] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType, ///< [in] is a switch to select the type of value returned: 1= Quick Guess, 2=Calibrated, 3= Std. Errors ( see \\ref #MODEL_RETVAL_FUNC)\n size_t maxIter ///< [in] is the maximum number of iterations used to calibrate the model. If missing or less than 100, the default maximum of 100 is assumed. \n );\n\n /*! \n * \\brief Returns a simulated data series the underlying GARCH process.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model. \n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCHM_SIM( double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n double flambda, ///< [in] is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.\n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double* sigmas, ///< [in] is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. \n size_t nSigmaSize, ///< [in] is the number of elements in sigmas. Only the latest q observations are used.\n UINT nSeed, ///< [in] is an unsigned integer for setting up the random number generators\n double* retArray, ///< [out] is the calculated simulation value\n size_t nSteps ///< [in] is the number of future steps to simulate for. \n );\n /*! \n * \\brief Calculates the out-of-sample forecast statistics.\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model. \n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FITTED(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCHM_FORE(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X.\n double* sigmas, ///< [in] is the univariate time series data (a one dimensional array of cells (e.g. rows or columns)) of the last q realized volatilities. \n size_t nSigmaSize, ///< [in] is the number of elements in sigmas. Only the latest q observations are used.\n double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n double flambda, ///< [in] is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.\n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian or Normal Distribution \n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n size_t nStep , ///< [in] is the forecast time/horizon (expressed in terms of steps beyond end of the time series). \n WORD retType, ///< [in] is a switch to select the type of value returned\n /// 1. Mean forecast \n /// 2. Forecast Error\n /// 3. Volatility term structure\n /// 4. Confidence interval lower limit\n /// 5. Confidence interval upper limit \n /// (see \\ref #FORECAST_RETVAL_FUNC)\n double alpha, ///< [in] is the statistical significance level. If missing, a default of 5% is assumed. \n double* retVal ///< [out] is the calculated forecast value\n );\n /*! \n * \\brief Returns an array of cells for the fitted values (i.e. mean, volatility and residuals)\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model. \n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCHM_GOF(), NDK_GARCHM_RESID(), NDK_GARCHM_PARAM(), NDK_GARCHM_FORE(), NDK_GARCHM_VALIDATE()\n */\n int __stdcall NDK_GARCHM_FITTED(double* pData, ///< [in] is the univariate time series data (a one dimensional array).\n size_t nSize, ///< [in] is the number of observations in X. \n double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n double flambda, ///< [in] is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.\n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n WORD retType ///< [in] is a switch to select a output type ( see \\ref #FIT_RETVAL_FUNC) \n );\n\n /*! \n * \\brief Calculates the long-run average volatility for the given GARCH-M model\n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model. \n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCH_GOF(), NDK_GARCH_RESID(), NDK_GARCH_PARAM(), NDK_GARCH_FORE(), NDK_GARCH_VALIDATE()\n */\n int __stdcall NDK_GARCHM_LRVAR( double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n double flambda, ///< [in] is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.\n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu, ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n double* retVal ///< [out] is the calculated long run value\n );\n /*! \n * \\brief Examines the model's parameters for stability constraints (e.g. stationary, etc.). \n * \n * \\note 1. The time series is homogeneous or equally spaced\n * \\note 2. The time series may include missing values (e.g. NaN) at either end.\n * \\note 3. The number of parameters in the input argument - alpha - determines the order of the ARCH component model. \n * \\note 4. The number of parameters in the input argument - beta - determines the order of the GARCH component model\n *\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED operation is unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_GARCHM_GOF(), NDK_ARCHM_RESID(), NDK_ARCHM_PARAM(), NDK_ARCHM_FORE(), NDK_ARCHM_FITTED()\n */\n int __stdcall NDK_GARCHM_VALIDATE(double mu, ///< [in] is the GARCH model conditional mean (i.e. mu). \n double flambda, ///< [in] is the volatility coefficient for the mean. In finance, lambda is referenced as the risk premium.\n const double* Alphas, ///< [in] are the parameters of the ARCH(p) component model (starting with the lowest lag). \n size_t p, ///< [in] is the number of elements in Alphas array\n const double* Betas, ///< [in] are the parameters of the GARCH(q) component model (starting with the lowest lag). \n size_t q, ///< [in] is the number of elements in Betas array\n WORD nInnovationType,///< [in] is the probability distribution function of the innovations/residuals (see #INNOVATION_TYPE)\n /// - INNOVATION_GAUSSIAN Gaussian Distribution (default)\n /// - INNOVATION_TDIST Student's T-Distribution, \n /// - INNOVATION_GED Generalized Error Distribution (GED)\n double nu ///< [in] is the shape factor (or degrees of freedom) of the innovations/residuals probability distribution function. \n );\n ///@}\n\n\n /// \\name Speactral Analysis\n /// @{\n /*! \n * \\brief Returns an array of cells for the convolution operator of two time series \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa SFMacros.h, NDK_LAG(), NDK_DIFF\n */\n int __stdcall NDK_CONVOLUTION(double *X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N1, ///< [in] is the number of observations in X. \n double *Y, ///< [in] is the second univariate time series data (a one dimensional array)\n size_t N2, ///< [in] is the number of observations in Y.\n double* Z, ///< [out] is the convolution time series output\n size_t* W ///< [inout] is the maximum number of elements in Z.\n );\n\n /*! \n * \\brief Calculates the inverse discrete fast Fourier transformation, recovering the time series.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa SFMacros.h, NDK_LAG(), NDK_DIFF\n */\n int __stdcall NDK_IDFT( double *amp, ///< [in] is an array of the amplitudes of the fourier transformation components.\n double *phase, ///< [in] is an array of the phase angle (radian) of the Fourier transformation components .\n size_t nSize, ///< [in] is the number of spectrum components (i.e. size of amp and phase). \n double* X, ///< [out] is the filtered (recovered) time series output\n size_t N ///< [in] is the original number of observations used to calculate the fourier transform. \n );\n\n /*! \n * \\brief Calculates the discrete fast Fourier transformation for amplitude and phase.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa SFMacros.h, NDK_LAG(), NDK_DIFF\n */\n int __stdcall NDK_DFT(double *X, ///< [in] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n double* retAmp, ///< [out] is an array of the amplitudes of the fourier transformation components\n double* retPhase, ///< [out] is an array of the phase angle (radian) of the Fourier transformation components .\n size_t M ///< [in] is the number of spectrum components (i.e. size of amp and phase)\n );\n\n\n /*! \n * \\brief computes cyclical component of given time series using the Hodrick\u0096Prescott filter.\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful (see \\ref SFMacros.h) \n * \\sa NDK_BaxterKingFilter(), NDK_DFT(), NDK_IDFT()\n */\n int __stdcall NDK_HodrickPrescotFilter(double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n BOOL bAscending, ///< [in] is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). \n double lambda ///< [in] is the multiplier used to penalize the variation in the trend component. If missing, a default is used based on data frequency. \n );\n\n\n /*! \n * \\brief Computes trend and cyclical component of a macroeconomic time series using Baxter-King Fixed Length Symmetric Filter. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful (see \\ref SFMacros.h) \n * \\sa NDK_HodrickPrescotFilter(), NDK_DFT(), NDK_IDFT()\n */\n int __stdcall NDK_BaxterKingFilter( double *X, ///< [inout] is the univariate time series data (a one dimensional array).\n size_t N, ///< [in] is the number of observations in X. \n BOOL bAscending, ///< [in] is the time order in the data series (i.e. the first data point's corresponding date (earliest date=1 (default), latest date=0)). \n size_t freq_min, ///< [in] is the number of periods for the high pass filter (e.g. 6 for quarterly data, 18 for monthly data). \n size_t freq_max, ///< [in] is the number of periods for the low passfilter (e.g. 32 for quarterly data, 96 for montly data). \n size_t K, ///< [in] is the number of points(aka terms) to use in the approximate optimal filter. If missing, a default value of 12 is assumed \n BOOL drift, ///< [in] is a logical value: FALSE if no drift in time series (default), TRUE if drift in time series. \n BOOL unitroot, ///< [in] is a logical value: FALSE if no unit-root is in time series (default), TRUE if unit-root is in time series. \n WORD retTYpe ///< [in] is the integer enumeration for the filter output: (1= trend component (default), 2=cyclical component, 3=noise component) \n );\n\n\n ///@}\n\n\n /*!\n * \\name Portfolio Analysis\n * \\brief \n * @{\n */\n /// \\brief compute the portfolio equivalent returns\n /*! \n * \\brief Calculates the portfolio equivalent return. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful (see \\ref SFMacros.h) \n * \\sa NDK_PORTFOLIO_VARIANCE(), NDK_PORTFOLIO_COVARIANCE()\n */\n int __stdcall NDK_PORTFOLIO_RET(double* weights, size_t nAssets, double* returns, double* ret);\n\n /*! \n * \\brief Calculates the overall portfolio variance (volatility squared). \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful (see \\ref SFMacros.h) \n * \\sa NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_COVARIANCE()\n */\n int __stdcall NDK_PORTFOLIO_VARIANCE(double* weights, size_t nAssets, double** covar, double* variance);\n\n /*! \n * \\brief Calculates the covariance between two portfolios. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation is unsuccessful (see \\ref SFMacros.h) \n * \\sa NDK_PORTFOLIO_RET(), NDK_PORTFOLIO_VARIANCE()\n */\n int __stdcall NDK_PORTFOLIO_COVARIANCE(double* weights1, double* weights2, size_t nAssets, double** covar, double* retVal);\n\n ///@}\n\n\n /*!\n * \\name Utilities\n * \n * @{\n */\n /*! \n * \\brief estimate the value of the function represented by (x,y) data set at an intermediate x-value. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval #NDK_FAILED Operation unsuccessful (see \\ref SFMacros.h)\n * \\sa NDK_WMA(), NDK_EWMA()\n */\n int __stdcall\tNDK_INTERPOLATE(double* X, ///< [in] is the x-component of the input data table (a one dimensional array)\n size_t Nx, ///< [in] is the number of elements in X\n double* Y, ///< [in] is the y-component of the input data table (a one dimensional array)\n size_t Ny, ///< [in] is the number of elements in Y \n double* XT, ///< [in] is the desired x-value(s) to interpolate for (a single value or a one dimensional array).\n size_t Nxt, ///< [in] is the number of elements in XT\n WORD nMethod, ///< [in] is the interpolation method (1=Forward Flat, 2=Backward Flat, 3=Linear, 4=Cubic Spline). \n /// 1. Forward Flat\n /// 2. Backward Flat\n /// 3. Linear \n /// 4. Cublic Spline\n BOOL extrapolate, ///< [in] sets whether or not to allow extrapolation (1=Yes, 0=No). If missing, the default is to not allow extrapolation\n double* YVals, ///< [out] is the output buffer to store the interpolated values\n size_t Nyvals ///< [in] is the number of elements in YVals (must equal to Nxt).\n );\n\n /*! \n * \\brief Query & retrieve NumXL SDK environment information \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa SFMacros.h, NDK_Init()\n */\n int __stdcall NDK_INFO(int nRetType, ///< [in] is a key/identifier to select the desired output\n /// 1. Version Number (default\n /// 2. Release\n /// 3. License Key\n /// 4. License Level\n /// 5. License Expiry Date\n /// 6. Installation Path\n /// 7. Data (e.g. Log-file) Path\n /// 8. Computer ID(unique identifier)\n LPTSTR szMsg, ///< [out] The buffer that will receive the return value\n int nSize ///< [inout] maximum number of characters to copy to the buffer.\n );\n /*! \n * \\brief write a log message to the logging system \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa SFMacros.h, SFLogger.h, SFLOG_LogMsg()\n */\n int __stdcall NDK_MSG( int nRetCode, ///< [in] is the log level (1=trace, 2=Debug, 3=Info, 4=Warn, 5=Error, 6=Fatal Error)\n LPTSTR pMsg, ///< [in] is the log message\n size_t nSize ///< [in] us the number of characters in pMsg\n );\n\n\n /*!\n * \\brief set the seed value of the random number generator\n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa SFMacros.h, SFSDK.h\n */\n int __stdcall NDK_RNG_SEED(ULONG ulSeed ///< [in] is the new seed value for the random number generator\n );\n\n /*! \n * \\brief Locate and return the full path of the default editor (e.g. notepad) in the system \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa SFMacros.h, NDK_Init()\n */\n int __stdcall NDK_DEFAULT_EDITOR (LPTSTR szFullPath, ///< [out] is the buffer that will receive the return value\n size_t* nSize ///< [inout] is the maximum number of characters to copy to the buffer.\n );\n\n\n /*! \n * \\brief Returns the n-th token/substring in a string after splitting it using a given delimiter \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa NDK_REGEX_REPLACE(), NDK_REGEX_MATCH()\n */\n int __stdcall NDK_TOKENIZE (LPCTSTR szTxt, ///< [in] is the input string to match for. \n LPCTSTR szDelim, ///< [in] is the character to use for splitting the string. If missing, comma (,) is used. \n short nOrder, ///< [in] is the order of the token to return, where first = 1, second = 2,..., and last = -1. If missing, the first token is returned\n LPTSTR pRetVal, ///< [out] is the n-th token/substring in a string\n size_t nSize ///< [in] is the number of characters in pRetVal buffer\n );\n /*! \n * \\brief Returns TRUE if the string matches the regular expression expressed \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa NDK_REGEX_REPLACE(), NDK_TOKENIZE()\n */\n int __stdcall NDK_REGEX_MATCH( LPCTSTR szLine, ///< [in] is the input string to match for.\n LPCTSTR szPattern, ///< [in] is the regular expression (regex PERL-style) to match the input string with (e.g. ^Thi[sS].*$). \n BOOL ignoreCase, ///< [in] is a flag to instruct the function to ignore the letter-case in the string\n BOOL partialOK, ///< [in] is a flag/switch to indicate whether a substring or a partial match (search) is permitted or to only consider full-string match.\n BOOL* bMatch ///< [out] is the return value of the match.\n );\n\n /*! \n * \\brief Returns the modified string after performing match/replace on the given string. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa NDK_REGEX_REPLACE(), NDK_TOKENIZE()\n */\n int __stdcall NDK_REGEX_REPLACE(LPCTSTR szLine, ///< [in] is the input string to process. \n LPCTSTR szKey, ///< [in] is the regular expression (PERL-style) (e.g. \"^\\d\\w{1,2}.*$\"). \n LPCTSTR szValue, ///< [in] is the value to replace the match with. If missing or omitted, an empty string is used\n BOOL ignoreCase, ///< [in] is a flag to instruct the matching function whether to ignore letter-case. If missing, ignore_case is set to TRUE\n BOOL global, ///< [in] is a flag to instruct the function whether to match and replace the first occurence (FALSE) or all the matches (TRUE). \n LPTSTR pRetVal, ///< [out] is the modified string after replacement\n size_t nSize ///< [in] is the size of the output buffer (pRetVal)\n );\n /*! \n * \\brief calculates the value of the regression function for an intermediate x-value. \n * \\return status code of the operation\n * \\retval #NDK_SUCCESS Operation successful\n * \\retval Error code\n * \\sa NDK_TREND(), NDK_DETREND()\n */\n int __stdcall\tNDK_REGRESSION( double* X, ///< [in] is the x-component of the input data table (a one dimensional array).\n size_t nX, ///< [in] is the number of elements in X.\n double* Y, ///< [in] is the y-component (i.e. function) of the input data table (a one dimensional array).\n size_t nY, ///< [in] is the number of elements in Y\n WORD nRegressType, ///< [in] is the model description flag for the trend function (1 = Linear (default), 2 = Polynomial, 3 = Exponential, 4 = Logarithmic, 5 = Power). \n WORD POrder, ///< [in] is the polynomial order. This is only relevant for a polynomial type of trend and is ignored for all others. If missing, POrder = 1.\n double intercept, ///< [in] is the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally.\n double target, ///< [in] is the desired x-value to calculate regression value for (a single value). \n WORD nRetType, ///< [in] is a switch to select the return output (1 = Forecast value (default), 2 = Upper limit, 3 = Lower Limit, 4 = R-Squared). \n double alpha, ///< [in] is the statistical significance or confidence level (i.e. alpha). If missing or omitted, an alpha value of 5% is assumed\n double* retVal ///< [out] is the calculated value\n );\n ///@}\n\n}\n/// @}", "meta": {"content_hash": "72a47784762482a67fe4141953762fc8", "timestamp": "", "source": "github", "line_count": 5079, "max_line_length": 341, "avg_line_length": 74.60858436700138, "alnum_prop": 0.5582590245872006, "repo_name": "spiderxl/sdk", "id": "73cc4f524ba8dcf455ab31eb18b9f08a36e34af3", "size": "379454", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/SFSDK.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "430124"}, {"name": "C#", "bytes": "23001"}, {"name": "C++", "bytes": "8895"}, {"name": "Visual Basic", "bytes": "218372"}]}} +{"text": "\n\npackage org.apache.kafka.copycat.runtime;\n\nimport org.apache.kafka.common.KafkaException;\nimport org.apache.kafka.common.utils.SystemTime;\nimport org.apache.kafka.common.utils.Time;\nimport org.apache.kafka.clients.producer.KafkaProducer;\nimport org.apache.kafka.clients.producer.ProducerConfig;\nimport org.apache.kafka.common.utils.Utils;\nimport org.apache.kafka.copycat.cli.WorkerConfig;\nimport org.apache.kafka.copycat.connector.Connector;\nimport org.apache.kafka.copycat.connector.ConnectorContext;\nimport org.apache.kafka.copycat.connector.Task;\nimport org.apache.kafka.copycat.errors.CopycatException;\nimport org.apache.kafka.copycat.sink.SinkTask;\nimport org.apache.kafka.copycat.source.SourceTask;\nimport org.apache.kafka.copycat.storage.*;\nimport org.apache.kafka.copycat.util.ConnectorTaskId;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Properties;\nimport java.util.Set;\n\n/**\n * <p>\n * Worker runs a (dynamic) set of tasks in a set of threads, doing the work of actually moving\n * data to/from Kafka.\n * </p>\n * <p>\n * Since each task has a dedicated thread, this is mainly just a container for them.\n * </p>\n */\npublic class Worker {\n private static final Logger log = LoggerFactory.getLogger(Worker.class);\n\n private Time time;\n private WorkerConfig config;\n private Converter keyConverter;\n private Converter valueConverter;\n private Converter internalKeyConverter;\n private Converter internalValueConverter;\n private OffsetBackingStore offsetBackingStore;\n private HashMap<String, Connector> connectors = new HashMap<>();\n private HashMap<ConnectorTaskId, WorkerTask> tasks = new HashMap<>();\n private KafkaProducer<byte[], byte[]> producer;\n private SourceTaskOffsetCommitter sourceTaskOffsetCommitter;\n\n public Worker(WorkerConfig config, OffsetBackingStore offsetBackingStore) {\n this(new SystemTime(), config, offsetBackingStore);\n }\n\n @SuppressWarnings(\"unchecked\")\n public Worker(Time time, WorkerConfig config, OffsetBackingStore offsetBackingStore) {\n this.time = time;\n this.config = config;\n this.keyConverter = config.getConfiguredInstance(WorkerConfig.KEY_CONVERTER_CLASS_CONFIG, Converter.class);\n this.keyConverter.configure(config.originalsWithPrefix(\"key.converter.\"), true);\n this.valueConverter = config.getConfiguredInstance(WorkerConfig.VALUE_CONVERTER_CLASS_CONFIG, Converter.class);\n this.valueConverter.configure(config.originalsWithPrefix(\"value.converter.\"), false);\n this.internalKeyConverter = config.getConfiguredInstance(WorkerConfig.INTERNAL_KEY_CONVERTER_CLASS_CONFIG, Converter.class);\n this.internalKeyConverter.configure(config.originalsWithPrefix(\"internal.key.converter.\"), true);\n this.internalValueConverter = config.getConfiguredInstance(WorkerConfig.INTERNAL_VALUE_CONVERTER_CLASS_CONFIG, Converter.class);\n this.internalValueConverter.configure(config.originalsWithPrefix(\"internal.value.converter.\"), false);\n\n this.offsetBackingStore = offsetBackingStore;\n this.offsetBackingStore.configure(config.originals());\n }\n\n public void start() {\n log.info(\"Worker starting\");\n\n Properties unusedConfigs = config.unusedProperties();\n\n Map<String, Object> producerProps = new HashMap<>();\n producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, Utils.join(config.getList(WorkerConfig.BOOTSTRAP_SERVERS_CONFIG), \",\"));\n producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, \"org.apache.kafka.common.serialization.ByteArraySerializer\");\n producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, \"org.apache.kafka.common.serialization.ByteArraySerializer\");\n for (String propName : unusedConfigs.stringPropertyNames()) {\n producerProps.put(propName, unusedConfigs.getProperty(propName));\n }\n producer = new KafkaProducer<>(producerProps);\n\n offsetBackingStore.start();\n sourceTaskOffsetCommitter = new SourceTaskOffsetCommitter(time, config);\n\n log.info(\"Worker started\");\n }\n\n public void stop() {\n log.info(\"Worker stopping\");\n\n long started = time.milliseconds();\n long limit = started + config.getLong(WorkerConfig.TASK_SHUTDOWN_GRACEFUL_TIMEOUT_MS_CONFIG);\n\n for (Map.Entry<String, Connector> entry : connectors.entrySet()) {\n Connector conn = entry.getValue();\n log.warn(\"Shutting down connector {} uncleanly; herder should have shut down connectors before the\" +\n \"Worker is stopped.\", conn);\n try {\n conn.stop();\n } catch (CopycatException e) {\n log.error(\"Error while shutting down connector \" + conn, e);\n }\n }\n\n for (Map.Entry<ConnectorTaskId, WorkerTask> entry : tasks.entrySet()) {\n WorkerTask task = entry.getValue();\n log.warn(\"Shutting down task {} uncleanly; herder should have shut down \"\n + \"tasks before the Worker is stopped.\", task);\n try {\n task.stop();\n } catch (CopycatException e) {\n log.error(\"Error while shutting down task \" + task, e);\n }\n }\n\n for (Map.Entry<ConnectorTaskId, WorkerTask> entry : tasks.entrySet()) {\n WorkerTask task = entry.getValue();\n log.debug(\"Waiting for task {} to finish shutting down\", task);\n if (!task.awaitStop(Math.max(limit - time.milliseconds(), 0)))\n log.error(\"Graceful shutdown of task {} failed.\", task);\n task.close();\n }\n\n long timeoutMs = limit - time.milliseconds();\n sourceTaskOffsetCommitter.close(timeoutMs);\n\n offsetBackingStore.stop();\n\n log.info(\"Worker stopped\");\n }\n\n /**\n * Add a new connector.\n * @param connConfig connector configuration\n * @param ctx context for the connector\n */\n public void addConnector(ConnectorConfig connConfig, ConnectorContext ctx) {\n String connName = connConfig.getString(ConnectorConfig.NAME_CONFIG);\n Class<?> maybeConnClass = connConfig.getClass(ConnectorConfig.CONNECTOR_CLASS_CONFIG);\n log.info(\"Creating connector {} of type {}\", connName, maybeConnClass.getName());\n\n Class<? extends Connector> connClass;\n try {\n connClass = maybeConnClass.asSubclass(Connector.class);\n } catch (ClassCastException e) {\n throw new CopycatException(\"Specified class is not a subclass of Connector: \" + maybeConnClass.getName());\n }\n\n if (connectors.containsKey(connName))\n throw new CopycatException(\"Connector with name \" + connName + \" already exists\");\n\n final Connector connector = instantiateConnector(connClass);\n connector.initialize(ctx);\n try {\n Map<String, Object> originals = connConfig.originals();\n Properties props = new Properties();\n props.putAll(originals);\n connector.start(props);\n } catch (CopycatException e) {\n throw new CopycatException(\"Connector threw an exception while starting\", e);\n }\n\n connectors.put(connName, connector);\n\n log.info(\"Finished creating connector {}\", connName);\n }\n\n private static Connector instantiateConnector(Class<? extends Connector> connClass) {\n try {\n return Utils.newInstance(connClass);\n } catch (Throwable t) {\n // Catches normal exceptions due to instantiation errors as well as any runtime errors that\n // may be caused by user code\n throw new CopycatException(\"Failed to create connector instance\", t);\n }\n }\n\n public Map<ConnectorTaskId, Map<String, String>> reconfigureConnectorTasks(String connName, int maxTasks, List<String> sinkTopics) {\n log.trace(\"Reconfiguring connector tasks for {}\", connName);\n\n Connector connector = connectors.get(connName);\n if (connector == null)\n throw new CopycatException(\"Connector \" + connName + \" not found in this worker.\");\n\n Map<ConnectorTaskId, Map<String, String>> result = new HashMap<>();\n String taskClassName = connector.taskClass().getName();\n int index = 0;\n for (Properties taskProps : connector.taskConfigs(maxTasks)) {\n ConnectorTaskId taskId = new ConnectorTaskId(connName, index);\n index++;\n Map<String, String> taskConfig = Utils.propsToStringMap(taskProps);\n taskConfig.put(TaskConfig.TASK_CLASS_CONFIG, taskClassName);\n if (sinkTopics != null)\n taskConfig.put(SinkTask.TOPICS_CONFIG, Utils.join(sinkTopics, \",\"));\n result.put(taskId, taskConfig);\n }\n return result;\n }\n\n public void stopConnector(String connName) {\n log.info(\"Stopping connector {}\", connName);\n\n Connector connector = connectors.get(connName);\n if (connector == null)\n throw new CopycatException(\"Connector \" + connName + \" not found in this worker.\");\n\n try {\n connector.stop();\n } catch (CopycatException e) {\n log.error(\"Error shutting down connector {}: \", connector, e);\n }\n\n connectors.remove(connName);\n\n log.info(\"Stopped connector {}\", connName);\n }\n\n /**\n * Get the IDs of the connectors currently running in this worker.\n */\n public Set<String> connectorNames() {\n return connectors.keySet();\n }\n\n /**\n * Add a new task.\n * @param id Globally unique ID for this task.\n * @param taskConfig the parsed task configuration\n */\n public void addTask(ConnectorTaskId id, TaskConfig taskConfig) {\n log.info(\"Creating task {}\", id);\n\n if (tasks.containsKey(id)) {\n String msg = \"Task already exists in this worker; the herder should not have requested \"\n + \"that this : \" + id;\n log.error(msg);\n throw new CopycatException(msg);\n }\n\n final Task task = instantiateTask(taskConfig.getClass(TaskConfig.TASK_CLASS_CONFIG).asSubclass(Task.class));\n\n // Decide which type of worker task we need based on the type of task.\n final WorkerTask workerTask;\n if (task instanceof SourceTask) {\n SourceTask sourceTask = (SourceTask) task;\n OffsetStorageReader offsetReader = new OffsetStorageReaderImpl(offsetBackingStore, id.connector(),\n internalKeyConverter, internalValueConverter);\n OffsetStorageWriter offsetWriter = new OffsetStorageWriter(offsetBackingStore, id.connector(),\n internalKeyConverter, internalValueConverter);\n workerTask = new WorkerSourceTask(id, sourceTask, keyConverter, valueConverter, producer,\n offsetReader, offsetWriter, config, time);\n } else if (task instanceof SinkTask) {\n workerTask = new WorkerSinkTask(id, (SinkTask) task, config, keyConverter, valueConverter, time);\n } else {\n log.error(\"Tasks must be a subclass of either SourceTask or SinkTask\", task);\n throw new CopycatException(\"Tasks must be a subclass of either SourceTask or SinkTask\");\n }\n\n // Start the task before adding modifying any state, any exceptions are caught higher up the\n // call chain and there's no cleanup to do here\n Properties props = new Properties();\n props.putAll(taskConfig.originals());\n workerTask.start(props);\n if (task instanceof SourceTask) {\n WorkerSourceTask workerSourceTask = (WorkerSourceTask) workerTask;\n sourceTaskOffsetCommitter.schedule(id, workerSourceTask);\n }\n tasks.put(id, workerTask);\n }\n\n private static Task instantiateTask(Class<? extends Task> taskClass) {\n try {\n return Utils.newInstance(taskClass);\n } catch (KafkaException e) {\n throw new CopycatException(\"Task class not found\", e);\n }\n }\n\n public void stopTask(ConnectorTaskId id) {\n log.info(\"Stopping task {}\", id);\n\n WorkerTask task = getTask(id);\n if (task instanceof WorkerSourceTask)\n sourceTaskOffsetCommitter.remove(id);\n task.stop();\n if (!task.awaitStop(config.getLong(WorkerConfig.TASK_SHUTDOWN_GRACEFUL_TIMEOUT_MS_CONFIG)))\n log.error(\"Graceful stop of task {} failed.\", task);\n task.close();\n tasks.remove(id);\n }\n\n /**\n * Get the IDs of the tasks currently running in this worker.\n */\n public Set<ConnectorTaskId> taskIds() {\n return tasks.keySet();\n }\n\n private WorkerTask getTask(ConnectorTaskId id) {\n WorkerTask task = tasks.get(id);\n if (task == null) {\n log.error(\"Task not found: \" + id);\n throw new CopycatException(\"Task not found: \" + id);\n }\n return task;\n }\n\n public Converter getInternalKeyConverter() {\n return internalKeyConverter;\n }\n\n public Converter getInternalValueConverter() {\n return internalValueConverter;\n }\n}\n", "meta": {"content_hash": "6dc7afa4b06ec1e47ae7f5bc03bc904f", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 139, "avg_line_length": 41.308411214953274, "alnum_prop": 0.6619909502262443, "repo_name": "bluebreezecf/kafka", "id": "b37e49f82b0bfabc61ddb7dc8a9db121a92194e6", "size": "14069", "binary": false, "copies": "1", "ref": "refs/heads/trunk", "path": "copycat/runtime/src/main/java/org/apache/kafka/copycat/runtime/Worker.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "20579"}, {"name": "HTML", "bytes": "5443"}, {"name": "Java", "bytes": "3079838"}, {"name": "Python", "bytes": "481095"}, {"name": "Scala", "bytes": "2641655"}, {"name": "Shell", "bytes": "92527"}, {"name": "XSLT", "bytes": "7116"}]}} +{"text": "\n\n\npackage org.apache.geode.internal.cache.entries;\n\n// DO NOT modify this class. It was generated from LeafRegionEntry.cpp\nimport java.util.concurrent.atomic.AtomicLongFieldUpdater;\n\nimport org.apache.geode.internal.cache.DiskId;\nimport org.apache.geode.internal.cache.DiskStoreImpl;\nimport org.apache.geode.internal.cache.PlaceHolderDiskRegion;\nimport org.apache.geode.internal.cache.RegionEntry;\nimport org.apache.geode.internal.cache.RegionEntryContext;\nimport org.apache.geode.internal.cache.eviction.EvictionController;\nimport org.apache.geode.internal.cache.persistence.DiskRecoveryStore;\nimport org.apache.geode.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;\n\n/*\n * macros whose definition changes this class:\n *\n * disk: DISK lru: LRU stats: STATS versioned: VERSIONED offheap: OFFHEAP\n *\n * One of the following key macros must be defined:\n *\n * key object: KEY_OBJECT key int: KEY_INT key long: KEY_LONG key uuid: KEY_UUID key string1:\n * KEY_STRING1 key string2: KEY_STRING2\n */\n/**\n * Do not modify this class. It was generated. Instead modify LeafRegionEntry.cpp and then run\n * ./dev-tools/generateRegionEntryClasses.sh (it must be run from the top level directory).\n */\npublic class VMThinDiskRegionEntryHeapIntKey extends VMThinDiskRegionEntryHeap {\n // --------------------------------------- common fields ----------------------------------------\n private static final AtomicLongFieldUpdater<VMThinDiskRegionEntryHeapIntKey> LAST_MODIFIED_UPDATER =\n AtomicLongFieldUpdater.newUpdater(VMThinDiskRegionEntryHeapIntKey.class, \"lastModified\");\n protected int hash;\n private HashEntry<Object, Object> nextEntry;\n @SuppressWarnings(\"unused\")\n private volatile long lastModified;\n private volatile Object value;\n // ---------------------------------------- disk fields -----------------------------------------\n /**\n * @since GemFire 5.1\n */\n protected DiskId id;\n // --------------------------------------- key fields -------------------------------------------\n // DO NOT modify this class. It was generated from LeafRegionEntry.cpp\n private final int key;\n\n public VMThinDiskRegionEntryHeapIntKey(final RegionEntryContext context, final int key,\n final Object value) {\n super(context, (value instanceof RecoveredEntry ? null : value));\n // DO NOT modify this class. It was generated from LeafRegionEntry.cpp\n initialize(context, value);\n this.key = key;\n }\n\n // DO NOT modify this class. It was generated from LeafRegionEntry.cpp\n @Override\n protected Object getValueField() {\n return this.value;\n }\n\n @Override\n protected void setValueField(final Object value) {\n this.value = value;\n }\n\n @Override\n protected long getLastModifiedField() {\n return LAST_MODIFIED_UPDATER.get(this);\n }\n\n @Override\n protected boolean compareAndSetLastModifiedField(final long expectedValue, final long newValue) {\n return LAST_MODIFIED_UPDATER.compareAndSet(this, expectedValue, newValue);\n }\n\n @Override\n public int getEntryHash() {\n return this.hash;\n }\n\n @Override\n protected void setEntryHash(final int hash) {\n this.hash = hash;\n }\n\n @Override\n public HashEntry<Object, Object> getNextEntry() {\n return this.nextEntry;\n }\n\n @Override\n public void setNextEntry(final HashEntry<Object, Object> nextEntry) {\n this.nextEntry = nextEntry;\n }\n\n // ----------------------------------------- disk code ------------------------------------------\n // DO NOT modify this class. It was generated from LeafRegionEntry.cpp\n protected void initialize(final RegionEntryContext context, final Object value) {\n diskInitialize(context, value);\n }\n\n @Override\n public int updateAsyncEntrySize(final EvictionController evictionController) {\n throw new IllegalStateException(\"should never be called\");\n }\n\n // DO NOT modify this class. It was generated from LeafRegionEntry.cpp\n @Override\n public DiskId getDiskId() {\n return this.id;\n }\n\n @Override\n public void setDiskId(final RegionEntry oldEntry) {\n this.id = ((DiskEntry) oldEntry).getDiskId();\n }\n\n private void diskInitialize(final RegionEntryContext context, final Object value) {\n DiskRecoveryStore diskRecoveryStore = (DiskRecoveryStore) context;\n DiskStoreImpl diskStore = diskRecoveryStore.getDiskStore();\n long maxOplogSize = diskStore.getMaxOplogSize();\n // get appropriate instance of DiskId implementation based on maxOplogSize\n this.id = DiskId.createDiskId(maxOplogSize, true, diskStore.needsLinkedList());\n Helper.initialize(this, diskRecoveryStore, value);\n }\n\n // ----------------------------------------- key code -------------------------------------------\n // DO NOT modify this class. It was generated from LeafRegionEntry.cpp\n @Override\n public Object getKey() {\n return this.key;\n }\n\n @Override\n public boolean isKeyEqual(final Object key) {\n if (key instanceof Integer) {\n return ((Integer) key).intValue() == this.key;\n }\n return false;\n }\n // DO NOT modify this class. It was generated from LeafRegionEntry.cpp\n}\n", "meta": {"content_hash": "e13cb1c42ae90d6e3f52ddd628c608d8", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 102, "avg_line_length": 34.84827586206897, "alnum_prop": 0.687908173362359, "repo_name": "smanvi-pivotal/geode", "id": "92363f96a7e310faa9eb04541b8f2908e9d9da16", "size": "5842", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/entries/VMThinDiskRegionEntryHeapIntKey.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "106707"}, {"name": "Groovy", "bytes": "2928"}, {"name": "HTML", "bytes": "3998074"}, {"name": "Java", "bytes": "26700079"}, {"name": "JavaScript", "bytes": "1781013"}, {"name": "Ruby", "bytes": "6751"}, {"name": "Shell", "bytes": "21891"}]}} +{"text": "\ufeffusing System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Windows;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"nil-runtime\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"nil-runtime\")]\n[assembly: AssemblyCopyright(\"Copyright \u00a9 2016\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components. If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n//In order to begin building localizable applications, set \n//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file\n//inside a <PropertyGroup>. For example, if you are using US english\n//in your source files, set the <UICulture> to en-US. Then uncomment\n//the NeutralResourceLanguage attribute below. Update the \"en-US\" in\n//the line below to match the UICulture setting in the project file.\n\n//[assembly: NeutralResourcesLanguage(\"en-US\", UltimateResourceFallbackLocation.Satellite)]\n\n\n[assembly: ThemeInfo(\n ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\n //(used if a resource is not found in the page, \n // or application resource dictionaries)\n ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\n //(used if a resource is not found in the page, \n // app, or any theme specific resource dictionaries)\n)]\n\n\n// Version information for an assembly consists of the following four values:\n//\n// Major Version\n// Minor Version \n// Build Number\n// Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n", "meta": {"content_hash": "77481f0647e02de905ab2c3f50bc9b00", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 98, "avg_line_length": 43.236363636363635, "alnum_prop": 0.7060555088309504, "repo_name": "zhongzf/nativescript-dotnet-runtime", "id": "9bfbc4e51d7048250d63d6d0c6a7f02e1c6095eb", "size": "2381", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nil-runtime/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "85788"}, {"name": "JavaScript", "bytes": "2760248"}]}} +{"text": "<form method=\"post\">{% csrf_token %}\r\n \u00bfEst\u00e1s seguro que deseas borrar \"{{ object }}\"?\r\n <input type=\"submit\" value=\"Submit\" />\r\n</form>", "meta": {"content_hash": "c4fef9e41ae222ee1cc0fea65addde63", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 51, "avg_line_length": 35.5, "alnum_prop": 0.5985915492957746, "repo_name": "GoberInfinity/ExampleDjango", "id": "417a387fe6c3466b70981ca6fae8d52886505327", "size": "144", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "crudclassviews/templates/crudclassviews/person_confirm_delete.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "187"}, {"name": "HTML", "bytes": "2054"}, {"name": "JavaScript", "bytes": "615"}, {"name": "Python", "bytes": "16642"}]}} +{"text": "import * as yargs from \"yargs\";\n\nexport function initCLI() {\n console.log(\"init cli\");\n}\n", "meta": {"content_hash": "13878994ea13d4b9806c7eaf242fb0f4", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 31, "avg_line_length": 18.4, "alnum_prop": 0.6521739130434783, "repo_name": "pnml/fuse-box", "id": "b78d2c491e5886bae60ff92173defd759a4f0119", "size": "92", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/cli/entry.ts", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "533"}, {"name": "HTML", "bytes": "44"}, {"name": "JavaScript", "bytes": "646157"}, {"name": "TypeScript", "bytes": "926593"}]}} +{"text": "/*global module, test, equal, ok, jQuery */\n(function ($) {\n \"use strict\";\n\n /* If there is no delegation support, forcibly reset the plugin between\n * test runs\n */\n function resetPlugin() {\n if (!$.fn.on && !$.fn.delegate && !$.fn.live) {\n $.fn.example.boundClassNames = [];\n }\n }\n\n module(\"Basic usage\", {\n setup: function () {\n $('#basic1').example('Test');\n $('#basicform').submit(function (e) {\n e.preventDefault();\n });\n },\n teardown: resetPlugin\n });\n test(\"should have an example set\", function () {\n equal($('#basic1').val(), \"Test\", \"The example should read 'Test'.\");\n ok($('#basic1').hasClass('example'), \"The class should be 'example'.\");\n });\n test(\"should be cleared on focus\", function () {\n $('#basic1').focus();\n\n equal($('#basic1').val(), \"\", \"The example should be cleared.\");\n ok(!$('#basic1').hasClass('example'), \"The class should no longer be 'example'.\");\n });\n test(\"should reappear on blur if empty\", function () {\n $('#basic1').focus().blur();\n\n equal($('#basic1').val(), \"Test\", \"The example should read 'Test'.\");\n ok($('#basic1').hasClass('example'), \"The class should be 'example'.\");\n });\n test(\"should not be populated with an example on blur if user input is present\", function () {\n $('#basic1').focus();\n $('#basic1').val(\"My own value\");\n $('#basic1').blur();\n\n equal($('#basic1').val(), \"My own value\", \"The example should not be cleared.\");\n ok(!$('#basic1').hasClass('example'), \"The class should not be 'example'.\");\n });\n test(\"should not be populated with an example on focus if user input is present\", function () {\n $('#basic1').focus().val(\"My own value\").blur().focus();\n\n equal($('#basic1').val(), \"My own value\", \"The example should not be cleared.\");\n ok(!$('#basic1').hasClass('example'), \"The class should not be 'example'.\");\n });\n test(\"should be cleared on form submit\", function () {\n $('#basicform').submit();\n\n equal($('#basic1').val(), \"\", \"The example should be cleared.\");\n });\n test(\"shouldn't clear user inputs on form submit\", function () {\n $('#basic2').focus().val(\"User input\");\n $('#basicform').triggerHandler('submit');\n\n equal($('#basic2').val(), \"User input\", \"The user input should be intact.\");\n });\n\n module(\"Using custom classes\", {\n setup: function () {\n $('#custom1').example(\"Test\", {className: \"notExample\"});\n },\n teardown: resetPlugin\n });\n test(\"should have an example set\", function () {\n equal($('#custom1').val(), \"Test\", \"The example should be set.\");\n ok($('#custom1').hasClass('notExample'), \"The class should be the specified one.\");\n ok(!$('#custom1').hasClass('example'), \"The class should not be 'example'.\");\n });\n test(\"should be cleared on focus\", function () {\n $('#custom1').focus();\n\n equal($('#custom1').val(), \"\", \"The example should be cleared.\");\n ok(!$('#custom1').hasClass('notExample'), \"The class should not be the specified one.\");\n });\n test(\"should be reappear on blur\", function () {\n $('#custom1').focus().blur();\n\n equal($('#custom1').val(), \"Test\", \"The example should reappear.\");\n ok($('#custom1').hasClass('notExample'), \"The class should be the specified one.\");\n });\n\n module(\"Multiple forms\", {\n setup: function () {\n $('#multipleform1, #multipleform2').submit(function (e) {\n e.preventDefault();\n });\n $('#mf1').example('Test');\n $('#mf2').example('Test');\n },\n teardown: resetPlugin\n });\n test(\"should only clear examples in that form\", function () {\n $('#multipleform1').submit();\n\n equal($('#mf1').val(), \"\", \"The example should be cleared.\");\n equal($('#mf2').val(), \"Test\", \"An example in another form should not be cleared.\");\n });\n\n module(\"Simple callback\", {\n setup: function () {\n $('#callback1').example(function () { return \"Callback Test\"; });\n },\n teardown: resetPlugin\n });\n test(\"should have an example set\", function () {\n equal($('#callback1').val(), \"Callback Test\", \"The example should read 'Callback Test'.\");\n ok($('#callback1').hasClass('example'), \"The class should be 'example'.\");\n });\n test(\"should be cleared on focus\", function () {\n $('#callback1').focus();\n\n equal($('#callback1').val(), \"\", \"The example should be cleared.\");\n ok(!$('#callback1').hasClass('example'), \"The class should no longer be 'example'.\");\n });\n test(\"should reappear on blur if empty\", function () {\n $('#callback1').focus().blur();\n\n equal($('#callback1').val(), \"Callback Test\", \"The example should read 'Callback Test'.\");\n ok($('#callback1').hasClass('example'), \"The class should be 'example'.\");\n });\n\n module(\"More complicated callback\", {\n setup: function () {\n $('#callback2').example(function () {\n return $(this).attr('title');\n });\n },\n teardown: resetPlugin\n });\n test(\"should have an example set\", function () {\n equal($('#callback2').val(), \"Starting\", \"The example should read 'Starting'.\");\n ok($('#callback2').hasClass('example'), \"The class should be 'example'.\");\n });\n test(\"should be cleared on focus\", function () {\n $('#callback2').focus();\n\n equal($('#callback2').val(), \"\", \"The example should be cleared.\");\n ok(!$('#callback2').hasClass('example'), \"The class should no longer be 'example'.\");\n });\n test(\"should reappear on blur if empty\", function () {\n $('#callback2').focus().blur();\n\n equal($('#callback2').val(), \"Starting\", \"The example should read 'Starting'.\");\n ok($('#callback2').hasClass('example'), \"The class should be 'example'.\");\n });\n test(\"should run the callback every time instead of caching it\", function () {\n $('#callback2').attr('title', 'Another');\n $('#callback2').focus().blur();\n\n equal($('#callback2').val(), \"Another\", \"The example should read 'Another'.\");\n ok($('#callback2').hasClass('example'), \"The class should be 'example'.\");\n });\n\n module(\"Metadata plugin\", {\n setup: function () {\n $('#m1').example();\n },\n teardown: resetPlugin\n });\n test(\"should have an example set\", function () {\n equal($('#m1').val(), \"Something\", \"The example should read 'Something'.\");\n ok($('#m1').hasClass('m1'), \"The class should be 'm1'.\");\n });\n test(\"should be cleared on focus\", function () {\n $('#m1').focus();\n\n equal($('#m1').val(), \"\", \"The example should be cleared.\");\n ok(!$('#m1').hasClass('m1'), \"The class should no longer be 'm1'.\");\n });\n test(\"should reappear on blur if empty\", function () {\n $('#m1').focus().blur();\n\n equal($('#m1').val(), \"Something\", \"The example should read 'Something'.\");\n ok($('#m1').hasClass('m1'), \"The class should be 'm1'.\");\n });\n test(\"should be overridden by arguments\", function () {\n $('#m2').example('Precedence', {className: 'o1'});\n\n equal($('#m2').val(), \"Precedence\", \"The example in the arguments should take precedence\");\n ok($('#m2').hasClass('o1'), \"The class should be 'o1'.\");\n });\n\n module(\"On page load\", {\n teardown: resetPlugin\n });\n test(\"should not set an example if a value is already set\", function () {\n $('#load1').example(\"Test\");\n\n equal($('#load1').val(), \"Already filled in\", \"The example should not be set.\");\n ok(!$('#load1').hasClass('example'), \"The class should not be 'example'.\");\n });\n test(\"should not clear a field with a value even when using a callback\", function () {\n $('#load2').example(function () {\n return \"Nope\";\n });\n\n equal($('#load2').val(), \"Default\", \"The value should be the default.\");\n ok(!$('#load2').hasClass('example'), \"The class should not be 'example'.\");\n });\n\n module(\"Changing values by Javascript\", {\n setup: function () {\n $('#f1').example('Example');\n },\n teardown: resetPlugin\n });\n test(\"should set example\", function () {\n equal($('#f1').val(), \"Example\", \"The example should read 'Example'.\");\n ok($('#f1').hasClass('example'), \"The example class should be set.\");\n });\n\n test(\"should remove example class when changed\", function () {\n $('#f1').val(\"New value\");\n $('#f1').change();\n\n equal($('#f1').val(), \"New value\", \"Value should be changed to 'New value'.\");\n ok(!$('#f1').hasClass('example'), \"The example class should no longer be set.\");\n\n /* Clear the field between test runs. */\n $('#f1').val('');\n });\n\n module(\"Clearing values when loaded from cache\", {\n teardown: resetPlugin\n });\n test(\"value should be set to default value\", function () {\n\n /* Fake loading from cache by setting the example to be different to\n * the recorded defaultValue.\n */\n $('#c1').val('Cached example').example('Cached example');\n equal($('#c1').val(), \"Filled in\", \"Value should have been reset to 'Filled in'.\");\n });\n test(\"value should be cleared and set to the example if without default\", function () {\n $('#c2').val('Cached example').example('Cached example');\n equal($('#c2').val(), 'Cached example', \"Value should have been emptied.\");\n ok($('#c2').hasClass('example'), 'The example class should be set.');\n });\n test(\"value is not touched if it doesn't match the example\", function () {\n $('#c3').val('Some user input').example('Test');\n equal($('#c3').val(), 'Some user input', 'Value should not have been modified.');\n ok(!$('#c3').hasClass('example'), 'The example class should not be set.');\n });\n test('value is always cleared if the example is a callback', function () {\n $('#c4').val('Some user input').example(function () {\n return 'Test';\n });\n equal($('#c4').val(), 'Test', 'The cached value is overridden.');\n ok($('#c4').hasClass('example'), 'The example class should be set.');\n });\n test('value is not touched if it is the default', function () {\n $('#c5').val('Some default').example('Test');\n equal($('#c5').val(), 'Some default', 'Value should not have been modified.');\n ok(!$('#c5').hasClass('example'), 'The example class should not be set.');\n });\n\n module('Custom events', {\n teardown: resetPlugin\n });\n test('a specific form is cleared when calling example:resetForm on it', function () {\n $('#ce1, #ce2').example('Testing');\n $('#custom').trigger('example:resetForm');\n equal($('#ce1').val(), '', 'The value should have been cleared.');\n ok(!$('#ce1').hasClass('example'), 'The example class should not be set.');\n equal($('#ce2').val(), 'Testing', 'The value should not have been cleared.');\n ok($('#ce2').hasClass('example'), 'The example class should be set.');\n });\n test('triggering example:resetForm on a field will bubble to the form', function () {\n $('#ce1').example('Testing');\n $('#ce1').trigger('example:resetForm');\n equal($('#ce1').val(), '', 'The value should have been cleared.');\n ok(!$('#ce1').hasClass('example'), 'The example class should not be set.');\n });\n}(jQuery));\n", "meta": {"content_hash": "36ff2e589dff2edf047d73e54038b016", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 99, "avg_line_length": 41.779359430604984, "alnum_prop": 0.547274275979557, "repo_name": "mudge/jquery_example", "id": "bc881493b21f22c98ac4deb594978428aff164c3", "size": "11740", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/jquery.example_test.js", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "4602"}, {"name": "HTML", "bytes": "3105"}, {"name": "JavaScript", "bytes": "66502"}, {"name": "Ruby", "bytes": "147"}]}} +{"text": "<?php\n\nnamespace Drupal\\block;\n\nuse Drupal\\Core\\Block\\BlockPluginInterface;\nuse Drupal\\Core\\Config\\Entity\\ConfigEntityInterface;\n\n/**\n * Provides an interface defining a block entity.\n */\ninterface BlockInterface extends ConfigEntityInterface {\n\n /**\n * Indicates the block label (title) should be displayed to end users.\n *\n * @deprecated in Drupal 8.3.x, will be removed before Drupal 9.0.0.\n * Use \\Drupal\\Core\\Block\\BlockPluginInterface::BLOCK_LABEL_VISIBLE.\n *\n * @see https://www.drupal.org/node/2829775\n */\n const BLOCK_LABEL_VISIBLE = BlockPluginInterface::BLOCK_LABEL_VISIBLE;\n\n /**\n * Denotes that a block is not enabled in any region and should not be shown.\n *\n * @deprecated Scheduled for removal in Drupal 9.0.0.\n */\n const BLOCK_REGION_NONE = -1;\n\n /**\n * Returns the plugin instance.\n *\n * @return \\Drupal\\Core\\Block\\BlockPluginInterface\n * The plugin instance for this block.\n */\n public function getPlugin();\n\n /**\n * Returns the plugin ID.\n *\n * @return string\n * The plugin ID for this block.\n */\n public function getPluginId();\n\n /**\n * Returns the region this block is placed in.\n *\n * @return string\n * The region this block is placed in.\n */\n public function getRegion();\n\n /**\n * Returns the theme ID.\n *\n * @return string\n * The theme ID for this block instance.\n */\n public function getTheme();\n\n /**\n * Returns an array of visibility condition configurations.\n *\n * @return array\n * An array of visibility condition configuration keyed by the condition ID.\n */\n public function getVisibility();\n\n /**\n * Gets conditions for this block.\n *\n * @return \\Drupal\\Core\\Condition\\ConditionInterface[]|\\Drupal\\Core\\Condition\\ConditionPluginCollection\n * An array or collection of configured condition plugins.\n */\n public function getVisibilityConditions();\n\n /**\n * Gets a visibility condition plugin instance.\n *\n * @param string $instance_id\n * The condition plugin instance ID.\n *\n * @return \\Drupal\\Core\\Condition\\ConditionInterface\n * A condition plugin.\n */\n public function getVisibilityCondition($instance_id);\n\n /**\n * Sets the visibility condition configuration.\n *\n * @param string $instance_id\n * The condition instance ID.\n * @param array $configuration\n * The condition configuration.\n *\n * @return $this\n */\n public function setVisibilityConfig($instance_id, array $configuration);\n\n /**\n * Returns the weight of this block (used for sorting).\n *\n * @return int\n * The block weight.\n */\n public function getWeight();\n\n /**\n * Sets the region this block is placed in.\n *\n * @param string $region\n * The region to place this block in.\n *\n * @return $this\n */\n public function setRegion($region);\n\n /**\n * Sets the block weight.\n *\n * @param int $weight\n * The desired weight.\n *\n * @return $this\n */\n public function setWeight($weight);\n\n /**\n * Creates a duplicate of the block entity.\n *\n * @param string $new_id\n * (optional) The new ID on the duplicate block.\n * @param string $new_theme\n * (optional) The theme on the duplicate block.\n *\n * @return static\n * A clone of $this with all identifiers unset, so saving it inserts a new\n * entity into the storage system.\n */\n public function createDuplicateBlock($new_id = NULL, $new_theme = NULL);\n\n}\n", "meta": {"content_hash": "630d823d07c3b7def923126c3b6565ef", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 105, "avg_line_length": 23.958041958041957, "alnum_prop": 0.6579100992410974, "repo_name": "leorawe/sci-base", "id": "f4ce6268c2adedc3c6bd7e7acc5a1da77f6dd698", "size": "3426", "binary": false, "copies": "68", "ref": "refs/heads/master", "path": "web/core/modules/block/src/BlockInterface.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "891567"}, {"name": "Gherkin", "bytes": "3374"}, {"name": "HTML", "bytes": "809692"}, {"name": "JavaScript", "bytes": "1514397"}, {"name": "PHP", "bytes": "36312357"}, {"name": "Ruby", "bytes": "63696"}, {"name": "Shell", "bytes": "59930"}]}} +{"text": "var path = require('path');\nvar url = require('url');\n\nfunction fromFileURL(url) {\n return url.substr(7 + !!process.platform.match(/^win/)).replace(/\\//g, path.sep);\n}\nexports.fromFileURL = fromFileURL;\n\nfunction toFileURL(path) {\n return 'file://' + (process.platform.match(/^win/) ? '/' : '') + path.replace(/\\\\/g, '/');\n}\nexports.toFileURL = toFileURL;\n\nfunction isFileURL(url) {\n return url.substr(0, 5) === 'file:';\n}\nexports.isFileURL = isFileURL;\n\n/* Remove scheme prefix from file URLs, so that they are paths. */\nfunction filePath(url) {\n if (isFileURL(url))\n return url.replace(/^file:\\/+/, '/');\n}\nexports.filePath = filePath;\n\n/* Coerce URLs to paths, assuming they are file URLs */\nfunction coercePath(url) {\n if (isFileURL(url))\n return url.replace(/^file:\\/+/, '/');\n else\n // assume relative\n return path.resolve(process.cwd(), url);\n}\nexports.coercePath = coercePath;\n\nvar absURLRegEx = /^[^\\/]+:\\/\\//;\n\nfunction normalizePath(loader, path) {\n var curPath;\n if (loader.paths[path][0] == '.')\n curPath = decodeURI(url.resolve(toFileURL(process.cwd()) + '/', loader.paths[path]));\n else\n curPath = decodeURI(url.resolve(loader.baseURL, loader.paths[path]));\n if (loader.defaultJSExtensions && curPath.substr(curPath.length - 3, 3) != '.js')\n curPath += '.js';\n return curPath;\n}\n\nexports.getCanonicalName = getCanonicalName;\nfunction getCanonicalName(loader, normalized) {\n // remove the plugin part first\n var plugin;\n if (loader.pluginFirst) {\n var pluginIndex = normalized.indexOf('!');\n if (pluginIndex != -1) {\n plugin = normalized.substr(0, pluginIndex);\n normalized = normalized.substr(pluginIndex + 1);\n }\n }\n else {\n var pluginIndex = normalized.lastIndexOf('!');\n if (pluginIndex != -1) {\n plugin = normalized.substr(pluginIndex + 1);\n normalized = normalized.substr(0, pluginIndex);\n }\n }\n\n // now just reverse apply paths rules to get canonical name\n var pathMatch;\n\n // first check exact path matches\n for (var p in loader.paths) {\n if (loader.paths[p].indexOf('*') != -1)\n continue;\n\n var curPath = normalizePath(loader, p);\n\n if (normalized === curPath) {\n // always stop on first exact match\n pathMatch = p;\n break;\n }\n }\n\n // then wildcard matches\n var pathMatchLength = 0;\n var curMatchlength;\n if (!pathMatch)\n for (var p in loader.paths) {\n if (loader.paths[p].indexOf('*') == -1)\n continue;\n\n // normalize the output path\n var curPath = normalizePath(loader, p);\n\n // do reverse match\n var wIndex = curPath.indexOf('*');\n if (normalized.substr(0, wIndex) === curPath.substr(0, wIndex)\n && normalized.substr(normalized.length - curPath.length + wIndex + 1) === curPath.substr(wIndex + 1)) {\n curMatchLength = curPath.split('/').length;\n if (curMatchLength > pathMatchLength) {\n pathMatch = p.replace('*', normalized.substr(wIndex, normalized.length - curPath.length + 1));\n pathMatchLength = curMatchLength;\n }\n }\n }\n\n // when no path was matched, act like the standard rule is *: baseURL/*\n if (!pathMatch) {\n if (normalized.substr(0, loader.baseURL.length) == loader.baseURL)\n pathMatch = normalized.substr(loader.baseURL.length);\n else if (normalized.match(absURLRegEx))\n throw 'Unable to calculate canonical name to bundle ' + normalized;\n else\n pathMatch = normalized;\n }\n\n if (plugin) {\n if (loader.pluginFirst) {\n pathMatch = getCanonicalName(loader, plugin) + '!' + pathMatch;\n }\n else {\n pathMatch += '!' + getCanonicalName(loader, plugin);\n }\n }\n\n return pathMatch;\n}\n\nexports.getAlias = getAlias\nfunction getAlias(loader, canonicalName) {\n var bestAlias;\n\n function getBestAlias(mapped) {\n return canonicalName.substr(0, mapped.length) == mapped\n && (canonicalName.length == mapped.length || canonicalName[mapped.length + 1] == '/');\n }\n\n Object.keys(loader.map).forEach(function(alias) {\n if (getBestAlias(loader.map[alias]))\n bestAlias = alias;\n });\n\n if (bestAlias)\n return bestAlias;\n\n Object.keys(loader.packages).forEach(function(pkg) {\n Object.keys(loader.packages[pkg].map || {}).forEach(function(alias) {\n if (getBestAlias(loader.packages[pkg].map[alias]))\n bestAlias = alias;\n });\n });\n\n return bestAlias || canonicalName;\n}", "meta": {"content_hash": "461a16a1abe3111bec734ad1c864bb6e", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 111, "avg_line_length": 28.329032258064515, "alnum_prop": 0.6406285584149396, "repo_name": "synaptek/builder", "id": "93a55949e9728d5bc127000b355ec4bd5d83af27", "size": "4391", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/utils.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "7636"}, {"name": "JavaScript", "bytes": "113223"}]}} +{"text": "package org.bitcoins.server\n\nimport akka.actor.ActorSystem\nimport akka.http.scaladsl.server._\nimport akka.http.scaladsl.server.Directives._\nimport akka.stream.ActorMaterializer\nimport org.bitcoins.node.Node\n\ncase class NodeRoutes(node: Node)(implicit system: ActorSystem)\n extends ServerRoute {\n implicit val materializer = ActorMaterializer()\n\n def handleCommand: PartialFunction[ServerCommand, StandardRoute] = {\n case ServerCommand(\"getpeers\", _) =>\n complete {\n Server.httpSuccess(\"TODO implement getpeers\")\n }\n }\n}\n", "meta": {"content_hash": "d057f744080eb16e27dd188a803ff6ea", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 70, "avg_line_length": 28.736842105263158, "alnum_prop": 0.7545787545787546, "repo_name": "bitcoin-s/bitcoin-s-core", "id": "c5db4d25695457a687cb9936687b2d53ada05d40", "size": "546", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/server/src/main/scala/org/bitcoins/server/NodeRoutes.scala", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "2266"}, {"name": "Dockerfile", "bytes": "148"}, {"name": "Java", "bytes": "44689"}, {"name": "JavaScript", "bytes": "22991"}, {"name": "Scala", "bytes": "2222831"}, {"name": "Shell", "bytes": "804"}]}} +{"text": "Node.js - klaw\n==============\n\n<a href=\"https://standardjs.com\" style=\"float: right; padding: 0 0 20px 20px;\"><img src=\"https://cdn.rawgit.com/feross/standard/master/sticker.svg\" alt=\"JavaScript Standard Style\" width=\"100\" align=\"right\"></a>\n\nA Node.js file system walker extracted from [fs-extra](https://github.com/jprichardson/node-fs-extra).\n\n[](https://www.npmjs.org/package/klaw)\n[](http://travis-ci.org/jprichardson/node-klaw)\n[](https://ci.appveyor.com/project/jprichardson/node-klaw/branch/master)\n\nInstall\n-------\n\n npm i --save klaw\n\nIf you're using Typescript, we've got [types](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/11492/files):\n\n npm i --save-dev @types/klaw\n\n\nName\n----\n\n`klaw` is `walk` backwards :p\n\n\nSync\n----\n\nIf you need the same functionality but synchronous, you can use [klaw-sync](https://github.com/manidlou/node-klaw-sync).\n\n\nUsage\n-----\n\n### klaw(directory, [options])\n\nReturns a [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) that iterates\nthrough every file and directory starting with `dir` as the root. Every `read()` or `data` event\nreturns an object with two properties: `path` and `stats`. `path` is the full path of the file and\n`stats` is an instance of [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats).\n\n- `directory`: The directory to recursively walk. Type `string`.\n- `options`: [Readable stream options](https://nodejs.org/api/stream.html#stream_new_stream_readable_options) and\nthe following:\n - `queueMethod` (`string`, default: `'shift'`): Either `'shift'` or `'pop'`. On `readdir()` array, call either `shift()` or `pop()`.\n - `pathSorter` (`function`, default: `undefined`): Sorting [function for Arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort).\n - `fs` (`object`, default: [`graceful-fs`](https://github.com/isaacs/node-graceful-fs)): Use this to hook into the `fs` methods or to use [`mock-fs`](https://github.com/tschaub/mock-fs)\n - `filter` (`function`, default: `undefined`): Filtering [function for Arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n - `depthLimit` (`number`, default: `undefined`): The number of times to recurse before stopping. -1 for unlimited.\n - `preserveSymlinks` (`boolean`, default: `false`): Whether symlinks should be followed or treated as items themselves. If true, symlinks will be returned as items in their own right. If false, the linked item will be returned and potentially recursed into, in its stead.\n\n**Streams 1 (push) example:**\n\n```js\nconst klaw = require('klaw')\n\nconst items = [] // files, directories, symlinks, etc\nklaw('/some/dir')\n .on('data', item => items.push(item.path))\n .on('end', () => console.dir(items)) // => [ ... array of files]\n```\n\n**Streams 2 & 3 (pull) example:**\n\n```js\nconst klaw = require('klaw')\n\nconst items = [] // files, directories, symlinks, etc\nklaw('/some/dir')\n .on('readable', function () {\n let item\n while ((item = this.read())) {\n items.push(item.path)\n }\n })\n .on('end', () => console.dir(items)) // => [ ... array of files]\n```\n\n**```for-await-of``` example:**\n\n```js\nfor await (const file of klaw('/some/dir')) {\n console.log(file)\n}\n```\n\n### Error Handling\n\nListen for the `error` event.\n\nExample:\n\n```js\nconst klaw = require('klaw')\n\nklaw('/some/dir')\n .on('readable', function () {\n let item\n while ((item = this.read())) {\n // do something with the file\n }\n })\n .on('error', (err, item) => {\n console.log(err.message)\n console.log(item.path) // the file the error occurred on\n })\n .on('end', () => console.dir(items)) // => [ ... array of files]\n```\n\n\n### Aggregation / Filtering / Executing Actions (Through Streams)\n\nOn many occasions you may want to filter files based upon size, extension, etc.\nOr you may want to aggregate stats on certain file types. Or maybe you want to\nperform an action on certain file types.\n\nYou should use the module [`through2`](https://www.npmjs.com/package/through2) to easily\naccomplish this.\n\nInstall `through2`:\n\n npm i --save through2\n\n\n**Example (skipping directories):**\n\n```js\nconst klaw = require('klaw')\nconst through2 = require('through2')\n\nconst excludeDirFilter = through2.obj(function (item, enc, next) {\n if (!item.stats.isDirectory()) this.push(item)\n next()\n})\n\nconst items = [] // files, directories, symlinks, etc\nklaw('/some/dir')\n .pipe(excludeDirFilter)\n .on('data', item => items.push(item.path))\n .on('end', () => console.dir(items)) // => [ ... array of files without directories]\n```\n\n**Example (ignore hidden directories):**\n\n```js\nconst klaw = require('klaw')\nconst path = require('path')\n\nconst filterFunc = item => {\n const basename = path.basename(item)\n return basename === '.' || basename[0] !== '.'\n}\n\nklaw('/some/dir', { filter: filterFunc })\n .on('data', item => {\n // only items of none hidden folders will reach here\n })\n```\n\n**Example (totaling size of PNG files):**\n\n```js\nconst klaw = require('klaw')\nconst path = require('path')\nconst through2 = require('through2')\n\nlet totalPngsInBytes = 0\nconst aggregatePngSize = through2.obj(function (item, enc, next) {\n if (path.extname(item.path) === '.png') {\n totalPngsInBytes += item.stats.size\n }\n this.push(item)\n next()\n})\n\nklaw('/some/dir')\n .pipe(aggregatePngSize)\n .on('data', item => items.push(item.path))\n .on('end', () => console.dir(totalPngsInBytes)) // => total of all pngs (bytes)\n```\n\n\n**Example (deleting all .tmp files):**\n\n```js\nconst fs = require('fs')\nconst klaw = require('klaw')\nconst through2 = require('through2')\n\nconst deleteAction = through2.obj(function (item, enc, next) {\n this.push(item)\n\n if (path.extname(item.path) === '.tmp') {\n item.deleted = true\n fs.unlink(item.path, next)\n } else {\n item.deleted = false\n next()\n }\n})\n\nconst deletedFiles = []\nklaw('/some/dir')\n .pipe(deleteAction)\n .on('data', item => {\n if (!item.deleted) return\n deletedFiles.push(item.path)\n })\n .on('end', () => console.dir(deletedFiles)) // => all deleted files\n```\n\nYou can even chain a bunch of these filters and aggregators together. By using\nmultiple pipes.\n\n**Example (using multiple filters / aggregators):**\n\n```js\nklaw('/some/dir')\n .pipe(filterCertainFiles)\n .pipe(deleteSomeOtherFiles)\n .on('end', () => console.log('all done!'))\n```\n\n**Example passing (piping) through errors:**\n\nNode.js does not `pipe()` errors. This means that the error on one stream, like\n`klaw` will not pipe through to the next. If you want to do this, do the following:\n\n```js\nconst klaw = require('klaw')\nconst through2 = require('through2')\n\nconst excludeDirFilter = through2.obj(function (item, enc, next) {\n if (!item.stats.isDirectory()) this.push(item)\n next()\n})\n\nconst items = [] // files, directories, symlinks, etc\nklaw('/some/dir')\n .on('error', err => excludeDirFilter.emit('error', err)) // forward the error on\n .pipe(excludeDirFilter)\n .on('data', item => items.push(item.path))\n .on('end', () => console.dir(items)) // => [ ... array of files without directories]\n```\n\n\n### Searching Strategy\n\nPass in options for `queueMethod`, `pathSorter`, and `depthLimit` to affect how the file system\nis recursively iterated. See the code for more details, it's less than 50 lines :)\n\n\n\nLicense\n-------\n\nMIT\n\nCopyright (c) 2015 [JP Richardson](https://github.com/jprichardson)\n", "meta": {"content_hash": "c40fc12d4ab5dceefb1c12fadbedf6c9", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 273, "avg_line_length": 29.448275862068964, "alnum_prop": 0.6731720010408535, "repo_name": "jprichardson/node-klaw", "id": "58639696d86cee533eac91a2beb816ce134ce8a3", "size": "7686", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "11194"}]}} +{"text": "``` diff\n+namespace System.Drawing.Printing {\n+ public enum Duplex {\n+ Default = -1,\n+ Horizontal = 3,\n+ Simplex = 1,\n+ Vertical = 2,\n+ }\n+ public class InvalidPrinterException : SystemException {\n+ public InvalidPrinterException(PrinterSettings settings);\n+ protected InvalidPrinterException(SerializationInfo info, StreamingContext context);\n+ public override void GetObjectData(SerializationInfo info, StreamingContext context);\n+ }\n+ public class Margins : ICloneable {\n+ public Margins();\n+ public Margins(int left, int right, int top, int bottom);\n+ public int Bottom { get; set; }\n+ public int Left { get; set; }\n+ public int Right { get; set; }\n+ public int Top { get; set; }\n+ public object Clone();\n+ public override bool Equals(object obj);\n+ public override int GetHashCode();\n+ public static bool operator ==(Margins m1, Margins m2);\n+ public static bool operator !=(Margins m1, Margins m2);\n+ public override string ToString();\n+ }\n+ public class PageSettings : ICloneable {\n+ public PageSettings();\n+ public PageSettings(PrinterSettings printerSettings);\n+ public Rectangle Bounds { get; }\n+ public bool Color { get; set; }\n+ public float HardMarginX { get; }\n+ public float HardMarginY { get; }\n+ public bool Landscape { get; set; }\n+ public Margins Margins { get; set; }\n+ public PaperSize PaperSize { get; set; }\n+ public PaperSource PaperSource { get; set; }\n+ public RectangleF PrintableArea { get; }\n+ public PrinterResolution PrinterResolution { get; set; }\n+ public PrinterSettings PrinterSettings { get; set; }\n+ public object Clone();\n+ public void CopyToHdevmode(IntPtr hdevmode);\n+ public void SetHdevmode(IntPtr hdevmode);\n+ public override string ToString();\n+ }\n+ public enum PaperKind {\n+ A2 = 66,\n+ A3 = 8,\n+ A3Extra = 63,\n+ A3ExtraTransverse = 68,\n+ A3Rotated = 76,\n+ A3Transverse = 67,\n+ A4 = 9,\n+ A4Extra = 53,\n+ A4Plus = 60,\n+ A4Rotated = 77,\n+ A4Small = 10,\n+ A4Transverse = 55,\n+ A5 = 11,\n+ A5Extra = 64,\n+ A5Rotated = 78,\n+ A5Transverse = 61,\n+ A6 = 70,\n+ A6Rotated = 83,\n+ APlus = 57,\n+ B4 = 12,\n+ B4Envelope = 33,\n+ B4JisRotated = 79,\n+ B5 = 13,\n+ B5Envelope = 34,\n+ B5Extra = 65,\n+ B5JisRotated = 80,\n+ B5Transverse = 62,\n+ B6Envelope = 35,\n+ B6Jis = 88,\n+ B6JisRotated = 89,\n+ BPlus = 58,\n+ C3Envelope = 29,\n+ C4Envelope = 30,\n+ C5Envelope = 28,\n+ C65Envelope = 32,\n+ C6Envelope = 31,\n+ CSheet = 24,\n+ Custom = 0,\n+ DLEnvelope = 27,\n+ DSheet = 25,\n+ ESheet = 26,\n+ Executive = 7,\n+ Folio = 14,\n+ GermanLegalFanfold = 41,\n+ GermanStandardFanfold = 40,\n+ InviteEnvelope = 47,\n+ IsoB4 = 42,\n+ ItalyEnvelope = 36,\n+ JapaneseDoublePostcard = 69,\n+ JapaneseDoublePostcardRotated = 82,\n+ JapaneseEnvelopeChouNumber3 = 73,\n+ JapaneseEnvelopeChouNumber3Rotated = 86,\n+ JapaneseEnvelopeChouNumber4 = 74,\n+ JapaneseEnvelopeChouNumber4Rotated = 87,\n+ JapaneseEnvelopeKakuNumber2 = 71,\n+ JapaneseEnvelopeKakuNumber2Rotated = 84,\n+ JapaneseEnvelopeKakuNumber3 = 72,\n+ JapaneseEnvelopeKakuNumber3Rotated = 85,\n+ JapaneseEnvelopeYouNumber4 = 91,\n+ JapaneseEnvelopeYouNumber4Rotated = 92,\n+ JapanesePostcard = 43,\n+ JapanesePostcardRotated = 81,\n+ Ledger = 4,\n+ Legal = 5,\n+ LegalExtra = 51,\n+ Letter = 1,\n+ LetterExtra = 50,\n+ LetterExtraTransverse = 56,\n+ LetterPlus = 59,\n+ LetterRotated = 75,\n+ LetterSmall = 2,\n+ LetterTransverse = 54,\n+ MonarchEnvelope = 37,\n+ Note = 18,\n+ Number10Envelope = 20,\n+ Number11Envelope = 21,\n+ Number12Envelope = 22,\n+ Number14Envelope = 23,\n+ Number9Envelope = 19,\n+ PersonalEnvelope = 38,\n+ Prc16K = 93,\n+ Prc16KRotated = 106,\n+ Prc32K = 94,\n+ Prc32KBig = 95,\n+ Prc32KBigRotated = 108,\n+ Prc32KRotated = 107,\n+ PrcEnvelopeNumber1 = 96,\n+ PrcEnvelopeNumber10 = 105,\n+ PrcEnvelopeNumber10Rotated = 118,\n+ PrcEnvelopeNumber1Rotated = 109,\n+ PrcEnvelopeNumber2 = 97,\n+ PrcEnvelopeNumber2Rotated = 110,\n+ PrcEnvelopeNumber3 = 98,\n+ PrcEnvelopeNumber3Rotated = 111,\n+ PrcEnvelopeNumber4 = 99,\n+ PrcEnvelopeNumber4Rotated = 112,\n+ PrcEnvelopeNumber5 = 100,\n+ PrcEnvelopeNumber5Rotated = 113,\n+ PrcEnvelopeNumber6 = 101,\n+ PrcEnvelopeNumber6Rotated = 114,\n+ PrcEnvelopeNumber7 = 102,\n+ PrcEnvelopeNumber7Rotated = 115,\n+ PrcEnvelopeNumber8 = 103,\n+ PrcEnvelopeNumber8Rotated = 116,\n+ PrcEnvelopeNumber9 = 104,\n+ PrcEnvelopeNumber9Rotated = 117,\n+ Quarto = 15,\n+ Standard10x11 = 45,\n+ Standard10x14 = 16,\n+ Standard11x17 = 17,\n+ Standard12x11 = 90,\n+ Standard15x11 = 46,\n+ Standard9x11 = 44,\n+ Statement = 6,\n+ Tabloid = 3,\n+ TabloidExtra = 52,\n+ USStandardFanfold = 39,\n+ }\n+ public class PaperSize {\n+ public PaperSize();\n+ public PaperSize(string name, int width, int height);\n+ public int Height { get; set; }\n+ public PaperKind Kind { get; }\n+ public string PaperName { get; set; }\n+ public int RawKind { get; set; }\n+ public int Width { get; set; }\n+ public override string ToString();\n+ }\n+ public class PaperSource {\n+ public PaperSource();\n+ public PaperSourceKind Kind { get; }\n+ public int RawKind { get; set; }\n+ public string SourceName { get; set; }\n+ public override string ToString();\n+ }\n+ public enum PaperSourceKind {\n+ AutomaticFeed = 7,\n+ Cassette = 14,\n+ Custom = 257,\n+ Envelope = 5,\n+ FormSource = 15,\n+ LargeCapacity = 11,\n+ LargeFormat = 10,\n+ Lower = 2,\n+ Manual = 4,\n+ ManualFeed = 6,\n+ Middle = 3,\n+ SmallFormat = 9,\n+ TractorFeed = 8,\n+ Upper = 1,\n+ }\n+ public sealed class PreviewPageInfo {\n+ public PreviewPageInfo(Image image, Size physicalSize);\n+ public Image Image { get; }\n+ public Size PhysicalSize { get; }\n+ }\n+ public class PreviewPrintController : PrintController {\n+ public PreviewPrintController();\n+ public override bool IsPreview { get; }\n+ public virtual bool UseAntiAlias { get; set; }\n+ public PreviewPageInfo[] GetPreviewPageInfo();\n+ public override void OnEndPage(PrintDocument document, PrintPageEventArgs e);\n+ public override void OnEndPrint(PrintDocument document, PrintEventArgs e);\n+ public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e);\n+ public override void OnStartPrint(PrintDocument document, PrintEventArgs e);\n+ }\n+ public enum PrintAction {\n+ PrintToFile = 0,\n+ PrintToPreview = 1,\n+ PrintToPrinter = 2,\n+ }\n+ public abstract class PrintController {\n+ protected PrintController();\n+ public virtual bool IsPreview { get; }\n+ public virtual void OnEndPage(PrintDocument document, PrintPageEventArgs e);\n+ public virtual void OnEndPrint(PrintDocument document, PrintEventArgs e);\n+ public virtual Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e);\n+ public virtual void OnStartPrint(PrintDocument document, PrintEventArgs e);\n+ }\n+ public class PrintDocument : Component {\n+ public PrintDocument();\n+ public PageSettings DefaultPageSettings { get; set; }\n+ public string DocumentName { get; set; }\n+ public bool OriginAtMargins { get; set; }\n+ public PrintController PrintController { get; set; }\n+ public PrinterSettings PrinterSettings { get; set; }\n+ public event PrintEventHandler BeginPrint;\n+ public event PrintEventHandler EndPrint;\n+ public event PrintPageEventHandler PrintPage;\n+ public event QueryPageSettingsEventHandler QueryPageSettings;\n+ protected virtual void OnBeginPrint(PrintEventArgs e);\n+ protected virtual void OnEndPrint(PrintEventArgs e);\n+ protected virtual void OnPrintPage(PrintPageEventArgs e);\n+ protected virtual void OnQueryPageSettings(QueryPageSettingsEventArgs e);\n+ public void Print();\n+ public override string ToString();\n+ }\n+ public class PrinterResolution {\n+ public PrinterResolution();\n+ public PrinterResolutionKind Kind { get; set; }\n+ public int X { get; set; }\n+ public int Y { get; set; }\n+ public override string ToString();\n+ }\n+ public enum PrinterResolutionKind {\n+ Custom = 0,\n+ Draft = -1,\n+ High = -4,\n+ Low = -2,\n+ Medium = -3,\n+ }\n+ public class PrinterSettings : ICloneable {\n+ public PrinterSettings();\n+ public bool CanDuplex { get; }\n+ public bool Collate { get; set; }\n+ public short Copies { get; set; }\n+ public PageSettings DefaultPageSettings { get; }\n+ public Duplex Duplex { get; set; }\n+ public int FromPage { get; set; }\n+ public static PrinterSettings.StringCollection InstalledPrinters { get; }\n+ public bool IsDefaultPrinter { get; }\n+ public bool IsPlotter { get; }\n+ public bool IsValid { get; }\n+ public int LandscapeAngle { get; }\n+ public int MaximumCopies { get; }\n+ public int MaximumPage { get; set; }\n+ public int MinimumPage { get; set; }\n+ public PrinterSettings.PaperSizeCollection PaperSizes { get; }\n+ public PrinterSettings.PaperSourceCollection PaperSources { get; }\n+ public string PrinterName { get; set; }\n+ public PrinterSettings.PrinterResolutionCollection PrinterResolutions { get; }\n+ public string PrintFileName { get; set; }\n+ public PrintRange PrintRange { get; set; }\n+ public bool PrintToFile { get; set; }\n+ public bool SupportsColor { get; }\n+ public int ToPage { get; set; }\n+ public object Clone();\n+ public Graphics CreateMeasurementGraphics();\n+ public Graphics CreateMeasurementGraphics(bool honorOriginAtMargins);\n+ public Graphics CreateMeasurementGraphics(PageSettings pageSettings);\n+ public Graphics CreateMeasurementGraphics(PageSettings pageSettings, bool honorOriginAtMargins);\n+ public IntPtr GetHdevmode();\n+ public IntPtr GetHdevmode(PageSettings pageSettings);\n+ public IntPtr GetHdevnames();\n+ public bool IsDirectPrintingSupported(Image image);\n+ public bool IsDirectPrintingSupported(ImageFormat imageFormat);\n+ public void SetHdevmode(IntPtr hdevmode);\n+ public void SetHdevnames(IntPtr hdevnames);\n+ public override string ToString();\n+ public class PaperSizeCollection : ICollection, IEnumerable {\n+ public PaperSizeCollection(PaperSize[] array);\n+ public int Count { get; }\n+ int System.Collections.ICollection.Count { get; }\n+ bool System.Collections.ICollection.IsSynchronized { get; }\n+ object System.Collections.ICollection.SyncRoot { get; }\n+ public virtual PaperSize this[int index] { get; }\n+ public int Add(PaperSize paperSize);\n+ public void CopyTo(PaperSize[] paperSizes, int index);\n+ public IEnumerator GetEnumerator();\n+ void System.Collections.ICollection.CopyTo(Array array, int index);\n+ IEnumerator System.Collections.IEnumerable.GetEnumerator();\n+ }\n+ public class PaperSourceCollection : ICollection, IEnumerable {\n+ public PaperSourceCollection(PaperSource[] array);\n+ public int Count { get; }\n+ int System.Collections.ICollection.Count { get; }\n+ bool System.Collections.ICollection.IsSynchronized { get; }\n+ object System.Collections.ICollection.SyncRoot { get; }\n+ public virtual PaperSource this[int index] { get; }\n+ public int Add(PaperSource paperSource);\n+ public void CopyTo(PaperSource[] paperSources, int index);\n+ public IEnumerator GetEnumerator();\n+ void System.Collections.ICollection.CopyTo(Array array, int index);\n+ IEnumerator System.Collections.IEnumerable.GetEnumerator();\n+ }\n+ public class PrinterResolutionCollection : ICollection, IEnumerable {\n+ public PrinterResolutionCollection(PrinterResolution[] array);\n+ public int Count { get; }\n+ int System.Collections.ICollection.Count { get; }\n+ bool System.Collections.ICollection.IsSynchronized { get; }\n+ object System.Collections.ICollection.SyncRoot { get; }\n+ public virtual PrinterResolution this[int index] { get; }\n+ public int Add(PrinterResolution printerResolution);\n+ public void CopyTo(PrinterResolution[] printerResolutions, int index);\n+ public IEnumerator GetEnumerator();\n+ void System.Collections.ICollection.CopyTo(Array array, int index);\n+ IEnumerator System.Collections.IEnumerable.GetEnumerator();\n+ }\n+ public class StringCollection : ICollection, IEnumerable {\n+ public StringCollection(string[] array);\n+ public int Count { get; }\n+ int System.Collections.ICollection.Count { get; }\n+ bool System.Collections.ICollection.IsSynchronized { get; }\n+ object System.Collections.ICollection.SyncRoot { get; }\n+ public virtual string this[int index] { get; }\n+ public int Add(string value);\n+ public void CopyTo(string[] strings, int index);\n+ public IEnumerator GetEnumerator();\n+ void System.Collections.ICollection.CopyTo(Array array, int index);\n+ IEnumerator System.Collections.IEnumerable.GetEnumerator();\n+ }\n+ }\n+ public enum PrinterUnit {\n+ Display = 0,\n+ HundredthsOfAMillimeter = 2,\n+ TenthsOfAMillimeter = 3,\n+ ThousandthsOfAnInch = 1,\n+ }\n+ public sealed class PrinterUnitConvert {\n+ public static double Convert(double value, PrinterUnit fromUnit, PrinterUnit toUnit);\n+ public static Point Convert(Point value, PrinterUnit fromUnit, PrinterUnit toUnit);\n+ public static Margins Convert(Margins value, PrinterUnit fromUnit, PrinterUnit toUnit);\n+ public static Rectangle Convert(Rectangle value, PrinterUnit fromUnit, PrinterUnit toUnit);\n+ public static Size Convert(Size value, PrinterUnit fromUnit, PrinterUnit toUnit);\n+ public static int Convert(int value, PrinterUnit fromUnit, PrinterUnit toUnit);\n+ }\n+ public class PrintEventArgs : CancelEventArgs {\n+ public PrintEventArgs();\n+ public PrintAction PrintAction { get; }\n+ }\n+ public delegate void PrintEventHandler(object sender, PrintEventArgs e);\n+ public sealed class PrintingPermission : CodeAccessPermission, IUnrestrictedPermission {\n+ public PrintingPermission(PrintingPermissionLevel printingLevel);\n+ public PrintingPermission(PermissionState state);\n+ public PrintingPermissionLevel Level { get; set; }\n+ public override IPermission Copy();\n+ public override void FromXml(SecurityElement element);\n+ public override IPermission Intersect(IPermission target);\n+ public override bool IsSubsetOf(IPermission target);\n+ public bool IsUnrestricted();\n+ public override SecurityElement ToXml();\n+ public override IPermission Union(IPermission target);\n+ }\n+ public sealed class PrintingPermissionAttribute : CodeAccessSecurityAttribute {\n+ public PrintingPermissionAttribute(SecurityAction action);\n+ public PrintingPermissionLevel Level { get; set; }\n+ public override IPermission CreatePermission();\n+ }\n+ public enum PrintingPermissionLevel {\n+ AllPrinting = 3,\n+ DefaultPrinting = 2,\n+ NoPrinting = 0,\n+ SafePrinting = 1,\n+ }\n+ public class PrintPageEventArgs : EventArgs {\n+ public PrintPageEventArgs(Graphics graphics, Rectangle marginBounds, Rectangle pageBounds, PageSettings pageSettings);\n+ public bool Cancel { get; set; }\n+ public Graphics Graphics { get; }\n+ public bool HasMorePages { get; set; }\n+ public Rectangle MarginBounds { get; }\n+ public Rectangle PageBounds { get; }\n+ public PageSettings PageSettings { get; }\n+ }\n+ public delegate void PrintPageEventHandler(object sender, PrintPageEventArgs e);\n+ public enum PrintRange {\n+ AllPages = 0,\n+ CurrentPage = 4194304,\n+ Selection = 1,\n+ SomePages = 2,\n+ }\n+ public class QueryPageSettingsEventArgs : PrintEventArgs {\n+ public QueryPageSettingsEventArgs(PageSettings pageSettings);\n+ public PageSettings PageSettings { get; set; }\n+ }\n+ public delegate void QueryPageSettingsEventHandler(object sender, QueryPageSettingsEventArgs e);\n+ public class StandardPrintController : PrintController {\n+ public StandardPrintController();\n+ public override void OnEndPage(PrintDocument document, PrintPageEventArgs e);\n+ public override void OnEndPrint(PrintDocument document, PrintEventArgs e);\n+ public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e);\n+ public override void OnStartPrint(PrintDocument document, PrintEventArgs e);\n+ }\n+}\n```\n\n", "meta": {"content_hash": "e1fc4d3ca5e16fbf35837899d48cd483", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 127, "avg_line_length": 42.86492890995261, "alnum_prop": 0.6315993145005252, "repo_name": "ericstj/standard", "id": "243b64840b63c39b6fa170dde097b3b34bf51c31", "size": "18116", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/comparisons/netstandard2.0_vs_netcoreapp2.0/System.Drawing.Printing.md", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "11626"}, {"name": "C#", "bytes": "24604928"}, {"name": "CMake", "bytes": "9153"}, {"name": "PowerShell", "bytes": "69131"}, {"name": "Shell", "bytes": "64844"}]}} +{"text": "\n\nusing System;\nusing System.IO;\nusing Dapper;\nusing Newtonsoft.Json;\n\nnamespace SteamDatabaseBackend\n{\n static class Settings\n {\n private static SettingsJson _current = new SettingsJson();\n\n public static bool IsFullRun { get; private set; }\n\n public static SettingsJson Current\n {\n get\n {\n return _current;\n }\n }\n\n public static void Load()\n {\n string settingsFile = Path.Combine(Application.Path, \"settings.json\");\n\n if (!File.Exists(settingsFile))\n {\n throw new FileNotFoundException(\"settings.json file does not exist. Rename and edit settings.json.default file.\");\n }\n\n _current = JsonConvert.DeserializeObject<SettingsJson>(File.ReadAllText(settingsFile), new JsonSerializerSettings { MissingMemberHandling = MissingMemberHandling.Error }) ?? new SettingsJson();\n }\n\n public static void Initialize()\n {\n if (string.IsNullOrWhiteSpace(Current.Steam.Username) || string.IsNullOrWhiteSpace(Current.Steam.Password))\n {\n throw new InvalidDataException(\"Missing Steam credentials in settings file\");\n }\n\n // Test database connection, it will throw if connection is unable to be made\n using (var connection = Database.GetConnection())\n {\n // Clear GC status table while we're at it\n connection.Execute(\"DELETE FROM `GC`\");\n }\n\n if (Current.FullRun != FullRunState.None)\n {\n IsFullRun = true;\n\n Log.WriteInfo(\"Settings\", \"Running full update with option \\\"{0}\\\"\", Current.FullRun);\n\n // Don't log full runs, regardless of setting\n Current.LogToFile = false;\n\n // Don't connect to IRC while doing a full run\n Current.IRC.Enabled = false;\n }\n else if (!Current.LogToFile)\n {\n Log.WriteInfo(\"Settings\", \"File logging is disabled\");\n }\n\n Current.IRC.Enabled = CanConnectToIRC();\n }\n\n private static bool CanConnectToIRC()\n {\n if (!Current.IRC.Enabled)\n {\n Log.WriteWarn(\"Settings\", \"IRC is disabled in settings\");\n return false;\n }\n\n if (string.IsNullOrEmpty(Current.IRC.Server) || Current.IRC.Port <= 0)\n {\n Log.WriteWarn(\"Settings\", \"Missing IRC details in settings file, not connecting\");\n return false;\n }\n\n if (string.IsNullOrWhiteSpace(Current.IRC.Nickname))\n {\n Log.WriteError(\"Settings\", \"Missing IRC nickname in settings file, not connecting\");\n return false;\n }\n\n if (string.IsNullOrWhiteSpace(Current.IRC.Password))\n {\n Current.IRC.Password = null;\n }\n\n return true;\n }\n }\n}\n", "meta": {"content_hash": "e61ab38354f48856c25bb877b19e8cbd", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 205, "avg_line_length": 31.20408163265306, "alnum_prop": 0.5464355788096795, "repo_name": "SGColdSun/SteamDatabaseBackend", "id": "70755525e2a0bc01e3cf4d62208a44cce04e2600", "size": "3226", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Util/Settings.cs", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C#", "bytes": "284296"}, {"name": "Shell", "bytes": "452"}]}} +{"text": "<!DOCTYPE html>\n\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /><meta name=\"generator\" content=\"Docutils 0.19: https://docutils.sourceforge.io/\" />\n\n \n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n <meta http-equiv=\"x-ua-compatible\" content=\"ie=edge\">\n <meta name=\"lang:clipboard.copy\" content=\"Copy to clipboard\">\n <meta name=\"lang:clipboard.copied\" content=\"Copied to clipboard\">\n <meta name=\"lang:search.language\" content=\"en\">\n <meta name=\"lang:search.pipeline.stopwords\" content=\"True\">\n <meta name=\"lang:search.pipeline.trimmer\" content=\"True\">\n <meta name=\"lang:search.result.none\" content=\"No matching documents\">\n <meta name=\"lang:search.result.one\" content=\"1 matching document\">\n <meta name=\"lang:search.result.other\" content=\"# matching documents\">\n <meta name=\"lang:search.tokenizer\" content=\"[\\s\\-]+\">\n\n \n <link href=\"https://fonts.gstatic.com/\" rel=\"preconnect\" crossorigin>\n <link href=\"https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback\" rel=\"stylesheet\">\n\n <style>\n body,\n input {\n font-family: \"Roboto\", \"Helvetica Neue\", Helvetica, Arial, sans-serif\n }\n\n code,\n kbd,\n pre {\n font-family: \"Roboto Mono\", \"Courier New\", Courier, monospace\n }\n </style>\n \n\n <link rel=\"stylesheet\" href=\"../_static/stylesheets/application.css\"/>\n <link rel=\"stylesheet\" href=\"../_static/stylesheets/application-palette.css\"/>\n <link rel=\"stylesheet\" href=\"../_static/stylesheets/application-fixes.css\"/>\n \n <link rel=\"stylesheet\" href=\"../_static/fonts/material-icons.css\"/>\n \n <meta name=\"theme-color\" content=\"#3f51b5\">\n <script src=\"../_static/javascripts/modernizr.js\"></script>\n \n \n \n <title>statsmodels.robust.norms.LeastSquares.psi_deriv — statsmodels</title>\n <link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"../_static/icons/favicon-32x32.png\">\n <link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"../_static/icons/favicon-16x16.png\">\n <link rel=\"manifest\" href=\"../_static/icons/site.webmanifest\">\n <link rel=\"mask-icon\" href=\"../_static/icons/safari-pinned-tab.svg\" color=\"#919191\">\n <meta name=\"msapplication-TileColor\" content=\"#2b5797\">\n <meta name=\"msapplication-config\" content=\"../_static/icons/browserconfig.xml\">\n <link rel=\"stylesheet\" href=\"../_static/stylesheets/examples.css\">\n <link rel=\"stylesheet\" href=\"../_static/stylesheets/deprecation.css\">\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../_static/pygments.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../_static/material.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../_static/graphviz.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../_static/plot_directive.css\" />\n <script data-url_root=\"../\" id=\"documentation_options\" src=\"../_static/documentation_options.js\"></script>\n <script src=\"../_static/jquery.js\"></script>\n <script src=\"../_static/underscore.js\"></script>\n <script src=\"../_static/_sphinx_javascript_frameworks_compat.js\"></script>\n <script src=\"../_static/doctools.js\"></script>\n <script src=\"../_static/sphinx_highlight.js\"></script>\n <script crossorigin=\"anonymous\" integrity=\"sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=\" src=\"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js\"></script>\n <link rel=\"shortcut icon\" href=\"../_static/favicon.ico\"/>\n <link rel=\"author\" title=\"About these documents\" href=\"../about.html\" />\n <link rel=\"index\" title=\"Index\" href=\"../genindex.html\" />\n <link rel=\"search\" title=\"Search\" href=\"../search.html\" />\n <link rel=\"next\" title=\"statsmodels.robust.norms.LeastSquares.rho\" href=\"statsmodels.robust.norms.LeastSquares.rho.html\" />\n <link rel=\"prev\" title=\"statsmodels.robust.norms.LeastSquares.psi\" href=\"statsmodels.robust.norms.LeastSquares.psi.html\" />\n \n \n\n </head>\n <body dir=ltr\n data-md-color-primary=indigo data-md-color-accent=blue>\n \n <svg class=\"md-svg\">\n <defs data-children-count=\"0\">\n \n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"416\" height=\"448\" viewBox=\"0 0 416 448\" id=\"__github\"><path fill=\"currentColor\" d=\"M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z\"/></svg>\n \n </defs>\n </svg>\n \n <input class=\"md-toggle\" data-md-toggle=\"drawer\" type=\"checkbox\" id=\"__drawer\">\n <input class=\"md-toggle\" data-md-toggle=\"search\" type=\"checkbox\" id=\"__search\">\n <label class=\"md-overlay\" data-md-component=\"overlay\" for=\"__drawer\"></label>\n <a href=\"#generated/statsmodels.robust.norms.LeastSquares.psi_deriv\" tabindex=\"1\" class=\"md-skip\"> Skip to content </a>\n <header class=\"md-header\" data-md-component=\"header\">\n <nav class=\"md-header-nav md-grid\">\n <div class=\"md-flex navheader\">\n <div class=\"md-flex__cell md-flex__cell--shrink\">\n <a href=\"../index.html\" title=\"statsmodels\"\n class=\"md-header-nav__button md-logo\">\n \n <img src=\"../_static/statsmodels-logo-v2-bw.svg\" height=\"26\"\n alt=\"statsmodels logo\">\n \n </a>\n </div>\n <div class=\"md-flex__cell md-flex__cell--shrink\">\n <label class=\"md-icon md-icon--menu md-header-nav__button\" for=\"__drawer\"></label>\n </div>\n <div class=\"md-flex__cell md-flex__cell--stretch\">\n <div class=\"md-flex__ellipsis md-header-nav__title\" data-md-component=\"title\">\n <span class=\"md-header-nav__topic\">statsmodels 0.13.3</span>\n <span class=\"md-header-nav__topic\"> statsmodels.robust.norms.LeastSquares.psi_deriv </span>\n </div>\n </div>\n <div class=\"md-flex__cell md-flex__cell--shrink\">\n <label class=\"md-icon md-icon--search md-header-nav__button\" for=\"__search\"></label>\n \n<div class=\"md-search\" data-md-component=\"search\" role=\"dialog\">\n <label class=\"md-search__overlay\" for=\"__search\"></label>\n <div class=\"md-search__inner\" role=\"search\">\n <form class=\"md-search__form\" action=\"../search.html\" method=\"get\" name=\"search\">\n <input type=\"text\" class=\"md-search__input\" name=\"q\" placeholder=\"Search\"\n autocapitalize=\"off\" autocomplete=\"off\" spellcheck=\"false\"\n data-md-component=\"query\" data-md-state=\"active\">\n <label class=\"md-icon md-search__icon\" for=\"__search\"></label>\n <button type=\"reset\" class=\"md-icon md-search__icon\" data-md-component=\"reset\" tabindex=\"-1\">\n \n </button>\n </form>\n <div class=\"md-search__output\">\n <div class=\"md-search__scrollwrap\" data-md-scrollfix>\n <div class=\"md-search-result\" data-md-component=\"result\">\n <div class=\"md-search-result__meta\">\n Type to start searching\n </div>\n <ol class=\"md-search-result__list\"></ol>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n </div>\n \n <div class=\"md-flex__cell md-flex__cell--shrink\">\n <div class=\"md-header-nav__source\">\n <a href=\"https://github.com/statsmodels/statsmodels\" title=\"Go to repository\" class=\"md-source\" data-md-source=\"github\">\n\n <div class=\"md-source__icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 24 24\" width=\"28\" height=\"28\">\n <use xlink:href=\"#__github\" width=\"24\" height=\"24\"></use>\n </svg>\n </div>\n \n <div class=\"md-source__repository\">\n statsmodels\n </div>\n</a>\n </div>\n </div>\n \n \n \n <script src=\"../_static/javascripts/version_dropdown.js\"></script>\n <script>\n var json_loc = \"../../versions-v2.json\",\n target_loc = \"../../\",\n text = \"Versions\";\n $( document ).ready( add_version_dropdown(json_loc, target_loc, text));\n </script>\n \n\n </div>\n </nav>\n</header>\n\n \n <div class=\"md-container\">\n \n \n \n <nav class=\"md-tabs\" data-md-component=\"tabs\">\n <div class=\"md-tabs__inner md-grid\">\n <ul class=\"md-tabs__list\">\n <li class=\"md-tabs__item\"><a href=\"../user-guide.html\" class=\"md-tabs__link\">User Guide</a></li>\n <li class=\"md-tabs__item\"><a href=\"../rlm.html\" class=\"md-tabs__link\">Robust Linear Models</a></li>\n <li class=\"md-tabs__item\"><a href=\"statsmodels.robust.norms.LeastSquares.html\" class=\"md-tabs__link\">statsmodels.robust.norms.LeastSquares</a></li>\n </ul>\n </div>\n </nav>\n <main class=\"md-main\">\n <div class=\"md-main__inner md-grid\" data-md-component=\"container\">\n \n <div class=\"md-sidebar md-sidebar--primary\" data-md-component=\"navigation\">\n <div class=\"md-sidebar__scrollwrap\">\n <div class=\"md-sidebar__inner\">\n <nav class=\"md-nav md-nav--primary\" data-md-level=\"0\">\n <label class=\"md-nav__title md-nav__title--site\" for=\"__drawer\">\n <a href=\"../index.html\" title=\"statsmodels\" class=\"md-nav__button md-logo\">\n \n <img src=\"../_static/statsmodels-logo-v2-bw.svg\" alt=\" logo\" width=\"48\" height=\"48\">\n \n </a>\n <a href=\"../index.html\"\n title=\"statsmodels\">statsmodels 0.13.3</a>\n </label>\n <div class=\"md-nav__source\">\n <a href=\"https://github.com/statsmodels/statsmodels\" title=\"Go to repository\" class=\"md-source\" data-md-source=\"github\">\n\n <div class=\"md-source__icon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 24 24\" width=\"28\" height=\"28\">\n <use xlink:href=\"#__github\" width=\"24\" height=\"24\"></use>\n </svg>\n </div>\n \n <div class=\"md-source__repository\">\n statsmodels\n </div>\n</a>\n </div>\n \n \n\n \n <ul class=\"md-nav__list\">\n <li class=\"md-nav__item\">\n \n \n <a href=\"../install.html\" class=\"md-nav__link\">Installing statsmodels</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../gettingstarted.html\" class=\"md-nav__link\">Getting started</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html\" class=\"md-nav__link\">User Guide</a>\n <ul class=\"md-nav__list\"> \n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#background\" class=\"md-nav__link\">Background</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#regression-and-linear-models\" class=\"md-nav__link\">Regression and Linear Models</a>\n <ul class=\"md-nav__list\"> \n <li class=\"md-nav__item\">\n \n \n <a href=\"../regression.html\" class=\"md-nav__link\">Linear Regression</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../glm.html\" class=\"md-nav__link\">Generalized Linear Models</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../gee.html\" class=\"md-nav__link\">Generalized Estimating Equations</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../gam.html\" class=\"md-nav__link\">Generalized Additive Models (GAM)</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../rlm.html\" class=\"md-nav__link\">Robust Linear Models</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../mixed_linear.html\" class=\"md-nav__link\">Linear Mixed Effects Models</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../discretemod.html\" class=\"md-nav__link\">Regression with Discrete Dependent Variable</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../mixed_glm.html\" class=\"md-nav__link\">Generalized Linear Mixed Effects Models</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../anova.html\" class=\"md-nav__link\">ANOVA</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../other_models.html\" class=\"md-nav__link\">Other Models <code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">othermod</span></code></a>\n \n \n </li></ul>\n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#time-series-analysis\" class=\"md-nav__link\">Time Series Analysis</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#other-models\" class=\"md-nav__link\">Other Models</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#statistics-and-tools\" class=\"md-nav__link\">Statistics and Tools</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#data-sets\" class=\"md-nav__link\">Data Sets</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../user-guide.html#sandbox\" class=\"md-nav__link\">Sandbox</a>\n \n \n </li></ul>\n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../examples/index.html\" class=\"md-nav__link\">Examples</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../api.html\" class=\"md-nav__link\">API Reference</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../about.html\" class=\"md-nav__link\">About statsmodels</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../dev/index.html\" class=\"md-nav__link\">Developer Page</a>\n \n \n </li>\n <li class=\"md-nav__item\">\n \n \n <a href=\"../release/index.html\" class=\"md-nav__link\">Release Notes</a>\n \n \n </li>\n </ul>\n \n\n</nav>\n </div>\n </div>\n </div>\n <div class=\"md-sidebar md-sidebar--secondary\" data-md-component=\"toc\">\n <div class=\"md-sidebar__scrollwrap\">\n <div class=\"md-sidebar__inner\">\n \n<nav class=\"md-nav md-nav--secondary\">\n <label class=\"md-nav__title\" for=\"__toc\">Contents</label>\n <ul class=\"md-nav__list\" data-md-scrollfix=\"\">\n <li class=\"md-nav__item\"><a href=\"#generated-statsmodels-robust-norms-leastsquares-psi-deriv--page-root\" class=\"md-nav__link\">statsmodels.robust.norms.LeastSquares.psi_deriv</a><nav class=\"md-nav\">\n <ul class=\"md-nav__list\">\n <li class=\"md-nav__item\"><a href=\"#statsmodels.robust.norms.LeastSquares.psi_deriv\" class=\"md-nav__link\"><code class=\"docutils literal notranslate\"><span class=\"pre\">LeastSquares.psi_deriv</span></code></a>\n </li></ul>\n </nav>\n </li>\n \n<li class=\"md-nav__item\"><a class=\"md-nav__extra_link\" href=\"../_sources/generated/statsmodels.robust.norms.LeastSquares.psi_deriv.rst.txt\">Show Source</a> </li>\n\n<li id=\"searchbox\" class=\"md-nav__item\"></li>\n\n </ul>\n</nav>\n </div>\n </div>\n </div>\n \n <div class=\"md-content\">\n <article class=\"md-content__inner md-typeset\" role=\"main\">\n \n <section id=\"statsmodels-robust-norms-leastsquares-psi-deriv\">\n<h1 id=\"generated-statsmodels-robust-norms-leastsquares-psi-deriv--page-root\">statsmodels.robust.norms.LeastSquares.psi_deriv<a class=\"headerlink\" href=\"#generated-statsmodels-robust-norms-leastsquares-psi-deriv--page-root\" title=\"Permalink to this heading\">\u00b6</a></h1>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"statsmodels.robust.norms.LeastSquares.psi_deriv\">\n<span class=\"sig-prename descclassname\"><span class=\"pre\">LeastSquares.</span></span><span class=\"sig-name descname\"><span class=\"pre\">psi_deriv</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">z</span></span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"../_modules/statsmodels/robust/norms.html#LeastSquares.psi_deriv\"><span class=\"viewcode-link\"><span class=\"pre\">[source]</span></span></a><a class=\"headerlink\" href=\"#statsmodels.robust.norms.LeastSquares.psi_deriv\" title=\"Permalink to this definition\">\u00b6</a></dt>\n<dd><p>The derivative of the least squares psi function.</p>\n<dl class=\"field-list\">\n<dt class=\"field-odd\">Returns<span class=\"colon\">:</span></dt>\n<dd class=\"field-odd\"><dl>\n<dt><strong>psi_deriv</strong><span class=\"classifier\"><a class=\"reference external\" href=\"https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray\" title=\"(in NumPy v1.23)\"><code class=\"xref py py-obj docutils literal notranslate\"><span class=\"pre\">ndarray</span></code></a></span></dt><dd><p>ones(z.shape)</p>\n</dd>\n</dl>\n</dd>\n</dl>\n<p class=\"rubric\">Notes</p>\n<p>Used to estimate the robust covariance matrix.</p>\n</dd></dl>\n</section>\n\n\n </article>\n </div>\n </div>\n </main>\n </div>\n <footer class=\"md-footer\">\n <div class=\"md-footer-nav\">\n <nav class=\"md-footer-nav__inner md-grid\">\n \n <a href=\"statsmodels.robust.norms.LeastSquares.psi.html\" title=\"statsmodels.robust.norms.LeastSquares.psi\"\n class=\"md-flex md-footer-nav__link md-footer-nav__link--prev\"\n rel=\"prev\">\n <div class=\"md-flex__cell md-flex__cell--shrink\">\n <i class=\"md-icon md-icon--arrow-back md-footer-nav__button\"></i>\n </div>\n <div class=\"md-flex__cell md-flex__cell--stretch md-footer-nav__title\">\n <span class=\"md-flex__ellipsis\">\n <span\n class=\"md-footer-nav__direction\"> Previous </span> statsmodels.robust.norms.LeastSquares.psi </span>\n </div>\n </a>\n \n \n <a href=\"statsmodels.robust.norms.LeastSquares.rho.html\" title=\"statsmodels.robust.norms.LeastSquares.rho\"\n class=\"md-flex md-footer-nav__link md-footer-nav__link--next\"\n rel=\"next\">\n <div class=\"md-flex__cell md-flex__cell--stretch md-footer-nav__title\"><span\n class=\"md-flex__ellipsis\"> <span\n class=\"md-footer-nav__direction\"> Next </span> statsmodels.robust.norms.LeastSquares.rho </span>\n </div>\n <div class=\"md-flex__cell md-flex__cell--shrink\"><i\n class=\"md-icon md-icon--arrow-forward md-footer-nav__button\"></i>\n </div>\n \n </a>\n \n </nav>\n </div>\n <div class=\"md-footer-meta md-typeset\">\n <div class=\"md-footer-meta__inner md-grid\">\n <div class=\"md-footer-copyright\">\n <div class=\"md-footer-copyright__highlight\">\n © Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.\n \n </div>\n Last updated on\n Nov 01, 2022.\n <br/>\n Created using\n <a href=\"http://www.sphinx-doc.org/\">Sphinx</a> 5.3.0.\n and\n <a href=\"https://github.com/bashtage/sphinx-material/\">Material for\n Sphinx</a>\n </div>\n </div>\n </div>\n </footer>\n <script src=\"../_static/javascripts/application.js\"></script>\n <script>app.initialize({version: \"1.0.4\", url: {base: \"..\"}})</script>\n </body>\n</html>", "meta": {"content_hash": "58fcb59dcb5ad9b3b04449f825a38840", "timestamp": "", "source": "github", "line_count": 516, "max_line_length": 999, "avg_line_length": 38.27713178294574, "alnum_prop": 0.5973874740519467, "repo_name": "statsmodels/statsmodels.github.io", "id": "bc44c2fca922ef0db0d780919012801fd87b3e05", "size": "19755", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "v0.13.3/generated/statsmodels.robust.norms.LeastSquares.psi_deriv.html", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "\ufeffusing System;\nusing CVaS.BL.Common;\nusing CVaS.Shared.Options;\nusing CVaS.Shared.Helpers;\nusing CVaS.Web.Authentication;\nusing CVaS.Web.Installers;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensions.PlatformAbstractions;\nusing DryIoc;\nusing DryIoc.Microsoft.DependencyInjection;\nusing StackExchange.Profiling.Storage;\nusing Microsoft.Extensions.Caching.Memory;\nusing CVaS.Web.Helpers;\nusing Swashbuckle.AspNetCore.Swagger;\nusing Swashbuckle.AspNetCore.SwaggerGen;\nusing CVaS.Web.Swagger;\n\nnamespace CVaS.Web\n{\n public class Startup\n {\n private readonly IHostingEnvironment _hostingEnvironment;\n private readonly ModeOptions _modeOptions = new ModeOptions();\n\n public Startup(IHostingEnvironment env, ILoggerFactory loggerFactory)\n {\n Configuration = new ConfigurationBuilder()\n .SetBasePath(env.ContentRootPath)\n .AddJsonFile(\"appsettings.json\", optional: true, reloadOnChange: true)\n .AddJsonFile($\"appsettings.{env.EnvironmentName}.json\", optional: true)\n .AddEnvironmentVariables()\n .Build();\n\n loggerFactory\n .AddConsole(Configuration.GetSection(\"Logging\"))\n .AddDebug();\n\n _hostingEnvironment = env;\n }\n\n public IConfigurationRoot Configuration { get; }\n\n // This method gets called by the runtime. Use this method to add services to the container.\n public IServiceProvider ConfigureServices(IServiceCollection services)\n {\n services.AddCustomOptions(Configuration);\n Configuration.GetSection(\"Mode\").Bind(_modeOptions);\n\n services.AddCustomizedIdentity();\n services.AddApiAuthentication(option =>\n {\n option.AuthenticationScheme = AuthenticationSchemes.ApiKey;\n option.HeaderScheme = \"Simple\";\n });\n\n services.AddDatabaseServices(Configuration);\n services.AddStorageServices(Configuration);\n services.AddCustomizedMvc();\n services.AddMemoryCache();\n // Inject an implementation of ISwaggerProvider with defaulted settings applied\n services.AddSwaggerGen(ConfigureSwagger);\n services.AddMiniProfiler();\n //.AddEntityFramework();\n\n if (_modeOptions.IsLocal)\n {\n services.AddJobsService(Configuration);\n }\n else\n {\n services.AddMessageBroker(Configuration);\n }\n\n services.AddTransient<AppContextSeed>();\n services.AddSingleton(Configuration);\n\n var physicalProvider = _hostingEnvironment.ContentRootFileProvider;\n // It's null when using ef migrations tools so we need to check first to not to throw exc\n if (physicalProvider != null) services.AddSingleton(physicalProvider);\n\n return new Container(Rules.Default\n .WithCaptureContainerDisposeStackTrace()\n .WithoutThrowIfDependencyHasShorterReuseLifespan()\n .WithImplicitRootOpenScope())\n .WithDependencyInjectionAdapter(services,\n throwIfUnresolved: type => type.Name.EndsWith(\"Controller\")) \n .ConfigureServiceProvider<WebApiCompositionRoot>();\n }\n\n // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.\n public void Configure(IApplicationBuilder app, IHostingEnvironment env, IMemoryCache cache, IContainer container) \n {\n if (env.IsDevelopment())\n {\n app.UseDeveloperExceptionPage();\n }\n\n app.UseStaticFiles();\n\n if (env.IsDevelopment())\n {\n app.UseMiniProfiler(o =>\n {\n o.RouteBasePath = \"~/profiler\";\n o.SqlFormatter = new StackExchange.Profiling.SqlFormatters.InlineFormatter();\n o.Storage = new MemoryCacheStorage(cache, TimeSpan.FromMinutes(20));\n });\n }\n\n app.UseAuthentication();\n\n app.UseMvc(routes =>\n {\n routes.MapRoute(\n name: \"default\",\n template: \"{controller=Home}/{action=Index}/{id?}\");\n });\n\n // Enable middleware to serve generated Swagger as a JSON endpoint\n app.UseSwagger();\n // Enable middleware to serve swagger-ui assets (HTML, JS, CSS etc.)\n app.UseSwaggerUI(c =>\n {\n c.SwaggerEndpoint(\"/swagger/v1/swagger.json\", \"API V1\");\n c.InjectStylesheet(\"/lib/swagger-ui-themes/themes/2.x/theme-flattop.css\");\n });\n\n if (_modeOptions.IsLocal)\n {\n ServicesExtensions.InitializeJobs(container);\n }\n }\n\n private static void ConfigureSwagger(SwaggerGenOptions options)\n {\n options.SwaggerDoc(\"v1\", new Info\n {\n Version = \"v1\",\n Title = \"Computer Vision as Service API\",\n Description = \"A simple api to run computer vision algorithms.\",\n TermsOfService = \"None\",\n Contact = new Contact\n {\n Name = \"Adam Je\u017e\",\n Email = \"adamjez@outlook.cz\"\n }\n });\n options.AddSecurityDefinition(\"ApiKey\", new ApiKeyScheme()\n {\n In = \"header\",\n Name = \"Authorization\",\n Description = \"Api Key Authentication\",\n Type = \"apiKey\"\n });\n\n options.DocumentFilter<LowercaseDocumentFilter>();\n options.OperationFilter<AuthResponsesOperationFilter>();\n options.OperationFilter<AddFileParamsFilter>();\n\n\n var basePath = PlatformServices.Default.Application.ApplicationBasePath;\n var pathToDoc = System.IO.Path.Combine(basePath, \"CVaS.Web.xml\");\n options.IncludeXmlComments(pathToDoc);\n }\n }\n}\n", "meta": {"content_hash": "b8679b2703f2562dc9ae00b6419dd1be", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 124, "avg_line_length": 37.34117647058824, "alnum_prop": 0.5956206679269062, "repo_name": "adamjez/CVaS", "id": "6d110356d3484513441e444b33569c6c5742a253", "size": "6351", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/CVaS.Web/Startup.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "350481"}, {"name": "CSS", "bytes": "4863"}, {"name": "JavaScript", "bytes": "9750"}, {"name": "PowerShell", "bytes": "50183"}, {"name": "Shell", "bytes": "870"}]}} +{"text": "\ufeffnamespace dp2Circulation\n{\n partial class DupForm\n {\n /// <summary>\n /// Required designer variable.\n /// </summary>\n private System.ComponentModel.IContainer components = null;\n\n /// <summary>\n /// Clean up any resources being used.\n /// </summary>\n /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n protected override void Dispose(bool disposing)\n {\n if (disposing && (components != null))\n {\n components.Dispose();\n }\n\n this.EventFinish.Dispose();\n\n base.Dispose(disposing);\n }\n\n #region Windows Form Designer generated code\n\n /// <summary>\n /// Required method for Designer support - do not modify\n /// the contents of this method with the code editor.\n /// </summary>\n private void InitializeComponent()\n {\n this.components = new System.ComponentModel.Container();\n System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DupForm));\n this.label_dupMessage = new System.Windows.Forms.Label();\n this.label2 = new System.Windows.Forms.Label();\n this.textBox_recordPath = new System.Windows.Forms.TextBox();\n this.label1 = new System.Windows.Forms.Label();\n this.listView_browse = new DigitalPlatform.GUI.ListViewNF();\n this.columnHeader_path = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));\n this.columnHeader_sum = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));\n this.imageList_dupItemType = new System.Windows.Forms.ImageList(this.components);\n this.label_message = new System.Windows.Forms.Label();\n this.button_search = new System.Windows.Forms.Button();\n this.comboBox_projectName = new System.Windows.Forms.ComboBox();\n this.button_viewXmlRecord = new System.Windows.Forms.Button();\n this.checkBox_includeLowCols = new System.Windows.Forms.CheckBox();\n this.checkBox_returnAllRecords = new System.Windows.Forms.CheckBox();\n this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();\n this.panel1 = new System.Windows.Forms.Panel();\n this.panel2 = new System.Windows.Forms.Panel();\n this.panel3 = new System.Windows.Forms.Panel();\n this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();\n this.checkBox_returnSearchDetail = new System.Windows.Forms.CheckBox();\n this.tableLayoutPanel1.SuspendLayout();\n this.panel1.SuspendLayout();\n this.panel2.SuspendLayout();\n this.panel3.SuspendLayout();\n this.flowLayoutPanel1.SuspendLayout();\n this.SuspendLayout();\n // \n // label_dupMessage\n // \n this.label_dupMessage.AutoSize = true;\n this.label_dupMessage.Font = new System.Drawing.Font(\"\u5b8b\u4f53\", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));\n this.label_dupMessage.Location = new System.Drawing.Point(3, 425);\n this.label_dupMessage.Name = \"label_dupMessage\";\n this.label_dupMessage.Size = new System.Drawing.Size(114, 18);\n this.label_dupMessage.TabIndex = 1;\n this.label_dupMessage.Text = \"\u5c1a\u672a\u67e5\u91cd...\";\n // \n // label2\n // \n this.label2.AutoSize = true;\n this.label2.Location = new System.Drawing.Point(3, 3);\n this.label2.Name = \"label2\";\n this.label2.Size = new System.Drawing.Size(116, 18);\n this.label2.TabIndex = 0;\n this.label2.Text = \"\u67e5\u91cd\u65b9\u6848(&P):\";\n // \n // textBox_recordPath\n // \n this.textBox_recordPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \n | System.Windows.Forms.AnchorStyles.Right)));\n this.textBox_recordPath.Location = new System.Drawing.Point(142, -2);\n this.textBox_recordPath.Name = \"textBox_recordPath\";\n this.textBox_recordPath.Size = new System.Drawing.Size(268, 28);\n this.textBox_recordPath.TabIndex = 1;\n this.textBox_recordPath.TextChanged += new System.EventHandler(this.textBox_recordPath_TextChanged);\n // \n // label1\n // \n this.label1.AutoSize = true;\n this.label1.Location = new System.Drawing.Point(3, 3);\n this.label1.Name = \"label1\";\n this.label1.Size = new System.Drawing.Size(134, 18);\n this.label1.TabIndex = 0;\n this.label1.Text = \"\u6e90\u8bb0\u5f55\u8def\u5f84(&P):\";\n // \n // listView_browse\n // \n this.listView_browse.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {\n this.columnHeader_path,\n this.columnHeader_sum});\n this.listView_browse.Dock = System.Windows.Forms.DockStyle.Left;\n this.listView_browse.FullRowSelect = true;\n this.listView_browse.HideSelection = false;\n this.listView_browse.LargeImageList = this.imageList_dupItemType;\n this.listView_browse.Location = new System.Drawing.Point(0, 72);\n this.listView_browse.Margin = new System.Windows.Forms.Padding(0);\n this.listView_browse.Name = \"listView_browse\";\n this.listView_browse.Size = new System.Drawing.Size(451, 303);\n this.listView_browse.SmallImageList = this.imageList_dupItemType;\n this.listView_browse.TabIndex = 0;\n this.listView_browse.UseCompatibleStateImageBehavior = false;\n this.listView_browse.View = System.Windows.Forms.View.Details;\n this.listView_browse.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_browse_ColumnClick);\n this.listView_browse.SelectedIndexChanged += new System.EventHandler(this.listView_browse_SelectedIndexChanged);\n this.listView_browse.DoubleClick += new System.EventHandler(this.listView_browse_DoubleClick);\n this.listView_browse.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView_browse_MouseUp);\n // \n // columnHeader_path\n // \n this.columnHeader_path.Text = \"\u8bb0\u5f55\u8def\u5f84\";\n this.columnHeader_path.Width = 120;\n // \n // columnHeader_sum\n // \n this.columnHeader_sum.Text = \"\u6743\u503c\u548c\";\n this.columnHeader_sum.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;\n this.columnHeader_sum.Width = 70;\n // \n // imageList_dupItemType\n // \n this.imageList_dupItemType.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject(\"imageList_dupItemType.ImageStream\")));\n this.imageList_dupItemType.TransparentColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(193)))));\n this.imageList_dupItemType.Images.SetKeyName(0, \"undup_type.bmp\");\n this.imageList_dupItemType.Images.SetKeyName(1, \"dup_type.bmp\");\n // \n // label_message\n // \n this.label_message.AutoSize = true;\n this.label_message.Location = new System.Drawing.Point(3, 443);\n this.label_message.Name = \"label_message\";\n this.label_message.Size = new System.Drawing.Size(17, 18);\n this.label_message.TabIndex = 2;\n this.label_message.Text = \" \";\n // \n // button_search\n // \n this.button_search.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\n this.button_search.Location = new System.Drawing.Point(418, 0);\n this.button_search.Name = \"button_search\";\n this.button_search.Size = new System.Drawing.Size(112, 33);\n this.button_search.TabIndex = 2;\n this.button_search.Text = \"\u67e5\u91cd(&S)\";\n this.button_search.Click += new System.EventHandler(this.button_search_Click);\n // \n // comboBox_projectName\n // \n this.comboBox_projectName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \n | System.Windows.Forms.AnchorStyles.Right)));\n this.comboBox_projectName.FormattingEnabled = true;\n this.comboBox_projectName.Location = new System.Drawing.Point(142, 3);\n this.comboBox_projectName.Name = \"comboBox_projectName\";\n this.comboBox_projectName.Size = new System.Drawing.Size(268, 26);\n this.comboBox_projectName.TabIndex = 1;\n this.comboBox_projectName.DropDown += new System.EventHandler(this.comboBox_projectName_DropDown);\n // \n // button_viewXmlRecord\n // \n this.button_viewXmlRecord.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\n this.button_viewXmlRecord.Location = new System.Drawing.Point(418, 0);\n this.button_viewXmlRecord.Name = \"button_viewXmlRecord\";\n this.button_viewXmlRecord.Size = new System.Drawing.Size(112, 33);\n this.button_viewXmlRecord.TabIndex = 2;\n this.button_viewXmlRecord.Text = \"XML...\";\n this.button_viewXmlRecord.UseVisualStyleBackColor = true;\n this.button_viewXmlRecord.Click += new System.EventHandler(this.button_viewXmlRecord_Click);\n // \n // checkBox_includeLowCols\n // \n this.checkBox_includeLowCols.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));\n this.checkBox_includeLowCols.AutoSize = true;\n this.checkBox_includeLowCols.Location = new System.Drawing.Point(4, 4);\n this.checkBox_includeLowCols.Margin = new System.Windows.Forms.Padding(4);\n this.checkBox_includeLowCols.Name = \"checkBox_includeLowCols\";\n this.checkBox_includeLowCols.Size = new System.Drawing.Size(295, 22);\n this.checkBox_includeLowCols.TabIndex = 0;\n this.checkBox_includeLowCols.Text = \"\u8fd4\u56de\u4f4e\u4e8e\u9608\u503c\u7684\u8bb0\u5f55\u7684\u6d4f\u89c8\u5217(&B)\";\n this.checkBox_includeLowCols.UseVisualStyleBackColor = true;\n // \n // checkBox_returnAllRecords\n // \n this.checkBox_returnAllRecords.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));\n this.checkBox_returnAllRecords.AutoSize = true;\n this.checkBox_returnAllRecords.Location = new System.Drawing.Point(307, 4);\n this.checkBox_returnAllRecords.Margin = new System.Windows.Forms.Padding(4);\n this.checkBox_returnAllRecords.Name = \"checkBox_returnAllRecords\";\n this.checkBox_returnAllRecords.Size = new System.Drawing.Size(205, 22);\n this.checkBox_returnAllRecords.TabIndex = 1;\n this.checkBox_returnAllRecords.Text = \"\u8fd4\u56de\u5168\u90e8\u547d\u4e2d\u8bb0\u5f55(&A)\";\n this.checkBox_returnAllRecords.UseVisualStyleBackColor = true;\n // \n // tableLayoutPanel1\n // \n this.tableLayoutPanel1.AutoSize = true;\n this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;\n this.tableLayoutPanel1.ColumnCount = 1;\n this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());\n this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0);\n this.tableLayoutPanel1.Controls.Add(this.label_dupMessage, 0, 4);\n this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 1);\n this.tableLayoutPanel1.Controls.Add(this.listView_browse, 0, 2);\n this.tableLayoutPanel1.Controls.Add(this.label_message, 0, 5);\n this.tableLayoutPanel1.Controls.Add(this.panel3, 0, 3);\n this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;\n this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);\n this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);\n this.tableLayoutPanel1.Name = \"tableLayoutPanel1\";\n this.tableLayoutPanel1.RowCount = 7;\n this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\n this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\n this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));\n this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\n this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\n this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\n this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 3F));\n this.tableLayoutPanel1.Size = new System.Drawing.Size(534, 464);\n this.tableLayoutPanel1.TabIndex = 10;\n // \n // panel1\n // \n this.panel1.AutoSize = true;\n this.panel1.Controls.Add(this.label2);\n this.panel1.Controls.Add(this.comboBox_projectName);\n this.panel1.Controls.Add(this.button_search);\n this.panel1.Dock = System.Windows.Forms.DockStyle.Left;\n this.panel1.Location = new System.Drawing.Point(0, 0);\n this.panel1.Margin = new System.Windows.Forms.Padding(0);\n this.panel1.Name = \"panel1\";\n this.panel1.Size = new System.Drawing.Size(848, 36);\n this.panel1.TabIndex = 0;\n // \n // panel2\n // \n this.panel2.AutoSize = true;\n this.panel2.Controls.Add(this.label1);\n this.panel2.Controls.Add(this.textBox_recordPath);\n this.panel2.Controls.Add(this.button_viewXmlRecord);\n this.panel2.Dock = System.Windows.Forms.DockStyle.Left;\n this.panel2.Location = new System.Drawing.Point(0, 36);\n this.panel2.Margin = new System.Windows.Forms.Padding(0);\n this.panel2.Name = \"panel2\";\n this.panel2.Size = new System.Drawing.Size(848, 36);\n this.panel2.TabIndex = 1;\n // \n // panel3\n // \n this.panel3.BackColor = System.Drawing.SystemColors.Control;\n this.panel3.Controls.Add(this.flowLayoutPanel1);\n this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;\n this.panel3.Location = new System.Drawing.Point(0, 375);\n this.panel3.Margin = new System.Windows.Forms.Padding(0);\n this.panel3.Name = \"panel3\";\n this.panel3.Size = new System.Drawing.Size(848, 50);\n this.panel3.TabIndex = 7;\n // \n // flowLayoutPanel1\n // \n this.flowLayoutPanel1.Controls.Add(this.checkBox_includeLowCols);\n this.flowLayoutPanel1.Controls.Add(this.checkBox_returnAllRecords);\n this.flowLayoutPanel1.Controls.Add(this.checkBox_returnSearchDetail);\n this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;\n this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);\n this.flowLayoutPanel1.Name = \"flowLayoutPanel1\";\n this.flowLayoutPanel1.Size = new System.Drawing.Size(848, 50);\n this.flowLayoutPanel1.TabIndex = 2;\n // \n // checkBox_returnSearchDetail\n // \n this.checkBox_returnSearchDetail.AutoSize = true;\n this.checkBox_returnSearchDetail.Location = new System.Drawing.Point(519, 3);\n this.checkBox_returnSearchDetail.Name = \"checkBox_returnSearchDetail\";\n this.checkBox_returnSearchDetail.Size = new System.Drawing.Size(169, 22);\n this.checkBox_returnSearchDetail.TabIndex = 2;\n this.checkBox_returnSearchDetail.Text = \"\u8fd4\u56de\u68c0\u7d22\u8be6\u60c5(&S)\";\n this.checkBox_returnSearchDetail.UseVisualStyleBackColor = true;\n // \n // DupForm\n // \n this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);\n this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n this.ClientSize = new System.Drawing.Size(534, 464);\n this.Controls.Add(this.tableLayoutPanel1);\n this.Icon = ((System.Drawing.Icon)(resources.GetObject(\"$this.Icon\")));\n this.Name = \"DupForm\";\n this.ShowInTaskbar = false;\n this.Text = \"DupForm\";\n this.Activated += new System.EventHandler(this.DupForm_Activated);\n this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DupForm_FormClosing);\n this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.DupForm_FormClosed);\n this.Load += new System.EventHandler(this.DupForm_Load);\n this.SizeChanged += new System.EventHandler(this.DupForm_SizeChanged);\n this.tableLayoutPanel1.ResumeLayout(false);\n this.tableLayoutPanel1.PerformLayout();\n this.panel1.ResumeLayout(false);\n this.panel1.PerformLayout();\n this.panel2.ResumeLayout(false);\n this.panel2.PerformLayout();\n this.panel3.ResumeLayout(false);\n this.flowLayoutPanel1.ResumeLayout(false);\n this.flowLayoutPanel1.PerformLayout();\n this.ResumeLayout(false);\n this.PerformLayout();\n\n }\n\n #endregion\n\n private System.Windows.Forms.Label label_dupMessage;\n private System.Windows.Forms.Label label2;\n private System.Windows.Forms.TextBox textBox_recordPath;\n private System.Windows.Forms.Label label1;\n private DigitalPlatform.GUI.ListViewNF listView_browse;\n private System.Windows.Forms.ColumnHeader columnHeader_path;\n private System.Windows.Forms.ColumnHeader columnHeader_sum;\n private System.Windows.Forms.Label label_message;\n private System.Windows.Forms.Button button_search;\n private System.Windows.Forms.ComboBox comboBox_projectName;\n private System.Windows.Forms.Button button_viewXmlRecord;\n private System.Windows.Forms.ImageList imageList_dupItemType;\n private System.Windows.Forms.CheckBox checkBox_includeLowCols;\n private System.Windows.Forms.CheckBox checkBox_returnAllRecords;\n private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;\n private System.Windows.Forms.Panel panel1;\n private System.Windows.Forms.Panel panel2;\n private System.Windows.Forms.Panel panel3;\n private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;\n private System.Windows.Forms.CheckBox checkBox_returnSearchDetail;\n }\n}", "meta": {"content_hash": "6ba39200f442244557ede07c8794e97c", "timestamp": "", "source": "github", "line_count": 343, "max_line_length": 175, "avg_line_length": 56.48979591836735, "alnum_prop": 0.6343414533443436, "repo_name": "DigitalPlatform/dp2", "id": "77363cd47cb9b9ce3ebf0e342b5051e17e57388e", "size": "19480", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dp2Circulation/Dup/DupForm.Designer.cs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ASP.NET", "bytes": "80547"}, {"name": "Batchfile", "bytes": "7192"}, {"name": "C#", "bytes": "56347865"}, {"name": "CSS", "bytes": "818819"}, {"name": "HTML", "bytes": "1914736"}, {"name": "JavaScript", "bytes": "152102"}, {"name": "PHP", "bytes": "30185"}, {"name": "Roff", "bytes": "1879"}, {"name": "Smalltalk", "bytes": "48625"}, {"name": "XSLT", "bytes": "64230"}]}} +{"text": "<?php\n\n/* @WebProfiler/Profiler/base_js.html.twig */\nclass __TwigTemplate_e7980dfb8bff76e82b49ca15a592b08d8e457a6b35170d5e64a247a3d4b200aa extends Twig_Template\n{\n public function __construct(Twig_Environment $env)\n {\n parent::__construct($env);\n\n $this->parent = false;\n\n $this->blocks = array(\n );\n }\n\n protected function doDisplay(array $context, array $blocks = array())\n {\n // line 1\n echo \"<script>/*<![CDATA[*/\n Sfjs = (function() {\n \\\"use strict\\\";\n\n var noop = function() {},\n\n profilerStorageKey = 'sf2/profiler/',\n\n request = function(url, onSuccess, onError, payload, options) {\n var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');\n options = options || {};\n options.maxTries = options.maxTries || 0;\n xhr.open(options.method || 'GET', url, true);\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n xhr.onreadystatechange = function(state) {\n if (4 !== xhr.readyState) {\n return null;\n }\n\n if (xhr.status == 404 && options.maxTries > 1) {\n setTimeout(function(){\n options.maxTries--;\n request(url, onSuccess, onError, payload, options);\n }, 500);\n\n return null;\n }\n\n if (200 === xhr.status) {\n (onSuccess || noop)(xhr);\n } else {\n (onError || noop)(xhr);\n }\n };\n xhr.send(payload || '');\n },\n\n hasClass = function(el, klass) {\n return el.className && el.className.match(new RegExp('\\\\\\\\b' + klass + '\\\\\\\\b'));\n },\n\n removeClass = function(el, klass) {\n if (el.className) {\n el.className = el.className.replace(new RegExp('\\\\\\\\b' + klass + '\\\\\\\\b'), ' ');\n }\n },\n\n addClass = function(el, klass) {\n if (!hasClass(el, klass)) {\n el.className += \\\" \\\" + klass;\n }\n },\n\n getPreference = function(name) {\n if (!window.localStorage) {\n return null;\n }\n\n return localStorage.getItem(profilerStorageKey + name);\n },\n\n setPreference = function(name, value) {\n if (!window.localStorage) {\n return null;\n }\n\n localStorage.setItem(profilerStorageKey + name, value);\n },\n\n requestStack = [],\n\n renderAjaxRequests = function() {\n var requestCounter = document.querySelectorAll('.sf-toolbar-ajax-requests');\n if (!requestCounter.length) {\n return;\n }\n\n var tbodies = document.querySelectorAll('.sf-toolbar-ajax-request-list');\n var state = 'ok';\n if (tbodies.length) {\n var tbody = tbodies[0];\n\n var rows = document.createDocumentFragment();\n\n if (requestStack.length) {\n for (var i = 0; i < requestStack.length; i++) {\n var request = requestStack[i];\n\n var row = document.createElement('tr');\n rows.appendChild(row);\n\n var methodCell = document.createElement('td');\n methodCell.textContent = request.method;\n row.appendChild(methodCell);\n\n var pathCell = document.createElement('td');\n pathCell.className = 'sf-ajax-request-url';\n pathCell.textContent = request.url;\n pathCell.setAttribute('title', request.url);\n row.appendChild(pathCell);\n\n var durationCell = document.createElement('td');\n durationCell.className = 'sf-ajax-request-duration';\n\n if (request.duration) {\n durationCell.textContent = request.duration + \\\"ms\\\";\n } else {\n durationCell.textContent = '-';\n }\n row.appendChild(durationCell);\n\n row.appendChild(document.createTextNode(' '));\n var profilerCell = document.createElement('td');\n\n if (request.profilerUrl) {\n var profilerLink = document.createElement('a');\n profilerLink.setAttribute('href', request.profilerUrl);\n profilerLink.textContent = request.profile;\n profilerCell.appendChild(profilerLink);\n } else {\n profilerCell.textContent = 'n/a';\n }\n\n row.appendChild(profilerCell);\n\n var requestState = 'ok';\n if (request.error) {\n requestState = 'error';\n if (state != \\\"loading\\\" && i > requestStack.length - 4) {\n state = 'error';\n }\n } else if (request.loading) {\n requestState = 'loading';\n state = 'loading'\n }\n row.className = 'sf-ajax-request sf-ajax-request-' + requestState;\n }\n\n var infoSpan = document.querySelectorAll(\\\".sf-toolbar-ajax-info\\\")[0];\n var children = Array.prototype.slice.call(tbody.children);\n for (var i = 0; i < children.length; i++) {\n tbody.removeChild(children[i]);\n }\n tbody.appendChild(rows);\n\n if (infoSpan) {\n var text = requestStack.length + ' call' + (requestStack.length > 1 ? 's' : '');\n infoSpan.textContent = text;\n }\n } else {\n var cell = document.createElement('td');\n cell.setAttribute('colspan', '4');\n cell.textContent = \\\"No AJAX requests yet.\\\";\n var row = document.createElement('tr');\n row.appendChild(cell);\n tbody.appendChild(row);\n }\n }\n\n requestCounter[0].textContent = requestStack.length;\n\n var className = 'sf-toolbar-ajax-requests sf-toolbar-status';\n if (state == 'ok') {\n className += ' sf-toolbar-status-green';\n } else if (state == 'error') {\n className += ' sf-toolbar-status-red';\n } else {\n className += ' sf-ajax-request-loading';\n }\n\n requestCounter[0].className = className;\n };\n\n var addEventListener;\n\n if (document.attachEvent) {\n addEventListener = function (element, eventName, callback) {\n element.attachEvent('on' + eventName, callback);\n };\n } else {\n addEventListener = function (element, eventName, callback) {\n element.addEventListener(eventName, callback, false);\n };\n }\n\n \";\n // line 186\n if (array_key_exists(\"excluded_ajax_paths\", $context)) {\n // line 187\n echo \" var proxied = XMLHttpRequest.prototype.open;\n\n XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {\n var self = this;\n\n /* prevent logging AJAX calls to static and inline files, like templates */\n if (url.substr(0, 1) === '/' && !url.match(new RegExp(\\\"\";\n // line 193\n echo twig_escape_filter($this->env, (isset($context[\"excluded_ajax_paths\"]) ? $context[\"excluded_ajax_paths\"] : $this->getContext($context, \"excluded_ajax_paths\")), \"html\", null, true);\n echo \"\\\"))) {\n var stackElement = {\n loading: true,\n error: false,\n url: url,\n method: method,\n start: new Date()\n };\n\n requestStack.push(stackElement);\n\n addEventListener(this, 'readystatechange', function() {\n if (self.readyState == 4) {\n stackElement.duration = new Date() - stackElement.start;\n stackElement.loading = false;\n stackElement.error = self.status < 200 || self.status >= 400;\n stackElement.profile = self.getResponseHeader(\\\"X-Debug-Token\\\");\n stackElement.profilerUrl = self.getResponseHeader(\\\"X-Debug-Token-Link\\\");\n\n Sfjs.renderAjaxRequests();\n }\n });\n\n Sfjs.renderAjaxRequests();\n }\n\n proxied.apply(this, Array.prototype.slice.call(arguments));\n };\n \";\n }\n // line 222\n echo \"\n return {\n hasClass: hasClass,\n\n removeClass: removeClass,\n\n addClass: addClass,\n\n getPreference: getPreference,\n\n setPreference: setPreference,\n\n addEventListener: addEventListener,\n\n request: request,\n\n renderAjaxRequests: renderAjaxRequests,\n\n load: function(selector, url, onSuccess, onError, options) {\n var el = document.getElementById(selector);\n\n if (el && el.getAttribute('data-sfurl') !== url) {\n request(\n url,\n function(xhr) {\n el.innerHTML = xhr.responseText;\n el.setAttribute('data-sfurl', url);\n removeClass(el, 'loading');\n (onSuccess || noop)(xhr, el);\n },\n function(xhr) { (onError || noop)(xhr, el); },\n '',\n options\n );\n }\n\n return this;\n },\n\n toggle: function(selector, elOn, elOff) {\n var i,\n style,\n tmp = elOn.style.display,\n el = document.getElementById(selector);\n\n elOn.style.display = elOff.style.display;\n elOff.style.display = tmp;\n\n if (el) {\n el.style.display = 'none' === tmp ? 'none' : 'block';\n }\n\n return this;\n }\n }\n })();\n/*]]>*/</script>\n\";\n }\n\n public function getTemplateName()\n {\n return \"@WebProfiler/Profiler/base_js.html.twig\";\n }\n\n public function isTraitable()\n {\n return false;\n }\n\n public function getDebugInfo()\n {\n return array ( 248 => 222, 216 => 193, 208 => 187, 206 => 186, 19 => 1,);\n }\n}\n", "meta": {"content_hash": "accaa677207166d3aa8983fcfa7a26b2", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 197, "avg_line_length": 37.02795031055901, "alnum_prop": 0.4314350415163969, "repo_name": "novikovm/Store", "id": "87eb58ce6f9be9b0c2501bbea64a2cba081e7680", "size": "11923", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/cache/dev/twig/e7/98/0dfb8bff76e82b49ca15a592b08d8e457a6b35170d5e64a247a3d4b200aa.php", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "3073"}, {"name": "CSS", "bytes": "792"}, {"name": "JavaScript", "bytes": "2824"}, {"name": "PHP", "bytes": "77153"}]}} +{"text": "\ufeff\n//____________________________________________________________________________\n//\n// Copyright (C) 2019, Mariusz Postol LODZ POLAND.\n//\n// To be in touch join the community at GITTER: https://gitter.im/mpostol/OPC-UA-OOI\n//____________________________________________________________________________\n\nnamespace UAOOI.Networking.Core\n{\n\n /// <summary>\n /// Enum HandlerState - represents states of an configurable object. \n /// </summary>\n public enum HandlerState\n {\n\n /// <summary>\n /// The handler is not configured and cannot be enabled.\n /// </summary>\n NoConfiguration,\n /// <summary>\n /// The handler is configured but currently disabled.\n /// </summary>\n Disabled,\n /// <summary>\n /// The handler is operational.\n /// </summary>\n Operational,\n /// <summary>\n /// The handler is in an error state, i.e. cannot change the state to Operational. Similar to NoConfiguration state but after an error occurs.\n /// </summary>\n Error\n\n }\n}\n", "meta": {"content_hash": "98203845daf7853e0ca239f9d405aa50", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 146, "avg_line_length": 27.666666666666668, "alnum_prop": 0.5341365461847389, "repo_name": "mpostol/OPC-UA-OOI", "id": "4876b7e7815269c8f12ab80fe0feee9235e7c47a", "size": "998", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Networking/Core/HandlerState.cs", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "8495"}, {"name": "C#", "bytes": "4749023"}, {"name": "Vim Snippet", "bytes": "1008"}]}} +{"text": "\n\n#ifdef KROLL_COVERAGE\n\n#import \"TiBase.h\"\n#import \"KrollObject.h\"\n#import \"KrollMethod.h\"\n\n#define COMPONENT_TYPE_PROXIES @\"proxies\"\n#define COMPONENT_TYPE_MODULES @\"modules\"\n#define COMPONENT_TYPE_OTHER @\"other\"\n\n#define API_TYPE_FUNCTION @\"function\"\n#define API_TYPE_PROPERTY @\"property\"\n\n#define COVERAGE_TYPE_GET @\"propertyGet\"\n#define COVERAGE_TYPE_SET @\"propertySet\"\n#define COVERAGE_TYPE_CALL @\"functionCall\"\n\n#define TOP_LEVEL @\"TOP_LEVEL\"\n\n@protocol KrollCoverage <NSObject>\n-(void)increment:(NSString*)apiName coverageType:(NSString*)coverageType apiType:(NSString*)apiType;\n-(NSString*)coverageName;\n-(NSString*)coverageType;\n@end\n\n@interface KrollCoverageObject : KrollObject <KrollCoverage> {\n@private\n\tNSString *componentName, *componentType;\n}\n\n@property(nonatomic,copy) NSString *componentName;\n@property(nonatomic,copy) NSString *componentType;\n\n+(void)incrementCoverage:(NSString*)componentType_ componentName:(NSString*)componentName_ apiName:(NSString*)apiName_ coverageType:(NSString*)coverageType_ apiType:(NSString*)apiType_;\n+(void)incrementTopLevelFunctionCall:(NSString*)componentName name:(NSString*)apiName;\n+(NSDictionary*)dumpCoverage;\n+(void)releaseCoverage;\n\n-(id)initWithTarget:(id)target_ context:(KrollContext*)context_;\n-(id)initWithTarget:(id)target_ context:(KrollContext*)context_ componentName:(NSString*)componentName_;\n\n@end\n\n@interface KrollCoverageMethod : KrollMethod <KrollCoverage> {\n@private\n\tNSString *parentName, *parentType;\n id<KrollCoverage> parent;\n}\n\n@property(nonatomic,copy) NSString *parentName;\n@property(nonatomic,copy) NSString *parentType;\n\n-(id)initWithTarget:(id)target_ context:(KrollContext *)context_ parent:(id<KrollCoverage>)parent_;\n-(id)initWithTarget:(id)target_ selector:(SEL)selector_ argcount:(int)argcount_ type:(KrollMethodType)type_ name:(id)name_ context:(KrollContext*)context_ parent:(id)parent_;\n\n-(id)call:(NSArray*)args;\n\n@end\n\n#endif", "meta": {"content_hash": "21bb573fe092080f36e7572f9593252a", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 185, "avg_line_length": 31.016129032258064, "alnum_prop": 0.7795111804472179, "repo_name": "AppWerft/SunTracker", "id": "a35c96cbe93d2220f17c7fc21f3d721e8b64e370", "size": "2220", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build/iphone/Classes/KrollCoverage.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "139582"}, {"name": "C++", "bytes": "56872"}, {"name": "D", "bytes": "1093222"}, {"name": "JavaScript", "bytes": "31672"}, {"name": "Objective-C", "bytes": "3310532"}, {"name": "Shell", "bytes": "270"}]}} +{"text": "{% extends 'base.html' %}\n\n{% block content %}\n\n <main class=\"frontpage\">\n {% for article in articles %}\n <section>\n <h1><a href=\"{{ article.url }}\">{{ article.title }}</a></h1>\n <time>Published {{ article.locale_date }}</time>\n <p>{{ article.summary }}</p>\n </section>\n {% endfor %}\n </main>\n\n{% endblock %}", "meta": {"content_hash": "d9a765cd0f3bf2cf46dc62c75e9fa255", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 66, "avg_line_length": 22.466666666666665, "alnum_prop": 0.5311572700296736, "repo_name": "greencoder/scrapester.xyz", "id": "0091584c04c82a77fd57bb37fb64d8bd61ed4b28", "size": "337", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "themes/custom/templates/index.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "3508"}, {"name": "HTML", "bytes": "2242"}, {"name": "Python", "bytes": "1704"}, {"name": "Shell", "bytes": "2201"}]}} +{"text": "using namespace cv;\nusing namespace cv::xfeatures2d;\nusing std::cout;\nusing std::endl;\n\nconst char* keys =\n \"{ help h | | Print help message. }\"\n \"{ input1 | box.png | Path to input image 1. }\"\n \"{ input2 | box_in_scene.png | Path to input image 2. }\";\n\nint main( int argc, char* argv[] )\n{\n CommandLineParser parser( argc, argv, keys );\n Mat img_object = imread( samples::findFile( parser.get<String>(\"input1\") ), IMREAD_GRAYSCALE );\n Mat img_scene = imread( samples::findFile( parser.get<String>(\"input2\") ), IMREAD_GRAYSCALE );\n if ( img_object.empty() || img_scene.empty() )\n {\n cout << \"Could not open or find the image!\\n\" << endl;\n parser.printMessage();\n return -1;\n }\n\n //-- Step 1: Detect the keypoints using SURF Detector, compute the descriptors\n int minHessian = 400;\n Ptr<SURF> detector = SURF::create( minHessian );\n std::vector<KeyPoint> keypoints_object, keypoints_scene;\n Mat descriptors_object, descriptors_scene;\n detector->detectAndCompute( img_object, noArray(), keypoints_object, descriptors_object );\n detector->detectAndCompute( img_scene, noArray(), keypoints_scene, descriptors_scene );\n\n //-- Step 2: Matching descriptor vectors with a FLANN based matcher\n // Since SURF is a floating-point descriptor NORM_L2 is used\n Ptr<DescriptorMatcher> matcher = DescriptorMatcher::create(DescriptorMatcher::FLANNBASED);\n std::vector< std::vector<DMatch> > knn_matches;\n matcher->knnMatch( descriptors_object, descriptors_scene, knn_matches, 2 );\n\n //-- Filter matches using the Lowe's ratio test\n const float ratio_thresh = 0.75f;\n std::vector<DMatch> good_matches;\n for (size_t i = 0; i < knn_matches.size(); i++)\n {\n if (knn_matches[i][0].distance < ratio_thresh * knn_matches[i][1].distance)\n {\n good_matches.push_back(knn_matches[i][0]);\n }\n }\n\n //-- Draw matches\n Mat img_matches;\n drawMatches( img_object, keypoints_object, img_scene, keypoints_scene, good_matches, img_matches, Scalar::all(-1),\n Scalar::all(-1), std::vector<char>(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS );\n\n //-- Localize the object\n std::vector<Point2f> obj;\n std::vector<Point2f> scene;\n\n for( size_t i = 0; i < good_matches.size(); i++ )\n {\n //-- Get the keypoints from the good matches\n obj.push_back( keypoints_object[ good_matches[i].queryIdx ].pt );\n scene.push_back( keypoints_scene[ good_matches[i].trainIdx ].pt );\n }\n\n Mat H = findHomography( obj, scene, RANSAC );\n\n //-- Get the corners from the image_1 ( the object to be \"detected\" )\n std::vector<Point2f> obj_corners(4);\n obj_corners[0] = Point2f(0, 0);\n obj_corners[1] = Point2f( (float)img_object.cols, 0 );\n obj_corners[2] = Point2f( (float)img_object.cols, (float)img_object.rows );\n obj_corners[3] = Point2f( 0, (float)img_object.rows );\n std::vector<Point2f> scene_corners(4);\n\n perspectiveTransform( obj_corners, scene_corners, H);\n\n //-- Draw lines between the corners (the mapped object in the scene - image_2 )\n line( img_matches, scene_corners[0] + Point2f((float)img_object.cols, 0),\n scene_corners[1] + Point2f((float)img_object.cols, 0), Scalar(0, 255, 0), 4 );\n line( img_matches, scene_corners[1] + Point2f((float)img_object.cols, 0),\n scene_corners[2] + Point2f((float)img_object.cols, 0), Scalar( 0, 255, 0), 4 );\n line( img_matches, scene_corners[2] + Point2f((float)img_object.cols, 0),\n scene_corners[3] + Point2f((float)img_object.cols, 0), Scalar( 0, 255, 0), 4 );\n line( img_matches, scene_corners[3] + Point2f((float)img_object.cols, 0),\n scene_corners[0] + Point2f((float)img_object.cols, 0), Scalar( 0, 255, 0), 4 );\n\n //-- Show detected matches\n imshow(\"Good Matches & Object detection\", img_matches );\n\n waitKey();\n return 0;\n}\n#else\nint main()\n{\n std::cout << \"This tutorial code needs the xfeatures2d contrib module to be run.\" << std::endl;\n return 0;\n}\n#endif\n", "meta": {"content_hash": "4915b4b4ba5e249df6a02b4b5e3746b4", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 118, "avg_line_length": 41.704081632653065, "alnum_prop": 0.6359187668216295, "repo_name": "opencv/opencv", "id": "2aa0bcd9cbb9c2eaafdc85aaa38e3577440360ed", "size": "4329", "binary": false, "copies": "2", "ref": "refs/heads/4.x", "path": "samples/cpp/tutorial_code/features2D/feature_homography/SURF_FLANN_matching_homography_Demo.cpp", "mode": "33188", "license": "apache-2.0", "language": [{"name": "AIDL", "bytes": "1986"}, {"name": "Batchfile", "bytes": "1498"}, {"name": "C", "bytes": "1543870"}, {"name": "C++", "bytes": "35975082"}, {"name": "CMake", "bytes": "1010867"}, {"name": "Cuda", "bytes": "333437"}, {"name": "Dockerfile", "bytes": "309"}, {"name": "HTML", "bytes": "40027"}, {"name": "Java", "bytes": "774232"}, {"name": "JavaScript", "bytes": "233673"}, {"name": "Kotlin", "bytes": "5204"}, {"name": "Objective-C", "bytes": "100731"}, {"name": "Objective-C++", "bytes": "392600"}, {"name": "Perl", "bytes": "15865"}, {"name": "PowerShell", "bytes": "14591"}, {"name": "Prolog", "bytes": "843"}, {"name": "Python", "bytes": "1038154"}, {"name": "Shell", "bytes": "22738"}, {"name": "Swift", "bytes": "301765"}, {"name": "TeX", "bytes": "3530"}]}} +{"text": "<!--MENU DE ADMINISTRADOR-->\n\n<?php \n/* obtiene la ruta del proyecto*/\n $rutaBase = base_url();\n?>\n\n<nav class=\"navbar navbar-default\">\n <div class=\"container-fluid\">\n <!-- Brand and toggle get grouped for better mobile display -->\n <div class=\"navbar-header\">\n <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\" aria-expanded=\"false\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n\t \n <a class=\"navbar-brand\" href=\"<?php echo $rutaBase.'resources/imagenes/im2.png'; ?>\"><img src=\"<?php echo $rutaBase.'resources/imagenes/im2.png'; ?>\" height=\"180%\" width=\"60%\" ></a>\n </div>\n\n <div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\n <ul class=\"nav navbar-nav navbar-right\">\n\t\t\t<li class=\"dropdown\">\n <a id=\"drop1\" href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Enlace 1\n \n </a>\n </li>\n\t\t\t\n\t\t\t<li class=\"dropdown\">\n <a id=\"drop2\" href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Enlace 2\n <span class=\"caret\"></span>\n </a>\n <ul class=\"dropdown-menu\" aria-labelledby=\"drop4\">\n <li><a href=\"#\">Lista 2.1</a></li>\n <li><a href=\"#\">Lista 2.2</a></li>\n <li><a href=\"#\">Lista 2.3</a></li>\n <li role=\"separator\" class=\"divider\"></li>\n <li><a href=\"#\">Lista 2.4</a></li>\n </ul>\n </li>\n\t\t\t\n\t\t\t<li class=\"dropdown\">\n <a id=\"drop1\" href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Enlace 3\n <span class=\"caret\"></span>\n </a>\n <ul class=\"dropdown-menu\" aria-labelledby=\"drop1\">\n <li><a href=\"#\">Lista 1</a></li>\n <li><a href=\"#\">Lista 2</a></li>\n <li><a href=\"#\">Lista 3</a></li>\n <li role=\"separator\" class=\"divider\"></li>\n <li><a href=\"#\">Lista 4</a></li>\n </ul>\n </li>\n\t\t\t\n\t\t\t<li class=\"dropdown\">\n <a id=\"drop1\" href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Enlace 4\n <span class=\"caret\"></span>\n </a>\n <ul class=\"dropdown-menu\" aria-labelledby=\"drop1\">\n <li><a href=\"#\">Lista 1</a></li>\n <li><a href=\"#\">Lista 2</a></li>\n <li><a href=\"#\">Lista 3</a></li>\n <li role=\"separator\" class=\"divider\"></li>\n <li><a href=\"#\">Lista 4</a></li>\n </ul>\n </li>\n\t\t\t\n <li id=\"fat-menu\" class=\"dropdown\">\n <a id=\"drop3\" href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">\n Administrador\n <span class=\"caret\"></span>\n </a>\n <ul class=\"dropdown-menu\" aria-labelledby=\"drop3\">\n\t\t\t\t<!--Se modifica la ruta segun el nombre del controlador-->\n <li><a href=\"<?php echo $rutaBase.'index.php/vistas/usuario';?>\">Usuario</a></li>\n </ul>\n </li>\n\t\t\t\n\t\t\t\n\t\t\t\n </ul>\n </div><!-- /.nav-collapse -->\n </div><!-- /.container-fluid -->\n", "meta": {"content_hash": "8e86765499f12e3b10035ae66a376e36", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 187, "avg_line_length": 42.07954545454545, "alnum_prop": 0.497164461247637, "repo_name": "DaniGeraldine/Layout", "id": "a2971000e138fe0850d3766c426f3631579b419e", "size": "3703", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/menu_admin.php", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "240"}, {"name": "CSS", "bytes": "12194"}, {"name": "HTML", "bytes": "5372956"}, {"name": "JavaScript", "bytes": "51459"}, {"name": "PHP", "bytes": "1735671"}]}} +{"text": "use std::cmp;\nuse std::fmt::{self, Formatter};\nuse std::mem::{self, ManuallyDrop};\nuse std::num::NonZeroU32;\nuse std::ops::{Deref, DerefMut};\n#[cfg(all(feature = \"wayland\", not(any(target_os = \"macos\", windows))))]\nuse std::sync::atomic::Ordering;\n\nuse glutin::context::{NotCurrentContext, PossiblyCurrentContext};\nuse glutin::prelude::*;\nuse glutin::surface::{Rect as DamageRect, Surface, SwapInterval, WindowSurface};\n\nuse log::{debug, info, warn};\nuse parking_lot::MutexGuard;\nuse serde::{Deserialize, Serialize};\nuse winit::dpi::PhysicalSize;\nuse winit::event::ModifiersState;\nuse winit::window::CursorIcon;\n\nuse crossfont::{self, Rasterize, Rasterizer};\nuse unicode_width::UnicodeWidthChar;\n\nuse alacritty_terminal::ansi::{CursorShape, NamedColor};\nuse alacritty_terminal::config::MAX_SCROLLBACK_LINES;\nuse alacritty_terminal::event::{EventListener, OnResize, WindowSize};\nuse alacritty_terminal::grid::Dimensions as TermDimensions;\nuse alacritty_terminal::index::{Column, Direction, Line, Point};\nuse alacritty_terminal::selection::{Selection, SelectionRange};\nuse alacritty_terminal::term::cell::Flags;\nuse alacritty_terminal::term::color::Rgb;\nuse alacritty_terminal::term::{self, Term, TermDamage, TermMode, MIN_COLUMNS, MIN_SCREEN_LINES};\n\nuse crate::config::font::Font;\nuse crate::config::window::Dimensions;\n#[cfg(not(windows))]\nuse crate::config::window::StartupMode;\nuse crate::config::UiConfig;\nuse crate::display::bell::VisualBell;\nuse crate::display::color::List;\nuse crate::display::content::{RenderableContent, RenderableCursor};\nuse crate::display::cursor::IntoRects;\nuse crate::display::damage::RenderDamageIterator;\nuse crate::display::hint::{HintMatch, HintState};\nuse crate::display::meter::Meter;\nuse crate::display::window::Window;\nuse crate::event::{Mouse, SearchState};\nuse crate::message_bar::{MessageBuffer, MessageType};\nuse crate::renderer::rects::{RenderLine, RenderLines, RenderRect};\nuse crate::renderer::{self, GlyphCache, Renderer};\nuse crate::string::{ShortenDirection, StrShortener};\n\npub mod content;\npub mod cursor;\npub mod hint;\npub mod window;\n\nmod bell;\nmod color;\nmod damage;\nmod meter;\n\n/// Label for the forward terminal search bar.\nconst FORWARD_SEARCH_LABEL: &str = \"Search: \";\n\n/// Label for the backward terminal search bar.\nconst BACKWARD_SEARCH_LABEL: &str = \"Backward Search: \";\n\n/// The character used to shorten the visible text like uri preview or search regex.\nconst SHORTENER: char = '\u2026';\n\n/// Color which is used to highlight damaged rects when debugging.\nconst DAMAGE_RECT_COLOR: Rgb = Rgb { r: 255, g: 0, b: 255 };\n\n#[derive(Debug)]\npub enum Error {\n /// Error with window management.\n Window(window::Error),\n\n /// Error dealing with fonts.\n Font(crossfont::Error),\n\n /// Error in renderer.\n Render(renderer::Error),\n\n /// Error during context operations.\n Context(glutin::error::Error),\n}\n\nimpl std::error::Error for Error {\n fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {\n match self {\n Error::Window(err) => err.source(),\n Error::Font(err) => err.source(),\n Error::Render(err) => err.source(),\n Error::Context(err) => err.source(),\n }\n }\n}\n\nimpl fmt::Display for Error {\n fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {\n match self {\n Error::Window(err) => err.fmt(f),\n Error::Font(err) => err.fmt(f),\n Error::Render(err) => err.fmt(f),\n Error::Context(err) => err.fmt(f),\n }\n }\n}\n\nimpl From<window::Error> for Error {\n fn from(val: window::Error) -> Self {\n Error::Window(val)\n }\n}\n\nimpl From<crossfont::Error> for Error {\n fn from(val: crossfont::Error) -> Self {\n Error::Font(val)\n }\n}\n\nimpl From<renderer::Error> for Error {\n fn from(val: renderer::Error) -> Self {\n Error::Render(val)\n }\n}\n\nimpl From<glutin::error::Error> for Error {\n fn from(val: glutin::error::Error) -> Self {\n Error::Context(val)\n }\n}\n\n/// Terminal size info.\n#[derive(Serialize, Deserialize, Debug, Copy, Clone, PartialEq, Eq)]\npub struct SizeInfo<T = f32> {\n /// Terminal window width.\n width: T,\n\n /// Terminal window height.\n height: T,\n\n /// Width of individual cell.\n cell_width: T,\n\n /// Height of individual cell.\n cell_height: T,\n\n /// Horizontal window padding.\n padding_x: T,\n\n /// Vertical window padding.\n padding_y: T,\n\n /// Number of lines in the viewport.\n screen_lines: usize,\n\n /// Number of columns in the viewport.\n columns: usize,\n}\n\nimpl From<SizeInfo<f32>> for SizeInfo<u32> {\n fn from(size_info: SizeInfo<f32>) -> Self {\n Self {\n width: size_info.width as u32,\n height: size_info.height as u32,\n cell_width: size_info.cell_width as u32,\n cell_height: size_info.cell_height as u32,\n padding_x: size_info.padding_x as u32,\n padding_y: size_info.padding_y as u32,\n screen_lines: size_info.screen_lines,\n columns: size_info.screen_lines,\n }\n }\n}\n\nimpl From<SizeInfo<f32>> for WindowSize {\n fn from(size_info: SizeInfo<f32>) -> Self {\n Self {\n num_cols: size_info.columns() as u16,\n num_lines: size_info.screen_lines() as u16,\n cell_width: size_info.cell_width() as u16,\n cell_height: size_info.cell_height() as u16,\n }\n }\n}\n\nimpl<T: Clone + Copy> SizeInfo<T> {\n #[inline]\n pub fn width(&self) -> T {\n self.width\n }\n\n #[inline]\n pub fn height(&self) -> T {\n self.height\n }\n\n #[inline]\n pub fn cell_width(&self) -> T {\n self.cell_width\n }\n\n #[inline]\n pub fn cell_height(&self) -> T {\n self.cell_height\n }\n\n #[inline]\n pub fn padding_x(&self) -> T {\n self.padding_x\n }\n\n #[inline]\n pub fn padding_y(&self) -> T {\n self.padding_y\n }\n}\n\nimpl SizeInfo<f32> {\n #[allow(clippy::too_many_arguments)]\n pub fn new(\n width: f32,\n height: f32,\n cell_width: f32,\n cell_height: f32,\n mut padding_x: f32,\n mut padding_y: f32,\n dynamic_padding: bool,\n ) -> SizeInfo {\n if dynamic_padding {\n padding_x = Self::dynamic_padding(padding_x.floor(), width, cell_width);\n padding_y = Self::dynamic_padding(padding_y.floor(), height, cell_height);\n }\n\n let lines = (height - 2. * padding_y) / cell_height;\n let screen_lines = cmp::max(lines as usize, MIN_SCREEN_LINES);\n\n let columns = (width - 2. * padding_x) / cell_width;\n let columns = cmp::max(columns as usize, MIN_COLUMNS);\n\n SizeInfo {\n width,\n height,\n cell_width,\n cell_height,\n padding_x: padding_x.floor(),\n padding_y: padding_y.floor(),\n screen_lines,\n columns,\n }\n }\n\n #[inline]\n pub fn reserve_lines(&mut self, count: usize) {\n self.screen_lines = cmp::max(self.screen_lines.saturating_sub(count), MIN_SCREEN_LINES);\n }\n\n /// Check if coordinates are inside the terminal grid.\n ///\n /// The padding, message bar or search are not counted as part of the grid.\n #[inline]\n pub fn contains_point(&self, x: usize, y: usize) -> bool {\n x <= (self.padding_x + self.columns as f32 * self.cell_width) as usize\n && x > self.padding_x as usize\n && y <= (self.padding_y + self.screen_lines as f32 * self.cell_height) as usize\n && y > self.padding_y as usize\n }\n\n /// Calculate padding to spread it evenly around the terminal content.\n #[inline]\n fn dynamic_padding(padding: f32, dimension: f32, cell_dimension: f32) -> f32 {\n padding + ((dimension - 2. * padding) % cell_dimension) / 2.\n }\n}\n\nimpl TermDimensions for SizeInfo {\n #[inline]\n fn columns(&self) -> usize {\n self.columns\n }\n\n #[inline]\n fn screen_lines(&self) -> usize {\n self.screen_lines\n }\n\n #[inline]\n fn total_lines(&self) -> usize {\n self.screen_lines()\n }\n}\n\n#[derive(Default, Clone, Debug, PartialEq, Eq)]\npub struct DisplayUpdate {\n pub dirty: bool,\n\n dimensions: Option<PhysicalSize<u32>>,\n cursor_dirty: bool,\n font: Option<Font>,\n}\n\nimpl DisplayUpdate {\n pub fn dimensions(&self) -> Option<PhysicalSize<u32>> {\n self.dimensions\n }\n\n pub fn font(&self) -> Option<&Font> {\n self.font.as_ref()\n }\n\n pub fn cursor_dirty(&self) -> bool {\n self.cursor_dirty\n }\n\n pub fn set_dimensions(&mut self, dimensions: PhysicalSize<u32>) {\n self.dimensions = Some(dimensions);\n self.dirty = true;\n }\n\n pub fn set_font(&mut self, font: Font) {\n self.font = Some(font);\n self.dirty = true;\n }\n\n pub fn set_cursor_dirty(&mut self) {\n self.cursor_dirty = true;\n self.dirty = true;\n }\n}\n\n/// The display wraps a window, font rasterizer, and GPU renderer.\npub struct Display {\n pub window: Window,\n\n pub size_info: SizeInfo,\n\n /// Hint highlighted by the mouse.\n pub highlighted_hint: Option<HintMatch>,\n\n /// Hint highlighted by the vi mode cursor.\n pub vi_highlighted_hint: Option<HintMatch>,\n\n pub is_wayland: bool,\n\n /// UI cursor visibility for blinking.\n pub cursor_hidden: bool,\n\n pub visual_bell: VisualBell,\n\n /// Mapped RGB values for each terminal color.\n pub colors: List,\n\n /// State of the keyboard hints.\n pub hint_state: HintState,\n\n /// Unprocessed display updates.\n pub pending_update: DisplayUpdate,\n\n /// The renderer update that takes place only once before the actual rendering.\n pub pending_renderer_update: Option<RendererUpdate>,\n\n /// The ime on the given display.\n pub ime: Ime,\n\n // Mouse point position when highlighting hints.\n hint_mouse_point: Option<Point>,\n\n renderer: ManuallyDrop<Renderer>,\n\n surface: ManuallyDrop<Surface<WindowSurface>>,\n\n context: ManuallyDrop<Replaceable<PossiblyCurrentContext>>,\n\n debug_damage: bool,\n damage_rects: Vec<DamageRect>,\n next_frame_damage_rects: Vec<DamageRect>,\n glyph_cache: GlyphCache,\n meter: Meter,\n}\n\nimpl Display {\n pub fn new(\n window: Window,\n gl_context: NotCurrentContext,\n config: &UiConfig,\n ) -> Result<Display, Error> {\n #[cfg(any(not(feature = \"wayland\"), target_os = \"macos\", windows))]\n let is_wayland = false;\n #[cfg(all(feature = \"wayland\", not(any(target_os = \"macos\", windows))))]\n let is_wayland = window.wayland_surface().is_some();\n\n let scale_factor = window.scale_factor as f32;\n let rasterizer = Rasterizer::new(scale_factor)?;\n\n debug!(\"Loading \\\"{}\\\" font\", &config.font.normal().family);\n let mut glyph_cache = GlyphCache::new(rasterizer, &config.font)?;\n\n let metrics = glyph_cache.font_metrics();\n let (cell_width, cell_height) = compute_cell_size(config, &metrics);\n\n // Resize the window to account for the user configured size.\n if let Some(dimensions) = config.window.dimensions() {\n let size = window_size(config, dimensions, cell_width, cell_height, scale_factor);\n window.set_inner_size(size);\n }\n\n // Create the GL surface to draw into.\n let surface = renderer::platform::create_gl_surface(\n &gl_context,\n window.inner_size(),\n window.raw_window_handle(),\n )?;\n\n // Make the context current.\n let context = gl_context.make_current(&surface)?;\n\n // Create renderer.\n let mut renderer = Renderer::new(&context)?;\n\n // Load font common glyphs to accelerate rendering.\n debug!(\"Filling glyph cache with common glyphs\");\n renderer.with_loader(|mut api| {\n glyph_cache.reset_glyph_cache(&mut api);\n });\n\n let padding = config.window.padding(window.scale_factor as f32);\n let viewport_size = window.inner_size();\n\n // Create new size with at least one column and row.\n let size_info = SizeInfo::new(\n viewport_size.width as f32,\n viewport_size.height as f32,\n cell_width,\n cell_height,\n padding.0,\n padding.1,\n config.window.dynamic_padding && config.window.dimensions().is_none(),\n );\n\n info!(\"Cell size: {} x {}\", cell_width, cell_height);\n info!(\"Padding: {} x {}\", size_info.padding_x(), size_info.padding_y());\n info!(\"Width: {}, Height: {}\", size_info.width(), size_info.height());\n\n // Update OpenGL projection.\n renderer.resize(&size_info);\n\n // Clear screen.\n let background_color = config.colors.primary.background;\n renderer.clear(background_color, config.window_opacity());\n\n // Disable shadows for transparent windows on macOS.\n #[cfg(target_os = \"macos\")]\n window.set_has_shadow(config.window_opacity() >= 1.0);\n\n // On Wayland we can safely ignore this call, since the window isn't visible until you\n // actually draw something into it and commit those changes.\n #[cfg(not(any(target_os = \"macos\", windows)))]\n if !is_wayland {\n surface.swap_buffers(&context).expect(\"failed to swap buffers.\");\n renderer.finish();\n }\n\n window.set_visible(true);\n\n #[allow(clippy::single_match)]\n #[cfg(not(windows))]\n match config.window.startup_mode {\n #[cfg(target_os = \"macos\")]\n StartupMode::SimpleFullscreen => window.set_simple_fullscreen(true),\n #[cfg(not(any(target_os = \"macos\", windows)))]\n StartupMode::Maximized if !is_wayland => window.set_maximized(true),\n _ => (),\n }\n\n let hint_state = HintState::new(config.hints.alphabet());\n\n let debug_damage = config.debug.highlight_damage;\n let (damage_rects, next_frame_damage_rects) = if is_wayland || debug_damage {\n let vec = Vec::with_capacity(size_info.screen_lines());\n (vec.clone(), vec)\n } else {\n (Vec::new(), Vec::new())\n };\n\n // We use vsync everywhere except wayland.\n if !is_wayland {\n if let Err(err) =\n surface.set_swap_interval(&context, SwapInterval::Wait(NonZeroU32::new(1).unwrap()))\n {\n warn!(\"Error setting vsync: {:?}\", err);\n }\n }\n\n Ok(Self {\n window,\n context: ManuallyDrop::new(Replaceable::new(context)),\n surface: ManuallyDrop::new(surface),\n renderer: ManuallyDrop::new(renderer),\n glyph_cache,\n hint_state,\n meter: Meter::new(),\n size_info,\n ime: Ime::new(),\n highlighted_hint: None,\n vi_highlighted_hint: None,\n is_wayland,\n cursor_hidden: false,\n visual_bell: VisualBell::from(&config.bell),\n colors: List::from(&config.colors),\n pending_update: Default::default(),\n pending_renderer_update: Default::default(),\n debug_damage,\n damage_rects,\n next_frame_damage_rects,\n hint_mouse_point: None,\n })\n }\n\n #[inline]\n pub fn gl_context(&self) -> &PossiblyCurrentContext {\n self.context.get()\n }\n\n pub fn make_not_current(&mut self) {\n if self.context.get().is_current() {\n self.context.replace_with(|context| {\n context\n .make_not_current()\n .expect(\"failed to disable context\")\n .treat_as_possibly_current()\n });\n }\n }\n\n pub fn make_current(&self) {\n if !self.context.get().is_current() {\n self.context.make_current(&self.surface).expect(\"failed to make context current\")\n }\n }\n\n fn swap_buffers(&self) {\n #[allow(clippy::single_match)]\n match (self.surface.deref(), &self.context.get()) {\n #[cfg(not(any(target_os = \"macos\", windows)))]\n (Surface::Egl(surface), PossiblyCurrentContext::Egl(context))\n if self.is_wayland && !self.debug_damage =>\n {\n surface.swap_buffers_with_damage(context, &self.damage_rects)\n },\n (surface, context) => surface.swap_buffers(context),\n }\n .expect(\"failed to swap buffers.\");\n }\n\n /// Update font size and cell dimensions.\n ///\n /// This will return a tuple of the cell width and height.\n fn update_font_size(\n glyph_cache: &mut GlyphCache,\n scale_factor: f64,\n config: &UiConfig,\n font: &Font,\n ) -> (f32, f32) {\n let _ = glyph_cache.update_font_size(font, scale_factor);\n\n // Compute new cell sizes.\n compute_cell_size(config, &glyph_cache.font_metrics())\n }\n\n /// Reset glyph cache.\n fn reset_glyph_cache(&mut self) {\n let cache = &mut self.glyph_cache;\n self.renderer.with_loader(|mut api| {\n cache.reset_glyph_cache(&mut api);\n });\n }\n\n /// Process update events.\n ///\n /// XXX: this function must not call to any `OpenGL` related tasks. Only logical update\n /// of the state is being performed here. Rendering update takes part right before the\n /// actual rendering.\n pub fn handle_update<T>(\n &mut self,\n terminal: &mut Term<T>,\n pty_resize_handle: &mut dyn OnResize,\n message_buffer: &MessageBuffer,\n search_active: bool,\n config: &UiConfig,\n ) where\n T: EventListener,\n {\n let pending_update = mem::take(&mut self.pending_update);\n\n let (mut cell_width, mut cell_height) =\n (self.size_info.cell_width(), self.size_info.cell_height());\n\n if pending_update.font().is_some() || pending_update.cursor_dirty() {\n let renderer_update = self.pending_renderer_update.get_or_insert(Default::default());\n renderer_update.clear_font_cache = true\n }\n\n // Update font size and cell dimensions.\n if let Some(font) = pending_update.font() {\n let scale_factor = self.window.scale_factor;\n let cell_dimensions =\n Self::update_font_size(&mut self.glyph_cache, scale_factor, config, font);\n cell_width = cell_dimensions.0;\n cell_height = cell_dimensions.1;\n\n info!(\"Cell size: {} x {}\", cell_width, cell_height);\n }\n\n let (mut width, mut height) = (self.size_info.width(), self.size_info.height());\n if let Some(dimensions) = pending_update.dimensions() {\n width = dimensions.width as f32;\n height = dimensions.height as f32;\n\n let renderer_update = self.pending_renderer_update.get_or_insert(Default::default());\n renderer_update.resize = true\n }\n\n let padding = config.window.padding(self.window.scale_factor as f32);\n\n self.size_info = SizeInfo::new(\n width,\n height,\n cell_width,\n cell_height,\n padding.0,\n padding.1,\n config.window.dynamic_padding,\n );\n\n // Update number of column/lines in the viewport.\n let message_bar_lines =\n message_buffer.message().map_or(0, |m| m.text(&self.size_info).len());\n let search_lines = usize::from(search_active);\n self.size_info.reserve_lines(message_bar_lines + search_lines);\n\n // Resize PTY.\n pty_resize_handle.on_resize(self.size_info.into());\n\n // Resize terminal.\n terminal.resize(self.size_info);\n }\n\n /// Update the state of the renderer.\n ///\n /// NOTE: The update to the renderer is split from the display update on purpose, since\n /// on some platforms, like Wayland, resize and other OpenGL operations must be performed\n /// right before rendering, otherwise they could lock the back buffer resulting in\n /// rendering with the buffer of old size.\n ///\n /// This also resolves any flickering, since the resize is now synced with frame callbacks.\n pub fn process_renderer_update(&mut self) {\n let renderer_update = match self.pending_renderer_update.take() {\n Some(renderer_update) => renderer_update,\n _ => return,\n };\n\n // Resize renderer.\n if renderer_update.resize {\n let width = NonZeroU32::new(self.size_info.width() as u32).unwrap();\n let height = NonZeroU32::new(self.size_info.height() as u32).unwrap();\n self.surface.resize(&self.context, width, height);\n }\n\n // Ensure we're modifying the correct OpenGL context.\n self.make_current();\n\n if renderer_update.clear_font_cache {\n self.reset_glyph_cache();\n }\n\n self.renderer.resize(&self.size_info);\n\n if self.collect_damage() {\n let lines = self.size_info.screen_lines();\n if lines > self.damage_rects.len() {\n self.damage_rects.reserve(lines);\n } else {\n self.damage_rects.shrink_to(lines);\n }\n }\n\n info!(\"Padding: {} x {}\", self.size_info.padding_x(), self.size_info.padding_y());\n info!(\"Width: {}, Height: {}\", self.size_info.width(), self.size_info.height());\n\n // Damage the entire screen after processing update.\n self.fully_damage();\n }\n\n /// Damage the entire window.\n fn fully_damage(&mut self) {\n let screen_rect =\n DamageRect::new(0, 0, self.size_info.width() as i32, self.size_info.height() as i32);\n\n self.damage_rects.push(screen_rect);\n }\n\n fn update_damage<T: EventListener>(\n &mut self,\n terminal: &mut MutexGuard<'_, Term<T>>,\n selection_range: Option<SelectionRange>,\n search_state: &SearchState,\n ) {\n let requires_full_damage = self.visual_bell.intensity() != 0.\n || self.hint_state.active()\n || search_state.regex().is_some();\n if requires_full_damage {\n terminal.mark_fully_damaged();\n }\n\n self.damage_highlighted_hints(terminal);\n match terminal.damage(selection_range) {\n TermDamage::Full => self.fully_damage(),\n TermDamage::Partial(damaged_lines) => {\n let damaged_rects = RenderDamageIterator::new(damaged_lines, self.size_info.into());\n for damaged_rect in damaged_rects {\n self.damage_rects.push(damaged_rect);\n }\n },\n }\n terminal.reset_damage();\n\n // Ensure that the content requiring full damage is cleaned up again on the next frame.\n if requires_full_damage {\n terminal.mark_fully_damaged();\n }\n\n // Damage highlighted hints for the next frame as well, so we'll clear them.\n self.damage_highlighted_hints(terminal);\n }\n\n /// Draw the screen.\n ///\n /// A reference to Term whose state is being drawn must be provided.\n ///\n /// This call may block if vsync is enabled.\n pub fn draw<T: EventListener>(\n &mut self,\n mut terminal: MutexGuard<'_, Term<T>>,\n message_buffer: &MessageBuffer,\n config: &UiConfig,\n search_state: &SearchState,\n ) {\n // Collect renderable content before the terminal is dropped.\n let mut content = RenderableContent::new(config, self, &terminal, search_state);\n let mut grid_cells = Vec::new();\n for cell in &mut content {\n grid_cells.push(cell);\n }\n let selection_range = content.selection_range();\n let foreground_color = content.color(NamedColor::Foreground as usize);\n let background_color = content.color(NamedColor::Background as usize);\n let display_offset = content.display_offset();\n let cursor = content.cursor();\n\n let cursor_point = terminal.grid().cursor.point;\n let total_lines = terminal.grid().total_lines();\n let metrics = self.glyph_cache.font_metrics();\n let size_info = self.size_info;\n\n let vi_mode = terminal.mode().contains(TermMode::VI);\n let vi_cursor_point = if vi_mode { Some(terminal.vi_mode_cursor.point) } else { None };\n\n if self.collect_damage() {\n self.update_damage(&mut terminal, selection_range, search_state);\n }\n\n // Drop terminal as early as possible to free lock.\n drop(terminal);\n\n // Make sure this window's OpenGL context is active.\n self.make_current();\n\n self.renderer.clear(background_color, config.window_opacity());\n let mut lines = RenderLines::new();\n\n // Optimize loop hint comparator.\n let has_highlighted_hint =\n self.highlighted_hint.is_some() || self.vi_highlighted_hint.is_some();\n\n // Draw grid.\n {\n let _sampler = self.meter.sampler();\n\n // Ensure macOS hasn't reset our viewport.\n #[cfg(target_os = \"macos\")]\n self.renderer.set_viewport(&size_info);\n\n let glyph_cache = &mut self.glyph_cache;\n let highlighted_hint = &self.highlighted_hint;\n let vi_highlighted_hint = &self.vi_highlighted_hint;\n\n self.renderer.draw_cells(\n &size_info,\n glyph_cache,\n grid_cells.into_iter().map(|mut cell| {\n // Underline hints hovered by mouse or vi mode cursor.\n let point = term::viewport_to_point(display_offset, cell.point);\n\n if has_highlighted_hint {\n let hyperlink =\n cell.extra.as_ref().and_then(|extra| extra.hyperlink.as_ref());\n if highlighted_hint\n .as_ref()\n .map_or(false, |hint| hint.should_highlight(point, hyperlink))\n || vi_highlighted_hint\n .as_ref()\n .map_or(false, |hint| hint.should_highlight(point, hyperlink))\n {\n cell.flags.insert(Flags::UNDERLINE);\n }\n }\n\n // Update underline/strikeout.\n lines.update(&cell);\n\n cell\n }),\n );\n }\n\n let mut rects = lines.rects(&metrics, &size_info);\n\n if let Some(vi_cursor_point) = vi_cursor_point {\n // Indicate vi mode by showing the cursor's position in the top right corner.\n let line = (-vi_cursor_point.line.0 + size_info.bottommost_line().0) as usize;\n let obstructed_column = Some(vi_cursor_point)\n .filter(|point| point.line == -(display_offset as i32))\n .map(|point| point.column);\n self.draw_line_indicator(config, total_lines, obstructed_column, line);\n } else if search_state.regex().is_some() {\n // Show current display offset in vi-less search to indicate match position.\n self.draw_line_indicator(config, total_lines, None, display_offset);\n };\n\n // Draw cursor.\n rects.extend(cursor.rects(&size_info, config.terminal_config.cursor.thickness()));\n\n // Push visual bell after url/underline/strikeout rects.\n let visual_bell_intensity = self.visual_bell.intensity();\n if visual_bell_intensity != 0. {\n let visual_bell_rect = RenderRect::new(\n 0.,\n 0.,\n size_info.width(),\n size_info.height(),\n config.bell.color,\n visual_bell_intensity as f32,\n );\n rects.push(visual_bell_rect);\n }\n\n // Handle IME positioning and search bar rendering.\n let ime_position = match search_state.regex() {\n Some(regex) => {\n let search_label = match search_state.direction() {\n Direction::Right => FORWARD_SEARCH_LABEL,\n Direction::Left => BACKWARD_SEARCH_LABEL,\n };\n\n let search_text = Self::format_search(regex, search_label, size_info.columns());\n\n // Render the search bar.\n self.draw_search(config, &search_text);\n\n // Draw search bar cursor.\n let line = size_info.screen_lines();\n let column = Column(search_text.chars().count() - 1);\n\n // Add cursor to search bar if IME is not active.\n if self.ime.preedit().is_none() {\n let fg = config.colors.footer_bar_foreground();\n let shape = CursorShape::Underline;\n let cursor = RenderableCursor::new(Point::new(line, column), shape, fg, false);\n rects.extend(\n cursor.rects(&size_info, config.terminal_config.cursor.thickness()),\n );\n }\n\n Some(Point::new(line, column))\n },\n None => {\n let num_lines = self.size_info.screen_lines();\n term::point_to_viewport(display_offset, cursor_point)\n .filter(|point| point.line < num_lines)\n },\n };\n\n // Handle IME.\n if self.ime.is_enabled() {\n if let Some(point) = ime_position {\n let (fg, bg) = if search_state.regex().is_some() {\n (config.colors.footer_bar_foreground(), config.colors.footer_bar_background())\n } else {\n (foreground_color, background_color)\n };\n\n self.draw_ime_preview(point, fg, bg, &mut rects, config);\n }\n }\n\n if self.debug_damage {\n self.highlight_damage(&mut rects);\n }\n\n if let Some(message) = message_buffer.message() {\n let search_offset = usize::from(search_state.regex().is_some());\n let text = message.text(&size_info);\n\n // Create a new rectangle for the background.\n let start_line = size_info.screen_lines() + search_offset;\n let y = size_info.cell_height().mul_add(start_line as f32, size_info.padding_y());\n\n let bg = match message.ty() {\n MessageType::Error => config.colors.normal.red,\n MessageType::Warning => config.colors.normal.yellow,\n };\n\n let message_bar_rect =\n RenderRect::new(0., y, size_info.width(), size_info.height() - y, bg, 1.);\n\n // Push message_bar in the end, so it'll be above all other content.\n rects.push(message_bar_rect);\n\n // Draw rectangles.\n self.renderer.draw_rects(&size_info, &metrics, rects);\n\n // Relay messages to the user.\n let glyph_cache = &mut self.glyph_cache;\n let fg = config.colors.primary.background;\n for (i, message_text) in text.iter().enumerate() {\n let point = Point::new(start_line + i, Column(0));\n self.renderer.draw_string(\n point,\n fg,\n bg,\n message_text.chars(),\n &size_info,\n glyph_cache,\n );\n }\n } else {\n // Draw rectangles.\n self.renderer.draw_rects(&size_info, &metrics, rects);\n }\n\n self.draw_render_timer(config);\n\n // Draw hyperlink uri preview.\n if has_highlighted_hint {\n let cursor_point = vi_cursor_point.or(Some(cursor_point));\n self.draw_hyperlink_preview(config, cursor_point, display_offset);\n }\n\n // Frame event should be requested before swaping buffers, since it requires surface\n // `commit`, which is done by swap buffers under the hood.\n #[cfg(all(feature = \"wayland\", not(any(target_os = \"macos\", windows))))]\n self.request_frame(&self.window);\n\n // Clearing debug highlights from the previous frame requires full redraw.\n self.swap_buffers();\n\n #[cfg(all(feature = \"x11\", not(any(target_os = \"macos\", windows))))]\n if !self.is_wayland {\n // On X11 `swap_buffers` does not block for vsync. However the next OpenGl command\n // will block to synchronize (this is `glClear` in Alacritty), which causes a\n // permanent one frame delay.\n self.renderer.finish();\n }\n\n self.damage_rects.clear();\n\n // Append damage rects we've enqueued for the next frame.\n mem::swap(&mut self.damage_rects, &mut self.next_frame_damage_rects);\n }\n\n /// Update to a new configuration.\n pub fn update_config(&mut self, config: &UiConfig) {\n self.debug_damage = config.debug.highlight_damage;\n self.visual_bell.update_config(&config.bell);\n self.colors = List::from(&config.colors);\n }\n\n /// Update the mouse/vi mode cursor hint highlighting.\n ///\n /// This will return whether the highlighted hints changed.\n pub fn update_highlighted_hints<T>(\n &mut self,\n term: &Term<T>,\n config: &UiConfig,\n mouse: &Mouse,\n modifiers: ModifiersState,\n ) -> bool {\n // Update vi mode cursor hint.\n let vi_highlighted_hint = if term.mode().contains(TermMode::VI) {\n let mods = ModifiersState::all();\n let point = term.vi_mode_cursor.point;\n hint::highlighted_at(term, config, point, mods)\n } else {\n None\n };\n let mut dirty = vi_highlighted_hint != self.vi_highlighted_hint;\n self.vi_highlighted_hint = vi_highlighted_hint;\n\n // Abort if mouse highlighting conditions are not met.\n if !mouse.inside_text_area || !term.selection.as_ref().map_or(true, Selection::is_empty) {\n dirty |= self.highlighted_hint.is_some();\n self.highlighted_hint = None;\n return dirty;\n }\n\n // Find highlighted hint at mouse position.\n let point = mouse.point(&self.size_info, term.grid().display_offset());\n let highlighted_hint = hint::highlighted_at(term, config, point, modifiers);\n\n // Update cursor shape.\n if highlighted_hint.is_some() {\n // If mouse changed the line, we should update the hyperlink preview, since the\n // highlighted hint could be disrupted by the old preview.\n dirty = self.hint_mouse_point.map_or(false, |p| p.line != point.line);\n self.hint_mouse_point = Some(point);\n self.window.set_mouse_cursor(CursorIcon::Hand);\n } else if self.highlighted_hint.is_some() {\n self.hint_mouse_point = None;\n if term.mode().intersects(TermMode::MOUSE_MODE) && !term.mode().contains(TermMode::VI) {\n self.window.set_mouse_cursor(CursorIcon::Default);\n } else {\n self.window.set_mouse_cursor(CursorIcon::Text);\n }\n }\n\n dirty |= self.highlighted_hint != highlighted_hint;\n self.highlighted_hint = highlighted_hint;\n\n dirty\n }\n\n #[inline(never)]\n fn draw_ime_preview(\n &mut self,\n point: Point<usize>,\n fg: Rgb,\n bg: Rgb,\n rects: &mut Vec<RenderRect>,\n config: &UiConfig,\n ) {\n let preedit = match self.ime.preedit() {\n Some(preedit) => preedit,\n None => {\n // In case we don't have preedit, just set the popup point.\n self.window.update_ime_position(point, &self.size_info);\n return;\n },\n };\n\n let num_cols = self.size_info.columns();\n\n // Get the visible preedit.\n let visible_text: String = match (preedit.cursor_byte_offset, preedit.cursor_end_offset) {\n (Some(byte_offset), Some(end_offset)) if end_offset > num_cols => StrShortener::new(\n &preedit.text[byte_offset..],\n num_cols,\n ShortenDirection::Right,\n Some(SHORTENER),\n ),\n _ => {\n StrShortener::new(&preedit.text, num_cols, ShortenDirection::Left, Some(SHORTENER))\n },\n }\n .collect();\n\n let visible_len = visible_text.chars().count();\n\n let end = cmp::min(point.column.0 + visible_len, num_cols);\n let start = end.saturating_sub(visible_len);\n\n let start = Point::new(point.line, Column(start));\n let end = Point::new(point.line, Column(end - 1));\n\n let glyph_cache = &mut self.glyph_cache;\n let metrics = glyph_cache.font_metrics();\n\n self.renderer.draw_string(\n start,\n fg,\n bg,\n visible_text.chars(),\n &self.size_info,\n glyph_cache,\n );\n\n if self.collect_damage() {\n let damage = self.damage_from_point(Point::new(start.line, Column(0)), num_cols as u32);\n self.damage_rects.push(damage);\n self.next_frame_damage_rects.push(damage);\n }\n\n // Add underline for preedit text.\n let underline = RenderLine { start, end, color: fg };\n rects.extend(underline.rects(Flags::UNDERLINE, &metrics, &self.size_info));\n\n let ime_popup_point = match preedit.cursor_end_offset {\n Some(cursor_end_offset) if cursor_end_offset != 0 => {\n let is_wide = preedit.text[preedit.cursor_byte_offset.unwrap_or_default()..]\n .chars()\n .next()\n .map(|ch| ch.width() == Some(2))\n .unwrap_or_default();\n\n let cursor_column = Column(\n (end.column.0 as isize - cursor_end_offset as isize + 1).max(0) as usize,\n );\n let cursor_point = Point::new(point.line, cursor_column);\n let cursor =\n RenderableCursor::new(cursor_point, CursorShape::HollowBlock, fg, is_wide);\n rects.extend(\n cursor.rects(&self.size_info, config.terminal_config.cursor.thickness()),\n );\n cursor_point\n },\n _ => end,\n };\n\n self.window.update_ime_position(ime_popup_point, &self.size_info);\n }\n\n /// Format search regex to account for the cursor and fullwidth characters.\n fn format_search(search_regex: &str, search_label: &str, max_width: usize) -> String {\n let label_len = search_label.len();\n\n // Skip `search_regex` formatting if only label is visible.\n if label_len > max_width {\n return search_label[..max_width].to_owned();\n }\n\n // The search string consists of `search_label` + `search_regex` + `cursor`.\n let mut bar_text = String::from(search_label);\n bar_text.extend(StrShortener::new(\n search_regex,\n max_width.wrapping_sub(label_len + 1),\n ShortenDirection::Left,\n Some(SHORTENER),\n ));\n\n // Add place for cursor.\n bar_text.push(' ');\n\n bar_text\n }\n\n /// Draw preview for the currently highlighted `Hyperlink`.\n #[inline(never)]\n fn draw_hyperlink_preview(\n &mut self,\n config: &UiConfig,\n cursor_point: Option<Point>,\n display_offset: usize,\n ) {\n let num_cols = self.size_info.columns();\n let uris: Vec<_> = self\n .highlighted_hint\n .iter()\n .chain(&self.vi_highlighted_hint)\n .filter_map(|hint| hint.hyperlink().map(|hyperlink| hyperlink.uri()))\n .map(|uri| StrShortener::new(uri, num_cols, ShortenDirection::Right, Some(SHORTENER)))\n .collect();\n\n if uris.is_empty() {\n return;\n }\n\n // The maximum amount of protected lines including the ones we'll show preview on.\n let max_protected_lines = uris.len() * 2;\n\n // Lines we shouldn't shouldn't show preview on, because it'll obscure the highlighted\n // hint.\n let mut protected_lines = Vec::with_capacity(max_protected_lines);\n if self.size_info.screen_lines() >= max_protected_lines {\n // Prefer to show preview even when it'll likely obscure the highlighted hint, when\n // there's no place left for it.\n protected_lines.push(self.hint_mouse_point.map(|point| point.line));\n protected_lines.push(cursor_point.map(|point| point.line));\n }\n\n // Find the line in viewport we can draw preview on without obscuring protected lines.\n let viewport_bottom = self.size_info.bottommost_line() - Line(display_offset as i32);\n let viewport_top = viewport_bottom - (self.size_info.screen_lines() - 1);\n let uri_lines = (viewport_top.0..=viewport_bottom.0)\n .rev()\n .map(|line| Some(Line(line)))\n .filter_map(|line| {\n if protected_lines.contains(&line) {\n None\n } else {\n protected_lines.push(line);\n line\n }\n })\n .take(uris.len())\n .flat_map(|line| term::point_to_viewport(display_offset, Point::new(line, Column(0))));\n\n let fg = config.colors.footer_bar_foreground();\n let bg = config.colors.footer_bar_background();\n for (uri, point) in uris.into_iter().zip(uri_lines) {\n // Damage the uri preview.\n if self.collect_damage() {\n let uri_preview_damage = self.damage_from_point(point, num_cols as u32);\n self.damage_rects.push(uri_preview_damage);\n\n // Damage the uri preview for the next frame as well.\n self.next_frame_damage_rects.push(uri_preview_damage);\n }\n\n self.renderer.draw_string(point, fg, bg, uri, &self.size_info, &mut self.glyph_cache);\n }\n }\n\n /// Draw current search regex.\n #[inline(never)]\n fn draw_search(&mut self, config: &UiConfig, text: &str) {\n // Assure text length is at least num_cols.\n let num_cols = self.size_info.columns();\n let text = format!(\"{:<1$}\", text, num_cols);\n\n let point = Point::new(self.size_info.screen_lines(), Column(0));\n\n let fg = config.colors.footer_bar_foreground();\n let bg = config.colors.footer_bar_background();\n\n self.renderer.draw_string(\n point,\n fg,\n bg,\n text.chars(),\n &self.size_info,\n &mut self.glyph_cache,\n );\n }\n\n /// Draw render timer.\n #[inline(never)]\n fn draw_render_timer(&mut self, config: &UiConfig) {\n if !config.debug.render_timer {\n return;\n }\n\n let timing = format!(\"{:.3} usec\", self.meter.average());\n let point = Point::new(self.size_info.screen_lines().saturating_sub(2), Column(0));\n let fg = config.colors.primary.background;\n let bg = config.colors.normal.red;\n\n if self.collect_damage() {\n // Damage the entire line.\n let render_timer_damage =\n self.damage_from_point(point, self.size_info.columns() as u32);\n self.damage_rects.push(render_timer_damage);\n\n // Damage the render timer for the next frame.\n self.next_frame_damage_rects.push(render_timer_damage)\n }\n\n let glyph_cache = &mut self.glyph_cache;\n self.renderer.draw_string(point, fg, bg, timing.chars(), &self.size_info, glyph_cache);\n }\n\n /// Draw an indicator for the position of a line in history.\n #[inline(never)]\n fn draw_line_indicator(\n &mut self,\n config: &UiConfig,\n total_lines: usize,\n obstructed_column: Option<Column>,\n line: usize,\n ) {\n const fn num_digits(mut number: u32) -> usize {\n let mut res = 0;\n loop {\n number /= 10;\n res += 1;\n if number == 0 {\n break res;\n }\n }\n }\n\n let text = format!(\"[{}/{}]\", line, total_lines - 1);\n let column = Column(self.size_info.columns().saturating_sub(text.len()));\n let point = Point::new(0, column);\n\n // Damage the maximum possible length of the format text, which could be achieved when\n // using `MAX_SCROLLBACK_LINES` as current and total lines adding a `3` for formatting.\n const MAX_SIZE: usize = 2 * num_digits(MAX_SCROLLBACK_LINES) + 3;\n let damage_point = Point::new(0, Column(self.size_info.columns().saturating_sub(MAX_SIZE)));\n if self.collect_damage() {\n self.damage_rects.push(self.damage_from_point(damage_point, MAX_SIZE as u32));\n }\n\n let colors = &config.colors;\n let fg = colors.line_indicator.foreground.unwrap_or(colors.primary.background);\n let bg = colors.line_indicator.background.unwrap_or(colors.primary.foreground);\n\n // Do not render anything if it would obscure the vi mode cursor.\n if obstructed_column.map_or(true, |obstructed_column| obstructed_column < column) {\n let glyph_cache = &mut self.glyph_cache;\n self.renderer.draw_string(point, fg, bg, text.chars(), &self.size_info, glyph_cache);\n }\n }\n\n /// Damage `len` starting from a `point`.\n ///\n /// This method also enqueues damage for the next frame automatically.\n fn damage_from_point(&self, point: Point<usize>, len: u32) -> DamageRect {\n let size_info: SizeInfo<u32> = self.size_info.into();\n let x = size_info.padding_x() + point.column.0 as u32 * size_info.cell_width();\n let y_top = size_info.height() - size_info.padding_y();\n let y = y_top - (point.line as u32 + 1) * size_info.cell_height();\n let width = len * size_info.cell_width();\n DamageRect::new(x as i32, y as i32, width as i32, size_info.cell_height() as i32)\n }\n\n /// Damage currently highlighted `Display` hints.\n #[inline]\n fn damage_highlighted_hints<T: EventListener>(&self, terminal: &mut Term<T>) {\n let display_offset = terminal.grid().display_offset();\n let last_visible_line = terminal.screen_lines() - 1;\n for hint in self.highlighted_hint.iter().chain(&self.vi_highlighted_hint) {\n for point in\n (hint.bounds().start().line.0..=hint.bounds().end().line.0).flat_map(|line| {\n term::point_to_viewport(display_offset, Point::new(Line(line), Column(0)))\n .filter(|point| point.line <= last_visible_line)\n })\n {\n terminal.damage_line(point.line, 0, terminal.columns() - 1);\n }\n }\n }\n\n /// Returns `true` if damage information should be collected, `false` otherwise.\n #[inline]\n fn collect_damage(&self) -> bool {\n self.is_wayland || self.debug_damage\n }\n\n /// Highlight damaged rects.\n ///\n /// This function is for debug purposes only.\n fn highlight_damage(&self, render_rects: &mut Vec<RenderRect>) {\n for damage_rect in &self.damage_rects {\n let x = damage_rect.x as f32;\n let height = damage_rect.height as f32;\n let width = damage_rect.width as f32;\n let y = self.size_info.height() - damage_rect.y as f32 - height;\n let render_rect = RenderRect::new(x, y, width, height, DAMAGE_RECT_COLOR, 0.5);\n\n render_rects.push(render_rect);\n }\n }\n\n /// Requst a new frame for a window on Wayland.\n #[inline]\n #[cfg(all(feature = \"wayland\", not(any(target_os = \"macos\", windows))))]\n fn request_frame(&self, window: &Window) {\n let surface = match window.wayland_surface() {\n Some(surface) => surface,\n None => return,\n };\n\n let should_draw = self.window.should_draw.clone();\n\n // Mark that window was drawn.\n should_draw.store(false, Ordering::Relaxed);\n\n // Request a new frame.\n surface.frame().quick_assign(move |_, _, _| {\n should_draw.store(true, Ordering::Relaxed);\n });\n }\n}\n\nimpl Drop for Display {\n fn drop(&mut self) {\n // Switch OpenGL context before dropping, otherwise objects (like programs) from other\n // contexts might be deleted during droping renderer.\n self.make_current();\n unsafe {\n ManuallyDrop::drop(&mut self.renderer);\n ManuallyDrop::drop(&mut self.context);\n ManuallyDrop::drop(&mut self.surface);\n }\n }\n}\n\n/// Input method state.\n#[derive(Debug, Default)]\npub struct Ime {\n /// Whether the IME is enabled.\n enabled: bool,\n\n /// Current IME preedit.\n preedit: Option<Preedit>,\n}\n\nimpl Ime {\n pub fn new() -> Self {\n Default::default()\n }\n\n #[inline]\n pub fn set_enabled(&mut self, is_enabled: bool) {\n if is_enabled {\n self.enabled = is_enabled\n } else {\n // Clear state when disabling IME.\n *self = Default::default();\n }\n }\n\n #[inline]\n pub fn is_enabled(&self) -> bool {\n self.enabled\n }\n\n #[inline]\n pub fn set_preedit(&mut self, preedit: Option<Preedit>) {\n self.preedit = preedit;\n }\n\n #[inline]\n pub fn preedit(&self) -> Option<&Preedit> {\n self.preedit.as_ref()\n }\n}\n\n#[derive(Debug, Default, PartialEq, Eq)]\npub struct Preedit {\n /// The preedit text.\n text: String,\n\n /// Byte offset for cursor start into the preedit text.\n ///\n /// `None` means that the cursor is invisible.\n cursor_byte_offset: Option<usize>,\n\n /// The cursor offset from the end of the preedit in char width.\n cursor_end_offset: Option<usize>,\n}\n\nimpl Preedit {\n pub fn new(text: String, cursor_byte_offset: Option<usize>) -> Self {\n let cursor_end_offset = if let Some(byte_offset) = cursor_byte_offset {\n // Convert byte offset into char offset.\n let cursor_end_offset =\n text[byte_offset..].chars().fold(0, |acc, ch| acc + ch.width().unwrap_or(1));\n\n Some(cursor_end_offset)\n } else {\n None\n };\n\n Self { text, cursor_byte_offset, cursor_end_offset }\n }\n}\n\n/// Pending renderer updates.\n///\n/// All renderer updates are cached to be applied just before rendering, to avoid platform-specific\n/// rendering issues.\n#[derive(Debug, Default, Copy, Clone)]\npub struct RendererUpdate {\n /// Should resize the window.\n resize: bool,\n\n /// Clear font caches.\n clear_font_cache: bool,\n}\n\n/// Struct for safe in-place replacement.\n///\n/// This struct allows easily replacing struct fields that provide `self -> Self` methods in-place,\n/// without having to deal with constantly unwrapping the underlying [`Option`].\nstruct Replaceable<T>(Option<T>);\n\nimpl<T> Replaceable<T> {\n pub fn new(inner: T) -> Self {\n Self(Some(inner))\n }\n\n /// Replace the contents of the container.\n pub fn replace_with<F: FnMut(T) -> T>(&mut self, f: F) {\n self.0 = self.0.take().map(f);\n }\n\n /// Get immutable access to the wrapped value.\n pub fn get(&self) -> &T {\n self.0.as_ref().unwrap()\n }\n\n /// Get mutable access to the wrapped value.\n pub fn get_mut(&mut self) -> &mut T {\n self.0.as_mut().unwrap()\n }\n}\n\nimpl<T> Deref for Replaceable<T> {\n type Target = T;\n\n fn deref(&self) -> &Self::Target {\n self.get()\n }\n}\n\nimpl<T> DerefMut for Replaceable<T> {\n fn deref_mut(&mut self) -> &mut Self::Target {\n self.get_mut()\n }\n}\n\n/// Calculate the cell dimensions based on font metrics.\n///\n/// This will return a tuple of the cell width and height.\n#[inline]\nfn compute_cell_size(config: &UiConfig, metrics: &crossfont::Metrics) -> (f32, f32) {\n let offset_x = f64::from(config.font.offset.x);\n let offset_y = f64::from(config.font.offset.y);\n (\n (metrics.average_advance + offset_x).floor().max(1.) as f32,\n (metrics.line_height + offset_y).floor().max(1.) as f32,\n )\n}\n\n/// Calculate the size of the window given padding, terminal dimensions and cell size.\nfn window_size(\n config: &UiConfig,\n dimensions: Dimensions,\n cell_width: f32,\n cell_height: f32,\n scale_factor: f32,\n) -> PhysicalSize<u32> {\n let padding = config.window.padding(scale_factor);\n\n let grid_width = cell_width * dimensions.columns.0.max(MIN_COLUMNS) as f32;\n let grid_height = cell_height * dimensions.lines.max(MIN_SCREEN_LINES) as f32;\n\n let width = (padding.0).mul_add(2., grid_width).floor();\n let height = (padding.1).mul_add(2., grid_height).floor();\n\n PhysicalSize::new(width as u32, height as u32)\n}\n", "meta": {"content_hash": "a4697cd42cc8718268e032ff3db99615", "timestamp": "", "source": "github", "line_count": 1554, "max_line_length": 100, "avg_line_length": 34.072072072072075, "alnum_prop": 0.5720140515222483, "repo_name": "alacritty/alacritty", "id": "ed1b1fc53b3001294cbeb0f89825332d79f639ed", "size": "53047", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "alacritty/src/display/mod.rs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "GLSL", "bytes": "10739"}, {"name": "Makefile", "bytes": "2941"}, {"name": "Roff", "bytes": "4196"}, {"name": "Rust", "bytes": "1011078"}, {"name": "Shell", "bytes": "17333"}]}} +{"text": "\"\"\"\nWSGI config for django_calendar project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/\n\"\"\"\n\nimport os\n\nfrom django.core.wsgi import get_wsgi_application\n\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"django_calendar.settings\")\n\napplication = get_wsgi_application()\n", "meta": {"content_hash": "a16031a488f80c25cd19334dcc2f1bd4", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.4375, "alnum_prop": 0.773955773955774, "repo_name": "psycane/django-calendar", "id": "e98ed05c9cc29a3c6c4ab5585b3cbd6fbbe9768c", "size": "407", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "django_calendar/wsgi.py", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "4683"}, {"name": "HTML", "bytes": "4914"}, {"name": "JavaScript", "bytes": "12531"}, {"name": "Python", "bytes": "26928"}]}} +{"text": "var request = require('request');\nvar fs = require('fs');\n\nvar YOUR_ACCESS_TOKEN = \"YOUR_ACCESS_TOKEN\";\nvar YOUR_PRODUCT_ID = 0;\n\n\n\n\n\nvar that = {\n\tbaseUrl: \"https://api.particle.io\",\n\n\tGENERIC_PUBLIC_KEY: \"-----BEGIN PUBLIC KEY-----\\n\" +\n\t\t\"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBLiA/XITqywdja3J2dCPLfqcU\\n\" +\n\t\t\"jdacNaGBys6Xz1TJCyq4NSUtr8RU7AkWP3e/ePKp5Lg/vJnEBo1Z8gPR1QMWAWup\\n\" +\n\t\t\"Gqz+S9DxIBwCIeVXovZE6ZFRZ6m0dsCBnZ36UuME2vBS70cL6yzfu71fRDeGg4Lh\\n\" +\n\t\t\"yr+GNspjRSDkqgeBUQIDAQAB\\n\" +\n\t\t\"-----END PUBLIC KEY-----\",\n\n\tsendPublicKey: function (deviceID, keyFilename) {\n\t\tif (!deviceID || deviceID == \"\") {\n\t\t\tconsole.error(\"device id was invalid\");\n\t\t\treturn;\n\t\t}\n\n\t\tvar keyStr;\n\t\tif (!keyFilename || (keyFilename == \"\") || !fs.existsSync(keyFilename)) {\n\t\t\tconsole.log(\"using generic public key\");\n\t\t\tkeyStr = that.GENERIC_PUBLIC_KEY;\n\t\t}\n\t\telse {\n\t\t\tkeyStr = fs.readFileSync(keyFilename).toString();\n\t\t}\n\t\t\n\t\tconsole.log('attempting to add a new public key for device ' + deviceID);\n\n\t\trequest({\n\t\t\turi: that.baseUrl + \"/v1/provisioning/\" + deviceID,\n\t\t\tmethod: \"POST\",\n\t\t\tform: {\n\t\t\t\tdeviceID: deviceID,\n\t\t\t\tpublicKey: keyStr.toString(),\n\t\t\t\torder: \"script_\" + ((new Date()).getTime()),\n\t\t\t\tfilename: \"script\",\n\t\t\t\taccess_token: YOUR_ACCESS_TOKEN,\n\t\t\t\tproduct_id: YOUR_PRODUCT_ID\n\t\t\t},\n\t\t\tjson: true\n\t\t}, \n\t\tfunction (error, response, body) \n\t\t{\n\t\t\tif (error || body.error) {\n\t\t\t\tconsole.log(\"Provisioning Error: \", error || body.error);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"Success - Device Provisioned!\");\n\t\t\t}\n\t\t});\n\t}\n};\n\n\nvar args = process.argv;\n\nif (YOUR_ACCESS_TOKEN == \"YOUR_ACCESS_TOKEN\") {\n\tconsole.error(\"Please edit main.js, and change YOUR_ACCESS_TOKEN to your access token\" );\n\treturn;\n}\nif (YOUR_PRODUCT_ID == 0) {\n\tconsole.error(\"Please edit main.js, and change PRODUCT_ID to your product id\");\n\treturn;\n}\n\nif (args.length < 3) {\n\tvar helpLines = [\n\t\t\"Please include deviceID, and an optional keyfile\",\n\t\t\"\",\n\t\t\"Example: \",\n\t\t\" node main.js SOME_DEVICE_ID \",\n\t\t\" node main.js SOME_DEVICE_ID SOME_KEY_FILE\"\n\t];\n\tconsole.log(helpLines.join(\"\\n\"));\n}\nelse {\n\tvar deviceID = args[2];\n\tvar keyFile = (args.length >= 4) ? args[3] : null;\n\n\tthat.sendPublicKey(deviceID, keyFile);\t\n}\n", "meta": {"content_hash": "7c1ac1b6a0f9e0783bb44cfef7d57808", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 90, "avg_line_length": 24.41111111111111, "alnum_prop": 0.6536185707783341, "repo_name": "spark/device-provisioning-helper", "id": "9bca5e64beffdc328f606b4b3e96a70d091d447d", "size": "2197", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "main.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "JavaScript", "bytes": "2197"}]}} +{"text": "**NeedsWork** | [#roslyn/57589](https://github.com/dotnet/roslyn/issues/57589#issuecomment-985038558)\n\n## API Review\r\n\r\n* Most of the generator examples we've seen as motivating examples are v1 generators that, when factored into incremental generators, have perfectly fine performance.\r\n* Doesn't help with Hot Reload or EnC scenarios, which need full implementation results\r\n * Only for the application of edits, not for things like intellisense\r\n* Workaround is available: register 2 generators, one that registers partials with empty bodies, one that provides the real implementation with our existing API\r\n * If you did it this way, it would require partial consistency, whereas the ReferenceSourceOnly version could make it harder to ensure that these things line up.\r\n Would have errors\r\n* Might have been nice if we had done a slightly different design. What if we just did RegisterSourceOutput, and put a flag on it?\r\n * Would that cause us to have to run generators twice, even if they didn't check that flag?\r\n* Can RegisterReferenceSourceOutput actually change the reference assembly output?\r\n * They probably can do that, so we're ok\r\n* Might need a slightly better name\r\n * We'll bikeshed over this when we have perf data.\r\n\r\n### Conclusion\r\n\r\nWe think the API shape is reasonable (modulo the name), but we would like data on whether it actually helps our motivating generators before shipping the API for real.\n", "meta": {"content_hash": "d0ba96751db263345a4729d034a1db86", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 167, "avg_line_length": 72.2, "alnum_prop": 0.7721606648199446, "repo_name": "dotnet/apireviews", "id": "30b5ebe97d7e50646d7ee76920ec08f15477b034", "size": "1522", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "2021/12-02-roslyn-reviews/README.md", "mode": "33188", "license": "mit", "language": []}} +{"text": "<html><body>\r\n<h4>Windows 10 x64 (18362.388)</h4><br>\r\n<h2>_POP_DIRECTED_DRIPS_PROBLEM_DEVICE_REASON</h2>\r\n<font face=\"arial\"> DirectedDripsProblemDeviceReasonSpecialDevice = 0n0<br>\r\n DirectedDripsProblemDeviceReasonNoDfx = 0n1<br>\r\n DirectedDripsProblemDeviceReasonNoPs4 = 0n2<br>\r\n DirectedDripsProblemDeviceReasonNoPs4Root = 0n3<br>\r\n DirectedDripsProblemDeviceReasonComponentContraint = 0n4<br>\r\n DirectedDripsProblemDeviceReasonDfxFailure = 0n5<br>\r\n DirectedDripsProblemDeviceReasonMax = 0n6<br>\r\n</font></body></html>", "meta": {"content_hash": "95c5587e3ced469161099f905be5ea78", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 77, "avg_line_length": 49.0, "alnum_prop": 0.7792207792207793, "repo_name": "epikcraw/ggool", "id": "d13d2b4f4077782f120c45b7eb37ab2d73c5dce0", "size": "539", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/Windows 10 x64 (18362.388)/_POP_DIRECTED_DRIPS_PROBLEM_DEVICE_REASON.html", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "17631902"}, {"name": "JavaScript", "bytes": "552"}]}} +{"text": "!\n! Copyright 2016 ARTED developers\n!\n! Licensed under the Apache License, Version 2.0 (the \"License\");\n! you may not use this file except in compliance with the License.\n! You may obtain a copy of the License at\n!\n! http://www.apache.org/licenses/LICENSE-2.0\n!\n! Unless required by applicable law or agreed to in writing, software\n! distributed under the License is distributed on an \"AS IS\" BASIS,\n! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n! See the License for the specific language governing permissions and\n! limitations under the License.\n!\nmodule PSE_band_calc_variables\n\n integer :: Nsym_point, NB_band_calc\n real(8),allocatable :: b0_band_vec(:), band_Cvec_d(:,:)\n character(10),allocatable :: Name_sym_point(:)\n integer,allocatable :: Ndist_band(:)\n\nend module PSE_band_calc_variables\n", "meta": {"content_hash": "3eda86fb5b3be9ae65c9b0db17d32ec2", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 75, "avg_line_length": 36.78260869565217, "alnum_prop": 0.7328605200945626, "repo_name": "ARTED/ARTED_noc", "id": "2ad5931a1ba8a20cb345029017293c965d7cd740", "size": "846", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/PSE_band_calc_variables.f90", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Fortran", "bytes": "244698"}, {"name": "Makefile", "bytes": "1442"}]}} +{"text": "package bazaar4idea.command;\n\nimport com.intellij.openapi.project.Project;\nimport bazaar4idea.BzrFile;\nimport org.jetbrains.annotations.NotNull;\n\nimport java.util.Arrays;\n\npublic class BzrAddCommand {\n\n private final Project project;\n\n public BzrAddCommand(Project project) {\n this.project = project;\n }\n\n public void execute(@NotNull BzrFile bzrFile) {\n ShellCommandService.getInstance(project)\n .execute(bzrFile.getRepo(), \"add\", Arrays.asList(bzrFile.getRelativePath()));\n }\n\n}\n", "meta": {"content_hash": "ad150684411f5749bab1ec6d39934762", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 85, "avg_line_length": 22.681818181818183, "alnum_prop": 0.7555110220440882, "repo_name": "bwrsandman/bzr4j", "id": "049a9d6a6d276749409d009c405228f7e7e28471", "size": "1083", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/intellij/src/main/java/bazaar4idea/command/BzrAddCommand.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "1044148"}, {"name": "Shell", "bytes": "31"}]}} +{"text": "\ufeffnamespace TehPers.FishingOverhaul.Api\n{\n /// <summary>\n /// The state of the treasure in the fishing minigame.\n /// </summary>\n public enum TreasureState\n {\n /// <summary>\n /// No treasure can be caught.\n /// </summary>\n None,\n /// <summary>\n /// Treasure can be caught, but it has not yet been caught.\n /// </summary>\n NotCaught,\n /// <summary>\n /// Treasure was caught.\n /// </summary>\n Caught,\n }\n}", "meta": {"content_hash": "6f75e275c7ae88341ad5fe89bba1a5cd", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 67, "avg_line_length": 24.0, "alnum_prop": 0.503968253968254, "repo_name": "TehPers/StardewValleyMods", "id": "f769c399f89d6b23132204fb4c23e1dcecdfa231", "size": "506", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/TehPers.FishingOverhaul.Api/TreasureState.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "743286"}, {"name": "PowerShell", "bytes": "861"}]}} +{"text": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.12\"/>\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n<title>Tempest: Tempest::slot Class Reference</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"resize.js\"></script>\n<script type=\"text/javascript\" src=\"navtreedata.js\"></script>\n<script type=\"text/javascript\" src=\"navtree.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(initResizable);\n</script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/searchdata.js\"></script>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n $(document).ready(function() { init_search(); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n <td id=\"projectlogo\"><img alt=\"Logo\" src=\"icon.png\"/></td>\n <td id=\"projectalign\" style=\"padding-left: 0.5em;\">\n <div id=\"projectname\">Tempest\n </div>\n </td>\n <td> <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n <span class=\"left\">\n <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n alt=\"\"/>\n <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n onblur=\"searchBox.OnSearchFieldFocus(false)\" \n onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n </span><span class=\"right\">\n <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n </span>\n </div>\n</td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.12 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n</div><!-- top -->\n<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n <div id=\"nav-tree\">\n <div id=\"nav-tree-contents\">\n <div id=\"nav-sync\" class=\"sync\"></div>\n </div>\n </div>\n <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n class=\"ui-resizable-handle\">\n </div>\n</div>\n<script type=\"text/javascript\">\n$(document).ready(function(){initNavTree('class_tempest_1_1slot.html','');});\n</script>\n<div id=\"doc-content\">\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n</div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n <div class=\"summary\">\n<a href=\"#nested-classes\">Classes</a> |\n<a href=\"#pro-methods\">Protected Member Functions</a> |\n<a href=\"#friends\">Friends</a> |\n<a href=\"class_tempest_1_1slot-members.html\">List of all members</a> </div>\n <div class=\"headertitle\">\n<div class=\"title\">Tempest::slot Class Reference</div> </div>\n</div><!--header-->\n<div class=\"contents\">\n<div class=\"dynheader\">\nInheritance diagram for Tempest::slot:</div>\n<div class=\"dyncontent\">\n <div class=\"center\">\n <img src=\"class_tempest_1_1slot.png\" usemap=\"#Tempest::slot_map\" alt=\"\"/>\n <map id=\"Tempest::slot_map\" name=\"Tempest::slot_map\">\n<area href=\"class_tempest_1_1_list_delegate.html\" title=\"The ListDelegate class provides items to display in list or other collection. \" alt=\"Tempest::ListDelegate\" shape=\"rect\" coords=\"876,56,1304,80\"/>\n<area href=\"class_tempest_1_1_menu.html\" alt=\"Tempest::Menu\" shape=\"rect\" coords=\"1314,56,1742,80\"/>\n<area href=\"class_tempest_1_1_widget.html\" alt=\"Tempest::Widget\" shape=\"rect\" coords=\"1752,56,2180,80\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< bool >\" shape=\"rect\" coords=\"438,112,866,136\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< const std::u16string &>\" shape=\"rect\" coords=\"438,168,866,192\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< const std::u16string, const Tempest::Rect &>\" shape=\"rect\" coords=\"438,224,866,248\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< const Tempest::Menu::Declarator &, Tempest::Widget &>\" shape=\"rect\" coords=\"438,280,866,304\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< int >\" shape=\"rect\" coords=\"438,336,866,360\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< int, int >\" shape=\"rect\" coords=\"438,392,866,416\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< ShowMode >\" shape=\"rect\" coords=\"438,448,866,472\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< size_t >\" shape=\"rect\" coords=\"438,504,866,528\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< size_t, Tempest::Widget *>\" shape=\"rect\" coords=\"438,560,866,584\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< State >\" shape=\"rect\" coords=\"438,616,866,640\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< Tempest::Font >\" shape=\"rect\" coords=\"438,672,866,696\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< Tempest::Orientation >\" shape=\"rect\" coords=\"438,728,866,752\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< Tempest::UiMetrics >\" shape=\"rect\" coords=\"438,784,866,808\"/>\n<area href=\"class_tempest_1_1signal.html\" alt=\"Tempest::signal< Tempest::Widget *>\" shape=\"rect\" coords=\"438,840,866,864\"/>\n<area href=\"class_tempest_1_1signal.html\" title=\"signal class, for signals and slots system. \" alt=\"Tempest::signal< Args >\" shape=\"rect\" coords=\"438,896,866,920\"/>\n<area href=\"class_tempest_1_1_abstract_list_delegate.html\" alt=\"Tempest::AbstractListDelegate< T, std::vector< T >, Ctrl >\" shape=\"rect\" coords=\"1314,112,1742,136\"/>\n<area href=\"class_tempest_1_1_abstract_list_delegate.html\" alt=\"Tempest::AbstractListDelegate< T, VT, Ctrl >\" shape=\"rect\" coords=\"1314,168,1742,192\"/>\n<area href=\"class_tempest_1_1_abstract_list_box.html\" alt=\"Tempest::AbstractListBox\" shape=\"rect\" coords=\"2190,112,2618,136\"/>\n<area href=\"class_tempest_1_1_button.html\" alt=\"Tempest::Button\" shape=\"rect\" coords=\"2190,168,2618,192\"/>\n<area href=\"class_tempest_1_1_image.html\" alt=\"Tempest::Image< InTexture >\" shape=\"rect\" coords=\"2190,224,2618,248\"/>\n<area href=\"class_tempest_1_1_label.html\" alt=\"Tempest::Label\" shape=\"rect\" coords=\"2190,280,2618,304\"/>\n<area href=\"class_tempest_1_1_line_edit.html\" alt=\"Tempest::LineEdit\" shape=\"rect\" coords=\"2190,336,2618,360\"/>\n<area href=\"class_tempest_1_1_list_view.html\" alt=\"Tempest::ListView\" shape=\"rect\" coords=\"2190,392,2618,416\"/>\n<area href=\"class_tempest_1_1_panel.html\" alt=\"Tempest::Panel\" shape=\"rect\" coords=\"2190,448,2618,472\"/>\n<area href=\"class_tempest_1_1_scroll_bar.html\" alt=\"Tempest::ScrollBar\" shape=\"rect\" coords=\"2190,504,2618,528\"/>\n<area href=\"struct_tempest_1_1_scroll_bar_1_1_central_widget.html\" alt=\"Tempest::ScrollBar::CentralWidget\" shape=\"rect\" coords=\"2190,560,2618,584\"/>\n<area href=\"class_tempest_1_1_scroll_widget.html\" alt=\"Tempest::ScrollWidget\" shape=\"rect\" coords=\"2190,616,2618,640\"/>\n<area href=\"class_tempest_1_1_stacked_widget.html\" alt=\"Tempest::StackedWidget\" shape=\"rect\" coords=\"2190,672,2618,696\"/>\n<area href=\"class_tempest_1_1_surface.html\" alt=\"Tempest::Surface\" shape=\"rect\" coords=\"2190,728,2618,752\"/>\n<area href=\"class_tempest_1_1_window.html\" alt=\"Tempest::Window\" shape=\"rect\" coords=\"2190,784,2618,808\"/>\n<area href=\"class_tempest_1_1_window_overlay.html\" alt=\"Tempest::WindowOverlay\" shape=\"rect\" coords=\"2190,840,2618,864\"/>\n</map>\n </div></div>\n<table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"pro-methods\"></a>\nProtected Member Functions</h2></td></tr>\n<tr class=\"memitem:a560d84cb8d2504b2dfb251c0e46a793e\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\"><a id=\"a560d84cb8d2504b2dfb251c0e46a793e\"></a>\n </td><td class=\"memItemRight\" valign=\"bottom\"><b>slot</b> (const <a class=\"el\" href=\"class_tempest_1_1slot.html\">slot</a> &other)</td></tr>\n<tr class=\"separator:a560d84cb8d2504b2dfb251c0e46a793e\"><td class=\"memSeparator\" colspan=\"2\"> </td></tr>\n<tr class=\"memitem:adde8e77fdbe24660b6155b0fa7d12647\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\"><a id=\"adde8e77fdbe24660b6155b0fa7d12647\"></a>\n<a class=\"el\" href=\"class_tempest_1_1slot.html\">slot</a> & </td><td class=\"memItemRight\" valign=\"bottom\"><b>operator=</b> (<a class=\"el\" href=\"class_tempest_1_1slot.html\">slot</a> &other)</td></tr>\n<tr class=\"separator:adde8e77fdbe24660b6155b0fa7d12647\"><td class=\"memSeparator\" colspan=\"2\"> </td></tr>\n</table><table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"friends\"></a>\nFriends</h2></td></tr>\n<tr class=\"memitem:a4d8dd8d7128a1ee29556fc24f581b420\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\"><a id=\"a4d8dd8d7128a1ee29556fc24f581b420\"></a>\nclass </td><td class=\"memItemRight\" valign=\"bottom\"><b>Detail::signalBase</b></td></tr>\n<tr class=\"separator:a4d8dd8d7128a1ee29556fc24f581b420\"><td class=\"memSeparator\" colspan=\"2\"> </td></tr>\n<tr class=\"memitem:af9add2352f0d4e501677b8a511a74475\"><td class=\"memTemplParams\" colspan=\"2\"><a id=\"af9add2352f0d4e501677b8a511a74475\"></a>\ntemplate<class ... Args> </td></tr>\n<tr class=\"memitem:af9add2352f0d4e501677b8a511a74475\"><td class=\"memTemplItemLeft\" align=\"right\" valign=\"top\">class </td><td class=\"memTemplItemRight\" valign=\"bottom\"><b>Tempest::signal</b></td></tr>\n<tr class=\"separator:af9add2352f0d4e501677b8a511a74475\"><td class=\"memSeparator\" colspan=\"2\"> </td></tr>\n</table>\n<hr/>The documentation for this class was generated from the following file:<ul>\n<li><a class=\"el\" href=\"signal__slot_8h_source.html\">signal_slot.h</a></li>\n</ul>\n</div><!-- contents -->\n</div><!-- doc-content -->\n<!-- start footer part -->\n<div id=\"nav-path\" class=\"navpath\"><!-- id is needed for treeview function! -->\n <ul>\n <li class=\"navelem\"><b>Tempest</b></li><li class=\"navelem\"><a class=\"el\" href=\"class_tempest_1_1slot.html\">slot</a></li>\n <li class=\"footer\">Generated by\n <a href=\"http://www.doxygen.org/index.html\">\n <img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/></a> 1.8.12 </li>\n </ul>\n</div>\n</body>\n</html>\n", "meta": {"content_hash": "0de2227a8d18087cb449f0f240a2625a", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 210, "avg_line_length": 63.71508379888268, "alnum_prop": 0.695572117492328, "repo_name": "enotio/Tempest", "id": "550f9721a23c54564c6ef3e53e09682518965ce4", "size": "11405", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/class_tempest_1_1slot.html", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "209674"}, {"name": "C++", "bytes": "997335"}, {"name": "CSS", "bytes": "26404"}, {"name": "Java", "bytes": "10502"}, {"name": "Makefile", "bytes": "3047"}, {"name": "Objective-C", "bytes": "387"}, {"name": "Objective-C++", "bytes": "50885"}, {"name": "QML", "bytes": "1647"}, {"name": "QMake", "bytes": "11871"}]}} +{"text": "module Spree\n class LoyaltyPointsDebitTransaction < LoyaltyPointsTransaction\n after_create :update_user_balance\n before_create :update_balance\n\n private\n\n def update_user_balance\n user.decrement(:loyalty_points_balance, loyalty_points)\n user.save!\n end\n\n def update_balance\n self.balance = user.loyalty_points_balance - loyalty_points\n end\n\n end\nend", "meta": {"content_hash": "db25e7b6e44319a11b2559effa97fd3e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 67, "avg_line_length": 22.27777777777778, "alnum_prop": 0.6957605985037406, "repo_name": "Hrom512/spree-loyalty-points", "id": "9c3cf591e4a5bdb15eb2cf8479dc86f8c25d6510", "size": "401", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/models/spree/loyalty_points_debit_transaction.rb", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "144"}, {"name": "HTML", "bytes": "5990"}, {"name": "JavaScript", "bytes": "3911"}, {"name": "Ruby", "bytes": "109616"}]}} +{"text": "\n\n#ifndef QMITKXNATTREEMODEL_H\n#define QMITKXNATTREEMODEL_H\n\n// CTK includes\n#include <ctkXnatTreeModel.h>\n\n// MITK includes\n#include \"MitkXNATExports.h\"\n\nnamespace mitk {\nclass DataNode;\n}\n\nclass MITKXNAT_EXPORT QmitkXnatTreeModel : public ctkXnatTreeModel\n{\n Q_OBJECT\n\npublic:\n QmitkXnatTreeModel();\n\n virtual QVariant data(const QModelIndex& index, int role) const;\n\n virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);\n\n using QAbstractItemModel::supportedDropActions;\n virtual Qt::DropActions supportedDropActions();\n\n virtual Qt::ItemFlags flags(const QModelIndex &index) const;\n\n ctkXnatObject* GetXnatObjectFromUrl(const QString&);\n\n signals:\n void ResourceDropped(const QList<mitk::DataNode*>&, ctkXnatObject*, const QModelIndex&);\n\nprivate:\n ctkXnatObject *InternalGetXnatObjectFromUrl(const QString &xnatObjectType, const QString &url, ctkXnatObject *parent);\n\n};\n\n#endif // QMITKXNATTREEMODEL_H\n", "meta": {"content_hash": "8e43d960931d1547c0b3c8f4b6e3d2c3", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 122, "avg_line_length": 23.547619047619047, "alnum_prop": 0.7785642062689585, "repo_name": "NifTK/MITK", "id": "90ae8788864fd54b315e56d3d726fdfcceeb254d", "size": "1487", "binary": false, "copies": "1", "ref": "refs/heads/niftk", "path": "Modules/XNAT/include/QmitkXnatTreeModel.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "2343401"}, {"name": "C++", "bytes": "28797565"}, {"name": "CMake", "bytes": "864932"}, {"name": "CSS", "bytes": "117579"}, {"name": "HTML", "bytes": "101835"}, {"name": "JavaScript", "bytes": "167070"}, {"name": "Makefile", "bytes": "25077"}, {"name": "Objective-C", "bytes": "476388"}, {"name": "Python", "bytes": "62916"}, {"name": "QMake", "bytes": "5583"}, {"name": "Shell", "bytes": "1261"}]}} +{"text": "/**\n @file\n @ingroup pgm\n @brief opengm extensions\n*/\n\n#ifndef PGMLINK_PGM_H\n#define PGMLINK_PGM_H\n\n#include <vector>\n\n#include <pgmlink/ext_opengm/loss_hamming.hxx>\n#include <opengm/graphicalmodel/graphicalmodel.hxx>\n#include <pgmlink/ext_opengm/loglinearmodel.hxx>\n#include <opengm/inference/inference.hxx>\n#include <opengm/functions/explicit_function.hxx>\n#include <pgmlink/ext_opengm/decorator_weighted.hxx>\n#include <pgmlink/ext_opengm/indicator_function.hxx>\n#include <opengm/operations/adder.hxx>\n#include <opengm/utilities/metaprogramming.hxx>\n\n#include \"pgmlink/hypotheses.h\"\n#include \"pgmlink/graph.h\"\n#include \"pgmlink/util.h\"\n\nnamespace pgmlink {\n namespace pgm {\n using boost::shared_ptr;\n \n\n //typedef opengm::GraphicalModel<double, opengm::Adder> OpengmModel;\n typedef opengm::ExplicitFunction<double> ExplicitFunction;\n typedef opengm::FunctionDecoratorWeighted< opengm::IndicatorFunction<double> > FeatureFunction;\n typedef opengm::HammingFunction<double> LossFunction;\n typedef opengm::LoglinearModel<double,\n opengm::meta::TypeList<ExplicitFunction,\n opengm::meta::TypeList<FeatureFunction,\n opengm::meta::TypeList<LossFunction, opengm::meta::ListEnd > > > > OpengmModel;\n\n template <typename OGM_FUNCTION>\n class OpengmFactor {\n public:\n typedef OGM_FUNCTION FunctionType;\n\n OpengmFactor( const FunctionType&, const std::vector<size_t>& ogm_var_indices );\n template <typename ITER>\n\tOpengmFactor( const FunctionType&, ITER first_ogm_idx, ITER last_ogm_idx );\n\n typename FunctionType::ValueType get_value( std::vector<size_t> coords ) const;\n template <typename OGM_GRAPHICAL_MODEL>\n\tvoid add_to( OGM_GRAPHICAL_MODEL& ) const;\n\n FunctionType& function() { return ogmfunction_; }\n const FunctionType& function() const { return ogmfunction_; }\n const std::vector<size_t>& var_indices() const { return vi_; }\n const std::vector<size_t>& var_order() const { return order_; }\n\n protected:\n FunctionType ogmfunction_;\n std::vector<size_t> vi_;\n std::vector<size_t> order_;\n };\n\n\n template <typename VALUE>\n class OpengmExplicitFactor : public OpengmFactor<opengm::ExplicitFunction<VALUE> > {\n public:\n typedef typename OpengmFactor<opengm::ExplicitFunction<VALUE> >::FunctionType FunctionType; \n \n OpengmExplicitFactor( const std::vector<size_t>& ogm_var_indices, VALUE init=0, size_t states_per_var=2 );\n template <typename ITER>\n\tOpengmExplicitFactor( ITER first_ogm_idx, ITER last_ogm_idx, VALUE init=0, size_t states_per_var=2 ); \n \n void set_value( std::vector<size_t> coords, VALUE v);\n \n private:\n void init_( VALUE init, size_t states_per_var );\n }; \n \n template <typename VALUE>\n class OpengmWeightedFeature\n : public OpengmFactor< opengm::FunctionDecoratorWeighted< opengm::IndicatorFunction<VALUE> > >\n {\n public:\n typedef typename opengm::FunctionDecoratorWeighted< opengm::IndicatorFunction<VALUE> > FunctionType;\n\n template<class IT1, class IT2>\n\tOpengmWeightedFeature(const std::vector<size_t>& ogm_var_indices,\n\t\t\t IT1 shapeBegin, IT1 shapeEnd,\n\t\t\t IT2 indicate,\n\t\t\t VALUE indicate_value = 1., \n\t\t\t VALUE weight = 1.,\n\t\t\t VALUE default_value = 0);\n\n template <typename OGM_LOGLINEARMODEL>\n\tvoid add_as_feature_to( OGM_LOGLINEARMODEL&, typename OGM_LOGLINEARMODEL::IndexType weight_index ) const;\n\n void weight( VALUE w );\n VALUE weight() const;\n\n void indicate_value( VALUE v );\n VALUE indicate_value() const;\n \n void default_value( VALUE v );\n VALUE default_value() const;\n };\n\n /**\n @brief Accessing entries of a Factor/Function that was already added to a graphical model.\n\n Manages a pointer to an element of an array-like opengm function (usually opengm::ExplicitFunction).\n Validity of the pointer is ensured by owning a smart pointer to the full model.\n\n Use this class to modify factor elements of an already instantiated opengm graphical model.\n */\n class FactorEntry {\n public:\n FactorEntry() : entry_(NULL) {}\n FactorEntry( shared_ptr<OpengmModel> m, /**< has to be valid */\n\t\t OpengmModel::ValueType* entry /**< has to point into the opengm model to ensure the same lifetime */\n\t\t ) :\n m_(m), entry_(entry) {}\n \n void set( OpengmModel::ValueType );\n OpengmModel::ValueType get() const;\n\n shared_ptr<OpengmModel> model() const { return m_; }\n\n private:\n shared_ptr<OpengmModel> m_;\n OpengmModel::ValueType* entry_;\n };\n\n\n\n/******************/\n/* Implementation */\n/******************/\n\n////\n//// class OpengmFactor\n////\n template <typename OGM_FUNCTION>\n OpengmFactor<OGM_FUNCTION>::OpengmFactor( const FunctionType& f, const std::vector<size_t>& ogm_var_indices )\n : ogmfunction_(f), vi_(ogm_var_indices) {\n // store sorted order of indices\n indexsorter::sort_indices( vi_.begin(), vi_.end(), order_ );\n}\n\n template <typename OGM_FUNCTION>\n template< typename ITER >\n OpengmFactor<OGM_FUNCTION>::OpengmFactor( const FunctionType& f, ITER first_ogm_idx, ITER last_ogm_idx )\n : ogmfunction_(f), vi_(first_ogm_idx, last_ogm_idx) {\n // store sorted order of indices\n indexsorter::sort_indices( vi_.begin(), vi_.end(), order_ );\n }\n\n template <typename OGM_FUNCTION>\n typename OpengmFactor<OGM_FUNCTION>::FunctionType::ValueType OpengmFactor<OGM_FUNCTION>::get_value( std::vector<size_t> coords ) const {\n if( coords.size() != vi_.size() ) {\n throw std::invalid_argument(\"OpengmFactor::get_value(): coordinate dimension differs from factor dimension\");\n }\n indexsorter::reorder( coords, order_ );\n return ogmfunction_(coords.begin());\n }\n\n template <typename OGM_FUNCTION>\n template <typename OGM_GRAPHICAL_MODEL>\n void OpengmFactor<OGM_FUNCTION>::add_to( OGM_GRAPHICAL_MODEL& m ) const {\n std::vector<size_t> sorted_vi(vi_);\n std::sort(sorted_vi.begin(), sorted_vi.end());\n // opengm expects a monotonic increasing sequence\n if(!(m.isValidIndexSequence(sorted_vi.begin(), sorted_vi.end()))) {\n throw std::runtime_error(\"OpengmExplicitFactor::add_to(): invalid index sequence\");\n }\n \n typename OGM_GRAPHICAL_MODEL::FunctionIdentifier id=m.addFunction( ogmfunction_ );\n m.addFactor(id, sorted_vi.begin(), sorted_vi.end());\n }\n\n \n////\n//// class OpengmExplicitFactor\n////\n template <typename VALUE>\n OpengmExplicitFactor<VALUE>::OpengmExplicitFactor( const std::vector<size_t>& ogm_var_indices, VALUE init, size_t states_per_var )\n : OpengmFactor<opengm::ExplicitFunction<VALUE> >(opengm::ExplicitFunction<VALUE>(), ogm_var_indices) {\n init_( init, states_per_var );\n}\n template <typename VALUE>\n template< typename ITER >\n OpengmExplicitFactor<VALUE>::OpengmExplicitFactor( ITER first_ogm_idx, ITER last_ogm_idx, VALUE init, size_t states_per_var )\n : OpengmFactor<opengm::ExplicitFunction<VALUE> >(opengm::ExplicitFunction<VALUE>(),first_ogm_idx, last_ogm_idx) {\n init_( init, states_per_var );\n }\n\n template <typename VALUE> \n void OpengmExplicitFactor<VALUE>::set_value( std::vector<size_t> coords, VALUE v) {\n if( coords.size() != this->vi_.size() ) {\n throw std::invalid_argument(\"OpengmExplicitFactor::set_value(): coordinate dimension differs from factor dimension\");\n }\n typename opengm::ExplicitFunction<VALUE>::iterator element( this->ogmfunction_ );\n size_t index;\n\n indexsorter::reorder( coords, this->order_ );\n this->ogmfunction_.coordinatesToIndex(coords.begin(), index);\n element[index] = v;\n }\n\n template <typename VALUE>\n void OpengmExplicitFactor<VALUE>::init_( VALUE init, size_t states_per_var ) {\n std::vector<size_t> shape( this->vi_.size(), states_per_var );\n this->ogmfunction_ = opengm::ExplicitFunction<VALUE>( shape.begin(), shape.end(), init );\n }\n\n\n\n////\n//// class OpengmWeightedFeature\n////\ntemplate<class VALUE>\n template<class IT1, class IT2>\n OpengmWeightedFeature<VALUE>::OpengmWeightedFeature(\n\t\t\t const std::vector<size_t>& ogm_var_indices,\n\t\t IT1 shapeBegin, IT1 shapeEnd,\n\t\t\t IT2 indicate,\n\t\t\t VALUE indicate_value, \n\t\t\t VALUE weight,\n\t\t\t VALUE default_value)\n : OpengmFactor<FunctionType >(FunctionType(new opengm::IndicatorFunction<VALUE>( shapeBegin,\n\t\t\t\t\t\t\t\t\t\t shapeEnd,\n\t\t\t\t\t\t\t\t\t\t indicate,\n\t\t\t\t\t\t\t\t\t\t indicate_value,\n\t\t\t\t\t\t\t\t\t\t default_value),\n\t\t\t\t\t weight)\n\t\t\t\t, ogm_var_indices) {\n // replace function with a sorted variant\n std::vector<size_t> sorted_shape( shapeBegin, shapeEnd );\n indexsorter::reorder( sorted_shape, this->order_ );\n std::vector<size_t> sorted_indicate( this->ogmfunction_.innerFunction()->indicate() );\n indexsorter::reorder( sorted_indicate, this->order_ );\n\n this->ogmfunction_ = FunctionType(new opengm::IndicatorFunction<VALUE>( sorted_shape.begin(),\n\t\t\t\t\t\t\t\t\t sorted_shape.end(),\n\t\t\t\t\t\t\t\t\t sorted_indicate.begin(),\n\t\t\t\t\t\t\t\t\t indicate_value,\n\t\t\t\t\t\t\t\t\t default_value),\n\t\t\t\t weight);\n }\n\ntemplate<class VALUE>\n template <typename OGM_LOGLINEARMODEL>\n void OpengmWeightedFeature<VALUE>::add_as_feature_to( OGM_LOGLINEARMODEL& m, typename OGM_LOGLINEARMODEL::IndexType weight_index ) const {\n std::vector<size_t> sorted_vi(this->vi_);\n std::sort(sorted_vi.begin(), sorted_vi.end());\n // opengm expects a monotonic increasing sequence\n if(!(m.isValidIndexSequence(sorted_vi.begin(), sorted_vi.end()))) {\n throw std::runtime_error(\"OpengmExplicitFactor::add_to(): invalid index sequence\");\n }\n \n typename OGM_LOGLINEARMODEL::FunctionIdentifier id=m.addFeature( this->ogmfunction_, weight_index );\n m.addFactor(id, sorted_vi.begin(), sorted_vi.end());\n }\n\ntemplate<class VALUE>\n void OpengmWeightedFeature<VALUE>::weight( VALUE w ) {\n this->ogmfunction_.weight(w);\n }\n\ntemplate<class VALUE>\n VALUE OpengmWeightedFeature<VALUE>::weight() const {\n return this->ogmfunction_.weight();\n }\n\ntemplate<class VALUE>\n void OpengmWeightedFeature<VALUE>::indicate_value( VALUE v ) {\n this->ogmfunction_.innerFunction()->indicate_value(v);\n }\n \ntemplate<class VALUE>\n VALUE OpengmWeightedFeature<VALUE>::indicate_value() const {\n return this->ogmfunction_.innerFunction()->indicate_value();\n }\n \ntemplate<class VALUE> \n void OpengmWeightedFeature<VALUE>::default_value( VALUE v ) {\n this->ogmfunction_.innerFunction()->default_value(v);\n }\n\ntemplate<class VALUE>\n VALUE OpengmWeightedFeature<VALUE>::default_value() const {\n return this->ogmfunction_.innerFunction()->default_value();\n }\n\n} /* namespace pgm */\n} /* namespace pgmlink */\n\n#endif /* PGMLINK_PGM_H */\n", "meta": {"content_hash": "3015b75121017203bb32dacffbecb1c6", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 140, "avg_line_length": 35.486577181208055, "alnum_prop": 0.689645390070922, "repo_name": "bekaus/pgmlink", "id": "578e09d65d234881d4fc9a41fa979bc8cb5ebaae", "size": "10575", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/pgmlink/pgm.h", "mode": "33188", "license": "mit", "language": [{"name": "C++", "bytes": "248858"}, {"name": "Python", "bytes": "2086"}]}} +{"text": "<!DOCTYPE html>\n<html>\n\t<head>\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no\"/>\n\t\t<link href=\"https://fonts.googleapis.com/css?family=Roboto:300,400,500\" rel=\"stylesheet\">\n\t\t<link href=\"https://fonts.googleapis.com/css?family=Chelsea+Market|Harmattan|Rancho\" rel=\"stylesheet\">\n\t\t<link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\"\n rel=\"stylesheet\">\n <link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css\" integrity=\"sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ\" crossorigin=\"anonymous\">\n\t\t<link rel=\"stylesheet\" href=\"/style/style.css\">\n\t\t<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/src/img/icons/trailTracker_icon-180.png\" />\n\t\t<link rel=\"manifest\" href=\u201c/src/img/icons/manifest.json\u201d />\n\t\t<link rel=\"icon\" type=\"image/png\" href=\"/src/img/icons/trailTracker_icon-32.png\" sizes=\"32x32\" />\n\t\t<link rel=\"icon\" type=\"image/png\" href=\"/src/img/icons/trailTracker_icon-16.png\" sizes=\"16x16\" />\n\n\t\t<!-- <script src=\"https://maps.googleapis.com/maps/api/js\"></script> -->\n\t</head>\n\t<body>\n\t\t<div id=\"container\"></div>\n\t</body>\n\t<script src=\"https://code.jquery.com/jquery-3.1.1.slim.min.js\" integrity=\"sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n\" crossorigin=\"anonymous\"></script>\n\t<script src=\"https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js\" integrity=\"sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb\" crossorigin=\"anonymous\"></script>\n\t<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js\" integrity=\"sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn\" crossorigin=\"anonymous\"></script>\n\t<script src=\"/bundle.js\"></script>\n</html>\n", "meta": {"content_hash": "c51d8e082dd9ea83435a68ee98bd536d", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 220, "avg_line_length": 73.24, "alnum_prop": 0.744401966138722, "repo_name": "JohnDHamm/trail-tracker-react", "id": "351b83d94a1680b568b226c7d397a91bb84a8530", "size": "1835", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1795"}, {"name": "HTML", "bytes": "1835"}, {"name": "JavaScript", "bytes": "50673"}]}} +{"text": "module Carto\n module OauthProvider\n module Scopes\n class DataservicesScope < DefaultScope\n def initialize(service, description)\n super('dataservices', service, CATEGORY_MONEY, description)\n @grant_key = :services\n end\n\n def add_to_api_key_grants(grants, _user = nil)\n super(grants)\n ensure_includes_apis(grants, ['sql'])\n end\n end\n end\n end\nend\n", "meta": {"content_hash": "e22bf14c52f34c9c5360a286847f2e72", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 69, "avg_line_length": 25.11764705882353, "alnum_prop": 0.6088992974238876, "repo_name": "CartoDB/cartodb", "id": "102eecd84e40824fe0b967e92389e4005b32b7dc", "size": "427", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/carto/oauth_provider/scopes/dataservices_scope.rb", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "7083"}, {"name": "EJS", "bytes": "311401"}, {"name": "HTML", "bytes": "6933668"}, {"name": "JavaScript", "bytes": "9784580"}, {"name": "Jupyter Notebook", "bytes": "47684"}, {"name": "Makefile", "bytes": "14050"}, {"name": "Mustache", "bytes": "30410"}, {"name": "PLpgSQL", "bytes": "1233"}, {"name": "Procfile", "bytes": "189"}, {"name": "Python", "bytes": "10350"}, {"name": "Ruby", "bytes": "6995180"}, {"name": "SCSS", "bytes": "1454540"}, {"name": "Shell", "bytes": "14538"}, {"name": "Smarty", "bytes": "654458"}, {"name": "Vue", "bytes": "755091"}]}} +{"text": "import isAngle from './isAngle'\nimport isColor from './isColor'\nimport isCubicBezier from './isCubicBezier'\nimport isFrames from './isFrames'\nimport isGlobal from './isGlobal'\nimport isImage from './isImage'\nimport isLength from './isLength'\nimport isLengthPercentage from './isLengthPercentage'\nimport isNumber from './isNumber'\nimport isOpacity from './isOpacity'\nimport isPercentage from './isPercentage'\nimport isPosition from './isPosition'\nimport isRepeat from './isRepeat'\nimport isSize from './isSize'\nimport isSteps from './isSteps'\nimport isSvgLength from './isSvgLength'\nimport isTime from './isTime'\n\nexport {\n isAngle,\n isColor,\n isCubicBezier,\n isFrames,\n isGlobal,\n isImage,\n isLength,\n isLengthPercentage,\n isNumber,\n isOpacity,\n isPercentage,\n isPosition,\n isRepeat,\n isSize,\n isSteps,\n isSvgLength,\n isTime,\n}\n", "meta": {"content_hash": "677677d4bb72047a7ef1ba2d49629e08", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 53, "avg_line_length": 22.83783783783784, "alnum_prop": 0.7514792899408284, "repo_name": "rofrischmann/bredon", "id": "4edcbaba4ce63c30098c104686a3ffd89d832494", "size": "845", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/bredon-validate/src/types/index.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "137500"}, {"name": "JavaScript", "bytes": "321255"}, {"name": "Shell", "bytes": "682"}]}} +{"text": "\n/*-------------------------------------------------------------------------\n * Script contains key operations for the Remote Control.\n *\n * DEPENDENCIES\n * - Logger.js\n *-------------------------------------------------------------------------*/\n\n/** Flag to indicate whether the remote button is pressed or not.*/\nvar isMouseDown = false;\n\n/** Latest key to be send.*/\nvar latest_key;\n\n/** Latest key event which is to be send. */\nvar latest_event;\n\n\n/** Function invoked when the DOM is ready.*/\n$(function() {\n $(\"#skeyboard,#shard-power,#skeyhelp\").tooltip({\n show: {\n effect: \"slideDown\",\n delay: 2000\n },\n hide: {\n effect: \"puff\",\n }\n });\n\n /* Captures mouse out event for the DOM body and if holdkey action is in-progress (isMouseDown = true), it will generate\n * a mouseup event on the latest key to complete the hold action.*/\n $('body').mouseout(function() {\n if (isMouseDown) {\n clickRemoteButton(latest_event, latest_key, false);\n }\n });\n\n /* Creates a tabbed interface for trace and event logs. */\n $('.traceTab').tabs({\n\n /* Invoked when a tab widget is selected. */\n activate : function(event, ui) {\n var container;\n var index = ui.newTab.index();\n\n if( index === 0) {\n container = $(getVisibleTraceContainer()+' .traceDisp');\n } else if(index === 1) {\n container = $(getVisibleTraceContainer()+' .eventDisp');\n }\n doAutoScrolling(container);\n }\n });\n\n});\n\n/** Constant regex pattern for Non blinking keys. Applicable for hold actions. */\nvar non_blinking_key_pattern = /VOL(UP|DN)|CH(UP|DN)/;\n\n/**\n * Sends a key to the server to be forwarded to the stb\n * @param key The name of the key to send\n */\nfunction sendKey(key) {\n if ($('#faded').css('display') == 'none') {\n var deviceIds = LayoutUtil.getCheckedDevices();\n var keyPattern = \"Key:\"+ key;\n updateEventLog(\"Pressed remote key [\"+ keyPattern +\", Action:SENDKEY]\", deviceIds);\n var remoteType = HTMLUtil.getParameterByName(\"remoteType\");\n remoteType = (remoteType != null) ? remoteType.toUpperCase() : null;\n var keyPayload = {\n deviceIds : deviceIds,\n key : key,\n remoteType : remoteType\n };\n var posting = $.post(CXT_PATH + '/sendKey', keyPayload);\n validatePostEvent(posting, keyPattern);\n }\n}\n\n/**\n * Called when a key is clicked. This will blink the image and then send the key to the stb\n * @param image The image that was clicked and will blink\n * @param key The key to send to the stb\n */\nfunction clickKey(image, key) {\n if(isBlinkAllowed(key)) {\n blink(image);\n }\n sendKey(key);\n}\n\n/**\n * Called when a key is holded for a duration. The image for the key will blink and then send the key along with\n * hold duration to the stb.\n *\n * @param image The image that was clicked and will blink\n * @param key The key to send to the stb\n * @param holdTime time in milliseconds the key is pressed.\n */\nfunction holdIRKey(image, key, holdTime) {\n if(isBlinkAllowed(key)) {\n blink(image);\n }\n holdKey(key, holdTime);\n}\n\n/**\n * Blink keys only for key patterns which are NOT defined by\n * 'non_blinking_key_pattern' variable. For those keys flashing of button is\n * handled separately. Unlike other remote types BCM-7437-1 remote has separate\n * image for Chup, Chdn, Volup and Voldn. So these key patterns are also handled\n * here (ignoring non_blinking_key_pattern) if the remote type is BCM-7437-1.\n * Since the blinking of GENERIC remote is handled separately, isBlinkingAllowed\n * should return false, if remote type is GENERIC.\n *\n * @param keyName\n * currently sending key name.\n * @returns true if flashing of button is allowed. False otherwise.\n */\nfunction isBlinkAllowed(keyName) {\n var remoteType = StandardRemote.getRemoteName();\n var isBlinkingKey = non_blinking_key_pattern.test(keyName) ? false : true;\n var status = isBlinkingKey;\n if ('BCM-7437-1' == remoteType) {\n status = true;\n } else if ('GENERIC' == remoteType) {\n status = false;\n }\n return status;\n}\n\n/**\n * Sends a key to the server to be forwarded to the stb\n * @param key The name of the key to send\n * @param holdTime time in milliseconds the key is holded\n */\nfunction holdKey(key, holdTime) {\n var deviceIds = LayoutUtil.getCheckedDevices();\n var keyPattern = \"Key:\"+ key;\n updateEventLog(\"Pressed remote key [\"+ keyPattern +\", Action:HOLDKEY, TimeInMillis:\"+ holdTime+\"]\", deviceIds)\n var remoteType = HTMLUtil.getParameterByName(\"remoteType\");\n remoteType = (remoteType != null) ? remoteType.toUpperCase() : null;\n if ($('#faded').css('display') == 'none') {\n var keyPayload = {\n deviceIds : deviceIds,\n key : key,\n holdTime : holdTime,\n remoteType : remoteType\n };\n var posting = $.post(CXT_PATH + '/holdKey', keyPayload);\n validatePostEvent(posting, keyPattern);\n }\n}\n\nfunction sendKeyFromList() {\n var key = $('#keySelection').find(\":selected\").text();\n sendKey(key);\n}\n\n/**\n * Since chup and chdn and volup and voldn share an image then this method is called and determines which region is clicked.\n * @param img The image that was clicked\n * @param key The name of the key to send (VOL or CH)\n * @param clickY user clicked position(from top) in the page\n * @param isMouseDown flag to indicate whether key pressed or not. The button will blink only during the\n * release of the key.\n * @returns key pattern to be sent to the Rack.\n */\nfunction getKeyForVolCh(img, key, clickY, isMouseDown) {\n var iconHeight = $(img).height()/2;\n\n // Actual image mid pixel in the page.\n var boundary = $(img).offset().top + iconHeight;\n\n var clickedTop = clickY < boundary;\n var top = clickedTop ? 0 : iconHeight;\n\n var keySuffix = clickedTop ? 'UP' : 'DN';\n\n if(!isMouseDown) {\n blinkRegion($(img)[0], 0, top, $(img).width(), iconHeight);\n }\n return (key + keySuffix);\n}\n\n\nvar keyMap = new Array();\nkeyMap[13] = 'SELECT'; // enter\nkeyMap[38] = 'UP'; // up\nkeyMap[40] = 'DOWN'; // down\nkeyMap[37] = 'LEFT'; // left\nkeyMap[39] = 'RIGHT'; // right\nkeyMap[65] = 'A'; // a\nkeyMap[66] = 'B'; // b\nkeyMap[67] = 'C'; // c\nkeyMap[68] = 'D'; // d\nkeyMap[8] = 'LAST'; // backspace\nkeyMap[189] = 'CHDN'; // +\nkeyMap[187] = 'CHUP'; // -\nkeyMap[33] = 'PGUP'; // Page Up\nkeyMap[34] = 'PGDN'; // Page Down\nkeyMap[71] = 'GUIDE'; // g\nkeyMap[77] = 'MENU'; // m\nkeyMap[73] = 'INFO'; // i\nkeyMap[27] = 'EXIT'; // esc\nkeyMap[48] = 'ZERO'; // 0\nkeyMap[49] = 'ONE'; // 1\nkeyMap[50] = 'TWO'; // 2\nkeyMap[51] = 'THREE'; // 3\nkeyMap[52] = 'FOUR'; // 4\nkeyMap[53] = 'FIVE'; // 5\nkeyMap[54] = 'SIX'; // 6\nkeyMap[55] = 'SEVEN'; // 7\nkeyMap[56] = 'EIGHT'; // 8\nkeyMap[57] = 'NINE'; // 9\nkeyMap[112] = 'FAV_1'; // Fav 1\nkeyMap[113] = 'FAV_2'; // Fav 2\nkeyMap[114] = 'FAV_3'; // Fav 3\nkeyMap[115] = 'FAV_4'; // Fav 4\n\n/** Key code for '=' which is mapped to CHUP */\nvar CHUP_KEY_CODE = 187;\n\n/** Key code for '-' which is mapped to CHDN */\nvar CHDN_KEY_CODE = 189;\n\n/** Key codes of Fav1, Fav2,Fav3 and Fav4 which are mapped to FAV_1, FAV_2, FAV_3, FAV_4 */\nvar FAV_CHANNEL_CODES = [112, 113, 114, 115];\n\n/** Key codes of buttons that are not available in BCM-7437-1 remote (PGUP, PGDN, A, B, C, D) */\nvar KEY_CODES_NOT_SUPPORTED_BY_BCM_7437_1_REMOTE = [33, 34, 65, 66, 67, 68];\n\n$(window).keydown(function(event) {\n var editingText = $(document.activeElement).attr(\"type\") == \"text\" || $(document.activeElement).attr(\"type\") == \"textarea\";\n if (!editingText && hotKeysOn && !event.ctrlKey) {\n var keyCode = event.which;\n var key = keyMap[keyCode];\n if (key != null) {\n var rem = $('#standardRemoteDiv').is(':hidden') ? 'm' : 's';\n var remoteType = StandardRemote.getRemoteName();\n\n /** For CHUP and CHDN, one single image is used. So blink the proper area in UI depends on the Pressed key.*/\n if((keyCode === CHUP_KEY_CODE || keyCode === CHDN_KEY_CODE) && (remoteType != 'BCM-7437-1')) {\n var chElement = $(\"#sch\")[0];\n var iconHeight = $(chElement).height()/2;\n var iconWidth = $(chElement).width();\n\n if(keyCode === CHUP_KEY_CODE) {\n blinkRegion($(chElement)[0], 0, 0, iconWidth, iconHeight);\n } else {\n blinkRegion($(chElement)[0], 0, iconHeight, iconWidth, iconHeight);\n }\n }\n\n validateClickedKey(rem, key, keyCode, remoteType);\n event.preventDefault();\n }\n }\n});\n\nfunction validateClickedKey (rem, key, keyCode, remoteType){\n if ((FAV_CHANNEL_CODES.indexOf(keyCode) > -1) && remoteType != 'BCM-7437-1') {\n // Do nothing, do not send key press\n } else if ((KEY_CODES_NOT_SUPPORTED_BY_BCM_7437_1_REMOTE.indexOf(keyCode) > -1) && remoteType =='BCM-7437-1'){\n // Do nothing, do not send key press\n } else {\n clickKey(document.getElementById(rem + key.toLowerCase()), key);\n }\n}\n\nvar hotKeysOn = true;\n\nfunction clickKeyboard(img) {\n hotKeysOn = !hotKeysOn;\n img.src = CXT_PATH + \"/images/keyboard\" + (hotKeysOn ? \"Sel\" : \"\") + \".png\";\n updateKeyboardQHelp(hotKeysOn);\n}\n\n/** Constant to store the time in milliseconds for a single key press. */\nvar single_keypress_time = 100;\n\n/** Delay in milliseconds used to distinguish between a normal click from the hold key event. If a key is\n * is pressed for more than 500ms, then it is assumed as a hold action.*/\nvar delay_for_hold_action = 500;\n\n/** Interval timer variable for hold action */\nvar intervalTimer;\n\n/** Timeout timer variable for hold action.*/\nvar timeOut;\n\n/** Holds the time at which the key is pressed. */\nvar startTime = 0;\n\n/** Holds the time at which the key is released. */\nvar endTime = 0;\n\n/**\n * Method which handles the click events and distinguish between normal click and hold action.\n * If a key is pressed for < 500ms, then it is assumed as a normal single click action. If the click,\n * duration is more than 500ms then it will identify it as a hold event and compute the hold time in milliseconds.\n *\n * General rule for computation is : <b>For every 100ms there will be 1 key press.</b>\n *\n * @param e click event\n * @param key key value to be sent to the IRClient\n * @param isDown Flag to indicate whehter key press or key release.\n */\n\nfunction clickRemoteButton(e, key, isDown) {\n latest_event = e;\n latest_key = key;\n\n var image = latest_event.target;\n\n if (isDown) {\n isMouseDown = true;\n startTime = Date.now();\n clearTimers();\n $('#hold_panel').text('');\n\n clickTime = Date.now() - startTime;\n\n // Setup a timeout timer to update the repeat count values.\n // The counter updation starts ONLY AFTER (500 - current clickTime)\n timeOut = setTimeout(function () {\n updateCounter(e);\n }, (delay_for_hold_action - clickTime));\n } // end of key down action\n else {\n\n // Trigger the key up action only if valid mouse down action exists.\n if(isMouseDown){\n isMouseDown = false;\n endTime = Date.now();\n\n // clear all timers which are asynchronously updating the repeat counts.\n clearTimers();\n\n // Compute the key hold time.\n var holdTimeInMillis = endTime - startTime;\n\n $('#hold_panel').hide(\"slow\");\n\n if (holdTimeInMillis > delay_for_hold_action) {\n // Press and hold key\n holdIRKey(image, key, holdTimeInMillis);\n } else {\n // Normal click\n clickKey(image, key);\n }\n // reset starttime and endtime variables.\n startTime = 0;\n endTime = 0;\n }\n }\n}\n\n/**\n * Method to asynchronously update the repeat counter for the hold action.\n * @param e click event\n */\n\nfunction updateCounter(e) {\n // Default repeat count value. In order to have a hold event there should be a minimum of\n // 500 ms. For every 100ms there will be 1 key. So setting 5 as default repeat count.\n repeatCount = 5;\n\n // Computing currently clicked position in the screen to draw the counter panel.\n posX = e.pageX;\n posY = e.pageY;\n\n // Increment counter in every 100ms, until the timers are cleared.\n intervalTimer = setInterval(function () {\n repeatCount++;\n drawOverlay(posX, posY, repeatCount);\n }, single_keypress_time);\n}\n\n/**\n * Draw the counter panel overlay.\n * @param posX currently clicked X position\n * @param posY currently clicked Y position\n * @param repeatCount repeat count for the key.\n */\n\nfunction drawOverlay(posX, posY, repeatCount) {\n $('#hold_panel').css('left', posX + 10);\n $('#hold_panel').css('top', posY + 5);\n $('#hold_panel').show(\"fast\");\n $('#hold_panel').text(repeatCount + ' repeats ');\n}\n\n/**\n * Clear all the previously existing timeout and interval timers.\n */\n\nfunction clearTimers() {\n clearInterval(intervalTimer);\n clearTimeout(timeOut);\n}\n\n/**\n * Used to display or hide the keyboard to remote key mapping overlay\n * @param e click event\n * @param status determines whether to show or hide the overlay.\n */\nfunction displayKeyMappingOverlay(e, status) {\n var image = e.target;\n if(status) {\n blink(image);\n $(\"#keymap_panel\").show(\"slow\")\n } else {\n $(\"#keymap_panel\").hide(\"slow\")\n }\n}\n\n/**\n * Display keyboard quick help button only if the keyboard mode is active.\n * @param isVisible indicate whether keyboard mode is currently active or not.\n */\nfunction updateKeyboardQHelp(isVisible) {\n if(isVisible) {\n $(\"#skeyhelp\").show();\n } else {\n $(\"#skeyhelp\").hide();\n }\n}\n\n/**\n * Helper method to verify the post event response.\n * @param posting event response\n * @param keyPattern key pattern sent to the server.\n */\nfunction validatePostEvent(posting, keyPattern) {\n posting.done(function( data ) {\n updateEventLog( \"Successfully sent [\"+ keyPattern +\"]\", null);\n });\n posting.fail(function(jqXHR, textStatus, errorThrown){\n updateEventLog( \"Error while sending [\"+ keyPattern + \"]\", null);\n updateEventLog( errorThrown +\". Status: \"+ jqXHR.status, null);\n });\n}\n", "meta": {"content_hash": "2a281ad304a3ff01d708c8d5d187de18", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 127, "avg_line_length": 32.62247191011236, "alnum_prop": 0.6104567059309775, "repo_name": "trentontrees/dawg", "id": "3a168ab362a980f1924fbf861edff1246366862c", "size": "15140", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "libraries/dawg-show/src/main/webapp/js/keys.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "35085"}, {"name": "Java", "bytes": "1200331"}, {"name": "JavaScript", "bytes": "368052"}, {"name": "Makefile", "bytes": "1790"}, {"name": "Ruby", "bytes": "1270"}, {"name": "Shell", "bytes": "593"}]}} +{"text": "//=================================================================================================\n\n//=================================================================================================\n\n\n//*************************************************************************************************\n// Includes\n//*************************************************************************************************\n\n#include <cstdlib>\n#include <iostream>\n#include <blaze/math/CompressedVector.h>\n#include <blaze/math/DynamicMatrix.h>\n#include <blaze/math/StrictlyLowerMatrix.h>\n#include <blazetest/mathtest/Creator.h>\n#include <blazetest/mathtest/dmatsvecmult/OperationTest.h>\n#include <blazetest/system/MathTest.h>\n\n\n//=================================================================================================\n//\n// MAIN FUNCTION\n//\n//=================================================================================================\n\n//*************************************************************************************************\nint main()\n{\n std::cout << \" Running 'SLDbVCb'...\" << std::endl;\n\n using blazetest::mathtest::TypeB;\n\n try\n {\n // Matrix type definitions\n typedef blaze::StrictlyLowerMatrix< blaze::DynamicMatrix<TypeB> > SLDb;\n typedef blaze::CompressedVector<TypeB> VCb;\n\n // Creator type definitions\n typedef blazetest::Creator<SLDb> CSLDb;\n typedef blazetest::Creator<VCb> CVCb;\n\n // Running tests with large matrices and vectors\n for( size_t i=0UL; i<=6UL; ++i ) {\n for( size_t j=0UL; j<=i; ++j ) {\n RUN_DMATSVECMULT_OPERATION_TEST( CSLDb( i ), CVCb( i, j ) );\n }\n }\n\n // Running tests with large matrices and vectors\n RUN_DMATSVECMULT_OPERATION_TEST( CSLDb( 67UL ), CVCb( 67UL, 7UL ) );\n RUN_DMATSVECMULT_OPERATION_TEST( CSLDb( 127UL ), CVCb( 127UL, 13UL ) );\n RUN_DMATSVECMULT_OPERATION_TEST( CSLDb( 64UL ), CVCb( 64UL, 8UL ) );\n RUN_DMATSVECMULT_OPERATION_TEST( CSLDb( 128UL ), CVCb( 128UL, 16UL ) );\n }\n catch( std::exception& ex ) {\n std::cerr << \"\\n\\n ERROR DETECTED during dense matrix/sparse vector multiplication:\\n\"\n << ex.what() << \"\\n\";\n return EXIT_FAILURE;\n }\n\n return EXIT_SUCCESS;\n}\n//*************************************************************************************************\n", "meta": {"content_hash": "a4a62324f0986d2d5d22917ed860a25c", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 99, "avg_line_length": 37.625, "alnum_prop": 0.4148671096345515, "repo_name": "wdv4758h/blaze-lib", "id": "8a15b52d43b4f85d24cbcb3a2a4e3b59495dd62e", "size": "4292", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "blazetest/src/mathtest/dmatsvecmult/SLDbVCb.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "108199"}, {"name": "C++", "bytes": "63280462"}, {"name": "Makefile", "bytes": "520048"}, {"name": "Objective-C", "bytes": "9874"}, {"name": "Shell", "bytes": "551420"}]}} +{"text": "using System;\nusing UnityEngine;\nusing Vexe.Runtime.Extensions;\nusing Vexe.Runtime.Helpers;\nusing Vexe.Runtime.Types;\nusing Random = UnityEngine.Random;\n\nnamespace Vexe.Editor.Drawers\n{\n\tpublic abstract class BetterVectorDrawer<T, A> : AttributeDrawer<T, A> where A : DrawnAttribute\n\t{\n\t\tprivate const string kBtnReset = \"0\";\n\t\tprivate const string kBtnNormalize = \"1\";\n\t\tprivate const string kBtnRandomize = \"r\";\n\n\t\tprivate Func<string, T, T> _getField;\n\n\t\tprotected static float rand()\n\t\t{\n\t\t\treturn Random.Range(-100, 100);\n\t\t}\n\n\t\tpublic override void OnGUI()\n\t\t{\n\t\t\tusing (gui.Horizontal())\n\t\t\t{\n\t\t\t\tif (_getField == null)\n\t\t\t\t\t_getField = GetField();\n\n\t\t\t\tvar current = memberValue;\n\t\t\t\tvar newValue = _getField(displayText, current);\n\t\t\t\t{\n\t\t\t\t\tif (!VectorEquals(current, newValue))\n\t\t\t\t\t\tmemberValue = newValue;\n\t\t\t\t}\n\n\t\t\t\tgui.Space(12f);\n\t\t\t\tFoldout();\n\t\t\t\tgui.Space(-10f);\n\t\t\t}\n\n\t\t\tif (foldout)\n\t\t\t{\n\t\t\t\tusing (gui.Horizontal())\n\t\t\t\t{\n\t\t\t\t\tDoButtons();\n\t\t\t\t\tgui.Space(25f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void DoButtons()\n\t\t{\n\t\t\tgui.FlexibleSpace();\n\t\t\tvar option = Layout.sHeight(13f);\n\t\t\tif (gui.MiniButton(\"Copy\", \"Copy vector value\", option))\n\t\t\t\tCopy();\n\t\t\tif (gui.MiniButton(\"Paste\", \"Paste vector value\", option))\n\t\t\t\tmemberValue = Paste();\n\t\t\tif (gui.MiniButton(kBtnRandomize, \"Randomize values between [-100, 100]\", MiniButtonStyle.ModMid, option))\n\t\t\t\tmemberValue = Randomize();\n\t\t\tif (gui.MiniButton(kBtnNormalize, \"Normalize\", MiniButtonStyle.ModMid, option))\n\t\t\t\tmemberValue = Normalize();\n\t\t\tif (gui.MiniButton(kBtnReset, \"Reset\", MiniButtonStyle.ModRight, option))\n\t\t\t\tmemberValue = Reset();\n\t\t}\n\n\t\tprotected abstract Func<string, T, T> GetField();\n\n\t\tprotected abstract bool VectorEquals(T left, T right);\n\n\t\tprotected abstract T Reset();\n\n\t\tprotected abstract T Normalize();\n\n\t\tprotected abstract T Randomize();\n\n\t\tprotected abstract T Paste();\n\n\t\tprotected abstract void Copy();\n\t}\n\n\tpublic class BetterV2Drawer : BetterVectorDrawer<Vector2, BetterV2Attribute>\n\t{\n\t\tprotected override void Copy()\n\t\t{\n\t\t\tint key = RuntimeHelper.CombineHashCodes(id, \"Clip\");\n\t\t\tprefs.SetV2(key, memberValue);\n\t\t}\n\n\t\tprotected override Vector2 Paste()\n\t\t{\n\t\t\tint key = RuntimeHelper.CombineHashCodes(id, \"Clip\");\n\t\t\treturn prefs.GetV2(key, memberValue);\n\t\t}\n\n\t\tprotected override Vector2 Randomize()\n\t\t{\n\t\t\treturn new Vector2(rand(), rand());\n\t\t}\n\n\t\tprotected override Vector2 Normalize()\n\t\t{\n\t\t\treturn Vector2.one;\n\t\t}\n\n\t\tprotected override Vector2 Reset()\n\t\t{\n\t\t\treturn Vector2.zero;\n\t\t}\n\n\t\tprotected override Func<string, Vector2, Vector2> GetField()\n\t\t{\n\t\t\treturn gui.Vector2Field;\n\t\t}\n\n\t\tprotected override bool VectorEquals(Vector2 left, Vector2 right)\n\t\t{\n\t\t\treturn left.ApproxEqual(right);\n\t\t}\n\t}\n\n\tpublic class BetterV3Drawer : BetterVectorDrawer<Vector3, BetterV3Attribute>\n\t{\n\t\tprotected override void Copy()\n\t\t{\n\t\t\tint key = RuntimeHelper.CombineHashCodes(id, \"Clip\");\n\t\t\tprefs.SetV3(key, memberValue);\n\t\t}\n\n\t\tprotected override Vector3 Paste()\n\t\t{\n\t\t\tint key = RuntimeHelper.CombineHashCodes(id, \"Clip\");\n\t\t\treturn prefs.GetV3(key, memberValue);\n\t\t}\n\n\t\tprotected override Vector3 Randomize()\n\t\t{\n\t\t\treturn new Vector3(rand(), rand(), rand());\n\t\t}\n\n\t\tprotected override Vector3 Normalize()\n\t\t{\n\t\t\treturn Vector3.one;\n\t\t}\n\n\t\tprotected override Vector3 Reset()\n\t\t{\n\t\t\treturn Vector3.zero;\n\t\t}\n\n\t\tprotected override Func<string, Vector3, Vector3> GetField()\n\t\t{\n\t\t\treturn gui.Vector3Field;\n\t\t}\n\n\t\tprotected override bool VectorEquals(Vector3 left, Vector3 right)\n\t\t{\n\t\t\treturn left.ApproxEqual(right);\n\t\t}\n\t}\n}\n", "meta": {"content_hash": "a1678282e99d9f79fcc6ae3d689593a3", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 109, "avg_line_length": 21.753086419753085, "alnum_prop": 0.6816118047673099, "repo_name": "laicasaane/VFW", "id": "35dc95b09b3066aac813a9f6969067be5e8d7c5b", "size": "3524", "binary": false, "copies": "1", "ref": "refs/heads/improved", "path": "Assets/Plugins/Editor/Vexe/Drawers/User/BetterVectorDrawer.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "712135"}]}} +{"text": "/*\n * The Plaid API\n * The Plaid REST API. Please see https://plaid.com/docs/api for more details.\n *\n * The version of the OpenAPI document: 2020-09-14_1.205.3\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\npackage com.plaid.client.model;\n\nimport java.util.Objects;\nimport java.util.Arrays;\nimport com.google.gson.TypeAdapter;\nimport com.google.gson.annotations.JsonAdapter;\nimport com.google.gson.annotations.SerializedName;\nimport com.google.gson.stream.JsonReader;\nimport com.google.gson.stream.JsonWriter;\nimport com.plaid.client.model.Originator;\nimport io.swagger.annotations.ApiModel;\nimport io.swagger.annotations.ApiModelProperty;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Defines the response schema for `/transfer/originator/list`\n */\n@ApiModel(description = \"Defines the response schema for `/transfer/originator/list`\")\n@javax.annotation.Generated(value = \"org.openapitools.codegen.languages.JavaClientCodegen\", date = \"2022-11-17T17:52:41.932844Z[Etc/UTC]\")\npublic class TransferOriginatorListResponse {\n public static final String SERIALIZED_NAME_ORIGINATORS = \"originators\";\n @SerializedName(SERIALIZED_NAME_ORIGINATORS)\n private List<Originator> originators = new ArrayList<>();\n\n public static final String SERIALIZED_NAME_REQUEST_ID = \"request_id\";\n @SerializedName(SERIALIZED_NAME_REQUEST_ID)\n private String requestId;\n\n\n public TransferOriginatorListResponse originators(List<Originator> originators) {\n \n this.originators = originators;\n return this;\n }\n\n public TransferOriginatorListResponse addOriginatorsItem(Originator originatorsItem) {\n this.originators.add(originatorsItem);\n return this;\n }\n\n /**\n * Get originators\n * @return originators\n **/\n @ApiModelProperty(required = true, value = \"\")\n\n public List<Originator> getOriginators() {\n return originators;\n }\n\n\n public void setOriginators(List<Originator> originators) {\n this.originators = originators;\n }\n\n\n public TransferOriginatorListResponse requestId(String requestId) {\n \n this.requestId = requestId;\n return this;\n }\n\n /**\n * A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.\n * @return requestId\n **/\n @ApiModelProperty(required = true, value = \"A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.\")\n\n public String getRequestId() {\n return requestId;\n }\n\n\n public void setRequestId(String requestId) {\n this.requestId = requestId;\n }\n\n\n @Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (o == null || getClass() != o.getClass()) {\n return false;\n }\n TransferOriginatorListResponse transferOriginatorListResponse = (TransferOriginatorListResponse) o;\n return Objects.equals(this.originators, transferOriginatorListResponse.originators) &&\n Objects.equals(this.requestId, transferOriginatorListResponse.requestId);\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(originators, requestId);\n }\n\n @Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"class TransferOriginatorListResponse {\\n\");\n sb.append(\" originators: \").append(toIndentedString(originators)).append(\"\\n\");\n sb.append(\" requestId: \").append(toIndentedString(requestId)).append(\"\\n\");\n sb.append(\"}\");\n return sb.toString();\n }\n\n /**\n * Convert the given object to string with each line indented by 4 spaces\n * (except the first line).\n */\n private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }\n\n}\n\n", "meta": {"content_hash": "2d1b46f3c2e8b5e3a01127d647c773b4", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 187, "avg_line_length": 29.432835820895523, "alnum_prop": 0.7221095334685599, "repo_name": "plaid/plaid-java", "id": "68bccdcee25cfac5d4e7b1d25165776c8c9906d2", "size": "3944", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/plaid/client/model/TransferOriginatorListResponse.java", "mode": "33188", "license": "mit", "language": [{"name": "Dockerfile", "bytes": "170"}, {"name": "Java", "bytes": "6218680"}, {"name": "Mustache", "bytes": "23285"}]}} +{"text": "require 'omniauth-github-team-member/version'\nrequire 'omniauth/strategies/github_team_member'\n", "meta": {"content_hash": "540722b0648ea208ee6e0b84a221da4b", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 48, "avg_line_length": 47.5, "alnum_prop": 0.8315789473684211, "repo_name": "jonmagic/omniauth-github-team-member", "id": "c257bb1255d7ae132b2f2a23cb4290b3d2686d12", "size": "95", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/omniauth-github-team-member.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "4438"}]}} +{"text": "TFJS uint8 quantized version of the YOLO model (with DarkNet 53 backbone) trained on the CPPE - 5 (Medical Personal Protective Equipment) dataset [1].\n\n<!-- parent-model: rishit-dagli/yolo-cppe5-tfjs/1 -->\n<!-- asset-path: https://storage.googleapis.com/cppe-5/trained_models/yolo/tfjs/yolo_uint8.tar.gz -->\n\n### Overview\nThe YOLO model was proposed by Redmon et al. in their paper \"Yolov3: An incremental improvement\" [2]. The YOLO model is trained on the CPPE - 5 dataset we present in our paper \"CPPE - 5: Medical Personal Protective Equipment Dataset\" [1] which is a new challenging dataset with an aim to facilitate the study of subordinate categorization of medical personal protective equipments. This dataset mostly contains non-iconic images or non-canonical perspectives in their natural context. This allows models to be better at generalizing, being easily deployable to real-world scenarios and often contain other objects in an image as well.\n\nWe include the training code as well some tools for this model in our paper GitHub repository [3].\n\nNote: In no case should this model be used to engage in any kind of high-risk activities, please [TF Hub Additional Terms of Service](https://tfhub.dev/terms#hra) for more information.\n\n### Usage\nThe saved model can be loaded directly:\n\n```js\nconst model = await tf.loadGraphModel(\"https://tfhub.dev/rishit-dagli/yolo-cppe5-tfjs/uint8/tfjs/1\")\n```\n\nThe inputs to the models should:\n\n- have color values in the range `[0,1]`, following the [common image input](https://www.tensorflow.org/hub/common_signatures/images#input) conventions\n- the expected size of the input images is height x width = 800 x 1216 pixels\n- the images should in the `channels_first` format\n- The shape of the input tensor would ths be `(1, 3, 800, 1216)`, the first dimension represents the batch size\n\nThe model outputs are:\n\n- A tensor of shape `[batch_size, 100, 5]` with the bounding boxes in normalized coordinates.\n- A tensor of shape `[batch_size, 100]` with the class labels for the bounding boxes.\n\n### Note\n\n- This model was quantized using `uint8` quantization.\n- This model takes fixed-shaped (800 x 1216) inputs.\n- This model has been converted using the [TensorFlow.js converter API](https://www.tensorflow.org/js/guide/conversion).\n\n### Acknowledgements\n\nThis is joint work with Ali Mustufa Shaikh. The authors would like to thank Google for supporting this work by providing Google Cloud credits. The authors would also like to thank [Google TPU Research Cloud (TRC) program](https://sites.research.google/trc) for providing access to TPUs.\n\n### References\n\n[1] Dagli, Rishit, and Ali Mustufa Shaikh. \u2018CPPE-5: Medical Personal Protective Equipment Dataset\u2019. ArXiv:2112.09569 [Cs], Dec. 2021. arXiv.org, http://arxiv.org/abs/2112.09569.\n\n[2] Redmon, Joseph, and Ali Farhadi. \"Yolov3: An incremental improvement.\" arXiv preprint arXiv:1804.02767 (2018).\n\n[3] https://github.com/Rishit-dagli/CPPE-Dataset", "meta": {"content_hash": "1ee062806409dffe7d36fc86ecfc3165", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 634, "avg_line_length": 61.4375, "alnum_prop": 0.7653441844693116, "repo_name": "tensorflow/tfhub.dev", "id": "4a2c488381deaaf188e709b18c4bc1ec4555a1b5", "size": "2997", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "assets/docs/rishit-dagli/yolo-cppe5-tfjs/uint8/tfjs/1.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Python", "bytes": "160084"}, {"name": "Starlark", "bytes": "6838"}]}} +{"text": "<?php\r\nsession_start();\r\nrequire(\"../../MySQLconnect/config.php\");\r\n\r\nif(!isset($_SESSION['user_id']))\r\n{\r\nheader('location:../../');\r\n}\r\nelse\r\n{\r\n$userid = mysql_real_escape_string($_SESSION['user_id']);\r\n}\r\n\r\n$riskid = mysql_real_escape_string($_GET['risk_id']);\r\n$projectid = mysql_real_escape_string($_GET['project_id']);\r\n$riskinfo = htmlentities(stripslashes(stripslashes(mysql_real_escape_string($_GET['risk_info']))),ENT_QUOTES);\r\n$consequence = htmlentities(stripslashes(stripslashes(mysql_real_escape_string($_GET['consequence']))),ENT_QUOTES);\r\n$chance = mysql_real_escape_string($_GET['chance']);\r\n$programme = mysql_real_escape_string($_GET['programme']);\r\n$budget = mysql_real_escape_string($_GET['budget']);\r\n$she = mysql_real_escape_string($_GET['she']);\r\n$timeimpact = mysql_real_escape_string($_GET['impact_t']);\r\n$cost = mysql_real_escape_string($_GET['cost']);\r\n$costtbd = mysql_real_escape_string($_GET['cost_tbd']);\r\n$owner = mysql_real_escape_string($_GET['owner']);\r\n$mitigation = htmlentities(stripslashes(stripslashes(mysql_real_escape_string($_GET['mitigation']))),ENT_QUOTES);\r\n$time=time();\r\n$riskrating = $chance*max($programme,$budget);\r\n\r\n$oldrecorddetails = mysql_fetch_array(mysql_query(\"SELECT * FROM risk_log WHERE risk_id='$riskid'\"));\r\n\r\n//check for the ID of the new owner and add them to the system if they do not exist\r\n$results = mysql_query(\"SELECT * FROM users WHERE email='$owner'\");\r\n$countrows = mysql_num_rows($results);\r\nif($countrows==0)\r\n{\r\nmysql_query(\"INSERT INTO users SET email='$owner'\");\r\n$results = mysql_query(\"SELECT * FROM users WHERE email='$owner'\");\r\n$ownerid = mysql_fetch_array($results);\r\n$ownerid = $ownerid['user_id'];\r\n}\r\nelse\r\n{\r\n$ownerid = mysql_fetch_array($results);\r\n$ownerid = $ownerid['user_id'];\r\n}\r\n\r\nmysql_query(\"UPDATE risk_log \r\nSET risk_info='$riskinfo', consequence='$consequence', chance='$chance', impact_p='$programme', impact_b='$budget', impact_she='$she', impact_t='$timeimpact', e_cost='$cost', e_cost_tbd='$costtbd', owner='$ownerid', mitigation='$mitigation', risk_rating='$riskrating'\r\nWHERE risk_id='$riskid'\");\r\n\r\n\r\n$updatecomment1 = \"\";\r\n$updatecomment2 = \"\";\r\n$updatecomment3 = \"\";\r\n$updatecomment4 = \"\";\r\n$updatecomment5 = \"\";\r\n$updatecomment6 = \"\";\r\n$updatecomment7 = \"\";\r\n$updatecomment8 = \"\";\r\n$updatecomment9 = \"\";\r\n$updatecomment10 = \"\";\r\n$updatecomment11 = \"\";\r\n$updatecomment12 = \"\";\r\n$changed = 0;\r\n\r\nif($oldrecorddetails['risk_info']<>$riskinfo)\r\n{\r\n$updatecomment1 = \"<br />Risk info changed from: \" . $oldrecorddetails['risk_info'];\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['owner']<>$owner)\r\n{\r\n$updatecomment2 = \"<br />Owner changed from: \" . $oldrecorddetails['owner'];\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['consequence']<>$consequence)\r\n{\r\n$updatecomment3 = \"<br />Consequence changed from: \" . $oldrecorddetails['consequence'];\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['impact_p']<>$programme)\r\n{\r\n$updatecomment4 = \"<br />Programme impact changed from: \" . $oldrecorddetails['impact_p'];\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['impact_b']<>$budget)\r\n{\r\n$updatecomment5 = \"<br />Budget impact changed from: \" . $oldrecorddetails['impact_b'];\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['impact_she']<>$she)\r\n{\r\n$updatecomment6 = \"<br />SHE impact changed from: \" . $oldrecorddetails['impact_she'];\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['chance']<>$chance)\r\n{\r\n$updatecomment7 = \"<br />Likelihood changed from: \" . $oldrecorddetails['chance'];\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['risk_rating']<>$riskrating)\r\n{\r\n$updatecomment8 = \"<br />Risk rating changed from: \" . $oldrecorddetails['risk_rating'];\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['impact_t']<>$timeimpact)\r\n{\r\n$updatecomment9 = \"<br />Time impact changed from: \" . $oldrecorddetails['impact_t'];\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['e_cost']<>$cost)\r\n{\r\n$updatecomment10 = \"<br />Estimated cost changed from: \" . $oldrecorddetails['e_cost'];\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['e_cost_tbd']<>$costtbd)\r\n{\r\n\tif($costtbd==1)\r\n\t{\r\n\t$updatecomment11 = \"<br />Costs to be determined changed to: confirmation needed\";\r\n\t}\r\n\telse\r\n\t{\r\n\t$updatecomment11 = \"<br />Costs to be determined changed to: costs confirmed\";\r\n\t}\r\n$changed = 1;\r\n}\r\n\r\nif($oldrecorddetails['mitigation']<>$mitigation)\r\n{\r\n$updatecomment12 = \"<br />Mitigation measures changed from: \" . $oldrecorddetails['mitigation'];\r\n$changed = 1;\r\n}\r\n\r\nif($changed>0)\r\n{\r\n$updatecomment = $updatecomment1.$updatecomment2.$updatecomment3.$updatecomment4.$updatecomment5.$updatecomment6.$updatecomment7.$updatecomment8.$updatecomment9.$updatecomment10.$updatecomment11.$updatecomment12;\r\nmysql_query(\"INSERT INTO audit_trail_risk_log (project_id, risk_id, comment, user_id) VALUES ('$projectid','$riskid','$updatecomment','$userid')\");\r\n}\r\n\r\n//display the list of daily records\r\nrequire(\"load_risk_records.php\");\r\n?>", "meta": {"content_hash": "043d57789b2864ef93ce78c7accb7a41", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 267, "avg_line_length": 31.649350649350648, "alnum_prop": 0.6721378744357817, "repo_name": "tomwinslow/Open-Project-Tracker", "id": "e53dabec918a440732a15fde41e4dac0904872c3", "size": "4874", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Ajax/risk_log/update_risk_details.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "28700"}, {"name": "HTML", "bytes": "13314"}, {"name": "JavaScript", "bytes": "214765"}, {"name": "PHP", "bytes": "341361"}]}} +{"text": "\n//global variables\nvar countriesNeedIDNumber = [];\nvar countriesNeedZipCode = [];\n\n$(document).ready(function(){\n\tsetCountries();\n\tbindStateInputAndUpdate();\n\tbindUniform();\n\tbindPostcode();\n\tbindCheckbox();\n\t$(document).on('click', '#invoice_address', function(e){\n\t\tbindCheckbox();\n\t});\n});\n\nfunction setCountries()\n{\n\tif (typeof countries !== 'undefined' && countries)\n\t{\n\t\tvar countriesPS = [];\n\t for (var i in countries)\n\t\t{\n\t\t\tvar id_country = countries[i]['id_country'];\n\t\t\tif (typeof countries[i]['states'] !== 'undefined' && countries[i]['states'] && countries[i]['contains_states'])\n\t\t\t{\n\t\t\t\tcountriesPS[id_country] = [];\n\t \t\tfor (var j in countries[i]['states'])\n\t\t\t\t\tcountriesPS[parseInt(id_country)].push({'id' : parseInt(countries[i]['states'][j]['id_state']), 'name' : countries[i]['states'][j]['name']});\n\t\t\t}\n\t\t\tif (typeof countries[i]['need_identification_number'] !== 'undefined' && parseInt(countries[i]['need_identification_number']) > 0)\n\t\t\t\tcountriesNeedIDNumber.push(parseInt(countries[i]['id_country']));\n\t\t\tif (typeof countries[i]['need_zip_code'] !== 'undefined' && parseInt(countries[i]['need_zip_code']) > 0)\n\t\t\t\tcountriesNeedZipCode[parseInt(countries[i]['id_country'])] = countries[i]['zip_code_format'];\n\t\t}\n\t}\n\tcountries = countriesPS;\n}\n\nfunction bindCheckbox()\n{\n\tif ($('#invoice_address:checked').length > 0)\n\t{\n\t\t$('#opc_invoice_address').slideDown('slow');\n\t\tif ($('#company_invoice').val() == '')\n\t\t\t$('#vat_number_block_invoice').hide();\n\t\tbindUniform();\n\t}\n\telse\n\t\t$('#opc_invoice_address').slideUp('slow');\n}\n\nfunction bindUniform()\n{\n\t$(\"select.form-control,input[type='radio'],input[type='checkbox']\").uniform(); \n}\n\nfunction bindPostcode()\n{\n\t$(document).on('keyup', 'input[name=postcode]', function(e)\n\t{\n\t\t$(this).val($(this).val().toUpperCase());\n\t});\n}\n\nfunction bindStateInputAndUpdate()\n{\n\t$('.id_state, .dni, .postcode').css({'display':'none'});\n\tupdateState();\n\tupdateNeedIDNumber();\n\tupdateZipCode();\n\n\t$(document).on('change', '#id_country', function(e)\n\t{\n\t\tupdateState();\n\t\tupdateNeedIDNumber();\n\t\tupdateZipCode();\n\t});\n\n\tif ($('#id_country_invoice').length !== 0)\n\t{\n\t\t$(document).on('change', '#id_country_invoice', function(e)\n\t\t{\n\t\t\tupdateState('invoice');\n\t\t\tupdateNeedIDNumber('invoice');\n\t\t\tupdateZipCode('invoice');\n\t\t});\n\t\tupdateState('invoice');\n\t\tupdateNeedIDNumber('invoice');\n\t\tupdateZipCode('invoice');\n\t}\n\n\tif (typeof idSelectedState !== 'undefined' && idSelectedState)\n\t\t$('.id_state option[value=' + idSelectedState + ']').prop('selected', true);\n\tif (typeof idSelectedStateInvoice !== 'undefined' && idSelectedStateInvoice)\n\t\t$('.id_state_invoice option[value=' + idSelectedStateInvoice + ']').prop('selected', true);\n}\n\nfunction updateState(suffix)\n{\n\t$('#id_state' + (typeof suffix !== 'undefined' ? '_' + suffix : '')+' option:not(:first-child)').remove();\n\tif (typeof countries !== 'undefined')\n\t\tvar states = countries[parseInt($('#id_country' + (typeof suffix !== 'undefined' ? '_' + suffix : '')).val())];\n\tif (typeof states !== 'undefined')\n\t{\n\t\t$(states).each(function(key, item){\n\t\t\t$('#id_state' + (typeof suffix !== 'undefined' ? '_' + suffix : '')).append('<option value=\"' + parseInt(item.id) + '\">' + item.name + '</option>');\n\t\t});\n\n\t\t$('.id_state' + (typeof suffix !== 'undefined' ? '_' + suffix : '') + ':hidden').fadeIn('slow');\n\t\t$('#id_state, #id_state_invoice').uniform();\n\t}\n\telse\n\t\t$('.id_state' + (typeof suffix !== 'undefined' ? '_' + suffix : '')).fadeOut('fast');\n}\n\nfunction updateNeedIDNumber(suffix)\n{\n\tvar idCountry = parseInt($('#id_country' + (typeof suffix !== 'undefined' ? '_' + suffix : '')).val());\n\tif (typeof countriesNeedIDNumber !== 'undefined' && in_array(idCountry, countriesNeedIDNumber))\n\t{\n\t\t$('.dni' + (typeof suffix !== 'undefined' ? '_' + suffix : '') + ':hidden').fadeIn('slow');\n\t\t$('#dni').uniform();\n\t}\n\telse\n\t\t$('.dni' + (typeof suffix !== 'undefined' ? '_' + suffix : '')).fadeOut('fast');\n}\n\nfunction updateZipCode(suffix)\n{\n\tvar idCountry = parseInt($('#id_country' + (typeof suffix !== 'undefined' ? '_' + suffix : '')).val());\n\tif (typeof countriesNeedZipCode !== 'undefined' && typeof countriesNeedZipCode[idCountry] !== 'undefined')\n\t{\n\t\t$('.postcode' + (typeof suffix !== 'undefined' ? '_' + suffix : '') + ':hidden').fadeIn('slow');\n\t\t$('#postcode').uniform();\n\t}\n\telse\n\t\t$('.postcode'+(typeof suffix !== 'undefined' ? '_' + suffix : '')).fadeOut('fast');\n}", "meta": {"content_hash": "eba19d0ef655c08eca67ace7547259e6", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 151, "avg_line_length": 31.690647482014388, "alnum_prop": 0.6204313280363224, "repo_name": "rannor/ranno-bootstrap", "id": "13ac28153b39cf38c37ea1198cb4e96a10105e07", "size": "5373", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "js/tools/statesManagement.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "411867"}, {"name": "JavaScript", "bytes": "370528"}, {"name": "PHP", "bytes": "168531"}, {"name": "Ruby", "bytes": "770"}]}} +{"text": "webhookr\n========\n\nGo-lang HTTP multiplexer\n", "meta": {"content_hash": "c0f5bc92f9daf6d13b1a3e9aa7bdcd57", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 24, "avg_line_length": 11.0, "alnum_prop": 0.6590909090909091, "repo_name": "vongrippen/webhookr", "id": "adf387922a5b38024e554a781a126918d5dcfa59", "size": "44", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": []}} +{"text": "package com.piggymetrics.statistics.service;\n\nimport com.google.common.collect.ImmutableList;\nimport com.google.common.collect.ImmutableMap;\nimport com.piggymetrics.statistics.domain.Account;\nimport com.piggymetrics.statistics.domain.Currency;\nimport com.piggymetrics.statistics.domain.Item;\nimport com.piggymetrics.statistics.domain.Saving;\nimport com.piggymetrics.statistics.domain.TimePeriod;\nimport com.piggymetrics.statistics.domain.timeseries.DataPoint;\nimport com.piggymetrics.statistics.domain.timeseries.ItemMetric;\nimport com.piggymetrics.statistics.domain.timeseries.StatisticMetric;\nimport com.piggymetrics.statistics.repository.DataPointRepository;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.mockito.InjectMocks;\nimport org.mockito.Mock;\n\nimport java.math.BigDecimal;\nimport java.math.RoundingMode;\nimport java.time.LocalDate;\nimport java.time.ZoneId;\nimport java.util.Date;\nimport java.util.List;\nimport java.util.Map;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertTrue;\nimport static org.mockito.AdditionalAnswers.returnsFirstArg;\nimport static org.mockito.Mockito.any;\nimport static org.mockito.Mockito.times;\nimport static org.mockito.Mockito.verify;\nimport static org.mockito.Mockito.when;\nimport static org.mockito.MockitoAnnotations.initMocks;\n\npublic class StatisticsServiceImplTest {\n\n\t@InjectMocks\n\tprivate StatisticsServiceImpl statisticsService;\n\n\t@Mock\n\tprivate ExchangeRatesServiceImpl ratesService;\n\n\t@Mock\n\tprivate DataPointRepository repository;\n\n\t@Before\n\tpublic void setup() {\n\t\tinitMocks(this);\n\t}\n\n\t@Test\n\tpublic void shouldFindDataPointListByAccountName() {\n\t\tfinal List<DataPoint> list = ImmutableList.of(new DataPoint());\n\t\twhen(repository.findByIdAccount(\"test\")).thenReturn(list);\n\n\t\tList<DataPoint> result = statisticsService.findByAccountName(\"test\");\n\t\tassertEquals(list, result);\n\t}\n\n\t@Test(expected = IllegalArgumentException.class)\n\tpublic void shouldFailToFindDataPointWhenAccountNameIsNull() {\n\t\tstatisticsService.findByAccountName(null);\n\t}\n\n\t@Test(expected = IllegalArgumentException.class)\n\tpublic void shouldFailToFindDataPointWhenAccountNameIsEmpty() {\n\t\tstatisticsService.findByAccountName(\"\");\n\t}\n\n\t@Test\n\tpublic void shouldSaveDataPoint() {\n\n\t\t/**\n\t\t * Given\n\t\t */\n\n\t\tItem salary = new Item();\n\t\tsalary.setTitle(\"Salary\");\n\t\tsalary.setAmount(new BigDecimal(9100));\n\t\tsalary.setCurrency(Currency.USD);\n\t\tsalary.setPeriod(TimePeriod.MONTH);\n\n\t\tItem grocery = new Item();\n\t\tgrocery.setTitle(\"Grocery\");\n\t\tgrocery.setAmount(new BigDecimal(500));\n\t\tgrocery.setCurrency(Currency.RUB);\n\t\tgrocery.setPeriod(TimePeriod.DAY);\n\n\t\tItem vacation = new Item();\n\t\tvacation.setTitle(\"Vacation\");\n\t\tvacation.setAmount(new BigDecimal(3400));\n\t\tvacation.setCurrency(Currency.EUR);\n\t\tvacation.setPeriod(TimePeriod.YEAR);\n\n\t\tSaving saving = new Saving();\n\t\tsaving.setAmount(new BigDecimal(1000));\n\t\tsaving.setCurrency(Currency.EUR);\n\t\tsaving.setInterest(new BigDecimal(3.2));\n\t\tsaving.setDeposit(true);\n\t\tsaving.setCapitalization(false);\n\n\t\tAccount account = new Account();\n\t\taccount.setIncomes(ImmutableList.of(salary));\n\t\taccount.setExpenses(ImmutableList.of(grocery, vacation));\n\t\taccount.setSaving(saving);\n\n\t\tfinal Map<Currency, BigDecimal> rates = ImmutableMap.of(\n\t\t\t\tCurrency.EUR, new BigDecimal(\"0.8\"),\n\t\t\t\tCurrency.RUB, new BigDecimal(\"80\"),\n\t\t\t\tCurrency.USD, BigDecimal.ONE\n\t\t);\n\n\t\t/**\n\t\t * When\n\t\t */\n\n\t\twhen(ratesService.convert(any(Currency.class),any(Currency.class),any(BigDecimal.class)))\n\t\t\t\t.then(i -> ((BigDecimal)i.getArgument(2))\n\t\t\t\t\t\t.divide(rates.get(i.getArgument(0)), 4, RoundingMode.HALF_UP));\n\n\t\twhen(ratesService.getCurrentRates()).thenReturn(rates);\n\n\t\twhen(repository.save(any(DataPoint.class))).then(returnsFirstArg());\n\n\t\tDataPoint dataPoint = statisticsService.save(\"test\", account);\n\n\t\t/**\n\t\t * Then\n\t\t */\n\n\t\tfinal BigDecimal expectedExpensesAmount = new BigDecimal(\"17.8861\");\n\t\tfinal BigDecimal expectedIncomesAmount = new BigDecimal(\"298.9802\");\n\t\tfinal BigDecimal expectedSavingAmount = new BigDecimal(\"1250\");\n\n\t\tfinal BigDecimal expectedNormalizedSalaryAmount = new BigDecimal(\"298.9802\");\n\t\tfinal BigDecimal expectedNormalizedVacationAmount = new BigDecimal(\"11.6361\");\n\t\tfinal BigDecimal expectedNormalizedGroceryAmount = new BigDecimal(\"6.25\");\n\n\t\tassertEquals(dataPoint.getId().getAccount(), \"test\");\n\t\tassertEquals(dataPoint.getId().getDate(), Date.from(LocalDate.now().atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));\n\n\t\tassertTrue(expectedExpensesAmount.compareTo(dataPoint.getStatistics().get(StatisticMetric.EXPENSES_AMOUNT)) == 0);\n\t\tassertTrue(expectedIncomesAmount.compareTo(dataPoint.getStatistics().get(StatisticMetric.INCOMES_AMOUNT)) == 0);\n\t\tassertTrue(expectedSavingAmount.compareTo(dataPoint.getStatistics().get(StatisticMetric.SAVING_AMOUNT)) == 0);\n\n\t\tItemMetric salaryItemMetric = dataPoint.getIncomes().stream()\n\t\t\t\t.filter(i -> i.getTitle().equals(salary.getTitle()))\n\t\t\t\t.findFirst().get();\n\n\t\tItemMetric vacationItemMetric = dataPoint.getExpenses().stream()\n\t\t\t\t.filter(i -> i.getTitle().equals(vacation.getTitle()))\n\t\t\t\t.findFirst().get();\n\n\t\tItemMetric groceryItemMetric = dataPoint.getExpenses().stream()\n\t\t\t\t.filter(i -> i.getTitle().equals(grocery.getTitle()))\n\t\t\t\t.findFirst().get();\n\n\t\tassertTrue(expectedNormalizedSalaryAmount.compareTo(salaryItemMetric.getAmount()) == 0);\n\t\tassertTrue(expectedNormalizedVacationAmount.compareTo(vacationItemMetric.getAmount()) == 0);\n\t\tassertTrue(expectedNormalizedGroceryAmount.compareTo(groceryItemMetric.getAmount()) == 0);\n\n\t\tassertEquals(rates, dataPoint.getRates());\n\n\t\tverify(repository, times(1)).save(dataPoint);\n\t}\n}", "meta": {"content_hash": "99512399205f81d0ba6ddfaac1e0c769", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 130, "avg_line_length": 33.74850299401198, "alnum_prop": 0.7730660042583393, "repo_name": "guanzhenxing/swan", "id": "beeef32a8ccc0a844fd160352e55686b8ca12876", "size": "5636", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "statistics-service/src/test/java/com/piggymetrics/statistics/service/StatisticsServiceImplTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "133089"}]}} +{"text": "\"\"\"\nProject Euler Problem 86: https://projecteuler.net/problem=86\n\nA spider, S, sits in one corner of a cuboid room, measuring 6 by 5 by 3, and a fly, F,\nsits in the opposite corner. By travelling on the surfaces of the room the shortest\n\"straight line\" distance from S to F is 10 and the path is shown on the diagram.\n\ufffc\nHowever, there are up to three \"shortest\" path candidates for any given cuboid and the\nshortest route doesn't always have integer length.\n\nIt can be shown that there are exactly 2060 distinct cuboids, ignoring rotations, with\ninteger dimensions, up to a maximum size of M by M by M, for which the shortest route\nhas integer length when M = 100. This is the least value of M for which the number of\nsolutions first exceeds two thousand; the number of solutions when M = 99 is 1975.\n\nFind the least value of M such that the number of solutions first exceeds one million.\n\nSolution:\n Label the 3 side-lengths of the cuboid a,b,c such that 1 <= a <= b <= c <= M.\n By conceptually \"opening up\" the cuboid and laying out its faces on a plane,\n it can be seen that the shortest distance between 2 opposite corners is\n sqrt((a+b)^2 + c^2). This distance is an integer if and only if (a+b),c make up\n the first 2 sides of a pythagorean triplet.\n\n The second useful insight is rather than calculate the number of cuboids\n with integral shortest distance for each maximum cuboid side-length M,\n we can calculate this number iteratively each time we increase M, as follows.\n The set of cuboids satisfying this property with maximum side-length M-1 is a\n subset of the cuboids satisfying the property with maximum side-length M\n (since any cuboids with side lengths <= M-1 are also <= M). To calculate the\n number of cuboids in the larger set (corresponding to M) we need only consider\n the cuboids which have at least one side of length M. Since we have ordered the\n side lengths a <= b <= c, we can assume that c = M. Then we just need to count\n the number of pairs a,b satisfying the conditions:\n sqrt((a+b)^2 + M^2) is integer\n 1 <= a <= b <= M\n\n To count the number of pairs (a,b) satisfying these conditions, write d = a+b.\n Now we have:\n 1 <= a <= b <= M => 2 <= d <= 2*M\n we can actually make the second equality strict,\n since d = 2*M => d^2 + M^2 = 5M^2\n => shortest distance = M * sqrt(5)\n => not integral.\n a + b = d => b = d - a\n and a <= b\n => a <= d/2\n also a <= M\n => a <= min(M, d//2)\n\n a + b = d => a = d - b\n and b <= M\n => a >= d - M\n also a >= 1\n => a >= max(1, d - M)\n\n So a is in range(max(1, d - M), min(M, d // 2) + 1)\n\n For a given d, the number of cuboids satisfying the required property with c = M\n and a + b = d is the length of this range, which is\n min(M, d // 2) + 1 - max(1, d - M).\n\n In the code below, d is sum_shortest_sides\n and M is max_cuboid_size.\n\n\n\"\"\"\n\n\nfrom math import sqrt\n\n\ndef solution(limit: int = 1000000) -> int:\n \"\"\"\n Return the least value of M such that there are more than one million cuboids\n of side lengths 1 <= a,b,c <= M such that the shortest distance between two\n opposite vertices of the cuboid is integral.\n >>> solution(100)\n 24\n >>> solution(1000)\n 72\n >>> solution(2000)\n 100\n >>> solution(20000)\n 288\n \"\"\"\n num_cuboids: int = 0\n max_cuboid_size: int = 0\n sum_shortest_sides: int\n\n while num_cuboids <= limit:\n max_cuboid_size += 1\n for sum_shortest_sides in range(2, 2 * max_cuboid_size + 1):\n if sqrt(sum_shortest_sides**2 + max_cuboid_size**2).is_integer():\n num_cuboids += (\n min(max_cuboid_size, sum_shortest_sides // 2)\n - max(1, sum_shortest_sides - max_cuboid_size)\n + 1\n )\n\n return max_cuboid_size\n\n\nif __name__ == \"__main__\":\n print(f\"{solution() = }\")\n", "meta": {"content_hash": "4ec2b80df800a7d14c1403eed27d6525", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 86, "avg_line_length": 40.22857142857143, "alnum_prop": 0.5935132575757576, "repo_name": "TheAlgorithms/Python", "id": "064af215c049ecc1de5e7a945c8a7bc444bb874c", "size": "4226", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "project_euler/problem_086/sol1.py", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "2601694"}]}} +{"text": "package gov.va.med.srcalc.web.view.admin;\n\nimport gov.va.med.srcalc.domain.model.MultiSelectOption;\nimport gov.va.med.srcalc.util.ValidationCodes;\nimport gov.va.med.srcalc.util.ValidationUtils2;\n\nimport org.springframework.validation.*;\n\nimport com.google.common.collect.ImmutableList;\n\n/**\n * Validates an {@link EditMultiSelectVar} object.\n */\npublic class EditMultiSelectVarValidator implements Validator\n{\n private final EditBaseVarValidator fBaseValidator = new EditBaseVarValidator();\n \n /**\n * Returns true if (and only if) the given class is {@link EditMultiSelectVar}\n * or a subclass.\n */\n @Override\n public boolean supports(final Class<?> clazz)\n {\n return EditMultiSelectVar.class.isAssignableFrom(clazz);\n }\n \n /**\n * Validates the given object, using error codes from {@link ValidationCodes}.\n * @param target the object to validate. Must be an instance of {@link\n * EditMultiSelectVar}.\n * @throws ClassCastException if the given object is not an EditMultiSelectVar\n */\n @Override\n public void validate(final Object target, final Errors errors)\n {\n final EditMultiSelectVar editVar = (EditMultiSelectVar)target;\n // First, delegate to EditBaseVarValidator for validating the basic\n // properties.\n fBaseValidator.validate(target, errors);\n \n // Validate displayType.\n ValidationUtils.rejectIfEmpty(\n errors, \"displayType\", ValidationCodes.NO_VALUE);\n \n // Validate options. Use the getTrimmedOptions since that is what\n // getMultiSelectOptions will ultimately use. (That is, trailing blanks\n // are omitted.)\n final ImmutableList<String> options = editVar.getTrimmedOptions();\n if (options.isEmpty())\n {\n errors.rejectValue(\n \"options\",\n ValidationCodes.NO_VALUE,\n \"No options specified.\");\n }\n else if (options.size() > editVar.getMaxOptions())\n {\n errors.rejectValue(\n \"options\",\n ValidationCodes.TOO_LONG,\n new Object[] { editVar.getMaxOptions() },\n \"too many options\");\n }\n // Iterate using the index here because we need it to specify the field.\n for (int i = 0; i < options.size(); ++i)\n {\n final String fieldName = String.format(\"options[%d]\", i);\n ValidationUtils.rejectIfEmpty(errors, fieldName, ValidationCodes.NO_VALUE);\n ValidationUtils2.rejectIfTooLong(errors, fieldName, MultiSelectOption.VALUE_MAX);\n ValidationUtils2.rejectIfDoesntMatch(\n errors, fieldName, MultiSelectOption.VALID_VALUE_PATTERN,\n new Object[] {MultiSelectOption.VALID_VALUE_CHARACTERS});\n }\n }\n \n}\n", "meta": {"content_hash": "2da3b750a0a0c8111377ccc34454f702", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 93, "avg_line_length": 37.467532467532465, "alnum_prop": 0.6329289428076257, "repo_name": "VHAINNOVATIONS/ASRCM", "id": "094002898cb2a6299f9e150f94404256f2554130", "size": "2885", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "srcalc/src/main/java/gov/va/med/srcalc/web/view/admin/EditMultiSelectVarValidator.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "5043"}, {"name": "CSS", "bytes": "12887"}, {"name": "Genshi", "bytes": "56570"}, {"name": "Java", "bytes": "1182363"}, {"name": "JavaScript", "bytes": "18075"}]}} +{"text": "\n\n#import <UIKit/UIKit.h>\n\n@interface UICollectionView (TML)\n\n@end\n", "meta": {"content_hash": "388df23f9692a90fde50313160ff784d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 33, "avg_line_length": 9.571428571428571, "alnum_prop": 0.7164179104477612, "repo_name": "translationexchange/tml-objc", "id": "fa81ddd9ac430cf34294530983024abc2caae12b", "size": "1975", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Classes/Extensions/UICollectionView+TML.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "343086"}, {"name": "C++", "bytes": "19355"}, {"name": "Objective-C", "bytes": "1703946"}, {"name": "Ruby", "bytes": "10372"}, {"name": "Shell", "bytes": "11954"}]}} +{"text": "<?php\n\nnamespace Plivo\\Resources\\Message;\n\n\n\nuse Plivo\\Exceptions\\PlivoValidationException;\nuse Plivo\\Exceptions\\PlivoRestException;\nuse Plivo\\Exceptions\\PlivoResponseException;\nuse Plivo\\Util\\ArrayOperations;\nuse Plivo\\MessageClient;\nuse Plivo\\Resources\\ResourceInterface;\n\n/**\n * Class MessageInterface\n * @package Plivo\\Resources\\Message\n */\nclass MessageInterface extends ResourceInterface\n{\n /**\n * MessageInterface constructor.\n * @param MessageClient $plivoClient\n * @param $authId\n */\n public function __construct(MessageClient $plivoClient, $authId)\n {\n parent::__construct($plivoClient);\n $this->pathParams = [\n 'authId' => $authId\n ];\n $this->uri = \"Account/\".$authId.\"/Message/\";\n }\n\n\n /**\n * @param $messageUuid\n * @return Message\n * @throws PlivoValidationException\n */\n public function get($messageUuid)\n {\n if (ArrayOperations::checkNull([$messageUuid])) {\n throw\n new PlivoValidationException(\n 'message uuid is mandatory');\n }\n\n $response = $this->client->fetch(\n $this->uri . $messageUuid .'/',\n []\n );\n // return the object for chain method \n if ($response->getStatusCode() == 200){\n return new Message(\n $this->client, $response->getContent(),\n $this->pathParams['authId'], $this->uri);\n }\n return json_encode($response->getContent(), JSON_FORCE_OBJECT);\n }\n\n \n \n\n /**\n * Return a list of messages\n * @param array $optionalArgs\n * + Valid arguments\n * + [string] :subaccount - The id of the subaccount, if message details of the subaccount is needed.\n * + [string] :message_direction - Filter the results by message direction. The valid inputs are inbound and outbound.\n * + [string] :message_time - Filter out messages according to the time of completion. The filter can be used in the following five forms:\n * <br /> message_time: The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all messages that were sent/received at 2012-03-21 11:47[:30], use message_time=2012-03-21 11:47[:30]\n * <br /> message_time\\__gt: gt stands for greater than. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all messages that were sent/received after 2012-03-21 11:47, use message_time\\__gt=2012-03-21 11:47\n * <br /> message_time\\__gte: gte stands for greater than or equal. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all messages that were sent/received after or exactly at 2012-03-21 11:47[:30], use message_time\\__gte=2012-03-21 11:47[:30]\n * <br /> message_time\\__lt: lt stands for lesser than. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all messages that were sent/received before 2012-03-21 11:47, use message_time\\__lt=2012-03-21 11:47\n * <br /> message_time\\__lte: lte stands for lesser than or equal. The format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. Eg:- To get all messages that were sent/received before or exactly at 2012-03-21 11:47[:30], use message_time\\__lte=2012-03-21 11:47[:30]\n * <br /> Note: The above filters can be combined to get messages that were sent/received in a particular time range. The timestamps need to be UTC timestamps.\n * + [string] :message_state Status value of the message, is one of \"queued\", \"sent\", \"failed\", \"delivered\", \"undelivered\" or \"rejected\"\n * + [int] :limit Used to display the number of results per page. The maximum number of results that can be fetched is 20.\n * + [int] :offset Denotes the number of value items by which the results should be offset. Eg:- If the result contains a 1000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results.\n * + [string] :error_code Delivery Response code returned by the carrier attempting the delivery. See Supported error codes {https://www.plivo.com/docs/api/message/#standard-plivo-error-codes}.\n * + [string] : powerpack_id - Filter the results by Powerpack ID.\n * @return MessageList\n */\n protected function getList($optionalArgs = [])\n {\n $response = $this->client->fetch(\n $this->uri,\n $optionalArgs\n );\n if(!array_key_exists(\"error\", $response->getContent())) {\n $messages = [];\n foreach ($response->getContent()['objects'] as $message) {\n $newMessage = new Message($this->client, $message, $this->pathParams['authId'], $this->uri);\n array_push($messages, $newMessage);\n }\n return new MessageList($this->client, $response->getContent()['meta'], $messages);\n } else {\n throw new PlivoResponseException(\n $response->getContent()['error'],\n 0,\n null,\n $response->getContent(),\n $response->getStatusCode()\n );\n }\n }\n\n /**\n * Send a message\n *\n * @param string $src\n * @param array $dst\n * @param string $text\n * @param array $optionalArgs\n * + Valid arguments\n * + [string] :type - The type of message. Should be `sms` or `mms`. Defaults to `sms`.\n * + [string] :url - The URL to which with the status of the message is sent. The following parameters are sent to the URL:\n * <br /> To - Phone number of the recipient\n * <br /> From - Phone number of the sender\n * <br /> Status - Status of the message including \"queued\", \"sent\", \"failed\", \"delivered\", \"undelivered\" or \"rejected\"\n * <br /> MessageUUID - The unique ID for the message\n * <br /> ParentMessageUUID - ID of the parent message (see notes about long SMS below)\n * <br /> PartInfo - Specifies the sequence of the message (useful for long messages split into multiple text messages; see notes about long SMS below)\n * <br /> TotalRate - Total rate per sms\n * <br /> TotalAmount - Total cost of sending the sms (TotalRate * Units)\n * <br /> Units - Number of units into which a long SMS was split\n * <br /> MCC - Mobile Country Code (see here {https://en.wikipedia.org/wiki/Mobile_country_code} for more details)\n * <br /> MNC - Mobile Network Code (see here {https://en.wikipedia.org/wiki/Mobile_country_code} for more details)\n * <br /> ErrorCode - Delivery Response code returned by the carrier attempting the delivery. See Supported error codes {https://www.plivo.com/docs/api/message/#standard-plivo-error-codes}.\n * + [string] :method - The method used to call the url. Defaults to POST.\n * + [string] :log - If set to false, the content of this message will not be logged on the Plivo infrastructure and the dst value will be masked (e.g., 141XXXXX528). Default is set to true.\n * [list] : media_urls - If your sending mms message, you can specify the media urls like ['https://yourmedia_urls/test.jpg','https://test.com/test.gif']\n * @return MessageCreateResponse output\n * @throws PlivoValidationException,PlivoResponseException\n */\n // \n public function create($src=null, $dst=null, $text=null,array $optionalArgs = [], $powerpackUUID = null)\n {\n if (is_array($src))\n {\n $optionalArgs = array_merge($src, $optionalArgs);\n $src = isset($optionalArgs['src']) ? $optionalArgs['src'] : null;\n $dst = isset($optionalArgs['dst']) ? $optionalArgs['dst'] : null;\n $text = isset($optionalArgs['text']) ? $optionalArgs['text'] : null;\n $powerpackUUID = isset($optionalArgs['powerpackUUID']) ? $optionalArgs['powerpackUUID'] : null;\n } \n if (is_array($dst)){\n $mandatoryArgs = [\n 'dst' => implode('<', $dst),\n ];\n } \n else {\n $mandatoryArgs = ['dst' => $dst ];\n }\n \n\n if (ArrayOperations::checkNull($mandatoryArgs)) {\n throw new PlivoValidationException(\n \"Mandatory parameters cannot be null\");\n }\n\n if (is_null($src) && is_null($powerpackUUID)) {\n throw new PlivoValidationException(\n \"Specify either powerpack_uuid or src in request params to send a message.\"\n );\n }\n\n if (!is_null($src) && !is_null($powerpackUUID)) {\n throw new PlivoValidationException(\n \"Both powerpack_uuid and src cannot be specified. Specify either powerpack_uuid or src in request params to send a message.\"\n );\n }\n\n $response = $this->client->update(\n $this->uri,\n array_merge($mandatoryArgs, $optionalArgs, ['src' => $src, 'powerpack_uuid' => $powerpackUUID, 'text' => $text])\n );\n\n $responseContents = $response->getContent();\n \n if(!array_key_exists(\"error\",$responseContents)){\n if(array_key_exists(\"invalid_number\", $responseContents)){\n return new MessageCreateResponse(\n $responseContents['message'],\n $responseContents['message_uuid'],\n $responseContents['api_id'],\n $response->getStatusCode(),\n $responseContents['invalid_number']\n );\n }\n else{\n return new MessageCreateResponse(\n $responseContents['message'],\n $responseContents['message_uuid'],\n $responseContents['api_id'],\n $response->getStatusCode(),\n []\n );\n }\n } else {\n throw new PlivoResponseException(\n $responseContents['error'],\n 0,\n null,\n $response->getContent(),\n $response->getStatusCode()\n\n );\n }\n }\n\n}", "meta": {"content_hash": "f1d26b293a26e6f2bcf24c833cdad0b5", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 305, "avg_line_length": 48.806603773584904, "alnum_prop": 0.581907799362134, "repo_name": "plivo/plivo-php", "id": "cc7048d501d861705954d75e1bb72b168fa5923f", "size": "10347", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Plivo/Resources/Message/MessageInterface.php", "mode": "33188", "license": "mit", "language": [{"name": "Hack", "bytes": "7"}, {"name": "PHP", "bytes": "613664"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing SlimsteMens.Model.Entities;\nusing SlimsteMens.Model.Repositories;\n\nnamespace SlimsteMens.Model.Services\n{\n public class GalleryRoundService\n {\n private readonly IRepository<Gallery> _galleryRepository;\n private readonly Game _game;\n protected int GalleryNr;\n public int Correct { get; set; }\n public IList<Gallery> Galleries { get; set; }\n public int SecondsOnCorrect { get; set; }\n public IList<TurnType> PlayedAGallery { get; set; }\n public IList<TurnType> PlayedCurrentGallery { get; set; }\n\n /// <summary>\n /// Initializes a new instance of the <see cref=\"GalleryRoundService\" /> class.\n /// </summary>\n /// <param name=\"secondsOnCorrect\">The seconds on correct.</param>\n /// <param name=\"galleryRepository\">The gallery repository.</param>\n /// <param name=\"game\">The game.</param>\n /// <exception cref=\"System.ArgumentNullException\">\n /// galleryRepository\n /// or\n /// game\n /// </exception>\n /// <exception cref=\"System.ArgumentException\"></exception>\n public GalleryRoundService(int secondsOnCorrect, IRepository<Gallery> galleryRepository, Game game)\n {\n if (galleryRepository == null) throw new ArgumentNullException(\"galleryRepository\");\n if (game == null) throw new ArgumentNullException(\"game\");\n\n SecondsOnCorrect = secondsOnCorrect;\n _galleryRepository = galleryRepository;\n _game = game;\n PlayedAGallery = new List<TurnType>();\n PlayedCurrentGallery = new List<TurnType>();\n GalleryNr = 0;\n InitializeGalleries();\n }\n\n /// <summary>\n /// Retrieves the Next gallery.\n /// </summary>\n /// <returns></returns>\n public Gallery NextGallery()\n {\n if (GalleryNr >= Galleries.Count)\n return null;\n\n TurnType turn = _game.NextAndSetTurnByLowestTime(PlayedAGallery);\n Correct = 0;\n if (Galleries.Count == 0)\n return null;\n\n PlayedCurrentGallery = new List<TurnType>();\n PlayedAGallery.Add(turn);\n GalleryNr++;\n\n return Galleries[GalleryNr - 1];\n }\n\n private void InitializeGalleries()\n {\n List<long> ids;\n\n if (_galleryRepository.AsQueryable().Count(c => c.GalleryQuestions.All(g => !g.Played)) >= 3)\n {\n ids = _galleryRepository.AsQueryable().Where(c => c.GalleryQuestions.All(g => !g.Played)).Select(s => s.Id).Shuffle().Take(3).ToList();\n }\n else\n {\n ids = _galleryRepository.AsQueryable().Select(s => s.Id).Shuffle().Take(3).ToList();\n }\n\n Galleries = _galleryRepository.Query(g => ids.Any(id => id == g.Id)).Shuffle().ToList();\n\n if (Galleries.Count < 3)\n throw new InvalidOperationException(\"Need 3 galleries to continue\");\n\n Galleries.ToList().ForEach(g => g.GalleryQuestions.ToList().ForEach(gq => gq.Played = true));\n }\n }\n}\n", "meta": {"content_hash": "f7833770a733201ce3d327758b461cf8", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 151, "avg_line_length": 36.65909090909091, "alnum_prop": 0.5818350898946063, "repo_name": "ArneD/slimste-quiz", "id": "2e07f73a612ccf67f7291a49430b73dd2952fea4", "size": "3228", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SlimsteMens.Model/Services/GalleryRoundService.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "392933"}]}} +{"text": "Reflectors\n==========\n\n[](http://docs.ateliers-pierrot.fr/reflectors/)\n[](http://codeclimate.com/github/atelierspierrot/reflectors)\n\nSome PHP Reflectors objects to complete the [internal Reflection](http://php.net/manual/book.reflection.php).\nAll objects defined in this package implement the [\\Reflector interface](http://php.net/manual/class.reflector.php)\nand generate a simple output to keep compliant with existing internal reflection objects.\n\n\nInstallation\n------------\n\nFor a complete information about how to install this package and load its namespace, \nplease have a look at [our *USAGE* documentation](http://github.com/atelierspierrot/atelierspierrot/blob/master/USAGE.md).\n\nIf you are a [Composer](http://getcomposer.org/) user, just add the package to the \nrequirements of your project's `composer.json` manifest file:\n\n```json\n\"atelierspierrot/reflectors\": \"dev-master\"\n```\n\nYou can use a specific release or the latest release of a major version using the appropriate\n[version constraint](http://getcomposer.org/doc/01-basic-usage.md#package-versions).\n\n\nAuthor & License\n----------------\n\n> Reflectors\n\n> http://github.com/atelierspierrot/reflectors\n\n> Copyright (c) 2015-2016 Pierre Cassat and contributors\n\n> Licensed under the Apache 2 license.\n\n> http://www.apache.org/licenses/LICENSE-2.0\n\n> ----\n\n> Les Ateliers Pierrot - Paris, France\n\n> <http://www.ateliers-pierrot.fr/> - <contact@ateliers-pierrot.fr>\n", "meta": {"content_hash": "6736d4f1bfd33dc4888a850a0f305de6", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 148, "avg_line_length": 35.06521739130435, "alnum_prop": 0.7427154370737755, "repo_name": "atelierspierrot/reflectors", "id": "b9f1aee15933d9459c168eaced5b7aaef5437adc", "size": "1613", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "9418"}, {"name": "HTML", "bytes": "661624"}, {"name": "PHP", "bytes": "125665"}]}} +{"text": "// Code generated by protoc-gen-gogo.\n// source: combos/unsafemarshaler/types.proto\n// DO NOT EDIT!\n\n/*\nPackage types is a generated protocol buffer package.\n\nIt is generated from these files:\n\tcombos/unsafemarshaler/types.proto\n\nIt has these top-level messages:\n\tKnownTypes\n\tProtoTypes\n\tStdTypes\n\tRepProtoTypes\n\tRepStdTypes\n\tMapProtoTypes\n\tMapStdTypes\n\tOneofProtoTypes\n\tOneofStdTypes\n*/\npackage types\n\nimport proto \"github.com/gogo/protobuf/proto\"\nimport fmt \"fmt\"\nimport math \"math\"\nimport _ \"github.com/gogo/protobuf/gogoproto\"\nimport google_protobuf1 \"github.com/gogo/protobuf/types\"\nimport google_protobuf2 \"github.com/gogo/protobuf/types\"\nimport google_protobuf3 \"github.com/gogo/protobuf/types\"\n\nimport time \"time\"\nimport github_com_gogo_protobuf_types \"github.com/gogo/protobuf/types\"\n\n// Reference imports to suppress errors if they are not otherwise used.\nvar _ = proto.Marshal\nvar _ = fmt.Errorf\nvar _ = math.Inf\n\n// This is a compile-time assertion to ensure that this generated file\n// is compatible with the proto package it is being compiled against.\n// A compilation error at this line likely means your copy of the\n// proto package needs to be updated.\nconst _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package\n\ntype KnownTypes struct {\n\tDur *google_protobuf1.Duration `protobuf:\"bytes,1,opt,name=dur\" json:\"dur,omitempty\"`\n\tTs *google_protobuf2.Timestamp `protobuf:\"bytes,2,opt,name=ts\" json:\"ts,omitempty\"`\n\tDbl *google_protobuf3.DoubleValue `protobuf:\"bytes,3,opt,name=dbl\" json:\"dbl,omitempty\"`\n\tFlt *google_protobuf3.FloatValue `protobuf:\"bytes,4,opt,name=flt\" json:\"flt,omitempty\"`\n\tI64 *google_protobuf3.Int64Value `protobuf:\"bytes,5,opt,name=i64\" json:\"i64,omitempty\"`\n\tU64 *google_protobuf3.UInt64Value `protobuf:\"bytes,6,opt,name=u64\" json:\"u64,omitempty\"`\n\tI32 *google_protobuf3.Int32Value `protobuf:\"bytes,7,opt,name=i32\" json:\"i32,omitempty\"`\n\tU32 *google_protobuf3.UInt32Value `protobuf:\"bytes,8,opt,name=u32\" json:\"u32,omitempty\"`\n\tBool *google_protobuf3.BoolValue `protobuf:\"bytes,9,opt,name=bool\" json:\"bool,omitempty\"`\n\tStr *google_protobuf3.StringValue `protobuf:\"bytes,10,opt,name=str\" json:\"str,omitempty\"`\n\tBytes *google_protobuf3.BytesValue `protobuf:\"bytes,11,opt,name=bytes\" json:\"bytes,omitempty\"`\n}\n\nfunc (m *KnownTypes) Reset() { *m = KnownTypes{} }\nfunc (m *KnownTypes) String() string { return proto.CompactTextString(m) }\nfunc (*KnownTypes) ProtoMessage() {}\nfunc (*KnownTypes) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{0} }\n\nfunc (m *KnownTypes) GetDur() *google_protobuf1.Duration {\n\tif m != nil {\n\t\treturn m.Dur\n\t}\n\treturn nil\n}\n\nfunc (m *KnownTypes) GetTs() *google_protobuf2.Timestamp {\n\tif m != nil {\n\t\treturn m.Ts\n\t}\n\treturn nil\n}\n\nfunc (m *KnownTypes) GetDbl() *google_protobuf3.DoubleValue {\n\tif m != nil {\n\t\treturn m.Dbl\n\t}\n\treturn nil\n}\n\nfunc (m *KnownTypes) GetFlt() *google_protobuf3.FloatValue {\n\tif m != nil {\n\t\treturn m.Flt\n\t}\n\treturn nil\n}\n\nfunc (m *KnownTypes) GetI64() *google_protobuf3.Int64Value {\n\tif m != nil {\n\t\treturn m.I64\n\t}\n\treturn nil\n}\n\nfunc (m *KnownTypes) GetU64() *google_protobuf3.UInt64Value {\n\tif m != nil {\n\t\treturn m.U64\n\t}\n\treturn nil\n}\n\nfunc (m *KnownTypes) GetI32() *google_protobuf3.Int32Value {\n\tif m != nil {\n\t\treturn m.I32\n\t}\n\treturn nil\n}\n\nfunc (m *KnownTypes) GetU32() *google_protobuf3.UInt32Value {\n\tif m != nil {\n\t\treturn m.U32\n\t}\n\treturn nil\n}\n\nfunc (m *KnownTypes) GetBool() *google_protobuf3.BoolValue {\n\tif m != nil {\n\t\treturn m.Bool\n\t}\n\treturn nil\n}\n\nfunc (m *KnownTypes) GetStr() *google_protobuf3.StringValue {\n\tif m != nil {\n\t\treturn m.Str\n\t}\n\treturn nil\n}\n\nfunc (m *KnownTypes) GetBytes() *google_protobuf3.BytesValue {\n\tif m != nil {\n\t\treturn m.Bytes\n\t}\n\treturn nil\n}\n\ntype ProtoTypes struct {\n\tNullableTimestamp *google_protobuf2.Timestamp `protobuf:\"bytes,1,opt,name=nullableTimestamp\" json:\"nullableTimestamp,omitempty\"`\n\tNullableDuration *google_protobuf1.Duration `protobuf:\"bytes,2,opt,name=nullableDuration\" json:\"nullableDuration,omitempty\"`\n\tTimestamp google_protobuf2.Timestamp `protobuf:\"bytes,3,opt,name=timestamp\" json:\"timestamp\"`\n\tDuration google_protobuf1.Duration `protobuf:\"bytes,4,opt,name=duration\" json:\"duration\"`\n}\n\nfunc (m *ProtoTypes) Reset() { *m = ProtoTypes{} }\nfunc (m *ProtoTypes) String() string { return proto.CompactTextString(m) }\nfunc (*ProtoTypes) ProtoMessage() {}\nfunc (*ProtoTypes) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{1} }\n\nfunc (m *ProtoTypes) GetNullableTimestamp() *google_protobuf2.Timestamp {\n\tif m != nil {\n\t\treturn m.NullableTimestamp\n\t}\n\treturn nil\n}\n\nfunc (m *ProtoTypes) GetNullableDuration() *google_protobuf1.Duration {\n\tif m != nil {\n\t\treturn m.NullableDuration\n\t}\n\treturn nil\n}\n\nfunc (m *ProtoTypes) GetTimestamp() google_protobuf2.Timestamp {\n\tif m != nil {\n\t\treturn m.Timestamp\n\t}\n\treturn google_protobuf2.Timestamp{}\n}\n\nfunc (m *ProtoTypes) GetDuration() google_protobuf1.Duration {\n\tif m != nil {\n\t\treturn m.Duration\n\t}\n\treturn google_protobuf1.Duration{}\n}\n\ntype StdTypes struct {\n\tNullableTimestamp *time.Time `protobuf:\"bytes,1,opt,name=nullableTimestamp,stdtime\" json:\"nullableTimestamp,omitempty\"`\n\tNullableDuration *time.Duration `protobuf:\"bytes,2,opt,name=nullableDuration,stdduration\" json:\"nullableDuration,omitempty\"`\n\tTimestamp time.Time `protobuf:\"bytes,3,opt,name=timestamp,stdtime\" json:\"timestamp\"`\n\tDuration time.Duration `protobuf:\"bytes,4,opt,name=duration,stdduration\" json:\"duration\"`\n}\n\nfunc (m *StdTypes) Reset() { *m = StdTypes{} }\nfunc (m *StdTypes) String() string { return proto.CompactTextString(m) }\nfunc (*StdTypes) ProtoMessage() {}\nfunc (*StdTypes) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{2} }\n\nfunc (m *StdTypes) GetNullableTimestamp() *time.Time {\n\tif m != nil {\n\t\treturn m.NullableTimestamp\n\t}\n\treturn nil\n}\n\nfunc (m *StdTypes) GetNullableDuration() *time.Duration {\n\tif m != nil {\n\t\treturn m.NullableDuration\n\t}\n\treturn nil\n}\n\nfunc (m *StdTypes) GetTimestamp() time.Time {\n\tif m != nil {\n\t\treturn m.Timestamp\n\t}\n\treturn time.Time{}\n}\n\nfunc (m *StdTypes) GetDuration() time.Duration {\n\tif m != nil {\n\t\treturn m.Duration\n\t}\n\treturn 0\n}\n\ntype RepProtoTypes struct {\n\tNullableTimestamps []*google_protobuf2.Timestamp `protobuf:\"bytes,1,rep,name=nullableTimestamps\" json:\"nullableTimestamps,omitempty\"`\n\tNullableDurations []*google_protobuf1.Duration `protobuf:\"bytes,2,rep,name=nullableDurations\" json:\"nullableDurations,omitempty\"`\n\tTimestamps []google_protobuf2.Timestamp `protobuf:\"bytes,3,rep,name=timestamps\" json:\"timestamps\"`\n\tDurations []google_protobuf1.Duration `protobuf:\"bytes,4,rep,name=durations\" json:\"durations\"`\n}\n\nfunc (m *RepProtoTypes) Reset() { *m = RepProtoTypes{} }\nfunc (m *RepProtoTypes) String() string { return proto.CompactTextString(m) }\nfunc (*RepProtoTypes) ProtoMessage() {}\nfunc (*RepProtoTypes) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{3} }\n\nfunc (m *RepProtoTypes) GetNullableTimestamps() []*google_protobuf2.Timestamp {\n\tif m != nil {\n\t\treturn m.NullableTimestamps\n\t}\n\treturn nil\n}\n\nfunc (m *RepProtoTypes) GetNullableDurations() []*google_protobuf1.Duration {\n\tif m != nil {\n\t\treturn m.NullableDurations\n\t}\n\treturn nil\n}\n\nfunc (m *RepProtoTypes) GetTimestamps() []google_protobuf2.Timestamp {\n\tif m != nil {\n\t\treturn m.Timestamps\n\t}\n\treturn nil\n}\n\nfunc (m *RepProtoTypes) GetDurations() []google_protobuf1.Duration {\n\tif m != nil {\n\t\treturn m.Durations\n\t}\n\treturn nil\n}\n\ntype RepStdTypes struct {\n\tNullableTimestamps []*time.Time `protobuf:\"bytes,1,rep,name=nullableTimestamps,stdtime\" json:\"nullableTimestamps,omitempty\"`\n\tNullableDurations []*time.Duration `protobuf:\"bytes,2,rep,name=nullableDurations,stdduration\" json:\"nullableDurations,omitempty\"`\n\tTimestamps []time.Time `protobuf:\"bytes,3,rep,name=timestamps,stdtime\" json:\"timestamps\"`\n\tDurations []time.Duration `protobuf:\"bytes,4,rep,name=durations,stdduration\" json:\"durations\"`\n}\n\nfunc (m *RepStdTypes) Reset() { *m = RepStdTypes{} }\nfunc (m *RepStdTypes) String() string { return proto.CompactTextString(m) }\nfunc (*RepStdTypes) ProtoMessage() {}\nfunc (*RepStdTypes) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{4} }\n\nfunc (m *RepStdTypes) GetNullableTimestamps() []*time.Time {\n\tif m != nil {\n\t\treturn m.NullableTimestamps\n\t}\n\treturn nil\n}\n\nfunc (m *RepStdTypes) GetNullableDurations() []*time.Duration {\n\tif m != nil {\n\t\treturn m.NullableDurations\n\t}\n\treturn nil\n}\n\nfunc (m *RepStdTypes) GetTimestamps() []time.Time {\n\tif m != nil {\n\t\treturn m.Timestamps\n\t}\n\treturn nil\n}\n\nfunc (m *RepStdTypes) GetDurations() []time.Duration {\n\tif m != nil {\n\t\treturn m.Durations\n\t}\n\treturn nil\n}\n\ntype MapProtoTypes struct {\n\tNullableTimestamp map[int32]*google_protobuf2.Timestamp `protobuf:\"bytes,1,rep,name=nullableTimestamp\" json:\"nullableTimestamp,omitempty\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value\"`\n\tTimestamp map[int32]google_protobuf2.Timestamp `protobuf:\"bytes,2,rep,name=timestamp\" json:\"timestamp\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value\"`\n\tNullableDuration map[int32]*google_protobuf1.Duration `protobuf:\"bytes,3,rep,name=nullableDuration\" json:\"nullableDuration,omitempty\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value\"`\n\tDuration map[int32]google_protobuf1.Duration `protobuf:\"bytes,4,rep,name=duration\" json:\"duration\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value\"`\n}\n\nfunc (m *MapProtoTypes) Reset() { *m = MapProtoTypes{} }\nfunc (m *MapProtoTypes) String() string { return proto.CompactTextString(m) }\nfunc (*MapProtoTypes) ProtoMessage() {}\nfunc (*MapProtoTypes) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{5} }\n\nfunc (m *MapProtoTypes) GetNullableTimestamp() map[int32]*google_protobuf2.Timestamp {\n\tif m != nil {\n\t\treturn m.NullableTimestamp\n\t}\n\treturn nil\n}\n\nfunc (m *MapProtoTypes) GetTimestamp() map[int32]google_protobuf2.Timestamp {\n\tif m != nil {\n\t\treturn m.Timestamp\n\t}\n\treturn nil\n}\n\nfunc (m *MapProtoTypes) GetNullableDuration() map[int32]*google_protobuf1.Duration {\n\tif m != nil {\n\t\treturn m.NullableDuration\n\t}\n\treturn nil\n}\n\nfunc (m *MapProtoTypes) GetDuration() map[int32]google_protobuf1.Duration {\n\tif m != nil {\n\t\treturn m.Duration\n\t}\n\treturn nil\n}\n\ntype MapStdTypes struct {\n\tNullableTimestamp map[int32]*time.Time `protobuf:\"bytes,1,rep,name=nullableTimestamp,stdtime\" json:\"nullableTimestamp,omitempty\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value\"`\n\tTimestamp map[int32]time.Time `protobuf:\"bytes,2,rep,name=timestamp,stdtime\" json:\"timestamp\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value\"`\n\tNullableDuration map[int32]*time.Duration `protobuf:\"bytes,3,rep,name=nullableDuration,stdduration\" json:\"nullableDuration,omitempty\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value\"`\n\tDuration map[int32]time.Duration `protobuf:\"bytes,4,rep,name=duration,stdduration\" json:\"duration\" protobuf_key:\"varint,1,opt,name=key,proto3\" protobuf_val:\"bytes,2,opt,name=value\"`\n}\n\nfunc (m *MapStdTypes) Reset() { *m = MapStdTypes{} }\nfunc (m *MapStdTypes) String() string { return proto.CompactTextString(m) }\nfunc (*MapStdTypes) ProtoMessage() {}\nfunc (*MapStdTypes) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{6} }\n\nfunc (m *MapStdTypes) GetNullableTimestamp() map[int32]*time.Time {\n\tif m != nil {\n\t\treturn m.NullableTimestamp\n\t}\n\treturn nil\n}\n\nfunc (m *MapStdTypes) GetTimestamp() map[int32]time.Time {\n\tif m != nil {\n\t\treturn m.Timestamp\n\t}\n\treturn nil\n}\n\nfunc (m *MapStdTypes) GetNullableDuration() map[int32]*time.Duration {\n\tif m != nil {\n\t\treturn m.NullableDuration\n\t}\n\treturn nil\n}\n\nfunc (m *MapStdTypes) GetDuration() map[int32]time.Duration {\n\tif m != nil {\n\t\treturn m.Duration\n\t}\n\treturn nil\n}\n\ntype OneofProtoTypes struct {\n\t// Types that are valid to be assigned to OneOfProtoTimes:\n\t//\t*OneofProtoTypes_Timestamp\n\t//\t*OneofProtoTypes_Duration\n\tOneOfProtoTimes isOneofProtoTypes_OneOfProtoTimes `protobuf_oneof:\"OneOfProtoTimes\"`\n}\n\nfunc (m *OneofProtoTypes) Reset() { *m = OneofProtoTypes{} }\nfunc (m *OneofProtoTypes) String() string { return proto.CompactTextString(m) }\nfunc (*OneofProtoTypes) ProtoMessage() {}\nfunc (*OneofProtoTypes) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{7} }\n\ntype isOneofProtoTypes_OneOfProtoTimes interface {\n\tisOneofProtoTypes_OneOfProtoTimes()\n\tEqual(interface{}) bool\n\tVerboseEqual(interface{}) error\n\tMarshalTo([]byte) (int, error)\n\tSize() int\n}\n\ntype OneofProtoTypes_Timestamp struct {\n\tTimestamp *google_protobuf2.Timestamp `protobuf:\"bytes,1,opt,name=timestamp,oneof\"`\n}\ntype OneofProtoTypes_Duration struct {\n\tDuration *google_protobuf1.Duration `protobuf:\"bytes,2,opt,name=duration,oneof\"`\n}\n\nfunc (*OneofProtoTypes_Timestamp) isOneofProtoTypes_OneOfProtoTimes() {}\nfunc (*OneofProtoTypes_Duration) isOneofProtoTypes_OneOfProtoTimes() {}\n\nfunc (m *OneofProtoTypes) GetOneOfProtoTimes() isOneofProtoTypes_OneOfProtoTimes {\n\tif m != nil {\n\t\treturn m.OneOfProtoTimes\n\t}\n\treturn nil\n}\n\nfunc (m *OneofProtoTypes) GetTimestamp() *google_protobuf2.Timestamp {\n\tif x, ok := m.GetOneOfProtoTimes().(*OneofProtoTypes_Timestamp); ok {\n\t\treturn x.Timestamp\n\t}\n\treturn nil\n}\n\nfunc (m *OneofProtoTypes) GetDuration() *google_protobuf1.Duration {\n\tif x, ok := m.GetOneOfProtoTimes().(*OneofProtoTypes_Duration); ok {\n\t\treturn x.Duration\n\t}\n\treturn nil\n}\n\n// XXX_OneofFuncs is for the internal use of the proto package.\nfunc (*OneofProtoTypes) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _OneofProtoTypes_OneofMarshaler, _OneofProtoTypes_OneofUnmarshaler, _OneofProtoTypes_OneofSizer, []interface{}{\n\t\t(*OneofProtoTypes_Timestamp)(nil),\n\t\t(*OneofProtoTypes_Duration)(nil),\n\t}\n}\n\nfunc _OneofProtoTypes_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {\n\tm := msg.(*OneofProtoTypes)\n\t// OneOfProtoTimes\n\tswitch x := m.OneOfProtoTimes.(type) {\n\tcase *OneofProtoTypes_Timestamp:\n\t\t_ = b.EncodeVarint(1<<3 | proto.WireBytes)\n\t\tif err := b.EncodeMessage(x.Timestamp); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase *OneofProtoTypes_Duration:\n\t\t_ = b.EncodeVarint(2<<3 | proto.WireBytes)\n\t\tif err := b.EncodeMessage(x.Duration); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase nil:\n\tdefault:\n\t\treturn fmt.Errorf(\"OneofProtoTypes.OneOfProtoTimes has unexpected type %T\", x)\n\t}\n\treturn nil\n}\n\nfunc _OneofProtoTypes_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {\n\tm := msg.(*OneofProtoTypes)\n\tswitch tag {\n\tcase 1: // OneOfProtoTimes.timestamp\n\t\tif wire != proto.WireBytes {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tmsg := new(google_protobuf2.Timestamp)\n\t\terr := b.DecodeMessage(msg)\n\t\tm.OneOfProtoTimes = &OneofProtoTypes_Timestamp{msg}\n\t\treturn true, err\n\tcase 2: // OneOfProtoTimes.duration\n\t\tif wire != proto.WireBytes {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tmsg := new(google_protobuf1.Duration)\n\t\terr := b.DecodeMessage(msg)\n\t\tm.OneOfProtoTimes = &OneofProtoTypes_Duration{msg}\n\t\treturn true, err\n\tdefault:\n\t\treturn false, nil\n\t}\n}\n\nfunc _OneofProtoTypes_OneofSizer(msg proto.Message) (n int) {\n\tm := msg.(*OneofProtoTypes)\n\t// OneOfProtoTimes\n\tswitch x := m.OneOfProtoTimes.(type) {\n\tcase *OneofProtoTypes_Timestamp:\n\t\ts := proto.Size(x.Timestamp)\n\t\tn += proto.SizeVarint(1<<3 | proto.WireBytes)\n\t\tn += proto.SizeVarint(uint64(s))\n\t\tn += s\n\tcase *OneofProtoTypes_Duration:\n\t\ts := proto.Size(x.Duration)\n\t\tn += proto.SizeVarint(2<<3 | proto.WireBytes)\n\t\tn += proto.SizeVarint(uint64(s))\n\t\tn += s\n\tcase nil:\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"proto: unexpected type %T in oneof\", x))\n\t}\n\treturn n\n}\n\ntype OneofStdTypes struct {\n\t// Types that are valid to be assigned to OneOfStdTimes:\n\t//\t*OneofStdTypes_Timestamp\n\t//\t*OneofStdTypes_Duration\n\tOneOfStdTimes isOneofStdTypes_OneOfStdTimes `protobuf_oneof:\"OneOfStdTimes\"`\n}\n\nfunc (m *OneofStdTypes) Reset() { *m = OneofStdTypes{} }\nfunc (m *OneofStdTypes) String() string { return proto.CompactTextString(m) }\nfunc (*OneofStdTypes) ProtoMessage() {}\nfunc (*OneofStdTypes) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{8} }\n\ntype isOneofStdTypes_OneOfStdTimes interface {\n\tisOneofStdTypes_OneOfStdTimes()\n\tEqual(interface{}) bool\n\tVerboseEqual(interface{}) error\n\tMarshalTo([]byte) (int, error)\n\tSize() int\n}\n\ntype OneofStdTypes_Timestamp struct {\n\tTimestamp *time.Time `protobuf:\"bytes,1,opt,name=timestamp,oneof,stdtime\"`\n}\ntype OneofStdTypes_Duration struct {\n\tDuration *time.Duration `protobuf:\"bytes,2,opt,name=duration,oneof,stdduration\"`\n}\n\nfunc (*OneofStdTypes_Timestamp) isOneofStdTypes_OneOfStdTimes() {}\nfunc (*OneofStdTypes_Duration) isOneofStdTypes_OneOfStdTimes() {}\n\nfunc (m *OneofStdTypes) GetOneOfStdTimes() isOneofStdTypes_OneOfStdTimes {\n\tif m != nil {\n\t\treturn m.OneOfStdTimes\n\t}\n\treturn nil\n}\n\nfunc (m *OneofStdTypes) GetTimestamp() *time.Time {\n\tif x, ok := m.GetOneOfStdTimes().(*OneofStdTypes_Timestamp); ok {\n\t\treturn x.Timestamp\n\t}\n\treturn nil\n}\n\nfunc (m *OneofStdTypes) GetDuration() *time.Duration {\n\tif x, ok := m.GetOneOfStdTimes().(*OneofStdTypes_Duration); ok {\n\t\treturn x.Duration\n\t}\n\treturn nil\n}\n\n// XXX_OneofFuncs is for the internal use of the proto package.\nfunc (*OneofStdTypes) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {\n\treturn _OneofStdTypes_OneofMarshaler, _OneofStdTypes_OneofUnmarshaler, _OneofStdTypes_OneofSizer, []interface{}{\n\t\t(*OneofStdTypes_Timestamp)(nil),\n\t\t(*OneofStdTypes_Duration)(nil),\n\t}\n}\n\nfunc _OneofStdTypes_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {\n\tm := msg.(*OneofStdTypes)\n\t// OneOfStdTimes\n\tswitch x := m.OneOfStdTimes.(type) {\n\tcase *OneofStdTypes_Timestamp:\n\t\t_ = b.EncodeVarint(1<<3 | proto.WireBytes)\n\t\tdata, err := github_com_gogo_protobuf_types.StdTimeMarshal(*x.Timestamp)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := b.EncodeRawBytes(data); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase *OneofStdTypes_Duration:\n\t\t_ = b.EncodeVarint(2<<3 | proto.WireBytes)\n\t\tdata, err := github_com_gogo_protobuf_types.StdDurationMarshal(*x.Duration)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := b.EncodeRawBytes(data); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase nil:\n\tdefault:\n\t\treturn fmt.Errorf(\"OneofStdTypes.OneOfStdTimes has unexpected type %T\", x)\n\t}\n\treturn nil\n}\n\nfunc _OneofStdTypes_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {\n\tm := msg.(*OneofStdTypes)\n\tswitch tag {\n\tcase 1: // OneOfStdTimes.timestamp\n\t\tif wire != proto.WireBytes {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tx, err := b.DecodeRawBytes(true)\n\t\tif err != nil {\n\t\t\treturn true, err\n\t\t}\n\t\tc := new(time.Time)\n\t\tif err2 := github_com_gogo_protobuf_types.StdTimeUnmarshal(c, x); err2 != nil {\n\t\t\treturn true, err\n\t\t}\n\t\tm.OneOfStdTimes = &OneofStdTypes_Timestamp{c}\n\t\treturn true, err\n\tcase 2: // OneOfStdTimes.duration\n\t\tif wire != proto.WireBytes {\n\t\t\treturn true, proto.ErrInternalBadWireType\n\t\t}\n\t\tx, err := b.DecodeRawBytes(true)\n\t\tif err != nil {\n\t\t\treturn true, err\n\t\t}\n\t\tc := new(time.Duration)\n\t\tif err2 := github_com_gogo_protobuf_types.StdDurationUnmarshal(c, x); err2 != nil {\n\t\t\treturn true, err\n\t\t}\n\t\tm.OneOfStdTimes = &OneofStdTypes_Duration{c}\n\t\treturn true, err\n\tdefault:\n\t\treturn false, nil\n\t}\n}\n\nfunc _OneofStdTypes_OneofSizer(msg proto.Message) (n int) {\n\tm := msg.(*OneofStdTypes)\n\t// OneOfStdTimes\n\tswitch x := m.OneOfStdTimes.(type) {\n\tcase *OneofStdTypes_Timestamp:\n\t\ts := github_com_gogo_protobuf_types.SizeOfStdTime(*x.Timestamp)\n\t\tn += proto.SizeVarint(1<<3 | proto.WireBytes)\n\t\tn += proto.SizeVarint(uint64(s))\n\t\tn += s\n\tcase *OneofStdTypes_Duration:\n\t\ts := github_com_gogo_protobuf_types.SizeOfStdDuration(*x.Duration)\n\t\tn += proto.SizeVarint(2<<3 | proto.WireBytes)\n\t\tn += proto.SizeVarint(uint64(s))\n\t\tn += s\n\tcase nil:\n\tdefault:\n\t\tpanic(fmt.Sprintf(\"proto: unexpected type %T in oneof\", x))\n\t}\n\treturn n\n}\n\nfunc init() {\n\tproto.RegisterType((*KnownTypes)(nil), \"types.KnownTypes\")\n\tproto.RegisterType((*ProtoTypes)(nil), \"types.ProtoTypes\")\n\tproto.RegisterType((*StdTypes)(nil), \"types.StdTypes\")\n\tproto.RegisterType((*RepProtoTypes)(nil), \"types.RepProtoTypes\")\n\tproto.RegisterType((*RepStdTypes)(nil), \"types.RepStdTypes\")\n\tproto.RegisterType((*MapProtoTypes)(nil), \"types.MapProtoTypes\")\n\tproto.RegisterType((*MapStdTypes)(nil), \"types.MapStdTypes\")\n\tproto.RegisterType((*OneofProtoTypes)(nil), \"types.OneofProtoTypes\")\n\tproto.RegisterType((*OneofStdTypes)(nil), \"types.OneofStdTypes\")\n}\nfunc (this *KnownTypes) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*KnownTypes)\n\tif !ok {\n\t\tthat2, ok := that.(KnownTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *KnownTypes\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *KnownTypes but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *KnownTypes but is not nil && this == nil\")\n\t}\n\tif !this.Dur.Equal(that1.Dur) {\n\t\treturn fmt.Errorf(\"Dur this(%v) Not Equal that(%v)\", this.Dur, that1.Dur)\n\t}\n\tif !this.Ts.Equal(that1.Ts) {\n\t\treturn fmt.Errorf(\"Ts this(%v) Not Equal that(%v)\", this.Ts, that1.Ts)\n\t}\n\tif !this.Dbl.Equal(that1.Dbl) {\n\t\treturn fmt.Errorf(\"Dbl this(%v) Not Equal that(%v)\", this.Dbl, that1.Dbl)\n\t}\n\tif !this.Flt.Equal(that1.Flt) {\n\t\treturn fmt.Errorf(\"Flt this(%v) Not Equal that(%v)\", this.Flt, that1.Flt)\n\t}\n\tif !this.I64.Equal(that1.I64) {\n\t\treturn fmt.Errorf(\"I64 this(%v) Not Equal that(%v)\", this.I64, that1.I64)\n\t}\n\tif !this.U64.Equal(that1.U64) {\n\t\treturn fmt.Errorf(\"U64 this(%v) Not Equal that(%v)\", this.U64, that1.U64)\n\t}\n\tif !this.I32.Equal(that1.I32) {\n\t\treturn fmt.Errorf(\"I32 this(%v) Not Equal that(%v)\", this.I32, that1.I32)\n\t}\n\tif !this.U32.Equal(that1.U32) {\n\t\treturn fmt.Errorf(\"U32 this(%v) Not Equal that(%v)\", this.U32, that1.U32)\n\t}\n\tif !this.Bool.Equal(that1.Bool) {\n\t\treturn fmt.Errorf(\"Bool this(%v) Not Equal that(%v)\", this.Bool, that1.Bool)\n\t}\n\tif !this.Str.Equal(that1.Str) {\n\t\treturn fmt.Errorf(\"Str this(%v) Not Equal that(%v)\", this.Str, that1.Str)\n\t}\n\tif !this.Bytes.Equal(that1.Bytes) {\n\t\treturn fmt.Errorf(\"Bytes this(%v) Not Equal that(%v)\", this.Bytes, that1.Bytes)\n\t}\n\treturn nil\n}\nfunc (this *KnownTypes) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*KnownTypes)\n\tif !ok {\n\t\tthat2, ok := that.(KnownTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif !this.Dur.Equal(that1.Dur) {\n\t\treturn false\n\t}\n\tif !this.Ts.Equal(that1.Ts) {\n\t\treturn false\n\t}\n\tif !this.Dbl.Equal(that1.Dbl) {\n\t\treturn false\n\t}\n\tif !this.Flt.Equal(that1.Flt) {\n\t\treturn false\n\t}\n\tif !this.I64.Equal(that1.I64) {\n\t\treturn false\n\t}\n\tif !this.U64.Equal(that1.U64) {\n\t\treturn false\n\t}\n\tif !this.I32.Equal(that1.I32) {\n\t\treturn false\n\t}\n\tif !this.U32.Equal(that1.U32) {\n\t\treturn false\n\t}\n\tif !this.Bool.Equal(that1.Bool) {\n\t\treturn false\n\t}\n\tif !this.Str.Equal(that1.Str) {\n\t\treturn false\n\t}\n\tif !this.Bytes.Equal(that1.Bytes) {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc (this *ProtoTypes) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*ProtoTypes)\n\tif !ok {\n\t\tthat2, ok := that.(ProtoTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *ProtoTypes\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *ProtoTypes but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *ProtoTypes but is not nil && this == nil\")\n\t}\n\tif !this.NullableTimestamp.Equal(that1.NullableTimestamp) {\n\t\treturn fmt.Errorf(\"NullableTimestamp this(%v) Not Equal that(%v)\", this.NullableTimestamp, that1.NullableTimestamp)\n\t}\n\tif !this.NullableDuration.Equal(that1.NullableDuration) {\n\t\treturn fmt.Errorf(\"NullableDuration this(%v) Not Equal that(%v)\", this.NullableDuration, that1.NullableDuration)\n\t}\n\tif !this.Timestamp.Equal(&that1.Timestamp) {\n\t\treturn fmt.Errorf(\"Timestamp this(%v) Not Equal that(%v)\", this.Timestamp, that1.Timestamp)\n\t}\n\tif !this.Duration.Equal(&that1.Duration) {\n\t\treturn fmt.Errorf(\"Duration this(%v) Not Equal that(%v)\", this.Duration, that1.Duration)\n\t}\n\treturn nil\n}\nfunc (this *ProtoTypes) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*ProtoTypes)\n\tif !ok {\n\t\tthat2, ok := that.(ProtoTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif !this.NullableTimestamp.Equal(that1.NullableTimestamp) {\n\t\treturn false\n\t}\n\tif !this.NullableDuration.Equal(that1.NullableDuration) {\n\t\treturn false\n\t}\n\tif !this.Timestamp.Equal(&that1.Timestamp) {\n\t\treturn false\n\t}\n\tif !this.Duration.Equal(&that1.Duration) {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc (this *StdTypes) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*StdTypes)\n\tif !ok {\n\t\tthat2, ok := that.(StdTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *StdTypes\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *StdTypes but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *StdTypes but is not nil && this == nil\")\n\t}\n\tif that1.NullableTimestamp == nil {\n\t\tif this.NullableTimestamp != nil {\n\t\t\treturn fmt.Errorf(\"this.NullableTimestamp != nil && that1.NullableTimestamp == nil\")\n\t\t}\n\t} else if !this.NullableTimestamp.Equal(*that1.NullableTimestamp) {\n\t\treturn fmt.Errorf(\"NullableTimestamp this(%v) Not Equal that(%v)\", this.NullableTimestamp, that1.NullableTimestamp)\n\t}\n\tif this.NullableDuration != nil && that1.NullableDuration != nil {\n\t\tif *this.NullableDuration != *that1.NullableDuration {\n\t\t\treturn fmt.Errorf(\"NullableDuration this(%v) Not Equal that(%v)\", *this.NullableDuration, *that1.NullableDuration)\n\t\t}\n\t} else if this.NullableDuration != nil {\n\t\treturn fmt.Errorf(\"this.NullableDuration == nil && that.NullableDuration != nil\")\n\t} else if that1.NullableDuration != nil {\n\t\treturn fmt.Errorf(\"NullableDuration this(%v) Not Equal that(%v)\", this.NullableDuration, that1.NullableDuration)\n\t}\n\tif !this.Timestamp.Equal(that1.Timestamp) {\n\t\treturn fmt.Errorf(\"Timestamp this(%v) Not Equal that(%v)\", this.Timestamp, that1.Timestamp)\n\t}\n\tif this.Duration != that1.Duration {\n\t\treturn fmt.Errorf(\"Duration this(%v) Not Equal that(%v)\", this.Duration, that1.Duration)\n\t}\n\treturn nil\n}\nfunc (this *StdTypes) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*StdTypes)\n\tif !ok {\n\t\tthat2, ok := that.(StdTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif that1.NullableTimestamp == nil {\n\t\tif this.NullableTimestamp != nil {\n\t\t\treturn false\n\t\t}\n\t} else if !this.NullableTimestamp.Equal(*that1.NullableTimestamp) {\n\t\treturn false\n\t}\n\tif this.NullableDuration != nil && that1.NullableDuration != nil {\n\t\tif *this.NullableDuration != *that1.NullableDuration {\n\t\t\treturn false\n\t\t}\n\t} else if this.NullableDuration != nil {\n\t\treturn false\n\t} else if that1.NullableDuration != nil {\n\t\treturn false\n\t}\n\tif !this.Timestamp.Equal(that1.Timestamp) {\n\t\treturn false\n\t}\n\tif this.Duration != that1.Duration {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc (this *RepProtoTypes) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*RepProtoTypes)\n\tif !ok {\n\t\tthat2, ok := that.(RepProtoTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *RepProtoTypes\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *RepProtoTypes but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *RepProtoTypes but is not nil && this == nil\")\n\t}\n\tif len(this.NullableTimestamps) != len(that1.NullableTimestamps) {\n\t\treturn fmt.Errorf(\"NullableTimestamps this(%v) Not Equal that(%v)\", len(this.NullableTimestamps), len(that1.NullableTimestamps))\n\t}\n\tfor i := range this.NullableTimestamps {\n\t\tif !this.NullableTimestamps[i].Equal(that1.NullableTimestamps[i]) {\n\t\t\treturn fmt.Errorf(\"NullableTimestamps this[%v](%v) Not Equal that[%v](%v)\", i, this.NullableTimestamps[i], i, that1.NullableTimestamps[i])\n\t\t}\n\t}\n\tif len(this.NullableDurations) != len(that1.NullableDurations) {\n\t\treturn fmt.Errorf(\"NullableDurations this(%v) Not Equal that(%v)\", len(this.NullableDurations), len(that1.NullableDurations))\n\t}\n\tfor i := range this.NullableDurations {\n\t\tif !this.NullableDurations[i].Equal(that1.NullableDurations[i]) {\n\t\t\treturn fmt.Errorf(\"NullableDurations this[%v](%v) Not Equal that[%v](%v)\", i, this.NullableDurations[i], i, that1.NullableDurations[i])\n\t\t}\n\t}\n\tif len(this.Timestamps) != len(that1.Timestamps) {\n\t\treturn fmt.Errorf(\"Timestamps this(%v) Not Equal that(%v)\", len(this.Timestamps), len(that1.Timestamps))\n\t}\n\tfor i := range this.Timestamps {\n\t\tif !this.Timestamps[i].Equal(&that1.Timestamps[i]) {\n\t\t\treturn fmt.Errorf(\"Timestamps this[%v](%v) Not Equal that[%v](%v)\", i, this.Timestamps[i], i, that1.Timestamps[i])\n\t\t}\n\t}\n\tif len(this.Durations) != len(that1.Durations) {\n\t\treturn fmt.Errorf(\"Durations this(%v) Not Equal that(%v)\", len(this.Durations), len(that1.Durations))\n\t}\n\tfor i := range this.Durations {\n\t\tif !this.Durations[i].Equal(&that1.Durations[i]) {\n\t\t\treturn fmt.Errorf(\"Durations this[%v](%v) Not Equal that[%v](%v)\", i, this.Durations[i], i, that1.Durations[i])\n\t\t}\n\t}\n\treturn nil\n}\nfunc (this *RepProtoTypes) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*RepProtoTypes)\n\tif !ok {\n\t\tthat2, ok := that.(RepProtoTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif len(this.NullableTimestamps) != len(that1.NullableTimestamps) {\n\t\treturn false\n\t}\n\tfor i := range this.NullableTimestamps {\n\t\tif !this.NullableTimestamps[i].Equal(that1.NullableTimestamps[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.NullableDurations) != len(that1.NullableDurations) {\n\t\treturn false\n\t}\n\tfor i := range this.NullableDurations {\n\t\tif !this.NullableDurations[i].Equal(that1.NullableDurations[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.Timestamps) != len(that1.Timestamps) {\n\t\treturn false\n\t}\n\tfor i := range this.Timestamps {\n\t\tif !this.Timestamps[i].Equal(&that1.Timestamps[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.Durations) != len(that1.Durations) {\n\t\treturn false\n\t}\n\tfor i := range this.Durations {\n\t\tif !this.Durations[i].Equal(&that1.Durations[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\nfunc (this *RepStdTypes) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*RepStdTypes)\n\tif !ok {\n\t\tthat2, ok := that.(RepStdTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *RepStdTypes\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *RepStdTypes but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *RepStdTypes but is not nil && this == nil\")\n\t}\n\tif len(this.NullableTimestamps) != len(that1.NullableTimestamps) {\n\t\treturn fmt.Errorf(\"NullableTimestamps this(%v) Not Equal that(%v)\", len(this.NullableTimestamps), len(that1.NullableTimestamps))\n\t}\n\tfor i := range this.NullableTimestamps {\n\t\tif !this.NullableTimestamps[i].Equal(*that1.NullableTimestamps[i]) {\n\t\t\treturn fmt.Errorf(\"NullableTimestamps this[%v](%v) Not Equal that[%v](%v)\", i, this.NullableTimestamps[i], i, that1.NullableTimestamps[i])\n\t\t}\n\t}\n\tif len(this.NullableDurations) != len(that1.NullableDurations) {\n\t\treturn fmt.Errorf(\"NullableDurations this(%v) Not Equal that(%v)\", len(this.NullableDurations), len(that1.NullableDurations))\n\t}\n\tfor i := range this.NullableDurations {\n\t\tif dthis, dthat := this.NullableDurations[i], that1.NullableDurations[i]; (dthis != nil && dthat != nil && *dthis != *dthat) || (dthis != nil && dthat == nil) || (dthis == nil && dthat != nil) {\n\t\t\treturn fmt.Errorf(\"NullableDurations this[%v](%v) Not Equal that[%v](%v)\", i, this.NullableDurations[i], i, that1.NullableDurations[i])\n\t\t}\n\t}\n\tif len(this.Timestamps) != len(that1.Timestamps) {\n\t\treturn fmt.Errorf(\"Timestamps this(%v) Not Equal that(%v)\", len(this.Timestamps), len(that1.Timestamps))\n\t}\n\tfor i := range this.Timestamps {\n\t\tif !this.Timestamps[i].Equal(that1.Timestamps[i]) {\n\t\t\treturn fmt.Errorf(\"Timestamps this[%v](%v) Not Equal that[%v](%v)\", i, this.Timestamps[i], i, that1.Timestamps[i])\n\t\t}\n\t}\n\tif len(this.Durations) != len(that1.Durations) {\n\t\treturn fmt.Errorf(\"Durations this(%v) Not Equal that(%v)\", len(this.Durations), len(that1.Durations))\n\t}\n\tfor i := range this.Durations {\n\t\tif this.Durations[i] != that1.Durations[i] {\n\t\t\treturn fmt.Errorf(\"Durations this[%v](%v) Not Equal that[%v](%v)\", i, this.Durations[i], i, that1.Durations[i])\n\t\t}\n\t}\n\treturn nil\n}\nfunc (this *RepStdTypes) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*RepStdTypes)\n\tif !ok {\n\t\tthat2, ok := that.(RepStdTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif len(this.NullableTimestamps) != len(that1.NullableTimestamps) {\n\t\treturn false\n\t}\n\tfor i := range this.NullableTimestamps {\n\t\tif !this.NullableTimestamps[i].Equal(*that1.NullableTimestamps[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.NullableDurations) != len(that1.NullableDurations) {\n\t\treturn false\n\t}\n\tfor i := range this.NullableDurations {\n\t\tif dthis, dthat := this.NullableDurations[i], that1.NullableDurations[i]; (dthis != nil && dthat != nil && *dthis != *dthat) || (dthis != nil && dthat == nil) || (dthis == nil && dthat != nil) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.Timestamps) != len(that1.Timestamps) {\n\t\treturn false\n\t}\n\tfor i := range this.Timestamps {\n\t\tif !this.Timestamps[i].Equal(that1.Timestamps[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.Durations) != len(that1.Durations) {\n\t\treturn false\n\t}\n\tfor i := range this.Durations {\n\t\tif this.Durations[i] != that1.Durations[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\nfunc (this *MapProtoTypes) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*MapProtoTypes)\n\tif !ok {\n\t\tthat2, ok := that.(MapProtoTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *MapProtoTypes\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *MapProtoTypes but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *MapProtoTypes but is not nil && this == nil\")\n\t}\n\tif len(this.NullableTimestamp) != len(that1.NullableTimestamp) {\n\t\treturn fmt.Errorf(\"NullableTimestamp this(%v) Not Equal that(%v)\", len(this.NullableTimestamp), len(that1.NullableTimestamp))\n\t}\n\tfor i := range this.NullableTimestamp {\n\t\tif !this.NullableTimestamp[i].Equal(that1.NullableTimestamp[i]) {\n\t\t\treturn fmt.Errorf(\"NullableTimestamp this[%v](%v) Not Equal that[%v](%v)\", i, this.NullableTimestamp[i], i, that1.NullableTimestamp[i])\n\t\t}\n\t}\n\tif len(this.Timestamp) != len(that1.Timestamp) {\n\t\treturn fmt.Errorf(\"Timestamp this(%v) Not Equal that(%v)\", len(this.Timestamp), len(that1.Timestamp))\n\t}\n\tfor i := range this.Timestamp {\n\t\ta := this.Timestamp[i]\n\t\tb := that1.Timestamp[i]\n\t\tif !(&a).Equal(&b) {\n\t\t\treturn fmt.Errorf(\"Timestamp this[%v](%v) Not Equal that[%v](%v)\", i, this.Timestamp[i], i, that1.Timestamp[i])\n\t\t}\n\t}\n\tif len(this.NullableDuration) != len(that1.NullableDuration) {\n\t\treturn fmt.Errorf(\"NullableDuration this(%v) Not Equal that(%v)\", len(this.NullableDuration), len(that1.NullableDuration))\n\t}\n\tfor i := range this.NullableDuration {\n\t\tif !this.NullableDuration[i].Equal(that1.NullableDuration[i]) {\n\t\t\treturn fmt.Errorf(\"NullableDuration this[%v](%v) Not Equal that[%v](%v)\", i, this.NullableDuration[i], i, that1.NullableDuration[i])\n\t\t}\n\t}\n\tif len(this.Duration) != len(that1.Duration) {\n\t\treturn fmt.Errorf(\"Duration this(%v) Not Equal that(%v)\", len(this.Duration), len(that1.Duration))\n\t}\n\tfor i := range this.Duration {\n\t\ta := this.Duration[i]\n\t\tb := that1.Duration[i]\n\t\tif !(&a).Equal(&b) {\n\t\t\treturn fmt.Errorf(\"Duration this[%v](%v) Not Equal that[%v](%v)\", i, this.Duration[i], i, that1.Duration[i])\n\t\t}\n\t}\n\treturn nil\n}\nfunc (this *MapProtoTypes) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*MapProtoTypes)\n\tif !ok {\n\t\tthat2, ok := that.(MapProtoTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif len(this.NullableTimestamp) != len(that1.NullableTimestamp) {\n\t\treturn false\n\t}\n\tfor i := range this.NullableTimestamp {\n\t\tif !this.NullableTimestamp[i].Equal(that1.NullableTimestamp[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.Timestamp) != len(that1.Timestamp) {\n\t\treturn false\n\t}\n\tfor i := range this.Timestamp {\n\t\ta := this.Timestamp[i]\n\t\tb := that1.Timestamp[i]\n\t\tif !(&a).Equal(&b) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.NullableDuration) != len(that1.NullableDuration) {\n\t\treturn false\n\t}\n\tfor i := range this.NullableDuration {\n\t\tif !this.NullableDuration[i].Equal(that1.NullableDuration[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.Duration) != len(that1.Duration) {\n\t\treturn false\n\t}\n\tfor i := range this.Duration {\n\t\ta := this.Duration[i]\n\t\tb := that1.Duration[i]\n\t\tif !(&a).Equal(&b) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\nfunc (this *MapStdTypes) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*MapStdTypes)\n\tif !ok {\n\t\tthat2, ok := that.(MapStdTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *MapStdTypes\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *MapStdTypes but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *MapStdTypes but is not nil && this == nil\")\n\t}\n\tif len(this.NullableTimestamp) != len(that1.NullableTimestamp) {\n\t\treturn fmt.Errorf(\"NullableTimestamp this(%v) Not Equal that(%v)\", len(this.NullableTimestamp), len(that1.NullableTimestamp))\n\t}\n\tfor i := range this.NullableTimestamp {\n\t\tif !this.NullableTimestamp[i].Equal(*that1.NullableTimestamp[i]) {\n\t\t\treturn fmt.Errorf(\"NullableTimestamp this[%v](%v) Not Equal that[%v](%v)\", i, this.NullableTimestamp[i], i, that1.NullableTimestamp[i])\n\t\t}\n\t}\n\tif len(this.Timestamp) != len(that1.Timestamp) {\n\t\treturn fmt.Errorf(\"Timestamp this(%v) Not Equal that(%v)\", len(this.Timestamp), len(that1.Timestamp))\n\t}\n\tfor i := range this.Timestamp {\n\t\tif !this.Timestamp[i].Equal(that1.Timestamp[i]) {\n\t\t\treturn fmt.Errorf(\"Timestamp this[%v](%v) Not Equal that[%v](%v)\", i, this.Timestamp[i], i, that1.Timestamp[i])\n\t\t}\n\t}\n\tif len(this.NullableDuration) != len(that1.NullableDuration) {\n\t\treturn fmt.Errorf(\"NullableDuration this(%v) Not Equal that(%v)\", len(this.NullableDuration), len(that1.NullableDuration))\n\t}\n\tfor i := range this.NullableDuration {\n\t\tif dthis, dthat := this.NullableDuration[i], that1.NullableDuration[i]; (dthis != nil && dthat != nil && *dthis != *dthat) || (dthis != nil && dthat == nil) || (dthis == nil && dthat != nil) {\n\t\t\treturn fmt.Errorf(\"NullableDuration this[%v](%v) Not Equal that[%v](%v)\", i, this.NullableDuration[i], i, that1.NullableDuration[i])\n\t\t}\n\t}\n\tif len(this.Duration) != len(that1.Duration) {\n\t\treturn fmt.Errorf(\"Duration this(%v) Not Equal that(%v)\", len(this.Duration), len(that1.Duration))\n\t}\n\tfor i := range this.Duration {\n\t\tif this.Duration[i] != that1.Duration[i] {\n\t\t\treturn fmt.Errorf(\"Duration this[%v](%v) Not Equal that[%v](%v)\", i, this.Duration[i], i, that1.Duration[i])\n\t\t}\n\t}\n\treturn nil\n}\nfunc (this *MapStdTypes) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*MapStdTypes)\n\tif !ok {\n\t\tthat2, ok := that.(MapStdTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif len(this.NullableTimestamp) != len(that1.NullableTimestamp) {\n\t\treturn false\n\t}\n\tfor i := range this.NullableTimestamp {\n\t\tif !this.NullableTimestamp[i].Equal(*that1.NullableTimestamp[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.Timestamp) != len(that1.Timestamp) {\n\t\treturn false\n\t}\n\tfor i := range this.Timestamp {\n\t\tif !this.Timestamp[i].Equal(that1.Timestamp[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.NullableDuration) != len(that1.NullableDuration) {\n\t\treturn false\n\t}\n\tfor i := range this.NullableDuration {\n\t\tif dthis, dthat := this.NullableDuration[i], that1.NullableDuration[i]; (dthis != nil && dthat != nil && *dthis != *dthat) || (dthis != nil && dthat == nil) || (dthis == nil && dthat != nil) {\n\t\t\treturn false\n\t\t}\n\t}\n\tif len(this.Duration) != len(that1.Duration) {\n\t\treturn false\n\t}\n\tfor i := range this.Duration {\n\t\tif this.Duration[i] != that1.Duration[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\nfunc (this *OneofProtoTypes) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*OneofProtoTypes)\n\tif !ok {\n\t\tthat2, ok := that.(OneofProtoTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *OneofProtoTypes\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *OneofProtoTypes but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *OneofProtoTypes but is not nil && this == nil\")\n\t}\n\tif that1.OneOfProtoTimes == nil {\n\t\tif this.OneOfProtoTimes != nil {\n\t\t\treturn fmt.Errorf(\"this.OneOfProtoTimes != nil && that1.OneOfProtoTimes == nil\")\n\t\t}\n\t} else if this.OneOfProtoTimes == nil {\n\t\treturn fmt.Errorf(\"this.OneOfProtoTimes == nil && that1.OneOfProtoTimes != nil\")\n\t} else if err := this.OneOfProtoTimes.VerboseEqual(that1.OneOfProtoTimes); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\nfunc (this *OneofProtoTypes_Timestamp) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*OneofProtoTypes_Timestamp)\n\tif !ok {\n\t\tthat2, ok := that.(OneofProtoTypes_Timestamp)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *OneofProtoTypes_Timestamp\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *OneofProtoTypes_Timestamp but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *OneofProtoTypes_Timestamp but is not nil && this == nil\")\n\t}\n\tif !this.Timestamp.Equal(that1.Timestamp) {\n\t\treturn fmt.Errorf(\"Timestamp this(%v) Not Equal that(%v)\", this.Timestamp, that1.Timestamp)\n\t}\n\treturn nil\n}\nfunc (this *OneofProtoTypes_Duration) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*OneofProtoTypes_Duration)\n\tif !ok {\n\t\tthat2, ok := that.(OneofProtoTypes_Duration)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *OneofProtoTypes_Duration\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *OneofProtoTypes_Duration but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *OneofProtoTypes_Duration but is not nil && this == nil\")\n\t}\n\tif !this.Duration.Equal(that1.Duration) {\n\t\treturn fmt.Errorf(\"Duration this(%v) Not Equal that(%v)\", this.Duration, that1.Duration)\n\t}\n\treturn nil\n}\nfunc (this *OneofProtoTypes) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*OneofProtoTypes)\n\tif !ok {\n\t\tthat2, ok := that.(OneofProtoTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif that1.OneOfProtoTimes == nil {\n\t\tif this.OneOfProtoTimes != nil {\n\t\t\treturn false\n\t\t}\n\t} else if this.OneOfProtoTimes == nil {\n\t\treturn false\n\t} else if !this.OneOfProtoTimes.Equal(that1.OneOfProtoTimes) {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc (this *OneofProtoTypes_Timestamp) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*OneofProtoTypes_Timestamp)\n\tif !ok {\n\t\tthat2, ok := that.(OneofProtoTypes_Timestamp)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif !this.Timestamp.Equal(that1.Timestamp) {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc (this *OneofProtoTypes_Duration) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*OneofProtoTypes_Duration)\n\tif !ok {\n\t\tthat2, ok := that.(OneofProtoTypes_Duration)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif !this.Duration.Equal(that1.Duration) {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc (this *OneofStdTypes) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*OneofStdTypes)\n\tif !ok {\n\t\tthat2, ok := that.(OneofStdTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *OneofStdTypes\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *OneofStdTypes but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *OneofStdTypes but is not nil && this == nil\")\n\t}\n\tif that1.OneOfStdTimes == nil {\n\t\tif this.OneOfStdTimes != nil {\n\t\t\treturn fmt.Errorf(\"this.OneOfStdTimes != nil && that1.OneOfStdTimes == nil\")\n\t\t}\n\t} else if this.OneOfStdTimes == nil {\n\t\treturn fmt.Errorf(\"this.OneOfStdTimes == nil && that1.OneOfStdTimes != nil\")\n\t} else if err := this.OneOfStdTimes.VerboseEqual(that1.OneOfStdTimes); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\nfunc (this *OneofStdTypes_Timestamp) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*OneofStdTypes_Timestamp)\n\tif !ok {\n\t\tthat2, ok := that.(OneofStdTypes_Timestamp)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *OneofStdTypes_Timestamp\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *OneofStdTypes_Timestamp but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *OneofStdTypes_Timestamp but is not nil && this == nil\")\n\t}\n\tif that1.Timestamp == nil {\n\t\tif this.Timestamp != nil {\n\t\t\treturn fmt.Errorf(\"this.Timestamp != nil && that1.Timestamp == nil\")\n\t\t}\n\t} else if !this.Timestamp.Equal(*that1.Timestamp) {\n\t\treturn fmt.Errorf(\"Timestamp this(%v) Not Equal that(%v)\", this.Timestamp, that1.Timestamp)\n\t}\n\treturn nil\n}\nfunc (this *OneofStdTypes_Duration) VerboseEqual(that interface{}) error {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that == nil && this != nil\")\n\t}\n\n\tthat1, ok := that.(*OneofStdTypes_Duration)\n\tif !ok {\n\t\tthat2, ok := that.(OneofStdTypes_Duration)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"that is not of type *OneofStdTypes_Duration\")\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"that is type *OneofStdTypes_Duration but is nil && this != nil\")\n\t} else if this == nil {\n\t\treturn fmt.Errorf(\"that is type *OneofStdTypes_Duration but is not nil && this == nil\")\n\t}\n\tif this.Duration != nil && that1.Duration != nil {\n\t\tif *this.Duration != *that1.Duration {\n\t\t\treturn fmt.Errorf(\"Duration this(%v) Not Equal that(%v)\", *this.Duration, *that1.Duration)\n\t\t}\n\t} else if this.Duration != nil {\n\t\treturn fmt.Errorf(\"this.Duration == nil && that.Duration != nil\")\n\t} else if that1.Duration != nil {\n\t\treturn fmt.Errorf(\"Duration this(%v) Not Equal that(%v)\", this.Duration, that1.Duration)\n\t}\n\treturn nil\n}\nfunc (this *OneofStdTypes) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*OneofStdTypes)\n\tif !ok {\n\t\tthat2, ok := that.(OneofStdTypes)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif that1.OneOfStdTimes == nil {\n\t\tif this.OneOfStdTimes != nil {\n\t\t\treturn false\n\t\t}\n\t} else if this.OneOfStdTimes == nil {\n\t\treturn false\n\t} else if !this.OneOfStdTimes.Equal(that1.OneOfStdTimes) {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc (this *OneofStdTypes_Timestamp) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*OneofStdTypes_Timestamp)\n\tif !ok {\n\t\tthat2, ok := that.(OneofStdTypes_Timestamp)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif that1.Timestamp == nil {\n\t\tif this.Timestamp != nil {\n\t\t\treturn false\n\t\t}\n\t} else if !this.Timestamp.Equal(*that1.Timestamp) {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc (this *OneofStdTypes_Duration) Equal(that interface{}) bool {\n\tif that == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t}\n\n\tthat1, ok := that.(*OneofStdTypes_Duration)\n\tif !ok {\n\t\tthat2, ok := that.(OneofStdTypes_Duration)\n\t\tif ok {\n\t\t\tthat1 = &that2\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\tif that1 == nil {\n\t\tif this == nil {\n\t\t\treturn true\n\t\t}\n\t\treturn false\n\t} else if this == nil {\n\t\treturn false\n\t}\n\tif this.Duration != nil && that1.Duration != nil {\n\t\tif *this.Duration != *that1.Duration {\n\t\t\treturn false\n\t\t}\n\t} else if this.Duration != nil {\n\t\treturn false\n\t} else if that1.Duration != nil {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc NewPopulatedKnownTypes(r randyTypes, easy bool) *KnownTypes {\n\tthis := &KnownTypes{}\n\tif r.Intn(10) != 0 {\n\t\tthis.Dur = google_protobuf1.NewPopulatedDuration(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.Ts = google_protobuf2.NewPopulatedTimestamp(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.Dbl = google_protobuf3.NewPopulatedDoubleValue(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.Flt = google_protobuf3.NewPopulatedFloatValue(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.I64 = google_protobuf3.NewPopulatedInt64Value(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.U64 = google_protobuf3.NewPopulatedUInt64Value(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.I32 = google_protobuf3.NewPopulatedInt32Value(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.U32 = google_protobuf3.NewPopulatedUInt32Value(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.Bool = google_protobuf3.NewPopulatedBoolValue(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.Str = google_protobuf3.NewPopulatedStringValue(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.Bytes = google_protobuf3.NewPopulatedBytesValue(r, easy)\n\t}\n\tif !easy && r.Intn(10) != 0 {\n\t}\n\treturn this\n}\n\nfunc NewPopulatedProtoTypes(r randyTypes, easy bool) *ProtoTypes {\n\tthis := &ProtoTypes{}\n\tif r.Intn(10) != 0 {\n\t\tthis.NullableTimestamp = google_protobuf2.NewPopulatedTimestamp(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.NullableDuration = google_protobuf1.NewPopulatedDuration(r, easy)\n\t}\n\tv1 := google_protobuf2.NewPopulatedTimestamp(r, easy)\n\tthis.Timestamp = *v1\n\tv2 := google_protobuf1.NewPopulatedDuration(r, easy)\n\tthis.Duration = *v2\n\tif !easy && r.Intn(10) != 0 {\n\t}\n\treturn this\n}\n\nfunc NewPopulatedStdTypes(r randyTypes, easy bool) *StdTypes {\n\tthis := &StdTypes{}\n\tif r.Intn(10) != 0 {\n\t\tthis.NullableTimestamp = github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy)\n\t}\n\tif r.Intn(10) != 0 {\n\t\tthis.NullableDuration = github_com_gogo_protobuf_types.NewPopulatedStdDuration(r, easy)\n\t}\n\tv3 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy)\n\tthis.Timestamp = *v3\n\tv4 := github_com_gogo_protobuf_types.NewPopulatedStdDuration(r, easy)\n\tthis.Duration = *v4\n\tif !easy && r.Intn(10) != 0 {\n\t}\n\treturn this\n}\n\nfunc NewPopulatedRepProtoTypes(r randyTypes, easy bool) *RepProtoTypes {\n\tthis := &RepProtoTypes{}\n\tif r.Intn(10) != 0 {\n\t\tv5 := r.Intn(5)\n\t\tthis.NullableTimestamps = make([]*google_protobuf2.Timestamp, v5)\n\t\tfor i := 0; i < v5; i++ {\n\t\t\tthis.NullableTimestamps[i] = google_protobuf2.NewPopulatedTimestamp(r, easy)\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv6 := r.Intn(5)\n\t\tthis.NullableDurations = make([]*google_protobuf1.Duration, v6)\n\t\tfor i := 0; i < v6; i++ {\n\t\t\tthis.NullableDurations[i] = google_protobuf1.NewPopulatedDuration(r, easy)\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv7 := r.Intn(5)\n\t\tthis.Timestamps = make([]google_protobuf2.Timestamp, v7)\n\t\tfor i := 0; i < v7; i++ {\n\t\t\tv8 := google_protobuf2.NewPopulatedTimestamp(r, easy)\n\t\t\tthis.Timestamps[i] = *v8\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv9 := r.Intn(5)\n\t\tthis.Durations = make([]google_protobuf1.Duration, v9)\n\t\tfor i := 0; i < v9; i++ {\n\t\t\tv10 := google_protobuf1.NewPopulatedDuration(r, easy)\n\t\t\tthis.Durations[i] = *v10\n\t\t}\n\t}\n\tif !easy && r.Intn(10) != 0 {\n\t}\n\treturn this\n}\n\nfunc NewPopulatedRepStdTypes(r randyTypes, easy bool) *RepStdTypes {\n\tthis := &RepStdTypes{}\n\tif r.Intn(10) != 0 {\n\t\tv11 := r.Intn(5)\n\t\tthis.NullableTimestamps = make([]*time.Time, v11)\n\t\tfor i := 0; i < v11; i++ {\n\t\t\tthis.NullableTimestamps[i] = github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy)\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv12 := r.Intn(5)\n\t\tthis.NullableDurations = make([]*time.Duration, v12)\n\t\tfor i := 0; i < v12; i++ {\n\t\t\tthis.NullableDurations[i] = github_com_gogo_protobuf_types.NewPopulatedStdDuration(r, easy)\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv13 := r.Intn(5)\n\t\tthis.Timestamps = make([]time.Time, v13)\n\t\tfor i := 0; i < v13; i++ {\n\t\t\tv14 := github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy)\n\t\t\tthis.Timestamps[i] = *v14\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv15 := r.Intn(5)\n\t\tthis.Durations = make([]time.Duration, v15)\n\t\tfor i := 0; i < v15; i++ {\n\t\t\tv16 := github_com_gogo_protobuf_types.NewPopulatedStdDuration(r, easy)\n\t\t\tthis.Durations[i] = *v16\n\t\t}\n\t}\n\tif !easy && r.Intn(10) != 0 {\n\t}\n\treturn this\n}\n\nfunc NewPopulatedMapProtoTypes(r randyTypes, easy bool) *MapProtoTypes {\n\tthis := &MapProtoTypes{}\n\tif r.Intn(10) != 0 {\n\t\tv17 := r.Intn(10)\n\t\tthis.NullableTimestamp = make(map[int32]*google_protobuf2.Timestamp)\n\t\tfor i := 0; i < v17; i++ {\n\t\t\tthis.NullableTimestamp[int32(r.Int31())] = google_protobuf2.NewPopulatedTimestamp(r, easy)\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv18 := r.Intn(10)\n\t\tthis.Timestamp = make(map[int32]google_protobuf2.Timestamp)\n\t\tfor i := 0; i < v18; i++ {\n\t\t\tthis.Timestamp[int32(r.Int31())] = *google_protobuf2.NewPopulatedTimestamp(r, easy)\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv19 := r.Intn(10)\n\t\tthis.NullableDuration = make(map[int32]*google_protobuf1.Duration)\n\t\tfor i := 0; i < v19; i++ {\n\t\t\tthis.NullableDuration[int32(r.Int31())] = google_protobuf1.NewPopulatedDuration(r, easy)\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv20 := r.Intn(10)\n\t\tthis.Duration = make(map[int32]google_protobuf1.Duration)\n\t\tfor i := 0; i < v20; i++ {\n\t\t\tthis.Duration[int32(r.Int31())] = *google_protobuf1.NewPopulatedDuration(r, easy)\n\t\t}\n\t}\n\tif !easy && r.Intn(10) != 0 {\n\t}\n\treturn this\n}\n\nfunc NewPopulatedMapStdTypes(r randyTypes, easy bool) *MapStdTypes {\n\tthis := &MapStdTypes{}\n\tif r.Intn(10) != 0 {\n\t\tv21 := r.Intn(10)\n\t\tthis.NullableTimestamp = make(map[int32]*time.Time)\n\t\tfor i := 0; i < v21; i++ {\n\t\t\tthis.NullableTimestamp[int32(r.Int31())] = github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy)\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv22 := r.Intn(10)\n\t\tthis.Timestamp = make(map[int32]time.Time)\n\t\tfor i := 0; i < v22; i++ {\n\t\t\tthis.Timestamp[int32(r.Int31())] = *github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy)\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv23 := r.Intn(10)\n\t\tthis.NullableDuration = make(map[int32]*time.Duration)\n\t\tfor i := 0; i < v23; i++ {\n\t\t\tthis.NullableDuration[int32(r.Int31())] = github_com_gogo_protobuf_types.NewPopulatedStdDuration(r, easy)\n\t\t}\n\t}\n\tif r.Intn(10) != 0 {\n\t\tv24 := r.Intn(10)\n\t\tthis.Duration = make(map[int32]time.Duration)\n\t\tfor i := 0; i < v24; i++ {\n\t\t\tthis.Duration[int32(r.Int31())] = *github_com_gogo_protobuf_types.NewPopulatedStdDuration(r, easy)\n\t\t}\n\t}\n\tif !easy && r.Intn(10) != 0 {\n\t}\n\treturn this\n}\n\nfunc NewPopulatedOneofProtoTypes(r randyTypes, easy bool) *OneofProtoTypes {\n\tthis := &OneofProtoTypes{}\n\toneofNumber_OneOfProtoTimes := []int32{1, 2}[r.Intn(2)]\n\tswitch oneofNumber_OneOfProtoTimes {\n\tcase 1:\n\t\tthis.OneOfProtoTimes = NewPopulatedOneofProtoTypes_Timestamp(r, easy)\n\tcase 2:\n\t\tthis.OneOfProtoTimes = NewPopulatedOneofProtoTypes_Duration(r, easy)\n\t}\n\tif !easy && r.Intn(10) != 0 {\n\t}\n\treturn this\n}\n\nfunc NewPopulatedOneofProtoTypes_Timestamp(r randyTypes, easy bool) *OneofProtoTypes_Timestamp {\n\tthis := &OneofProtoTypes_Timestamp{}\n\tthis.Timestamp = google_protobuf2.NewPopulatedTimestamp(r, easy)\n\treturn this\n}\nfunc NewPopulatedOneofProtoTypes_Duration(r randyTypes, easy bool) *OneofProtoTypes_Duration {\n\tthis := &OneofProtoTypes_Duration{}\n\tthis.Duration = google_protobuf1.NewPopulatedDuration(r, easy)\n\treturn this\n}\nfunc NewPopulatedOneofStdTypes(r randyTypes, easy bool) *OneofStdTypes {\n\tthis := &OneofStdTypes{}\n\toneofNumber_OneOfStdTimes := []int32{1, 2}[r.Intn(2)]\n\tswitch oneofNumber_OneOfStdTimes {\n\tcase 1:\n\t\tthis.OneOfStdTimes = NewPopulatedOneofStdTypes_Timestamp(r, easy)\n\tcase 2:\n\t\tthis.OneOfStdTimes = NewPopulatedOneofStdTypes_Duration(r, easy)\n\t}\n\tif !easy && r.Intn(10) != 0 {\n\t}\n\treturn this\n}\n\nfunc NewPopulatedOneofStdTypes_Timestamp(r randyTypes, easy bool) *OneofStdTypes_Timestamp {\n\tthis := &OneofStdTypes_Timestamp{}\n\tthis.Timestamp = github_com_gogo_protobuf_types.NewPopulatedStdTime(r, easy)\n\treturn this\n}\nfunc NewPopulatedOneofStdTypes_Duration(r randyTypes, easy bool) *OneofStdTypes_Duration {\n\tthis := &OneofStdTypes_Duration{}\n\tthis.Duration = github_com_gogo_protobuf_types.NewPopulatedStdDuration(r, easy)\n\treturn this\n}\n\ntype randyTypes interface {\n\tFloat32() float32\n\tFloat64() float64\n\tInt63() int64\n\tInt31() int32\n\tUint32() uint32\n\tIntn(n int) int\n}\n\nfunc randUTF8RuneTypes(r randyTypes) rune {\n\tru := r.Intn(62)\n\tif ru < 10 {\n\t\treturn rune(ru + 48)\n\t} else if ru < 36 {\n\t\treturn rune(ru + 55)\n\t}\n\treturn rune(ru + 61)\n}\nfunc randStringTypes(r randyTypes) string {\n\tv25 := r.Intn(100)\n\ttmps := make([]rune, v25)\n\tfor i := 0; i < v25; i++ {\n\t\ttmps[i] = randUTF8RuneTypes(r)\n\t}\n\treturn string(tmps)\n}\nfunc randUnrecognizedTypes(r randyTypes, maxFieldNumber int) (data []byte) {\n\tl := r.Intn(5)\n\tfor i := 0; i < l; i++ {\n\t\twire := r.Intn(4)\n\t\tif wire == 3 {\n\t\t\twire = 5\n\t\t}\n\t\tfieldNumber := maxFieldNumber + r.Intn(100)\n\t\tdata = randFieldTypes(data, r, fieldNumber, wire)\n\t}\n\treturn data\n}\nfunc randFieldTypes(data []byte, r randyTypes, fieldNumber int, wire int) []byte {\n\tkey := uint32(fieldNumber)<<3 | uint32(wire)\n\tswitch wire {\n\tcase 0:\n\t\tdata = encodeVarintPopulateTypes(data, uint64(key))\n\t\tv26 := r.Int63()\n\t\tif r.Intn(2) == 0 {\n\t\t\tv26 *= -1\n\t\t}\n\t\tdata = encodeVarintPopulateTypes(data, uint64(v26))\n\tcase 1:\n\t\tdata = encodeVarintPopulateTypes(data, uint64(key))\n\t\tdata = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))\n\tcase 2:\n\t\tdata = encodeVarintPopulateTypes(data, uint64(key))\n\t\tll := r.Intn(100)\n\t\tdata = encodeVarintPopulateTypes(data, uint64(ll))\n\t\tfor j := 0; j < ll; j++ {\n\t\t\tdata = append(data, byte(r.Intn(256)))\n\t\t}\n\tdefault:\n\t\tdata = encodeVarintPopulateTypes(data, uint64(key))\n\t\tdata = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))\n\t}\n\treturn data\n}\nfunc encodeVarintPopulateTypes(data []byte, v uint64) []byte {\n\tfor v >= 1<<7 {\n\t\tdata = append(data, uint8(uint64(v)&0x7f|0x80))\n\t\tv >>= 7\n\t}\n\tdata = append(data, uint8(v))\n\treturn data\n}\nfunc (m *KnownTypes) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif m.Dur != nil {\n\t\tl = m.Dur.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.Ts != nil {\n\t\tl = m.Ts.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.Dbl != nil {\n\t\tl = m.Dbl.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.Flt != nil {\n\t\tl = m.Flt.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.I64 != nil {\n\t\tl = m.I64.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.U64 != nil {\n\t\tl = m.U64.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.I32 != nil {\n\t\tl = m.I32.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.U32 != nil {\n\t\tl = m.U32.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.Bool != nil {\n\t\tl = m.Bool.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.Str != nil {\n\t\tl = m.Str.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.Bytes != nil {\n\t\tl = m.Bytes.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\treturn n\n}\n\nfunc (m *ProtoTypes) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif m.NullableTimestamp != nil {\n\t\tl = m.NullableTimestamp.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.NullableDuration != nil {\n\t\tl = m.NullableDuration.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tl = m.Timestamp.Size()\n\tn += 1 + l + sovTypes(uint64(l))\n\tl = m.Duration.Size()\n\tn += 1 + l + sovTypes(uint64(l))\n\treturn n\n}\n\nfunc (m *StdTypes) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif m.NullableTimestamp != nil {\n\t\tl = github_com_gogo_protobuf_types.SizeOfStdTime(*m.NullableTimestamp)\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tif m.NullableDuration != nil {\n\t\tl = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.NullableDuration)\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\tl = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)\n\tn += 1 + l + sovTypes(uint64(l))\n\tl = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration)\n\tn += 1 + l + sovTypes(uint64(l))\n\treturn n\n}\n\nfunc (m *RepProtoTypes) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif len(m.NullableTimestamps) > 0 {\n\t\tfor _, e := range m.NullableTimestamps {\n\t\t\tl = e.Size()\n\t\t\tn += 1 + l + sovTypes(uint64(l))\n\t\t}\n\t}\n\tif len(m.NullableDurations) > 0 {\n\t\tfor _, e := range m.NullableDurations {\n\t\t\tl = e.Size()\n\t\t\tn += 1 + l + sovTypes(uint64(l))\n\t\t}\n\t}\n\tif len(m.Timestamps) > 0 {\n\t\tfor _, e := range m.Timestamps {\n\t\t\tl = e.Size()\n\t\t\tn += 1 + l + sovTypes(uint64(l))\n\t\t}\n\t}\n\tif len(m.Durations) > 0 {\n\t\tfor _, e := range m.Durations {\n\t\t\tl = e.Size()\n\t\t\tn += 1 + l + sovTypes(uint64(l))\n\t\t}\n\t}\n\treturn n\n}\n\nfunc (m *RepStdTypes) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif len(m.NullableTimestamps) > 0 {\n\t\tfor _, e := range m.NullableTimestamps {\n\t\t\tl = github_com_gogo_protobuf_types.SizeOfStdTime(*e)\n\t\t\tn += 1 + l + sovTypes(uint64(l))\n\t\t}\n\t}\n\tif len(m.NullableDurations) > 0 {\n\t\tfor _, e := range m.NullableDurations {\n\t\t\tl = github_com_gogo_protobuf_types.SizeOfStdDuration(*e)\n\t\t\tn += 1 + l + sovTypes(uint64(l))\n\t\t}\n\t}\n\tif len(m.Timestamps) > 0 {\n\t\tfor _, e := range m.Timestamps {\n\t\t\tl = github_com_gogo_protobuf_types.SizeOfStdTime(e)\n\t\t\tn += 1 + l + sovTypes(uint64(l))\n\t\t}\n\t}\n\tif len(m.Durations) > 0 {\n\t\tfor _, e := range m.Durations {\n\t\t\tl = github_com_gogo_protobuf_types.SizeOfStdDuration(e)\n\t\t\tn += 1 + l + sovTypes(uint64(l))\n\t\t}\n\t}\n\treturn n\n}\n\nfunc (m *MapProtoTypes) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif len(m.NullableTimestamp) > 0 {\n\t\tfor k, v := range m.NullableTimestamp {\n\t\t\t_ = k\n\t\t\t_ = v\n\t\t\tl = 0\n\t\t\tif v != nil {\n\t\t\t\tl = v.Size()\n\t\t\t\tl += 1 + sovTypes(uint64(l))\n\t\t\t}\n\t\t\tmapEntrySize := 1 + sovTypes(uint64(k)) + l\n\t\t\tn += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize))\n\t\t}\n\t}\n\tif len(m.Timestamp) > 0 {\n\t\tfor k, v := range m.Timestamp {\n\t\t\t_ = k\n\t\t\t_ = v\n\t\t\tl = v.Size()\n\t\t\tmapEntrySize := 1 + sovTypes(uint64(k)) + 1 + l + sovTypes(uint64(l))\n\t\t\tn += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize))\n\t\t}\n\t}\n\tif len(m.NullableDuration) > 0 {\n\t\tfor k, v := range m.NullableDuration {\n\t\t\t_ = k\n\t\t\t_ = v\n\t\t\tl = 0\n\t\t\tif v != nil {\n\t\t\t\tl = v.Size()\n\t\t\t\tl += 1 + sovTypes(uint64(l))\n\t\t\t}\n\t\t\tmapEntrySize := 1 + sovTypes(uint64(k)) + l\n\t\t\tn += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize))\n\t\t}\n\t}\n\tif len(m.Duration) > 0 {\n\t\tfor k, v := range m.Duration {\n\t\t\t_ = k\n\t\t\t_ = v\n\t\t\tl = v.Size()\n\t\t\tmapEntrySize := 1 + sovTypes(uint64(k)) + 1 + l + sovTypes(uint64(l))\n\t\t\tn += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize))\n\t\t}\n\t}\n\treturn n\n}\n\nfunc (m *MapStdTypes) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif len(m.NullableTimestamp) > 0 {\n\t\tfor k, v := range m.NullableTimestamp {\n\t\t\t_ = k\n\t\t\t_ = v\n\t\t\tl = 0\n\t\t\tif v != nil {\n\t\t\t\tl = github_com_gogo_protobuf_types.SizeOfStdTime(*v)\n\t\t\t\tl += 1 + sovTypes(uint64(l))\n\t\t\t}\n\t\t\tmapEntrySize := 1 + sovTypes(uint64(k)) + l\n\t\t\tn += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize))\n\t\t}\n\t}\n\tif len(m.Timestamp) > 0 {\n\t\tfor k, v := range m.Timestamp {\n\t\t\t_ = k\n\t\t\t_ = v\n\t\t\tl = github_com_gogo_protobuf_types.SizeOfStdTime(v)\n\t\t\tmapEntrySize := 1 + sovTypes(uint64(k)) + 1 + l + sovTypes(uint64(l))\n\t\t\tn += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize))\n\t\t}\n\t}\n\tif len(m.NullableDuration) > 0 {\n\t\tfor k, v := range m.NullableDuration {\n\t\t\t_ = k\n\t\t\t_ = v\n\t\t\tl = 0\n\t\t\tif v != nil {\n\t\t\t\tl = github_com_gogo_protobuf_types.SizeOfStdDuration(*v)\n\t\t\t\tl += 1 + sovTypes(uint64(l))\n\t\t\t}\n\t\t\tmapEntrySize := 1 + sovTypes(uint64(k)) + l\n\t\t\tn += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize))\n\t\t}\n\t}\n\tif len(m.Duration) > 0 {\n\t\tfor k, v := range m.Duration {\n\t\t\t_ = k\n\t\t\t_ = v\n\t\t\tl = github_com_gogo_protobuf_types.SizeOfStdDuration(v)\n\t\t\tmapEntrySize := 1 + sovTypes(uint64(k)) + 1 + l + sovTypes(uint64(l))\n\t\t\tn += mapEntrySize + 1 + sovTypes(uint64(mapEntrySize))\n\t\t}\n\t}\n\treturn n\n}\n\nfunc (m *OneofProtoTypes) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif m.OneOfProtoTimes != nil {\n\t\tn += m.OneOfProtoTimes.Size()\n\t}\n\treturn n\n}\n\nfunc (m *OneofProtoTypes_Timestamp) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif m.Timestamp != nil {\n\t\tl = m.Timestamp.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\treturn n\n}\nfunc (m *OneofProtoTypes_Duration) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif m.Duration != nil {\n\t\tl = m.Duration.Size()\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\treturn n\n}\nfunc (m *OneofStdTypes) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif m.OneOfStdTimes != nil {\n\t\tn += m.OneOfStdTimes.Size()\n\t}\n\treturn n\n}\n\nfunc (m *OneofStdTypes_Timestamp) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif m.Timestamp != nil {\n\t\tl = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Timestamp)\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\treturn n\n}\nfunc (m *OneofStdTypes_Duration) Size() (n int) {\n\tvar l int\n\t_ = l\n\tif m.Duration != nil {\n\t\tl = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Duration)\n\t\tn += 1 + l + sovTypes(uint64(l))\n\t}\n\treturn n\n}\n\nfunc sovTypes(x uint64) (n int) {\n\tfor {\n\t\tn++\n\t\tx >>= 7\n\t\tif x == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn n\n}\nfunc sozTypes(x uint64) (n int) {\n\treturn sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))\n}\nfunc (m *KnownTypes) Marshal() (data []byte, err error) {\n\tsize := m.Size()\n\tdata = make([]byte, size)\n\tn, err := m.MarshalTo(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data[:n], nil\n}\n\nfunc (m *KnownTypes) MarshalTo(data []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif m.Dur != nil {\n\t\tdata[i] = 0xa\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.Dur.Size()))\n\t\tn1, err := m.Dur.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n1\n\t}\n\tif m.Ts != nil {\n\t\tdata[i] = 0x12\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.Ts.Size()))\n\t\tn2, err := m.Ts.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n2\n\t}\n\tif m.Dbl != nil {\n\t\tdata[i] = 0x1a\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.Dbl.Size()))\n\t\tn3, err := m.Dbl.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n3\n\t}\n\tif m.Flt != nil {\n\t\tdata[i] = 0x22\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.Flt.Size()))\n\t\tn4, err := m.Flt.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n4\n\t}\n\tif m.I64 != nil {\n\t\tdata[i] = 0x2a\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.I64.Size()))\n\t\tn5, err := m.I64.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n5\n\t}\n\tif m.U64 != nil {\n\t\tdata[i] = 0x32\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.U64.Size()))\n\t\tn6, err := m.U64.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n6\n\t}\n\tif m.I32 != nil {\n\t\tdata[i] = 0x3a\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.I32.Size()))\n\t\tn7, err := m.I32.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n7\n\t}\n\tif m.U32 != nil {\n\t\tdata[i] = 0x42\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.U32.Size()))\n\t\tn8, err := m.U32.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n8\n\t}\n\tif m.Bool != nil {\n\t\tdata[i] = 0x4a\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.Bool.Size()))\n\t\tn9, err := m.Bool.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n9\n\t}\n\tif m.Str != nil {\n\t\tdata[i] = 0x52\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.Str.Size()))\n\t\tn10, err := m.Str.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n10\n\t}\n\tif m.Bytes != nil {\n\t\tdata[i] = 0x5a\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.Bytes.Size()))\n\t\tn11, err := m.Bytes.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n11\n\t}\n\treturn i, nil\n}\n\nfunc (m *ProtoTypes) Marshal() (data []byte, err error) {\n\tsize := m.Size()\n\tdata = make([]byte, size)\n\tn, err := m.MarshalTo(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data[:n], nil\n}\n\nfunc (m *ProtoTypes) MarshalTo(data []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif m.NullableTimestamp != nil {\n\t\tdata[i] = 0xa\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.NullableTimestamp.Size()))\n\t\tn12, err := m.NullableTimestamp.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n12\n\t}\n\tif m.NullableDuration != nil {\n\t\tdata[i] = 0x12\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.NullableDuration.Size()))\n\t\tn13, err := m.NullableDuration.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n13\n\t}\n\tdata[i] = 0x1a\n\ti++\n\ti = encodeVarintTypes(data, i, uint64(m.Timestamp.Size()))\n\tn14, err := m.Timestamp.MarshalTo(data[i:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\ti += n14\n\tdata[i] = 0x22\n\ti++\n\ti = encodeVarintTypes(data, i, uint64(m.Duration.Size()))\n\tn15, err := m.Duration.MarshalTo(data[i:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\ti += n15\n\treturn i, nil\n}\n\nfunc (m *StdTypes) Marshal() (data []byte, err error) {\n\tsize := m.Size()\n\tdata = make([]byte, size)\n\tn, err := m.MarshalTo(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data[:n], nil\n}\n\nfunc (m *StdTypes) MarshalTo(data []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif m.NullableTimestamp != nil {\n\t\tdata[i] = 0xa\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*m.NullableTimestamp)))\n\t\tn16, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.NullableTimestamp, data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n16\n\t}\n\tif m.NullableDuration != nil {\n\t\tdata[i] = 0x12\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.NullableDuration)))\n\t\tn17, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.NullableDuration, data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n17\n\t}\n\tdata[i] = 0x1a\n\ti++\n\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)))\n\tn18, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, data[i:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\ti += n18\n\tdata[i] = 0x22\n\ti++\n\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration)))\n\tn19, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, data[i:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\ti += n19\n\treturn i, nil\n}\n\nfunc (m *RepProtoTypes) Marshal() (data []byte, err error) {\n\tsize := m.Size()\n\tdata = make([]byte, size)\n\tn, err := m.MarshalTo(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data[:n], nil\n}\n\nfunc (m *RepProtoTypes) MarshalTo(data []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif len(m.NullableTimestamps) > 0 {\n\t\tfor _, msg := range m.NullableTimestamps {\n\t\t\tdata[i] = 0xa\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(msg.Size()))\n\t\t\tn, err := msg.MarshalTo(data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n\n\t\t}\n\t}\n\tif len(m.NullableDurations) > 0 {\n\t\tfor _, msg := range m.NullableDurations {\n\t\t\tdata[i] = 0x12\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(msg.Size()))\n\t\t\tn, err := msg.MarshalTo(data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n\n\t\t}\n\t}\n\tif len(m.Timestamps) > 0 {\n\t\tfor _, msg := range m.Timestamps {\n\t\t\tdata[i] = 0x1a\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(msg.Size()))\n\t\t\tn, err := msg.MarshalTo(data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n\n\t\t}\n\t}\n\tif len(m.Durations) > 0 {\n\t\tfor _, msg := range m.Durations {\n\t\t\tdata[i] = 0x22\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(msg.Size()))\n\t\t\tn, err := msg.MarshalTo(data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n\n\t\t}\n\t}\n\treturn i, nil\n}\n\nfunc (m *RepStdTypes) Marshal() (data []byte, err error) {\n\tsize := m.Size()\n\tdata = make([]byte, size)\n\tn, err := m.MarshalTo(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data[:n], nil\n}\n\nfunc (m *RepStdTypes) MarshalTo(data []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif len(m.NullableTimestamps) > 0 {\n\t\tfor _, msg := range m.NullableTimestamps {\n\t\t\tdata[i] = 0xa\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*msg)))\n\t\t\tn, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*msg, data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n\n\t\t}\n\t}\n\tif len(m.NullableDurations) > 0 {\n\t\tfor _, msg := range m.NullableDurations {\n\t\t\tdata[i] = 0x12\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*msg)))\n\t\t\tn, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*msg, data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n\n\t\t}\n\t}\n\tif len(m.Timestamps) > 0 {\n\t\tfor _, msg := range m.Timestamps {\n\t\t\tdata[i] = 0x1a\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(msg)))\n\t\t\tn, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(msg, data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n\n\t\t}\n\t}\n\tif len(m.Durations) > 0 {\n\t\tfor _, msg := range m.Durations {\n\t\t\tdata[i] = 0x22\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(msg)))\n\t\t\tn, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(msg, data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n\n\t\t}\n\t}\n\treturn i, nil\n}\n\nfunc (m *MapProtoTypes) Marshal() (data []byte, err error) {\n\tsize := m.Size()\n\tdata = make([]byte, size)\n\tn, err := m.MarshalTo(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data[:n], nil\n}\n\nfunc (m *MapProtoTypes) MarshalTo(data []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif len(m.NullableTimestamp) > 0 {\n\t\tfor k := range m.NullableTimestamp {\n\t\t\tdata[i] = 0xa\n\t\t\ti++\n\t\t\tv := m.NullableTimestamp[k]\n\t\t\tmsgSize := 0\n\t\t\tif v != nil {\n\t\t\t\tmsgSize = v.Size()\n\t\t\t\tmsgSize += 1 + sovTypes(uint64(msgSize))\n\t\t\t}\n\t\t\tmapSize := 1 + sovTypes(uint64(k)) + msgSize\n\t\t\ti = encodeVarintTypes(data, i, uint64(mapSize))\n\t\t\tdata[i] = 0x8\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(k))\n\t\t\tif v != nil {\n\t\t\t\tdata[i] = 0x12\n\t\t\t\ti++\n\t\t\t\ti = encodeVarintTypes(data, i, uint64(v.Size()))\n\t\t\t\tn20, err := v.MarshalTo(data[i:])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\ti += n20\n\t\t\t}\n\t\t}\n\t}\n\tif len(m.Timestamp) > 0 {\n\t\tfor k := range m.Timestamp {\n\t\t\tdata[i] = 0x12\n\t\t\ti++\n\t\t\tv := m.Timestamp[k]\n\t\t\tmsgSize := 0\n\t\t\tif (&v) != nil {\n\t\t\t\tmsgSize = (&v).Size()\n\t\t\t\tmsgSize += 1 + sovTypes(uint64(msgSize))\n\t\t\t}\n\t\t\tmapSize := 1 + sovTypes(uint64(k)) + msgSize\n\t\t\ti = encodeVarintTypes(data, i, uint64(mapSize))\n\t\t\tdata[i] = 0x8\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(k))\n\t\t\tdata[i] = 0x12\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64((&v).Size()))\n\t\t\tn21, err := (&v).MarshalTo(data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n21\n\t\t}\n\t}\n\tif len(m.NullableDuration) > 0 {\n\t\tfor k := range m.NullableDuration {\n\t\t\tdata[i] = 0x1a\n\t\t\ti++\n\t\t\tv := m.NullableDuration[k]\n\t\t\tmsgSize := 0\n\t\t\tif v != nil {\n\t\t\t\tmsgSize = v.Size()\n\t\t\t\tmsgSize += 1 + sovTypes(uint64(msgSize))\n\t\t\t}\n\t\t\tmapSize := 1 + sovTypes(uint64(k)) + msgSize\n\t\t\ti = encodeVarintTypes(data, i, uint64(mapSize))\n\t\t\tdata[i] = 0x8\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(k))\n\t\t\tif v != nil {\n\t\t\t\tdata[i] = 0x12\n\t\t\t\ti++\n\t\t\t\ti = encodeVarintTypes(data, i, uint64(v.Size()))\n\t\t\t\tn22, err := v.MarshalTo(data[i:])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\ti += n22\n\t\t\t}\n\t\t}\n\t}\n\tif len(m.Duration) > 0 {\n\t\tfor k := range m.Duration {\n\t\t\tdata[i] = 0x22\n\t\t\ti++\n\t\t\tv := m.Duration[k]\n\t\t\tmsgSize := 0\n\t\t\tif (&v) != nil {\n\t\t\t\tmsgSize = (&v).Size()\n\t\t\t\tmsgSize += 1 + sovTypes(uint64(msgSize))\n\t\t\t}\n\t\t\tmapSize := 1 + sovTypes(uint64(k)) + msgSize\n\t\t\ti = encodeVarintTypes(data, i, uint64(mapSize))\n\t\t\tdata[i] = 0x8\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(k))\n\t\t\tdata[i] = 0x12\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64((&v).Size()))\n\t\t\tn23, err := (&v).MarshalTo(data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n23\n\t\t}\n\t}\n\treturn i, nil\n}\n\nfunc (m *MapStdTypes) Marshal() (data []byte, err error) {\n\tsize := m.Size()\n\tdata = make([]byte, size)\n\tn, err := m.MarshalTo(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data[:n], nil\n}\n\nfunc (m *MapStdTypes) MarshalTo(data []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif len(m.NullableTimestamp) > 0 {\n\t\tfor k := range m.NullableTimestamp {\n\t\t\tdata[i] = 0xa\n\t\t\ti++\n\t\t\tv := m.NullableTimestamp[k]\n\t\t\tmsgSize := 0\n\t\t\tif v != nil {\n\t\t\t\tmsgSize = github_com_gogo_protobuf_types.SizeOfStdTime(*v)\n\t\t\t\tmsgSize += 1 + sovTypes(uint64(msgSize))\n\t\t\t}\n\t\t\tmapSize := 1 + sovTypes(uint64(k)) + msgSize\n\t\t\ti = encodeVarintTypes(data, i, uint64(mapSize))\n\t\t\tdata[i] = 0x8\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(k))\n\t\t\tif v != nil {\n\t\t\t\tdata[i] = 0x12\n\t\t\t\ti++\n\t\t\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*v)))\n\t\t\t\tn24, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*v, data[i:])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\ti += n24\n\t\t\t}\n\t\t}\n\t}\n\tif len(m.Timestamp) > 0 {\n\t\tfor k := range m.Timestamp {\n\t\t\tdata[i] = 0x12\n\t\t\ti++\n\t\t\tv := m.Timestamp[k]\n\t\t\tmsgSize := 0\n\t\t\tif (&v) != nil {\n\t\t\t\tmsgSize = github_com_gogo_protobuf_types.SizeOfStdTime(*(&v))\n\t\t\t\tmsgSize += 1 + sovTypes(uint64(msgSize))\n\t\t\t}\n\t\t\tmapSize := 1 + sovTypes(uint64(k)) + msgSize\n\t\t\ti = encodeVarintTypes(data, i, uint64(mapSize))\n\t\t\tdata[i] = 0x8\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(k))\n\t\t\tdata[i] = 0x12\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*(&v))))\n\t\t\tn25, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*(&v), data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n25\n\t\t}\n\t}\n\tif len(m.NullableDuration) > 0 {\n\t\tfor k := range m.NullableDuration {\n\t\t\tdata[i] = 0x1a\n\t\t\ti++\n\t\t\tv := m.NullableDuration[k]\n\t\t\tmsgSize := 0\n\t\t\tif v != nil {\n\t\t\t\tmsgSize = github_com_gogo_protobuf_types.SizeOfStdDuration(*v)\n\t\t\t\tmsgSize += 1 + sovTypes(uint64(msgSize))\n\t\t\t}\n\t\t\tmapSize := 1 + sovTypes(uint64(k)) + msgSize\n\t\t\ti = encodeVarintTypes(data, i, uint64(mapSize))\n\t\t\tdata[i] = 0x8\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(k))\n\t\t\tif v != nil {\n\t\t\t\tdata[i] = 0x12\n\t\t\t\ti++\n\t\t\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*v)))\n\t\t\t\tn26, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*v, data[i:])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn 0, err\n\t\t\t\t}\n\t\t\t\ti += n26\n\t\t\t}\n\t\t}\n\t}\n\tif len(m.Duration) > 0 {\n\t\tfor k := range m.Duration {\n\t\t\tdata[i] = 0x22\n\t\t\ti++\n\t\t\tv := m.Duration[k]\n\t\t\tmsgSize := 0\n\t\t\tif (&v) != nil {\n\t\t\t\tmsgSize = github_com_gogo_protobuf_types.SizeOfStdDuration(*(&v))\n\t\t\t\tmsgSize += 1 + sovTypes(uint64(msgSize))\n\t\t\t}\n\t\t\tmapSize := 1 + sovTypes(uint64(k)) + msgSize\n\t\t\ti = encodeVarintTypes(data, i, uint64(mapSize))\n\t\t\tdata[i] = 0x8\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(k))\n\t\t\tdata[i] = 0x12\n\t\t\ti++\n\t\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*(&v))))\n\t\t\tn27, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*(&v), data[i:])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\t\t\ti += n27\n\t\t}\n\t}\n\treturn i, nil\n}\n\nfunc (m *OneofProtoTypes) Marshal() (data []byte, err error) {\n\tsize := m.Size()\n\tdata = make([]byte, size)\n\tn, err := m.MarshalTo(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data[:n], nil\n}\n\nfunc (m *OneofProtoTypes) MarshalTo(data []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif m.OneOfProtoTimes != nil {\n\t\tnn28, err := m.OneOfProtoTimes.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += nn28\n\t}\n\treturn i, nil\n}\n\nfunc (m *OneofProtoTypes_Timestamp) MarshalTo(data []byte) (int, error) {\n\ti := 0\n\tif m.Timestamp != nil {\n\t\tdata[i] = 0xa\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.Timestamp.Size()))\n\t\tn29, err := m.Timestamp.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n29\n\t}\n\treturn i, nil\n}\nfunc (m *OneofProtoTypes_Duration) MarshalTo(data []byte) (int, error) {\n\ti := 0\n\tif m.Duration != nil {\n\t\tdata[i] = 0x12\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(m.Duration.Size()))\n\t\tn30, err := m.Duration.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n30\n\t}\n\treturn i, nil\n}\nfunc (m *OneofStdTypes) Marshal() (data []byte, err error) {\n\tsize := m.Size()\n\tdata = make([]byte, size)\n\tn, err := m.MarshalTo(data)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn data[:n], nil\n}\n\nfunc (m *OneofStdTypes) MarshalTo(data []byte) (int, error) {\n\tvar i int\n\t_ = i\n\tvar l int\n\t_ = l\n\tif m.OneOfStdTimes != nil {\n\t\tnn31, err := m.OneOfStdTimes.MarshalTo(data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += nn31\n\t}\n\treturn i, nil\n}\n\nfunc (m *OneofStdTypes_Timestamp) MarshalTo(data []byte) (int, error) {\n\ti := 0\n\tif m.Timestamp != nil {\n\t\tdata[i] = 0xa\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(*m.Timestamp)))\n\t\tn32, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Timestamp, data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n32\n\t}\n\treturn i, nil\n}\nfunc (m *OneofStdTypes_Duration) MarshalTo(data []byte) (int, error) {\n\ti := 0\n\tif m.Duration != nil {\n\t\tdata[i] = 0x12\n\t\ti++\n\t\ti = encodeVarintTypes(data, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Duration)))\n\t\tn33, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Duration, data[i:])\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\ti += n33\n\t}\n\treturn i, nil\n}\nfunc encodeFixed64Types(data []byte, offset int, v uint64) int {\n\tdata[offset] = uint8(v)\n\tdata[offset+1] = uint8(v >> 8)\n\tdata[offset+2] = uint8(v >> 16)\n\tdata[offset+3] = uint8(v >> 24)\n\tdata[offset+4] = uint8(v >> 32)\n\tdata[offset+5] = uint8(v >> 40)\n\tdata[offset+6] = uint8(v >> 48)\n\tdata[offset+7] = uint8(v >> 56)\n\treturn offset + 8\n}\nfunc encodeFixed32Types(data []byte, offset int, v uint32) int {\n\tdata[offset] = uint8(v)\n\tdata[offset+1] = uint8(v >> 8)\n\tdata[offset+2] = uint8(v >> 16)\n\tdata[offset+3] = uint8(v >> 24)\n\treturn offset + 4\n}\nfunc encodeVarintTypes(data []byte, offset int, v uint64) int {\n\tfor v >= 1<<7 {\n\t\tdata[offset] = uint8(v&0x7f | 0x80)\n\t\tv >>= 7\n\t\toffset++\n\t}\n\tdata[offset] = uint8(v)\n\treturn offset + 1\n}\n\nfunc init() { proto.RegisterFile(\"combos/unsafemarshaler/types.proto\", fileDescriptorTypes) }\n\nvar fileDescriptorTypes = []byte{\n\t// 922 bytes of a gzipped FileDescriptorProto\n\t0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xec, 0x56, 0xcf, 0x6f, 0xe3, 0x44,\n\t0x18, 0x8d, 0xed, 0x64, 0x49, 0xbf, 0x28, 0xec, 0xae, 0x25, 0x90, 0x09, 0xc8, 0x2d, 0xe6, 0x52,\n\t0x76, 0xb5, 0x0e, 0x24, 0x51, 0x40, 0x8b, 0x16, 0x16, 0xab, 0xbb, 0xdb, 0xa5, 0xea, 0x0f, 0xa5,\n\t0xa5, 0x02, 0x24, 0x10, 0x76, 0xe3, 0xa4, 0x11, 0x8e, 0x27, 0xb2, 0xc7, 0x54, 0xb9, 0xf1, 0x27,\n\t0x70, 0x41, 0x02, 0x6e, 0x1c, 0x90, 0x38, 0x70, 0x87, 0x23, 0x17, 0xa4, 0xde, 0xe0, 0x2f, 0x80,\n\t0x36, 0xfc, 0x13, 0x3d, 0xa2, 0x19, 0xff, 0x8e, 0xc7, 0x0e, 0x89, 0x54, 0x71, 0xd9, 0x5b, 0x9c,\n\t0x79, 0xdf, 0x9b, 0xe7, 0x37, 0xef, 0xfb, 0xc6, 0xa0, 0x9c, 0xa0, 0xb1, 0x81, 0xdc, 0xa6, 0x67,\n\t0xbb, 0xfa, 0xc0, 0x1c, 0xeb, 0x8e, 0x7b, 0xaa, 0x5b, 0xa6, 0xd3, 0xc4, 0xd3, 0x89, 0xe9, 0xaa,\n\t0x13, 0x07, 0x61, 0x24, 0x56, 0xe8, 0x43, 0xe3, 0xde, 0x70, 0x84, 0x4f, 0x3d, 0x43, 0x3d, 0x41,\n\t0xe3, 0xe6, 0x10, 0x0d, 0x51, 0x93, 0xae, 0x1a, 0xde, 0x80, 0x3e, 0xd1, 0x07, 0xfa, 0xcb, 0xaf,\n\t0x6a, 0xc8, 0x43, 0x84, 0x86, 0x96, 0x19, 0xa3, 0xfa, 0x9e, 0xa3, 0xe3, 0x11, 0xb2, 0x83, 0xf5,\n\t0xf5, 0xf9, 0x75, 0x3c, 0x1a, 0x9b, 0x2e, 0xd6, 0xc7, 0x93, 0x3c, 0x82, 0x33, 0x47, 0x9f, 0x4c,\n\t0x4c, 0x27, 0x90, 0xa5, 0x7c, 0x53, 0x06, 0xd8, 0xb1, 0xd1, 0x99, 0x7d, 0x44, 0xe4, 0x89, 0x77,\n\t0x41, 0xe8, 0x7b, 0x8e, 0xc4, 0x6d, 0x70, 0x9b, 0xb5, 0xd6, 0x4b, 0xaa, 0x5f, 0xac, 0x86, 0xc5,\n\t0xea, 0x56, 0xb0, 0x7b, 0x8f, 0xa0, 0xc4, 0x3b, 0xc0, 0x63, 0x57, 0xe2, 0x29, 0xb6, 0x91, 0xc1,\n\t0x1e, 0x85, 0x4a, 0x7a, 0x3c, 0x76, 0x45, 0x15, 0x84, 0xbe, 0x61, 0x49, 0x02, 0x05, 0xbf, 0x92,\n\t0x25, 0x46, 0x9e, 0x61, 0x99, 0xc7, 0xba, 0xe5, 0x99, 0x3d, 0x02, 0x14, 0xef, 0x81, 0x30, 0xb0,\n\t0xb0, 0x54, 0xa6, 0xf8, 0x97, 0x33, 0xf8, 0xc7, 0x16, 0xd2, 0x71, 0x00, 0x1f, 0x58, 0x98, 0xc0,\n\t0x47, 0xdd, 0x8e, 0x54, 0xc9, 0x81, 0x3f, 0xb5, 0x71, 0xb7, 0x13, 0xc0, 0x47, 0xdd, 0x0e, 0x51,\n\t0xe3, 0x75, 0x3b, 0xd2, 0x8d, 0x1c, 0x35, 0x1f, 0x26, 0xf1, 0x5e, 0xb7, 0x43, 0xe9, 0xdb, 0x2d,\n\t0xe9, 0xb9, 0x7c, 0xfa, 0x76, 0x2b, 0xa4, 0x6f, 0xb7, 0x28, 0x7d, 0xbb, 0x25, 0x55, 0x0b, 0xe8,\n\t0x23, 0xbc, 0x47, 0xf1, 0x65, 0x03, 0x21, 0x4b, 0x5a, 0xcb, 0xb1, 0x52, 0x43, 0xc8, 0xf2, 0xe1,\n\t0x14, 0x47, 0xf8, 0x5d, 0xec, 0x48, 0x90, 0xc3, 0x7f, 0x88, 0x9d, 0x91, 0x3d, 0x0c, 0xf8, 0x5d,\n\t0xec, 0x88, 0x6f, 0x42, 0xc5, 0x98, 0x62, 0xd3, 0x95, 0x6a, 0x39, 0x2f, 0xa0, 0x91, 0x55, 0xbf,\n\t0xc0, 0x47, 0x2a, 0xdf, 0xf3, 0x00, 0x07, 0x64, 0xd9, 0xcf, 0xc5, 0x36, 0xdc, 0xb6, 0x3d, 0xcb,\n\t0xd2, 0x0d, 0xcb, 0x8c, 0xce, 0x35, 0x48, 0x49, 0xd1, 0xc9, 0x67, 0x8b, 0xc4, 0x47, 0x70, 0x2b,\n\t0xfc, 0x33, 0x4c, 0x53, 0x10, 0xa1, 0x82, 0xb8, 0x65, 0x4a, 0xc4, 0x77, 0x61, 0x2d, 0x8a, 0x7a,\n\t0x90, 0xaa, 0x02, 0x21, 0x5a, 0xf9, 0xfc, 0xaf, 0xf5, 0x52, 0x2f, 0x2e, 0x11, 0xdf, 0x81, 0x6a,\n\t0xd8, 0x4a, 0x41, 0xc8, 0xf2, 0xb7, 0x0f, 0xaa, 0xa3, 0x02, 0xe5, 0x67, 0x1e, 0xaa, 0x87, 0xb8,\n\t0xef, 0x5b, 0xb3, 0xb7, 0x92, 0x35, 0x5a, 0xf9, 0xeb, 0xbf, 0xd7, 0x39, 0x96, 0x41, 0x3b, 0x2b,\n\t0x18, 0xa4, 0x95, 0xbf, 0x25, 0x6c, 0x59, 0x9b, 0xb4, 0xe5, 0x6c, 0xaa, 0x92, 0x17, 0xa5, 0xc2,\n\t0x12, 0x56, 0xbd, 0xb7, 0x8c, 0x55, 0x94, 0x81, 0x8a, 0x89, 0xed, 0xfa, 0x91, 0x87, 0x7a, 0xcf,\n\t0x9c, 0x24, 0xe2, 0xf4, 0x01, 0x88, 0x99, 0x17, 0x77, 0x25, 0x6e, 0x43, 0x58, 0x90, 0x27, 0x46,\n\t0x95, 0xf8, 0x24, 0xf6, 0x3f, 0x54, 0x41, 0x86, 0x92, 0x50, 0x9c, 0xa8, 0x6c, 0x8d, 0xf8, 0x10,\n\t0x00, 0xc7, 0x62, 0x84, 0x45, 0x62, 0x82, 0x54, 0x24, 0x6a, 0xc4, 0x07, 0xb0, 0xd6, 0x8f, 0x24,\n\t0x94, 0x17, 0x48, 0x08, 0x33, 0x19, 0x55, 0x28, 0xbf, 0xf0, 0x50, 0xeb, 0x99, 0x93, 0x28, 0x59,\n\t0x07, 0xab, 0xb9, 0x14, 0x44, 0x8b, 0xe5, 0xd5, 0xee, 0x2a, 0x5e, 0x05, 0xe1, 0x62, 0x38, 0xb6,\n\t0xb5, 0xa4, 0x63, 0x71, 0xbc, 0x92, 0xae, 0xbd, 0xbf, 0x94, 0x6b, 0x71, 0xc0, 0x12, 0xce, 0xfd,\n\t0x5e, 0x81, 0xfa, 0xae, 0x9e, 0x4c, 0xd8, 0xc7, 0xec, 0xae, 0x24, 0xe4, 0x77, 0x55, 0xff, 0x5e,\n\t0x4e, 0x15, 0xa8, 0x7b, 0xf3, 0xe8, 0x47, 0x36, 0x76, 0xa6, 0xac, 0x06, 0x7d, 0x92, 0xec, 0x29,\n\t0xdf, 0xbc, 0xd7, 0x98, 0x94, 0x69, 0xaa, 0xec, 0x0c, 0x3a, 0x66, 0x74, 0xba, 0x6f, 0xe2, 0x9d,\n\t0x42, 0x89, 0x21, 0xd8, 0x57, 0x98, 0x6d, 0xfa, 0xad, 0x54, 0xc3, 0x12, 0x3e, 0x85, 0xc9, 0x97,\n\t0xe2, 0x99, 0x1f, 0x72, 0x8d, 0xcf, 0xe1, 0x45, 0xb6, 0x27, 0xe2, 0x2d, 0x10, 0xbe, 0x30, 0xa7,\n\t0x74, 0xc6, 0x55, 0x7a, 0xe4, 0xa7, 0xf8, 0x06, 0x54, 0xbe, 0x24, 0xb7, 0xc7, 0x7f, 0xf8, 0x18,\n\t0xf0, 0x81, 0xf7, 0xf9, 0xb7, 0xb9, 0xc6, 0x47, 0xf0, 0xfc, 0x35, 0x31, 0x7f, 0x06, 0x2f, 0x30,\n\t0xcd, 0x62, 0x6c, 0xd0, 0x4c, 0x6f, 0x50, 0x30, 0x32, 0x12, 0xfc, 0xc7, 0x50, 0xbf, 0x0e, 0x5e,\n\t0xe5, 0x8f, 0x0a, 0xd4, 0x76, 0xf5, 0x78, 0x02, 0x7c, 0x9a, 0x9f, 0xe2, 0xd7, 0xe3, 0x23, 0x0d,\n\t0xe1, 0x39, 0x19, 0xce, 0xbf, 0x6a, 0x9e, 0x66, 0x93, 0xfc, 0x2a, 0x83, 0x76, 0x8e, 0x8e, 0x79,\n\t0x49, 0x7c, 0x92, 0x9b, 0xe5, 0xcd, 0x02, 0xa1, 0x73, 0x09, 0xcc, 0xb9, 0xc4, 0x1e, 0x67, 0xf2,\n\t0xbc, 0xc1, 0xe0, 0x4c, 0x73, 0x31, 0xee, 0xa1, 0x67, 0x89, 0xfe, 0x1f, 0x12, 0xfd, 0x1d, 0x07,\n\t0x37, 0xf7, 0x6d, 0x13, 0x0d, 0x12, 0xb3, 0xf9, 0x7e, 0x32, 0x76, 0x0b, 0xbf, 0x94, 0xb6, 0x53,\n\t0x33, 0xf3, 0xad, 0x44, 0x16, 0x16, 0xe9, 0xd8, 0x4e, 0x8c, 0x33, 0xed, 0x36, 0xd5, 0xb1, 0x1f,\n\t0xe8, 0x20, 0x7c, 0xca, 0x0f, 0x1c, 0xd4, 0xa9, 0xb6, 0xa8, 0xdf, 0x1e, 0x2e, 0xa5, 0xcc, 0x6f,\n\t0xac, 0xb4, 0xbe, 0x07, 0x4b, 0xe8, 0xf3, 0x03, 0x9f, 0x52, 0x79, 0x93, 0x2a, 0xda, 0xa7, 0x8a,\n\t0x08, 0xa7, 0xb6, 0x79, 0x71, 0x29, 0x73, 0x57, 0x97, 0x32, 0xf7, 0xd3, 0x4c, 0xe6, 0x7e, 0x9d,\n\t0xc9, 0xdc, 0x6f, 0x33, 0x99, 0x3b, 0x9f, 0xc9, 0xa5, 0x3f, 0x67, 0x72, 0xe9, 0x62, 0x26, 0x73,\n\t0x57, 0x33, 0x99, 0xfb, 0xea, 0x1f, 0xb9, 0x64, 0xdc, 0xa0, 0xfc, 0xed, 0x7f, 0x03, 0x00, 0x00,\n\t0xff, 0xff, 0xf6, 0x96, 0x19, 0xdc, 0x8d, 0x0e, 0x00, 0x00,\n}\n", "meta": {"content_hash": "6d840c8c1e39f5374cc518b52d4ce2cf", "timestamp": "", "source": "github", "line_count": 3304, "max_line_length": 221, "avg_line_length": 27.69128329297821, "alnum_prop": 0.651182617059415, "repo_name": "jabley/cf-metrics", "id": "b5ced21de147f2f22cac093714b7d399ff0de363", "size": "91492", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/src/github.com/gogo/protobuf/test/types/combos/unsafemarshaler/types.pb.go", "mode": "33188", "license": "mit", "language": [{"name": "Go", "bytes": "19148"}, {"name": "Makefile", "bytes": "358"}]}} +{"text": "import cgi\r\nimport wsgiref\r\nimport logging\r\nimport datetime\r\nimport time\r\n\r\nfrom geohash import Geohash\r\nfrom shardedcounter import *\r\nfrom boundsSplitting import *\r\n\r\nfrom urlparse import urlparse\r\n\r\nfrom django.utils import simplejson\r\n\r\nfrom google.appengine.api import users\r\nfrom google.appengine.ext import webapp\r\nfrom google.appengine.ext.webapp.util import run_wsgi_app\r\nfrom google.appengine.ext import db\r\n\r\nclass BikeBingle(db.Model):\r\n occuredOn = db.DateTimeProperty()\r\n enteredOn = db.DateTimeProperty(auto_now_add=True)\r\n \r\n position = db.GeoPtProperty()\r\n description = db.TextProperty()\r\n \r\n enteredBy = db.UserProperty()\r\n \r\n injuryIndex = db.IntegerProperty()\r\n type = db.IntegerProperty()\r\n link = db.LinkProperty()\r\n geoHash = db.StringProperty()\r\n\r\nclass BikeBingleHighRes(db.Model):\r\n type = db.IntegerProperty()\r\n position = db.GeoPtProperty()\r\n geoHash = db.StringProperty()\r\n\r\nclass BikeBingleMediumRes(db.Model):\r\n type = db.IntegerProperty()\r\n position = db.GeoPtProperty()\r\n geoHash = db.StringProperty()\r\n\r\nclass BikeBingleLowRes(db.Model):\r\n type = db.IntegerProperty()\r\n position = db.GeoPtProperty()\r\n geoHash = db.StringProperty()\r\n\r\ndef getQueryForLengthSquared(lengthSquared):\r\n if lengthSquared < 0.015:\r\n return BikeBingle.all()\r\n elif lengthSquared < 0.8:\r\n return BikeBingleHighRes.all()\r\n elif lengthSquared < 800:\r\n return BikeBingleMediumRes.all()\r\n else:\r\n return BikeBingleLowRes.all()\r\n\r\nclass test1(webapp.RequestHandler):\r\n def get(self):\r\n self.response.headers['Content-Type'] = 'text/plain'\r\n #self.response.out.write('Hello, webapp World!')\r\n \r\n #the name will be obtained from a URL something like\r\n # this http://localhost:8080/server/?name=ImReallyGood\r\n name = self.request.get(\"name\")\r\n self.response.out.write('hello ' + name)\r\n\r\nclass DeleteBingle(webapp.RequestHandler):\r\n def post(self):\r\n \r\n respBody = 'false'\r\n \r\n bingleId = self.request.body\r\n logging.info(\"request to delete a bingle with id :\" + bingleId + \":\")\r\n \r\n if len(bingleId) == 0:\r\n #no bingle id given so return\r\n respBody = 'false'\r\n else:\r\n currentUser = users.get_current_user()\r\n if not currentUser:\r\n #no user logged in so return\r\n logging.warn(\"no user logged in, cannot delete from db\")\r\n else:\r\n entity = BikeBingle.get_by_id(int(bingleId))\r\n if not entity:\r\n #no entity returnefd as it mustn't be in the DB so just return\r\n logging.warn(\"no entity found with key \" + bingleId)\r\n else:\r\n if currentUser != entity.enteredBy:\r\n #then the user that entered this entity is not the one trying to delete it\r\n logging.warn(\"current user does not match user trying to delete item\")\r\n else:\r\n ChangeCountForBingleType(entity.type,-1)\r\n entity.delete()\r\n respBody = 'true'\r\n \r\n \r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.headers['Content-Length'] = len(respBody)\r\n \r\n self.response.out.write(respBody)\r\n \r\n \r\n\r\nclass AddBingle(webapp.RequestHandler):\r\n def post(self):\r\n args = simplejson.loads(self.request.body)\r\n \r\n aBingle = self.getBingleFromJsonData(args)\r\n \r\n #calculate the geohash value for the position\r\n latitude = aBingle.position.lat\r\n longitude = aBingle.position.lon\r\n #yes it needs double brackets around the lat,long\r\n pthash = Geohash((latitude,longitude))\r\n aBingle.geoHash = str(pthash)\r\n aBingle.put()\r\n ChangeCountForBingleType(aBingle.type,1)\r\n \r\n #now add it to the low res table\r\n self.addToHighResIfNecessary(latitude,longitude)\r\n \r\n logging.info(\"bingle added to database with id\" + str(aBingle.key().id()))\r\n \r\n def getRoundedValueHigh(self, latOrLng):\r\n return round(latOrLng,2)\r\n \r\n def getRoundedValueMedium(self, latOrLng):\r\n return round(latOrLng,1)\r\n \r\n def getRoundedValueLow(self, latOrLng):\r\n return round(latOrLng/2.)*2\r\n\r\n def addToHighResIfNecessary(self,lat,lng):\r\n latitude = self.getRoundedValueHigh(lat)\r\n longitude = self.getRoundedValueHigh(lng)\r\n \r\n pthash = Geohash((latitude,longitude))\r\n geoHashString = str(pthash)\r\n \r\n q = BikeBingleHighRes.all()\r\n q.filter(\"geoHash =\", geoHashString)\r\n res = q.fetch(1)\r\n \r\n #logging.info(\"found LODs\" + str(len(res)))\r\n \r\n if len(res) == 0:\r\n logging.info(\"added high res\")\r\n bblr = BikeBingleHighRes(\r\n position=db.GeoPt(lat,lng),\r\n geoHash = geoHashString,\r\n type = -2\r\n )\r\n bblr.put()\r\n self.addToMediumResIfNecessary(lat, lng)\r\n\r\n def addToMediumResIfNecessary(self,lat,lng):\r\n latitude = self.getRoundedValueMedium(lat)\r\n longitude = self.getRoundedValueMedium(lng)\r\n \r\n pthash = Geohash((latitude,longitude))\r\n geoHashString = str(pthash)\r\n \r\n q = BikeBingleMediumRes.all()\r\n q.filter(\"geoHash =\", geoHashString)\r\n res = q.fetch(1)\r\n \r\n #logging.info(\"found LODs\" + str(len(res)))\r\n \r\n if len(res) == 0:\r\n logging.info(\"added med res\")\r\n bblr = BikeBingleMediumRes(\r\n position=db.GeoPt(lat,lng),\r\n geoHash = geoHashString,\r\n type = -2\r\n )\r\n bblr.put()\r\n self.addToLowResIfNecessary(lat, lng)\r\n\r\n \r\n def addToLowResIfNecessary(self,lat,lng):\r\n latitude = self.getRoundedValueLow(lat)\r\n longitude = self.getRoundedValueLow(lng)\r\n \r\n pthash = Geohash((latitude,longitude))\r\n geoHashString = str(pthash)\r\n \r\n q = BikeBingleLowRes.all()\r\n q.filter(\"geoHash =\", geoHashString)\r\n res = q.fetch(1)\r\n \r\n #logging.info(\"found LODs\" + str(len(res)))\r\n \r\n if len(res) == 0:\r\n logging.info(\"added low res\")\r\n bblr = BikeBingleLowRes(\r\n position=db.GeoPt(lat,lng),\r\n geoHash = geoHashString,\r\n type = -2\r\n )\r\n bblr.put()\r\n \r\n \r\n def makeLinkValid(self, url):\r\n if len(url) == 0:\r\n return url\r\n elif url.startswith('http://'):\r\n return url\r\n else:\r\n return 'http://' + url\r\n \r\n \r\n def getBingleFromJsonData(self, jsonData):\r\n \r\n occuredOnDate = datetime.datetime.strptime(jsonData['occuredOn'], \"%Y-%m-%d %H:%M:%S\");\r\n desc = jsonData['description']\r\n \r\n pos = jsonData['position']\r\n lat = pos['lat']\r\n lng =pos['lng']\r\n \r\n injury = jsonData['injuryIndex']\r\n typet = jsonData['type']\r\n linkt = jsonData['link']\r\n linkt = self.makeLinkValid(linkt)\r\n \r\n \r\n if len(linkt) == 0:\r\n centerBB = BikeBingle(enteredBy=users.get_current_user(),\r\n occuredOn=occuredOnDate,\r\n enteredOn=datetime.datetime.today(),\r\n description=desc,\r\n position=db.GeoPt(lat,lng),\r\n injuryIndex=injury,\r\n type=typet\r\n )\r\n else:\r\n centerBB = BikeBingle(enteredBy=users.get_current_user(),\r\n occuredOn=occuredOnDate,\r\n enteredOn=datetime.datetime.today(),\r\n description=desc,\r\n position=db.GeoPt(lat,lng),\r\n injuryIndex=injury,\r\n type=typet,\r\n link=linkt\r\n )\r\n return centerBB\r\n \r\n \r\nclass GetBingleCount(webapp.RequestHandler):\r\n def get(self):\r\n result = 0\r\n \r\n bingleType = self.request.get(\"type\")\r\n if bingleType:\r\n result = GetCountForBingleType(bingleType)\r\n else:\r\n result = GetCountForAllBingleTypes()\r\n \r\n respBody = str(result)\r\n \r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.headers['Content-Length'] = len(respBody)\r\n self.response.out.write(respBody)\r\n \r\nclass GetLatestBingles(webapp.RequestHandler):\r\n def get(self):\r\n \r\n bingles = self.getLatestBingles()\r\n \r\n list = []\r\n for aBingle in bingles:\r\n list.append(getBingleAsSimplePythonObject(aBingle))\r\n \r\n data = simplejson.dumps(list,indent=4)\r\n self.response.headers['Content-Length'] = len(data)\r\n self.response.out.write(data)\r\n\r\n\r\n def getLatestBingles(self):\r\n q = BikeBingle.all()\r\n q.order(\"-enteredOn\")\r\n res = q.fetch(10)\r\n return res\r\n\r\nclass GetBingles(webapp.RequestHandler):\r\n def __init__(self):\r\n self.__isLowRes = False\r\n \r\n def get(self):\r\n \r\n\r\n start_time = datetime.datetime.now()\r\n \r\n #url would be something like\r\n # http://localhost:8080/getbingles/?neLatitude=1.23456&neLongitude=2.3456789&swLatitude=3.456789012&swLongitude=4.567890123\r\n \r\n neLat = self.request.get(\"neLatitude\")\r\n neLng = self.request.get(\"neLongitude\")\r\n swLat = self.request.get(\"swLatitude\")\r\n swLng = self.request.get(\"swLongitude\")\r\n isUserOnly = self.request.get(\"isuseronly\")\r\n isLowRes = self.request.get(\"islowres\")\r\n \r\n #if not isLowRes:\r\n # self.__isLowRes = False\r\n #elif isLowRes == 'true':\r\n # self.__isLowRes = True\r\n #else:\r\n # self.__isLowRes = False\r\n #respString = 'ne=' + neLat + \", \" + neLng + \" sw=\" + swLat + \", \" + swLng\r\n self.__isLowRes = True\r\n\r\n #logging.info(\"getting URL params = \" + str(datetime.datetime.now() - start_time))\r\n\r\n #start_time = datetime.datetime.now()\r\n\r\n if not isUserOnly:\r\n bingles = self.getBingles(neLat, neLng, swLat, swLng)\r\n elif isUserOnly == 'true':\r\n bingles = self.getBinglesForCurrentUser()\r\n else:\r\n bingles = self.getBingles(neLat, neLng, swLat, swLng)\r\n \r\n #logging.info(\"getting bingles = \" + str(datetime.datetime.now() - start_time))\r\n #start_time = datetime.datetime.now()\r\n \r\n list = []\r\n for aBingle in bingles:\r\n list.append(getBingleAsSimplePythonObject(aBingle))\r\n \r\n #logging.info(\"bingles to simple python = \" + str(datetime.datetime.now() - start_time))\r\n #start_time = datetime.datetime.now()\r\n \r\n ##logging.info(\"found bingles count = \" + str(len(list)))\r\n data = simplejson.dumps(list,indent=4)\r\n #logging.info('generated JSON: ' + data)\r\n \r\n #logging.info(\"simple python to json str = \" + str(datetime.datetime.now() - start_time))\r\n \r\n #self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.headers['Content-Length'] = len(data)\r\n self.response.out.write(data)\r\n \r\n def getBingles(self, neLat, neLng, swLat, swLng):\r\n fneLat = float(neLat)\r\n fneLng = float(neLng)\r\n fswLat = float(swLat)\r\n fswLng = float(swLng)\r\n \r\n start_time = datetime.datetime.now()\r\n \r\n res = []\r\n splitBounds = getSplitBounds(fneLat, fneLng, fswLat, fswLng)\r\n lengthSquared = getLengthSquaredOfSplitBounds(splitBounds)\r\n \r\n #logging.info(\"length squared = \" + str(lengthSquared))\r\n #logging.info(\" getting split bounds = \" + str(datetime.datetime.now() - start_time))\r\n #logging.info('no of split bounds = '+str(len(splitBounds)))\r\n \r\n for sb in splitBounds:\r\n\r\n ineLat, ineLng, iswLat, iswLng = sb\r\n \r\n #logging.info(str(sb))\r\n \r\n neGeoHash = Geohash((ineLat,ineLng))\r\n swGeoHash = Geohash((iswLat,iswLng))\r\n \r\n if self.__isLowRes:\r\n #q = BikeBingleLowRes.all()\r\n q = getQueryForLengthSquared(lengthSquared)\r\n else:\r\n q = BikeBingle.all()\r\n q.filter(\"geoHash <\", str(neGeoHash))\r\n q.filter(\"geoHash >\", str(swGeoHash))\r\n \r\n greetings = q.fetch(500) \r\n \r\n #logging.info('no found from db = '+str(len(greetings)))\r\n res = res + greetings\r\n\r\n #for aBingle in greetings:\r\n # #if (aBingle.position.lat < ineLat) & \r\n # (aBingle.position.lat > iswLat) & \r\n # (aBingle.position.lon < ineLng) & (aBingle.position.lon > iswLng):\r\n # res.append(aBingle)\r\n #logging.info('no found from db after strip = '+str(len(res)))\r\n \r\n \r\n return res\r\n \r\n \r\n \r\n def getBinglesForCurrentUser(self):\r\n user = users.get_current_user()\r\n if not user:\r\n return []\r\n \r\n q = BikeBingle.all()\r\n q.filter(\"enteredBy =\", user)\r\n q.order(\"enteredOn\")\r\n \r\n res = q.fetch(500)\r\n return res\r\n\r\n \r\ndef getBingleAsSimplePythonObject(aBingle):\r\n if aBingle.type == -2:\r\n bingleData = {'id': aBingle.key().id(),\r\n 'position': {'lat':aBingle.position.lat,'lng':aBingle.position.lon},\r\n 'type':aBingle.type\r\n }\r\n return bingleData\r\n else:\r\n #userEmail = aBingle.enteredBy.email()\r\n #userNickName = aBingle.enteredBy.nickname()\r\n #TODO - figure out what I was meant to do with this\r\n #userEmail = ''\r\n #userNickName = ''\r\n \r\n bingleData = {'id': aBingle.key().id(),\r\n 'description': str(aBingle.description),\r\n 'occuredOn': str(aBingle.occuredOn),\r\n 'enteredOn': str(aBingle.enteredOn),\r\n 'position': {'lat':aBingle.position.lat,'lng':aBingle.position.lon},\r\n #'enteredBy': {'name':userNickName,'email':userEmail},\r\n 'injuryIndex': aBingle.injuryIndex,\r\n 'type':aBingle.type,\r\n 'link':str(aBingle.link)\r\n }\r\n return bingleData\r\n \r\n \r\n\r\nclass LoggedInUser(webapp.RequestHandler):\r\n def get(self):\r\n user = users.get_current_user()\r\n\r\n if user:\r\n logging.info(user.email() + ' logged in')\r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.out.write(user.nickname() + ' ' + user.email())\r\n else:\r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.out.write('')\r\n\r\n\r\nclass LoginPage(webapp.RequestHandler):\r\n def get(self):\r\n user = users.get_current_user()\r\n\r\n tabName = self.request.get(\"tabname\")\r\n if not tabName:\r\n tabName = 'add'\r\n\r\n if user:\r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.out.write(user.nickname() + ' ' + user.email() + ' isLoggedIn')\r\n else:\r\n o = urlparse(self.request.uri)\r\n rootUrl = o[0] + \"://\" + o[1] + \"/\"\r\n queryBit = \"?tab=\" + tabName\r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.out.write(users.create_login_url(rootUrl + queryBit))\r\n \r\n #self.redirect(users.create_login_url(self.request.uri))\r\n\r\nclass LogoutPage(webapp.RequestHandler):\r\n def get(self):\r\n user = users.get_current_user()\r\n\r\n if user:\r\n self.redirect(users.create_logout_url(self.request.uri))\r\n else:\r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.out.write('You are not logged in ');\r\n \r\nclass Cleanup(webapp.RequestHandler):\r\n def get(self):\r\n user = users.get_current_user()\r\n\r\n if user:\r\n if users.is_current_user_admin():\r\n #self.__doCleanup()\r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.out.write('remember lock, you removed this functionality to prevent accidents');\r\n else:\r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.out.write('you are not an administrator');\r\n else:\r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.out.write('no user logged in');\r\n \r\n def __doCleanup(self):\r\n logging.info('doing cleanup')\r\n res = CounterShard.all().fetch(500)\r\n if len(res) != 0:\r\n db.delete(res)\r\n else:\r\n logging.info('counter shard empty')\r\n \r\n res = BikeBingleLowRes.all().fetch(500)\r\n if len(res) != 0:\r\n db.delete(res)\r\n else:\r\n logging.info('BikeBingleLowRes empty')\r\n \r\n res = BikeBingleMediumRes.all().fetch(500)\r\n if len(res) != 0:\r\n db.delete(res)\r\n else:\r\n logging.info('BikeBingleMediumRes empty')\r\n \r\n res = BikeBingleHighRes.all().fetch(500)\r\n if len(res) != 0:\r\n db.delete(res)\r\n else:\r\n logging.info('BikeBingleHighRes empty')\r\n \r\n res = BikeBingle.all().fetch(500)\r\n if len(res) != 0:\r\n db.delete(res)\r\n else:\r\n logging.info('BikeBingle empty')\r\n logging.info('cleanup complete')\r\n self.response.headers['Content-Type'] = 'text/plain'\r\n self.response.out.write('cleanup complete');\r\n \r\n \r\n\r\napplication = webapp.WSGIApplication(\r\n [('/server/',test1),\r\n ('/getbingles/',GetBingles),\r\n ('/getlatestbingles/',GetLatestBingles),\r\n ('/addbingle/',AddBingle),\r\n ('/deletebingle/',DeleteBingle),\r\n ('/getbinglecount/',GetBingleCount),\r\n ('/login/',LoginPage),\r\n ('/logout/',LogoutPage),\r\n ('/cleanup/',Cleanup),\r\n ('/user/',LoggedInUser)],\r\n debug=True\r\n )\r\n\r\ndef main():\r\n run_wsgi_app(application)\r\n #wsgiref.handlers.CGIHandler.run(application)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n main()", "meta": {"content_hash": "77a695e2471195033d44797c20c5ab18", "timestamp": "", "source": "github", "line_count": 554, "max_line_length": 132, "avg_line_length": 35.691335740072205, "alnum_prop": 0.5119607545643049, "repo_name": "lachlanhurst/BikeBingle", "id": "2d51e1bd753df5afb83b300916cbb854d24a2378", "size": "19773", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ServerMain.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "70793"}, {"name": "Java", "bytes": "184075"}, {"name": "JavaScript", "bytes": "10"}, {"name": "Python", "bytes": "31472"}]}} +{"text": "'use strict';\nvar tap = require('tap');\nvar test = tap.test;\nvar util = require('util');\n\ntest('proper exit on uncaughtException', {skip: true}, function(t) {\n process.on('uncaughtException', function(err) {\n if (err.message === 'oops') {\n //console.log(\"ok got expected message: %s\", err.message);\n t.pass(util.format(\"ok got expected message: %s\", err.message));\n }\n else {\n throw err;\n }\n });\n\n var cls = require('../../index.js');\n var ns = cls.createNamespace('x');\n ns.run(function() {\n throw new Error('oops');\n });\n});\n", "meta": {"content_hash": "24c2235617b988df3d2a81668064ca6f", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 70, "avg_line_length": 25.59090909090909, "alnum_prop": 0.5914742451154529, "repo_name": "Jeff-Lewis/cls-hooked", "id": "c1bd769de9e5cf29afc811ce44206377751270a9", "size": "563", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/tap/proper-exit.tap.js", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "JavaScript", "bytes": "125102"}]}} +{"text": "<?php\n\nnamespace Demagog\\WebBundle\\Response;\n\nuse Symfony\\Component\\HttpFoundation\\Response;\n\nclass JSONResponse extends Response\n{\n public function __construct($payload)\n {\n parent::__construct(json_encode($payload), 200, [\n 'Content-Type' => 'application/json'\n ]);\n }\n}\n", "meta": {"content_hash": "5a4920f38caf89669cc3c31276e4c444", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 57, "avg_line_length": 20.466666666666665, "alnum_prop": 0.6514657980456026, "repo_name": "Demagog2/Demagog.cz", "id": "4821e76ae8cbb3f63a162bc34dcc08aa606ce6c8", "size": "307", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Demagog/WebBundle/Response/JSONResponse.php", "mode": "33188", "license": "mit", "language": [{"name": "PHP", "bytes": "179013"}]}} +{"text": "\n\"use strict\";\ndefine(['./DvtToolkit', './DvtSubcomponent'], function(dvt) {\n // Internal use only. All APIs and functionality are subject to change at any time.\n // Map the D namespace to dvt, which is used to provide access across partitions.\n var D = dvt;\n /**\n * The base class for tree components.\n * @extends {DvtBaseComponent}\n * @class The base class for tree components.\n * @constructor\n * @export\n */\nvar DvtBaseTreeView = function() {};\n\nDvtObj.createSubclass(DvtBaseTreeView, DvtBaseComponent, 'DvtBaseTreeView');\n\n/**\n * Initializes the tree view.\n * @param {DvtContext} context The rendering context.\n * @param {object} callback The function that should be called to dispatch component events.\n * @param {object} callbackObj The object context for the callback function\n * @protected\n */\nDvtBaseTreeView.prototype.Init = function(context, callback, callbackObj) {\n DvtBaseTreeView.superclass.Init.call(this, context, callback, callbackObj);\n\n // Create the event handler and add event listeners\n this._eventHandler = this.CreateEventManager(this, context, this.__dispatchEvent, this);\n this._eventHandler.addListeners(this);\n\n // Drag and drop support\n this._dragSource = new DvtDragSource(context);\n this._dropTarget = new DvtBaseTreeDropTarget(this);\n this._eventHandler.setDragSource(this._dragSource);\n\n /**\n * Field used to store the legend displayable during render.\n * @private\n */\n this._legend = null;\n\n // boolean to indicate whether or not this view has current keyboard focus\n this._hasFocus = false;\n\n // String to indicate the id of the node that should get keyboard focus\n // Used when an event causes the view to re-render or animate and we want to re-set the keyboard focus to a\n // non-default node, for example when we\n // 1. drill up (set keyboard focus to the node that was the previous, drilled-in root of the treemap)\n // 2. restore a treemap after isolating a node (set focus to the node that was previously isolated)\n // 3. expand or collapse a sunburst node (set focus to the node that was expanded/collapsed)\n this._navigableIdToFocus = null;\n};\n\n/**\n * @override\n */\nDvtBaseTreeView.prototype.SetOptions = function(options) {\n if (options) {\n this.Options = this.Defaults.calcOptions(options);\n\n // Disable animation for canvas and xml\n if (!DvtAgent.isEnvironmentBrowser()) {\n this.Options['animationOnDisplay'] = 'none';\n this.Options['animationOnDataChange'] = 'none';\n }\n }\n else if (!this.Options)\n this.Options = this.GetDefaults();\n};\n\n/**\n * Renders the component using the specified options. If no options is supplied to a component\n * that has already been rendered, this function will rerender the component with the\n * specified size.\n * @param {object} options The new options object.\n * @param {number} width The width of the component.\n * @param {number} height The height of the component.\n * @export\n */\nDvtBaseTreeView.prototype.render = function(options, width, height) \n{\n // Update if a new options object has been provided or initialize with defaults if needed.\n var bNewOptions = (options || !this.Options);\n this.SetOptions(options);\n\n // Process the options object\n var root = this._processNodes();\n this.ApplyParsedProperties({root: root});\n\n // Update the width and height if provided\n if (!isNaN(width) && !isNaN(height)) {\n this.Width = width;\n this.Height = height;\n }\n\n // Hide any currently shown tooltips\n if (this._eventHandler)\n this._eventHandler.hideTooltip();\n\n // Relayout the component (for resize or new data)\n var availSpace = new DvtRectangle(0, 0, this.Width, this.Height);\n this.Layout(availSpace);\n\n // Create a new container and render the component into it\n var container = new DvtContainer(this.getCtx());\n this.addChild(container);\n\n // content facet: create afContext\n if (this._templates) {\n this._afContext = new DvtAfContext(this.getCtx(), this._eventHandler);\n //remove any components that don't fit in the tree node\n this._afContext.setRmIfNotFit(true);\n }\n\n this.Render(container, availSpace);\n\n // Animation Support\n // Stop any animation in progress\n if (this.Animation) {\n this.AnimationStopped = true;\n this.Animation.stop();\n }\n\n // Construct the new animation playable\n var animationOnDataChange = this.getOptions()['animationOnDataChange'];\n var bounds = new DvtRectangle(0, 0, this.Width, this.Height);\n var bBlackBoxUpdate = false; // true if this is a black box update animation\n if (!this._container) {\n this.Animation = this.GetDisplayAnimation(container, bounds);\n }\n else if (animationOnDataChange && bNewOptions) {\n // AnimationOnDataChange\n if (DvtBlackBoxAnimationHandler.isSupported(animationOnDataChange)) {\n // Black Box Animation\n this.Animation = DvtBlackBoxAnimationHandler.getCombinedAnimation(this.getCtx(), animationOnDataChange, this._container, container, bounds, this.AnimationDuration);\n bBlackBoxUpdate = true;\n }\n else if (this._oldRoot && animationOnDataChange == 'auto') {\n // Data Change Animation\n // Create the animation handler, calc, and play the animation\n this._deleteContainer = this.GetDeleteContainer();\n this.addChild(this._deleteContainer);\n var ah = new DvtBaseTreeAnimationHandler(this.getCtx(), this._deleteContainer);\n ah.animate(this._oldRoot, this._root, this._oldAncestors, this._ancestors);\n this.Animation = ah.getAnimation(true);\n }\n }\n\n // Clear out the old info, not needed anymore\n this._oldRoot = null;\n this._oldAncestors = null;\n\n // If an animation was created, play it\n if (this.Animation) {\n // Disable event listeners temporarily\n this._eventHandler.removeListeners(this);\n\n // Start the animation\n this.Animation.setOnEnd(this.OnAnimationEnd, this);\n this.Animation.play();\n }\n\n // Clean up the old container. If doing black box animation, store a pointer and clean\n // up after animation is complete. Otherwise, remove immediately.\n if (bBlackBoxUpdate) {\n this._oldContainer = this._container;\n }\n else if (this._container) {\n // Not black box animation, so clean up the old contents\n this.removeChild(this._container);\n }\n\n // Update the pointer to the new container\n this._container = container;\n\n // Selection Support\n if (bNewOptions) {\n // Update the selection manager with the initial selections. This must be done after\n // the shapes are created to apply the selection effects.\n this._processInitialSelections();\n }\n else\n this.ReselectNodes(); // Resize or Rerender: Reselect the nodes using the selection handler's state\n\n // Update the event manager with the initial focus\n this._processInitialFocus(!this.Animation);\n\n // Process the highlightedCategories. We'll also do this in the animation end listener to avoid conflicts with insert\n // animations.\n if (!this.Animation)\n this._processInitialHighlighting();\n\n this.UpdateAriaAttributes();\n};\n\n\n\n/**\n * Parses the xml and returns the root node.\n * @param {string} xmlString The string to be parsed\n * @return {object} An object containing the parsed properties.\n * @protected\n */\nDvtBaseTreeView.prototype.Parse = function(xmlString) {\n // subclasses should override\n return null;\n};\n\n\n/**\n * Performs layout for the component.\n * @param {DvtRect} availSpace The rectangle within which to perform layout.\n * @protected\n */\nDvtBaseTreeView.prototype.Layout = function(availSpace) {\n // subclasses should override\n};\n\n\n/**\n * Renders the component.\n * @param {DvtContainer} container The container to render within.\n * @param {DvtRectangle} bounds The bounds of the node area.\n * @protected\n */\nDvtBaseTreeView.prototype.Render = function(container, bounds) {\n // subclasses should override\n};\n\n\n/**\n * Renders the background.\n * @param {DvtContainer} container The container to render within.\n * @param {string} defaultStyle The default style string\n * @protected\n */\nDvtBaseTreeView.prototype.RenderBackground = function(container, defaultStyle) {\n // Render an invisible fill for eventing\n var background = new DvtRect(this.getCtx(), 0, 0, this.Width, this.Height);\n background.setInvisibleFill();\n container.addChild(background);\n};\n\n\n/**\n * Lays out the breadcrumbs and updates the available space.\n * @param {DvtRect} availSpace The rectangle within which to perform layout.\n * @protected\n */\nDvtBaseTreeView.prototype.LayoutBreadcrumbs = function(availSpace) {\n if (this._ancestors.length > 0) {\n var rootLabel = this._root ? this._root.getLabel() : null;\n\n if (this._breadcrumbs)\n this._eventHandler.removeComponentKeyboardHandler(this._breadcrumbs.getEventManager());\n\n this._breadcrumbs = DvtTreeBreadcrumbsRenderer.render(this, availSpace, this._ancestors, rootLabel);\n this._eventHandler.addComponentKeyboardHandlerAt(this._breadcrumbs.getEventManager(), 0);\n }\n else {\n if (this._breadcrumbs)\n this._eventHandler.removeComponentKeyboardHandler(this._breadcrumbs.getEventManager());\n\n this._breadcrumbs = null;\n }\n};\n\n\n/**\n * Renders the breadcrumbs.\n * @param {DvtContainer} container The container to render within.\n * @protected\n */\nDvtBaseTreeView.prototype.RenderBreadcrumbs = function(container) {\n // The breadcrumbs are actually already rendered in _layoutBreadcrumbs, so just add it to the tree here.\n if (this._breadcrumbs) {\n container.addChild(this._breadcrumbs);\n }\n};\n\n\n/**\n * Lays out the legend component and updates the available space.\n * @param {DvtRect} availSpace The rectangle within which to perform layout.\n * @protected\n */\nDvtBaseTreeView.prototype.LayoutLegend = function(availSpace) {\n this._legend = DvtTreeLegendRenderer.render(this, availSpace, this._legendSource);\n};\n\n\n/**\n * Renders the legend.\n * @param {DvtContainer} container The container to render within.\n * @protected\n */\nDvtBaseTreeView.prototype.RenderLegend = function(container) {\n // The legend is actually already rendered in _layoutLegend, so just add it to the tree here.\n if (this._legend) {\n container.addChild(this._legend);\n\n // Clear the pointer, since we don't need it anymore\n this._legend = null;\n }\n};\n\n\n/**\n * Renders the empty text message, centered in the available space.\n * @param {DvtContainer} container The container to render within.\n * @protected\n */\nDvtBaseTreeView.prototype.RenderEmptyText = function(container) {\n var options = this.getOptions();\n var emptyText = options['emptyText'];\n if (!emptyText)\n emptyText = DvtBundle.getTranslation(options, 'labelNoData', DvtBundle.UTIL_PREFIX, 'NO_DATA');\n\n DvtTextUtils.renderEmptyText(container, emptyText, new DvtRectangle(0, 0, this.Width, this.Height), this.__getEventManager());\n};\n\n\n/**\n * Checks whether the component has valid data.\n * @return {boolean} True if the component has valid data.\n * @protected\n */\nDvtBaseTreeView.prototype.HasValidData = function() {\n return (this._root && this._root.getSize() > 0);\n};\n\n\n/**\n * Returns the animation to use on initial display of this component.\n * @param {DvtContainer} container The container to render within.\n * @param {DvtRectangle} bounds The bounds of the node area.\n * @return {DvtBaseAnimation} The initial display animation.\n * @protected\n */\nDvtBaseTreeView.prototype.GetDisplayAnimation = function(container, bounds) {\n var animationOnDisplay = this.getOptions()['animationOnDisplay'];\n if (DvtBlackBoxAnimationHandler.isSupported(animationOnDisplay))\n return DvtBlackBoxAnimationHandler.getInAnimation(this.getCtx(), animationOnDisplay, container, bounds, this.AnimationDuration);\n else\n return null;\n};\n\n\n/**\n * Hook for cleaning up animation behavior at the end of the animation.\n * @protected\n */\nDvtBaseTreeView.prototype.OnAnimationEnd = function() {\n // Remove the container containing the delete animations\n if (this._deleteContainer) {\n this.removeChild(this._deleteContainer);\n this._deleteContainer = null;\n }\n\n // Clean up the old container used by black box updates\n if (this._oldContainer) {\n this.removeChild(this._oldContainer);\n this._oldContainer = null;\n }\n\n // Reset the animation stopped flag\n this.AnimationStopped = false;\n\n // Remove the animation reference\n this.Animation = null;\n\n // Restore event listeners\n this._eventHandler.addListeners(this);\n\n // Restore visual effects on node with keyboard focus\n this._processInitialFocus(true);\n\n // Process the highlightedCategories\n this._processInitialHighlighting();\n};\n\n\n/**\n * Creates a container that can be used for storing delete animation content.\n * @return {DvtContainer}\n * @protected\n */\nDvtBaseTreeView.prototype.GetDeleteContainer = function() {\n return new DvtContainer(this.getCtx());\n};\n\n\n/**\n * Returns a keyboard handler that can be used by the view's event manager\n * @param {DvtEventManager} manager The owning event manager\n * @return {DvtKeyboardHandler}\n * @protected\n */\nDvtBaseTreeView.prototype.CreateKeyboardHandler = function(manager)\n{\n return new DvtBaseTreeKeyboardHandler(manager);\n};\n\n\n/**\n * Returns an event manager that will handle events on this view\n * @param {DvtContainer} view\n * @param {DvtContext} context\n * @param {object} callback The function that should be called to dispatch component events.\n * @param {object} callbackObj The object context for the callback function\n * @return {DvtEventManager}\n * @protected\n */\nDvtBaseTreeView.prototype.CreateEventManager = function(view, context, callback, callbackObj)\n{\n return new DvtBaseTreeEventManager(view, context, callback, callbackObj);\n};\n\n\n/**\n * Returns the node that should receive initial keyboard focus when the view first gets focus\n * @param {DvtBaseTreeNode} root The node that should receive initial keyboard focus\n * @return {DvtBaseTreeNode}\n * @protected\n */\nDvtBaseTreeView.prototype.GetInitialFocusedItem = function(root)\n{\n return root;\n};\n\n/**\n * @override\n * @export\n */\nDvtBaseTreeView.prototype.highlight = function(categories) {\n // Update the options\n this.getOptions()['highlightedCategories'] = DvtJSONUtils.clone(categories);\n\n // Perform the highlighting\n DvtCategoryRolloverHandler.highlight(categories, DvtBaseTreeUtils.getAllNodes(this._root), this.getOptions()['highlightMatch'] == 'any');\n};\n\n/**\n * @override\n * @export\n */\nDvtBaseTreeView.prototype.select = function(selection) {\n // Update the options\n var options = this.getOptions();\n options['selection'] = DvtJSONUtils.clone(selection);\n\n // Perform the selection\n if (this._selectionHandler) {\n var targets = DvtBaseTreeUtils.getAllNodes(this._root);\n this._selectionHandler.processInitialSelections(options['selection'], targets);\n }\n};\n\n/**\n * @override\n */\nDvtBaseTreeView.prototype.__getEventManager = function() {\n return this._eventHandler;\n};\n\n/**\n * Returns the maximum depth of the tree.\n * @return {number} The maximum depth of the tree.\n */\nDvtBaseTreeView.prototype.__getMaxDepth = function() {\n return this._maxDepth;\n};\n\n\n/**\n * Returns the node count of the tree.\n * @return {number} The node count of the tree.\n */\nDvtBaseTreeView.prototype.__getNodeCount = function() {\n return this._nodeCount;\n};\n\n/**\n * Applies the parsed properties to this component.\n * @param {object} props An object containing the parsed properties for this component.\n * @protected\n */\nDvtBaseTreeView.prototype.ApplyParsedProperties = function(props) {\n var options = this.getOptions();\n\n // Save the old info for animation support\n this._oldRoot = this._root;\n this._oldAncestors = this._ancestors;\n\n // Save the parsed properties\n this._root = props.root;\n this._ancestors = options['_ancestors'] ? options['_ancestors'] : [];\n this._nodeCount = this._root ? DvtBaseTreeUtils.calcNodeCount(this._root) : 0;\n this._maxDepth = this._root ? DvtBaseTreeUtils.calcMaxDepth(this._root, 0) : 0;\n\n // TODO HZHANG: This uses the weird client side value in seconds\n this.AnimationDuration = DvtStyleUtils.getTimeMilliseconds(options['animationDuration']) / 1000;\n\n this._styles = props.styles ? props.styles : {};\n\n // Selection Support\n if (options['selectionMode'] == 'none')\n this._nodeSelection = null;\n else if (options['selectionMode'] == 'single')\n this._nodeSelection = DvtSelectionHandler.TYPE_SINGLE;\n else\n this._nodeSelection = DvtSelectionHandler.TYPE_MULTIPLE;\n\n if (this._nodeSelection) {\n this._selectionHandler = new DvtSelectionHandler(this._nodeSelection);\n this._initialSelection = options['selection'];\n }\n else\n this._selectionHandler = null;\n\n // Event Handler delegates to other handlers\n this._eventHandler.setSelectionHandler(this._selectionHandler);\n\n // Keyboard Support\n this._eventHandler.setKeyboardHandler(this.CreateKeyboardHandler(this._eventHandler));\n\n // Attribute Groups and Legend Support\n this._legendSource = null;\n this._attrGroups = [];\n if (options['attributeGroups']) {\n var nodes = DvtBaseTreeUtils.getAllNodes(this._root);\n for (var i = 0; i < options['attributeGroups'].length; i++) {\n var attrGroup = options['attributeGroups'][i];\n var agObj = null;\n if (attrGroup['attributeType'] == 'continuous') {\n DvtBaseTreeUtils.calcContinuousAttrGroupsExtents(attrGroup, nodes);\n agObj = new DvtContinuousAttrGroups(attrGroup['min'], attrGroup['max'], attrGroup['minLabel'], attrGroup['maxLabel'], attrGroup['colors']);\n }\n else { // discrete\n agObj = new DvtDiscreteAttrGroups();\n for (var groupIndex = 0; groupIndex < attrGroup['groups'].length; groupIndex++) {\n var group = attrGroup['groups'][groupIndex];\n agObj.add(group['id'], group['label'], {color: group['color'], pattern: group['pattern']});\n }\n }\n this._attrGroups.push({attrGroups: agObj, stampId: attrGroup['S'], id: attrGroup['id']});\n\n // If source wasn't specified, use the first attributeGroups. In ADF no legend unless explicitly specified.\n if (!options['_adf'] && !options['_legendSource'] && i == 0)\n this._legendSource = agObj;\n else if (options['_legendSource'] && options['_legendSource'] == attrGroup['id'])\n this._legendSource = agObj;\n }\n\n // For continuous attribute groups sent from server, evaluate to get the colors\n DvtBaseTreeUtils.processContinuousAttrGroups(this._attrGroups, nodes);\n }\n\n // ADF Context Menus\n var menus = options['_contextMenus'];\n if (menus && menus.length > 0) {\n var contextMenuHandler = new DvtContextMenuHandler(this.getCtx(), menus);\n this._eventHandler.setContextMenuHandler(contextMenuHandler);\n }\n\n // ADF Templates for Content Facet\n var templates = options['_templates'];\n if (templates) {\n this._templates = {};\n\n // The templates object is a mapping from stampId to template definition\n for (var templateKey in templates) {\n var afComponent = DvtAfComponentFactory.parseJsonElement(templates[templateKey]);\n this._templates[templateKey] = afComponent;\n }\n }\n};\n\n\n/**\n * Reselects the selected nodes after a re-render.\n * @protected\n */\nDvtBaseTreeView.prototype.ReselectNodes = function() {\n var selectedNodes = this._selectionHandler ? this._selectionHandler.getSelection() : new Array();\n for (var i = 0; i < selectedNodes.length; i++)\n selectedNodes[i].setSelected(true);\n};\n\n\n/**\n * Update the selection handler with the initial selections.\n * @private\n */\nDvtBaseTreeView.prototype._processInitialSelections = function() {\n if (this._selectionHandler && this._initialSelection) {\n var targets = DvtBaseTreeUtils.getAllNodes(this._root);\n this._selectionHandler.processInitialSelections(this._initialSelection, targets);\n this._initialSelection = null;\n }\n};\n\n/**\n * Update the displayables with the initial highlighting.\n * @private\n */\nDvtBaseTreeView.prototype._processInitialHighlighting = function() {\n var highlightedCategories = this.getOptions()['highlightedCategories'];\n if (highlightedCategories && highlightedCategories.length > 0)\n this.highlight(highlightedCategories);\n};\n\n/**\n * Update the event manager with the initial focused item\n * @param {Boolean} applyVisualEffects True if we want to apply visual effects to indicate which node has\n * keyboard focus.\n * @private\n */\nDvtBaseTreeView.prototype._processInitialFocus = function(applyVisualEffects) {\n\n var initialFocus = null;\n var id = this.__getNavigableIdToFocus();\n\n if (id)\n {\n initialFocus = DvtBaseTreeNode.getNodeById(this._root, id);\n this._eventHandler.setFocus(initialFocus);\n }\n\n if (applyVisualEffects)\n {\n // if we are applying visual effects in response to an event that caused a re-render or animation, and this\n // event specified a non-default node to set keyboard focus on, clear that value now that we've used it\n this.__setNavigableIdToFocus(null);\n }\n\n if (!initialFocus)\n {\n // set the item that has initial keyboard focus to a default if none was previously defined\n initialFocus = this.GetInitialFocusedItem(this._root);\n this._eventHandler.setFocus(initialFocus);\n }\n\n // have the event manager apply any needed visual effects\n // however, do this only if we are not animating so as to prevent the focus visual effect\n // from appearing during the duration of the animation\n if (applyVisualEffects)\n this.setFocused(this.isFocused());\n\n};\n\n\n/**\n * Update the visual effects on view when it receives or loses keyboard focus\n *\n * @param {boolean} isFocused\n */\nDvtBaseTreeView.prototype.setFocused = function(isFocused)\n{\n this._hasFocus = isFocused;\n this._eventHandler.setFocused(isFocused);\n};\n\n\n/**\n * Returns true if the view currently has keyboard focus\n * @return {boolean}\n */\nDvtBaseTreeView.prototype.isFocused = function()\n{\n return this._hasFocus;\n};\n\n/**\n * Returns the animation duration, in milliseconds.\n * @return {number}\n */\nDvtBaseTreeView.prototype.__getAnimationDuration = function() {\n return this.AnimationDuration;\n};\n\n/**\n * Returns the content facet template for the given stamp id.\n * @param {string} stampId\n * @return {object}\n */\nDvtBaseTreeView.prototype.__getTemplate = function(stampId) {\n return this._templates ? this._templates[stampId] : null;\n};\n\n/**\n * Returns the afComponent context instance.\n * @return {DvtAfContext}\n */\nDvtBaseTreeView.prototype.__getAfContext = function() {\n return this._afContext;\n};\n\n\n/**\n * Returns the node under the specified coordinates.\n * @param {number} x\n * @param {number} y\n * @return {DvtBaseTreeNode}\n */\nDvtBaseTreeView.prototype.__getNodeUnderPoint = function(x, y) {\n return this._root.getNodeUnderPoint(x, y);\n};\n\n\n/**\n * Returns the clientId of the drag source owner if dragging is supported.\n * @param {array} clientIds\n * @return {string}\n */\nDvtBaseTreeView.prototype.__isDragAvailable = function(clientIds) {\n // Drag and drop supported when selection is enabled, only 1 drag source\n if (this._selectionHandler)\n return clientIds[0];\n else\n return null;\n};\n\n\n/**\n * Returns the row keys for the current drag.\n * @param {DvtBaseTreeNode} node The node where the drag was initiated.\n * @return {array} The row keys for the current drag.\n */\nDvtBaseTreeView.prototype.__getDragTransferable = function(node) {\n // Select the node if not already selected\n if (!node.isSelected()) {\n this._selectionHandler.processClick(node, false);\n this._eventHandler.fireSelectionEvent();\n }\n\n // Gather the rowKeys for the selected objects\n var rowKeys = [];\n var selection = this._selectionHandler.getSelection();\n for (var i = 0; i < selection.length; i++) {\n rowKeys.push(selection[i].getId());\n }\n\n return rowKeys;\n};\n\n\n/**\n * Returns the displayables to use for drag feedback for the current drag.\n * @return {array} The displayables for the current drag.\n */\nDvtBaseTreeView.prototype.__getDragFeedback = function() {\n // This is called after __getDragTransferable, so the selection has been updated already.\n // Gather the displayables for the selected objects\n var displayables = [];\n var selection = this._selectionHandler.getSelection();\n for (var i = 0; i < selection.length; i++) {\n displayables.push(selection[i].getDisplayable());\n }\n\n return displayables;\n};\n\n\n/**\n * Displays drop site feedback for the specified node.\n * @param {DvtBaseTreeNode} node The node for which to show drop feedback, or null to remove drop feedback.\n * @return {DvtDisplayable} The drop site feedback, if any.\n */\nDvtBaseTreeView.prototype.__showDropSiteFeedback = function(node) {\n // Remove any existing drop site feedback\n if (this._dropSiteFeedback) {\n this.removeChild(this._dropSiteFeedback);\n this._dropSiteFeedback = null;\n }\n\n // Create feedback for the node\n if (node) {\n this._dropSiteFeedback = node.getDropSiteFeedback();\n if (this._dropSiteFeedback) {\n var styleDefaults = this.getOptions()['styleDefaults'];\n this._dropSiteFeedback.setSolidFill(styleDefaults['_dropSiteFillColor'], styleDefaults['_dropSiteOpacity']);\n this._dropSiteFeedback.setSolidStroke(styleDefaults['_dropSiteBorderColor']);\n this.addChild(this._dropSiteFeedback);\n }\n }\n\n return this._dropSiteFeedback;\n};\n\n\n/**\n * Processes a breadcrumb drill event.\n * @param {DvtBreadcrumbsDrillEvent} event\n */\nDvtBaseTreeView.prototype.__processBreadcrumbsEvent = function(event) {\n if (event instanceof DvtBreadcrumbsDrillEvent)\n this.__drill(event.getId(), false);\n};\n\n\n/**\n * Performs a drill on the specified node.\n * @param {string} id\n * @param {boolean} bDrillUp True if this is a drill up operation.\n */\nDvtBaseTreeView.prototype.__drill = function(id, bDrillUp) {\n if (bDrillUp && this._root && id == this._root.getId() && this._ancestors.length > 0) {\n // after the drill up completes, set keyboard focus on the node that was the\n // root of the previously drilled-down view\n this.__setNavigableIdToFocus(id);\n\n // Drill up only supported on the root node\n this.__dispatchEvent(new DvtDrillReplaceEvent(this._ancestors[0].id));\n }\n else if (!bDrillUp) // Fire the event\n this.__dispatchEvent(new DvtDrillReplaceEvent(id));\n\n // Hide any tooltips being shown\n this.getCtx().getTooltipManager().hideTooltip();\n};\n\n\n/**\n * Returns the logical object corresponding to the physical target\n * @param {Object} target\n * @return {Object}\n */\nDvtBaseTreeView.prototype.getLogicalObject = function(target)\n{\n return this._eventHandler.GetLogicalObject(target);\n};\n\n\n/**\n * @return {DvtBaseTreeNode} the root tree node.\n */\nDvtBaseTreeView.prototype.getRootNode = function()\n{\n return this._root;\n};\n\n\n/**\n * Returns the id of the node that should get keyboard focus, if the default node should not receive focus.\n * Used when an event causes the view to re-render or animate and we want to set the keyboard focus\n * to a non-default node.\n *\n * @return {String} the id of the node that should receive keyboard focus\n */\nDvtBaseTreeView.prototype.__getNavigableIdToFocus = function() \n{\n return this._navigableIdToFocus;\n};\n\n\n/**\n * Sets the id of the node that should get keyboard focus, if the default node should not receive focus.\n * Used when an event causes the view to re-render or animate and we want to set the keyboard focus\n * to a non-default node.\n *\n * @param {String} id The id of the node that should receive keyboard focus\n */\nDvtBaseTreeView.prototype.__setNavigableIdToFocus = function(id) \n{\n this._navigableIdToFocus = id;\n};\n\n\n/**\n * @return {String} whether nodeSelection is multiple, single, or null.\n */\nDvtBaseTreeView.prototype.__getNodeSelection = function() \n{\n return this._nodeSelection;\n};\n\n/**\n * Creates a node for this view. Subclasses must override.\n * @param {object} nodeOptions The options for the node.\n * @return {DvtBaseTreeNode}\n * @protected\n */\nDvtBaseTreeView.prototype.CreateNode = function(nodeOptions) {\n // subclasses must override\n return null;\n};\n\n/**\n * Helper function to return the bundle prefix for this component.\n * @return {string}\n */\nDvtBaseTreeView.prototype.getBundlePrefix = function() {\n // subclasses must override\n return null;\n};\n\n/**\n * Returns the automation object for this treeView\n * @return {DvtAutomation} The automation object\n * @export\n */\nDvtBaseTreeView.prototype.getAutomation = function() {\n return new DvtTreeAutomation(this);\n};\n\n/**\n * Returns the breadcrumbs object for this treeView\n * Used by automation APIs\n * @return {DvtBreadcrumbs} The breadcrumbs object\n */\nDvtBaseTreeView.prototype.getBreadcrumbs = function() {\n return this._breadcrumbs;\n};\n\n/**\n * Recursively creates and returns the root layer nodes based on the options object. Creates an artificial node if\n * needed for multi-rooted trees.\n * @return {DvtBaseTreeNode}\n * @private\n */\nDvtBaseTreeView.prototype._processNodes = function() {\n var options = this.getOptions();\n if (options['nodes'] == null)\n return null;\n\n // Create each of the root level nodes\n var rootNodes = [];\n // create a boolean map of hidden categories for better performance\n var hiddenCategories = DvtArrayUtils.createBooleanMap(options['hiddenCategories']);\n for (i = 0; i < options['nodes'].length; i++) {\n var nodeOptions = options['nodes'][i];\n\n // Store the index for automation\n nodeOptions['_index'] = i;\n\n // Recursively process the node\n var rootNode = this._processNode(hiddenCategories, nodeOptions);\n if (rootNode)\n rootNodes.push(rootNode);\n }\n\n // Ensure that there's a single root, creating an artificial one if needed\n if (rootNodes.length == 1)\n return rootNodes[0];\n else {\n // Calculate the sum of the child sizes\n var size = 0;\n for (var i = 0; i < rootNodes.length; i++) {\n size += rootNodes[i].getSize();\n }\n\n // Create the actual node and set the children\n var props = {'value': size, bArtificialRoot: true};\n var artificialRoot = this.CreateNode(props);\n artificialRoot.setChildNodes(rootNodes);\n return artificialRoot;\n }\n};\n\n/**\n * Recursively creates and returns the node based on the options object.\n * @param {object} hiddenCategories The boolean map of hidden categories.\n * @param {object} nodeOptions The options for the node to process.\n * @return {DvtBaseTreeNode}\n * @private\n */\nDvtBaseTreeView.prototype._processNode = function(hiddenCategories, nodeOptions) {\n // Don't create if node is hidden\n if (DvtBaseTreeUtils.isHiddenNode(hiddenCategories, nodeOptions))\n return null;\n\n // Create the node\n var node = this.CreateNode(nodeOptions);\n\n // Create child nodes only if this node is expanded\n if (node.isDisclosed()) {\n // Recurse and build the child nodes\n var childNodes = [];\n var childOptions = nodeOptions['nodes'] ? nodeOptions['nodes'] : [];\n for (var childIndex = 0; childIndex < childOptions.length; childIndex++) {\n var childNodeOptions = childOptions[childIndex];\n childNodeOptions['_index'] = childIndex;\n\n var childNode = this._processNode(hiddenCategories, childNodeOptions);\n if (childNode)\n childNodes.push(childNode);\n }\n node.setChildNodes(childNodes);\n }\n\n return node;\n};\n\n/**\n * Annotates nodes with aria flowto properties for VoiceOver navigation\n * @param {DvtBaseTreeNode} root The root node\n * @protected\n */\nDvtBaseTreeView.prototype.UpdateAriaNavigation = function(root) {\n // VoiceOver workaround for bug 20745395\n if (DvtAgent.isTouchDevice() || DvtAgent.isEnvironmentTest()) {\n var nodes = DvtBaseTreeUtils.getAllVisibleNodes(root);\n for (var i = 0; i < nodes.length - 1; i++) {\n // Set the aria flowto property of the current node to the next node's id\n var id = this.getId() + (nodes[i + 1].getId() ? nodes[i + 1].getId() : nodes[i + 1].getLabel());\n // VoiceOver doesn't work well if there are spaces in the id so remove all spaces first\n id = id.replace(/\\s+/g, '');\n nodes[i + 1].getDisplayable().setId(id, true);\n nodes[i].getDisplayable().setAriaProperty('flowto', id);\n }\n }\n};\n// APIs called by the ADF Faces drag source for DvtBaseTreeView\n\n\n/**\n * If this object supports drag, returns the client id of the drag component.\n * Otherwise returns null.\n * @param mouseX the x coordinate of the mouse\n * @param mouseY the x coordinate of the mouse\n * @param clientIds the array of client ids of the valid drag components\n */\nDvtBaseTreeView.prototype.isDragAvailable = function(mouseX, mouseY, clientIds) {\n return this._dragSource.isDragAvailable(clientIds);\n};\n\n\n/**\n * Returns the transferable object for a drag initiated at these coordinates.\n */\nDvtBaseTreeView.prototype.getDragTransferable = function(mouseX, mouseY) {\n return this._dragSource.getDragTransferable(mouseX, mouseY);\n};\n\n\n/**\n * Returns the feedback for the drag operation.\n */\nDvtBaseTreeView.prototype.getDragOverFeedback = function(mouseX, mouseY) {\n return this._dragSource.getDragOverFeedback(mouseX, mouseY);\n};\n\n\n/**\n * Returns an Object containing the drag context info.\n */\nDvtBaseTreeView.prototype.getDragContext = function(mouseX, mouseY) {\n return this._dragSource.getDragContext(mouseX, mouseY);\n};\n\n\n/**\n * Returns the offset to use for the drag feedback. This positions the drag\n * feedback relative to the pointer.\n */\nDvtBaseTreeView.prototype.getDragOffset = function(mouseX, mouseY) {\n return this._dragSource.getDragOffset(mouseX, mouseY);\n};\n\n\n/**\n * Returns the offset from the mouse pointer where the drag is considered to be located.\n */\nDvtBaseTreeView.prototype.getPointerOffset = function(xOffset, yOffset) {\n return this._dragSource.getPointerOffset(xOffset, yOffset);\n};\n\n\n/**\n * Notifies the component that a drag started.\n */\nDvtBaseTreeView.prototype.initiateDrag = function() {\n this._dragSource.initiateDrag();\n};\n\n\n/**\n * Clean up after the drag is completed.\n */\nDvtBaseTreeView.prototype.dragDropEnd = function() {\n this._dragSource.dragDropEnd();\n};\n// APIs called by the ADF Faces drop target for DvtBaseTreeView\n\n\n/**\n * If a drop is possible at these mouse coordinates, returns the client id\n * of the drop component. Returns null if drop is not possible.\n */\nDvtBaseTreeView.prototype.acceptDrag = function(mouseX, mouseY, clientIds) {\n return this._dropTarget.acceptDrag(mouseX, mouseY, clientIds);\n};\n\n\n/**\n * Paints drop site feedback as a drag enters the drop site.\n */\nDvtBaseTreeView.prototype.dragEnter = function() {\n this._dropTarget.dragEnter();\n};\n\n\n/**\n * Cleans up drop site feedback as a drag exits the drop site.\n */\nDvtBaseTreeView.prototype.dragExit = function() {\n this._dropTarget.dragExit();\n};\n\n\n/**\n * Returns the object representing the drop site. This method is called when a valid\n * drop is performed.\n */\nDvtBaseTreeView.prototype.getDropSite = function(mouseX, mouseY) {\n return this._dropTarget.getDropSite(mouseX, mouseY);\n};\n/**\n * Animation handler for tree data objects.\n * @param {DvtContext} context The platform specific context object.\n * @param {DvtContainer} deleteContainer The container where deletes should be moved for animation.\n * @class DvtBaseTreeAnimationHandler\n * @constructor\n */\nvar DvtBaseTreeAnimationHandler = function(context, deleteContainer) {\n this.Init(context, deleteContainer);\n};\n\nDvtObj.createSubclass(DvtBaseTreeAnimationHandler, DvtDataAnimationHandler, 'DvtBaseTreeAnimationHandler');\n\n\n/**\n * Animates the tree component, with support for data changes and drilling.\n * @param {DvtBaseTreeNode} oldRoot The state of the tree before the animation.\n * @param {DvtBaseTreeNode} newRoot The state of the tree after the animation.\n * @param {array} oldAncestors The array of ancestors for the old root node.\n * @param {array} newAncestors The array of ancestors for the new root node.\n */\nDvtBaseTreeAnimationHandler.prototype.animate = function(oldRoot, newRoot, oldAncestors, newAncestors) {\n this._bDrill = false; // true if this is a drilling animation\n this._oldRoot = oldRoot;\n this._oldAncestors = oldAncestors;\n\n // Determine whether this is a drill or data change animation\n if (DvtBaseTreeAnimationHandler._isAncestor(newAncestors, oldRoot) ||\n DvtBaseTreeAnimationHandler._isAncestor(oldAncestors, newRoot))\n {\n // Drilling\n this._bDrill = true;\n var oldList = oldRoot.getDescendantNodes();\n var newList = newRoot.getDescendantNodes();\n oldList.push(oldRoot);\n newList.push(newRoot);\n this.constructAnimation(oldList, newList);\n }\n else {\n // Data Change Animation\n this.constructAnimation([oldRoot], [newRoot]);\n }\n};\n\n\n/**\n * Returns true if the current animation is for a drill operation. The nodes\n * will call this function and handle their animations differently.\n * @return {boolean}\n */\nDvtBaseTreeAnimationHandler.prototype.isDrillAnimation = function() {\n return this._bDrill;\n};\n\n\n/**\n * Returns true if the specified node was previously an ancestor of the old root. A value\n * of true indicates that an insert animation should not be performed on this node.\n * @param {DvtBaseTreeNode} node\n */\nDvtBaseTreeAnimationHandler.prototype.isAncestorInsert = function(node) {\n if (this._bDrill)\n return this._oldRoot.getId() == node.getId() ||\n DvtBaseTreeAnimationHandler._isAncestor(this._oldAncestors, node);\n else\n return false;\n};\n\n\n/**\n * Returns true if the specified node is contained in the array of ancestors.\n * @param {array} ancestors The array of ancestors to search.\n * @param {DvtBaseTreeNode} node The node to search for.\n * @return {boolean}\n */\nDvtBaseTreeAnimationHandler._isAncestor = function(ancestors, node) {\n if (!node || !ancestors)\n return false;\n\n // Iterate through the array and search for the node\n for (var i = 0; i < ancestors.length; i++) {\n if (ancestors[i]['id'] == node.getId())\n return true;\n }\n\n // No match found\n return false;\n};\n/**\n * Drop Target event handler for DvtBaseTreeView\n * @param {DvtBaseTreeView} view\n * @class DvtBaseTreeDropTarget\n * @extends {DvtDropTarget}\n * @constructor\n */\nvar DvtBaseTreeDropTarget = function(view) {\n this._view = view;\n};\n\nDvtObj.createSubclass(DvtBaseTreeDropTarget, DvtDropTarget, 'DvtBaseTreeDropTarget');\n\n\n/**\n * @override\n */\nDvtBaseTreeDropTarget.prototype.acceptDrag = function(mouseX, mouseY, clientIds) {\n // If there is no node under the point, then don't accept the drag\n var node = this._view.__getNodeUnderPoint(mouseX, mouseY);\n if (!node) {\n this._view.__showDropSiteFeedback(null);\n return null;\n }\n else if (node != this._dropSite) {\n this._view.__showDropSiteFeedback(node);\n this._dropSite = node;\n }\n\n // Return the first clientId, since this component has only a single drag source\n return clientIds[0];\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeDropTarget.prototype.dragExit = function() {\n // Remove drop site feedback\n this._view.__showDropSiteFeedback(null);\n this._dropSite = null;\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeDropTarget.prototype.getDropSite = function(mouseX, mouseY) {\n var node = this._view.__getNodeUnderPoint(mouseX, mouseY);\n if (node)\n return {clientRowKey: node.getId()};\n else\n return null;\n};\n/**\n * Event Manager for tree components.\n * @param {DvtBaseTreeView} view\n * @param {DvtContext} context\n * @param {function} callback A function that responds to component events.\n * @param {object} callbackObj The optional object instance that the callback function is defined on.\n * @constructor\n */\nvar DvtBaseTreeEventManager = function(view, context, callback, callbackObj) {\n this.Init(context, callback, callbackObj);\n this._view = view;\n};\n\nDvtObj.createSubclass(DvtBaseTreeEventManager, DvtEventManager, 'DvtBaseTreeEventManager');\n\n/**\n * Returns the owning tree component.\n * @return {DvtBaseTreeView}\n * @protected\n */\nDvtBaseTreeEventManager.prototype.GetView = function() {\n return this._view;\n};\n\n/**\n * @override\n */\nDvtBaseTreeEventManager.prototype.OnDblClickInternal = function(event) {\n // Done if there is no object\n var obj = this.GetLogicalObject(event.target);\n if (!obj)\n return;\n\n this._processDrill(obj, event.shiftKey);\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeEventManager.prototype.OnClick = function(event) {\n DvtBaseTreeEventManager.superclass.OnClick.call(this, event);\n\n // If the object is a DvtBaseTreePeer (for node labels), handle drilling\n var obj = this.GetLogicalObject(event.target);\n this._processNodeLabel(obj);\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeEventManager.prototype.OnMouseOver = function(event) {\n DvtBaseTreeEventManager.superclass.OnMouseOver.call(this, event);\n\n // Additional mouse over support\n var obj = this.GetLogicalObject(event.target);\n if (!obj)\n return;\n\n if (obj.handleMouseOver)\n obj.handleMouseOver();\n};\n\n/**\n * @override\n */\nDvtBaseTreeEventManager.prototype.OnMouseOut = function(event) {\n DvtBaseTreeEventManager.superclass.OnMouseOut.call(this, event);\n\n // Additional mouse out support\n var obj = this.GetLogicalObject(event.target);\n if (!obj)\n return;\n\n // Don't hide on mouseOut to object belonging to same node (expand button for example)\n if (obj.handleMouseOut) {\n var relatedObj = this.GetLogicalObject(event.relatedTarget);\n var relatedId = relatedObj && relatedObj.getId ? relatedObj.getId() : null;\n if ((obj.getId() == null) || (relatedId != obj.getId()))\n obj.handleMouseOut();\n }\n};\n\n/**\n * @override\n */\nDvtBaseTreeEventManager.prototype.ProcessKeyboardEvent = function(event)\n{\n var eventConsumed = false;\n var keyCode = event.keyCode;\n var obj = this.getFocus(); // the item with current keyboard focus\n\n if (keyCode == DvtKeyboardEvent.ENTER && !event.ctrlKey)\n {\n // handle drill operations\n obj = this.getFocus();\n if (obj.isDrillReplaceEnabled && obj.isDrillReplaceEnabled())\n {\n // SHIFT+ENTER means drill up from the current root, even if the node with keyboard focus is not the current root\n if (event.shiftKey)\n obj = this._view.getRootNode();\n\n // Delegate to the view to fire a drill event\n this._view.__drill(obj.getId(), event.shiftKey);\n }\n\n DvtEventManager.consumeEvent(event);\n eventConsumed = true;\n }\n else\n {\n eventConsumed = DvtBaseTreeEventManager.superclass.ProcessKeyboardEvent.call(this, event);\n }\n\n return eventConsumed;\n};\n\n/**\n * @override\n */\nDvtBaseTreeEventManager.prototype.HandleTouchClickInternal = function(event) {\n var targetObj = event.target;\n var obj = this.GetLogicalObject(targetObj);\n this._processNodeLabel(obj);\n\n if (this._currentHoverItem) {\n if (this._currentHoverItem != obj) {\n this._currentHoverItem.handleMouseOut();\n this._currentHoverItem = null;\n }\n }\n\n if (obj && obj instanceof DvtBaseTreeNode) {\n if (this._currentHoverItem != obj) {\n this._currentHoverItem = obj;\n obj.handleMouseOver();\n }\n }\n};\n\n/**\n * @override\n */\nDvtBaseTreeEventManager.prototype.HandleTouchDblClickInternal = function(event) {\n var targetObj = event.target;\n var obj = this.GetLogicalObject(targetObj);\n if (!obj)\n return;\n this._processDrill(obj, false);\n};\n\n/**\n * Processes a click on a node label.\n * @param {DvtLogicalObject} obj The logical object that was the target of the event\n * @private\n */\nDvtBaseTreeEventManager.prototype._processNodeLabel = function(obj) {\n if (obj && obj instanceof DvtBaseTreePeer && obj.isDrillable()) {\n // Delegate to the view to fire a drill event\n this._view.__drill(obj.getId(), false);\n }\n};\n\n/**\n * Processes a drill on the specified object.\n * @param {DvtLogicalObject} obj The logical object that was the target of the event\n * @param {boolean} shiftKey True if the shift key was pressed.\n * @private\n */\nDvtBaseTreeEventManager.prototype._processDrill = function(obj, shiftKey) {\n // Fire a drill event if drilling is enabled\n if (obj.isDrillReplaceEnabled && obj.isDrillReplaceEnabled()) {\n // Delegate to the view to fire a drill event\n this._view.__drill(obj.getId(), shiftKey);\n }\n};\n\n/**\n * @override\n */\nDvtBaseTreeEventManager.prototype.ProcessRolloverEvent = function(event, obj, bOver) {\n // Don't continue if not enabled\n var options = this._view.getOptions();\n if (options['hoverBehavior'] != 'dim')\n return;\n\n // Compute the new highlighted categories and update the options\n var categories = obj.getCategories ? obj.getCategories() : [];\n options['highlightedCategories'] = bOver ? categories.slice() : null;\n\n // Fire the event to the rollover handler, who will fire to the component callback.\n var type = bOver ? DvtCategoryRolloverEvent.TYPE_OVER : DvtCategoryRolloverEvent.TYPE_OUT;\n var rolloverEvent = new DvtCategoryRolloverEvent(type, options['highlightedCategories']);\n var nodes = DvtBaseTreeUtils.getAllNodes(this.GetView().getRootNode());\n var hoverBehaviorDelay = DvtStyleUtils.getTimeMilliseconds(options['hoverBehaviorDelay']);\n this.RolloverHandler.processEvent(rolloverEvent, nodes, hoverBehaviorDelay, options['highlightMatch'] == 'any');\n\n // Stop event propagation, since this rollover is now handled\n event.stopPropagation();\n};\n/**\n * Base class for tree component nodes.\n * @class The base class for tree component nodes.\n * @constructor\n * @implements {DvtCategoricalObject}\n * @implements {DvtTooltipSource}\n * @implements {DvtSelectable}\n * @implements {DvtPopupSource}\n * @implements {DvtContextMenuSource}\n * @implements {DvtKeyboardNavigable}\n * @implements {DvtDraggable}\n */\nvar DvtBaseTreeNode = function() {};\n\nDvtObj.createSubclass(DvtBaseTreeNode, DvtObj, 'DvtBaseTreeNode');\n\nDvtBaseTreeNode._ANIMATION_DELETE_PRIORITY = 0; // The order in which the delete animation occurs\nDvtBaseTreeNode._ANIMATION_UPDATE_PRIORITY = 1; // The order in which the update animation occurs\nDvtBaseTreeNode._ANIMATION_INSERT_PRIORITY = 2; // The order in which the insert animation occurs\n\nDvtBaseTreeNode._DEFAULT_FILL_COLOR = '#000000';\nDvtBaseTreeNode._DEFAULT_TEXT_SIZE = 11;\n\nDvtBaseTreeNode.__NODE_SELECTED_SHADOW = new DvtShadow('#000000', 2, 5, 5, 45, 0.5);\n\n/**\n * @param {DvtBaseTreeView} treeView The DvtBaseTreeView that owns this node.\n * @param {object} props The properties for the node.\n * @protected\n */\nDvtBaseTreeNode.prototype.Init = function(treeView, props)\n{\n this._view = treeView;\n this._options = props;\n\n var nodeDefaults = this._view.getOptions()['nodeDefaults'];\n\n this._id = props['id'];\n this._color = props['color'] ? props['color'] : DvtBaseTreeNode._DEFAULT_FILL_COLOR;\n this._textStr = props['label'];\n this._labelStyle = typeof props['labelStyle'] == 'string' ? new DvtCSSStyle(props['labelStyle']) : props['labelStyle'];\n this._pattern = props['pattern'];\n this._selectable = props['selectable'];\n this._shortDesc = props['shortDesc'] ? props['shortDesc'] : props['tooltip'];\n this._size = props['value'];\n\n this._drilling = props['drilling'] ? props['drilling'] : nodeDefaults['drilling'];\n this._stampId = props['S'];\n\n // Whether this node is an artificial root\n this._bArtificialRoot = props.bArtificialRoot;\n\n // Node alpha is always 1 unless during animation\n this._alpha = 1;\n\n // reference to last visited child\n this._lastVisitedChild = null;\n\n this._isShowingKeyboardFocusEffect = false;\n\n this.IsHover = false;\n};\n\n/**\n * Sets the Array containing all children of this node.\n * @param {array} children The array of children for this node.\n */\nDvtBaseTreeNode.prototype.setChildNodes = function(children) {\n // Set this node as the parent of the children\n if (children != null) {\n for (var i = 0; i < children.length; i++)\n children[i]._parent = this;\n }\n\n // Store the children\n this._children = children;\n};\n\n\n/**\n * Returns the Array containing all children of this node.\n * @return {array} The array of children belonging to this node.\n */\nDvtBaseTreeNode.prototype.getChildNodes = function() {\n return this._children ? this._children : [];\n};\n\n\n/**\n * Returns an Array containing all the descendants of this node\n * @return {Array} The array of descendants of this node\n */\nDvtBaseTreeNode.prototype.getDescendantNodes = function()\n{\n var descendants = [];\n var childDescendants;\n var child;\n\n if (!this.hasChildren())\n return descendants;\n\n for (var i = 0; i < this._children.length; i++)\n {\n child = this._children[i];\n childDescendants = child.getDescendantNodes();\n descendants.push(child);\n descendants = descendants.concat(childDescendants);\n }\n\n return descendants;\n};\n\n\n/**\n * Sets a reference to the last visited child.\n *\n * @param {DvtBaseTreeNode} lastVisited\n * @protected\n */\nDvtBaseTreeNode.prototype.SetLastVisitedChild = function(lastVisited)\n{\n this._lastVisitedChild = lastVisited;\n};\n\n\n/**\n * Returns the last visited child\n *\n * @return {DvtBaseTreeNode} The last visited child\n * @protected\n */\nDvtBaseTreeNode.prototype.GetLastVisitedChild = function() \n{\n return this._lastVisitedChild;\n};\n\n\n/**\n * Updates the last visited child on the given node's parent to this node\n * @protected\n */\nDvtBaseTreeNode.prototype.MarkAsLastVisitedChild = function()\n{\n var parent = this.GetParent();\n if (parent)\n {\n parent.SetLastVisitedChild(this);\n }\n};\n\n\n/**\n * Returns true if this node is a descendant of the specified node.\n * @param {DvtBaseTreeNode} node\n */\nDvtBaseTreeNode.prototype.isDescendantOf = function(node) {\n if (!node || !this.GetParent())\n return false;\n else if (this.GetParent() == node)\n return true;\n else\n return this.GetParent().isDescendantOf(node);\n};\n\n\n/**\n * Returns an Array containing all nodes that are at the given depth away from the current node\n * @param {DvtBaseTreeNode} root\n * @param {Number} depth\n * @return {Array}\n */\nDvtBaseTreeNode.prototype.GetNodesAtDepth = function(root, depth)\n{\n var returnArray = [];\n if (depth < 0)\n return returnArray;\n\n if (depth == 0)\n return [this];\n else if (root.hasChildren())\n {\n var children = root.getChildNodes();\n var child;\n for (var i = 0; i < children.length; i++)\n {\n child = children[i];\n returnArray = returnArray.concat(child.GetNodesAtDepth(child, depth - 1));\n }\n }\n\n return returnArray;\n};\n\n/**\n * Returns the node with the given id, if it is in the tree with the given root\n * @param {DvtBaseTreeNode} root\n * @param {String} id\n * @return {DvtBaseTreeNode} The node with the given id, or null if no node with the given id is found\n */\nDvtBaseTreeNode.getNodeById = function(root, id)\n{\n if (root.getId() == id)\n {\n return root;\n }\n else\n {\n // recursively call getNodeById on each of the children\n var node = null;\n var children = root.getChildNodes();\n var length = children.length;\n var child = null;\n\n for (var i = 0; i < length; i++)\n {\n child = children[i];\n node = DvtBaseTreeNode.getNodeById(child, id);\n if (node)\n {\n // if we found the node, return it, otherwise check the next child\n return node;\n }\n }\n return null;\n }\n};\n\n\n/**\n * Returns the component that owns this node.\n * @return {DvtBaseTreeView} The component that owns this node.\n */\nDvtBaseTreeNode.prototype.getView = function() {\n return this._view;\n};\n\n\n/**\n * Returns the id of the stamp for this node.\n * @return {string} The id of the stamp for this node.\n */\nDvtBaseTreeNode.prototype.getStampId = function() {\n return this._stampId;\n};\n\n/**\n * Returns the options object for this node.\n * @return {object}\n */\nDvtBaseTreeNode.prototype.getOptions = function() {\n return this._options;\n};\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.getCategories = function() {\n // Implements function in DvtCategoricalObject\n var categories = this.getOptions()['categories'];\n if (!categories) {\n // By default, append the id of this node to the parent's categories\n var parent = this.GetParent();\n var parentCategories = parent ? parent.getCategories() : null;\n categories = parentCategories ? parentCategories.slice() : [];\n categories.push(this.getId());\n }\n return categories;\n};\n\n/**\n * Returns the id for this node.\n * @return {string} The id for this node.\n */\nDvtBaseTreeNode.prototype.getId = function() {\n return this._id;\n};\n\n\n/**\n * Returns the relative size of this node.\n * @return {Number} The relative size of this node.\n */\nDvtBaseTreeNode.prototype.getSize = function() {\n // Note: Called by automation APIs\n return this._size;\n};\n\n\n/**\n * Returns the color of this node.\n * @return {String} The color of this node.\n */\nDvtBaseTreeNode.prototype.getColor = function() {\n // Note: Called by automation APIs\n return this._color;\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.getDatatip = function() {\n // Custom Tooltip from Function\n var tooltipFunc = this._view.getOptions()['tooltip'];\n if (tooltipFunc)\n return this.getView().getCtx().getTooltipManager().getCustomTooltip(tooltipFunc, this.getDataContext());\n\n // Custom Tooltip from ShortDesc\n return this._shortDesc;\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.getDatatipColor = function() {\n return this._color;\n};\n\n/**\n * Returns the shortDesc of the node.\n * @return {string}\n */\nDvtBaseTreeNode.prototype.getShortDesc = function() {\n // Note: Called by automation APIs\n return this._shortDesc;\n};\n\n/**\n * Returns the data context that will be passed to the tooltip function.\n * @return {object}\n */\nDvtBaseTreeNode.prototype.getDataContext = function() {\n return {\n 'id': this.getId(),\n 'label': this.getLabel(),\n 'value': this.getSize(),\n 'color': this.getColor()\n };\n};\n\n/**\n * Returns the index for this node within the current parent. Used for automation, this takes into account nodes that\n * were not created due to hiddenCategories.\n * @return {number}\n */\nDvtBaseTreeNode.prototype.getIndex = function() {\n return this.getOptions()['_index'];\n};\n\n/**\n * Returns the alpha for this node.\n * @return {number} The alpha for this node.\n */\nDvtBaseTreeNode.prototype.getAlpha = function() {\n // Note: This API is called by the fadeIn and fadeOut animations\n return this._alpha;\n};\n\n\n/**\n * Specifies the alpha for this node.\n * @param {number} alpha The alpha for this node.\n */\nDvtBaseTreeNode.prototype.setAlpha = function(alpha) {\n // Note: This API is called by the fadeIn and fadeOut animations\n this._alpha = alpha;\n\n if (this._shape)\n this._shape.setAlpha(this._alpha);\n};\n\n\n/**\n * Specifies whether the children of this node are disclosed.\n * @param {boolean} disclosed\n * @protected\n */\nDvtBaseTreeNode.prototype.setDisclosed = function(disclosed) {\n this.getOptions()['_expanded'] = disclosed;\n};\n\n/**\n * Returns true if the children of this node are disclosed.\n * @return {boolean}\n * @protected\n */\nDvtBaseTreeNode.prototype.isDisclosed = function() {\n return this.getOptions()['_expanded'] !== false;\n};\n\n/**\n * Returns true if this node is the artificial root of the tree.\n * @return {boolean}\n */\nDvtBaseTreeNode.prototype.isArtificialRoot = function() {\n return this._bArtificialRoot;\n};\n\n\n/**\n * Returns true if drill replace is enabled for this node.\n * @return {boolean}\n */\nDvtBaseTreeNode.prototype.isDrillReplaceEnabled = function() {\n return this._drilling == 'replace' || this._drilling == 'insertAndReplace';\n};\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.getShowPopupBehaviors = function() {\n // Retrieve from the showPopupBehaviors map in the options object, indexed via the stampid.\n var behaviors = this.getView().getOptions()['_spb'];\n if (!behaviors || !behaviors[this.getStampId()])\n return null;\n\n // If found, create a DvtShowPopupBehavior and return\n return DvtShowPopupBehavior.createBehaviors(behaviors[this.getStampId()]);\n};\n\n/**\n * Renders this node.\n * @param {DvtContainer} container The container to render in.\n */\nDvtBaseTreeNode.prototype.render = function(container) {\n // subclasses should override\n};\n\n\n/**\n * Renders the child nodes of this node.\n * @param {DvtContainer} container The container to render in.\n */\nDvtBaseTreeNode.prototype.renderChildren = function(container) {\n // Render all children of this node\n var children = this.getChildNodes();\n if (children != null) {\n for (var i = 0; i < children.length; i++) {\n children[i].render(container);\n }\n }\n};\n\n\n/**\n * Updates this node and its children with values from the attribute groups.\n * @param {DvtAttrGroups} ag\n */\nDvtBaseTreeNode.prototype.processAttrGroups = function(ag) {\n var color = ag.get(this.getOptions()['_cv']);\n if (color)\n this._color = color;\n};\n\n\n/**\n * Default implementation of getNextNavigable. Returns this node as the next navigable. Subclasses should override\n * @override\n */\nDvtBaseTreeNode.prototype.getNextNavigable = function(event) \n{\n // subclasses should override\n this.MarkAsLastVisitedChild();\n return this;\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.getKeyboardBoundingBox = function(targetCoordinateSpace) \n{\n // subclasses should override\n return new DvtRectangle(0, 0, 0, 0);\n};\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.getTargetElem = function() \n{\n // subclasses should override\n return null;\n};\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.showKeyboardFocusEffect = function() \n{\n this._isShowingKeyboardFocusEffect = true;\n\n this.showHoverEffect();\n if (this.handleMouseOver)\n this.handleMouseOver();\n\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.hideKeyboardFocusEffect = function()\n{\n // Hide the hover effect if it was shown in response to keyboard focus\n if (this._isShowingKeyboardFocusEffect) {\n this._isShowingKeyboardFocusEffect = false;\n this.hideHoverEffect();\n }\n\n if (this.handleMouseOut)\n this.handleMouseOut();\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.isShowingKeyboardFocusEffect = function() \n{\n return this._isShowingKeyboardFocusEffect;\n};\n\n\n/**\n * Handles a mouse over event on the node.\n */\nDvtBaseTreeNode.prototype.handleMouseOver = function() {\n this.IsHover = true;\n};\n\n\n/**\n * Handles a mouse out event on the node.\n */\nDvtBaseTreeNode.prototype.handleMouseOut = function() {\n this.IsHover = false;\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.isSelectable = function() {\n return this._selectable != 'off' && this.getView().__getNodeSelection() != null;\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.isSelected = function() {\n return this._selected;\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.setSelected = function(selected) {\n // Store the selection state\n this._selected = selected;\n this.UpdateAriaLabel();\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.showHoverEffect = function() {\n // subclasses should override\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.hideHoverEffect = function() {\n // subclasses should override\n};\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.highlight = function(bDimmed, alpha) {\n // Implements DvtCategoricalObject.prototype.highlight\n this.setAlpha(alpha);\n};\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.isDragAvailable = function(clientIds) {\n return this.getView().__isDragAvailable(clientIds);\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.getDragTransferable = function(mouseX, mouseY) {\n return this.getView().__getDragTransferable(this);\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeNode.prototype.getDragFeedback = function(mouseX, mouseY) {\n return this.getView().__getDragFeedback();\n};\n\n\n/**\n * Returns a displayable used for drop site feedback.\n * @return {DvtDisplayable}\n */\nDvtBaseTreeNode.prototype.getDropSiteFeedback = function() {\n return null;\n};\n\n/**\n * Returns the bounds upon which the popup fired by the given behavior should align.\n * @param {DvtShowPopupBehavior} behavior The DvtShowPopupBehavior that is firing the popup.\n * @return {DvtRectangle} The rectangle that the popup should align to.\n */\nDvtBaseTreeNode.prototype.getPopupBounds = function(behavior) {\n return null; // subclasses can override, or else default positioning will occur\n};\n\n\n/**\n * Returns true if this node contains the given coordinates.\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nDvtBaseTreeNode.prototype.contains = function(x, y) {\n return false; // subclasses should override\n};\n\n\n/**\n * Returns the node under the given point, if it exists in the subtree of this node.\n * @param {number} x\n * @param {number} y\n * @return {DvtBaseTreeNode}\n */\nDvtBaseTreeNode.prototype.getNodeUnderPoint = function(x, y) {\n return null; // subclasses should override\n};\n\n\n/**\n * Returns the layout parameters for the current animation frame.\n * @return {array} The array of layout parameters.\n * @protected\n */\nDvtBaseTreeNode.prototype.GetAnimationParams = function() {\n return []; // subclasses should override\n};\n\n\n/**\n * Sets the layout parameters for the current animation frame.\n * @param {array} params The array of layout parameters.\n * @protected\n */\nDvtBaseTreeNode.prototype.SetAnimationParams = function(params) {\n // subclasses should override\n};\n\n\n/**\n * Creates the update animation for this node.\n * @param {DvtBaseTreeAnimationHandler} handler The animation handler, which can be used to chain animations.\n * @param {DvtBaseTreeNode} oldNode The old node state to animate from.\n */\nDvtBaseTreeNode.prototype.animateUpdate = function(handler, oldNode) {\n // Drilling animations are handled across all nodes up front, no recursion needed\n if (!handler.isDrillAnimation()) {\n // Recurse and animate the children\n handler.constructAnimation(oldNode.getChildNodes(), this.getChildNodes());\n }\n\n // Create the animator for this node\n var endState = this.GetAnimationParams();\n var startState = oldNode.GetAnimationParams(endState);\n\n var nodePlayable;\n if (!DvtArrayUtils.equals(startState, endState)) {\n // Only create if state changed\n nodePlayable = new DvtCustomAnimation(this.getView().getCtx(), this, this.getView().__getAnimationDuration());\n nodePlayable.getAnimator().addProp(DvtAnimator.TYPE_NUMBER_ARRAY, this, this.GetAnimationParams, this.SetAnimationParams, endState);\n\n // Create the playable\n handler.add(nodePlayable, DvtBaseTreeNode._ANIMATION_UPDATE_PRIORITY);\n\n // Determine whether size and color changed. This must be done before start state is set.\n var bSizeChanged = (this._size != oldNode._size);\n var bColorChanged = (DvtColorUtils.getRGBA(this._color) != DvtColorUtils.getRGBA(oldNode._color));\n\n // Initialize the start state\n this.SetAnimationParams(startState);\n\n // If the data changed, flash directly into the update color.\n var animationUpdateColor = this._view.getOptions()['animationUpdateColor'];\n if (animationUpdateColor && (bSizeChanged || bColorChanged))\n this._color = animationUpdateColor;\n }\n};\n\n\n/**\n * Creates the insert animation for this node.\n * @param {DvtBaseTreeAnimationHandler} handler The animation handler, which can be used to chain animations.\n */\nDvtBaseTreeNode.prototype.animateInsert = function(handler) {\n // Animate if this is a data change animation (not drilling), or if this node is not an\n // ancestor of the old root in a drilling animation. The ancestors are not animated\n // so that they appear at the beginning of the animation.\n if (!handler.isDrillAnimation() || !handler.isAncestorInsert(this)) {\n // Initialize the start state\n this.setAlpha(0);\n\n var anim = new DvtAnimFadeIn(this.getView().getCtx(), this, this.getView().__getAnimationDuration());\n handler.add(anim, DvtBaseTreeNode._ANIMATION_INSERT_PRIORITY);\n\n // Recurse to children\n if (this.hasChildren()) {\n for (var i = 0; i < this._children.length; i++) {\n this._children[i].animateInsert(handler);\n }\n }\n }\n};\n\n\n/**\n * Creates the delete animation for this node.\n * @param {DvtBaseTreeAnimationHandler} handler The animation handler, which can be used to chain animations.\n * @param {DvtContainer} container The container where deletes should be moved for animation.\n */\nDvtBaseTreeNode.prototype.animateDelete = function(handler, container) {\n // Move to the new container, since the old container may be removed\n container.addChild(this._shape);\n\n // Create the animation\n var anim = new DvtAnimFadeOut(this.getView().getCtx(), this, this.getView().__getAnimationDuration());\n handler.add(anim, DvtBaseTreeNode._ANIMATION_DELETE_PRIORITY);\n\n // Drilling animations are handled across all nodes up front, no recursion needed\n if (!handler.isDrillAnimation() && this.hasChildren()) {\n // Recurse to children\n for (var i = 0; i < this._children.length; i++) {\n this._children[i].animateDelete(handler, container);\n }\n }\n};\n\n\n/**\n * Returns true if this node has children.\n * @return {boolean} true if this node has children.\n */\nDvtBaseTreeNode.prototype.hasChildren = function() {\n return (this._children != null && this._children.length > 0);\n};\n\n\n/**\n * Returns the parent node for this node.\n * @return {DvtBaseTreeNode} The parent node.\n * @protected\n */\nDvtBaseTreeNode.prototype.GetParent = function() {\n return this._parent;\n};\n\n\n/**\n * Returns the depth of the node in the tree.\n * @return {number} The depth of the node.\n * @protected\n */\nDvtBaseTreeNode.prototype.GetDepth = function() {\n var depth = 0;\n var parent = this.GetParent();\n while (parent) {\n depth++;\n parent = parent.GetParent();\n }\n return depth;\n};\n\n\n/**\n * Returns the DvtFill to use for this node.\n * @return {DvtFill}\n */\nDvtBaseTreeNode.prototype.GetFill = function() {\n if (this._pattern)\n return new DvtPatternFill(this._pattern, this._color);\n else\n return new DvtSolidFill(this._color);\n};\n\n\n/**\n * Calculates and returns a color for node text that will provide a\n * good contrast with the given color.\n * @param {DvtBaseTreeNode} node\n * @protected\n */\nDvtBaseTreeNode.GetNodeTextColor = function(node) {\n if (node._pattern) {\n // Use black for all patterned nodes against white backgrounds\n return '#000000';\n }\n else {\n return DvtColorUtils.getContrastingTextColor(node._color);\n }\n};\n\nDvtBaseTreeNode.prototype.ApplyLabelTextStyle = function(text) {\n var defaultFillColor = DvtBaseTreeNode.GetNodeTextColor(this);\n text.setSolidFill(defaultFillColor);\n var textStyle = new Array();\n textStyle.push(this._view.getOptions()['nodeDefaults']['labelStyle']);\n if (this._labelStyle)\n textStyle.push(this._labelStyle);\n text.setCSSStyle(DvtCSSStyle.mergeStyles(textStyle));\n\n // In high contrast mode, override the app settings and use the default colors\n if (DvtAgent.isHighContrast())\n text.setSolidFill(defaultFillColor);\n};\n\nDvtBaseTreeNode.prototype.GetTextSize = function() {\n var size = DvtBaseTreeNode._DEFAULT_TEXT_SIZE;\n var textStyle = this._view.getOptions()['nodeDefaults']['labelStyle'];\n var fontSize = textStyle.getFontSize();\n if (fontSize) {\n size = parseFloat(fontSize);\n }\n return size;\n};\n\n/**\n * Returns the primary displayable for this node.\n * @return {DvtDisplayable}\n */\nDvtBaseTreeNode.prototype.getDisplayable = function() {\n // Note: Called by automation APIs\n return this._shape;\n};\n\n/**\n * Returns the label string for this node.\n * @return {string}\n */\nDvtBaseTreeNode.prototype.getLabel = function() {\n // Note: Called by automation APIs\n return this._textStr;\n};\n\nDvtBaseTreeNode.prototype.GetAfContext = function() {\n return this.getView().__getAfContext();\n};\n\nDvtBaseTreeNode.prototype.GetElAttributes = function() {\n return this.getOptions()['_cf'];\n};\n\nDvtBaseTreeNode.prototype.GetTemplate = function() {\n return this.getView().__getTemplate(this.getStampId());\n};\n\n/**\n * Returns whether this node can be double clicked.\n */\nDvtBaseTreeNode.prototype.isDoubleClickable = function() {\n return this.isDrillReplaceEnabled();\n};\n\n/**\n * Updates the aria label of the node.\n * @protected\n */\nDvtBaseTreeNode.prototype.UpdateAriaLabel = function() {\n // subclasses should override\n};\n/**\n * Simple logical object for drilling and tooltip support.\n * @param {DvtBaseTreeNode} node The associated node, if it has been created.\n * @param {string} id The id of the associated node.\n * @param {string} tooltip The tooltip to display.\n * @param {string} datatip The datatip to display.\n * @param {string} datatipColor The border color of the datatip.\n * @class\n * @constructor\n * @implements {DvtTooltipSource}\n */\nvar DvtBaseTreePeer = function(node, id, tooltip, datatip, datatipColor) {\n this.Init(tooltip, datatip, datatipColor);\n this._node = node;\n this._id = id;\n this._bDrillable = false;\n};\n\nDvtObj.createSubclass(DvtBaseTreePeer, DvtSimpleObjPeer, 'DvtBaseTreePeer');\n\n\n/**\n * Returns the id of the associated node.\n * @return {string}\n */\nDvtBaseTreePeer.prototype.getId = function() {\n return this._id;\n};\n\n\n/**\n * Returns true if the associated object is drillable.\n * @return {boolean}\n */\nDvtBaseTreePeer.prototype.isDrillable = function() {\n return this._bDrillable;\n};\n\n\n/**\n * Specifies whether the associated object is drillable.\n * @param {boolean} drillable\n */\nDvtBaseTreePeer.prototype.setDrillable = function(drillable) {\n this._bDrillable = drillable;\n};\n\n\n/**\n * Handles a mouse out event on the associated object.\n */\nDvtBaseTreePeer.prototype.handleMouseOut = function() {\n // Expand/Collapse: hide button if displayed\n if (this._node && this._node.handleMouseOut) {\n this._node.handleMouseOut();\n }\n};\n/**\n * Breadcrumb rendering utilities for tree components.\n * @class\n */\nvar DvtTreeBreadcrumbsRenderer = function() {};\n\nDvtObj.createSubclass(DvtTreeBreadcrumbsRenderer, DvtObj, 'DvtTreeBreadcrumbsRenderer');\n\nDvtTreeBreadcrumbsRenderer._COMPONENT_GAP = 6;\nDvtTreeBreadcrumbsRenderer._ENABLED_INLINE_STYLE = 'color: #003286;';\n\n\n/**\n * Performs layout and rendering for the breadcrumbs in the given space. Updates the available\n * space and returns the rendered displayable.\n * @param {DvtBaseTreeView} treeView The owning component.\n * @param {DvtRectangle} availSpace The rectangle within which to layout.\n * @param {array} ancestors\n * @param {string} rootLabel The label for the root node.\n * @return {DvtDisplayable} The rendered legend contents.\n */\nDvtTreeBreadcrumbsRenderer.render = function(treeView, availSpace, ancestors, rootLabel) {\n var context = treeView.getCtx();\n var styleDefaults = treeView.getOptions()['styleDefaults'];\n\n // Figure out the label styles\n var enabledStyleArray = new Array();\n enabledStyleArray.push(new DvtCSSStyle(DvtTreeBreadcrumbsRenderer._ENABLED_INLINE_STYLE));\n enabledStyleArray.push(styleDefaults['_drillTextStyle']);\n var enabledStyle = DvtCSSStyle.mergeStyles(enabledStyleArray).toString();\n var enabledStyleOver = enabledStyle + 'text-decoration: underline;';\n\n var disabledStyleArray = new Array();\n disabledStyleArray.push(styleDefaults['_currentTextStyle']);\n var disabledStyle = DvtCSSStyle.mergeStyles(disabledStyleArray).toString();\n\n // Create the breadcrumbs component and temporarily add to the component\n var options = {labelStyle: enabledStyle, labelStyleOver: enabledStyleOver, labelStyleDown: enabledStyleOver, disabledLabelStyle: disabledStyle};\n var breadcrumbs = new DvtBreadcrumbs(context, treeView.__processBreadcrumbsEvent, treeView, options);\n treeView.addChild(breadcrumbs);\n\n // Create the data object for the breadcrumbs. Use the reverse of the ancestors array, since\n // the most distant ancestor is rendered first.\n var dataItems = ancestors.slice(0).reverse();\n dataItems.push({'label': rootLabel});\n var data = {'items': dataItems};\n breadcrumbs.render(data, availSpace.w);\n\n // Figure out the height used and reduce availSpace\n var dims = breadcrumbs.getDimensions();\n breadcrumbs.setTranslate(availSpace.x, availSpace.y);\n var height = dims.h + DvtTreeBreadcrumbsRenderer._COMPONENT_GAP;\n availSpace.y += height;\n availSpace.h -= height;\n\n // Remove the breadcrumbs so that it can be added under the right parent.\n treeView.removeChild(breadcrumbs);\n return breadcrumbs;\n};\n/**\n * Legend rendering utilies for tree components.\n * @class\n */\nvar DvtTreeLegendRenderer = function() {};\n\nDvtObj.createSubclass(DvtTreeLegendRenderer, DvtObj, 'DvtTreeLegendRenderer');\n\n/** @private @const **/\nDvtTreeLegendRenderer._LEGEND_GAP = 4;\n/** @private @const **/\nDvtTreeLegendRenderer._LEGEND_LABEL_GAP = 7;\n/** @private @const **/\nDvtTreeLegendRenderer._LEGEND_SECTION_GAP = 24;\n/** @private @const **/\nDvtTreeLegendRenderer._LABEL_SIZE = 11;\n/** @private @const **/\nDvtTreeLegendRenderer._LABEL_COLOR = '#636363';\n\n/** @private @const **/\nDvtTreeLegendRenderer._LABEL_INLINE_STYLE = 'color:' + DvtTreeLegendRenderer._LABEL_COLOR + ';';\n\n/**\n * Performs layout and rendering for the legend in the given space. Updates the available\n * space and returns the rendered displayable.\n * @param {DvtBaseTreeView} treeView The owning component.\n * @param {DvtRectangle} availSpace The rectangle within which to layout.\n * @param {DvtAttrGroups} attrGroups An attribute groups describing the colors.\n * @return {DvtDisplayable} The rendered legend contents.\n */\nDvtTreeLegendRenderer.render = function(treeView, availSpace, attrGroups) {\n var options = treeView.getOptions();\n var sizeValueStr = options['sizeLabel'];\n var colorValueStr = options['colorLabel'];\n if (sizeValueStr == null && colorValueStr == null && attrGroups == null)\n return;\n\n var context = treeView.getCtx();\n var eventManager = treeView.__getEventManager();\n\n // Create the legend container and temporarily add to the component\n var legend = new DvtContainer(context);\n treeView.addChild(legend);\n\n // Size/Color Labels\n var labelContainer = DvtTreeLegendRenderer._renderLabels(context, treeView, legend, availSpace.w, sizeValueStr, colorValueStr, attrGroups);\n\n var borderColor = DvtCSSStyle.afterSkinAlta(treeView.getOptions()['skin']) ? null : '#000000';\n var legendStyleArray = new Array();\n legendStyleArray.push(options['styleDefaults']['_labelStyle']);\n var legendStyles = {borderColor: borderColor, labelStyle: DvtCSSStyle.mergeStyles(legendStyleArray)};\n\n // Color Section\n var colorContainer = DvtLegendAttrGroupsRenderer.renderAttrGroups(context, eventManager, legend, availSpace.w, availSpace.h, attrGroups, legendStyles);\n\n // Position the sections horizontally\n var labelDims = labelContainer ? labelContainer.getDimensions() : null;\n var colorDims = colorContainer ? colorContainer.getDimensions() : null;\n if (labelContainer && !colorContainer) // Only labels, center\n labelContainer.setTranslateX(availSpace.y + (availSpace.w - labelDims.w) / 2);\n else if (colorContainer && !labelContainer) // Only colors, center\n colorContainer.setTranslateX(availSpace.y + (availSpace.w - colorDims.w) / 2);\n else if (colorContainer && labelContainer) {\n // Deal with overflow\n var availWidth = availSpace.w - DvtTreeLegendRenderer._LEGEND_SECTION_GAP;\n if (labelDims.w + colorDims.w > availWidth) {\n if (labelDims.w > availWidth / 2 && colorDims.w > availWidth / 2) {\n // Both don't fit, recreate at half of the avail width each\n legend.removeChild(labelContainer);\n legend.removeChild(colorContainer);\n labelContainer = DvtTreeLegendRenderer._renderLabels(context, treeView, legend, availWidth / 2, sizeValueStr, colorValueStr, attrGroups);\n colorContainer = DvtLegendAttrGroupsRenderer.renderAttrGroups(context, eventManager, legend, availWidth / 2, availSpace.h, attrGroups, legendStyles);\n }\n else if (labelDims.w > colorDims.w) {\n // Labels don't fit, give all remaining space\n var labelSpace = availWidth - colorDims.w;\n\n // Recreate the labelContainer at the available size\n legend.removeChild(labelContainer);\n labelContainer = DvtTreeLegendRenderer._renderLabels(context, treeView, legend, labelSpace, sizeValueStr, colorValueStr, attrGroups);\n }\n else {\n // Colors don't fit, give all remaining space\n var colorSpace = availWidth - labelDims.w;\n\n // Recreate the labelContainer at the available size\n legend.removeChild(colorContainer);\n colorContainer = DvtLegendAttrGroupsRenderer.renderAttrGroups(context, eventManager, legend, colorSpace, availSpace.h, attrGroups, legendStyles);\n }\n\n // Size changed so recalc dimensions\n labelDims = labelContainer.getDimensions();\n colorDims = colorContainer.getDimensions();\n }\n\n // Position\n if (DvtAgent.isRightToLeft(context)) {\n colorContainer.setTranslateX(availSpace.x);\n labelContainer.setTranslateX(availSpace.x + availSpace.w - labelDims.w);\n }\n else {\n labelContainer.setTranslateX(availSpace.x);\n colorContainer.setTranslateX(availSpace.x + availSpace.w - colorDims.w);\n }\n }\n\n // Figure out the height used and reduce availSpace\n var legendDims = legend.getDimensions();\n legend.setTranslateY(availSpace.y + availSpace.h - legendDims.h);\n availSpace.h -= (legendDims.h + DvtTreeLegendRenderer._LEGEND_GAP);\n\n // Remove the legend so that it can be added under the right parent.\n treeView.removeChild(legend);\n return legend;\n};\n\n\n/**\n * Performs layout and rendering for the legend labels.\n * @param {DvtContext} context\n * @param {DvtBaseTreeView} treeView The owning component.\n * @param {DvtContainer} legend The legend container.\n * @param {number} availWidth The available horizontal space.\n * @param {string} sizeValueStr A description of the size metric.\n * @param {string} colorValueStr A description of the color metric.\n * @param {DvtAttrGroups} attrGroups An attribute groups describing the colors.\n * @return {DvtDisplayable} The rendered contents.\n */\nDvtTreeLegendRenderer._renderLabels = function(context, treeView, legend, availWidth, sizeValueStr, colorValueStr, attrGroups) {\n var isRTL = DvtAgent.isRightToLeft(context);\n var eventManager = treeView.__getEventManager();\n var styleDefaults = treeView.getOptions()['styleDefaults'];\n\n var labelContainer = null;\n if (sizeValueStr || colorValueStr) {\n // Create a container for the labels\n labelContainer = new DvtContainer(context);\n legend.addChild(labelContainer);\n\n var textStyle = new Array();\n textStyle.push(styleDefaults['_attributeTypeTextStyle']);\n var attrTypeStyle = DvtCSSStyle.mergeStyles(textStyle);\n\n textStyle = new Array();\n textStyle.push(styleDefaults['_attributeValueTextStyle']);\n var attrValueStyle = DvtCSSStyle.mergeStyles(textStyle);\n\n // Size: Size Metric\n var sizeLabel;\n var sizeValueLabel;\n var sizeLabelWidth;\n var sizeValueLabelWidth;\n var sizeWidth = 0;\n if (sizeValueStr) {\n // Size Label\n var sizeStr = DvtBundle.getTranslation(treeView.getOptions(), 'labelSize', treeView.getBundlePrefix(), 'SIZE');\n sizeLabel = new DvtOutputText(context, sizeStr, 0, 0);\n sizeLabel.setCSSStyle(attrTypeStyle);\n\n labelContainer.addChild(sizeLabel);\n sizeLabelWidth = sizeLabel.measureDimensions().w;\n\n // Size Value Label\n sizeValueLabel = new DvtOutputText(context, sizeValueStr, 0, 0);\n sizeValueLabel.setCSSStyle(attrValueStyle);\n\n labelContainer.addChild(sizeValueLabel);\n sizeValueLabelWidth = sizeValueLabel.measureDimensions().w;\n\n // Size section width\n sizeWidth = sizeLabelWidth + sizeValueLabelWidth + DvtTreeLegendRenderer._LEGEND_LABEL_GAP;\n }\n\n // Color: Color Metric\n var colorLabel;\n var colorValueLabel;\n var colorLabelWidth;\n var colorValueLabelWidth;\n var colorWidth = 0;\n if (colorValueStr) {\n // Color Label\n var colorStr = DvtBundle.getTranslation(treeView.getOptions(), 'labelColor', treeView.getBundlePrefix(), 'COLOR');\n colorLabel = new DvtOutputText(context, colorStr, 0, 0);\n colorLabel.setCSSStyle(attrTypeStyle);\n\n labelContainer.addChild(colorLabel);\n colorLabelWidth = colorLabel.measureDimensions().w;\n\n // Color Value Label\n colorValueLabel = new DvtOutputText(context, colorValueStr, 0, 0);\n colorValueLabel.setCSSStyle(attrValueStyle);\n\n labelContainer.addChild(colorValueLabel);\n colorValueLabelWidth = colorValueLabel.measureDimensions().w;\n\n // Size section width\n colorWidth = colorLabelWidth + colorValueLabelWidth + DvtTreeLegendRenderer._LEGEND_LABEL_GAP;\n }\n\n // Reduce size to fit if needed\n availWidth -= DvtTreeLegendRenderer._LEGEND_SECTION_GAP;\n if (sizeWidth + colorWidth > availWidth) {\n var widthPerSection = availWidth / 2;\n if (sizeWidth > widthPerSection && colorWidth > widthPerSection) {\n // Both don't fit, truncate and reposition\n var sizeValueSpace = widthPerSection - sizeLabelWidth - DvtTreeLegendRenderer._LEGEND_LABEL_GAP;\n if (DvtTextUtils.fitText(sizeValueLabel, sizeValueSpace, Infinity, labelContainer)) {\n sizeValueLabelWidth = sizeValueLabel.measureDimensions().w;\n eventManager.associate(sizeValueLabel, new DvtSimpleObjPeer(sizeValueStr));\n }\n else {\n labelContainer.removeChild(sizeLabel);\n labelContainer.removeChild(sizeValueLabel);\n sizeValueLabel = null;\n sizeValueLabelWidth = 0;\n }\n\n var colorValueSpace = widthPerSection - colorLabelWidth - DvtTreeLegendRenderer._LEGEND_LABEL_GAP;\n if (DvtTextUtils.fitText(colorValueLabel, colorValueSpace, Infinity, labelContainer)) {\n colorValueLabelWidth = colorValueLabel.measureDimensions().w;\n eventManager.associate(colorValueLabel, new DvtSimpleObjPeer(colorValueStr));\n }\n else {\n labelContainer.removeChild(colorLabel);\n labelContainer.removeChild(colorValueLabel);\n colorValueLabel = null;\n colorValueLabelWidth = 0;\n }\n }\n else if (sizeWidth > colorWidth) { // Reduce the size label size\n if (DvtTextUtils.fitText(sizeValueLabel, availWidth - colorWidth - sizeLabelWidth - DvtTreeLegendRenderer._LEGEND_LABEL_GAP, Infinity, labelContainer)) {\n sizeValueLabelWidth = sizeValueLabel.measureDimensions().w;\n eventManager.associate(sizeValueLabel, new DvtSimpleObjPeer(sizeValueStr));\n }\n else {\n labelContainer.removeChild(sizeLabel);\n labelContainer.removeChild(sizeValueLabel);\n sizeValueLabel = null;\n sizeValueLabelWidth = 0;\n }\n }\n else { // Reduce the color label size\n if (DvtTextUtils.fitText(colorValueLabel, availWidth - sizeWidth - colorLabelWidth - DvtTreeLegendRenderer._LEGEND_LABEL_GAP, Infinity, labelContainer)) {\n colorValueLabelWidth = colorValueLabel.measureDimensions().w;\n eventManager.associate(colorValueLabel, new DvtSimpleObjPeer(colorValueStr));\n }\n else {\n labelContainer.removeChild(colorLabel);\n labelContainer.removeChild(colorValueLabel);\n colorValueLabel = null;\n colorValueLabelWidth = 0;\n }\n }\n }\n\n // Position the text objects\n var x = 0;\n if (isRTL) {\n if (colorValueLabel) {\n colorValueLabel.setX(x);\n x += colorValueLabelWidth + DvtTreeLegendRenderer._LEGEND_LABEL_GAP;\n colorLabel.setX(x);\n x += colorLabelWidth + DvtTreeLegendRenderer._LEGEND_SECTION_GAP;\n }\n\n if (sizeValueLabel) {\n sizeValueLabel.setX(x);\n x += sizeValueLabelWidth + DvtTreeLegendRenderer._LEGEND_LABEL_GAP;\n sizeLabel.setX(x);\n }\n }\n else {\n if (sizeValueLabel) {\n sizeLabel.setX(x);\n x += sizeLabelWidth + DvtTreeLegendRenderer._LEGEND_LABEL_GAP;\n sizeValueLabel.setX(x);\n x += sizeValueLabelWidth + DvtTreeLegendRenderer._LEGEND_SECTION_GAP;\n }\n\n if (colorValueLabel) {\n colorLabel.setX(x);\n x += colorLabelWidth + DvtTreeLegendRenderer._LEGEND_LABEL_GAP;\n colorValueLabel.setX(x);\n }\n }\n }\n return labelContainer;\n};\n/*---------------------------------------------------------------------------------*/\n/* DvtBaseTreeKeyboardHandler Keyboard handler for Sunburst */\n/*---------------------------------------------------------------------------------*/\n/**\n * @param {DvtEventManager} manager The owning DvtEventManager\n * @class DvtBaseTreeKeyboardHandler\n * @extends {DvtKeyboardHandler}\n * @constructor\n */\nvar DvtBaseTreeKeyboardHandler = function(manager)\n{\n this.Init(manager);\n};\n\nDvtObj.createSubclass(DvtBaseTreeKeyboardHandler, DvtKeyboardHandler, 'DvtBaseTreeKeyboardHandler');\n\n\n/**\n * @override\n */\nDvtBaseTreeKeyboardHandler.prototype.isSelectionEvent = function(event)\n{\n return this.isNavigationEvent(event) && !event.ctrlKey;\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeKeyboardHandler.prototype.isMultiSelectEvent = function(event)\n{\n return event.keyCode == DvtKeyboardEvent.SPACE && event.ctrlKey;\n};\n/**\n * Default values and utility functions for component versioning.\n * @class\n * @constructor\n * @extends {DvtBaseComponentDefaults}\n */\nvar DvtBaseTreeDefaults = function() {};\n\nDvtObj.createSubclass(DvtBaseTreeDefaults, DvtBaseComponentDefaults, 'DvtBaseTreeDefaults');\n\n\n/**\n * Defaults for version 1. This component was exposed after the Alta skin, so no earlier defaults are provided.\n */\nDvtBaseTreeDefaults.VERSION_1 = {\n 'skin': DvtCSSStyle.SKIN_ALTA,\n\n // Note, only attributes that are different than the XML defaults need\n // to be listed here, at least until the XML API is replaced.\n 'animationDuration': 500,\n 'animationOnDataChange': 'none',\n 'animationOnDisplay': 'none',\n 'highlightMatch' : 'all',\n 'hoverBehavior': 'none', 'hoverBehaviorDelay': 200,\n 'nodeDefaults': {\n 'labelStyle': new DvtCSSStyle(\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 11px;\")\n },\n 'selectionMode': 'multiple',\n 'sorting': 'off',\n 'styleDefaults': {\n '_attributeTypeTextStyle': new DvtCSSStyle(\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:12px;font-weight:bold;color:#4F4F4F\"),\n '_attributeValueTextStyle': new DvtCSSStyle(\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:12px;\"),\n '_currentTextStyle': new DvtCSSStyle(\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:12px;\"),\n '_drillTextStyle': new DvtCSSStyle(\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:12px;\"),\n '_labelStyle': new DvtCSSStyle(\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\")\n },\n\n '_resources': {}\n};\n\n\n/**\n * @override\n */\nDvtBaseTreeDefaults.prototype.Init = function(defaultsMap) {\n // This will only be called via subclasses. Combine with defaults from this class before passing to super.\n var ret = {\n 'skyros': DvtJSONUtils.merge(defaultsMap['skyros'], DvtBaseTreeDefaults.VERSION_1),\n 'alta': DvtJSONUtils.merge(defaultsMap['alta'], {})\n };\n\n DvtBaseTreeDefaults.superclass.Init.call(this, ret);\n};\n/**\n * Utility functions for DvtBaseTreeView.\n * @class\n */\nvar DvtBaseTreeUtils = {};\n\nDvtObj.createSubclass(DvtBaseTreeUtils, DvtObj, 'DvtBaseTreeUtils');\n\n/**\n * Returns the maximum depth of the tree rooted at the specified node.\n * @param {DvtBaseTreeNode} node The subtree to find the depth for.\n * @param {number} depth The depth of the specified node.\n * @return {number} The maximum depth of the tree.\n */\nDvtBaseTreeUtils.calcMaxDepth = function(node, depth) {\n var maxDepth = depth;\n var children = node.getChildNodes();\n if (children) {\n for (var i = 0; i < children.length; i++) {\n var childDepth = DvtBaseTreeUtils.calcMaxDepth(children[i], depth + 1);\n maxDepth = Math.max(maxDepth, childDepth);\n }\n }\n return maxDepth;\n};\n\n/**\n * Returns the node count of the tree rooted at the specified node.\n * @param {DvtBaseTreeNode} node The subtree to find the depth for.\n * @return {number}\n */\nDvtBaseTreeUtils.calcNodeCount = function(node) {\n var count = 1;\n var children = node.getChildNodes();\n if (children) {\n for (var i = 0; i < children.length; i++) {\n count += DvtBaseTreeUtils.calcNodeCount(children[i]);\n }\n }\n return count;\n};\n\n/**\n * Returns an array containing all the nodes in the subtree rooted at the specified node.\n * @param {DvtBaseTreeNode} node\n * @return {array}\n */\nDvtBaseTreeUtils.getAllNodes = function(node) {\n var ret = [];\n DvtBaseTreeUtils._addNodesToArray(node, ret);\n return ret;\n};\n\n/**\n * Returns an array containing all the visible nodes in the subtree rooted at the specified node.\n * @param {DvtBaseTreeNode} node\n * @return {array}\n */\nDvtBaseTreeUtils.getAllVisibleNodes = function(node) {\n var ret = [];\n DvtBaseTreeUtils._addNodesToArray(node, ret, false, true);\n return ret;\n};\n\n/**\n * Returns an array containing all the leaf nodes in the subtree rooted at the specified node.\n * @param {DvtBaseTreeNode} node\n * @return {array}\n */\nDvtBaseTreeUtils.getLeafNodes = function(node) {\n var ret = [];\n DvtBaseTreeUtils._addNodesToArray(node, ret, true);\n return ret;\n};\n\n/**\n * Returns true if the node with the specified options would be hidden.\n * @param {object} categoryMap The boolean map of hidden categories.\n * @param {object} nodeOptions The options for the node to process.\n * @return {boolean}\n */\nDvtBaseTreeUtils.isHiddenNode = function(categoryMap, nodeOptions) {\n return DvtArrayUtils.hasAnyMapItem(categoryMap, nodeOptions['categories']);\n};\n\n/**\n * If not specified, calculates and updates the attribute groups min and max values.\n * @param {object} attrGroupOptions\n * @param {array} nodes\n */\nDvtBaseTreeUtils.calcContinuousAttrGroupsExtents = function(attrGroupOptions, nodes) {\n // Return if explicitly defined or no stamp id specified\n var stampId = attrGroupOptions['S'];\n if (stampId == null || (attrGroupOptions['min'] != null && attrGroupOptions['max'] != null))\n return;\n\n // Loop through all the nodes to find the values\n var min = Infinity;\n var max = -Infinity;\n for (var i = 0; i < nodes.length; i++) {\n // Only process if the template id matches. This is internal and only sent by ADF.\n var node = nodes[i];\n if (stampId == node.getStampId()) {\n var value = node.getOptions()['_cv'];\n if (value != null) {\n max = Math.max(max, value);\n min = Math.min(min, value);\n }\n }\n }\n\n // Apply the values\n if (attrGroupOptions['min'] == null)\n attrGroupOptions['min'] = min;\n\n if (attrGroupOptions['max'] == null)\n attrGroupOptions['max'] = max;\n};\n\n/**\n * Processes the list of attribute groups, applying the continuous color properties if needed.\n * @param {array} attrGroupsList The array of attribute groups definitions.\n * @param {array} nodes The array of nodes whose attribute groups will be applied.\n */\nDvtBaseTreeUtils.processContinuousAttrGroups = function(attrGroupsList, nodes) {\n for (var i = 0; i < attrGroupsList.length; i++) {\n var attrGroupsMap = attrGroupsList[i];\n var attrGroups = attrGroupsMap.attrGroups;\n var stampId = attrGroupsMap.stampId;\n if (attrGroups instanceof DvtContinuousAttrGroups && stampId != null) {\n for (var j = 0; j < nodes.length; j++) {\n // Only process if the template id matches. This is internal and only sent by ADF.\n var node = nodes[j];\n if (stampId == node.getStampId())\n node.processAttrGroups(attrGroups);\n }\n }\n }\n};\n\n/**\n * Recursively returns an array containing all nodes in the subtree of a given node.\n * @param {DvtBaseTreeNode} node The root of the subtree whose children will be returned.\n * @param {array} ret The array onto which to add the subtree.\n * @param {boolean=} bLeafOnly Optional flag to specify whether only leaf nodes should be included.\n * @param {boolean=} bRendered Optional flag to specify whether only rendered nodes should be included.\n * @private\n */\nDvtBaseTreeUtils._addNodesToArray = function(node, ret, bLeafOnly, bRendered) {\n if (!node)\n return;\n\n var children = node.getChildNodes();\n var childCount = children ? children.length : 0;\n\n // Add this node\n if ((!bLeafOnly || childCount == 0) && !(bRendered && !node.getDisplayable()))\n ret.push(node);\n\n // Add its children\n for (var i = 0; i < childCount; i++) {\n DvtBaseTreeUtils._addNodesToArray(children[i], ret, bLeafOnly, bRendered);\n }\n};\n// Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.\n/*---------------------------------------------------------------------*/\n/* DvtTreeAutomation Tree Automation Services */\n/*---------------------------------------------------------------------*/\n/**\n * Provides automation services for treemap/sunburst. To obtain a\n * @class DvtTreeAutomation\n * @param {DvtBaseTreeView} treeView\n * @implements {DvtAutomation}\n * @constructor\n * @export\n */\nvar DvtTreeAutomation = function(treeView)\n{\n this._treeView = treeView;\n this._root = treeView.getRootNode();\n};\n\nDvtObj.createSubclass(DvtTreeAutomation, DvtAutomation, 'DvtTreeAutomation');\n\n/**\n * The subId prefix for tree nodes\n */\nDvtTreeAutomation.NODE_ID_PREFIX = 'node';\n\n/**\n * The subId prefix for breadcrumbs\n */\nDvtTreeAutomation.BREADCRUMBS_PREFIX = 'breadcrumbs';\n\n/**\n * Valid subIds inlcude:\n * <ul>\n * <li>node[nodeIndex0][nodeIndex1]...[nodeIndexN]</li>\n * </ul>\n * @override\n */\nDvtTreeAutomation.prototype.GetSubIdForDomElement = function(displayable) {\n var logicalObj = this._treeView.getLogicalObject(displayable);\n\n if (!logicalObj) { // could be a breadcrumb\n if (displayable.getParent() instanceof DvtButton) {\n displayable = displayable.getParent();\n }\n var parent = displayable.getParent();\n if (parent instanceof DvtBreadcrumbs)\n return DvtTreeAutomation.BREADCRUMBS_PREFIX + '[' + parent.getCrumbIndex(displayable) + ']';\n return null;\n }\n\n if (logicalObj instanceof DvtBaseTreeNode)\n {\n var currentNode = logicalObj;\n var indices = '';\n\n if (!this._root.isArtificialRoot()) {\n // If logicalObj represents real root node, return default subId\n // Else include index for real root as first index in string of indices\n if (currentNode == this._root)\n return DvtTreeAutomation.NODE_ID_PREFIX + '[0]';\n else\n indices += '[0]';\n }\n // Indices for nodes beyond the root\n var childIndices = this._getIndicesFromNode(currentNode, this._root.getChildNodes());\n indices = childIndices ? indices + childIndices : indices;\n\n if (indices.length > 0)\n return DvtTreeAutomation.NODE_ID_PREFIX + indices;\n }\n return null;\n};\n\n\n/**\n * Returns the index values of the given node\n * @param {Object} node The tree node to find the indices for\n * @param {Object} children The legend nodes whose descendants are being searched\n * @return {String} [nodeIndex0][nodeIndex1]...[nodeIndexN]\n * @private\n */\nDvtTreeAutomation.prototype._getIndicesFromNode = function(node, children) {\n // If there are sections in this options object, recurse through the section object\n if (children && children.length > 0) {\n for (var n = 0; n < children.length; n++) {\n if (children[n] == node)\n return '[' + n + ']';\n else {\n var nodeIndex = this._getIndicesFromNode(node, children[n].getChildNodes());\n if (nodeIndex)\n return '[' + n + ']' + nodeIndex;\n }\n }\n }\n return null;\n};\n\n/**\n * Valid subIds inlcude:\n * <ul>\n * <li>node[nodeIndex0][nodeIndex1]...[nodeIndexN]</li>\n * <li>tooltip</li>\n * </ul>\n * @override\n * @export\n */\nDvtTreeAutomation.prototype.getDomElementForSubId = function(subId) {\n if (!subId)\n return null;\n\n // tooltip\n if (subId == DvtAutomation.TOOLTIP_SUBID)\n return this.GetTooltipElement(this._treeView);\n\n if (subId.indexOf(DvtTreeAutomation.BREADCRUMBS_PREFIX) == 0) {\n var index = subId.substring(subId.indexOf('[') + 1, subId.indexOf(']'));\n var crumb = this._root.getView().getBreadcrumbs().getCrumb(index);\n return crumb ? crumb.getElem() : null;\n }\n\n //If root is real remove first index from subId because we begin searching at the root\n if (!this._root.isArtificialRoot()) {\n subId = subId.substring(0, subId.indexOf('[')) + subId.substring(subId.indexOf(']') + 1);\n // If no more indices exist in the string return the root dom element\n if (subId == DvtTreeAutomation.NODE_ID_PREFIX)\n return this._root.getDisplayable().getElem();\n }\n\n var foundNode = this._getNodeFromSubId(this._root, subId);\n if (foundNode)\n return foundNode.getDisplayable().getElem();\n\n return null;\n};\n\n/**\n * Returns the tree node for the given subId\n * @param {Object} node The tree node whose children wil be searched\n * @param {String} subId The subId of the desired node\n * @return {Object} the child node corresponding to the given subId\n * @private\n */\nDvtTreeAutomation.prototype._getNodeFromSubId = function(node, subId) {\n var openParen = subId.indexOf('[');\n var closeParen = subId.indexOf(']');\n if (openParen >= 0 && closeParen >= 0) {\n var index = subId.substring(openParen + 1, closeParen);\n subId = subId.substring(closeParen + 1);\n var nextOpenParen = subId.indexOf('[');\n var nextCloseParen = subId.indexOf(']');\n\n var childNode = DvtTreeAutomation._getNodeByIndex(node.getChildNodes(), index);\n if (nextOpenParen >= 0 && nextCloseParen >= 0) {\n // If there is another index layer recurse into the child node at that index\n return this._getNodeFromSubId(childNode, subId);\n }\n else // If we are at the last index return the child node at that index\n return childNode;\n }\n};\n\n\n/**\n * Returns the tree node for the given path array\n * @param {Object} node The tree node whose children wil be searched\n * @param {String} path The array of indices\n * @return {Object} the child node corresponding to the given path\n * @private\n */\nDvtTreeAutomation.prototype._getNodeFromPath = function(node, path) {\n // Remove index at the head of the array\n var index = path.shift();\n\n var childNode = DvtTreeAutomation._getNodeByIndex(node.getChildNodes(), index);\n if (path.length == 0) // If this is the last index return child node at that position\n return childNode;\n else if (path.length > 0)\n return this._getNodeFromPath(childNode, path);\n\n return null;\n};\n\n\n/**\n * Returns an object containing data for a tree node. Used for verification.\n * Valid verification values inlcude:\n * <ul>\n * <li>color</li>\n * <li>label</li>\n * <li>selected</li>\n * <li>size</li>\n * <li>tooltip</li>\n * </ul>\n * @param {String} subIdPath The array of indices in the subId for the desired node\n * @return {Object} An object containing data for the node\n * @export\n */\nDvtTreeAutomation.prototype.getNode = function(subIdPath) {\n // If the root is real, remove first element of subIdPath since we already start searching at the root\n if (!this._root.isArtificialRoot() && subIdPath[0] == 0)\n subIdPath.shift();\n\n // If root index was the only element of subIdPath, set the node to get data for as the root, else search for the correct node\n var node = (subIdPath.length == 0) ? this._root : this._getNodeFromPath(this._root, subIdPath);\n\n var nodeData = {\n 'color': node.getColor(),\n 'label': node.getLabel(),\n 'selected': node.isSelected() == undefined ? false : node.isSelected(),\n 'size': node.getSize(),\n 'tooltip': node.getShortDesc()\n };\n\n return nodeData;\n};\n\n/**\n * Returns the node from the array with the specified index.\n * @param {array} nodes\n * @param {number} index\n * @return {DvtBaseTreeNode}\n * @private\n */\nDvtTreeAutomation._getNodeByIndex = function(nodes, index) {\n for (var i = 0; i < nodes.length; i++) {\n if (index == nodes[i].getIndex())\n return nodes[i];\n }\n\n // None found, return null\n return null;\n};\n return D;\n});", "meta": {"content_hash": "a3fee42f7804f895e76825e227af3038", "timestamp": "", "source": "github", "line_count": 3243, "max_line_length": 170, "avg_line_length": 30.589885908109775, "alnum_prop": 0.7075693275404977, "repo_name": "jobinesh/jet-examples", "id": "772b5086382d1b54fcd197920c8f400d03c42ce3", "size": "99287", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "node-jet1.1.2-mongo-app/public/js/libs/oj/v1.1.2/debug/internal-deps/dvt/DvtBaseTreeView.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "4792833"}, {"name": "HTML", "bytes": "52517"}, {"name": "JavaScript", "bytes": "48909007"}]}} +{"text": "<?php\n\n\n\nnamespace FOS\\UserBundle\\Command;\n\nuse FOS\\UserBundle\\Util\\UserManipulator;\nuse Symfony\\Component\\Console\\Attribute\\AsCommand;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\nuse Symfony\\Component\\Console\\Question\\Question;\n\n/**\n * @author Antoine H\u00e9rault <antoine.herault@gmail.com>\n *\n * @internal\n *\n * @final\n */\n#[AsCommand(name: 'fos:user:deactivate', description: 'Deactivate a user')]\nclass DeactivateUserCommand extends Command\n{\n // BC with Symfony <5.3\n protected static $defaultName = 'fos:user:deactivate';\n\n private $userManipulator;\n\n public function __construct(UserManipulator $userManipulator)\n {\n parent::__construct();\n\n $this->userManipulator = $userManipulator;\n }\n\n /**\n * {@inheritdoc}\n */\n protected function configure()\n {\n $this\n // BC with Symfony <5.3\n ->setName('fos:user:deactivate')\n ->setDescription('Deactivate a user')\n ->setDefinition([\n new InputArgument('username', InputArgument::REQUIRED, 'The username'),\n ])\n ->setHelp(<<<'EOT'\nThe <info>fos:user:deactivate</info> command deactivates a user (will not be able to log in)\n\n <info>php %command.full_name% matthieu</info>\nEOT\n );\n }\n\n /**\n * {@inheritdoc}\n */\n protected function execute(InputInterface $input, OutputInterface $output): int\n {\n $username = $input->getArgument('username');\n\n $this->userManipulator->deactivate($username);\n\n $output->writeln(sprintf('User \"%s\" has been deactivated.', $username));\n\n return 0;\n }\n\n /**\n * {@inheritdoc}\n */\n protected function interact(InputInterface $input, OutputInterface $output)\n {\n if (!$input->getArgument('username')) {\n $question = new Question('Please choose a username:');\n $question->setValidator(function ($username) {\n if (empty($username)) {\n throw new \\Exception('Username can not be empty');\n }\n\n return $username;\n });\n $answer = $this->getHelper('question')->ask($input, $output, $question);\n\n $input->setArgument('username', $answer);\n }\n }\n}\n", "meta": {"content_hash": "805865139d4153b7aa48178ef6c1a711", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 92, "avg_line_length": 26.877777777777776, "alnum_prop": 0.6134766432410087, "repo_name": "FriendsOfSymfony/FOSUserBundle", "id": "d1876f706d4242254013e95c9749494937d3c203", "size": "2672", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Command/DeactivateUserCommand.php", "mode": "33188", "license": "mit", "language": [{"name": "Makefile", "bytes": "154"}, {"name": "PHP", "bytes": "283258"}, {"name": "Twig", "bytes": "6819"}]}} +{"text": "Helium\n======\n\nA small 64 bit OS with a micro-kernel.\n\n## Done\n\n1. Read Multiboot Info\n - memory map\n - module table\n \n## Partially Done\n\n2. Setup Page Frame Allocator\n - watermark\n - revisit for more sophisticated implementation\n\n## TODO\n\n3. Setup Virtual Memory Allocator\n - decide where to map paging structures\n4. CPU features like I/O Ports, MSRs, etc. \n - may be needed be earlier steps too\n5. Parse ACPI and SMP Tables\n - needs virtual memory management (at least for ACPI)\n6. Enable I/O APICs and Local APIC of BSP\n7. Boot Application Processors\n8. Keyboard\n9. User Mode processes\n10. Virtual Consoles\n", "meta": {"content_hash": "d302a442cbba468fa062298ae12e5e23", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 57, "avg_line_length": 21.133333333333333, "alnum_prop": 0.7113564668769716, "repo_name": "fatho/Helium", "id": "ea54eb0fdaf532875f49ea48f9d03b476c35c0a0", "size": "634", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Assembly", "bytes": "12562"}, {"name": "C", "bytes": "129325"}, {"name": "C++", "bytes": "44794"}, {"name": "Shell", "bytes": "431"}]}} +{"text": "@implementation PriceBar\n\n@synthesize date = _date;\n@synthesize open = _open;\n@synthesize high = _high;\n@synthesize low = _low;\n@synthesize close = _close;\n@synthesize volume = _volume;\n\n- (instancetype)initWithOpen:(double)open high:(double)high low:(double)low close:(double)close volume:(long)volume {\n self = [super init];\n if (self) {\n _date = [[NSDate alloc] init];\n _open = open;\n _high = high;\n _low = low;\n _close = close;\n _volume = volume;\n }\n return self;\n}\n\n- (instancetype)initWithDate:(NSDate *)date open:(double)open high:(double)high low:(double)low close:(double)close volume:(long)volume {\n self = [super init];\n if (self) {\n _date = date;\n _open = open;\n _high = high;\n _low = low;\n _close = close;\n _volume = volume;\n }\n return self;\n}\n\n@end\n", "meta": {"content_hash": "2654d0f60961d8629be540e4af4fc615", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 137, "avg_line_length": 24.194444444444443, "alnum_prop": 0.5832376578645235, "repo_name": "ABTSoftware/SciChartiOSTutorial", "id": "0c835ac36a0367eb1aa2e6cbdeff16c4326ed6b1", "size": "1647", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "v2.x/Examples/SciChartDemo/SciChartDemo/Data/PriceBar.m", "mode": "33261", "license": "mit", "language": [{"name": "Swift", "bytes": "77055"}]}} +{"text": "(function() {\n 'use strict';\n if (!navigator.geolocation) { alert('Cannot use geolocation'); return; }\n\n var success = function(pos) {\n console.log(pos.coords);\n var info = '\u7def\u5ea6:' + pos.coords.latitude + '<br/>' +\n '\u7d4c\u5ea6:' + pos.coords.longitude + '<br/>';\n console.log(info);\n document.getElementById('current_info').innerHTML = info;\n };\n\n var error = function(err) {\n alert('ERROR! (' + err.code + ' : ' + err.message + ')');\n };\n\n navigator.geolocation.getCurrentPosition(success, error);\n\n}).call(this);\n", "meta": {"content_hash": "b0988f411078b84f16748aaf27c88052", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 74, "avg_line_length": 28.526315789473685, "alnum_prop": 0.5977859778597786, "repo_name": "TomckySan/wordbench", "id": "ae30d8b0c3de7fed2fb130b8429d953fb49df63e", "size": "550", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vol9_20150425/geolocation-api-sample/geolocation-sample.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "844"}, {"name": "JavaScript", "bytes": "3347"}]}} +{"text": "import { SessionApitype } from './../apitypes/Session.apitype';\nimport { Injectable } from '@angular/core';\n\n@Injectable()\nexport class StateService {\n\n private _isLoggedIn = false;\n get isLoggedIn(): boolean {\n return this._isLoggedIn;\n }\n set isLoggedIn(_isLoggedIn: boolean) {\n this._isLoggedIn = _isLoggedIn;\n this.saveLocalStorage();\n }\n\n private _isAdmin = false;\n get isAdmin(): boolean {\n return this._isAdmin;\n }\n set isAdmin(_isAdmin: boolean) {\n this._isAdmin = _isAdmin;\n this.saveLocalStorage();\n }\n\n private _apiToken: string = null;\n get apiToken(): string {\n return this._apiToken;\n }\n set apiToken(_apiToken: string) {\n this._apiToken = _apiToken;\n this.saveLocalStorage();\n }\n\n private _isNative = false;\n get isNative(): boolean {\n return this._isNative;\n }\n set isNative(_isNative: boolean) {\n this._isNative = _isNative;\n this.saveLocalStorage();\n }\n\n private _pageSize = 25;\n get pageSize(): number {\n return this._pageSize;\n }\n set pageSize(_pageSize: number) {\n this._pageSize = _pageSize;\n this.saveLocalStorage();\n }\n\n private _pageSizes = [5, 10, 25, 50, 100];\n get pageSizes(): Array<number> {\n return this._pageSizes;\n }\n\n private _recordTypes = [\n 'A', 'A6', 'AAAA', 'AFSDB', 'ALIAS', 'CAA', 'CDNSKEY', 'CDS', 'CERT', 'CNAME', 'DHCID',\n 'DLV', 'DNAME', 'DNSKEY', 'DS', 'EUI48', 'EUI64', 'HINFO',\n 'IPSECKEY', 'KEY', 'KX', 'LOC', 'LUA', 'MAILA', 'MAILB', 'MINFO', 'MR',\n 'MX', 'NAPTR', 'NS', 'NSEC', 'NSEC3', 'NSEC3PARAM', 'OPENPGPKEY',\n 'OPT', 'PTR', 'RKEY', 'RP', 'RRSIG', 'SIG', 'SPF',\n 'SRV', 'TKEY', 'SSHFP', 'TLSA', 'TSIG', 'TXT', 'WKS', 'MBOXFW', 'URL'\n ];\n get recordTypes(): Array<string> {\n return this._recordTypes;\n }\n\n constructor() {\n this.loadLocalStorage();\n }\n\n private saveLocalStorage() {\n localStorage.setItem('pdnsmanagerstate', JSON.stringify(this));\n }\n\n private loadLocalStorage() {\n Object.assign(this, JSON.parse(localStorage.getItem('pdnsmanagerstate')));\n }\n}\n", "meta": {"content_hash": "1adac14952514977ee189dee90331134", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 95, "avg_line_length": 27.6625, "alnum_prop": 0.5661997288748305, "repo_name": "loewexy/pdnsmanager", "id": "3535deb3289309ad74a76fd389706977fd49919b", "size": "2213", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "frontend/src/app/services/state.service.ts", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "41226"}, {"name": "JavaScript", "bytes": "67754"}, {"name": "PHP", "bytes": "136459"}, {"name": "SCSS", "bytes": "2066"}, {"name": "Shell", "bytes": "4786"}, {"name": "TypeScript", "bytes": "102332"}]}} +{"text": "\ufeffusing System.IO;\r\nusing Goedel.Mesh.Shell;\r\nusing Goedel.Cryptography;\r\nusing MT=Microsoft.VisualStudio.TestTools.UnitTesting;\r\nusing Goedel.Test;\r\n\r\nnamespace Goedel.Catalog.Test {\r\n [MT.TestClass]\r\n public partial class CatalogTests {\r\n static string ResultDirectory;\r\n static string ContainerDirectory = \"Shells\";\r\n\r\n const string DirectorySource = \"Files\";\r\n const string DirectoryEncrypted = \"Encrypted\";\r\n const string DirectoryDecrypted = \"Decrypted\";\r\n\r\n const string DirectoryTarget = \"Target\";\r\n string Target(string File) => DirectoryTarget + @\"\\\" + File;\r\n\r\n const string DirectoryArchive = \"Archive\";\r\n const string DirectoryArchiveCopy = \"ArchiveCopy\";\r\n string Archive(string File) => DirectoryArchive + @\"\\\" + File;\r\n\r\n const string FileTest1 = @\"PHBLogo1.svg\";\r\n const string FileTest2 = @\"PHBLogo1.svg\";\r\n const string FileTest3 = @\"PHBLogo180.png\";\r\n const string FileTest4 = @\"PHBLogo256.ico\";\r\n const string FileTest5 = @\"PHBLogo256.png\";\r\n\r\n /// <summary>\r\n /// \r\n /// </summary>\r\n public static void TestDirect() {\r\n InitializeClass();\r\n var Instance = new CatalogTests();\r\n //Instance.TestBasicCalendar();\r\n //Instance.TestContainerSerial();\r\n Instance.TestContainerArchiveBase();\r\n //Instance.TestBasicBookMark();\r\n //Instance.TestBasicCredential();\r\n }\r\n\r\n static ShellDispatch ShellDispatchCommon;\r\n\r\n [MT.AssemblyInitialize]\r\n public static void InitializeClass(MT.TestContext Context) {\r\n ResultDirectory = Context.TestRunDirectory;\r\n Directory.SetCurrentDirectory(Directories.RunDirectoryFramework);\r\n \r\n InitializeClass();\r\n }\r\n\r\n public static void InitializeClass() {\r\n \r\n Directory.CreateDirectory(ContainerDirectory);\r\n Directory.CreateDirectory(DirectoryEncrypted);\r\n Directory.CreateDirectory(DirectoryDecrypted);\r\n Directory.CreateDirectory(DirectoryTarget);\r\n Directory.CreateDirectory(DirectoryArchive);\r\n CryptographyWindows.Initialize();\r\n\r\n ShellDispatchCommon = GetShell(\"TestFile.dcon\");\r\n // OK so here create ourselves a set of test keys for encryption and signature\r\n\r\n\r\n }\r\n\r\n static ShellDispatch GetShell(string Filename) {\r\n Filename = ContainerDirectory + @\"\\\" + Filename;\r\n\r\n File.Delete(Filename);\r\n return new ShellDispatch(Catalog: Filename);\r\n }\r\n }\r\n\r\n\r\n\r\n }\r\n", "meta": {"content_hash": "3d63cd8735f3281586ecfccfc871e2aa", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 90, "avg_line_length": 34.62820512820513, "alnum_prop": 0.6086634579785265, "repo_name": "hallambaker/Mathematical-Mesh", "id": "cf66a66ca0af10724080b5d89e43ec9fffea30a3", "size": "2703", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "Testing/Goedel.Catalog.Test/base.cs", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "4297"}, {"name": "C", "bytes": "10818"}, {"name": "C#", "bytes": "7433774"}, {"name": "C++", "bytes": "2618"}, {"name": "CSS", "bytes": "24248"}, {"name": "Dockerfile", "bytes": "146"}, {"name": "HTML", "bytes": "18736869"}, {"name": "JavaScript", "bytes": "2218"}, {"name": "Makefile", "bytes": "143050"}, {"name": "Python", "bytes": "27929"}, {"name": "Shell", "bytes": "40856"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n\"http://www.w3.org/TR/html4/loose.dtd\">\r\n<html>\r\n<head>\r\n<title>Minim : : AudioSample : : mute</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n<link href=\"stylesheet.css\" rel=\"stylesheet\" type=\"text/css\">\r\n</head>\r\n<body> \r\n<center>\r\n<table class=\"mainTable\">\r\n\r\n <tr>\r\n <td class=\"header\">\r\n \t<span class=\"indexheader\">Minim</span><br/>\r\n \t<span class=\"indexnavigation\">\r\n \t\t<a href=\"index.html\">core</a> | \r\n \t\t<a href=\"index_ugens.html\">ugens</a> | \r\n \t\t<a href=\"index_analysis.html\">analysis</a>\r\n \t</span>\r\n </td>\r\n <td class=\"border-left\"> </td>\r\n </tr>\r\n \r\n <tr>\r\n <td class=\"classNavigation\">\r\n \t<p class=\"mainTextName\"><A href=\"controller_class_controller.html\">Controller</A></p>\r\n \t<p class=\"methodName\">mute</p>\r\n </td>\r\n <td class=\"mainText border-left\">\r\n \t<p class=\"memberSectionHeader\">Description</p>\r\n \tMutes the sound.\r\n \t\r\n \t<p class=\"memberSectionHeader\">Signature</p>\r\n \t<pre>void mute()\n</pre>\r\n \t\r\n \t\r\n \t\r\n <p class=\"memberSectionHeader\">Returns</p> \r\n <p>None</p>\r\n \r\n \t\r\n \t<p class=\"memberSectionHeader\">Related</p>\r\n \t<A href=\"audiosample_method_unmute.html\">unmute ( )</A><BR>\n<A href=\"audiosample_method_ismuted.html\">isMuted ( )</A><BR>\n\r\n \t\r\n \t<p class=\"memberSectionHeader\">Example</p>\r\n \t<pre>None available</pre>\r\n \t\r\n \t<p class=\"memberSectionHeader\">Usage</p>\r\n \tWeb & Application\r\n </td>\r\n </tr>\r\n</table>\r\n</center>\r\n</body>\r\n</html>\r\n", "meta": {"content_hash": "372c16faad41ee81e05f565709e3eed5", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 90, "avg_line_length": 26.83050847457627, "alnum_prop": 0.5862286797220467, "repo_name": "UTSDataArena/examples", "id": "9fe9036c495ae317e616fa16d4a028e58272168a", "size": "1583", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "processing/sketchbook/libraries/minim/documentation/audiosample_method_mute.html", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "CSS", "bytes": "76811"}, {"name": "HTML", "bytes": "791628"}, {"name": "Java", "bytes": "1060796"}, {"name": "JavaScript", "bytes": "1863596"}, {"name": "Matlab", "bytes": "16205"}, {"name": "Processing", "bytes": "506308"}, {"name": "Python", "bytes": "118339"}, {"name": "Shell", "bytes": "165"}]}} +{"text": "\n\n// This code is auto-generated, do not modify\npackage com.spectralogic.ds3client.commands.parsers;\n\nimport com.spectralogic.ds3client.commands.parsers.interfaces.AbstractResponseParser;\nimport com.spectralogic.ds3client.commands.parsers.utils.ResponseParserUtils;\nimport com.spectralogic.ds3client.commands.spectrads3.notifications.GetPoolFailureNotificationRegistrationSpectraS3Response;\nimport com.spectralogic.ds3client.models.PoolFailureNotificationRegistration;\nimport com.spectralogic.ds3client.networking.WebResponse;\nimport com.spectralogic.ds3client.serializer.XmlOutput;\nimport java.io.IOException;\nimport java.io.InputStream;\n\npublic class GetPoolFailureNotificationRegistrationSpectraS3ResponseParser extends AbstractResponseParser<GetPoolFailureNotificationRegistrationSpectraS3Response> {\n private final int[] expectedStatusCodes = new int[]{200};\n\n @Override\n public GetPoolFailureNotificationRegistrationSpectraS3Response parseXmlResponse(final WebResponse response) throws IOException {\n final int statusCode = response.getStatusCode();\n if (ResponseParserUtils.validateStatusCode(statusCode, expectedStatusCodes)) {\n switch (statusCode) {\n case 200:\n try (final InputStream inputStream = response.getResponseStream()) {\n final PoolFailureNotificationRegistration result = XmlOutput.fromXml(inputStream, PoolFailureNotificationRegistration.class);\n return new GetPoolFailureNotificationRegistrationSpectraS3Response(result, this.getChecksum(), this.getChecksumType());\n }\n\n default:\n assert false: \"validateStatusCode should have made it impossible to reach this line\";\n }\n }\n\n throw ResponseParserUtils.createFailedRequest(response, expectedStatusCodes);\n }\n}", "meta": {"content_hash": "59a2e766680916f5b837f6d89dfc5c3d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 164, "avg_line_length": 51.27777777777778, "alnum_prop": 0.776273022751896, "repo_name": "DenverM80/ds3_java_sdk", "id": "285ec7d4bab75a52a6e6d54bc773024886d536d8", "size": "2603", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ds3-sdk/src/main/java/com/spectralogic/ds3client/commands/parsers/GetPoolFailureNotificationRegistrationSpectraS3ResponseParser.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "4841457"}, {"name": "Kotlin", "bytes": "9285"}, {"name": "Ruby", "bytes": "3144"}, {"name": "Shell", "bytes": "474"}]}} +{"text": "\n\npackage com.google.errorprone.refaster;\n\nimport com.google.auto.value.AutoValue;\nimport com.google.common.base.Function;\nimport com.google.common.base.Optional;\nimport com.google.common.collect.Iterables;\nimport com.google.errorprone.refaster.ControlFlowVisitor.Result;\nimport com.sun.source.tree.IfTree;\nimport com.sun.source.tree.StatementTree;\nimport com.sun.source.tree.TreeVisitor;\nimport com.sun.tools.javac.tree.JCTree.JCStatement;\nimport com.sun.tools.javac.util.List;\nimport javax.annotation.Nullable;\n\n/**\n * {@link UTree} representation of an {@link IfTree}.\n *\n * @author lowasser@google.com (Louis Wasserman)\n */\n@AutoValue\nabstract class UIf implements UStatement, IfTree {\n public static UIf create(\n UExpression condition, UStatement thenStatement, UStatement elseStatement) {\n return new AutoValue_UIf(condition, thenStatement, elseStatement);\n }\n\n @Override\n public abstract UExpression getCondition();\n\n @Override\n public abstract UStatement getThenStatement();\n\n @Override\n @Nullable\n public abstract UStatement getElseStatement();\n\n @Override\n public <R, D> R accept(TreeVisitor<R, D> visitor, D data) {\n return visitor.visitIf(this, data);\n }\n\n @Override\n public Kind getKind() {\n return Kind.IF;\n }\n\n private static Function<Unifier, Choice<Unifier>> unifyUStatementWithSingleStatement(\n @Nullable final UStatement toUnify, @Nullable final StatementTree target) {\n return (Unifier unifier) -> {\n if (toUnify == null) {\n return (target == null) ? Choice.of(unifier) : Choice.<Unifier>none();\n }\n List<StatementTree> list = (target == null) ? List.<StatementTree>nil() : List.of(target);\n return toUnify\n .apply(UnifierWithUnconsumedStatements.create(unifier, list))\n .condition(s -> s.unconsumedStatements().isEmpty())\n .transform(UnifierWithUnconsumedStatements::unifier);\n };\n }\n\n @Override\n @Nullable\n public Choice<UnifierWithUnconsumedStatements> apply(UnifierWithUnconsumedStatements state) {\n java.util.List<? extends StatementTree> unconsumedStatements = state.unconsumedStatements();\n if (unconsumedStatements.isEmpty()) {\n return Choice.none();\n }\n final java.util.List<? extends StatementTree> unconsumedStatementsTail =\n unconsumedStatements.subList(1, unconsumedStatements.size());\n StatementTree firstStatement = unconsumedStatements.get(0);\n if (firstStatement.getKind() != Kind.IF) {\n return Choice.none();\n }\n final IfTree ifTree = (IfTree) firstStatement;\n Unifier unifier = state.unifier();\n Choice<UnifierWithUnconsumedStatements> forwardMatch =\n getCondition()\n .unify(ifTree.getCondition(), unifier.fork())\n .thenChoose(\n unifyUStatementWithSingleStatement(getThenStatement(), ifTree.getThenStatement()))\n .thenChoose(\n unifierAfterThen -> {\n if (getElseStatement() != null\n && ifTree.getElseStatement() == null\n && ControlFlowVisitor.INSTANCE.visitStatement(ifTree.getThenStatement())\n == Result.ALWAYS_RETURNS) {\n Choice<UnifierWithUnconsumedStatements> result =\n getElseStatement()\n .apply(\n UnifierWithUnconsumedStatements.create(\n unifierAfterThen.fork(), unconsumedStatementsTail));\n if (getElseStatement() instanceof UBlock) {\n Choice<UnifierWithUnconsumedStatements> alternative =\n Choice.of(\n UnifierWithUnconsumedStatements.create(\n unifierAfterThen.fork(), unconsumedStatementsTail));\n for (UStatement stmt : ((UBlock) getElseStatement()).getStatements()) {\n alternative = alternative.thenChoose(stmt);\n }\n result = result.or(alternative);\n }\n return result;\n } else {\n return unifyUStatementWithSingleStatement(\n getElseStatement(), ifTree.getElseStatement())\n .apply(unifierAfterThen)\n .transform(\n unifierAfterElse ->\n UnifierWithUnconsumedStatements.create(\n unifierAfterElse, unconsumedStatementsTail));\n }\n });\n Choice<UnifierWithUnconsumedStatements> backwardMatch =\n getCondition()\n .negate()\n .unify(ifTree.getCondition(), unifier.fork())\n .thenChoose(\n unifierAfterCond -> {\n if (getElseStatement() == null) {\n return Choice.none();\n }\n return getElseStatement()\n .apply(\n UnifierWithUnconsumedStatements.create(\n unifierAfterCond, List.of(ifTree.getThenStatement())))\n .thenOption(\n (UnifierWithUnconsumedStatements stateAfterThen) ->\n stateAfterThen.unconsumedStatements().isEmpty()\n ? Optional.of(stateAfterThen.unifier())\n : Optional.<Unifier>absent());\n })\n .thenChoose(\n unifierAfterThen -> {\n if (ifTree.getElseStatement() == null\n && ControlFlowVisitor.INSTANCE.visitStatement(ifTree.getThenStatement())\n == Result.ALWAYS_RETURNS) {\n Choice<UnifierWithUnconsumedStatements> result =\n getThenStatement()\n .apply(\n UnifierWithUnconsumedStatements.create(\n unifierAfterThen.fork(), unconsumedStatementsTail));\n if (getThenStatement() instanceof UBlock) {\n Choice<UnifierWithUnconsumedStatements> alternative =\n Choice.of(\n UnifierWithUnconsumedStatements.create(\n unifierAfterThen.fork(), unconsumedStatementsTail));\n for (UStatement stmt : ((UBlock) getThenStatement()).getStatements()) {\n alternative = alternative.thenChoose(stmt);\n }\n result = result.or(alternative);\n }\n return result;\n } else {\n return unifyUStatementWithSingleStatement(\n getThenStatement(), ifTree.getElseStatement())\n .apply(unifierAfterThen)\n .transform(\n unifierAfterElse ->\n UnifierWithUnconsumedStatements.create(\n unifierAfterElse, unconsumedStatementsTail));\n }\n });\n return forwardMatch.or(backwardMatch);\n }\n\n @Override\n public List<JCStatement> inlineStatements(Inliner inliner) throws CouldNotResolveImportException {\n return List.<JCStatement>of(\n inliner\n .maker()\n .If(\n getCondition().inline(inliner),\n Iterables.getOnlyElement(getThenStatement().inlineStatements(inliner)),\n (getElseStatement() == null)\n ? null\n : Iterables.getOnlyElement(getElseStatement().inlineStatements(inliner))));\n }\n}\n", "meta": {"content_hash": "2c0b4be3dd2147a31d89f107fb938bad", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 100, "avg_line_length": 43.15, "alnum_prop": 0.5664992918758851, "repo_name": "cushon/error-prone", "id": "88b624e65c581fde18b04fe60a17366bf957a88e", "size": "8372", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/main/java/com/google/errorprone/refaster/UIf.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "2061"}, {"name": "Java", "bytes": "7364383"}, {"name": "Python", "bytes": "10499"}, {"name": "Shell", "bytes": "1815"}]}} +{"text": "'use strict';\n\nconst expect = require('../../helpers/expect');\n\nconst WriteImages = require('../../../src/utils/write-images');\n\nconst fs = require('fs');\nconst sizeOf = require('image-size');\nconst _forOwn = require('lodash').forOwn;\n\ndescribe('WriteImages', function() {\n // Hitting the file system is slow\n this.timeout(0);\n\n before(() => {\n if (!fs.existsSync('tmp')) fs.mkdirSync('tmp');\n });\n\n context('when source, projectPath, dest, and platformSizes', () => {\n const source = 'node-tests/fixtures/icon.svg';\n const projectPath = 'tmp';\n const dest = 'icons';\n const platformSizes = {\n ios: {\n sizeKey: 'width',\n sizes: [\n {\n size: 57,\n id: 'icon'\n }\n ]\n }\n };\n let subject;\n\n before(() => {\n subject = WriteImages({\n source: source,\n projectPath: projectPath,\n dest: dest,\n platformSizes: platformSizes\n });\n });\n\n after(() => {\n platformSizes['ios'].sizes.forEach((rasterize) => {\n fs.unlinkSync(`${projectPath}/${rasterize.path}`);\n });\n });\n\n it('resolves to platform sizes updated with paths', (done) => {\n subject.then((updatedPlatformSizes) => {\n try {\n _forOwn(updatedPlatformSizes, (icons, platform) => {\n icons.sizes.map((size) => {\n const path = `${dest}/${platform}/${size.id}.png`;\n expect(size.path).to.equal(path);\n });\n });\n done();\n } catch(e) {\n done(e);\n }\n });\n });\n\n it('writes the files to rasterize at the right size', (done) => {\n subject.then((updatedPlatformSizes) => {\n try {\n updatedPlatformSizes['ios'].sizes.forEach((rasterize) => {\n const writePath = `${projectPath}/${rasterize.path}`;\n expect(fs.existsSync(writePath)).to.equal(true);\n expect(sizeOf(writePath).width).to.equal(rasterize.size);\n expect(sizeOf(writePath).height).to.equal(rasterize.size);\n });\n done();\n } catch(e) {\n done(e);\n }\n });\n });\n });\n});\n", "meta": {"content_hash": "d21cf1bd3dead2a17affc844d954fedf", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 70, "avg_line_length": 26.40963855421687, "alnum_prop": 0.5086678832116789, "repo_name": "isleofcode/splicon", "id": "183e13ebd76446bc84602ab0294ff2c2d5b2bc03", "size": "2192", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node-tests/unit/utils/write-images-test.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "37934"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE sun-web-app PUBLIC \"-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN\" \"http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd\">\n<sun-web-app error-url=\"\">\n <context-root>/Gateway/AdminDistribution/2_0</context-root>\n <class-loader delegate=\"false\"/>\n <jsp-config>\n <property name=\"keepgenerated\" value=\"true\">\n <description>Keep a copy of the generated servlet class' java code.</description>\n </property>\n </jsp-config>\n</sun-web-app>\n", "meta": {"content_hash": "43670b2a67b0f399b43fb07b8f7751f1", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 168, "avg_line_length": 48.27272727272727, "alnum_prop": 0.6949152542372882, "repo_name": "sailajaa/CONNECT", "id": "4f561b11a0dc1aa417869695d3405788e28a89e0", "size": "531", "binary": false, "copies": "2", "ref": "refs/heads/CONNECT_integration", "path": "Product/Production/Gateway/AdminDistribution_20/src/main/webapp/WEB-INF/sun-web.xml", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "5539"}, {"name": "Groovy", "bytes": "1641"}, {"name": "Java", "bytes": "12552183"}, {"name": "Python", "bytes": "773"}, {"name": "Shell", "bytes": "14607"}, {"name": "XSLT", "bytes": "35057"}]}} +{"text": "\ufeff//------------------------------------------------------------------------------\n// <auto-generated>\n// This code was generated by a tool.\n//\n// Changes to this file may cause incorrect behavior and will be lost if\n// the code is regenerated. \n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace GRA.SRP.ControlRoom.Modules.Setup {\n \n \n public partial class SurveyEmbedCode {\n \n /// <summary>\n /// SID control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.DropDownList SID;\n \n /// <summary>\n /// DDSourceType control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.DropDownList DDSourceType;\n \n /// <summary>\n /// IWidth control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.TextBox IWidth;\n \n /// <summary>\n /// revIWidth control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.RegularExpressionValidator revIWidth;\n \n /// <summary>\n /// rvIWidth control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.RangeValidator rvIWidth;\n \n /// <summary>\n /// DDSourceID control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.DropDownList DDSourceID;\n \n /// <summary>\n /// IHeight control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.TextBox IHeight;\n \n /// <summary>\n /// RegularExpressionValidator1 control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator1;\n \n /// <summary>\n /// RangeValidator1 control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.RangeValidator RangeValidator1;\n \n /// <summary>\n /// btnFilter control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.Button btnFilter;\n \n /// <summary>\n /// btnFilter0 control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.Button btnFilter0;\n \n /// <summary>\n /// odsDDSurveys control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.ObjectDataSource odsDDSurveys;\n \n /// <summary>\n /// pnlResults control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.Panel pnlResults;\n \n /// <summary>\n /// lblInfo control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.Label lblInfo;\n \n /// <summary>\n /// txtResults control.\n /// </summary>\n /// <remarks>\n /// Auto-generated field.\n /// To modify move field declaration from designer file to code-behind file.\n /// </remarks>\n protected global::System.Web.UI.WebControls.TextBox txtResults;\n }\n}\n", "meta": {"content_hash": "d629095c405935f7e0753d3f80454e26", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 107, "avg_line_length": 35.846666666666664, "alnum_prop": 0.5460293844151014, "repo_name": "justinmeiners/greatreadingadventure", "id": "66e0b85c81ba5bf1407f1e44c2aae027ecdf2aae", "size": "5379", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SRP/ControlRoom/Modules/Setup/SurveyEmbedCode.aspx.designer.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "2280623"}, {"name": "C#", "bytes": "3427541"}, {"name": "CSS", "bytes": "188580"}, {"name": "HTML", "bytes": "142"}, {"name": "JavaScript", "bytes": "632812"}, {"name": "PLpgSQL", "bytes": "57277"}, {"name": "SQLPL", "bytes": "51553"}]}} +{"text": "/**\n * Module dependencies\n */\n\nvar _ = require('lodash')\n , util = require('util');\n\n\n/**\n * Sort the tuples in `data` using `comparator`.\n * \n * @param { Object[] } data\n * @param { Object } comparator\n * @return { Object[] }\n */\nmodule.exports = function (data, comparator) {\n if( !comparator || !data ) return data;\n return sortData(_.clone(data), comparator);\n};\n\n\n\n\n\n\n//////////////////////////\n///\n/// private methods ||\n/// \\/\n/// \n//////////////////////////\n\n\n\n\n/**\n * Sort `data` (tuples) using `sortCriteria` (comparator)\n * \n * Based on method described here:\n * http://stackoverflow.com/a/4760279/909625\n *\n * @param { Object[] } data [tuples]\n * @param { Object } sortCriteria [mongo-style comparator object]\n * @return { Object[] }\n */\n\nfunction sortData(data, sortCriteria) {\n\n function dynamicSort(property) {\n var sortOrder = 1;\n if(property[0] === '-') {\n sortOrder = -1;\n property = property.substr(1);\n }\n\n return function (a,b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n };\n }\n\n function dynamicSortMultiple() {\n var props = arguments;\n return function (obj1, obj2) {\n var i = 0, result = 0, numberOfProperties = props.length;\n\n while(result === 0 && i < numberOfProperties) {\n result = dynamicSort(props[i])(obj1, obj2);\n i++;\n }\n return result;\n };\n }\n\n // build sort criteria in the format ['firstName', '-lastName']\n var sortArray = [];\n _.each(_.keys(sortCriteria), function(key) {\n if(sortCriteria[key] === -1) sortArray.push('-' + key.toLowerCase());\n else sortArray.push(key.toLowerCase());\n });\n\n data.sort(dynamicSortMultiple.apply(null, sortArray));\n return data;\n}\n", "meta": {"content_hash": "5e12aa3165a8a91e98a9740db33f4848", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 90, "avg_line_length": 21.738095238095237, "alnum_prop": 0.56078860898138, "repo_name": "ShaneK/TibiaXMLParser", "id": "92cfdb8e0b7cbb99f7ec3486bcdf5792c2daaebe", "size": "1826", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/waterline/node_modules/waterline-criteria/lib/filters/sort.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "18831"}]}} +{"text": "module Typingtutor\n class Stats\n FILE = File.expand_path('~/.typingtutor')\n\n def initialize\n @stats = {}\n @stats.merge!(YAML.load(IO.read(FILE))) if File.exists?(FILE)\n @stats[:created_at] ||= Time.now\n @stats[:total] ||= {}\n @stats[:exercises] ||= {}\n @stats[:words] ||= {}\n @stats[:letters] ||= {}\n end\n\n def save\n @stats[:updated_at] = Time.now\n IO.write(FILE, YAML.dump(@stats))\n end\n\n def record_exercise(exercise)\n @stats[:exercises][exercise.name] ||= {}\n @stats[:exercises][exercise.name][:runs] ||= 0\n @stats[:exercises][exercise.name][:runs] += 1\n @stats[:exercises][exercise.name][:last_run] = Time.now\n @stats[:exercises][exercise.name][:last_run_results] = exercise.results\n\n # update totals\n @stats[:total][:runs] ||= 0\n @stats[:total][:runs] += 1\n\n [:time, :chars, :correct_chars, :words, :keystrokes].each do |metric|\n @stats[:total][metric] ||= 0\n @stats[:total][metric] += exercise.results[metric]\n end\n\n @stats[:total][:max_wpm] ||= 0\n @stats[:total][:max_wpm] = [@stats[:total][:max_wpm], exercise.results[:gross_wpm]].max\n @stats[:total][:avg_wpm] = @stats[:total][:words] / (@stats[:total][:time] / 60)\n end\n\n def record_word(word)\n # TODO\n end\n\n def record_letter(letter, ok)\n return if letter == ' '\n @stats[:letters][letter] ||= {}\n @stats[:letters][letter][:total] ||= {}\n @stats[:letters][letter][:total][:count] ||= 0\n @stats[:letters][letter][:total][:count] += 1\n @stats[:letters][letter][:total][:correct] ||= 0\n @stats[:letters][letter][:total][:correct] += 1 if ok\n @stats[:letters][letter][:total][:accuracy] = (@stats[:letters][letter][:total][:correct].to_f / @stats[:letters][letter][:total][:count].to_f * 100).round\n end\n\n def print\n puts \"------------------------\"\n puts \"Your avg speed: #{@stats[:total][:avg_wpm].round} wpm\"\n puts \"Your max speed: #{@stats[:total][:max_wpm].round} wpm\"\n end\n\n def print_full\n puts \"Accuracy per letter:\"\n worst_letters.each {|letter, accuracy| puts \"#{letter}: #{accuracy.round}%\"}\n\n if @stats[:exercises].size > 0\n puts\n puts \"Exercises:\"\n @stats[:exercises].each do |name, data|\n puts \"- #{name}: #{data[:runs]} runs, #{data[:last_run_results][:gross_wpm].round} wpm\"\n end\n end\n puts\n puts \"Exercises played: #{@stats[:total][:runs] || 0}\"\n puts \"Time played: #{(@stats[:total][:time] || 0).round.divmod(60).join('m ')}s\"\n puts \"Avg speed: #{(@stats[:total][:avg_wpm] || 0).round} wpm\"\n puts \"Max speed: #{(@stats[:total][:max_wpm] || 0).round} wpm\"\n end\n\n def worst_letters\n accuracy = @stats[:letters].map {|letter, data| [letter, data[:total][:accuracy]]}.to_h # { \"a\" => 100, \"b\" => 98 }\n accuracy.reject! {|key, value| value == 100}\n accuracy.reject! {|key, value| key !~ /\\w/ }\n accuracy = accuracy.sort_by {|key, value| value }.to_h\n accuracy\n end\n end\nend\n", "meta": {"content_hash": "72561e44f45265a945da83541784281d", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 161, "avg_line_length": 35.07954545454545, "alnum_prop": 0.5562034337544541, "repo_name": "paolodona/typingtutor", "id": "98a4c6115c9fd619778e09b149b60ba66a910fc1", "size": "3087", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/typingtutor/stats.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "11768"}]}} +{"text": "require 'cloud_formation/bridge/request'\nrequire 'cloud_formation/bridge/names'\nrequire 'cloud_formation/bridge/resources/elasti_cache_replication_group'\n\ndescribe CloudFormation::Bridge::Resources::ElastiCacheReplicationGroup do\n\n include FileSupport\n\n FIELDS = CloudFormation::Bridge::Names::FIELDS\n ELASTI_CACHE = CloudFormation::Bridge::Names::ELASTI_CACHE\n\n let(:replication_group_id) { \"dev-redis-rep\" }\n\n def stub_describe_replication_group\n expect(subject.client).to receive(:describe_replication_groups).\n with(replication_group_id: replication_group_id).\n and_return(parse_json(\"describe-replication-group-primary-only\"))\n end\n\n context \"#create\" do\n\n let(:request) { CloudFormation::Bridge::Request.new(parse_json(\"create-replication-group-message\", false)) }\n\n it 'creates the replication group' do\n expect(subject.client).to receive(:create_replication_group).with(\n replication_group_id: replication_group_id,\n primary_cluster_id: \"cluster-id-here\",\n replication_group_description: \"Sample replication group for the redis instances\",\n )\n\n stub_describe_replication_group\n\n outputs = subject.create(request)\n\n expect(outputs).to eq(\n FIELDS::DATA => {\n ELASTI_CACHE::REPLICATION_GROUP_ID => replication_group_id,\n },\n FIELDS::PHYSICAL_RESOURCE_ID => replication_group_id,\n )\n end\n\n end\n\n context \"#delete\" do\n\n let(:request) { CloudFormation::Bridge::Request.new(parse_json(\"delete-replication-group-message\", false)) }\n\n it 'should delete the group' do\n stub_describe_replication_group\n expect(subject.client).to receive(:delete_replication_group).with(\n replication_group_id: replication_group_id,\n retain_primary_cluster: true,\n )\n subject.delete(request)\n end\n\n it 'should ignore if the replication group does not exist' do\n expect(subject).to receive(:replication_group_available?).and_raise(AWS::ElastiCache::Errors::ReplicationGroupNotFoundFault)\n expect { subject.delete(request) }.not_to raise_error\n end\n\n end\n\nend", "meta": {"content_hash": "f07f4f3fe7d0d531278419bb2ac6c1e2", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 130, "avg_line_length": 37.50769230769231, "alnum_prop": 0.6119770303527482, "repo_name": "TheNeatCompany/cfn-bridge", "id": "956e5b49f687785390c9c9757a239e7a84d387cf", "size": "2438", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/lib/cloud_formation/bridge/resources/elasti_cache_replication_group_spec.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "49994"}]}} +{"text": "\npackage com.thoughtworks.go.config;\n\nimport com.thoughtworks.go.config.helper.ValidationContextMother;\nimport com.thoughtworks.go.config.policy.Allow;\nimport com.thoughtworks.go.config.policy.Policy;\nimport com.thoughtworks.go.config.policy.SupportedAction;\nimport com.thoughtworks.go.domain.config.ConfigurationKey;\nimport com.thoughtworks.go.domain.config.ConfigurationProperty;\nimport com.thoughtworks.go.domain.config.ConfigurationValue;\nimport com.thoughtworks.go.plugin.access.authorization.AuthorizationMetadataStore;\nimport com.thoughtworks.go.plugin.api.info.PluginDescriptor;\nimport com.thoughtworks.go.plugin.domain.authorization.AuthorizationPluginInfo;\nimport com.thoughtworks.go.plugin.domain.authorization.SupportedAuthType;\nimport com.thoughtworks.go.plugin.domain.common.Metadata;\nimport com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings;\nimport com.thoughtworks.go.plugin.domain.common.PluginConfiguration;\nimport com.thoughtworks.go.security.CryptoException;\nimport com.thoughtworks.go.security.GoCipher;\nimport org.junit.jupiter.api.AfterEach;\nimport org.junit.jupiter.api.Test;\n\nimport static com.thoughtworks.go.config.policy.SupportedEntity.ENVIRONMENT;\nimport static java.util.Arrays.asList;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.nullValue;\nimport static org.junit.Assert.*;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class PluginRoleConfigTest {\n @AfterEach\n public void teardown() {\n AuthorizationMetadataStore.instance().clear();\n }\n\n @Test\n public void validate_shouldValidatePresenceOfRoleName() {\n validatePresenceOfRoleName(new Validator() {\n @Override\n public void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context) {\n pluginRoleConfig.validate(context);\n }\n });\n }\n\n @Test\n public void validate_shouldValidateNullRoleName() {\n validateNullRoleName(new Validator() {\n @Override\n public void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context) {\n pluginRoleConfig.validate(context);\n }\n });\n }\n\n @Test\n public void validate_presenceAuthConfigId() {\n validatePresenceAuthConfigId(new Validator() {\n @Override\n public void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context) {\n pluginRoleConfig.validate(context);\n }\n });\n }\n\n @Test\n public void validate_presenceOfAuthConfigIdInSecurityConfig() throws Exception {\n validatePresenceOfAuthConfigIdInSecurityConfig(new Validator() {\n @Override\n public void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context) {\n pluginRoleConfig.validate(context);\n }\n });\n }\n\n @Test\n public void validate_uniquenessOfRoleName() throws Exception {\n validateUniquenessOfRoleName(new Validator() {\n @Override\n public void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context) {\n pluginRoleConfig.validate(context);\n }\n });\n }\n\n @Test\n public void validateTree_shouldValidatePresenceOfRoleName() {\n validatePresenceOfRoleName(new Validator() {\n @Override\n public void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context) {\n assertFalse(pluginRoleConfig.validateTree(context));\n }\n });\n }\n\n @Test\n public void validateTree_shouldValidateNullRoleName() {\n validateNullRoleName(new Validator() {\n @Override\n public void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context) {\n pluginRoleConfig.validateTree(context);\n }\n });\n }\n\n @Test\n public void validateTree_presenceAuthConfigId() {\n validatePresenceAuthConfigId(new Validator() {\n @Override\n public void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context) {\n assertFalse(pluginRoleConfig.validateTree(context));\n }\n });\n }\n\n @Test\n public void validateTree_presenceOfAuthConfigIdInSecurityConfig() throws Exception {\n validatePresenceOfAuthConfigIdInSecurityConfig(new Validator() {\n @Override\n public void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context) {\n assertFalse(pluginRoleConfig.validateTree(context));\n }\n });\n }\n\n @Test\n public void validateTree_uniquenessOfRoleName() throws Exception {\n validateUniquenessOfRoleName(new Validator() {\n @Override\n public void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context) {\n assertFalse(pluginRoleConfig.validateTree(context));\n }\n });\n }\n\n @Test\n public void hasErrors_shouldBeTrueIfRoleHasErrors() throws Exception {\n Role role = new PluginRoleConfig(\"\", \"auth_config_id\");\n\n SecurityConfig securityConfig = new SecurityConfig();\n securityConfig.securityAuthConfigs().add(new SecurityAuthConfig(\"auth_config_id\", \"plugin_id\"));\n\n role.validate(ValidationContextMother.validationContext(securityConfig));\n\n assertTrue(role.hasErrors());\n }\n\n @Test\n public void hasErrors_shouldBeTrueIfConfigurationPropertiesHasErrors() throws Exception {\n ConfigurationProperty property = new ConfigurationProperty(new ConfigurationKey(\"username\"), new ConfigurationValue(\"view\"));\n PluginRoleConfig roleConfig = new PluginRoleConfig(\"admin\", \"auth_id\", property);\n\n property.addError(\"username\", \"username format is incorrect\");\n\n assertTrue(roleConfig.hasErrors());\n assertTrue(roleConfig.errors().isEmpty());\n }\n\n @Test\n public void shouldAnswerWhetherItHasPermissionsForGivenEntityOfTypeAndName() {\n final Policy directives = new Policy();\n directives.add(new Allow(\"view\", ENVIRONMENT.getType(), \"env_1\"));\n RoleConfig role = new RoleConfig(new CaseInsensitiveString(\"\"), new Users(), directives);\n\n assertTrue(role.hasPermissionsFor(SupportedAction.VIEW, EnvironmentConfig.class, \"env_1\"));\n assertFalse(role.hasPermissionsFor(SupportedAction.VIEW, EnvironmentConfig.class, \"env_2\"));\n assertFalse(role.hasPermissionsFor(SupportedAction.VIEW, PipelineConfig.class, \"*\"));\n }\n\n private void validatePresenceOfRoleName(Validator v) {\n PluginRoleConfig role = new PluginRoleConfig(\"\", \"auth_config_id\");\n\n SecurityConfig securityConfig = new SecurityConfig();\n securityConfig.securityAuthConfigs().add(new SecurityAuthConfig(\"auth_config_id\", \"plugin_id\"));\n\n v.validate(role, ValidationContextMother.validationContext(securityConfig));\n\n assertTrue(role.hasErrors());\n assertThat(role.errors().size(), is(1));\n assertThat(role.errors().get(\"name\").get(0), is(\"Invalid role name name ''. This must be alphanumeric and can\" +\n \" contain underscores and periods (however, it cannot start with a period). The maximum allowed length is 255 characters.\"));\n }\n\n private void validateNullRoleName(Validator v) {\n PluginRoleConfig role = new PluginRoleConfig(\"\", \"auth_config_id\");\n role.setName(null);\n\n SecurityConfig securityConfig = new SecurityConfig();\n securityConfig.securityAuthConfigs().add(new SecurityAuthConfig(\"auth_config_id\", \"plugin_id\"));\n\n v.validate(role, ValidationContextMother.validationContext(securityConfig));\n\n assertTrue(role.hasErrors());\n assertThat(role.errors().size(), is(1));\n assertThat(role.errors().get(\"name\").get(0), is(\"Invalid role name name 'null'. This must be alphanumeric and can\" +\n \" contain underscores and periods (however, it cannot start with a period). The maximum allowed length is 255 characters.\"));\n }\n\n public void validatePresenceAuthConfigId(Validator v) {\n PluginRoleConfig role = new PluginRoleConfig(\"admin\", \"\");\n\n SecurityConfig securityConfig = new SecurityConfig();\n\n v.validate(role, ValidationContextMother.validationContext(securityConfig));\n\n assertThat(role.errors().size(), is(1));\n assertThat(role.errors().get(\"authConfigId\").size(), is(1));\n assertThat(role.errors().get(\"authConfigId\").get(0), is(\"Invalid plugin role authConfigId name ''. This must be alphanumeric and can\" +\n \" contain underscores and periods (however, it cannot start with a period). The maximum allowed length is 255 characters.\"));\n }\n\n public void validatePresenceOfAuthConfigIdInSecurityConfig(Validator v) throws Exception {\n PluginRoleConfig role = new PluginRoleConfig(\"admin\", \"auth_config_id\");\n SecurityConfig securityConfig = new SecurityConfig();\n\n v.validate(role, ValidationContextMother.validationContext(securityConfig));\n\n assertThat(role.errors().size(), is(1));\n assertThat(role.errors().get(\"authConfigId\").size(), is(1));\n assertThat(role.errors().get(\"authConfigId\").get(0), is(\"No such security auth configuration present for id: `auth_config_id`\"));\n }\n\n public void validateUniquenessOfRoleName(Validator v) throws Exception {\n PluginRoleConfig role = new PluginRoleConfig(\"admin\", \"auth_config_id\");\n SecurityConfig securityConfig = new SecurityConfig();\n ValidationContext validationContext = ValidationContextMother.validationContext(securityConfig);\n\n securityConfig.securityAuthConfigs().add(new SecurityAuthConfig(\"auth_config_id\", \"plugin_id\"));\n securityConfig.getRoles().add(new RoleConfig(new CaseInsensitiveString(\"admin\")));\n securityConfig.getRoles().add(role);\n\n v.validate(role, validationContext);\n\n assertThat(role.errors().size(), is(1));\n assertThat(role.errors().get(\"name\").get(0), is(\"Role names should be unique. Role with the same name exists.\"));\n }\n\n @Test\n public void shouldEncryptSecurePluginProperties() throws CryptoException {\n setAuthorizationPluginInfo();\n String authConfigId = \"auth_config_id\";\n String pluginId = \"cd.go.github\";\n\n BasicCruiseConfig basicCruiseConfig = new BasicCruiseConfig();\n basicCruiseConfig.server().security().securityAuthConfigs().add(new SecurityAuthConfig(authConfigId, pluginId));\n PluginRoleConfig role = new PluginRoleConfig(\"admin\", authConfigId);\n role.addConfigurations(asList(\n new ConfigurationProperty(new ConfigurationKey(\"k1\"), new ConfigurationValue(\"pub_v1\")),\n new ConfigurationProperty(new ConfigurationKey(\"k2\"), new ConfigurationValue(\"pub_v2\")),\n new ConfigurationProperty(new ConfigurationKey(\"k3\"), new ConfigurationValue(\"pub_v3\"))));\n\n GoCipher goCipher = new GoCipher();\n\n assertThat(role.getProperty(\"k1\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k1\").getConfigValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k1\").getValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k2\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k2\").getConfigValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k2\").getValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k3\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k3\").getConfigValue(), is(\"pub_v3\"));\n assertThat(role.getProperty(\"k3\").getValue(), is(\"pub_v3\"));\n\n role.encryptSecureProperties(basicCruiseConfig);\n\n assertThat(role.getProperty(\"k1\").getEncryptedValue(), is(goCipher.encrypt(\"pub_v1\")));\n assertThat(role.getProperty(\"k1\").getConfigValue(), is(nullValue()));\n assertThat(role.getProperty(\"k1\").getValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k2\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k2\").getConfigValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k2\").getValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k3\").getEncryptedValue(), is(goCipher.encrypt(\"pub_v3\")));\n assertThat(role.getProperty(\"k3\").getConfigValue(), is(nullValue()));\n assertThat(role.getProperty(\"k3\").getValue(), is(\"pub_v3\"));\n }\n\n @Test\n public void shouldNotEncryptSecurePluginProperties_WhenPluginInfosIsAbsent() throws CryptoException {\n String authConfigId = \"auth_config_id\";\n String pluginId = \"cd.go.github\";\n\n BasicCruiseConfig basicCruiseConfig = new BasicCruiseConfig();\n basicCruiseConfig.server().security().securityAuthConfigs().add(new SecurityAuthConfig(authConfigId, pluginId));\n PluginRoleConfig role = new PluginRoleConfig(\"admin\", authConfigId);\n role.addConfigurations(asList(\n new ConfigurationProperty(new ConfigurationKey(\"k1\"), new ConfigurationValue(\"pub_v1\")),\n new ConfigurationProperty(new ConfigurationKey(\"k2\"), new ConfigurationValue(\"pub_v2\")),\n new ConfigurationProperty(new ConfigurationKey(\"k3\"), new ConfigurationValue(\"pub_v3\"))));\n\n assertThat(role.getProperty(\"k1\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k1\").getConfigValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k1\").getValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k2\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k2\").getConfigValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k2\").getValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k3\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k3\").getConfigValue(), is(\"pub_v3\"));\n assertThat(role.getProperty(\"k3\").getValue(), is(\"pub_v3\"));\n\n role.encryptSecureProperties(basicCruiseConfig);\n\n assertThat(role.getProperty(\"k1\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k1\").getConfigValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k1\").getValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k2\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k2\").getConfigValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k2\").getValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k3\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k3\").getConfigValue(), is(\"pub_v3\"));\n assertThat(role.getProperty(\"k3\").getValue(), is(\"pub_v3\"));\n }\n\n @Test\n public void shouldNotEncryptSecurePluginProperties_WhenReferencedAuthConfigDoesNotExists() throws CryptoException {\n setAuthorizationPluginInfo();\n String authConfigId = \"auth_config_id\";\n\n BasicCruiseConfig basicCruiseConfig = new BasicCruiseConfig();\n PluginRoleConfig role = new PluginRoleConfig(\"admin\", authConfigId);\n role.addConfigurations(asList(\n new ConfigurationProperty(new ConfigurationKey(\"k1\"), new ConfigurationValue(\"pub_v1\")),\n new ConfigurationProperty(new ConfigurationKey(\"k2\"), new ConfigurationValue(\"pub_v2\")),\n new ConfigurationProperty(new ConfigurationKey(\"k3\"), new ConfigurationValue(\"pub_v3\"))));\n\n assertThat(role.getProperty(\"k1\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k1\").getConfigValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k1\").getValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k2\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k2\").getConfigValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k2\").getValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k3\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k3\").getConfigValue(), is(\"pub_v3\"));\n assertThat(role.getProperty(\"k3\").getValue(), is(\"pub_v3\"));\n\n role.encryptSecureProperties(basicCruiseConfig);\n\n assertThat(role.getProperty(\"k1\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k1\").getConfigValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k1\").getValue(), is(\"pub_v1\"));\n assertThat(role.getProperty(\"k2\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k2\").getConfigValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k2\").getValue(), is(\"pub_v2\"));\n assertThat(role.getProperty(\"k3\").getEncryptedValue(), is(nullValue()));\n assertThat(role.getProperty(\"k3\").getConfigValue(), is(\"pub_v3\"));\n assertThat(role.getProperty(\"k3\").getValue(), is(\"pub_v3\"));\n }\n\n interface Validator {\n void validate(PluginRoleConfig pluginRoleConfig, ValidationContext context);\n }\n\n private void setAuthorizationPluginInfo() {\n PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class);\n\n PluginConfiguration k1 = new PluginConfiguration(\"k1\", new Metadata(false, true));\n PluginConfiguration k2 = new PluginConfiguration(\"k2\", new Metadata(false, false));\n PluginConfiguration k3 = new PluginConfiguration(\"k3\", new Metadata(false, true));\n\n PluggableInstanceSettings authConfigSettins = new PluggableInstanceSettings(asList(k1, k2, k3));\n PluggableInstanceSettings roleConfigSettings = new PluggableInstanceSettings(asList(k1, k2, k3));\n\n com.thoughtworks.go.plugin.domain.authorization.Capabilities capabilities = new com.thoughtworks.go.plugin.domain.authorization.Capabilities(SupportedAuthType.Web, true, true, true);\n AuthorizationPluginInfo artifactPluginInfo = new AuthorizationPluginInfo(pluginDescriptor, authConfigSettins, roleConfigSettings, null, capabilities);\n when(pluginDescriptor.id()).thenReturn(\"cd.go.github\");\n AuthorizationMetadataStore.instance().setPluginInfo(artifactPluginInfo);\n }\n}\n", "meta": {"content_hash": "454914ca9d899c90900f01b24c100a6b", "timestamp": "", "source": "github", "line_count": 368, "max_line_length": 190, "avg_line_length": 49.26358695652174, "alnum_prop": 0.6927574604225274, "repo_name": "arvindsv/gocd", "id": "c1ed6c07818014c9c8c20af8db7d9f56eb2ab865", "size": "18730", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "config/config-api/src/test/java/com/thoughtworks/go/config/PluginRoleConfigTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "466"}, {"name": "CSS", "bytes": "797200"}, {"name": "FreeMarker", "bytes": "9764"}, {"name": "Groovy", "bytes": "2240189"}, {"name": "HTML", "bytes": "640932"}, {"name": "Java", "bytes": "21023083"}, {"name": "JavaScript", "bytes": "2539209"}, {"name": "NSIS", "bytes": "23526"}, {"name": "PowerShell", "bytes": "691"}, {"name": "Ruby", "bytes": "1888167"}, {"name": "Shell", "bytes": "169149"}, {"name": "TSQL", "bytes": "200114"}, {"name": "TypeScript", "bytes": "3070898"}, {"name": "XSLT", "bytes": "203240"}]}} +{"text": "export interface Serializable {\n serialize(): any;\n deserialize(obj: any): Serializable;\n}\n", "meta": {"content_hash": "4ab5f5117d91ad8801edfebdc7dce9bb", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 38, "avg_line_length": 23.25, "alnum_prop": 0.7311827956989247, "repo_name": "hyperboloide/udapi", "id": "900d3aa2638d992b0fbbe4df75d2b3db385cc4c1", "size": "94", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/interfaces/basic.ts", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "1319"}, {"name": "Makefile", "bytes": "525"}, {"name": "TypeScript", "bytes": "74865"}]}} +{"text": "Helixcoin 0.8.5 BETA\n====================\n\nCopyright (c) 2009-2013 Bitcoin Developers\nCopyright (c) 2014\t\tHelixcoin Developers\n\nDistributed under the MIT/X11 software license, see the accompanying\nfile COPYING or http://www.opensource.org/licenses/mit-license.php.\nThis product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes\ncryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard. This product also includes software developed by [Crypto++](http://www.cryptopp.com/) which is released under the Boost Software License 1.0.\n\n\nIntro\n---------------------\nHelixcoin is a free open source peer-to-peer electronic cash system that is\ncompletely decentralized, without the need for a central server or trusted\nparties. Users hold the crypto keys to their own money and transact directly\nwith each other, with the help of a P2P network to check for double-spending.\n\n\nSetup\n---------------------\nYou need the Qt4 run-time libraries to run Helixcoin-Qt. On Debian or Ubuntu:\n\t`sudo apt-get install libqtgui4`\n\nUnpack the files into a directory and run:\n\n- bin/32/helixcoin-qt (GUI, 32-bit)\n- bin/32/helixcoind (headless, 32-bit)\n- bin/64/helixcoin-qt (GUI, 64-bit)\n- bin/64/helixcoind (headless, 64-bit)\n\nSee the documentation at the [Bitcoin Wiki](https://en.bitcoin.it/wiki/Main_Page)\nfor help and more information.\n\n\nOther Pages\n---------------------\n- [Unix Build Notes](build-unix.md)\n- [OSX Build Notes](build-osx.md)\n- [Windows Build Notes](build-msw.md)\n- [Coding Guidelines](coding.md)\n- [Release Process](release-process.md)\n- [Release Notes](release-notes.md)\n- [Multiwallet Qt Development](multiwallet-qt.md)\n- [Unit Tests](unit-tests.md)\n- [Translation Process](translation_process.md)\n", "meta": {"content_hash": "d2579d83dec582759ce40ed71db07762", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 280, "avg_line_length": 39.57446808510638, "alnum_prop": 0.736021505376344, "repo_name": "HelixCoin/HelixCoin", "id": "dca34540d20e4381c3cabed1994aaa6a546a1aa3", "size": "1860", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/README.md", "mode": "33261", "license": "mit", "language": []}} +{"text": "<?php\r\n$strQuery = sprintf(\"select s.*,sp.seq as publish_seq,sp.start_date,sp.finish_date,unix_timestamp(sp.start_date) as start_time,unix_timestamp(sp.finish_date) as finish_time from test_published as sp join test as s on sp.test_seq=s.seq where sp.seq=%d\",$intPublishedSeq);\r\n?>", "meta": {"content_hash": "44e903c12eb18b7d2d38ea7b3fc3b49f", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 270, "avg_line_length": 93.66666666666667, "alnum_prop": 0.7473309608540926, "repo_name": "inkukyang/MamaOMR", "id": "7d3beafda7e0afbdc697c755df7f69cff51fd91c", "size": "281", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Model/Tests/SQL/MySQL/Tests/getTestsByPublishedSeq.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "721406"}, {"name": "HTML", "bytes": "5867"}, {"name": "JavaScript", "bytes": "711879"}, {"name": "PHP", "bytes": "646163"}]}} +{"text": "\n\npackage org.wso2.siddhi.core.table;\n\nimport org.apache.hadoop.util.bloom.CountingBloomFilter;\nimport org.apache.hadoop.util.bloom.Key;\nimport org.apache.hadoop.util.hash.Hash;\nimport org.apache.log4j.Logger;\nimport org.wso2.siddhi.core.config.SiddhiContext;\nimport org.wso2.siddhi.core.event.*;\nimport org.wso2.siddhi.core.event.in.InEvent;\nimport org.wso2.siddhi.core.event.in.InStateEvent;\nimport org.wso2.siddhi.core.executor.conditon.ConditionExecutor;\nimport org.wso2.siddhi.core.table.cache.CachingTable;\nimport org.wso2.siddhi.core.table.predicate.PredicateToken;\nimport org.wso2.siddhi.core.table.predicate.PredicateTreeNode;\nimport org.wso2.siddhi.core.table.predicate.sql.SQLPredicateBuilder;\nimport org.wso2.siddhi.query.api.definition.Attribute;\nimport org.wso2.siddhi.query.api.definition.TableDefinition;\nimport org.wso2.siddhi.query.api.query.QueryEventSource;\n\nimport javax.sql.DataSource;\nimport java.nio.ByteBuffer;\nimport java.sql.*;\nimport java.util.ArrayList;\nimport java.util.Iterator;\nimport java.util.List;\n\npublic class RDBMSEventTable implements EventTable {\n static final String PARAM_TABLE_NAME = \"table.name\";\n static final String PARAM_DATASOURCE_NAME = \"datasource.name\";\n static final String PARAM_CREATE_QUERY = \"create.query\";\n static final String PARAM_CACHING_ALGORITHM = \"caching.algorithm\";\n static final String PARAM_CACHE_SIZE = \"cache.size\";\n static final String PARAM_CACHE_LOADING = \"cache.loading\";\n static final String PARAM_BLOOM_FILTERS = \"bloom.filters\";\n\n public static final int BLOOM_FILTER_SIZE = 10000;\n public static final int BLOOM_FILTER_HASH_FUNCTIONS = 4;\n\n static final Logger log = Logger.getLogger(RDBMSEventTable.class);\n\n private TableDefinition tableDefinition;\n private QueryEventSource queryEventSource;\n // attribute list used for accessing the table.\n private List<Attribute> attributeList; // full attribute list of the table\n private boolean eagerCacheLoading;\n\n private DataSource dataSource;\n private String databaseName;\n private String tableName;\n private String fullTableName; // schema.tableName\n private String tableColumnList; // for insertion queries.\n\n private boolean isInitialized; // db connection init status\n\n private String insertQuery;\n private boolean bloomFiltersEnabled;\n\n private CachingTable cachedTable;\n // private BloomFilter[] bloomFilters; // bloom filters for each column\n private CountingBloomFilter[] bloomFilters;\n\n public RDBMSEventTable( ) {\n }\n\n public void init(TableDefinition tableDefinition, SiddhiContext siddhiContext) {\n this.tableDefinition = tableDefinition;\n this.queryEventSource = new QueryEventSource(tableDefinition.getExternalTable().getParameter(PARAM_TABLE_NAME), tableDefinition.getTableId(), tableDefinition, null, null, null);\n this.dataSource = siddhiContext.getDataSource(tableDefinition.getExternalTable().getParameter(PARAM_DATASOURCE_NAME));\n this.attributeList = new ArrayList<Attribute>();\n\n // caching is enabled by default.\n if ((tableDefinition.getExternalTable().getParameter(PARAM_CACHING_ALGORITHM) != null) && (!tableDefinition.getExternalTable().getParameter(PARAM_CACHING_ALGORITHM).equalsIgnoreCase(\"disable\"))) {\n this.cachedTable = new CachingTable(tableDefinition.getTableId(), tableDefinition.getExternalTable().getParameter(PARAM_CACHING_ALGORITHM), tableDefinition.getExternalTable().getParameter(PARAM_CACHE_SIZE), siddhiContext);\n }\n\n // cache is by default loaded Lazily\n if (cachedTable != null && (tableDefinition.getExternalTable().getParameter(PARAM_CACHE_LOADING) != null) && (tableDefinition.getExternalTable().getParameter(PARAM_CACHE_LOADING).equalsIgnoreCase(\"eager\"))) {\n this.eagerCacheLoading = true;\n }\n\n // bloom filters are disabled by default\n if ((tableDefinition.getExternalTable().getParameter(PARAM_BLOOM_FILTERS) != null) && (tableDefinition.getExternalTable().getParameter(PARAM_BLOOM_FILTERS).equalsIgnoreCase(\"enabled\"))) {\n this.bloomFiltersEnabled = true;\n }\n\n try {\n initializeConnection();\n createPreparedStatementQueries();\n if (eagerCacheLoading) {\n preloadCache();\n }\n if (bloomFiltersEnabled) {\n buildBloomFilters();\n }\n } catch (ClassNotFoundException e) {\n log.error(\"Class not found. Can't continue to initialize the table.\", e);\n throw new RuntimeException(e);\n } catch (Exception e) {\n log.error(\"Unable to connect to the database.\", e);\n }\n }\n\n private void initializeConnection() throws SQLException, ClassNotFoundException {\n if (!isInitialized) {\n synchronized (this) {\n // synchronized double checking to ensure this doesn't get hit when there are concurrent calls\n if (!isInitialized) {\n\n Connection con = null;\n Statement statement = null;\n try {\n tableName = tableDefinition.getExternalTable().getParameter(PARAM_TABLE_NAME);\n\n if (dataSource == null) {\n throw new RuntimeException(\"Data source doesn't exist: \" + tableDefinition.getExternalTable().getParameter(PARAM_DATASOURCE_NAME));\n }\n con = dataSource.getConnection();\n\n // default mysql jdbc driver\n databaseName = con.getCatalog();\n fullTableName = databaseName + \".\" + tableName;\n\n statement = con.createStatement();\n\n String createQuery = tableDefinition.getExternalTable().getParameter(PARAM_CREATE_QUERY);\n\n // table creation.\n if (createQuery == null || createQuery.length() < 1) {\n StringBuilder stringBuilder = new StringBuilder(\"CREATE TABLE IF NOT EXISTS \");\n stringBuilder.append(fullTableName);\n stringBuilder.append(\" (\");\n boolean appendComma = false;\n for (Attribute column : tableDefinition.getAttributeList()) {\n if (appendComma) {\n stringBuilder.append(\", \");\n } else {\n appendComma = true;\n }\n stringBuilder.append(column.getName());\n stringBuilder.append(\" \");\n switch (column.getType()) {\n case INT:\n stringBuilder.append(\"INT\");\n break;\n case LONG:\n stringBuilder.append(\"BIGINT\");\n break;\n case FLOAT:\n stringBuilder.append(\"DECIMAL(30,10)\");\n break;\n case DOUBLE:\n stringBuilder.append(\"DECIMAL(40,15)\");\n break;\n case BOOL:\n stringBuilder.append(\"BOOL\");\n break;\n default:\n stringBuilder.append(\"VARCHAR(255)\");\n break;\n }\n }\n stringBuilder.append(\");\");\n createQuery = stringBuilder.toString();\n statement.execute(createQuery);\n\n } else {\n // users may not use 'IF NOT EXISTS' clause, so need to check whether the table exists before\n // executing their create queries.\n try {\n statement.execute(\"SELECT 1 FROM \" + fullTableName + \" LIMIT 1\");\n } catch (SQLException e) {\n statement.execute(createQuery);\n }\n }\n\n StringBuilder builder = new StringBuilder(\"(\");\n boolean appendComma = false;\n for (Attribute att : tableDefinition.getAttributeList()) {\n attributeList.add(att);\n if (appendComma) {\n builder.append(\",\");\n }\n builder.append(att.getName());\n appendComma = true;\n }\n builder.append(\")\");\n tableColumnList = builder.toString();\n isInitialized = true;\n } finally {\n cleanUpConnections(statement, con);\n }\n }\n }\n }\n }\n\n\n private synchronized void buildBloomFilters() {\n this.bloomFilters = new CountingBloomFilter[tableDefinition.getAttributeList().size()];\n for (int i = 0; i < bloomFilters.length; i++) {\n // number of hashes: 4\n bloomFilters[i] = new CountingBloomFilter(BLOOM_FILTER_SIZE, BLOOM_FILTER_HASH_FUNCTIONS, Hash.MURMUR_HASH);\n }\n Connection con = null;\n Statement stmt = null;\n try {\n con = dataSource.getConnection();\n stmt = con.createStatement();\n ResultSet results = stmt.executeQuery(\"SELECT * FROM \" + fullTableName);\n int count = 0;\n while (results.next()) {\n count++;\n for (int i = 0; i < bloomFilters.length; i++) {\n switch (tableDefinition.getAttributeList().get(i).getType()) {\n case INT:\n bloomFilters[i].add(new Key(Integer.toString(results.getInt(i + 1)).getBytes()));\n break;\n case LONG:\n bloomFilters[i].add(new Key(Long.toString(results.getLong(i + 1)).getBytes()));\n break;\n case FLOAT:\n bloomFilters[i].add(new Key(Float.toString(results.getFloat(i + 1)).getBytes()));\n break;\n case DOUBLE:\n bloomFilters[i].add(new Key(Double.toString(results.getDouble(i + 1)).getBytes()));\n break;\n case STRING:\n bloomFilters[i].add(new Key(results.getString(i + 1).getBytes()));\n break;\n case BOOL:\n bloomFilters[i].add(new Key(Boolean.toString(results.getBoolean(i + 1)).getBytes()));\n break;\n\n }\n }\n }\n results.close();\n\n } catch (Exception ex) {\n log.error(ex);\n } finally {\n cleanUpConnections(stmt, con);\n }\n }\n\n\n @Override\n public TableDefinition getTableDefinition() {\n return tableDefinition;\n }\n\n @Override\n public void add(StreamEvent streamEvent) {\n\n Connection con = null;\n PreparedStatement statement = null;\n try {\n initializeConnection();\n con = dataSource.getConnection();\n con.setAutoCommit(false);\n\n statement = con.prepareStatement(insertQuery);\n ArrayList<Event> bloomFilterInsertionList = null;\n if (bloomFiltersEnabled) {\n bloomFilterInsertionList = new ArrayList<Event>();\n }\n if (streamEvent instanceof AtomicEvent) {\n populateInsertQuery((Event) streamEvent, statement);\n statement.executeUpdate();\n if (bloomFiltersEnabled) {\n bloomFilterInsertionList.add((Event) streamEvent);\n }\n } else {\n ListEvent listEvent = ((ListEvent) streamEvent);\n for (int i = 0, size = listEvent.getActiveEvents(); i < size; i++) {\n populateInsertQuery(listEvent.getEvent(i), statement);\n statement.addBatch();\n if (bloomFiltersEnabled) {\n bloomFilterInsertionList.add(listEvent.getEvent(i));\n }\n }\n statement.executeBatch();\n }\n con.commit();\n\n if (cachedTable != null) {\n cachedTable.add(streamEvent);\n }\n if (bloomFiltersEnabled) {\n addToBloomFilters(bloomFilterInsertionList);\n }\n\n } catch (SQLException e) {\n log.error(\"Unable to insert the records to the table\", e);\n } catch (Exception e) {\n log.error(\"Error while inserting data.\", e);\n } finally {\n cleanUpConnections(statement, con);\n }\n }\n\n\n private void addToBloomFilters(List<Event> eventList) {\n for (Event event : eventList) {\n for (int i = 0; i < attributeList.size(); i++) {\n Attribute at = attributeList.get(i);\n switch (at.getType()) {\n case INT:\n bloomFilters[i].add(new Key(Integer.toString((Integer) event.getData(i)).getBytes()));\n break;\n case LONG:\n bloomFilters[i].add(new Key(Long.toString((Long) event.getData(i)).getBytes()));\n break;\n case FLOAT:\n bloomFilters[i].add(new Key(Float.toString((Float) event.getData(i)).getBytes()));\n break;\n case DOUBLE:\n bloomFilters[i].add(new Key(Double.toString((Double) event.getData(i)).getBytes()));\n break;\n case STRING:\n bloomFilters[i].add(new Key(event.getData(i).toString().getBytes()));\n break;\n case BOOL:\n bloomFilters[i].add(new Key(Boolean.toString((Boolean) event.getData(i)).getBytes()));\n break;\n }\n }\n }\n }\n\n private void removeFromBloomFilters(List<Event> eventList) {\n for (Event event : eventList) {\n for (int i = 0; i < attributeList.size(); i++) {\n Attribute at = attributeList.get(i);\n switch (at.getType()) {\n case INT:\n bloomFilters[i].delete(new Key(ByteBuffer.allocate(4).putInt((Integer) event.getData(i)).array()));\n break;\n case LONG:\n bloomFilters[i].delete(new Key(ByteBuffer.allocate(8).putLong((Long) event.getData(i)).array()));\n break;\n case FLOAT:\n bloomFilters[i].delete(new Key(ByteBuffer.allocate(4).putFloat((Float) event.getData(i)).array()));\n break;\n case DOUBLE:\n bloomFilters[i].delete(new Key(ByteBuffer.allocate(8).putDouble((Double) event.getData(i)).array()));\n break;\n case STRING:\n bloomFilters[i].delete(new Key(event.getData(i).toString().getBytes()));\n break;\n case BOOL:\n bloomFilters[i].delete(new Key(Boolean.toString((Boolean) event.getData(i)).getBytes()));\n break;\n }\n }\n }\n }\n\n private void preloadCache() {\n Connection con = null;\n Statement statement = null;\n try {\n con = dataSource.getConnection();\n statement = con.createStatement();\n ResultSet resultSet = statement.executeQuery(\"SELECT * FROM \" + fullTableName +\n \" LIMIT 0, \" + cachedTable.getCacheLimit());\n resultSet.setFetchSize(cachedTable.getCacheLimit());\n List<StreamEvent> eventList = new ArrayList<StreamEvent>();\n long timestamp = System.currentTimeMillis();\n while (resultSet.next()) {\n Object[] data = new Object[attributeList.size()];\n for (int i = 0; i < attributeList.size(); i++) {\n switch (attributeList.get(i).getType()) {\n case BOOL:\n data[i] = resultSet.getBoolean(attributeList.get(i).getName());\n break;\n case DOUBLE:\n data[i] = resultSet.getDouble(attributeList.get(i).getName());\n break;\n case FLOAT:\n data[i] = resultSet.getFloat(attributeList.get(i).getName());\n break;\n case INT:\n data[i] = resultSet.getInt(attributeList.get(i).getName());\n break;\n case LONG:\n data[i] = resultSet.getLong(attributeList.get(i).getName());\n break;\n case STRING:\n data[i] = resultSet.getString(attributeList.get(i).getName());\n break;\n default:\n data[i] = resultSet.getObject(attributeList.get(i).getName());\n\n }\n }\n Event event = new InEvent(tableDefinition.getExternalTable().getParameter(PARAM_TABLE_NAME), timestamp, data);\n eventList.add(event);\n }\n if (cachedTable != null) {\n cachedTable.addAll(eventList);\n // checking whether the table size is equal to the current cache size\n ResultSet resultCount = statement.executeQuery(\"SELECT COUNT(*) FROM \" + fullTableName);\n int rowCount = 0;\n while (resultCount.next()) {\n rowCount = resultCount.getInt(1);\n }\n if (rowCount <= cachedTable.getCacheLimit()) {\n // this is later used for optimizations when reading\n cachedTable.setFullyLoaded(true);\n }\n resultCount.close();\n }\n resultSet.close();\n } catch (SQLException e) {\n log.error(\"Unable to read the table: \" + tableDefinition.getExternalTable().getParameter(PARAM_TABLE_NAME), e);\n } finally {\n cleanUpConnections(statement, con);\n }\n }\n\n private void populateInsertQuery(Event event, PreparedStatement statement) throws SQLException {\n for (int i = 0; i < attributeList.size(); i++) {\n switch (attributeList.get(i).getType()) {\n case INT:\n statement.setInt(i + 1, ((Number) event.getData(i)).intValue());\n break;\n case LONG:\n statement.setLong(i + 1, ((Number) event.getData(i)).longValue());\n break;\n case FLOAT:\n statement.setFloat(i + 1, ((Number) event.getData(i)).floatValue());\n break;\n case DOUBLE:\n statement.setDouble(i + 1, ((Number) event.getData(i)).doubleValue());\n break;\n case BOOL:\n statement.setBoolean(i + 1, (Boolean) event.getData(i));\n break;\n default:\n statement.setString(i + 1, event.getData(i).toString());\n break;\n }\n }\n }\n\n private void createPreparedStatementQueries() {\n // only the insert query can be created since update, delete have query-specific predicates\n StringBuilder builder = new StringBuilder(\"INSERT INTO \");\n builder.append(fullTableName);\n builder.append(tableColumnList);\n\n builder.append(\" VALUES (\");\n for (int i = 0; i < attributeList.size(); i++) {\n if (i > 0) {\n builder.append(\", \");\n }\n\n builder.append(\"?\");\n }\n builder.append(\")\");\n insertQuery = builder.toString();\n }\n\n @Override\n public void delete(StreamEvent streamEvent, ConditionExecutor conditionExecutor) {\n PreparedStatement statement = null;\n Connection con = null;\n try {\n initializeConnection();\n con = dataSource.getConnection();\n con.setAutoCommit(false);\n StringBuilder statementBuilder = new StringBuilder(\"DELETE FROM \");\n statementBuilder.append(fullTableName);\n statementBuilder.append(\" WHERE \");\n ArrayList<Event> bloomFilterDeletionList = null;\n if (bloomFiltersEnabled) {\n bloomFilterDeletionList = new ArrayList<Event>();\n }\n if (streamEvent instanceof AtomicEvent) {\n PredicateTreeNode predicate = conditionExecutor.constructPredicate((Event) streamEvent, tableDefinition, new SQLPredicateBuilder());\n statementBuilder.append(predicate.buildPredicateString());\n statement = con.prepareStatement(statementBuilder.toString());\n ArrayList paramList = new ArrayList();\n predicate.populateParameters(paramList);\n for (int i = 0; i < paramList.size(); i++) {\n populateStatement(statement, i + 1, paramList.get(i));\n }\n if (bloomFiltersEnabled) {\n bloomFilterDeletionList.add((Event) streamEvent);\n }\n statement.executeUpdate();\n } else {\n for (int i = 0, size = ((ListEvent) streamEvent).getActiveEvents(); i < size; i++) {\n // deleting the entire event set using an aggregate query with OR conditions\n if (i > 0) {\n statementBuilder.append(\" OR \");\n }\n statementBuilder.append(\"(\");\n statementBuilder.append(conditionExecutor.constructPredicate(((ListEvent) streamEvent).getEvent(i), tableDefinition, new SQLPredicateBuilder()).buildPredicateString());\n statementBuilder.append(\")\");\n if (bloomFiltersEnabled) {\n bloomFilterDeletionList.add(((ListEvent) streamEvent).getEvent(i));\n }\n }\n statement = con.prepareStatement(statementBuilder.toString());\n statement.executeUpdate();\n }\n con.commit();\n if (cachedTable != null) {\n cachedTable.delete(streamEvent, conditionExecutor);\n }\n if (bloomFiltersEnabled) {\n removeFromBloomFilters(bloomFilterDeletionList);\n }\n\n } catch (SQLException e) {\n log.error(\"Unable to execute deletion.\", e);\n } catch (ClassNotFoundException e) {\n log.error(\"Unable to load the database driver.\", e);\n } finally {\n cleanUpConnections(statement, con);\n }\n\n }\n\n @Override\n public void update(StreamEvent streamEvent, ConditionExecutor conditionExecutor,\n int[] attributeUpdateMappingPosition) {\n Connection con = null;\n PreparedStatement statement = null;\n\n try {\n initializeConnection();\n con = dataSource.getConnection();\n con.setAutoCommit(false);\n Event atomicEvent = null;\n SQLPredicateBuilder predicateBuilder = new SQLPredicateBuilder();\n if (streamEvent instanceof AtomicEvent) {\n atomicEvent = (Event) streamEvent; // used to execute the condition executor\n } else {\n if (((ListEvent) streamEvent).getActiveEvents() > 0) {\n atomicEvent = ((ListEvent) streamEvent).getEvent(0);\n }\n }\n\n PredicateTreeNode predicate = conditionExecutor.constructPredicate(atomicEvent, tableDefinition, predicateBuilder);\n String query = createUpdateQuery(predicate.buildPredicateString(), attributeUpdateMappingPosition);\n statement = con.prepareStatement(query);\n ArrayList paramList = new ArrayList();\n\n if (streamEvent instanceof AtomicEvent) {\n\n for (int i = 0; i < attributeUpdateMappingPosition.length; i++) {\n populateStatement(statement, i + 1, atomicEvent.getData(i));\n }\n\n predicate.populateParameters(paramList);\n for (int i = 0; i < paramList.size(); i++) {\n populateStatement(statement, attributeUpdateMappingPosition.length + i + 1, paramList.get(i));\n }\n statement.executeUpdate();\n\n } else { // streamEvent instanceof ListEvent\n statement.clearParameters();\n\n for (int j = 0, size = ((ListEvent) streamEvent).getActiveEvents(); j < size; j++) {\n Event event = ((ListEvent) streamEvent).getEvent(j);\n predicate = conditionExecutor.constructPredicate(event, tableDefinition, predicateBuilder);\n paramList.clear();\n predicate.populateParameters(paramList);\n for (int i = 0; i < attributeList.size(); i++) {\n populateStatement(statement, i + 1, event.getData(i));\n }\n for (int i = 0; i < paramList.size(); i++) {\n populateStatement(statement, attributeList.size() + i + 1, paramList.get(i));\n }\n statement.addBatch();\n }\n statement.executeBatch();\n }\n con.commit();\n if (cachedTable != null) {\n cachedTable.update(streamEvent, conditionExecutor, attributeUpdateMappingPosition);\n }\n if (bloomFiltersEnabled) {\n buildBloomFilters();\n }\n\n } catch (SQLException e) {\n log.error(\"Unable to execute update on \" + streamEvent, e);\n } catch (ClassNotFoundException e) {\n log.error(\"Unable to load the database driver for \" + tableDefinition.getExternalTable().getParameter(PARAM_TABLE_NAME), e);\n } finally {\n cleanUpConnections(statement, con);\n }\n\n }\n\n\n @Override\n public boolean contains(AtomicEvent atomicEvent, ConditionExecutor conditionExecutor) {\n\n PredicateTreeNode predicate = null;\n\n if (bloomFiltersEnabled) {\n // bloom filters used only for the equal conditions.\n predicate = conditionExecutor.constructPredicate(atomicEvent, tableDefinition, new SQLPredicateBuilder());\n ArrayList<PredicateToken> tokenList = new ArrayList<PredicateToken>(3);\n predicate.populateTokens(tokenList);\n\n // looking for two sided equals conditions (operators) only.\n if (tokenList.size() < 4) {\n // not using bloom filters for complex conditions\n for (int operatorIndex = 1; operatorIndex < tokenList.size() - 1; operatorIndex++) {\n\n // at this level the operator becomes '=' instead of '=='\n if (tokenList.get(operatorIndex).getGetTokenType() == PredicateToken.Type.OPERATOR &&\n tokenList.get(operatorIndex).getTokenValue().trim().equals(\"=\")) {\n\n // param and value can be in any order i.e. price = 3 or 1 = price. this is to handle such scenarios.\n String param = tokenList.get(operatorIndex - 1).getGetTokenType() == PredicateToken.Type.VARIABLE ? tokenList.get(operatorIndex - 1).getTokenValue().trim() :\n tokenList.get(operatorIndex + 1).getTokenValue().toString().trim();\n String value = tokenList.get(operatorIndex - 1).getGetTokenType() == PredicateToken.Type.VARIABLE ? tokenList.get(operatorIndex + 1).getTokenValue().toString().trim() :\n tokenList.get(operatorIndex - 1).getTokenValue().trim();\n\n for (int i = 0; i < attributeList.size(); i++) {\n if (attributeList.get(i).getName().equals(param)) {\n boolean mightContain = bloomFilters[i].membershipTest(new Key(value.getBytes()));\n\n if (!mightContain) {\n return false;\n }\n }\n }\n }\n }\n }\n }\n\n\n if ((cachedTable != null) && cachedTable.contains(atomicEvent, conditionExecutor)) {\n return true;\n } else {\n Connection con = null;\n PreparedStatement statement = null;\n try {\n initializeConnection();\n\n if (predicate == null) {\n predicate = conditionExecutor.constructPredicate(atomicEvent, tableDefinition, new SQLPredicateBuilder());\n }\n con = dataSource.getConnection();\n // need to construct this each time since there are multiple queries and their predicates differ.\n statement = con.prepareStatement(\"SELECT * FROM \" + fullTableName + \" WHERE \" + predicate.buildPredicateString() + \" LIMIT 0,1\");\n ArrayList paramList = new ArrayList();\n predicate.populateParameters(paramList);\n for (int i = 0; i < paramList.size(); i++) {\n populateStatement(statement, i + 1, paramList.get(i));\n }\n ResultSet resultSet = statement.executeQuery();\n\n boolean contains = false;\n long timestamp = System.currentTimeMillis();\n\n while (resultSet.next()) {\n contains = true;\n if (cachedTable != null) {\n\n Object[] data = new Object[attributeList.size()];\n for (int i = 0; i < attributeList.size(); i++) {\n switch (attributeList.get(i).getType()) {\n case BOOL:\n data[i] = resultSet.getBoolean(attributeList.get(i).getName());\n break;\n case DOUBLE:\n data[i] = resultSet.getDouble(attributeList.get(i).getName());\n break;\n case FLOAT:\n data[i] = resultSet.getFloat(attributeList.get(i).getName());\n break;\n case INT:\n data[i] = resultSet.getInt(attributeList.get(i).getName());\n break;\n case LONG:\n data[i] = resultSet.getLong(attributeList.get(i).getName());\n break;\n case STRING:\n data[i] = resultSet.getString(attributeList.get(i).getName());\n break;\n default:\n data[i] = resultSet.getObject(attributeList.get(i).getName());\n\n }\n }\n // lazy loading caches since we've already read the event\n Event event = new InEvent(tableDefinition.getExternalTable().getParameter(PARAM_TABLE_NAME), timestamp, data);\n cachedTable.add(event);\n } else {\n break;\n }\n }\n resultSet.close();\n return contains;\n } catch (SQLException e) {\n log.error(\"Can't read the database table: \" + tableDefinition.getExternalTable().getParameter(PARAM_TABLE_NAME), e);\n } catch (Exception e) {\n log.error(\"Can't connect to the database.\", e);\n } finally {\n cleanUpConnections(statement, con);\n }\n return false;\n }\n }\n\n private String createUpdateQuery(String predicate, int[] attributeMappingPositions) {\n StringBuilder statementBuilder = new StringBuilder(\"UPDATE \");\n statementBuilder.append(fullTableName);\n statementBuilder.append(\" SET \");\n\n for (int i = 0; i < attributeMappingPositions.length; i++) {\n if (i > 0) {\n statementBuilder.append(\", \");\n }\n statementBuilder.append(attributeList.get(attributeMappingPositions[i]).getName());\n statementBuilder.append(\" = ?\");\n }\n statementBuilder.append(\" WHERE \");\n if (predicate != null) {\n statementBuilder.append(predicate);\n }\n return statementBuilder.toString();\n }\n\n @Override\n public QueryEventSource getQueryEventSource() {\n return queryEventSource;\n }\n\n @Override\n public Iterator<StreamEvent> iterator(StreamEvent event, ConditionExecutor conditionExecutor) {\n if (cachedTable != null && cachedTable.isFullyLoaded()) {\n if (event instanceof AtomicEvent) {\n synchronized (this) {\n ArrayList<StreamEvent> resultEvents = new ArrayList<StreamEvent>();\n Iterator<StreamEvent> iterator = cachedTable.iterator();\n StateEvent stateEvent = new InStateEvent(new StreamEvent[2]);\n stateEvent.setStreamEvent(0, event);\n while (iterator.hasNext()) {\n StreamEvent cachedEvent = iterator.next();\n stateEvent.setStreamEvent(1, cachedEvent);\n if (conditionExecutor.execute(stateEvent)) {\n resultEvents.add(cachedEvent);\n }\n }\n return resultEvents.iterator();\n }\n\n }\n }\n PredicateTreeNode predicate = conditionExecutor.constructPredicate((AtomicEvent) event, tableDefinition, new SQLPredicateBuilder());\n String sqlPredicate = predicate.buildPredicateString();\n if (sqlPredicate.trim().equals(\"?\")) {\n return iterator();\n }\n ArrayList paramList = new ArrayList();\n predicate.populateParameters(paramList);\n for (int i = 0; i < paramList.size(); i++) {\n Object value = paramList.get(i);\n if (value != null) {\n value = value.toString().replaceAll(\"'\", \"''\");\n }\n sqlPredicate = sqlPredicate.replaceFirst(\"\\\\?\", \"'\" + value.toString() + \"'\"); // populate one by one.\n }\n return iterator(sqlPredicate);\n }\n\n @Override\n public Iterator<StreamEvent> iterator(String sqlPredicate) {\n Connection con = null;\n Statement statement = null;\n try {\n con = dataSource.getConnection();\n statement = con.createStatement();\n ResultSet resultSet = statement.executeQuery(\"SELECT * FROM \" + fullTableName +\n ((sqlPredicate == null) ? \"\" : (\" WHERE \" + sqlPredicate)));\n resultSet.setFetchSize(10000);\n ArrayList<StreamEvent> eventList = new ArrayList<StreamEvent>();\n long timestamp = System.currentTimeMillis();\n while (resultSet.next()) {\n Object[] data = new Object[attributeList.size()];\n for (int i = 0; i < attributeList.size(); i++) {\n switch (attributeList.get(i).getType()) {\n case BOOL:\n data[i] = resultSet.getBoolean(attributeList.get(i).getName());\n break;\n case DOUBLE:\n data[i] = resultSet.getDouble(attributeList.get(i).getName());\n break;\n case FLOAT:\n data[i] = resultSet.getFloat(attributeList.get(i).getName());\n break;\n case INT:\n data[i] = resultSet.getInt(attributeList.get(i).getName());\n break;\n case LONG:\n data[i] = resultSet.getLong(attributeList.get(i).getName());\n break;\n case STRING:\n data[i] = resultSet.getString(attributeList.get(i).getName());\n break;\n default:\n data[i] = resultSet.getObject(attributeList.get(i).getName());\n\n }\n }\n Event event = new InEvent(tableDefinition.getExternalTable().getParameter(PARAM_TABLE_NAME), timestamp, data);\n eventList.add(event);\n }\n resultSet.close();\n return eventList.iterator();\n } catch (SQLException e) {\n log.error(\"Unable to read the table: \" + tableDefinition.getExternalTable().getParameter(PARAM_TABLE_NAME), e);\n } finally {\n cleanUpConnections(statement, con);\n }\n return null;\n }\n\n @Override\n public Iterator<StreamEvent> iterator() {\n return iterator(null);\n }\n\n private void cleanUpConnections(Statement stmt, Connection con) {\n if (stmt != null) {\n try {\n stmt.close();\n } catch (SQLException e) {\n log.error(\"unable to release statement\", e);\n }\n }\n\n if (con != null) {\n try {\n con.close();\n } catch (SQLException e) {\n log.error(\"unable to release connection\", e);\n }\n }\n }\n\n private void populateStatement(PreparedStatement stmt, int index, Object value)\n throws SQLException {\n if (value instanceof String) {\n stmt.setString(index, (String) value);\n } else if (value instanceof Integer) {\n stmt.setInt(index, (Integer) value);\n } else if (value instanceof Double) {\n stmt.setDouble(index, (Double) value);\n } else if (value instanceof Boolean) {\n stmt.setBoolean(index, (Boolean) value);\n } else if (value instanceof Float) {\n stmt.setFloat(index, (Float) value);\n } else if (value instanceof Long) {\n stmt.setLong(index, (Long) value);\n } else {\n stmt.setString(index, (String) value);\n }\n }\n}\n", "meta": {"content_hash": "eca1e6b1fbf0b38d55ff8bb9f57edf40", "timestamp": "", "source": "github", "line_count": 873, "max_line_length": 234, "avg_line_length": 45.49942726231386, "alnum_prop": 0.5168550640719015, "repo_name": "mohanvive/siddhi-2.x", "id": "ad3e241de9fbf76dab438ac0eb4477e38e6cc5db", "size": "40388", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "modules/siddhi-core/src/main/java/org/wso2/siddhi/core/table/RDBMSEventTable.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "2652"}, {"name": "GAP", "bytes": "42178"}, {"name": "Java", "bytes": "2547522"}]}} +{"text": "4.0 Functional Description\n==========================\n\n.. toctree::\n :glob:\n\n digital\n tri_state_1\n tri_state_2\n input_only\n analog\n power\n\n\n", "meta": {"content_hash": "cbab8dfcf66b2ed6cbd83bf955d01c4d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 26, "avg_line_length": 11.571428571428571, "alnum_prop": 0.4876543209876543, "repo_name": "google/globalfoundries-pdk-libs-gf180mcu_fd_io", "id": "e89404fb719bae6804e7feb64018d63f8ba45343", "size": "162", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "docs/functional.rst", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Verilog", "bytes": "16964"}]}} +{"text": "package com.innovez.sample;\n\nimport org.springframework.context.annotation.ComponentScan;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;\nimport org.springframework.web.servlet.config.annotation.EnableWebMvc;\nimport org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;\nimport org.springframework.web.servlet.config.annotation.ViewControllerRegistry;\nimport org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;\n\n@Configuration\n@EnableWebMvc\n@ComponentScan(basePackages=\"com.innovez.sample.web\")\npublic class WebappConfiguration extends WebMvcConfigurerAdapter {\n\t@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\tregistry.addResourceHandler(\"/assets/**\").addResourceLocations(\"/WEB-INF/assets/**\");\n\t}\n\t\n\t@Override\n\tpublic void addViewControllers(ViewControllerRegistry registry) {\n\t\tregistry.addViewController(\"/\").setViewName(\"/WEB-INF/templates/index.html\");\n\t\tregistry.addViewController(\"/employee\").setViewName(\"/WEB-INF/views/employees.html\");\n\t}\n\n\t@Override\n\tpublic void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {\n\t\tconfigurer.enable();\n\t}\n}\n", "meta": {"content_hash": "ce5debbfdda4bd2b2bafbe42a7122cbb", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 90, "avg_line_length": 42.03333333333333, "alnum_prop": 0.8350515463917526, "repo_name": "zakyalvan/spring-envers-audit", "id": "e720db959e41fcb6382cb922554a08e334b74c3c", "size": "1261", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spring-envers-audit-sample/src/main/java/com/innovez/sample/WebappConfiguration.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "46039"}]}} +{"text": "class Announcement < ActiveRecord::Base\n \n named_scope :active, lambda { { :conditions => ['starts_at <= ? AND ends_at >= ?', Time.now.utc, Time.now.utc] } }\n named_scope :since, lambda { |hide_time| { :conditions => (hide_time ? ['updated_at > ? OR starts_at > ?', hide_time.utc, hide_time.utc] : nil) } }\n \n def self.display(hide_time)\n active.since(hide_time)\n end\n \nend", "meta": {"content_hash": "90ca176f2d7f8d5ee3855e2fa04859d7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 149, "avg_line_length": 38.4, "alnum_prop": 0.625, "repo_name": "agileblaze/RFP", "id": "13c06d8fd20810781b97b938af9c2a7b929ad62d", "size": "384", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/models/announcement.rb", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "64000"}, {"name": "ColdFusion", "bytes": "169639"}, {"name": "JavaScript", "bytes": "2145502"}, {"name": "PHP", "bytes": "67590"}, {"name": "Perl", "bytes": "38659"}, {"name": "Python", "bytes": "47611"}, {"name": "Ruby", "bytes": "174303"}, {"name": "Shell", "bytes": "1704"}]}} +{"text": "\r\n\r\ntinymce.dom.TreeWalker = function(start_node, root_node) {\r\n\tvar node = start_node;\r\n\r\n\tfunction findSibling(node, start_name, sibling_name, shallow) {\r\n\t\tvar sibling, parent;\r\n\r\n\t\tif (node) {\r\n\t\t\t// Walk into nodes if it has a start\r\n\t\t\tif (!shallow && node[start_name])\r\n\t\t\t\treturn node[start_name];\r\n\r\n\t\t\t// Return the sibling if it has one\r\n\t\t\tif (node != root_node) {\r\n\t\t\t\tsibling = node[sibling_name];\r\n\t\t\t\tif (sibling)\r\n\t\t\t\t\treturn sibling;\r\n\r\n\t\t\t\t// Walk up the parents to look for siblings\r\n\t\t\t\tfor (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) {\r\n\t\t\t\t\tsibling = parent[sibling_name];\r\n\t\t\t\t\tif (sibling)\r\n\t\t\t\t\t\treturn sibling;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Returns the current node.\r\n\t *\r\n\t * @return {Node} Current node where the walker is.\r\n\t */\r\n\tthis.current = function() {\r\n\t\treturn node;\r\n\t};\r\n\r\n\t/**\r\n\t * Walks to the next node in tree.\r\n\t *\r\n\t * @return {Node} Current node where the walker is after moving to the next node.\r\n\t */\r\n\tthis.next = function(shallow) {\r\n\t\treturn (node = findSibling(node, 'firstChild', 'nextSibling', shallow));\r\n\t};\r\n\r\n\t/**\r\n\t * Walks to the previous node in tree.\r\n\t *\r\n\t * @return {Node} Current node where the walker is after moving to the previous node.\r\n\t */\r\n\tthis.prev = function(shallow) {\r\n\t\treturn (node = findSibling(node, 'lastChild', 'lastSibling', shallow));\r\n\t};\r\n};\r\n", "meta": {"content_hash": "6c5909cd113751688918b22d0f09553b", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 95, "avg_line_length": 24.642857142857142, "alnum_prop": 0.6115942028985507, "repo_name": "nathanvda/substructd", "id": "c7fc06047c66ea7eed2529b11b3a1514f3311e7b", "size": "1598", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "assets/javascripts/tiny_mce/classes/dom/TreeWalker.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "5998"}, {"name": "Ruby", "bytes": "304980"}]}} +{"text": "package com.fangzhou.manatee.domain;\n\nimport org.hibernate.annotations.Cache;\nimport org.hibernate.annotations.CacheConcurrencyStrategy;\n\nimport javax.persistence.*;\nimport java.io.Serializable;\nimport java.util.Objects;\n\n/**\n * A Team.\n */\n@Entity\n@Table(name = \"team\")\n@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\npublic class Team implements Serializable {\n\n private static final long serialVersionUID = 1L;\n\n @Id\n @GeneratedValue(strategy = GenerationType.AUTO)\n private Long id;\n\n @Column(name = \"organization\")\n private String organization;\n\n @Column(name = \"name\")\n private String name;\n\n @Column(name = \"specialty\")\n private String specialty;\n\n @Column(name = \"max_patients\")\n private Long maxPatients;\n\n @Column(name = \"monday\")\n private Long monday;\n\n @Column(name = \"tuesday\")\n private Long tuesday;\n\n @Column(name = \"wednesday\")\n private Long wednesday;\n\n @Column(name = \"thursday\")\n private Long thursday;\n\n @Column(name = \"friday\")\n private Long friday;\n\n @Column(name = \"saturday\")\n private Long saturday;\n\n @Column(name = \"sunday\")\n private Long sunday;\n\n public Long getId() {\n return id;\n }\n\n public void setId(Long id) {\n this.id = id;\n }\n\n public String getOrganization() {\n return organization;\n }\n\n public void setOrganization(String organization) {\n this.organization = organization;\n }\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n\n public String getSpecialty() {\n return specialty;\n }\n\n public void setSpecialty(String specialty) {\n this.specialty = specialty;\n }\n\n public Long getMaxPatients() {\n return maxPatients;\n }\n\n public void setMaxPatients(Long maxPatients) {\n this.maxPatients = maxPatients;\n }\n\n public Long getMonday() {\n return monday;\n }\n\n public void setMonday(Long monday) {\n this.monday = monday;\n }\n\n public Long getTuesday() {\n return tuesday;\n }\n\n public void setTuesday(Long tuesday) {\n this.tuesday = tuesday;\n }\n\n public Long getWednesday() {\n return wednesday;\n }\n\n public void setWednesday(Long wednesday) {\n this.wednesday = wednesday;\n }\n\n public Long getThursday() {\n return thursday;\n }\n\n public void setThursday(Long thursday) {\n this.thursday = thursday;\n }\n\n public Long getFriday() {\n return friday;\n }\n\n public void setFriday(Long friday) {\n this.friday = friday;\n }\n\n public Long getSaturday() {\n return saturday;\n }\n\n public void setSaturday(Long saturday) {\n this.saturday = saturday;\n }\n\n public Long getSunday() {\n return sunday;\n }\n\n public void setSunday(Long sunday) {\n this.sunday = sunday;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (o == null || getClass() != o.getClass()) {\n return false;\n }\n Team team = (Team) o;\n if(team.id == null || id == null) {\n return false;\n }\n return Objects.equals(id, team.id);\n }\n\n @Override\n public int hashCode() {\n return Objects.hashCode(id);\n }\n\n @Override\n public String toString() {\n return \"Team{\" +\n \"id=\" + id +\n \", organization='\" + organization + \"'\" +\n \", name='\" + name + \"'\" +\n \", specialty='\" + specialty + \"'\" +\n \", maxPatients='\" + maxPatients + \"'\" +\n \", monday='\" + monday + \"'\" +\n \", tuesday='\" + tuesday + \"'\" +\n \", wednesday='\" + wednesday + \"'\" +\n \", thursday='\" + thursday + \"'\" +\n \", friday='\" + friday + \"'\" +\n \", saturday='\" + saturday + \"'\" +\n \", sunday='\" + sunday + \"'\" +\n '}';\n }\n}\n", "meta": {"content_hash": "c29538662c0d78abd1ac89f3c139b61a", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 61, "avg_line_length": 21.063157894736843, "alnum_prop": 0.5594702648675662, "repo_name": "magnumresearch/manatee", "id": "15c62a5999e3a4d89840ab120f28f7b9c61da425", "size": "4002", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/fangzhou/manatee/domain/Team.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "15472"}, {"name": "Dockerfile", "bytes": "312"}, {"name": "HTML", "bytes": "171124"}, {"name": "Java", "bytes": "328631"}, {"name": "JavaScript", "bytes": "242731"}, {"name": "Scala", "bytes": "17164"}]}} +{"text": "{% extends \"base_site.html\" %}\n\n{% block title %}Meetings{% endblock %}\n\n{% block extrahead %}{{ block.super }}\n <link rel=\"stylesheet\" type=\"text/css\" href=\"{{ SECR_STATIC_URL }}css/jquery-ui-1.8.1.custom.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"{{ SECR_STATIC_URL }}css/jquery.ui.autocomplete.css\" />\n <script type=\"text/javascript\" src=\"{{ SECR_STATIC_URL }}js/jquery-ui-1.8.1.custom.min.js\"></script>\n <script type=\"text/javascript\" src=\"{{ SECR_STATIC_URL }}js/utils.js\"></script>\n <script type=\"text/javascript\" src=\"{{ SECR_STATIC_URL }}js/dynamic_inlines.js\"></script>\n{% endblock %}\n\n{% block breadcrumbs %}{{ block.super }} \n » <a href=\"../../\">Meetings</a>\n » <a href=\"../\">{{ meeting.number }}</a>\n » Rooms and Times\n{% endblock %}\n\n\n{% block content %}\n\n<div id=\"nav\" class=\"rooms-times-nav\">\n <ul id=\"list-nav\">\n <li id=\"nav-room\" class=\"leftmost\"><a href=\"{% url meetings_rooms meeting_id=meeting.number %}\">Rooms</a></li>\n <li id=\"nav-time\"><a href=\"{% url meetings_times meeting_id=meeting.number %}\">Times</a></li>\n <li id=\"nav-non-session\"><a href=\"{% url meetings_non_session meeting_id=meeting.number %}\">Non-Session</a></li>\n </ul>\n</div>\n\n{% block subsection %}{% endblock %}\n\n{% endblock %}\n", "meta": {"content_hash": "04f4dd448eff362552fad3529e724a8a", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 116, "avg_line_length": 39.53125, "alnum_prop": 0.6324110671936759, "repo_name": "mcr/ietfdb", "id": "4d56537993ac11b94f707e1e769ea91576a66d7d", "size": "1265", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ietf/secr/templates/meetings/base_rooms_times.html", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "239198"}, {"name": "JavaScript", "bytes": "450755"}, {"name": "Perl", "bytes": "3223"}, {"name": "Python", "bytes": "10286676"}, {"name": "Ruby", "bytes": "3468"}, {"name": "Shell", "bytes": "39950"}, {"name": "TeX", "bytes": "23944"}]}} +{"text": "module Projects\n class ForkService < BaseService\n def execute(fork_to_project = nil)\n if fork_to_project\n link_existing_project(fork_to_project)\n else\n fork_new_project\n end\n end\n\n private\n\n def allowed_fork?\n current_user.can?(:fork_project, @project)\n end\n\n def link_existing_project(fork_to_project)\n return if fork_to_project.forked?\n\n build_fork_network_member(fork_to_project)\n\n if link_fork_network(fork_to_project)\n # A forked project stores its LFS objects in the `forked_from_project`.\n # So the LFS objects become inaccessible, and therefore delete them from\n # the database so they'll get cleaned up.\n #\n # TODO: refactor this to get the correct lfs objects when implementing\n # https://gitlab.com/gitlab-org/gitlab-ce/issues/39769\n fork_to_project.lfs_objects_projects.delete_all\n\n fork_to_project\n end\n end\n\n def fork_new_project\n new_params = {\n visibility_level: allowed_visibility_level,\n description: @project.description,\n name: @project.name,\n path: @project.path,\n shared_runners_enabled: @project.shared_runners_enabled,\n namespace_id: target_namespace.id,\n fork_network: fork_network,\n # We need to assign the fork network membership after the project has\n # been instantiated to avoid ActiveRecord trying to create it when\n # initializing the project, as that would cause a foreign key constraint\n # exception.\n relations_block: -> (project) { build_fork_network_member(project) }\n }\n\n if @project.avatar.present? && @project.avatar.image?\n new_params[:avatar] = @project.avatar\n end\n\n new_params.merge!(@project.object_pool_params)\n\n new_project = CreateService.new(current_user, new_params).execute\n return new_project unless new_project.persisted?\n\n # Set the forked_from_project relation after saving to avoid having to\n # reload the project to reset the association information and cause an\n # extra query.\n new_project.forked_from_project = @project\n\n builds_access_level = @project.project_feature.builds_access_level\n new_project.project_feature.update(builds_access_level: builds_access_level)\n\n new_project\n end\n\n def fork_network\n @fork_network ||= @project.fork_network || @project.build_root_of_fork_network\n end\n\n def build_fork_network_member(fork_to_project)\n if allowed_fork?\n fork_to_project.build_fork_network_member(forked_from_project: @project,\n fork_network: fork_network)\n else\n fork_to_project.errors.add(:forked_from_project_id, 'is forbidden')\n end\n end\n\n def link_fork_network(fork_to_project)\n return if fork_to_project.errors.any?\n\n fork_to_project.fork_network_member.save &&\n refresh_forks_count\n end\n\n def refresh_forks_count\n Projects::ForksCountService.new(@project).refresh_cache\n end\n\n def target_namespace\n @target_namespace ||= @params[:namespace] || current_user.namespace\n end\n\n def allowed_visibility_level\n target_level = [@project.visibility_level, target_namespace.visibility_level].min\n\n Gitlab::VisibilityLevel.closest_allowed_level(target_level)\n end\n end\nend\n", "meta": {"content_hash": "74ad4dcaad161f38d28ecab483c0f913", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 87, "avg_line_length": 33.08571428571429, "alnum_prop": 0.6450777202072538, "repo_name": "axilleas/gitlabhq", "id": "91091c4393dc1dbcabe2e2d69f24758586232ec8", "size": "3505", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/services/projects/fork_service.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "683690"}, {"name": "Clojure", "bytes": "79"}, {"name": "Dockerfile", "bytes": "1907"}, {"name": "HTML", "bytes": "1340167"}, {"name": "JavaScript", "bytes": "4309733"}, {"name": "Ruby", "bytes": "19732082"}, {"name": "Shell", "bytes": "44575"}, {"name": "Vue", "bytes": "1040466"}]}} +{"text": "class CreateAliquotSampleFormats < SharedMigration\n\tdef self.up\n\t\tcreate_table :aliquot_sample_formats do |t|\n\t\t\tt.integer :position\n\t\t\tt.string :key, :null => false\n\t\t\tt.string :description\n\t\t\tt.timestamps\n\t\tend\n\t\tadd_index :aliquot_sample_formats, :key, :unique => true\n\t\tadd_index :aliquot_sample_formats, :description, :unique => true\n\tend\n\n\tdef self.down\n\t\tdrop_table :aliquot_sample_formats\n\tend\nend\n", "meta": {"content_hash": "35f34a1b40ef8907dd3c354ae3df069d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 66, "avg_line_length": 25.5, "alnum_prop": 0.7230392156862745, "repo_name": "ccls/ccls_engine", "id": "4b17ee6430e7910f19acb20928d84291532504bc", "size": "408", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/migrate/20100218233849_create_aliquot_sample_formats.rb", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "3879"}, {"name": "Ruby", "bytes": "865318"}, {"name": "Shell", "bytes": "271"}]}} +{"text": "<html>\n<head>\n\t<title>Leaflet</title>\n\t<link rel=\"stylesheet\" href=\"/leaflet/leaflet.css\" />\n\t<script src=\"/leaflet/leaflet.js\"></script>\n\t<script src=\"../layer/vector/OSM.js\"></script>\n</head>\n<body>\n\t<div style=\"width:100%; height:100%\" id=\"map\"></div>\n<script type='text/javascript'>\nvar map = new L.Map('map', {center: new L.LatLng(55.7, 37.6), zoom: 9, zoomAnimation: false });\nmap.addLayer(new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'));\nvar layer = new L.OSM('ulugo.osm')\n\t\t\t.on(\"loaded\", function(e) { map.fitBounds(e.target.getBounds()); });\nmap.addLayer(layer);\nmap.addControl(new L.Control.Layers({}, {\"OSM\":layer}));\n\n</script>\n \n</body>\n</html>\n", "meta": {"content_hash": "08c9f78dadaf1cb76375f81d2a2fd06c", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 95, "avg_line_length": 32.42857142857143, "alnum_prop": 0.6490455212922174, "repo_name": "MAPC/developmentdatabase-python", "id": "ed35e55a3322173dbab9634d6d38bafe59003f08", "size": "681", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "developmentdatabase/static/lib/leaflet/plugins/shramov/examples/osm.html", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "19926"}, {"name": "JavaScript", "bytes": "565239"}, {"name": "Python", "bytes": "302858"}]}} +{"text": "<md-content ng-controller=\"AddCtrl\" layout=\"column\" flex layout-padding>\r\n\t<h3>Depositar na sua conta</h3>\r\n\t<md-input-container class=\"md-block\">\r\n\t\t<label>Valor</label>\r\n\t\t<input type=\"text\" ng-model=\"valor\" ui-number-mask=\"2\">\r\n\t</md-input-container>\r\n\t<div layout=\"column\">\r\n\t\t<md-button class=\"md-raised md-primary\" aria-label=\"confirmar\" ng-click=\"confirmar()\" ng-disabled=\"!valor\">\r\n\t\t\tConfirmar\r\n\t\t</md-button>\r\n\t</div>\r\n</md-content>", "meta": {"content_hash": "1aab8d8f863eab4d540bd81f7a4517ac", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 109, "avg_line_length": 36.833333333333336, "alnum_prop": 0.6787330316742082, "repo_name": "everton-ongit/wepay", "id": "377b57089d3575f186bd82a37a67ff4ffde7704f", "size": "442", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/app/add/add.html", "mode": "33261", "license": "mit", "language": [{"name": "HTML", "bytes": "10372"}, {"name": "JavaScript", "bytes": "19489"}]}} +{"text": "namespace syncer {\n\nclass SyncPrefs;\n\n// This class is used by ProfileSyncService to manage all logic and state\n// pertaining to initialization of the SyncEngine.\nclass StartupController {\n public:\n StartupController(const SyncPrefs* sync_prefs,\n base::Callback<bool()> can_start,\n base::Closure start_engine);\n ~StartupController();\n\n // Starts up sync if it is requested by the user and preconditions are met.\n // Returns true if these preconditions are met, although does not imply\n // the engine was started.\n bool TryStart();\n\n // Same as TryStart() above, but bypasses deferred startup and the first setup\n // complete check.\n bool TryStartImmediately();\n\n // Called when a datatype (SyncableService) has a need for sync to start\n // ASAP, presumably because a local change event has occurred but we're\n // still in deferred start mode, meaning the SyncableService hasn't been\n // told to MergeDataAndStartSyncing yet.\n // It is expected that |type| is a currently active datatype.\n void OnDataTypeRequestsSyncStartup(ModelType type);\n\n // Prepares this object for a new attempt to start sync, forgetting\n // whether or not preconditions were previously met.\n // NOTE: This resets internal state managed by this class, but does not\n // touch values that are explicitly set and reset by higher layers to\n // tell this class whether a setup UI dialog is being shown to the user.\n // See setup_in_progress_.\n void Reset(const ModelTypeSet registered_types);\n\n // Sets the setup in progress flag and tries to start sync if it's true.\n void SetSetupInProgress(bool setup_in_progress);\n\n bool IsSetupInProgress() const { return setup_in_progress_; }\n base::Time start_engine_time() const { return start_engine_time_; }\n std::string GetEngineInitializationStateString() const;\n\n void OverrideFallbackTimeoutForTest(const base::TimeDelta& timeout);\n\n private:\n enum StartUpDeferredOption { STARTUP_DEFERRED, STARTUP_IMMEDIATE };\n // Returns true if all conditions to start the engine are met.\n bool StartUp(StartUpDeferredOption deferred_option);\n void OnFallbackStartupTimerExpired();\n\n // Records time spent in deferred state with UMA histograms.\n void RecordTimeDeferred();\n\n // If true, will bypass the FirstSetupComplete check when triggering sync\n // startup.\n bool bypass_setup_complete_;\n\n // True if we should start sync ASAP because either a SyncableService has\n // requested it, or we're done waiting for a sign and decided to go ahead.\n bool received_start_request_;\n\n // The time that StartUp() is called. This is used to calculate time spent\n // in the deferred state; that is, after StartUp and before invoking the\n // start_engine_ callback.\n base::Time start_up_time_;\n\n // If |true|, there is setup UI visible so we should not start downloading\n // data types.\n // Note: this is explicitly controlled by higher layers (UI) and is meant to\n // reflect what the UI claims the setup state to be. Therefore, only set this\n // due to explicit requests to do so via SetSetupInProgress.\n bool setup_in_progress_;\n\n const SyncPrefs* sync_prefs_;\n\n // A function that can be invoked repeatedly to determine whether sync can be\n // started. |start_engine_| should not be invoked unless this returns true.\n base::Callback<bool()> can_start_;\n\n // The callback we invoke when it's time to call expensive\n // startup routines for the sync engine.\n base::Closure start_engine_;\n\n // The time at which we invoked the start_engine_ callback.\n base::Time start_engine_time_;\n\n base::TimeDelta fallback_timeout_;\n\n // Used to compute preferred_types from SyncPrefs as-needed.\n ModelTypeSet registered_types_;\n\n base::WeakPtrFactory<StartupController> weak_factory_;\n};\n\n} // namespace syncer\n\n#endif // COMPONENTS_SYNC_DRIVER_STARTUP_CONTROLLER_H_\n", "meta": {"content_hash": "0316e5d429db8cc398d38e1ce36bf546", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 80, "avg_line_length": 38.878787878787875, "alnum_prop": 0.7381137957911146, "repo_name": "google-ar/WebARonARCore", "id": "63c027854831d6e141463f097afba051b55f7b4e", "size": "4276", "binary": false, "copies": "3", "ref": "refs/heads/webarcore_57.0.2987.5", "path": "components/sync/driver/startup_controller.h", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "namespace uut\n{\n\tclass String : public ValueType\n\t{\n\t\tUUT_VALUETYPE(uut, String, ValueType)\n\tpublic:\n\t\ttypedef std::string DataType;\n\t\ttypedef DataType::iterator Iterator;\n\t\ttypedef DataType::const_iterator CIterator;\n\n\t\tString();\n\t\tString(const char* str);\n\t\tString(const String& str);\n\t\tString(String&& str);\n\t\tString(const std::string& str);\n\t\tString(std::string&& str);\n\n\t\tbool EndsWith(const String& ends) const;\n\t\tbool EndsWith(const String& ends, StringComparison comparisonType) const;\n\n\t\tint IndexOf(char value) const;\n\t\tint IndexOf(char value, StringComparison comparisonType) const;\n\n\t\tint IndexOf(const String& value) const;\n\t\tint IndexOf(const String& value, StringComparison comparisonType) const;\n\t\tint IndexOf(const String& value, int startIndex, StringComparison comparisonType) const;\n\n\t\tvoid Insert(int index, const String& value);\n\n\t\tint LastIndexOf(char value) const;\n\t\tint LastIndexOf(char value, StringComparison comparisonType) const;\n\n\t\tint LastIndexOf(const String& value) const;\n\t\tint LastIndexOf(const String& value, StringComparison comparisonType) const;\n\n\t\tvoid Remove(int startIndex);\n\t\tvoid Remove(int startIndex, int length);\n\n\t\tint Replace(char oldChar, char newChar);\n\t\tint Replace(const String& oldValue, const String& newValue);\n\n\t\tvoid TrimStart();\n\t\tvoid TrimStart(const List<char>& trimChars);\n\n\t\tvoid TrimEnd();\n\t\tvoid TrimEnd(const List<char>& trimChars);\n\n\t\tvoid Trim();\n\t\tvoid Trim(const List<char>& trimChars);\n\n\t\tint Split(char c, List<String>& out) const;\n\t\tList<String> Split(char c) const;\n\n\t\tString Substring(int startIndex) const;\n\t\tString Substring(int startIndex, int length) const;\n\n\t\tbool Equals(const String& str) const;\n\t\tbool Equals(const String& str, StringComparison comparisonType) const;\n\n\t\tuint Count() const { return _data.size(); }\n\t\tbool IsEmpty() const { return _data.empty(); }\n\t\tvoid Clear() { _data.clear(); }\n\n\t\toperator const char*() const { return _data.c_str(); }\n\t\tconst char* GetData() const { return _data.c_str(); }\n\n\t\tbool operator == (const char* str) const { return Equals(str); }\n\t\tbool operator != (const char* str) const { return !Equals(str); }\n\n\t\tbool operator == (const String& str) const { return Equals(str); }\n\t\tbool operator != (const String& str) const { return !Equals(str); }\n\n\t\tString& operator = (const char* str);\n\t\tString& operator = (const String& str);\n\t\tString& operator = (String&& str);\n\n\t\tString& operator += (char c);\n\t\tString& operator += (const char* str);\n\t\tString& operator += (const String& str);\n\n\t\tString operator + (const char* str) const;\n\t\tString operator + (const String& str) const;\n\n\t\tstatic String Join(const List<String>& list, const String& str);\n\t\tstatic String Format(const char* format, ...);\n\n\t\tIterator Begin() { return _data.begin(); }\n\t\tIterator End() { return _data.begin(); }\n\n\t\tCIterator Begin() const { return _data.begin(); }\n\t\tCIterator End() const { return _data.begin(); }\n\n\t\tstatic const String Empty;\n\n\t\tstatic int Compare(const String& a, const String& b, StringComparison comparisonType = StringComparison::Ordinal);\n\n\tprotected:\n\t\tstd::string _data;\n\t};\n\n\ttemplate<class T> String::Iterator begin(String& str) { return str.Begin(); }\n\ttemplate<class T> String::Iterator end(String& str) { return str.End(); }\n\n\ttemplate<class T> String::CIterator begin(const String& str) { return str.Begin(); }\n\ttemplate<class T> String::CIterator end(const String& str) { return str.End(); }\n\n\tnamespace detail\n\t{\n\t\ttemplate<typename T> struct StringConvert {\n\t\t\tstatic String ToString(const T& value) { return String(value); }\n\t\t};\n\n\t\t//template<typename T, class = std::enable_if_t<std::is_fundamental<T>::value>> struct StringConvert {\n\t\t//\tstatic String ToString(const T& value) { return String::Empty; }\n\t\t//};\n\n\t\ttemplate<> struct StringConvert<String> {\n\t\t\tstatic String ToString(const String& value) { return value; }\n\t\t};\n\n\t\ttemplate<> struct StringConvert<const Type*> {\n\t\t\tstatic String ToString(const Type* value) { return value->ToString(); }\n\t\t};\n\t}\n\n\ttemplate<typename T>\n\tstatic String ToString(T value) { return detail::StringConvert<T>::ToString(value); }\n\n\tUUT_DEFAULT_VALUE(String, String::Empty)\n}", "meta": {"content_hash": "28a8eb8578bfd89ea9154a6992ee08c5", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 116, "avg_line_length": 31.892307692307693, "alnum_prop": 0.7047756874095513, "repo_name": "kolyden/uut-engine", "id": "559c64b285892d38212b58e7cf805cc35ea9c984", "size": "4271", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "UUT/Core/String.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "2263439"}, {"name": "C++", "bytes": "2142907"}, {"name": "Objective-C", "bytes": "8426"}]}} +{"text": "require 'spec_helper'\ndescribe Spree::PageLayout do\n let (:page_layout) { Spree::PageLayout.first }\n \n it \"build html css js\" do\n html, css = page_layout.build_content \n html.present?.should be_true\n css.present?.should be_true\n end\n \n it \"create new page_layout tree\" do\n # objects = Spree::Section.roots\n # section_hash= objects.inject({}){|h,sp| h[sp.slug] = sp; h}\n # center area\n # center_area = Spree::PageLayout.create_layout(section_hash['center_area'], \"center_area\")\n # center_area.add_section(section_hash['center_part'],:title=>\"center_part\")\n # center_area.add_section(section_hash['left_part'],:title=>\"left_part\")\n # center_area.add_section(section_hash['right_part'],:title=>\"right_part\")\n\n # center_area.children.count.should eq(3) \n # center_area.param_values.count.should eq(0)\n \n end\n \n it \"valid section context\" do\n \n product_detail = Spree::PageLayout.find_by_section_context( Spree::PageLayout::ContextEnum.detail)\n product_detail.context_detail?.should be_true\n product_list = Spree::PageLayout.find_by_section_context( Spree::PageLayout::ContextEnum.list)\n product_list.context_list?.should be_true\n end\n\n it \"could update context\" do\n list_section = Spree::PageLayout.find_by_section_context('list')\n detail_section = Spree::PageLayout.find_by_section_context('detail')\n #contexts = [Spree::PageLayout::ContextEnum.account, Spree::PageLayout::ContextEnum.thanks,Spree::PageLayout::ContextEnum.cart, Spree::PageLayout::ContextEnum.checkout]\n contexts = [Spree::PageLayout::ContextEnum.list, Spree::PageLayout::ContextEnum.detail]\n page_layout.update_section_context contexts\n \n for node in page_layout.self_and_descendants\n if node.is_or_is_descendant_of? list_section\n node.current_contexts.should eq(list_section.current_contexts)\n elsif node.is_or_is_descendant_of? detail_section\n node.current_contexts.should eq(detail_section.current_contexts)\n else\n node.current_contexts.should eq(contexts) \n end\n \n end\n end\n\n it \"could verify contexts\" do\n Spree::PageLayout.verify_contexts( Spree::PageLayout::ContextEnum.cart, [:cart, :checkout, :thankyou ] ).should be_true\n \n Spree::PageLayout.verify_contexts( [Spree::PageLayout::ContextEnum.cart], [:cart, :checkout, :thankyou ] ).should be_true\n\n Spree::PageLayout.verify_contexts( Spree::PageLayout::ContextEnum.either, [:cart, :checkout, :thankyou ] ).should be_false\n end\n \n it \"could replace section\" do\n original_page_layout = page_layout.dup \n root2 = Spree::Section.find('root2')\n page_layout.replace_with(root2)\n original_page_layout.param_values.empty?.should be_true\n page_layout.section.should eq root2\n page_layout.param_values.present?.should be_true\n \n end\n \nend", "meta": {"content_hash": "32591e64cce624099a25291ddb631452", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 172, "avg_line_length": 40.5, "alnum_prop": 0.7022927689594356, "repo_name": "RuanShan/spree_theme", "id": "47d223ba92f0a8a3dc995906f69b08f79160f327", "size": "2858", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/models/page_layout_spec.rb", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "9761"}, {"name": "JavaScript", "bytes": "253599"}, {"name": "Ruby", "bytes": "284748"}]}} +{"text": "base::LazyInstance<base::TestDiscardableMemoryAllocator>\n g_discardable_memory_allocator = LAZY_INSTANCE_INITIALIZER;\n\nint main(int argc, char** argv) {\n#if defined(OS_WIN)\n ui::ScopedOleInitializer ole_initializer_;\n#endif\n\n base::CommandLine::Init(argc, argv);\n\n base::AtExitManager at_exit;\n\n#if defined(USE_X11)\n // This demo uses InProcessContextFactory which uses X on a separate Gpu\n // thread.\n gfx::InitializeThreadedX11();\n#endif\n\n gl::init::InitializeGLOneOff();\n\n // The ContextFactory must exist before any Compositors are created.\n bool context_factory_for_test = false;\n cc::SurfaceManager surface_manager;\n std::unique_ptr<ui::InProcessContextFactory> context_factory(\n new ui::InProcessContextFactory(context_factory_for_test,\n &surface_manager));\n context_factory->set_use_test_surface(false);\n\n base::MessageLoopForUI message_loop;\n\n base::i18n::InitializeICU();\n\n ui::RegisterPathProvider();\n\n base::FilePath ui_test_pak_path;\n CHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));\n ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);\n\n base::DiscardableMemoryAllocator::SetInstance(\n g_discardable_memory_allocator.Pointer());\n\n base::PowerMonitor power_monitor(\n base::WrapUnique(new base::PowerMonitorDeviceSource));\n\n#if defined(OS_WIN)\n gfx::win::MaybeInitializeDirectWrite();\n#endif\n\n#if defined(USE_AURA)\n std::unique_ptr<aura::Env> env = aura::Env::CreateInstance();\n aura::Env::GetInstance()->set_context_factory(context_factory.get());\n#endif\n ui::InitializeInputMethodForTesting();\n ui::MaterialDesignController::Initialize();\n\n {\n views::DesktopTestViewsDelegate views_delegate;\n#if defined(USE_AURA)\n wm::WMState wm_state;\n#endif\n#if !defined(OS_CHROMEOS) && defined(USE_AURA)\n std::unique_ptr<display::Screen> desktop_screen(\n views::CreateDesktopScreen());\n display::Screen::SetScreenInstance(desktop_screen.get());\n#endif\n\n views::examples::ShowExamplesWindow(views::examples::QUIT_ON_CLOSE);\n\n base::RunLoop().Run();\n\n ui::ResourceBundle::CleanupSharedInstance();\n }\n\n ui::ShutdownInputMethod();\n\n#if defined(USE_AURA)\n env.reset();\n#endif\n\n return 0;\n}\n", "meta": {"content_hash": "825fab7409c0f86d89e79e091ccbae68", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 74, "avg_line_length": 27.506172839506174, "alnum_prop": 0.7172351885098743, "repo_name": "google-ar/WebARonARCore", "id": "26b103fec7a8a7ff231f6fd5adacba57c212dac1", "size": "3768", "binary": false, "copies": "1", "ref": "refs/heads/webarcore_57.0.2987.5", "path": "ui/views/examples/examples_main.cc", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "My wedding's homepage using [Creative](http://startbootstrap.com/template-overviews/creative/).\n", "meta": {"content_hash": "c4ed725abc64e77b3aea13858a9da215", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 95, "avg_line_length": 96.0, "alnum_prop": 0.8020833333333334, "repo_name": "mfuentesm/jamieymauricio", "id": "4ce948d537c8a919da3f81da2ef834aef0f50d6c", "size": "96", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "18680"}, {"name": "HTML", "bytes": "11725"}, {"name": "JavaScript", "bytes": "4910"}]}} +{"text": "local types = require \"base.types\"\nlocal common = types.common\n\n-- Forwarding constructor based on type name.\nfunction common.__call(parent, ...)\n local obj = parent.new(...)\n setmetatable(obj, parent)\n return obj\nend\n\n-- Getter lookup.\nfunction common.__index(table, key)\n local mt = getmetatable(table)\n local func = mt.getters[key]\n if func == nil then\n error(\"no member named '\" .. key .. \"'\", 2)\n end\n return func(table)\nend\n\n-- Setter lookup.\nfunction common.__newindex(table, key, value)\n local mt = getmetatable(table)\n local func = mt.setters[key]\n if func == nil then\n error(\"no member named '\" .. key .. \"'\", 2)\n end\n func(table, value)\nend\n\n-- Module exports.\nreturn nil\n", "meta": {"content_hash": "0cd51bd0141fb9e7a86d82e83a442a43", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 51, "avg_line_length": 23.0, "alnum_prop": 0.6345108695652174, "repo_name": "bobsomers/flexrender", "id": "676eefe776a328f174580c307c8f10fc551126fb", "size": "767", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "frlib/base/common.lua", "mode": "33188", "license": "mit", "language": [{"name": "C++", "bytes": "282212"}, {"name": "Lua", "bytes": "72520"}, {"name": "Shell", "bytes": "9263"}]}} +{"text": "from thrift.Thrift import *\nimport fb303.ttypes\nimport hive_metastore.ttypes\nimport queryplan.ttypes\n\n\nfrom thrift.transport import TTransport\nfrom thrift.protocol import TBinaryProtocol, TProtocol\ntry:\n from thrift.protocol import fastbinary\nexcept:\n fastbinary = None\n\n\nclass JobTrackerState:\n INITIALIZING = 1\n RUNNING = 2\n\n _VALUES_TO_NAMES = {\n 1: \"INITIALIZING\",\n 2: \"RUNNING\",\n }\n\n _NAMES_TO_VALUES = {\n \"INITIALIZING\": 1,\n \"RUNNING\": 2,\n }\n\n\nclass HiveClusterStatus:\n \"\"\"\n Attributes:\n - taskTrackers\n - mapTasks\n - reduceTasks\n - maxMapTasks\n - maxReduceTasks\n - state\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.I32, 'taskTrackers', None, None, ), # 1\n (2, TType.I32, 'mapTasks', None, None, ), # 2\n (3, TType.I32, 'reduceTasks', None, None, ), # 3\n (4, TType.I32, 'maxMapTasks', None, None, ), # 4\n (5, TType.I32, 'maxReduceTasks', None, None, ), # 5\n (6, TType.I32, 'state', None, None, ), # 6\n )\n\n def __init__(self, taskTrackers=None, mapTasks=None, reduceTasks=None, maxMapTasks=None, maxReduceTasks=None, state=None,):\n self.taskTrackers = taskTrackers\n self.mapTasks = mapTasks\n self.reduceTasks = reduceTasks\n self.maxMapTasks = maxMapTasks\n self.maxReduceTasks = maxReduceTasks\n self.state = state\n\n def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.I32:\n self.taskTrackers = iprot.readI32();\n else:\n iprot.skip(ftype)\n elif fid == 2:\n if ftype == TType.I32:\n self.mapTasks = iprot.readI32();\n else:\n iprot.skip(ftype)\n elif fid == 3:\n if ftype == TType.I32:\n self.reduceTasks = iprot.readI32();\n else:\n iprot.skip(ftype)\n elif fid == 4:\n if ftype == TType.I32:\n self.maxMapTasks = iprot.readI32();\n else:\n iprot.skip(ftype)\n elif fid == 5:\n if ftype == TType.I32:\n self.maxReduceTasks = iprot.readI32();\n else:\n iprot.skip(ftype)\n elif fid == 6:\n if ftype == TType.I32:\n self.state = iprot.readI32();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()\n\n def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('HiveClusterStatus')\n if self.taskTrackers is not None:\n oprot.writeFieldBegin('taskTrackers', TType.I32, 1)\n oprot.writeI32(self.taskTrackers)\n oprot.writeFieldEnd()\n if self.mapTasks is not None:\n oprot.writeFieldBegin('mapTasks', TType.I32, 2)\n oprot.writeI32(self.mapTasks)\n oprot.writeFieldEnd()\n if self.reduceTasks is not None:\n oprot.writeFieldBegin('reduceTasks', TType.I32, 3)\n oprot.writeI32(self.reduceTasks)\n oprot.writeFieldEnd()\n if self.maxMapTasks is not None:\n oprot.writeFieldBegin('maxMapTasks', TType.I32, 4)\n oprot.writeI32(self.maxMapTasks)\n oprot.writeFieldEnd()\n if self.maxReduceTasks is not None:\n oprot.writeFieldBegin('maxReduceTasks', TType.I32, 5)\n oprot.writeI32(self.maxReduceTasks)\n oprot.writeFieldEnd()\n if self.state is not None:\n oprot.writeFieldBegin('state', TType.I32, 6)\n oprot.writeI32(self.state)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n\n def validate(self):\n return\n\n\n def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n def __ne__(self, other):\n return not (self == other)\n\nclass HiveServerException(Exception):\n \"\"\"\n Attributes:\n - message\n - errorCode\n - SQLState\n \"\"\"\n\n thrift_spec = (\n None, # 0\n (1, TType.STRING, 'message', None, None, ), # 1\n (2, TType.I32, 'errorCode', None, None, ), # 2\n (3, TType.STRING, 'SQLState', None, None, ), # 3\n )\n\n def __init__(self, message=None, errorCode=None, SQLState=None,):\n self.message = message\n self.errorCode = errorCode\n self.SQLState = SQLState\n\n def read(self, iprot):\n if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:\n fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))\n return\n iprot.readStructBegin()\n while True:\n (fname, ftype, fid) = iprot.readFieldBegin()\n if ftype == TType.STOP:\n break\n if fid == 1:\n if ftype == TType.STRING:\n self.message = iprot.readString();\n else:\n iprot.skip(ftype)\n elif fid == 2:\n if ftype == TType.I32:\n self.errorCode = iprot.readI32();\n else:\n iprot.skip(ftype)\n elif fid == 3:\n if ftype == TType.STRING:\n self.SQLState = iprot.readString();\n else:\n iprot.skip(ftype)\n else:\n iprot.skip(ftype)\n iprot.readFieldEnd()\n iprot.readStructEnd()\n\n def write(self, oprot):\n if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:\n oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))\n return\n oprot.writeStructBegin('HiveServerException')\n if self.message is not None:\n oprot.writeFieldBegin('message', TType.STRING, 1)\n oprot.writeString(self.message)\n oprot.writeFieldEnd()\n if self.errorCode is not None:\n oprot.writeFieldBegin('errorCode', TType.I32, 2)\n oprot.writeI32(self.errorCode)\n oprot.writeFieldEnd()\n if self.SQLState is not None:\n oprot.writeFieldBegin('SQLState', TType.STRING, 3)\n oprot.writeString(self.SQLState)\n oprot.writeFieldEnd()\n oprot.writeFieldStop()\n oprot.writeStructEnd()\n\n def validate(self):\n return\n\n\n def __str__(self):\n return repr(self)\n\n def __repr__(self):\n L = ['%s=%r' % (key, value)\n for key, value in self.__dict__.iteritems()]\n return '%s(%s)' % (self.__class__.__name__, ', '.join(L))\n\n def __eq__(self, other):\n return isinstance(other, self.__class__) and self.__dict__ == other.__dict__\n\n def __ne__(self, other):\n return not (self == other)\n", "meta": {"content_hash": "81dbcc4e85b1ac6673434818effa6e3f", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 188, "avg_line_length": 29.906382978723403, "alnum_prop": 0.6246442800227661, "repo_name": "genericDataCompany/hsandbox", "id": "f10f8c454db1a7ca2d81707c13440765875f6a7d", "size": "7145", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "common/hive-0.9.0-bin/lib/py/hive_service/ttypes.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "26324"}, {"name": "C++", "bytes": "40407"}, {"name": "Java", "bytes": "20935825"}, {"name": "Objective-C", "bytes": "1894"}, {"name": "PHP", "bytes": "898217"}, {"name": "Perl", "bytes": "539854"}, {"name": "Python", "bytes": "786538"}, {"name": "Shell", "bytes": "146660"}, {"name": "XSLT", "bytes": "1431"}]}} +{"text": "ACCEPTED\n\n#### According to\nInternational Plant Names Index\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "872109a5ec47f1d51d365eab0025176e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "e36c4ed50b3ffce2d5c4bc9c4148d06d241811c7", "size": "169", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Inga/Inga triflora/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": " <div class=\"sidebar\">\n <div id=\"sidebar-social\">\n <h4>Social</h4>\n <li style=\"white-space:nowrap;\"><i class=\"fa fa-envelope\"></i><a href=\"mailto:eduardszoecs@gmail.com\" title=\"Email\"> eduardszoecs@gmail.com</a></li>\n <li><i class=\"fa fa-twitter\"></i><a href=\"http://twitter.com/EduardSzoecs\" title=\"Twitter\"> @EduardSzoecs</a></li>\n <li><i class=\"fa fa-skype\"></i><a href=\"skype:profile_name?userinfo\"> szocs.eduard</a></li>\n <li><i class=\"fa fa-github\"></i><a href=\"https://github.com/EDiLD\" title=\"Github\"> EDiLD</a></li>\n <li><i class=\"fa fa-stack-overflow\"></i><a href=\"http://stackoverflow.com/users/511399/edi\" title=\"Stackoverflow\"> EDi</a></li>\n \n <h4>Links</h4>\n <li><i class=\"ai ai-researchgate-square\"></i><a href=\"http://www.researchgate.net/profile/Eduard_Szoecs\" title=\"Researchgate\"> Researchgate</a></li>\n <li><i class=\"ai ai-google-scholar-square\"></i><a href=\"https://scholar.google.de/citations?user=QlQH1zEAAAAJ&hl=en\" title=\"Google scholar\"> Google Scholar</a></li>\n <li><i class=\"ai ai-orcid\"></i><a href=\"http://orcid.org/0000-0001-5376-1194\" title=\"Orcid\"> ORCID</a></li>\n <li style=\"white-space:nowrap;\"><i class=\"fa fa-university\"></i><a href=\"https://www.uni-koblenz-landau.de/en/campus-landau/faculty7/environmental-sciences/landscape-ecology/Staff/eduardszoecs\" title=\"Univerity\"> University</a></li>\n <li><i class=\"fa fa-fw fa-rss\"></i><a href=\"{{ site.url }}/feed.xml\" title=\"Subscribe RSS\"> Subscribe</a></li>\n </div>\n </div>\n", "meta": {"content_hash": "a4405acbdf54c9d0ef9700df5bb1491e", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 238, "avg_line_length": 90.11764705882354, "alnum_prop": 0.6514360313315927, "repo_name": "EDiLD/edild.github.com", "id": "3fa1147db1725d8e75ffe583c52d2197b40714ef", "size": "1532", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_includes/sidebar.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "17093"}, {"name": "HTML", "bytes": "8889"}, {"name": "R", "bytes": "4475"}, {"name": "Ruby", "bytes": "50"}]}} +{"text": "\n\n#include <stdio.h>\n#include <stdint.h>\n\n#include <sel4/sel4.h>\n#include <sel4utils/util.h>\n\n#include <VchanProxy.h>\n\n#include \"vmm/vmm.h\"\n#include \"vmm/vchan_copy.h\"\n#include \"vmm/vchan_sharemem.h\"\n\n#define DPRINTF(num, ...) printf(__VA_ARGS__);\n\nint32_t rpc_in_new_connection(vchan_connect_t con) {\n// DPRINTF(DBG_SERVER, \"Proxy: new connection \\n\");\n return (int32_t)vchan_com_out_new_connection(con);\n}\n\n\nint32_t rpc_in_rem_connection(vchan_connect_t con) {\n// DPRINTF(DBG_SERVER, \"Proxy: rem connection \\n\");\n return (int32_t)vchan_com_out_rem_connection(con);\n}\n\nint32_t rpc_in_get_buf(vchan_ctrl_t con, int32_t cmd) {\n// DPRINTF(DBG_SERVER, \"Proxy: get buff \\n\");\n return (int32_t)vchan_com_out_get_buf(con, (int)cmd);\n}\n\nint32_t rpc_in_status(vchan_ctrl_t con) {\n// DPRINTF(DBG_SERVER, \"Proxy: in status \\n\");\n return (int32_t)vchan_com_out_status(con);\n}\n\nint32_t rpc_in_alert_status(vchan_ctrl_t con) {\n// DPRINTF(DBG_SERVER, \"Proxy: alert status \\n\");\n return (int32_t)vchan_com_out_alert_status(con);\n}\n\nvoid rpc_in_ping() {\n// DPRINTF(DBG_SERVER, \"Proxy: ping \\n\");\n vchan_com_out_ping();\n}\n\nvoid vevent_out_callback(void *arg) {\n// DPRINTF(DBG_SERVER, \"Proxy: vevent out callback \\n\");\n vevent_in_write_void();\n// DPRINTF(DBG_SERVER, \"Proxy: vevent out sent with result %d \\n\", result);\n vevent_out_reg_callback(vevent_out_callback, arg);\n}\n\nint run(void) {\n// DPRINTF(DBG_SERVER, \"Proxy: started \\n\");\n vevent_out_reg_callback(vevent_out_callback, NULL);\n return 0;\n}\n", "meta": {"content_hash": "c55f36c0f8756667722b98227e37aedc", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 76, "avg_line_length": 25.508474576271187, "alnum_prop": 0.6750830564784053, "repo_name": "smaccm/smaccm", "id": "c5b9ff32ffaa095cabcbaf51f9bb51e99cff878c", "size": "1756", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "models/Trusted_Build_Test/vChan_demo/components/VchanProxy/src/proxy.c", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ANTLR", "bytes": "451"}, {"name": "Batchfile", "bytes": "683"}, {"name": "C", "bytes": "11288334"}, {"name": "C++", "bytes": "311661"}, {"name": "CSS", "bytes": "8414"}, {"name": "Common Lisp", "bytes": "2573"}, {"name": "GAP", "bytes": "1308789"}, {"name": "HTML", "bytes": "261273"}, {"name": "Java", "bytes": "13163755"}, {"name": "Limbo", "bytes": "2106"}, {"name": "Lua", "bytes": "8914"}, {"name": "MATLAB", "bytes": "10198"}, {"name": "Makefile", "bytes": "205845"}, {"name": "Objective-C", "bytes": "908928"}, {"name": "Python", "bytes": "14200"}, {"name": "Shell", "bytes": "812"}]}} +{"text": "/**\n * Authored by AlmogBaku\n * almog.baku@gmail.com\n * http://www.almogbaku.com/\n *\n * 9/8/13 9:33 PM\n */\n\nangular.element(document).ready(function() {\n angular.bootstrap(document, ['app']);\n});\n\n\n/**\n * DEBUG!!!!!! @TODO remove it!\n */\nfunction getApp(service) {\n return angular.element(document).injector().get(service);\n}", "meta": {"content_hash": "36a7a4c186aa8416b0585da2df0f8a58", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 61, "avg_line_length": 18.842105263157894, "alnum_prop": 0.5865921787709497, "repo_name": "AlmogBaku/actionable-connections", "id": "02fe790aca46bff3259227a97906df90531cf66d", "size": "358", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/load.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "2844"}, {"name": "HTML", "bytes": "6605"}, {"name": "JavaScript", "bytes": "21727"}, {"name": "Ruby", "bytes": "969"}]}} +{"text": "<!DOCTYPE HTML>\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc -->\n<title>org.apache.sysds.hops.rewrite (Apache SystemDS 2.3.0-SNAPSHOT API)</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../../stylesheet.css\" title=\"Style\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../../jquery/jquery-ui.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"../../../../../script.js\"></script>\n<script type=\"text/javascript\" src=\"../../../../../jquery/jszip/dist/jszip.min.js\"></script>\n<script type=\"text/javascript\" src=\"../../../../../jquery/jszip-utils/dist/jszip-utils.min.js\"></script>\n<!--[if IE]>\n<script type=\"text/javascript\" src=\"../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js\"></script>\n<![endif]-->\n<script type=\"text/javascript\" src=\"../../../../../jquery/jquery-3.5.1.js\"></script>\n<script type=\"text/javascript\" src=\"../../../../../jquery/jquery-ui.js\"></script>\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n try {\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"org.apache.sysds.hops.rewrite (Apache SystemDS 2.3.0-SNAPSHOT API)\";\n }\n }\n catch(err) {\n }\n//-->\nvar pathtoroot = \"../../../../../\";\nvar useModuleDirectories = true;\nloadScripts(document, 'script');</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<header role=\"banner\">\n<nav role=\"navigation\">\n<div class=\"fixedNav\">\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a id=\"navbar.top\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a id=\"navbar.top.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../index.html\">Overview</a></li>\n<li class=\"navBarCell1Rev\">Package</li>\n<li>Class</li>\n<li><a href=\"package-use.html\">Use</a></li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../../allclasses.html\">All Classes</a></li>\n</ul>\n<ul class=\"navListSearch\">\n<li><label for=\"search\">SEARCH:</label>\n<input type=\"text\" id=\"search\" value=\"search\" disabled=\"disabled\">\n<input type=\"reset\" id=\"reset\" value=\"reset\" disabled=\"disabled\">\n</li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n</div>\n<a id=\"skip.navbar.top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n</div>\n<div class=\"navPadding\"> </div>\n<script type=\"text/javascript\"><!--\n$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n//-->\n</script>\n</nav>\n</header>\n<main role=\"main\">\n<div class=\"header\">\n<h1 title=\"Package\" class=\"title\">Package org.apache.sysds.hops.rewrite</h1>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<table class=\"typeSummary\">\n<caption><span>Class Summary</span><span class=\"tabEnd\"> </span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Class</th>\n<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"HopDagValidator.html\" title=\"class in org.apache.sysds.hops.rewrite\">HopDagValidator</a></th>\n<td class=\"colLast\">\n<div class=\"block\">This class allows to check hop dags for validity, e.g., parent-child linking.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"HopRewriteRule.html\" title=\"class in org.apache.sysds.hops.rewrite\">HopRewriteRule</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Base class for all hop rewrites in order to enable generic\n application of all rules.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"HopRewriteUtils.html\" title=\"class in org.apache.sysds.hops.rewrite\">HopRewriteUtils</a></th>\n<td class=\"colLast\"> </td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"MarkForLineageReuse.html\" title=\"class in org.apache.sysds.hops.rewrite\">MarkForLineageReuse</a></th>\n<td class=\"colLast\"> </td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"ProgramRewriter.html\" title=\"class in org.apache.sysds.hops.rewrite\">ProgramRewriter</a></th>\n<td class=\"colLast\">\n<div class=\"block\">This program rewriter applies a variety of rule-based rewrites\n on all hop dags of the given program in one pass over the entire\n program.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"ProgramRewriteStatus.html\" title=\"class in org.apache.sysds.hops.rewrite\">ProgramRewriteStatus</a></th>\n<td class=\"colLast\"> </td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteAlgebraicSimplificationDynamic.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteAlgebraicSimplificationDynamic</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Algebraic Simplifications.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteAlgebraicSimplificationStatic.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteAlgebraicSimplificationStatic</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Algebraic Simplifications.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteBlockSizeAndReblock.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteBlockSizeAndReblock</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: BlockSizeAndReblock.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteCommonSubexpressionElimination.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteCommonSubexpressionElimination</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: CommonSubexpressionElimination.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteCompressedReblock.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteCompressedReblock</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Compressed Re block if config compressed.linalg is enabled, we inject compression directions after read of\n matrices if number of rows is above 1000 and cols at least 1.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteConstantFolding.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteConstantFolding</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Constant Folding.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteElementwiseMultChainOptimization.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteElementwiseMultChainOptimization</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Prerequisite: RewriteCommonSubexpressionElimination must run before this rule.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteFederatedExecution.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteFederatedExecution</a></th>\n<td class=\"colLast\"> </td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteFederatedExecution.PrivacyConstraintRetriever.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteFederatedExecution.PrivacyConstraintRetriever</a></th>\n<td class=\"colLast\">\n<div class=\"block\">FederatedUDF for retrieving privacy constraint of data stored in file name.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteForLoopVectorization.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteForLoopVectorization</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Simplify program structure by pulling if or else statement body out\n (removing the if statement block ifself) in order to allow intra-procedure\n analysis to propagate exact statistics.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteGPUSpecificOps.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteGPUSpecificOps</a></th>\n<td class=\"colLast\"> </td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteHoistLoopInvariantOperations.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteHoistLoopInvariantOperations</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Simplify program structure by hoisting loop-invariant operations\n out of while, for, or parfor loops.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteIndexingVectorization.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteIndexingVectorization</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Indexing vectorization.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteInjectSparkLoopCheckpointing.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteInjectSparkLoopCheckpointing</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Insert checkpointing operations for caching purposes.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteInjectSparkPReadCheckpointing.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteInjectSparkPReadCheckpointing</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: BlockSizeAndReblock.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteMarkLoopVariablesUpdateInPlace.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteMarkLoopVariablesUpdateInPlace</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Mark loop variables that are only read/updated through cp left indexing\n for update in-place.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteMatrixMultChainOptimization.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteMatrixMultChainOptimization</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Determine the optimal order of execution for a chain of\n matrix multiplications \n \n Solution: Classic Dynamic Programming\n Approach: Currently, the approach based only on matrix dimensions\n Goal: To reduce the number of computations in the run-time\n (map-reduce) layer</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteMatrixMultChainOptimizationSparse.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteMatrixMultChainOptimizationSparse</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Determine the optimal order of execution for a chain of\n matrix multiplications \n \n Solution: Classic Dynamic Programming\n Approach: Currently, the approach based only on matrix dimensions\n and sparsity estimates using the MNC sketch\n Goal: To reduce the number of computations in the run-time\n (map-reduce) layer</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteMergeBlockSequence.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteMergeBlockSequence</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Simplify program structure by merging sequences of last-level\n statement blocks in order to create optimization opportunities.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteRemoveDanglingParentReferences.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteRemoveDanglingParentReferences</a></th>\n<td class=\"colLast\">\n<div class=\"block\">This rewrite is a general-purpose cleanup pass that removes any\n dangling parent references in one pass through the hop DAG.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteRemoveEmptyBasicBlocks.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteRemoveEmptyBasicBlocks</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Simplify program structure by removing empty last-level blocks,\n which may originate from the original program or due to a sequence of\n rewrites (e.g., checkpoint injection and subsequent IPA).</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteRemoveForLoopEmptySequence.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteRemoveForLoopEmptySequence</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Simplify program structure by removing (par)for statements iterating over\n an empty sequence, i.e., (par)for-loops without a single iteration.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteRemovePersistentReadWrite.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteRemovePersistentReadWrite</a></th>\n<td class=\"colLast\">\n<div class=\"block\">This rewrite is a custom rewrite for JMLC in order to replace all persistent reads\n and writes with transient reads and writes from the symbol table.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteRemoveReadAfterWrite.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteRemoveReadAfterWrite</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: RemoveReadAfterWrite.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteRemoveUnnecessaryBranches.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteRemoveUnnecessaryBranches</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Simplify program structure by pulling if or else statement body out\n (removing the if statement block ifself) in order to allow intra-procedure\n analysis to propagate exact statistics.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteRemoveUnnecessaryCasts.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteRemoveUnnecessaryCasts</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: RemoveUnnecessaryCasts.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteSplitDagDataDependentOperators.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteSplitDagDataDependentOperators</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Split Hop DAG after specific data-dependent operators.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteSplitDagUnknownCSVRead.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteSplitDagUnknownCSVRead</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Split Hop DAG after CSV reads with unknown size.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"RewriteTransientWriteParentHandling.html\" title=\"class in org.apache.sysds.hops.rewrite\">RewriteTransientWriteParentHandling</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Rule: Eliminate for Transient Write DataHops to have no parents\n Solution: Move parent edges of Transient Write Hop to parent of\n its child \n Reason: Transient Write not being a root messes up\n analysis for Lop's to Instruction translation (according to Amol)</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<th class=\"colFirst\" scope=\"row\"><a href=\"StatementBlockRewriteRule.html\" title=\"class in org.apache.sysds.hops.rewrite\">StatementBlockRewriteRule</a></th>\n<td class=\"colLast\">\n<div class=\"block\">Base class for all hop rewrites in order to enable generic\n application of all rules.</div>\n</td>\n</tr>\n</tbody>\n</table>\n</li>\n</ul>\n</div>\n</main>\n<footer role=\"contentinfo\">\n<nav role=\"navigation\">\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a id=\"navbar.bottom\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a id=\"navbar.bottom.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../index.html\">Overview</a></li>\n<li class=\"navBarCell1Rev\">Package</li>\n<li>Class</li>\n<li><a href=\"package-use.html\">Use</a></li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../../allclasses.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n</div>\n<a id=\"skip.navbar.bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</nav>\n<p class=\"legalCopy\"><small>Copyright © 2021 <a href=\"https://www.apache.org/\">The Apache Software Foundation</a>. All rights reserved.</small></p>\n</footer>\n</body>\n</html>\n", "meta": {"content_hash": "c6c9c5767385cfd29ac8a1fe3449e7f4", "timestamp": "", "source": "github", "line_count": 402, "max_line_length": 209, "avg_line_length": 42.975124378109456, "alnum_prop": 0.7137647603611947, "repo_name": "apache/incubator-systemml", "id": "08b06266cc8c1246ca65a3d080656b69af73a718", "size": "17276", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/api/java/org/apache/sysds/hops/rewrite/package-summary.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ANTLR", "bytes": "31285"}, {"name": "Batchfile", "bytes": "22265"}, {"name": "C", "bytes": "8676"}, {"name": "C++", "bytes": "30804"}, {"name": "CMake", "bytes": "10312"}, {"name": "Cuda", "bytes": "30575"}, {"name": "Java", "bytes": "12990600"}, {"name": "Jupyter Notebook", "bytes": "36387"}, {"name": "Makefile", "bytes": "936"}, {"name": "Protocol Buffer", "bytes": "66399"}, {"name": "Python", "bytes": "195969"}, {"name": "R", "bytes": "672462"}, {"name": "Scala", "bytes": "185698"}, {"name": "Shell", "bytes": "152940"}]}} +{"text": "[](https://badge.fury.io/js/snowscape)\n\ninstall\n\n```\n$ npm i -g snowscape\n```\n\nexecute\n\n```\n$ snowscape\n```\n", "meta": {"content_hash": "17e5ca5c68910c31b27389f6617a6a74", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 92, "avg_line_length": 12.461538461538462, "alnum_prop": 0.6419753086419753, "repo_name": "feb19/snowscape", "id": "fd253f8c48c1f196f05b13ebb91ecb592d5474ce", "size": "174", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "3138"}]}} +{"text": "import React from 'react';\n\nclass Home extends React.Component {\n render() {\n return (\n <div className='container'>\n <div className='page-header'>\n <h1>Events at Hacker Dojo</h1>\n </div>\n </div>\n );\n }\n}\n\nexport default Home;", "meta": {"content_hash": "50e9be366080b11eb277139a95ec9f20", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 40, "avg_line_length": 17.733333333333334, "alnum_prop": 0.5639097744360902, "repo_name": "billsaysthis/fhd-events", "id": "7d3e3ecc7a60b0b24c293e8d1c9dea0468f4c5b2", "size": "266", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/components/Home.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "188402"}, {"name": "HTML", "bytes": "562"}, {"name": "JavaScript", "bytes": "1270421"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\" >\n\n <TextView\n android:id=\"@+id/textAbout\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:scrollbars=\"vertical\"\n android:textAppearance=\"?android:attr/textAppearanceSmall\"\n android:textSize=\"10sp\" />\n\n</FrameLayout>\n", "meta": {"content_hash": "b02b9f1012d7337f090934bf27e4989f", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 71, "avg_line_length": 35.0, "alnum_prop": 0.6795918367346939, "repo_name": "darizotas/metadatastrip", "id": "9fc8e19b892f2f4f684a114b8cec625c8d228313", "size": "490", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "res/layout/fragment_about_dialog.xml", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Java", "bytes": "53237"}]}} +{"text": "require 'spec_helper'\nrequire 'whois/parsers/whois.domain-registry.nl.rb'\n\ndescribe Whois::Parsers::WhoisDomainRegistryNl, \"property_nameservers_with_ip.expected\" do\n\n subject do\n file = fixture(\"responses\", \"whois.domain-registry.nl/nl/property_nameservers_with_ip.txt\")\n part = Whois::Record::Part.new(body: File.read(file))\n described_class.new(part)\n end\n\n describe \"#nameservers\" do\n it do\n expect(subject.nameservers).to be_a(Array)\n expect(subject.nameservers.size).to eq(2)\n expect(subject.nameservers[0]).to be_a(Whois::Parser::Nameserver)\n expect(subject.nameservers[0].name).to eq(\"ns1.tntpost.nl\")\n expect(subject.nameservers[0].ipv4).to eq(\"145.78.21.10\")\n expect(subject.nameservers[1]).to be_a(Whois::Parser::Nameserver)\n expect(subject.nameservers[1].name).to eq(\"ns2.tntpost.nl\")\n expect(subject.nameservers[1].ipv4).to eq(\"80.69.76.10\")\n end\n end\nend\n", "meta": {"content_hash": "36a94a975b59b844990eaf6831f65d24", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 95, "avg_line_length": 38.666666666666664, "alnum_prop": 0.7036637931034483, "repo_name": "weppos/whois-parser", "id": "efc7e3d23dffc383757c1a414bd52dd779fca89c", "size": "1220", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "spec/whois/parsers/responses/whois.domain-registry.nl/nl/property_nameservers_with_ip_spec.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "2354053"}]}} +{"text": "/* this file has been autogenerated by vtkNodeJsWrap */\n/* editing this might proof futile */\n\n#define VTK_WRAPPING_CXX\n#define VTK_STREAMS_FWD_ONLY\n#include <nan.h>\n\n#include \"vtkInteractorStyleWrap.h\"\n#include \"vtkInteractorStyleSwitchBaseWrap.h\"\n#include \"vtkObjectBaseWrap.h\"\n#include \"vtkRenderWindowInteractorWrap.h\"\n#include \"../../plus/plus.h\"\n\nusing namespace v8;\n\nextern Nan::Persistent<v8::Object> vtkNodeJsNoWrap;\nNan::Persistent<v8::FunctionTemplate> VtkInteractorStyleSwitchBaseWrap::ptpl;\n\nVtkInteractorStyleSwitchBaseWrap::VtkInteractorStyleSwitchBaseWrap()\n{ }\n\nVtkInteractorStyleSwitchBaseWrap::VtkInteractorStyleSwitchBaseWrap(vtkSmartPointer<vtkInteractorStyleSwitchBase> _native)\n{ native = _native; }\n\nVtkInteractorStyleSwitchBaseWrap::~VtkInteractorStyleSwitchBaseWrap()\n{ }\n\nvoid VtkInteractorStyleSwitchBaseWrap::Init(v8::Local<v8::Object> exports)\n{\n\tNan::SetAccessor(exports, Nan::New(\"vtkInteractorStyleSwitchBase\").ToLocalChecked(), ConstructorGetter);\n\tNan::SetAccessor(exports, Nan::New(\"InteractorStyleSwitchBase\").ToLocalChecked(), ConstructorGetter);\n}\n\nvoid VtkInteractorStyleSwitchBaseWrap::ConstructorGetter(\n\tv8::Local<v8::String> property,\n\tconst Nan::PropertyCallbackInfo<v8::Value>& info)\n{\n\tInitPtpl();\n\tinfo.GetReturnValue().Set(Nan::New(ptpl)->GetFunction());\n}\n\nvoid VtkInteractorStyleSwitchBaseWrap::InitPtpl()\n{\n\tif (!ptpl.IsEmpty()) return;\n\tv8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);\n\tVtkInteractorStyleWrap::InitPtpl( );\n\ttpl->Inherit(Nan::New<FunctionTemplate>(VtkInteractorStyleWrap::ptpl));\n\ttpl->SetClassName(Nan::New(\"VtkInteractorStyleSwitchBaseWrap\").ToLocalChecked());\n\ttpl->InstanceTemplate()->SetInternalFieldCount(1);\n\n\tNan::SetPrototypeMethod(tpl, \"GetInteractor\", GetInteractor);\n\tNan::SetPrototypeMethod(tpl, \"getInteractor\", GetInteractor);\n\n\tNan::SetPrototypeMethod(tpl, \"NewInstance\", NewInstance);\n\tNan::SetPrototypeMethod(tpl, \"newInstance\", NewInstance);\n\n\tNan::SetPrototypeMethod(tpl, \"SafeDownCast\", SafeDownCast);\n\tNan::SetPrototypeMethod(tpl, \"safeDownCast\", SafeDownCast);\n\n#ifdef VTK_NODE_PLUS_VTKINTERACTORSTYLESWITCHBASEWRAP_INITPTPL\n\tVTK_NODE_PLUS_VTKINTERACTORSTYLESWITCHBASEWRAP_INITPTPL\n#endif\n\tptpl.Reset( tpl );\n}\n\nvoid VtkInteractorStyleSwitchBaseWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info)\n{\n\tif(!info.IsConstructCall())\n\t{\n\t\tNan::ThrowError(\"Constructor not called in a construct call.\");\n\t\treturn;\n\t}\n\n\tif(info.Length() == 0)\n\t{\n\t\tvtkSmartPointer<vtkInteractorStyleSwitchBase> native = vtkSmartPointer<vtkInteractorStyleSwitchBase>::New();\n\t\tVtkInteractorStyleSwitchBaseWrap* obj = new VtkInteractorStyleSwitchBaseWrap(native);\n\t\tobj->Wrap(info.This());\n\t}\n\telse\n\t{\n\t\tif(info[0]->ToObject() != vtkNodeJsNoWrap )\n\t\t{\n\t\t\tNan::ThrowError(\"Parameter Error\");\n\t\t\treturn;\n\t\t}\n\t}\n\n\tinfo.GetReturnValue().Set(info.This());\n}\n\nvoid VtkInteractorStyleSwitchBaseWrap::GetInteractor(const Nan::FunctionCallbackInfo<v8::Value>& info)\n{\n\tVtkInteractorStyleSwitchBaseWrap *wrapper = ObjectWrap::Unwrap<VtkInteractorStyleSwitchBaseWrap>(info.Holder());\n\tvtkInteractorStyleSwitchBase *native = (vtkInteractorStyleSwitchBase *)wrapper->native.GetPointer();\n\tvtkRenderWindowInteractor * r;\n\tif(info.Length() != 0)\n\t{\n\t\tNan::ThrowError(\"Too many parameters.\");\n\t\treturn;\n\t}\n\tr = native->GetInteractor();\n\tVtkRenderWindowInteractorWrap::InitPtpl();\n\tv8::Local<v8::Value> argv[1] =\n\t\t{ Nan::New(vtkNodeJsNoWrap) };\n\tv8::Local<v8::Function> cons =\n\t\tNan::New<v8::FunctionTemplate>(VtkRenderWindowInteractorWrap::ptpl)->GetFunction();\n\tv8::Local<v8::Object> wo = cons->NewInstance(1, argv);\n\tVtkRenderWindowInteractorWrap *w = new VtkRenderWindowInteractorWrap();\n\tw->native = r;\n\tw->Wrap(wo);\n\tinfo.GetReturnValue().Set(wo);\n}\n\nvoid VtkInteractorStyleSwitchBaseWrap::NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info)\n{\n\tVtkInteractorStyleSwitchBaseWrap *wrapper = ObjectWrap::Unwrap<VtkInteractorStyleSwitchBaseWrap>(info.Holder());\n\tvtkInteractorStyleSwitchBase *native = (vtkInteractorStyleSwitchBase *)wrapper->native.GetPointer();\n\tvtkInteractorStyleSwitchBase * r;\n\tif(info.Length() != 0)\n\t{\n\t\tNan::ThrowError(\"Too many parameters.\");\n\t\treturn;\n\t}\n\tr = native->NewInstance();\n\tVtkInteractorStyleSwitchBaseWrap::InitPtpl();\n\tv8::Local<v8::Value> argv[1] =\n\t\t{ Nan::New(vtkNodeJsNoWrap) };\n\tv8::Local<v8::Function> cons =\n\t\tNan::New<v8::FunctionTemplate>(VtkInteractorStyleSwitchBaseWrap::ptpl)->GetFunction();\n\tv8::Local<v8::Object> wo = cons->NewInstance(1, argv);\n\tVtkInteractorStyleSwitchBaseWrap *w = new VtkInteractorStyleSwitchBaseWrap();\n\tw->native = r;\n\tw->Wrap(wo);\n\tinfo.GetReturnValue().Set(wo);\n}\n\nvoid VtkInteractorStyleSwitchBaseWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info)\n{\n\tVtkInteractorStyleSwitchBaseWrap *wrapper = ObjectWrap::Unwrap<VtkInteractorStyleSwitchBaseWrap>(info.Holder());\n\tvtkInteractorStyleSwitchBase *native = (vtkInteractorStyleSwitchBase *)wrapper->native.GetPointer();\n\tif(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectBaseWrap::ptpl))->HasInstance(info[0]))\n\t{\n\t\tVtkObjectBaseWrap *a0 = ObjectWrap::Unwrap<VtkObjectBaseWrap>(info[0]->ToObject());\n\t\tvtkInteractorStyleSwitchBase * r;\n\t\tif(info.Length() != 1)\n\t\t{\n\t\t\tNan::ThrowError(\"Too many parameters.\");\n\t\t\treturn;\n\t\t}\n\t\tr = native->SafeDownCast(\n\t\t\t(vtkObjectBase *) a0->native.GetPointer()\n\t\t);\n\t\tVtkInteractorStyleSwitchBaseWrap::InitPtpl();\n\t\tv8::Local<v8::Value> argv[1] =\n\t\t\t{ Nan::New(vtkNodeJsNoWrap) };\n\t\tv8::Local<v8::Function> cons =\n\t\t\tNan::New<v8::FunctionTemplate>(VtkInteractorStyleSwitchBaseWrap::ptpl)->GetFunction();\n\t\tv8::Local<v8::Object> wo = cons->NewInstance(1, argv);\n\t\tVtkInteractorStyleSwitchBaseWrap *w = new VtkInteractorStyleSwitchBaseWrap();\n\t\tw->native = r;\n\t\tw->Wrap(wo);\n\t\tinfo.GetReturnValue().Set(wo);\n\t\treturn;\n\t}\n\tNan::ThrowError(\"Parameter mismatch\");\n}\n\n", "meta": {"content_hash": "db6ea02455b20b2e030aa0814f3a9bfd", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 121, "avg_line_length": 34.839285714285715, "alnum_prop": 0.7602938663933025, "repo_name": "axkibe/node-vtk", "id": "aaddcc5a42c3ccb35bc437ac72788797d460bd5a", "size": "5853", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wrappers/8.1.1/vtkInteractorStyleSwitchBaseWrap.cc", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C++", "bytes": "75388342"}, {"name": "CMake", "bytes": "915"}, {"name": "JavaScript", "bytes": "70"}, {"name": "Roff", "bytes": "145455"}]}} +{"text": "package org.hisp.dhis.mock.batchhandler;\n\n\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.HashSet;\nimport java.util.List;\n\nimport org.amplecode.quick.BatchHandler;\nimport org.amplecode.quick.JdbcConfiguration;\n\n/**\n * @author Lars Helge Overland\n */\npublic class MockBatchHandler<T>\n implements BatchHandler<T>\n{\n private List<T> inserts = new ArrayList<>();\n private List<T> updates = new ArrayList<>();\n private List<T> deletes = new ArrayList<>();\n \n @Override\n public BatchHandler<T> init()\n {\n return this;\n }\n\n @Override\n public JdbcConfiguration getConfiguration()\n {\n return null;\n }\n\n @Override\n public BatchHandler<T> setTableName( String name )\n {\n return this;\n }\n\n @Override\n public boolean addObject( T object )\n {\n return inserts.add( object );\n }\n\n @Override\n public int insertObject( T object, boolean returnGeneratedIdentifier )\n {\n inserts.add( object );\n return 0;\n }\n\n @Override\n public void updateObject( T object )\n {\n updates.add( object ); \n }\n\n @Override\n public void deleteObject( T object )\n {\n deletes.add( object ); \n }\n\n @Override\n public boolean objectExists( T object )\n {\n return false;\n }\n\n @Override\n public int getObjectIdentifier( Object object )\n {\n return 0;\n }\n\n @Override\n public Collection<Integer> flush()\n {\n return new HashSet<>();\n }\n\n public List<T> getInserts()\n {\n return inserts;\n }\n\n public List<T> getUpdates()\n {\n return updates;\n }\n\n public List<T> getDeletes()\n {\n return deletes;\n }\n}\n", "meta": {"content_hash": "5f3f68d280b8bdeb222ff64bf20fe0c0", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 74, "avg_line_length": 17.79591836734694, "alnum_prop": 0.5934633027522935, "repo_name": "kakada/dhis2", "id": "9f17eb995a46e8f5be7ce85c50a09ec839035075", "size": "3300", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/mock/batchhandler/MockBatchHandler.java", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "396164"}, {"name": "Game Maker Language", "bytes": "20893"}, {"name": "HTML", "bytes": "340997"}, {"name": "Java", "bytes": "18116166"}, {"name": "JavaScript", "bytes": "7103857"}, {"name": "Ruby", "bytes": "1011"}, {"name": "Shell", "bytes": "376"}, {"name": "XSLT", "bytes": "24103"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sem:triples xmlns:sem=\"http://marklogic.com/semantics\">\n <sem:triple>\n <sem:subject>http://www.lds.org/concept/cpg/faith-in-the-lord-jesus-christ</sem:subject>\n <sem:predicate>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</sem:predicate>\n <sem:object datatype=\"sem:iri\">http://www.w3.org/2004/02/skos/core#Concept</sem:object>\n </sem:triple>\n <sem:triple>\n <sem:subject>http://www.lds.org/concept/cpg/faith-in-the-lord-jesus-christ</sem:subject>\n <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>\n <sem:object datatype=\"sem:iri\">http://www.lds.org/concept-scheme/curriculum-planning-guide</sem:object>\n </sem:triple>\n <sem:triple>\n <sem:subject>http://www.lds.org/concept/cpg/faith-in-the-lord-jesus-christ</sem:subject>\n <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>\n <sem:object xml:lang=\"eng\" datatype=\"xsd:string\">Faith in the Lord Jesus Christ</sem:object>\n </sem:triple>\n <sem:triple>\n <sem:subject>http://www.lds.org/concept/cpg/faith-in-the-lord-jesus-christ</sem:subject>\n <sem:predicate>http://www.w3.org/2004/02/skos/core#narrower</sem:predicate>\n <sem:object datatype=\"sem:iri\">http://www.lds.org/concept/cpg/principles-ordinances-and-covenants-of-the-gospel</sem:object>\n </sem:triple>\n <sem:triple>\n <sem:subject>http://www.lds.org/concept/cpg/faith-in-the-lord-jesus-christ</sem:subject>\n <sem:predicate>http://www.lds.org/core#relCount</sem:predicate>\n <sem:object datatype=\"xsd:integer\">1</sem:object>\n </sem:triple>\n</sem:triples>\n", "meta": {"content_hash": "854ece2ef8213be1103c14efb3eb0781", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 128, "avg_line_length": 57.25, "alnum_prop": 0.7117903930131004, "repo_name": "freshie/ml-taxonomies", "id": "b724cc22dd0510d70bcab0e2075d691a0e8162e9", "size": "1603", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "roxy/data/gospel-topical-explorer-v2/taxonomies/doctrine/cpg/faith-in-the-lord-jesus-christ.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "4422"}, {"name": "CSS", "bytes": "38665"}, {"name": "HTML", "bytes": "356"}, {"name": "JavaScript", "bytes": "411651"}, {"name": "Ruby", "bytes": "259121"}, {"name": "Shell", "bytes": "7329"}, {"name": "XQuery", "bytes": "857170"}, {"name": "XSLT", "bytes": "13753"}]}} +{"text": "\n\npackage com.f2prateek.couchpotato.ui.debug;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.View;\nimport android.view.ViewDebug;\nimport com.f2prateek.couchpotato.ui.ActivityHierarchyServer;\nimport java.io.BufferedReader;\nimport java.io.BufferedWriter;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.OutputStream;\nimport java.io.OutputStreamWriter;\nimport java.lang.reflect.Method;\nimport java.net.InetAddress;\nimport java.net.ServerSocket;\nimport java.net.Socket;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map.Entry;\nimport java.util.concurrent.CopyOnWriteArrayList;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.concurrent.locks.ReentrantReadWriteLock;\n\n/**\n * <p>This class can be used to enable the use of HierarchyViewer inside an\n * application. HierarchyViewer is an Android SDK tool that can be used\n * to inspect and debug the user interface of running applications. For\n * security reasons, HierarchyViewer does not work on production builds\n * (for instance phones bought in store.) By using this class, you can\n * make HierarchyViewer work on any device. You must be very careful\n * however to only enable HierarchyViewer when debugging your\n * application.</p>\n *\n * <p>To use this view server, your application must require the INTERNET\n * permission.</p>\n */\npublic class SocketActivityHierarchyServer implements Runnable, ActivityHierarchyServer {\n /**\n * The default port used to start view servers.\n */\n private static final int VIEW_SERVER_DEFAULT_PORT = 4939;\n private static final int VIEW_SERVER_MAX_CONNECTIONS = 10;\n\n private static final String LOG_TAG = \"SocketActivityHierarchyServer\";\n\n private static final String VALUE_PROTOCOL_VERSION = \"4\";\n private static final String VALUE_SERVER_VERSION = \"4\";\n\n // Protocol commands\n // Returns the protocol version\n private static final String COMMAND_PROTOCOL_VERSION = \"PROTOCOL\";\n // Returns the server version\n private static final String COMMAND_SERVER_VERSION = \"SERVER\";\n // Lists all of the available windows in the system\n private static final String COMMAND_WINDOW_MANAGER_LIST = \"LIST\";\n // Keeps a connection open and notifies when the list of windows changes\n private static final String COMMAND_WINDOW_MANAGER_AUTOLIST = \"AUTOLIST\";\n // Returns the focused window\n private static final String COMMAND_WINDOW_MANAGER_GET_FOCUS = \"GET_FOCUS\";\n\n private ServerSocket mServer;\n private final int mPort;\n\n private Thread mThread;\n private ExecutorService mThreadPool;\n\n private final List<WindowListener> mListeners = new CopyOnWriteArrayList<>();\n\n private final HashMap<View, String> mWindows = new HashMap<>();\n private final ReentrantReadWriteLock mWindowsLock = new ReentrantReadWriteLock();\n\n private View mFocusedWindow;\n private final ReentrantReadWriteLock mFocusLock = new ReentrantReadWriteLock();\n\n /**\n * Creates a new ActivityHierarchyServer associated with the specified window manager on the\n * default local port. The server is not started by default.\n *\n * @see #start()\n */\n public SocketActivityHierarchyServer() {\n mPort = SocketActivityHierarchyServer.VIEW_SERVER_DEFAULT_PORT;\n }\n\n /**\n * Starts the server.\n *\n * @return True if the server was successfully created, or false if it already exists.\n * @throws java.io.IOException If the server cannot be created.\n */\n public boolean start() throws IOException {\n if (mThread != null) {\n return false;\n }\n\n mThread = new Thread(this, \"Local View Server [port=\" + mPort + \"]\");\n mThreadPool = Executors.newFixedThreadPool(VIEW_SERVER_MAX_CONNECTIONS);\n mThread.start();\n\n return true;\n }\n\n @Override public void onActivityCreated(Activity activity, Bundle bundle) {\n String name = activity.getTitle().toString();\n if (TextUtils.isEmpty(name)) {\n name = activity.getClass().getCanonicalName() //\n + \"/0x\" + System.identityHashCode(activity);\n } else {\n name += \" (\" + activity.getClass().getCanonicalName() + \")\";\n }\n mWindowsLock.writeLock().lock();\n try {\n mWindows.put(activity.getWindow().getDecorView().getRootView(), name);\n } finally {\n mWindowsLock.writeLock().unlock();\n }\n fireWindowsChangedEvent();\n }\n\n @Override public void onActivityStarted(Activity activity) {\n }\n\n @Override public void onActivityResumed(Activity activity) {\n View view = activity.getWindow().getDecorView();\n mFocusLock.writeLock().lock();\n try {\n mFocusedWindow = view == null ? null : view.getRootView();\n } finally {\n mFocusLock.writeLock().unlock();\n }\n fireFocusChangedEvent();\n }\n\n @Override public void onActivityPaused(Activity activity) {\n }\n\n @Override public void onActivityStopped(Activity activity) {\n }\n\n @Override public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {\n }\n\n @Override public void onActivityDestroyed(Activity activity) {\n mWindowsLock.writeLock().lock();\n try {\n mWindows.remove(activity.getWindow().getDecorView().getRootView());\n } finally {\n mWindowsLock.writeLock().unlock();\n }\n fireWindowsChangedEvent();\n }\n\n public void run() {\n try {\n mServer = new ServerSocket(mPort, VIEW_SERVER_MAX_CONNECTIONS, InetAddress.getLocalHost());\n } catch (Exception e) {\n Log.w(LOG_TAG, \"Starting ServerSocket error: \", e);\n }\n\n while (mServer != null && Thread.currentThread() == mThread) {\n // Any uncaught exception will crash the system process\n try {\n Socket client = mServer.accept();\n if (mThreadPool != null) {\n mThreadPool.submit(new ViewServerWorker(client));\n } else {\n try {\n client.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n } catch (Exception e) {\n Log.w(LOG_TAG, \"Connection error: \", e);\n }\n }\n }\n\n private static boolean writeValue(Socket client, String value) {\n boolean result;\n BufferedWriter out = null;\n try {\n OutputStream clientStream = client.getOutputStream();\n out = new BufferedWriter(new OutputStreamWriter(clientStream), 8 * 1024);\n out.write(value);\n out.write(\"\\n\");\n out.flush();\n result = true;\n } catch (Exception e) {\n result = false;\n } finally {\n if (out != null) {\n try {\n out.close();\n } catch (IOException e) {\n result = false;\n }\n }\n }\n return result;\n }\n\n private void fireWindowsChangedEvent() {\n for (WindowListener listener : mListeners) {\n listener.windowsChanged();\n }\n }\n\n private void fireFocusChangedEvent() {\n for (WindowListener listener : mListeners) {\n listener.focusChanged();\n }\n }\n\n private void addWindowListener(WindowListener listener) {\n if (!mListeners.contains(listener)) {\n mListeners.add(listener);\n }\n }\n\n private void removeWindowListener(WindowListener listener) {\n mListeners.remove(listener);\n }\n\n private interface WindowListener {\n void windowsChanged();\n\n void focusChanged();\n }\n\n private static class UncloseableOutputStream extends OutputStream {\n private final OutputStream mStream;\n\n UncloseableOutputStream(OutputStream stream) {\n mStream = stream;\n }\n\n public void close() throws IOException {\n // Don't close the stream\n }\n\n public boolean equals(Object o) {\n return mStream.equals(o);\n }\n\n public void flush() throws IOException {\n mStream.flush();\n }\n\n public int hashCode() {\n return mStream.hashCode();\n }\n\n public String toString() {\n return mStream.toString();\n }\n\n public void write(byte[] buffer, int offset, int count) throws IOException {\n mStream.write(buffer, offset, count);\n }\n\n public void write(byte[] buffer) throws IOException {\n mStream.write(buffer);\n }\n\n public void write(int oneByte) throws IOException {\n mStream.write(oneByte);\n }\n }\n\n private class ViewServerWorker implements Runnable, WindowListener {\n private Socket mClient;\n private boolean mNeedWindowListUpdate;\n private boolean mNeedFocusedWindowUpdate;\n\n private final Object[] mLock = new Object[0];\n\n public ViewServerWorker(Socket client) {\n mClient = client;\n mNeedWindowListUpdate = false;\n mNeedFocusedWindowUpdate = false;\n }\n\n public void run() {\n BufferedReader in = null;\n try {\n in = new BufferedReader(new InputStreamReader(mClient.getInputStream()), 1024);\n\n final String request = in.readLine();\n\n String command;\n String parameters;\n\n int index = request.indexOf(' ');\n if (index == -1) {\n command = request;\n parameters = \"\";\n } else {\n command = request.substring(0, index);\n parameters = request.substring(index + 1);\n }\n\n boolean result;\n if (COMMAND_PROTOCOL_VERSION.equalsIgnoreCase(command)) {\n result = writeValue(mClient, VALUE_PROTOCOL_VERSION);\n } else if (COMMAND_SERVER_VERSION.equalsIgnoreCase(command)) {\n result = writeValue(mClient, VALUE_SERVER_VERSION);\n } else if (COMMAND_WINDOW_MANAGER_LIST.equalsIgnoreCase(command)) {\n result = listWindows(mClient);\n } else if (COMMAND_WINDOW_MANAGER_GET_FOCUS.equalsIgnoreCase(command)) {\n result = getFocusedWindow(mClient);\n } else if (COMMAND_WINDOW_MANAGER_AUTOLIST.equalsIgnoreCase(command)) {\n result = windowManagerAutolistLoop();\n } else {\n result = windowCommand(mClient, command, parameters);\n }\n\n if (!result) {\n Log.w(LOG_TAG, \"An error occurred with the command: \" + command);\n }\n } catch (IOException e) {\n Log.w(LOG_TAG, \"Connection error: \", e);\n } finally {\n if (in != null) {\n try {\n in.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (mClient != null) {\n try {\n mClient.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }\n\n private boolean windowCommand(Socket client, String command, String parameters) {\n boolean success = true;\n BufferedWriter out = null;\n\n try {\n // Find the hash code of the window\n int index = parameters.indexOf(' ');\n if (index == -1) {\n index = parameters.length();\n }\n final String code = parameters.substring(0, index);\n int hashCode = (int) Long.parseLong(code, 16);\n\n // Extract the command's parameter after the window description\n if (index < parameters.length()) {\n parameters = parameters.substring(index + 1);\n } else {\n parameters = \"\";\n }\n\n final View window = findWindow(hashCode);\n if (window == null) {\n return false;\n }\n\n // call stuff\n final Method dispatch =\n ViewDebug.class.getDeclaredMethod(\"dispatchCommand\", View.class, String.class,\n String.class, OutputStream.class);\n dispatch.setAccessible(true);\n dispatch.invoke(null, window, command, parameters,\n new UncloseableOutputStream(client.getOutputStream()));\n\n if (!client.isOutputShutdown()) {\n out = new BufferedWriter(new OutputStreamWriter(client.getOutputStream()));\n out.write(\"DONE\\n\");\n out.flush();\n }\n } catch (Exception e) {\n Log.w(LOG_TAG, \"Could not send command \" + command //\n + \" with parameters \" + parameters, e);\n success = false;\n } finally {\n if (out != null) {\n try {\n out.close();\n } catch (IOException e) {\n success = false;\n }\n }\n }\n\n return success;\n }\n\n private View findWindow(int hashCode) {\n if (hashCode == -1) {\n View window = null;\n mWindowsLock.readLock().lock();\n try {\n window = mFocusedWindow;\n } finally {\n mWindowsLock.readLock().unlock();\n }\n return window;\n }\n\n mWindowsLock.readLock().lock();\n try {\n for (Entry<View, String> entry : mWindows.entrySet()) {\n if (System.identityHashCode(entry.getKey()) == hashCode) {\n return entry.getKey();\n }\n }\n } finally {\n mWindowsLock.readLock().unlock();\n }\n\n return null;\n }\n\n private boolean listWindows(Socket client) {\n boolean result = true;\n BufferedWriter out = null;\n\n try {\n mWindowsLock.readLock().lock();\n\n OutputStream clientStream = client.getOutputStream();\n out = new BufferedWriter(new OutputStreamWriter(clientStream), 8 * 1024);\n\n for (Entry<View, String> entry : mWindows.entrySet()) {\n out.write(Integer.toHexString(System.identityHashCode(entry.getKey())));\n out.write(' ');\n out.append(entry.getValue());\n out.write('\\n');\n }\n\n out.write(\"DONE.\\n\");\n out.flush();\n } catch (Exception e) {\n result = false;\n } finally {\n mWindowsLock.readLock().unlock();\n\n if (out != null) {\n try {\n out.close();\n } catch (IOException e) {\n result = false;\n }\n }\n }\n\n return result;\n }\n\n private boolean getFocusedWindow(Socket client) {\n boolean result = true;\n String focusName = null;\n\n BufferedWriter out = null;\n try {\n OutputStream clientStream = client.getOutputStream();\n out = new BufferedWriter(new OutputStreamWriter(clientStream), 8 * 1024);\n\n View focusedWindow = null;\n\n mFocusLock.readLock().lock();\n try {\n focusedWindow = mFocusedWindow;\n } finally {\n mFocusLock.readLock().unlock();\n }\n\n if (focusedWindow != null) {\n mWindowsLock.readLock().lock();\n try {\n focusName = mWindows.get(mFocusedWindow);\n } finally {\n mWindowsLock.readLock().unlock();\n }\n\n out.write(Integer.toHexString(System.identityHashCode(focusedWindow)));\n out.write(' ');\n out.append(focusName);\n }\n out.write('\\n');\n out.flush();\n } catch (Exception e) {\n result = false;\n } finally {\n if (out != null) {\n try {\n out.close();\n } catch (IOException e) {\n result = false;\n }\n }\n }\n\n return result;\n }\n\n public void windowsChanged() {\n synchronized (mLock) {\n mNeedWindowListUpdate = true;\n mLock.notifyAll();\n }\n }\n\n public void focusChanged() {\n synchronized (mLock) {\n mNeedFocusedWindowUpdate = true;\n mLock.notifyAll();\n }\n }\n\n private boolean windowManagerAutolistLoop() {\n addWindowListener(this);\n BufferedWriter out = null;\n try {\n out = new BufferedWriter(new OutputStreamWriter(mClient.getOutputStream()));\n while (!Thread.interrupted()) {\n boolean needWindowListUpdate = false;\n boolean needFocusedWindowUpdate = false;\n synchronized (mLock) {\n while (!mNeedWindowListUpdate && !mNeedFocusedWindowUpdate) {\n mLock.wait();\n }\n if (mNeedWindowListUpdate) {\n mNeedWindowListUpdate = false;\n needWindowListUpdate = true;\n }\n if (mNeedFocusedWindowUpdate) {\n mNeedFocusedWindowUpdate = false;\n needFocusedWindowUpdate = true;\n }\n }\n if (needWindowListUpdate) {\n out.write(\"LIST UPDATE\\n\");\n out.flush();\n }\n if (needFocusedWindowUpdate) {\n out.write(\"FOCUS UPDATE\\n\");\n out.flush();\n }\n }\n } catch (Exception e) {\n Log.w(LOG_TAG, \"Connection error: \", e);\n } finally {\n if (out != null) {\n try {\n out.close();\n } catch (IOException e) {\n // Ignore\n }\n }\n removeWindowListener(this);\n }\n return true;\n }\n }\n}\n", "meta": {"content_hash": "5b00cafe7a2acf228acf86c95a9914a0", "timestamp": "", "source": "github", "line_count": 570, "max_line_length": 97, "avg_line_length": 28.887719298245614, "alnum_prop": 0.6141746629418195, "repo_name": "f2prateek/android-couchpotato", "id": "9102ff4757bcec5b781573f21ebdbb1d7a2a25f6", "size": "17066", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "couchpotato/src/debug/java/com/f2prateek/couchpotato/ui/debug/SocketActivityHierarchyServer.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Groovy", "bytes": "5268"}, {"name": "Java", "bytes": "410944"}]}} +{"text": "<!DOCTYPE html>\n<html>\n\n<head>\n <meta charset=\"UTF-8\">\n <title>Bullseye</title>\n <script src=\"https://maps.googleapis.com/maps/api/js?key=AIzaSyByl4gRpPmSXUOYX3SA8n-t_WvvNcEf79A&libraries=places,geometry\"> </script>\n <link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\">\n <link href=\"https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css\" rel=\"stylesheet\">\n <link href=\"https://fonts.googleapis.com/css?family=Nunito\" rel=\"stylesheet\">\n <link href=\"style.css\" rel=\"stylesheet\">\n</head>\n\n<body>\n <div id=\"app\"></div>\n</body>\n\n<script src=\"https://code.jquery.com/jquery-2.1.1.min.js\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/js/materialize.min.js\"></script>\n<script src=\"bundle.js\" defer></script>\n\n</html>\n", "meta": {"content_hash": "67845dbc237d11c49701ae52a109b1f3", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 136, "avg_line_length": 37.04545454545455, "alnum_prop": 0.7165644171779141, "repo_name": "Bullseyed/Bullseye", "id": "fe6188aaeb536e17731d55fa310190ced5444117", "size": "815", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/index.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1366"}, {"name": "HTML", "bytes": "815"}, {"name": "JavaScript", "bytes": "3439188"}]}} +{"text": "use inventory_vector::InventoryVector;\nuse {Encode, VarInt};\n\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn it_implements_types_required_for_protocol() {\n let m = InvMessage::default();\n assert_eq!(m.name(), \"inv\");\n assert_eq!(m.len(), 8);\n }\n}\n#[derive(Debug, Default, Encode, PartialEq)]\npub struct InvMessage {\n #[count]\n pub inventory: Vec<InventoryVector>,\n}\n\nimpl InvMessage {\n #[inline]\n pub fn len(&self) -> usize {\n 8 + (36 * self.inventory.len())\n }\n\n #[inline]\n pub fn name(&self) -> &'static str {\n \"inv\"\n }\n}\n", "meta": {"content_hash": "80e9e3cb1651aaa8d3aa8a6fb8cae947", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 52, "avg_line_length": 19.451612903225808, "alnum_prop": 0.5588723051409619, "repo_name": "tomasvdw/bitcrust", "id": "3440feedd275c1f3e4ec4b23a3f3e34ef4ae4df9", "size": "603", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "net/src/message/inv_message.rs", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "10080"}, {"name": "HTML", "bytes": "28242"}, {"name": "JavaScript", "bytes": "863"}, {"name": "Python", "bytes": "3826"}, {"name": "Rust", "bytes": "794393"}, {"name": "Shell", "bytes": "3988"}]}} +{"text": "/* DO NOT EDIT THIS FILE - it is machine generated */\n#include <jni.h>\n/* Header for class mil_navy_nrl_norm_NormStream */\n\n#ifndef _Included_mil_navy_nrl_norm_NormStream\n#define _Included_mil_navy_nrl_norm_NormStream\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n/*\n * Class: mil_navy_nrl_norm_NormStream\n * Method: close\n * Signature: (Z)V\n */\nJNIEXPORT void JNICALL Java_mil_navy_nrl_norm_NormStream_close\n (JNIEnv *, jobject, jboolean);\n\n/*\n * Class: mil_navy_nrl_norm_NormStream\n * Method: write\n * Signature: ([BII)I\n */\nJNIEXPORT jint JNICALL Java_mil_navy_nrl_norm_NormStream_write\n (JNIEnv *, jobject, jbyteArray, jint, jint);\n\n/*\n * Class: mil_navy_nrl_norm_NormStream\n * Method: flush\n * Signature: (ZLmil/navy/nrl/norm/enums/NormFlushMode;)V\n */\nJNIEXPORT void JNICALL Java_mil_navy_nrl_norm_NormStream_flush\n (JNIEnv *, jobject, jboolean, jobject);\n\n/*\n * Class: mil_navy_nrl_norm_NormStream\n * Method: setAutoFlush\n * Signature: (Lmil/navy/nrl/norm/enums/NormFlushMode;)V\n */\nJNIEXPORT void JNICALL Java_mil_navy_nrl_norm_NormStream_setAutoFlush\n (JNIEnv *, jobject, jobject);\n\n/*\n * Class: mil_navy_nrl_norm_NormStream\n * Method: setPushEnable\n * Signature: (Z)V\n */\nJNIEXPORT void JNICALL Java_mil_navy_nrl_norm_NormStream_setPushEnable\n (JNIEnv *, jobject, jboolean);\n\n/*\n * Class: mil_navy_nrl_norm_NormStream\n * Method: hasVacancy\n * Signature: ()Z\n */\nJNIEXPORT jboolean JNICALL Java_mil_navy_nrl_norm_NormStream_hasVacancy\n (JNIEnv *, jobject);\n\n/*\n * Class: mil_navy_nrl_norm_NormStream\n * Method: markEom\n * Signature: ()V\n */\nJNIEXPORT void JNICALL Java_mil_navy_nrl_norm_NormStream_markEom\n (JNIEnv *, jobject);\n\n/*\n * Class: mil_navy_nrl_norm_NormStream\n * Method: read\n * Signature: ([BII)I\n */\nJNIEXPORT jint JNICALL Java_mil_navy_nrl_norm_NormStream_read\n (JNIEnv *, jobject, jbyteArray, jint, jint);\n\n/*\n * Class: mil_navy_nrl_norm_NormStream\n * Method: seekMsgStart\n * Signature: ()Z\n */\nJNIEXPORT jboolean JNICALL Java_mil_navy_nrl_norm_NormStream_seekMsgStart\n (JNIEnv *, jobject);\n\n/*\n * Class: mil_navy_nrl_norm_NormStream\n * Method: getReadOffset\n * Signature: ()J\n */\nJNIEXPORT jlong JNICALL Java_mil_navy_nrl_norm_NormStream_getReadOffset\n (JNIEnv *, jobject);\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n", "meta": {"content_hash": "1addd502f472cbbc1629ea93dac56bfa", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 73, "avg_line_length": 24.817204301075268, "alnum_prop": 0.6941074523396881, "repo_name": "aletheia7/norm", "id": "48696f4aa48fe6229b83dd4a6a9531124691cd7f", "size": "2308", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "norm/src/java/jni/normStreamJni.h", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Go", "bytes": "70061"}]}} +{"text": "<!DOCTYPE html>\n<!--\n | Generated by Apache Maven Doxia at 2016-07-27 \n | Rendered using Apache Maven Fluido Skin 1.4\n-->\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta name=\"Date-Revision-yyyymmdd\" content=\"20160727\" />\n <meta http-equiv=\"Content-Language\" content=\"en\" />\n <title>PMD JavaScript – Surefire Report</title>\n <link rel=\"stylesheet\" href=\"./css/apache-maven-fluido-1.4.min.css\" />\n <link rel=\"stylesheet\" href=\"./css/site.css\" />\n <link rel=\"stylesheet\" href=\"./css/print.css\" media=\"print\" />\n\n \n <script type=\"text/javascript\" src=\"./js/apache-maven-fluido-1.4.min.js\"></script>\n\n \n </head>\n <body class=\"topBarEnabled\">\n \n \n \n \n \n \n <a href=\"https://github.com/pmd/pmd\">\n <img style=\"position: absolute; top: 0; right: 0; border: 0; z-index: 10000;\"\n src=\"https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png\"\n alt=\"Fork me on GitHub\">\n </a>\n \n \n \n \n\n <div id=\"topbar\" class=\"navbar navbar-fixed-top \">\n <div class=\"navbar-inner\">\n <div class=\"container-fluid\">\n <a data-target=\".nav-collapse\" data-toggle=\"collapse\" class=\"btn btn-navbar\">\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </a>\n \n <a class=\"brand\" href=\"index.html\" title=\"PMD\">\n\n \n <img src=\"images/logo/pmd_logo_tiny.png\" alt=\"PMD\" />\n \n </a>\n \n <ul class=\"nav\">\n <li class=\"dropdown\">\n <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Parent Project <b class=\"caret\"></b></a>\n <ul class=\"dropdown-menu\">\n \n <li> <a href=\"../index.html\" title=\"PMD\">PMD</a>\n</li>\n </ul>\n </li>\n <li class=\"dropdown\">\n <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Rule Sets <b class=\"caret\"></b></a>\n <ul class=\"dropdown-menu\">\n \n <li class=\"dropdown-submenu\">\n <a href=\"rules/index.html\" title=\"ecmascript\">ecmascript</a>\n <ul class=\"dropdown-menu\">\n <li> <a href=\"rules/ecmascript/basic.html\" title=\"Basic Ecmascript\">Basic Ecmascript</a>\n</li>\n <li> <a href=\"rules/ecmascript/braces.html\" title=\"Braces\">Braces</a>\n</li>\n <li> <a href=\"rules/ecmascript/controversial.html\" title=\"Controversial Ecmascript\">Controversial Ecmascript</a>\n</li>\n <li> <a href=\"rules/ecmascript/unnecessary.html\" title=\"Unnecessary\">Unnecessary</a>\n</li>\n </ul>\n </li>\n </ul>\n </li>\n <li class=\"dropdown\">\n <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">Project Documentation <b class=\"caret\"></b></a>\n <ul class=\"dropdown-menu\">\n \n <li class=\"dropdown-submenu\">\n <a href=\"project-info.html\" title=\"Project Information\">Project Information</a>\n <ul class=\"dropdown-menu\">\n <li> <a href=\"project-summary.html\" title=\"Project Summary\">Project Summary</a>\n</li>\n <li> <a href=\"dependencies.html\" title=\"Dependencies\">Dependencies</a>\n</li>\n <li> <a href=\"dependency-convergence.html\" title=\"Dependency Convergence\">Dependency Convergence</a>\n</li>\n <li> <a href=\"dependency-info.html\" title=\"Dependency Information\">Dependency Information</a>\n</li>\n <li> <a href=\"dependency-management.html\" title=\"Dependency Management\">Dependency Management</a>\n</li>\n <li> <a href=\"plugin-management.html\" title=\"Plugin Management\">Plugin Management</a>\n</li>\n <li> <a href=\"plugins.html\" title=\"Project Plugins\">Project Plugins</a>\n</li>\n <li> <a href=\"team-list.html\" title=\"Project Team\">Project Team</a>\n</li>\n <li> <a href=\"mail-lists.html\" title=\"Mailing Lists\">Mailing Lists</a>\n</li>\n <li> <a href=\"integration.html\" title=\"Continuous Integration\">Continuous Integration</a>\n</li>\n <li> <a href=\"issue-tracking.html\" title=\"Issue Tracking\">Issue Tracking</a>\n</li>\n <li> <a href=\"license.html\" title=\"Project License\">Project License</a>\n</li>\n <li> <a href=\"source-repository.html\" title=\"Source Repository\">Source Repository</a>\n</li>\n </ul>\n </li>\n \n <li class=\"dropdown-submenu\">\n <a href=\"project-reports.html\" title=\"Project Reports\">Project Reports</a>\n <ul class=\"dropdown-menu\">\n <li> <a href=\"xref/index.html\" title=\"Source Xref\">Source Xref</a>\n</li>\n <li> <a href=\"xref-test/index.html\" title=\"Test Source Xref\">Test Source Xref</a>\n</li>\n <li> <a href=\"apidocs/index.html\" title=\"JavaDocs\">JavaDocs</a>\n</li>\n <li> <a href=\"testapidocs/index.html\" title=\"Test JavaDocs\">Test JavaDocs</a>\n</li>\n <li> <a href=\"cpd.html\" title=\"CPD\">CPD</a>\n</li>\n <li> <a href=\"checkstyle.html\" title=\"Checkstyle\">Checkstyle</a>\n</li>\n <li> <a href=\"surefire-report.html\" title=\"Surefire Report\">Surefire Report</a>\n</li>\n <li> <a href=\"jacoco/index.html\" title=\"JaCoCo Test\">JaCoCo Test</a>\n</li>\n <li> <a href=\"dependency-updates-report.html\" title=\"Dependency Updates Report\">Dependency Updates Report</a>\n</li>\n <li> <a href=\"plugin-updates-report.html\" title=\"Plugin Updates Report\">Plugin Updates Report</a>\n</li>\n <li> <a href=\"property-updates-report.html\" title=\"Property Updates Report\">Property Updates Report</a>\n</li>\n </ul>\n </li>\n </ul>\n </li>\n </ul>\n \n \n \n <ul class=\"nav pull-right\">\n <li class=\"dropdown\">\n <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">External Links <b class=\"caret\"></b></a>\n <ul class=\"dropdown-menu\">\n <li> <a href=\"http://sourceforge.net/projects/pmd\" title=\"SourceForge.net Project Page\">SourceForge.net Project Page</a>\n</li>\n <li> <a href=\"http://sourceforge.net\" title=\"Hosted by SourceForge\">Hosted by SourceForge</a>\n</li>\n </ul>\n </li>\n </ul>\n \n </div>\n \n </div>\n </div>\n </div>\n \n <div class=\"container-fluid\">\n <div id=\"banner\">\n <div class=\"pull-left\">\n <a href=\"../\" id=\"bannerLeft\">\n <img src=\"../images/logo/pmd_logo_small.png\" alt=\"pmd-logo\"/>\n </a>\n </div>\n <div class=\"pull-right\"> <a href=\"http://sourceforge.net/\" id=\"bannerRight\">\n <img src=\"../images/sflogo.png\" alt=\"SourceForge\"/>\n </a>\n </div>\n <div class=\"clear\"><hr/></div>\n </div>\n\n <div id=\"breadcrumbs\">\n <ul class=\"breadcrumb\">\n \n \n <li id=\"publishDate\">Last Published: 2016-07-27\n <span class=\"divider\">|</span>\n </li>\n <li id=\"projectVersion\">Version: 5.5.1\n <span class=\"divider\">|</span>\n </li>\n <li class=\"\">\n <a href=\"http://www.sourceforge.net/\" class=\"externalLink\" title=\"SourceForge\">\n SourceForge</a>\n <span class=\"divider\">/</span>\n </li>\n <li class=\"\">\n <a href=\"../\" title=\"PMD\">\n PMD</a>\n <span class=\"divider\">/</span>\n </li>\n <li class=\"\">\n <a href=\"./\" title=\"PMD JavaScript\">\n PMD JavaScript</a>\n <span class=\"divider\">/</span>\n </li>\n <li class=\"active \">Surefire Report</li>\n \n \n \n \n </ul>\n </div>\n\n \n <div class=\"row-fluid\">\n <div id=\"leftColumn\" class=\"span2\">\n <div class=\"well sidebar-nav\">\n \n \n <ul class=\"nav nav-list\">\n <li class=\"nav-header\">Parent Project</li>\n \n <li>\n \n <a href=\"../index.html\" title=\"PMD\">\n <span class=\"none\"></span>\n PMD</a>\n </li>\n <li class=\"nav-header\">Rule Sets</li>\n \n <li>\n \n <a href=\"rules/index.html\" title=\"ecmascript\">\n <span class=\"icon-chevron-down\"></span>\n ecmascript</a>\n <ul class=\"nav nav-list\">\n \n <li>\n \n <a href=\"rules/ecmascript/basic.html\" title=\"Basic Ecmascript\">\n <span class=\"none\"></span>\n Basic Ecmascript</a>\n </li>\n \n <li>\n \n <a href=\"rules/ecmascript/braces.html\" title=\"Braces\">\n <span class=\"none\"></span>\n Braces</a>\n </li>\n \n <li>\n \n <a href=\"rules/ecmascript/controversial.html\" title=\"Controversial Ecmascript\">\n <span class=\"none\"></span>\n Controversial Ecmascript</a>\n </li>\n \n <li>\n \n <a href=\"rules/ecmascript/unnecessary.html\" title=\"Unnecessary\">\n <span class=\"none\"></span>\n Unnecessary</a>\n </li>\n </ul>\n </li>\n <li class=\"nav-header\">Project Documentation</li>\n \n <li>\n \n <a href=\"project-info.html\" title=\"Project Information\">\n <span class=\"icon-chevron-right\"></span>\n Project Information</a>\n </li>\n \n <li>\n \n <a href=\"project-reports.html\" title=\"Project Reports\">\n <span class=\"icon-chevron-down\"></span>\n Project Reports</a>\n <ul class=\"nav nav-list\">\n \n <li>\n \n <a href=\"xref/index.html\" title=\"Source Xref\">\n <span class=\"none\"></span>\n Source Xref</a>\n </li>\n \n <li>\n \n <a href=\"xref-test/index.html\" title=\"Test Source Xref\">\n <span class=\"none\"></span>\n Test Source Xref</a>\n </li>\n \n <li>\n \n <a href=\"apidocs/index.html\" title=\"JavaDocs\">\n <span class=\"none\"></span>\n JavaDocs</a>\n </li>\n \n <li>\n \n <a href=\"testapidocs/index.html\" title=\"Test JavaDocs\">\n <span class=\"none\"></span>\n Test JavaDocs</a>\n </li>\n \n <li>\n \n <a href=\"cpd.html\" title=\"CPD\">\n <span class=\"none\"></span>\n CPD</a>\n </li>\n \n <li>\n \n <a href=\"checkstyle.html\" title=\"Checkstyle\">\n <span class=\"none\"></span>\n Checkstyle</a>\n </li>\n \n <li class=\"active\">\n \n <a href=\"#\"><span class=\"none\"></span>Surefire Report</a>\n </li>\n \n <li>\n \n <a href=\"jacoco/index.html\" title=\"JaCoCo Test\">\n <span class=\"none\"></span>\n JaCoCo Test</a>\n </li>\n \n <li>\n \n <a href=\"dependency-updates-report.html\" title=\"Dependency Updates Report\">\n <span class=\"none\"></span>\n Dependency Updates Report</a>\n </li>\n \n <li>\n \n <a href=\"plugin-updates-report.html\" title=\"Plugin Updates Report\">\n <span class=\"none\"></span>\n Plugin Updates Report</a>\n </li>\n \n <li>\n \n <a href=\"property-updates-report.html\" title=\"Property Updates Report\">\n <span class=\"none\"></span>\n Property Updates Report</a>\n </li>\n </ul>\n </li>\n </ul>\n \n \n \n <hr />\n\n <div id=\"poweredBy\">\n <div class=\"clear\"></div>\n <div class=\"clear\"></div>\n <div class=\"clear\"></div>\n <div class=\"clear\"></div>\n <a href=\"http://maven.apache.org/\" title=\"Maven\" class=\"builtBy\">\n <img class=\"builtBy\" alt=\"Built by Maven\" src=\"http://maven.apache.org/images/logos/maven-feather.png\" />\n </a>\n <a href=\"http://sourceforge.net/\" title=\"SourceForge.net\" class=\"builtBy\">\n <img class=\"builtBy\" alt=\"SourceForge.net. Fast, secure and Free Open Source software downloads\" src=\"http://sflogo.sourceforge.net/sflogo.php?group_id=56262&type=10\" width=\"80\" height=\"15\" />\n </a>\n </div>\n </div>\n </div>\n \n \n <div id=\"bodyColumn\" class=\"span10\" >\n \n <script type=\"text/javascript\">\n//<![CDATA[\nfunction toggleDisplay(elementId) {\n var elm = document.getElementById(elementId + 'error');\n if (elm && typeof elm.style != \"undefined\") {\n if (elm.style.display == \"none\") {\n elm.style.display = \"\";\n document.getElementById(elementId + 'off').style.display = \"none\";\n document.getElementById(elementId + 'on').style.display = \"inline\";\n } else if (elm.style.display == \"\") { elm.style.display = \"none\";\n document.getElementById(elementId + 'off').style.display = \"inline\";\n document.getElementById(elementId + 'on').style.display = \"none\";\n } \n } \n }\n//]]>\n</script>\n<div class=\"section\">\n<h2><a name=\"Surefire_Report\"></a>Surefire Report</h2></div>\n<div class=\"section\">\n<h2><a name=\"Summary\"></a>Summary</h2><a name=\"Summary\"></a>\n<p>[<a href=\"#Summary\">Summary</a>] [<a href=\"#Package_List\">Package List</a>] [<a href=\"#Test_Cases\">Test Cases</a>]</p><br />\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td>135</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>3.283</td></tr></table><br />\n<p>Note: failures are anticipated and checked for with assertions while errors are unanticipated.</p><br /></div>\n<div class=\"section\">\n<h2><a name=\"Package_List\"></a>Package List</h2><a name=\"Package_List\"></a>\n<p>[<a href=\"#Summary\">Summary</a>] [<a href=\"#Package_List\">Package List</a>] [<a href=\"#Test_Cases\">Test Cases</a>]</p><br />\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th>Package</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.braces\">net.sourceforge.pmd.lang.ecmascript.rule.braces</a></td>\n<td>21</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.045</td></tr>\n<tr class=\"a\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.basic\">net.sourceforge.pmd.lang.ecmascript.rule.basic</a></td>\n<td>54</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.486</td></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.ast\">net.sourceforge.pmd.lang.ecmascript.ast</a></td>\n<td>14</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.076</td></tr>\n<tr class=\"a\">\n<td><a href=\"#net.sourceforge.pmd.ant\">net.sourceforge.pmd.ant</a></td>\n<td>1</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>1.142</td></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.cpd\">net.sourceforge.pmd.cpd</a></td>\n<td>7</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.146</td></tr>\n<tr class=\"a\">\n<td><a href=\"#net.sourceforge.pmd\">net.sourceforge.pmd</a></td>\n<td>8</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>1.035</td></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.unnecessary\">net.sourceforge.pmd.lang.ecmascript.rule.unnecessary</a></td>\n<td>24</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.156</td></tr>\n<tr class=\"a\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.controversial\">net.sourceforge.pmd.lang.ecmascript.rule.controversial</a></td>\n<td>1</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.002</td></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript\">net.sourceforge.pmd.lang.ecmascript</a></td>\n<td>4</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.002</td></tr>\n<tr class=\"a\">\n<td><a href=\"#net.sourceforge.pmd.cli\">net.sourceforge.pmd.cli</a></td>\n<td>1</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.193</td></tr></table><br />\n<p>Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.</p>\n<div class=\"section\">\n<h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.braces\"></a>net.sourceforge.pmd.lang.ecmascript.rule.braces</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.braces\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th></th>\n<th>Class</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.bracesBracesRulesTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.bracesBracesRulesTest\">BracesRulesTest</a></td>\n<td>21</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.045</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.basic\"></a>net.sourceforge.pmd.lang.ecmascript.rule.basic</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.basic\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th></th>\n<th>Class</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.basicBasicRulesTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.basicBasicRulesTest\">BasicRulesTest</a></td>\n<td>54</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.486</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"net.sourceforge.pmd.lang.ecmascript.ast\"></a>net.sourceforge.pmd.lang.ecmascript.ast</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.ast\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th></th>\n<th>Class</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.astEcmascriptParserTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.astEcmascriptParserTest\">EcmascriptParserTest</a></td>\n<td>8</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.044</td></tr>\n<tr class=\"a\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.astASTFunctionNodeTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.astASTFunctionNodeTest\">ASTFunctionNodeTest</a></td>\n<td>2</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.019</td></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.astASTTryStatementTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.astASTTryStatementTest\">ASTTryStatementTest</a></td>\n<td>4</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.013</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"net.sourceforge.pmd.ant\"></a>net.sourceforge.pmd.ant</h3><a name=\"net.sourceforge.pmd.ant\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th></th>\n<th>Class</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.antPMDTaskTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.antPMDTaskTest\">PMDTaskTest</a></td>\n<td>1</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>1.142</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"net.sourceforge.pmd.cpd\"></a>net.sourceforge.pmd.cpd</h3><a name=\"net.sourceforge.pmd.cpd\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th></th>\n<th>Class</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.cpdEcmascriptTokenizerTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.cpdEcmascriptTokenizerTest\">EcmascriptTokenizerTest</a></td>\n<td>5</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.053</td></tr>\n<tr class=\"a\">\n<td><a href=\"#net.sourceforge.pmd.cpdCPDCommandLineInterfaceTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.cpdCPDCommandLineInterfaceTest\">CPDCommandLineInterfaceTest</a></td>\n<td>2</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.093</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"net.sourceforge.pmd\"></a>net.sourceforge.pmd</h3><a name=\"net.sourceforge.pmd\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th></th>\n<th>Class</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmdReportTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmdReportTest\">ReportTest</a></td>\n<td>1</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.418</td></tr>\n<tr class=\"a\">\n<td><a href=\"#net.sourceforge.pmdLanguageVersionTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmdLanguageVersionTest\">LanguageVersionTest</a></td>\n<td>3</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.012</td></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmdRuleSetFactoryTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmdRuleSetFactoryTest\">RuleSetFactoryTest</a></td>\n<td>4</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.605</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.unnecessary\"></a>net.sourceforge.pmd.lang.ecmascript.rule.unnecessary</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.unnecessary\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th></th>\n<th>Class</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.unnecessaryUnnecessaryRulesTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.unnecessaryUnnecessaryRulesTest\">UnnecessaryRulesTest</a></td>\n<td>24</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.156</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.controversial\"></a>net.sourceforge.pmd.lang.ecmascript.rule.controversial</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.controversial\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th></th>\n<th>Class</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.controversialControversialRulesTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascript.rule.controversialControversialRulesTest\">ControversialRulesTest</a></td>\n<td>1</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.002</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"net.sourceforge.pmd.lang.ecmascript\"></a>net.sourceforge.pmd.lang.ecmascript</h3><a name=\"net.sourceforge.pmd.lang.ecmascript\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th></th>\n<th>Class</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascriptEcmascriptParserOptionsTest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.lang.ecmascriptEcmascriptParserOptionsTest\">EcmascriptParserOptionsTest</a></td>\n<td>4</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.002</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"net.sourceforge.pmd.cli\"></a>net.sourceforge.pmd.cli</h3><a name=\"net.sourceforge.pmd.cli\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<th></th>\n<th>Class</th>\n<th>Tests</th>\n<th>Errors </th>\n<th>Failures</th>\n<th>Skipped</th>\n<th>Success Rate</th>\n<th>Time</th></tr>\n<tr class=\"b\">\n<td><a href=\"#net.sourceforge.pmd.cliCLITest\"><img src=\"images/icon_success_sml.gif\" alt=\"\" /></a></td>\n<td><a href=\"#net.sourceforge.pmd.cliCLITest\">CLITest</a></td>\n<td>1</td>\n<td>0</td>\n<td>0</td>\n<td>0</td>\n<td>100%</td>\n<td>0.193</td></tr></table></div><br /></div>\n<div class=\"section\">\n<h2><a name=\"Test_Cases\"></a>Test Cases</h2><a name=\"Test_Cases\"></a>\n<p>[<a href=\"#Summary\">Summary</a>] [<a href=\"#Package_List\">Package List</a>] [<a href=\"#Test_Cases\">Test Cases</a>]</p>\n<div class=\"section\">\n<h3><a name=\"EcmascriptParserTest\"></a>EcmascriptParserTest</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.astEcmascriptParserTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testCaseAsIdentifier</td>\n<td>0.001</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testXorAssignment</td>\n<td>0.024</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testSuppresionComment</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testArrayAccess</td>\n<td>0.004</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testArrayMethod</td>\n<td>0.004</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testVoidKeyword</td>\n<td>0.001</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testLineNumbers</td>\n<td>0</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testLineNumbersWithinEcmascriptRules</td>\n<td>0.007</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"ASTFunctionNodeTest\"></a>ASTFunctionNodeTest</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.astASTFunctionNodeTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testGetBodyFunctionClosureExpression</td>\n<td>0.019</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testGetBody</td>\n<td>0</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"ReportTest\"></a>ReportTest</h3><a name=\"net.sourceforge.pmdReportTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testExclusionsInReportWithNOPMDEcmascript</td>\n<td>0.418</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"ASTTryStatementTest\"></a>ASTTryStatementTest</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.astASTTryStatementTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testMultipleCatchAndFinallyBlock</td>\n<td>0.006</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testFinallyBlockOnly</td>\n<td>0</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testCatchAndFinallyBlock</td>\n<td>0.005</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testCatchBlockOnly</td>\n<td>0.002</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"ControversialRulesTest\"></a>ControversialRulesTest</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.controversialControversialRulesTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidWithStatement::0 Basic case</td>\n<td>0.002</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"PMDTaskTest\"></a>PMDTaskTest</h3><a name=\"net.sourceforge.pmd.antPMDTaskTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testEcmascript</td>\n<td>1.142</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"CLITest\"></a>CLITest</h3><a name=\"net.sourceforge.pmd.cliCLITest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>useEcmaScript</td>\n<td>0.193</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"EcmascriptTokenizerTest\"></a>EcmascriptTokenizerTest</h3><a name=\"net.sourceforge.pmd.cpdEcmascriptTokenizerTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testIgnoreMultiLineComments</td>\n<td>0.047</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testIgnoreSingleLineComments</td>\n<td>0.001</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>test1</td>\n<td>0.002</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>test2</td>\n<td>0.002</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>parseStringNotAsMultiline</td>\n<td>0.001</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"BracesRulesTest\"></a>BracesRulesTest</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.bracesBracesRulesTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ForLoopsMustUseBraces::0 Ok</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ForLoopsMustUseBraces::1 Ok, for in</td>\n<td>0.004</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ForLoopsMustUseBraces::2 Bad</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ForLoopsMustUseBraces::3 Bad, no increment</td>\n<td>0.002</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ForLoopsMustUseBraces::4 Bad, no condition/increment</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ForLoopsMustUseBraces::5 Bad, no initializer/condition/increment</td>\n<td>0.002</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ForLoopsMustUseBraces::6 Bad, for in</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfElseStmtsMustUseBraces::0 Ok, if/else</td>\n<td>0.003</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfElseStmtsMustUseBraces::1 Ok, if/else if/else</td>\n<td>0</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfElseStmtsMustUseBraces::2 Ok, if without braces</td>\n<td>0</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfElseStmtsMustUseBraces::3 Ok, nest if without braces</td>\n<td>0</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfElseStmtsMustUseBraces::4 Bad, if/else with else missing braces</td>\n<td>0</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfElseStmtsMustUseBraces::5 Bad, if/else with if and else missing braces</td>\n<td>0</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfElseStmtsMustUseBraces::6 Bad, if/else if/else, with else missing braces</td>\n<td>0.001</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfElseStmtsMustUseBraces::7 Bad, if/else if/else, with else if and else missing braces</td>\n<td>0.004</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfElseStmtsMustUseBraces::8 Bad, if/else if/else, with if and else if and else missing braces</td>\n<td>0.003</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfStmtsMustUseBraces::0 Ok</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfStmtsMustUseBraces::1 Bad</td>\n<td>0.003</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>IfStmtsMustUseBraces::2 Bad, nested</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>WhileLoopsMustUseBraces::0 Ok, with braces</td>\n<td>0.003</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>WhileLoopsMustUseBraces::1 no braces</td>\n<td>0.002</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"LanguageVersionTest\"></a>LanguageVersionTest</h3><a name=\"net.sourceforge.pmdLanguageVersionTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testRegisteredRulesets[0]</td>\n<td>0.011</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testFindVersionsForLanguageNameAndVersion[0]</td>\n<td>0.001</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testGetLanguageVersionForTerseName[0]</td>\n<td>0</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"EcmascriptParserOptionsTest\"></a>EcmascriptParserOptionsTest</h3><a name=\"net.sourceforge.pmd.lang.ecmascriptEcmascriptParserOptionsTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testEqualsHashcode</td>\n<td>0.002</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testDefaults</td>\n<td>0</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testSetters</td>\n<td>0</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testConstructor</td>\n<td>0</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"UnnecessaryRulesTest\"></a>UnnecessaryRulesTest</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.unnecessaryUnnecessaryRulesTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>NoElseReturn::0 Simple violation</td>\n<td>0.018</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>NoElseReturn::1 Simple fix</td>\n<td>0.006</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>NoElseReturn::2 No return in if</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::0 Ok, function</td>\n<td>0.003</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::1 Ok, if</td>\n<td>0.005</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::2 Ok, for</td>\n<td>0.009</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::3 Ok, for in</td>\n<td>0.01</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::4 Ok, while</td>\n<td>0.004</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::5 Ok, do while</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::6 Ok, switch</td>\n<td>0.003</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::7 Ok, try</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::8 Bad, global</td>\n<td>0.002</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::9 Bad, function</td>\n<td>0.003</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::10 Bad, if</td>\n<td>0.003</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::11 Bad, for</td>\n<td>0.005</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::12 Bad, for in</td>\n<td>0.003</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::13 Bad, while</td>\n<td>0.008</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::14 Bad, do while</td>\n<td>0.017</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::15 Bad, switch</td>\n<td>0.008</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryBlock::16 Bad, try</td>\n<td>0.01</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryParentheses::0 Ok, simple</td>\n<td>0.002</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryParentheses::1 Bad, simple</td>\n<td>0.004</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryParentheses::2 Ok, complex</td>\n<td>0.002</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnnecessaryParentheses::3 Bad, complex</td>\n<td>0.022</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"RuleSetFactoryTest\"></a>RuleSetFactoryTest</h3><a name=\"net.sourceforge.pmdRuleSetFactoryTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testDtd</td>\n<td>0.055</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testXmlSchema</td>\n<td>0.04</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testReadWriteRoundTrip</td>\n<td>0.501</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>testAllPMDBuiltInRulesMeetConventions</td>\n<td>0.009</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"BasicRulesTest\"></a>BasicRulesTest</h3><a name=\"net.sourceforge.pmd.lang.ecmascript.rule.basicBasicRulesTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AssignmentInOperand::0 Ok, all cases</td>\n<td>0.037</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AssignmentInOperand::1 Bad, assignment, all cases</td>\n<td>0.016</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AssignmentInOperand::2 Ok, allow assignment, if</td>\n<td>0.029</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AssignmentInOperand::3 Ok, allow assignment, while</td>\n<td>0.019</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AssignmentInOperand::4 Ok, allow assignment, do</td>\n<td>0.032</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AssignmentInOperand::5 Ok, allow assignment, for</td>\n<td>0</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AssignmentInOperand::6 Ok, allow assignment, ternary</td>\n<td>0.013</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AssignmentInOperand::7 Ok, allow assignment, ternary results</td>\n<td>0.03</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AssignmentInOperand::8 Bad, increment/decrement, all cases</td>\n<td>0</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AssignmentInOperand::9 Ok, allow increment/decrement, all cases</td>\n<td>0.017</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidTrailingComma::0 Ok, object literals</td>\n<td>0.008</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidTrailingComma::1 Bad, object literals</td>\n<td>0.016</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidTrailingComma::2 Bad, object literals, multi-line nested</td>\n<td>0</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidTrailingComma::3 Bad, object literals, compressed nested</td>\n<td>0.009</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidTrailingComma::4 Ok, allow object literals</td>\n<td>0.006</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidTrailingComma::5 Ok, array literals</td>\n<td>0.007</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidTrailingComma::6 Bad, array literals</td>\n<td>0.006</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidTrailingComma::7 Bad, array literals, multi-line nested</td>\n<td>0.006</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidTrailingComma::8 Bad, array literals, compressed nested</td>\n<td>0.009</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>AvoidTrailingComma::9 Ok, allow array literals</td>\n<td>0.007</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ConsistentReturn::0 Ok, no return</td>\n<td>0.005</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ConsistentReturn::1 Ok, 1 return w/ result</td>\n<td>0.013</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ConsistentReturn::2 Ok, 1 return w/o result</td>\n<td>0.005</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ConsistentReturn::3 Ok, nested function with different return result</td>\n<td>0.004</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ConsistentReturn::4 Bad, mixed result</td>\n<td>0.004</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ConsistentReturn::5 Bad, mixed result with nested function</td>\n<td>0.005</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>EqualComparison::0 Ok, all cases</td>\n<td>0.005</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>EqualComparison::1 Bad, all cases</td>\n<td>0.007</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>GlobalVariable::0 Ok, all cases</td>\n<td>0.005</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>GlobalVariable::1 Bad, all cases</td>\n<td>0.005</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>InnaccurateNumericLiteral::0 Ok integer</td>\n<td>0.007</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>InnaccurateNumericLiteral::1 Bad integer</td>\n<td>0.005</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>InnaccurateNumericLiteral::2 Ok float</td>\n<td>0.006</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>InnaccurateNumericLiteral::3 Bad float</td>\n<td>0.006</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>InnaccurateNumericLiteral::4 Ok float w/ exponent</td>\n<td>0.005</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>InnaccurateNumericLiteral::5 Bad float w/ exponent</td>\n<td>0.006</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ScopeForInVariable::0 Ok, global scope</td>\n<td>0.006</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ScopeForInVariable::1 Ok, function scope</td>\n<td>0.006</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ScopeForInVariable::2 Ok, nested function</td>\n<td>0.005</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ScopeForInVariable::3 Bad, global scope</td>\n<td>0.005</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ScopeForInVariable::4 Bad, function scope</td>\n<td>0.029</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>ScopeForInVariable::5 Bad, nested function</td>\n<td>0.004</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnreachableCode::0 Ok, return</td>\n<td>0.006</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnreachableCode::1 Ok, loop continue</td>\n<td>0.009</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnreachableCode::2 Ok, loop break;</td>\n<td>0.004</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnreachableCode::3 Ok, switch break</td>\n<td>0.004</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnreachableCode::4 Ok, throw</td>\n<td>0.014</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnreachableCode::5 Bad, return</td>\n<td>0.008</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnreachableCode::6 Bad, loop continue</td>\n<td>0.004</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnreachableCode::7 Bad, loop break;</td>\n<td>0.003</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnreachableCode::8 Bad, switch break</td>\n<td>0.006</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UnreachableCode::9 Bad, throw</td>\n<td>0.004</td></tr>\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UseBaseWithParseInt::0 KO, missing the base argument</td>\n<td>0.005</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>UseBaseWithParseInt::1 OK, have the appropriate 'base' parameter</td>\n<td>0.004</td></tr></table></div>\n<div class=\"section\">\n<h3><a name=\"CPDCommandLineInterfaceTest\"></a>CPDCommandLineInterfaceTest</h3><a name=\"net.sourceforge.pmd.cpdCPDCommandLineInterfaceTest\"></a>\n<table border=\"1\" class=\"table table-striped\">\n<tr class=\"a\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>shouldFindNoDuplicatesWithDifferentFileExtensions</td>\n<td>0.057</td></tr>\n<tr class=\"b\">\n<td><img src=\"images/icon_success_sml.gif\" alt=\"\" /></td>\n<td>shouldFindDuplicatesWithDifferentFileExtensions</td>\n<td>0.036</td></tr></table></div><br /></div>\n </div>\n </div>\n </div>\n\n <hr/>\n\n <footer>\n <div class=\"container-fluid\">\n <div class=\"row-fluid\">\n <p >Copyright © 2002–2016\n <a href=\"http://pmd.sourceforge.net/\">InfoEther</a>.\n All rights reserved. \n \n </p>\n </div>\n\n \n </div>\n </footer>\n </body>\n</html>\n", "meta": {"content_hash": "e6cc9c9aa4fbfe613583c966747e6b28", "timestamp": "", "source": "github", "line_count": 1380, "max_line_length": 296, "avg_line_length": 36.86014492753623, "alnum_prop": 0.5743802465252521, "repo_name": "jasonwee/videoOnCloud", "id": "74e739225405585f215633b97da288d5c1f34f06", "size": "50867", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pmd/pmd-doc-5.5.1/pmd-javascript/surefire-report.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "116270"}, {"name": "C", "bytes": "2209717"}, {"name": "C++", "bytes": "375267"}, {"name": "CSS", "bytes": "1134648"}, {"name": "Dockerfile", "bytes": "1656"}, {"name": "HTML", "bytes": "306558398"}, {"name": "Java", "bytes": "1465506"}, {"name": "JavaScript", "bytes": "9028509"}, {"name": "Jupyter Notebook", "bytes": "30907"}, {"name": "Less", "bytes": "107003"}, {"name": "PHP", "bytes": "856"}, {"name": "PowerShell", "bytes": "77807"}, {"name": "Pug", "bytes": "2968"}, {"name": "Python", "bytes": "1001861"}, {"name": "R", "bytes": "7390"}, {"name": "Roff", "bytes": "3553"}, {"name": "Shell", "bytes": "206191"}, {"name": "Thrift", "bytes": "80564"}, {"name": "XSLT", "bytes": "4740"}]}} +{"text": "\n\npackage com.metamolecular.pubcouch.record;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.util.Iterator;\n\n/**\n *\n * @author Richard L. Apodaca <rapodaca at metamolecular.com>\n */\npublic class DefaultRecordStreamer implements RecordStreamer\n{\n private BufferedReader reader;\n private InputStream stream;\n\n public DefaultRecordStreamer(InputStream stream)\n {\n this.stream = stream;\n this.reader = new BufferedReader(new InputStreamReader(stream));\n }\n\n public Iterator<Record> iterator()\n {\n return new RecordIterator();\n }\n\n private class RecordIterator implements Iterator\n {\n public boolean hasNext()\n {\n try\n {\n reader.mark(1);\n if (reader.read() != -1)\n {\n reader.reset();\n return true;\n }\n }\n catch (IOException e)\n {\n throw new RuntimeException(\"Error accessing the underlying datastream.\", e);\n }\n\n return false;\n }\n\n public Object next()\n {\n Record result = null;\n\n try\n {\n result = new Record(reader);\n }\n catch(IOException e)\n {\n throw new RuntimeException(e);\n }\n \n return result;\n }\n\n public void remove()\n {\n throw new UnsupportedOperationException(\"Not supported yet.\");\n }\n }\n}\n", "meta": {"content_hash": "6a29b634d4448de5b97b9f72f3267f95", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 84, "avg_line_length": 18.904109589041095, "alnum_prop": 0.6217391304347826, "repo_name": "metamolecular/pubcouch", "id": "b0459f0c06a73ad575134a388a3057942eef522e", "size": "2582", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/metamolecular/pubcouch/record/DefaultRecordStreamer.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "76494"}, {"name": "JavaScript", "bytes": "796"}]}} +{"text": "package org.leguan.testproject.language.java;\n\nimport java.util.Date;\n\npublic class ClassWithoutConstructor {\n\n public void hello () {\n\n }\n\n\n\n\n\n}\n", "meta": {"content_hash": "ac412fa757712f4e57486cde7bbda793", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 45, "avg_line_length": 9.866666666666667, "alnum_prop": 0.7162162162162162, "repo_name": "moley/leguan", "id": "72bf4c6a632302ef3e7bf1b990b9b1d8738e9659", "size": "148", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "leguan-testprojects/testprojectJava/src/main/java/org/leguan/testproject/language/java/ClassWithoutConstructor.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "20530"}, {"name": "HTML", "bytes": "35444"}, {"name": "Java", "bytes": "2096474"}, {"name": "JavaScript", "bytes": "1240"}, {"name": "Shell", "bytes": "1844"}, {"name": "TypeScript", "bytes": "71940"}]}} +{"text": "var os = require('os'),\n fs = require('fs'),\n sys = require('util'),\n exec = require('child_process').exec;\n\nfunction linux(brightness,callback){\n\t// Enumerate the backlight devices...\n\tfs.readdir('/sys/class/backlight', function(err, brightnessDevices){\n\t\tif(err) {\n\t\t\tconsole.error('Error while listing brightness devices. Maybe you need superuser privileges to run this script?');\n\t\t\tthrow err;\n\t\t}\n\n\t\tvar devicePath = '/sys/class/backlight/' + brightnessDevices[0];\n\t\t//Read the maximum for the first device\n\t\tfs.readFile(devicePath + '/max_brightness', function(err, maxBrightness){\n\t\t\tmaxBrightness = parseInt(maxBrightness, 10)\n\t\t\tif(err) {\n\t\t\t\tconsole.error('Error while reading maximum brightness. Maybe you need superuser privileges to run this script?');\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\t// Turn percent into the actual value we need\n\t\t\tvar brightnessValue = Math.floor(brightness / 100 * maxBrightness);\n\n\t\t\t// Write out new value\n\t\t\tfs.createWriteStream(devicePath + '/brightness')\n\t\t\t\t.on('end', callback)\n\t\t\t\t.write(new Buffer(brightnessValue.toString()));\n\t\t});\n\t})\n}\n\nfunction windows(brightness,callback){\n\n//These are the identifiers for the current power scheme\n\n\tvar GUID;\n\tvar subgroup;\n\tvar powerSetting;\n\n\t// powercfg -q gives information about power settings, but can only give accurate brightness info for laptops or other portable windows devices\n\n\texec('powercfg -q', function(error,stdout,stderr){\n\t\tif(!error){\n\t\t\tvar regExp = /([a-z\\-0-9]+)\\s\\D+$/\n\t\t\tvar splitOutput = stdout.split('\\r\\n');\n\t\t\tGUID = regExp.exec(splitOutput[0])[1];\n\n\t\t\tfor(var i = 0;i<splitOutput.length;i++){\n\t\t\t\tif(splitOutput[i].match(/\\(Display\\)$/)){\n\n\t\t\t\t\t//The subgroup is derived from the output named display\n\n\t\t\t\t\tsubgroup = regExp.exec(splitOutput[i])[1];\n\t\t\t\t}\n\t\t\t\telse if(splitOutput[i].match(/\\(Display\\sbrightness\\)$/)){\n\n\t\t\t\t\t//The powerSetting is derived from the output named Display\n\n\t\t\t\t\tpowerSetting = regExp.exec(splitOutput[i])[1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//console.log(GUID,subgroup,powerSetting);\n\n\t\t\t//Set the the brightness for AC power plan settings\n\n\t\t\texec('powercfg -SetAcValueIndex' + ' ' + GUID + ' ' + subgroup + ' ' + powerSetting + ' ' + brightness,function(err,out,stderror){\n\t\t\t\tif(err) throw err;\n\n\t\t\t\t//Set the brightness when on DC power plan settings\n\n\t\t\t\texec('powercfg -SetDcValueIndex' + ' ' + GUID + ' ' + subgroup + ' ' + powerSetting + ' ' + brightness,function(err,out,stderror){\n\t\t\t\t\tif(err) throw err;\n\n\t\t\t\t\t//Set the modified power plan as the current system plan\n\n\t\t\t\t\texec('powercfg -S' + ' ' + GUID,function(err,out,stderror){\n\t\t\t\t\t\tif(err) throw err;\n\t\t\t\t\t\tif(callback) callback();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\n\t\t}\n\t\telse{\n\t\t\tthrow error;\n\t\t}\n\t});\n}\n\nfunction changeBrightness(brightness,callback){\n\n//Brightness is in percent\n\tswitch(os.platform()){\n\n\tcase 'win32':\n\twindows(brightness,callback);\n\tbreak;\n\n\tcase 'linux':\n\tlinux(brightness, callback);\n\tbreak;\n\n\tdefault:\n\tthrow new Error('OS is not recognized or is unsupported');\n\tbreak;\n\t}\n\n}\n\nmodule.exports = changeBrightness;\n", "meta": {"content_hash": "1a7f064293008791d70f9a600c96e92f", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 144, "avg_line_length": 26.69298245614035, "alnum_prop": 0.6703910614525139, "repo_name": "Jabbath/node-brightness", "id": "db9ce1469666fe3301c70905ca7af378834a7a9d", "size": "3043", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "main.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "3148"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"es\">\n\n<head>\n\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <meta name=\"description\" content=\"\">\n <meta name=\"author\" content=\"\">\n\t<meta name=\"google-site-verification\" content=\"IqC9E_aWJtA4gqC0Bv4gL9MV70PJZ0W7mdU8nLkvLoQ\" />\n\n <title>Thinking Mind Healing Heart</title>\n\t<link rel=\"shortcut icon\" href=\"../favicon.ico\" />\n\n <!-- Bootstrap Core CSS -->\n <link href=\"../css/bootstrap.min.css\" rel=\"stylesheet\">\n\n <!-- Custom CSS -->\n <link href=\"../css/style-es.css\" rel=\"stylesheet\">\n\n <!-- Custom Fonts -->\n <link href=\"../css/font-awesome.min.css\" rel=\"stylesheet\" type=\"text/css\">\n\n <!-- Google Analytics -->\n <script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n ga('create', 'UA-75979766-2', 'auto', 'MenteCorazon');\n ga('MenteCorazon.send', 'pageview');\n </script>\n\n</head>\n\n<body id=\"page-top\" data-spy=\"scroll\" data-target=\".navbar-fixed-top\">\n\n <!-- Intro Header -->\n <header class=\"intro\">\n <div class=\"row\">\n <br />\n <div class=\"col-lg-8 col-lg-offset-2\">\n <ul class=\"list-inline banner-social-buttons\">\n <li>\n <a href=\"https://www.instagram.com/ThinkingHealing/\" class=\"btn btn-default\"><i class=\"fa fa-instagram fa-fw\"></i> Instagram</a>\n </li>\n <li>\n <a href=\"https://www.youtube.com/channel/UCVo8Wr5AaT04hFwTeAaFv5w\" class=\"btn btn-default\"><i class=\"fa fa-youtube-play fa-fw\"></i> Youtube</a>\n </li>\n <li>\n <a href=\"https://twitter.com/ThinkingHealing\" class=\"btn btn-default\"><i class=\"fa fa-twitter fa-fw\"></i> Twitter</a>\n </li>\n </ul>\n </div>\n </div>\n </header>\n\n <!-- jQuery -->\n <script src=\"../js/jquery.js\"></script>\n\n <!-- Bootstrap Core JavaScript -->\n <script src=\"../js/bootstrap.min.js\"></script>\n\n <!-- Plugin JavaScript -->\n <script src=\"../js/jquery.easing.min.js\"></script>\n\n <!-- Custom Theme JavaScript -->\n <script src=\"../js/script.js\"></script>\n\n</body>\n\n</html>\n", "meta": {"content_hash": "066a386f33ef3097a72c5209633aa031", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 167, "avg_line_length": 35.26027397260274, "alnum_prop": 0.5578865578865578, "repo_name": "ThinkingHealing/thinkinghealing.github.io", "id": "557c391c1fc31528c53162131007b9142deefa27", "size": "2574", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "es/index.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "19434"}, {"name": "HTML", "bytes": "7838"}, {"name": "JavaScript", "bytes": "1129"}]}} +{"text": "package gaia3d.controller.view;\n\nimport gaia3d.domain.terrain.Terrain;\nimport gaia3d.service.TerrainService;\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.ui.Model;\nimport org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\n\nimport javax.servlet.http.HttpServletRequest;\nimport java.util.List;\n\n@Slf4j\n@Controller\n@RequestMapping(\"/terrain\")\npublic class TerrainController {\n\n\t@Autowired\n\tprivate TerrainService terrainService;\n\n\t/**\n\t * Terrain \ubaa9\ub85d\n\t * @param model\n\t * @return\n\t */\n\t@GetMapping(value = \"/list\")\n\tpublic String list(HttpServletRequest request, Model model) {\n\t\tList<Terrain> terrainList = terrainService.getListTerrain();\n\n\t\tmodel.addAttribute(\"terrainList\", terrainList);\n\n\t\treturn \"/terrain/list\";\n\t}\n\n\t/**\n\t * Terrain \ub4f1\ub85d \ud654\uba74\n\t * @param model\n\t * @return\n\t */\n\t@GetMapping(value = \"/input\")\n\tpublic String input(Model model) {\n\t\tmodel.addAttribute(\"terrain\", new Terrain());\n\t\treturn \"/terrain/input\";\n\t}\n\n\t/**\n\t * Terrain \uc218\uc815 \ud654\uba74\n\t * @param reuqet\n\t * @param terrainId\n\t * @param model\n\t * @return\n\t */\n\t@GetMapping(value = \"/modify\")\n\tpublic String modify(HttpServletRequest reuqet, @RequestParam Integer terrainId, Model model) {\n\t\tTerrain terrain = terrainService.getTerrain(terrainId);\n\n\t\tmodel.addAttribute(terrain);\n\n\t\treturn \"/terrain/modify\";\n\t}\n\n\t/**\n\t * Terrain \uc0ad\uc81c\n\t * @param terrainId\n\t * @param model\n\t * @return\n\t */\n\t@GetMapping(value = \"/delete\")\n\tpublic String delete(@RequestParam(\"terrainId\") Integer terrainId, Model model) {\n\t\tterrainService.deleteTerrain(terrainId);\n\n\t\treturn \"redirect:/terrain/list\";\n\t}\n}\n", "meta": {"content_hash": "0fff028ee1b3cc29b834620f8a5adae7", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 97, "avg_line_length": 23.363636363636363, "alnum_prop": 0.7398554752640356, "repo_name": "Gaia3D/mago3d", "id": "4d823fd339c112966a6bd25ef427bb3b2bc44ef5", "size": "1823", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "mago3d-admin/src/main/java/gaia3d/controller/view/TerrainController.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "853699"}, {"name": "HTML", "bytes": "2164643"}, {"name": "Java", "bytes": "2158477"}, {"name": "JavaScript", "bytes": "22316674"}, {"name": "Less", "bytes": "356476"}, {"name": "SCSS", "bytes": "391356"}, {"name": "Shell", "bytes": "587"}]}} +{"text": "@interface ViewController : UIViewController\n\n\n@end\n\n", "meta": {"content_hash": "e2da20b9691e6576f466ab6459e3ce7d", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 44, "avg_line_length": 10.6, "alnum_prop": 0.7924528301886793, "repo_name": "Xiexingda/XDVideoCamera", "id": "2afcaf6f64372ba1260f1303a0d488dcd0dd7658", "size": "307", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Demo/ViewController.h", "mode": "33188", "license": "mit", "language": [{"name": "Objective-C", "bytes": "38513"}, {"name": "Ruby", "bytes": "6187"}]}} +{"text": "var angular = require('angular');\n\nvar Interstellar = angular.module('Interstellar', []);\nInterstellar.provider('interstellarSet', function() {\n\n\tvar data = [];\n\tvar focusIndex = 0;\n\tvar name = '';\n\n\treturn {\n\t\tinit: function(argData) {\n\t\t\t\tdata = argData;\n\t\t},\n\t\t$get: function($rootScope) {\n\n\t\t\treturn {\n\t\t\t\tgetAll: function() {\n\t\t\t\t\treturn data;\n\t\t\t\t},\n\t\t\t\tget: function(index) {\n\t\t\t\t\treturn data[index];\n\t\t\t\t},\n\t\t\t\tadd: function(argData) {\n\t\t\t\t\t// \u66f4\u65b0\u7126\u70b9\n\t\t\t\t\tfocusIndex = data.length;\n\t\t\t\t\tdata.push(argData);\n\t\t\t\t\t$rootScope.$broadcast('$focusChange');\n\t\t\t\t},\n\t\t\t\t// addR \u4f7f\u7528 Replace \u7684\u65b9\u5f0f\u6dfb\u52a0\u6570\u636e\n\t\t\t\taddR: function(index, argData) {\n\t\t\t\t\tfocusIndex = index;\n\t\t\t\t\tdata.splice(index, 0 , argData);\n\t\t\t\t\t$rootScope.$broadcast('$focusChange');\n\t\t\t\t},\n\t\t\t\treplace: function(index, behavior) {\n\t\t\t\t\tdata.splice(index, 1 , behavior);\n\t\t\t\t\t$rootScope.$broadcast('$focusChange');\n\t\t\t\t},\n\t\t\t\tupdate: function(index, value) {\n\t\t\t\t\tdata[index] = value;\n\t\t\t\t},\n\t\t\t\tremove: function(index) {\n\t\t\t\t\tfocusIndex = index - 1;\n\t\t\t\t\tdata[focusIndex].other = !data[focusIndex].other;\n\t\t\t\t\tdata.splice(index, 1);\n\t\t\t\t\t$rootScope.$broadcast('$focusChange');\n\t\t\t\t},\n\t\t\t\tgetName: function(){\n\t\t\t\t\treturn name;\n\t\t\t\t},\n\t\t\t\tsetName: function(argName) {\n\t\t\t\t\tname = argName;\n\n\t\t\t\t\t$rootScope.$broadcast('$nameChange');\n\t\t\t\t},\n\t\t\t\tgetFocus: function() {\n\t\t\t\t\treturn focusIndex;\n\t\t\t\t},\n\t\t\t\tsetFocus: function(index) {\n\t\t\t\t\tfocusIndex = index;\n\t\t\t\t\t$rootScope.$broadcast('$focusChange');\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n});\n", "meta": {"content_hash": "53296dee1ad4d7ffbf0f6b279d6371e8", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 54, "avg_line_length": 22.393939393939394, "alnum_prop": 0.587956698240866, "repo_name": "wangzhe1995/interstellar", "id": "781b8c9a16be26287c05c8b64acac3b9c31b093d", "size": "1504", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/interstellar.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "2833"}, {"name": "JavaScript", "bytes": "16052"}]}} +{"text": "var micka = {\n \n confirmURL: function(msg, url){\n if(window.confirm(msg)){\n window.location = url;\n }\n },\n \n showSubsets: function(){\n var target = $('#micka-subsets').get(0);\n var fid = $('#file-identifier').get(0).textContent;\n this._showSubsets(target, fid);\n },\n \n _showSubsets(target, fid){\n var that = this;\n $.get('../../csw/?REQUEST=GetRecords&FORMAT=application/json&query=ParentIdentifier%3D'+fid)\n .done(function(data){\n $(target).html('');\n for(var i=0;i<data.records.length;i++){\n $(target).append('<div><a href=\"'+data.records[i].id+'\"><span class=\"res-type '+data.records[i].trida+'\"></span>'+data.records[i].title+'</a></div>');\n $(target).append('<div style=\"margin-left:15px;\" id=\"sub-'+data.records[i].id+'\">loading....</div>');\n that._showSubsets($(\"#sub-\"+data.records[i].id), data.records[i].id);\n }\n }) \n }\n}", "meta": {"content_hash": "ac00ddb43580c3237dc9069d6a6e0cb0", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 166, "avg_line_length": 37.81481481481482, "alnum_prop": 0.5142017629774731, "repo_name": "hsrs-cz/Micka", "id": "4275cb01cd915df501f3465127542c468faaccd6", "size": "1021", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scripts/micka.js", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "45657"}, {"name": "HTML", "bytes": "112384"}, {"name": "JavaScript", "bytes": "205191"}, {"name": "PHP", "bytes": "468302"}, {"name": "TSQL", "bytes": "4046552"}, {"name": "XSLT", "bytes": "1473790"}]}} +{"text": "// \u00a9 2016 and later: Unicode, Inc. and others.\n// License & terms of use: http://www.unicode.org/copyright.html\n\n\n#include \"unicode/utypes.h\"\n#include <float.h>\n\n#if !UCONFIG_NO_FORMATTING\n\n#include \"unicode/gregocal.h\"\n#include \"gregoimp.h\"\n#include \"umutex.h\"\n#include \"uassert.h\"\n\n// *****************************************************************************\n// class GregorianCalendar\n// *****************************************************************************\n\n/**\n* Note that the Julian date used here is not a true Julian date, since\n* it is measured from midnight, not noon. This value is the Julian\n* day number of January 1, 1970 (Gregorian calendar) at noon UTC. [LIU]\n*/\n\nstatic const int16_t kNumDays[]\n= {0,31,59,90,120,151,181,212,243,273,304,334}; // 0-based, for day-in-year\nstatic const int16_t kLeapNumDays[]\n= {0,31,60,91,121,152,182,213,244,274,305,335}; // 0-based, for day-in-year\nstatic const int8_t kMonthLength[]\n= {31,28,31,30,31,30,31,31,30,31,30,31}; // 0-based\nstatic const int8_t kLeapMonthLength[]\n= {31,29,31,30,31,30,31,31,30,31,30,31}; // 0-based\n\n// setTimeInMillis() limits the Julian day range to +/-7F000000.\n// This would seem to limit the year range to:\n// ms=+183882168921600000 jd=7f000000 December 20, 5828963 AD\n// ms=-184303902528000000 jd=81000000 September 20, 5838270 BC\n// HOWEVER, CalendarRegressionTest/Test4167060 shows that the actual\n// range limit on the year field is smaller (~ +/-140000). [alan 3.0]\n\nstatic const int32_t kGregorianCalendarLimits[UCAL_FIELD_COUNT][4] = {\n // Minimum Greatest Least Maximum\n // Minimum Maximum\n { 0, 0, 1, 1}, // ERA\n { 1, 1, 140742, 144683}, // YEAR\n { 0, 0, 11, 11}, // MONTH\n { 1, 1, 52, 53}, // WEEK_OF_YEAR\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // WEEK_OF_MONTH\n { 1, 1, 28, 31}, // DAY_OF_MONTH\n { 1, 1, 365, 366}, // DAY_OF_YEAR\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // DAY_OF_WEEK\n { -1, -1, 4, 5}, // DAY_OF_WEEK_IN_MONTH\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // AM_PM\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // HOUR\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // HOUR_OF_DAY\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // MINUTE\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // SECOND\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // MILLISECOND\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // ZONE_OFFSET\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // DST_OFFSET\n { -140742, -140742, 140742, 144683}, // YEAR_WOY\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // DOW_LOCAL\n { -140742, -140742, 140742, 144683}, // EXTENDED_YEAR\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // JULIAN_DAY\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // MILLISECONDS_IN_DAY\n {/*N/A*/-1,/*N/A*/-1,/*N/A*/-1,/*N/A*/-1}, // IS_LEAP_MONTH\n};\n\n/*\n* <pre>\n* Greatest Least \n* Field name Minimum Minimum Maximum Maximum\n* ---------- ------- ------- ------- -------\n* ERA 0 0 1 1\n* YEAR 1 1 140742 144683\n* MONTH 0 0 11 11\n* WEEK_OF_YEAR 1 1 52 53\n* WEEK_OF_MONTH 0 0 4 6\n* DAY_OF_MONTH 1 1 28 31\n* DAY_OF_YEAR 1 1 365 366\n* DAY_OF_WEEK 1 1 7 7\n* DAY_OF_WEEK_IN_MONTH -1 -1 4 5\n* AM_PM 0 0 1 1\n* HOUR 0 0 11 11\n* HOUR_OF_DAY 0 0 23 23\n* MINUTE 0 0 59 59\n* SECOND 0 0 59 59\n* MILLISECOND 0 0 999 999\n* ZONE_OFFSET -12* -12* 12* 12*\n* DST_OFFSET 0 0 1* 1*\n* YEAR_WOY 1 1 140742 144683\n* DOW_LOCAL 1 1 7 7\n* </pre>\n* (*) In units of one-hour\n*/\n\n#if defined( U_DEBUG_CALSVC ) || defined (U_DEBUG_CAL)\n#include <stdio.h>\n#endif\n\nU_NAMESPACE_BEGIN\n\nUOBJECT_DEFINE_RTTI_IMPLEMENTATION(GregorianCalendar)\n\n// 00:00:00 UTC, October 15, 1582, expressed in ms from the epoch.\n// Note that only Italy and other Catholic countries actually\n// observed this cutover. Most other countries followed in\n// the next few centuries, some as late as 1928. [LIU]\n// in Java, -12219292800000L\n//const UDate GregorianCalendar::kPapalCutover = -12219292800000L;\nstatic const uint32_t kCutoverJulianDay = 2299161;\nstatic const UDate kPapalCutover = (2299161.0 - kEpochStartAsJulianDay) * U_MILLIS_PER_DAY;\n//static const UDate kPapalCutoverJulian = (2299161.0 - kEpochStartAsJulianDay);\n\n// -------------------------------------\n\nGregorianCalendar::GregorianCalendar(UErrorCode& status)\n: Calendar(status),\nfGregorianCutover(kPapalCutover),\nfCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582),\nfIsGregorian(TRUE), fInvertGregorian(FALSE)\n{\n setTimeInMillis(getNow(), status);\n}\n\n// -------------------------------------\n\nGregorianCalendar::GregorianCalendar(TimeZone* zone, UErrorCode& status)\n: Calendar(zone, Locale::getDefault(), status),\nfGregorianCutover(kPapalCutover),\nfCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582),\nfIsGregorian(TRUE), fInvertGregorian(FALSE)\n{\n setTimeInMillis(getNow(), status);\n}\n\n// -------------------------------------\n\nGregorianCalendar::GregorianCalendar(const TimeZone& zone, UErrorCode& status)\n: Calendar(zone, Locale::getDefault(), status),\nfGregorianCutover(kPapalCutover),\nfCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582),\nfIsGregorian(TRUE), fInvertGregorian(FALSE)\n{\n setTimeInMillis(getNow(), status);\n}\n\n// -------------------------------------\n\nGregorianCalendar::GregorianCalendar(const Locale& aLocale, UErrorCode& status)\n: Calendar(TimeZone::createDefault(), aLocale, status),\nfGregorianCutover(kPapalCutover),\nfCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582),\nfIsGregorian(TRUE), fInvertGregorian(FALSE)\n{\n setTimeInMillis(getNow(), status);\n}\n\n// -------------------------------------\n\nGregorianCalendar::GregorianCalendar(TimeZone* zone, const Locale& aLocale,\n UErrorCode& status)\n : Calendar(zone, aLocale, status),\n fGregorianCutover(kPapalCutover),\n fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582),\n fIsGregorian(TRUE), fInvertGregorian(FALSE)\n{\n setTimeInMillis(getNow(), status);\n}\n\n// -------------------------------------\n\nGregorianCalendar::GregorianCalendar(const TimeZone& zone, const Locale& aLocale,\n UErrorCode& status)\n : Calendar(zone, aLocale, status),\n fGregorianCutover(kPapalCutover),\n fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582),\n fIsGregorian(TRUE), fInvertGregorian(FALSE)\n{\n setTimeInMillis(getNow(), status);\n}\n\n// -------------------------------------\n\nGregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date,\n UErrorCode& status)\n : Calendar(TimeZone::createDefault(), Locale::getDefault(), status),\n fGregorianCutover(kPapalCutover),\n fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582),\n fIsGregorian(TRUE), fInvertGregorian(FALSE)\n{\n set(UCAL_ERA, AD);\n set(UCAL_YEAR, year);\n set(UCAL_MONTH, month);\n set(UCAL_DATE, date);\n}\n\n// -------------------------------------\n\nGregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date,\n int32_t hour, int32_t minute, UErrorCode& status)\n : Calendar(TimeZone::createDefault(), Locale::getDefault(), status),\n fGregorianCutover(kPapalCutover),\n fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582),\n fIsGregorian(TRUE), fInvertGregorian(FALSE)\n{\n set(UCAL_ERA, AD);\n set(UCAL_YEAR, year);\n set(UCAL_MONTH, month);\n set(UCAL_DATE, date);\n set(UCAL_HOUR_OF_DAY, hour);\n set(UCAL_MINUTE, minute);\n}\n\n// -------------------------------------\n\nGregorianCalendar::GregorianCalendar(int32_t year, int32_t month, int32_t date,\n int32_t hour, int32_t minute, int32_t second,\n UErrorCode& status)\n : Calendar(TimeZone::createDefault(), Locale::getDefault(), status),\n fGregorianCutover(kPapalCutover),\n fCutoverJulianDay(kCutoverJulianDay), fNormalizedGregorianCutover(fGregorianCutover), fGregorianCutoverYear(1582),\n fIsGregorian(TRUE), fInvertGregorian(FALSE)\n{\n set(UCAL_ERA, AD);\n set(UCAL_YEAR, year);\n set(UCAL_MONTH, month);\n set(UCAL_DATE, date);\n set(UCAL_HOUR_OF_DAY, hour);\n set(UCAL_MINUTE, minute);\n set(UCAL_SECOND, second);\n}\n\n// -------------------------------------\n\nGregorianCalendar::~GregorianCalendar()\n{\n}\n\n// -------------------------------------\n\nGregorianCalendar::GregorianCalendar(const GregorianCalendar &source)\n: Calendar(source),\nfGregorianCutover(source.fGregorianCutover),\nfCutoverJulianDay(source.fCutoverJulianDay), fNormalizedGregorianCutover(source.fNormalizedGregorianCutover), fGregorianCutoverYear(source.fGregorianCutoverYear),\nfIsGregorian(source.fIsGregorian), fInvertGregorian(source.fInvertGregorian)\n{\n}\n\n// -------------------------------------\n\nGregorianCalendar* GregorianCalendar::clone() const\n{\n return new GregorianCalendar(*this);\n}\n\n// -------------------------------------\n\nGregorianCalendar &\nGregorianCalendar::operator=(const GregorianCalendar &right)\n{\n if (this != &right)\n {\n Calendar::operator=(right);\n fGregorianCutover = right.fGregorianCutover;\n fNormalizedGregorianCutover = right.fNormalizedGregorianCutover;\n fGregorianCutoverYear = right.fGregorianCutoverYear;\n fCutoverJulianDay = right.fCutoverJulianDay;\n }\n return *this;\n}\n\n// -------------------------------------\n\nUBool GregorianCalendar::isEquivalentTo(const Calendar& other) const\n{\n // Calendar override.\n return Calendar::isEquivalentTo(other) &&\n fGregorianCutover == ((GregorianCalendar*)&other)->fGregorianCutover;\n}\n\n// -------------------------------------\n\nvoid\nGregorianCalendar::setGregorianChange(UDate date, UErrorCode& status)\n{\n if (U_FAILURE(status)) \n return;\n\n // Precompute two internal variables which we use to do the actual\n // cutover computations. These are the normalized cutover, which is the\n // midnight at or before the cutover, and the cutover year. The\n // normalized cutover is in pure date milliseconds; it contains no time\n // of day or timezone component, and it used to compare against other\n // pure date values.\n double cutoverDay = ClockMath::floorDivide(date, (double)kOneDay);\n\n // Handle the rare case of numeric overflow where the user specifies a time\n // outside of INT32_MIN .. INT32_MAX number of days.\n \n if (cutoverDay <= INT32_MIN) {\n cutoverDay = INT32_MIN;\n fGregorianCutover = fNormalizedGregorianCutover = cutoverDay * kOneDay;\n } else if (cutoverDay >= INT32_MAX) {\n cutoverDay = INT32_MAX;\n fGregorianCutover = fNormalizedGregorianCutover = cutoverDay * kOneDay;\n } else {\n fNormalizedGregorianCutover = cutoverDay * kOneDay;\n fGregorianCutover = date;\n }\n\n // Normalize the year so BC values are represented as 0 and negative\n // values.\n GregorianCalendar *cal = new GregorianCalendar(getTimeZone(), status);\n /* test for NULL */\n if (cal == 0) {\n status = U_MEMORY_ALLOCATION_ERROR;\n return;\n }\n if(U_FAILURE(status))\n return;\n cal->setTime(date, status);\n fGregorianCutoverYear = cal->get(UCAL_YEAR, status);\n if (cal->get(UCAL_ERA, status) == BC) \n fGregorianCutoverYear = 1 - fGregorianCutoverYear;\n fCutoverJulianDay = (int32_t)cutoverDay;\n delete cal;\n}\n\n\nvoid GregorianCalendar::handleComputeFields(int32_t julianDay, UErrorCode& status) {\n int32_t eyear, month, dayOfMonth, dayOfYear, unusedRemainder;\n\n\n if(U_FAILURE(status)) { \n return; \n }\n\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: jd%d- (greg's %d)- [cut=%d]\\n\", \n __FILE__, __LINE__, julianDay, getGregorianDayOfYear(), fCutoverJulianDay);\n#endif\n\n\n if (julianDay >= fCutoverJulianDay) {\n month = getGregorianMonth();\n dayOfMonth = getGregorianDayOfMonth();\n dayOfYear = getGregorianDayOfYear();\n eyear = getGregorianYear();\n } else {\n // The Julian epoch day (not the same as Julian Day)\n // is zero on Saturday December 30, 0 (Gregorian).\n int32_t julianEpochDay = julianDay - (kJan1_1JulianDay - 2);\n\t\teyear = (int32_t) ClockMath::floorDivide((4.0*julianEpochDay) + 1464.0, (int32_t) 1461, unusedRemainder);\n\n // Compute the Julian calendar day number for January 1, eyear\n int32_t january1 = 365*(eyear-1) + ClockMath::floorDivide(eyear-1, (int32_t)4);\n dayOfYear = (julianEpochDay - january1); // 0-based\n\n // Julian leap years occurred historically every 4 years starting\n // with 8 AD. Before 8 AD the spacing is irregular; every 3 years\n // from 45 BC to 9 BC, and then none until 8 AD. However, we don't\n // implement this historical detail; instead, we implement the\n // computatinally cleaner proleptic calendar, which assumes\n // consistent 4-year cycles throughout time.\n UBool isLeap = ((eyear&0x3) == 0); // equiv. to (eyear%4 == 0)\n\n // Common Julian/Gregorian calculation\n int32_t correction = 0;\n int32_t march1 = isLeap ? 60 : 59; // zero-based DOY for March 1\n if (dayOfYear >= march1) {\n correction = isLeap ? 1 : 2;\n }\n month = (12 * (dayOfYear + correction) + 6) / 367; // zero-based month\n dayOfMonth = dayOfYear - (isLeap?kLeapNumDays[month]:kNumDays[month]) + 1; // one-based DOM\n ++dayOfYear;\n#if defined (U_DEBUG_CAL)\n // fprintf(stderr, \"%d - %d[%d] + 1\\n\", dayOfYear, isLeap?kLeapNumDays[month]:kNumDays[month], month );\n // fprintf(stderr, \"%s:%d: greg's HCF %d -> %d/%d/%d not %d/%d/%d\\n\", \n // __FILE__, __LINE__,julianDay,\n // eyear,month,dayOfMonth,\n // getGregorianYear(), getGregorianMonth(), getGregorianDayOfMonth() );\n fprintf(stderr, \"%s:%d: doy %d (greg's %d)- [cut=%d]\\n\", \n __FILE__, __LINE__, dayOfYear, getGregorianDayOfYear(), fCutoverJulianDay);\n#endif\n\n }\n\n // [j81] if we are after the cutover in its year, shift the day of the year\n if((eyear == fGregorianCutoverYear) && (julianDay >= fCutoverJulianDay)) {\n //from handleComputeMonthStart\n int32_t gregShift = Grego::gregorianShift(eyear);\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: gregorian shift %d ::: doy%d => %d [cut=%d]\\n\",\n __FILE__, __LINE__,gregShift, dayOfYear, dayOfYear+gregShift, fCutoverJulianDay);\n#endif\n dayOfYear += gregShift;\n }\n\n internalSet(UCAL_MONTH, month);\n internalSet(UCAL_DAY_OF_MONTH, dayOfMonth);\n internalSet(UCAL_DAY_OF_YEAR, dayOfYear);\n internalSet(UCAL_EXTENDED_YEAR, eyear);\n int32_t era = AD;\n if (eyear < 1) {\n era = BC;\n eyear = 1 - eyear;\n }\n internalSet(UCAL_ERA, era);\n internalSet(UCAL_YEAR, eyear);\n}\n\n\n// -------------------------------------\n\nUDate\nGregorianCalendar::getGregorianChange() const\n{\n return fGregorianCutover;\n}\n\n// -------------------------------------\n\nUBool \nGregorianCalendar::isLeapYear(int32_t year) const\n{\n // MSVC complains bitterly if we try to use Grego::isLeapYear here\n // NOTE: year&0x3 == year%4\n return (year >= fGregorianCutoverYear ?\n (((year&0x3) == 0) && ((year%100 != 0) || (year%400 == 0))) : // Gregorian\n ((year&0x3) == 0)); // Julian\n}\n\n// -------------------------------------\n\nint32_t GregorianCalendar::handleComputeJulianDay(UCalendarDateFields bestField) \n{\n fInvertGregorian = FALSE;\n\n int32_t jd = Calendar::handleComputeJulianDay(bestField);\n\n if((bestField == UCAL_WEEK_OF_YEAR) && // if we are doing WOY calculations, we are counting relative to Jan 1 *julian*\n (internalGet(UCAL_EXTENDED_YEAR)==fGregorianCutoverYear) && \n jd >= fCutoverJulianDay) { \n fInvertGregorian = TRUE; // So that the Julian Jan 1 will be used in handleComputeMonthStart\n return Calendar::handleComputeJulianDay(bestField);\n }\n\n\n // The following check handles portions of the cutover year BEFORE the\n // cutover itself happens.\n //if ((fIsGregorian==TRUE) != (jd >= fCutoverJulianDay)) { /* cutoverJulianDay)) { */\n if ((fIsGregorian==TRUE) != (jd >= fCutoverJulianDay)) { /* cutoverJulianDay)) { */\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: jd [invert] %d\\n\", \n __FILE__, __LINE__, jd);\n#endif\n fInvertGregorian = TRUE;\n jd = Calendar::handleComputeJulianDay(bestField);\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: fIsGregorian %s, fInvertGregorian %s - \", \n __FILE__, __LINE__,fIsGregorian?\"T\":\"F\", fInvertGregorian?\"T\":\"F\");\n fprintf(stderr, \" jd NOW %d\\n\", \n jd);\n#endif\n } else {\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: jd [==] %d - %sfIsGregorian %sfInvertGregorian, %d\\n\", \n __FILE__, __LINE__, jd, fIsGregorian?\"T\":\"F\", fInvertGregorian?\"T\":\"F\", bestField);\n#endif\n }\n\n if(fIsGregorian && (internalGet(UCAL_EXTENDED_YEAR) == fGregorianCutoverYear)) {\n int32_t gregShift = Grego::gregorianShift(internalGet(UCAL_EXTENDED_YEAR));\n if (bestField == UCAL_DAY_OF_YEAR) {\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: [DOY%d] gregorian shift of JD %d += %d\\n\", \n __FILE__, __LINE__, fFields[bestField],jd, gregShift);\n#endif\n jd -= gregShift;\n } else if ( bestField == UCAL_WEEK_OF_MONTH ) {\n int32_t weekShift = 14;\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: [WOY/WOM] gregorian week shift of %d += %d\\n\", \n __FILE__, __LINE__, jd, weekShift);\n#endif\n jd += weekShift; // shift by weeks for week based fields.\n }\n }\n\n return jd;\n}\n\nint32_t GregorianCalendar::handleComputeMonthStart(int32_t eyear, int32_t month,\n\n UBool /* useMonth */) const\n{\n GregorianCalendar *nonConstThis = (GregorianCalendar*)this; // cast away const\n\n // If the month is out of range, adjust it into range, and\n // modify the extended year value accordingly.\n if (month < 0 || month > 11) {\n eyear += ClockMath::floorDivide(month, 12, month);\n }\n\n UBool isLeap = eyear%4 == 0;\n int64_t y = (int64_t)eyear-1;\n int64_t julianDay = 365*y + ClockMath::floorDivide(y, (int64_t)4) + (kJan1_1JulianDay - 3);\n\n nonConstThis->fIsGregorian = (eyear >= fGregorianCutoverYear);\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: (hcms%d/%d) fIsGregorian %s, fInvertGregorian %s\\n\", \n __FILE__, __LINE__, eyear,month, fIsGregorian?\"T\":\"F\", fInvertGregorian?\"T\":\"F\");\n#endif\n if (fInvertGregorian) {\n nonConstThis->fIsGregorian = !fIsGregorian;\n }\n if (fIsGregorian) {\n isLeap = isLeap && ((eyear%100 != 0) || (eyear%400 == 0));\n // Add 2 because Gregorian calendar starts 2 days after\n // Julian calendar\n int32_t gregShift = Grego::gregorianShift(eyear);\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: (hcms%d/%d) gregorian shift of %d += %d\\n\", \n __FILE__, __LINE__, eyear, month, julianDay, gregShift);\n#endif\n julianDay += gregShift;\n }\n\n // At this point julianDay indicates the day BEFORE the first\n // day of January 1, <eyear> of either the Julian or Gregorian\n // calendar.\n\n if (month != 0) {\n julianDay += isLeap?kLeapNumDays[month]:kNumDays[month];\n }\n\n return static_cast<int32_t>(julianDay);\n}\n\nint32_t GregorianCalendar::handleGetMonthLength(int32_t extendedYear, int32_t month) const\n{\n // If the month is out of range, adjust it into range, and\n // modify the extended year value accordingly.\n if (month < 0 || month > 11) {\n extendedYear += ClockMath::floorDivide(month, 12, month);\n }\n\n return isLeapYear(extendedYear) ? kLeapMonthLength[month] : kMonthLength[month];\n}\n\nint32_t GregorianCalendar::handleGetYearLength(int32_t eyear) const {\n return isLeapYear(eyear) ? 366 : 365;\n}\n\n\nint32_t\nGregorianCalendar::monthLength(int32_t month) const\n{\n int32_t year = internalGet(UCAL_EXTENDED_YEAR);\n return handleGetMonthLength(year, month);\n}\n\n// -------------------------------------\n\nint32_t\nGregorianCalendar::monthLength(int32_t month, int32_t year) const\n{\n return isLeapYear(year) ? kLeapMonthLength[month] : kMonthLength[month];\n}\n\n// -------------------------------------\n\nint32_t\nGregorianCalendar::yearLength(int32_t year) const\n{\n return isLeapYear(year) ? 366 : 365;\n}\n\n// -------------------------------------\n\nint32_t\nGregorianCalendar::yearLength() const\n{\n return isLeapYear(internalGet(UCAL_YEAR)) ? 366 : 365;\n}\n\n// -------------------------------------\n\n/**\n* After adjustments such as add(MONTH), add(YEAR), we don't want the\n* month to jump around. E.g., we don't want Jan 31 + 1 month to go to Mar\n* 3, we want it to go to Feb 28. Adjustments which might run into this\n* problem call this method to retain the proper month.\n*/\nvoid \nGregorianCalendar::pinDayOfMonth() \n{\n int32_t monthLen = monthLength(internalGet(UCAL_MONTH));\n int32_t dom = internalGet(UCAL_DATE);\n if(dom > monthLen) \n set(UCAL_DATE, monthLen);\n}\n\n// -------------------------------------\n\n\nUBool\nGregorianCalendar::validateFields() const\n{\n for (int32_t field = 0; field < UCAL_FIELD_COUNT; field++) {\n // Ignore DATE and DAY_OF_YEAR which are handled below\n if (field != UCAL_DATE &&\n field != UCAL_DAY_OF_YEAR &&\n isSet((UCalendarDateFields)field) &&\n ! boundsCheck(internalGet((UCalendarDateFields)field), (UCalendarDateFields)field))\n return FALSE;\n }\n\n // Values differ in Least-Maximum and Maximum should be handled\n // specially.\n if (isSet(UCAL_DATE)) {\n int32_t date = internalGet(UCAL_DATE);\n if (date < getMinimum(UCAL_DATE) ||\n date > monthLength(internalGet(UCAL_MONTH))) {\n return FALSE;\n }\n }\n\n if (isSet(UCAL_DAY_OF_YEAR)) {\n int32_t days = internalGet(UCAL_DAY_OF_YEAR);\n if (days < 1 || days > yearLength()) {\n return FALSE;\n }\n }\n\n // Handle DAY_OF_WEEK_IN_MONTH, which must not have the value zero.\n // We've checked against minimum and maximum above already.\n if (isSet(UCAL_DAY_OF_WEEK_IN_MONTH) &&\n 0 == internalGet(UCAL_DAY_OF_WEEK_IN_MONTH)) {\n return FALSE;\n }\n\n return TRUE;\n}\n\n// -------------------------------------\n\nUBool\nGregorianCalendar::boundsCheck(int32_t value, UCalendarDateFields field) const\n{\n return value >= getMinimum(field) && value <= getMaximum(field);\n}\n\n// -------------------------------------\n\nUDate \nGregorianCalendar::getEpochDay(UErrorCode& status) \n{\n complete(status);\n // Divide by 1000 (convert to seconds) in order to prevent overflow when\n // dealing with UDate(Long.MIN_VALUE) and UDate(Long.MAX_VALUE).\n double wallSec = internalGetTime()/1000 + (internalGet(UCAL_ZONE_OFFSET) + internalGet(UCAL_DST_OFFSET))/1000;\n\n return ClockMath::floorDivide(wallSec, kOneDay/1000.0);\n}\n\n// -------------------------------------\n\n\n// -------------------------------------\n\n/**\n* Compute the julian day number of the day BEFORE the first day of\n* January 1, year 1 of the given calendar. If julianDay == 0, it\n* specifies (Jan. 1, 1) - 1, in whatever calendar we are using (Julian\n* or Gregorian).\n*/\ndouble GregorianCalendar::computeJulianDayOfYear(UBool isGregorian,\n int32_t year, UBool& isLeap)\n{\n isLeap = year%4 == 0;\n int32_t y = year - 1;\n double julianDay = 365.0*y + ClockMath::floorDivide(y, 4) + (kJan1_1JulianDay - 3);\n\n if (isGregorian) {\n isLeap = isLeap && ((year%100 != 0) || (year%400 == 0));\n // Add 2 because Gregorian calendar starts 2 days after Julian calendar\n julianDay += Grego::gregorianShift(year);\n }\n\n return julianDay;\n}\n\n// /**\n// * Compute the day of week, relative to the first day of week, from\n// * 0..6, of the current DOW_LOCAL or DAY_OF_WEEK fields. This is\n// * equivalent to get(DOW_LOCAL) - 1.\n// */\n// int32_t GregorianCalendar::computeRelativeDOW() const {\n// int32_t relDow = 0;\n// if (fStamp[UCAL_DOW_LOCAL] > fStamp[UCAL_DAY_OF_WEEK]) {\n// relDow = internalGet(UCAL_DOW_LOCAL) - 1; // 1-based\n// } else if (fStamp[UCAL_DAY_OF_WEEK] != kUnset) {\n// relDow = internalGet(UCAL_DAY_OF_WEEK) - getFirstDayOfWeek();\n// if (relDow < 0) relDow += 7;\n// }\n// return relDow;\n// }\n\n// /**\n// * Compute the day of week, relative to the first day of week,\n// * from 0..6 of the given julian day.\n// */\n// int32_t GregorianCalendar::computeRelativeDOW(double julianDay) const {\n// int32_t relDow = julianDayToDayOfWeek(julianDay) - getFirstDayOfWeek();\n// if (relDow < 0) {\n// relDow += 7;\n// }\n// return relDow;\n// }\n\n// /**\n// * Compute the DOY using the WEEK_OF_YEAR field and the julian day\n// * of the day BEFORE January 1 of a year (a return value from\n// * computeJulianDayOfYear).\n// */\n// int32_t GregorianCalendar::computeDOYfromWOY(double julianDayOfYear) const {\n// // Compute DOY from day of week plus week of year\n\n// // Find the day of the week for the first of this year. This\n// // is zero-based, with 0 being the locale-specific first day of\n// // the week. Add 1 to get first day of year.\n// int32_t fdy = computeRelativeDOW(julianDayOfYear + 1);\n\n// return\n// // Compute doy of first (relative) DOW of WOY 1\n// (((7 - fdy) < getMinimalDaysInFirstWeek())\n// ? (8 - fdy) : (1 - fdy))\n\n// // Adjust for the week number.\n// + (7 * (internalGet(UCAL_WEEK_OF_YEAR) - 1))\n\n// // Adjust for the DOW\n// + computeRelativeDOW();\n// }\n\n// -------------------------------------\n\ndouble \nGregorianCalendar::millisToJulianDay(UDate millis)\n{\n return (double)kEpochStartAsJulianDay + ClockMath::floorDivide(millis, (double)kOneDay);\n}\n\n// -------------------------------------\n\nUDate\nGregorianCalendar::julianDayToMillis(double julian)\n{\n return (UDate) ((julian - kEpochStartAsJulianDay) * (double) kOneDay);\n}\n\n// -------------------------------------\n\nint32_t\nGregorianCalendar::aggregateStamp(int32_t stamp_a, int32_t stamp_b) \n{\n return (((stamp_a != kUnset && stamp_b != kUnset) \n ? uprv_max(stamp_a, stamp_b)\n : (int32_t)kUnset));\n}\n\n// -------------------------------------\n\n/**\n* Roll a field by a signed amount.\n* Note: This will be made public later. [LIU]\n*/\n\nvoid \nGregorianCalendar::roll(EDateFields field, int32_t amount, UErrorCode& status) {\n roll((UCalendarDateFields) field, amount, status); \n}\n\nvoid\nGregorianCalendar::roll(UCalendarDateFields field, int32_t amount, UErrorCode& status)\n{\n if((amount == 0) || U_FAILURE(status)) {\n return;\n }\n\n // J81 processing. (gregorian cutover)\n UBool inCutoverMonth = FALSE;\n int32_t cMonthLen=0; // 'c' for cutover; in days\n int32_t cDayOfMonth=0; // no discontinuity: [0, cMonthLen)\n double cMonthStart=0.0; // in ms\n\n // Common code - see if we're in the cutover month of the cutover year\n if(get(UCAL_EXTENDED_YEAR, status) == fGregorianCutoverYear) {\n switch (field) {\n case UCAL_DAY_OF_MONTH:\n case UCAL_WEEK_OF_MONTH:\n {\n int32_t max = monthLength(internalGet(UCAL_MONTH));\n UDate t = internalGetTime();\n // We subtract 1 from the DAY_OF_MONTH to make it zero-based, and an\n // additional 10 if we are after the cutover. Thus the monthStart\n // value will be correct iff we actually are in the cutover month.\n cDayOfMonth = internalGet(UCAL_DAY_OF_MONTH) - ((t >= fGregorianCutover) ? 10 : 0);\n cMonthStart = t - ((cDayOfMonth - 1) * kOneDay);\n // A month containing the cutover is 10 days shorter.\n if ((cMonthStart < fGregorianCutover) &&\n (cMonthStart + (cMonthLen=(max-10))*kOneDay >= fGregorianCutover)) {\n inCutoverMonth = TRUE;\n }\n }\n break;\n default:\n ;\n }\n }\n\n switch (field) {\n case UCAL_WEEK_OF_YEAR: {\n // Unlike WEEK_OF_MONTH, WEEK_OF_YEAR never shifts the day of the\n // week. Also, rolling the week of the year can have seemingly\n // strange effects simply because the year of the week of year\n // may be different from the calendar year. For example, the\n // date Dec 28, 1997 is the first day of week 1 of 1998 (if\n // weeks start on Sunday and the minimal days in first week is\n // <= 3).\n int32_t woy = get(UCAL_WEEK_OF_YEAR, status);\n // Get the ISO year, which matches the week of year. This\n // may be one year before or after the calendar year.\n int32_t isoYear = get(UCAL_YEAR_WOY, status);\n int32_t isoDoy = internalGet(UCAL_DAY_OF_YEAR);\n if (internalGet(UCAL_MONTH) == UCAL_JANUARY) {\n if (woy >= 52) {\n isoDoy += handleGetYearLength(isoYear);\n }\n } else {\n if (woy == 1) {\n isoDoy -= handleGetYearLength(isoYear - 1);\n }\n }\n woy += amount;\n // Do fast checks to avoid unnecessary computation:\n if (woy < 1 || woy > 52) {\n // Determine the last week of the ISO year.\n // We do this using the standard formula we use\n // everywhere in this file. If we can see that the\n // days at the end of the year are going to fall into\n // week 1 of the next year, we drop the last week by\n // subtracting 7 from the last day of the year.\n int32_t lastDoy = handleGetYearLength(isoYear);\n int32_t lastRelDow = (lastDoy - isoDoy + internalGet(UCAL_DAY_OF_WEEK) -\n getFirstDayOfWeek()) % 7;\n if (lastRelDow < 0) lastRelDow += 7;\n if ((6 - lastRelDow) >= getMinimalDaysInFirstWeek()) lastDoy -= 7;\n int32_t lastWoy = weekNumber(lastDoy, lastRelDow + 1);\n woy = ((woy + lastWoy - 1) % lastWoy) + 1;\n }\n set(UCAL_WEEK_OF_YEAR, woy);\n set(UCAL_YEAR_WOY,isoYear);\n return;\n }\n\n case UCAL_DAY_OF_MONTH:\n if( !inCutoverMonth ) { \n Calendar::roll(field, amount, status);\n return;\n } else {\n // [j81] 1582 special case for DOM\n // The default computation works except when the current month\n // contains the Gregorian cutover. We handle this special case\n // here. [j81 - aliu]\n double monthLen = cMonthLen * kOneDay;\n double msIntoMonth = uprv_fmod(internalGetTime() - cMonthStart +\n amount * kOneDay, monthLen);\n if (msIntoMonth < 0) {\n msIntoMonth += monthLen;\n }\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: roll DOM %d -> %.0lf ms \\n\", \n __FILE__, __LINE__,amount, cMonthLen, cMonthStart+msIntoMonth);\n#endif\n setTimeInMillis(cMonthStart + msIntoMonth, status);\n return;\n }\n\n case UCAL_WEEK_OF_MONTH:\n if( !inCutoverMonth ) { \n Calendar::roll(field, amount, status);\n return;\n } else {\n#if defined (U_DEBUG_CAL)\n fprintf(stderr, \"%s:%d: roll WOM %d ??????????????????? \\n\", \n __FILE__, __LINE__,amount);\n#endif\n // NOTE: following copied from the old\n // GregorianCalendar::roll( WEEK_OF_MONTH ) code \n\n // This is tricky, because during the roll we may have to shift\n // to a different day of the week. For example:\n\n // s m t w r f s\n // 1 2 3 4 5\n // 6 7 8 9 10 11 12\n\n // When rolling from the 6th or 7th back one week, we go to the\n // 1st (assuming that the first partial week counts). The same\n // thing happens at the end of the month.\n\n // The other tricky thing is that we have to figure out whether\n // the first partial week actually counts or not, based on the\n // minimal first days in the week. And we have to use the\n // correct first day of the week to delineate the week\n // boundaries.\n\n // Here's our algorithm. First, we find the real boundaries of\n // the month. Then we discard the first partial week if it\n // doesn't count in this locale. Then we fill in the ends with\n // phantom days, so that the first partial week and the last\n // partial week are full weeks. We then have a nice square\n // block of weeks. We do the usual rolling within this block,\n // as is done elsewhere in this method. If we wind up on one of\n // the phantom days that we added, we recognize this and pin to\n // the first or the last day of the month. Easy, eh?\n\n // Another wrinkle: To fix jitterbug 81, we have to make all this\n // work in the oddball month containing the Gregorian cutover.\n // This month is 10 days shorter than usual, and also contains\n // a discontinuity in the days; e.g., the default cutover month\n // is Oct 1582, and goes from day of month 4 to day of month 15.\n\n // Normalize the DAY_OF_WEEK so that 0 is the first day of the week\n // in this locale. We have dow in 0..6.\n int32_t dow = internalGet(UCAL_DAY_OF_WEEK) - getFirstDayOfWeek();\n if (dow < 0) \n dow += 7;\n\n // Find the day of month, compensating for cutover discontinuity.\n int32_t dom = cDayOfMonth;\n\n // Find the day of the week (normalized for locale) for the first\n // of the month.\n int32_t fdm = (dow - dom + 1) % 7;\n if (fdm < 0) \n fdm += 7;\n\n // Get the first day of the first full week of the month,\n // including phantom days, if any. Figure out if the first week\n // counts or not; if it counts, then fill in phantom days. If\n // not, advance to the first real full week (skip the partial week).\n int32_t start;\n if ((7 - fdm) < getMinimalDaysInFirstWeek())\n start = 8 - fdm; // Skip the first partial week\n else\n start = 1 - fdm; // This may be zero or negative\n\n // Get the day of the week (normalized for locale) for the last\n // day of the month.\n int32_t monthLen = cMonthLen;\n int32_t ldm = (monthLen - dom + dow) % 7;\n // We know monthLen >= DAY_OF_MONTH so we skip the += 7 step here.\n\n // Get the limit day for the blocked-off rectangular month; that\n // is, the day which is one past the last day of the month,\n // after the month has already been filled in with phantom days\n // to fill out the last week. This day has a normalized DOW of 0.\n int32_t limit = monthLen + 7 - ldm;\n\n // Now roll between start and (limit - 1).\n int32_t gap = limit - start;\n int32_t newDom = (dom + amount*7 - start) % gap;\n if (newDom < 0) \n newDom += gap;\n newDom += start;\n\n // Finally, pin to the real start and end of the month.\n if (newDom < 1) \n newDom = 1;\n if (newDom > monthLen) \n newDom = monthLen;\n\n // Set the DAY_OF_MONTH. We rely on the fact that this field\n // takes precedence over everything else (since all other fields\n // are also set at this point). If this fact changes (if the\n // disambiguation algorithm changes) then we will have to unset\n // the appropriate fields here so that DAY_OF_MONTH is attended\n // to.\n\n // If we are in the cutover month, manipulate ms directly. Don't do\n // this in general because it doesn't work across DST boundaries\n // (details, details). This takes care of the discontinuity.\n setTimeInMillis(cMonthStart + (newDom-1)*kOneDay, status); \n return;\n }\n\n default:\n Calendar::roll(field, amount, status);\n return;\n }\n}\n\n// -------------------------------------\n\n\n/**\n* Return the minimum value that this field could have, given the current date.\n* For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().\n* @param field the time field.\n* @return the minimum value that this field could have, given the current date.\n* @deprecated ICU 2.6. Use getActualMinimum(UCalendarDateFields field) instead.\n*/\nint32_t GregorianCalendar::getActualMinimum(EDateFields field) const\n{\n return getMinimum((UCalendarDateFields)field);\n}\n\nint32_t GregorianCalendar::getActualMinimum(EDateFields field, UErrorCode& /* status */) const\n{\n return getMinimum((UCalendarDateFields)field);\n}\n\n/**\n* Return the minimum value that this field could have, given the current date.\n* For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().\n* @param field the time field.\n* @return the minimum value that this field could have, given the current date.\n* @draft ICU 2.6.\n*/\nint32_t GregorianCalendar::getActualMinimum(UCalendarDateFields field, UErrorCode& /* status */) const\n{\n return getMinimum(field);\n}\n\n\n// ------------------------------------\n\n/**\n* Old year limits were least max 292269054, max 292278994.\n*/\n\n/**\n* @stable ICU 2.0\n*/\nint32_t GregorianCalendar::handleGetLimit(UCalendarDateFields field, ELimitType limitType) const {\n return kGregorianCalendarLimits[field][limitType];\n}\n\n/**\n* Return the maximum value that this field could have, given the current date.\n* For example, with the date \"Feb 3, 1997\" and the DAY_OF_MONTH field, the actual\n* maximum would be 28; for \"Feb 3, 1996\" it s 29. Similarly for a Hebrew calendar,\n* for some years the actual maximum for MONTH is 12, and for others 13.\n* @stable ICU 2.0\n*/\nint32_t GregorianCalendar::getActualMaximum(UCalendarDateFields field, UErrorCode& status) const\n{\n /* It is a known limitation that the code here (and in getActualMinimum)\n * won't behave properly at the extreme limits of GregorianCalendar's\n * representable range (except for the code that handles the YEAR\n * field). That's because the ends of the representable range are at\n * odd spots in the year. For calendars with the default Gregorian\n * cutover, these limits are Sun Dec 02 16:47:04 GMT 292269055 BC to Sun\n * Aug 17 07:12:55 GMT 292278994 AD, somewhat different for non-GMT\n * zones. As a result, if the calendar is set to Aug 1 292278994 AD,\n * the actual maximum of DAY_OF_MONTH is 17, not 30. If the date is Mar\n * 31 in that year, the actual maximum month might be Jul, whereas is\n * the date is Mar 15, the actual maximum might be Aug -- depending on\n * the precise semantics that are desired. Similar considerations\n * affect all fields. Nonetheless, this effect is sufficiently arcane\n * that we permit it, rather than complicating the code to handle such\n * intricacies. - liu 8/20/98\n\n * UPDATE: No longer true, since we have pulled in the limit values on\n * the year. - Liu 11/6/00 */\n\n switch (field) {\n\n case UCAL_YEAR:\n /* The year computation is no different, in principle, from the\n * others, however, the range of possible maxima is large. In\n * addition, the way we know we've exceeded the range is different.\n * For these reasons, we use the special case code below to handle\n * this field.\n *\n * The actual maxima for YEAR depend on the type of calendar:\n *\n * Gregorian = May 17, 292275056 BC - Aug 17, 292278994 AD\n * Julian = Dec 2, 292269055 BC - Jan 3, 292272993 AD\n * Hybrid = Dec 2, 292269055 BC - Aug 17, 292278994 AD\n *\n * We know we've exceeded the maximum when either the month, date,\n * time, or era changes in response to setting the year. We don't\n * check for month, date, and time here because the year and era are\n * sufficient to detect an invalid year setting. NOTE: If code is\n * added to check the month and date in the future for some reason,\n * Feb 29 must be allowed to shift to Mar 1 when setting the year.\n */\n {\n if(U_FAILURE(status)) return 0;\n Calendar *cal = clone();\n if(!cal) {\n status = U_MEMORY_ALLOCATION_ERROR;\n return 0;\n }\n\n cal->setLenient(TRUE);\n\n int32_t era = cal->get(UCAL_ERA, status);\n UDate d = cal->getTime(status);\n\n /* Perform a binary search, with the invariant that lowGood is a\n * valid year, and highBad is an out of range year.\n */\n int32_t lowGood = kGregorianCalendarLimits[UCAL_YEAR][1];\n int32_t highBad = kGregorianCalendarLimits[UCAL_YEAR][2]+1;\n while ((lowGood + 1) < highBad) {\n int32_t y = (lowGood + highBad) / 2;\n cal->set(UCAL_YEAR, y);\n if (cal->get(UCAL_YEAR, status) == y && cal->get(UCAL_ERA, status) == era) {\n lowGood = y;\n } else {\n highBad = y;\n cal->setTime(d, status); // Restore original fields\n }\n }\n\n delete cal;\n return lowGood;\n }\n\n default:\n return Calendar::getActualMaximum(field,status);\n }\n}\n\n\nint32_t GregorianCalendar::handleGetExtendedYear() {\n // the year to return\n int32_t year = kEpochYear;\n\n // year field to use\n int32_t yearField = UCAL_EXTENDED_YEAR;\n\n // There are three separate fields which could be used to\n // derive the proper year. Use the one most recently set.\n if (fStamp[yearField] < fStamp[UCAL_YEAR])\n yearField = UCAL_YEAR;\n if (fStamp[yearField] < fStamp[UCAL_YEAR_WOY])\n yearField = UCAL_YEAR_WOY;\n\n // based on the \"best\" year field, get the year\n switch(yearField) {\n case UCAL_EXTENDED_YEAR:\n year = internalGet(UCAL_EXTENDED_YEAR, kEpochYear);\n break;\n\n case UCAL_YEAR:\n {\n // The year defaults to the epoch start, the era to AD\n int32_t era = internalGet(UCAL_ERA, AD);\n if (era == BC) {\n year = 1 - internalGet(UCAL_YEAR, 1); // Convert to extended year\n } else {\n year = internalGet(UCAL_YEAR, kEpochYear);\n }\n }\n break;\n\n case UCAL_YEAR_WOY:\n year = handleGetExtendedYearFromWeekFields(internalGet(UCAL_YEAR_WOY), internalGet(UCAL_WEEK_OF_YEAR));\n#if defined (U_DEBUG_CAL)\n // if(internalGet(UCAL_YEAR_WOY) != year) {\n fprintf(stderr, \"%s:%d: hGEYFWF[%d,%d] -> %d\\n\", \n __FILE__, __LINE__,internalGet(UCAL_YEAR_WOY),internalGet(UCAL_WEEK_OF_YEAR),year);\n //}\n#endif\n break;\n\n default:\n year = kEpochYear;\n }\n return year;\n}\n\nint32_t GregorianCalendar::handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy)\n{\n // convert year to extended form\n int32_t era = internalGet(UCAL_ERA, AD);\n if(era == BC) {\n yearWoy = 1 - yearWoy;\n }\n return Calendar::handleGetExtendedYearFromWeekFields(yearWoy, woy);\n}\n\n\n// -------------------------------------\n\nUBool\nGregorianCalendar::inDaylightTime(UErrorCode& status) const\n{\n if (U_FAILURE(status) || !getTimeZone().useDaylightTime()) \n return FALSE;\n\n // Force an update of the state of the Calendar.\n ((GregorianCalendar*)this)->complete(status); // cast away const\n\n return (UBool)(U_SUCCESS(status) ? (internalGet(UCAL_DST_OFFSET) != 0) : FALSE);\n}\n\n// -------------------------------------\n\n/**\n* Return the ERA. We need a special method for this because the\n* default ERA is AD, but a zero (unset) ERA is BC.\n*/\nint32_t\nGregorianCalendar::internalGetEra() const {\n return isSet(UCAL_ERA) ? internalGet(UCAL_ERA) : (int32_t)AD;\n}\n\nconst char *\nGregorianCalendar::getType() const {\n //static const char kGregorianType = \"gregorian\";\n\n return \"gregorian\";\n}\n\n/**\n * The system maintains a static default century start date and Year. They are\n * initialized the first time they are used. Once the system default century date \n * and year are set, they do not change.\n */\nstatic UDate gSystemDefaultCenturyStart = DBL_MIN;\nstatic int32_t gSystemDefaultCenturyStartYear = -1;\nstatic icu::UInitOnce gSystemDefaultCenturyInit = U_INITONCE_INITIALIZER;\n\n\nUBool GregorianCalendar::haveDefaultCentury() const\n{\n return TRUE;\n}\n\nstatic void U_CALLCONV\ninitializeSystemDefaultCentury()\n{\n // initialize systemDefaultCentury and systemDefaultCenturyYear based\n // on the current time. They'll be set to 80 years before\n // the current time.\n UErrorCode status = U_ZERO_ERROR;\n GregorianCalendar calendar(status);\n if (U_SUCCESS(status)) {\n calendar.setTime(Calendar::getNow(), status);\n calendar.add(UCAL_YEAR, -80, status);\n\n gSystemDefaultCenturyStart = calendar.getTime(status);\n gSystemDefaultCenturyStartYear = calendar.get(UCAL_YEAR, status);\n }\n // We have no recourse upon failure unless we want to propagate the failure\n // out.\n}\n\nUDate GregorianCalendar::defaultCenturyStart() const {\n // lazy-evaluate systemDefaultCenturyStart\n umtx_initOnce(gSystemDefaultCenturyInit, &initializeSystemDefaultCentury);\n return gSystemDefaultCenturyStart;\n}\n\nint32_t GregorianCalendar::defaultCenturyStartYear() const {\n // lazy-evaluate systemDefaultCenturyStartYear\n umtx_initOnce(gSystemDefaultCenturyInit, &initializeSystemDefaultCentury);\n return gSystemDefaultCenturyStartYear;\n}\n\nU_NAMESPACE_END\n\n#endif /* #if !UCONFIG_NO_FORMATTING */\n\n//eof\n", "meta": {"content_hash": "077e4d89315d2e1ef2471d36990d9cf3", "timestamp": "", "source": "github", "line_count": 1283, "max_line_length": 162, "avg_line_length": 37.81605611847233, "alnum_prop": 0.5825672946123088, "repo_name": "endlessm/chromium-browser", "id": "6b15171c12b9ac4e2911f2749afaaaefe66d95c2", "size": "50660", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "third_party/icu/source/i18n/gregocal.cpp", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "package smo;\n\n\n/**\n * @author kilian mock\n * @version 08,11.15\n * stellt controler dh.action listener f\u00fcr das lotto programm dar\n */\nimport java.awt.event.*;\n\nimport javax.swing.JToggleButton;\nimport javax.swing.plaf.basic.BasicBorders.ToggleButtonBorder;\npublic class Controller implements ActionListener {\n\t // Attribute: Model und View\n\t private Model m;\n\t private View v;\n\n\t /**\n\t * Kontruktor: erzeugt Model und View\n\t */\n\t public Controller() {\n\t\t this.m = new Model();\n\t\t this.v = new View(this.m, this);\n\t }\n\n\t /**\n\t * @param e der event der den aufruf bewirkt hat\n\t * \n\t * \u00fcberpr\u00fcft von was er aufgerufen wurde und ruft demensprechend die richtigen methoden auf\n\t */\n\t public void actionPerformed(ActionEvent e) {\n\t\t if (e.getActionCommand() == \"neue ziehung\")\n\t\t {\n\t\t\t m.ziehen();\n\t\t\t v.auswertung();\n\t\t\t System.out.println(\"los\");\n\t\t\t return;\n\t\t }\n\t\t if (e.getActionCommand() == \"auswerten\")\n\t\t {\n\t\t\t v.auswertung();\n\t\t\t return;\n\t\t }\n\t\t JToggleButton a = (JToggleButton) e.getSource();\n\t\t v.addToTip(Integer.parseInt(a.getText()));\n\t }\n\t}\n", "meta": {"content_hash": "53be3f298c21808108a33b62f0466bdb", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 93, "avg_line_length": 22.46808510638298, "alnum_prop": 0.6628787878787878, "repo_name": "mockerl/A09_Teamarbeit2", "id": "e0fba846db2ffcabe20cd64a6062ccdaf5fd1fca", "size": "1056", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/smo/Controller.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "7168"}]}} +{"text": "<?php\n\n\n\nnamespace {\n\nfrom('Hoa')\n\n/**\n * \\Hoa\\Console\\Cursor\n */\n-> import('Console.Cursor')\n\n/**\n * \\Hoa\\Console\\Window\n */\n-> import('Console.Window');\n\n}\n\nnamespace Hoa\\Console\\Chrome {\n\n/**\n * Class \\Hoa\\Console\\Chrome\\Text.\n *\n * This class builts the text layout.\n *\n * @author Ivan Enderlin <ivan.enderlin@hoa-project.net>\n * @copyright Copyright \u00a9 2007-2014 Ivan Enderlin.\n * @license New BSD License\n */\n\nclass Text {\n\n /**\n * Align the text to left.\n *\n * @const int\n */\n const ALIGN_LEFT = 0;\n\n /**\n * Align the text to right.\n *\n * @const int\n */\n const ALIGN_RIGHT = 1;\n\n /**\n * Align the text to center.\n *\n * @const int\n */\n const ALIGN_CENTER = 2;\n\n\n\n /**\n * Colorize a portion of a text.\n * It is kind of a shortcut of \\Hoa\\Console\\Color.\n *\n * @access public\n * @param string $text Text.\n * @param string $attributesBefore Style to apply.\n * @param string $attributesAfter Reset style.\n * @return string\n */\n public static function colorize ( $text, $attributesBefore,\n $attributesAfter = 'normal' ) {\n\n ob_start();\n \\Hoa\\Console\\Cursor::colorize($attributesBefore);\n echo $text;\n \\Hoa\\Console\\Cursor::colorize($attributesAfter);\n $out = ob_get_contents();\n ob_end_clean();\n\n return $out;\n }\n\n /**\n * Built column from an array.\n * The array has this structure :\n * array(\n * array('Firstname', 'Lastname', 'Love', 'Made' ),\n * array('Ivan', 'Enderlin', 'Hoa' ),\n * array('Rasmus', 'Lerdorf' ),\n * array(null, 'Berners-Lee', null, 'The Web')\n * )\n * The cell can have a new-line character (\\n).\n * The column can have a global alignement, a horizontal and a vertical\n * padding (this horizontal padding is actually the right padding), and a\n * separator.\n * Separator has this form : 'first-column|second-column|third-column|\u2026'.\n * For example : '|: ', will set a ': ' between the first and second column,\n * and nothing for the other.\n *\n * @access public\n * @param Array $line The table represented by an array\n * (see the documentation).\n * @param int $alignement The global alignement of the text\n * in cell.\n * @param int $horizontalPadding The horizontal padding (right\n * padding).\n * @param int $verticalPadding The vertical padding.\n * @param string $separator String where each character is a\n * column separator.\n * @return string\n */\n public static function columnize ( Array $line,\n $alignement = self::ALIGN_LEFT,\n $horizontalPadding = 2,\n $verticalPadding = 0,\n $separator = null ) {\n\n if(empty($line))\n return '';\n\n $separator = explode('|', $separator);\n $nbColumn = 0;\n $nbLine = count($line);\n $xtraWidth = 2 * ($verticalPadding + 2); // + separator\n\n // Get the number of column.\n foreach($line as $key => &$column) {\n\n if(!is_array($column))\n $column = array(0 => $column);\n\n $handle = count($column);\n $handle > $nbColumn and $nbColumn = $handle;\n }\n\n $xtraWidth += $horizontalPadding * $nbColumn;\n\n // Get the column width.\n $columnWidth = array_fill(0, $nbColumn, 0);\n\n for($e = 0; $e < $nbColumn; $e++) {\n\n for($i = 0; $i < $nbLine; $i++) {\n\n if(!isset($line[$i][$e]))\n continue;\n\n $handle = self::getMaxLineWidth($line[$i][$e]);\n $handle > $columnWidth[$e] and $columnWidth[$e] = $handle;\n }\n }\n\n // If the sum of each column is greater than the window width, we reduce\n // all greaters columns.\n $window = \\Hoa\\Console\\Window::getSize();\n $envWindow = $window['x'];\n\n while($envWindow <= ($cWidthSum = $xtraWidth + array_sum($columnWidth))) {\n\n $diff = $cWidthSum - $envWindow;\n $max = max($columnWidth) - $xtraWidth;\n $newWidth = $max - $diff;\n $i = array_search(max($columnWidth), $columnWidth);\n $columnWidth[$i] = $newWidth;\n\n foreach($line as $key => &$c)\n if(isset($c[$i]))\n $c[$i] = self::wordwrap($c[$i], $newWidth);\n }\n\n // Manage the horizontal right padding.\n $columnWidth = array_map(\n function ( $x ) use ( $horizontalPadding ) {\n\n return $x + 2 * $horizontalPadding;\n },\n $columnWidth\n );\n\n // Prepare the new table, i.e. a new line (\\n) must be a new line in the\n // array (structurally meaning).\n $newLine = array();\n foreach($line as $key => $plpl) {\n\n $i = self::getMaxLineNumber($plpl);\n while($i-- >= 0)\n $newLine[] = array_fill(0, $nbColumn, null);\n }\n\n $yek = 0;\n foreach($line as $key => $col) {\n\n foreach($col as $kkey => $value) {\n\n if(false === strpos($value, \"\\n\")) {\n\n $newLine[$yek][$kkey] = $value;\n continue;\n }\n\n foreach(explode(\"\\n\", $value) as $foo => $oof)\n $newLine[$yek + $foo][$kkey] = $oof;\n }\n\n $i = self::getMaxLineNumber($col);\n $i > 0 and $yek += $i;\n $yek++;\n }\n\n // Place the column separator.\n foreach($newLine as $key => $col)\n foreach($col as $kkey => $value)\n if(isset($separator[$kkey]))\n $newLine[$key][$kkey] = $separator[$kkey] .\n str_replace(\n \"\\n\",\n \"\\n\" . $separator[$kkey],\n $value\n );\n\n $line = $newLine;\n unset($newLine);\n $nbLine = count($line);\n\n // Complete the table with empty cells.\n foreach($line as $key => &$column) {\n\n $handle = count($column);\n\n if($nbColumn - $handle > 0)\n $column += array_fill($handle, $nbColumn - $handle, null);\n }\n\n // Built !\n $out = null;\n $dash = $alignement === self::ALIGN_LEFT ? '-' : '';\n foreach($line as $key => $handle) {\n\n $format = null;\n\n foreach($handle as $i => $hand)\n if(preg_match_all('#(\\\\e\\[[0-9]+m)#', $hand, $match)) {\n\n $a = $columnWidth[$i];\n\n foreach($match as $m)\n $a += strlen($m[1]);\n\n $format .= '%' . $dash . ($a + floor(count($match) / 2)) . 's';\n }\n else\n $format .= '%' . $dash . $columnWidth[$i] . 's';\n\n $format .= str_repeat(\"\\n\", $verticalPadding + 1);\n\n array_unshift($handle, $format);\n $out .= call_user_func_array('sprintf', $handle);\n }\n\n return $out;\n }\n\n /**\n * Align a text according a \u201clayer\u201d. The layer width is given in arguments.\n *\n * @access public\n * @param string $text The text.\n * @param string $alignement The text alignement.\n * @param int $width The layer width.\n * @return string\n */\n public static function align ( $text,\n $alignement = self::ALIGN_LEFT,\n $width = null ) {\n\n if(null === $width) {\n\n $window = \\Hoa\\Console\\Window::getSize();\n $width = $window['x'];\n }\n\n $out = null;\n\n switch($alignement) {\n\n case self::ALIGN_LEFT:\n $out .= sprintf('%-' . $width . 's', self::wordwrap($text, $width));\n break;\n\n case self::ALIGN_CENTER:\n foreach(explode(\"\\n\", self::wordwrap($text, $width)) as $key => $value)\n $out .= str_repeat(' ', ceil(($width - strlen($value)) / 2)) .\n $value . \"\\n\";\n break;\n \n case self::ALIGN_RIGHT:\n default:\n foreach(explode(\"\\n\", self::wordwrap($text, $width)) as $key => $value)\n $out .= sprintf('%' . $width . 's' . \"\\n\", $value);\n break;\n }\n\n return $out;\n }\n\n /**\n * Get the maximum line width.\n *\n * @access protected\n * @param mixed $lines The line (or group of lines).\n * @return int\n */\n protected static function getMaxLineWidth ( $lines ) {\n\n if(!is_array($lines))\n $lines = array(0 => $lines);\n\n $width = 0;\n\n foreach($lines as $foo => $line)\n foreach(explode(\"\\n\", $line) as $fooo => $lin) {\n\n $lin = preg_replace('#\\\\e\\[[0-9]+m#', '', $lin);\n strlen($lin) > $width and $width = strlen($lin);\n }\n\n return $width;\n }\n\n /**\n * Get the maximum line number (count the new-line character).\n *\n * @access protected\n * @param mixed $lines The line (or group of lines).\n * @return int\n */\n protected static function getMaxLineNumber ( $lines ) {\n\n if(!is_array($lines))\n $lines = array(0 => $lines);\n\n $number = 0;\n\n foreach($lines as $foo => $line)\n substr_count($line, \"\\n\") > $number and\n $number = substr_count($line, \"\\n\");\n\n return $number;\n }\n\n /**\n * My own wordwrap (just force the wordwrap() $cut parameter)..\n *\n * @access public\n * @param string $text Text to wrap.\n * @param int $width Line width.\n * @param string $break String to make the break.\n * @return string\n */\n public static function wordwrap ( $text, $width = null, $break = \"\\n\" ) {\n\n if(null === $width) {\n\n $window = \\Hoa\\Console\\Window::getSize();\n $width = $window['x'];\n }\n\n return wordwrap($text, $width, $break, true);\n }\n\n /**\n * Underline with a special string.\n *\n * @access public\n * @param string $text The text to underline.\n * @param string $pattern The string used to underline.\n * @return string\n */\n public static function underline ( $text, $pattern = '*' ) {\n\n $text = explode(\"\\n\", $text);\n $card = strlen($pattern);\n\n foreach($text as $key => &$value) {\n\n $i = -1;\n $max = strlen($value);\n while($value{++$i} == ' ' && $i < $max);\n\n $underline = str_repeat(' ', $i) .\n str_repeat($pattern, strlen(trim($value)) / $card) .\n str_repeat(' ', strlen($value) - $i - strlen(trim($value)));\n\n $value .= \"\\n\" . $underline;\n }\n\n return implode(\"\\n\", $text);\n }\n}\n\n}\n", "meta": {"content_hash": "a80ad034bab4fa431de3cb1dc0baa3a4", "timestamp": "", "source": "github", "line_count": 399, "max_line_length": 87, "avg_line_length": 29.458646616541355, "alnum_prop": 0.4438489025012762, "repo_name": "Hywan/Central", "id": "00b22288c3c5a761a04a505ca5f00b6ee540ffc0", "size": "13402", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Hoa/Console/Chrome/Text.php", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "SYNONYM\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "f1b13be423898476ab3882c2181b09ae", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "bed68684234ce41d9d8d2e3eb36bcc50bbff8b6d", "size": "185", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Bromeliaceae/Pitcairnia/Pitcairnia integrifolia/ Syn. Pitcairnia anthericoides/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "/* ==========================================================================\n* ALGO STREAK DETECTION\n* ========================================================================== */\n\n/* ==========================================================================\n* MODULE FILE NAME: function.cpp\n* MODULE TYPE: \n*\n* FUNCTION: Function for image elaboration.\n* PURPOSE: \n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* DESIGN ISSUE: None\n* INTERFACES: None\n* SUBORDINATES: None.\n*\n* HISTORY: See table below.\n*\n* 27-Jul-2016 | Francesco Diprima | 0.0 |\n* Initial creation of this file.\n*\n* ========================================================================== */\n\n/* ==========================================================================\n* INCLUDES\n* ========================================================================== */\n#include <iostream>\n#include <opencv2/opencv.hpp>\n#include <opencv/highgui.h>\n#include \"opencv2/gpu/gpu.hpp\"\n#include \"externalClass.cu\" // important to include .cu file, not header file\n\n#include \"function_GPU.h\"\n#include \"macros.h\"\n\n\n/* ==========================================================================\n* MODULE PRIVATE MACROS\n* ========================================================================== */\n\n/* ==========================================================================\n* MODULE PRIVATE TYPE DECLARATIONS\n* ========================================================================== */\n\n/* ==========================================================================\n* STATIC VARIABLES FOR MODULE\n* ========================================================================== */\n\n/* ==========================================================================\n* STATIC MEMBERS\n* ========================================================================== */\n\n/* ==========================================================================\n* NAME SPACE\n* ========================================================================== */\n \n/* ==========================================================================\n* FUNCTION NAME: backgroundEstimation\n* FUNCTION DESCRIPTION: Background Estimation\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\ncv::gpu::GpuMat backgroundEstimation(const cv::gpu::GpuMat& imgInOr, const cv::Point backCnt, cv::Mat& meanBg, cv::Mat& stdBg)\n{\n cv::gpu::GpuMat imgIn = imgInOr.clone();\n size_t backSzR = static_cast<size_t>(::round(imgIn.rows / backCnt.y));\n size_t backSzC = static_cast<size_t>(::round(imgIn.cols / backCnt.x));\n \n std::vector<int> vBackSrow;\n std::vector<int> vBackScol;\n\n for (size_t o = 0; o < backCnt.y; ++o)\n {\n vBackSrow.push_back(backSzR*o);\n }\n vBackSrow.push_back(imgIn.rows);\n\n for (size_t o = 0; o < backCnt.x; ++o)\n {\n vBackScol.push_back(backSzC*o);\n }\n vBackScol.push_back(imgIn.cols);\n \n cv::gpu::GpuMat outImg = cv::gpu::createContinuous(imgIn.rows, imgIn.cols, imgIn.type());\n //in cpu braso a zero\n\n for (size_t i = 0; i < backCnt.y; ++i)\n {\n for (size_t j = 0; j < backCnt.x; ++j)\n {\n const cv::Point ptTL = {vBackScol.at(j), vBackSrow.at(i)};\n const cv::Point ptBR = {vBackScol.at(j+1), vBackSrow.at(i+1)};\n\n cv::Rect region_of_interest = cv::Rect(ptTL, ptBR);\n cv::gpu::GpuMat imgPart = imgIn(region_of_interest);\n cv::gpu::GpuMat imgPartTh = cv::gpu::createContinuous(imgPart.rows, imgPart.cols, imgPart.type());\n //in cpu braso a zero\n cv::gpu::GpuMat imgPart2 = cv::gpu::createContinuous(imgPart.rows, imgPart.cols, imgPart.type());\n \n float oldStd=0;\n float diffPercStd = 1;\n\n cv::Scalar bg_mean = 0;\n cv::Scalar bg_std = 0;\n cv::gpu::meanStdDev(imgPart, bg_mean, bg_std);\n\n meanBg.at<double>(i, j) = bg_mean.val[0];\n //meanBg.at<double>(i,j) = *(cv::mean(imgPart, cv::noArray()).val); Not exist mean for gpu\n\n while (diffPercStd>0.2f)\n {\n cv::Scalar meanBGmod = 0;\n cv::Scalar stdBGs = 0;\n cv::gpu::meanStdDev(imgPart, meanBGmod, stdBGs);\n \n stdBg.at<double>(i,j) = stdBGs.val[0];//*(stdBGs.val);\n\n double threshH = meanBg.at<double>(i,j)+2.5*stdBg.at<double>(i,j);//3\n\n double maxval = 1.0;\n double asdf = cv::gpu::threshold(imgPart, imgPartTh, threshH, maxval, cv::THRESH_BINARY_INV);\n\n cv::gpu::multiply(imgPart, imgPartTh, imgPart2, cv::gpu::Stream::Null());\n\n diffPercStd = ::abs((stdBg.at<double>(i,j)-oldStd)/stdBg.at<double>(i,j));\n oldStd=stdBg.at<double>(i,j); \n }\n \n /*cv::gpu::GpuMat img_RoI = outImg(region_of_interest);\n imgPart2.copyTo(img_RoI);\n //imgPart2.copyTo(outImg(region_of_interest).ptr());*/\n\n /*externalClass kernelCUDA;\n kernelCUDA.fillImgCUDAKernel(imgPart2, outImg, ptTL.x, ptTL.y, ptBR.x, ptBR.y);*/\n\n }\n }\n\n#if SPD_FIGURE_1\n cv::Mat result_host;\n outImg.download(result_host);\n // Create a window for display.\n namedWindow(\"Background estimation\", cv::WINDOW_NORMAL);\n imshow(\"Background estimation\", result_host);\n cv::waitKey(0);\n#endif\n\n return outImg;\n}\n\n/* ==========================================================================\n* FUNCTION NAME: gaussianFilter\n* FUNCTION DESCRIPTION: Gaussian lowpass filter\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\ncv::gpu::GpuMat gaussianFilter(const cv::gpu::GpuMat& imgIn, int hsize[2], double sigma)\n{\n //cv::gpu::GpuMat imgOut;\n cv::gpu::GpuMat imgOut = \n cv::gpu::createContinuous(imgIn.rows, imgIn.cols, imgIn.type());\n\n cv::Size h = { hsize[0], hsize[1] };\n\n int columnBorderType=-1;\n cv::gpu::GaussianBlur(imgIn, imgOut, h, sigma, sigma, cv::BORDER_DEFAULT, columnBorderType);\n \n#if SPD_FIGURE_1\n cv::Mat result_host;\n imgOut.download(result_host);\n // Create a window for display.\n namedWindow(\"Gaussain filter GPU\", cv::WINDOW_NORMAL);\n imshow(\"Gaussain filter GPU\", result_host);\n cv::waitKey(0);\n#endif\n\n return imgOut;\n}\n\n/* ==========================================================================\n* FUNCTION NAME: subtractImage\n* FUNCTION DESCRIPTION: Subtraction of images, matrix-matrix difference.\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\ncv::gpu::GpuMat subtractImage(const cv::gpu::GpuMat& imgA, const cv::gpu::GpuMat& imgB)\n{\n cv::gpu::GpuMat imgOut = \n cv::gpu::createContinuous(imgA.rows, imgA.cols, imgA.type());\n \n cv::gpu::subtract(imgA, imgB, imgOut);\n \n#if SPD_FIGURE_1\n cv::Mat result_host;\n imgOut.download(result_host);\n // Create a window for display.\n namedWindow(\"Subtracted image GPU\", cv::WINDOW_NORMAL);\n imshow(\"Subtracted image GPU\", result_host);\n cv::waitKey(0);\n#endif\n \n return imgOut;\n}\n\n/* ==========================================================================\n* FUNCTION NAME: addiction\n* FUNCTION DESCRIPTION: Addiction of images, matrix-matrix addiction.\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\ncv::gpu::GpuMat addiction(const cv::gpu::GpuMat& imgA, const cv::gpu::GpuMat& imgB)\n{\n cv::gpu::GpuMat imgOut = \n cv::gpu::createContinuous(imgA.rows, imgA.cols, imgA.type());\n \n cv::gpu::add(imgA, imgB, imgOut);\n \n#if SPD_FIGURE_1\n cv::Mat result_host;\n imgOut.download(result_host);\n // Create a window for display.\n namedWindow(\"Subtracted image GPU\", cv::WINDOW_NORMAL);\n imshow(\"Subtracted image GPU\", result_host);\n cv::waitKey(0);\n#endif\n \n return imgOut;\n}\n\n/* ==========================================================================\n* FUNCTION NAME: morphologyOpen\n* FUNCTION DESCRIPTION: Morphology opening\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\ncv::gpu::GpuMat morphologyOpen(const cv::gpu::GpuMat& imgIn, int dimLine, double teta_streak)\n{\n //cv::gpu::GpuMat imgOut;\n cv::gpu::GpuMat imgOut = \n cv::gpu::createContinuous(imgIn.rows, imgIn.cols, imgIn.type());\n\n int iter = 1;\n cv::Point anchor = cv::Point(-1, -1);\n\n //InputArray kernel;\n cv::Mat horizontalStructure = getStructuringElement(cv::MORPH_RECT, cv::Size(dimLine, 1));\n\n cv::gpu::morphologyEx(imgIn, imgOut, cv::MORPH_OPEN, horizontalStructure, anchor, iter);\n \n#if SPD_FIGURE_1\n cv::Mat result_host;\n imgOut.download(result_host);\n // Create a window for display.\n namedWindow(\"Morphology opening with rectangular kernel GPU\", cv::WINDOW_NORMAL);\n imshow(\"Morphology opening with rectangular kernel GPU\", result_host);\n cv::waitKey(0);\n#endif\n\n return imgOut;\n}\n\n/* ==========================================================================\n* FUNCTION NAME: morphologyOpen\n* FUNCTION DESCRIPTION: Morphology opening with circular structuring element\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\ncv::gpu::GpuMat morphologyOpen(const cv::gpu::GpuMat& imgIn, int rad)\n{\n cv::gpu::GpuMat imgOut =\n cv::gpu::createContinuous(imgIn.rows, imgIn.cols, imgIn.type());\n\n int iter = 1;\n cv::Point anchor = cv::Point(-1, -1);\n cv::Size size = cv::Size(rad, rad);\n\n //InputArray kernel;\n cv::Mat horizontalStructure = getStructuringElement(cv::MORPH_ELLIPSE, size, anchor);\n\n cv::gpu::morphologyEx(imgIn, imgOut, cv::MORPH_OPEN, horizontalStructure, anchor, iter);\n\n#if SPD_FIGURE_1\n cv::Mat result_host;\n imgOut.download(result_host);\n // Create a window for display.\n namedWindow(\"Morphology opening with circular kernel\", cv::WINDOW_NORMAL);\n imshow(\"Morphology opening with circular kernel\", result_host);\n cv::waitKey(0);\n#endif\n\n return imgOut;\n}\n\n/* ==========================================================================\n* FUNCTION NAME: binarization\n* FUNCTION DESCRIPTION: Image binarization\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\ncv::gpu::GpuMat binarization(const cv::gpu::GpuMat& imgIn)\n{\n //cv::gpu::GpuMat imgOut, binImg;\n \n cv::gpu::GpuMat imgOut = \n cv::gpu::createContinuous(imgIn.rows, imgIn.cols, imgIn.type());\n \n cv::gpu::GpuMat binImg = \n cv::gpu::createContinuous(imgIn.rows, imgIn.cols, imgIn.type()); \n \n double maxval = 255.0;\n double level = 0.0;\n \n level = cv::gpu::threshold(imgIn, binImg, cv::THRESH_OTSU, maxval, cv::THRESH_BINARY);\n \n level = level * 2.5;//1.5\n \n cv::gpu::threshold(imgIn, imgOut, level, maxval, cv::THRESH_BINARY);\n \n#if SPD_FIGURE_1\n /* Create a window for display.\n namedWindow(\"Binary image\", WINDOW_NORMAL);\n imshow(\"Binary image\", binImg);*/\n\n cv::Mat result_host;\n imgOut.download(result_host);\n // Create a window for display.\n namedWindow(\"Binary image Otsu threshold GPU\", cv::WINDOW_NORMAL);\n imshow(\"Binary image Otsu threshold GPU\", result_host);\n cv::waitKey(0);\n#endif\n\n return imgOut;\n}\n\n/* ==========================================================================\n* FUNCTION NAME: binarizationZone\n* FUNCTION DESCRIPTION: Image binarization using user threshold\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\ncv::gpu::GpuMat binarizationZone(const cv::gpu::GpuMat& imgIn, const cv::Point zoneCnt, const cv::Mat& level)\n{\n size_t zoneSzR = static_cast<size_t>(::round(imgIn.rows / zoneCnt.y));\n size_t zoneSzC = static_cast<size_t>(::round(imgIn.cols / zoneCnt.x));\n \n std::vector<int> vBackSrow;\n std::vector<int> vBackScol;\n\n for (size_t o = 0; o < zoneCnt.y; ++o)\n {\n vBackSrow.push_back(zoneSzR*o);\n }\n vBackSrow.push_back(imgIn.rows);\n\n for (size_t o = 0; o < zoneCnt.x; ++o)\n {\n vBackScol.push_back(zoneSzC*o);\n }\n vBackScol.push_back(imgIn.cols);\n \n cv::gpu::GpuMat outImg = cv::gpu::createContinuous(imgIn.rows, imgIn.cols, imgIn.type());\n \n for (size_t i = 0; i < zoneCnt.y; ++i)\n {\n for (size_t j = 0; j < zoneCnt.x; ++j)\n {\n const cv::Point ptTL = { vBackScol.at(j), vBackSrow.at(i) };\n const cv::Point ptBR = { vBackScol.at(j + 1), vBackSrow.at(i + 1) };\n\n cv::Rect region_of_interest = cv::Rect(ptTL, ptBR);\n cv::gpu::GpuMat imgPart = imgIn(region_of_interest);\n cv::gpu::GpuMat imgPartTh = cv::gpu::createContinuous(imgPart.rows, imgPart.cols, imgPart.type());\n\n double maxval = 255.0;\n double asdf = cv::gpu::threshold(imgPart, imgPartTh, level.at<double>(i,j), maxval, cv::THRESH_BINARY);\n \n cv::gpu::GpuMat img_RoI = outImg(region_of_interest);\n imgPart.copyTo(img_RoI);\n }\n }\n \n#if SPD_FIGURE_1\n cv::Mat result_host;\n outImg.download(result_host);\n namedWindow(\"Binary image user thresholdZones\", cv::WINDOW_NORMAL);\n imshow(\"Binary image user thresholdZones\", result_host);\n cv::waitKey(0);\n#endif\n\n return outImg;\n}\n\n#if 0\n/* ==========================================================================\n* FUNCTION NAME: binarizationDiffTh\n* FUNCTION DESCRIPTION: Image binarization\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\ncv::gpu::GpuMat binarizationDiffTh(cv::gpu::GpuMat& imgIn, int flag)\n{\n cv::gpu::GpuMat imgOut, binImg;\n cv::gpu::GpuMat subBImgTL, subBImgTR, subBImgBL, subBImgBR;\n\n cv::Point imgSz = { imgIn.rows, imgIn.cols };\n\n /*int dims[] = { 5, 1 };\n cv::Mat level(2, dims, CV_64F);*/\n\n cv::gpu::GpuMat subImageTL(imgIn, cv::Rect(0, 0, imgIn.cols/2, imgIn.rows/2));\n cv::gpu::GpuMat subImageTR(imgIn, cv::Rect(0, imgIn.rows/2, imgIn.cols/2, imgIn.rows/2));\n cv::gpu::GpuMat subImageBL(imgIn, cv::Rect(0, imgIn.rows/2, imgIn.cols/2, imgIn.rows/2));\n cv::gpu::GpuMat subImageBR(imgIn, cv::Rect(imgIn.cols/2, imgIn.rows/2, imgIn.cols/2, imgIn.rows/2));\n\n \n double maxval = 1.0;\n double level1 = 0.0;\n double level2 = 0.0;\n double level3 = 0.0;\n double level4 = 0.0;\n double level5 = 0.0;\n\n level1 = cv::gpu::threshold(subImageTL, subBImgTL, cv::THRESH_OTSU, maxval, cv::THRESH_BINARY);\n level2 = cv::gpu::threshold(subImageTR, subBImgTR, cv::THRESH_OTSU, maxval, cv::THRESH_BINARY);\n level3 = cv::gpu::threshold(subImageBL, subBImgBL, cv::THRESH_OTSU, maxval, cv::THRESH_BINARY);\n level4 = cv::gpu::threshold(subImageBR, subBImgBR, cv::THRESH_OTSU, maxval, cv::THRESH_BINARY);\n level5 = cv::gpu::threshold(binImg , imgOut, cv::THRESH_OTSU, maxval, cv::THRESH_BINARY);\n\n level1 = level1 *1.5;\n level2 = level2 *1.5;\n level3 = level3 *1.5;\n level4 = level4 *1.5;\n level5 = level5 *1.5;\n\n /*media mediana ordinamento */\n\n /*da completare*/\n\n if (SPD_FIGURE_1)\n {\n // Create a window for display.\n namedWindow(\"Binary image\", cv::WINDOW_NORMAL);\n imshow(\"Binary image\", imgOut);\n }\n\n return imgOut;\n}\n#endif\n\n/* ==========================================================================\n* FUNCTION NAME: hough\n* FUNCTION DESCRIPTION: Hough transform\n* CREATION DATE: 20160911\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\nstd::vector<std::pair<float, int>> hough(const cv::gpu::GpuMat& imgIn)\n{\n double rho = 1; //0.5;\n double theta = 2*CV_PI / 180; //CV_PI / (2*180); r:pi=g:180\n int threshold = 60;\n \n //std::vector<cv::Vec2f> houghVal;\n cv::gpu::GpuMat houghVal;\n bool doSort = true; \n int maxLines = 5;\n\n cv::gpu::HoughLines(imgIn, houghVal, rho, theta, threshold, doSort, maxLines);\n \n#if 0\n // Select the inclination angles\n std::vector<float> angle;\n for (size_t i = 0; i < houghVal.size(); ++i)\n {\n angle.push_back(houghVal.at(i)[1]);\n }\n angle.push_back(CV_PI / 2); //Force research at 0\\B0\n \n int count = 0;\n std::vector<std::pair<float, int>> countAngle;\n for (size_t i = 0; i < houghVal.size(); ++i)\n {\n int a = std::count(angle.begin(), angle.end(), angle.at(i));\n countAngle.push_back(std::make_pair(angle.at(i), a));\n count = count + a;\n if (houghVal.size() == count) break;\n }\n#else\n std::vector<std::pair<float, int>> countAngle;\n#endif\n\n#if SPD_FIGURE_1\n cv::Mat color_dst;\n cvtColor( imgIn, color_dst, CV_GRAY2BGR );\n double minLineLength = 20;\n double maxLineGap = 1;\n std::vector<cv::Vec4i> lines;\n HoughLinesP(imgIn, lines, rho, theta, threshold, minLineLength, maxLineGap);\n\n for (size_t i = 0; i < lines.size(); i++) {\n line(color_dst, cv::Point(lines[i][0], lines[i][1]),\n cv::Point(lines[i][2], lines[i][3]), cv::Scalar(0, 0, 255), 3, 8);\n }\n\n // Create a window for display.\n namedWindow(\"Hough transform\", cv::WINDOW_NORMAL);\n imshow(\"Hough transform\", color_dst);\n cv::waitKey(0);\n#endif\n \n return countAngle;\n}\n\n/* ==========================================================================\n* FUNCTION NAME: convolution\n* FUNCTION DESCRIPTION: Image convolution\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\ncv::gpu::GpuMat convolution(const cv::gpu::GpuMat& imgIn, const cv::Mat& kernel, double thresh)\n{\n //cv::gpu::GpuMat imgOut, convImg;\n cv::gpu::GpuMat imgOut = \n cv::gpu::createContinuous(imgIn.rows, imgIn.cols, imgIn.type());\n \n /*cv::gpu::GpuMat convImg = \n cv::gpu::createContinuous(imgIn.rows, imgIn.cols, imgIn.type());*/\n cv::gpu::GpuMat convImg; \n \n /*kernel_size = 3 + 2 * (ind % 5);\n kernel = Mat::ones(kernel_size, kernel_size, CV_32F) / (float)(kernel_size*kernel_size);*/\n\n int ddepth = -1;\n cv::Point anchor = cv::Point(-1, -1);\n cv::gpu::Stream stream;\n stream.Null();\n \n std::cout << \"prima di filter2d \" << std::endl;\n cv::gpu::filter2D(imgIn, convImg, ddepth, kernel, anchor, cv::BORDER_DEFAULT);\n std::cout << \"dopo di filter2d \" << std::endl;\n/*thresh=1;\n cv::gpu::boxFilter(const_cast<const cv::gpu::GpuMat&>(imgIn), convImg, ddepth, kernel, anchor, stream);\n*/\n \n/*cv::Size ksize(3, 3);\n cv::gpu::blur(const_cast<const cv::gpu::GpuMat&>(imgIn), convImg, ksize, anchor, stream);\n*/ \n \n double maxval = 255.0;\n \n cv::gpu::threshold(convImg, imgOut, thresh, maxval, cv::THRESH_BINARY);\n//cv::gpu::threshold(imgIn, imgOut, thresh, maxval, cv::THRESH_BINARY);\n \n#if SPD_FIGURE_1\n cv::Mat result_host;\n imgOut.download(result_host);\n // Create a window for display.\n namedWindow(\"Convolution image GPU\", cv::WINDOW_NORMAL);\n imshow(\"Convolution image GPU\", result_host);\n#endif\n\n return imgOut;\n}\n\n/* ==========================================================================\n* FUNCTION NAME: iDivUp\n* FUNCTION DESCRIPTION: Rounded division \n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\nint iDivUp(int a, int b)\n{ \n return ((a % b) != 0) ? (a / b + 1) : (a / b); \n}\n\n/* ==========================================================================\n* FUNCTION NAME: gpuErrchk\n* FUNCTION DESCRIPTION: CUDA error check\n* CREATION DATE: 20160727\n* AUTHORS: Francesco Diprima\n* INTERFACES: None\n* SUBORDINATES: None\n* ========================================================================== */\n#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }\ninline void gpuAssert(cudaError_t code, char *file, int line, bool abort=true)\n{\n if (code != cudaSuccess) \n {\n fprintf(stderr,\"GPUassert: %s %s %d\\n\", cudaGetErrorString(code), file, line);\n if (abort) exit(code);\n }\n}\n", "meta": {"content_hash": "2895698cacea3d2c6915ef20b636aa4c", "timestamp": "", "source": "github", "line_count": 615, "max_line_length": 126, "avg_line_length": 33.702439024390245, "alnum_prop": 0.5393448159405606, "repo_name": "franaisd1a/repo_diprima", "id": "bdfbc26b2e77de1c4948bf8cfd812f7504692ba8", "size": "20727", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Dottorato/Algoritm_streak_detection/CPP/algoritm_streak_detection_cpp/src/function_GPU.cpp", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "2161"}, {"name": "C", "bytes": "9864"}, {"name": "C++", "bytes": "297610"}, {"name": "CMake", "bytes": "7886"}, {"name": "Cuda", "bytes": "82675"}, {"name": "M", "bytes": "1171"}, {"name": "Matlab", "bytes": "256744"}, {"name": "Shell", "bytes": "2584"}]}} +{"text": "<?php\n/**\n * PopStop is a PHP script that let's you stream your\n * movie collection to your browser.\n *\n * This software is distributed under the MIT License\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Visit http://www.popstop.io for more information\n *\n * @author Sebastian de Kok\n */\nclass MovieController extends BaseController {\n\n /**\n * Get a movie from the database by ID\n *\n * @param array $params\n * @return array\n */\n public function getMovieById($params) {\n $this->db->bind([\"id\" => $params['id']]);\n $movie = $this->db->fetch(\"SELECT * FROM movies WHERE movie_id = :id\", true);\n\n return $movie;\n }\n\n /**\n * Get a random featured movie from the database\n *\n * @return array|string\n */\n public function getFeaturedMovie() {\n $featured = $this->db->fetch('SELECT * FROM movies ORDER BY RANDOM()', true);\n\n if (!$featured) {\n return 'The database is empty, delete the database to start the installation process.';\n }\n\n return $featured;\n }\n\n\n /**\n * Get all the movies and order them correctly\n *\n * @param array $params\n * @return array\n */\n public function getMovies($params) {\n\n /** @var int $batch */\n $batch = $this->getSettings()['batch'];\n\n switch($params['type']) {\n case \"date\":\n $query = \"ORDER BY created_at desc\";\n break;\n case \"rating\":\n $query = \"ORDER BY vote_average desc\";\n break;\n case \"popular\":\n $query = \"ORDER BY popularity desc\";\n break;\n }\n\n //get current starting point of records\n $position = ($params['is_loaded']);\n $genre = (!empty($params['genre'])) ? $params['genre'] : '';\n $cast = (!empty($params['cast'])) ? $params['cast'] : '';\n $this->db->bind([\n \"position\" => $position,\n \"batch\" => $batch,\n \"genre\" => \"%$genre%\",\n \"cast\" => \"%$cast%\"\n ]);\n\n $movies = $this->db->fetch(\"SELECT * FROM movies INNER JOIN files ON movies.movie_id = files.movie_id\n WHERE (',' || genres || ',') LIKE :genre\n AND (',' || casts || ',') LIKE :cast\n $query LIMIT :position, :batch\");\n\n return ['movies' => $movies, 'batch' => $batch];\n }\n\n /**\n * Get the movie file location to play in the browser\n *\n * @param array $params\n * @return array\n */\n public function playMovie($params) {\n $this->db->bind([\"id\" => $params['id']]);\n $result = $this->db->fetch(\"SELECT * FROM movies INNER JOIN files\n ON movies.movie_id = files.movie_id\n WHERE movies.movie_id = :id\", true);\n\n return $result;\n }\n\n /**\n * Search the database for the movie\n *\n * @param array $params\n * @return array\n */\n public function searchMovies($params) {\n $query = $params['query'];\n $this->db->bind([\"query\" => \"$query*\"]);\n $result = $this->db->fetch(\"SELECT * FROM movies WHERE movies MATCH :query\");\n\n return $result;\n }\n\n /**\n * Get all the movie genres in the database\n *\n * @return array\n */\n public function getMovieGenres() {\n $genres = $this->db->fetch('SELECT genres FROM movies');\n\n foreach($genres as $genre) {\n $genres_explode = explode(',', $genre['genres']);\n foreach($genres_explode as $genre) {\n $array[] = $genre;\n }\n }\n /**\n * Sort the genres on alphabetical order\n */\n function sortAlphabetically($a, $b) {\n return strcmp($a, $b);\n }\n usort($array, \"sortAlphabetically\");\n\n return array_count_values($array);\n }\n\n /**\n * Get the movie cast by ID\n *\n * @param array $params\n * @return array\n */\n public function getMovieCastById($params) {\n $this->db->bind([\"id\" => $params['id']]);\n $movie = $this->db->fetch(\"SELECT casts FROM movies WHERE movie_id = :id\", true);\n\n $movieCast = explode(',', $movie['casts']);\n $casts = [];\n foreach($movieCast as $castId)\n {\n $this->db->bind([\"cast_id\" => $castId]);\n $casts[] = $this->db->fetch(\"SELECT * FROM casts WHERE cast_id = :cast_id\", true);\n }\n\n return ['casts' => $casts];\n }\n\n /**\n * Get the movie file location to play in the browser\n *\n * @param array $params\n * @return array\n */\n public function getMovieSubtitles($params) {\n\n $this->db->bind([\"id\" => $params['id']]);\n $result = $this->db->fetch(\"SELECT * FROM files WHERE movie_id = :id\", true);\n\n return $this->scan->getSubtitles($result['path'], $result['alias']);\n }\n\n /**\n * Save the current time of the movie\n *\n * @param array $params\n * @return array\n */\n public function saveCurrentTime($params) {\n $this->db->bind([\n \"current_at\" => $params['current_time'],\n \"movie_id\" => $params['movie_id']\n ]);\n\n $this->db->update(\"UPDATE movies SET resume_at = :current_at WHERE movie_id = :movie_id\");\n\n return ['saved' => true];\n }\n\n /**\n * Clean the database with the files that don't exist\n *\n * @return array\n */\n public function cleanDatabase() {\n $files = $this->db->fetch(\"SELECT docid, movies.movie_id, target FROM movies LEFT JOIN files\n ON movies.movie_id = files.movie_id\");\n\n $i = 0;\n foreach($files as $file) {\n $doc_id = $file['docid'];\n $movie_id = $file['movie_id'];\n\n if(!file_exists($file['target'])) {\n $this->db->query(\"DELETE FROM movies WHERE docid = $doc_id; DELETE FROM files WHERE movie_id = $movie_id\");\n $i++;\n }\n }\n\n return ['cleaned' => $i];\n }\n}\n", "meta": {"content_hash": "b715963582c19ab3015d62084eb57716", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 123, "avg_line_length": 28.72897196261682, "alnum_prop": 0.5013012361743656, "repo_name": "sebas7dk/popstop", "id": "c83cf63d087c1f99d8131407b35a77167cf46534", "size": "6148", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/Controllers/MovieController.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "47331"}, {"name": "HTML", "bytes": "4923"}, {"name": "JavaScript", "bytes": "54469"}, {"name": "PHP", "bytes": "36384"}]}} +{"text": " \r\n/* Includes ------------------------------------------------------------------*/\r\n\r\n#include \"usbh_ioreq.h\"\r\n#include \"usb_bsp.h\"\r\n#include \"usbh_hcs.h\"\r\n#include \"usbh_stdreq.h\"\r\n#include \"usbh_core.h\"\r\n#include \"usb_hcd_int.h\"\r\n\r\n/** @addtogroup USBH_LIB\r\n * @{\r\n */\r\n\r\n/** @addtogroup USBH_LIB_CORE\r\n* @{\r\n*/\r\n\r\n/** @defgroup USBH_CORE \r\n * @brief TThis file handles the basic enumaration when a device is connected \r\n * to the host.\r\n * @{\r\n */ \r\n\r\n/** @defgroup USBH_CORE_Private_TypesDefinitions\r\n * @{\r\n */ \r\nuint8_t USBH_Disconnected (USB_OTG_CORE_HANDLE *pdev); \r\nuint8_t USBH_Connected (USB_OTG_CORE_HANDLE *pdev); \r\nuint8_t USBH_SOF (USB_OTG_CORE_HANDLE *pdev); \r\n\r\nUSBH_HCD_INT_cb_TypeDef USBH_HCD_INT_cb = \r\n{\r\n USBH_SOF,\r\n USBH_Connected, \r\n USBH_Disconnected, \r\n};\r\n\r\nUSBH_HCD_INT_cb_TypeDef *USBH_HCD_INT_fops = &USBH_HCD_INT_cb;\r\n/**\r\n * @}\r\n */ \r\n\r\n\r\n/** @defgroup USBH_CORE_Private_Defines\r\n * @{\r\n */ \r\n/**\r\n * @}\r\n */ \r\n\r\n\r\n/** @defgroup USBH_CORE_Private_Macros\r\n * @{\r\n */ \r\n/**\r\n * @}\r\n */ \r\n\r\n\r\n/** @defgroup USBH_CORE_Private_Variables\r\n * @{\r\n */ \r\n/**\r\n * @}\r\n */ \r\n\r\n\r\n/** @defgroup USBH_CORE_Private_FunctionPrototypes\r\n * @{\r\n */\r\nstatic USBH_Status USBH_HandleEnum(USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost);\r\nUSBH_Status USBH_HandleControl (USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost);\r\n\r\n/**\r\n * @}\r\n */ \r\n\r\n\r\n/** @defgroup USBH_CORE_Private_Functions\r\n * @{\r\n */ \r\n\r\n\r\n/**\r\n * @brief USBH_Connected\r\n * USB Connect callback function from the Interrupt. \r\n * @param selected device\r\n * @retval Status\r\n*/\r\nuint8_t USBH_Connected (USB_OTG_CORE_HANDLE *pdev)\r\n{\r\n pdev->host.ConnSts = 1;\r\n return 0;\r\n}\r\n\r\n/**\r\n* @brief USBH_Disconnected\r\n* USB Disconnect callback function from the Interrupt. \r\n* @param selected device\r\n* @retval Status\r\n*/\r\n\r\nuint8_t USBH_Disconnected (USB_OTG_CORE_HANDLE *pdev)\r\n{\r\n pdev->host.ConnSts = 0;\r\n return 0; \r\n}\r\n\r\n/**\r\n * @brief USBH_SOF\r\n * USB SOF callback function from the Interrupt. \r\n * @param selected device\r\n * @retval Status\r\n */\r\n\r\nuint8_t USBH_SOF (USB_OTG_CORE_HANDLE *pdev)\r\n{\r\n /* This callback could be used to implement a scheduler process */\r\n return 0; \r\n}\r\n/**\r\n * @brief USBH_Init\r\n * Host hardware and stack initializations \r\n * @param class_cb: Class callback structure address\r\n * @param usr_cb: User callback structure address\r\n * @retval None\r\n */\r\nvoid USBH_Init(USB_OTG_CORE_HANDLE *pdev,\r\n USB_OTG_CORE_ID_TypeDef coreID,\r\n USBH_HOST *phost, \r\n USBH_Class_cb_TypeDef *class_cb, \r\n USBH_Usr_cb_TypeDef *usr_cb)\r\n{\r\n \r\n /* Hardware Init */\r\n USB_OTG_BSP_Init(pdev); \r\n \r\n /* configure GPIO pin used for switching VBUS power */\r\n USB_OTG_BSP_ConfigVBUS(0); \r\n \r\n \r\n /* Host de-initializations */\r\n USBH_DeInit(pdev, phost);\r\n \r\n /*Register class and user callbacks */\r\n phost->class_cb = class_cb;\r\n phost->usr_cb = usr_cb; \r\n \r\n /* Start the USB OTG core */ \r\n HCD_Init(pdev , coreID);\r\n \r\n /* Upon Init call usr call back */\r\n phost->usr_cb->Init();\r\n \r\n /* Enable Interrupts */\r\n USB_OTG_BSP_EnableInterrupt(pdev);\r\n}\r\n\r\n/**\r\n * @brief USBH_DeInit \r\n * Re-Initialize Host\r\n * @param None \r\n * @retval status: USBH_Status\r\n */\r\nUSBH_Status USBH_DeInit(USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost)\r\n{\r\n /* Software Init */\r\n \r\n phost->gState = HOST_IDLE;\r\n phost->gStateBkp = HOST_IDLE; \r\n phost->EnumState = ENUM_IDLE;\r\n phost->RequestState = CMD_SEND; \r\n \r\n phost->Control.state = CTRL_SETUP;\r\n phost->Control.ep0size = USB_OTG_MAX_EP0_SIZE; \r\n \r\n phost->device_prop.address = USBH_DEVICE_ADDRESS_DEFAULT;\r\n phost->device_prop.speed = HPRT0_PRTSPD_FULL_SPEED;\r\n \r\n USBH_Free_Channel (pdev, phost->Control.hc_num_in);\r\n USBH_Free_Channel (pdev, phost->Control.hc_num_out); \r\n return USBH_OK;\r\n}\r\n\r\n/**\r\n* @brief USBH_Process\r\n* USB Host core main state machine process\r\n* @param None \r\n* @retval None\r\n*/\r\nvoid USBH_Process(USB_OTG_CORE_HANDLE *pdev , USBH_HOST *phost)\r\n{\r\n volatile USBH_Status status = USBH_FAIL;\r\n \r\n \r\n /* check for Host port events */\r\n if ((HCD_IsDeviceConnected(pdev) == 0)&& (phost->gState != HOST_IDLE)) \r\n {\r\n if(phost->gState != HOST_DEV_DISCONNECTED) \r\n {\r\n phost->gState = HOST_DEV_DISCONNECTED;\r\n }\r\n }\r\n \r\n switch (phost->gState)\r\n {\r\n \r\n case HOST_IDLE :\r\n \r\n if (HCD_IsDeviceConnected(pdev)) \r\n {\r\n phost->gState = HOST_DEV_ATTACHED;\r\n USB_OTG_BSP_mDelay(100);\r\n }\r\n break;\r\n \r\n case HOST_DEV_ATTACHED :\r\n \r\n phost->usr_cb->DeviceAttached();\r\n phost->Control.hc_num_out = USBH_Alloc_Channel(pdev, 0x00);\r\n phost->Control.hc_num_in = USBH_Alloc_Channel(pdev, 0x80); \r\n \r\n /* Reset USB Device */\r\n if ( HCD_ResetPort(pdev) == 0)\r\n {\r\n phost->usr_cb->ResetDevice();\r\n /* Wait for USB USBH_ISR_PrtEnDisableChange() \r\n Host is Now ready to start the Enumeration \r\n */\r\n \r\n phost->device_prop.speed = HCD_GetCurrentSpeed(pdev);\r\n \r\n phost->gState = HOST_ENUMERATION;\r\n phost->usr_cb->DeviceSpeedDetected(phost->device_prop.speed);\r\n \r\n /* Open Control pipes */\r\n USBH_Open_Channel (pdev,\r\n phost->Control.hc_num_in,\r\n phost->device_prop.address,\r\n phost->device_prop.speed,\r\n EP_TYPE_CTRL,\r\n phost->Control.ep0size); \r\n \r\n /* Open Control pipes */\r\n USBH_Open_Channel (pdev,\r\n phost->Control.hc_num_out,\r\n phost->device_prop.address,\r\n phost->device_prop.speed,\r\n EP_TYPE_CTRL,\r\n phost->Control.ep0size); \r\n }\r\n break;\r\n \r\n case HOST_ENUMERATION: \r\n /* Check for enumeration status */ \r\n if ( USBH_HandleEnum(pdev , phost) == USBH_OK)\r\n { \r\n /* The function shall return USBH_OK when full enumeration is complete */\r\n \r\n /* user callback for end of device basic enumeration */\r\n phost->usr_cb->EnumerationDone();\r\n \r\n phost->gState = HOST_USR_INPUT; \r\n }\r\n break;\r\n \r\n case HOST_USR_INPUT: \r\n /*The function should return user response true to move to class state */\r\n if ( phost->usr_cb->UserInput() == USBH_USR_RESP_OK)\r\n {\r\n if((phost->class_cb->Init(pdev, phost))\\\r\n == USBH_OK)\r\n {\r\n phost->gState = HOST_CLASS_REQUEST; \r\n } \r\n } \r\n break;\r\n \r\n case HOST_CLASS_REQUEST: \r\n /* process class standard contol requests state machine */ \r\n status = phost->class_cb->Requests(pdev, phost);\r\n \r\n if(status == USBH_OK)\r\n {\r\n phost->gState = HOST_CLASS;\r\n } \r\n \r\n else\r\n {\r\n USBH_ErrorHandle(phost, status);\r\n }\r\n \r\n \r\n break; \r\n case HOST_CLASS: \r\n /* process class state machine */\r\n status = phost->class_cb->Machine(pdev, phost);\r\n USBH_ErrorHandle(phost, status);\r\n break; \r\n \r\n case HOST_CTRL_XFER:\r\n /* process control transfer state machine */\r\n USBH_HandleControl(pdev, phost); \r\n break;\r\n \r\n case HOST_SUSPENDED:\r\n break;\r\n \r\n case HOST_ERROR_STATE:\r\n /* Re-Initilaize Host for new Enumeration */\r\n USBH_DeInit(pdev, phost);\r\n phost->usr_cb->DeInit();\r\n phost->class_cb->DeInit(pdev, &phost->device_prop);\r\n break;\r\n \r\n case HOST_DEV_DISCONNECTED :\r\n \r\n /* Manage User disconnect operations*/\r\n phost->usr_cb->DeviceDisconnected();\r\n \r\n /* Re-Initilaize Host for new Enumeration */\r\n USBH_DeInit(pdev, phost);\r\n phost->usr_cb->DeInit();\r\n phost->class_cb->DeInit(pdev, &phost->device_prop); \r\n USBH_DeAllocate_AllChannel(pdev); \r\n phost->gState = HOST_IDLE;\r\n \r\n break;\r\n \r\n default :\r\n break;\r\n }\r\n\r\n}\r\n\r\n\r\n/**\r\n * @brief USBH_ErrorHandle \r\n * This function handles the Error on Host side.\r\n * @param errType : Type of Error or Busy/OK state\r\n * @retval None\r\n */\r\nvoid USBH_ErrorHandle(USBH_HOST *phost, USBH_Status errType)\r\n{\r\n /* Error unrecovered or not supported device speed */\r\n if ( (errType == USBH_ERROR_SPEED_UNKNOWN) ||\r\n (errType == USBH_UNRECOVERED_ERROR) )\r\n {\r\n phost->usr_cb->UnrecoveredError(); \r\n phost->gState = HOST_ERROR_STATE; \r\n } \r\n /* USB host restart requested from application layer */\r\n else if(errType == USBH_APPLY_DEINIT)\r\n {\r\n phost->gState = HOST_ERROR_STATE; \r\n /* user callback for initalization */\r\n phost->usr_cb->Init();\r\n } \r\n}\r\n\r\n\r\n/**\r\n * @brief USBH_HandleEnum \r\n * This function includes the complete enumeration process\r\n * @param pdev: Selected device\r\n * @retval USBH_Status\r\n */\r\nstatic USBH_Status USBH_HandleEnum(USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost)\r\n{\r\n USBH_Status Status = USBH_BUSY; \r\n uint8_t Local_Buffer[64];\r\n \r\n switch (phost->EnumState)\r\n {\r\n case ENUM_IDLE: \r\n /* Get Device Desc for only 1st 8 bytes : To get EP0 MaxPacketSize */\r\n if ( USBH_Get_DevDesc(pdev , phost, 8) == USBH_OK)\r\n {\r\n phost->Control.ep0size = phost->device_prop.Dev_Desc.bMaxPacketSize;\r\n \r\n /* Issue Reset */\r\n HCD_ResetPort(pdev);\r\n phost->EnumState = ENUM_GET_FULL_DEV_DESC;\r\n \r\n /* modify control channels configuration for MaxPacket size */\r\n USBH_Modify_Channel (pdev,\r\n phost->Control.hc_num_out,\r\n 0,\r\n 0,\r\n 0,\r\n phost->Control.ep0size);\r\n \r\n USBH_Modify_Channel (pdev,\r\n phost->Control.hc_num_in,\r\n 0,\r\n 0,\r\n 0,\r\n phost->Control.ep0size); \r\n }\r\n break;\r\n \r\n case ENUM_GET_FULL_DEV_DESC: \r\n /* Get FULL Device Desc */\r\n if ( USBH_Get_DevDesc(pdev, phost, USB_DEVICE_DESC_SIZE)\\\r\n == USBH_OK)\r\n {\r\n /* user callback for device descriptor available */\r\n phost->usr_cb->DeviceDescAvailable(&phost->device_prop.Dev_Desc); \r\n phost->EnumState = ENUM_SET_ADDR;\r\n }\r\n break;\r\n \r\n case ENUM_SET_ADDR: \r\n /* set address */\r\n if ( USBH_SetAddress(pdev, phost, USBH_DEVICE_ADDRESS) == USBH_OK)\r\n {\r\n USB_OTG_BSP_mDelay(2);\r\n phost->device_prop.address = USBH_DEVICE_ADDRESS;\r\n \r\n /* user callback for device address assigned */\r\n phost->usr_cb->DeviceAddressAssigned();\r\n phost->EnumState = ENUM_GET_CFG_DESC;\r\n \r\n /* modify control channels to update device address */\r\n USBH_Modify_Channel (pdev,\r\n phost->Control.hc_num_in,\r\n phost->device_prop.address,\r\n 0,\r\n 0,\r\n 0);\r\n \r\n USBH_Modify_Channel (pdev,\r\n phost->Control.hc_num_out,\r\n phost->device_prop.address,\r\n 0,\r\n 0,\r\n 0); \r\n }\r\n break;\r\n \r\n case ENUM_GET_CFG_DESC: \r\n /* get standard configuration descriptor */\r\n if ( USBH_Get_CfgDesc(pdev, \r\n phost,\r\n USB_CONFIGURATION_DESC_SIZE) == USBH_OK)\r\n {\r\n phost->EnumState = ENUM_GET_FULL_CFG_DESC;\r\n }\r\n break;\r\n \r\n case ENUM_GET_FULL_CFG_DESC: \r\n /* get FULL config descriptor (config, interface, endpoints) */\r\n if (USBH_Get_CfgDesc(pdev, \r\n phost,\r\n phost->device_prop.Cfg_Desc.wTotalLength) == USBH_OK)\r\n {\r\n /* User callback for configuration descriptors available */\r\n phost->usr_cb->ConfigurationDescAvailable(&phost->device_prop.Cfg_Desc,\r\n phost->device_prop.Itf_Desc,\r\n phost->device_prop.Ep_Desc[0]);\r\n \r\n phost->EnumState = ENUM_GET_MFC_STRING_DESC;\r\n }\r\n break;\r\n \r\n case ENUM_GET_MFC_STRING_DESC: \r\n if (phost->device_prop.Dev_Desc.iManufacturer != 0)\r\n { /* Check that Manufacturer String is available */\r\n \r\n if ( USBH_Get_StringDesc(pdev,\r\n phost,\r\n phost->device_prop.Dev_Desc.iManufacturer, \r\n Local_Buffer , \r\n 0xff) == USBH_OK)\r\n {\r\n /* User callback for Manufacturing string */\r\n phost->usr_cb->ManufacturerString(Local_Buffer);\r\n phost->EnumState = ENUM_GET_PRODUCT_STRING_DESC;\r\n }\r\n }\r\n else\r\n {\r\n phost->usr_cb->ManufacturerString(\"N/A\"); \r\n phost->EnumState = ENUM_GET_PRODUCT_STRING_DESC;\r\n }\r\n break;\r\n \r\n case ENUM_GET_PRODUCT_STRING_DESC: \r\n if (phost->device_prop.Dev_Desc.iProduct != 0)\r\n { /* Check that Product string is available */\r\n if ( USBH_Get_StringDesc(pdev,\r\n phost,\r\n phost->device_prop.Dev_Desc.iProduct, \r\n Local_Buffer, \r\n 0xff) == USBH_OK)\r\n {\r\n /* User callback for Product string */\r\n phost->usr_cb->ProductString(Local_Buffer);\r\n phost->EnumState = ENUM_GET_SERIALNUM_STRING_DESC;\r\n }\r\n }\r\n else\r\n {\r\n phost->usr_cb->ProductString(\"N/A\");\r\n phost->EnumState = ENUM_GET_SERIALNUM_STRING_DESC;\r\n } \r\n break;\r\n \r\n case ENUM_GET_SERIALNUM_STRING_DESC: \r\n if (phost->device_prop.Dev_Desc.iSerialNumber != 0)\r\n { /* Check that Serial number string is available */ \r\n if ( USBH_Get_StringDesc(pdev, \r\n phost,\r\n phost->device_prop.Dev_Desc.iSerialNumber, \r\n Local_Buffer, \r\n 0xff) == USBH_OK)\r\n {\r\n /* User callback for Serial number string */\r\n phost->usr_cb->SerialNumString(Local_Buffer);\r\n phost->EnumState = ENUM_SET_CONFIGURATION;\r\n }\r\n }\r\n else\r\n {\r\n phost->usr_cb->SerialNumString(\"N/A\"); \r\n phost->EnumState = ENUM_SET_CONFIGURATION;\r\n } \r\n break;\r\n \r\n case ENUM_SET_CONFIGURATION:\r\n /* set configuration (default config) */\r\n if (USBH_SetCfg(pdev, \r\n phost,\r\n phost->device_prop.Cfg_Desc.bConfigurationValue) == USBH_OK)\r\n {\r\n phost->EnumState = ENUM_DEV_CONFIGURED;\r\n }\r\n break;\r\n\r\n \r\n case ENUM_DEV_CONFIGURED:\r\n /* user callback for enumeration done */\r\n Status = USBH_OK;\r\n break;\r\n \r\n default:\r\n break;\r\n } \r\n return Status;\r\n}\r\n\r\n\r\n/**\r\n * @brief USBH_HandleControl\r\n * Handles the USB control transfer state machine\r\n * @param pdev: Selected device\r\n * @retval Status\r\n */\r\nUSBH_Status USBH_HandleControl (USB_OTG_CORE_HANDLE *pdev, USBH_HOST *phost)\r\n{\r\n uint8_t direction; \r\n static uint16_t timeout = 0;\r\n USBH_Status status = USBH_OK;\r\n URB_STATE URB_Status = URB_IDLE;\r\n \r\n phost->Control.status = CTRL_START;\r\n\r\n \r\n switch (phost->Control.state)\r\n {\r\n case CTRL_SETUP:\r\n /* send a SETUP packet */\r\n USBH_CtlSendSetup (pdev, \r\n\t phost->Control.setup.d8 , \r\n\t phost->Control.hc_num_out); \r\n phost->Control.state = CTRL_SETUP_WAIT; \r\n break; \r\n \r\n case CTRL_SETUP_WAIT:\r\n \r\n URB_Status = HCD_GetURB_State(pdev , phost->Control.hc_num_out); \r\n /* case SETUP packet sent successfully */\r\n if(URB_Status == URB_DONE)\r\n { \r\n direction = (phost->Control.setup.b.bmRequestType & USB_REQ_DIR_MASK);\r\n \r\n /* check if there is a data stage */\r\n if (phost->Control.setup.b.wLength.w != 0 )\r\n { \r\n timeout = DATA_STAGE_TIMEOUT;\r\n if (direction == USB_D2H)\r\n {\r\n /* Data Direction is IN */\r\n phost->Control.state = CTRL_DATA_IN;\r\n }\r\n else\r\n {\r\n /* Data Direction is OUT */\r\n phost->Control.state = CTRL_DATA_OUT;\r\n } \r\n }\r\n /* No DATA stage */\r\n else\r\n {\r\n timeout = NODATA_STAGE_TIMEOUT;\r\n \r\n /* If there is No Data Transfer Stage */\r\n if (direction == USB_D2H)\r\n {\r\n /* Data Direction is IN */\r\n phost->Control.state = CTRL_STATUS_OUT;\r\n }\r\n else\r\n {\r\n /* Data Direction is OUT */\r\n phost->Control.state = CTRL_STATUS_IN;\r\n } \r\n } \r\n /* Set the delay timer to enable timeout for data stage completion */\r\n phost->Control.timer = HCD_GetCurrentFrame(pdev);\r\n }\r\n else if(URB_Status == URB_ERROR)\r\n {\r\n phost->Control.state = CTRL_ERROR; \r\n phost->Control.status = CTRL_XACTERR;\r\n } \r\n break;\r\n \r\n case CTRL_DATA_IN: \r\n /* Issue an IN token */ \r\n USBH_CtlReceiveData(pdev,\r\n phost->Control.buff, \r\n phost->Control.length,\r\n phost->Control.hc_num_in);\r\n \r\n phost->Control.state = CTRL_DATA_IN_WAIT;\r\n break; \r\n \r\n case CTRL_DATA_IN_WAIT:\r\n \r\n URB_Status = HCD_GetURB_State(pdev , phost->Control.hc_num_in); \r\n \r\n /* check is DATA packet transfered successfully */\r\n if (URB_Status == URB_DONE)\r\n { \r\n phost->Control.state = CTRL_STATUS_OUT;\r\n }\r\n \r\n /* manage error cases*/\r\n if (URB_Status == URB_STALL) \r\n { \r\n /* In stall case, return to previous machine state*/\r\n phost->gState = phost->gStateBkp;\r\n } \r\n else if (URB_Status == URB_ERROR)\r\n {\r\n /* Device error */\r\n phost->Control.state = CTRL_ERROR; \r\n }\r\n else if ((HCD_GetCurrentFrame(pdev)- phost->Control.timer) > timeout)\r\n {\r\n /* timeout for IN transfer */\r\n phost->Control.state = CTRL_ERROR; \r\n } \r\n break;\r\n \r\n case CTRL_DATA_OUT:\r\n /* Start DATA out transfer (only one DATA packet)*/\r\n pdev->host.hc[phost->Control.hc_num_out].toggle_out = 1; \r\n \r\n USBH_CtlSendData (pdev,\r\n phost->Control.buff, \r\n phost->Control.length , \r\n phost->Control.hc_num_out);\r\n \r\n\r\n\r\n\r\n \r\n phost->Control.state = CTRL_DATA_OUT_WAIT;\r\n break;\r\n \r\n case CTRL_DATA_OUT_WAIT:\r\n \r\n URB_Status = HCD_GetURB_State(pdev , phost->Control.hc_num_out); \r\n if (URB_Status == URB_DONE)\r\n { /* If the Setup Pkt is sent successful, then change the state */\r\n phost->Control.state = CTRL_STATUS_IN;\r\n }\r\n \r\n /* handle error cases */\r\n else if (URB_Status == URB_STALL) \r\n { \r\n /* In stall case, return to previous machine state*/\r\n phost->gState = phost->gStateBkp;\r\n phost->Control.state = CTRL_STALLED; \r\n } \r\n else if (URB_Status == URB_NOTREADY)\r\n { \r\n /* Nack received from device */\r\n phost->Control.state = CTRL_DATA_OUT;\r\n } \r\n else if (URB_Status == URB_ERROR)\r\n {\r\n /* device error */\r\n phost->Control.state = CTRL_ERROR; \r\n } \r\n break;\r\n \r\n \r\n case CTRL_STATUS_IN:\r\n /* Send 0 bytes out packet */\r\n USBH_CtlReceiveData (pdev,\r\n 0,\r\n 0,\r\n phost->Control.hc_num_in);\r\n \r\n phost->Control.state = CTRL_STATUS_IN_WAIT;\r\n \r\n break;\r\n \r\n case CTRL_STATUS_IN_WAIT:\r\n \r\n URB_Status = HCD_GetURB_State(pdev , phost->Control.hc_num_in); \r\n \r\n if ( URB_Status == URB_DONE)\r\n { /* Control transfers completed, Exit the State Machine */\r\n phost->gState = phost->gStateBkp;\r\n phost->Control.state = CTRL_COMPLETE;\r\n }\r\n \r\n else if (URB_Status == URB_ERROR)\r\n {\r\n phost->Control.state = CTRL_ERROR; \r\n }\r\n \r\n else if((HCD_GetCurrentFrame(pdev)\\\r\n - phost->Control.timer) > timeout)\r\n {\r\n phost->Control.state = CTRL_ERROR; \r\n }\r\n else if(URB_Status == URB_STALL)\r\n {\r\n /* Control transfers completed, Exit the State Machine */\r\n phost->gState = phost->gStateBkp;\r\n phost->Control.status = CTRL_STALL;\r\n status = USBH_NOT_SUPPORTED;\r\n }\r\n break;\r\n \r\n case CTRL_STATUS_OUT:\r\n pdev->host.hc[phost->Control.hc_num_out].toggle_out ^= 1; \r\n USBH_CtlSendData (pdev,\r\n 0,\r\n 0,\r\n phost->Control.hc_num_out);\r\n \r\n phost->Control.state = CTRL_STATUS_OUT_WAIT;\r\n break;\r\n \r\n case CTRL_STATUS_OUT_WAIT: \r\n \r\n URB_Status = HCD_GetURB_State(pdev , phost->Control.hc_num_out); \r\n if (URB_Status == URB_DONE)\r\n { \r\n phost->gState = phost->gStateBkp; \r\n phost->Control.state = CTRL_COMPLETE; \r\n }\r\n else if (URB_Status == URB_NOTREADY)\r\n { \r\n phost->Control.state = CTRL_STATUS_OUT;\r\n } \r\n else if (URB_Status == URB_ERROR)\r\n {\r\n phost->Control.state = CTRL_ERROR; \r\n }\r\n break;\r\n \r\n case CTRL_ERROR:\r\n /* \r\n After a halt condition is encountered or an error is detected by the \r\n host, a control endpoint is allowed to recover by accepting the next Setup \r\n PID; i.e., recovery actions via some other pipe are not required for control\r\n endpoints. For the Default Control Pipe, a device reset will ultimately be \r\n required to clear the halt or error condition if the next Setup PID is not \r\n accepted.\r\n */\r\n if (++ phost->Control.errorcount <= USBH_MAX_ERROR_COUNT)\r\n {\r\n /* Do the transmission again, starting from SETUP Packet */\r\n phost->Control.state = CTRL_SETUP; \r\n }\r\n else\r\n {\r\n phost->Control.status = CTRL_FAIL;\r\n phost->gState = phost->gStateBkp;\r\n \r\n status = USBH_FAIL;\r\n }\r\n break;\r\n \r\n default:\r\n break;\r\n }\r\n return status;\r\n}\r\n\r\n\r\n/**\r\n* @}\r\n*/ \r\n\r\n/**\r\n* @}\r\n*/ \r\n\r\n/**\r\n* @}\r\n*/\r\n\r\n/**\r\n* @}\r\n*/ \r\n\r\n/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r\n\r\n\r\n\r\n\r\n", "meta": {"content_hash": "78b96866ad7d7509d189a3c0cdb3cac9", "timestamp": "", "source": "github", "line_count": 830, "max_line_length": 85, "avg_line_length": 26.898795180722892, "alnum_prop": 0.5260234703932635, "repo_name": "james54068/stm32f429_learning", "id": "5ddf2808f995a16d94ef78daec1395d4615810f7", "size": "23546", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "USB_MSC_HOST/Libraries/STM32_USB_HOST_Library/Core/src/usbh_core.c", "mode": "33261", "license": "mit", "language": [{"name": "Assembly", "bytes": "1781117"}, {"name": "C", "bytes": "39049950"}, {"name": "C++", "bytes": "2532831"}, {"name": "CSS", "bytes": "270876"}, {"name": "JavaScript", "bytes": "996886"}, {"name": "Makefile", "bytes": "24127"}, {"name": "Objective-C", "bytes": "11759"}, {"name": "Shell", "bytes": "9891"}]}} +{"text": "module Waitress\n\n # The DirHandler class is an instance of +Waitress::Handler+ that is responsible\n # for loading files from the filesystem and serving them if they exist in the VHost's\n # root. It automatically handles mimetypes, evaluation and almost everything about\n # the serving process for files in the FileSystem.\n class DirHandler < Handler\n\n attr_accessor :priority\n attr_accessor :directory\n\n # Get the instance of DirHandler that will load Waitress' resources\n # such as the default 404 and index pages, as well as CSS and JS\n def self.resources_handler\n @@resources_handler ||= Waitress::DirHandler.new(Waitress::Chef.resources_http, -1000)\n @@resources_handler\n end\n\n # Create a new DirHandler, with the given FileSystem directory as a root\n # and priority.\n def initialize directory, priority=50\n @directory = File.absolute_path(directory)\n @priority = priority\n end\n\n def respond? request, vhost\n path = File.expand_path File.join(\"#{directory}\", request.path)\n res = Waitress::Chef.find_file(path)[:result]\n path.include?(directory) && (res == :ok)\n end\n\n def serve request, response, client, vhost\n path = File.expand_path File.join(\"#{directory}\", request.path)\n file = Waitress::Chef.find_file(path)[:file]\n Waitress::Chef.serve_file request, response, client, vhost, file\n end\n\n end\nend\n", "meta": {"content_hash": "bca1e90430cb996f00165e7249d83e96", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 92, "avg_line_length": 36.05128205128205, "alnum_prop": 0.6998577524893315, "repo_name": "JacisNonsense/Waitress", "id": "f1010ea1cdb30727361983860e66e509ebcad53d", "size": "1406", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/waitress/handlers/dirhandler.rb", "mode": "33261", "license": "mit", "language": [{"name": "C", "bytes": "42050"}, {"name": "CSS", "bytes": "3326"}, {"name": "HTML", "bytes": "826"}, {"name": "Ragel in Ruby Host", "bytes": "9946"}, {"name": "Ruby", "bytes": "95155"}]}} +{"text": ".class public abstract Landroid/app/ActivityView$ActivityViewCallback;\n.super Ljava/lang/Object;\n.source \"ActivityView.java\"\n\n\n# annotations\n.annotation system Ldalvik/annotation/EnclosingClass;\n value = Landroid/app/ActivityView;\n.end annotation\n\n.annotation system Ldalvik/annotation/InnerClass;\n accessFlags = 0x409\n name = \"ActivityViewCallback\"\n.end annotation\n\n\n# direct methods\n.method public constructor <init>()V\n .locals 0\n\n invoke-direct {p0}, Ljava/lang/Object;-><init>()V\n\n return-void\n.end method\n\n\n# virtual methods\n.method public abstract onAllActivitiesComplete(Landroid/app/ActivityView;)V\n.end method\n\n.method public abstract onSurfaceAvailable(Landroid/app/ActivityView;)V\n.end method\n\n.method public abstract onSurfaceDestroyed(Landroid/app/ActivityView;)V\n.end method\n", "meta": {"content_hash": "0f78cf93d8152e7e7008fe981f505edd", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 76, "avg_line_length": 23.085714285714285, "alnum_prop": 0.7821782178217822, "repo_name": "BatMan-Rom/ModdedFiles", "id": "0f364d8301a4c85b16aafa621f95f0809c01cf5c", "size": "808", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "framework.jar.out/smali/android/app/ActivityView$ActivityViewCallback.smali", "mode": "33188", "license": "apache-2.0", "language": [{"name": "GLSL", "bytes": "15069"}, {"name": "HTML", "bytes": "139176"}, {"name": "Smali", "bytes": "541934400"}]}} +{"text": "package io.jvertx.core.eb;\n\nimport io.vertx.core.Vertx;\nimport io.vertx.core.eventbus.EventBus;\n\n/**\n * @author YYL on 2017/7/19\n */\npublic class App {\n\n public static void main(String[] args) {\n Vertx vertx = Vertx.vertx();\n EventBus eb = vertx.eventBus();\n eb.consumer(\"im.msg\", message ->{\n System.out.println(message.body());\n message.reply(\"ok\");\n });\n// eb.publish(\"im.msg\", \"first message !\");\n// eb.send(\"im.msg\", \"second message !\", result ->{\n// if (result.succeeded()){\n// System.out.println(result.result().body());\n// }\n// });\n EventBus bus = vertx.eventBus();\n bus.send(\"im.msg\", \"other bus\");\n }\n}\n", "meta": {"content_hash": "7c95aac54c07ebae681db5fc81d58929", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 61, "avg_line_length": 27.444444444444443, "alnum_prop": 0.5303643724696356, "repo_name": "coxapp/jvertx", "id": "be986401c2a1fcf1553ad6f237a2c71bbb42b502", "size": "741", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/io/jvertx/core/eb/App.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "143"}, {"name": "Java", "bytes": "6469"}]}} +{"text": "from setuptools import setup\n\nwith open('README.rst') as readme_file:\n readme = readme_file.read()\n\nwith open('HISTORY.rst') as history_file:\n history = history_file.read()\n\nrequirements = [\n 'docopt',\n 'python-wordpress-xmlrpc',\n 'requests',\n # TODO: put package requirements here\n]\n\ntest_requirements = [\n # TODO: put package test requirements here\n]\n\nsetup(\n name='wordpress_importer',\n version='0.1.0',\n description=\"Utility to import data into wordpress from CSV using a template.\",\n long_description=readme + '\\n\\n' + history,\n author=\"James Brink\",\n author_email='brink.james@gmail.com',\n url='https://github.com/jamesbrink/wordpress_importer',\n packages=[\n 'wordpress_importer',\n ],\n package_dir={'wordpress_importer':\n 'wordpress_importer'},\n include_package_data=True,\n install_requires=requirements,\n license=\"MIT license\",\n zip_safe=False,\n keywords='wordpress_importer',\n classifiers=[\n 'Development Status :: 2 - Pre-Alpha',\n 'Intended Audience :: Developers',\n 'License :: OSI Approved :: MIT License',\n 'Natural Language :: English',\n \"Programming Language :: Python :: 2\",\n 'Programming Language :: Python :: 2.6',\n 'Programming Language :: Python :: 2.7',\n 'Programming Language :: Python :: 3',\n 'Programming Language :: Python :: 3.3',\n 'Programming Language :: Python :: 3.4',\n 'Programming Language :: Python :: 3.5',\n ],\n scripts=['scripts/wordpress_importer', ],\n test_suite='tests',\n tests_require=test_requirements\n)\n", "meta": {"content_hash": "c19bc121351fab84bfe30315ff3846a2", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 83, "avg_line_length": 30.074074074074073, "alnum_prop": 0.6268472906403941, "repo_name": "urandomio/wordpress_importer", "id": "22510665bfb9c8844abde60b6e8820b4e548fd1a", "size": "1671", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "setup.py", "mode": "33188", "license": "mit", "language": [{"name": "Makefile", "bytes": "2339"}, {"name": "Python", "bytes": "13184"}]}} +{"text": "\n\n/**\n * Autogenerated by Thrift Compiler (0.10.0)\n *\n * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n * @generated\n */\n#include \"credential_store_data_models_constants.h\"\n\n\n\nconst credential_store_data_modelsConstants g_credential_store_data_models_constants;\n\ncredential_store_data_modelsConstants::credential_store_data_modelsConstants() {\n DEFAULT_ID = \"DO_NOT_SET_AT_CLIENTS\";\n\n}\n\n\n\n", "meta": {"content_hash": "f5228bb44ba3e1a40ea9141f31818f6b", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 85, "avg_line_length": 19.523809523809526, "alnum_prop": 0.7390243902439024, "repo_name": "apache/airavata", "id": "76cc416b77d50fbf345ee57161092e5a8aa37ca3", "size": "1212", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/credential_store_data_models_constants.cpp", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2959"}, {"name": "Blade", "bytes": "640580"}, {"name": "C", "bytes": "29278"}, {"name": "C++", "bytes": "8274651"}, {"name": "CSS", "bytes": "34425"}, {"name": "Dockerfile", "bytes": "7386"}, {"name": "HTML", "bytes": "91922"}, {"name": "Java", "bytes": "36030164"}, {"name": "JavaScript", "bytes": "404261"}, {"name": "Jinja", "bytes": "234378"}, {"name": "PHP", "bytes": "1176284"}, {"name": "Python", "bytes": "633278"}, {"name": "Shell", "bytes": "153797"}, {"name": "Thrift", "bytes": "472909"}, {"name": "XSLT", "bytes": "3266"}]}} +{"text": "\npackage org.asynchttpclient.providers.netty4;\n\nimport org.asynchttpclient.AsyncHttpClient;\nimport org.asynchttpclient.AsyncHttpClientConfig;\nimport org.asynchttpclient.async.IdleStateHandlerTest;\n\npublic class NettyIdleStateHandlerTest extends IdleStateHandlerTest {\n @Override\n public AsyncHttpClient getAsyncHttpClient(AsyncHttpClientConfig config) {\n return NettyProviderUtil.nettyProvider(config);\n }\n}\n", "meta": {"content_hash": "f176ab26a3c2fa4338f871c9ff26e64c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 77, "avg_line_length": 32.61538461538461, "alnum_prop": 0.8301886792452831, "repo_name": "afelisatti/async-http-client", "id": "107cb8b0d52b6b4d0406b076d588e17507284bc3", "size": "1119", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "providers/netty4/src/test/java/org/asynchttpclient/providers/netty4/NettyIdleStateHandlerTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "1925816"}]}} +{"text": "#ifndef HISTOGRAMS_HH\n#define HISTOGRAMS_HH\n\n#include <vector>\n\n/**\n * Save histogram data to file.\n *\n * Will save file with four data points for each histogram bin:\n * bin_start Low edge of bin\n * bin_end High edge of bin\n * count Absolute count of values in bin\n * relcount Relative count (i.e., divided by total number of values)\n *\n * Arguments:\n * v - Vector containing all values\n * dm - Bin width\n * filename - Name of file to save to\n**/\nvoid save_histogram(const std::vector<double> &v, double dm, const char *filename);\n\n#endif\n", "meta": {"content_hash": "42aa97ff20d889bcb5d345f9242ee836", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 83, "avg_line_length": 26.863636363636363, "alnum_prop": 0.6446700507614214, "repo_name": "frxstrem/fys3150", "id": "714c3718196e155e20f8d0ad34248565f5fd5605", "size": "591", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "project5/code/histograms.hh", "mode": "33188", "license": "mit", "language": [{"name": "C++", "bytes": "139141"}, {"name": "Makefile", "bytes": "4891"}, {"name": "Python", "bytes": "1544"}, {"name": "Shell", "bytes": "970"}, {"name": "TeX", "bytes": "133946"}]}} +{"text": "package com.bq.corbel.iam.service;\n\nimport com.google.common.collect.Sets;\nimport com.google.gson.JsonObject;\nimport com.google.gson.JsonPrimitive;\nimport com.bq.corbel.iam.auth.AuthorizationRequestContextFactory;\nimport com.bq.corbel.iam.exception.UnauthorizedException;\nimport com.bq.corbel.iam.model.Scope;\nimport com.bq.corbel.iam.model.UserToken;\nimport com.bq.corbel.iam.repository.UserTokenRepository;\nimport com.bq.corbel.lib.token.TokenInfo;\nimport com.bq.corbel.lib.token.reader.TokenReader;\nimport net.oauth.jsontoken.JsonToken;\nimport net.oauth.jsontoken.JsonTokenParser;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.Mock;\nimport org.mockito.runners.MockitoJUnitRunner;\n\nimport java.security.SignatureException;\nimport java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\n\nimport static org.mockito.Mockito.*;\n\n@RunWith(MockitoJUnitRunner.class) public class DefaultUpgradeTokenServiceTest {\n\n private static final String TEST_ASSERTION = \"123.456.789\";\n private static final String TEST_TOKEN = \"the_access_token\";\n private static final String TEST_CLIENT = \"client\";\n private static final String TEST_DOMAIN = \"domain\";\n private static final String TEST_USER = \"user\";\n private static final String TEST_SCOPES = \"SCOPE_1 SCOPE_2\";\n\n @Mock private JsonTokenParser jsonTokenParser;\n @Mock private AuthorizationRequestContextFactory contextFactory;\n @Mock private ScopeService scopeServiceMock;\n @Mock private TokenInfo accessToken;\n @Mock private TokenReader tokenReader;\n @Mock private UserTokenRepository userTokenRepositoryMock;\n\n private UpgradeTokenService upgradeTokenService;\n\n @Before\n public void setUp() {\n upgradeTokenService = new DefaultUpgradeTokenService(jsonTokenParser, scopeServiceMock, userTokenRepositoryMock);\n when(accessToken.getClientId()).thenReturn(TEST_CLIENT);\n when(accessToken.getUserId()).thenReturn(TEST_USER);\n when(accessToken.getDomainId()).thenReturn(TEST_DOMAIN);\n when(accessToken.toString()).thenReturn(TEST_TOKEN);\n when(tokenReader.getInfo()).thenReturn(accessToken);\n when(tokenReader.getToken()).thenReturn(TEST_TOKEN);\n }\n\n @Test\n public void upgradeTokenTest() throws SignatureException, UnauthorizedException {\n JsonToken validJsonToken = mock(JsonToken.class);\n JsonObject json = new JsonObject();\n json.add(\"scope\", new JsonPrimitive(TEST_SCOPES));\n when(validJsonToken.getPayloadAsJsonObject()).thenReturn(json);\n Scope scope1 = mock(Scope.class);\n Scope scope2 = mock(Scope.class);\n Set<Scope> scopes = new HashSet<Scope>(Arrays.asList(scope1, scope2));\n Set<String> scopesIds = new HashSet<String>(Arrays.asList(\"SCOPE_1\", \"SCOPE_2\"));\n UserToken userToken = new UserToken();\n userToken.setScopes(new HashSet<>());\n\n when(scopeServiceMock.expandScopes(scopesIds)).thenReturn(scopes);\n when(scopeServiceMock.fillScopes(scopes, TEST_USER, TEST_CLIENT, TEST_DOMAIN)).thenReturn(scopes);\n when(userTokenRepositoryMock.findByToken(TEST_TOKEN)).thenReturn(userToken);\n\n when(jsonTokenParser.verifyAndDeserialize(TEST_ASSERTION)).thenReturn(validJsonToken);\n\n Set<String> scopesToAdd = upgradeTokenService.getScopesFromTokenToUpgrade(TEST_ASSERTION);\n upgradeTokenService.upgradeToken(TEST_ASSERTION, tokenReader, scopesToAdd);\n\n verify(scopeServiceMock).fillScopes(scopes, TEST_USER, TEST_CLIENT, TEST_DOMAIN);\n verify(scopeServiceMock).addAuthorizationRules(TEST_TOKEN, scopes);\n }\n\n @Test(expected = UnauthorizedException.class)\n public void upgradeTokenNonexistentScopeTest() throws SignatureException, UnauthorizedException {\n JsonToken validJsonToken = mock(JsonToken.class);\n JsonObject json = new JsonObject();\n json.add(\"scope\", new JsonPrimitive(TEST_SCOPES));\n when(validJsonToken.getPayloadAsJsonObject()).thenReturn(json);\n\n doThrow(new IllegalStateException(\"Nonexistent scope scopeId\")).when(scopeServiceMock).addAuthorizationRules(anyString(), anySet());\n\n when(jsonTokenParser.verifyAndDeserialize(TEST_ASSERTION)).thenReturn(validJsonToken);\n\n Set<String> scopes = upgradeTokenService.getScopesFromTokenToUpgrade(TEST_ASSERTION);\n upgradeTokenService.upgradeToken(TEST_ASSERTION, tokenReader, scopes);\n }\n\n @Test\n public void upgradeTokenEmptyScopeTest() throws SignatureException, UnauthorizedException {\n Set<Scope> scopes = new HashSet<>();\n JsonToken validJsonToken = mock(JsonToken.class);\n JsonObject json = new JsonObject();\n json.add(\"scope\", new JsonPrimitive(\"\"));\n UserToken userToken = new UserToken();\n userToken.setScopes(new HashSet<>());\n when(validJsonToken.getPayloadAsJsonObject()).thenReturn(json);\n when(jsonTokenParser.verifyAndDeserialize(TEST_ASSERTION)).thenReturn(validJsonToken);\n when(userTokenRepositoryMock.findByToken(TEST_TOKEN)).thenReturn(userToken);\n when(scopeServiceMock.fillScopes(any(), any(), any(), any())).thenReturn(Sets.newHashSet());\n\n Set<String> scopesToAdd = upgradeTokenService.getScopesFromTokenToUpgrade(TEST_ASSERTION);\n upgradeTokenService.upgradeToken(TEST_ASSERTION, tokenReader, scopesToAdd);\n\n verify(scopeServiceMock).fillScopes(scopes, TEST_USER, TEST_CLIENT, TEST_DOMAIN);\n verify(scopeServiceMock).addAuthorizationRules(TEST_TOKEN, scopes);\n }\n}\n", "meta": {"content_hash": "c888595eb0785b226b5cda111fef1c3a", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 140, "avg_line_length": 47.25423728813559, "alnum_prop": 0.7474892395982783, "repo_name": "bq/corbel", "id": "aae98468b049d5553993b123996b0f3540cdb054", "size": "5576", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "iam/src/test/java/com/bq/corbel/iam/service/DefaultUpgradeTokenServiceTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Groovy", "bytes": "27620"}, {"name": "Java", "bytes": "1627258"}, {"name": "Shell", "bytes": "246"}]}} +{"text": "\n\npackage com.nebhale.buildmonitor.web;\n\nimport com.nebhale.buildmonitor.ApplicationConfiguration;\nimport org.junit.runner.RunWith;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.test.SpringApplicationConfiguration;\nimport org.springframework.jdbc.core.JdbcTemplate;\nimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;\nimport org.springframework.test.context.web.WebAppConfiguration;\nimport org.springframework.test.jdbc.JdbcTestUtils;\nimport org.springframework.test.web.servlet.MockMvc;\nimport org.springframework.util.StringUtils;\nimport org.springframework.web.context.WebApplicationContext;\n\nimport javax.sql.DataSource;\nimport javax.transaction.Transactional;\nimport java.util.Arrays;\nimport java.util.Set;\nimport java.util.stream.Collectors;\n\nimport static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup;\n\n@RunWith(SpringJUnit4ClassRunner.class)\n@SpringApplicationConfiguration(classes = ApplicationConfiguration.class)\n@Transactional\n@WebAppConfiguration\npublic abstract class AbstractControllerTest {\n\n private volatile JdbcTemplate jdbcTemplate;\n\n volatile MockMvc mockMvc;\n\n @Autowired\n final void setDataSource(DataSource dataSource) {\n this.jdbcTemplate = new JdbcTemplate(dataSource);\n }\n\n @Autowired\n final void setWebApplicationContext(WebApplicationContext webApplicationContext) {\n this.mockMvc = webAppContextSetup(webApplicationContext).build();\n }\n\n final int countRowsInTable(String tableName) {\n return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName);\n }\n\n final String toJson(String... pairs) {\n StringBuilder sb = new StringBuilder(\"{ \");\n\n Set<String> entries = Arrays.stream(pairs).map(pair -> {\n String[] parts = StringUtils.split(pair, \":\");\n return String.format(\"\\\"%s\\\" : \\\"%s\\\"\", parts[0], parts[1]);\n }).collect(Collectors.toSet());\n\n sb.append(StringUtils.collectionToDelimitedString(entries, \", \"));\n\n return sb.append(\" }\").toString();\n }\n\n}\n", "meta": {"content_hash": "d5e89f4b952b5662936f644e9d6b7acb", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 92, "avg_line_length": 33.935483870967744, "alnum_prop": 0.7647338403041825, "repo_name": "nebhale/build-monitor", "id": "544fa13e0369ecae134b30f63261ecd679544145", "size": "2724", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/test/java/com/nebhale/buildmonitor/web/AbstractControllerTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "3932"}, {"name": "Java", "bytes": "82100"}, {"name": "JavaScript", "bytes": "12134"}]}} +{"text": ".. _manual:\n\nUser Guide\n==========\n\n\n.. include:: installation.rst\n\n.. include:: basic_usage.rst\n\n.. include:: formats.rst\n\n.. include:: piped_output.rst\n\n.. include:: jupyter_notebooks.rst\n\n.. include:: styling.rst\n\n.. _attributes:\n.. include:: attributes.rst\n\n.. _node-ports-compass:\n.. include:: node_ports.rst\n\n.. _backslash-escapes:\n.. include:: escapes.rst\n\n.. _quoting-and-html-like-labels:\n.. include:: quoting.rst\n\n.. _subgraphs-clusters:\n.. include:: subgraphs_and_clusters.rst\n\n.. _engines:\n.. include:: engines.rst\n\n.. include:: neato_no_op.rst\n\n.. include:: unflatten.rst\n\n.. include:: custom_dot.rst\n\n.. _using-raw-dot:\n.. include:: raw_dot.rst\n\n.. include:: existing_files.rst\n\n.. include:: integration_with_viewers.rst\n", "meta": {"content_hash": "e211dbc9fbcd237e0ef749d657f3fc4c", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 41, "avg_line_length": 15.3125, "alnum_prop": 0.6625850340136055, "repo_name": "xflr6/graphviz", "id": "15952a0ca0d74313780d97b0e9a423f04ca05c50", "size": "735", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/manual.rst", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "196982"}]}} +{"text": "/* ** GENEREATED FILE - DO NOT MODIFY ** */\r\npackage com.wilutions.mslib.outlook.impl;\r\nimport com.wilutions.com.*;\r\n\r\n@SuppressWarnings(\"all\")\r\n@CoClass(guid=\"{C091A9EE-A463-DB41-5DAE-69E7A5F7FCBC}\")\r\npublic class SyncObjectEventsImpl extends Dispatch implements com.wilutions.mslib.outlook.SyncObjectEvents {\r\n @DeclDISPID(61441) public void onSyncStart() throws ComException {\r\n this._dispatchCall(61441,\"SyncStart\", DISPATCH_METHOD,null);\r\n }\r\n @DeclDISPID(61442) public void onProgress(final com.wilutions.mslib.outlook.OlSyncState State, final String Description, final Integer Value, final Integer Max) throws ComException {\r\n assert(State != null);\r\n assert(Description != null);\r\n assert(Value != null);\r\n assert(Max != null);\r\n this._dispatchCall(61442,\"Progress\", DISPATCH_METHOD,null,State.value,Description,Value,Max);\r\n }\r\n @DeclDISPID(61443) public void onOnError(final Integer Code, final String Description) throws ComException {\r\n assert(Code != null);\r\n assert(Description != null);\r\n this._dispatchCall(61443,\"OnError\", DISPATCH_METHOD,null,Code,Description);\r\n }\r\n @DeclDISPID(61444) public void onSyncEnd() throws ComException {\r\n this._dispatchCall(61444,\"SyncEnd\", DISPATCH_METHOD,null);\r\n }\r\n public SyncObjectEventsImpl(String progId) throws ComException {\r\n super(progId, \"{00063085-0000-0000-C000-000000000046}\");\r\n }\r\n protected SyncObjectEventsImpl(long ndisp) {\r\n super(ndisp);\r\n }\r\n public String toString() {\r\n return \"[SyncObjectEventsImpl\" + super.toString() + \"]\";\r\n }\r\n}\r\n", "meta": {"content_hash": "42d6ee11643ff73e5b8271bae9e76fa6", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 185, "avg_line_length": 44.74285714285714, "alnum_prop": 0.7171136653895275, "repo_name": "wolfgangimig/joa", "id": "f3b9228f8b21cec1422d2beeadbaa2b04432c367", "size": "1566", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java/joa/src-gen/com/wilutions/mslib/outlook/impl/SyncObjectEventsImpl.java", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "1296"}, {"name": "CSS", "bytes": "792"}, {"name": "HTML", "bytes": "1337"}, {"name": "Java", "bytes": "9952275"}, {"name": "VBScript", "bytes": "338"}]}} +{"text": "<?php\nnamespace PHPServices;\n\nclass Module\n{\n public function getConfig()\n {\n return include __DIR__ . '/../../config/module.config.php';\n }\n}\n", "meta": {"content_hash": "586c3a24fb04f085378a787e19cda2a3", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 67, "avg_line_length": 15.9, "alnum_prop": 0.5911949685534591, "repo_name": "insprintorob/phpservices", "id": "e0d11a1cfe16369488bf24c42dda66b42122646f", "size": "159", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/PHPServices/Module.php", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "PHP", "bytes": "12761"}]}} +{"text": "\ufeff'------------------------------------------------------------------------------\n' <auto-generated>\n' This code was generated by a tool.\n' Runtime Version:4.0.30319.42000\n'\n' Changes to this file may cause incorrect behavior and will be lost if\n' the code is regenerated.\n' </auto-generated>\n'------------------------------------------------------------------------------\n\nOption Strict On\nOption Explicit On\n\nImports System\n\nNamespace My.Resources\n \n 'This class was auto-generated by the StronglyTypedResourceBuilder\n 'class via a tool like ResGen or Visual Studio.\n 'To add or remove a member, edit your .ResX file then rerun ResGen\n 'with the /str option, or rebuild your VS project.\n '''<summary>\n ''' A strongly-typed resource class, for looking up localized strings, etc.\n '''</summary>\n <Global.System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"16.0.0.0\"), _\n Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _\n Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _\n Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _\n Friend Module Resources\n \n Private resourceMan As Global.System.Resources.ResourceManager\n \n Private resourceCulture As Global.System.Globalization.CultureInfo\n \n '''<summary>\n ''' Returns the cached ResourceManager instance used by this class.\n '''</summary>\n <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _\n Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager\n Get\n If Object.ReferenceEquals(resourceMan, Nothing) Then\n Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager(\"Runtime.Shared.Resources\", GetType(Resources).Assembly)\n resourceMan = temp\n End If\n Return resourceMan\n End Get\n End Property\n \n '''<summary>\n ''' Overrides the current thread's CurrentUICulture property for all\n ''' resource lookups using this strongly typed resource class.\n '''</summary>\n <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _\n Friend Property Culture() As Global.System.Globalization.CultureInfo\n Get\n Return resourceCulture\n End Get\n Set\n resourceCulture = value\n End Set\n End Property\n End Module\nEnd Namespace\n", "meta": {"content_hash": "131812860828c9a4139332fbc4c7fd5d", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 174, "avg_line_length": 43.15873015873016, "alnum_prop": 0.6355277675616036, "repo_name": "wessupermare/WCompiler", "id": "04c7619c307d75729d69a0c653ad3d117fa0109f", "size": "2721", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Runtime/Shared/My Project/Resources.Designer.vb", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Visual Basic", "bytes": "73129"}]}} +{"text": "import json\nimport re\nimport requests\nfrom datetime import datetime, timedelta\nimport os\nfrom dateutil import parser\nfrom src.sgd.frontend import config\n\nBLOG_BASE_URL = 'https://public-api.wordpress.com/rest/v1.1/sites/yeastgenomeblog.wordpress.com/posts'\nBLOG_PAGE_SIZE = 10\nHOMEPAGE_REQUEST_TIMEOUT = 2\nURL_REGEX = 'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+'\n\n# from https://public-api.wordpress.com/rest/v1.1/sites/sgdblogtest.wordpress.com/categories\nwp_categories = [\n {\n 'name': 'Conferences',\n 'slug': 'conferences'\n },\n {\n 'name': 'Data updates',\n 'slug': 'data-updates'\n },\n {\n 'name': 'Homologs',\n 'slug': 'homologs'\n },\n {\n 'name': 'New Data',\n 'slug': 'new-data'\n },\n {\n 'name': 'News and Views',\n 'slug': 'news-and-views'\n },\n {\n 'name': 'Newsletter',\n 'slug': 'newsletter'\n },\n {\n 'name': 'Research Spotlight',\n 'slug': 'research-spotlight'\n },\n {\n 'name': 'Sequence',\n 'slug': 'sequence'\n },\n {\n 'name': 'Tutorial',\n 'slug': 'tutorial'\n },\n {\n 'name': 'Uncategorized',\n 'slug': 'uncategorized'\n },\n {\n 'name': 'Website changes',\n 'slug': 'website-changes'\n },\n {\n 'name': 'Yeast and Human Disease',\n 'slug': 'yeast-and-human-disease'\n },\n {\n 'name': 'Announcements',\n 'slug': 'announcements'\n }\n]\n\n\ndef get_wp_categories():\n return sorted(wp_categories, key=lambda k: k['name'])\n\n\ndef get_archive_years():\n now = datetime.now()\n this_year = now.year\n archive_years = []\n for i in range(7):\n archive_years.append(this_year - i)\n return archive_years\n\n\ndef get_recent_blog_posts():\n wp_url = BLOG_BASE_URL + '?number=5'\n try:\n response = requests.get(wp_url, timeout=HOMEPAGE_REQUEST_TIMEOUT)\n blog_posts = json.loads(response.text)['posts']\n for post in blog_posts:\n post = add_simple_date_to_post(post)\n except Exception as e:\n blog_posts = []\n return blog_posts\n\n# fetch \"SGD Public Events\" google calendar data and format as needed for homepage\ndef get_meetings():\n try:\n calendar_url = config.google_calendar_api_url\n response = requests.get(calendar_url, timeout=HOMEPAGE_REQUEST_TIMEOUT)\n meetings = json.loads(response.text)['items']\n # only get \"all day\" events\n meetings = [d for d in meetings if 'date' in list(d['start'].keys())]\n for meeting in meetings:\n if 'description' not in list(meeting.keys()):\n meeting['description'] = ''\n # get URL from description and remove URLs from description\n urls = re.findall(URL_REGEX, meeting['description'])\n if len(urls) > 0:\n url = urls[0]\n else:\n url = None\n meeting['url'] = url\n meeting['description'] = re.sub(URL_REGEX, '', meeting['description'])\n # format date as a string which is either a single day or range of dates\n start_date = datetime.strptime(meeting['start']['date'], '%Y-%m-%d')\n end_date = datetime.strptime(meeting['end']['date'], '%Y-%m-%d') - timedelta(days=1)\n meeting['start_date'] = start_date\n days_delta = (end_date - start_date).days\n if (days_delta >= 1):\n start_desc = start_date.strftime('%B %d')\n end_desc = end_date.strftime('%B %d, %Y')\n date_description = start_desc + ' to ' + end_desc\n else:\n date_description = start_date.strftime('%B %d, %Y')\n meeting['date_description'] = date_description\n # filter to only show future events\n now = datetime.now()\n meetings = [d for d in meetings if d['start_date'] > now]\n # sort by start date\n meetings = sorted(meetings, key=lambda d: d['start_date'])\n except Exception as e:\n meetings = []\n return meetings\n\n\ndef add_simple_date_to_post(raw):\n simple_date = parser.parse(raw['date']).strftime(\"%B %d, %Y\")\n raw['simple_date'] = simple_date\n return raw\n", "meta": {"content_hash": "f95f26cd79ef6d402ebdaedfa0eba573", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 102, "avg_line_length": 30.52517985611511, "alnum_prop": 0.5538534056092388, "repo_name": "yeastgenome/SGDFrontend", "id": "e8def9ecec5b341129be00b4284f9a8b6c2a85ee", "size": "4243", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/sgd/frontend/yeastgenome/views/cms_helpers.py", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "41612"}, {"name": "Dockerfile", "bytes": "2910"}, {"name": "Gherkin", "bytes": "28036"}, {"name": "HTML", "bytes": "3745"}, {"name": "JavaScript", "bytes": "1008081"}, {"name": "Jinja", "bytes": "418101"}, {"name": "Makefile", "bytes": "1744"}, {"name": "Python", "bytes": "139124"}, {"name": "Ruby", "bytes": "4116"}, {"name": "SCSS", "bytes": "51067"}]}} +{"text": "use super::camera::*;\nuse super::GameContext;\nuse super::event_manager::*;\nuse glium::glutin::{CursorState, ElementState, Event, MouseButton, VirtualKeyCode};\nuse std::rc::Rc;\n\npub struct Ghost {\n cam: Camera,\n context: Rc<GameContext>,\n speed: f32,\n forward: bool,\n backward: bool,\n left: bool,\n right: bool,\n up: bool,\n down: bool,\n mouselock: bool,\n}\n\n// Speed per second\nconst DEFAULT_SPEED: f32 = 12.0;\nconst SHIFT_SPEED: f32 = 60.0;\n\n\n\nimpl Ghost {\n pub fn new(context: Rc<GameContext>) -> Self {\n Ghost {\n cam: Camera::new(context.get_config().resolution.aspect_ratio()),\n context: context,\n speed: DEFAULT_SPEED,\n forward: false,\n backward: false,\n left: false,\n right: false,\n up: false,\n down: false,\n mouselock: false,\n }\n }\n pub fn update(&mut self, delta: f32) {\n let factored_speed = self.speed * delta;\n\n if self.forward {\n self.cam.move_forward(factored_speed);\n }\n if self.backward {\n self.cam.move_backward(factored_speed);\n }\n if self.left {\n self.cam.move_left(factored_speed);\n }\n if self.right {\n self.cam.move_right(factored_speed);\n }\n if self.up {\n self.cam.move_up(factored_speed);\n }\n if self.down {\n self.cam.move_down(factored_speed);\n }\n }\n\n pub fn get_camera(&self) -> Camera {\n self.cam\n }\n pub fn set_camera(&mut self, cam: Camera) {\n self.cam = cam;\n }\n}\n\n\n/// **Implements Controls**\n/// *W => FORWARD\n/// *A => LEFT\n/// *S => BACKWARDS\n/// *D => RIGHT\n/// *'Space' => UP\n/// *'LControl' => DOWN (only accepts one keystroke (cannot hold LControl to go\n/// down))\n/// *'C' => DOWN (as a replacement for 'LControl')\n\n/// MouseMovement for changing the direction the camera looks\nimpl EventHandler for Ghost {\n fn handle_event(&mut self, e: &Event) -> EventResponse {\n match *e {\n Event::KeyboardInput(ElementState::Pressed, _, Some(VirtualKeyCode::W)) => {\n self.forward = true;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Released, _, Some(VirtualKeyCode::W)) => {\n self.forward = false;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Pressed, _, Some(VirtualKeyCode::S)) => {\n self.backward = true;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Released, _, Some(VirtualKeyCode::S)) => {\n self.backward = false;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Pressed, _, Some(VirtualKeyCode::A)) => {\n self.left = true;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Released, _, Some(VirtualKeyCode::A)) => {\n self.left = false;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Pressed, _, Some(VirtualKeyCode::D)) => {\n self.right = true;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Released, _, Some(VirtualKeyCode::D)) => {\n self.right = false;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Pressed, _, Some(VirtualKeyCode::Space)) => {\n self.up = true;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Released, _, Some(VirtualKeyCode::Space)) => {\n self.up = false;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Pressed, _, Some(VirtualKeyCode::LControl)) => {\n self.down = true;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Released, _, Some(VirtualKeyCode::LControl)) => {\n self.down = false;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Pressed, _, Some(VirtualKeyCode::LShift)) => {\n self.speed = SHIFT_SPEED;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Released, _, Some(VirtualKeyCode::LShift)) => {\n self.speed = DEFAULT_SPEED;\n EventResponse::Continue\n }\n Event::KeyboardInput(ElementState::Released, _, Some(VirtualKeyCode::G)) => {\n EventResponse::Continue\n }\n Event::MouseInput(ElementState::Pressed, MouseButton::Left) => {\n if !self.mouselock {\n self.mouselock = true;\n if let Some(window) = self.context.get_facade().get_window() {\n window.set_cursor_state(CursorState::Hide)\n .expect(\"failed to set cursor state\");\n } else {\n warn!(\"Failed to obtain window from facade\");\n }\n } else if self.mouselock {\n self.mouselock = false;\n\n if let Some(window) = self.context.get_facade().get_window() {\n window.set_cursor_state(CursorState::Normal)\n .expect(\"failed to set cursor state\");\n } else {\n warn!(\"Failed to obtain window from facade\");\n }\n }\n\n EventResponse::Continue\n }\n\n Event::MouseMoved(x, y) => {\n if self.mouselock {\n if let Some(window) = self.context.get_facade().get_window() {\n // Possibility of mouse being outside of window without it resetting to the\n // middle?\n if let Some(middle) = window.get_inner_size_pixels() {\n let middle_x = (middle.0 as i32) / 2;\n let middle_y = (middle.1 as i32) / 2;\n let x_diff = x - middle_x;\n let y_diff = y - middle_y;\n self.cam.change_dir(y_diff as f32 / 300.0, -x_diff as f32 / 300.0);\n window.set_cursor_position(middle_x as i32, middle_y as i32)\n .expect(\"setting cursor position failed\");\n }\n }\n }\n EventResponse::Continue\n }\n _ => EventResponse::NotHandled,\n }\n }\n}\n", "meta": {"content_hash": "3480de1e340a5de51f322df900e30095", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 99, "avg_line_length": 35.910526315789475, "alnum_prop": 0.49728858273486737, "repo_name": "adRichter/plantex", "id": "01273f3f1c6d4c3904c6118e687cd8d6f0f72e26", "size": "6823", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/src/ghost.rs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "GLSL", "bytes": "29595"}, {"name": "Rust", "bytes": "285892"}, {"name": "Shell", "bytes": "5131"}]}} +{"text": "package joshie.harvest.animals.type;\n\nimport joshie.harvest.animals.HFAnimals;\nimport joshie.harvest.animals.item.ItemAnimalProduct.Sizeable;\nimport joshie.harvest.animals.item.ItemAnimalSpawner.Spawner;\nimport joshie.harvest.api.animals.AnimalAction;\nimport joshie.harvest.api.animals.AnimalStats;\nimport joshie.harvest.core.helpers.SizeableHelper;\nimport net.minecraft.item.ItemStack;\n\nimport java.util.List;\n\nimport static joshie.harvest.api.animals.AnimalFoodType.SEED;\n\npublic class AnimalChicken extends AnimalAbstract {\n public AnimalChicken() {\n super(\"chicken\", 3, 10, SEED);\n }\n\n @Override\n public ItemStack getIcon() {\n return HFAnimals.ANIMAL.getStackFromEnum(Spawner.CHICKEN);\n }\n\n @Override\n public int getRelationshipBonus(AnimalAction action) {\n switch (action) {\n case OUTSIDE: return 5;\n case FEED: return 100;\n }\n\n return super.getRelationshipBonus(action);\n }\n\n @Override\n public ItemStack getProduct(AnimalStats stats) {\n return SizeableHelper.getEgg(stats);\n }\n\n @Override\n public List<ItemStack> getProductsForDisplay(AnimalStats stats) {\n return SizeableHelper.getSizeablesForDisplay(stats, Sizeable.EGG);\n }\n\n @Override\n public int getDaysBetweenProduction() {\n return 1;\n }\n\n @Override\n public int getGenericTreatCount() {\n return 5;\n }\n\n @Override\n public int getTypeTreatCount() {\n return 26;\n }\n}", "meta": {"content_hash": "f6e854f97d851222913793de0dfedbd1", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 74, "avg_line_length": 25.305084745762713, "alnum_prop": 0.6972538513060951, "repo_name": "PenguinSquad/Harvest-Festival", "id": "277fd569e34006150094b248aff12b9fdf5e9518", "size": "1493", "binary": false, "copies": "1", "ref": "refs/heads/1.10.2-0.6.X", "path": "src/main/java/joshie/harvest/animals/type/AnimalChicken.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "2809556"}]}} +{"text": "require 'spec_helper'\n\ndescribe Marathon::Util do\n\n describe '.validate_choice' do\n subject { described_class }\n\n it 'passes with valid value' do\n described_class.validate_choice('foo', 'bar', %w[f00 bar], false)\n end\n\n it 'passes with nil value' do\n described_class.validate_choice('foo', nil, %w[f00], true)\n end\n\n it 'fails with nil value' do\n expect {\n described_class.validate_choice('foo', nil, %w[f00], false)\n }.to raise_error(Marathon::Error::ArgumentError)\n end\n\n it 'fails with invalid value' do\n expect {\n described_class.validate_choice('foo', 'bar', %w[f00], false)\n }.to raise_error(Marathon::Error::ArgumentError)\n end\n end\n\n describe '.add_choice' do\n subject { described_class }\n\n it 'validates choice first' do\n expect(described_class).to receive(:validate_choice).with('foo', 'bar', %w[f00 bar], false)\n described_class.add_choice({}, 'foo', 'bar', %w[f00 bar], false)\n end\n\n it 'adds choice' do\n opts = {}\n described_class.add_choice(opts, 'foo', 'bar', %w[f00 bar], false)\n expect(opts['foo']).to eq('bar')\n end\n end\n\n describe '.keywordize_hash!' do\n subject { described_class }\n\n it 'keywordizes the hash' do\n hash = {\n 'foo' => 'bar',\n 'f00' => {'w00h00' => 'yeah'},\n 'bang' => [{'tricky' => 'one'}],\n 'env' => {'foo' => 'bar'},\n 'null' => nil\n }\n\n expect(subject.keywordize_hash!(hash)).to eq({\n :foo => 'bar',\n :f00 => {:w00h00 => 'yeah'},\n :bang => [{:tricky => 'one'}],\n :env => {'foo' => 'bar'},\n :null => nil\n })\n # make sure, it changes the hash w/o creating a new one\n expect(hash[:foo]).to eq('bar')\n end\n end\n\n describe '.remove_keys' do\n subject { described_class }\n\n it 'removes keys from hash' do\n hash = {\n :foo => 'bar',\n :deleteme => {'w00h00' => 'yeah'},\n :blah => [{:deleteme => :foo}, 1]\n }\n\n expect(subject.remove_keys(hash, [:deleteme])).to eq({\n :foo => 'bar',\n :blah => [{}, 1]\n })\n # make sure, it does not changes the original hash\n expect(hash.size).to eq(3)\n end\n end\n\nend\n", "meta": {"content_hash": "01f3807ccc9b3516efc9af95874cb857", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 97, "avg_line_length": 26.04597701149425, "alnum_prop": 0.5335392762577229, "repo_name": "yp-engineering/marathon-api", "id": "472321938a50689d4a2ad4128401993ad703aaee", "size": "2266", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/marathon/util_spec.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "99503"}]}} +{"text": "package saltchannel.dev;\n\npublic interface ServerSessionFactory {\n public ByteChannelServerSession createSession();\n}\n", "meta": {"content_hash": "7fd8760b76c6adb91d1a7be8bde0bf94", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 52, "avg_line_length": 24.2, "alnum_prop": 0.8181818181818182, "repo_name": "assaabloy-ppi/salt-channel", "id": "2776feae5250539c7480cd302930ab363c2bb9e0", "size": "121", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/saltchannel/dev/ServerSessionFactory.java", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "2311"}, {"name": "Java", "bytes": "600439"}]}} +{"text": "\r\n#include <CtrlLib/CtrlLib.h>\r\n\r\nusing namespace Upp;\r\n\r\n#include <LogCtrl/LogCtrl.h>\r\n\r\n#define LAYOUTFILE <LogCtrlTest/LogCtrlTest.lay>\r\n#include <CtrlCore/lay.h>\r\n\r\n\r\n\r\nclass LogCtrlTest : public WithLogCtrlTestLayout<TopWindow> {\r\npublic:\r\n\ttypedef LogCtrlTest CLASSNAME;\r\n\tLogCtrlTest();\r\n\t\r\n\tvoid Clear() { log.Clear(); }\r\n\tvoid Save() { log.Save(); }\r\n\t\r\n\tLogCtrl log;\r\n};\r\n\r\n#endif\r\n\r\n", "meta": {"content_hash": "395bbe885d804f6dfa4699086d7c9e6a", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 61, "avg_line_length": 15.76, "alnum_prop": 0.6700507614213198, "repo_name": "dreamsxin/ultimatepp", "id": "a34845f15b3173d02a9ecac9ac028f969d8a10b7", "size": "466", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bazaar/LogCtrlTest/LogCtrlTest.h", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Assembly", "bytes": "8477"}, {"name": "C", "bytes": "47921993"}, {"name": "C++", "bytes": "28354499"}, {"name": "CSS", "bytes": "659"}, {"name": "JavaScript", "bytes": "7006"}, {"name": "Objective-C", "bytes": "178854"}, {"name": "Perl", "bytes": "65041"}, {"name": "Python", "bytes": "38142"}, {"name": "Shell", "bytes": "91097"}, {"name": "Smalltalk", "bytes": "101"}, {"name": "Turing", "bytes": "661569"}]}} +{"text": "<?php \nclass ControllerSaleCustomer extends Controller { \n\tprivate $error = array();\n\n\tpublic function index() {\n\t\t$this->language->load('sale/customer');\n\n\t\t$this->document->setTitle($this->language->get('heading_title'));\n\n\t\t$this->load->model('sale/customer');\n\n\t\t$this->getList();\n\t}\n\n\tpublic function insert() {\n\t\t$this->language->load('sale/customer');\n\n\t\t$this->document->setTitle($this->language->get('heading_title'));\n\n\t\t$this->load->model('sale/customer');\n\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {\n\t\t\t$this->model_sale_customer->addCustomer($this->request->post);\n\n\t\t\t$this->session->data['success'] = $this->language->get('text_success');\n\n\t\t\t$url = '';\n\n\t\t\tif (isset($this->request->get['filter_name'])) {\n\t\t\t\t$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_email'])) {\n\t\t\t\t$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_customer_group_id'])) {\n\t\t\t\t$url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_approved'])) {\n\t\t\t\t$url .= '&filter_approved=' . $this->request->get['filter_approved'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_ip'])) {\n\t\t\t\t$url .= '&filter_ip=' . $this->request->get['filter_ip'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_date_added'])) {\n\t\t\t\t$url .= '&filter_date_added=' . $this->request->get['filter_date_added'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['sort'])) {\n\t\t\t\t$url .= '&sort=' . $this->request->get['sort'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['order'])) {\n\t\t\t\t$url .= '&order=' . $this->request->get['order'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['page'])) {\n\t\t\t\t$url .= '&page=' . $this->request->get['page'];\n\t\t\t}\n\n\t\t\t$this->redirect($this->url->link('sale/customer', 'token=' . $this->session->data['token'] . $url, 'SSL'));\n\t\t}\n\n\t\t$this->getForm();\n\t}\n\n\tpublic function update() {\n\t\t$this->language->load('sale/customer');\n\n\t\t$this->document->setTitle($this->language->get('heading_title'));\n\n\t\t$this->load->model('sale/customer');\n\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {\n\t\t\t$this->model_sale_customer->editCustomer($this->request->get['customer_id'], $this->request->post);\n\n\t\t\t$this->session->data['success'] = $this->language->get('text_success');\n\n\t\t\t$url = '';\n\n\t\t\tif (isset($this->request->get['filter_name'])) {\n\t\t\t\t$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_email'])) {\n\t\t\t\t$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_customer_group_id'])) {\n\t\t\t\t$url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_approved'])) {\n\t\t\t\t$url .= '&filter_approved=' . $this->request->get['filter_approved'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_ip'])) {\n\t\t\t\t$url .= '&filter_ip=' . $this->request->get['filter_ip'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_date_added'])) {\n\t\t\t\t$url .= '&filter_date_added=' . $this->request->get['filter_date_added'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['sort'])) {\n\t\t\t\t$url .= '&sort=' . $this->request->get['sort'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['order'])) {\n\t\t\t\t$url .= '&order=' . $this->request->get['order'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['page'])) {\n\t\t\t\t$url .= '&page=' . $this->request->get['page'];\n\t\t\t}\n\n\t\t\t$this->redirect($this->url->link('sale/customer', 'token=' . $this->session->data['token'] . $url, 'SSL'));\n\t\t}\n\n\t\t$this->getForm();\n\t}\n\n\tpublic function delete() {\n\t\t$this->language->load('sale/customer');\n\n\t\t$this->document->setTitle($this->language->get('heading_title'));\n\n\t\t$this->load->model('sale/customer');\n\n\t\tif (isset($this->request->post['selected']) && $this->validateDelete()) {\n\t\t\tforeach ($this->request->post['selected'] as $customer_id) {\n\t\t\t\t$this->model_sale_customer->deleteCustomer($customer_id);\n\t\t\t}\n\n\t\t\t$this->session->data['success'] = $this->language->get('text_success');\n\n\t\t\t$url = '';\n\n\t\t\tif (isset($this->request->get['filter_name'])) {\n\t\t\t\t$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_email'])) {\n\t\t\t\t$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_customer_group_id'])) {\n\t\t\t\t$url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_approved'])) {\n\t\t\t\t$url .= '&filter_approved=' . $this->request->get['filter_approved'];\n\t\t\t}\t\n\n\t\t\tif (isset($this->request->get['filter_ip'])) {\n\t\t\t\t$url .= '&filter_ip=' . $this->request->get['filter_ip'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_date_added'])) {\n\t\t\t\t$url .= '&filter_date_added=' . $this->request->get['filter_date_added'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['sort'])) {\n\t\t\t\t$url .= '&sort=' . $this->request->get['sort'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['order'])) {\n\t\t\t\t$url .= '&order=' . $this->request->get['order'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['page'])) {\n\t\t\t\t$url .= '&page=' . $this->request->get['page'];\n\t\t\t}\n\n\t\t\t$this->redirect($this->url->link('sale/customer', 'token=' . $this->session->data['token'] . $url, 'SSL'));\n\t\t}\n\n\t\t$this->getList();\n\t}\n\n\tpublic function approve() {\n\t\t$this->language->load('sale/customer');\n\n\t\t$this->document->setTitle($this->language->get('heading_title'));\n\n\t\t$this->load->model('sale/customer');\n\n\t\tif (!$this->user->hasPermission('modify', 'sale/customer')) {\n\t\t\t$this->error['warning'] = $this->language->get('error_permission');\n\t\t} elseif (isset($this->request->post['selected'])) {\n\t\t\t$approved = 0;\n\n\t\t\tforeach ($this->request->post['selected'] as $customer_id) {\n\t\t\t\t$customer_info = $this->model_sale_customer->getCustomer($customer_id);\n\n\t\t\t\tif ($customer_info && !$customer_info['approved']) {\n\t\t\t\t\t$this->model_sale_customer->approve($customer_id);\n\n\t\t\t\t\t$approved++;\n\t\t\t\t}\n\t\t\t} \n\n\t\t\t$this->session->data['success'] = sprintf($this->language->get('text_approved'), $approved);\t\n\n\t\t\t$url = '';\n\n\t\t\tif (isset($this->request->get['filter_name'])) {\n\t\t\t\t$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_email'])) {\n\t\t\t\t$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_customer_group_id'])) {\n\t\t\t\t$url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_approved'])) {\n\t\t\t\t$url .= '&filter_approved=' . $this->request->get['filter_approved'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_ip'])) {\n\t\t\t\t$url .= '&filter_ip=' . $this->request->get['filter_ip'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_date_added'])) {\n\t\t\t\t$url .= '&filter_date_added=' . $this->request->get['filter_date_added'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['sort'])) {\n\t\t\t\t$url .= '&sort=' . $this->request->get['sort'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['order'])) {\n\t\t\t\t$url .= '&order=' . $this->request->get['order'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['page'])) {\n\t\t\t\t$url .= '&page=' . $this->request->get['page'];\n\t\t\t}\t\n\n\t\t\t$this->redirect($this->url->link('sale/customer', 'token=' . $this->session->data['token'] . $url, 'SSL'));\t\t\t\n\t\t}\n\n\t\t$this->getList();\n\t} \n\n\tprotected function getList() {\n\t\tif (isset($this->request->get['filter_name'])) {\n\t\t\t$filter_name = $this->request->get['filter_name'];\n\t\t} else {\n\t\t\t$filter_name = null;\n\t\t}\n\n\t\tif (isset($this->request->get['filter_email'])) {\n\t\t\t$filter_email = $this->request->get['filter_email'];\n\t\t} else {\n\t\t\t$filter_email = null;\n\t\t}\n\n\t\tif (isset($this->request->get['filter_customer_group_id'])) {\n\t\t\t$filter_customer_group_id = $this->request->get['filter_customer_group_id'];\n\t\t} else {\n\t\t\t$filter_customer_group_id = null;\n\t\t}\n\n\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t$filter_status = $this->request->get['filter_status'];\n\t\t} else {\n\t\t\t$filter_status = null;\n\t\t}\n\n\t\tif (isset($this->request->get['filter_approved'])) {\n\t\t\t$filter_approved = $this->request->get['filter_approved'];\n\t\t} else {\n\t\t\t$filter_approved = null;\n\t\t}\n\n\t\tif (isset($this->request->get['filter_ip'])) {\n\t\t\t$filter_ip = $this->request->get['filter_ip'];\n\t\t} else {\n\t\t\t$filter_ip = null;\n\t\t}\n\n\t\tif (isset($this->request->get['filter_date_added'])) {\n\t\t\t$filter_date_added = $this->request->get['filter_date_added'];\n\t\t} else {\n\t\t\t$filter_date_added = null;\n\t\t}\t\t\n\n\t\tif (isset($this->request->get['sort'])) {\n\t\t\t$sort = $this->request->get['sort'];\n\t\t} else {\n\t\t\t$sort = 'name'; \n\t\t}\n\n\t\tif (isset($this->request->get['order'])) {\n\t\t\t$order = $this->request->get['order'];\n\t\t} else {\n\t\t\t$order = 'ASC';\n\t\t}\n\n\t\tif (isset($this->request->get['page'])) {\n\t\t\t$page = $this->request->get['page'];\n\t\t} else {\n\t\t\t$page = 1;\n\t\t}\n\n\t\t$url = '';\n\n\t\tif (isset($this->request->get['filter_name'])) {\n\t\t\t$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));\n\t\t}\n\n\t\tif (isset($this->request->get['filter_email'])) {\n\t\t\t$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));\n\t\t}\n\n\t\tif (isset($this->request->get['filter_customer_group_id'])) {\n\t\t\t$url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_approved'])) {\n\t\t\t$url .= '&filter_approved=' . $this->request->get['filter_approved'];\n\t\t}\t\n\n\t\tif (isset($this->request->get['filter_ip'])) {\n\t\t\t$url .= '&filter_ip=' . $this->request->get['filter_ip'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_date_added'])) {\n\t\t\t$url .= '&filter_date_added=' . $this->request->get['filter_date_added'];\n\t\t}\n\n\t\tif (isset($this->request->get['sort'])) {\n\t\t\t$url .= '&sort=' . $this->request->get['sort'];\n\t\t}\n\n\t\tif (isset($this->request->get['order'])) {\n\t\t\t$url .= '&order=' . $this->request->get['order'];\n\t\t}\n\n\t\tif (isset($this->request->get['page'])) {\n\t\t\t$url .= '&page=' . $this->request->get['page'];\n\t\t}\n\n\t\t$this->data['breadcrumbs'] = array();\n\n\t\t$this->data['breadcrumbs'][] = array(\n\t\t\t'text' => $this->language->get('text_home'),\n\t\t\t'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),\n\t\t\t'separator' => false\n\t\t);\n\n\t\t$this->data['breadcrumbs'][] = array(\n\t\t\t'text' => $this->language->get('heading_title'),\n\t\t\t'href' => $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . $url, 'SSL'),\n\t\t\t'separator' => ' :: '\n\t\t);\n\n\t\t$this->data['approve'] = $this->url->link('sale/customer/approve', 'token=' . $this->session->data['token'] . $url, 'SSL');\n\t\t$this->data['insert'] = $this->url->link('sale/customer/insert', 'token=' . $this->session->data['token'] . $url, 'SSL');\n\t\t$this->data['delete'] = $this->url->link('sale/customer/delete', 'token=' . $this->session->data['token'] . $url, 'SSL');\n\n\t\t$this->data['customers'] = array();\n\n\t\t$data = array(\n\t\t\t'filter_name' => $filter_name, \n\t\t\t'filter_email' => $filter_email, \n\t\t\t'filter_customer_group_id' => $filter_customer_group_id, \n\t\t\t'filter_status' => $filter_status, \n\t\t\t'filter_approved' => $filter_approved, \n\t\t\t'filter_date_added' => $filter_date_added,\n\t\t\t'filter_ip' => $filter_ip,\n\t\t\t'sort' => $sort,\n\t\t\t'order' => $order,\n\t\t\t'start' => ($page - 1) * $this->config->get('config_admin_limit'),\n\t\t\t'limit' => $this->config->get('config_admin_limit')\n\t\t);\n\n\t\t$customer_total = $this->model_sale_customer->getTotalCustomers($data);\n\n\t\t$results = $this->model_sale_customer->getCustomers($data);\n\n\t\tforeach ($results as $result) {\n\t\t\t$action = array();\n\n\t\t\t$action[] = array(\n\t\t\t\t'text' => $this->language->get('text_edit'),\n\t\t\t\t'href' => $this->url->link('sale/customer/update', 'token=' . $this->session->data['token'] . '&customer_id=' . $result['customer_id'] . $url, 'SSL')\n\t\t\t);\n\n\t\t\t$this->data['customers'][] = array(\n\t\t\t\t'customer_id' => $result['customer_id'],\n\t\t\t\t'name' => $result['name'],\n\t\t\t\t'email' => $result['email'],\n\t\t\t\t'customer_group' => $result['customer_group'],\n\t\t\t\t'status' => ($result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled')),\n\t\t\t\t'approved' => ($result['approved'] ? $this->language->get('text_yes') : $this->language->get('text_no')),\n\t\t\t\t'ip' => $result['ip'],\n\t\t\t\t'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),\n\t\t\t\t'selected' => isset($this->request->post['selected']) && in_array($result['customer_id'], $this->request->post['selected']),\n\t\t\t\t'action' => $action\n\t\t\t);\n\t\t}\t\n\n\t\t$this->data['heading_title'] = $this->language->get('heading_title');\n\n\t\t$this->data['text_enabled'] = $this->language->get('text_enabled');\n\t\t$this->data['text_disabled'] = $this->language->get('text_disabled');\n\t\t$this->data['text_yes'] = $this->language->get('text_yes');\n\t\t$this->data['text_no'] = $this->language->get('text_no');\t\n\t\t$this->data['text_select'] = $this->language->get('text_select');\t\n\t\t$this->data['text_default'] = $this->language->get('text_default');\t\t\n\t\t$this->data['text_no_results'] = $this->language->get('text_no_results');\n\n\t\t$this->data['column_name'] = $this->language->get('column_name');\n\t\t$this->data['column_email'] = $this->language->get('column_email');\n\t\t$this->data['column_customer_group'] = $this->language->get('column_customer_group');\n\t\t$this->data['column_status'] = $this->language->get('column_status');\n\t\t$this->data['column_approved'] = $this->language->get('column_approved');\n\t\t$this->data['column_ip'] = $this->language->get('column_ip');\n\t\t$this->data['column_date_added'] = $this->language->get('column_date_added');\n\t\t$this->data['column_login'] = $this->language->get('column_login');\n\t\t$this->data['column_action'] = $this->language->get('column_action');\t\t\n\n\t\t$this->data['button_approve'] = $this->language->get('button_approve');\n\t\t$this->data['button_insert'] = $this->language->get('button_insert');\n\t\t$this->data['button_delete'] = $this->language->get('button_delete');\n\t\t$this->data['button_filter'] = $this->language->get('button_filter');\n\n\t\t$this->data['token'] = $this->session->data['token'];\n\n\t\tif (isset($this->error['warning'])) {\n\t\t\t$this->data['error_warning'] = $this->error['warning'];\n\t\t} else {\n\t\t\t$this->data['error_warning'] = '';\n\t\t}\n\n\t\tif (isset($this->session->data['success'])) {\n\t\t\t$this->data['success'] = $this->session->data['success'];\n\n\t\t\tunset($this->session->data['success']);\n\t\t} else {\n\t\t\t$this->data['success'] = '';\n\t\t}\n\n\t\t$url = '';\n\n\t\tif (isset($this->request->get['filter_name'])) {\n\t\t\t$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));\n\t\t}\n\n\t\tif (isset($this->request->get['filter_email'])) {\n\t\t\t$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));\n\t\t}\n\n\t\tif (isset($this->request->get['filter_customer_group_id'])) {\n\t\t\t$url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_approved'])) {\n\t\t\t$url .= '&filter_approved=' . $this->request->get['filter_approved'];\n\t\t}\t\n\n\t\tif (isset($this->request->get['filter_ip'])) {\n\t\t\t$url .= '&filter_ip=' . $this->request->get['filter_ip'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_date_added'])) {\n\t\t\t$url .= '&filter_date_added=' . $this->request->get['filter_date_added'];\n\t\t}\n\n\t\tif ($order == 'ASC') {\n\t\t\t$url .= '&order=DESC';\n\t\t} else {\n\t\t\t$url .= '&order=ASC';\n\t\t}\n\n\t\tif (isset($this->request->get['page'])) {\n\t\t\t$url .= '&page=' . $this->request->get['page'];\n\t\t}\n\n\t\t$this->data['sort_name'] = $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . '&sort=name' . $url, 'SSL');\n\t\t$this->data['sort_email'] = $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . '&sort=c.email' . $url, 'SSL');\n\t\t$this->data['sort_customer_group'] = $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . '&sort=customer_group' . $url, 'SSL');\n\t\t$this->data['sort_status'] = $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . '&sort=c.status' . $url, 'SSL');\n\t\t$this->data['sort_approved'] = $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . '&sort=c.approved' . $url, 'SSL');\n\t\t$this->data['sort_ip'] = $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . '&sort=c.ip' . $url, 'SSL');\n\t\t$this->data['sort_date_added'] = $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . '&sort=c.date_added' . $url, 'SSL');\n\n\t\t$url = '';\n\n\t\tif (isset($this->request->get['filter_name'])) {\n\t\t\t$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));\n\t\t}\n\n\t\tif (isset($this->request->get['filter_email'])) {\n\t\t\t$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));\n\t\t}\n\n\t\tif (isset($this->request->get['filter_customer_group_id'])) {\n\t\t\t$url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_approved'])) {\n\t\t\t$url .= '&filter_approved=' . $this->request->get['filter_approved'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_ip'])) {\n\t\t\t$url .= '&filter_ip=' . $this->request->get['filter_ip'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_date_added'])) {\n\t\t\t$url .= '&filter_date_added=' . $this->request->get['filter_date_added'];\n\t\t}\n\n\t\tif (isset($this->request->get['sort'])) {\n\t\t\t$url .= '&sort=' . $this->request->get['sort'];\n\t\t}\n\n\t\tif (isset($this->request->get['order'])) {\n\t\t\t$url .= '&order=' . $this->request->get['order'];\n\t\t}\n\n\t\t$pagination = new Pagination();\n\t\t$pagination->total = $customer_total;\n\t\t$pagination->page = $page;\n\t\t$pagination->limit = $this->config->get('config_admin_limit');\n\t\t$pagination->text = $this->language->get('text_pagination');\n\t\t$pagination->url = $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . $url . '&page={page}', 'SSL');\n\n\t\t$this->data['pagination'] = $pagination->render();\n\n\t\t$this->data['filter_name'] = $filter_name;\n\t\t$this->data['filter_email'] = $filter_email;\n\t\t$this->data['filter_customer_group_id'] = $filter_customer_group_id;\n\t\t$this->data['filter_status'] = $filter_status;\n\t\t$this->data['filter_approved'] = $filter_approved;\n\t\t$this->data['filter_ip'] = $filter_ip;\n\t\t$this->data['filter_date_added'] = $filter_date_added;\n\n\t\t$this->load->model('sale/customer_group');\n\n\t\t$this->data['customer_groups'] = $this->model_sale_customer_group->getCustomerGroups();\n\n\t\t$this->load->model('setting/store');\n\n\t\t$this->data['stores'] = $this->model_setting_store->getStores();\n\n\t\t$this->data['sort'] = $sort;\n\t\t$this->data['order'] = $order;\n\n\t\t$this->template = 'sale/customer_list.tpl';\n\t\t$this->children = array(\n\t\t\t'common/header',\n\t\t\t'common/footer'\n\t\t);\n\n\t\t$this->response->setOutput($this->render());\n\t}\n\n\tprotected function getForm() {\n\t\t$this->data['heading_title'] = $this->language->get('heading_title');\n\n\t\t$this->data['text_enabled'] = $this->language->get('text_enabled');\n\t\t$this->data['text_disabled'] = $this->language->get('text_disabled');\n\t\t$this->data['text_select'] = $this->language->get('text_select');\n\t\t$this->data['text_none'] = $this->language->get('text_none');\n\t\t$this->data['text_wait'] = $this->language->get('text_wait');\n\t\t$this->data['text_no_results'] = $this->language->get('text_no_results');\n\t\t$this->data['text_add_ban_ip'] = $this->language->get('text_add_ban_ip');\n\t\t$this->data['text_remove_ban_ip'] = $this->language->get('text_remove_ban_ip');\n\n\t\t$this->data['column_ip'] = $this->language->get('column_ip');\n\t\t$this->data['column_total'] = $this->language->get('column_total');\n\t\t$this->data['column_date_added'] = $this->language->get('column_date_added');\n\t\t$this->data['column_action'] = $this->language->get('column_action');\n\n\t\t$this->data['entry_firstname'] = $this->language->get('entry_firstname');\n\t\t$this->data['entry_lastname'] = $this->language->get('entry_lastname');\n\t\t$this->data['entry_email'] = $this->language->get('entry_email');\n\t\t$this->data['entry_telephone'] = $this->language->get('entry_telephone');\n\t\t$this->data['entry_fax'] = $this->language->get('entry_fax');\n\t\t$this->data['entry_password'] = $this->language->get('entry_password');\n\t\t$this->data['entry_confirm'] = $this->language->get('entry_confirm');\n\t\t$this->data['entry_newsletter'] = $this->language->get('entry_newsletter');\n\t\t$this->data['entry_customer_group'] = $this->language->get('entry_customer_group');\n\t\t$this->data['entry_status'] = $this->language->get('entry_status');\n\t\t$this->data['entry_company'] = $this->language->get('entry_company');\n\t\t$this->data['entry_company_id'] = $this->language->get('entry_company_id');\n\t\t$this->data['entry_tax_id'] = $this->language->get('entry_tax_id');\n\t\t$this->data['entry_address_1'] = $this->language->get('entry_address_1');\n\t\t$this->data['entry_address_2'] = $this->language->get('entry_address_2');\n\t\t$this->data['entry_city'] = $this->language->get('entry_city');\n\t\t$this->data['entry_postcode'] = $this->language->get('entry_postcode');\n\t\t$this->data['entry_zone'] = $this->language->get('entry_zone');\n\t\t$this->data['entry_country'] = $this->language->get('entry_country');\n\t\t$this->data['entry_default'] = $this->language->get('entry_default');\n\t\t$this->data['entry_comment'] = $this->language->get('entry_comment');\n\t\t$this->data['entry_description'] = $this->language->get('entry_description');\n\t\t$this->data['entry_amount'] = $this->language->get('entry_amount');\n\t\t$this->data['entry_points'] = $this->language->get('entry_points');\n\n\t\t$this->data['button_save'] = $this->language->get('button_save');\n\t\t$this->data['button_cancel'] = $this->language->get('button_cancel');\n\t\t$this->data['button_add_address'] = $this->language->get('button_add_address');\n\t\t$this->data['button_add_history'] = $this->language->get('button_add_history');\n\t\t$this->data['button_add_transaction'] = $this->language->get('button_add_transaction');\n\t\t$this->data['button_add_reward'] = $this->language->get('button_add_reward');\n\t\t$this->data['button_remove'] = $this->language->get('button_remove');\n\n\t\t$this->data['tab_general'] = $this->language->get('tab_general');\n\t\t$this->data['tab_address'] = $this->language->get('tab_address');\n\t\t$this->data['tab_history'] = $this->language->get('tab_history');\n\t\t$this->data['tab_transaction'] = $this->language->get('tab_transaction');\n\t\t$this->data['tab_reward'] = $this->language->get('tab_reward');\n\t\t$this->data['tab_ip'] = $this->language->get('tab_ip');\n\n\t\t$this->data['token'] = $this->session->data['token'];\n\n\t\tif (isset($this->request->get['customer_id'])) {\n\t\t\t$this->data['customer_id'] = $this->request->get['customer_id'];\n\t\t} else {\n\t\t\t$this->data['customer_id'] = 0;\n\t\t}\n\n\t\tif (isset($this->error['warning'])) {\n\t\t\t$this->data['error_warning'] = $this->error['warning'];\n\t\t} else {\n\t\t\t$this->data['error_warning'] = '';\n\t\t}\n\n\t\tif (isset($this->error['firstname'])) {\n\t\t\t$this->data['error_firstname'] = $this->error['firstname'];\n\t\t} else {\n\t\t\t$this->data['error_firstname'] = '';\n\t\t}\n\n\t\tif (isset($this->error['lastname'])) {\n\t\t\t$this->data['error_lastname'] = $this->error['lastname'];\n\t\t} else {\n\t\t\t$this->data['error_lastname'] = '';\n\t\t}\n\n\t\tif (isset($this->error['email'])) {\n\t\t\t$this->data['error_email'] = $this->error['email'];\n\t\t} else {\n\t\t\t$this->data['error_email'] = '';\n\t\t}\n\n\t\tif (isset($this->error['telephone'])) {\n\t\t\t$this->data['error_telephone'] = $this->error['telephone'];\n\t\t} else {\n\t\t\t$this->data['error_telephone'] = '';\n\t\t}\n\n\t\tif (isset($this->error['password'])) {\n\t\t\t$this->data['error_password'] = $this->error['password'];\n\t\t} else {\n\t\t\t$this->data['error_password'] = '';\n\t\t}\n\n\t\tif (isset($this->error['confirm'])) {\n\t\t\t$this->data['error_confirm'] = $this->error['confirm'];\n\t\t} else {\n\t\t\t$this->data['error_confirm'] = '';\n\t\t}\n\n\t\tif (isset($this->error['address_firstname'])) {\n\t\t\t$this->data['error_address_firstname'] = $this->error['address_firstname'];\n\t\t} else {\n\t\t\t$this->data['error_address_firstname'] = '';\n\t\t}\n\n\t\tif (isset($this->error['address_lastname'])) {\n\t\t\t$this->data['error_address_lastname'] = $this->error['address_lastname'];\n\t\t} else {\n\t\t\t$this->data['error_address_lastname'] = '';\n\t\t}\n\n\t\tif (isset($this->error['address_tax_id'])) {\n\t\t\t$this->data['error_address_tax_id'] = $this->error['address_tax_id'];\n\t\t} else {\n\t\t\t$this->data['error_address_tax_id'] = '';\n\t\t}\n\n\t\tif (isset($this->error['address_address_1'])) {\n\t\t\t$this->data['error_address_address_1'] = $this->error['address_address_1'];\n\t\t} else {\n\t\t\t$this->data['error_address_address_1'] = '';\n\t\t}\n\n\t\tif (isset($this->error['address_city'])) {\n\t\t\t$this->data['error_address_city'] = $this->error['address_city'];\n\t\t} else {\n\t\t\t$this->data['error_address_city'] = '';\n\t\t}\n\n\t\tif (isset($this->error['address_postcode'])) {\n\t\t\t$this->data['error_address_postcode'] = $this->error['address_postcode'];\n\t\t} else {\n\t\t\t$this->data['error_address_postcode'] = '';\n\t\t}\n\n\t\tif (isset($this->error['address_country'])) {\n\t\t\t$this->data['error_address_country'] = $this->error['address_country'];\n\t\t} else {\n\t\t\t$this->data['error_address_country'] = '';\n\t\t}\n\n\t\tif (isset($this->error['address_zone'])) {\n\t\t\t$this->data['error_address_zone'] = $this->error['address_zone'];\n\t\t} else {\n\t\t\t$this->data['error_address_zone'] = '';\n\t\t}\n\n\t\t$url = '';\n\n\t\tif (isset($this->request->get['filter_name'])) {\n\t\t\t$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));\n\t\t}\n\n\t\tif (isset($this->request->get['filter_email'])) {\n\t\t\t$url .= '&filter_email=' . urlencode(html_entity_decode($this->request->get['filter_email'], ENT_QUOTES, 'UTF-8'));\n\t\t}\n\n\t\tif (isset($this->request->get['filter_customer_group_id'])) {\n\t\t\t$url .= '&filter_customer_group_id=' . $this->request->get['filter_customer_group_id'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n\t\t}\n\n\t\tif (isset($this->request->get['filter_approved'])) {\n\t\t\t$url .= '&filter_approved=' . $this->request->get['filter_approved'];\n\t\t}\t\n\n\t\tif (isset($this->request->get['filter_date_added'])) {\n\t\t\t$url .= '&filter_date_added=' . $this->request->get['filter_date_added'];\n\t\t}\n\n\t\tif (isset($this->request->get['sort'])) {\n\t\t\t$url .= '&sort=' . $this->request->get['sort'];\n\t\t}\n\n\t\tif (isset($this->request->get['order'])) {\n\t\t\t$url .= '&order=' . $this->request->get['order'];\n\t\t}\n\n\t\tif (isset($this->request->get['page'])) {\n\t\t\t$url .= '&page=' . $this->request->get['page'];\n\t\t}\n\n\t\t$this->data['breadcrumbs'] = array();\n\n\t\t$this->data['breadcrumbs'][] = array(\n\t\t\t'text' => $this->language->get('text_home'),\n\t\t\t'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),\n\t\t\t'separator' => false\n\t\t);\n\n\t\t$this->data['breadcrumbs'][] = array(\n\t\t\t'text' => $this->language->get('heading_title'),\n\t\t\t'href' => $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . $url, 'SSL'),\n\t\t\t'separator' => ' :: '\n\t\t);\n\n\t\tif (!isset($this->request->get['customer_id'])) {\n\t\t\t$this->data['action'] = $this->url->link('sale/customer/insert', 'token=' . $this->session->data['token'] . $url, 'SSL');\n\t\t} else {\n\t\t\t$this->data['action'] = $this->url->link('sale/customer/update', 'token=' . $this->session->data['token'] . '&customer_id=' . $this->request->get['customer_id'] . $url, 'SSL');\n\t\t}\n\n\t\t$this->data['cancel'] = $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . $url, 'SSL');\n\n\t\tif (isset($this->request->get['customer_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {\n\t\t\t$customer_info = $this->model_sale_customer->getCustomer($this->request->get['customer_id']);\n\t\t}\n\n\t\tif (isset($this->request->post['firstname'])) {\n\t\t\t$this->data['firstname'] = $this->request->post['firstname'];\n\t\t} elseif (!empty($customer_info)) { \n\t\t\t$this->data['firstname'] = $customer_info['firstname'];\n\t\t} else {\n\t\t\t$this->data['firstname'] = '';\n\t\t}\n\n\t\tif (isset($this->request->post['lastname'])) {\n\t\t\t$this->data['lastname'] = $this->request->post['lastname'];\n\t\t} elseif (!empty($customer_info)) {\n\t\t\t$this->data['lastname'] = $customer_info['lastname'];\n\t\t} else {\n\t\t\t$this->data['lastname'] = '';\n\t\t}\n\n\t\tif (isset($this->request->post['email'])) {\n\t\t\t$this->data['email'] = $this->request->post['email'];\n\t\t} elseif (!empty($customer_info)) {\n\t\t\t$this->data['email'] = $customer_info['email'];\n\t\t} else {\n\t\t\t$this->data['email'] = '';\n\t\t}\n\n\t\tif (isset($this->request->post['telephone'])) {\n\t\t\t$this->data['telephone'] = $this->request->post['telephone'];\n\t\t} elseif (!empty($customer_info)) {\n\t\t\t$this->data['telephone'] = $customer_info['telephone'];\n\t\t} else {\n\t\t\t$this->data['telephone'] = '';\n\t\t}\n\n\t\tif (isset($this->request->post['fax'])) {\n\t\t\t$this->data['fax'] = $this->request->post['fax'];\n\t\t} elseif (!empty($customer_info)) {\n\t\t\t$this->data['fax'] = $customer_info['fax'];\n\t\t} else {\n\t\t\t$this->data['fax'] = '';\n\t\t}\n\n\t\tif (isset($this->request->post['newsletter'])) {\n\t\t\t$this->data['newsletter'] = $this->request->post['newsletter'];\n\t\t} elseif (!empty($customer_info)) {\n\t\t\t$this->data['newsletter'] = $customer_info['newsletter'];\n\t\t} else {\n\t\t\t$this->data['newsletter'] = '';\n\t\t}\n\n\t\t$this->load->model('sale/customer_group');\n\n\t\t$this->data['customer_groups'] = $this->model_sale_customer_group->getCustomerGroups();\n\n\t\tif (isset($this->request->post['customer_group_id'])) {\n\t\t\t$this->data['customer_group_id'] = $this->request->post['customer_group_id'];\n\t\t} elseif (!empty($customer_info)) {\n\t\t\t$this->data['customer_group_id'] = $customer_info['customer_group_id'];\n\t\t} else {\n\t\t\t$this->data['customer_group_id'] = $this->config->get('config_customer_group_id');\n\t\t}\n\n\t\tif (isset($this->request->post['status'])) {\n\t\t\t$this->data['status'] = $this->request->post['status'];\n\t\t} elseif (!empty($customer_info)) {\n\t\t\t$this->data['status'] = $customer_info['status'];\n\t\t} else {\n\t\t\t$this->data['status'] = 1;\n\t\t}\n\n\t\tif (isset($this->request->post['password'])) {\n\t\t\t$this->data['password'] = $this->request->post['password'];\n\t\t} else {\n\t\t\t$this->data['password'] = '';\n\t\t}\n\n\t\tif (isset($this->request->post['confirm'])) { \n\t\t\t$this->data['confirm'] = $this->request->post['confirm'];\n\t\t} else {\n\t\t\t$this->data['confirm'] = '';\n\t\t}\n\n\t\t$this->load->model('localisation/country');\n\n\t\t$this->data['countries'] = $this->model_localisation_country->getCountries();\n\n\t\tif (isset($this->request->post['address'])) { \n\t\t\t$this->data['addresses'] = $this->request->post['address'];\n\t\t} elseif (isset($this->request->get['customer_id'])) {\n\t\t\t$this->data['addresses'] = $this->model_sale_customer->getAddresses($this->request->get['customer_id']);\n\t\t} else {\n\t\t\t$this->data['addresses'] = array();\n\t\t}\n\n\t\tif (isset($this->request->post['address_id'])) {\n\t\t\t$this->data['address_id'] = $this->request->post['address_id'];\n\t\t} elseif (!empty($customer_info)) {\n\t\t\t$this->data['address_id'] = $customer_info['address_id'];\n\t\t} else {\n\t\t\t$this->data['address_id'] = '';\n\t\t}\n\n\t\t$this->data['ips'] = array();\n\n\t\tif (!empty($customer_info)) {\n\t\t\t$results = $this->model_sale_customer->getIpsByCustomerId($this->request->get['customer_id']);\n\n\t\t\tforeach ($results as $result) {\n\t\t\t\t$ban_ip_total = $this->model_sale_customer->getTotalBanIpsByIp($result['ip']);\n\n\t\t\t\t$this->data['ips'][] = array(\n\t\t\t\t\t'ip' => $result['ip'],\n\t\t\t\t\t'total' => $this->model_sale_customer->getTotalCustomersByIp($result['ip']),\n\t\t\t\t\t'date_added' => date('d/m/y', strtotime($result['date_added'])),\n\t\t\t\t\t'filter_ip' => $this->url->link('sale/customer', 'token=' . $this->session->data['token'] . '&filter_ip=' . $result['ip'], 'SSL'),\n\t\t\t\t\t'ban_ip' => $ban_ip_total\n\t\t\t\t);\n\t\t\t}\n\t\t}\t\t\n\n\t\t$this->template = 'sale/customer_form.tpl';\n\t\t$this->children = array(\n\t\t\t'common/header',\n\t\t\t'common/footer'\n\t\t);\n\n\t\t$this->response->setOutput($this->render());\n\t}\n\n\tprotected function validateForm() {\n\t\tif (!$this->user->hasPermission('modify', 'sale/customer')) {\n\t\t\t$this->error['warning'] = $this->language->get('error_permission');\n\t\t}\n\n\t\tif ((utf8_strlen($this->request->post['firstname']) < 1) || (utf8_strlen($this->request->post['firstname']) > 32)) {\n\t\t\t$this->error['firstname'] = $this->language->get('error_firstname');\n\t\t}\n\n\t\tif ((utf8_strlen($this->request->post['lastname']) < 1) || (utf8_strlen($this->request->post['lastname']) > 32)) {\n\t\t\t$this->error['lastname'] = $this->language->get('error_lastname');\n\t\t}\n\n\t\tif ((utf8_strlen($this->request->post['email']) > 96) || !preg_match('/^[^\\@]+@.*\\.[a-z]{2,6}$/i', $this->request->post['email'])) {\n\t\t\t$this->error['email'] = $this->language->get('error_email');\n\t\t}\n\n\t\t$customer_info = $this->model_sale_customer->getCustomerByEmail($this->request->post['email']);\n\n\t\tif (!isset($this->request->get['customer_id'])) {\n\t\t\tif ($customer_info) {\n\t\t\t\t$this->error['warning'] = $this->language->get('error_exists');\n\t\t\t}\n\t\t} else {\n\t\t\tif ($customer_info && ($this->request->get['customer_id'] != $customer_info['customer_id'])) {\n\t\t\t\t$this->error['warning'] = $this->language->get('error_exists');\n\t\t\t}\n\t\t}\n\n\t\tif ((utf8_strlen($this->request->post['telephone']) < 3) || (utf8_strlen($this->request->post['telephone']) > 32)) {\n\t\t\t$this->error['telephone'] = $this->language->get('error_telephone');\n\t\t}\n\n\t\tif ($this->request->post['password'] || (!isset($this->request->get['customer_id']))) {\n\t\t\tif ((utf8_strlen($this->request->post['password']) < 4) || (utf8_strlen($this->request->post['password']) > 20)) {\n\t\t\t\t$this->error['password'] = $this->language->get('error_password');\n\t\t\t}\n\n\t\t\tif ($this->request->post['password'] != $this->request->post['confirm']) {\n\t\t\t\t$this->error['confirm'] = $this->language->get('error_confirm');\n\t\t\t}\n\t\t}\n\n\t\tif (isset($this->request->post['address'])) {\n\t\t\tforeach ($this->request->post['address'] as $key => $value) {\n\t\t\t\tif ((utf8_strlen($value['firstname']) < 1) || (utf8_strlen($value['firstname']) > 32)) {\n\t\t\t\t\t$this->error['address_firstname'][$key] = $this->language->get('error_firstname');\n\t\t\t\t}\n\n\t\t\t\tif ((utf8_strlen($value['lastname']) < 1) || (utf8_strlen($value['lastname']) > 32)) {\n\t\t\t\t\t$this->error['address_lastname'][$key] = $this->language->get('error_lastname');\n\t\t\t\t}\t\n\n\t\t\t\tif ((utf8_strlen($value['address_1']) < 3) || (utf8_strlen($value['address_1']) > 128)) {\n\t\t\t\t\t$this->error['address_address_1'][$key] = $this->language->get('error_address_1');\n\t\t\t\t}\n\n\t\t\t\tif ((utf8_strlen($value['city']) < 2) || (utf8_strlen($value['city']) > 128)) {\n\t\t\t\t\t$this->error['address_city'][$key] = $this->language->get('error_city');\n\t\t\t\t} \n\n\t\t\t\t$this->load->model('localisation/country');\n\n\t\t\t\t$country_info = $this->model_localisation_country->getCountry($value['country_id']);\n\n\t\t\t\tif ($country_info) {\n\t\t\t\t\tif ($country_info['postcode_required'] && (utf8_strlen($value['postcode']) < 2) || (utf8_strlen($value['postcode']) > 10)) {\n\t\t\t\t\t\t$this->error['address_postcode'][$key] = $this->language->get('error_postcode');\n\t\t\t\t\t}\n\n\t\t\t\t\t// VAT Validation\n\t\t\t\t\t$this->load->helper('vat');\n\n\t\t\t\t\tif ($this->config->get('config_vat') && $value['tax_id'] && (vat_validation($country_info['iso_code_2'], $value['tax_id']) == 'invalid')) {\n\t\t\t\t\t\t$this->error['address_tax_id'][$key] = $this->language->get('error_vat');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($value['country_id'] == '') {\n\t\t\t\t\t$this->error['address_country'][$key] = $this->language->get('error_country');\n\t\t\t\t}\n\n\t\t\t\tif (!isset($value['zone_id']) || $value['zone_id'] == '') {\n\t\t\t\t\t$this->error['address_zone'][$key] = $this->language->get('error_zone');\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\tif ($this->error && !isset($this->error['warning'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_warning');\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tprotected function validateDelete() {\n\t\tif (!$this->user->hasPermission('modify', 'sale/customer')) {\n\t\t\t$this->error['warning'] = $this->language->get('error_permission');\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t} \n\t}\n\n\tpublic function login() {\n\t\t$json = array();\n\n\t\tif (isset($this->request->get['customer_id'])) {\n\t\t\t$customer_id = $this->request->get['customer_id'];\n\t\t} else {\n\t\t\t$customer_id = 0;\n\t\t}\n\n\t\t$this->load->model('sale/customer');\n\n\t\t$customer_info = $this->model_sale_customer->getCustomer($customer_id);\n\n\t\tif ($customer_info) {\n\t\t\t$token = md5(mt_rand());\n\n\t\t\t$this->model_sale_customer->editToken($customer_id, $token);\n\n\t\t\tif (isset($this->request->get['store_id'])) {\n\t\t\t\t$store_id = $this->request->get['store_id'];\n\t\t\t} else {\n\t\t\t\t$store_id = 0;\n\t\t\t}\n\n\t\t\t$this->load->model('setting/store');\n\n\t\t\t$store_info = $this->model_setting_store->getStore($store_id);\n\n\t\t\tif ($store_info) {\n\t\t\t\t$this->redirect($store_info['url'] . 'index.php?route=account/login&token=' . $token);\n\t\t\t} else { \n\t\t\t\t$this->redirect(HTTP_CATALOG . 'index.php?route=account/login&token=' . $token);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->language->load('error/not_found');\n\n\t\t\t$this->document->setTitle($this->language->get('heading_title'));\n\n\t\t\t$this->data['heading_title'] = $this->language->get('heading_title');\n\n\t\t\t$this->data['text_not_found'] = $this->language->get('text_not_found');\n\n\t\t\t$this->data['breadcrumbs'] = array();\n\n\t\t\t$this->data['breadcrumbs'][] = array(\n\t\t\t\t'text' => $this->language->get('text_home'),\n\t\t\t\t'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),\n\t\t\t\t'separator' => false\n\t\t\t);\n\n\t\t\t$this->data['breadcrumbs'][] = array(\n\t\t\t\t'text' => $this->language->get('heading_title'),\n\t\t\t\t'href' => $this->url->link('error/not_found', 'token=' . $this->session->data['token'], 'SSL'),\n\t\t\t\t'separator' => ' :: '\n\t\t\t);\n\n\t\t\t$this->template = 'error/not_found.tpl';\n\t\t\t$this->children = array(\n\t\t\t\t'common/header',\n\t\t\t\t'common/footer'\n\t\t\t);\n\n\t\t\t$this->response->setOutput($this->render());\n\t\t}\n\t}\n\n\tpublic function history() {\n\t\t$this->language->load('sale/customer');\n\n\t\t$this->load->model('sale/customer');\n\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->user->hasPermission('modify', 'sale/customer')) { \n\t\t\t$this->model_sale_customer->addHistory($this->request->get['customer_id'], $this->request->post['comment']);\n\n\t\t\t$this->data['success'] = $this->language->get('text_success');\n\t\t} else {\n\t\t\t$this->data['success'] = '';\n\t\t}\n\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && !$this->user->hasPermission('modify', 'sale/customer')) {\n\t\t\t$this->data['error_warning'] = $this->language->get('error_permission');\n\t\t} else {\n\t\t\t$this->data['error_warning'] = '';\n\t\t}\t\t\n\n\t\t$this->data['text_no_results'] = $this->language->get('text_no_results');\n\n\t\t$this->data['column_date_added'] = $this->language->get('column_date_added');\n\t\t$this->data['column_comment'] = $this->language->get('column_comment');\n\n\t\tif (isset($this->request->get['page'])) {\n\t\t\t$page = $this->request->get['page'];\n\t\t} else {\n\t\t\t$page = 1;\n\t\t} \n\n\t\t$this->data['histories'] = array();\n\n\t\t$results = $this->model_sale_customer->getHistories($this->request->get['customer_id'], ($page - 1) * 10, 10);\n\n\t\tforeach ($results as $result) {\n\t\t\t$this->data['histories'][] = array(\n\t\t\t\t'comment' => $result['comment'],\n\t\t\t\t'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))\n\t\t\t);\n\t\t}\n\n\t\t$transaction_total = $this->model_sale_customer->getTotalHistories($this->request->get['customer_id']);\n\n\t\t$pagination = new Pagination();\n\t\t$pagination->total = $transaction_total;\n\t\t$pagination->page = $page;\n\t\t$pagination->limit = 10; \n\t\t$pagination->text = $this->language->get('text_pagination');\n\t\t$pagination->url = $this->url->link('sale/customer/history', 'token=' . $this->session->data['token'] . '&customer_id=' . $this->request->get['customer_id'] . '&page={page}', 'SSL');\n\n\t\t$this->data['pagination'] = $pagination->render();\n\n\t\t$this->template = 'sale/customer_history.tpl';\t\t\n\n\t\t$this->response->setOutput($this->render());\n\t}\n\n\tpublic function transaction() {\n\t\t$this->language->load('sale/customer');\n\n\t\t$this->load->model('sale/customer');\n\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->user->hasPermission('modify', 'sale/customer')) { \n\t\t\t$this->model_sale_customer->addTransaction($this->request->get['customer_id'], $this->request->post['description'], $this->request->post['amount']);\n\n\t\t\t$this->data['success'] = $this->language->get('text_success');\n\t\t} else {\n\t\t\t$this->data['success'] = '';\n\t\t}\n\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && !$this->user->hasPermission('modify', 'sale/customer')) {\n\t\t\t$this->data['error_warning'] = $this->language->get('error_permission');\n\t\t} else {\n\t\t\t$this->data['error_warning'] = '';\n\t\t}\t\t\n\n\t\t$this->data['text_no_results'] = $this->language->get('text_no_results');\n\t\t$this->data['text_balance'] = $this->language->get('text_balance');\n\n\t\t$this->data['column_date_added'] = $this->language->get('column_date_added');\n\t\t$this->data['column_description'] = $this->language->get('column_description');\n\t\t$this->data['column_amount'] = $this->language->get('column_amount');\n\n\t\tif (isset($this->request->get['page'])) {\n\t\t\t$page = $this->request->get['page'];\n\t\t} else {\n\t\t\t$page = 1;\n\t\t} \n\n\t\t$this->data['transactions'] = array();\n\n\t\t$results = $this->model_sale_customer->getTransactions($this->request->get['customer_id'], ($page - 1) * 10, 10);\n\n\t\tforeach ($results as $result) {\n\t\t\t$this->data['transactions'][] = array(\n\t\t\t\t'amount' => $this->currency->format($result['amount'], $this->config->get('config_currency')),\n\t\t\t\t'description' => $result['description'],\n\t\t\t\t'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))\n\t\t\t);\n\t\t}\n\n\t\t$this->data['balance'] = $this->currency->format($this->model_sale_customer->getTransactionTotal($this->request->get['customer_id']), $this->config->get('config_currency'));\n\n\t\t$transaction_total = $this->model_sale_customer->getTotalTransactions($this->request->get['customer_id']);\n\n\t\t$pagination = new Pagination();\n\t\t$pagination->total = $transaction_total;\n\t\t$pagination->page = $page;\n\t\t$pagination->limit = 10; \n\t\t$pagination->text = $this->language->get('text_pagination');\n\t\t$pagination->url = $this->url->link('sale/customer/transaction', 'token=' . $this->session->data['token'] . '&customer_id=' . $this->request->get['customer_id'] . '&page={page}', 'SSL');\n\n\t\t$this->data['pagination'] = $pagination->render();\n\n\t\t$this->template = 'sale/customer_transaction.tpl';\t\t\n\n\t\t$this->response->setOutput($this->render());\n\t}\n\n\tpublic function reward() {\n\t\t$this->language->load('sale/customer');\n\n\t\t$this->load->model('sale/customer');\n\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->user->hasPermission('modify', 'sale/customer')) { \n\t\t\t$this->model_sale_customer->addReward($this->request->get['customer_id'], $this->request->post['description'], $this->request->post['points']);\n\n\t\t\t$this->data['success'] = $this->language->get('text_success');\n\t\t} else {\n\t\t\t$this->data['success'] = '';\n\t\t}\n\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && !$this->user->hasPermission('modify', 'sale/customer')) {\n\t\t\t$this->data['error_warning'] = $this->language->get('error_permission');\n\t\t} else {\n\t\t\t$this->data['error_warning'] = '';\n\t\t}\t\n\n\t\t$this->data['text_no_results'] = $this->language->get('text_no_results');\n\t\t$this->data['text_balance'] = $this->language->get('text_balance');\n\n\t\t$this->data['column_date_added'] = $this->language->get('column_date_added');\n\t\t$this->data['column_description'] = $this->language->get('column_description');\n\t\t$this->data['column_points'] = $this->language->get('column_points');\n\n\t\tif (isset($this->request->get['page'])) {\n\t\t\t$page = $this->request->get['page'];\n\t\t} else {\n\t\t\t$page = 1;\n\t\t} \n\n\t\t$this->data['rewards'] = array();\n\n\t\t$results = $this->model_sale_customer->getRewards($this->request->get['customer_id'], ($page - 1) * 10, 10);\n\n\t\tforeach ($results as $result) {\n\t\t\t$this->data['rewards'][] = array(\n\t\t\t\t'points' => $result['points'],\n\t\t\t\t'description' => $result['description'],\n\t\t\t\t'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))\n\t\t\t);\n\t\t}\n\n\t\t$this->data['balance'] = $this->model_sale_customer->getRewardTotal($this->request->get['customer_id']);\n\n\t\t$reward_total = $this->model_sale_customer->getTotalRewards($this->request->get['customer_id']);\n\n\t\t$pagination = new Pagination();\n\t\t$pagination->total = $reward_total;\n\t\t$pagination->page = $page;\n\t\t$pagination->limit = 10; \n\t\t$pagination->text = $this->language->get('text_pagination');\n\t\t$pagination->url = $this->url->link('sale/customer/reward', 'token=' . $this->session->data['token'] . '&customer_id=' . $this->request->get['customer_id'] . '&page={page}', 'SSL');\n\n\t\t$this->data['pagination'] = $pagination->render();\n\n\t\t$this->template = 'sale/customer_reward.tpl';\t\t\n\n\t\t$this->response->setOutput($this->render());\n\t}\n\n\tpublic function addBanIP() {\n\t\t$this->language->load('sale/customer');\n\n\t\t$json = array();\n\n\t\tif (isset($this->request->post['ip'])) { \n\t\t\tif (!$this->user->hasPermission('modify', 'sale/customer')) {\n\t\t\t\t$json['error'] = $this->language->get('error_permission');\n\t\t\t} else {\n\t\t\t\t$this->load->model('sale/customer');\n\n\t\t\t\t$this->model_sale_customer->addBanIP($this->request->post['ip']);\n\n\t\t\t\t$json['success'] = $this->language->get('text_success');\n\t\t\t}\n\t\t}\n\n\t\t$this->response->setOutput(json_encode($json));\n\t}\n\n\tpublic function removeBanIP() {\n\t\t$this->language->load('sale/customer');\n\n\t\t$json = array();\n\n\t\tif (isset($this->request->post['ip'])) { \n\t\t\tif (!$this->user->hasPermission('modify', 'sale/customer')) {\n\t\t\t\t$json['error'] = $this->language->get('error_permission');\n\t\t\t} else {\n\t\t\t\t$this->load->model('sale/customer');\n\n\t\t\t\t$this->model_sale_customer->removeBanIP($this->request->post['ip']);\n\n\t\t\t\t$json['success'] = $this->language->get('text_success');\n\t\t\t}\n\t\t}\n\n\t\t$this->response->setOutput(json_encode($json));\n\t}\n\n\tpublic function autocomplete() {\n\t\t$json = array();\n\n\t\tif (isset($this->request->get['filter_name'])) {\n\t\t\t$this->load->model('sale/customer');\n\n\t\t\t$data = array(\n\t\t\t\t'filter_name' => $this->request->get['filter_name'],\n\t\t\t\t'start' => 0,\n\t\t\t\t'limit' => 20\n\t\t\t);\n\n\t\t\t$results = $this->model_sale_customer->getCustomers($data);\n\n\t\t\tforeach ($results as $result) {\n\t\t\t\t$json[] = array(\n\t\t\t\t\t'customer_id' => $result['customer_id'], \n\t\t\t\t\t'customer_group_id' => $result['customer_group_id'],\n\t\t\t\t\t'name' => strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')),\n\t\t\t\t\t'customer_group' => $result['customer_group'],\n\t\t\t\t\t'firstname' => $result['firstname'],\n\t\t\t\t\t'lastname' => $result['lastname'],\n\t\t\t\t\t'email' => $result['email'],\n\t\t\t\t\t'telephone' => $result['telephone'],\n\t\t\t\t\t'fax' => $result['fax'],\n\t\t\t\t\t'address' => $this->model_sale_customer->getAddresses($result['customer_id'])\n\t\t\t\t);\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t$sort_order = array();\n\n\t\tforeach ($json as $key => $value) {\n\t\t\t$sort_order[$key] = $value['name'];\n\t\t}\n\n\t\tarray_multisort($sort_order, SORT_ASC, $json);\n\n\t\t$this->response->setOutput(json_encode($json));\n\t}\t\t\n\n\tpublic function country() {\n\t\t$json = array();\n\n\t\t$this->load->model('localisation/country');\n\n\t\t$country_info = $this->model_localisation_country->getCountry($this->request->get['country_id']);\n\n\t\tif ($country_info) {\n\t\t\t$this->load->model('localisation/zone');\n\n\t\t\t$json = array(\n\t\t\t\t'country_id' => $country_info['country_id'],\n\t\t\t\t'name' => $country_info['name'],\n\t\t\t\t'iso_code_2' => $country_info['iso_code_2'],\n\t\t\t\t'iso_code_3' => $country_info['iso_code_3'],\n\t\t\t\t'address_format' => $country_info['address_format'],\n\t\t\t\t'postcode_required' => $country_info['postcode_required'],\n\t\t\t\t'zone' => $this->model_localisation_zone->getZonesByCountryId($this->request->get['country_id']),\n\t\t\t\t'status' => $country_info['status']\t\t\n\t\t\t);\n\t\t}\n\n\t\t$this->response->setOutput(json_encode($json));\n\t}\n\n\tpublic function address() {\n\t\t$json = array();\n\n\t\tif (!empty($this->request->get['address_id'])) {\n\t\t\t$this->load->model('sale/customer');\n\n\t\t\t$json = $this->model_sale_customer->getAddress($this->request->get['address_id']);\n\t\t}\n\n\t\t$this->response->setOutput(json_encode($json));\t\t\n\t}\n}\n?>", "meta": {"content_hash": "c0d1a2940ce4b625a78a2f43335fdb99", "timestamp": "", "source": "github", "line_count": 1418, "max_line_length": 188, "avg_line_length": 35.38787023977433, "alnum_prop": 0.5918294141092069, "repo_name": "chasemg/babybling", "id": "8b297703188ea129b7c3ba7a8a09364175f45c20", "size": "50180", "binary": false, "copies": "12", "ref": "refs/heads/master", "path": "admin/controller/sale/customer.php", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "1197722"}, {"name": "JavaScript", "bytes": "1419011"}, {"name": "PHP", "bytes": "6105609"}]}} +{"text": "A Gem to fetch details of Indian city, district, state based on Indian postal codes from yaml data.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'indian_postal_codes'\n```\n\nAnd then execute:\n\n $ bundle\n\nOr install it yourself as:\n\n $ gem install indian_postal_codes\n\n## Usage\n\n```ruby\nIndianPostalCodes.details('562110')\n\n# => {:city=>\"Devanhalli\", :district=>\"Channapatna\", :state=>\"Karnataka\"}\n```\n\n<!-- ## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). -->\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/DevilalDheer/indian_postal_codes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n", "meta": {"content_hash": "34f88e3f254eb147d574d6202cac7c28", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 328, "avg_line_length": 34.829268292682926, "alnum_prop": 0.7443977591036415, "repo_name": "DevilalDheer/indian_postal_codes", "id": "001227a8ebfc5b706b30d20c7600c566b576cb2f", "size": "1449", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "2743"}, {"name": "Shell", "bytes": "115"}]}} +{"text": "var express = require('express');\nvar router = express.Router();\n\n/* GET home page. */\nrouter.get('/', function(req, res) {\n res.render('index', { title: 'My Blog!' });\n});\n\nrouter.get('/pay', function(req, res) {\n res.render('pay', {title: \"Where's my money, honey?\"});\n});\n\nmodule.exports = router;\n", "meta": {"content_hash": "ecc81ee99bd8b1e965e9ff5259ccf9fe", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 23.307692307692307, "alnum_prop": 0.6105610561056105, "repo_name": "portlandcodeschool-jsi/my-first-blog", "id": "51d3ebc9ecf902a7b90617ba98f80dfabf4de8b7", "size": "303", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "routes/index.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "110"}, {"name": "HTML", "bytes": "2877"}, {"name": "JavaScript", "bytes": "2006"}]}} +{"text": "/***************************************************************************//**\n* \\file cy_sysint.h\n* \\version 1.60\n*\n* \\brief\n* Provides an API declaration of the SysInt driver\n*\n********************************************************************************\n* \\copyright\n* Copyright 2016-2020 Cypress Semiconductor Corporation\n* SPDX-License-Identifier: Apache-2.0\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*******************************************************************************/\n\n/**\n* \\addtogroup group_sysint\n* \\{\n* The SysInt driver provides an API to configure the device peripheral interrupts.\n* It provides a lightweight interface to complement\n* the <a href=\"https://www.keil.com/pack/doc/CMSIS/Core/html/group__NVIC__gr.html\">CMSIS core NVIC API</a>.\n* The provided functions are applicable for all cores in a device and they can\n* be used to configure and connect device peripheral interrupts to one or more\n* cores.\n*\n* The functions and other declarations used in this driver are in cy_sysint.h.\n* You can include cy_pdl.h to get access to all functions\n* and declarations in the PDL.\n*\n* \\section group_sysint_vector_table Vector Table\n* \\subsection group_sysint_CM0_CM4 CM0+/CM4\n* The vector table defines the entry addresses of the processor exceptions and\n* the device specific interrupts. It is located at the start address of the flash\n* and is copied by the startup code to RAM. The symbol code __Vectors is the\n* address of the vector table in the startup code and the register SCB->VTOR\n* holds the start address of the vector table. See \\ref group_system_config_device_vector_table\n* section for the implementation details.\n* The default interrupt handler functions are defined as weak functions to a dummy handler\n* in the startup file. The naming convention is \\<interrupt_name\\>_IRQHandler.\n*\n* Defining these in the user application allows the linker to place them in\n* the vector table in flash/ROM. For example:\n* \\code\n* void ioss_interrupts_gpio_0_IRQHandler(void)\n* {\n* ...\n* }\n* \\endcode\n* And can be used like this:\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_flashVT\n* Using this method avoids the need for a RAM vector table. However in this scenario,\n* interrupt handler re-location at run-time is not possible, unless the vector table is\n* relocated to RAM.\n*\n* \\subsection group_sysint_CM33 CM33\n* CM33 with Security extension supports two vector tables, one for secure world and another\n* for non-secure world. Secure interrupt vector table is placed in the secure ROM/FLASH, where as\n* non-secure interrupt vector table is placed in the non-secure ROM/FLASH. In both scenarios,\n* vector tables are copied by the startup code to secure and non-secure RAM respectively.\n* The symbol code __s_vector_table is the address of the secure vector table and\n* __ns_vector_table is for the non-secure world in the startup code. The register SCB->VTOR\n* holds the start address of the vector table. See \\ref group_system_config_device_vector_table\n* section for the implementation details.\n*\n* CM33 without Security extension will support only non-secure interrupts.\n*\n* The default interrupt handler functions are defined to a dummy handler in the startup file.\n* The naming convention is \\<interrupt_name\\>_IRQHandler.\n*\n*\n* \\section group_sysint_driver_usage Driver Usage\n*\n* \\subsection group_sysint_initialization Initialization\n*\n* Interrupt numbers are defined in a device-specific header file, such as\n* cy8c68237bz_ble.h, and are consistent with interrupt handlers defined in the\n* vector table.\n*\n* To configure an interrupt, call Cy_SysInt_Init(). Populate\n* the configuration structure (cy_stc_sysint_t) and pass it as a parameter\n* along with the ISR address. This initializes the interrupt and\n* instructs the CPU to jump to the specified ISR vector upon a valid trigger.\n* For CM0+ core, the configuration structure (cy_stc_sysint_t)\n* must specify the device interrupt source (cm0pSrc) that feeds into the CM0+ NVIC\n* mux (intrSrc).\n*\n* For CM4/CM33 core, system interrupt source 'n' is connected to the\n* corresponding IRQn. Deep-sleep capable interrupts are allocated to Deep Sleep\n* capable IRQn channels.\n*\n* For CM0+ core, deep Sleep wakeup-capability is determined by the CPUSS_CM0_DPSLP_IRQ_NR\n* parameter, where the first N number of muxes (NvicMux0 ... NvicMuxN-1) have the\n* capability to trigger Deep Sleep interrupts. A Deep Sleep capable interrupt source\n* must be connected to one of these muxes to be able to trigger in Deep Sleep.\n* Refer to the IRQn_Type definition in the device header.\n*\n* 1. For CPUSS_ver1 the CM0+ core supports up to 32 interrupt channels (IRQn 0-31). To allow all device\n* interrupts to be routable to the NVIC of this core, there is a 240:1 multiplexer\n* at each of the 32 NVIC channels.\n*\n* 2. For CPUSS_ver2 the CM0+ core supports up to 8 hardware interrupt channels (IRQn 0-7) and software-only\n* interrupt channels (IRQn 8-15). The device has up to 1023 interrupts that can be connected to any of the\n* hardware interrupt channels. In this structure, multiple interrupt sources can be connected\n* simultaneously to one NVIC channel. The application must then query the interrupt source on the\n* channel and service the active interrupt(s). The priority of these interrupts is determined by the\n* interrupt number as defined in the cy_en_intr_t enum, where the lower number denotes higher priority\n* over the higher number.\n*\n* \\subsection group_sysint_enable Enable\n*\n* After initializing an interrupt, use the CMSIS Core\n* <a href=\"https://www.keil.com/pack/doc/CMSIS/Core/html/group__NVIC__gr.html#ga530ad9fda2ed1c8b70e439ecfe80591f\">NVIC_EnableIRQ()</a> function\n* to enable it. Given an initialization structure named config,\n* the function should be called as follows:\n* \\code\n* NVIC_EnableIRQ(config.intrSrc)\n* \\endcode\n*\n* \\subsection group_sysint_service Writing an interrupt service routine\n*\n* Servicing interrupts in the Peripheral Drivers should follow a prescribed\n* recipe to ensure all interrupts are serviced and duplicate interrupts are not\n* received. Any peripheral-specific register that must be written to clear the\n* source of the interrupt should be written as soon as possible in the interrupt\n* service routine. However, note that due to buffering on the output bus to the\n* peripherals, the write clearing of the interrupt may be delayed. After performing\n* the normal interrupt service that should respond to the interrupting\n* condition, the interrupt register that was initially written to clear the\n* register should be read before returning from the interrupt service routine.\n* This read ensures that the initial write has been flushed out to the hardware.\n* Note, no additional processing should be performed based on the result of this\n* read, as this read is intended only to ensure the write operation is flushed.\n*\n* This final read may indicate a pending interrupt. What this means is that in\n* the interval between when the write actually happened at the peripheral and\n* when the read actually happened at the peripheral, an interrupting condition\n* occurred. This is ok and a return from the interrupt is still the correct\n* action. As soon as conditions warrant, meaning interrupts are enabled and\n* there are no higher priority interrupts pending, the interrupt will be\n* triggered again to service the additional condition.\n*\n* \\section group_sysint_section_configuration_considerations Configuration Considerations\n*\n* Certain CM0+ <a href=\"https://www.keil.com/pack/doc/CMSIS/Core/html/group__NVIC__gr.html#ga7e1129cd8a196f4284d41db3e82ad5c8\">NVIC IRQn</a>\n* channels are reserved for system use:\n* <table class=\"doxtable\">\n* <tr><th>NVIC channel (\\ref IRQn_Type)</th><th>Interrupt source (\\ref cy_en_intr_t)</th><th>Purpose</th></tr>\n* <tr><td>#0 (NvicMux0_IRQn)</td><td>IPC Interrupt #0 (cpuss_interrupts_ipc_0_IRQn)</td><td>System Calls to ROM</td></tr>\n* <tr><td>#1 (NvicMux1_IRQn)</td><td>IPC Interrupt #3 (cpuss_interrupts_ipc_3_IRQn)</td><td>System IPC pipe in the default startup</td></tr>\n* </table>\n*\n* \\note For CPUSS_ver2, each NVIC channel can be shared between multiple interrupt sources.\n* However it is not recommended to share the application NVIC channel with the reserved channels.\n*\n* \\section group_sysint_more_information More Information\n*\n* Refer to the technical reference manual (TRM) and the device datasheet.\n*\n* \\section group_sysint_changelog Changelog\n* <table class=\"doxtable\">\n* <tr><th>Version</th><th>Changes</th><th>Reason for Change</th></tr>\n* <tr>\n* <td>1.60</td>\n* <td>Support for CM33.</td>\n* <td>New devices support.</td>\n* </tr>\n* <tr>\n* <td>1.50</td>\n* <td>Fixed MISRA 2012 violations.</td>\n* <td>MISRA 2012 compliance.</td>\n* </tr>\n* <tr>\n* <td>1.40</td>\n* <td>Updated the CY_SYSINT_IS_PC_0 macro to access the protected register\n* for the secure CYB06xx7 devices via \\ref group_pra driver.\n* </td>\n* <td>Added PSoC 64 devices support.</td>\n* </tr>\n* <tr>\n* <td>1.30.1</td>\n* <td>Minor documentation updates.</td>\n* <td>Documentation enhancement.</td>\n* </tr>\n* <tr>\n* <td>1.30</td>\n* <td>The Cy_SysInt_SetNmiSource is updated with Protection Context check for CM0+.</td>\n* <td>User experience enhancement.</td>\n* </tr>\n* <tr>\n* <td>1.20.1</td>\n* <td>The Vector Table section is extended with a code snippet.</td>\n* <td>Documentation enhancement.</td>\n* </tr>\n* <tr>\n* <td rowspan=\"3\">1.20</td>\n* <td>Flattened the organization of the driver source code into the single source directory and the single include directory.</td>\n* <td>Driver library directory-structure simplification.</td>\n* </tr>\n* <tr>\n* <td>Added CPUSS_ver2 support to the following API functions:\n* - \\ref Cy_SysInt_SetInterruptSource\n* - \\ref Cy_SysInt_SetNmiSource\n* - \\ref Cy_SysInt_GetNmiSource\n*\n* Added new API functions:\n* - \\ref Cy_SysInt_DisconnectInterruptSource\n* - \\ref Cy_SysInt_GetNvicConnection\n* - \\ref Cy_SysInt_GetInterruptActive\n*\n* Deprecated following functions:\n* - Cy_SysInt_SetIntSource\n* - Cy_SysInt_GetIntSource\n* - Cy_SysInt_SetIntSourceNMI\n* - Cy_SysInt_GetIntSourceNMI\n* </td>\n* <td>New devices support.</td>\n* </tr>\n* <tr>\n* <td>Added register access layer. Use register access macros instead\n* of direct register access using dereferenced pointers.</td>\n* <td>Makes register access device-independent, so that the PDL does\n* not need to be recompiled for each supported part number.</td>\n* </tr>\n* <tr>\n* <td>1.10</td>\n* <td>Cy_SysInt_GetState() function is redefined to call NVIC_GetEnableIRQ()</td>\n* <td></td>\n* </tr>\n* <tr>\n* <td>1.0</td>\n* <td>Initial version</td>\n* <td></td>\n* </tr>\n* </table>\n*\n* \\defgroup group_sysint_macros Macros\n* \\defgroup group_sysint_globals Global variables\n* \\defgroup group_sysint_functions Functions\n* \\defgroup group_sysint_data_structures Data Structures\n* \\defgroup group_sysint_enums Enumerated Types\n*/\n\n\n#if !defined (CY_SYSINT_H)\n#define CY_SYSINT_H\n\n#include \"cy_device.h\"\n\n#if defined (CY_IP_M33SYSCPUSS) || defined (CY_IP_M4CPUSS)\n\n#include <stddef.h>\n#include \"cy_syslib.h\"\n#if defined(CY_DEVICE_SECURE) && defined(CY_DEVICE_PSOC6ABLE2)\n #include \"cy_pra.h\"\n#endif /* defined(CY_DEVICE_SECURE) && defined(CY_DEVICE_PSOC6ABLE2) */\n#include \"cy_device_headers.h\"\n\n#if defined(__cplusplus)\nextern \"C\" {\n#endif\n\n/***************************************\n* Global Variable\n***************************************/\n\n/**\n* \\addtogroup group_sysint_globals\n* \\{\n*/\n\n#if defined (CY_IP_M4CPUSS)\nCY_MISRA_DEVIATE_BLOCK_START('MISRA C-2012 Rule 8.6', 2, \\\n'Coverity does not check the .S assembly files, the definition is a part of startup_psoc6_04_cm4.s file.');\nextern const cy_israddress __Vectors[]; /**< Vector table in flash */\nextern cy_israddress __ramVectors[]; /**< Relocated vector table in SRAM */\nCY_MISRA_BLOCK_END('MISRA C-2012 Rule 8.6');\n#endif /* CY_IP_M4CPUSS */\n\n#if defined (CY_SECURE_WORLD) || defined (CY_DOXYGEN)\nextern uint32_t *__s_vector_table_rw; /**< Secure vector table in flash/ROM */\n#endif\n#if !defined (CY_SECURE_WORLD) || defined (CY_DOXYGEN)\nCY_MISRA_DEVIATE_BLOCK_START('MISRA C-2012 Rule 8.6', 2, \\\n'Coverity does not check the .S assembly files, the definition is a part of startup_psoc6_04_cm4.s file.');\nextern uint32_t *__ns_vector_table_rw; /**< Non-secure vector table in flash/ROM */\nCY_MISRA_BLOCK_END('MISRA C-2012 Rule 8.6');\n#endif\n\n/** \\} group_sysint_globals */\n\n\n/***************************************\n* Global Interrupt\n***************************************/\n\n/**\n* \\addtogroup group_sysint_macros\n* \\{\n*/\n\n/** Driver major version */\n#define CY_SYSINT_DRV_VERSION_MAJOR 2\n\n/** Driver minor version */\n#define CY_SYSINT_DRV_VERSION_MINOR 0\n\n/** SysInt driver ID */\n#define CY_SYSINT_ID CY_PDL_DRV_ID (0x15U)\n\n/** \\} group_sysint_macros */\n\n\n/***************************************\n* Enumeration\n***************************************/\n\n/**\n* \\addtogroup group_sysint_enums\n* \\{\n*/\n\n/**\n* SysInt Driver error codes\n*/\ntypedef enum\n{\n CY_SYSINT_SUCCESS = 0x0UL, /**< Returned successful */\n CY_SYSINT_BAD_PARAM = CY_SYSINT_ID | CY_PDL_STATUS_ERROR | 0x1UL, /**< Bad parameter was passed */\n} cy_en_sysint_status_t;\n\n/** NMI connection input */\ntypedef enum\n{\n CY_SYSINT_NMI1 = 1UL, /**< NMI source input 1 */\n CY_SYSINT_NMI2 = 2UL, /**< NMI source input 2 */\n CY_SYSINT_NMI3 = 3UL, /**< NMI source input 3 */\n CY_SYSINT_NMI4 = 4UL, /**< NMI source input 4 */\n} cy_en_sysint_nmi_t;\n\n/** \\} group_sysint_enums */\n\n\n/***************************************\n* Configuration Structure\n***************************************/\n\n/**\n* \\addtogroup group_sysint_data_structures\n* \\{\n*/\n\n/**\n* Initialization configuration structure for a single interrupt channel\n*/\ntypedef struct {\n IRQn_Type intrSrc; /**< Interrupt source */\n#if (CY_CPU_CORTEX_M0P)\n cy_en_intr_t cm0pSrc; /**< Maps cm0pSrc device interrupt to intrSrc */\n#endif /* CY_CPU_CORTEX_M0P */\n uint32_t intrPriority; /**< Interrupt priority number (Refer to __NVIC_PRIO_BITS) */\n} cy_stc_sysint_t;\n\n/** \\} group_sysint_data_structures */\n\n\n/***************************************\n* Constants\n***************************************/\n\n/** \\cond INTERNAL */\n\n #define CY_INT_IRQ_BASE (16U) /**< Start location of interrupts in the vector table */\n #define CY_SYSINT_STATE_MASK (1UL) /**< Mask for interrupt state */\n #define CY_SYSINT_STIR_MASK (0xFFUL) /**< Mask for software trigger interrupt register */\n #define CY_SYSINT_DISABLE (0UL) /**< Disable interrupt */\n #define CY_SYSINT_ENABLE (1UL) /**< Enable interrupt */\n #define CY_SYSINT_INT_STATUS_MSK (0x7UL)\n\n#if defined (CY_IP_M4CPUSS)\n /*(CY_IP_M4CPUSS_VERSION == 1u) */\n #define CY_SYSINT_CM0P_MUX_MASK (0xFFUL) /**< CM0+ NVIC multiplexer mask */\n #define CY_SYSINT_CM0P_MUX_SHIFT (2U) /**< CM0+ NVIC multiplexer shift */\n #define CY_SYSINT_CM0P_MUX_SCALE (3U) /**< CM0+ NVIC multiplexer scaling value */\n #define CY_SYSINT_CM0P_MUX0 (0U) /**< CM0+ NVIC multiplexer register 0 */\n #define CY_SYSINT_CM0P_MUX1 (1U) /**< CM0+ NVIC multiplexer register 1 */\n #define CY_SYSINT_CM0P_MUX2 (2U) /**< CM0+ NVIC multiplexer register 2 */\n #define CY_SYSINT_CM0P_MUX3 (3U) /**< CM0+ NVIC multiplexer register 3 */\n #define CY_SYSINT_CM0P_MUX4 (4U) /**< CM0+ NVIC multiplexer register 4 */\n #define CY_SYSINT_CM0P_MUX5 (5U) /**< CM0+ NVIC multiplexer register 5 */\n #define CY_SYSINT_CM0P_MUX6 (6U) /**< CM0+ NVIC multiplexer register 6 */\n #define CY_SYSINT_CM0P_MUX7 (7U) /**< CM0+ NVIC multiplexer register 7 */\n #define CY_SYSINT_MUX_REG_MSK (0x7UL)\n#endif /* CY_IP_M4CPUSS */\n\n /* Parameter validation macros */\n #define CY_SYSINT_IS_PRIORITY_VALID(intrPriority) ((uint32_t)(1UL << __NVIC_PRIO_BITS) > (intrPriority))\n #define CY_SYSINT_IS_VECTOR_VALID(userIsr) (NULL != (userIsr))\n #define CY_SYSINT_IS_NMI_NUM_VALID(nmiNum) (((nmiNum) == CY_SYSINT_NMI1) || \\\n ((nmiNum) == CY_SYSINT_NMI2) || \\\n ((nmiNum) == CY_SYSINT_NMI3) || \\\n ((nmiNum) == CY_SYSINT_NMI4))\n#if defined (CY_IP_M4CPUSS)\n #if CY_CPU_CORTEX_M4 && defined(CY_DEVICE_SECURE) && defined(CY_DEVICE_PSOC6ABLE2)\n #define CY_SYSINT_IS_PC_0 (0UL == _FLD2VAL(PROT_MPU_MS_CTL_PC, \\\n CY_PRA_REG32_GET(CY_PRA_INDX_PROT_MPU_MS_CTL)))\n #else\n #define CY_SYSINT_IS_PC_0 (0UL == _FLD2VAL(PROT_MPU_MS_CTL_PC, PROT_MPU_MS_CTL(0U)))\n #endif\n#endif /* CY_IP_M4CPUSS */\n/** \\endcond */\n\n\n/***************************************\n* Function Prototypes\n***************************************/\n\n/**\n* \\addtogroup group_sysint_functions\n* \\{\n*/\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_Init\n****************************************************************************//**\n*\n* \\brief Initializes the referenced interrupt by setting the priority and the\n* interrupt vector.\n* In case of CM33 with Security Extension eanbled, if this function is called\n* from secure world then, the parameters are used to configure secure interrupt.\n* If it is called form non-secure world then the parameters are used to configure\n* non-secure interrupt. In case of CM33 without Security Extension, this function\n* alwasys configures the non-secure interrupt.\n*\n* Use the CMSIS core function NVIC_EnableIRQ(config.intrSrc) to enable the interrupt.\n*\n* \\param config\n* Interrupt configuration structure\n*\n* \\param userIsr\n* Address of the ISR\n*\n* \\return\n* Initialization status\n*\n* \\note CM0+/CM4 <br/>\n* The interrupt vector will be relocated only if the vector table was\n* moved to __ramVectors in SRAM. Otherwise it is ignored.\n*\n* \\note CM33<br/>\n* The interrupt vector will be relocated only if the vector table was\n* moved to __s_vector_table_rw and __ns_vector_table_rw for secure and\n* non-secure world respectively.\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_Init\n*\n*******************************************************************************/\ncy_en_sysint_status_t Cy_SysInt_Init(const cy_stc_sysint_t* config, cy_israddress userIsr);\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_SetVector\n****************************************************************************//**\n*\n* \\brief Changes the ISR vector for the interrupt.\n*\n* CM0+/CM4:<br/>\n* This function relies on the assumption that the vector table is\n* relocated to __ramVectors[RAM_VECTORS_SIZE] in SRAM. Otherwise it will\n* return the address of the default ISR location in the flash vector table.\n*\n* CM33:<br/>\n* When called from secure world. this function relies on the assumption that the\n* vector table is relocated to __s_vector_table_rw[] in secure SRAM. Otherwise it will\n* return the address of the default ISR location in the secure flash/ROM vector table.\n*\n* When called from non-secure world. this function relies on the assumption that\n* the vector table is relocated to __ns_vector_table_rw[] in non-secure SRAM.\n* Otherwise it will return the address of the default ISR location in the non-secure\n* flash/ROM vector table.\n*\n* Use the CMSIS core function NVIC_EnableIRQ(config.intrSrc) to enable the interrupt.\n* \\param IRQn\n* Interrupt source\n*\n* \\param userIsr\n* Address of the ISR to set in the interrupt vector table\n*\n* \\return\n * Previous address of the ISR in the interrupt vector table\n*\n* \\note For CM0+, this function sets the interrupt vector for the interrupt\n* channel on the NVIC.\n*\n* \\note In case of CM33 with Security Extension eanbled, if this function is called\n* from secure world then, it sets the interrupt vector for the secure world.\n* If it is called form non-secure world then it sets the interrupt vector for the\n* non-secure world.\n*\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_SetVector\n*\n*******************************************************************************/\ncy_israddress Cy_SysInt_SetVector(IRQn_Type IRQn, cy_israddress userIsr);\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_GetVector\n****************************************************************************//**\n*\n* \\brief Gets the address of the current ISR vector for the interrupt.\n*\n* CM0+/CM4:<br/>\n* This function relies on the assumption that the vector table is\n* relocated to __ramVectors[RAM_VECTORS_SIZE] in SRAM. Otherwise it will\n* return the address of the default ISR location in the flash vector table.\n*\n* CM33:<br/>\n* When called from the secure world, this function relies on the assumption that\n* the vector table is relocated to __ns_vector_table_rw[] in non-secure SRAM.\n* Otherwise it will return the address of the default ISR location in the\n* flash/ROM vector table.\n*\n* \\param IRQn\n* Interrupt source\n*\n* \\return\n* Address of the ISR in the interrupt vector table\n*\n* \\note CM0+:<br/> This function returns the interrupt vector for the interrupt\n* channel on the NVIC.\n*\n* \\note CM33:<br/>In case of CM33 with Security Extension eanbled, if this function is called\n* from secure world then, it returns the interrupt vector for the secure world.\n* If it is called form non-secure world then it returns the interrupt vector\n* for the non-secure world.\n*\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_SetVector\n*\n*******************************************************************************/\ncy_israddress Cy_SysInt_GetVector(IRQn_Type IRQn);\n\n\n#if (CY_CPU_CORTEX_M0P) || defined (CY_DOXYGEN)\n/*******************************************************************************\n* Function Name: Cy_SysInt_SetInterruptSource\n****************************************************************************//**\n*\n* \\brief Configures the interrupt selection for the specified NVIC channel.\n*\n* To disconnect the interrupt source from the NVIC channel\n* use the \\ref Cy_SysInt_DisconnectInterruptSource.\n*\n* \\param IRQn\n* NVIC channel number connected to the CPU core.\n*\n* \\param devIntrSrc\n* Device interrupt to be routed to the NVIC channel.\n*\n* \\note This function is available for CM0+ core only.\n*\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_SetInterruptSource\n*\n*******************************************************************************/\nvoid Cy_SysInt_SetInterruptSource(IRQn_Type IRQn, cy_en_intr_t devIntrSrc);\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_GetInterruptSource\n****************************************************************************//**\n*\n* \\brief Gets the interrupt source of the NVIC channel.\n*\n* \\param IRQn\n* NVIC channel number connected to the CPU core\n*\n* \\return\n* Device interrupt connected to the NVIC channel. A returned value of\n* \"disconnected_IRQn\" indicates that the interrupt source is disconnected.\n*\n* \\note This function is available for CM0+ core only.\n*\n* \\note This function supports only devices using CPUSS_ver1. For all\n* other devices, use the Cy_SysInt_GetNvicConnection() function.\n*\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_SetInterruptSource\n*\n*******************************************************************************/\ncy_en_intr_t Cy_SysInt_GetInterruptSource(IRQn_Type IRQn);\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_GetNvicConnection\n****************************************************************************//**\n*\n* \\brief Gets the NVIC channel to which the interrupt source is connected.\n*\n* \\param devIntrSrc\n* Device interrupt that is potentially connected to the NVIC channel.\n*\n* \\return\n* NVIC channel number connected to the CPU core. A returned value of\n* \"unconnected_IRQn\" indicates that the interrupt source is disabled.\n*\n* \\note This function is available for CM0+ core only.\n*\n* \\note This function supports only devices using CPUSS_ver2 or higher.\n*\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_SetInterruptSource\n*\n*******************************************************************************/\nIRQn_Type Cy_SysInt_GetNvicConnection(cy_en_intr_t devIntrSrc);\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_GetInterruptActive\n****************************************************************************//**\n*\n* \\brief Gets the highest priority active interrupt for the selected NVIC channel.\n*\n* The priority of the interrupt in a given channel is determined by the index\n* value of the interrupt in the cy_en_intr_t enum. The lower the index, the\n* higher the priority. E.g. Consider a case where an interrupt source with value\n* 29 and an interrupt source with value 46 both source the same NVIC channel. If\n* both are active (triggered) at the same time, calling Cy_SysInt_GetInterruptActive()\n* will return 29 as the active interrupt.\n*\n* \\param IRQn\n* NVIC channel number connected to the CPU core\n*\n* \\return\n* Device interrupt connected to the NVIC channel. A returned value of\n* \"disconnected_IRQn\" indicates that there are no active (pending) interrupts\n* on this NVIC channel.\n*\n* \\note This function is available for CM0+ core only.\n*\n* \\note This function supports only devices using CPUSS_ver2 or higher.\n*\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_GetInterruptActive\n*\n*******************************************************************************/\ncy_en_intr_t Cy_SysInt_GetInterruptActive(IRQn_Type IRQn);\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_DisconnectInterruptSource\n****************************************************************************//**\n*\n* \\brief Disconnect the interrupt source from the specified NVIC channel.\n*\n* \\param IRQn\n* NVIC channel number connected to the CPU core.\n* This parameter is ignored for devices using CPUSS_ver2.\n*\n* \\param devIntrSrc\n* Device interrupt routed to the NVIC channel.\n* This parameter is ignored for devices using CPUSS_ver1.\n*\n* \\note This function is available for CM0+ core only.\n*\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_DisconnectInterruptSource\n*\n*******************************************************************************/\nvoid Cy_SysInt_DisconnectInterruptSource(IRQn_Type IRQn, cy_en_intr_t devIntrSrc);\n#endif\n\n\n/***************************************\n* Functions\n***************************************/\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_SetNmiSource\n****************************************************************************//**\n*\n* \\brief Sets the interrupt source of the CPU core NMI.\n*\n* The interrupt source must be a positive number. Setting the value to\n* \"unconnected_IRQn\" or \"disconnected_IRQn\" disconnects the interrupt source\n* from the NMI. Depending on the device, the number of interrupt sources that\n* can provide the NMI trigger signal to the core can vary.\n*\n* \\param nmiNum\n* NMI source number.\n* CPUSS_ver2 allows up to 4 sources to trigger the core NMI.\n* CPUSS_ver1 allows only one source to trigger the core NMI and\n* the specified NMI number is ignored.\n*\n* \\param intrSrc\n* Interrupt source. This parameter can either be of type cy_en_intr_t or IRQn_Type\n* for CM0+ and CM4/CM33 respectively.\n*\n* \\note CM0+ may call this function only at PC=0, CM4 may set its NMI handler at any PC.\n* \\note The CM0+ NMI is used for performing system calls that execute out of ROM.\n*\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_SetNmiSource\n*\n*******************************************************************************/\nCY_MISRA_FP_BLOCK_START('MISRA C-2012 Rule 8.6', 2, 'Only one prototype will be pciked for compilation');\nCY_MISRA_FP_BLOCK_START('MISRA C-2012 Rule 8.5', 2, 'Only one prototype will be pciked for compilation');\nCY_MISRA_FP_BLOCK_START('MISRA C-2012 Rule 8.3', 2, 'Only one prototype will be pciked for compilation');\n#if (!CY_CPU_CORTEX_M0P) || defined (CY_DOXYGEN)\nvoid Cy_SysInt_SetNmiSource(cy_en_sysint_nmi_t nmiNum, IRQn_Type intrSrc);\n#else\nvoid Cy_SysInt_SetNmiSource(cy_en_sysint_nmi_t nmiNum, cy_en_intr_t devIntrSrc);\n#endif\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_GetIntSourceNMI\n****************************************************************************//**\n*\n* \\brief Gets the interrupt source of the CPU core NMI for the given NMI source\n* number.\n*\n* \\param nmiNum\n* NMI source number.\n* CPUSS_ver2 allows up to 4 sources to trigger the core NMI (i.e. #1, 2, 3, 4).\n* CPUSS_ver1 allows only 1 source to trigger the core NMI (i.e #1).\n*\n* \\return\n* Interrupt Source. This parameter can either be of type cy_en_intr_t or IRQn_Type\n* for CM0+ and CM4/CM33 respectively.\n*\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_SetNmiSource\n*\n*******************************************************************************/\n#if (!CY_CPU_CORTEX_M0P) || defined (CY_DOXYGEN)\nIRQn_Type Cy_SysInt_GetNmiSource(cy_en_sysint_nmi_t nmiNum);\n#else\ncy_en_intr_t Cy_SysInt_GetNmiSource(cy_en_sysint_nmi_t nmiNum);\n#endif\nCY_MISRA_BLOCK_END('MISRA C-2012 Rule 8.3');\nCY_MISRA_BLOCK_END('MISRA C-2012 Rule 8.5');\nCY_MISRA_BLOCK_END('MISRA C-2012 Rule 8.6');\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_SoftwareTrig\n****************************************************************************//**\n*\n* \\brief Triggers an interrupt using software (Not applicable for CM0+).\n*\n* \\param IRQn\n* Interrupt source\n*\n* \\funcusage\n* \\snippet sysint/snippet/main.c snippet_Cy_SysInt_SoftwareTrig\n*\n* \\note Only privileged software can enable unprivileged access to the\n* Software Trigger Interrupt Register (STIR).\n*\n*******************************************************************************/\nvoid Cy_SysInt_SoftwareTrig(IRQn_Type IRQn);\n\n\n/** \\} group_sysint_functions */\n\n/** \\cond INTERNAL */\n\n/***************************************\n* Deprecated functions\n***************************************/\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_GetState\n****************************************************************************//**\n*\n* This function is deprecated. It invokes the NVIC_GetEnableIRQ() function.\n*\n*******************************************************************************/\n#define Cy_SysInt_GetState NVIC_GetEnableIRQ\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_SetIntSource\n****************************************************************************//**\n*\n* This function is deprecated. It invokes the Cy_SysInt_SetInterruptSource() function.\n*\n*******************************************************************************/\n#define Cy_SysInt_SetIntSource(intrSrc, devIntrSrc) Cy_SysInt_SetInterruptSource(intrSrc, devIntrSrc)\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_GetIntSource\n****************************************************************************//**\n*\n* This function is deprecated. It invokes the Cy_SysInt_GetInterruptSource() function.\n*\n*******************************************************************************/\n#define Cy_SysInt_GetIntSource(intrSrc) Cy_SysInt_GetInterruptSource(intrSrc)\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_SetIntSourceNMI\n****************************************************************************//**\n*\n* This function is deprecated. It invokes the Cy_SysInt_SetNmiSource() function.\n*\n*******************************************************************************/\n#define Cy_SysInt_SetIntSourceNMI(srcParam) Cy_SysInt_SetNmiSource(CY_SYSINT_NMI1, srcParam)\n\n\n/*******************************************************************************\n* Function Name: Cy_SysInt_GetIntSourceNMI\n****************************************************************************//**\n*\n* This function is deprecated. It invokes the Cy_SysInt_GetNmiSource() function.\n*\n*******************************************************************************/\n#define Cy_SysInt_GetIntSourceNMI() Cy_SysInt_GetNmiSource(CY_SYSINT_NMI1)\n\n/** \\endcond */\n\n#if defined(__cplusplus)\n}\n#endif\n\n#endif /* CY_IP_M33SYSCPUSS */\n\n#endif /* CY_SYSINT_H */\n\n/** \\} group_sysint */\n\n/* [] END OF FILE */\n", "meta": {"content_hash": "a70775fbdb072d2cb77a18a4144de1c5", "timestamp": "", "source": "github", "line_count": 843, "max_line_length": 143, "avg_line_length": 40.194543297746144, "alnum_prop": 0.6135344115216621, "repo_name": "mbedmicro/mbed", "id": "53de4ccfb800bbdd8e9a5f1b1eb5d46c31fad336", "size": "33884", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "targets/TARGET_Cypress/TARGET_PSOC6/mtb-pdl-cat1/drivers/include/cy_sysint.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "5511149"}, {"name": "C", "bytes": "152405192"}, {"name": "C++", "bytes": "7777242"}, {"name": "CMake", "bytes": "27635"}, {"name": "HTML", "bytes": "1531100"}, {"name": "Makefile", "bytes": "131050"}, {"name": "Objective-C", "bytes": "169382"}, {"name": "Python", "bytes": "7913"}, {"name": "Shell", "bytes": "24790"}, {"name": "XSLT", "bytes": "11192"}]}} +{"text": "export interface IModel {\n name: string;\n body: IField[];\n description?: string;\n}\n\nexport interface IField {\n field: IInfo;\n input?: IInfo;\n}\n\nexport interface IInfo {\n name: string;\n type: string;\n}\n", "meta": {"content_hash": "73591dc7e8eaf1fa55ce2a1b578bf836", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 25, "avg_line_length": 14.8, "alnum_prop": 0.6261261261261262, "repo_name": "itaied246/daas", "id": "56aba480741755be30883383d8ad7ad263a080c1", "size": "222", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/models/interfaces/index.ts", "mode": "33188", "license": "mit", "language": [{"name": "TypeScript", "bytes": "26378"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"zh\">\n<head>\n<!-- Generated by javadoc (version 1.7.0_40) on Thu Jan 02 16:44:32 CST 2014 -->\n<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">\n<title>\u7c7b org.apache.giraph.io.formats.TextVertexInputFormat.TextVertexReaderFromEachLine\u7684\u4f7f\u7528 (Apache Giraph Core 1.0.0 API)</title>\n<meta name=\"date\" content=\"2014-01-02\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"\u7c7b org.apache.giraph.io.formats.TextVertexInputFormat.TextVertexReaderFromEachLine\u7684\u4f7f\u7528 (Apache Giraph Core 1.0.0 API)\";\n }\n//-->\n</script>\n<noscript>\n<div>\u60a8\u7684\u6d4f\u89c8\u5668\u5df2\u7981\u7528 JavaScript\u3002</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!-- -->\n</a><a href=\"#skip-navbar_top\" title=\"\u8df3\u8fc7\u5bfc\u822a\u94fe\u63a5\"></a><a name=\"navbar_top_firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"\u5bfc\u822a\">\n<li><a href=\"../../../../../../overview-summary.html\">\u6982\u89c8</a></li>\n<li><a href=\"../package-summary.html\">\u7a0b\u5e8f\u5305</a></li>\n<li><a href=\"../../../../../../org/apache/giraph/io/formats/TextVertexInputFormat.TextVertexReaderFromEachLine.html\" title=\"org.apache.giraph.io.formats\u4e2d\u7684\u7c7b\">\u7c7b</a></li>\n<li class=\"navBarCell1Rev\">\u4f7f\u7528</li>\n<li><a href=\"../package-tree.html\">\u6811</a></li>\n<li><a href=\"../../../../../../deprecated-list.html\">\u5df2\u8fc7\u65f6</a></li>\n<li><a href=\"../../../../../../index-all.html\">\u7d22\u5f15</a></li>\n<li><a href=\"../../../../../../help-doc.html\">\u5e2e\u52a9</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>\u4e0a\u4e00\u4e2a</li>\n<li>\u4e0b\u4e00\u4e2a</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../index.html?org/apache/giraph/io/formats/class-use/TextVertexInputFormat.TextVertexReaderFromEachLine.html\" target=\"_top\">\u6846\u67b6</a></li>\n<li><a href=\"TextVertexInputFormat.TextVertexReaderFromEachLine.html\" target=\"_top\">\u65e0\u6846\u67b6</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../../../allclasses-noframe.html\">\u6240\u6709\u7c7b</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h2 title=\"\u7c7b org.apache.giraph.io.formats.TextVertexInputFormat.TextVertexReaderFromEachLine \u7684\u4f7f\u7528\" class=\"title\">\u7c7b org.apache.giraph.io.formats.TextVertexInputFormat.TextVertexReaderFromEachLine<br>\u7684\u4f7f\u7528</h2>\n</div>\n<div class=\"classUseContainer\">\u6ca1\u6709org.apache.giraph.io.formats.TextVertexInputFormat.TextVertexReaderFromEachLine\u7684\u7528\u6cd5</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!-- -->\n</a><a href=\"#skip-navbar_bottom\" title=\"\u8df3\u8fc7\u5bfc\u822a\u94fe\u63a5\"></a><a name=\"navbar_bottom_firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"\u5bfc\u822a\">\n<li><a href=\"../../../../../../overview-summary.html\">\u6982\u89c8</a></li>\n<li><a href=\"../package-summary.html\">\u7a0b\u5e8f\u5305</a></li>\n<li><a href=\"../../../../../../org/apache/giraph/io/formats/TextVertexInputFormat.TextVertexReaderFromEachLine.html\" title=\"org.apache.giraph.io.formats\u4e2d\u7684\u7c7b\">\u7c7b</a></li>\n<li class=\"navBarCell1Rev\">\u4f7f\u7528</li>\n<li><a href=\"../package-tree.html\">\u6811</a></li>\n<li><a href=\"../../../../../../deprecated-list.html\">\u5df2\u8fc7\u65f6</a></li>\n<li><a href=\"../../../../../../index-all.html\">\u7d22\u5f15</a></li>\n<li><a href=\"../../../../../../help-doc.html\">\u5e2e\u52a9</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>\u4e0a\u4e00\u4e2a</li>\n<li>\u4e0b\u4e00\u4e2a</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../index.html?org/apache/giraph/io/formats/class-use/TextVertexInputFormat.TextVertexReaderFromEachLine.html\" target=\"_top\">\u6846\u67b6</a></li>\n<li><a href=\"TextVertexInputFormat.TextVertexReaderFromEachLine.html\" target=\"_top\">\u65e0\u6846\u67b6</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../../../allclasses-noframe.html\">\u6240\u6709\u7c7b</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n<p class=\"legalCopy\"><small>Copyright © 2011-2014 <a href=\"http://www.apache.org\">The Apache Software Foundation</a>. All Rights Reserved.</small></p>\n</body>\n</html>\n", "meta": {"content_hash": "c7509145beda3b20f4d5109476462052", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 205, "avg_line_length": 40.23931623931624, "alnum_prop": 0.633177570093458, "repo_name": "zfighter/giraph-research", "id": "c771f6b7a0f8d36737b2542861615c338d4b1449", "size": "4932", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "giraph-core/target/munged/apidocs/org/apache/giraph/io/formats/class-use/TextVertexInputFormat.TextVertexReaderFromEachLine.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "78939"}, {"name": "Java", "bytes": "7580660"}, {"name": "Shell", "bytes": "35741"}]}} +{"text": "\n\npackage org.apache.commons.chain2.testutils;\n\nimport org.apache.commons.chain2.Context;\nimport org.hamcrest.Description;\nimport org.hamcrest.Factory;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.TypeSafeDiagnosingMatcher;\n\n/**\n * A matcher that checks if a {@link Context} contains a log with the given contents.\n * This matcher assumes that the context has a context value of type {@link StringBuilder}\n * registered for key {@code log}.\n *\n */\npublic class HasLog extends TypeSafeDiagnosingMatcher<Context> {\n\n private String expectedContent;\n\n public HasLog(String expectedContent) {\n this.expectedContent = expectedContent;\n }\n\n @Factory\n public static Matcher<? super Context> hasLog(final String logContent) {\n return new HasLog(logContent);\n }\n\n @Override\n protected boolean matchesSafely(Context item, Description mismatchDescription) {\n StringBuilder log = (StringBuilder) item.get(\"log\");\n if (log == null) {\n mismatchDescription.appendText(\"context has no log \");\n return false;\n }\n String actualContent = log.toString();\n if (!actualContent.equals(expectedContent)) {\n mismatchDescription.appendText(\"log has content \").appendValue(actualContent);\n return false;\n }\n return true;\n }\n\n @Override\n public void describeTo(Description description) {\n description.appendText(\"log has content \").appendValue(expectedContent);\n }\n\n}\n", "meta": {"content_hash": "79bf0ba88ba196bfe71e18750e032a9c", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 90, "avg_line_length": 29.88, "alnum_prop": 0.6921017402945113, "repo_name": "apache/commons-chain", "id": "908034e40bab31ff2c7d9c456cfd74aff5bff1b7", "size": "2295", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test-utils/src/main/java/org/apache/commons/chain2/testutils/HasLog.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "15147"}, {"name": "Java", "bytes": "655989"}, {"name": "Shell", "bytes": "157"}]}} +{"text": "<?php\n\n\n\nuse CodeIgniter\\HTTP\\IncomingRequest;\nuse CodeIgniter\\HTTP\\URI;\nuse CodeIgniter\\Router\\Exceptions\\RouterException;\nuse Config\\App;\nuse Config\\Services;\n\n// CodeIgniter URL Helpers\n\nif (! function_exists('_get_uri')) {\n /**\n * Used by the other URL functions to build a\n * framework-specific URI based on the App config.\n *\n * @internal Outside of the framework this should not be used directly.\n *\n * @param string $relativePath May include queries or fragments\n *\n * @throws InvalidArgumentException For invalid paths or config\n */\n function _get_uri(string $relativePath = '', ?App $config = null): URI\n {\n $config ??= config('App');\n\n if ($config->baseURL === '') {\n throw new InvalidArgumentException('_get_uri() requires a valid baseURL.');\n }\n\n // If a full URI was passed then convert it\n if (is_int(strpos($relativePath, '://'))) {\n $full = new URI($relativePath);\n $relativePath = URI::createURIString(null, null, $full->getPath(), $full->getQuery(), $full->getFragment());\n }\n\n $relativePath = URI::removeDotSegments($relativePath);\n\n // Build the full URL based on $config and $relativePath\n $url = rtrim($config->baseURL, '/ ') . '/';\n\n // Check for an index page\n if ($config->indexPage !== '') {\n $url .= $config->indexPage;\n\n // Check if we need a separator\n if ($relativePath !== '' && $relativePath[0] !== '/' && $relativePath[0] !== '?') {\n $url .= '/';\n }\n }\n\n $url .= $relativePath;\n\n $uri = new URI($url);\n\n // Check if the baseURL scheme needs to be coerced into its secure version\n if ($config->forceGlobalSecureRequests && $uri->getScheme() === 'http') {\n $uri->setScheme('https');\n }\n\n return $uri;\n }\n}\n\nif (! function_exists('site_url')) {\n /**\n * Returns a site URL as defined by the App config.\n *\n * @param mixed $relativePath URI string or array of URI segments\n * @param App|null $config Alternate configuration to use\n */\n function site_url($relativePath = '', ?string $scheme = null, ?App $config = null): string\n {\n // Convert array of segments to a string\n if (is_array($relativePath)) {\n $relativePath = implode('/', $relativePath);\n }\n\n $uri = _get_uri($relativePath, $config);\n\n return URI::createURIString($scheme ?? $uri->getScheme(), $uri->getAuthority(), $uri->getPath(), $uri->getQuery(), $uri->getFragment());\n }\n}\n\nif (! function_exists('base_url')) {\n /**\n * Returns the base URL as defined by the App config.\n * Base URLs are trimmed site URLs without the index page.\n *\n * @param mixed $relativePath URI string or array of URI segments\n * @param string $scheme\n */\n function base_url($relativePath = '', ?string $scheme = null): string\n {\n $config = clone config('App');\n $config->indexPage = '';\n\n return rtrim(site_url($relativePath, $scheme, $config), '/');\n }\n}\n\nif (! function_exists('current_url')) {\n /**\n * Returns the current full URL based on the IncomingRequest.\n * String returns ignore query and fragment parts.\n *\n * @param bool $returnObject True to return an object instead of a string\n * @param IncomingRequest|null $request A request to use when retrieving the path\n *\n * @return string|URI\n */\n function current_url(bool $returnObject = false, ?IncomingRequest $request = null)\n {\n $request ??= Services::request();\n $path = $request->getPath();\n\n // Append queries and fragments\n if ($query = $request->getUri()->getQuery()) {\n $path .= '?' . $query;\n }\n if ($fragment = $request->getUri()->getFragment()) {\n $path .= '#' . $fragment;\n }\n\n $uri = _get_uri($path);\n\n return $returnObject ? $uri : URI::createURIString($uri->getScheme(), $uri->getAuthority(), $uri->getPath());\n }\n}\n\nif (! function_exists('previous_url')) {\n /**\n * Returns the previous URL the current visitor was on. For security reasons\n * we first check in a saved session variable, if it exists, and use that.\n * If that's not available, however, we'll use a sanitized url from $_SERVER['HTTP_REFERER']\n * which can be set by the user so is untrusted and not set by certain browsers/servers.\n *\n * @return mixed|string|URI\n */\n function previous_url(bool $returnObject = false)\n {\n // Grab from the session first, if we have it,\n // since it's more reliable and safer.\n // Otherwise, grab a sanitized version from $_SERVER.\n $referer = $_SESSION['_ci_previous_url'] ?? Services::request()->getServer('HTTP_REFERER', FILTER_SANITIZE_URL);\n\n $referer ??= site_url('/');\n\n return $returnObject ? new URI($referer) : $referer;\n }\n}\n\nif (! function_exists('uri_string')) {\n /**\n * URL String\n *\n * Returns the path part of the current URL\n *\n * @param bool $relative Whether the resulting path should be relative to baseURL\n */\n function uri_string(bool $relative = false): string\n {\n return $relative\n ? ltrim(Services::request()->getPath(), '/')\n : Services::request()->getUri()->getPath();\n }\n}\n\nif (! function_exists('index_page')) {\n /**\n * Index page\n *\n * Returns the \"index_page\" from your config file\n *\n * @param App|null $altConfig Alternate configuration to use\n */\n function index_page(?App $altConfig = null): string\n {\n // use alternate config if provided, else default one\n $config = $altConfig ?? config(App::class);\n\n return $config->indexPage;\n }\n}\n\nif (! function_exists('anchor')) {\n /**\n * Anchor Link\n *\n * Creates an anchor based on the local URL.\n *\n * @param mixed $uri URI string or array of URI segments\n * @param string $title The link title\n * @param mixed $attributes Any attributes\n * @param App|null $altConfig Alternate configuration to use\n */\n function anchor($uri = '', string $title = '', $attributes = '', ?App $altConfig = null): string\n {\n // use alternate config if provided, else default one\n $config = $altConfig ?? config(App::class);\n\n $siteUrl = is_array($uri) ? site_url($uri, null, $config) : (preg_match('#^(\\w+:)?//#i', $uri) ? $uri : site_url($uri, null, $config));\n // eliminate trailing slash\n $siteUrl = rtrim($siteUrl, '/');\n\n if ($title === '') {\n $title = $siteUrl;\n }\n\n if ($attributes !== '') {\n $attributes = stringify_attributes($attributes);\n }\n\n return '<a href=\"' . $siteUrl . '\"' . $attributes . '>' . $title . '</a>';\n }\n}\n\nif (! function_exists('anchor_popup')) {\n /**\n * Anchor Link - Pop-up version\n *\n * Creates an anchor based on the local URL. The link\n * opens a new window based on the attributes specified.\n *\n * @param string $uri the URL\n * @param string $title the link title\n * @param mixed $attributes any attributes\n * @param App|null $altConfig Alternate configuration to use\n */\n function anchor_popup($uri = '', string $title = '', $attributes = false, ?App $altConfig = null): string\n {\n // use alternate config if provided, else default one\n $config = $altConfig ?? config(App::class);\n\n $siteUrl = preg_match('#^(\\w+:)?//#i', $uri) ? $uri : site_url($uri, null, $config);\n $siteUrl = rtrim($siteUrl, '/');\n\n if ($title === '') {\n $title = $siteUrl;\n }\n\n if ($attributes === false) {\n return '<a href=\"' . $siteUrl . '\" onclick=\"window.open(\\'' . $siteUrl . \"', '_blank'); return false;\\\">\" . $title . '</a>';\n }\n\n if (! is_array($attributes)) {\n $attributes = [$attributes];\n\n // Ref: http://www.w3schools.com/jsref/met_win_open.asp\n $windowName = '_blank';\n } elseif (! empty($attributes['window_name'])) {\n $windowName = $attributes['window_name'];\n unset($attributes['window_name']);\n } else {\n $windowName = '_blank';\n }\n\n foreach (['width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'menubar' => 'no', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0'] as $key => $val) {\n $atts[$key] = $attributes[$key] ?? $val;\n unset($attributes[$key]);\n }\n\n $attributes = stringify_attributes($attributes);\n\n return '<a href=\"' . $siteUrl\n . '\" onclick=\"window.open(\\'' . $siteUrl . \"', '\" . $windowName . \"', '\" . stringify_attributes($atts, true) . \"'); return false;\\\"\"\n . $attributes . '>' . $title . '</a>';\n }\n}\n\nif (! function_exists('mailto')) {\n /**\n * Mailto Link\n *\n * @param string $email the email address\n * @param string $title the link title\n * @param mixed $attributes any attributes\n */\n function mailto(string $email, string $title = '', $attributes = ''): string\n {\n if (trim($title) === '') {\n $title = $email;\n }\n\n return '<a href=\"mailto:' . $email . '\"' . stringify_attributes($attributes) . '>' . $title . '</a>';\n }\n}\n\nif (! function_exists('safe_mailto')) {\n /**\n * Encoded Mailto Link\n *\n * Create a spam-protected mailto link written in Javascript\n *\n * @param string $email the email address\n * @param string $title the link title\n * @param mixed $attributes any attributes\n */\n function safe_mailto(string $email, string $title = '', $attributes = ''): string\n {\n if (trim($title) === '') {\n $title = $email;\n }\n\n $x = str_split('<a href=\"mailto:', 1);\n\n for ($i = 0, $l = strlen($email); $i < $l; $i++) {\n $x[] = '|' . ord($email[$i]);\n }\n\n $x[] = '\"';\n\n if ($attributes !== '') {\n if (is_array($attributes)) {\n foreach ($attributes as $key => $val) {\n $x[] = ' ' . $key . '=\"';\n\n for ($i = 0, $l = strlen($val); $i < $l; $i++) {\n $x[] = '|' . ord($val[$i]);\n }\n\n $x[] = '\"';\n }\n } else {\n for ($i = 0, $l = mb_strlen($attributes); $i < $l; $i++) {\n $x[] = mb_substr($attributes, $i, 1);\n }\n }\n }\n\n $x[] = '>';\n\n $temp = [];\n\n for ($i = 0, $l = strlen($title); $i < $l; $i++) {\n $ordinal = ord($title[$i]);\n\n if ($ordinal < 128) {\n $x[] = '|' . $ordinal;\n } else {\n if (empty($temp)) {\n $count = ($ordinal < 224) ? 2 : 3;\n }\n\n $temp[] = $ordinal;\n\n if (count($temp) === $count) {\n $number = ($count === 3) ? (($temp[0] % 16) * 4096) + (($temp[1] % 64) * 64) + ($temp[2] % 64) : (($temp[0] % 32) * 64) + ($temp[1] % 64);\n $x[] = '|' . $number;\n $count = 1;\n $temp = [];\n }\n }\n }\n\n $x[] = '<';\n $x[] = '/';\n $x[] = 'a';\n $x[] = '>';\n\n $x = array_reverse($x);\n\n // improve obfuscation by eliminating newlines & whitespace\n $output = '<script type=\"text/javascript\">'\n . 'var l=new Array();';\n\n foreach ($x as $i => $value) {\n $output .= 'l[' . $i . \"] = '\" . $value . \"';\";\n }\n\n return $output . ('for (var i = l.length-1; i >= 0; i=i-1) {'\n . \"if (l[i].substring(0, 1) === '|') document.write(\\\"&#\\\"+unescape(l[i].substring(1))+\\\";\\\");\"\n . 'else document.write(unescape(l[i]));'\n . '}'\n . '</script>');\n }\n}\n\nif (! function_exists('auto_link')) {\n /**\n * Auto-linker\n *\n * Automatically links URL and Email addresses.\n * Note: There's a bit of extra code here to deal with\n * URLs or emails that end in a period. We'll strip these\n * off and add them after the link.\n *\n * @param string $str the string\n * @param string $type the type: email, url, or both\n * @param bool $popup whether to create pop-up links\n */\n function auto_link(string $str, string $type = 'both', bool $popup = false): string\n {\n // Find and replace any URLs.\n if ($type !== 'email' && preg_match_all('#(\\w*://|www\\.)[^\\s()<>;]+\\w#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {\n // Set our target HTML if using popup links.\n $target = ($popup) ? ' target=\"_blank\"' : '';\n\n // We process the links in reverse order (last -> first) so that\n // the returned string offsets from preg_match_all() are not\n // moved as we add more HTML.\n foreach (array_reverse($matches) as $match) {\n // $match[0] is the matched string/link\n // $match[1] is either a protocol prefix or 'www.'\n //\n // With PREG_OFFSET_CAPTURE, both of the above is an array,\n // where the actual value is held in [0] and its offset at the [1] index.\n $a = '<a href=\"' . (strpos($match[1][0], '/') ? '' : 'http://') . $match[0][0] . '\"' . $target . '>' . $match[0][0] . '</a>';\n $str = substr_replace($str, $a, $match[0][1], strlen($match[0][0]));\n }\n }\n\n // Find and replace any emails.\n if ($type !== 'url' && preg_match_all('#([\\w\\.\\-\\+]+@[a-z0-9\\-]+\\.[a-z0-9\\-\\.]+[^[:punct:]\\s])#i', $str, $matches, PREG_OFFSET_CAPTURE)) {\n foreach (array_reverse($matches[0]) as $match) {\n if (filter_var($match[0], FILTER_VALIDATE_EMAIL) !== false) {\n $str = substr_replace($str, safe_mailto($match[0]), $match[1], strlen($match[0]));\n }\n }\n }\n\n return $str;\n }\n}\n\nif (! function_exists('prep_url')) {\n /**\n * Prep URL - Simply adds the http:// or https:// part if no scheme is included.\n *\n * Formerly used URI, but that does not play nicely with URIs missing\n * the scheme.\n *\n * @param string $str the URL\n * @param bool $secure set true if you want to force https://\n */\n function prep_url(string $str = '', bool $secure = false): string\n {\n if (in_array($str, ['http://', 'https://', '//', ''], true)) {\n return '';\n }\n\n if (parse_url($str, PHP_URL_SCHEME) === null) {\n $str = 'http://' . ltrim($str, '/');\n }\n\n // force replace http:// with https://\n if ($secure) {\n $str = preg_replace('/^(?:http):/i', 'https:', $str);\n }\n\n return $str;\n }\n}\n\nif (! function_exists('url_title')) {\n /**\n * Create URL Title\n *\n * Takes a \"title\" string as input and creates a\n * human-friendly URL string with a \"separator\" string\n * as the word separator.\n *\n * @param string $str Input string\n * @param string $separator Word separator (usually '-' or '_')\n * @param bool $lowercase Whether to transform the output string to lowercase\n */\n function url_title(string $str, string $separator = '-', bool $lowercase = false): string\n {\n $qSeparator = preg_quote($separator, '#');\n\n $trans = [\n '&.+?;' => '',\n '[^\\w\\d\\pL\\pM _-]' => '',\n '\\s+' => $separator,\n '(' . $qSeparator . ')+' => $separator,\n ];\n\n $str = strip_tags($str);\n\n foreach ($trans as $key => $val) {\n $str = preg_replace('#' . $key . '#iu', $val, $str);\n }\n\n if ($lowercase === true) {\n $str = mb_strtolower($str);\n }\n\n return trim(trim($str, $separator));\n }\n}\n\nif (! function_exists('mb_url_title')) {\n /**\n * Create URL Title that takes into account accented characters\n *\n * Takes a \"title\" string as input and creates a\n * human-friendly URL string with a \"separator\" string\n * as the word separator.\n *\n * @param string $str Input string\n * @param string $separator Word separator (usually '-' or '_')\n * @param bool $lowercase Whether to transform the output string to lowercase\n */\n function mb_url_title(string $str, string $separator = '-', bool $lowercase = false): string\n {\n helper('text');\n\n return url_title(convert_accented_characters($str), $separator, $lowercase);\n }\n}\n\nif (! function_exists('url_to')) {\n /**\n * Get the full, absolute URL to a controller method\n * (with additional arguments)\n *\n * @param mixed ...$args\n *\n * @throws RouterException\n */\n function url_to(string $controller, ...$args): string\n {\n if (! $route = route_to($controller, ...$args)) {\n $explode = explode('::', $controller);\n\n if (isset($explode[1])) {\n throw RouterException::forControllerNotFound($explode[0], $explode[1]);\n }\n\n throw RouterException::forInvalidRoute($controller);\n }\n\n return site_url($route);\n }\n}\n\nif (! function_exists('url_is')) {\n /**\n * Determines if current url path contains\n * the given path. It may contain a wildcard (*)\n * which will allow any valid character.\n *\n * Example:\n * if (url_is('admin*)) ...\n */\n function url_is(string $path): bool\n {\n // Setup our regex to allow wildcards\n $path = '/' . trim(str_replace('*', '(\\S)*', $path), '/ ');\n $currentPath = '/' . trim(uri_string(true), '/ ');\n\n return (bool) preg_match(\"|^{$path}$|\", $currentPath, $matches);\n }\n}\n", "meta": {"content_hash": "34f9510dfde0fdab76d88e64647042d1", "timestamp": "", "source": "github", "line_count": 555, "max_line_length": 192, "avg_line_length": 32.81261261261261, "alnum_prop": 0.5078798528361979, "repo_name": "bcit-ci/CodeIgniter4", "id": "98dd596c1a4d172fc47f8f3dc83159e660a60559", "size": "18454", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "system/Helpers/url_helper.php", "mode": "33188", "license": "mit", "language": [{"name": "BlitzBasic", "bytes": "2795"}, {"name": "CSS", "bytes": "143659"}, {"name": "HTML", "bytes": "24162"}, {"name": "Hack", "bytes": "2832"}, {"name": "JavaScript", "bytes": "23661"}, {"name": "Makefile", "bytes": "4622"}, {"name": "PHP", "bytes": "2728879"}, {"name": "Python", "bytes": "11561"}, {"name": "Shell", "bytes": "10172"}]}} +{"text": "import { Component } from \"@angular/core\";\n\n@Component({\n moduleId: module.id,\n templateUrl: \"./nested-routers.component.html\"\n})\nexport class NestedRoutersComponent { }\n", "meta": {"content_hash": "4d7852b12d7079f6c97b69745e661ffd", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 50, "avg_line_length": 25.142857142857142, "alnum_prop": 0.7102272727272727, "repo_name": "NativeScript/nativescript-sdk-examples-ng", "id": "30444ab3b0d2de768379270f2274fa4591df0d3e", "size": "176", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/ng-framework-modules-category/routing/nested-routers/nested-routers.component.ts", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "7924"}, {"name": "HTML", "bytes": "92854"}, {"name": "JavaScript", "bytes": "25328"}, {"name": "Shell", "bytes": "66"}, {"name": "TypeScript", "bytes": "222192"}]}} +{"text": "[](https://badge.fury.io/js/react-state-hoc)\n[](https://travis-ci.org/troch/react-state-hoc)\n\n# React state component (higher-order)\n\n> A React higher-order component for abstracting away state\n\nKeep your components simple, testable, and composable by using higher-order components. This higher-order component will abstract state away from components, so you can keep using functional stateless components.\n\n## Installation\n\n```sh\nnpm install --save react-state-hoc\n# or\nyarn add react-state-hoc\n```\n\n## API\n\n### withState(initialState, mapSetStateToProps?, mergeProps?)(BaseComponent)\n\nWraps your `BaseComponent` with a stateful component, passing the state into the `BaseComponent` as props. By default, state will be spread into the component's props, plus the `setState` function is passed through. If you specify a `mapSetStateToProps` function, `setState` will not be passed through.\n\nTwo optional arguments allow you to a) define state creators, and b) customise which props are passed into the `BaseComponent`.\n\n* `initialState` can be either:\n * An object, to be used as the component's initial state.\n\n ```js\n withState({ visible: true })(BaseComponent)\n ```\n\n * A function, which maps initial props to initial state.\n\n ```js\n withState(props => ({ visible: props.visible }))(BaseComponent)\n ```\n\n* `mapSetStateToProps` can be either:\n * An object, containing state creators. Each state creator is a function which maps input arguments to new state. State creators are a convenient shorthand which automatically binds `setState` into smaller functions. Functions can also be provided as well as objects: they are supported by `setState` (see [https://reactjs.org/docs/react-component.html#setstate](https://reactjs.org/docs/react-component.html#setstate))\n\n ```js\n withState(\n { visible: true },\n { setVisibility: visible => ({ visible }) }\n )(BaseComponent)\n ```\n\n * A function, mapping `initialProps` and `setState` to state creators.\n\n ```js\n withState({ state: null }, initialProps => setState => ({\n setValue: value => setState({\n someState: initialProps.mapValue(value)\n })\n }))(BaseComponent)\n ```\n\n **Default:**\n\n ```js\n () => setState => ({ setState })\n \n ```\n\n* `mergeProps`: A function mapping the current `props`, `state` and `stateCreators` into the `BaseComponent`'s props.\n\n ```js\n withState(\n { visible: true },\n { setVisibility: visible => ({ visible }) },\n (props, state, stateCreators) => ({\n ...state,\n ...stateCreators\n // deliberately not passing props through to BaseComponent\n })\n )(BaseComponent)\n ```\n\n **Default:**\n\n ```js\n (props, state, stateCreators) => ({ ...props, ...state, ...stateCreators })\n ```\n\n\n## Example\n\n```javascript\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport withState from 'react-state-hoc'\n\nfunction StatelessButton({ counter, setCounter }) {\n return (\n <button onClick={() => setCounter(counter + 1)}>\n Clicked {counter} times.\n </button>\n )\n}\n\nconst mapSetStateToProps = () => setState => ({\n setCounter: counter => setState({ counter })\n})\n\nconst StatefulButton1 = withState({ counter: 0 }, mapSetStateToProps)(\n StatelessButton\n)\n\nconst StatefulButton2 = withState({ counter: 10 }, mapSetStateToProps)(\n StatelessButton\n)\n\nReactDOM.render(\n <div>\n <StatefulButton1 />\n <StatefulButton2 />\n </div>,\n document.getElementById('app')\n)\n```\n", "meta": {"content_hash": "ba3d4ac48625d84c3b18110e3b2dcdd3", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 423, "avg_line_length": 31.520661157024794, "alnum_prop": 0.6489250131095963, "repo_name": "troch/react-state-hoc", "id": "a5a3c6869e2745c772a82e8d012a77f0650b2fdc", "size": "3814", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "591"}, {"name": "TypeScript", "bytes": "9364"}]}} +{"text": "package com.github.gwtmaterialdesign.client.application.sidenavmini;\n\n\n\n\nimport com.google.gwt.uibinder.client.UiBinder;\nimport com.google.gwt.user.client.ui.Widget;\nimport com.gwtplatform.mvp.client.ViewImpl;\n\nimport javax.inject.Inject;\n\n\npublic class MiniSideNavView extends ViewImpl implements MiniSideNavPresenter.MyView {\n interface Binder extends UiBinder<Widget, MiniSideNavView> {\n }\n\n @Inject\n MiniSideNavView(Binder uiBinder) {\n initWidget(uiBinder.createAndBindUi(this));\n }\n}\n", "meta": {"content_hash": "1c6a199f86ccd0ffc93bb991ed10be14", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 86, "avg_line_length": 24.333333333333332, "alnum_prop": 0.776908023483366, "repo_name": "GwtMaterialDesign/gwt-material-patterns", "id": "a873733cce5d7c82b5f76767c6903cca9c98519e", "size": "1163", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/github/gwtmaterialdesign/client/application/sidenavmini/MiniSideNavView.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "27"}, {"name": "HTML", "bytes": "1264"}, {"name": "Java", "bytes": "148725"}, {"name": "Shell", "bytes": "1325"}]}} +{"text": "export { default as Title } from './title';\n", "meta": {"content_hash": "44f287de1dad4e8ec30b708e354813ce", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 43, "avg_line_length": 44.0, "alnum_prop": 0.6590909090909091, "repo_name": "bullet-app/bullet-app", "id": "a28ccdbbbaf67d111fd065025e8e91867adc0ba5", "size": "44", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/components/title/index.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "4944"}]}} +{"text": "package com.github.gquintana.beepbeep.script;\n\nimport com.github.gquintana.beepbeep.TestConsumer;\nimport com.github.gquintana.beepbeep.pipeline.ScriptStartEvent;\nimport org.junit.jupiter.api.Test;\n\nimport java.io.IOException;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\npublic class ResourceScriptScannerGlobTest {\n @Test\n public void testFileGlob() throws IOException {\n checkResourceGlobScan(\"*.sql\", 1);\n checkResourceGlobScan(\"**/*.sql\", 11);\n checkResourceGlobScan(\"com/github/gquintana/**/*.sql\", 10);\n checkResourceGlobScan(\"com/github/gquintana/beepbeep/sql/init/*.sql\", 2);\n }\n\n private void checkResourceGlobScan(String fileGlob, int fileNb) throws IOException {\n TestConsumer<ScriptStartEvent> end = new TestConsumer<>();\n ResourceScriptScanner.resourceGlob(getClass().getClassLoader(), fileGlob, end).scan();\n assertThat(end.events).hasSize(fileNb);\n }\n\n}\n", "meta": {"content_hash": "158d2d9e8d1c081c4fde603cea0af98f", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 94, "avg_line_length": 36.46153846153846, "alnum_prop": 0.7331223628691983, "repo_name": "gquintana/beepbeep", "id": "074a9a905f67f6642383a6255dbe0db7b4fb4370", "size": "948", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/com/github/gquintana/beepbeep/script/ResourceScriptScannerGlobTest.java", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "340"}, {"name": "Java", "bytes": "295513"}, {"name": "Shell", "bytes": "421"}]}} +{"text": "using System;\nusing System.IO;\nusing System.Reflection;\nusing System.Threading;\nusing System.Diagnostics;\nusing System.Collections.Generic;\nusing Sce.PlayStation.Core;\nusing Sce.PlayStation.Core.Graphics;\nusing Sce.PlayStation.Core.Imaging;\nusing Sce.PlayStation.Core.Environment;\nusing Sce.PlayStation.Core.Input;\n\nnamespace API\n{\n\tpublic static class Text\n\t{\n\t private static GraphicsContext graphics;\n\t\n\t private static ShaderProgram textureShaderProgram;\n\t private static ShaderProgram colorShaderProgram;\n\n\t private static Matrix4 projectionMatrix;\n\t private static Matrix4 viewMatrix;\n\t\n\t private static VertexBuffer rectVertices;\n\t private static VertexBuffer circleVertices;\n\t\n\t private static Dictionary<string, TextSprite> spriteDict;\n\t private static int spriteNamelessCount;\n\n\t private static Font defaultFont;\n\t private static Font currentFont;\n\t\n\t public static bool Init(GraphicsContext graphicsContext, Stopwatch swInit = null)\n\t {\n\t graphics = graphicsContext;\n\t\n\t textureShaderProgram = createSimpleTextureShader();\n\t colorShaderProgram = createSimpleColorShader();\n\t\n\t projectionMatrix = Matrix4.Ortho(0, Width,\n\t 0, Height,\n\t 0.0f, 32768.0f);\n\t\n\t viewMatrix = Matrix4.LookAt(new Vector3(0, Height, 0),\n\t new Vector3(0, Height, 1),\n\t new Vector3(0, -1, 0));\n\t\n\t rectVertices = new VertexBuffer(4, VertexFormat.Float3);\n\t rectVertices.SetVertices(0, new float[]{0, 0, 0,\n\t 1, 0, 0,\n\t 1, 1, 0,\n\t 0, 1, 0});\n\t\n\t circleVertices = new VertexBuffer(36, VertexFormat.Float3);\n\t float[] circleVertex = new float[3 * 36];\n\t for (int i = 0; i < 36; i++) {\n\t float radian = ((i * 10) / 180.0f * FMath.PI);\n\t circleVertex[3 * i + 0] = FMath.Cos(radian);\n\t circleVertex[3 * i + 1] = FMath.Sin(radian);\n\t circleVertex[3 * i + 2] = 0.0f;\n\t }\n\t circleVertices.SetVertices(0, circleVertex);\n\t\n\t defaultFont = new Font(FontAlias.System, 24, FontStyle.Regular);\n\t SetDefaultFont();\n\t\n\t spriteDict = new Dictionary<string, TextSprite>();\n\t spriteNamelessCount = 0;\n\t\n\t return true;\n\t }\n\t\n\t\n\t /// Terminate\n\t public static void Term()\n\t {\n\t ClearSprite();\n\t\n\t defaultFont.Dispose();\n\t circleVertices.Dispose();\n\t rectVertices.Dispose();\n\t colorShaderProgram.Dispose();\n\t textureShaderProgram.Dispose();\n\t graphics = null;\n\t }\n\t\n\t public static int Width\n\t {\n\t get {return graphics.GetFrameBuffer().Width;}\n\t }\n\t\n\t public static int Height\n\t {\n\t get {return graphics.GetFrameBuffer().Height;}\n\t }\n\t\n\t /// Touch coordinates -> screen coordinates conversion : X\n\t public static int TouchPixelX(TouchData touchData)\n\t {\n\t return (int)((touchData.X + 0.5f) * Width);\n\t }\n\t\n\t /// Touch coordinates -> screen coordinates conversion : Y\n\t public static int TouchPixelY(TouchData touchData)\n\t {\n\t return (int)((touchData.Y + 0.5f) * Height);\n\t }\n\t\n\t public static void AddSprite(TextSprite sprite)\n\t {\n\t AddSprite(\"[nameless]:\" + spriteNamelessCount, sprite);\n\t spriteNamelessCount++;\n\t }\n\t\n\t public static void AddSprite(string key, TextSprite sprite)\n\t {\n\t if (spriteDict.ContainsKey(key) == false) {\n\t spriteDict.Add(key, sprite);\n\t }\n\t }\n\t\n\t /// Register a sprite that draws text\n\t public static void AddSprite(string key, string text, uint argb, Font font, int positionX, int positionY)\n\t {\n\t if (spriteDict.ContainsKey(text) == false) {\n\t AddSprite(key, new TextSprite(text, argb, font, positionX, positionY));\n\t }\n\t }\n\t\n\t /// Register a sprite that draws text\n\t public static void AddSprite(string text, uint argb, int positionX, int positionY)\n\t {\n\t AddSprite(text, text, argb, currentFont, positionX, positionY);\n\t }\n\t\n\t public static void RemoveSprite(string key)\n\t {\n\t if (spriteDict.ContainsKey(key)) {\n\t spriteDict[key].Dispose();\n\t spriteDict.Remove(key);\n\t }\n\t }\n\t\n\t public static void ClearSprite()\n\t {\n\t foreach (string key in spriteDict.Keys) {\n\t spriteDict[key].Dispose();\n\t }\n\t\n\t spriteDict.Clear();\n\t spriteNamelessCount = 0;\n\t }\n\t\n\t // if use Text's method, please call this method.\n\t public static void Update()\n\t {\n\t int keyNo = 0;\n\t\n\t string[] removeKey = new string[spriteDict.Count];\n\t\n\t foreach (var key in spriteDict.Keys) {\n\t if(false == spriteDict[key].CheckLifeTimer())\n\t {\n\t removeKey[keyNo] = key;\n\t keyNo++;\n\t }\n\t }\n\t\n\t for(int i = 0; i < keyNo; i++)\n\t {\n\t if(removeKey[i] != null)\n\t {\n\t RemoveSprite(removeKey[i]);\n\t }\n\t }\n\t }\n\t\n\t public static void DrawSprite(string key)\n\t {\n\t if (spriteDict.ContainsKey(key)) {\n\t DrawSprite(spriteDict[key]);\n\t }\n\t }\n\t\n\t public static void DrawSprite(TextSprite sprite)\n\t {\n\t var modelMatrix = sprite.CreateModelMatrix();\n\t var worldViewProj = projectionMatrix * viewMatrix * modelMatrix;\n\t\n\t textureShaderProgram.SetUniformValue(0, ref worldViewProj);\n\t\n\t graphics.SetShaderProgram(textureShaderProgram);\n\t graphics.SetVertexBuffer(0, sprite.Vertices);\n\t graphics.SetTexture(0, sprite.Texture);\n\t\n\t graphics.Enable(EnableMode.Blend);\n\t graphics.SetBlendFunc(BlendFuncMode.Add, BlendFuncFactor.SrcAlpha, BlendFuncFactor.OneMinusSrcAlpha);\n\t\n\t graphics.DrawArrays(DrawMode.TriangleFan, 0, 4);\n\t\n\t sprite.SetLifeTimer();\n\t }\n\t\n\t public static Font CurrentFont\n\t {\n\t get {return currentFont;}\n\t }\n\t\n\t public static Font SetDefaultFont()\n\t {\n\t return SetFont(defaultFont);\n\t }\n\t\n\t public static Font SetFont(Font font)\n\t {\n\t Font previousFont = currentFont;\n\t currentFont = font;\n\t return previousFont;\n\t }\n\t\n\t public static void DrawText(string text, uint argb, Font font, int positionX, int positionY)\n\t {\n\t AddSprite(text, text, argb, font, positionX, positionY);\n\t DrawSprite(text);\n\t }\n\t\n\t public static void DrawText(string text, uint argb, int positionX, int positionY)\n\t {\n\t AddSprite(text, text, argb, currentFont, positionX, positionY);\n\t DrawSprite(text);\n\t }\n\n\t public static void FillVertices(VertexBuffer vertices, uint argb, float positionX, float positionY, float scaleX, float scaleY)\n\t {\n\t var transMatrix = Matrix4.Translation(new Vector3(positionX, positionY, 0.0f));\n\t var scaleMatrix = Matrix4.Scale(new Vector3(scaleX, scaleY, 1.0f));\n\t var modelMatrix = transMatrix * scaleMatrix;\n\t\n\t var worldViewProj = projectionMatrix * viewMatrix * modelMatrix;\n\t\n\t colorShaderProgram.SetUniformValue(0, ref worldViewProj);\n\t\n\t Vector4 color = new Vector4((float)((argb >> 16) & 0xff) / 0xff,\n\t (float)((argb >> 8) & 0xff) / 0xff,\n\t (float)((argb >> 0) & 0xff) / 0xff,\n\t (float)((argb >> 24) & 0xff) / 0xff);\n\t colorShaderProgram.SetUniformValue(colorShaderProgram.FindUniform(\"MaterialColor\"), ref color);\n\t\n\t graphics.SetShaderProgram(colorShaderProgram);\n\t graphics.SetVertexBuffer(0, vertices);\n\t\n\t graphics.DrawArrays(DrawMode.TriangleFan, 0, vertices.VertexCount);\n\t }\n\n\t\tpublic static Texture2D createTexture(string text, Font font, uint argb)\n\t\t{\n\t\t\tint width = font.GetTextWidth(text, 0, text.Length);\n\t\t\tint height = font.Metrics.Height;\n\t\n\t\t\tvar image = new Image(ImageMode.Rgba,\n\t\t\tnew ImageSize(width, height),\n\t\t\tnew ImageColor(0, 0, 0, 0));\n\t\n\t\t\timage.DrawText(text,\n\t\t\tnew ImageColor((int)((argb >> 16) & 0xff),\n\t\t\t (int)((argb >> 8) & 0xff),\n\t\t\t (int)((argb >> 0) & 0xff),\n\t\t\t (int)((argb >> 24) & 0xff)),\n\t\t\tfont, new ImagePosition(0, 0));\n\t\n\t\t\tvar texture = new Texture2D(width, height, false, PixelFormat.Rgba);\n\t\t\ttexture.SetPixels(0, image.ToBuffer());\n\t\t\timage.Dispose();\n\n\t\t\treturn texture;\n\t\t}\n\t\n\t private static ShaderProgram createSimpleTextureShader()\n\t {\n\t string ResourceName = \"API.shaders.Texture.cgx\";\n\t \n\t Assembly resourceAssembly = Assembly.GetExecutingAssembly();\n\t if (resourceAssembly.GetManifestResourceInfo(ResourceName) == null)\n\t {\n\t throw new FileNotFoundException(\"File not found.\", ResourceName);\n\t }\n\t\n\t Stream fileStreamVertex = resourceAssembly.GetManifestResourceStream(ResourceName);\n\t Byte[] dataBufferVertex = new Byte[fileStreamVertex.Length];\n\t fileStreamVertex.Read(dataBufferVertex, 0, dataBufferVertex.Length);\n\t \n\t var shaderProgram = new ShaderProgram(dataBufferVertex);\n\t // var shaderProgram = new ShaderProgram(\"/Application/shaders/Texture.cgx\");\n\t\n\t shaderProgram.SetAttributeBinding(0, \"a_Position\");\n\t shaderProgram.SetAttributeBinding(1, \"a_TexCoord\");\n\t\n\t shaderProgram.SetUniformBinding(0, \"WorldViewProj\");\n\t\n\t return shaderProgram;\n\t }\n\t\n\t private static ShaderProgram createSimpleColorShader()\n\t {\n\t string ResourceName = \"API.shaders.Simple.cgx\";\n\t \n\t Assembly resourceAssembly = Assembly.GetExecutingAssembly();\n\t if (resourceAssembly.GetManifestResourceInfo(ResourceName) == null)\n\t {\n\t throw new FileNotFoundException(\"File not found.\", ResourceName);\n\t }\n\t\n\t Stream fileStreamVertex = resourceAssembly.GetManifestResourceStream(ResourceName);\n\t Byte[] dataBufferVertex = new Byte[fileStreamVertex.Length];\n\t fileStreamVertex.Read(dataBufferVertex, 0, dataBufferVertex.Length);\n\t \n\t var shaderProgram = new ShaderProgram(dataBufferVertex);\n\t // var shaderProgram = new ShaderProgram(\"/Application/shaders/Simple.cgx\");\n\t\n\t shaderProgram.SetAttributeBinding(0, \"a_Position\");\n\t //shaderProgram.SetAttributeBinding(1, \"a_Color0\");\n\t\n\t shaderProgram.SetUniformBinding(0, \"WorldViewProj\");\n\t\n\t return shaderProgram;\n\t }\n\t}\n\t\n}", "meta": {"content_hash": "d9b09619ac8c9a163edf7bdd2fdc75d9", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 132, "avg_line_length": 32.43030303030303, "alnum_prop": 0.6007288357316389, "repo_name": "Reisor/SpaceShips", "id": "404862fbd8331d19530153c7eaca74be0bbbeb36", "size": "10703", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "API/Text.cs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C#", "bytes": "164145"}]}} +{"text": "\"\"\"\nLow-level classes for managing data transfer.\n\"\"\"\nfrom __future__ import print_function\n\nfrom collections import namedtuple, Counter\nfrom concurrent.futures import ThreadPoolExecutor\nimport logging\nimport multiprocessing\nimport signal\nimport sys\nimport threading\nimport time\nimport uuid\nimport operator\nimport os\n\nfrom .exceptions import DatalakeIncompleteTransferException\n\nlogger = logging.getLogger(__name__)\n\n\nclass StateManager(object):\n \"\"\"\n Manages state for any hashable object.\n\n When tracking multiple files and their chunks, each file/chunk can be in\n any valid state for that particular type.\n\n At the simplest level, we need to set and retrieve an object's current\n state, while only allowing valid states to be used. In addition, we also\n need to give statistics about a group of objects (are all objects in one\n state? how many objects are in each available state?).\n\n Parameters\n ----------\n states : list of valid states\n Managed objects can only use these defined states.\n\n Examples\n --------\n >>> StateManager('draft', 'review', 'complete') # doctest: +SKIP\n <StateManager: draft=0 review=0 complete=0>\n >>> mgr = StateManager('off', 'on')\n >>> mgr['foo'] = 'on'\n >>> mgr['bar'] = 'off'\n >>> mgr['quux'] = 'on'\n >>> mgr # doctest: +SKIP\n <StateManager: off=1 on=2>\n >>> mgr.contains_all('on')\n False\n >>> mgr['bar'] = 'on'\n >>> mgr.contains_all('on')\n True\n >>> mgr.contains_none('off')\n True\n\n Internal class used by `ADLTransferClient`.\n \"\"\"\n def __init__(self, *states):\n self._states = {state: set() for state in states}\n self._objects = {}\n\n @property\n def states(self):\n return list(self._states)\n\n @property\n def objects(self):\n return list(self._objects)\n\n def __iter__(self):\n return iter(self._objects.items())\n\n def __getitem__(self, obj):\n return self._objects[obj]\n\n def __setitem__(self, obj, state):\n if obj in self._objects:\n self._states[self._objects[obj]].discard(obj)\n self._states[state].add(obj)\n self._objects[obj] = state\n\n def contains_all(self, state):\n \"\"\" Return whether all managed objects are in the given state \"\"\"\n objs = self._states[state]\n return len(objs) > 0 and len(self.objects) - len(objs) == 0\n\n def contains_none(self, *states):\n \"\"\" Return whether no managed objects are in the given states \"\"\"\n return all([len(self._states[state]) == 0 for state in states])\n\n def __str__(self):\n status = \" \".join(\n [\"%s=%d\" % (s, len(self._states[s])) for s in self._states])\n return \"<StateManager: \" + status + \">\"\n\n __repr__ = __str__\n\n\n# Named tuples used to serialize client progress\nFile = namedtuple('File', 'src dst state length chunks exception')\nChunk = namedtuple('Chunk', 'name state offset expected actual exception')\n\n\nclass ADLTransferClient(object):\n \"\"\"\n Client for transferring data from/to Azure DataLake Store\n\n This is intended as the underlying class for `ADLDownloader` and\n `ADLUploader`. If necessary, it can be used directly for additional\n control.\n\n Parameters\n ----------\n adlfs: ADL filesystem instance\n name: str\n Unique ID used for persistence.\n transfer: callable\n Function or callable object invoked when transferring chunks. See\n ``Function Signatures``.\n merge: callable [None]\n Function or callable object invoked when merging chunks. For each file\n containing only one chunk, no merge function will be called, even if\n provided. If None, then merging is skipped. See\n ``Function Signatures``.\n nthreads: int [None]\n Number of threads to use (minimum is 1). If None, uses the number of\n cores.\n chunksize: int [2**28]\n Number of bytes for a chunk. Large files are split into chunks. Files\n smaller than this number will always be transferred in a single thread.\n buffersize: int [2**25]\n Number of bytes for internal buffer. This block cannot be bigger than\n a chunk and cannot be smaller than a block.\n blocksize: int [2**25]\n Number of bytes for a block. Within each chunk, we write a smaller\n block for each API call. This block cannot be bigger than a chunk.\n chunked: bool [True]\n If set, each transferred chunk is stored in a separate file until\n chunks are gathered into a single file. Otherwise, each chunk will be\n written into the same destination file.\n unique_temporary: bool [True]\n If set, transferred chunks are written into a unique temporary\n directory.\n persist_path: str [None]\n Path used for persisting a client's state. If None, then `save()`\n and `load()` will be empty operations.\n delimiter: byte(s) or None\n If set, will transfer blocks using delimiters, as well as split\n files for transferring on that delimiter.\n parent: ADLDownloader, ADLUploader or None\n In typical usage, the transfer client is created in the context of an\n upload or download, which can be persisted between sessions.\n\n Temporary Files\n ---------------\n\n When a merge step is available, the client will write chunks to temporary\n files before merging. The exact temporary file looks like this in\n pseudo-BNF:\n\n >>> # {dirname}/{basename}.segments[.{unique_str}]/{basename}_{offset}\n\n Function Signatures\n -------------------\n\n To perform the actual work needed by the client, the user must pass in two\n callables, `transfer` and `merge`. If merge is not provided, then the\n merge step will be skipped.\n\n The `transfer` callable has the function signature,\n `fn(adlfs, src, dst, offset, size, buffersize, blocksize, shutdown_event)`.\n `adlfs` is the ADL filesystem instance. `src` and `dst` refer to the source\n and destination of the respective file transfer. `offset` is the location\n in `src` to read `size` bytes from. `buffersize` is the number of bytes\n used for internal buffering before transfer. `blocksize` is the number of\n bytes in a chunk to write at one time. The callable should return an\n integer representing the number of bytes written.\n\n The `merge` callable has the function signature,\n `fn(adlfs, outfile, files, shutdown_event)`. `adlfs` is the ADL filesystem\n instance. `outfile` is the result of merging `files`.\n\n For both callables, `shutdown_event` is optional. In particular,\n `shutdown_event` is a `threading.Event` that is passed to the callable.\n The event will be set when a shutdown is requested. It is good practice\n to listen for this.\n\n Internal State\n --------------\n\n self._fstates: StateManager\n This captures the current state of each transferred file.\n self._files: dict\n Using a tuple of the file source/destination as the key, this\n dictionary stores the file metadata and all chunk states. The\n dictionary key is `(src, dst)` and the value is\n `dict(length, cstates, exception)`.\n self._chunks: dict\n Using a tuple of the chunk name/offset as the key, this dictionary\n stores the chunk metadata and has a reference to the chunk's parent\n file. The dictionary key is `(name, offset)` and the value is\n `dict(parent=(src, dst), expected, actual, exception)`.\n self._ffutures: dict\n Using a Future object as the key, this dictionary provides a reverse\n lookup for the file associated with the given future. The returned\n value is the file's primary key, `(src, dst)`.\n self._cfutures: dict\n Using a Future object as the key, this dictionary provides a reverse\n lookup for the chunk associated with the given future. The returned\n value is the chunk's primary key, `(name, offset)`.\n\n See Also\n --------\n azure.datalake.store.multithread.ADLDownloader\n azure.datalake.store.multithread.ADLUploader\n \"\"\"\n\n def __init__(self, adlfs, transfer, merge=None, nthreads=None,\n chunksize=2**28, blocksize=2**25, chunked=True,\n unique_temporary=True, delimiter=None,\n parent=None, verbose=False, buffersize=2**25):\n self._adlfs = adlfs\n self._parent = parent\n self._transfer = transfer\n self._merge = merge\n self._nthreads = max(1, nthreads or multiprocessing.cpu_count())\n self._chunksize = chunksize\n self._buffersize = buffersize\n self._blocksize = blocksize\n self._chunked = chunked\n self._unique_temporary = unique_temporary\n self._unique_str = uuid.uuid4().hex\n self.verbose = verbose\n\n # Internal state tracking files/chunks/futures\n self._files = {}\n self._chunks = {}\n self._ffutures = {}\n self._cfutures = {}\n self._fstates = StateManager(\n 'pending', 'transferring', 'merging', 'finished', 'cancelled',\n 'errored')\n\n def submit(self, src, dst, length):\n \"\"\"\n Split a given file into chunks.\n\n All submitted files/chunks start in the `pending` state until `run()`\n is called.\n \"\"\"\n cstates = StateManager(\n 'pending', 'running', 'finished', 'cancelled', 'errored')\n\n # Create unique temporary directory for each file\n if self._chunked:\n if self._unique_temporary:\n filename = \"{}.segments.{}\".format(dst.name, self._unique_str)\n else:\n filename = \"{}.segments\".format(dst.name)\n tmpdir = dst.parent/filename\n else:\n tmpdir = None\n\n # TODO: might need xrange support for py2\n offsets = range(0, length, self._chunksize)\n\n # in the case of empty files, ensure that the initial offset of 0 is properly added.\n if not offsets:\n if not length:\n offsets = [0]\n else:\n raise DatalakeIncompleteTransferException('Could not compute offsets for source: {}, with destination: {} and expected length: {}.'.format(src, dst, length))\n\n tmpdir_and_offsets = tmpdir and len(offsets) > 1\n for offset in offsets:\n if tmpdir_and_offsets:\n name = tmpdir / \"{}_{}\".format(dst.name, offset)\n else:\n name = dst\n cstates[(name, offset)] = 'pending'\n self._chunks[(name, offset)] = {\n \"parent\": (src, dst),\n \"expected\": min(length - offset, self._chunksize),\n \"actual\": 0,\n \"exception\": None}\n logger.debug(\"Submitted %s, byte offset %d\", name, offset)\n\n self._fstates[(src, dst)] = 'pending'\n self._files[(src, dst)] = {\n \"length\": length,\n \"cstates\": cstates,\n \"exception\": None}\n\n\n def _submit(self, fn, *args, **kwargs):\n kwargs['shutdown_event'] = self._shutdown_event\n future = self._pool.submit(fn, *args, **kwargs)\n future.add_done_callback(self._update)\n return future\n\n def _start(self, src, dst):\n key = (src, dst)\n self._fstates[key] = 'transferring'\n for obj in self._files[key]['cstates'].objects:\n name, offset = obj\n cs = self._files[key]['cstates']\n if obj in cs.objects and cs[obj] == 'finished':\n continue\n cs[obj] = 'running'\n future = self._submit(\n self._transfer, self._adlfs, src, name, offset,\n self._chunks[obj]['expected'], self._buffersize,\n self._blocksize)\n self._cfutures[future] = obj\n\n @property\n def active(self):\n \"\"\" Return whether the transfer is active \"\"\"\n return not self._fstates.contains_none('pending', 'transferring', 'merging')\n\n @property\n def successful(self):\n \"\"\"\n Return whether the transfer completed successfully.\n\n It will raise AssertionError if the transfer is active.\n \"\"\"\n assert not self.active\n return self._fstates.contains_all('finished')\n\n @property\n def progress(self):\n \"\"\" Return a summary of all transferred file/chunks \"\"\"\n files = []\n for key in self._files:\n src, dst = key\n chunks = []\n for obj in self._files[key]['cstates'].objects:\n name, offset = obj\n chunks.append(Chunk(\n name=name,\n offset=offset,\n state=self._files[key]['cstates'][obj],\n expected=self._chunks[obj]['expected'],\n actual=self._chunks[obj]['actual'],\n exception=self._chunks[obj]['exception']))\n files.append(File(\n src=src,\n dst=dst,\n state=self._fstates[key],\n length=self._files[key]['length'],\n chunks=chunks,\n exception=self._files[key]['exception']))\n return files\n \n def _rename_file(self, src, dst, overwrite=False):\n \"\"\" Rename a file from file_name.inprogress to just file_name. Invoked once download completes on a file.\n\n Internal function used by `download`.\n \"\"\"\n try:\n # we do a final check to make sure someone didn't create the destination file while download was occuring\n # if the user did not specify overwrite.\n if os.path.isfile(dst):\n if not overwrite:\n raise FileExistsError(dst)\n os.remove(dst)\n os.rename(src, dst)\n except Exception as e:\n logger.error('Rename failed for source file: %r; %r', src, e)\n raise e\n \n logger.debug('Renamed %r to %r', src, dst)\n\n def _update(self, future):\n if future in self._cfutures:\n obj = self._cfutures[future]\n parent = self._chunks[obj]['parent']\n cstates = self._files[parent]['cstates']\n src, dst = parent\n\n if future.cancelled():\n cstates[obj] = 'cancelled'\n elif future.exception():\n self._chunks[obj]['exception'] = repr(future.exception())\n cstates[obj] = 'errored'\n else:\n nbytes, exception = future.result()\n self._chunks[obj]['actual'] = nbytes\n self._chunks[obj]['exception'] = exception\n if exception:\n cstates[obj] = 'errored'\n elif self._chunks[obj]['expected'] != nbytes:\n name, offset = obj\n cstates[obj] = 'errored'\n exception = DatalakeIncompleteTransferException(\n 'chunk {}, offset {}: expected {} bytes, transferred {} bytes'.format(\n name, offset, self._chunks[obj]['expected'],\n self._chunks[obj]['actual']))\n self._chunks[obj]['exception'] = exception\n logger.error(\"Incomplete transfer: %s -> %s, %s\",\n src, dst, repr(exception))\n else:\n cstates[obj] = 'finished'\n\n if cstates.contains_all('finished'):\n logger.debug(\"Chunks transferred\")\n if self._merge and len(cstates.objects) > 1:\n logger.debug(\"Merging file: %s\", self._fstates[parent])\n self._fstates[parent] = 'merging'\n merge_future = self._submit(\n self._merge, self._adlfs, dst,\n [chunk for chunk, _ in sorted(cstates.objects,\n key=operator.itemgetter(1))], \n overwrite=self._parent._overwrite)\n self._ffutures[merge_future] = parent\n else:\n if not self._chunked and str(dst).endswith('.inprogress'):\n logger.debug(\"Renaming file to remove .inprogress: %s\", self._fstates[parent])\n self._fstates[parent] = 'merging' \n self._rename_file(dst, dst.replace('.inprogress',''), overwrite=self._parent._overwrite)\n dst = dst.replace('.inprogress', '')\n\n self._fstates[parent] = 'finished'\n logger.info(\"Transferred %s -> %s\", src, dst)\n elif cstates.contains_none('running'):\n logger.error(\"Transfer failed: %s -> %s\", src, dst)\n self._fstates[parent] = 'errored'\n elif future in self._ffutures:\n src, dst = self._ffutures[future]\n\n if future.cancelled():\n self._fstates[(src, dst)] = 'cancelled'\n elif future.exception():\n self._files[(src, dst)]['exception'] = repr(future.exception())\n self._fstates[(src, dst)] = 'errored'\n else:\n exception = future.result()\n self._files[(src, dst)]['exception'] = exception\n if exception:\n self._fstates[(src, dst)] = 'errored'\n else:\n self._fstates[(src, dst)] = 'finished'\n logger.info(\"Transferred %s -> %s\", src, dst)\n # TODO: Re-enable progress saving when a less IO intensive solution is available.\n # See issue: https://github.com/Azure/azure-data-lake-store-python/issues/117\n #self.save()\n if self.verbose:\n print('\\b' * 200, self.status, end='')\n sys.stdout.flush()\n\n @property\n def status(self):\n c = sum([Counter([c.state for c in f.chunks]) for f in\n self.progress], Counter())\n return dict(c)\n\n def run(self, nthreads=None, monitor=True, before_start=None):\n self._pool = ThreadPoolExecutor(self._nthreads)\n self._shutdown_event = threading.Event()\n self._nthreads = nthreads or self._nthreads\n self._ffutures = {}\n self._cfutures = {}\n for src, dst in self._files:\n if before_start:\n before_start(self._adlfs, src, dst)\n self._start(src, dst)\n before_start = None\n if monitor:\n self.monitor()\n has_errors = False\n error_list = []\n for f in self.progress:\n for chunk in f.chunks:\n if chunk.state == 'finished':\n continue\n if chunk.exception:\n error_string = '{} -> {}, chunk {} {}: {}, {}'.format(\n f.src, f.dst, chunk.name, chunk.offset,\n chunk.state, repr(chunk.exception))\n logger.error(error_string)\n has_errors = True\n error_list.append(error_string)\n else:\n error_string = '{} -> {}, chunk {} {}: {}'.format(\n f.src, f.dst, chunk.name, chunk.offset,\n chunk.state)\n logger.error(error_string)\n error_list.append(error_string)\n has_errors = True\n if has_errors:\n raise DatalakeIncompleteTransferException('One more more exceptions occured during transfer, resulting in an incomplete transfer. \\n\\n List of exceptions and errors:\\n {}'.format('\\n'.join(error_list)))\n\n def _wait(self, poll=0.1, timeout=0):\n start = time.time()\n while self.active:\n if timeout > 0 and time.time() - start > timeout:\n break\n time.sleep(poll)\n\n def _clear(self):\n self._cfutures = {}\n self._ffutures = {}\n self._pool = None\n\n def shutdown(self):\n \"\"\"\n Shutdown task threads in an orderly fashion.\n\n Within the context of this method, we disable Ctrl+C keystroke events\n until all threads have exited. We re-enable Ctrl+C keystroke events\n before leaving.\n \"\"\"\n handler = signal.signal(signal.SIGINT, signal.SIG_IGN)\n try:\n logger.debug(\"Shutting down worker threads\")\n self._shutdown_event.set()\n self._pool.shutdown(wait=True)\n except Exception as e:\n logger.error(\"Unexpected exception occurred during shutdown: %s\", repr(e))\n else:\n logger.debug(\"Shutdown complete\")\n finally:\n signal.signal(signal.SIGINT, handler)\n\n def monitor(self, poll=0.1, timeout=0):\n \"\"\" Wait for download to happen \"\"\"\n try:\n self._wait(poll, timeout)\n except KeyboardInterrupt:\n logger.warning(\"%s suspended and persisted\", self)\n self.shutdown()\n self._clear()\n \n # TODO: Re-enable progress saving when a less IO intensive solution is available.\n # See issue: https://github.com/Azure/azure-data-lake-store-python/issues/117\n #self.save()\n\n def __getstate__(self):\n dic2 = self.__dict__.copy()\n dic2.pop('_cfutures', None)\n dic2.pop('_ffutures', None)\n dic2.pop('_pool', None)\n dic2.pop('_shutdown_event', None)\n\n dic2['_files'] = dic2.get('_files', {}).copy()\n dic2['_chunks'] = dic2.get('_chunks', {}).copy()\n\n return dic2\n\n def save(self, keep=True):\n if self._parent is not None:\n self._parent.save(keep=keep)\n", "meta": {"content_hash": "4efc3bdce92f539df4f291dc02893cb9", "timestamp": "", "source": "github", "line_count": 555, "max_line_length": 218, "avg_line_length": 39.04504504504504, "alnum_prop": 0.5697738809413936, "repo_name": "begoldsm/azure-data-lake-store-python", "id": "4ee3454232e95401e75a688950be85dcb7b7d62f", "size": "22021", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "azure/datalake/store/transfer.py", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "191637"}]}} +{"text": "\n#pragma once\n\n#include <algorithm>\n#include <cstdint>\n#include <vector>\n\nnamespace mirrage::util {\n\n\ttemplate <class T>\n\tclass sorted_vector {\n\t public:\n\t\tusing const_iterator = typename std::vector<T>::const_iterator;\n\t\tusing const_reverse_iterator = typename std::vector<T>::const_reverse_iterator;\n\n\t\tsorted_vector() = default;\n\t\tsorted_vector(std::vector<T> data) : _data(data) { std::sort(data.begin(), data.end()); }\n\n\t\ttemplate <class U, typename = std::enable_if_t<std::is_same_v<std::remove_reference_t<U>, T>>>\n\t\tauto insert(U&& v) -> T&\n\t\t{\n\t\t\tauto lb = std::lower_bound(_data.begin(), _data.end(), v);\n\t\t\treturn *_data.insert(lb, std::forward<U>(v));\n\t\t}\n\t\ttemplate <class Key,\n\t\t class... Args,\n\t\t typename = std::enable_if_t<!std::is_same_v<std::remove_reference_t<Key>, T>>>\n\t\tauto emplace(const Key& key, Args&&... args) -> T&\n\t\t{\n\t\t\tauto lb = std::lower_bound(_data.begin(), _data.end(), key);\n\t\t\treturn *_data.emplace(lb, std::forward<Args>(args)...);\n\t\t}\n\n\t\tvoid erase(const T& v)\n\t\t{\n\t\t\tauto lb = std::lower_bound(_data.begin(), _data.end(), v);\n\t\t\tif(lb != _data.end() && *lb == v) {\n\t\t\t\t_data.erase(lb);\n\t\t\t}\n\t\t}\n\n\t\ttemplate <class Key>\n\t\tauto find(const Key& key) -> const_iterator\n\t\t{\n\t\t\tauto iter = std::lower_bound(begin(), end(), key);\n\t\t\treturn iter != end() && *iter == key ? iter : end();\n\t\t}\n\n\t\tvoid erase(const_iterator iter) { _data.erase(iter); }\n\t\tvoid erase(const_iterator begin, const_iterator end) { _data.erase(begin, end); }\n\n\t\tauto pop_back() -> T\n\t\t{\n\t\t\tauto v = back();\n\t\t\t_data.pop_back();\n\t\t\treturn v;\n\t\t}\n\n\t\tauto front() { return _data.front(); }\n\t\tauto back() { return _data.back(); }\n\n\t\tauto clear() { return _data.clear(); }\n\n\t\tvoid reserve(std::size_t n) { _data.reserve(n); }\n\n\t\tauto size() const { return _data.size(); }\n\t\tauto empty() const { return _data.empty(); }\n\t\tauto begin() const { return _data.begin(); }\n\t\tauto end() const { return _data.end(); }\n\t\tauto rbegin() const { return _data.rbegin(); }\n\t\tauto rend() const { return _data.rend(); }\n\n\t\tdecltype(auto) operator[](std::int64_t i) { return _data.at(i); }\n\n\t private:\n\t\tstd::vector<T> _data;\n\t};\n\n} // namespace mirrage::util\n", "meta": {"content_hash": "37dac9b36f4e63d3a4f262ba3e988d71", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 96, "avg_line_length": 27.49367088607595, "alnum_prop": 0.5994475138121547, "repo_name": "lowkey42/mirrage", "id": "bb7feafa674339e816025062fb6cba97b7e76365", "size": "2646", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/mirrage/utils/include/mirrage/utils/sorted_vector.hpp", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "168007"}, {"name": "C++", "bytes": "1882762"}, {"name": "CMake", "bytes": "41342"}, {"name": "GLSL", "bytes": "165858"}, {"name": "Shell", "bytes": "706"}]}} +{"text": "echo \"Challenge 1\"\n\nTEST=`diff -wBq ../my_files/nsorts.txt ../my_files/asorts.txt`\nVAL=\"Files my_files/nsorts.txt and my_files/asorts.txt differ\"\n\nif [ $\"VAL\"=$\"TEST\" ] ; then\n\techo ...passed ;\nelse\n\techo ...failed ;\nfi\n\necho \"Challenge 2\"\n\nif [ `cat ../my_files/asia_count` -eq 77301 ] ; then\n\techo ...passed ;\nelse\n\techo ...failed ;\nfi\n\necho \"Challenge 3\"\n\necho \"bear\\ndeer\\nfox\\nrabbit\\nraccoon\" > test\n\nTEST=`diff -wBq test ../my_files/unique_animals.txt`\nVAL=\"Files test and my_files/unique_animals do not differ\"\n\nif [ $\"VAL\"=$\"TEST\" ] ; then\n\techo ...passed ;\nelse\n\techo ...failed ;\nfi\n", "meta": {"content_hash": "ba26f410dcfe4332acd1ff3cca5336d4", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 62, "avg_line_length": 19.129032258064516, "alnum_prop": 0.657672849915683, "repo_name": "dlab-berkeley/cornerstone-2015-unix-FUNdamentals", "id": "71f75bc4ef5af998a0f6739a25d6c542b56877a4", "size": "606", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/1-3_test.sh", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Shell", "bytes": "1649"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing OpenTK;\nusing System.Drawing;\nusing Sharp2D;\nusing Sharp2D.Core;\nusing Sharp2D.Core.Interfaces;\nusing Sharp2D.Game.Worlds;\n\nnamespace Sharp2D.Game.Sprites\n{\n public sealed class TileSprite : Sprite, ICollidable\n {\n public TiledWorld World { get; private set; }\n public int ID { get; private set; }\n public TileSet TileSet { get; private set; }\n public Layer ParentLayer { get; private set; }\n public bool FlippedDiagonally { get; internal set; }\n public bool FlippedHorizontally { get; internal set; }\n public bool FlippedVertically { get; internal set; }\n\n public TileSprite(int ID, TileSet parent, Layer parentLayer, int data_index, TiledWorld world)\n {\n this.World = world;\n this.ID = ID;\n this.TileSet = parent;\n this.ParentLayer = parentLayer;\n\n Width = TileSet.TileWidth;\n Height = TileSet.TileHeight;\n\n X = data_index % parentLayer.Width;\n Y = data_index / parentLayer.Width;\n\n X *= TileSet.TileWidth;\n Y *= TileSet.TileHeight;\n\n Layer = 1f/ParentLayer.LayerNumber;\n\n IsStatic = !(parent.TileProperties.ContainsKey(ID) && parent.TileProperties[ID].ContainsKey(\"static\") && parent.TileProperties[ID][\"static\"].ToLower() == \"true\");\n\n _setTexCoords();\n\n Texture = TileSet.TileTexture;\n\n if (IsCollidable)\n {\n Hitbox = new Hitbox(\"Space\", new List<Vector2>\n {\n new Vector2(0, 0),\n new Vector2(Width, 0),\n new Vector2(Width, Height),\n new Vector2(0, Height)\n });\n Hitbox.AddCollidable(this);\n }\n }\n\n public bool IsCollidable\n {\n get { return TileSet.TileProperties.ContainsKey(ID) && TileSet.TileProperties[ID].ContainsKey(\"collide\"); }\n }\n\n public override bool HasAlpha\n {\n get\n {\n return TileHasAlpha;\n }\n }\n\n public bool HasProperty(string key)\n {\n return TileSet.TileProperties.ContainsKey(ID) && TileSet.TileProperties[ID].ContainsKey(key);\n }\n\n public string GetProperty(string key)\n {\n return !HasProperty(key) ? null : TileSet.TileProperties[ID][key];\n }\n\n\n private void _setTexCoords()\n {\n if (World.texcoords_cache.ContainsKey(ID))\n {\n TexCoords = World.texcoords_cache[ID];\n return;\n }\n\n int tilepos = (ID - TileSet.FirstGID) + 1;\n float x, y, width, height;\n int step = (tilepos - 1) % TileSet.TilesPerRow, row = 0;\n\n for (int i = 0; i != ID; i++)\n {\n if (i % TileSet.TilesPerRow == 0 && i != 0)\n row++;\n }\n\n x = TileSet.TileWidth * step;\n y = TileSet.TileHeight * row;\n y = TileSet.TileTexture.TextureHeight + y;\n width = x + TileSet.TileWidth;\n height = y + TileSet.TileHeight;\n\n TexCoords = new TexCoords(x, y, width, height, TileSet.TileTexture);\n\n World.texcoords_cache.Add(ID, TexCoords);\n\n IsStatic = true;\n }\n\n public bool TileHasAlpha\n {\n get\n {\n if (TileSet.containsAlpha.ContainsKey(ID))\n return TileSet.containsAlpha[ID];\n\n int tilepos = (ID - TileSet.FirstGID) + 1;\n int step = (tilepos - 1) % TileSet.TilesPerRow, row = 0;\n\n for (int i = 0; i != ID; i++)\n {\n if (i % TileSet.TilesPerRow == 0 && i != 0)\n row++;\n }\n\n int x = TileSet.TileWidth * step;\n int y = TileSet.TileHeight * row;\n int width = TileSet.TileWidth;\n int height = TileSet.TileHeight;\n\n\n var testBmp = new Bitmap(width, height);\n using (Graphics g = Graphics.FromImage(testBmp))\n {\n g.DrawImage(Texture.Bitmap, new RectangleF(0, 0, width, height), new RectangleF(x, y, width, height), GraphicsUnit.Pixel);\n }\n\n bool cached_alpha_answer = testBmp.ContainsAlpha();\n TileSet.containsAlpha.Add(ID, cached_alpha_answer);\n\n testBmp.Dispose();\n return cached_alpha_answer;\n }\n }\n\n\n protected override void OnLoad()\n {\n //TODO Do some loading of something\n }\n\n protected override void OnUnload()\n {\n //TODO Do some unloading of something\n }\n\n protected override void OnDispose()\n {\n //TODO Dispose something..\n }\n\n protected override void OnDisplay()\n {\n //TODO Display related stuff (badpokerface)\n }\n\n protected override void BeforeDraw()\n {\n //TODO Do something before it's drawn\n }\n\n public event EventHandler OnCollision;\n public Hitbox Hitbox { get; set; }\n\n public CollisionResult CollidesWith(ICollidable c)\n {\n return new CollisionResult {Intersecting = false, WillIntersect = false, TranslationVector = new Vector2()};\n }\n\n public override string Name\n {\n get { return \"Tile #\" + ID; }\n }\n }\n}\n", "meta": {"content_hash": "8724662b8586f6ef72e82eb74f6e4df5", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 174, "avg_line_length": 29.666666666666668, "alnum_prop": 0.522998595505618, "repo_name": "CatinaCupGames/Sharp2D", "id": "6ff64883efdc8614df465a4187285d3982f76a21", "size": "5698", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Sharp2D/Sharp2D/Game/Sprites/TileSprite.cs", "mode": "33261", "license": "apache-2.0", "language": [{"name": "C#", "bytes": "324190"}, {"name": "GLSL", "bytes": "4939"}]}} +{"text": "<link rel=\"import\" href=\"../bower_components/polymer/polymer.html\">\n<link rel=\"import\" href=\"app-theme.html\">\n<dom-module id=\"total-price\">\n <style include=\"app-theme\">\n :host {\n --paper-menu: {\n padding: 0px;\n }\n }\n\n paper-icon-item {\n --paper-item-icon-width: 36px;\n @apply(--total-price-styles);\n color: var(--alt-text-color);\n }\n\n paper-menu {\n @apply(--total-price-styles);\n }\n\n paper-icon-item.iron-selected {\n @apply(--shadow-elevation-6dp);\n background-color: var(--light-alt-accent-color);\n z-index: 2;\n }\n\n paper-menu paper-submenu paper-menu paper-icon-item {\n padding-left: 25px;\n }\n\n paper-menu paper-submenu paper-menu paper-icon-item.iron-selected {\n @apply(--shadow-elevation-2dp);\n background-color: var(--alt-background-color);\n z-index: 1;\n }\n\n paper-item-body {\n text-align: left;\n }\n\n paper-material {\n padding: 8px 8px;\n margin: auto;\n margin-top: 16px;\n margin-bottom: 16px;\n max-width: 300px;\n box-sizing: border-box;\n display: inline-block;\n width: 90%;\n text-align: center;\n @apply(--total-price-styles);\n }\n\n #tabelize {\n display: table-cell;\n }\n\n #proceedToCartButton {\n margin: 10px auto 10px auto;\n }\n\n iron-icon, #boldColoredMoney {\n color: var(--darker-alt-accent-color);\n }\n\n iron-icon#cart {\n width: 35px;\n height: 35px;\n }\n\n h3 {\n color: inherit;\n }\n </style>\n <template>\n <firebase-document path=\"/categories\" data=\"{{categories}}\"> </firebase-document>\n <firebase-document path=\"/stores/[[storeId]]/stock\" data=\"{{data}}\"> </firebase-document>\n <!--<div id=\"grid\">-->\n <paper-material id=\"tabelize\" elevation=\"1\" animated class$=\"[[passedDownClass]]\">\n <paper-menu><template is=\"dom-repeat\" items=\"[[getObjectValues(categories)]]\">\n <paper-submenu disabled=\"[[emptySubCart(item, data, quantities)]]\">\n <paper-icon-item class=\"menu-trigger\" disabled=\"[[shouldDisable(item, data, quantities)]]\">\n <iron-icon icon=\"my-icons:tag\" item-icon></iron-icon>\n <paper-item-body><div><h3>[[capitalize(item)]]<template is=\"dom-if\" if=\"[[notStore(store)]]\"></template></h3></div></paper-item-body>\n <template is=\"dom-if\" if=\"[[store]]\">\n <div><h3><b>[[getCategoryTotalQuanta(item, data, quantities)]]</b></h3></div>\n </template>\n <template is=\"dom-if\" if=\"[[notStore(store)]]\">\n <div><h3><b>[[getCategoryTotal(item, data, quantities)]]</b></h3></div>\n </template>\n </paper-icon-item>\n <paper-menu class=\"menu-content\" selected=\"0\">\n <template is=\"dom-repeat\" items=\"[[getSubCart(item, data, quantities)]]\">\n <paper-icon-item>\n <iron-icon icon=\"my-icons:shopping-basket\" item-icon></iron-icon>\n <paper-item-body two-line>\n <div>[[capitalize(item.id)]]</div>\n <div secondary>[[item.quanta]] units in Cart</div>\n </paper-item-body>\n <div><h4><b>[[parseMoney(item.price)]]</b></h4></div>\n </paper-icon-item>\n </template>\n </paper-menu>\n </paper-submenu>\n </template></paper-menu>\n <template is=\"dom-if\" if=\"[[store]]\">\n <a href=\"/cart\" tabindex=\"-1\">\n <paper-button id=\"proceedToCartButton\" raised>\n <iron-icon icon=\"my-icons:cart\"></iron-icon>\n Proceed to Cart\n </paper-button>\n </a>\n </template>\n <template is=\"dom-if\" if=\"[[notStoreTracking(store, tracking)]]\">\n <paper-material elevation=\"2\" animated>\n <h2><iron-icon id=\"cart\" icon=\"my-icons:cart\"></iron-icon>Cart Total: <b id=\"boldColoredMoney\">[[cartTotal]]</b></h2>\n </paper-material>\n </template>\n </paper-material>\n <!--<template is=\"dom-if\" if=\"[[checkout]]\">-->\n <!--Implement Credit Card Selector-->\n <!--</template>-->\n <!--</div>-->\n <!--<paper-textarea label=\"Total Price Data\" value=\"[[parseJson(cart, checkout, storeId, userId, quantities, categories, data)]]\"></paper-textarea>-->\n </template>\n <script>\n Polymer({\n is: 'total-price',\n properties: {\n store: {\n type: Boolean,\n value: false\n }, cart: {\n type: Boolean,\n value: false\n }, checkout: {\n type: Boolean,\n value: false\n }, tracking: {\n type: Boolean,\n value: false\n }, cartTotal: {\n type: String,\n notify: true,\n computed: \"getTotal(categories, data, quantities)\"\n }\n },\n notStore: function(s) {\n return !s;\n },\n notStoreTracking: function(s, t) {\n return !s && !t;\n },\n shouldDisable: function (item, data, quantities) {\n return this.getCategoryTotalQuanta(item, data, quantities) == 0;\n },\n getSubCart: function (category, data, quantas) {\n log(\"================================GET SUB CART FUNCTION================================\");\n log(\"getSubCart: category\");\n log(category);\n log(\"getSubCart: quantas\");\n log(quantas);\n log(\"getSubCart: data\");\n log(data);\n log(\"!this.storeId || !category || !quantas || !data || Object.keys(data).length === 0 && data.constructor === Object\");\n log(!this.storeId || !category || !quantas || !data || Object.keys(data).length === 0 && data.constructor === Object);\n var rtn = [];\n if (!this.storeId || !category || !quantas || !data || Object.keys(data).length === 0 && data.constructor === Object) return rtn;\n for (var i in data)\n if (data[i].category === category && isInt(quantas[this.storeId][data[i].id]) && parseInt(quantas[this.storeId][data[i].id]) > 0)\n rtn.push({\"id\": data[i].id, \"quanta\": quantas[this.storeId][data[i].id], \"price\": parseInt(quantas[this.storeId][data[i].id]) * parseFloat(data[i].price)});\n log(\"Sub Cart Return\");\n log(rtn);\n log(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n return rtn;\n },\n emptySubCart: function (category, data, quantas) {\n return parseFloat(this.getCategoryTotal(category, data, quantas).substring(1)) <= 0;\n },\n getTotal: function (categories, data, quantas) {\n return this.getCategoryTotal(\"all\", data, quantas);\n },\n getCategoryTotal: function (category, data, quantas) {\n log(\"=============================GET CATEGORY TOTAL FUNCTION=============================\");\n log(\"getCategoryTotal: category\");\n log(category);\n log(\"getCategoryTotal: quantas\");\n log(quantas);\n log(\"getCategoryTotal: data\");\n log(data);\n log(\"getCategoryTotal: this.storeId\");\n log(this.storeId);\n log(\"!this.storeId || !category || !quantas || !data || Object.keys(data).length === 0 && data.constructor === Object\");\n log(!this.storeId || !category || !quantas || !data || Object.keys(data).length === 0 && data.constructor === Object);\n var total = 0;\n if (!this.storeId || !category || !quantas || !data || Object.keys(data).length === 0 && data.constructor === Object) return parseMoney(total);\n for (var i in data)\n if (isInt(quantas[this.storeId][data[i].id]) && parseInt(quantas[this.storeId][data[i].id]) > 0 && (category === \"all\" || data[i].category == category))\n total += data[i].price * quantas[this.storeId][data[i].id];\n log(\"Category Total\");\n log(total);\n log(\"Parsed Category Total\");\n log(parseMoney(total));\n log(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n return parseMoney(total);\n },\n getCategoryTotalQuanta: function (category, data, quantas) {\n log(\"=========================GET CATEGORY TOTAL QUANTA FUNCTION==========================\");\n log(\"getCategoryTotalQuanta: category\");\n log(category);\n log(\"getCategoryTotalQuanta: quantas\");\n log(quantas);\n log(\"getCategoryTotalQuanta: data\");\n log(data);\n log(\"!this.storeId || !category || !quantas || !data || Object.keys(data).length === 0 && data.constructor === Object\");\n log(!this.storeId || !category || !quantas || !data || Object.keys(data).length === 0 && data.constructor === Object);\n var total = 0;\n if (!this.storeId || !category || !quantas || !data || Object.keys(data).length === 0 && data.constructor === Object) return total;\n for (var i in data)\n if (isInt(quantas[this.storeId][data[i].id]) && parseInt(quantas[this.storeId][data[i].id]) > 0 && (category === \"all\" || data[i].category == category))\n total += 1; //quantas[this.storeId][data[i].id];\n log(\"Category Total Quanta\");\n log(total);\n log(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n return total;\n },\n capitalize: function (str) {\n return capitalize(str);\n },\n getObjectKeys: function (items) {\n return getObjectKeys(items);\n },\n getObjectValues: function (items) {\n return getObjectValues(items);\n },\n isInt: function (value) {\n return isInt(value);\n },\n flattenJson: function (data) {\n return flattenJson(data);\n },\n parseMoney: function (money) {\n return parseMoney(money);\n },\n parseJson: function () {\n var items = [].slice.apply(arguments);\n return items.reduce(function (acc, item) {\n return acc + \"\\nObject\\n\" + JSON.stringify(item, null, 4);\n }, \"\");\n }\n });\n\n function parseJson() {\n var items = [].slice.apply(arguments);\n return items.reduce(function (acc, item) {\n return acc + \"\\nObject\\n\" + JSON.stringify(item, null, 4);\n }, \"\");\n }\n </script>\n</dom-module>", "meta": {"content_hash": "527eab6dbd411e5a5838c6418fa6b845", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 180, "avg_line_length": 45.78076923076923, "alnum_prop": 0.4546752919432076, "repo_name": "Organic-Food-Store/ofs-client", "id": "800a805d012c8299202c5db229dd9fcaca10b7ae", "size": "11903", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/total-price.html", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "150804"}, {"name": "JavaScript", "bytes": "1803"}]}} +{"text": "module SugoiAliasesUpdator\n class AliasesParser\n\n attr_accessor :changed_labels\n\n def initialize(filepath)\n @native_lines = File.readlines(filepath)\n @changed_labels = []\n end\n\n def add(target_email, to)\n check_labels!(to)\n to.each do |x|\n unless label_mails_hash[x].include?(target_email)\n label_mails_hash[x].push(target_email)\n @changed_labels << x\n end\n end\n render!\n end\n\n def rm(target_email, from)\n if ['ALL'] == from\n label_mails_hash.each do |label, emails|\n if emails.include?(target_email)\n label_mails_hash[label].delete(target_email)\n @changed_labels << label\n end\n end\n return render!\n end\n\n check_labels!(from)\n from.each do |label|\n if label_mails_hash[label].include?(target_email)\n label_mails_hash[label].delete(target_email)\n @changed_labels << label\n end\n end\n render!\n end\n\n def list(target_email)\n finded = []\n label_mails_hash.each do |key, value|\n finded.push(key) if value.include?(target_email)\n end\n finded.join(',')\n end\n\n def render!\n new_lines = []\n @native_lines.each do |line|\n line_paser = LineParser.new(line)\n if line_paser.is_aliaes_line && @changed_labels.include?(line_paser.label)\n line = \"#{line_paser.label}:#{line_paser.margin}#{label_mails_hash[line_paser.label].join(\", \")}\\n\"\n end\n new_lines << line\n end\n new_lines.join\n end\n\n private\n\n def label_mails_hash\n @label_mails_hash ||= {}.tap do |h|\n @native_lines.each do |line|\n line_paser = LineParser.new(line)\n if line_paser.is_aliaes_line\n emails_line = line_paser.emails_line\n h[line_paser.label] = line_paser.emails_line.split(/\\,\\s?/)\n end\n end\n end\n end\n\n def check_labels!(inputed_labels)\n unknown_labels = inputed_labels - label_mails_hash.keys\n if unknown_labels.size > 0\n raise(\"unknown labels #{unknown_labels.join(', ')}\")\n end\n end\n end\nend\n", "meta": {"content_hash": "17bfb98a93e2d98e7a20c949f78886f5", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 109, "avg_line_length": 25.761904761904763, "alnum_prop": 0.5702402957486137, "repo_name": "jiikko/sugoi-aliases-updator", "id": "3e2bce697dde6b919803443ccbaf90548e31f8c8", "size": "2164", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/sugoi_aliases_updator/aliases_parser.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "11611"}]}} +{"text": "SYNONYM\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "e002c4f3ca72e218fdb50f24bb14043c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "2b0f3a632a2f0742fb00e7dc18d6d219b18cd5b0", "size": "187", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Coffea/Coffea mauritiana/ Syn. Coffea nossikumbaensis/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "/*!\n * numbro.js language configuration\n * language : German\n * locale: Austria\n * author : Tim McIntosh (StayinFront NZ)\n */\n(function () {\n 'use strict';\n\n var language = {\n langLocaleCode: 'de-AT',\n cultureCode: 'de-AT',\n delimiters: {\n thousands: ' ',\n decimal: ','\n },\n abbreviations: {\n thousand: 'k',\n million: 'm',\n billion: 'b',\n trillion: 't'\n },\n ordinal: function () {\n return '.';\n },\n currency: {\n symbol: '\u20ac',\n code: 'EUR'\n }\n };\n\n // Node\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = language;\n }\n // Browser\n if (typeof window !== 'undefined' && window.numbro && window.numbro.culture) {\n window.numbro.culture(language.cultureCode, language);\n }\n}.call(typeof window === 'undefined' ? this : window));\n", "meta": {"content_hash": "69bc1a66bc125bcc0328fce4231093cb", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 82, "avg_line_length": 23.975, "alnum_prop": 0.4848800834202294, "repo_name": "foretagsplatsen/numbro", "id": "3729988027cf6c901648dbde35d6e33be34c0608", "size": "961", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "languages/de-AT.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "339793"}]}} +{"text": "ACCEPTED\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nLeptogium adpressum Nyl.\n\n### Remarks\nnull", "meta": {"content_hash": "0b3aed3a0e419b63e2997fdf8bc57032", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 11.846153846153847, "alnum_prop": 0.7142857142857143, "repo_name": "mdoering/backbone", "id": "5c90742ece71b053fd0fc6a4d545d2caec8eb23b", "size": "202", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Lecanoromycetes/Peltigerales/Collemataceae/Leptogium/Leptogium adpressum/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "/**\n * Loads the update static resource page\n *\n * @class MODx.page.UpdateStatic\n * @extends MODx.Component\n * @param {Object} config An object of config properties\n * @xtype modx-page-static-update\n */\nMODx.page.UpdateStatic = function(config) {\n config = config || {record:{}};\n config.record = config.record || {};\n Ext.apply(config.record,{\n 'parent-cmb': config.record['parent']\n });\n\n Ext.applyIf(config,{\n url: MODx.config.connectors_url+'resource/index.php'\n ,which_editor: 'none'\n ,formpanel: 'modx-panel-resource'\n ,id: 'modx-page-update-resource'\n ,action: 'update'\n ,actions: {\n 'new': MODx.action['resource/create']\n ,edit: MODx.action['resource/update']\n ,preview: MODx.action['resource/preview']\n ,cancel: MODx.action['welcome']\n }\n ,components: [{\n xtype: 'modx-panel-static'\n ,renderTo: 'modx-panel-static-div'\n ,resource: config.resource\n ,record: config.record || {}\n ,publish_document: config.publish_document\n ,access_permissions: config.access_permissions\n ,show_tvs: config.show_tvs\n ,url: config.url\n }]\n ,loadStay: true\n ,buttons: this.getButtons(config)\n });\n MODx.page.UpdateStatic.superclass.constructor.call(this,config);\n};\nExt.extend(MODx.page.UpdateStatic,MODx.Component,{\n preview: function() {\n window.open(this.config.preview_url);\n return false;\n }\n\n ,duplicateResource: function(btn,e) {\n MODx.msg.confirm({\n text: _('resource_duplicate_confirm')\n ,url: MODx.config.connectors_url+'resource/index.php'\n ,params: {\n action: 'duplicate'\n ,id: this.config.resource\n }\n ,listeners: {\n success: {fn:function(r) {\n MODx.loadPage(MODx.action['resource/update'], 'id='+r.object.id);\n },scope:this}\n }\n });\n }\n\n ,deleteResource: function(btn,e) {\n MODx.msg.confirm({\n text: _('resource_delete_confirm')\n ,url: MODx.config.connectors_url+'resource/index.php'\n ,params: {\n action: 'delete'\n ,id: this.config.resource\n }\n ,listeners: {\n success: {fn:function(r) {\n MODx.loadPage(MODx.action['resource/update'], 'id='+r.object.id);\n },scope:this}\n }\n });\n }\n\n ,cancel: function(btn,e) {\n var fp = Ext.getCmp(this.config.formpanel);\n if (fp && fp.isDirty()) {\n Ext.Msg.confirm(_('warning'),_('resource_cancel_dirty_confirm'),function(e) {\n if (e == 'yes') {\n MODx.releaseLock(MODx.request.id);\n MODx.sleep(400);\n MODx.loadPage(MODx.action['welcome']);\n }\n },this);\n } else {\n MODx.releaseLock(MODx.request.id);\n MODx.loadPage(MODx.action['welcome']);\n }\n }\n ,getButtons: function(cfg) {\n var btns = [];\n if (cfg.canSave == 1) {\n btns.push({\n process: 'update'\n ,id: 'modx-abtn-save'\n ,text: _('save')\n ,method: 'remote'\n ,checkDirty: cfg.richtext || MODx.request.reload ? false : true\n ,keys: [{\n key: MODx.config.keymap_save || 's'\n ,ctrl: true\n }]\n });\n btns.push('-');\n } else {\n btns.push({\n text: cfg.lockedText || _('locked')\n ,handler: Ext.emptyFn\n ,disabled: true\n ,id: 'modx-abtn-locked'\n });\n btns.push('-');\n }\n if (cfg.canCreate == 1) {\n btns.push({\n process: 'duplicate'\n ,text: _('duplicate')\n ,handler: this.duplicateResource\n ,scope:this\n ,id: 'modx-abtn-duplicate'\n });\n btns.push('-');\n }\n if (cfg.canDelete == 1 && !cfg.locked) {\n btns.push({\n process: 'delete'\n ,text: _('delete')\n ,handler: this.deleteResource\n ,scope:this\n ,id: 'modx-abtn-delete'\n });\n btns.push('-');\n }\n btns.push({\n process: 'preview'\n ,text: _('view')\n ,handler: this.preview\n ,scope: this\n ,id: 'modx-abtn-preview'\n });\n btns.push('-');\n btns.push({\n process: 'cancel'\n ,text: _('cancel')\n ,handler: this.cancel\n ,scope: this\n ,id: 'modx-abtn-cancel'\n });\n btns.push('-');\n btns.push({\n text: _('help_ex')\n ,handler: MODx.loadHelpPane\n ,id: 'modx-abtn-help'\n });\n return btns;\n }\n});\nExt.reg('modx-page-static-update',MODx.page.UpdateStatic);", "meta": {"content_hash": "278ff7215a5b13625669d836642a1d84", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 89, "avg_line_length": 31.49390243902439, "alnum_prop": 0.4681510164569216, "repo_name": "timsvoice/great_green_sources", "id": "8aa3400f26c5e0d8bbbc5ddedd12cb0dce26d512", "size": "5165", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "manager/assets/modext/sections/resource/static/update.js", "mode": "33261", "license": "mit", "language": [{"name": "CSS", "bytes": "718852"}, {"name": "Java", "bytes": "11903"}, {"name": "JavaScript", "bytes": "1641637"}, {"name": "PHP", "bytes": "13315560"}, {"name": "Perl", "bytes": "25276"}]}} +{"text": "'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Iterator component to be used to display a list of entities, using a single field\n *\n * @example Display all the books by the current author\n * <ReferenceManyField reference=\"books\" target=\"author_id\">\n * <SingleFieldList>\n * <ChipField source=\"title\" />\n * </SingleFieldList>\n * </ReferenceManyField>\n */\nvar SingleFieldList = function SingleFieldList(_ref) {\n var ids = _ref.ids,\n data = _ref.data,\n resource = _ref.resource,\n basePath = _ref.basePath,\n children = _ref.children;\n return _react2.default.createElement(\n 'div',\n { style: { display: 'flex', flexWrap: 'wrap' } },\n ids.map(function (id) {\n return _react2.default.cloneElement(children, {\n key: id,\n record: data[id],\n resource: resource,\n basePath: basePath\n });\n })\n );\n};\n\nSingleFieldList.propTypes = {\n children: _react.PropTypes.element.isRequired\n};\n\nexports.default = SingleFieldList;\nmodule.exports = exports['default'];", "meta": {"content_hash": "89991f5b650692351a5cde081b2bdbca", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 95, "avg_line_length": 27.604166666666668, "alnum_prop": 0.6083018867924528, "repo_name": "epwqice/admin-on-rest-old-man", "id": "790aa079ecac628c1979182cdadfca4b2862fd12", "size": "1325", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/mui/list/SingleFieldList.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "698283"}, {"name": "Makefile", "bytes": "1207"}, {"name": "PowerShell", "bytes": "4033"}]}} +{"text": "@interface AppDelegate : UIResponder <UIApplicationDelegate>\n\n@property (strong, nonatomic) UIWindow *window;\n\n@end\n", "meta": {"content_hash": "feca7399da0e346d03627873da4da13d", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 60, "avg_line_length": 23.2, "alnum_prop": 0.7931034482758621, "repo_name": "I-SYST/iOS", "id": "1e4c2946bd5df26d98b8f99e18e65670911444e8", "size": "272", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "UartBle/UartBle/AppDelegate.h", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "Objective-C", "bytes": "56928"}, {"name": "Swift", "bytes": "20327"}]}} +{"text": "import {Injectable} from \"angular2/core\";\nimport {CONTACTS} from \"./mocks/data\";\nimport {Contact} from \"./contact\";\n\n@Injectable()\nexport class ContactService{\n getContacts(){\n return Promise.resolve(CONTACTS);\n }\n getContactById(id){\n return Promise.resolve(CONTACTS.find(x=>x.id == id));\n }\n insertContact(contact:Contact){\n Promise.resolve(CONTACTS)\n .then(\n (contacts:Contact[])=> contacts.push(contact)\n );\n }\n}\n", "meta": {"content_hash": "361e940c1a8390c20d8d5780c6a3f8b6", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 57, "avg_line_length": 23.63157894736842, "alnum_prop": 0.6636971046770601, "repo_name": "Pishtiko/ANGULAR-2-TEMPLATE", "id": "e40d690a267c38f73ef77c35c633407fac04bee3", "size": "590", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dev/contacts/contact.service.ts", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1227"}, {"name": "HTML", "bytes": "4933"}, {"name": "JavaScript", "bytes": "14954"}, {"name": "TypeScript", "bytes": "8483"}]}} +{"text": "// Copyright 2019 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include \"chrome/browser/web_applications/web_app_sync_bridge.h\"\n\n#include <memory>\n#include <vector>\n\n#include \"base/barrier_closure.h\"\n#include \"base/bind.h\"\n#include \"base/containers/contains.h\"\n#include \"base/containers/cxx20_erase.h\"\n#include \"base/run_loop.h\"\n#include \"base/strings/string_number_conversions.h\"\n#include \"base/test/bind.h\"\n#include \"chrome/browser/web_applications/os_integration/os_integration_manager.h\"\n#include \"chrome/browser/web_applications/test/fake_web_app_database_factory.h\"\n#include \"chrome/browser/web_applications/test/fake_web_app_provider.h\"\n#include \"chrome/browser/web_applications/test/web_app_sync_test_utils.h\"\n#include \"chrome/browser/web_applications/test/web_app_test.h\"\n#include \"chrome/browser/web_applications/test/web_app_test_observers.h\"\n#include \"chrome/browser/web_applications/test/web_app_test_utils.h\"\n#include \"chrome/browser/web_applications/user_display_mode.h\"\n#include \"chrome/browser/web_applications/web_app.h\"\n#include \"chrome/browser/web_applications/web_app_command_manager.h\"\n#include \"chrome/browser/web_applications/web_app_helpers.h\"\n#include \"chrome/browser/web_applications/web_app_install_manager.h\"\n#include \"chrome/browser/web_applications/web_app_registry_update.h\"\n#include \"chrome/browser/web_applications/web_app_utils.h\"\n#include \"components/sync/model/data_batch.h\"\n#include \"components/sync/model/entity_change.h\"\n#include \"components/sync/protocol/web_app_specifics.pb.h\"\n#include \"components/sync/test/mock_model_type_change_processor.h\"\n#include \"components/webapps/browser/install_result_code.h\"\n#include \"testing/gmock/include/gmock/gmock.h\"\n#include \"testing/gtest/include/gtest/gtest.h\"\n#include \"third_party/skia/include/core/SkColor.h\"\n\nnamespace web_app {\n\nnamespace {\n\nusing testing::_;\n\nusing AppsList = std::vector<std::unique_ptr<WebApp>>;\n\nvoid RemoveWebAppFromAppsList(AppsList* apps_list, const AppId& app_id) {\n base::EraseIf(*apps_list, [app_id](const std::unique_ptr<WebApp>& app) {\n return app->app_id() == app_id;\n });\n}\n\nbool IsSyncDataEqualIfApplied(const WebApp& expected_app,\n std::unique_ptr<WebApp> app_to_apply_sync_data,\n const syncer::EntityData& entity_data) {\n if (!entity_data.specifics.has_web_app())\n return false;\n\n const GURL sync_start_url(entity_data.specifics.web_app().start_url());\n if (expected_app.app_id() !=\n GenerateAppId(/*manifest_id=*/absl::nullopt, sync_start_url))\n return false;\n\n // ApplySyncDataToApp enforces kSync source on |app_to_apply_sync_data|.\n ApplySyncDataToApp(entity_data.specifics.web_app(),\n app_to_apply_sync_data.get());\n app_to_apply_sync_data->SetName(entity_data.name);\n return expected_app == *app_to_apply_sync_data;\n}\n\nbool IsSyncDataEqual(const WebApp& expected_app,\n const syncer::EntityData& entity_data) {\n auto app_to_apply_sync_data = std::make_unique<WebApp>(expected_app.app_id());\n return IsSyncDataEqualIfApplied(\n expected_app, std::move(app_to_apply_sync_data), entity_data);\n}\n\nbool RegistryContainsSyncDataBatchChanges(\n const Registry& registry,\n std::unique_ptr<syncer::DataBatch> data_batch) {\n if (!data_batch || !data_batch->HasNext())\n return registry.empty();\n\n while (data_batch->HasNext()) {\n syncer::KeyAndData key_and_data = data_batch->Next();\n auto web_app_iter = registry.find(key_and_data.first);\n if (web_app_iter == registry.end()) {\n LOG(ERROR) << \"App not found in registry: \" << key_and_data.first;\n return false;\n }\n\n if (!IsSyncDataEqual(*web_app_iter->second, *key_and_data.second))\n return false;\n }\n return true;\n}\n\nstd::unique_ptr<WebApp> CreateWebAppWithSyncOnlyFields(const std::string& url) {\n const GURL start_url(url);\n const AppId app_id = GenerateAppId(/*manifest_id=*/absl::nullopt, start_url);\n\n auto web_app = std::make_unique<WebApp>(app_id);\n web_app->AddSource(WebAppManagement::kSync);\n web_app->SetStartUrl(start_url);\n web_app->SetName(\"Name\");\n web_app->SetUserDisplayMode(UserDisplayMode::kStandalone);\n return web_app;\n}\n\nAppsList CreateAppsList(const std::string& base_url, int num_apps) {\n AppsList apps_list;\n\n for (int i = 0; i < num_apps; ++i) {\n apps_list.push_back(\n CreateWebAppWithSyncOnlyFields(base_url + base::NumberToString(i)));\n }\n\n return apps_list;\n}\n\nvoid InsertAppIntoRegistry(Registry* registry, std::unique_ptr<WebApp> app) {\n AppId app_id = app->app_id();\n ASSERT_FALSE(base::Contains(*registry, app_id));\n registry->emplace(std::move(app_id), std::move(app));\n}\n\nvoid InsertAppsListIntoRegistry(Registry* registry, const AppsList& apps_list) {\n for (const std::unique_ptr<WebApp>& app : apps_list)\n registry->emplace(app->app_id(), std::make_unique<WebApp>(*app));\n}\n\nvoid ConvertAppToEntityChange(const WebApp& app,\n syncer::EntityChange::ChangeType change_type,\n syncer::EntityChangeList* sync_data_list) {\n std::unique_ptr<syncer::EntityChange> entity_change;\n\n switch (change_type) {\n case syncer::EntityChange::ACTION_ADD:\n entity_change = syncer::EntityChange::CreateAdd(\n app.app_id(), std::move(*CreateSyncEntityData(app)));\n break;\n case syncer::EntityChange::ACTION_UPDATE:\n entity_change = syncer::EntityChange::CreateUpdate(\n app.app_id(), std::move(*CreateSyncEntityData(app)));\n break;\n case syncer::EntityChange::ACTION_DELETE:\n entity_change = syncer::EntityChange::CreateDelete(app.app_id());\n break;\n }\n\n sync_data_list->push_back(std::move(entity_change));\n}\n\nvoid ConvertAppsListToEntityChangeList(\n const AppsList& apps_list,\n syncer::EntityChangeList* sync_data_list) {\n for (auto& app : apps_list) {\n ConvertAppToEntityChange(*app, syncer::EntityChange::ACTION_ADD,\n sync_data_list);\n }\n}\n\n// Returns true if the app converted from entity_data exists in the apps_list.\nbool RemoveEntityDataAppFromAppsList(const std::string& storage_key,\n const syncer::EntityData& entity_data,\n AppsList* apps_list) {\n for (auto& app : *apps_list) {\n if (app->app_id() == storage_key) {\n if (!IsSyncDataEqual(*app, entity_data))\n return false;\n\n RemoveWebAppFromAppsList(apps_list, storage_key);\n return true;\n }\n }\n\n return false;\n}\n\nvoid RunCallbacksOnInstall(\n const std::vector<WebApp*>& apps,\n const WebAppInstallManager::RepeatingInstallCallback& callback,\n webapps::InstallResultCode code) {\n for (WebApp* app : apps)\n callback.Run(app->app_id(), code);\n}\n\n} // namespace\n\nclass WebAppSyncBridgeTest : public WebAppTest {\n public:\n void SetUp() override {\n WebAppTest::SetUp();\n\n command_manager_ = std::make_unique<WebAppCommandManager>(\n profile(), FakeWebAppProvider::Get(profile()));\n install_manager_ = std::make_unique<WebAppInstallManager>(profile());\n registrar_mutable_ = std::make_unique<WebAppRegistrarMutable>(profile());\n sync_bridge_ = std::make_unique<WebAppSyncBridge>(\n registrar_mutable_.get(), mock_processor_.CreateForwardingProcessor());\n database_factory_ = std::make_unique<FakeWebAppDatabaseFactory>();\n\n sync_bridge_->SetSubsystems(database_factory_.get(), install_manager_.get(),\n command_manager_.get());\n\n install_manager_->Start();\n\n ON_CALL(mock_processor_, IsTrackingMetadata())\n .WillByDefault(testing::Return(true));\n }\n\n void TearDown() override {\n DestroyManagers();\n WebAppTest::TearDown();\n }\n\n void InitSyncBridge() {\n base::RunLoop loop;\n sync_bridge_->Init(loop.QuitClosure());\n loop.Run();\n }\n\n void InitSyncBridgeFromAppList(const AppsList& apps_list) {\n Registry registry;\n InsertAppsListIntoRegistry(®istry, apps_list);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n }\n\n void MergeSyncData(const AppsList& merged_apps) {\n syncer::EntityChangeList entity_data_list;\n ConvertAppsListToEntityChangeList(merged_apps, &entity_data_list);\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n sync_bridge().MergeSyncData(sync_bridge().CreateMetadataChangeList(),\n std::move(entity_data_list));\n }\n\n bool IsDatabaseRegistryEqualToRegistrar() {\n Registry registry = database_factory().ReadRegistry();\n return IsRegistryEqual(registrar_registry(), registry);\n }\n\n void SetSyncInstallDelegateFailureIfCalled() {\n install_manager().SetInstallWebAppsAfterSyncDelegateForTesting(\n base::BindLambdaForTesting(\n [&](std::vector<WebApp*> apps_to_install,\n WebAppInstallManager::RepeatingInstallCallback callback) {\n ADD_FAILURE();\n }));\n\n install_manager().SetUninstallFromSyncDelegateForTesting(\n base::BindLambdaForTesting(\n [&](const std::vector<AppId>& apps_to_uninstall,\n WebAppInstallManager::RepeatingUninstallCallback callback) {\n ADD_FAILURE();\n }));\n }\n\n void CommitUpdate(std::unique_ptr<WebAppRegistryUpdate> update) {\n base::RunLoop run_loop;\n sync_bridge().CommitUpdate(\n std::move(update),\n base::BindLambdaForTesting([&run_loop](bool success) {\n ASSERT_TRUE(success);\n run_loop.Quit();\n }));\n run_loop.Run();\n }\n\n protected:\n void DestroyManagers() {\n if (command_manager_) {\n command_manager_->Shutdown();\n command_manager_.reset();\n }\n if (install_manager_) {\n install_manager_.reset();\n }\n if (registrar_mutable_) {\n registrar_mutable_.reset();\n }\n if (sync_bridge_) {\n sync_bridge_.reset();\n }\n if (database_factory_) {\n database_factory_.reset();\n }\n }\n\n syncer::MockModelTypeChangeProcessor& processor() { return mock_processor_; }\n FakeWebAppDatabaseFactory& database_factory() { return *database_factory_; }\n\n WebAppRegistrar& registrar() { return *registrar_mutable_; }\n\n WebAppSyncBridge& sync_bridge() { return *sync_bridge_; }\n\n WebAppInstallManager& install_manager() { return *install_manager_; }\n\n Registry& registrar_registry() { return registrar_mutable_->registry(); }\n\n private:\n std::unique_ptr<WebAppCommandManager> command_manager_;\n std::unique_ptr<WebAppInstallManager> install_manager_;\n std::unique_ptr<WebAppRegistrarMutable> registrar_mutable_;\n std::unique_ptr<WebAppSyncBridge> sync_bridge_;\n std::unique_ptr<FakeWebAppDatabaseFactory> database_factory_;\n\n testing::NiceMock<syncer::MockModelTypeChangeProcessor> mock_processor_;\n};\n\n// Tests that the WebAppSyncBridge correctly reports data from the\n// WebAppDatabase.\nTEST_F(WebAppSyncBridgeTest, GetData) {\n Registry registry;\n\n std::unique_ptr<WebApp> synced_app1 =\n CreateWebAppWithSyncOnlyFields(\"https://example.com/app1/\");\n {\n WebApp::SyncFallbackData sync_fallback_data;\n sync_fallback_data.name = \"Sync Name\";\n sync_fallback_data.theme_color = SK_ColorCYAN;\n synced_app1->SetSyncFallbackData(std::move(sync_fallback_data));\n }\n InsertAppIntoRegistry(®istry, std::move(synced_app1));\n\n std::unique_ptr<WebApp> synced_app2 =\n CreateWebAppWithSyncOnlyFields(\"https://example.com/app2/\");\n // sync_fallback_data is empty for this app.\n InsertAppIntoRegistry(®istry, std::move(synced_app2));\n\n std::unique_ptr<WebApp> policy_app = test::CreateWebApp(\n GURL(\"https://example.org/\"), WebAppManagement::kPolicy);\n InsertAppIntoRegistry(®istry, std::move(policy_app));\n\n database_factory().WriteRegistry(registry);\n\n EXPECT_CALL(processor(), ModelReadyToSync(_)).Times(1);\n InitSyncBridge();\n\n {\n WebAppSyncBridge::StorageKeyList storage_keys;\n // Add an unknown key to test this is handled gracefully.\n storage_keys.push_back(\"unknown\");\n for (const Registry::value_type& id_and_web_app : registry)\n storage_keys.push_back(id_and_web_app.first);\n\n base::RunLoop run_loop;\n sync_bridge().GetData(\n std::move(storage_keys),\n base::BindLambdaForTesting(\n [&](std::unique_ptr<syncer::DataBatch> data_batch) {\n EXPECT_TRUE(RegistryContainsSyncDataBatchChanges(\n registry, std::move(data_batch)));\n run_loop.Quit();\n }));\n run_loop.Run();\n }\n\n {\n base::RunLoop run_loop;\n sync_bridge().GetAllDataForDebugging(base::BindLambdaForTesting(\n [&](std::unique_ptr<syncer::DataBatch> data_batch) {\n EXPECT_TRUE(RegistryContainsSyncDataBatchChanges(\n registry, std::move(data_batch)));\n run_loop.Quit();\n }));\n run_loop.Run();\n }\n}\n\n// Tests that the client & storage tags are correct for entity data.\nTEST_F(WebAppSyncBridgeTest, Identities) {\n std::unique_ptr<WebApp> app =\n CreateWebAppWithSyncOnlyFields(\"https://example.com/\");\n std::unique_ptr<syncer::EntityData> entity_data = CreateSyncEntityData(*app);\n\n EXPECT_EQ(app->app_id(), sync_bridge().GetClientTag(*entity_data));\n EXPECT_EQ(app->app_id(), sync_bridge().GetStorageKey(*entity_data));\n}\n\n// Test that a empty local data results in no changes sent to the sync system.\nTEST_F(WebAppSyncBridgeTest, MergeSyncData_LocalSetAndServerSetAreEmpty) {\n InitSyncBridge();\n\n syncer::EntityChangeList sync_data_list;\n\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n\n sync_bridge().MergeSyncData(sync_bridge().CreateMetadataChangeList(),\n std::move(sync_data_list));\n}\n\nTEST_F(WebAppSyncBridgeTest, MergeSyncData_LocalSetEqualsServerSet) {\n AppsList apps = CreateAppsList(\"https://example.com/\", 10);\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n\n // The incoming list of apps from the sync server.\n syncer::EntityChangeList sync_data_list;\n ConvertAppsListToEntityChangeList(apps, &sync_data_list);\n\n // The local app state is the same as the server state, so no changes should\n // be sent.\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n\n sync_bridge().MergeSyncData(sync_bridge().CreateMetadataChangeList(),\n std::move(sync_data_list));\n\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest, MergeSyncData_LocalSetGreaterThanServerSet) {\n AppsList local_and_server_apps = CreateAppsList(\"https://example.com/\", 10);\n AppsList expected_local_apps_to_upload =\n CreateAppsList(\"https://example.org/\", 10);\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, local_and_server_apps);\n InsertAppsListIntoRegistry(®istry, expected_local_apps_to_upload);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n\n auto metadata_change_list = sync_bridge().CreateMetadataChangeList();\n syncer::MetadataChangeList* metadata_ptr = metadata_change_list.get();\n\n syncer::EntityChangeList sync_data_list;\n ConvertAppsListToEntityChangeList(local_and_server_apps, &sync_data_list);\n\n // MergeSyncData below should send |expected_local_apps_to_upload| to the\n // processor() to upload to USS.\n base::RunLoop run_loop;\n ON_CALL(processor(), Put(_, _, _))\n .WillByDefault([&](const std::string& storage_key,\n std::unique_ptr<syncer::EntityData> entity_data,\n syncer::MetadataChangeList* metadata) {\n EXPECT_EQ(metadata_ptr, metadata);\n EXPECT_TRUE(RemoveEntityDataAppFromAppsList(\n storage_key, *entity_data, &expected_local_apps_to_upload));\n if (expected_local_apps_to_upload.empty())\n run_loop.Quit();\n });\n\n sync_bridge().MergeSyncData(std::move(metadata_change_list),\n std::move(sync_data_list));\n run_loop.Run();\n\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest, MergeSyncData_LocalSetLessThanServerSet) {\n AppsList local_and_server_apps = CreateAppsList(\"https://example.com/\", 10);\n AppsList expected_apps_to_install =\n CreateAppsList(\"https://example.org/\", 10);\n // These fields are not synced, these are just expected values.\n for (std::unique_ptr<WebApp>& expected_app_to_install :\n expected_apps_to_install) {\n expected_app_to_install->SetIsLocallyInstalled(\n AreAppsLocallyInstalledBySync());\n expected_app_to_install->SetIsFromSyncAndPendingInstallation(true);\n }\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, local_and_server_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n\n syncer::EntityChangeList sync_data_list;\n ConvertAppsListToEntityChangeList(expected_apps_to_install, &sync_data_list);\n ConvertAppsListToEntityChangeList(local_and_server_apps, &sync_data_list);\n\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n\n base::RunLoop run_loop;\n // This is called after apps are installed from sync in MergeSyncData() below.\n install_manager().SetInstallWebAppsAfterSyncDelegateForTesting(\n base::BindLambdaForTesting(\n [&](std::vector<WebApp*> apps_to_install,\n WebAppInstallManager::RepeatingInstallCallback callback) {\n for (WebApp* app_to_install : apps_to_install) {\n // The app must be registered.\n EXPECT_TRUE(registrar().GetAppById(app_to_install->app_id()));\n // Add the app copy to the expected registry.\n registry.emplace(app_to_install->app_id(),\n std::make_unique<WebApp>(*app_to_install));\n\n // Find the app in expected_apps_to_install set and remove the\n // entry.\n bool found = false;\n for (const std::unique_ptr<WebApp>& expected_app_to_install :\n expected_apps_to_install) {\n if (expected_app_to_install->app_id() ==\n app_to_install->app_id()) {\n EXPECT_EQ(*expected_app_to_install, *app_to_install);\n RemoveWebAppFromAppsList(&expected_apps_to_install,\n expected_app_to_install->app_id());\n found = true;\n break;\n }\n }\n EXPECT_TRUE(found);\n }\n\n EXPECT_TRUE(expected_apps_to_install.empty());\n\n RunCallbacksOnInstall(\n apps_to_install, callback,\n webapps::InstallResultCode::kSuccessNewInstall);\n run_loop.Quit();\n }));\n\n sync_bridge().MergeSyncData(sync_bridge().CreateMetadataChangeList(),\n std::move(sync_data_list));\n run_loop.Run();\n\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest, ApplySyncChanges_EmptyEntityChanges) {\n AppsList merged_apps = CreateAppsList(\"https://example.com/\", 10);\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, merged_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n MergeSyncData(merged_apps);\n\n syncer::EntityChangeList entity_changes;\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n SetSyncInstallDelegateFailureIfCalled();\n\n sync_bridge().ApplySyncChanges(sync_bridge().CreateMetadataChangeList(),\n std::move(entity_changes));\n\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest, ApplySyncChanges_AddUpdateDelete) {\n // 20 initial apps with DisplayMode::kStandalone user display mode.\n AppsList merged_apps = CreateAppsList(\"https://example.com/\", 20);\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, merged_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n MergeSyncData(merged_apps);\n\n syncer::EntityChangeList entity_changes;\n\n for (std::unique_ptr<WebApp>& app_to_add :\n CreateAppsList(\"https://example.org/\", 10)) {\n app_to_add->SetIsLocallyInstalled(AreAppsLocallyInstalledBySync());\n app_to_add->SetIsFromSyncAndPendingInstallation(true);\n\n ConvertAppToEntityChange(*app_to_add, syncer::EntityChange::ACTION_ADD,\n &entity_changes);\n }\n\n // Update first 5 initial apps.\n for (int i = 0; i < 5; ++i) {\n auto app_to_update = std::make_unique<WebApp>(*merged_apps[i]);\n // Update user display mode field.\n app_to_update->SetUserDisplayMode(UserDisplayMode::kBrowser);\n ConvertAppToEntityChange(\n *app_to_update, syncer::EntityChange::ACTION_UPDATE, &entity_changes);\n // Override the app in the expected registry.\n registry[app_to_update->app_id()] = std::move(app_to_update);\n }\n\n // Delete next 5 initial apps. Leave the rest unchanged.\n for (int i = 5; i < 10; ++i) {\n const WebApp& app_to_delete = *merged_apps[i];\n ConvertAppToEntityChange(app_to_delete, syncer::EntityChange::ACTION_DELETE,\n &entity_changes);\n }\n\n // There should be no changes sent to USS in the next ApplySyncChanges()\n // operation.\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n\n base::RunLoop run_loop;\n base::RepeatingClosure barrier_closure =\n base::BarrierClosure(2, run_loop.QuitClosure());\n\n install_manager().SetInstallWebAppsAfterSyncDelegateForTesting(\n base::BindLambdaForTesting(\n [&](std::vector<WebApp*> apps_to_install,\n WebAppInstallManager::RepeatingInstallCallback callback) {\n for (WebApp* app_to_install : apps_to_install) {\n // The app must be registered.\n EXPECT_TRUE(registrar().GetAppById(app_to_install->app_id()));\n // Add the app copy to the expected registry.\n registry.emplace(app_to_install->app_id(),\n std::make_unique<WebApp>(*app_to_install));\n }\n\n RunCallbacksOnInstall(\n apps_to_install, callback,\n webapps::InstallResultCode::kSuccessNewInstall);\n barrier_closure.Run();\n }));\n\n install_manager().SetUninstallFromSyncDelegateForTesting(\n base::BindLambdaForTesting(\n [&](const std::vector<AppId>& apps_to_uninstall,\n WebAppInstallManager::RepeatingUninstallCallback callback) {\n EXPECT_EQ(5ul, apps_to_uninstall.size());\n\n for (const AppId& app_to_uninstall : apps_to_uninstall) {\n // The app must be registered.\n const WebApp* app = registrar().GetAppById(app_to_uninstall);\n // Sync expects that the apps are deleted by the delegate.\n EXPECT_TRUE(app);\n EXPECT_TRUE(app->is_uninstalling());\n EXPECT_TRUE(app->GetSources().none());\n registry.erase(app_to_uninstall);\n {\n ScopedRegistryUpdate update(&sync_bridge());\n update->DeleteApp(app_to_uninstall);\n }\n callback.Run(app_to_uninstall,\n webapps::UninstallResultCode::kSuccess);\n }\n\n barrier_closure.Run();\n }));\n\n sync_bridge().ApplySyncChanges(sync_bridge().CreateMetadataChangeList(),\n std::move(entity_changes));\n run_loop.Run();\n\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest, ApplySyncChanges_DeleteHappensExternally) {\n // 5 initial apps.\n AppsList merged_apps = CreateAppsList(\"https://example.com/\", 5);\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, merged_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n MergeSyncData(merged_apps);\n\n syncer::EntityChangeList entity_changes;\n\n // Delete next 5 initial apps. Leave the rest unchanged.\n for (int i = 0; i < 5; ++i) {\n const WebApp& app_to_delete = *merged_apps[i];\n ConvertAppToEntityChange(app_to_delete, syncer::EntityChange::ACTION_DELETE,\n &entity_changes);\n }\n\n // There should be no changes sent to USS in the next ApplySyncChanges()\n // operation.\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n\n base::RunLoop run_loop;\n std::vector<AppId> to_uninstall;\n WebAppInstallManager::RepeatingUninstallCallback uninstall_complete_callback;\n\n install_manager().SetUninstallFromSyncDelegateForTesting(\n base::BindLambdaForTesting(\n [&](const std::vector<AppId>& apps_to_uninstall,\n WebAppInstallManager::RepeatingUninstallCallback callback) {\n to_uninstall = apps_to_uninstall;\n uninstall_complete_callback = callback;\n run_loop.Quit();\n }));\n\n sync_bridge().ApplySyncChanges(sync_bridge().CreateMetadataChangeList(),\n std::move(entity_changes));\n run_loop.Run();\n\n EXPECT_EQ(5ul, to_uninstall.size());\n\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n for (const AppId& app_to_uninstall : to_uninstall) {\n const WebApp* app = registrar().GetAppById(app_to_uninstall);\n EXPECT_TRUE(app);\n EXPECT_TRUE(app->is_uninstalling());\n EXPECT_TRUE(app->GetSources().none());\n }\n}\n\nTEST_F(WebAppSyncBridgeTest, ApplySyncChanges_UpdateOnly) {\n AppsList merged_apps = CreateAppsList(\"https://example.com/\", 10);\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, merged_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n MergeSyncData(merged_apps);\n\n syncer::EntityChangeList entity_changes;\n\n // Update last 5 initial apps.\n for (int i = 5; i < 10; ++i) {\n auto app_to_update = std::make_unique<WebApp>(*merged_apps[i]);\n app_to_update->SetUserDisplayMode(UserDisplayMode::kStandalone);\n\n WebApp::SyncFallbackData sync_fallback_data;\n sync_fallback_data.name = \"Sync Name\";\n sync_fallback_data.theme_color = SK_ColorYELLOW;\n app_to_update->SetSyncFallbackData(std::move(sync_fallback_data));\n\n ConvertAppToEntityChange(\n *app_to_update, syncer::EntityChange::ACTION_UPDATE, &entity_changes);\n // Override the app in the expected registry.\n registry[app_to_update->app_id()] = std::move(app_to_update);\n }\n\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n\n // No installs or uninstalls are made here, only app updates.\n SetSyncInstallDelegateFailureIfCalled();\n\n sync_bridge().ApplySyncChanges(sync_bridge().CreateMetadataChangeList(),\n std::move(entity_changes));\n\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest,\n ApplySyncChanges_AddSyncAppsWithOverlappingPolicyApps) {\n AppsList policy_apps;\n for (int i = 0; i < 10; ++i) {\n std::unique_ptr<WebApp> policy_app = test::CreateWebApp(\n GURL(\"https://example.com/\" + base::NumberToString(i)),\n WebAppManagement::kPolicy);\n policy_apps.push_back(std::move(policy_app));\n }\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, policy_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n\n syncer::EntityChangeList entity_changes;\n\n // Install 5 kSync apps over existing kPolicy apps. Leave the rest unchanged.\n for (int i = 0; i < 5; ++i) {\n const WebApp& app_to_install = *policy_apps[i];\n ConvertAppToEntityChange(app_to_install, syncer::EntityChange::ACTION_ADD,\n &entity_changes);\n }\n\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n SetSyncInstallDelegateFailureIfCalled();\n\n sync_bridge().ApplySyncChanges(sync_bridge().CreateMetadataChangeList(),\n std::move(entity_changes));\n\n // Modify the registry with the results that we expect.\n for (int i = 0; i < 5; ++i) {\n std::unique_ptr<WebApp>& expected_sync_and_policy_app =\n registry[policy_apps[i]->app_id()];\n expected_sync_and_policy_app->AddSource(WebAppManagement::kSync);\n }\n\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest,\n ApplySyncChanges_UpdateSyncAppsWithOverlappingPolicyApps) {\n AppsList policy_and_sync_apps;\n for (int i = 0; i < 10; ++i) {\n std::unique_ptr<WebApp> policy_and_sync_app = test::CreateWebApp(\n GURL(\"https://example.com/\" + base::NumberToString(i)));\n policy_and_sync_app->AddSource(WebAppManagement::kPolicy);\n policy_and_sync_app->AddSource(WebAppManagement::kSync);\n policy_and_sync_apps.push_back(std::move(policy_and_sync_app));\n }\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, policy_and_sync_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n MergeSyncData(policy_and_sync_apps);\n\n syncer::EntityChangeList entity_changes;\n\n // Update first 5 kSync apps which are shared with kPolicy. Leave the rest\n // unchanged.\n AppsList apps_to_update;\n for (int i = 0; i < 5; ++i) {\n auto app_to_update = std::make_unique<WebApp>(*policy_and_sync_apps[i]);\n app_to_update->SetUserDisplayMode(UserDisplayMode::kBrowser);\n\n WebApp::SyncFallbackData sync_fallback_data;\n sync_fallback_data.name = \"Updated Sync Name\";\n sync_fallback_data.theme_color = SK_ColorWHITE;\n app_to_update->SetSyncFallbackData(std::move(sync_fallback_data));\n\n ConvertAppToEntityChange(\n *app_to_update, syncer::EntityChange::ACTION_UPDATE, &entity_changes);\n apps_to_update.push_back(std::move(app_to_update));\n }\n\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n SetSyncInstallDelegateFailureIfCalled();\n\n sync_bridge().ApplySyncChanges(sync_bridge().CreateMetadataChangeList(),\n std::move(entity_changes));\n\n // Modify the registry with the results that we expect.\n for (int i = 0; i < 5; ++i)\n registry[policy_and_sync_apps[i]->app_id()] = std::move(apps_to_update[i]);\n\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\n// Tests that if a policy app is installed, and that app is also in 'sync' and\n// is uninstalled through sync, then it should remain on the system as a policy\n// app.\nTEST_F(WebAppSyncBridgeTest,\n ApplySyncChanges_DeleteSyncAppsWithOverlappingPolicyApps) {\n AppsList policy_and_sync_apps;\n for (int i = 0; i < 10; ++i) {\n std::unique_ptr<WebApp> policy_and_sync_app = test::CreateWebApp(\n GURL(\"https://example.com/\" + base::NumberToString(i)));\n policy_and_sync_app->AddSource(WebAppManagement::kPolicy);\n policy_and_sync_app->AddSource(WebAppManagement::kSync);\n policy_and_sync_apps.push_back(std::move(policy_and_sync_app));\n }\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, policy_and_sync_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n MergeSyncData(policy_and_sync_apps);\n\n syncer::EntityChangeList entity_changes;\n\n // Uninstall 5 kSync apps which are shared with kPolicy. Leave the rest\n // unchanged.\n for (int i = 0; i < 5; ++i) {\n const WebApp& app_to_uninstall = *policy_and_sync_apps[i];\n ConvertAppToEntityChange(\n app_to_uninstall, syncer::EntityChange::ACTION_DELETE, &entity_changes);\n }\n\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n SetSyncInstallDelegateFailureIfCalled();\n\n sync_bridge().ApplySyncChanges(sync_bridge().CreateMetadataChangeList(),\n std::move(entity_changes));\n\n // Modify the registry with the results that we expect.\n for (int i = 0; i < 5; ++i) {\n std::unique_ptr<WebApp>& expected_policy_app =\n registry[policy_and_sync_apps[i]->app_id()];\n expected_policy_app->RemoveSource(WebAppManagement::kSync);\n }\n\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\n// Commits local data (e.g. installed web apps) before sync is hooked up. This\n// tests that the web apps are correctly sent to USS after MergeSyncData is\n// called.\nTEST_F(WebAppSyncBridgeTest, CommitUpdate_CommitWhileNotTrackingMetadata) {\n EXPECT_CALL(processor(), ModelReadyToSync(_)).Times(1);\n InitSyncBridge();\n\n AppsList sync_apps = CreateAppsList(\"https://example.com/\", 10);\n Registry expected_registry;\n InsertAppsListIntoRegistry(&expected_registry, sync_apps);\n\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n EXPECT_CALL(processor(), IsTrackingMetadata())\n .WillOnce(testing::Return(false));\n\n std::unique_ptr<WebAppRegistryUpdate> update = sync_bridge().BeginUpdate();\n\n for (const std::unique_ptr<WebApp>& app : sync_apps)\n update->CreateApp(std::make_unique<WebApp>(*app));\n\n CommitUpdate(std::move(update));\n testing::Mock::VerifyAndClear(&processor());\n\n // Do MergeSyncData next.\n base::RunLoop run_loop;\n ON_CALL(processor(), Put(_, _, _))\n .WillByDefault([&](const std::string& storage_key,\n std::unique_ptr<syncer::EntityData> entity_data,\n syncer::MetadataChangeList* metadata) {\n EXPECT_TRUE(RemoveEntityDataAppFromAppsList(storage_key, *entity_data,\n &sync_apps));\n if (sync_apps.empty())\n run_loop.Quit();\n });\n\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n EXPECT_CALL(processor(), IsTrackingMetadata())\n .WillOnce(testing::Return(true));\n\n sync_bridge().MergeSyncData(sync_bridge().CreateMetadataChangeList(),\n syncer::EntityChangeList{});\n run_loop.Run();\n\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), expected_registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest, CommitUpdate_CreateSyncApp) {\n InitSyncBridge();\n\n AppsList sync_apps = CreateAppsList(\"https://example.com/\", 10);\n Registry expected_registry;\n InsertAppsListIntoRegistry(&expected_registry, sync_apps);\n\n ON_CALL(processor(), Put(_, _, _))\n .WillByDefault([&](const std::string& storage_key,\n std::unique_ptr<syncer::EntityData> entity_data,\n syncer::MetadataChangeList* metadata) {\n ASSERT_TRUE(base::Contains(expected_registry, storage_key));\n const std::unique_ptr<WebApp>& expected_app =\n expected_registry.at(storage_key);\n EXPECT_TRUE(IsSyncDataEqual(*expected_app, *entity_data));\n RemoveWebAppFromAppsList(&sync_apps, storage_key);\n });\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n EXPECT_CALL(processor(), IsTrackingMetadata())\n .WillOnce(testing::Return(true));\n\n std::unique_ptr<WebAppRegistryUpdate> update = sync_bridge().BeginUpdate();\n\n for (const std::unique_ptr<WebApp>& app : sync_apps)\n update->CreateApp(std::make_unique<WebApp>(*app));\n\n CommitUpdate(std::move(update));\n\n EXPECT_TRUE(sync_apps.empty());\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), expected_registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest, CommitUpdate_UpdateSyncApp) {\n AppsList sync_apps = CreateAppsList(\"https://example.com/\", 10);\n Registry registry;\n InsertAppsListIntoRegistry(®istry, sync_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n\n ON_CALL(processor(), Put(_, _, _))\n .WillByDefault([&](const std::string& storage_key,\n std::unique_ptr<syncer::EntityData> entity_data,\n syncer::MetadataChangeList* metadata) {\n ASSERT_TRUE(base::Contains(registry, storage_key));\n const std::unique_ptr<WebApp>& expected_app = registry.at(storage_key);\n EXPECT_TRUE(IsSyncDataEqual(*expected_app, *entity_data));\n RemoveWebAppFromAppsList(&sync_apps, storage_key);\n });\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n\n std::unique_ptr<WebAppRegistryUpdate> update = sync_bridge().BeginUpdate();\n\n for (const std::unique_ptr<WebApp>& app : sync_apps) {\n // Obtain a writeable handle.\n WebApp* sync_app = update->UpdateApp(app->app_id());\n\n WebApp::SyncFallbackData sync_fallback_data;\n sync_fallback_data.name = \"Updated Sync Name\";\n sync_fallback_data.theme_color = SK_ColorBLACK;\n sync_app->SetSyncFallbackData(std::move(sync_fallback_data));\n sync_app->SetUserDisplayMode(UserDisplayMode::kBrowser);\n\n // Override the app in the expected registry.\n registry[sync_app->app_id()] = std::make_unique<WebApp>(*sync_app);\n }\n\n CommitUpdate(std::move(update));\n\n EXPECT_TRUE(sync_apps.empty());\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest, CommitUpdate_DeleteSyncApp) {\n AppsList sync_apps = CreateAppsList(\"https://example.com/\", 10);\n Registry registry;\n InsertAppsListIntoRegistry(®istry, sync_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n\n EXPECT_CALL(processor(), Put(_, _, _)).Times(0);\n ON_CALL(processor(), Delete(_, _))\n .WillByDefault([&](const std::string& storage_key,\n syncer::MetadataChangeList* metadata) {\n EXPECT_TRUE(base::Contains(registry, storage_key));\n RemoveWebAppFromAppsList(&sync_apps, storage_key);\n // Delete the app in the expected registry.\n registry.erase(storage_key);\n });\n\n std::unique_ptr<WebAppRegistryUpdate> update = sync_bridge().BeginUpdate();\n\n for (const std::unique_ptr<WebApp>& app : sync_apps)\n update->DeleteApp(app->app_id());\n\n CommitUpdate(std::move(update));\n\n EXPECT_TRUE(sync_apps.empty());\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest,\n CommitUpdate_CreateSyncAppWithOverlappingPolicyApp) {\n AppsList policy_apps;\n for (int i = 0; i < 10; ++i) {\n std::unique_ptr<WebApp> policy_app = test::CreateWebApp(\n GURL(\"https://example.com/\" + base::NumberToString(i)),\n WebAppManagement::kPolicy);\n policy_apps.push_back(std::move(policy_app));\n }\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, policy_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n\n ON_CALL(processor(), Put(_, _, _))\n .WillByDefault([&](const std::string& storage_key,\n std::unique_ptr<syncer::EntityData> entity_data,\n syncer::MetadataChangeList* metadata) {\n ASSERT_TRUE(base::Contains(registry, storage_key));\n const WebApp& expected_app = *registry.at(storage_key);\n\n // kPolicy and Name is the difference for the sync \"view\". Add them to\n // make operator== work.\n std::unique_ptr<WebApp> entity_data_app =\n std::make_unique<WebApp>(expected_app.app_id());\n entity_data_app->AddSource(WebAppManagement::kPolicy);\n entity_data_app->SetName(\"Name\");\n\n EXPECT_TRUE(IsSyncDataEqualIfApplied(\n expected_app, std::move(entity_data_app), *entity_data));\n\n RemoveWebAppFromAppsList(&policy_apps, storage_key);\n });\n EXPECT_CALL(processor(), Delete(_, _)).Times(0);\n\n std::unique_ptr<WebAppRegistryUpdate> update = sync_bridge().BeginUpdate();\n\n for (int i = 0; i < 10; ++i) {\n WebApp* app_to_update = update->UpdateApp(policy_apps[i]->app_id());\n\n // Add kSync source to first 5 apps. Modify the rest 5 apps locally.\n if (i < 5)\n app_to_update->AddSource(WebAppManagement::kSync);\n else\n app_to_update->SetDescription(\"Local policy app\");\n\n // Override the app in the expected registry.\n registry[app_to_update->app_id()] =\n std::make_unique<WebApp>(*app_to_update);\n }\n\n CommitUpdate(std::move(update));\n\n EXPECT_EQ(5u, policy_apps.size());\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\nTEST_F(WebAppSyncBridgeTest,\n CommitUpdate_DeleteSyncAppWithOverlappingPolicyApp) {\n AppsList policy_and_sync_apps;\n for (int i = 0; i < 10; ++i) {\n std::unique_ptr<WebApp> policy_and_sync_app = test::CreateWebApp(\n GURL(\"https://example.com/\" + base::NumberToString(i)));\n policy_and_sync_app->AddSource(WebAppManagement::kPolicy);\n policy_and_sync_app->AddSource(WebAppManagement::kSync);\n policy_and_sync_apps.push_back(std::move(policy_and_sync_app));\n }\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, policy_and_sync_apps);\n database_factory().WriteRegistry(registry);\n InitSyncBridge();\n\n ON_CALL(processor(), Put(_, _, _))\n .WillByDefault([&](const std::string& storage_key,\n std::unique_ptr<syncer::EntityData> entity_data,\n syncer::MetadataChangeList* metadata) {\n // Local changes to synced apps cause excessive |Put|.\n // See TODO in WebAppSyncBridge::UpdateSync.\n RemoveWebAppFromAppsList(&policy_and_sync_apps, storage_key);\n });\n ON_CALL(processor(), Delete(_, _))\n .WillByDefault([&](const std::string& storage_key,\n syncer::MetadataChangeList* metadata) {\n ASSERT_TRUE(base::Contains(registry, storage_key));\n RemoveWebAppFromAppsList(&policy_and_sync_apps, storage_key);\n });\n\n std::unique_ptr<WebAppRegistryUpdate> update = sync_bridge().BeginUpdate();\n\n for (int i = 0; i < 10; ++i) {\n WebApp* app_to_update =\n update->UpdateApp(policy_and_sync_apps[i]->app_id());\n\n // Remove kSync source from first 5 apps. Modify the rest 5 apps locally.\n if (i < 5)\n app_to_update->RemoveSource(WebAppManagement::kSync);\n else\n app_to_update->SetDescription(\"Local policy app\");\n\n // Override the app in the expected registry.\n registry[app_to_update->app_id()] =\n std::make_unique<WebApp>(*app_to_update);\n }\n\n CommitUpdate(std::move(update));\n\n EXPECT_TRUE(policy_and_sync_apps.empty());\n EXPECT_TRUE(IsRegistryEqual(registrar_registry(), registry));\n EXPECT_TRUE(IsDatabaseRegistryEqualToRegistrar());\n}\n\n// Test that any apps that are still pending install from sync (or,\n// |is_from_sync_and_pending_installation|) are continued to be installed when\n// the bridge initializes.\nTEST_F(WebAppSyncBridgeTest, InstallAppsFromSyncAndPendingInstallation) {\n AppsList apps_in_sync_install = CreateAppsList(\"https://example.com/\", 10);\n for (std::unique_ptr<WebApp>& app : apps_in_sync_install) {\n app->SetIsLocallyInstalled(AreAppsLocallyInstalledBySync());\n app->SetIsFromSyncAndPendingInstallation(true);\n }\n\n Registry registry;\n InsertAppsListIntoRegistry(®istry, apps_in_sync_install);\n database_factory().WriteRegistry(registry);\n\n base::RunLoop run_loop;\n install_manager().SetInstallWebAppsAfterSyncDelegateForTesting(\n base::BindLambdaForTesting(\n [&](std::vector<WebApp*> apps_to_install,\n WebAppInstallManager::RepeatingInstallCallback callback) {\n for (WebApp* app_to_install : apps_to_install) {\n // The app must be registered.\n EXPECT_TRUE(registrar().GetAppById(app_to_install->app_id()));\n RemoveWebAppFromAppsList(&apps_in_sync_install,\n app_to_install->app_id());\n }\n\n EXPECT_TRUE(apps_in_sync_install.empty());\n RunCallbacksOnInstall(\n apps_to_install, callback,\n webapps::InstallResultCode::kSuccessNewInstall);\n run_loop.Quit();\n }));\n\n InitSyncBridge();\n\n run_loop.Run();\n}\n\n// Tests that OnWebAppsWillBeUpdatedFromSync observer notification is called\n// properly.\nTEST_F(WebAppSyncBridgeTest, ApplySyncChanges_OnWebAppsWillBeUpdatedFromSync) {\n AppsList initial_registry_apps = CreateAppsList(\"https://example.com/\", 10);\n for (std::unique_ptr<WebApp>& app : initial_registry_apps)\n app->SetUserDisplayMode(UserDisplayMode::kBrowser);\n InitSyncBridgeFromAppList(initial_registry_apps);\n\n WebAppTestRegistryObserverAdapter observer{®istrar()};\n base::RunLoop run_loop;\n\n observer.SetWebAppWillBeUpdatedFromSyncDelegate(base::BindLambdaForTesting(\n [&](const std::vector<const WebApp*>& new_apps_state) {\n EXPECT_EQ(5u, new_apps_state.size());\n\n for (const WebApp* new_app_state : new_apps_state) {\n const WebApp* old_app_state =\n registrar().GetAppById(new_app_state->app_id());\n EXPECT_NE(*old_app_state, *new_app_state);\n\n EXPECT_EQ(old_app_state->user_display_mode(),\n UserDisplayMode::kBrowser);\n EXPECT_EQ(new_app_state->user_display_mode(),\n UserDisplayMode::kStandalone);\n\n // new and old states must be equal if diff fixed:\n auto old_app_state_no_diff = std::make_unique<WebApp>(*old_app_state);\n old_app_state_no_diff->SetUserDisplayMode(\n UserDisplayMode::kStandalone);\n EXPECT_EQ(*old_app_state_no_diff, *new_app_state);\n\n RemoveWebAppFromAppsList(&initial_registry_apps,\n new_app_state->app_id());\n }\n\n run_loop.Quit();\n }));\n\n AppsList apps_server_state;\n\n // Update first 5 apps: change user_display_mode field only.\n for (int i = 0; i < 5; ++i) {\n auto app_server_state = std::make_unique<WebApp>(*initial_registry_apps[i]);\n app_server_state->SetUserDisplayMode(UserDisplayMode::kStandalone);\n apps_server_state.push_back(std::move(app_server_state));\n }\n\n sync_bridge_test_utils::UpdateApps(sync_bridge(), apps_server_state);\n\n run_loop.Run();\n\n // 5 other apps left unchanged:\n EXPECT_EQ(5u, initial_registry_apps.size());\n for (int i = 0; i < 5; ++i) {\n EXPECT_EQ(UserDisplayMode::kBrowser,\n initial_registry_apps[i]->user_display_mode());\n }\n}\n\nTEST_F(WebAppSyncBridgeTest, RetryIncompleteUninstalls) {\n AppsList initial_registry_apps = CreateAppsList(\"https://example.com/\", 5);\n std::vector<AppId> initial_app_ids;\n for (std::unique_ptr<WebApp>& app : initial_registry_apps) {\n app->SetUserDisplayMode(UserDisplayMode::kBrowser);\n app->SetIsUninstalling(true);\n initial_app_ids.push_back(app->app_id());\n }\n\n SetSyncInstallDelegateFailureIfCalled();\n\n base::RunLoop run_loop;\n install_manager().SetRetryIncompleteUninstallsDelegateForTesting(\n base::BindLambdaForTesting(\n [&](const base::flat_set<AppId>& apps_to_uninstall) {\n EXPECT_EQ(apps_to_uninstall.size(), 5ul);\n EXPECT_THAT(apps_to_uninstall, ::testing::UnorderedElementsAreArray(\n apps_to_uninstall));\n run_loop.Quit();\n }));\n\n InitSyncBridgeFromAppList(initial_registry_apps);\n\n run_loop.Run();\n}\n\n} // namespace web_app\n", "meta": {"content_hash": "54bebc8b5973ec66e042af23c143900f", "timestamp": "", "source": "github", "line_count": 1267, "max_line_length": 82, "avg_line_length": 37.45067087608524, "alnum_prop": 0.6689567966280295, "repo_name": "chromium/chromium", "id": "fbd66c1e0682c6af25ffe98aac26e6763dc21cad", "size": "47450", "binary": false, "copies": "5", "ref": "refs/heads/main", "path": "chrome/browser/web_applications/web_app_sync_bridge_unittest.cc", "mode": "33188", "license": "bsd-3-clause", "language": []}} +{"text": "import re\nimport numpy\nfrom datetime import datetime\n\nfrom processing_components.visibility.msv2supp import cmp_to_total, STOKES_CODES, NUMERIC_STOKES, merge_baseline, \\\n geo_to_ecef, get_eci_transform\n\nfrom data_models.memory_data_models import Visibility, BlockVisibility, Configuration\n\nimport logging\n\nlog = logging.getLogger(__name__)\n\n__version__ = '0.1'\n__revision__ = '$Rev$'\n__all__ = ['STOKES_CODES', 'NUMERIC_STOKES', 'Stand', 'Observatory', 'Antenna', 'BaseData']\n\ntry:\n from casacore.tables import table, tableutil\n\n\n @cmp_to_total\n class Stand(object):\n \"\"\"\n Object to store the information (location and ID) about a stand.\n Stores stand:\n * ID number (id)\n * Position relative to the center stake in meters (x,y,z)\n\n The x, y, and z positions can also be accessed through subscripts:\n Stand[0] = x\n Stand[1] = y\n Stand[2] = z\n \"\"\"\n\n def __init__(self, id, x, y, z):\n self.id = id\n self.x = float(x)\n self.y = float(y)\n self.z = float(z)\n\n def __lt__(self, y):\n if self.id < y.id:\n return True\n else:\n return False\n\n def __le__(self, y):\n if self.id <= y.id:\n return True\n else:\n return False\n\n def __eq__(self, y):\n if self.id == y.id:\n return True\n else:\n return False\n\n def __gt__(self, y):\n if self.id > y.id:\n return True\n else:\n return False\n\n def __ge__(self, y):\n if self.id >= y.id:\n return True\n else:\n return False\n\n def __cmp__(self, y):\n if self.id > y.id:\n return 1\n elif self.id < y.id:\n return -1\n else:\n return 0\n\n def __str__(self):\n return \"Stand %i: x=%+.2f m, y=%+.2f m, z=%+.2f m\" % (self.id, self.x, self.y, self.z)\n\n def __reduce__(self):\n return (Stand, (self.id, self.x, self.y, self.z))\n\n def __getitem__(self, key):\n if key == 0:\n return self.x\n elif key == 1:\n return self.y\n elif key == 2:\n return self.z\n else:\n raise ValueError(\"Subscript %i out of range\" % key)\n\n def __setitem__(self, key, value):\n if key == 0:\n self.x = float(value)\n elif key == 1:\n self.y = float(value)\n elif key == 2:\n self.z = float(value)\n else:\n raise ValueError(\"Subscript %i out of range\" % key)\n\n def __add__(self, std):\n try:\n # If its a Stand instance, do this\n out = (self.x + std.x, self.y + std.y, self.z + std.z)\n except AttributeError:\n try:\n # Maybe it is a list/tuple, so do this\n out = (self.x + std[0], self.y + std[1], self.z + std[2])\n except TypeError:\n out = (self.x + std, self.y + std, self.z + std)\n\n return out\n\n def __sub__(self, std):\n try:\n # If its a Stand instance, do this\n out = (self.x - std.x, self.y - std.y, self.z - std.z)\n except AttributeError:\n try:\n # Maybe it is a list/tuple, so do this\n out = (self.x - std[0], self.y - std[1], self.z - std[2])\n except TypeError:\n out = (self.x - std, self.y - std, self.z - std)\n\n return out\n\n\n class Observatory(object):\n def __init__(self, name, lon, lat, alt):\n self.name = name\n self.lon = lon\n self.lat = lat\n self.alt = alt\n\n\n class Antenna(object):\n \"\"\"\n Object to store the information about an antenna. Stores antenna:\n * ID number (id)\n * Stand instance the antenna is part of (stand)\n * Polarization (0 == N-S; pol)\n * Antenna vertical mis-alignment in degrees (theta)\n * Antenna rotation mis-alignment in degrees (phi)\n * Fee instance the antenna is attached to (fee)\n * Port of the FEE used for the antenna (feePort)\n * Cable instance used to connect the antenna (cable)\n\n Some arguments are designed for future extension\n\n \"\"\"\n\n def __init__(self, id, stand=None, pol=0, theta=0.0, phi=0.0,\n fee=None, feePort=1, cable=None):\n self.id = int(id)\n\n if stand is None:\n self.stand = Stand(0, 0, 0, 0)\n else:\n self.stand = stand\n\n self.pol = int(pol)\n self.theta = float(theta)\n self.phi = float(phi)\n\n self.FEE = fee\n self.feePort = feePort\n\n self.cable = cable\n\n def __str__(self):\n return \"Antenna %i: stand=%i, polarization=%i; \" % (self.id, self.stand.id, self.pol)\n\n def __reduce__(self):\n return (Antenna, (\n self.id, self.stand, self.pol, self.theta, self.phi, self.fee, self.feePort, self.cable))\n\n def __lt__(self, y):\n if self.id < y.id:\n return True\n else:\n return False\n\n def __le__(self, y):\n if self.id <= y.id:\n return True\n else:\n return False\n\n def __eq__(self, y):\n if self.id == y.id:\n return True\n else:\n return False\n\n def __gt__(self, y):\n if self.id > y.id:\n return True\n else:\n return False\n\n def __ge__(self, y):\n if self.id >= y.id:\n return True\n else:\n return False\n\n def __cmp__(self, y):\n if self.id > y.id:\n return 1\n elif self.id < y.id:\n return -1\n else:\n return 0\n\n\n class Frequency:\n \"\"\"\n Information about the frequency setup used in the file.\n \"\"\"\n\n def __init__(self, bandFreq, channelWidth, bandwidth):\n self.id = 1\n self.bandFreq = bandFreq\n self.chWidth = channelWidth\n self.totalBW = bandwidth\n self.sideBand = 1\n self.baseBand = 0\n\n\n @cmp_to_total\n class MS_UVData(object):\n \"\"\"\n UV visibility data set for a given observation time.\n \"\"\"\n\n def __init__(self, obstime, inttime, baselines, visibilities, weights=None, pol=STOKES_CODES['XX'], source=None,\n phasecentre=None, uvw=None):\n self.obstime = obstime\n self.inttime = inttime\n self.baselines = baselines\n self.visibilities = visibilities\n self.weights = weights\n self.pol = pol\n self.source = source\n self.phasecentre = phasecentre\n self.uvw = uvw\n\n def __lt__(self, y):\n sID = (self.obstime, abs(self.pol))\n yID = (y.obstime, abs(y.pol))\n if sID > yID:\n return False\n else:\n return True\n\n def __le__(self, y):\n sID = (self.obstime, abs(self.pol))\n yID = (y.obstime, abs(y.pol))\n if sID <= yID:\n return True\n else:\n return False\n\n def __ge__(self, y):\n sID = (self.obstime, abs(self.pol))\n yID = (y.obstime, abs(y.pol))\n if sID >= yID:\n return True\n else:\n return False\n\n def __gt__(self, y):\n sID = (self.obstime, abs(self.pol))\n yID = (y.obstime, abs(y.pol))\n if sID < yID:\n return False\n else:\n return True\n\n def __eq__(self, y):\n sID = (self.obstime, abs(self.pol))\n yID = (y.obstime, abs(y.pol))\n if sID == yID:\n return True\n else:\n return False\n\n def __cmp__(self, y):\n \"\"\"\n Function to sort the self.data list in order of time and then\n polarization code.\n \"\"\"\n\n sID = (self.obstime, abs(self.pol))\n yID = (y.obstime, abs(y.pol))\n\n if sID > yID:\n return 1\n elif sID < yID:\n return -1\n else:\n return 0\n\n def time(self):\n return self.obstime\n\n def get_uvw(self, HA, dec, obs):\n\n Nbase = len(self.baselines)\n uvw = numpy.zeros((Nbase, 3), dtype=numpy.float32)\n\n # Phase center coordinates\n # Convert numbers to radians and, for HA, hours to degrees\n HA2 = HA * 15.0 * numpy.pi / 180\n dec2 = dec * numpy.pi / 180\n lat2 = obs.location.geodetic[1].to('rad').value\n\n # Coordinate transformation matrices\n trans1 = numpy.array([[0, -numpy.sin(lat2), numpy.cos(lat2)],\n [1, 0, 0],\n [0, numpy.cos(lat2), numpy.sin(lat2)]])\n trans2 = numpy.array([[numpy.sin(HA2), numpy.cos(HA2), 0],\n [-numpy.sin(dec2) * numpy.cos(HA2), numpy.sin(dec2) * numpy.sin(HA2),\n numpy.cos(dec2)],\n [numpy.cos(dec2) * numpy.cos(HA2), -numpy.cos(dec2) * numpy.sin(HA2),\n numpy.sin(dec2)]])\n\n for i, (a1, a2) in enumerate(self.baselines):\n # Go from a east, north, up coordinate system to a celestial equation,\n # east, north celestial pole system\n xyzPrime = a1.stand - a2.stand\n xyz = trans1 @ numpy.array([[xyzPrime[0]], [xyzPrime[1]], [xyzPrime[2]]])\n\n # Go from CE, east, NCP to u, v, w\n temp = trans2 @ xyz\n uvw[i, :] = numpy.squeeze(temp) # / speed_of_light\n\n return uvw\n\n def argsort(self, mapper=None, shift=16):\n packed = []\n for a1, a2 in self.baselines:\n if mapper is None:\n s1, s2 = a1.stand.id, a2.stand.id\n else:\n s1, s2 = mapper.index(a1.stand.id), mapper.index(a2.stand.id)\n packed.append(merge_baseline(s1, s2, shift=shift))\n packed = numpy.array(packed, dtype=numpy.int32)\n\n return numpy.argsort(packed)\n\n\n class BaseData(object):\n \"\"\"\n Base Data class: For an observation of interferometer, we should have:\n Antenna, Frequency, Visibility Funcation, UVW\n \"\"\"\n\n _MAX_ANTS = 255\n _PACKING_BIT_SHIFT = 8\n _STOKES_CODES = STOKES_CODES\n\n class _Antenna(object):\n \"\"\"\n Holds information describing the location and properties of an antenna.\n \"\"\"\n\n def __init__(self, id, x, y, z, bits=8, name=None):\n self.id = id\n self.x = x\n self.y = y\n self.z = z\n self.levels = bits\n self.name = name\n\n def getName(self):\n if self.name is None:\n if isinstance(self.id, str):\n return self.id\n else:\n return \"AT%03i\" % self.id\n else:\n return self.name\n\n def parse_time(self, ref_time):\n \"\"\"\n Given a time as either a integer, float, string, or datetime object,\n convert it to a string in the formation 'YYYY-MM-DDTHH:MM:SS'.\n \"\"\"\n\n # Valid time string (modulo the 'T')\n timeRE = re.compile(r'\\d{4}-\\d{2}-\\d{2}[ T]\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?')\n\n if type(ref_time) in (int, float):\n refDateTime = datetime.utcfromtimestamp(ref_time)\n ref_time = refDateTime.strftime(\"%Y-%m-%dT%H:%M:%S\")\n elif type(ref_time) == datetime:\n ref_time = ref_time.strftime(\"%Y-%m-%dT%H:%M:%S\")\n elif type(ref_time) == str:\n # Make sure that the string times are of the correct format\n if re.match(timeRE, ref_time) is None:\n raise RuntimeError(\"Malformed date/time provided: %s\" % ref_time)\n else:\n ref_time = ref_time.replace(' ', 'T', 1)\n else:\n raise RuntimeError(\"Unknown time format provided.\")\n\n return ref_time\n\n def __init__(self, filename, ref_time=0.0, source_name = None, frame='ITRF', verbose=False):\n # File-specific information\n self.filename = filename\n self.verbose = verbose\n self.site_config = None\n # Observatory-specific information\n self.siteName = 'Unknown'\n self.frame = frame\n self.source_name = source_name\n\n # Observation-specific information\n self.ref_time = self.parse_time(ref_time)\n self.nant = 0\n self.nchan = 0\n self.nstokes = 0\n self.refVal = 0\n self.refPix = 0\n self.channel_width = 0\n\n # Parameters that store the meta-data and data\n self.array = []\n self.freq = []\n self.stokes = []\n self.data = []\n self.uvw_arl = None\n\n def __enter__(self):\n return self\n\n def __exit__(self, type, value, tb):\n self.write()\n self.close()\n\n def set_stokes(self, polList):\n \"\"\"\n Given a list of Stokes parameters, update the object's parameters.\n \"\"\"\n\n for pol in polList:\n if type(pol) == str:\n numericPol = self._STOKES_CODES[pol.upper()]\n else:\n numericPol = pol\n\n if numericPol not in self.stokes:\n self.stokes.append(numericPol)\n\n # Sort into order of 'XX', 'YY', 'XY', and 'YX' or 'I', 'Q', 'U', and 'V'\n self.stokes.sort()\n if self.stokes[0] < 0:\n self.stokes.reverse()\n\n self.nStokes = len(self.stokes)\n\n def set_frequency(self, freq, channel_width):\n \"\"\"\n Given a numpy array of frequencies, set the relevant common observation\n parameters and add an entry to the self.freq list.\n \"\"\"\n if self.nchan == 0:\n self.nchan = len(freq)\n self.refVal = freq[0]\n self.refPix = 1\n self.channelWidth = channel_width[0]\n offset = 0.0\n else:\n assert (len(freq) == self.nchan)\n offset = freq[0] - self.refVal\n self.channelWidth = channel_width[0]\n\n if self.nchan == 1:\n totalWidth = self.channel_width\n else:\n totalWidth = numpy.abs(freq[-1] - freq[0])\n\n freqSetup = Frequency(offset, self.channelWidth, totalWidth)\n self.freq.append(freqSetup)\n\n def set_geometry(self, *args, **kwds):\n \"\"\"\n Given a station and an array of stands, set the relevant common observation\n parameters and add entries to the self.array list.\n \"\"\"\n\n raise NotImplementedError\n\n def add_data_set(self, obstime, inttime, baselines, visibilities, weights=None, pol='XX', source=None):\n \"\"\"\n Create a UVData object to store a collection of visibilities.\n\n \"\"\"\n\n if type(pol) == str:\n numericPol = self._STOKES_CODES[pol.upper()]\n else:\n numericPol = pol\n\n self.data.append(\n MS_UVData(obstime, inttime, baselines, visibilities, weights=weights, pol=numericPol, source=source))\n\n def write(self):\n \"\"\"\n Fill in the file will all of the required supporting metadata.\n \"\"\"\n\n raise NotImplementedError\n\n def close(self):\n \"\"\"\n Close out the file.\n \"\"\"\n\n raise NotImplementedError\n\nexcept ImportError:\n import warnings\n\n warnings.warn('Cannot import casacore.tables, MS support disabled', ImportWarning)\n\n raise RuntimeError(\"Cannot import casacore.tables, MS support disabled\")\n", "meta": {"content_hash": "6d3ad0b6118aa05109b83f1030fd1736", "timestamp": "", "source": "github", "line_count": 534, "max_line_length": 120, "avg_line_length": 31.49063670411985, "alnum_prop": 0.47127735490009515, "repo_name": "SKA-ScienceDataProcessor/algorithm-reference-library", "id": "3f3c4c4574b55fffee85f94d95adc6091da337d9", "size": "16883", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "processing_components/visibility/msv2fund.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "171056"}, {"name": "C++", "bytes": "520"}, {"name": "Dockerfile", "bytes": "4686"}, {"name": "Java", "bytes": "748"}, {"name": "Jupyter Notebook", "bytes": "8158663"}, {"name": "Makefile", "bytes": "19263"}, {"name": "Nix", "bytes": "3599"}, {"name": "Python", "bytes": "1854561"}, {"name": "Shell", "bytes": "73453"}, {"name": "Smarty", "bytes": "1057"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2013 The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n\n<android.support.v7.internal.widget.FitWindowsLinearLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:id=\"@+id/action_bar_root\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"vertical\"\n android:fitsSystemWindows=\"true\">\n\n <android.support.v7.internal.widget.ViewStubCompat\n android:id=\"@+id/action_mode_bar_stub\"\n android:inflatedId=\"@+id/action_mode_bar\"\n android:layout=\"@layout/abc_action_mode_bar\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\" />\n\n <include layout=\"@layout/abc_screen_content_include\" />\n\n</android.support.v7.internal.widget.FitWindowsLinearLayout>\n<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-sdk-release/frameworks/support/v7/appcompat/res/layout/abc_screen_simple.xml --><!-- From: file:/Users/bkon4208/Documents/workspace/AdMobBannerProject/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/layout/abc_screen_simple.xml -->", "meta": {"content_hash": "0b3fe933491fdae92b8b2aebfec338b0", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 392, "avg_line_length": 51.371428571428574, "alnum_prop": 0.7352614015572859, "repo_name": "billykonesavanh17/AdMobBannerProject", "id": "c536baec71f76e57930367fd23ece7fdb9ec601b", "size": "1798", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/build/intermediates/res/merged/debug/layout/abc_screen_simple.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "500974"}]}} +{"text": "DIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" >/dev/null 2>&1 && pwd )\"\n\n####################\n# GLOBAL VARIABLES #\n####################\n\nTEST_EXIT_CODE=0\nCAT_FILE_LIST=\"\"\n\n#######################\n# AUXILIARY FUNCTIONS #\n#######################\n\nfunction cookbook_check\n{\n TEST_RESULT=$?\n TEST_CASE=$1\n TEST_CASE_DETAILS=$2\n CAT_FILE=$3\n\n if [ \"$TEST_RESULT\" -ne \"0\" ]\n then\n echo \"ERROR: $TEST_CASE $TEST_CASE_DETAILS\"\n TEST_EXIT_CODE=1\n if [ \"$CAT_FILE\" != \"\" ]\n then\n CAT_FILE_LIST=\"$CAT_FILE_LIST $CAT_FILE\"\n fi\n else\n echo \"PASS: $TEST_CASE $TEST_CASE_DETAILS\"\n fi\n}\n\nfunction simple_testcase\n{\n TESTCASE=$1\n LOGFILE=${TESTCASE,,}.log\n ./bin/${TESTCASE,,} \\\n >& ./log/$LOGFILE\n cookbook_check \"$TESTCASE\" \"(run check)\"\n\n diff ./ref/$LOGFILE ./log/$LOGFILE >& ./log/diff_$LOGFILE\n cookbook_check \"$TESTCASE\" \"(logfile check)\" \"./log/diff_$LOGFILE\"\n}\n\nfunction check_wavinfo\n{\n TESTCASE=$1\n WAVFILE=$2\n\n LOGFILE=${TESTCASE,,}_wavinfo.log\n wavinfo ./out/$WAVFILE >& ./log/$LOGFILE\n cookbook_check \"$TESTCASE\" \"(wavinfo)\"\n\n diff ./ref/$LOGFILE ./log/$LOGFILE >& ./log/diff_$LOGFILE\n cookbook_check \"$TESTCASE\" \"(wavinfo logfile check)\" \"./log/diff_$LOGFILE\"\n}\n\nfunction check_wavefile\n{\n TESTCASE=$1\n WAVFILE=$2\n\n LOGFILE=${TESTCASE,,}.log\n\n diff ./ref/$WAVFILE ./out/$WAVFILE >& ./log/diff_$LOGFILE\n cookbook_check \"$TESTCASE\" \"(wavfile check)\" \"\"\n}\n\nfunction cleanup_data\n{\n rm log/*\n rm out/*\n rm src/*\n rm cookbook.ada\n}\n\n################\n# PREPARATIONS #\n################\n\n# Change to cookbook directory\ncd $DIR/../cookbook\n\n# Create .ada file based on Markdown file\nsed -n '/^~~~~~~~~~~/,/^~~~~~~~~~~/ p' < cookbook.md | sed '/^~~~~~~~~~~/ d' > cookbook.ada\ncookbook_check \"PREPARATIONS\" \"(sed)\" \"\"\n\n# Create source-code files based on cookbook file\ngnatchop -wr cookbook.ada ./src >& ./log/gnatchop.log\ncookbook_check \"PREPARATIONS\" \"(gnatchop)\" \"./log/gnatchop.log\"\n\n# Set GPR environment variable\nAUDIO_WAVEFILES_PATH=$(cd .. && pwd)\nif [ -z \"$GPR_PROJECT_PATH\" ]\nthen\n export GPR_PROJECT_PATH=${AUDIO_WAVEFILES_PATH}\nelse\n export GPR_PROJECT_PATH=\"${GPR_PROJECT_PATH}:${AUDIO_WAVEFILES_PATH}\"\nfi\necho \"GPR_PROJECT_PATH = $GPR_PROJECT_PATH\" >& ./log/gprbuild_env.log\n\n# Build application for each source-code file\ngprbuild ./cookbook.gpr >& ./log/gprbuild.log\ncookbook_check \"PREPARATIONS\" \"(gprbuild)\" \"./log/gprbuild.log\"\n\n##############\n# RUN & TEST #\n##############\n\nsimple_testcase Open_Close_Wavefile_For_Reading\n\nsimple_testcase Open_Close_Wavefile_For_Writing\ncheck_wavinfo Open_Close_Wavefile_For_Writing \"test.wav\"\n\nsimple_testcase Display_Errors_For_Wavefiles\n\nsimple_testcase List_Errors_For_Wavefiles\n\nsimple_testcase Display_RIFF_Chunks\n\nsimple_testcase Read_Display_Wavefile_Data\n\nsimple_testcase Write_Mono_Silence_Wavefile\ncheck_wavinfo Write_Mono_Silence_Wavefile \"1ch_silence.wav\"\ncheck_wavefile Write_Mono_Silence_Wavefile \"1ch_silence.wav\"\n\nsimple_testcase Write_Stereo_Sine_Wavefile\ncheck_wavinfo Write_Stereo_Sine_Wavefile \"2ch_sine.wav\"\ncheck_wavefile Write_Stereo_Sine_Wavefile \"2ch_sine.wav\"\n\nsimple_testcase Write_5_1_Channel_Sine_Wavefile\ncheck_wavinfo Write_5_1_Channel_Sine_Wavefile \"5_1ch_sine.wav\"\ncheck_wavefile Write_5_1_Channel_Sine_Wavefile \"5_1ch_sine.wav\"\n\nsimple_testcase Write_7_1_4_Channel_Sine_Wavefile\ncheck_wavinfo Write_7_1_4_Channel_Sine_Wavefile \"7_1_4ch_sine.wav\"\ncheck_wavefile Write_7_1_4_Channel_Sine_Wavefile \"7_1_4ch_sine.wav\"\n\nsimple_testcase Display_Channel_Config\n\nsimple_testcase Append_Wavefile\ncheck_wavinfo Append_Wavefile \"2ch_sine_append.wav\"\ncheck_wavefile Append_Wavefile \"2ch_sine_append.wav\"\n\nsimple_testcase Copy_Wavefile\ncheck_wavinfo Copy_Wavefile \"2ch_sine.wav\"\ncheck_wavefile Copy_Wavefile \"2ch_sine.wav\"\n\nsimple_testcase Copy_Wavefile_Using_Fixed_Point_Buffer\ncheck_wavinfo Copy_Wavefile_Using_Fixed_Point_Buffer \"2ch_sine.wav\"\ncheck_wavefile Copy_Wavefile_Using_Fixed_Point_Buffer \"2ch_sine.wav\"\n\nsimple_testcase Copy_Parts_Of_Wavefile\ncheck_wavinfo Copy_Parts_Of_Wavefile \"looped_clip.wav\"\ncheck_wavefile Copy_Parts_Of_Wavefile \"looped_clip.wav\"\n\nsimple_testcase Convert_Fixed_To_Float_Wavefile\ncheck_wavinfo Convert_Fixed_To_Float_Wavefile \"2ch_float_sine.wav\"\ncheck_wavefile Convert_Fixed_To_Float_Wavefile \"2ch_float_sine.wav\"\n\nsimple_testcase Downmix_Stereo_To_Mono_Wavefile\ncheck_wavinfo Downmix_Stereo_To_Mono_Wavefile \"1ch_dmx_sine.wav\"\ncheck_wavefile Downmix_Stereo_To_Mono_Wavefile \"1ch_dmx_sine.wav\"\n\nsimple_testcase Downmix_5_1_To_2_0_Wavefile\ncheck_wavinfo Downmix_5_1_To_2_0_Wavefile \"2_0ch_dmx_sine.wav\"\ncheck_wavefile Downmix_5_1_To_2_0_Wavefile \"2_0ch_dmx_sine.wav\"\n\nsimple_testcase Downmix_7_1_4_To_5_1_Wavefile\ncheck_wavinfo Downmix_7_1_4_To_5_1_Wavefile \"5_1ch_dmx_sine.wav\"\ncheck_wavefile Downmix_7_1_4_To_5_1_Wavefile \"5_1ch_dmx_sine.wav\"\n\nsimple_testcase Direct_Copy_Wavefile\ncheck_wavinfo Direct_Copy_Wavefile \"2ch_sine.wav\"\ncheck_wavefile Direct_Copy_Wavefile \"2ch_sine.wav\"\n\nsimple_testcase Direct_Copy_Float_Wavefile\ncheck_wavinfo Direct_Copy_Float_Wavefile \"2ch_float_sine.wav\"\ncheck_wavefile Direct_Copy_Float_Wavefile \"2ch_float_sine.wav\"\n\nsimple_testcase Convert_8_Bit_To_16_Bit_Wavefile\n\nsimple_testcase Read_To_Memory_Channel_Interleaved\n\nsimple_testcase Read_To_Memory_Per_Channel\n\nsimple_testcase Extract_XML_Chunk\ncheck_wavefile Extract_XML_Chunk \"2020-08-09.xml\"\n\n################\n# FINALIZATION #\n################\n\nif [ \"$CAT_FILE_LIST\" != \"\" ]\nthen\n for cat_file in $CAT_FILE_LIST\n do\n echo \"------------------------------------------\"\n echo $cat_file\n echo \"------------------------------------------\"\n cat $cat_file\n done\nfi\n\n# cleanup_data\n\nexit $TEST_EXIT_CODE\n", "meta": {"content_hash": "1ce080d3dc6a98a90c4e981a1b568724", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 91, "avg_line_length": 29.677884615384617, "alnum_prop": 0.635995464117933, "repo_name": "gusthoff/wavefiles", "id": "7723f6afa09dbc841a634536f01dbccbb219150c", "size": "6186", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "scripts/test_cookbook.sh", "mode": "33261", "license": "mit", "language": [{"name": "Ada", "bytes": "452266"}, {"name": "PowerShell", "bytes": "263"}, {"name": "Shell", "bytes": "12387"}]}} +{"text": "\ufeffnamespace TestRoom\n{\n partial class Mainform\n {\n /// <summary>\n /// Required designer variable.\n /// </summary>\n private System.ComponentModel.IContainer components = null;\n\n /// <summary>\n /// Clean up any resources being used.\n /// </summary>\n /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n protected override void Dispose(bool disposing)\n {\n if (disposing && (components != null))\n {\n components.Dispose();\n }\n base.Dispose(disposing);\n }\n\n #region Windows Form Designer generated code\n\n /// <summary>\n /// Required method for Designer support - do not modify\n /// the contents of this method with the code editor.\n /// </summary>\n private void InitializeComponent()\n {\n this.bTestVirtualDesktop = new System.Windows.Forms.Button();\n this.bTestLoaderService = new System.Windows.Forms.Button();\n this.bWcf = new System.Windows.Forms.Button();\n this.bTestCfg = new System.Windows.Forms.Button();\n this.bShowTaskbar = new System.Windows.Forms.Button();\n this.SuspendLayout();\n // \n // bTestVirtualDesktop\n // \n this.bTestVirtualDesktop.Location = new System.Drawing.Point(12, 12);\n this.bTestVirtualDesktop.Name = \"bTestVirtualDesktop\";\n this.bTestVirtualDesktop.Size = new System.Drawing.Size(151, 23);\n this.bTestVirtualDesktop.TabIndex = 0;\n this.bTestVirtualDesktop.Text = \"Test Virtual Desktop\";\n this.bTestVirtualDesktop.UseVisualStyleBackColor = true;\n this.bTestVirtualDesktop.Click += new System.EventHandler(this.bTestVirtualDesktop_Click);\n // \n // bTestLoaderService\n // \n this.bTestLoaderService.Location = new System.Drawing.Point(12, 41);\n this.bTestLoaderService.Name = \"bTestLoaderService\";\n this.bTestLoaderService.Size = new System.Drawing.Size(151, 23);\n this.bTestLoaderService.TabIndex = 1;\n this.bTestLoaderService.Text = \"Test Loader Service\";\n this.bTestLoaderService.UseVisualStyleBackColor = true;\n this.bTestLoaderService.Click += new System.EventHandler(this.bTestLoaderService_Click);\n // \n // bWcf\n // \n this.bWcf.Location = new System.Drawing.Point(12, 70);\n this.bWcf.Name = \"bWcf\";\n this.bWcf.Size = new System.Drawing.Size(151, 23);\n this.bWcf.TabIndex = 1;\n this.bWcf.Text = \"Test Wcf\";\n this.bWcf.UseVisualStyleBackColor = true;\n this.bWcf.Click += new System.EventHandler(this.bWcf_Click);\n // \n // bTestCfg\n // \n this.bTestCfg.Location = new System.Drawing.Point(12, 99);\n this.bTestCfg.Name = \"bTestCfg\";\n this.bTestCfg.Size = new System.Drawing.Size(151, 23);\n this.bTestCfg.TabIndex = 2;\n this.bTestCfg.Text = \"Test Cfg\";\n this.bTestCfg.UseVisualStyleBackColor = true;\n this.bTestCfg.Click += new System.EventHandler(this.bTestCfg_Click);\n // \n // bShowTaskbar\n // \n this.bShowTaskbar.Location = new System.Drawing.Point(12, 128);\n this.bShowTaskbar.Name = \"bShowTaskbar\";\n this.bShowTaskbar.Size = new System.Drawing.Size(151, 23);\n this.bShowTaskbar.TabIndex = 3;\n this.bShowTaskbar.Text = \"Show Taskbar\";\n this.bShowTaskbar.UseVisualStyleBackColor = true;\n this.bShowTaskbar.Click += new System.EventHandler(this.bShowTaskbar_Click);\n // \n // Mainform\n // \n this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n this.ClientSize = new System.Drawing.Size(863, 629);\n this.Controls.Add(this.bShowTaskbar);\n this.Controls.Add(this.bTestCfg);\n this.Controls.Add(this.bWcf);\n this.Controls.Add(this.bTestLoaderService);\n this.Controls.Add(this.bTestVirtualDesktop);\n this.Name = \"Mainform\";\n this.Text = \"Test Room\";\n this.ResumeLayout(false);\n\n }\n\n #endregion\n\n private System.Windows.Forms.Button bTestVirtualDesktop;\n private System.Windows.Forms.Button bTestLoaderService;\n private System.Windows.Forms.Button bWcf;\n private System.Windows.Forms.Button bTestCfg;\n private System.Windows.Forms.Button bShowTaskbar;\n }\n}\n\n", "meta": {"content_hash": "dfc221bf8b71e360c8de79de84758c17", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 107, "avg_line_length": 42.52212389380531, "alnum_prop": 0.591675338189386, "repo_name": "mind0n/hive", "id": "854d2b0f2ef2af882166f1affe4850744d472e36", "size": "4807", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Product/Server/HostNode/Joy/TestRoom/Mainform.Designer.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "670329"}, {"name": "ActionScript", "bytes": "7830"}, {"name": "ApacheConf", "bytes": "47"}, {"name": "Batchfile", "bytes": "18096"}, {"name": "C", "bytes": "19746409"}, {"name": "C#", "bytes": "258148996"}, {"name": "C++", "bytes": "48534520"}, {"name": "CSS", "bytes": "933736"}, {"name": "ColdFusion", "bytes": "10780"}, {"name": "GLSL", "bytes": "3935"}, {"name": "HTML", "bytes": "4631854"}, {"name": "Java", "bytes": "10881"}, {"name": "JavaScript", "bytes": "10250558"}, {"name": "Logos", "bytes": "1526844"}, {"name": "MAXScript", "bytes": "18182"}, {"name": "Mathematica", "bytes": "1166912"}, {"name": "Objective-C", "bytes": "2937200"}, {"name": "PHP", "bytes": "81898"}, {"name": "Perl", "bytes": "9496"}, {"name": "PowerShell", "bytes": "44339"}, {"name": "Python", "bytes": "188058"}, {"name": "Shell", "bytes": "758"}, {"name": "Smalltalk", "bytes": "5818"}, {"name": "TypeScript", "bytes": "50090"}]}} +{"text": "DIRECTORY=$(dirname $0)\nPROGRAM=$(basename $0)\nNEWLINE=$'\\n'\n\n# define the error function\nfunction die {\n echo \"$1\" 1>&2\n exit 1\n}\n\n# make sure that the right number of command line arguments were passed in\ntest $# -eq 4 || die \"Usage: ${PROGRAM} <environment name> <client name> <ca directory path> <subject> ${NEWLINE}Example: ${PROGRAM} Sandbox CoffeeBucks /some/secret/path/ 'CN=http://acmecoffee.com,O=Acme Coffee,C=US'\"\n\n# generate a new client certificate keystore for the environment\njava -classpath \"${DIRECTORY}/../lib/*\" craterdog.security.ClientCertificateGenerator \"$@\"", "meta": {"content_hash": "4a8ba3c4aef6d644be6c45f041aa9399", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 218, "avg_line_length": 39.2, "alnum_prop": 0.7193877551020408, "repo_name": "craterdog/java-security-framework", "id": "a6095600be7fd198c51910efc14b7e7002365e60", "size": "2007", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "java-certificate-generation/src/main/scripts/generate-client-certificate.sh", "mode": "33261", "license": "mit", "language": [{"name": "Java", "bytes": "119135"}, {"name": "Shell", "bytes": "13685"}]}} +{"text": "package com.englishtown.promises.impl;\n\nimport javax.inject.Inject;\nimport java.util.concurrent.Executor;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\n\n/**\n * Asynchronous executor that uses a fixed thread pool\n */\npublic class AsyncExecutor implements Executor {\n\n private ExecutorService executorService = Executors.newFixedThreadPool(20);\n\n @Inject\n public AsyncExecutor() {\n\n }\n\n /**\n * Executes the given command at some time in the future. The command\n * may execute in a new thread, in a pooled thread, or in the calling\n * thread, at the discretion of the {@code Executor} implementation.\n *\n * @param command the runnable task\n * @throws java.util.concurrent.RejectedExecutionException if this task cannot be\n * accepted for execution\n * @throws NullPointerException if command is null\n */\n @Override\n public void execute(Runnable command) {\n executorService.execute(command);\n }\n}\n", "meta": {"content_hash": "97daa0ceb6b018d444c3e6b7bbad6df1", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 85, "avg_line_length": 31.794117647058822, "alnum_prop": 0.6651248843663274, "repo_name": "englishtown/when.java", "id": "f15e7c678a405371aa9862d3224cc4b26c2ac040", "size": "1081", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "when.java/src/main/java/com/englishtown/promises/impl/AsyncExecutor.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "179308"}]}} +{"text": "package demo.java.v2c08javabean.ChartBean.com.horstmann.corejava;\r\n\r\nimport java.awt.*;\r\nimport java.awt.font.*;\r\nimport java.awt.geom.*;\r\nimport java.beans.*;\r\n\r\n/**\r\n * A custom editor for an array of floating-point numbers.\r\n * @version 1.21 2007-10-03\r\n * @author Cay Horstmann\r\n */\r\npublic class DoubleArrayEditor extends PropertyEditorSupport\r\n{\r\n @Override\r\n public void setValue(Object value)\r\n {\r\n super.setValue(value);\r\n }\r\n \r\n public Component getCustomEditor()\r\n {\r\n return new DoubleArrayEditorPanel(this);\r\n }\r\n\r\n public boolean supportsCustomEditor()\r\n {\r\n return true;\r\n }\r\n\r\n public boolean isPaintable()\r\n {\r\n return true;\r\n }\r\n\r\n public String getAsText()\r\n {\r\n return null;\r\n }\r\n\r\n public void paintValue(Graphics g, Rectangle box)\r\n {\r\n Graphics2D g2 = (Graphics2D) g;\r\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,\r\n RenderingHints.VALUE_TEXT_ANTIALIAS_ON);\r\n double[] values = (double[]) getValue();\r\n StringBuilder s = new StringBuilder();\r\n for (int i = 0; i < 3; i++)\r\n {\r\n if (values.length > i) s.append(values[i]);\r\n if (values.length > i + 1) s.append(\", \");\r\n }\r\n if (values.length > 3) s.append(\"...\");\r\n\r\n g2.setPaint(Color.white);\r\n g2.fill(box);\r\n g2.setPaint(Color.black);\r\n FontRenderContext context = g2.getFontRenderContext();\r\n Rectangle2D stringBounds = g2.getFont().getStringBounds(s.toString(), context);\r\n double w = stringBounds.getWidth();\r\n double x = box.x;\r\n if (w < box.width) x += (box.width - w) / 2;\r\n double ascent = -stringBounds.getY();\r\n double y = box.y + (box.height - stringBounds.getHeight()) / 2 + ascent;\r\n g2.drawString(s.toString(), (float) x, (float) y);\r\n }\r\n\r\n public String getJavaInitializationString()\r\n {\r\n double[] values = (double[]) getValue();\r\n StringBuilder s = new StringBuilder();\r\n s.append(\"new double[] {\");\r\n for (int i = 0; i < values.length; i++)\r\n {\r\n if (i > 0) s.append(\", \");\r\n s.append(values[i]);\r\n }\r\n s.append(\"}\");\r\n return s.toString();\r\n }\r\n}\r\n", "meta": {"content_hash": "c41baf7092675892ecd0ca226e9a3c7f", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 85, "avg_line_length": 27.209876543209877, "alnum_prop": 0.5812159709618875, "repo_name": "myid999/javademo", "id": "9ac7a4360c955940bee8183fafade38a861bb707", "size": "2204", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/main/java/demo/java/v2c08javabean/ChartBean/com/horstmann/corejava/DoubleArrayEditor.java", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "23149"}, {"name": "C++", "bytes": "2165"}, {"name": "HTML", "bytes": "1835"}, {"name": "Java", "bytes": "889869"}, {"name": "XSLT", "bytes": "1368"}]}} +{"text": "CREATE TABLE [tbl_Task_List] (\n [Location_ID] VARCHAR (50),\n [Request_date] DATETIME ,\n [Task_desc] VARCHAR (100),\n [Requested_by] VARCHAR (50),\n [Task_status] VARCHAR (50),\n [Date_completed] DATETIME ,\n [Followup_by] VARCHAR (50),\n [Task_notes] LONGTEXT ,\n [Followup_notes] LONGTEXT ,\n CONSTRAINT [pk_tbl_Task_List] PRIMARY KEY ([Location_ID], [Request_date], [Task_desc])\n)\n", "meta": {"content_hash": "6af315cb3af9b8326684f3c1dff04fc6", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 89, "avg_line_length": 32.25, "alnum_prop": 0.6640826873385013, "repo_name": "envisionnw/targetlists", "id": "4c034206d3dc79fa809ddf19e9a767366622dbdf", "size": "387", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "source/tbldef/tbl_Task_List.sql", "mode": "33188", "license": "mit", "language": [{"name": "Visual Basic", "bytes": "739429"}]}} +{"text": "require 'rails_helper'\n\ndescribe GamesHelper, :type => :helper do\nend\n", "meta": {"content_hash": "6f07a43c0a4edef773acd856271742a2", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 41, "avg_line_length": 17.5, "alnum_prop": 0.7428571428571429, "repo_name": "randomcodenz/canasta", "id": "e2928ff4c0bc203ee7aa91f7813897cc33d49c96", "size": "70", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/helpers/games_helper_spec.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "1849"}, {"name": "CoffeeScript", "bytes": "1266"}, {"name": "Cucumber", "bytes": "4757"}, {"name": "HTML", "bytes": "8457"}, {"name": "JavaScript", "bytes": "661"}, {"name": "Ruby", "bytes": "158587"}]}} +{"text": "\n\npackage com.example.android.tvleanback2.ui;\n\nimport android.app.Activity;\nimport android.app.FragmentManager;\nimport android.content.Context;\nimport android.graphics.drawable.Drawable;\nimport android.os.Bundle;\nimport android.support.annotation.NonNull;\nimport android.support.v17.leanback.app.GuidedStepFragment;\nimport android.support.v17.leanback.widget.GuidanceStylist;\nimport android.support.v17.leanback.widget.GuidanceStylist.Guidance;\nimport android.support.v17.leanback.widget.GuidedAction;\n\nimport com.example.android.tvleanback2.R;\n\nimport java.util.List;\n\n/**\n * Activity that showcases different aspects of GuidedStepFragments.\n */\npublic class GuidedStepActivity extends Activity {\n\n private static final int CONTINUE = 0;\n private static final int BACK = 1;\n private static final int OPTION_CHECK_SET_ID = 10;\n private static final String[] OPTION_NAMES = {\"Option A\", \"Option B\", \"Option C\"};\n private static final String[] OPTION_DESCRIPTIONS = {\"Here's one thing you can do\",\n \"Here's another thing you can do\", \"Here's one more thing you can do\"};\n private static final int[] OPTION_DRAWABLES = {R.drawable.ic_guidedstep_option_a,\n R.drawable.ic_guidedstep_option_b, R.drawable.ic_guidedstep_option_c};\n private static final boolean[] OPTION_CHECKED = {true, false, false};\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n if (null == savedInstanceState) {\n GuidedStepFragment.addAsRoot(this, new FirstStepFragment(), android.R.id.content);\n }\n }\n\n private static void addAction(List<GuidedAction> actions, long id, String title, String desc) {\n actions.add(new GuidedAction.Builder()\n .id(id)\n .title(title)\n .description(desc)\n .build());\n }\n\n private static void addCheckedAction(List<GuidedAction> actions, int iconResId, Context context,\n String title, String desc, boolean checked) {\n GuidedAction guidedAction = new GuidedAction.Builder()\n .title(title)\n .description(desc)\n .checkSetId(OPTION_CHECK_SET_ID)\n .iconResourceId(iconResId, context)\n .build();\n guidedAction.setChecked(checked);\n actions.add(guidedAction);\n }\n\n public static class FirstStepFragment extends GuidedStepFragment {\n @Override\n public int onProvideTheme() {\n return R.style.Theme_Example_Leanback_GuidedStep_First;\n }\n\n @Override\n @NonNull\n public Guidance onCreateGuidance(@NonNull Bundle savedInstanceState) {\n String title = getString(R.string.guidedstep_first_title);\n String breadcrumb = getString(R.string.guidedstep_first_breadcrumb);\n String description = getString(R.string.guidedstep_first_description);\n Drawable icon = getActivity().getDrawable(R.drawable.ic_main_icon);\n return new Guidance(title, description, breadcrumb, icon);\n }\n\n @Override\n public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {\n addAction(actions, CONTINUE,\n getResources().getString(R.string.guidedstep_continue),\n getResources().getString(R.string.guidedstep_letsdoit));\n addAction(actions, BACK,\n getResources().getString(R.string.guidedstep_cancel),\n getResources().getString(R.string.guidedstep_nevermind));\n }\n\n @Override\n public void onGuidedActionClicked(GuidedAction action) {\n FragmentManager fm = getFragmentManager();\n if (action.getId() == CONTINUE) {\n GuidedStepFragment.add(fm, new SecondStepFragment());\n } else {\n getActivity().finishAfterTransition();\n }\n }\n }\n\n public static class SecondStepFragment extends GuidedStepFragment {\n\n @Override\n @NonNull\n public Guidance onCreateGuidance(Bundle savedInstanceState) {\n String title = getString(R.string.guidedstep_second_title);\n String breadcrumb = getString(R.string.guidedstep_second_breadcrumb);\n String description = getString(R.string.guidedstep_second_description);\n Drawable icon = getActivity().getDrawable(R.drawable.ic_main_icon);\n return new Guidance(title, description, breadcrumb, icon);\n }\n\n @Override\n public GuidanceStylist onCreateGuidanceStylist() {\n return new GuidanceStylist() {\n @Override\n public int onProvideLayoutId() {\n return R.layout.guidedstep_second_guidance;\n }\n };\n }\n\n @Override\n public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {\n String desc = getResources().getString(R.string.guidedstep_action_description);\n actions.add(new GuidedAction.Builder()\n .title(getResources().getString(R.string.guidedstep_action_title))\n .description(desc)\n .multilineDescription(true)\n .infoOnly(true)\n .enabled(false)\n .build());\n for (int i = 0; i < OPTION_NAMES.length; i++) {\n addCheckedAction(actions,\n OPTION_DRAWABLES[i],\n getActivity(),\n OPTION_NAMES[i],\n OPTION_DESCRIPTIONS[i],\n OPTION_CHECKED[i]);\n }\n }\n\n @Override\n public void onGuidedActionClicked(GuidedAction action) {\n FragmentManager fm = getFragmentManager();\n ThirdStepFragment next = ThirdStepFragment.newInstance(getSelectedActionPosition() - 1);\n GuidedStepFragment.add(fm, next);\n }\n\n }\n\n public static class ThirdStepFragment extends GuidedStepFragment {\n private final static String ARG_OPTION_IDX = \"arg.option.idx\";\n\n public static ThirdStepFragment newInstance(final int option) {\n final ThirdStepFragment f = new ThirdStepFragment();\n final Bundle args = new Bundle();\n args.putInt(ARG_OPTION_IDX, option);\n f.setArguments(args);\n return f;\n }\n\n @Override\n @NonNull\n public Guidance onCreateGuidance(Bundle savedInstanceState) {\n String title = getString(R.string.guidedstep_third_title);\n String breadcrumb = getString(R.string.guidedstep_third_breadcrumb);\n String description = getString(R.string.guidedstep_third_command)\n + OPTION_NAMES[getArguments().getInt(ARG_OPTION_IDX)];\n Drawable icon = getActivity().getDrawable(R.drawable.ic_main_icon);\n return new Guidance(title, description, breadcrumb, icon);\n }\n\n @Override\n public void onCreateActions(@NonNull List<GuidedAction> actions, Bundle savedInstanceState) {\n addAction(actions, CONTINUE, \"Done\", \"All finished\");\n addAction(actions, BACK, \"Back\", \"Forgot something...\");\n }\n\n @Override\n public void onGuidedActionClicked(GuidedAction action) {\n if (action.getId() == CONTINUE) {\n getActivity().finishAfterTransition();\n } else {\n getFragmentManager().popBackStack();\n }\n }\n\n }\n\n}\n", "meta": {"content_hash": "caafc1cd4708ce82285b0c6389add889", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 101, "avg_line_length": 40.194736842105264, "alnum_prop": 0.6207935053031295, "repo_name": "SeanPONeil/HyprMX-AndroidTV-Leanback", "id": "0e8c04d1743a73cd385f16520a106b42132b6300", "size": "8256", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/example/android/tvleanback2/ui/GuidedStepActivity.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "153566"}]}} +{"text": "If your function returns a type that implements `MyTrait`, you can write its\nreturn type as `-> impl MyTrait`. This can help simplify your type signatures quite a lot!\n\n```rust,editable\nuse std::iter;\nuse std::vec::IntoIter;\n\n// This function combines two `Vec<i32>` and returns an iterator over it.\n// Look how complicated its return type is!\nfn combine_vecs_explicit_return_type(\n v: Vec<i32>,\n u: Vec<i32>,\n) -> iter::Cycle<iter::Chain<IntoIter<i32>, IntoIter<i32>>> {\n v.into_iter().chain(u.into_iter()).cycle()\n}\n\n// This is the exact same function, but its return type uses `impl Trait`.\n// Look how much simpler it is!\nfn combine_vecs(\n v: Vec<i32>,\n u: Vec<i32>,\n) -> impl Iterator<Item=i32> {\n v.into_iter().chain(u.into_iter()).cycle()\n}\n\nfn main() {\n let v1 = vec![1, 2, 3];\n let v2 = vec![4, 5];\n let mut v3 = combine_vecs(v1, v2);\n assert_eq!(Some(1), v3.next());\n assert_eq!(Some(2), v3.next());\n assert_eq!(Some(3), v3.next());\n assert_eq!(Some(4), v3.next());\n assert_eq!(Some(5), v3.next());\n println!(\"all done\");\n}\n```\n\nMore importantly, some Rust types can't be written out. For example, every\nclosure has its own unnamed concrete type. Before `impl Trait` syntax, you had\nto allocate on the heap in order to return a closure. But now you can do it all\nstatically, like this:\n\n```rust,editable\n// Returns a function that adds `y` to its input\nfn make_adder_function(y: i32) -> impl Fn(i32) -> i32 {\n let closure = move |x: i32| { x + y };\n closure\n}\n\nfn main() {\n let plus_one = make_adder_function(1);\n assert_eq!(plus_one(2), 3);\n}\n```\n\nYou can also use `impl Trait` to return an iterator that uses `map` or `filter`\nclosures! This makes using `map` and `filter` easier. Because closure types don't\nhave names, you can't write out an explicit return type if your function returns\niterators with closures. But with `impl Trait` you can do this easily:\n\n```rust,editable\nfn double_positives<'a>(numbers: &'a Vec<i32>) -> impl Iterator<Item = i32> + 'a {\n numbers\n .iter()\n .filter(|x| x > &&0)\n .map(|x| x * 2)\n}\n```\n", "meta": {"content_hash": "b824e0f0149513c37c3e4ab9840088a5", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 90, "avg_line_length": 30.695652173913043, "alnum_prop": 0.647780925401322, "repo_name": "rust-lang-cn/rust-by-example-cn", "id": "7b87bd2e9c5261598db5d150e406b49af377f543", "size": "2134", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "english/src/trait/impl_trait.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "JavaScript", "bytes": "1803"}, {"name": "Shell", "bytes": "399"}]}} +{"text": " * Write a program that prints the entire ASCII table of characters on the console (characters from 0 to 255).\n \n * Note: Some characters have a special purpose and will not be displayed as expected. You may skip them or display them differently.", "meta": {"content_hash": "21bdef7d36938f47781bef95e1c3aa8b", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 133, "avg_line_length": 82.0, "alnum_prop": 0.7804878048780488, "repo_name": "petyakostova/Telerik-Academy", "id": "0c5719836f45157098c694c2412ffbfa19c11a9c", "size": "286", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "C#/C# 1/2. PrimitiveDataTypesVariables-Homework/Print-The-ASCII-Table/README.md", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "260"}, {"name": "C#", "bytes": "2688607"}, {"name": "CSS", "bytes": "165511"}, {"name": "CoffeeScript", "bytes": "4962"}, {"name": "HTML", "bytes": "6067263"}, {"name": "JavaScript", "bytes": "2379763"}]}} +{"text": "import os\nimport sys\nfrom common import call_pandoc, regex_process, listfiles\n\ndef convert_to_wordpress(filename):\n \"\"\"Convert from Markdown to Wordpress.\"\"\"\n basename, ext = os.path.splitext(filename)\n print(\"Converting '{0:s}' to Wordpress HTML...\".format(filename))\n filename1 = basename + \".wordpress_tmp.txt\"\n call_pandoc(filename, filename1, \"markdown\", \"html\", [\"--gladtex\"])\n # postprocessing for wordpress and MathJax-Latex\n patterns = [(\"<EQ ENV=\\\"math\\\">(.*?)</EQ>\", \"[latex]\\\\1[/latex]\"),\n (\"<EQ ENV=\\\"displaymath\\\">(.*?)</EQ>\", \"<div style=\\\"text-align: center;\\\">[latex]\\\\1[/latex]</div>\"),\n (\"<pre><code>\",\"<pre lang=\\\"python\\\">\"),\n (\"</code></pre>\",\"</pre>\"),\n (\""\", \"\\\"\"),\n (\"'\", \"'\"),\n (\"<h1(.*?)>(.*?)</h1>\\n\", \"\"),\n ]\n filename2 = basename + \".wordpress.txt\"\n regex_process(filename1, filename2, patterns)\n os.remove(filename1)\n print(\"Done!\")\n\ndef main():\n for file in listfiles():\n convert_to_wordpress(file)\n\nif __name__ == '__main__':\n main()\n ", "meta": {"content_hash": "4cbc45c6f5c9b836adf35f51d2ba2fc7", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 118, "avg_line_length": 36.483870967741936, "alnum_prop": 0.5313881520778072, "repo_name": "rossant/mdconvert", "id": "d3f2a17941e0a2a0f0a1102adbf04715594237db", "size": "1131", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mdconvert/mdwp.py", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Python", "bytes": "3732"}]}} +{"text": "\"\"\"\nDijkstra's algorithm implementation\nhttps://en.wikipedia.org/wiki/Dijkstra%27s_algorithm\n\"\"\"\n\nfrom __future__ import print_function\n\n\ndef dijkstra(edges, source, target):\n \"\"\" Dijkstra's algorithm\n\n Parameters\n ----------\n edges : list of tuples\n list of dependencies between nodes in the graph\n [(source, target, weight), ...]\n source : str\n name of source node of the graph\n target : str\n name of target node of the graph\n\n Returns\n -------\n out : tuple\n length and path between source and target node\n tuple (length, path)\n\n \"\"\"\n # determine the graph as dict where:\n # key - source node and\n # item - list of [(destination, weight), ...]\n graph = {}\n for src, dest, weight in edges:\n if src not in graph:\n graph[src] = []\n graph[src].append((dest, weight))\n # set a queue\n # weight, source node, path from source node\n queue = [(0, source, [source])]\n # initialize visited nodes\n # visited nodes - nodes with a known shortest path\n # key - visited node\n # item - (cost, path)\n visited = dict()\n\n while queue:\n # get item from queue\n cost, src, path = queue.pop()\n if src not in visited:\n # this is a new visited node\n visited[src] = (cost, path)\n\n if src == target:\n # target node was reached\n return cost, path\n\n # set initial weight, destination node and path\n min_weight, min_dest, min_path = float('Inf'), None, None\n # loop for all visited nodes\n for src_, (cost_, path_) in visited.items():\n # find a shortest path\n # from src node to the nearest node\n for dest, weight in graph.get(src_, ()):\n if dest in visited:\n # skip nodes with a known shortest path\n continue\n # calculate current cost\n current_cost = cost_ + weight\n if current_cost < min_weight:\n min_weight, min_dest, min_path = current_cost, dest, path_\n\n if min_dest is not None:\n # we find shortest path to new node\n # shortest path was updated\n path = min_path + [min_dest]\n # add to the queue\n queue.insert(0, (min_weight, min_dest, path))\n\n # Return infinity if the target node is not reached\n return float('Inf'), []\n\nif __name__ == \"__main__\":\n EDGES = [\n ('s', 't', 6),\n ('s', 'y', 7),\n ('t', 'x', 5),\n ('x', 't', -2),\n ('t', 'y', 8),\n ('y', 'z', 9),\n ('y', 'x', -3),\n ('t', 'z', -4),\n ('z', 's', 2),\n ('z', 'x', 7)\n ]\n for SRC, DEST, MINLEN in [\n ('s', 'z', 2), ('a', 'z', float('Inf')), ('s', 's', 0)]:\n\n LEN, PATH = dijkstra(EDGES, SRC, DEST)\n print(\"Length of the path from '{}' to '{}' = {}, ({})\"\n .format(SRC, DEST, LEN, LEN == MINLEN))\n print(\"Path from '{}' to '{}': {}\".format(SRC, DEST, PATH))\n", "meta": {"content_hash": "c35c242a424f460aa19eecbac1f2d865", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 78, "avg_line_length": 30.514851485148515, "alnum_prop": 0.5045425048669695, "repo_name": "dsysoev/fun-with-algorithms", "id": "4996c07338f898bcad5f9b67bb3534898fe28311", "size": "3084", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "graph/dijkstra.py", "mode": "33188", "license": "mit", "language": [{"name": "Python", "bytes": "150209"}]}} +{"text": ".class final Lo/BZ;\n.super Lo/BY;\n.source \"\"\n\n\n# annotations\n.annotation system Ldalvik/annotation/InnerClass;\n accessFlags = 0x8\n name = null\n.end annotation\n\n.annotation system Ldalvik/annotation/Signature;\n value = {\n \"Lo/BY<TK;TV;>;\"\n }\n.end annotation\n\n\n# instance fields\n.field final synthetic \u02ca:Lo/BY;\n\n.field final synthetic \u02cb:Ljava/util/concurrent/Executor;\n\n\n# direct methods\n.method constructor <init>(Lo/BY;Ljava/util/concurrent/Executor;)V\n .locals 0\n\n .line 186\n iput-object p1, p0, Lo/BZ;->\u02ca:Lo/BY;\n\n iput-object p2, p0, Lo/BZ;->\u02cb:Ljava/util/concurrent/Executor;\n\n invoke-direct {p0}, Lo/BY;-><init>()V\n\n return-void\n.end method\n\n\n# virtual methods\n.method public \u02ca(Ljava/lang/Object;)Ljava/lang/Object;\n .locals 1\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"(TK;)TV;\"\n }\n .end annotation\n\n .line 189\n iget-object v0, p0, Lo/BZ;->\u02ca:Lo/BY;\n\n invoke-virtual {v0, p1}, Lo/BY;->\u02ca(Ljava/lang/Object;)Ljava/lang/Object;\n\n move-result-object v0\n\n return-object v0\n.end method\n\n.method public \u02ca(Ljava/lang/Iterable;)Ljava/util/Map;\n .locals 1\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"(Ljava/lang/Iterable<+TK;>;)Ljava/util/Map<TK;TV;>;\"\n }\n .end annotation\n\n .line 206\n iget-object v0, p0, Lo/BZ;->\u02ca:Lo/BY;\n\n invoke-virtual {v0, p1}, Lo/BY;->\u02ca(Ljava/lang/Iterable;)Ljava/util/Map;\n\n move-result-object v0\n\n return-object v0\n.end method\n\n.method public \u02ca(Ljava/lang/Object;Ljava/lang/Object;)Lo/Rc;\n .locals 2\n .annotation system Ldalvik/annotation/Signature;\n value = {\n \"(TK;TV;)Lo/Rc<TV;>;\"\n }\n .end annotation\n\n .line 194\n new-instance v0, Lo/Ca;\n\n invoke-direct {v0, p0, p1, p2}, Lo/Ca;-><init>(Lo/BZ;Ljava/lang/Object;Ljava/lang/Object;)V\n\n invoke-static {v0}, Lo/Rd;->\u02ca(Ljava/util/concurrent/Callable;)Lo/Rd;\n\n move-result-object v1\n\n .line 200\n iget-object v0, p0, Lo/BZ;->\u02cb:Ljava/util/concurrent/Executor;\n\n invoke-interface {v0, v1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V\n\n .line 201\n return-object v1\n.end method\n", "meta": {"content_hash": "854daa52071182789e22942339d87aa4", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 95, "avg_line_length": 21.742574257425744, "alnum_prop": 0.6429872495446266, "repo_name": "gelldur/jak_oni_to_robia_prezentacja", "id": "7e7f550c502c940b374d4636ab6deea2d151c98c", "size": "2209", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Starbucks/output/smali/o/BZ.smali", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "8427"}, {"name": "Shell", "bytes": "2303"}, {"name": "Smali", "bytes": "57557982"}]}} +{"text": "var util = require('util');\nvar plugins = require('../../services/plugins');\nvar Parent = plugins.require('models/fields/select');\n\nfunction Checkboxlist() {\n Parent.call(this);\n\n this.on('getting.options', function(event) {\n if (typeof event.value === 'function') {\n event.value = event.value.call(this);\n }\n });\n}\n\nutil.inherits(Checkboxlist, Parent);\n\nmodule.exports = Checkboxlist;\n", "meta": {"content_hash": "03dcffbba05c2fbf0e0d375c3acef15f", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 54, "avg_line_length": 24.941176470588236, "alnum_prop": 0.6297169811320755, "repo_name": "spleenboy/pallium-cms", "id": "b262873633a0b6c01048a46bba786e1491d01015", "size": "424", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/fields/checkboxlist.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "231825"}, {"name": "HTML", "bytes": "60887"}, {"name": "JavaScript", "bytes": "105960"}]}} +{"text": "package eventstore.j;\n\nimport java.io.Closeable;\nimport java.util.Collection;\nimport scala.concurrent.Future;\nimport akka.NotUsed;\nimport akka.stream.javadsl.Source;\nimport eventstore.akka.SubscriptionObserver;\nimport eventstore.core.settings.PersistentSubscriptionSettings;\nimport eventstore.core.*;\n\n\n/**\n * Maintains a full duplex connection to the EventStore\n * <p>\n * All operations are handled in a full async manner.\n * Many threads can use an <code>EsConnection</code> at the same time or a single thread can make many asynchronous requests.\n * To get the most performance out of the connection it is generally recommended to use it in this way.\n */\npublic interface EsConnection {\n\n /**\n * Write events to a stream\n * <p>\n * When writing events to a stream the {@link eventstore.core.ExpectedVersion} choice can\n * make a very large difference in the observed behavior. For example, if no stream exists\n * and ExpectedVersion.Any is used, a new stream will be implicitly created when appending.\n * <p>\n * There are also differences in idempotency between different types of calls.\n * If you specify an ExpectedVersion aside from ExpectedVersion.Any the Event Store\n * will give you an idempotency guarantee. If using ExpectedVersion.Any the Event Store\n * will do its best to provide idempotency but does not guarantee idempotency\n *\n * @param stream name of the stream to write events to\n * @param expectedVersion expected version of the stream to write to, or <code>ExpectedVersion.Any</code> if <code>null</code>\n * @param events events to append to the stream\n * @param credentials optional user credentials to perform operation with.\n * @return A {@link scala.concurrent.Future} that the caller can await on\n */\n Future<WriteResult> writeEvents(\n String stream,\n ExpectedVersion expectedVersion,\n Collection<EventData> events,\n UserCredentials credentials);\n\n /**\n * Write events to a stream\n * <p>\n * When writing events to a stream the {@link eventstore.core.ExpectedVersion} choice can\n * make a very large difference in the observed behavior. For example, if no stream exists\n * and ExpectedVersion.Any is used, a new stream will be implicitly created when appending.\n * <p>\n * There are also differences in idempotency between different types of calls.\n * If you specify an ExpectedVersion aside from ExpectedVersion.Any the Event Store\n * will give you an idempotency guarantee. If using ExpectedVersion.Any the Event Store\n * will do its best to provide idempotency but does not guarantee idempotency\n *\n * @param stream name of the stream to write events to\n * @param expectedVersion expected version of the stream to write to, or <code>ExpectedVersion.Any</code> if <code>null</code>\n * @param events events to append to the stream\n * @param credentials optional user credentials to perform operation with.\n * @param requireMaster Require Event Store to refuse operation if it is not master\n * @return A {@link scala.concurrent.Future} that the caller can await on\n */\n Future<WriteResult> writeEvents(\n String stream,\n ExpectedVersion expectedVersion,\n Collection<EventData> events,\n UserCredentials credentials,\n boolean requireMaster);\n\n /**\n * Deletes a stream from the Event Store\n *\n * @param stream name of the stream to delete\n * @param expectedVersion optional expected version that the stream should have when being deleted, or <code>ExpectedVersion.Any</code> if <code>null</code>\n * @param credentials optional user credentials to perform operation with.\n * @return A {@link scala.concurrent.Future} that the caller can await on\n */\n Future<DeleteResult> deleteStream(\n String stream,\n ExpectedVersion.Existing expectedVersion,\n UserCredentials credentials);\n\n /**\n * Deletes a stream from the Event Store\n *\n * @param stream name of the stream to delete\n * @param expectedVersion optional expected version that the stream should have when being deleted, or <code>ExpectedVersion.Any</code> if <code>null</code>\n * @param hardDelete Indicator for tombstoning vs soft-deleting the stream. Tombstoned streams can never be recreated. Soft-deleted streams can be written to again, but the EventNumber sequence will not start from 0.\n * @param credentials optional user credentials to perform operation with.\n * @return A {@link scala.concurrent.Future} that the caller can await on\n */\n Future<DeleteResult> deleteStream(\n String stream,\n ExpectedVersion.Existing expectedVersion,\n boolean hardDelete,\n UserCredentials credentials);\n\n /**\n * Deletes a stream from the Event Store\n *\n * @param stream name of the stream to delete\n * @param expectedVersion optional expected version that the stream should have when being deleted, or <code>ExpectedVersion.Any</code> if <code>null</code>\n * @param hardDelete Indicator for tombstoning vs soft-deleting the stream. Tombstoned streams can never be recreated. Soft-deleted streams can be written to again, but the EventNumber sequence will not start from 0.\n * @param credentials optional user credentials to perform operation with.\n * @param requireMaster Require Event Store to refuse operation if it is not master\n * @return A {@link scala.concurrent.Future} that the caller can await on\n */\n Future<DeleteResult> deleteStream(\n String stream,\n ExpectedVersion.Existing expectedVersion,\n boolean hardDelete,\n UserCredentials credentials,\n boolean requireMaster);\n\n /**\n * Starts a transaction in the event store on a given stream asynchronously\n * <p>\n * A {@link eventstore.j.EsTransaction} allows the calling of multiple writes with multiple\n * round trips over long periods of time between the caller and the event store. This method\n * is only available through the TCP interface and no equivalent exists for the RESTful interface.\n *\n * @param stream The stream to start a transaction on\n * @param expectedVersion The expected version of the stream at the time of starting the transaction\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link scala.concurrent.Future} containing an actual transaction\n */\n Future<EsTransaction> startTransaction(\n String stream,\n ExpectedVersion expectedVersion,\n UserCredentials credentials);\n\n /**\n * Starts a transaction in the event store on a given stream asynchronously\n * <p>\n * A {@link eventstore.j.EsTransaction} allows the calling of multiple writes with multiple\n * round trips over long periods of time between the caller and the event store. This method\n * is only available through the TCP interface and no equivalent exists for the RESTful interface.\n *\n * @param stream The stream to start a transaction on\n * @param expectedVersion The expected version of the stream at the time of starting the transaction\n * @param credentials The optional user credentials to perform operation with\n * @param requireMaster Require Event Store to refuse operation if it is not master\n * @return A {@link scala.concurrent.Future} containing an actual transaction\n */\n Future<EsTransaction> startTransaction(\n String stream,\n ExpectedVersion expectedVersion,\n UserCredentials credentials,\n boolean requireMaster);\n\n\n /**\n * Continues transaction by provided transaction ID.\n * <p>\n * A {@link eventstore.j.EsTransaction} allows the calling of multiple writes with multiple\n * round trips over long periods of time between the caller and the event store. This method\n * is only available through the TCP interface and no equivalent exists for the RESTful interface.\n *\n * @param transactionId The transaction ID that needs to be continued.\n * @param credentials The optional user credentials to perform operation with\n * @return A transaction for given id\n */\n EsTransaction continueTransaction(long transactionId, UserCredentials credentials);\n\n\n /**\n * Reads a single event from a stream at event number\n *\n * @param stream name of the stream to read from\n * @param eventNumber optional event number to read, or EventNumber.Last for reading latest event, EventNumber.Last if null\n * @param resolveLinkTos whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link scala.concurrent.Future} containing an event\n */\n Future<Event> readEvent(\n String stream,\n EventNumber eventNumber,\n boolean resolveLinkTos,\n UserCredentials credentials);\n\n /**\n * Reads a single event from a stream at event number\n *\n * @param stream name of the stream to read from\n * @param eventNumber optional event number to read, or EventNumber.Last for reading latest event, EventNumber.Last if null\n * @param resolveLinkTos whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @param requireMaster Require Event Store to refuse operation if it is not master\n * @return A {@link scala.concurrent.Future} containing an event\n */\n Future<Event> readEvent(\n String stream,\n EventNumber eventNumber,\n boolean resolveLinkTos,\n UserCredentials credentials,\n boolean requireMaster);\n\n\n /**\n * Reads count events from a stream forwards (e.g. oldest to newest) starting from event number\n *\n * @param stream name of stream to read from\n * @param fromNumber optional event number to read, EventNumber.First if null\n * @param maxCount maximum count of items to read\n * @param resolveLinkTos whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link scala.concurrent.Future} containing the results of the read operation\n */\n Future<ReadStreamEventsCompleted> readStreamEventsForward(\n String stream,\n EventNumber.Exact fromNumber,\n int maxCount,\n boolean resolveLinkTos,\n UserCredentials credentials);\n\n /**\n * Reads count events from a stream forwards (e.g. oldest to newest) starting from event number\n *\n * @param stream name of stream to read from\n * @param fromNumber optional event number to read, EventNumber.First if null\n * @param maxCount maximum count of items to read\n * @param resolveLinkTos whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @param requireMaster Require Event Store to refuse operation if it is not master\n * @return A {@link scala.concurrent.Future} containing the results of the read operation\n */\n Future<ReadStreamEventsCompleted> readStreamEventsForward(\n String stream,\n EventNumber.Exact fromNumber,\n int maxCount,\n boolean resolveLinkTos,\n UserCredentials credentials,\n boolean requireMaster);\n\n\n /**\n * Reads count events from from a stream backwards (e.g. newest to oldest) starting from event number\n *\n * @param stream name of stream to read from\n * @param fromNumber optional event number to read, EventNumber.Last if null\n * @param maxCount maximum count of items to read\n * @param resolveLinkTos whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link scala.concurrent.Future} containing the results of the read operation\n */\n Future<ReadStreamEventsCompleted> readStreamEventsBackward(\n String stream,\n EventNumber fromNumber,\n int maxCount,\n boolean resolveLinkTos,\n UserCredentials credentials);\n\n /**\n * Reads count events from from a stream backwards (e.g. newest to oldest) starting from event number\n *\n * @param stream name of stream to read from\n * @param fromNumber optional event number to read, EventNumber.Last if null\n * @param maxCount maximum count of items to read\n * @param resolveLinkTos whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @param requireMaster Require Event Store to refuse operation if it is not master\n * @return A {@link scala.concurrent.Future} containing the results of the read operation\n */\n Future<ReadStreamEventsCompleted> readStreamEventsBackward(\n String stream,\n EventNumber fromNumber,\n int maxCount,\n boolean resolveLinkTos,\n UserCredentials credentials,\n boolean requireMaster);\n\n\n /**\n * Reads all events in the node forward (e.g. beginning to end) starting from position\n *\n * @param fromPosition optional position to start reading from, Position.First of null\n * @param maxCount maximum count of items to read\n * @param resolveLinkTos whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link scala.concurrent.Future} containing the results of the read operation\n */\n Future<ReadAllEventsCompleted> readAllEventsForward(\n Position fromPosition,\n int maxCount,\n boolean resolveLinkTos,\n UserCredentials credentials);\n\n /**\n * Reads all events in the node forward (e.g. beginning to end) starting from position\n *\n * @param fromPosition optional position to start reading from, Position.First of null\n * @param maxCount maximum count of items to read\n * @param resolveLinkTos whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @param requireMaster Require Event Store to refuse operation if it is not master\n * @return A {@link scala.concurrent.Future} containing the results of the read operation\n */\n Future<ReadAllEventsCompleted> readAllEventsForward(\n Position fromPosition,\n int maxCount,\n boolean resolveLinkTos,\n UserCredentials credentials,\n boolean requireMaster);\n\n\n /**\n * Reads all events in the node backwards (e.g. end to beginning) starting from position\n *\n * @param fromPosition optional position to start reading from, Position.Last of null\n * @param maxCount maximum count of items to read\n * @param resolveLinkTos whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link scala.concurrent.Future} containing the results of the read operation\n */\n Future<ReadAllEventsCompleted> readAllEventsBackward(\n Position fromPosition,\n int maxCount,\n boolean resolveLinkTos,\n UserCredentials credentials);\n\n /**\n * Reads all events in the node backwards (e.g. end to beginning) starting from position\n *\n * @param fromPosition optional position to start reading from, Position.Last of null\n * @param maxCount maximum count of items to read\n * @param resolveLinkTos whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @param requireMaster Require Event Store to refuse operation if it is not master\n * @return A {@link scala.concurrent.Future} containing the results of the read operation\n */\n Future<ReadAllEventsCompleted> readAllEventsBackward(\n Position fromPosition,\n int maxCount,\n boolean resolveLinkTos,\n UserCredentials credentials,\n boolean requireMaster);\n\n\n /**\n * Subscribes to a single event stream. New events\n * written to the stream while the subscription is active will be\n * pushed to the client.\n *\n * @param stream The stream to subscribe to\n * @param observer A {@link eventstore.akka.SubscriptionObserver} to handle a new event received over the subscription\n * @param resolveLinkTos Whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link java.io.Closeable} representing the subscription which can be closed.\n */\n Closeable subscribeToStream(\n String stream,\n SubscriptionObserver<Event> observer,\n boolean resolveLinkTos,\n UserCredentials credentials);\n\n\n /**\n * Subscribes to a single event stream. Existing events from\n * lastCheckpoint onwards are read from the stream\n * and presented to the user of <code>SubscriptionObserver</code>\n * as if they had been pushed.\n * <p>\n * Once the end of the stream is read the subscription is\n * transparently (to the user) switched to push new events as\n * they are written.\n * <p>\n * If events have already been received and resubscription from the same point\n * is desired, use the event number of the last event processed which\n * appeared on the subscription.\n *\n * @param stream The stream to subscribe to\n * @param observer A {@link eventstore.akka.SubscriptionObserver} to handle a new event received over the subscription\n * @param fromEventNumberExclusive The event number from which to start, or <code>null</code> to read all events.\n * @param resolveLinkTos Whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link java.io.Closeable} representing the subscription which can be closed.\n */\n Closeable subscribeToStreamFrom(\n String stream,\n SubscriptionObserver<Event> observer,\n Long fromEventNumberExclusive,\n boolean resolveLinkTos,\n UserCredentials credentials);\n\n /**\n * Subscribes to all events in the Event Store. New events written to the stream\n * while the subscription is active will be pushed to the client.\n *\n * @param observer A {@link eventstore.akka.SubscriptionObserver} to handle a new event received over the subscription\n * @param resolveLinkTos Whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link java.io.Closeable} representing the subscription which can be closed.\n */\n Closeable subscribeToAll(\n SubscriptionObserver<IndexedEvent> observer,\n boolean resolveLinkTos,\n UserCredentials credentials);\n\n\n /**\n * Subscribes to a all events. Existing events from position\n * onwards are read from the Event Store and presented to the user of\n * <code>SubscriptionObserver</code> as if they had been pushed.\n * <p>\n * Once the end of the stream is read the subscription is\n * transparently (to the user) switched to push new events as\n * they are written.\n * <p>\n * If events have already been received and resubscription from the same point\n * is desired, use the position representing the last event processed which\n * appeared on the subscription.\n *\n * @param observer A {@link eventstore.akka.SubscriptionObserver} to handle a new event received over the subscription\n * @param fromPositionExclusive The position from which to start, or <code>null</code> to read all events\n * @param resolveLinkTos Whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link java.io.Closeable} representing the subscription which can be closed.\n */\n Closeable subscribeToAllFrom(\n SubscriptionObserver<IndexedEvent> observer,\n Position.Exact fromPositionExclusive,\n boolean resolveLinkTos,\n UserCredentials credentials);\n\n\n// TODO support stream not found\n// Future<Unit> setStreamMetadata(String stream, int expectedMetastreamVersion, StreamMetadata metadata, UserCredentials credentials);\n// Future<StreamMetadataResult> getStreamMetadataAsync(String stream, UserCredentials credentials);\n// Future<RawStreamMetadataResult> getStreamMetadataAsRawBytesAsync(String stream, UserCredentials credentials); TODO\n\n /**\n * Sets the metadata for a stream.\n *\n * @param stream The name of the stream for which to set metadata.\n * @param expectedMetastreamVersion The expected version for the write to the metadata stream.\n * @param metadata A byte array representing the new metadata.\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link scala.concurrent.Future} representing the operation\n */\n Future<WriteResult> setStreamMetadata(\n String stream,\n ExpectedVersion expectedMetastreamVersion,\n byte[] metadata,\n UserCredentials credentials);\n\n /**\n * Reads the metadata for a stream as a byte array.\n *\n * @param stream The name of the stream for which to read metadata.\n * @param credentials The optional user credentials to perform operation with\n * @return A {@link scala.concurrent.Future} containing the metadata as byte array.\n */\n Future<byte[]> getStreamMetadataBytes(String stream, UserCredentials credentials);\n\n /**\n * Creates a Source you can use to subscribe to a single event stream. Existing events from\n * event number onwards are read from the stream and presented to the user of\n * <code>Source</code> as if they had been pushed.\n * <p>\n * Once the end of the stream is read the <code>Source</code> transparently (to the user)\n * switches to push new events as they are written.\n * <p>\n * If events have already been received and resubscription from the same point\n * is desired, use the event number of the last event processed.\n *\n * @param stream The stream to subscribe to\n * @param fromEventNumberExclusive The event number from which to start, or <code>null</code> to read all events.\n * @param resolveLinkTos Whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @param infinite Whether to subscribe to the future events upon reading all current\n * @return A {@link akka.stream.javadsl.Source} representing the stream\n */\n Source<Event, NotUsed> streamSource(\n String stream,\n EventNumber fromEventNumberExclusive,\n boolean resolveLinkTos,\n UserCredentials credentials,\n boolean infinite);\n\n /**\n * Creates a Source you can use to subscribes to all events. Existing events from position\n * onwards are read from the Event Store and presented to the user of\n * <code>Source</code> as if they had been pushed.\n * <p>\n * Once the end of the stream is read the <code>Source</code> transparently (to the user)\n * switches to push new events as they are written.\n * <p>\n * If events have already been received and resubscription from the same point\n * is desired, use the position representing the last event processed.\n *\n * @param fromPositionExclusive The position from which to start, or <code>null</code> to read all events\n * @param resolveLinkTos Whether to resolve LinkTo events automatically\n * @param credentials The optional user credentials to perform operation with\n * @param infinite Whether to subscribe to the future events upon reading all current\n * @return A {@link akka.stream.javadsl.Source} representing all streams\n */\n Source<IndexedEvent, NotUsed> allStreamsSource(\n Position fromPositionExclusive,\n boolean resolveLinkTos,\n UserCredentials credentials,\n boolean infinite);\n\n /**\n * Asynchronously create a persistent subscription group on a stream\n *\n * @param stream The name of the stream to create the persistent subscription on\n * @param groupName The name of the group to create\n * @param settings The {@link PersistentSubscriptionSettings} for the subscription, or <code>null</code> for defaults\n * @param credentials The credentials to be used for this operation\n * @return A {@link scala.concurrent.Future} representing the operation\n */\n Future<scala.Unit> createPersistentSubscription(\n String stream,\n String groupName,\n PersistentSubscriptionSettings settings,\n UserCredentials credentials);\n\n /**\n * Asynchronously update a persistent subscription group on a stream\n *\n * @param stream The name of the stream to create the persistent subscription on\n * @param groupName The name of the group to create\n * @param settings The {@link PersistentSubscriptionSettings} for the subscription, or <code>null</code> for defaults\n * @param credentials The credentials to be used for this operation, or <code>null</code> for default\n * @return A {@link scala.concurrent.Future} representing the operation\n */\n Future<scala.Unit> updatePersistentSubscription(\n String stream,\n String groupName,\n PersistentSubscriptionSettings settings,\n UserCredentials credentials);\n\n /**\n * Asynchronously delete a persistent subscription group on a stream\n *\n * @param stream The name of the stream to create the persistent subscription on\n * @param groupName The name of the group to create\n * @param credentials The credentials to be used for this operation, or <code>null</code> for default\n * @return A {@link scala.concurrent.Future} representing the operation\n */\n Future<scala.Unit> deletePersistentSubscription(\n String stream,\n String groupName,\n UserCredentials credentials);\n}\n", "meta": {"content_hash": "013f65b93d0485b19f4c49371bbf21a9", "timestamp": "", "source": "github", "line_count": 547, "max_line_length": 223, "avg_line_length": 47.09140767824497, "alnum_prop": 0.7269303932606079, "repo_name": "EventStore/EventStore.JVM", "id": "e3379f754431c44dcddde909313919f9abafe6b0", "size": "25759", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/src/main/java/eventstore/j/EsConnection.java", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Java", "bytes": "29794"}, {"name": "Scala", "bytes": "683287"}]}} +{"text": "ACCEPTED\n\n#### According to\nInternational Plant Names Index\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "8f008fea1cd386dbe0af5a045b6395f5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "88b59771f656bf3074ccb58259c5afc1d4b908ef", "size": "174", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Lamiaceae/Sideritis/Sideritis rigida/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "<h2>Editing <span class='muted'>OilColor</span></h2>\n<br>\n\n<?php echo render('oilcolors/_form'); ?>\n<p>\n\t<?php echo Html::anchor('oilcolors/view/'.$oilColor->id, 'View'); ?> |\n\t<?php echo Html::anchor('oilcolors', 'Back'); ?></p>\n", "meta": {"content_hash": "5295acdbafa7f5409c952f7536d60d8f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 71, "avg_line_length": 32.857142857142854, "alnum_prop": 0.6130434782608696, "repo_name": "grantelgin/sw1", "id": "a75626d20bdda7fd085f88f39c1f6329efdb039b", "size": "230", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fuel/app/views/oilcolors/edit.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "155505"}, {"name": "JavaScript", "bytes": "58458"}, {"name": "PHP", "bytes": "1939677"}]}} +{"text": "<?php declare(strict_types=1);\n\n\n\nnamespace Monolog\\Handler;\n\nuse Monolog\\Logger;\nuse Swift;\nuse Swift_Message;\n\n/**\n * MandrillHandler uses cURL to send the emails to the Mandrill API\n *\n * @author Adam Nicholson <adamnicholson10@gmail.com>\n */\nclass MandrillHandler extends MailHandler\n{\n /** @var Swift_Message */\n protected $message;\n /** @var string */\n protected $apiKey;\n\n /**\n * @psalm-param Swift_Message|callable(): Swift_Message $message\n *\n * @param string $apiKey A valid Mandrill API key\n * @param callable|Swift_Message $message An example message for real messages, only the body will be replaced\n */\n public function __construct(string $apiKey, $message, $level = Logger::ERROR, bool $bubble = true)\n {\n parent::__construct($level, $bubble);\n\n if (!$message instanceof Swift_Message && is_callable($message)) {\n $message = $message();\n }\n if (!$message instanceof Swift_Message) {\n throw new \\InvalidArgumentException('You must provide either a Swift_Message instance or a callable returning it');\n }\n $this->message = $message;\n $this->apiKey = $apiKey;\n }\n\n /**\n * {@inheritdoc}\n */\n protected function send(string $content, array $records): void\n {\n $mime = 'text/plain';\n if ($this->isHtmlBody($content)) {\n $mime = 'text/html';\n }\n\n $message = clone $this->message;\n $message->setBody($content, $mime);\n /** @phpstan-ignore-next-line */\n if (version_compare(Swift::VERSION, '6.0.0', '>=')) {\n $message->setDate(new \\DateTimeImmutable());\n } else {\n /** @phpstan-ignore-next-line */\n $message->setDate(time());\n }\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send-raw.json');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([\n 'key' => $this->apiKey,\n 'raw_message' => (string) $message,\n 'async' => false,\n ]));\n\n Curl\\Util::execute($ch);\n }\n}\n", "meta": {"content_hash": "d3cfe461dd487bf3baa6a91775233d4b", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 127, "avg_line_length": 29.55263157894737, "alnum_prop": 0.57479964381122, "repo_name": "tsugiproject/tsugi", "id": "f49dc1c4c3f2c120689306d5ce62e402593636af", "size": "2473", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Dockerfile", "bytes": "263"}, {"name": "HTML", "bytes": "207"}, {"name": "Hack", "bytes": "3516"}, {"name": "Handlebars", "bytes": "4940"}, {"name": "JavaScript", "bytes": "14832"}, {"name": "PHP", "bytes": "680440"}, {"name": "Shell", "bytes": "524"}]}} +{"text": "\r\nTucnak pedestrian crossing\r\n", "meta": {"content_hash": "e46f90af307ce107bca7e6a245feca09", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 26, "avg_line_length": 15.0, "alnum_prop": 0.8, "repo_name": "MichalDM/hello-world", "id": "fce0ef58383ff0b62d95b307b42e34639023cb0a", "size": "40", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "animals/tucnak.md", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "672"}]}} +{"text": "// # Ghost Editor\r\n//\r\n// Ghost Editor contains a set of modules which make up the editor component\r\n// It manages the left and right panes, and all of the communication between them\r\n// Including scrolling,\r\n\r\n/*global document, $, _, Ghost */\r\n(function () {\r\n 'use strict';\r\n\r\n var Editor = function () {\r\n var self = this,\r\n $document = $(document),\r\n // Create all the needed editor components, passing them what they need to function\r\n markdown = new Ghost.Editor.MarkdownEditor(),\r\n uploadMgr = new Ghost.Editor.UploadManager(markdown),\r\n preview = new Ghost.Editor.HTMLPreview(markdown, uploadMgr),\r\n scrollHandler = new Ghost.Editor.ScrollHandler(markdown, preview),\r\n unloadDirtyMessage,\r\n handleChange,\r\n handleDrag;\r\n\r\n unloadDirtyMessage = function () {\r\n return '==============================\\n\\n' +\r\n 'Hey there! It looks like you\\'re in the middle of writing' +\r\n ' something and you haven\\'t saved all of your content.' +\r\n '\\n\\nSave before you go!\\n\\n' +\r\n '==============================';\r\n };\r\n\r\n handleChange = function () {\r\n self.setDirty(true);\r\n preview.update();\r\n };\r\n\r\n handleDrag = function (e) {\r\n e.preventDefault();\r\n };\r\n\r\n // Public API\r\n _.extend(this, {\r\n enable: function () {\r\n // Listen for changes\r\n $document.on('markdownEditorChange', handleChange);\r\n\r\n // enable editing and scrolling\r\n markdown.enable();\r\n scrollHandler.enable();\r\n },\r\n\r\n disable: function () {\r\n // Don't listen for changes\r\n $document.off('markdownEditorChange', handleChange);\r\n\r\n // disable editing and scrolling\r\n markdown.disable();\r\n scrollHandler.disable();\r\n },\r\n\r\n // Get the markdown value from the editor for saving\r\n // Upload manager makes sure the upload markers are removed beforehand\r\n value: function () {\r\n return uploadMgr.value();\r\n },\r\n\r\n setDirty: function (dirty) {\r\n window.onbeforeunload = dirty ? unloadDirtyMessage : null;\r\n }\r\n });\r\n\r\n // Initialise\r\n $document.on('drop dragover', handleDrag);\r\n preview.update();\r\n this.enable();\r\n };\r\n\r\n Ghost.Editor = Ghost.Editor || {};\r\n Ghost.Editor.Main = Editor;\r\n}());", "meta": {"content_hash": "566dacf6db9747d7f24f7b77ff1b0577", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 91, "avg_line_length": 33.64556962025316, "alnum_prop": 0.5052671181339353, "repo_name": "xhhjin/heroku-ghost", "id": "0420d6a694e7c1a45700dc47e26d17f4610c55b9", "size": "2658", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/client/assets/lib/editor/index.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "165743"}, {"name": "Handlebars", "bytes": "51482"}, {"name": "JavaScript", "bytes": "726644"}]}} +{"text": "<?php\n\ndeclare(strict_types=1);\n\nnamespace whatwedo\\TableBundle\\Tests\\App\\Factory;\n\nuse whatwedo\\TableBundle\\Tests\\App\\Entity\\Person;\nuse whatwedo\\TableBundle\\Tests\\App\\Repository\\PersonRepository;\nuse Zenstruck\\Foundry\\ModelFactory;\nuse Zenstruck\\Foundry\\Proxy;\nuse Zenstruck\\Foundry\\RepositoryProxy;\n\n/**\n * @method static Person|Proxy createOne(array $attributes = [])\n * @method static Person[]|Proxy[] createMany(int $number, $attributes = [])\n * @method static Person|Proxy find($criteria)\n * @method static Person|Proxy findOrCreate(array $attributes)\n * @method static Person|Proxy first(string $sortedField = 'id')\n * @method static Person|Proxy last(string $sortedField = 'id')\n * @method static Person|Proxy random(array $attributes = [])\n * @method static Person|Proxy randomOrCreate(array $attributes = [])\n * @method static Person[]|Proxy[] all()\n * @method static Person[]|Proxy[] findBy(array $attributes)\n * @method static Person[]|Proxy[] randomSet(int $number, array $attributes = [])\n * @method static Person[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])\n * @method static PersonRepository|RepositoryProxy repository()\n * @method Person|Proxy create($attributes = [])\n */\nfinal class PersonFactory extends ModelFactory\n{\n protected function getDefaults(): array\n {\n return [\n 'name' => self::faker()->name(),\n ];\n }\n\n protected static function getClass(): string\n {\n return Person::class;\n }\n}\n", "meta": {"content_hash": "9a5dcb2c8cb474119322fbaa77eca63a", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 96, "avg_line_length": 37.19047619047619, "alnum_prop": 0.6722151088348272, "repo_name": "whatwedo/TableBundle", "id": "fa0cf188cbcc3e04810ae429fddf116f1bfb6207", "size": "1562", "binary": false, "copies": "1", "ref": "refs/heads/1.0-dev", "path": "tests/App/Factory/PersonFactory.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "3877"}, {"name": "JavaScript", "bytes": "28280"}, {"name": "Makefile", "bytes": "749"}, {"name": "PHP", "bytes": "183340"}, {"name": "SCSS", "bytes": "1381"}, {"name": "Twig", "bytes": "76123"}]}} +{"text": "\npackage com.francetelecom.clara.cloud.presentation.applications;\n\nimport com.francetelecom.clara.cloud.core.service.exception.ObjectNotFoundException;\nimport com.francetelecom.clara.cloud.coremodel.Application;\nimport com.francetelecom.clara.cloud.presentation.common.AjaxFallbackCustomDataTable;\nimport com.francetelecom.clara.cloud.presentation.common.PageTemplate;\nimport com.francetelecom.clara.cloud.presentation.resource.CacheActivatedImage;\nimport com.francetelecom.clara.cloud.presentation.tools.ApplicationProvider;\nimport com.francetelecom.clara.cloud.presentation.tools.BusinessExceptionHandler;\nimport com.francetelecom.clara.cloud.presentation.tools.WicketSession;\nimport org.apache.wicket.ajax.AjaxRequestTarget;\nimport org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior;\nimport org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;\nimport org.apache.wicket.behavior.AttributeAppender;\nimport org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;\nimport org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;\nimport org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;\nimport org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;\nimport org.apache.wicket.markup.html.WebMarkupContainer;\nimport org.apache.wicket.markup.html.form.CheckBox;\nimport org.apache.wicket.markup.html.form.Form;\nimport org.apache.wicket.markup.html.form.SubmitLink;\nimport org.apache.wicket.markup.html.form.TextField;\nimport org.apache.wicket.markup.html.panel.Panel;\nimport org.apache.wicket.markup.repeater.Item;\nimport org.apache.wicket.model.*;\nimport org.apache.wicket.util.time.Duration;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * ApplicationsTablePanel\n * Panel which show the applications\n *\n * User: Thomas Escalle - tawe8231\n * Entity : FT/OLNC/RD/MAPS/MEP/MSE\n * Updated : $LastChangedDate$\n * @author : $Author$\n * @version : $Revision$\n */\npublic class ApplicationsTablePanel extends Panel {\n\t\n private static final long serialVersionUID = 527385503166750788L;\n \n //private static final transient org.slf4j.Logger logger = LoggerFactory.getLogger(ApplicationsTablePanel.class);\n\n \n AjaxFallbackCustomDataTable<Application, String> dataTable;\n\n CheckBox viewAllCheckBox;\n\n private ApplicationsPage parentPage;\n\n private List<Application> applicationsList;\n private Form<?> searchCriteriaForm;\n private String searchCriteria;\n \n private WebMarkupContainer refreshContainer;\n\n \n public ApplicationsTablePanel(String id) {\n super(id);\n initComponents();\n \n }\n \n private void initComponents() {\n\t\trefreshContainer = new WebMarkupContainer(\"refreshApplication\");\n\t\tadd(refreshContainer.setOutputMarkupId(true));\n\t\t\n\t\t\t\n\t\t}\n\n private StringResourceModel getStringResourceModel(java.lang.String key) {\n // BVA fix Localizer warning : cf. https://issues.apache.org/jira/browse/WICKET-990\n return new StringResourceModel(key, this, null);\n }\n\n private void initTable(){\n final List<IColumn<Application, String>> columns = new ArrayList<IColumn<Application, String>>();\n\n columns.add(new PropertyColumn<Application, String>(getStringResourceModel(\"portal.application.table.header.name\"), \"label\", \"label\") {\n private static final long serialVersionUID = -5548238873027346512L;\n\n @Override\n public void populateItem(Item<ICellPopulator<Application>> cellItem, String id, IModel<Application> appIModel) {\n cellItem.add(new ApplicationDetailsLinkPanel(id, appIModel));\n cellItem.add(new AttributeAppender(\"title\", appIModel.getObject().getLabel()));\n }\n\n @Override\n public String getCssClass() {\n return \"label ellipsis\";\n }\n });\n\n columns.add(new PropertyColumn<Application, String>(getStringResourceModel(\"portal.application.table.header.appCode\"), \"code\", \"code\") {\n\t\t\tprivate static final long serialVersionUID = 2743741360422459728L;\n\n\t\t\t@Override\n public void populateItem(Item<ICellPopulator<Application>> item, String componentId, IModel<Application> rowModel) {\n super.populateItem(item, componentId, rowModel);\n item.add(new AttributeAppender(\"title\", rowModel.getObject().getCode()));\n }\n\n @Override\n public String getCssClass() {\n return \"label ellipsis\";\n }\n });\n\n columns.add(new PropertyColumn<Application, String>(getStringResourceModel(\"portal.application.table.header.description\"), \"description\", \"description\"));\n\n columns.add(new PropertyColumn<Application, String>(getStringResourceModel(\"portal.application.table.header.visibility\"), \"visibility\", \"visibility\") {\n \t\t\tprivate static final long serialVersionUID = -2362613895284301548L;\n\n\t\t\t@Override\n public void populateItem(Item<ICellPopulator<Application>> iCellPopulatorItem, String componentId, IModel<Application> appIModel) {\n iCellPopulatorItem.add(new ApplicationVisibilityPanel(componentId, appIModel));\n }\n\n @Override\n public String getCssClass() {\n return \"actionShort actionCenter\";\n }\n });\n\n columns.add(new AbstractColumn<Application, String>(getStringResourceModel(\"portal.application.table.header.actions\")) {\n private static final long serialVersionUID = -2548831025324697929L;\n\n @Override\n public void populateItem(Item<ICellPopulator<Application>> iCellPopulatorItem, String componentId, IModel<Application> appIModel) {\n ApplicationActionPanel appActPanel = null;\n try {\n appActPanel = new ApplicationActionPanel(componentId, appIModel, parentPage.getManageApplication().canBeDeleted(appIModel.getObject().getUID()));\n } catch (ObjectNotFoundException e) {\n BusinessExceptionHandler handler = new BusinessExceptionHandler(parentPage);\n handler.error(e);\n }\n iCellPopulatorItem.add(appActPanel);\n }\n\n @Override\n public String getCssClass() {\n return \"actionShort actionCenter\";\n }\n });\n\n //ApplicationProvider appProv = new ApplicationProvider(this, viewAllCheckBox.getModel(), parentPage.getManageApplication());\n ApplicationProvider appProv = new ApplicationProvider(searchCriteria, applicationsList);\n\n dataTable = new AjaxFallbackCustomDataTable<>(\"applicationsDataTable\",columns,appProv, PageTemplate.ROWS_PER_PAGE);\n dataTable.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(60)));\n addOrReplace(dataTable);\n }\n\n @Override\n protected void onBeforeRender() {\n\n this.parentPage = (ApplicationsPage) getPage();\n\n createSearchCriteriaForm();\n \n viewAllCheckBox = new AjaxCheckBox(\"allAppsCheckbox\", new Model<Boolean>(WicketSession.get().getViewAll())) {\n\t\t\tprivate static final long serialVersionUID = -336651607302799133L;\n\n\t\t\t@Override\n protected void onUpdate(AjaxRequestTarget target) {\n WicketSession.get().setViewAll(getModelObject());\n getApplicationsFromDB();\n //\n initTable();\n refreshContainer.replace(dataTable);\n target.add(refreshContainer);\n \n }\n };\n searchCriteriaForm.addOrReplace(viewAllCheckBox);\n\n getApplicationsFromDB();\n \n initTable();\n refreshContainer.addOrReplace(dataTable) ;\n super.onBeforeRender();\n }\n \n \n private void getApplicationsFromDB() {\n \tapplicationsList = new ArrayList<Application>();\n \tif (viewAllCheckBox.getModelObject()) {\n \t\tapplicationsList = parentPage.getManageApplication().findApplications();\n } else {\n \tapplicationsList = parentPage.getManageApplication().findMyApplications();\n }\n \t\n }\n\n\n private void createSearchCriteriaForm() {\n \tsearchCriteriaForm = new Form<Void>(\"searchCriteriaForm\");\n \tsearchCriteriaForm.add(new CacheActivatedImage(\"imageHelp.searchField\", new ResourceModel(\"image.help\").getObject()));\n \taddOrReplace(searchCriteriaForm);\n\t\tsearchCriteriaForm.add(new TextField<String>(\"searchCriteria\", new PropertyModel<String>(this, \"searchCriteria\")));\n\t\tSubmitLink searchLink = new SubmitLink(\"searchLink\");\n\t\tCacheActivatedImage imageSearch = new CacheActivatedImage(\"imageSearch\", new ResourceModel(\"image.help\").getObject());\n\t\tsearchLink.add(imageSearch);\n\t\tsearchCriteriaForm.add(searchLink);\n }\n\n}\n", "meta": {"content_hash": "5e4201c3ca1a1cb61a4fb2b5219cb6cd", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 165, "avg_line_length": 41.405660377358494, "alnum_prop": 0.7058555479608111, "repo_name": "Orange-OpenSource/elpaaso-core", "id": "08c077050c64103259b2829f67e856fe050ae781", "size": "9359", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cloud-paas/cloud-paas-webapp/cloud-paas-webapp-war/src/main/java/com/francetelecom/clara/cloud/presentation/applications/ApplicationsTablePanel.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "3983"}, {"name": "CSS", "bytes": "78369"}, {"name": "Cucumber", "bytes": "55546"}, {"name": "HTML", "bytes": "170257"}, {"name": "Java", "bytes": "4183310"}, {"name": "JavaScript", "bytes": "5958"}]}} +{"text": "import { Routes } from '@angular/router';\nimport { HomeComponent } from './home/home.component';\nimport { ProfileComponent } from './profile/profile.component';\nimport { CallbackComponent } from './callback/callback.component';\n// import { DashboardComponent } from './dashboard/dashboard.component';\n// import { BootstrapComponent } from './bootstrap/bootstrap-component.component';\nimport { Error404Component } from './errors/error404.component';\n\nexport const ROUTES: Routes = [\n { path: '', component: HomeComponent },\n { path: 'dashboard', component: Error404Component },\n { path: 'bootstrap/:id', component: Error404Component },\n { path: 'profile', component: ProfileComponent },\n { path: 'callback', component: CallbackComponent },\n { path: '**', redirectTo: '' }\n];\n", "meta": {"content_hash": "db877e6da6abe0a8ec0e170894d9c976", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 83, "avg_line_length": 48.9375, "alnum_prop": 0.7100893997445722, "repo_name": "jackhummah/bootles", "id": "ec0dda5376d066c31372035fd09e10b5ca7cade8", "size": "783", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/app.routes.ts", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "642692"}, {"name": "HTML", "bytes": "476397"}, {"name": "JavaScript", "bytes": "360085"}, {"name": "TypeScript", "bytes": "16808"}]}} +{"text": "/* Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.activiti.engine.impl.persistence.entity;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\n\nimport org.activiti.engine.impl.EventSubscriptionQueryImpl;\nimport org.activiti.engine.impl.Page;\nimport org.activiti.engine.impl.persistence.AbstractManager;\n\n\n/**\n * @author Daniel Meyer\n */\npublic class EventSubscriptionManager extends AbstractManager {\n \n /** keep track of subscriptions created in the current command */\n protected List<EventSubscriptionEntity> createdSignalSubscriptions = new ArrayList<EventSubscriptionEntity>();\n \n public void insert(EventSubscriptionEntity persistentObject) {\n super.insert(persistentObject);\n if(persistentObject instanceof SignalEventSubscriptionEntity) {\n createdSignalSubscriptions.add(persistentObject);\n }\n }\n \n public void deleteEventSubscription(EventSubscriptionEntity persistentObject) {\n getDbSqlSession().delete(persistentObject.getClass(), persistentObject.getId());\n if(persistentObject instanceof SignalEventSubscriptionEntity) {\n createdSignalSubscriptions.remove(persistentObject);\n }\n }\n \n public EventSubscriptionEntity findEventSubscriptionbyId(String id) {\n return (EventSubscriptionEntity) getDbSqlSession().selectOne(\"selectEventSubscription\", id);\n }\n\n public long findEventSubscriptionCountByQueryCriteria(EventSubscriptionQueryImpl eventSubscriptionQueryImpl) {\n final String query = \"selectEventSubscriptionCountByQueryCriteria\"; \n return (Long) getDbSqlSession().selectOne(query, eventSubscriptionQueryImpl);\n }\n\n @SuppressWarnings(\"unchecked\")\n public List<EventSubscriptionEntity> findEventSubscriptionsByQueryCriteria(EventSubscriptionQueryImpl eventSubscriptionQueryImpl, Page page) {\n final String query = \"selectEventSubscriptionByQueryCriteria\"; \n return getDbSqlSession().selectList(query, eventSubscriptionQueryImpl, page);\n }\n\n @SuppressWarnings(\"unchecked\")\n public List<SignalEventSubscriptionEntity> findSignalEventSubscriptionsByEventName(String eventName) {\n final String query = \"selectSignalEventSubscriptionsByEventName\"; \n Set<SignalEventSubscriptionEntity> selectList = new HashSet<SignalEventSubscriptionEntity>( getDbSqlSession().selectList(query, eventName));\n \n // add events created in this command (not visible yet in query)\n for (EventSubscriptionEntity entity : createdSignalSubscriptions) {\n if(entity instanceof SignalEventSubscriptionEntity\n && eventName.equals(entity.getEventName())) {\n selectList.add((SignalEventSubscriptionEntity) entity); \n }\n }\n \n return new ArrayList<SignalEventSubscriptionEntity>(selectList);\n }\n \n @SuppressWarnings(\"unchecked\")\n public List<SignalEventSubscriptionEntity> findSignalEventSubscriptionsByExecution(String executionId) {\n final String query = \"selectSignalEventSubscriptionsByExecution\"; \n Set<SignalEventSubscriptionEntity> selectList = new HashSet<SignalEventSubscriptionEntity>( getDbSqlSession().selectList(query, executionId));\n \n // add events created in this command (not visible yet in query)\n for (EventSubscriptionEntity entity : createdSignalSubscriptions) {\n if(entity instanceof SignalEventSubscriptionEntity \n && executionId.equals(entity.getExecutionId())) {\n selectList.add((SignalEventSubscriptionEntity) entity); \n }\n }\n \n return new ArrayList<SignalEventSubscriptionEntity>(selectList);\n }\n \n @SuppressWarnings(\"unchecked\")\n public List<SignalEventSubscriptionEntity> findSignalEventSubscriptionsByNameAndExecution(String name, String executionId) {\n final String query = \"selectSignalEventSubscriptionsByNameAndExecution\"; \n Map<String,String> params = new HashMap<String, String>();\n params.put(\"executionId\", executionId);\n params.put(\"eventName\", name); \n Set<SignalEventSubscriptionEntity> selectList = new HashSet<SignalEventSubscriptionEntity>( getDbSqlSession().selectList(query, params));\n \n // add events created in this command (not visible yet in query)\n for (EventSubscriptionEntity entity : createdSignalSubscriptions) {\n if(entity instanceof SignalEventSubscriptionEntity\n && executionId.equals(entity.getExecutionId())\n && name.equals(entity.getEventName())) {\n selectList.add((SignalEventSubscriptionEntity) entity); \n }\n }\n \n return new ArrayList<SignalEventSubscriptionEntity>(selectList);\n }\n\n public List<EventSubscriptionEntity> findEventSubscriptions(String executionId, String type) {\n final String query = \"selectEventSubscriptionsByExecutionAndType\"; \n Map<String,String> params = new HashMap<String, String>();\n params.put(\"executionId\", executionId);\n params.put(\"eventType\", type); \n return getDbSqlSession().selectList(query, params); \n }\n \n public List<EventSubscriptionEntity> findEventSubscriptions(String executionId, String type, String activityId) {\n final String query = \"selectEventSubscriptionsByExecutionTypeAndActivity\"; \n Map<String,String> params = new HashMap<String, String>();\n params.put(\"executionId\", executionId);\n params.put(\"eventType\", type);\n params.put(\"activityId\", activityId);\n return getDbSqlSession().selectList(query, params); \n }\n\n public List<EventSubscriptionEntity> findEventSubscriptionsByConfiguration(String type, String configuration) {\n final String query = \"selectEventSubscriptionsByConfiguration\"; \n Map<String,String> params = new HashMap<String, String>();\n params.put(\"eventType\", type);\n params.put(\"configuration\", configuration);\n return getDbSqlSession().selectList(query, params); \n }\n\n public List<EventSubscriptionEntity> findEventSubscriptionByName(String type, String eventName) {\n final String query = \"selectEventSubscriptionsByName\"; \n Map<String,String> params = new HashMap<String, String>();\n params.put(\"eventType\", type);\n params.put(\"eventName\", eventName); \n return getDbSqlSession().selectList(query, params); \n }\n\n public MessageEventSubscriptionEntity findMessageStartEventSubscriptionByName(String messageName) {\n MessageEventSubscriptionEntity entity = (MessageEventSubscriptionEntity) getDbSqlSession().selectOne(\"selectMessageStartEventSubscriptionByName\", messageName);\n return entity;\n }\n \n}\n", "meta": {"content_hash": "bd8803cf658c15c4f65c0921afd5f6c4", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 163, "avg_line_length": 45.42580645161291, "alnum_prop": 0.7585570231501207, "repo_name": "iotsap/FiWare-Template-Handler", "id": "a65d31de9099b8a57943bf426750b8eed70496cd", "size": "7041", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ExecutionEnvironment/modules/activiti-engine/src/main/java/org/activiti/engine/impl/persistence/entity/EventSubscriptionManager.java", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "481305"}, {"name": "Java", "bytes": "8276608"}, {"name": "JavaScript", "bytes": "3364343"}, {"name": "Shell", "bytes": "2529"}, {"name": "XSLT", "bytes": "19610"}]}} +{"text": "\"\"\"\nVarious utilities for working with Python and Matplotlib\n\"\"\"\n\nimport matplotlib\nimport matplotlib.pyplot as plt \nimport numpy as np \nimport os\n\nfrom math import ceil, sqrt\nfrom skimage.io import imread\n\ndef show_images(images,titles=None):\n \"\"\"Display a list of images\"\"\"\n n_ims = len(images)\n if titles is None: titles = ['(%d)' % i for i in range(1,n_ims + 1)]\n fig = plt.figure()\n n = 1\n for image,title in zip(images, titles):\n a = fig.add_subplot(1,n_ims,n) # Make subplot\n if image.ndim == 2: # Is image grayscale?\n plt.gray() # Only place in this blog you can't replace 'gray' with 'grey'\n plt.imshow(image)\n a.set_title(title)\n n += 1\n fig.set_size_inches(np.array(fig.get_size_inches()) * n_ims)\n plt.show()\n\ndef tile_images(lst, size=None):\n \"\"\"\n Given a list of images, display them in a tiled format.\n \"\"\"\n num_plots = len(lst)\n if size is None:\n cols = ceil(sqrt(num_plots))\n rows = ceil(num_plots/cols)\n else:\n rows, cols = size\n\n # Set up the figure\n fig, axes = plt.subplots(rows, cols)\n\n # Plot the images using `plt.imshow`\n for i, x in enumerate(lst):\n ax = axes[i]\n # If the element is a string, assume that it's a path\n if isinstance(x, str):\n try:\n img = imread(os.path.abspath(x))\n ax.imshow(img)\n except IOError:\n print(\"Unable to load image: %s\" %x)\n except Exception as e:\n print(e)\n # Otherwise, attempt to load it as a numpy array\n else:\n try:\n img = np.array(x)\n ax.imshow(img)\n except Exception as e:\n print(e)\n\n # Show the images\n plt.show()\n\n # Return the fig and axes images, in case that is wanted\n return fig, axes", "meta": {"content_hash": "d8f79cf4b8fdcc1c30e291cf2f83c6e6", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 85, "avg_line_length": 28.08955223880597, "alnum_prop": 0.5626992561105207, "repo_name": "clickok/Code-Snippets", "id": "f14cf78130b63c45fa8968becbb0cd4d962abf9c", "size": "1892", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Python-Programming/utils_pyplot.py", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "2421"}, {"name": "HTML", "bytes": "2782"}, {"name": "JavaScript", "bytes": "4156"}, {"name": "Python", "bytes": "42579"}, {"name": "Shell", "bytes": "4041"}]}} +{"text": "/*\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\n/*\n * This code was generated by https://github.com/googleapis/google-api-java-client-services/\n * Modify at your own risk.\n */\n\npackage com.google.api.services.contentwarehouse.v1.model;\n\n/**\n * Saft named-entities info for a given topic.\n *\n * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is\n * transmitted over HTTP when working with the contentwarehouse API. For a detailed explanation see:\n * <a href=\"https://developers.google.com/api-client-library/java/google-http-java-client/json\">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>\n * </p>\n *\n * @author Google, Inc.\n */\n@SuppressWarnings(\"javadoc\")\npublic final class VideoContentSearchSaftEntityInfo extends com.google.api.client.json.GenericJson {\n\n /**\n * Representative canonical name for the entity.\n * The value may be {@code null}.\n */\n @com.google.api.client.util.Key\n private java.lang.String canonicalEntityName;\n\n /**\n * Score indicating the saliency (centrality) of this entity to the original_text.\n * The value may be {@code null}.\n */\n @com.google.api.client.util.Key\n private java.lang.Double entitySalience;\n\n /**\n * The type name, like \"/saft/person\", \"/saft/art\". See README.entity-types for the inventory of\n * SAFT type tags.\n * The value may be {@code null}.\n */\n @com.google.api.client.util.Key\n private java.lang.String entityTypeName;\n\n /**\n * Representative entity name mention extracted from original_text.\n * The value may be {@code null}.\n */\n @com.google.api.client.util.Key\n private java.lang.String mentionText;\n\n /**\n * SAFT Mention type.\n * The value may be {@code null}.\n */\n @com.google.api.client.util.Key\n private java.lang.String mentionType;\n\n /**\n * Freebase MID for entity if this the saft entity corresponds to a Webref KG mid. This field is\n * not always populated and is taken from FREEBASE_MID mid in EntityProfile in the saft entity\n * annotation.\n * The value may be {@code null}.\n */\n @com.google.api.client.util.Key\n private java.lang.String mid;\n\n /**\n * The original input text (e.g. the anchor text) where the saft entity annotation was run on.\n * The value may be {@code null}.\n */\n @com.google.api.client.util.Key\n private java.lang.String originalText;\n\n /**\n * Representative canonical name for the entity.\n * @return value or {@code null} for none\n */\n public java.lang.String getCanonicalEntityName() {\n return canonicalEntityName;\n }\n\n /**\n * Representative canonical name for the entity.\n * @param canonicalEntityName canonicalEntityName or {@code null} for none\n */\n public VideoContentSearchSaftEntityInfo setCanonicalEntityName(java.lang.String canonicalEntityName) {\n this.canonicalEntityName = canonicalEntityName;\n return this;\n }\n\n /**\n * Score indicating the saliency (centrality) of this entity to the original_text.\n * @return value or {@code null} for none\n */\n public java.lang.Double getEntitySalience() {\n return entitySalience;\n }\n\n /**\n * Score indicating the saliency (centrality) of this entity to the original_text.\n * @param entitySalience entitySalience or {@code null} for none\n */\n public VideoContentSearchSaftEntityInfo setEntitySalience(java.lang.Double entitySalience) {\n this.entitySalience = entitySalience;\n return this;\n }\n\n /**\n * The type name, like \"/saft/person\", \"/saft/art\". See README.entity-types for the inventory of\n * SAFT type tags.\n * @return value or {@code null} for none\n */\n public java.lang.String getEntityTypeName() {\n return entityTypeName;\n }\n\n /**\n * The type name, like \"/saft/person\", \"/saft/art\". See README.entity-types for the inventory of\n * SAFT type tags.\n * @param entityTypeName entityTypeName or {@code null} for none\n */\n public VideoContentSearchSaftEntityInfo setEntityTypeName(java.lang.String entityTypeName) {\n this.entityTypeName = entityTypeName;\n return this;\n }\n\n /**\n * Representative entity name mention extracted from original_text.\n * @return value or {@code null} for none\n */\n public java.lang.String getMentionText() {\n return mentionText;\n }\n\n /**\n * Representative entity name mention extracted from original_text.\n * @param mentionText mentionText or {@code null} for none\n */\n public VideoContentSearchSaftEntityInfo setMentionText(java.lang.String mentionText) {\n this.mentionText = mentionText;\n return this;\n }\n\n /**\n * SAFT Mention type.\n * @return value or {@code null} for none\n */\n public java.lang.String getMentionType() {\n return mentionType;\n }\n\n /**\n * SAFT Mention type.\n * @param mentionType mentionType or {@code null} for none\n */\n public VideoContentSearchSaftEntityInfo setMentionType(java.lang.String mentionType) {\n this.mentionType = mentionType;\n return this;\n }\n\n /**\n * Freebase MID for entity if this the saft entity corresponds to a Webref KG mid. This field is\n * not always populated and is taken from FREEBASE_MID mid in EntityProfile in the saft entity\n * annotation.\n * @return value or {@code null} for none\n */\n public java.lang.String getMid() {\n return mid;\n }\n\n /**\n * Freebase MID for entity if this the saft entity corresponds to a Webref KG mid. This field is\n * not always populated and is taken from FREEBASE_MID mid in EntityProfile in the saft entity\n * annotation.\n * @param mid mid or {@code null} for none\n */\n public VideoContentSearchSaftEntityInfo setMid(java.lang.String mid) {\n this.mid = mid;\n return this;\n }\n\n /**\n * The original input text (e.g. the anchor text) where the saft entity annotation was run on.\n * @return value or {@code null} for none\n */\n public java.lang.String getOriginalText() {\n return originalText;\n }\n\n /**\n * The original input text (e.g. the anchor text) where the saft entity annotation was run on.\n * @param originalText originalText or {@code null} for none\n */\n public VideoContentSearchSaftEntityInfo setOriginalText(java.lang.String originalText) {\n this.originalText = originalText;\n return this;\n }\n\n @Override\n public VideoContentSearchSaftEntityInfo set(String fieldName, Object value) {\n return (VideoContentSearchSaftEntityInfo) super.set(fieldName, value);\n }\n\n @Override\n public VideoContentSearchSaftEntityInfo clone() {\n return (VideoContentSearchSaftEntityInfo) super.clone();\n }\n\n}\n", "meta": {"content_hash": "028a514c528c90e5b6c02ef2287de819", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 182, "avg_line_length": 32.0, "alnum_prop": 0.7106164383561644, "repo_name": "googleapis/google-api-java-client-services", "id": "e1b534a626c44015c0a53281ded94c34c5231f87", "size": "7008", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "clients/google-api-services-contentwarehouse/v1/2.0.0/com/google/api/services/contentwarehouse/v1/model/VideoContentSearchSaftEntityInfo.java", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\n\npackage org.openspaces.persistency.hibernate.iterator;\n\nimport com.gigaspaces.datasource.DataIterator;\nimport org.hibernate.CacheMode;\nimport org.hibernate.Criteria;\nimport org.hibernate.FlushMode;\nimport org.hibernate.Session;\nimport org.hibernate.SessionFactory;\nimport org.hibernate.Transaction;\nimport org.hibernate.criterion.Example;\n\nimport java.util.Iterator;\n\n/**\n * A simple iterator that iterates over template object using Hibernate Criteria\n * by example.\n *\n * @author kimchy\n */\npublic class DefaultCriteriaByExampleDataIterator implements DataIterator {\n\n protected final Object template;\n\n protected final SessionFactory sessionFactory;\n\n protected Transaction transaction;\n\n protected Session session;\n\n private Iterator iterator;\n\n public DefaultCriteriaByExampleDataIterator(Object template, SessionFactory sessionFactory) {\n this.template = template;\n this.sessionFactory = sessionFactory;\n }\n\n public boolean hasNext() {\n if (iterator == null) {\n iterator = createIterator();\n }\n return iterator.hasNext();\n }\n\n public Object next() {\n return iterator.next();\n }\n\n public void remove() {\n throw new UnsupportedOperationException(\"remove not supported\");\n }\n\n public void close() {\n try {\n if (transaction == null) {\n return;\n }\n transaction.commit();\n } finally {\n transaction = null;\n if (session != null && session.isOpen()) {\n session.close();\n }\n }\n }\n\n protected Iterator createIterator() {\n session = sessionFactory.openSession();\n transaction = session.beginTransaction();\n Example example = Example.create(template);\n Criteria criteria = session.createCriteria(template.getClass()).add(example);\n criteria.setCacheMode(CacheMode.IGNORE);\n criteria.setCacheable(false);\n criteria.setFlushMode(FlushMode.NEVER);\n return criteria.list().iterator();\n }\n}", "meta": {"content_hash": "d0c0b7faf564a8a1c8a65d8b6a85774d", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 97, "avg_line_length": 26.474358974358974, "alnum_prop": 0.661501210653753, "repo_name": "Gigaspaces/xap-openspaces", "id": "f4bd31e24e7a4fe52dd66e2fb3e73c192cdb6767", "size": "2685", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/openspaces/persistency/hibernate/iterator/DefaultCriteriaByExampleDataIterator.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "1107"}, {"name": "Groovy", "bytes": "5372"}, {"name": "HTML", "bytes": "13501"}, {"name": "Java", "bytes": "8666667"}, {"name": "Shell", "bytes": "917"}]}} +{"text": "'use strict';\n\nvar gulp = require('gulp'),\n\tgutil = require('gulp-util'),\n\tlivereload = require('gulp-livereload'),\n\tnotify = require('gulp-notify'),\n\tpostcss = require('gulp-postcss'),\n\trename = require('gulp-rename'),\n\tsass = require('gulp-sass'),\n\tsourcemaps = require('gulp-sourcemaps');\n\ngulp.task('styles', function() {\n\treturn gulp.src(['src/scss/screen.scss', 'src/scss/ie.scss'])\n\t\t.pipe(sourcemaps.init())\n\t\t.pipe(sass())\n\t\t.on('error', notify.onError({\n\t\t\ticon: 'gulp/developer/icon-notify-styles.jpg',\n\t\t\ttitle: 'SCSS error',\n\t\t\tmessage: '<%= error.message %>'\n\t\t}))\n\t\t.pipe(postcss([\n\t\t\trequire('autoprefixer')({ browsers: [ 'last 3 versions' ]})\n\t\t]))\n\t\t.pipe(gutil.env.production ? require('gulp-cssnano')() : gutil.noop())\n\t\t.pipe(sourcemaps.write('.'))\n\t\t.pipe(gutil.env.production ? rename(function(path) {\n\t\t\tpath.basename = path.extname === '.map' ?\n\t\t\t\tpath.basename.replace(/\\.(.*)$/, '.min.$1') :\n\t\t\tpath.basename + '.min';\n\t\t}) : gutil.noop())\n\t\t.pipe(!gutil.env.production ? livereload() : gutil.noop())\n\t\t.pipe(gulp.dest('assets/css'))\n});\n", "meta": {"content_hash": "2dd831bba70b52135bac88a619ea3ace", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 72, "avg_line_length": 35.75757575757576, "alnum_prop": 0.5703389830508474, "repo_name": "dviate/html5-boilerplate", "id": "f390374272286db7ad4ae051a881737fd5326fd2", "size": "1180", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gulp/tasks/styles.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "21549"}, {"name": "JavaScript", "bytes": "5758"}, {"name": "PHP", "bytes": "2633"}]}} +{"text": "\n\npackage com.hazelcast.nio.serialization;\n\nimport java.io.IOException;\n\n/**\n * Portable provides an alternative serialization method. Instead of relying on reflection, each Portable is\n * created by a registered {@link com.hazelcast.nio.serialization.PortableFactory}.\n *\n * <p>\n *\n * Portable serialization has the following advantages:\n * <ul>\n * <li>Support multiple versions of the same object type.\n * (See {@link com.hazelcast.config.SerializationConfig#setPortableVersion(int)})</li>\n * <li>Fetching individual fields without having to rely on reflection.</li>\n * <li>Querying and indexing support without de-serialization and/or reflection.</li>\n * </ul>\n *\n * @see com.hazelcast.nio.serialization.PortableFactory\n * @see PortableWriter\n * @see PortableReader\n * @see ClassDefinition\n * @see com.hazelcast.nio.serialization.DataSerializable\n * @see com.hazelcast.nio.serialization.IdentifiedDataSerializable\n * @see com.hazelcast.config.SerializationConfig\n */\n\npublic interface Portable {\n\n /**\n * Returns PortableFactory ID for this portable class\n * @return factory ID\n */\n int getFactoryId();\n\n /**\n * Returns class identifier for this portable class. Class ID should be unique per PortableFactory.\n * @return class ID\n */\n int getClassId();\n\n /**\n * Serialize this portable object using PortableWriter\n *\n * @param writer PortableWriter\n * @throws IOException in case of any exceptional case\n */\n void writePortable(PortableWriter writer) throws IOException;\n\n /**\n * Read portable fields using PortableReader\n *\n * @param reader PortableReader\n * @throws IOException in case of any exceptional case\n */\n void readPortable(PortableReader reader) throws IOException;\n}\n", "meta": {"content_hash": "ef0c58b1203410d3a86cf2a1fe7e4e46", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 108, "avg_line_length": 30.271186440677965, "alnum_prop": 0.713885778275476, "repo_name": "mdogan/hazelcast", "id": "b5beac6b4372050fb4350275bdf72b38351e5f90", "size": "2411", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hazelcast/src/main/java/com/hazelcast/nio/serialization/Portable.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "1862"}, {"name": "C", "bytes": "3721"}, {"name": "Java", "bytes": "45797218"}, {"name": "Shell", "bytes": "30002"}]}} +{"text": "\ufeff---\nuid: SolidEdgePart.Model.ResizeRounds\nsummary: \nremarks: \n---\n", "meta": {"content_hash": "ce5e33bd1336488ee5160127d24b1e7e", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 37, "avg_line_length": 13.4, "alnum_prop": 0.7014925373134329, "repo_name": "SolidEdgeCommunity/docs", "id": "5b3bfdec6a9d597a3b113f327a4f3ee17a551dd6", "size": "69", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docfx_project/apidoc/SolidEdgePart.Model.ResizeRounds.md", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "38"}, {"name": "C#", "bytes": "5048212"}, {"name": "C++", "bytes": "2265"}, {"name": "CSS", "bytes": "148"}, {"name": "PowerShell", "bytes": "180"}, {"name": "Smalltalk", "bytes": "1996"}, {"name": "Visual Basic", "bytes": "10236277"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"ro\">\n<head>\n<!-- Generated by javadoc (version 1.7.0_07) on Tue May 27 14:37:26 EEST 2014 -->\n<title>Uses of Class net.sf.jasperreports.web.util.WebResourceHandlersExtensionRegistryFactory (JasperReports 5.6.0 API)</title>\n<meta name=\"date\" content=\"2014-05-27\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"Uses of Class net.sf.jasperreports.web.util.WebResourceHandlersExtensionRegistryFactory (JasperReports 5.6.0 API)\";\n }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!-- -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"../package-summary.html\">Package</a></li>\n<li><a href=\"../../../../../../net/sf/jasperreports/web/util/WebResourceHandlersExtensionRegistryFactory.html\" title=\"class in net.sf.jasperreports.web.util\">Class</a></li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../index.html?net/sf/jasperreports/web/util/class-use/WebResourceHandlersExtensionRegistryFactory.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"WebResourceHandlersExtensionRegistryFactory.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h2 title=\"Uses of Class net.sf.jasperreports.web.util.WebResourceHandlersExtensionRegistryFactory\" class=\"title\">Uses of Class<br>net.sf.jasperreports.web.util.WebResourceHandlersExtensionRegistryFactory</h2>\n</div>\n<div class=\"classUseContainer\">No usage of net.sf.jasperreports.web.util.WebResourceHandlersExtensionRegistryFactory</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!-- -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"../package-summary.html\">Package</a></li>\n<li><a href=\"../../../../../../net/sf/jasperreports/web/util/WebResourceHandlersExtensionRegistryFactory.html\" title=\"class in net.sf.jasperreports.web.util\">Class</a></li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../index.html?net/sf/jasperreports/web/util/class-use/WebResourceHandlersExtensionRegistryFactory.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"WebResourceHandlersExtensionRegistryFactory.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n<p class=\"legalCopy\"><small>\n\n<span style=\"font-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:8pt;font-style:normal;color:#000000;\">© 2001-2010 Jaspersoft Corporation <a href=\"http://www.jaspersoft.com\" target=\"_blank\" style=\"color:#000000;\">www.jaspersoft.com</a></span>\n\n\t\t\t</small></p>\n</body>\n</html>\n", "meta": {"content_hash": "df3b3de1364c6959fb007b8cdf824181", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 265, "avg_line_length": 41.15833333333333, "alnum_prop": 0.644057501518526, "repo_name": "phurtado1112/cnaemvc", "id": "75d406388f140762dd2f316fca88a274d092ecc7", "size": "4939", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/JasperReport__5.6/docs/api/net/sf/jasperreports/web/util/class-use/WebResourceHandlersExtensionRegistryFactory.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "11139"}, {"name": "HTML", "bytes": "112926414"}, {"name": "Java", "bytes": "532942"}]}} +{"text": "using System.ComponentModel;\nusing Windows.ApplicationModel.DataTransfer;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Navigation;\nusing Windows.UI.Xaml;\nusing AppStudio.DataProviders.LocalStorage;\nusing AppStudio.DataProviders.Html;\nusing NguyenAnNinhConfession.Sections;\nusing NguyenAnNinhConfession.ViewModels;\nusing AppStudio.Uwp;\n\nnamespace NguyenAnNinhConfession.Pages\n{\n public sealed partial class AboutThisApp1ListPage : Page\n {\n\t public ListViewModel ViewModel { get; set; }\n\n private DataTransferManager _dataTransferManager;\n\t\tpublic static readonly DependencyProperty HtmlContentProperty =\n DependencyProperty.Register(\"HtmlContent\", typeof(string), typeof(AboutThisApp1ListPage), new PropertyMetadata(string.Empty));\n public AboutThisApp1ListPage()\n {\n\t\t\tthis.ViewModel = ListViewModel.CreateNew(Singleton<AboutThisApp1Config>.Instance);\n\n this.InitializeComponent();\n\n }\n\n public string HtmlContent\n {\n get { return (string)GetValue(HtmlContentProperty); }\n set { SetValue(HtmlContentProperty, value); }\n }\n\n protected override async void OnNavigatedTo(NavigationEventArgs e)\n {\n await this.ViewModel.LoadDataAsync();\n\t\t\tif (ViewModel.Items != null && ViewModel.Items.Count > 0)\n\t\t\t{\n HtmlContent = ViewModel.Items[0].Content;\n }\n _dataTransferManager = DataTransferManager.GetForCurrentView();\n _dataTransferManager.DataRequested += OnDataRequested;\n\n base.OnNavigatedTo(e);\n }\n\n protected override void OnNavigatedFrom(NavigationEventArgs e)\n {\n _dataTransferManager.DataRequested -= OnDataRequested;\n\n base.OnNavigatedFrom(e);\n }\n\n private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)\n {\n ViewModel.ShareContent(args.Request);\n }\n }\n}\n", "meta": {"content_hash": "4867b220652a8fdc8593226508fb6db5", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 138, "avg_line_length": 32.766666666666666, "alnum_prop": 0.6912512716174974, "repo_name": "goldenskygiang/NANConfessionClient", "id": "a37dedffee901d087caa2dd163660e9d180e5407", "size": "1966", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "UWP/NguyenAnNinhConfession.W10/Pages/AboutThisApp1ListPage.xaml.cs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C#", "bytes": "116846"}, {"name": "HTML", "bytes": "157"}]}} +{"text": "package domain\n\nimport (\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n\n\t\"go-common/app/interface/main/app-resource/conf\"\n\n\t. \"github.com/smartystreets/goconvey/convey\"\n)\n\nvar (\n\ts *Service\n)\n\nfunc WithService(f func(s *Service)) func() {\n\treturn func() {\n\t\tf(s)\n\t}\n}\n\nfunc init() {\n\tdir, _ := filepath.Abs(\"../../cmd/app-resource-test.toml\")\n\tflag.Set(\"conf\", dir)\n\tconf.Init()\n\ts = New(conf.Conf)\n\ttime.Sleep(time.Second)\n}\n\nfunc TestDomain(t *testing.T) {\n\tConvey(\"get Domain data\", t, WithService(func(s *Service) {\n\t\tres := s.Domain()\n\t\tresult, _ := json.Marshal(res)\n\t\tfmt.Printf(\"test Domain (%v) \\n\", string(result))\n\t\tSo(res, ShouldNotBeEmpty)\n\t}))\n}\n", "meta": {"content_hash": "70728a8da29a6801ab7a8ac295963d3c", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 60, "avg_line_length": 16.634146341463413, "alnum_prop": 0.6422287390029325, "repo_name": "LQJJ/demo", "id": "b6971dc274ab1c2054a32c596d786de72ec62ad5", "size": "682", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "126-go-common-master/app/interface/main/app-resource/service/domain/domain_test.go", "mode": "33261", "license": "apache-2.0", "language": [{"name": "C", "bytes": "5910716"}, {"name": "C++", "bytes": "113072"}, {"name": "CSS", "bytes": "10791"}, {"name": "Dockerfile", "bytes": "934"}, {"name": "Go", "bytes": "40121403"}, {"name": "Groovy", "bytes": "347"}, {"name": "HTML", "bytes": "359263"}, {"name": "JavaScript", "bytes": "545384"}, {"name": "Makefile", "bytes": "6671"}, {"name": "Mathematica", "bytes": "14565"}, {"name": "Objective-C", "bytes": "14900720"}, {"name": "Objective-C++", "bytes": "20070"}, {"name": "PureBasic", "bytes": "4152"}, {"name": "Python", "bytes": "4490569"}, {"name": "Ruby", "bytes": "44850"}, {"name": "Shell", "bytes": "33251"}, {"name": "Swift", "bytes": "463286"}, {"name": "TSQL", "bytes": "108861"}]}} +{"text": "<?php\n/**\n * vpopqmail\n *\n * @license http://opensource.org/licenses/MIT MIT\n */\n\ninterface MazelabVpopqmail_Model_Dataprovider_Interface_MailingList\n{\n\n /**\n * deletes a certain mailing list\n * \n * @param MazelabVpopqmail_Model_ValueObject_MailingList $mailingList\n * @return boolean\n */\n public function deleteMailingList(MazelabVpopqmail_Model_ValueObject_MailingList $mailingList);\n\n /**\n * returns content of mailing list from given id\n * \n * @param string $id\n * @return array\n */\n public function getMailingList($id);\n \n /**\n * returns content of mailing list from given email\n * \n * @param string $email\n * @return array\n */\n public function getMailingListByEmail($email);\n \n /**\n * get all mailing lists\n * \n * @return array\n */ \n public function getMailingLists();\n \n /**\n * returns all mailing lists of a certain domain\n * \n * @param string $id\n * @return array\n */ \n public function getMailingListsByDomain($domainId);\n\n /**\n * saves given data set to a certain mailing list\n * \n * if id is not provided, it will create a new item\n * \n * @param string $mailingListId\n * @param array $data\n * @return string|false id of saved item\n */\n public function saveMailingList(array $data, $mailingListId = null);\n\n}\n", "meta": {"content_hash": "18419dbe5561a568092fbc102c4dfbff", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 99, "avg_line_length": 22.918032786885245, "alnum_prop": 0.6137339055793991, "repo_name": "mazelab/vpopqmail", "id": "36385a76c1743fab192cb17615d118ed67a40c95", "size": "1398", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "models/Dataprovider/Interface/MailingList.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "4074"}, {"name": "PHP", "bytes": "486295"}]}} +{"text": "#ifndef ALINOUS_RUNTIME_PARALLEL_CONCURRENTTASKEXEXUTOR_H_\n#define ALINOUS_RUNTIME_PARALLEL_CONCURRENTTASKEXEXUTOR_H_\nnamespace alinous{namespace annotation{\nclass OneSource;\n}}\nnamespace alinous {namespace runtime {namespace parallel {\nclass ThreadPool;}}}\n\nnamespace alinous {namespace runtime {namespace parallel {\nclass LaunchJoin;}}}\n\nnamespace alinous {namespace runtime {namespace parallel {\nclass IParallelTask;}}}\n\nnamespace alinous {namespace runtime {namespace parallel {\nclass ConcurrentTaskQueue;}}}\n\nnamespace java {namespace lang {\nclass InterruptedException;}}\n\nnamespace java {namespace util {\ntemplate <typename T> class LinkedList;}}\n\nnamespace alinous {namespace lock {\nclass LockObject;}}\n\nnamespace alinous {namespace runtime {namespace parallel {\nclass AlinousThread;}}}\n\nnamespace alinous {namespace runtime {namespace parallel {\nclass ConcurrentTaskExexutor;}}}\n\nnamespace alinous {namespace runtime {namespace parallel {\nclass IThreadAction;}}}\n\nnamespace java {namespace lang {\nclass IObject;\n}}\n\nnamespace alinous {\nclass ThreadContext;\n}\n\nnamespace alinous {namespace runtime {namespace parallel {\n\nusing namespace ::alinous;\nusing namespace ::java::lang;\nusing ::java::util::Iterator;\nusing ::java::util::LinkedList;\nusing ::alinous::lock::LockObject;\n\n\n\nclass ConcurrentTaskExexutor final : public virtual IObject {\npublic:\n\tclass FinalyzerEntryPoint;\n\tclass LauncherEntryPoint;\n\tConcurrentTaskExexutor(const ConcurrentTaskExexutor& base) = default;\npublic:\n\tConcurrentTaskExexutor(ThreadPool* pool, ThreadContext* ctx) throw() ;\n\tvoid __construct_impl(ThreadPool* pool, ThreadContext* ctx) throw() ;\n\tvirtual ~ConcurrentTaskExexutor() throw();\n\tvirtual void __releaseRegerences(bool prepare, ThreadContext* ctx) throw();\nprivate:\n\tLinkedList<ConcurrentTaskQueue>* queue;\n\tLinkedList<ConcurrentTaskQueue>* readyQueue;\n\tLockObject* sync;\n\tAlinousThread* finalizer;\n\tLaunchJoin* finalizerLaunchJoin;\n\tAlinousThread* launcher;\n\tLaunchJoin* launcherLaunchJoin;\n\tbool finalizerEnds;\n\tConcurrentTaskQueue* lastTask;\n\tThreadPool* pool;\npublic:\n\tvoid begin(ThreadContext* ctx);\n\tvoid startTask(IParallelTask* task, ThreadContext* ctx) throw() ;\n\tvoid flush(ThreadContext* ctx);\n\tvoid dispose(ThreadContext* ctx) throw() ;\nprivate:\n\tvoid finalizeLoop(ThreadContext* ctx);\n\tvoid launcherLoop(ThreadContext* ctx);\n\tvoid asyncStart(ThreadContext* ctx);\npublic:\n\n\n\n\tclass FinalyzerEntryPoint final : public IThreadAction, public virtual IObject {\n\tpublic:\n\t\tFinalyzerEntryPoint(const FinalyzerEntryPoint& base) = default;\n\tpublic:\n\t\tFinalyzerEntryPoint(ConcurrentTaskExexutor* exec, ThreadContext* ctx) throw() ;\n\t\tvoid __construct_impl(ConcurrentTaskExexutor* exec, ThreadContext* ctx) throw() ;\n\t\tvirtual ~FinalyzerEntryPoint() throw();\n\t\tvirtual void __releaseRegerences(bool prepare, ThreadContext* ctx) throw();\n\tprivate:\n\t\tConcurrentTaskExexutor* executor;\n\tpublic:\n\t\tvoid execute(ThreadContext* ctx) throw() final;\n\tpublic:\n\t\tstatic bool __init_done;\n\t\tstatic bool __init_static_variables();\n\tpublic:\n\t\tstatic void __cleanUp(ThreadContext* ctx);\n\t};\n\n\n\n\n\tclass LauncherEntryPoint final : public IThreadAction, public virtual IObject {\n\tpublic:\n\t\tLauncherEntryPoint(const LauncherEntryPoint& base) = default;\n\tpublic:\n\t\tLauncherEntryPoint(ConcurrentTaskExexutor* exec, ThreadContext* ctx) throw() ;\n\t\tvoid __construct_impl(ConcurrentTaskExexutor* exec, ThreadContext* ctx) throw() ;\n\t\tvirtual ~LauncherEntryPoint() throw();\n\t\tvirtual void __releaseRegerences(bool prepare, ThreadContext* ctx) throw();\n\tprivate:\n\t\tConcurrentTaskExexutor* exec;\n\tpublic:\n\t\tvoid execute(ThreadContext* ctx) throw() final;\n\tpublic:\n\t\tstatic bool __init_done;\n\t\tstatic bool __init_static_variables();\n\tpublic:\n\t\tstatic void __cleanUp(ThreadContext* ctx);\n\t};\n\n\tstatic bool __init_done;\n\tstatic bool __init_static_variables();\npublic:\n\tstatic void __cleanUp(ThreadContext* ctx);\n};\n\n}}}\n\n#endif /* end of ALINOUS_RUNTIME_PARALLEL_CONCURRENTTASKEXEXUTOR_H_ */\n", "meta": {"content_hash": "3f6d1978433b3314e4955bc3b3804649", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 83, "avg_line_length": 28.934306569343065, "alnum_prop": 0.7754793138244198, "repo_name": "alinous-core/alinous-elastic-db", "id": "375ae14ae348efc22ccb8918a484917129be7022", "size": "3964", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/src_java/alinous.runtime.parallel/ConcurrentTaskExexutor.h", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "7447"}, {"name": "C++", "bytes": "14486500"}, {"name": "CMake", "bytes": "223064"}]}} +{"text": "layout: post\ntitle: Insertion sort on small arrays in merge sort\ndate: 2015-08-30 15:04\ntags: CLRS Algorithms\n---\n\n2.1 Although merge sort runs in $$\\Theta(n \\lg n)$$ worst-case time and isnertion sort runs in $$\\Theta(n^2)$$ worst-case time, the constant factors in insertion sort can make it faster in practice for small problem sizes on many machines. Thus, it makes sense to coarsen the leaves of the recursion by using insertion sort within merge sort when subproblems become sufficiently small. Consider a modification to merge sort in which $$n/k$$ sublists of length $$k$$ are sorted using insertion sort and then merged using the standard merging mechanism, where $$k$$ is a value to be determined.\n\n1. Show that insertion sort can sort the $$n/k$$ sublists, each of length $$k$$, in $$\\Theta(nk)$$ worst-case time. \nWe know that insertion sort runs in $$\\Theta(n^2)$$ time where $$n$$ is the size of the list. Thus when the list is of size $$k$$, the worst case time is $$\\Theta(k^2)$$. Repeating this $$n/k$$ times (once for each of the $$n/k$$ sublists), we get $$n/k\\Theta(k^2)=\\Theta(nk)$$.\n\n2. Show how to merge the sublists in $$\\Theta(n\\lg(n/k))$$ worst-case time. \nWe merge sublists the exact same way as we did in regular mergesort. As before, there are $$n$$ elements at each level. Thus the merges cost $$\\Theta(n)$$ at each level. To see how many levels there are we note that recursion bottoms out when the size of the list is less than $$k$$, thus the number of levels, $$l$$, satisfies $$n(\\frac{1}{2}^l)\\leq k \\Rightarrow n\\leq k2^l \\Rightarrow n/k \\leq 2^l \\Rightarrow \\lg(n/k) \\leq l$$. Therefore $$l = \\lceil\\lg(n/k)\\rceil$$ and we can merge sublists in $$\\Theta(n\\lg(n/k))$$ worst-case time.\n\n3. Given that the modified algorithm runs in $$\\Theta(nk + n\\lg(n/k))$$ worst-case time, what is the largest value of $$k$$ as a function of $$n$$ for which the modified algorithm has the same running time as standard merge sort, in terms of $$\\Theta$$ notation? \nMerge sort runs in $$\\Theta(n\\lg n)$$ time. Thus for the modified algorithm to have a asymptotically faster run time, $$\\Theta(nk + n\\lg(n/k)) < \\Theta(n\\lg n) \\Rightarrow max(nk, n\\lg(n/k)) < n\\lg n$$, we must have $$nk < n\\lg n$$ and $$n\\lg(n/k) < n\\lg n$$. Therefore, $$1 < k < \\lg n$$. \nAs $$nk$$ strictly increases with $$k$$ and $$n\\lg(n/k)$$ strictly decreases with $$k$$, the lowest asymptotic running time occurs when $$k$$ is such that $$nk = n\\lg(n/k)$$.\n\n{% highlight python %}\n\ndef merge(left, right):\n ''' as before this function merges two lists, producing a new one '''\n sorted_keys = list()\n while True:\n try:\n left_top = left[0]\n right_top = right[0]\n except IndexError:\n sorted_keys += left + right\n return sorted_keys\n if left_top < right_top:\n sorted_keys.append(left.pop(0))\n else:\n sorted_keys.append(right.pop(0))\n\ndef insertion_sort(keys):\n ''' in place insertion sort '''\n for i in xrange(1,len(keys)):\n value = keys[i]\n j = i - 1\n while j >= 0 and keys[j] > value:\n keys[j + 1] = keys[j]\n j -= 1\n keys[j + 1] = value\n\ndef modified_merge_sort(keys, k):\n if len(keys) <= k:\n insertion_sort(keys)\n return keys\n else:\n midpoint = len(keys) / 2\n left = modified_merge_sort(keys[:midpoint], k)\n right = modified_merge_sort(keys[midpoint:], k)\n return merge(left, right)\n\n{% endhighlight %}\n\n\n\n\n", "meta": {"content_hash": "3537999a0a5a9dae0d8466a0caa43ddd", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 592, "avg_line_length": 58.56666666666667, "alnum_prop": 0.6442800227660785, "repo_name": "alw231/alw231.github.io", "id": "c4cadf8d2a016a792fb46e79b0069ab5a7831160", "size": "3518", "binary": false, "copies": "1", "ref": "refs/heads/disable_gh_pages", "path": "_posts/2015-08-30-insertion-sort-on-small-arrays-in-merge-sort.md", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "9664"}, {"name": "HTML", "bytes": "13345"}, {"name": "JavaScript", "bytes": "27423"}]}} +{"text": "/* ########## PARA VISUALIZAR Y REGISTRAR PUBLICACIONES ########## */\n\n/*Estilo en el t\u00edtulo (centrar el texto)*/\n.title-style{\n\ttext-align: center;\n}\n\n/*Color para icono de borrado en autores*/\n.btn-delete-color{\n\tcolor: #d9534f;\n}\n\n/*Espaciado superior e inferior en mensaje de alerta (no hay resultados de autor)*/\n.spacing-text-alert{\n\tmargin-top: 10px;\n\tmargin-bottom: 10px;\n}\n\n/*Margen, espaciado y color para el formulario \"Registrar autor\"*/\n.subform-autor{\n\tbackground-color: #dedede;\n\tpadding: 15px;\n\tmargin-bottom: 1em;\n}\n\n/*Decoraci\u00f3n de fondo en cada a\u00f1o*/\n.blockquote-decoration{\n\tborder-left: 5px solid #666;\n\tbackground-color: #ddd;\n}\n\n/*Espacio para mostrar publicaci\u00f3n con imagen\nSe emplean publication-container, publication-cover y publication-info*/\n.publication-container{ /*contenedor principal*/\n\theight: 305px;\n\twidth: 100%;\n\tmargin-bottom: 20px;\n\tposition: relative; /*para alinear texto posteriormente*/\n}\n.publication-cover{ /*espacio para portada*/\n\theight: 100%;\n\twidth: 100%;\n\toverflow: hidden;\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbackground-color: #333;\n}\n.publication-cover img{\n\twidth: 100%;\n}\n.publication-info{ /*espacio para texto*/\n\theight: 30%;\n\twidth: 100%;\n\tposition: absolute;\n\tbottom: 0;\n\tfont-size: 1.2em;\n\ttext-align: center;\n\tbackground-color: rgba(0,0,0,0.5);\n\tcolor: #eee;\n}\n\n/*Definir tama\u00f1os, espacios y alineaci\u00f3n de cada recuardo.\nTambi\u00e9n se define el tama\u00f1o individual del t\u00edtulo, autor, fecha*/\n.publication-thumbnail{\n\theight: 305px;\n\twidth: 100%;\n\tpadding: 1em;\n\tmargin: auto;\n\tmargin-bottom: 20px;\n\ttext-align: center;\n}\n.publication-title{\n\tfont-size: 1.3em;\n\tfont-weight: bold;\n}\n.publication-autor{\n\tfont-size: 1em;\n}\n.publication-date{\n\tfont-size: 1.2em;\n}\n\n/*Color de fondo y de texto si la publicaci\u00f3n es un ARTICULO*/\n.color-article{\n\tbackground: #133175;\n\tbackground: -webkit-linear-gradient(#133175, #0E4671);\n\tbackground: -o-linear-gradient(#133175, #0E4671);\n\tbackground: -moz-linear-gradient(#133175, #0E4671);\n\tbackground: linear-gradient(#133175, #0E4671);\n}\n.color-article-title{\n\tcolor: #F0A32F;\n}\n.color-article-autor{\n\tcolor: #FFF;\n}\n.color-article-date{\n\tcolor: #BBB;\n}\n\n/*Color de fondo y de texto si la publicaci\u00f3n es un LIBRO*/\n.color-book{\n\tbackground: #19197B;\n\tbackground: -webkit-linear-gradient(#19197B, #132F76);\n\tbackground: -o-linear-gradient(#19197B, #132F76);\n\tbackground: -moz-linear-gradient(#19197B, #132F76);\n\tbackground: linear-gradient(#19197B, #132F76);\n}\n.color-book-title{\n\tcolor: #F0A32F;\n}\n.color-book-autor{\n\tcolor: #FFF;\n}\n.color-book-date{\n\tcolor: #BBB;\n}\n\n/*Color de fondo y de texto si la publicaci\u00f3n es un DOCUMENTAL*/\n.color-documentary{\n\tbackground: #0E4671;\n\tbackground: -webkit-linear-gradient(#0E4671, #07666A);\n\tbackground: -o-linear-gradient(#0E4671, #07666A);\n\tbackground: -moz-linear-gradient(#0E4671, #07666A);\n\tbackground: linear-gradient(#0E4671, #07666A);\n}\n.color-documentary-title{\n\tcolor: #F0A32F;\n}\n.color-documentary-autor{\n\tcolor: #FFF;\n}\n.color-documentary-date{\n\tcolor: #BBB;\n}\n\n/*Color de fondo y de texto si la publicaci\u00f3n es una PONENCIA*/\n.color-lecture{\n\tbackground: #2C1479;\n\tbackground: -webkit-linear-gradient(#2C1479, #1B197A);\n\tbackground: -o-linear-gradient(#2C1479, #1B197A);\n\tbackground: -moz-linear-gradient(#2C1479, #1B197A);\n\tbackground: linear-gradient(#2C1479, #1B197A);\n}\n.color-lecture-title{\n\tcolor: #F0A32F;\n}\n.color-lecture-autor{\n\tcolor: #FFF;\n}\n.color-lecture-date{\n\tcolor: #BBB;\n}\n\n/*Color de fondo y de texto si la publicaci\u00f3n es una PAGINA WEB*/\n.color-website{\n\tbackground: #076969;\n\tbackground: -webkit-linear-gradient(#076969, #07774A);\n\tbackground: -o-linear-gradient(#076969, #07774A);\n\tbackground: -moz-linear-gradient(#076969, #07774A);\n\tbackground: linear-gradient(#076969, #07774A);\n}\n.color-website-title{\n\tcolor: #F0A32F;\n}\n.color-website-autor{\n\tcolor: #FFF;\n}\n.color-website-date{\n\tcolor: #BBB;\n}\n\n/*Color de fondo y de texto si la publicaci\u00f3n no tiene un tipo definido*/\n.color-default{\n\tbackground: #666;\n\tbackground: -webkit-linear-gradient(#666, #999);\n\tbackground: -o-linear-gradient(#666, #999);\n\tbackground: -moz-linear-gradient(#666, #999);\n\tbackground: linear-gradient(#666, #999);\n}\n.color-default-title{\n\tcolor: #EEE;\n}\n.color-default-autor{\n\tcolor: #FFF;\n}\n.color-default-date{\n\tcolor: #BBB;\n}\n\n\n/*Cada una de las propiedades de la publicaci\u00f3n (en tama\u00f1o xs)*/\n.row-property{\n\tmargin-bottom: 0.5em;\n\tmargin-top: 0.5em;\n\tpadding-top: 0.5em;\n\tborder-top-style: solid;\n\tborder-top-color: rgba(0,0,0,0.1);\n\tborder-top-width: 1px;\n}\n/*Imagen responsiva (max-width: 100% est\u00e1 en estilo de <img>)*/\n.imagen-portada{\n\tmax-height: 400px;\n}\n\n/*Estilo a usar en tama\u00f1o sm, md, lg*/\n@media screen and (min-width: 768px){\n\t/*Se disminuye ligeramente el tama\u00f1o de fuente*/\n\t.publication-title{\n\t\tfont-size: 1.2em;\n\t}\n\t.publication-autor{\n\t\tfont-size: 0.9em;\n\t}\n\t.publication-date{\n\t\tfont-size: 1em;\n\t}\n}", "meta": {"content_hash": "498455a51bb0c83f40e7e5f9136b1abc", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 83, "avg_line_length": 22.365296803652967, "alnum_prop": 0.708248264597795, "repo_name": "Sergioarc/lais-web", "id": "5bdfeac2fc20bc045ffcb47bf86d7aa8eaa758ab", "size": "4918", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/css/publicaciones.css", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "18104"}, {"name": "HTML", "bytes": "105358"}, {"name": "JavaScript", "bytes": "73154"}]}} +{"text": "\n\npackage net.systran.platform.resources.client.model;\n\nimport net.systran.platform.resources.client.model.LiteCorpus;\n\nimport io.swagger.annotations.*;\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\n\n@ApiModel(description = \"\")\npublic class CorpusImportResponse {\n \n private LiteCorpus corpus = null;\n\n \n /**\n **/\n @ApiModelProperty(required = true, value = \"\")\n @JsonProperty(\"corpus\")\n public LiteCorpus getCorpus() {\n return corpus;\n }\n public void setCorpus(LiteCorpus corpus) {\n this.corpus = corpus;\n }\n\n \n\n @Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"class CorpusImportResponse {\\n\");\n \n sb.append(\" corpus: \").append(corpus).append(\"\\n\");\n sb.append(\"}\\n\");\n return sb.toString();\n }\n}\n", "meta": {"content_hash": "c66ec28f456289e2f2d6e9c6a62add87", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 62, "avg_line_length": 20.333333333333332, "alnum_prop": 0.6796973518284993, "repo_name": "SYSTRAN/resources-api-java-client", "id": "2ff574e8be00fdc9a7337d45012cf1b0d5954a1c", "size": "1420", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/net/systran/platform/resources/client/model/CorpusImportResponse.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "293321"}]}} +{"text": "<?php\n\nnamespace Drupal\\commerce\\Element;\n\nuse Drupal\\Component\\Utility\\NestedArray;\nuse Drupal\\Core\\Form\\FormStateInterface;\nuse Drupal\\Core\\Render\\Element;\n\n/**\n * Provides a trait for Commerce form elements.\n *\n * Allows form elements to use #commerce_element_submit, a substitute\n * for the #element_submit that's missing from Drupal core.\n *\n * Each form element using this trait should add the attachElementSubmit and\n * validateElementSubmit callbacks to their getInfo() methods.\n */\ntrait CommerceElementTrait {\n\n /**\n * Attaches the #commerce_element_submit functionality.\n *\n * @param array $element\n * The form element being processed.\n * @param \\Drupal\\Core\\Form\\FormStateInterface $form_state\n * The current state of the form.\n * @param array $complete_form\n * The complete form structure.\n *\n * @return array\n * The processed form element.\n */\n public static function attachElementSubmit(array $element, FormStateInterface $form_state, array &$complete_form) {\n if (isset($complete_form['#commerce_element_submit_attached'])) {\n return $element;\n }\n // The #validate callbacks of the complete form run last.\n // That allows executeElementSubmitHandlers() to be completely certain that\n // the form has passed validation before proceeding.\n $complete_form['#validate'][] = [get_class(), 'executeElementSubmitHandlers'];\n $complete_form['#commerce_element_submit_attached'] = TRUE;\n\n return $element;\n }\n\n /**\n * Confirms that #commerce_element_submit handlers can be run.\n *\n * @param array $element\n * The form element.\n * @param \\Drupal\\Core\\Form\\FormStateInterface $form_state\n * The current state of the form.\n *\n * @throws \\Exception\n * Thrown if button-level #validate handlers are detected on the parent\n * form, as a protection against buggy behavior.\n */\n public static function validateElementSubmit(array &$element, FormStateInterface $form_state) {\n // Button-level #validate handlers replace the form-level ones, which means\n // that executeElementSubmitHandlers() won't be triggered.\n if ($handlers = $form_state->getValidateHandlers()) {\n throw new \\Exception('The current form must not have button-level #validate handlers');\n }\n }\n\n /**\n * Submits elements by calling their #commerce_element_submit callbacks.\n *\n * Form API has no #element_submit, requiring us to simulate it by running\n * the #commerce_element_submit handlers either in the last step of\n * validation, or the first step of submission. In this case it's the last\n * step of validation, allowing thrown exceptions to be converted into form\n * errors.\n *\n * @param array &$form\n * The form.\n * @param \\Drupal\\Core\\Form\\FormStateInterface $form_state\n * The form state.\n */\n public static function executeElementSubmitHandlers(array &$form, FormStateInterface $form_state) {\n if (!$form_state->isSubmitted() || $form_state->hasAnyErrors()) {\n // The form wasn't submitted (#ajax in progress) or failed validation.\n return;\n }\n // A submit button might need to process only a part of the form.\n // For example, the \"Apply coupon\" button at checkout should apply coupons,\n // but not save the payment information. Use #limit_validation_errors\n // as a guideline for which parts of the form to submit.\n $triggering_element = $form_state->getTriggeringElement();\n if (isset($triggering_element['#limit_validation_errors']) && $triggering_element['#limit_validation_errors'] !== FALSE) {\n // #limit_validation_errors => [], the button cares about nothing.\n if (empty($triggering_element['#limit_validation_errors'])) {\n return;\n }\n\n foreach ($triggering_element['#limit_validation_errors'] as $limit_validation_errors) {\n $element = NestedArray::getValue($form, $limit_validation_errors);\n if (!$element) {\n // The element will be empty if #parents don't match #array_parents,\n // the case for IEF widgets. In that case just submit everything.\n $element = &$form;\n }\n self::doExecuteSubmitHandlers($element, $form_state);\n }\n }\n else {\n self::doExecuteSubmitHandlers($form, $form_state);\n }\n }\n\n /**\n * Calls the #commerce_element_submit callbacks recursively.\n *\n * @param array &$element\n * The current element.\n * @param \\Drupal\\Core\\Form\\FormStateInterface $form_state\n * The form state.\n */\n public static function doExecuteSubmitHandlers(array &$element, FormStateInterface $form_state) {\n // Recurse through all children.\n foreach (Element::children($element) as $key) {\n if (!empty($element[$key])) {\n static::doExecuteSubmitHandlers($element[$key], $form_state);\n }\n }\n\n // If there are callbacks on this level, run them.\n if (!empty($element['#commerce_element_submit'])) {\n foreach ($element['#commerce_element_submit'] as $callback) {\n call_user_func_array($callback, [&$element, &$form_state]);\n }\n }\n }\n\n}\n", "meta": {"content_hash": "f22376fbca3314e460f55723563035c5", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 126, "avg_line_length": 37.51851851851852, "alnum_prop": 0.6797630799605133, "repo_name": "wow-yorick/suffix-zx", "id": "abf844fa916ea5597f5029f68bd5f6a960c271d9", "size": "5065", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "cms/modules/contrib/commerce/src/Element/CommerceElementTrait.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "711070"}, {"name": "HTML", "bytes": "944057"}, {"name": "JavaScript", "bytes": "1530798"}, {"name": "PHP", "bytes": "39866961"}, {"name": "Shell", "bytes": "55615"}]}} +{"text": "\n\npackage com.google.devtools.j2objc;\n\nimport com.google.devtools.j2objc.util.ErrorUtil;\nimport com.google.devtools.j2objc.util.JdtParser;\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimport java.lang.reflect.Constructor;\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.net.URLClassLoader;\nimport java.util.Arrays;\nimport java.util.jar.JarEntry;\nimport java.util.jar.JarInputStream;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\n\n/**\n * Translation tool for generating Objective C source files from Java sources.\n * This tool is not intended to be a general purpose converter, but instead is\n * focused on what is needed for business logic libraries written in Java to\n * run natively on iOS. In particular, no attempt is made to translate Java\n * UI framework code to any iOS frameworks.\n *\n * @author Tom Ball\n */\npublic class J2ObjC {\n\n static {\n // Always enable assertions in translator.\n ClassLoader loader = J2ObjC.class.getClassLoader();\n if (loader != null) {\n loader.setPackageAssertionStatus(J2ObjC.class.getPackage().getName(), true);\n }\n }\n\n private static final Logger logger = Logger.getLogger(J2ObjC.class.getName());\n\n private static void exit() {\n Options.deleteTemporaryDirectory();\n System.exit(ErrorUtil.errorCount());\n }\n\n public static String getFileHeader(String sourceFileName) {\n return String.format(Options.getFileHeader(), sourceFileName);\n }\n\n private static class JarFileLoader extends URLClassLoader {\n public JarFileLoader() {\n super(new URL[]{});\n }\n\n public void addJarFile(String path) throws MalformedURLException {\n String urlPath = \"jar:file://\" + path + \"!/\";\n addURL(new URL(urlPath));\n }\n }\n\n private static void initPlugins(String[] pluginPaths, String pluginOptionString)\n throws IOException {\n @SuppressWarnings(\"resource\")\n JarFileLoader classLoader = new JarFileLoader();\n for (String path : pluginPaths) {\n if (path.endsWith(\".jar\")) {\n JarInputStream jarStream = null;\n try {\n jarStream = new JarInputStream(new FileInputStream(path));\n classLoader.addJarFile(new File(path).getAbsolutePath());\n\n JarEntry entry;\n while ((entry = jarStream.getNextJarEntry()) != null) {\n String entryName = entry.getName();\n if (!entryName.endsWith(\".class\")) {\n continue;\n }\n\n String className = entryName.replaceAll(\"/\", \"\\\\.\").substring(\n 0, entryName.length() - \".class\".length());\n\n try {\n Class<?> clazz = classLoader.loadClass(className);\n if (Plugin.class.isAssignableFrom(clazz)) {\n Constructor<?> cons = clazz.getDeclaredConstructor();\n Plugin plugin = (Plugin) cons.newInstance();\n plugin.initPlugin(pluginOptionString);\n Options.getPlugins().add(plugin);\n }\n } catch (Exception e) {\n throw new IOException(\"plugin exception: \", e);\n }\n }\n } finally {\n if (jarStream != null) {\n jarStream.close();\n }\n }\n } else {\n logger.warning(\"Don't understand plugin path entry: \" + path);\n }\n }\n }\n\n public static void error(Exception e) {\n logger.log(Level.SEVERE, \"Exiting due to exception\", e);\n System.exit(1);\n }\n\n private static void checkErrors() {\n int errors = ErrorUtil.errorCount();\n if (Options.treatWarningsAsErrors()) {\n errors += ErrorUtil.warningCount();\n }\n if (errors > 0) {\n System.exit(1);\n }\n }\n\n private static JdtParser createParser() {\n JdtParser parser = new JdtParser();\n parser.addClasspathEntries(Options.getClassPathEntries());\n parser.addClasspathEntries(Options.getBootClasspath());\n parser.addSourcepathEntries(Options.getSourcePathEntries());\n parser.setIncludeRunningVMBootclasspath(false);\n parser.setEncoding(Options.fileEncoding());\n parser.setIgnoreMissingImports(Options.ignoreMissingImports());\n parser.setEnableDocComments(Options.docCommentsEnabled());\n return parser;\n }\n\n /**\n * Entry point for tool.\n *\n * @param args command-line arguments: flags and source file names\n * @throws IOException\n */\n public static void main(String[] args) {\n if (args.length == 0) {\n Options.help(true);\n }\n String[] files = null;\n try {\n files = Options.load(args);\n if (files.length == 0) {\n Options.usage(\"no source files\");\n }\n } catch (IOException e) {\n ErrorUtil.error(e.getMessage());\n System.exit(1);\n }\n\n try {\n initPlugins(Options.getPluginPathEntries(), Options.getPluginOptionString());\n } catch (IOException e) {\n error(e);\n }\n\n JdtParser parser = createParser();\n\n // Remove dead-code first, so modified file paths are replaced in the\n // translation list.\n DeadCodeProcessor deadCodeProcessor = DeadCodeProcessor.create(parser);\n if (deadCodeProcessor != null) {\n deadCodeProcessor.processFiles(Arrays.asList(files));\n checkErrors();\n files = deadCodeProcessor.postProcess().toArray(new String[0]);\n }\n\n TranslationProcessor translationProcessor = new TranslationProcessor(parser);\n translationProcessor.processFiles(Arrays.asList(files));\n translationProcessor.postProcess();\n checkErrors();\n\n exit();\n }\n}\n", "meta": {"content_hash": "76e911b5678ecc4ec70a92e643a024c1", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 83, "avg_line_length": 30.803370786516854, "alnum_prop": 0.6567572496808317, "repo_name": "xuvw/j2objc", "id": "eeae7c59084b2f2297c37d87366743668a09de83", "size": "6094", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "translator/src/main/java/com/google/devtools/j2objc/J2ObjC.java", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "\ufeff//------------------------------------------------------------------------------\n// <auto-generated>\n// This code was generated by a tool.\n// Runtime Version:4.0.30319.1\n//\n// Changes to this file may cause incorrect behavior and will be lost if\n// the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace ScrimpNet.Presentation.Demo.Properties {\n \n \n [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"10.0.0.0\")]\n internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n \n private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n \n public static Settings Default {\n get {\n return defaultInstance;\n }\n }\n }\n}\n", "meta": {"content_hash": "1015b4f54b3019450c30737be8c6b284", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 151, "avg_line_length": 41.46153846153846, "alnum_prop": 0.5844155844155844, "repo_name": "lindexi/lindexi_gd", "id": "0ab21252e442d1c49617ae4f0c1ad5f5e23bc262", "size": "1080", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ScrimpNet.Library.Suite Solution/__SamplesAndDemos/Presentation/ScrimpNet.Presentation.Demo Project/Properties/Settings.Designer.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP.NET", "bytes": "29822"}, {"name": "Batchfile", "bytes": "57394"}, {"name": "C", "bytes": "983450"}, {"name": "C#", "bytes": "36237467"}, {"name": "C++", "bytes": "316762"}, {"name": "CSS", "bytes": "121116"}, {"name": "Dockerfile", "bytes": "882"}, {"name": "HTML", "bytes": "113044"}, {"name": "JavaScript", "bytes": "3323"}, {"name": "Q#", "bytes": "556"}, {"name": "Roff", "bytes": "450615"}, {"name": "ShaderLab", "bytes": "3270"}, {"name": "Smalltalk", "bytes": "18"}, {"name": "TSQL", "bytes": "23558"}]}} +{"text": "\n----\n[Arguman.org](http://arguman.org) is an argument analysis and [mapping](https://en.wikipedia.org/wiki/Argument_map) platform.\n\n## How it works\n\nUsers assert contentions to be discussed, supported, prooved or disprooved and argue with premises using because, but, or however conjuctions.\n\n\n\n## Benefits\n\nCritical thinking is the intellectually disciplined process of actively and skillfully conceptualizing, applying, analyzing, synthesizing, and/or evaluating information gathered from, or generated by, observation, experience, reflection, reasoning, or communication, as a guide to belief and action. In its exemplary form, it is based on universal intellectual values that transcend subject matter divisions: clarity, accuracy, precision, consistency, relevance, sound evidence, good reasons, depth, breadth, and fairness.\n\nBasis of critical thinking is arguments. Assesment is done over argument, argument premises, promotives and corruptives.\n\nYou may think argument mappings as visual hierarchy mappings.\n\nArguman.org\u2019s aim is arguments to be mapped successfully by many users.\n\n\n\n\n## Who are we\n\narguman.org is an open source project which developed by community, If you want to contribute technically or intellectually please don\u2019t hesitate.\n\n### Contributors\n\n- Fatih Erikli\n- Tuna Varg\u0131\n- Huseyin Mert\n- Erdem Ozkol\n- Aybars Badur\n- Can G\u00f6kta\u015f\n- Bahattin \u00c7ini\u00e7\n- Murat \u00c7orlu\n- Cumhur Korkut\n- Serdar Dalg\u0131\u00e7\n- Emir Kar\u015f\u0131yakal\u0131\n- Ali Bar\u0131n\n- Halil Kaya\n- A. Liva Cengiz\n- \u00c7a\u011flar Bozkurt\n\n\n## Additionally Thanks To\n\n- Burak Ar\u0131kan\n- Kadir Akkara Yard\u0131mc\u0131\n", "meta": {"content_hash": "26dfd58d440f166f9d99a533bb9c2256", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 522, "avg_line_length": 36.5, "alnum_prop": 0.7857534246575343, "repo_name": "taiansu/arguman.org", "id": "3a784adce01562b8f7e84172ff227bb29a4e6de4", "size": "1847", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "43835"}, {"name": "HTML", "bytes": "57145"}, {"name": "JavaScript", "bytes": "23644"}, {"name": "Python", "bytes": "163449"}, {"name": "Shell", "bytes": "392"}]}} +{"text": "\n\n#ifndef RMLUI_CORE_LAYOUTLINEBOX_H\n#define RMLUI_CORE_LAYOUTLINEBOX_H\n\n#include \"LayoutInlineBox.h\"\n\nnamespace Rml {\n\nclass LayoutBlockBox;\n\n/**\n\t@author Peter Curry\n */\n\nclass LayoutLineBox\n{\npublic:\n\tLayoutLineBox(LayoutBlockBox* parent);\n\t~LayoutLineBox();\n\n\t/// Closes the line box, positioning all inline elements within it.\n\t/// @param overflow[in] The overflow box from a split inline box that caused this line to close. Leave this as nullptr if we closed naturally.\n\t/// @return If there was any overflow, this will be the last element generated by the spilling content. Otherwise, this will be nullptr.\n\tLayoutInlineBox* Close(UniquePtr<LayoutInlineBox> overflow = nullptr);\n\n\t/// Closes one of the line box's inline boxes.\n\t/// @param inline_box[in] The inline box to close. This should always be the line box's open box.\n\tvoid CloseInlineBox(LayoutInlineBox* inline_box);\n\n\t/// Attempts to add a new element to this line box. If it can't fit, or needs to be split, new line boxes will\n\t/// be created. The inline box for the final section of the element will be returned.\n\t/// @param element[in] The element to fit into this line box.\n\t/// @param box[in] The element's extents.\n\t/// @return The inline box for the element.\n\tLayoutInlineBox* AddElement(Element* element, const Box& box);\n\n\t/// Attempts to add a new inline box to this line. If it can't fit, or needs to be split, new line boxes will\n\t/// be created. The inline box for the final section of the element will be returned.\n\t/// @param box[in] The inline box to be added to the line.\n\t/// @return The final inline box.\n\tLayoutInlineBox* AddBox(UniquePtr<LayoutInlineBox> box);\n\t/// Adds an inline box as a chained hierarchy overflowing to this line. The chain will be extended into\n\t/// this line box.\n\t/// @param split_box[in] The box overflowed from a previous line.\n\tvoid AddChainedBox(LayoutInlineBox* chained_box);\n\n\t/// Returns the position of the line box, relative to its parent's block box's content area.\n\t/// @return The position of the line box.\n\tVector2f GetPosition() const;\n\t/// Returns the position of the line box, relative to its parent's block box's offset parent.\n\t/// @return The relative position of the line box.\n\tVector2f GetRelativePosition() const;\n\t/// Returns the dimensions of the line box.\n\t/// @return The dimensions of the line box.\n\tVector2f GetDimensions() const;\n\n\t/// Returns the line box's open inline box.\n\t/// @return The line's open inline box, or nullptr if it currently has none.\n\tLayoutInlineBox* GetOpenInlineBox();\n\t/// Returns the line's containing block box.\n\t/// @return The line's block box.\n\tLayoutBlockBox* GetBlockBox();\n\n\tfloat GetBoxCursor() const;\n\n\tbool GetBaselineOfLastLine(float& baseline) const;\n\n\tvoid* operator new(size_t size);\n\tvoid operator delete(void* chunk, size_t size);\n\nprivate:\n\t/// Appends an inline box to the end of the line box's list of inline boxes. Returns a pointer to the appended box.\n\tLayoutInlineBox* AppendBox(UniquePtr<LayoutInlineBox> box);\n\n\tusing InlineBoxList = Vector< UniquePtr<LayoutInlineBox> >;\n\n\t// The block box containing this line.\n\tLayoutBlockBox* parent;\n\n\t// The top-left position of the line box; this is set when the first inline box is placed.\n\tVector2f position;\n\tbool position_set;\n\n\t// The width and height of the line box; this is set when the line box is placed.\n\tVector2f dimensions;\n\tbool wrap_content;\n\n\t// The horizontal cursor. This is where the next inline box will be placed along the line.\n\tfloat box_cursor;\n\n\t// The list of inline boxes in this line box. These line boxes may be parented to others in this list.\n\tInlineBoxList inline_boxes;\n\t// The open inline box; this is nullptr if all inline boxes are closed.\n\tLayoutInlineBox* open_inline_box;\n};\n\n} // namespace Rml\n#endif\n", "meta": {"content_hash": "3f16b37514b0fb5e7df448d883c007d4", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 143, "avg_line_length": 38.121212121212125, "alnum_prop": 0.7419183889772125, "repo_name": "rokups/Urho3D", "id": "7a3de761f03fa87c7cea22d76b35e79dc84f2e45", "size": "5122", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/ThirdParty/RmlUi/Source/Core/LayoutLineBox.h", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "14842"}, {"name": "C#", "bytes": "643494"}, {"name": "C++", "bytes": "7624116"}, {"name": "CMake", "bytes": "285041"}, {"name": "GLSL", "bytes": "151027"}, {"name": "HLSL", "bytes": "175276"}, {"name": "HTML", "bytes": "23451"}, {"name": "Java", "bytes": "89032"}, {"name": "MAXScript", "bytes": "94704"}, {"name": "Makefile", "bytes": "1161"}, {"name": "Objective-C", "bytes": "6549"}, {"name": "Python", "bytes": "31194"}, {"name": "Shell", "bytes": "27209"}]}} +{"text": "package me.tikitoo.androiddemo.activity;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.os.Environment;\nimport android.support.annotation.Nullable;\nimport android.view.View;\nimport android.widget.Toast;\n\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.OutputStream;\n\nimport me.tikitoo.androiddemo.R;\nimport me.tikitoo.androiddemo.view.DrawView;\n\n/**\n * Created by Tikitoo on 2015/12/22.\n */\npublic class DrawViewActivity extends Activity {\n\n private DrawView mDrawView;\n\n @Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_custom_view);\n mDrawView = (DrawView) findViewById(R.id.draw_view);\n }\n\n public void saveBtn(View view) {\n onSaveClicked(this, view);\n\n }\n\n\n public void onSaveClicked(final Context context, View view) {\n try {\n File file = new File(Environment.getExternalStorageDirectory(),\n System.currentTimeMillis() + \".jpg\");\n OutputStream outputStream = new FileOutputStream(file);\n mDrawView.saveBitmap(outputStream);\n outputStream.close();\n/*\n Intent intent = new Intent();\n intent.setAction(Intent.ACTION_MEDIA_MOUNTED);\n intent.setData(Uri.fromFile(Environment.getExternalStorageDirectory()));\n sendBroadcast(intent);*/\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n Intent mediaScanIntent = new Intent(\n Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);\n Uri contentUri = Uri.fromFile(file);\n mediaScanIntent.setData(contentUri);\n this.sendBroadcast(mediaScanIntent);\n } else {\n sendBroadcast(new Intent(\n Intent.ACTION_MEDIA_MOUNTED,\n Uri.fromFile(Environment.getExternalStorageDirectory())));\n }\n showToast(context, \"save success\");\n } catch (Exception e) {\n showToast(context, \"save failed\");\n e.printStackTrace();\n }\n\n }\n\n private static void showToast(Context context, String msg) {\n Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();\n }\n\n}\n", "meta": {"content_hash": "b7142dc4152dfaa5c8a26c0381091fe6", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 84, "avg_line_length": 31.532467532467532, "alnum_prop": 0.6437397034596376, "repo_name": "Tikitoo/androidsamples", "id": "cdf574b03eb9ca4612851c2ba6f7ec1438750a8e", "size": "2428", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/me/tikitoo/androiddemo/activity/DrawViewActivity.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "1744"}, {"name": "Java", "bytes": "128274"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc -->\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>Uses of Class com.google.zxing.client.j2se.GUIRunner (ZXing 3.3.0 API)</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../../../stylesheet.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"../../../../../../script.js\"></script>\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n try {\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"Uses of Class com.google.zxing.client.j2se.GUIRunner (ZXing 3.3.0 API)\";\n }\n }\n catch(err) {\n }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar.top\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.top.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"../package-summary.html\">Package</a></li>\n<li><a href=\"../../../../../../com/google/zxing/client/j2se/GUIRunner.html\" title=\"class in com.google.zxing.client.j2se\">Class</a></li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../index.html?com/google/zxing/client/j2se/class-use/GUIRunner.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"GUIRunner.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip.navbar.top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h2 title=\"Uses of Class com.google.zxing.client.j2se.GUIRunner\" class=\"title\">Uses of Class<br>com.google.zxing.client.j2se.GUIRunner</h2>\n</div>\n<div class=\"classUseContainer\">No usage of com.google.zxing.client.j2se.GUIRunner</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar.bottom\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.bottom.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"../package-summary.html\">Package</a></li>\n<li><a href=\"../../../../../../com/google/zxing/client/j2se/GUIRunner.html\" title=\"class in com.google.zxing.client.j2se\">Class</a></li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../../../index.html?com/google/zxing/client/j2se/class-use/GUIRunner.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"GUIRunner.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip.navbar.bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n<p class=\"legalCopy\"><small>Copyright © 2007–2016. All rights reserved.</small></p>\n</body>\n</html>\n", "meta": {"content_hash": "a631a97e448ba4906443a1ae44504b42", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 139, "avg_line_length": 36.344, "alnum_prop": 0.6048866387849439, "repo_name": "DavidLDawes/zxing", "id": "d964903a8c27f11a3a690fe43baeb808a0084c0a", "size": "4543", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "docs/apidocs/com/google/zxing/client/j2se/class-use/GUIRunner.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "3869"}, {"name": "HTML", "bytes": "102287"}, {"name": "Java", "bytes": "2367385"}]}} +{"text": "FROM balenalib/orangepi-plus2-debian:bullseye-run\n\nRUN apt-get update \\\n && apt-get install -y --no-install-recommends \\\n ca-certificates \\\n curl \\\n \\\n# .NET Core dependencies\n libc6 \\\n libgcc1 \\\n libgssapi-krb5-2 \\\n libicu67 \\\n libssl1.1 \\\n libstdc++6 \\\n zlib1g \\\n && rm -rf /var/lib/apt/lists/*\n\n# Configure web servers to bind to port 80 when present\nENV ASPNETCORE_URLS=http://+:80 \\\n # Enable detection of running in a container\n DOTNET_RUNNING_IN_CONTAINER=true\n\n# Install .NET Core\nENV DOTNET_VERSION 3.1.21\n\nRUN curl -SL --output dotnet.tar.gz \"https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-runtime-$DOTNET_VERSION-linux-arm.tar.gz\" \\\n && dotnet_sha512='9c3fb0f5f860f53ab4d15124c2c23a83412ea916ad6155c0f39f066057dcbb3ca6911ae26daf8a36dbfbc09c17d6565c425fbdf3db9114a28c66944382b71000' \\\n && echo \"$dotnet_sha512 dotnet.tar.gz\" | sha512sum -c - \\\n && mkdir -p /usr/share/dotnet \\\n && tar -zxf dotnet.tar.gz -C /usr/share/dotnet \\\n && rm dotnet.tar.gz \\\n && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet\n\nCMD [\"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\"]\n\n RUN curl -SLO \"https://raw.githubusercontent.com/balena-io-library/base-images/44e597e40f2010cdde15b3ba1e397aea3a5c5271/scripts/assets/tests/test-stack@dotnet.sh\" \\\n && echo \"Running test-stack@dotnet\" \\\n && chmod +x test-stack@dotnet.sh \\\n && bash test-stack@dotnet.sh \\\n && rm -rf test-stack@dotnet.sh \n\nRUN [ ! -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 v7 \\nOS: Debian Bullseye \\nVariant: run variant \\nDefault variable(s): UDEV=off \\nThe following software stack is preinstalled: \\ndotnet 3.1-runtime \\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\n\nRUN echo '#!/bin/sh.real\\nbalena-info\\nrm -f /bin/sh\\ncp /bin/sh.real /bin/sh\\n/bin/sh \"$@\"' > /bin/sh-shim \\\n\t&& chmod +x /bin/sh-shim \\\n\t&& cp /bin/sh /bin/sh.real \\\n\t&& mv /bin/sh-shim /bin/sh", "meta": {"content_hash": "c9a576a3bf9b47b40d470a5ebb785172", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 682, "avg_line_length": 53.42553191489362, "alnum_prop": 0.702110712863401, "repo_name": "resin-io-library/base-images", "id": "e6a7f214a12bc4e397eabf388386351029627da1", "size": "2532", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/dotnet/orangepi-plus2/debian/bullseye/3.1-runtime/run/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Dockerfile", "bytes": "71234697"}, {"name": "JavaScript", "bytes": "13096"}, {"name": "Shell", "bytes": "12051936"}, {"name": "Smarty", "bytes": "59789"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <title>Code Coverage for /var/www/em/module/Em/src/Em/Controller/IndexController.php</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <link href=\"css/bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"css/bootstrap-responsive.min.css\" rel=\"stylesheet\">\n <link href=\"css/style.css\" rel=\"stylesheet\">\n <!--[if lt IE 9]>\n <script src=\"http://html5shim.googlecode.com/svn/trunk/html5.js\"></script>\n <![endif]-->\n </head>\n <body>\n <header>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"span12\">\n <ul class=\"breadcrumb\">\n <li><a href=\"index.html\">/var/www/em/module</a> <span class=\"divider\">/</span></li>\n <li><a href=\"Em.html\">Em</a> <span class=\"divider\">/</span></li>\n <li><a href=\"Em_src.html\">src</a> <span class=\"divider\">/</span></li>\n <li><a href=\"Em_src_Em.html\">Em</a> <span class=\"divider\">/</span></li>\n <li><a href=\"Em_src_Em_Controller.html\">Controller</a> <span class=\"divider\">/</span></li>\n <li class=\"active\">IndexController.php</li>\n\n </ul>\n </div>\n </div>\n </div>\n </header>\n <div class=\"container\">\n <table class=\"table table-bordered\">\n <thead>\n <tr>\n <td> </td>\n <td colspan=\"10\"><div align=\"center\"><strong>Code Coverage</strong></div></td>\n </tr>\n <tr>\n <td> </td>\n <td colspan=\"3\"><div align=\"center\"><strong>Classes and Traits</strong></div></td>\n <td colspan=\"4\"><div align=\"center\"><strong>Functions and Methods</strong></div></td>\n <td colspan=\"3\"><div align=\"center\"><strong>Lines</strong></div></td>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td class=\"danger\">Total</td>\n <td class=\"danger big\"> <div class=\"progress progress-danger\" style=\"width: 100px;\">\n <div class=\"bar\" style=\"width: 0.00%;\"></div>\n </div>\n</td>\n <td class=\"danger small\"><div align=\"right\">0.00%</div></td>\n <td class=\"danger small\"><div align=\"right\">0 / 1</div></td>\n <td class=\"danger big\"> <div class=\"progress progress-danger\" style=\"width: 100px;\">\n <div class=\"bar\" style=\"width: 0.00%;\"></div>\n </div>\n</td>\n <td class=\"danger small\"><div align=\"right\">0.00%</div></td>\n <td class=\"danger small\"><div align=\"right\">0 / 1</div></td>\n <td class=\"danger small\"><acronym title=\"Change Risk Anti-Patterns (CRAP) Index\">CRAP</acronym></td>\n <td class=\"danger big\"> <div class=\"progress progress-danger\" style=\"width: 100px;\">\n <div class=\"bar\" style=\"width: 0.00%;\"></div>\n </div>\n</td>\n <td class=\"danger small\"><div align=\"right\">0.00%</div></td>\n <td class=\"danger small\"><div align=\"right\">0 / 4</div></td>\n </tr>\n\n <tr>\n <td class=\"danger\">IndexController</td>\n <td class=\"danger big\"> <div class=\"progress progress-danger\" style=\"width: 100px;\">\n <div class=\"bar\" style=\"width: 0.00%;\"></div>\n </div>\n</td>\n <td class=\"danger small\"><div align=\"right\">0.00%</div></td>\n <td class=\"danger small\"><div align=\"right\">0 / 1</div></td>\n <td class=\"danger big\"> <div class=\"progress progress-danger\" style=\"width: 100px;\">\n <div class=\"bar\" style=\"width: 0.00%;\"></div>\n </div>\n</td>\n <td class=\"danger small\"><div align=\"right\">0.00%</div></td>\n <td class=\"danger small\"><div align=\"right\">0 / 1</div></td>\n <td class=\"danger small\">2</td>\n <td class=\"danger big\"> <div class=\"progress progress-danger\" style=\"width: 100px;\">\n <div class=\"bar\" style=\"width: 0.00%;\"></div>\n </div>\n</td>\n <td class=\"danger small\"><div align=\"right\">0.00%</div></td>\n <td class=\"danger small\"><div align=\"right\">0 / 4</div></td>\n </tr>\n\n <tr>\n <td class=\"danger\" colspan=\"4\"> <a href=\"#17\">indexAction()</a></td>\n <td class=\"danger big\"> <div class=\"progress progress-danger\" style=\"width: 100px;\">\n <div class=\"bar\" style=\"width: 0.00%;\"></div>\n </div>\n</td>\n <td class=\"danger small\"><div align=\"right\">0.00%</div></td>\n <td class=\"danger small\"><div align=\"right\">0 / 1</div></td>\n <td class=\"danger small\">2</td>\n <td class=\"danger big\"> <div class=\"progress progress-danger\" style=\"width: 100px;\">\n <div class=\"bar\" style=\"width: 0.00%;\"></div>\n </div>\n</td>\n <td class=\"danger small\"><div align=\"right\">0.00%</div></td>\n <td class=\"danger small\"><div align=\"right\">0 / 4</div></td>\n </tr>\n\n\n </tbody>\n </table>\n <table class=\"table table-borderless table-condensed\">\n <tbody>\n <tr><td><div align=\"right\"><a name=\"1\"></a><a href=\"#1\">1</a></div></td><td class=\"codeLine\"><span class=\"default\"><?php</span></td></tr>\n <tr><td><div align=\"right\"><a name=\"2\"></a><a href=\"#2\">2</a></div></td><td class=\"codeLine\"><span class=\"comment\"></span></td></tr>\n <tr><td><div align=\"right\"><a name=\"9\"></a><a href=\"#9\">9</a></div></td><td class=\"codeLine\"></td></tr>\n <tr><td><div align=\"right\"><a name=\"10\"></a><a href=\"#10\">10</a></div></td><td class=\"codeLine\"><span class=\"keyword\">namespace</span><span class=\"default\"> </span><span class=\"default\">Em</span><span class=\"default\">\\</span><span class=\"default\">Controller</span><span class=\"keyword\">;</span></td></tr>\n <tr><td><div align=\"right\"><a name=\"11\"></a><a href=\"#11\">11</a></div></td><td class=\"codeLine\"></td></tr>\n <tr><td><div align=\"right\"><a name=\"12\"></a><a href=\"#12\">12</a></div></td><td class=\"codeLine\"><span class=\"keyword\">use</span><span class=\"default\"> </span><span class=\"default\">Zend</span><span class=\"default\">\\</span><span class=\"default\">Mvc</span><span class=\"default\">\\</span><span class=\"default\">Controller</span><span class=\"default\">\\</span><span class=\"default\">AbstractActionController</span><span class=\"keyword\">;</span></td></tr>\n <tr><td><div align=\"right\"><a name=\"13\"></a><a href=\"#13\">13</a></div></td><td class=\"codeLine\"><span class=\"keyword\">use</span><span class=\"default\"> </span><span class=\"default\">Zend</span><span class=\"default\">\\</span><span class=\"default\">View</span><span class=\"default\">\\</span><span class=\"default\">Model</span><span class=\"default\">\\</span><span class=\"default\">ViewModel</span><span class=\"keyword\">;</span></td></tr>\n <tr><td><div align=\"right\"><a name=\"14\"></a><a href=\"#14\">14</a></div></td><td class=\"codeLine\"></td></tr>\n <tr><td><div align=\"right\"><a name=\"15\"></a><a href=\"#15\">15</a></div></td><td class=\"codeLine\"><span class=\"keyword\">class</span><span class=\"default\"> </span><span class=\"default\">IndexController</span><span class=\"default\"> </span><span class=\"keyword\">extends</span><span class=\"default\"> </span><span class=\"default\">AbstractActionController</span></td></tr>\n <tr><td><div align=\"right\"><a name=\"16\"></a><a href=\"#16\">16</a></div></td><td class=\"codeLine\"><span class=\"keyword\">{</span></td></tr>\n <tr class=\"danger\"><td><div align=\"right\"><a name=\"17\"></a><a href=\"#17\">17</a></div></td><td class=\"codeLine\"><span class=\"default\"> </span><span class=\"keyword\">public</span><span class=\"default\"> </span><span class=\"keyword\">function</span><span class=\"default\"> </span><span class=\"default\">indexAction</span><span class=\"keyword\">(</span><span class=\"keyword\">)</span></td></tr>\n <tr class=\"danger\"><td><div align=\"right\"><a name=\"18\"></a><a href=\"#18\">18</a></div></td><td class=\"codeLine\"><span class=\"default\"> </span><span class=\"keyword\">{</span></td></tr>\n <tr class=\"danger\"><td><div align=\"right\"><a name=\"19\"></a><a href=\"#19\">19</a></div></td><td class=\"codeLine\"><span class=\"default\"> </span><span class=\"keyword\">return</span><span class=\"default\"> </span><span class=\"keyword\">new</span><span class=\"default\"> </span><span class=\"default\">ViewModel</span><span class=\"keyword\">(</span><span class=\"keyword\">)</span><span class=\"keyword\">;</span></td></tr>\n <tr class=\"danger\"><td><div align=\"right\"><a name=\"20\"></a><a href=\"#20\">20</a></div></td><td class=\"codeLine\"><span class=\"default\"> </span><span class=\"keyword\">}</span></td></tr>\n <tr><td><div align=\"right\"><a name=\"21\"></a><a href=\"#21\">21</a></div></td><td class=\"codeLine\"><span class=\"keyword\">}</span></td></tr>\n\n </tbody>\n </table>\n <footer>\n <h4>Legend</h4>\n <p>\n <span class=\"success\"><strong>Executed</strong></span>\n <span class=\"danger\"><strong>Not Executed</strong></span>\n <span class=\"warning\"><strong>Dead Code</strong></span>\n </p>\n <p>\n <small>Generated by <a href=\"http://github.com/sebastianbergmann/php-code-coverage\" target=\"_top\">PHP_CodeCoverage 1.2.6</a> using <a href=\"http://www.php.net/\" target=\"_top\">PHP 5.4.12-2~precise+1</a> and <a href=\"http://phpunit.de/\">PHPUnit 3.7.8</a> at Tue Apr 16 12:43:11 CEST 2013.</small>\n </p>\n </footer>\n </div>\n <script src=\"js/jquery.min.js\" type=\"text/javascript\"></script>\n <script src=\"js/bootstrap.min.js\" type=\"text/javascript\"></script>\n <script type=\"text/javascript\">$('.popin').popover({trigger: 'hover'});</script>\n </body>\n</html>\n", "meta": {"content_hash": "4b9113c0451c2e6a06009ccdcba45c41", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 468, "avg_line_length": 62.375838926174495, "alnum_prop": 0.5993113836884011, "repo_name": "kpurrmann/em", "id": "701d7ed44d27da6dcdad05959d7ca2b7b864bb80", "size": "10623", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "module/Event/test/log/Em_src_Em_Controller_IndexController.php.html", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "JavaScript", "bytes": "41651"}, {"name": "PHP", "bytes": "99453"}]}} +{"text": "\npackage at.ac.tuwien.dsg.mela.common.monitoringConcepts;\n\nimport java.io.Serializable;\nimport javax.xml.bind.annotation.*;\n\n/**\n * Author: Daniel Moldovan E-Mail: d.moldovan@dsg.tuwien.ac.at *\n *\n */\n@XmlAccessorType(XmlAccessType.FIELD)\n@XmlRootElement(name = \"Action\")\npublic class Action implements Serializable {\n\n @XmlAttribute(name = \"targetEntityID\", required = true)\n private String targetEntityID;\n @XmlAttribute(name = \"action\", required = true)\n private String action;\n\n public Action() {\n }\n\n public Action(String targetEntityID, String action) {\n this.targetEntityID = targetEntityID;\n this.action = action;\n }\n\n public String getTargetEntityID() {\n return targetEntityID;\n }\n\n public void setTargetEntityID(String targetEntityID) {\n this.targetEntityID = targetEntityID;\n }\n\n public String getAction() {\n return action;\n }\n\n public void setAction(String action) {\n this.action = action;\n }\n\n @Override\n public int hashCode() {\n int hash = 7;\n hash = 31 * hash + (this.targetEntityID != null ? this.targetEntityID.hashCode() : 0);\n hash = 31 * hash + (this.action != null ? this.action.hashCode() : 0);\n return hash;\n }\n\n @Override\n public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n final Action other = (Action) obj;\n if ((this.targetEntityID == null) ? (other.targetEntityID != null) : !this.targetEntityID.equals(other.targetEntityID)) {\n return false;\n }\n if ((this.action == null) ? (other.action != null) : !this.action.equals(other.action)) {\n return false;\n }\n return true;\n }\n\n public Action withTargetEntityID(final String targetEntityID) {\n this.targetEntityID = targetEntityID;\n return this;\n }\n\n public Action withAction(final String action) {\n this.action = action;\n return this;\n }\n\n public Action clone() {\n return new Action(targetEntityID, action);\n }\n \n \n\n}\n", "meta": {"content_hash": "3f7a8789baa4184800054608c7525a08", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 129, "avg_line_length": 25.348837209302324, "alnum_prop": 0.6096330275229358, "repo_name": "tuwiendsg/MELA", "id": "e41ea791e2108e16d2f5113bd1e1a73a04800728", "size": "2958", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MELA-Core/MELA-Common/src/main/java/at/ac/tuwien/dsg/mela/common/monitoringConcepts/Action.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "245937"}, {"name": "HTML", "bytes": "844879"}, {"name": "Java", "bytes": "2859855"}, {"name": "JavaScript", "bytes": "1208998"}, {"name": "Python", "bytes": "203971"}, {"name": "R", "bytes": "12601"}, {"name": "Shell", "bytes": "1906"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Data.Entity.ModelConfiguration;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Dominio.Entidades;\n\nnamespace Infraestrutura.Configuracao.EF\n{\n public class TipoTelefoneConfiguration\n :EntityTypeConfiguration<TipoTelefone>\n {\n }\n}\n", "meta": {"content_hash": "59e557ef1c37fb4e8e7bcee10aa38989", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 46, "avg_line_length": 22.333333333333332, "alnum_prop": 0.7850746268656716, "repo_name": "gabrielsimas/SistemasExemplo", "id": "39d71fb46c1ca88e078a70be73445d22cda8c07a", "size": "337", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DDD/ControleContatos/Infraestrutura/Configuracao/EF/TipoTelefoneConfiguration.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "14994"}, {"name": "C#", "bytes": "456492"}, {"name": "CSS", "bytes": "2056"}, {"name": "HTML", "bytes": "14829"}, {"name": "Java", "bytes": "13901"}, {"name": "JavaScript", "bytes": "322489"}]}} +{"text": "var getPixels = require('canvas-pixels').get3d;\n\nvar SpriteBatch = require('./');\nvar test = require('tape').test;\n\ntest('draws texture colors', function(t) {\n var gl = require('webgl-context')({ width: 1, height: 1 });\n\n //a white texture is often useful for tinting lines and rectangles\n var tex = require('kami-white-texture')(gl);\n \n var batch = new SpriteBatch(gl);\n\n batch.begin();\n batch.setColor(1, 0, 0, 1);\n batch.draw(tex, 0, 0, 10, 10);\n batch.end();\n\n var pix = getPixels(gl);\n t.ok( pix[0]===255 && pix[1]===0 && pix[2]===0, 'setColor tints texture color' );\n t.end();\n});", "meta": {"content_hash": "917601c26c8f144c5c85d80a9f3af9b9", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 85, "avg_line_length": 28.272727272727273, "alnum_prop": 0.6028938906752411, "repo_name": "mattdesl/kami-batch", "id": "f3e6a39dc4aa5f7db7817177464443d0f320dc05", "size": "622", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "13958"}]}} +{"text": "<!DOCTYPE html>\n<html>\n <head>\n <title>Posts Tagged “Lesson” \u2013 devStory \u2013 Tales from a web developer</title>\n\n <meta charset=\"utf-8\" />\n <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>\n <meta http-equiv='X-UA-Compatible' content='IE=edge'>\n\n \n <meta name=\"twitter:card\" content=\"summary_large_image\">\n <meta name=\"twitter:image\" content=\"http://www.devstory.mikecornish.net/images/social-large.png\">\n <meta property=\"og:image\" content=\"http://www.devstory.mikecornish.net/images/social-large.png\">\n \n\n <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'>\n <meta name=\"twitter:site\" content=\"@MikeWCornish\">\n <meta name=\"twitter:creator\" content=\"@MikeWCornish\">\n\n \n <meta name=\"description\" content=\"Mike Cornish is a compulsive creator who builds websites.\">\n <meta property=\"og:description\" content=\"Mike Cornish is a compulsive creator who builds websites.\" />\n <meta name=\"twitter:description\" content=\"Mike Cornish is a compulsive creator who builds websites.\" />\n \n <meta name=\"author\" content=\"devStory\" />\n\n \n \n <meta property=\"og:title\" content=\"\" />\n <meta property=\"twitter:title\" content=\"\" />\n \n \n\n\n <!--[if lt IE 9]>\n <script src=\"http://html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n <![endif]-->\n\n <link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\" />\n <link rel=\"alternate\" type=\"application/rss+xml\" title=\"devStory - Tales from a web developer\" href=\"/feed.xml\" />\n <link href='https://fonts.googleapis.com/css?family=Merriweather:400,300,700|Merriweather+Sans:700,400italic,400' rel='stylesheet' type='text/css'>\n\n <!-- Created with Jekyll Now - http://github.com/barryclark/jekyll-now -->\n </head>\n\n <body>\n <div class=\"wrapper-masthead\">\n <div class=\"container\">\n <header class=\"masthead clearfix\">\n <!--<a href=\"/\" class=\"site-avatar\"><img src=\"https://raw.githubusercontent.com/barryclark/jekyll-now/master/images/jekyll-logo.png\" /></a>-->\n\n <div class=\"site-info\">\n <h1 class=\"site-name\"><a class=\"logo\" href=\"/\" data-logo>devStory</a>\n<script type=\"text/javascript\" src=\"/js/logo.js\"></script>\n<script type=\"text/javascript\">\n initLogo();\n</script>\n</h1>\n <p class=\"site-description\">Tales from a web developer</p>\n </div>\n\n <nav>\n <a class=\"about\" href=\"/about\">mikeCornish</a>\n </nav>\n </header>\n </div>\n </div>\n \n \n <div id=\"main\" role=\"main\" class=\"container\">\n <h2 class=\"post_title\">Posts Tagged “Lesson”</h2>\n<ul>\n \n \n \n \n \n \n \n \n \n \n \n <li class=\"archive_list\">\n <time style=\"color:#666;font-size:11px;\" datetime='2017-03-07'>03/07/17</time> <a class=\"archive_list_article_link\" href='/posts/chapter-7/'>#FailMore</a>\n <p class=\"summary\"></p>\n <ul class=\"tag_list\">\n \n <li class=\"inline archive_list\"><a class=\"tag_list_link\" href=\"/tag/Chapter\">Chapter</a></li>\n \n <li class=\"inline archive_list\"><a class=\"tag_list_link\" href=\"/tag/Life\">Life</a></li>\n \n <li class=\"inline archive_list\"><a class=\"tag_list_link\" href=\"/tag/Lesson\">Lesson</a></li>\n \n </ul>\n </li>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n</ul>\n\n </div>\n\n <div class=\"wrapper-footer\">\n <div class=\"container\">\n <footer class=\"footer\">\n \n<a href=\"mailto:cornishmw@gmail.com\" target=\"_blank\"><i class=\"svg-icon email\"></i></a>\n\n\n<a href=\"https://github.com/mCornish\" target=\"_blank\"><i class=\"svg-icon github\"></i></a>\n\n\n\n\n<a href=\"https://www.twitter.com/MikeWCornish\"><i class=\"svg-icon twitter\"></i></a>\n\n\n\n\n </footer>\n </div>\n </div>\n\n <!-- start Mixpanel -->\n<script type=\"text/javascript\">\n(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(\".\");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;\"undefined\"!==typeof d?c=b[d]=[]:d=\"mixpanel\";c.people=c.people||[];c.toString=function(b){var a=\"mixpanel\";\"mixpanel\"!==d&&(a+=\".\"+d);b||(a+=\" (stub)\");return a};c.people.toString=function(){return c.toString(1)+\".people (stub)\"};i=\"disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user\".split(\" \");\nfor(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=e.createElement(\"script\");a.type=\"text/javascript\";a.async=!0;a.src=\"undefined\"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:\"file:\"===e.location.protocol&&\"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js\".match(/^\\/\\//)?\"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js\":\"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js\";f=e.getElementsByTagName(\"script\")[0];f.parentNode.insertBefore(a,f)}})(document,window.mixpanel||[]);\nmixpanel.init(\"6da672b6f66f9813757d30f733fa3758\");\n</script>\n<!-- end Mixpanel -->\n<script src=\"/js/analytics.js\" type=\"text/javascript\"></script>\n<script type=\"text/javascript\">\n trackPageview();\n trackLinks();\n</script>\n\n </body>\n</html>\n", "meta": {"content_hash": "1920bc47ffd7530bc75ba2412a04ea15", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 750, "avg_line_length": 25.823255813953487, "alnum_prop": 0.6080691642651297, "repo_name": "mCornish/blog", "id": "531931936be565d6686ea08b70c338b735000891", "size": "5556", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/tag/Lesson/index.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "66560"}, {"name": "HTML", "bytes": "11134"}, {"name": "JavaScript", "bytes": "2008"}, {"name": "Ruby", "bytes": "1026"}]}} +{"text": "package eu.ramich.popularmovies.ui;\n\nimport android.content.Intent;\nimport android.database.Cursor;\nimport android.graphics.Bitmap;\nimport android.graphics.drawable.BitmapDrawable;\nimport android.net.Uri;\nimport android.os.Bundle;\nimport android.support.annotation.Nullable;\nimport android.support.design.widget.AppBarLayout;\nimport android.support.design.widget.CollapsingToolbarLayout;\nimport android.support.design.widget.FloatingActionButton;\nimport android.support.design.widget.Snackbar;\nimport android.support.v4.app.Fragment;\nimport android.support.v4.app.LoaderManager;\nimport android.support.v4.content.CursorLoader;\nimport android.support.v4.content.Loader;\nimport android.support.v7.app.AppCompatActivity;\nimport android.support.v7.graphics.Palette;\nimport android.support.v7.widget.LinearLayoutManager;\nimport android.support.v7.widget.RecyclerView;\nimport android.support.v7.widget.Toolbar;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport com.squareup.picasso.Callback;\nimport com.squareup.picasso.Picasso;\n\nimport java.util.Locale;\n\nimport butterknife.BindView;\nimport butterknife.ButterKnife;\nimport eu.ramich.popularmovies.R;\nimport eu.ramich.popularmovies.adapter.ReviewAdapter;\nimport eu.ramich.popularmovies.adapter.TrailerAdapter;\nimport eu.ramich.popularmovies.data.MovieContract;\nimport eu.ramich.popularmovies.sync.PopularMoviesIntentService;\nimport eu.ramich.popularmovies.sync.PopularMoviesSyncTasks;\nimport eu.ramich.popularmovies.utilities.NetworkUtils;\nimport eu.ramich.popularmovies.utilities.PopularMoviesUtils;\n\npublic class MovieDetailsFragment extends Fragment\n implements LoaderManager.LoaderCallbacks<Cursor>,\n TrailerAdapter.TrailerAdapterOnClickHandler,\n ReviewAdapter.ReviewAdapterOnClickHandler {\n\n private static final String TAG = MovieDetailsFragment.class.getSimpleName();\n\n private TrailerAdapter mTrailerAdapter;\n private ReviewAdapter mReviewAdapter;\n\n @BindView(R.id.rv_trailer) RecyclerView mTrailerRecyclerView;\n @BindView(R.id.rv_review) RecyclerView mReviewRecyclerView;\n\n @BindView(R.id.iv_movie_backdrop) ImageView movieBackdrop;\n @BindView(R.id.toolbar_layout) CollapsingToolbarLayout cToolbarLayout;\n @BindView(R.id.app_bar) AppBarLayout appBarLayout;\n\n @BindView(R.id.tv_movie_title_detail) TextView movieTitle;\n @BindView(R.id.tv_movie_release_date) TextView movieRelease;\n @BindView(R.id.tv_movie_overview) TextView movieOverview;\n @BindView(R.id.iv_movie_thumbnail) ImageView movieThumbnail;\n @BindView(R.id.tv_movie_average_rating) TextView movieAverageRating;\n\n @BindView(R.id.fab_fav) FloatingActionButton fav;\n\n public static final String[] DETAIL_MOVIE_PROJECTION = {\n MovieContract.MovieEntry.COLUMN_MOVIE_ID,\n MovieContract.MovieEntry.COLUMN_ORIGINAL_TITLE,\n MovieContract.MovieEntry.COLUMN_TITLE,\n MovieContract.MovieEntry.COLUMN_BACKDROP_PATH,\n MovieContract.MovieEntry.COLUMN_POSTER_PATH,\n MovieContract.MovieEntry.COLUMN_VOTE_AVERAGE,\n MovieContract.MovieEntry.COLUMN_RELEASE_DATE,\n MovieContract.MovieEntry.COLUMN_OVERVIEW,\n MovieContract.MovieEntry.COLUMN_FAVORITE\n };\n\n public static final int INDEX_MOVIE_ID = 0;\n public static final int INDEX_ORIGINAL_TITLE = 1;\n public static final int INDEX_TITLE = 2;\n public static final int INDEX_BACKDROP_PATH = 3;\n public static final int INDEX_POSTER_PATH = 4;\n public static final int INDEX_VOTE_AVERAGE = 5;\n public static final int INDEX_RELEASE_DATE = 6;\n public static final int INDEX_OVERVIEW = 7;\n public static final int INDEX_FAVOURITE = 8;\n\n public static final String[] DETAIL_TRAILER_PROJECTION = {\n MovieContract.TrailerEntry.COLUMN_KEY,\n MovieContract.TrailerEntry.COLUMN_NAME\n };\n\n public static final int INDEX_TRAILER_KEY = 0;\n public static final int INDEX_TRAILER_NAME = 1;\n\n public static final String[] DETAIL_REVIEW_PROJECTION = {\n MovieContract.ReviewEntry.COLUMN_AUTHOR,\n MovieContract.ReviewEntry.COLUMN_CONTENT\n };\n\n public static final int INDEX_REVIEW_AUTHOR = 0;\n public static final int INDEX_REVIEW_CONTENT = 1;\n\n private Uri mUri;\n private String mTitle;\n\n private static final int ID_MOVIE_LOADER = 7;\n private static final int ID_TRAILER_LOADER = 8;\n private static final int ID_REVIEWS_LOADER = 9;\n\n\n public static MovieDetailsFragment newInstance(Uri uriForMovie) {\n MovieDetailsFragment f = new MovieDetailsFragment();\n\n Bundle args = new Bundle();\n args.putParcelable(\"uri\", uriForMovie);\n f.setArguments(args);\n\n return f;\n }\n\n public Uri getShownMovieUri() {\n return getArguments().getParcelable(\"uri\");\n }\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_movie_detail, container, false);\n ButterKnife.bind(this, view);\n\n return view;\n }\n\n @Override\n public void onActivityCreated(@Nullable Bundle savedInstanceState) {\n super.onActivityCreated(savedInstanceState);\n\n if (savedInstanceState != null) {\n mUri = savedInstanceState.getParcelable(\"uri\");\n } else if (PopularMoviesUtils.isTablet()) {\n mUri = getArguments().getParcelable(\"uri\");\n } else {\n mUri = getActivity().getIntent().getData();\n }\n\n if (mUri == null)\n throw new NullPointerException(\"URI for MovieDetailsActivity cannot be null\");\n\n appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {\n\n @Override\n public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {\n if (appBarLayout.getTotalScrollRange() * -1 == verticalOffset) {\n cToolbarLayout.setTitle(mTitle);\n } else {\n cToolbarLayout.setTitle(\" \");\n }\n }\n });\n\n if (!PopularMoviesUtils.isTablet()) {\n Toolbar toolbar = (Toolbar) getActivity().findViewById(R.id.toolbar);\n ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);\n if (((AppCompatActivity) getActivity()).getSupportActionBar() != null)\n ((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n }\n\n fav.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent favIntent = new Intent(getActivity(), PopularMoviesIntentService.class);\n String message;\n\n if (fav.getTag().equals(R.drawable.ic_favorite_border)) {\n favIntent.setAction(PopularMoviesSyncTasks.ACTION_ADD_TO_FAV_MOVIES);\n message = getString(R.string.favorite_add);\n } else if (fav.getTag().equals(R.drawable.ic_favorite)) {\n favIntent.setAction(PopularMoviesSyncTasks.ACTION_REMOVE_FROM_FAV_MOVIES);\n message = getString(R.string.favorite_remove);\n } else {\n return;\n }\n\n favIntent.putExtra(\"id\", mUri.getLastPathSegment());\n getActivity().startService(favIntent);\n\n Snackbar.make(view, message, Snackbar.LENGTH_LONG).show();\n }\n });\n\n mTrailerAdapter = new TrailerAdapter(this);\n mTrailerRecyclerView.setAdapter(mTrailerAdapter);\n mTrailerRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(),\n LinearLayoutManager.HORIZONTAL, false));\n mTrailerRecyclerView.setHasFixedSize(true);\n\n mReviewAdapter = new ReviewAdapter(this);\n mReviewRecyclerView.setAdapter(mReviewAdapter);\n mReviewRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(),\n LinearLayoutManager.VERTICAL, false));\n mReviewRecyclerView.setHasFixedSize(true);\n\n Intent intent = new Intent(getActivity(), PopularMoviesIntentService.class);\n intent.setAction(PopularMoviesSyncTasks.ACTION_SYNC_VIDEO_LIST);\n intent.putExtra(\"id\", mUri.getLastPathSegment());\n getActivity().startService(intent);\n\n Intent reviewIntent = new Intent(getActivity(), PopularMoviesIntentService.class);\n reviewIntent.setAction(PopularMoviesSyncTasks.ACTION_SYNC_REVIEW_LIST);\n reviewIntent.putExtra(\"id\", mUri.getLastPathSegment());\n getActivity().startService(reviewIntent);\n\n getLoaderManager().initLoader(ID_MOVIE_LOADER, null, this);\n getLoaderManager().initLoader(ID_TRAILER_LOADER, null, this);\n getLoaderManager().initLoader(ID_REVIEWS_LOADER, null, this);\n }\n\n @Override\n public Loader<Cursor> onCreateLoader(int id, Bundle args) {\n String selection;\n String[] selectionArgs;\n\n switch (id) {\n case ID_MOVIE_LOADER:\n return new CursorLoader(getActivity(),\n mUri,\n DETAIL_MOVIE_PROJECTION,\n null,\n null,\n null);\n\n case ID_TRAILER_LOADER:\n selection = MovieContract.TrailerEntry.trailerSelection();\n selectionArgs = MovieContract.TrailerEntry\n .trailerSelectionArgs(mUri.getLastPathSegment());\n\n return new CursorLoader(getActivity(),\n MovieContract.TrailerEntry.CONTENT_URI,\n DETAIL_TRAILER_PROJECTION,\n selection,\n selectionArgs,\n null);\n\n case ID_REVIEWS_LOADER:\n selection = MovieContract.ReviewEntry.COLUMN_MOVIE_ID + \" = ?\";\n selectionArgs = new String[]{mUri.getLastPathSegment()};\n\n return new CursorLoader(getActivity(),\n MovieContract.ReviewEntry.CONTENT_URI,\n DETAIL_REVIEW_PROJECTION,\n selection,\n selectionArgs,\n null);\n\n default:\n throw new RuntimeException(\"Loader Not Implemented: \" + id);\n }\n }\n\n @Override\n public void onLoadFinished(Loader<Cursor> loader, Cursor data) {\n boolean cursorHasValidData = false;\n if (data != null && data.moveToFirst()) {\n cursorHasValidData = true;\n }\n\n if (!cursorHasValidData)\n return;\n\n switch (loader.getId()) {\n case ID_MOVIE_LOADER:\n mTitle = data.getString(INDEX_TITLE);\n movieTitle.setText(data.getString(INDEX_TITLE));\n\n movieOverview.setText(data.getString(INDEX_OVERVIEW));\n movieRelease.setText(PopularMoviesUtils.normalizeDate(data.getString(INDEX_RELEASE_DATE)));\n movieAverageRating.setText(String.format(Locale.getDefault(),\n \"%.1f/10\", data.getDouble(INDEX_VOTE_AVERAGE)));\n if (data.getInt(INDEX_FAVOURITE) == 1) {\n fav.setImageResource(R.drawable.ic_favorite);\n fav.setTag(R.drawable.ic_favorite);\n } else {\n fav.setImageResource(R.drawable.ic_favorite_border);\n fav.setTag(R.drawable.ic_favorite_border);\n }\n\n Picasso.with(getActivity())\n .load(NetworkUtils.buildPosterUrl(data.getString(INDEX_POSTER_PATH),\n PopularMoviesUtils.getPosterWidth(true)).toString())\n .into(movieThumbnail);\n\n Picasso.with(getActivity())\n .load(NetworkUtils.buildPosterUrl(data.getString(INDEX_BACKDROP_PATH),\n PopularMoviesUtils.getPosterWidth(false)).toString())\n .into(movieBackdrop, new Callback() {\n\n @Override\n public void onSuccess() {\n Bitmap bitmap = ((BitmapDrawable) movieBackdrop.getDrawable())\n .getBitmap();\n\n Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {\n @Override\n public void onGenerated(Palette palette) {\n Palette.Swatch swatch = palette.getDominantSwatch();\n if (swatch == null) {\n return;\n }\n int color = swatch.getRgb();\n cToolbarLayout.setBackgroundColor(color);\n cToolbarLayout.setStatusBarScrimColor(\n palette.getDarkVibrantColor(color));\n cToolbarLayout.setContentScrimColor(\n palette.getVibrantColor(color));\n }\n });\n }\n\n @Override\n public void onError() {\n Log.e(TAG, \"Error occured\");\n }\n });\n\n break;\n\n case ID_TRAILER_LOADER:\n mTrailerAdapter.swapCursor(data);\n break;\n\n case ID_REVIEWS_LOADER:\n mReviewAdapter.swapCursor(data);\n break;\n }\n }\n\n @Override\n public void onLoaderReset(Loader<Cursor> loader) {\n switch (loader.getId()) {\n case ID_TRAILER_LOADER:\n mTrailerAdapter.swapCursor(null);\n break;\n\n case ID_REVIEWS_LOADER:\n mReviewAdapter.swapCursor(null);\n break;\n }\n }\n\n @Override\n public void onClick(String trailerKey) {\n Uri trailerUri = NetworkUtils.buildTrailerUri(trailerKey);\n Intent trailerIntent = new Intent(Intent.ACTION_VIEW, trailerUri);\n\n if (trailerIntent.resolveActivity(getActivity().getPackageManager()) != null) {\n startActivity(trailerIntent);\n }\n }\n\n @Override\n public void onClick(ReviewAdapter.ReviewAdapterViewHolder rA) {\n if (!rA.isExpanded) {\n rA.reviewContent.setMaxLines(Integer.MAX_VALUE);\n rA.reviewContent.setEllipsize(null);\n rA.reviewArrow.setVisibility(View.VISIBLE);\n } else {\n rA.reviewContent.setMaxLines(3);\n rA.reviewContent.setEllipsize(TextUtils.TruncateAt.END);\n rA.reviewArrow.setVisibility(View.GONE);\n }\n rA.isExpanded = !rA.isExpanded;\n }\n\n @Override\n public void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putParcelable(\"uri\", mUri);\n }\n}\n", "meta": {"content_hash": "2c43256dd374f1ca495d9cee4b59ccc1", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 107, "avg_line_length": 40.015544041450774, "alnum_prop": 0.6131037161724718, "repo_name": "Shenkaa/Popular-Movies", "id": "2f9d8003a4b4b246a53ae7d31d166a11471754fe", "size": "15446", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/eu/ramich/popularmovies/ui/MovieDetailsFragment.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "90997"}]}} +{"text": "\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing OpenTK.Graphics.OpenGL;\n\nnamespace Treton.Graphics\n{\n\tpublic class Mesh : IDisposable\n\t{\n\t\tpublic int Handle { get; private set; }\n\t\tpublic Buffer VertexBuffer { get; private set; }\n\t\tpublic Buffer IndexBuffer { get; private set; }\n\t\tpublic SubMesh[] SubMeshes { get; private set; }\n\t\tpublic Material[] Materials;\n\n\t\tpublic Mesh(VertexFormat vertexFormat, byte[] vertexData, byte[] indexData, SubMesh[] subMeshes, Material[] materials, bool mutable = false)\n\t\t{\n\t\t\tif (vertexFormat == null)\n\t\t\t\tthrow new ArgumentNullException(\"vertexFormat\");\n\t\t\tif (vertexData == null)\n\t\t\t\tthrow new ArgumentNullException(\"vertexData\");\n\t\t\tif (indexData == null)\n\t\t\t\tthrow new ArgumentNullException(\"indexData\");\n\t\t\tif (subMeshes == null)\n\t\t\t\tthrow new ArgumentNullException(\"subMeshes\");\n\t\t\tif (materials == null)\n\t\t\t\tthrow new ArgumentNullException(\"materials\");\n\t\t\tif (subMeshes.Length != materials.Length)\n\t\t\t\tthrow new ArgumentException(\"subMeshes <-> materials length mismatch\");\n\n\t\t\tHandle = GL.GenVertexArray();\n\n\t\t\tSubMeshes = subMeshes;\n\t\t\tMaterials = materials;\n\n\t\t\tVertexBuffer = new Buffer(BufferTarget.ArrayBuffer, vertexFormat, mutable);\n\t\t\tIndexBuffer = new Buffer(BufferTarget.ElementArrayBuffer, mutable);\n\n\t\t\tVertexBuffer.SetData(vertexData);\n\t\t\tIndexBuffer.SetData(indexData);\n\n\t\t\tGL.BindVertexArray(Handle);\n\t\t\tGL.BindBuffer(IndexBuffer.Target, IndexBuffer.Handle);\n\t\t\tGL.BindVertexArray(0);\n\n\t\t\tGL.Ext.VertexArrayBindVertexBuffer(Handle, 0, VertexBuffer.Handle, IntPtr.Zero, vertexFormat.Size);\n\n\t\t\tfor (var v = 0; v < vertexFormat.Elements.Length; v++)\n\t\t\t{\n\t\t\t\tvar element = vertexFormat.Elements[v];\n\t\t\t\tvar index = (int)element.Semantic;\n\n\t\t\t\tGL.Ext.EnableVertexArrayAttrib(Handle, index);\n\t\t\t\tGL.Ext.VertexArrayVertexAttribBinding(Handle, index, 0);\n\t\t\t\tGL.Ext.VertexArrayVertexAttribFormat(Handle, index, element.Count, (ExtDirectStateAccess)element.Type, false, element.Offset);\n\t\t\t\tGL.Ext.VertexArrayVertexBindingDivisor(Handle, 0, element.Divisor);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose()\n\t\t{\n\t\t\tDispose(true);\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\t~Mesh()\n\t\t{\n\t\t\tDispose(false);\n\t\t}\n\n\t\tprotected virtual void Dispose(bool disposing)\n\t\t{\n\t\t\tif (Handle != 0)\n\t\t\t{\n\t\t\t\tGL.DeleteVertexArray(Handle);\n\t\t\t\tHandle = 0;\n\t\t\t}\n\n\t\t\tif (VertexBuffer != null)\n\t\t\t{\n\t\t\t\tVertexBuffer.Dispose();\n\t\t\t}\n\n\t\t\tif (IndexBuffer != null)\n\t\t\t{\n\t\t\t\tIndexBuffer.Dispose();\n\t\t\t}\n\t\t}\n\n\t\tpublic void Bind()\n\t\t{\n\t\t\tGL.BindVertexArray(Handle);\n\t\t}\n\n\t\tpublic struct SubMesh\n\t\t{\n\t\t\tpublic int Offset;\n\t\t\tpublic int Count;\n\n\t\t\tpublic SubMesh(int offset, int count)\n\t\t\t{\n\t\t\t\tOffset = offset;\n\t\t\t\tCount = count;\n\t\t\t}\n\t\t}\n\t}\n}\n", "meta": {"content_hash": "1f89c26351a22582720fd92233dfc8d7", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 142, "avg_line_length": 24.972477064220183, "alnum_prop": 0.6987509184423218, "repo_name": "johang88/Treton", "id": "b808c0edbd97622edb59eb8939a58203595a86e1", "size": "2724", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/Treton/Graphics/Mesh.cs", "mode": "33188", "license": "mit", "language": [{"name": "C#", "bytes": "86596"}, {"name": "F#", "bytes": "999"}, {"name": "GLSL", "bytes": "5748"}, {"name": "Shell", "bytes": "286"}, {"name": "Verilog", "bytes": "276"}]}} +{"text": "<!DOCTYPE html>\n\n<html>\n<head>\n<meta charset=\"UTF-8\">\n\n<title>class Rake::EarlyTime - rake-12.3.2 Documentation</title>\n\n<script type=\"text/javascript\">\n var rdoc_rel_prefix = \"../\";\n</script>\n\n<script src=\"../js/jquery.js\"></script>\n<script src=\"../js/darkfish.js\"></script>\n\n<link href=\"../css/fonts.css\" rel=\"stylesheet\">\n<link href=\"../css/rdoc.css\" rel=\"stylesheet\">\n\n\n\n<body id=\"top\" role=\"document\" class=\"class\">\n<nav role=\"navigation\">\n <div id=\"project-navigation\">\n <div id=\"home-section\" role=\"region\" title=\"Quick navigation\" class=\"nav-section\">\n <h2>\n <a href=\"../index.html\" rel=\"home\">Home</a>\n </h2>\n\n <div id=\"table-of-contents-navigation\">\n <a href=\"../table_of_contents.html#pages\">Pages</a>\n <a href=\"../table_of_contents.html#classes\">Classes</a>\n <a href=\"../table_of_contents.html#methods\">Methods</a>\n </div>\n</div>\n\n <div id=\"search-section\" role=\"search\" class=\"project-section initially-hidden\">\n <form action=\"#\" method=\"get\" accept-charset=\"utf-8\">\n <div id=\"search-field-wrapper\">\n <input id=\"search-field\" role=\"combobox\" aria-label=\"Search\"\n aria-autocomplete=\"list\" aria-controls=\"search-results\"\n type=\"text\" name=\"search\" placeholder=\"Search\" spellcheck=\"false\"\n title=\"Type to search, Up and Down to navigate, Enter to load\">\n </div>\n\n <ul id=\"search-results\" aria-label=\"Search Results\"\n aria-busy=\"false\" aria-expanded=\"false\"\n aria-atomic=\"false\" class=\"initially-hidden\"></ul>\n </form>\n</div>\n\n </div>\n\n \n\n <div id=\"class-metadata\">\n \n <div id=\"parent-class-section\" class=\"nav-section\">\n <h3>Parent</h3>\n\n \n <p class=\"link\"><a href=\"../Object.html\">Object</a>\n \n</div>\n\n <div id=\"includes-section\" class=\"nav-section\">\n <h3>Included Modules</h3>\n\n <ul class=\"link-list\">\n \n \n <li><span class=\"include\">Comparable</span>\n \n \n \n <li><span class=\"include\">Singleton</span>\n \n \n </ul>\n</div>\n\n \n <!-- Method Quickref -->\n<div id=\"method-list-section\" class=\"nav-section\">\n <h3>Methods</h3>\n\n <ul class=\"link-list\" role=\"directory\">\n \n <li ><a href=\"#method-i-3C-3D-3E\">#<=></a>\n \n </ul>\n</div>\n\n </div>\n</nav>\n\n<main role=\"main\" aria-labelledby=\"class-Rake::EarlyTime\">\n <h1 id=\"class-Rake::EarlyTime\" class=\"class\">\n class Rake::EarlyTime\n </h1>\n\n <section class=\"description\">\n \n<p><a href=\"EarlyTime.html\">EarlyTime</a> is a fake timestamp that occurs\n<em>before</em> any other time value.</p>\n\n </section>\n\n \n \n \n <section id=\"5Buntitled-5D\" class=\"documentation-section\">\n \n\n \n\n \n\n \n\n \n <section id=\"public-instance-5Buntitled-5D-method-details\" class=\"method-section\">\n <header>\n <h3>Public Instance Methods</h3>\n </header>\n\n \n <div id=\"method-i-3C-3D-3E\" class=\"method-detail \">\n \n <div class=\"method-heading\">\n <span class=\"method-name\"><=></span><span\n class=\"method-args\">(other)</span>\n \n <span class=\"method-click-advice\">click to toggle source</span>\n \n </div>\n \n\n <div class=\"method-description\">\n \n <p>The <a href=\"EarlyTime.html\">EarlyTime</a> always comes before\n<code>other</code>!</p>\n \n \n\n \n <div class=\"method-source-code\" id=\"3C-3D-3E-source\">\n <pre><span class=\"ruby-comment\"># File lib/rake/early_time.rb, line 12</span>\n<span class=\"ruby-keyword\">def</span> <span class=\"ruby-operator\"><=></span>(<span class=\"ruby-identifier\">other</span>)\n <span class=\"ruby-value\">-1</span>\n<span class=\"ruby-keyword\">end</span></pre>\n </div>\n \n </div>\n\n \n\n \n </div>\n\n \n </section>\n \n </section>\n</main>\n\n\n<footer id=\"validator-badges\" role=\"contentinfo\">\n <p><a href=\"http://validator.w3.org/check/referer\">Validate</a>\n <p>Generated by <a href=\"http://docs.seattlerb.org/rdoc/\">RDoc</a> 4.2.1.\n <p>Based on <a href=\"http://deveiate.org/projects/Darkfish-RDoc/\">Darkfish</a> by <a href=\"http://deveiate.org\">Michael Granger</a>.\n</footer>\n\n", "meta": {"content_hash": "6db7bf464402d5af3144160f7fdc33ed", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 134, "avg_line_length": 23.91860465116279, "alnum_prop": 0.5947982498784637, "repo_name": "Celyagd/celyagd.github.io", "id": "6c7b94e1ccc5c6f4c665c0e91a728481ad75af28", "size": "4114", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "stakes-jekyll/doc/rake-12.3.2/rdoc/Rake/EarlyTime.html", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "1375233"}, {"name": "C++", "bytes": "71485"}, {"name": "CMake", "bytes": "314"}, {"name": "CSS", "bytes": "168680"}, {"name": "HTML", "bytes": "7735250"}, {"name": "Java", "bytes": "134091"}, {"name": "JavaScript", "bytes": "196815"}, {"name": "PowerShell", "bytes": "238"}, {"name": "REXX", "bytes": "1941"}, {"name": "Ragel", "bytes": "56865"}, {"name": "Roff", "bytes": "3725"}, {"name": "Ruby", "bytes": "2708464"}, {"name": "Shell", "bytes": "842"}, {"name": "Yacc", "bytes": "7664"}]}} +{"text": "import {Command, flags} from '@heroku-cli/command'\nimport {cli} from 'cli-ux'\n\nimport {Dyno, Release} from '@heroku-cli/schema'\n\nexport default class Wait extends Command {\n static description = 'wait for all dynos to be running latest version after a release'\n\n static flags = {\n app: flags.app({required: true}),\n remote: flags.remote(),\n type: flags.string({\n char: 't',\n description: 'wait for one specific dyno type',\n }),\n 'wait-interval': flags.integer({\n char: 'w',\n description: 'how frequently to poll in seconds (to avoid hitting Heroku API rate limits)',\n parse: input => {\n const w = parseInt(input, 10)\n if (w < 10) {\n cli.error('wait-interval must be at least 10', {exit: 1})\n }\n return w\n },\n default: 10,\n }),\n 'with-run': flags.boolean({\n char: 'R',\n description: 'whether to wait for one-off run dynos',\n exclusive: ['type'],\n }),\n }\n\n async run() {\n const {flags} = this.parse(Wait)\n\n const {body: releases} = await this.heroku.request<Release[]>(`/apps/${flags.app}/releases`, {\n partial: true,\n headers: {\n Range: 'version ..; max=1, order=desc',\n },\n })\n\n if (releases.length === 0) {\n this.warn(`App ${flags.app} has no releases`)\n return\n }\n\n const latestRelease = releases[0]\n\n let released = true\n const interval = flags['wait-interval'] as number\n\n while (1 as any) {\n // eslint-disable-next-line no-await-in-loop\n const {body: dynos} = await this.heroku.get<Dyno[]>(`/apps/${flags.app}/dynos`)\n const relevantDynos = dynos\n .filter(dyno => dyno.type !== 'release')\n .filter(dyno => flags['with-run'] || dyno.type !== 'run')\n .filter(dyno => !flags.type || dyno.type === flags.type)\n\n const onLatest = relevantDynos.filter((dyno: Dyno) => {\n return dyno.state === 'up' &&\n latestRelease.version !== undefined &&\n dyno.release !== undefined &&\n dyno.release.version !== undefined &&\n dyno.release.version >= latestRelease.version\n })\n const releasedFraction = `${onLatest.length} / ${relevantDynos.length}`\n if (onLatest.length === relevantDynos.length) {\n if (!released) {\n cli.action.stop(`${releasedFraction}, done`)\n }\n break\n }\n\n if (released) {\n released = false\n cli.action.start(`Waiting for every dyno to be running v${latestRelease.version}`)\n }\n\n cli.action.status = releasedFraction\n\n // eslint-disable-next-line no-await-in-loop\n await cli.wait(interval * 1000)\n }\n }\n}\n", "meta": {"content_hash": "99477e3e2ddfef014be44817a5512535", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 98, "avg_line_length": 29.831460674157302, "alnum_prop": 0.584180790960452, "repo_name": "heroku/heroku-cli", "id": "7d364fb3dd3e811dc38533fb288ebf5aa1e3d32d", "size": "2655", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "packages/ps/src/commands/ps/wait.ts", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "239"}, {"name": "Go", "bytes": "87715"}, {"name": "JavaScript", "bytes": "4155"}, {"name": "Ruby", "bytes": "4575"}, {"name": "Shell", "bytes": "434"}]}} +{"text": "\n/**\n * Creates a rule that will be applied when an MDC-Web component is within the context of an RTL layout.\n *\n * Usage Example:\n * ```scss\n * .mdc-foo {\n * position: absolute;\n * left: 0;\n *\n * @include mdc-rtl {\n * left: auto;\n * right: 0;\n * }\n *\n * &__bar {\n * margin-left: 4px;\n * @include mdc-rtl(\".mdc-foo\") {\n * margin-left: auto;\n * margin-right: 4px;\n * }\n * }\n * }\n *\n * .mdc-foo--mod {\n * padding-left: 4px;\n *\n * @include mdc-rtl {\n * padding-left: auto;\n * padding-right: 4px;\n * }\n * }\n * ```\n *\n * Note that this works by checking for [dir=\"rtl\"] on an ancestor element. While this will work\n * in most cases, it will in some cases lead to false negatives, e.g.\n *\n * ```html\n * <html dir=\"rtl\">\n * <!-- ... -->\n * <div dir=\"ltr\">\n * <div class=\"mdc-foo\">Styled incorrectly as RTL!</div>\n * </div>\n * </html>\n * ```\n *\n * In the future, selectors such as :dir (http://mdn.io/:dir) will help us mitigate this.\n */\n/**\n * Takes a base box-model property - e.g. margin / border / padding - along with a default\n * direction and value, and emits rules which apply the value to the\n * \"<base-property>-<default-direction>\" property by default, but flips the direction\n * when within an RTL context.\n *\n * For example:\n *\n * ```scss\n * .mdc-foo {\n * @include mdc-rtl-reflexive-box(margin, left, 8px);\n * }\n * ```\n * is equivalent to:\n *\n * ```scss\n * .mdc-foo {\n * margin-left: 8px;\n *\n * @include mdc-rtl {\n * margin-right: 8px;\n * margin-left: 0;\n * }\n * }\n * ```\n * whereas:\n *\n * ```scss\n * .mdc-foo {\n * @include mdc-rtl-reflexive-box(margin, right, 8px);\n * }\n * ```\n * is equivalent to:\n *\n * ```scss\n * .mdc-foo {\n * margin-right: 8px;\n *\n * @include mdc-rtl {\n * margin-right: 0;\n * margin-left: 8px;\n * }\n * }\n * ```\n *\n * You can also pass a 4th optional $root-selector argument which will be forwarded to `mdc-rtl`,\n * e.g. `@include mdc-rtl-reflexive-box-property(margin, left, 8px, \".mdc-component\")`.\n *\n * Note that this function will always zero out the original value in an RTL context. If you're\n * trying to flip the values, use mdc-rtl-reflexive-property().\n */\n/**\n * Takes a base property and emits rules that assign <base-property>-left to <left-value> and\n * <base-property>-right to <right-value> in a LTR context, and vice versa in a RTL context.\n * For example:\n *\n * ```scss\n * .mdc-foo {\n * @include mdc-rtl-reflexive-property(margin, auto, 12px);\n * }\n * ```\n * is equivalent to:\n *\n * ```scss\n * .mdc-foo {\n * margin-left: auto;\n * margin-right: 12px;\n *\n * @include mdc-rtl {\n * margin-left: 12px;\n * margin-right: auto;\n * }\n * }\n * ```\n *\n * A 4th optional $root-selector argument can be given, which will be passed to `mdc-rtl`.\n */\n/**\n * Takes an argument specifying a horizontal position property (either \"left\" or \"right\") as well\n * as a value, and applies that value to the specified position in a LTR context, and flips it in a\n * RTL context. For example:\n *\n * ```scss\n * .mdc-foo {\n * @include mdc-rtl-reflexive-position(left, 0);\n * position: absolute;\n * }\n * ```\n * is equivalent to:\n *\n * ```scss\n * .mdc-foo {\n * position: absolute;\n * left: 0;\n * right: initial;\n *\n * @include mdc-rtl {\n * right: 0;\n * left: initial;\n * }\n * }\n * ```\n * An optional third $root-selector argument may also be given, which is passed to `mdc-rtl`.\n */\n/*\n Precomputed linear color channel values, for use in contrast calculations.\n See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n\n Algorithm, for c in 0 to 255:\n f(c) {\n c = c / 255;\n return c < 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n }\n\n This lookup table is needed since there is no `pow` in SASS.\n*/\n/**\n * Calculate the luminance for a color.\n * See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n */\n/**\n * Calculate the contrast ratio between two colors.\n * See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n */\n/**\n * Determine whether to use dark or light text on top of given color.\n * Returns \"dark\" for dark text and \"light\" for light text.\n */\n/*\n Main theme colors.\n If you're a user customizing your color scheme in SASS, these are probably the only variables you need to change.\n*/\n/* Indigo 500 */\n/* Pink A200 */\n/* White */\n/* Which set of text colors to use for each main theme color (light or dark) */\n/* Text colors according to light vs dark and text type */\n/* Primary text colors for each of the theme colors */\n/*\n Precomputed linear color channel values, for use in contrast calculations.\n See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n\n Algorithm, for c in 0 to 255:\n f(c) {\n c = c / 255;\n return c < 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n }\n\n This lookup table is needed since there is no `pow` in SASS.\n*/\n/**\n * Calculate the luminance for a color.\n * See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n */\n/**\n * Calculate the contrast ratio between two colors.\n * See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n */\n/**\n * Determine whether to use dark or light text on top of given color.\n * Returns \"dark\" for dark text and \"light\" for light text.\n */\n/*\n Main theme colors.\n If you're a user customizing your color scheme in SASS, these are probably the only variables you need to change.\n*/\n/* Indigo 500 */\n/* Pink A200 */\n/* White */\n/* Which set of text colors to use for each main theme color (light or dark) */\n/* Text colors according to light vs dark and text type */\n/* Primary text colors for each of the theme colors */\n/**\n * Applies the correct theme color style to the specified property.\n * $property is typically color or background-color, but can be any CSS property that accepts color values.\n * $style should be one of the map keys in $mdc-theme-property-values (_variables.scss).\n */\n/**\n * Creates a rule to be used in MDC-Web components for dark theming, and applies the provided contents.\n * Should provide the $root-selector option if applied to anything other than the root selector.\n * When used with a modifier class, provide a second argument of `true` for the $compound parameter\n * to specify that this should be attached as a compound class.\n *\n * Usage example:\n *\n * ```scss\n * .mdc-foo {\n * color: black;\n *\n * @include mdc-theme-dark {\n * color: white;\n * }\n *\n * &__bar {\n * background: black;\n *\n * @include mdc-theme-dark(\".mdc-foo\") {\n * background: white;\n * }\n * }\n * }\n *\n * .mdc-foo--disabled {\n * opacity: .38;\n *\n * @include mdc-theme-dark(\".mdc-foo\", true) {\n * opacity: .5;\n * }\n * }\n * ```\n */\n/* TODO(sgomes): Figure out what to do about desktop font sizes. */\n/* TODO(sgomes): Figure out what to do about i18n and i18n font sizes. */\n/* TODO(sgomes): Figure out what to do about desktop font sizes. */\n/* TODO(sgomes): Figure out what to do about i18n and i18n font sizes. */\n.mdc-textfield {\n font-family: Roboto, sans-serif;\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-size: 1rem;\n letter-spacing: 0.04em;\n display: inline-block;\n margin-bottom: 8px;\n will-change: opacity, transform, color; }\n .mdc-textfield__input {\n color: rgba(0, 0, 0, 0.87);\n color: var(--mdc-theme-text-primary-on-light, rgba(0, 0, 0, 0.87));\n padding: 0 0 8px;\n border: none;\n background: none;\n font-size: inherit;\n appearance: none; }\n .mdc-textfield__input::placeholder {\n color: rgba(0, 0, 0, 0.38);\n color: var(--mdc-theme-text-hint-on-light, rgba(0, 0, 0, 0.38));\n transition: color 180ms cubic-bezier(0.4, 0, 0.2, 1);\n opacity: 1; }\n .mdc-textfield__input:focus {\n outline: none; }\n .mdc-textfield__input:focus::placeholder {\n color: rgba(0, 0, 0, 0.54);\n color: var(--mdc-theme-text-secondary-on-light, rgba(0, 0, 0, 0.54)); }\n .mdc-textfield__input:invalid {\n box-shadow: none; }\n .mdc-textfield__input--theme-dark,\n .mdc-theme--dark .mdc-textfield__input {\n color: white; }\n .mdc-textfield__input--theme-dark::placeholder,\n .mdc-theme--dark .mdc-textfield__input::placeholder {\n color: rgba(255, 255, 255, 0.5);\n color: var(--mdc-theme-text-hint-on-dark, rgba(255, 255, 255, 0.5)); }\n .mdc-textfield__input--theme-dark:focus::placeholder,\n .mdc-theme--dark .mdc-textfield__input:focus::placeholder {\n color: rgba(255, 255, 255, 0.7);\n color: var(--mdc-theme-text-secondary-on-dark, rgba(255, 255, 255, 0.7)); }\n .mdc-textfield__label {\n color: rgba(0, 0, 0, 0.38);\n color: var(--mdc-theme-text-hint-on-light, rgba(0, 0, 0, 0.38));\n position: absolute;\n bottom: 8px;\n left: 0;\n transform-origin: left top;\n transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1), color 180ms cubic-bezier(0.4, 0, 0.2, 1);\n cursor: text; }\n [dir=\"rtl\"] .mdc-textfield .mdc-textfield__label,\n .mdc-textfield[dir=\"rtl\"] .mdc-textfield__label {\n right: 0;\n left: auto;\n transform-origin: right top; }\n .mdc-textfield--theme-dark .mdc-textfield__label,\n .mdc-theme--dark .mdc-textfield__label {\n color: rgba(255, 255, 255, 0.5);\n color: var(--mdc-theme-text-hint-on-dark, rgba(255, 255, 255, 0.5)); }\n .mdc-textfield__label--float-above {\n transform: translateY(-100%) scale(0.75, 0.75);\n cursor: auto; }\n\n.mdc-textfield__input:-webkit-autofill + .mdc-textfield__label {\n transform: translateY(-100%) scale(0.75, 0.75);\n cursor: auto; }\n\n.mdc-textfield--upgraded:not(.mdc-textfield--fullwidth) {\n display: inline-flex;\n position: relative;\n box-sizing: border-box;\n align-items: flex-end;\n margin-top: 16px; }\n .mdc-textfield--upgraded:not(.mdc-textfield--fullwidth):not(.mdc-textfield--multiline) {\n height: 48px; }\n .mdc-textfield--upgraded:not(.mdc-textfield--fullwidth):not(.mdc-textfield--multiline)::after {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 1px;\n transform: translateY(50%) scaleY(1);\n transform-origin: center bottom;\n transition: background-color 180ms cubic-bezier(0.4, 0, 0.2, 1), transform 180ms cubic-bezier(0.4, 0, 0.2, 1);\n background-color: rgba(0, 0, 0, 0.12);\n content: \"\"; }\n .mdc-textfield--theme-dark .mdc-textfield--upgraded:not(.mdc-textfield--fullwidth):not(.mdc-textfield--multiline)::after,\n .mdc-theme--dark .mdc-textfield--upgraded:not(.mdc-textfield--fullwidth):not(.mdc-textfield--multiline)::after {\n background-color: rgba(255, 255, 255, 0.12); }\n .mdc-textfield--upgraded:not(.mdc-textfield--fullwidth) .mdc-textfield__label {\n pointer-events: none; }\n\n.mdc-textfield--focused.mdc-textfield--upgraded:not(.mdc-textfield--fullwidth):not(.mdc-textfield--multiline)::after {\n background-color: #3f51b5;\n background-color: var(--mdc-theme-primary, #3f51b5);\n transform: translateY(100%) scaleY(2);\n transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1); }\n .mdc-textfield--theme-dark.mdc-textfield--focused.mdc-textfield--upgraded:not(.mdc-textfield--fullwidth):not(.mdc-textfield--multiline)::after,\n .mdc-theme--dark .mdc-textfield--focused.mdc-textfield--upgraded:not(.mdc-textfield--fullwidth):not(.mdc-textfield--multiline)::after {\n background-color: #3f51b5;\n background-color: var(--mdc-theme-primary, #3f51b5);\n transform: translateY(100%) scaleY(2);\n transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1); }\n\n.mdc-textfield--focused .mdc-textfield__label {\n color: #3f51b5;\n color: var(--mdc-theme-primary, #3f51b5); }\n .mdc-textfield--theme-dark .mdc-textfield--focused .mdc-textfield__label,\n .mdc-theme--dark .mdc-textfield--focused .mdc-textfield__label {\n color: #3f51b5;\n color: var(--mdc-theme-primary, #3f51b5); }\n\n.mdc-textfield--dense {\n margin-top: 12px;\n margin-bottom: 4px;\n font-size: .813rem; }\n .mdc-textfield--dense .mdc-textfield__label--float-above {\n transform: translateY(calc(-100% - 2px)) scale(0.923, 0.923); }\n\n.mdc-textfield--invalid:not(.mdc-textfield--focused)::after, .mdc-textfield--invalid:not(.mdc-textfield--focused).mdc-textfield--upgraded::after {\n background-color: #d50000; }\n\n.mdc-textfield--invalid:not(.mdc-textfield--focused) .mdc-textfield__label {\n color: #d50000; }\n\n.mdc-textfield--theme-dark.mdc-textfield--invalid:not(.mdc-textfield--focused)::after, .mdc-textfield--theme-dark.mdc-textfield--invalid:not(.mdc-textfield--focused).mdc-textfield--upgraded::after,\n.mdc-theme--dark .mdc-textfield--invalid:not(.mdc-textfield--focused)::after,\n.mdc-theme--dark .mdc-textfield--invalid:not(.mdc-textfield--focused).mdc-textfield--upgraded::after {\n background-color: #ff6e6e; }\n\n.mdc-textfield--theme-dark.mdc-textfield--invalid:not(.mdc-textfield--focused) .mdc-textfield__label,\n.mdc-theme--dark .mdc-textfield--invalid:not(.mdc-textfield--focused) .mdc-textfield__label {\n color: #ff6e6e; }\n\n.mdc-textfield--disabled {\n border-bottom: 1px dotted rgba(35, 31, 32, 0.26); }\n .mdc-textfield--disabled::after {\n display: none; }\n .mdc-textfield--disabled .mdc-textfield__input {\n padding-bottom: 7px; }\n .mdc-textfield--theme-dark.mdc-textfield--disabled,\n .mdc-theme--dark .mdc-textfield--disabled {\n border-bottom: 1px dotted rgba(255, 255, 255, 0.3); }\n .mdc-textfield--disabled .mdc-textfield__input,\n .mdc-textfield--disabled .mdc-textfield__label,\n .mdc-textfield--disabled + .mdc-textfield-helptext {\n color: rgba(0, 0, 0, 0.38);\n color: var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38)); }\n .mdc-textfield--theme-dark .mdc-textfield--disabled .mdc-textfield__input,\n .mdc-theme--dark .mdc-textfield--disabled .mdc-textfield__input, .mdc-textfield--theme-dark\n .mdc-textfield--disabled .mdc-textfield__label,\n .mdc-theme--dark\n .mdc-textfield--disabled .mdc-textfield__label {\n color: rgba(255, 255, 255, 0.5);\n color: var(--mdc-theme-text-disabled-on-dark, rgba(255, 255, 255, 0.5)); }\n .mdc-textfield--theme-dark.mdc-textfield--disabled + .mdc-textfield-helptext,\n .mdc-theme--dark .mdc-textfield--disabled + .mdc-textfield-helptext {\n color: rgba(255, 255, 255, 0.5);\n color: var(--mdc-theme-text-disabled-on-dark, rgba(255, 255, 255, 0.5)); }\n .mdc-textfield--disabled .mdc-textfield__label {\n bottom: 7px;\n cursor: default; }\n\n.mdc-textfield__input:required + .mdc-textfield__label::after {\n margin-left: 1px;\n content: \"*\"; }\n .mdc-textfield--focused .mdc-textfield__input:required + .mdc-textfield__label::after {\n color: #d50000; }\n .mdc-textfield--focused .mdc-textfield--theme-dark .mdc-textfield__input:required + .mdc-textfield__label::after, .mdc-textfield--focused\n .mdc-theme--dark .mdc-textfield__input:required + .mdc-textfield__label::after {\n color: #ff6e6e; }\n\n.mdc-textfield--multiline {\n display: flex;\n height: initial;\n transition: none; }\n .mdc-textfield--multiline::after {\n content: initial; }\n .mdc-textfield--multiline .mdc-textfield__input {\n padding: 4px;\n transition: border-color 180ms cubic-bezier(0.4, 0, 0.2, 1);\n border: 1px solid rgba(0, 0, 0, 0.12);\n border-radius: 2px; }\n .mdc-textfield--theme-dark .mdc-textfield--multiline .mdc-textfield__input,\n .mdc-theme--dark .mdc-textfield--multiline .mdc-textfield__input {\n border-color: rgba(255, 255, 255, 0.12); }\n .mdc-textfield--multiline .mdc-textfield__input:focus {\n border-color: #3f51b5;\n border-color: var(--mdc-theme-primary, #3f51b5); }\n .mdc-textfield--multiline .mdc-textfield__input:invalid:not(:focus) {\n border-color: #d50000; }\n .mdc-textfield--theme-dark .mdc-textfield--multiline .mdc-textfield__input:invalid:not(:focus),\n .mdc-theme--dark .mdc-textfield--multiline .mdc-textfield__input:invalid:not(:focus) {\n border-color: #ff6e6e; }\n .mdc-textfield--multiline .mdc-textfield__label {\n top: 6px;\n bottom: initial;\n left: 4px; }\n [dir=\"rtl\"] .mdc-textfield--multiline .mdc-textfield--multiline .mdc-textfield__label,\n .mdc-textfield--multiline[dir=\"rtl\"] .mdc-textfield--multiline .mdc-textfield__label {\n right: 4px;\n left: auto; }\n .mdc-textfield--multiline .mdc-textfield__label--float-above {\n transform: translateY(calc(-100% - 6px)) scale(0.923, 0.923); }\n .mdc-textfield--multiline.mdc-textfield--disabled {\n border-bottom: none; }\n .mdc-textfield--multiline.mdc-textfield--disabled .mdc-textfield__input {\n border: 1px dotted rgba(35, 31, 32, 0.26); }\n .mdc-textfield--theme-dark .mdc-textfield--multiline.mdc-textfield--disabled .mdc-textfield__input,\n .mdc-theme--dark .mdc-textfield--multiline.mdc-textfield--disabled .mdc-textfield__input {\n border-color: rgba(255, 255, 255, 0.3); }\n\n.mdc-textfield--fullwidth {\n display: block;\n width: 100%;\n box-sizing: border-box;\n margin: 0;\n border: none;\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n outline: none; }\n .mdc-textfield--fullwidth:not(.mdc-textfield--multiline) {\n height: 56px; }\n .mdc-textfield--fullwidth.mdc-textfield--multiline {\n padding: 20px 0 0; }\n .mdc-textfield--fullwidth.mdc-textfield--dense:not(.mdc-textfield--multiline) {\n height: 48px; }\n .mdc-textfield--fullwidth.mdc-textfield--dense.mdc-textfield--multiline {\n padding: 16px 0 0; }\n .mdc-textfield--fullwidth.mdc-textfield--disabled, .mdc-textfield--fullwidth.mdc-textfield--disabled.mdc-textfield--multiline {\n border-bottom: 1px dotted rgba(0, 0, 0, 0.12); }\n .mdc-textfield--fullwidth--theme-dark,\n .mdc-theme--dark .mdc-textfield--fullwidth {\n border-bottom: 1px solid rgba(255, 255, 255, 0.12); }\n .mdc-textfield--fullwidth--theme-dark.mdc-textfield--disabled, .mdc-textfield--fullwidth--theme-dark.mdc-textfield--disabled.mdc-textfield--multiline,\n .mdc-theme--dark .mdc-textfield--fullwidth.mdc-textfield--disabled,\n .mdc-theme--dark .mdc-textfield--fullwidth.mdc-textfield--disabled.mdc-textfield--multiline {\n border-bottom: 1px dotted rgba(255, 255, 255, 0.12); }\n .mdc-textfield--fullwidth .mdc-textfield__input {\n width: 100%;\n height: 100%;\n padding: 0;\n resize: none;\n border: none !important; }\n\n.mdc-textfield:not(.mdc-textfield--upgraded):not(.mdc-textfield--multiline) .mdc-textfield__input {\n transition: border-bottom-color 180ms cubic-bezier(0.4, 0, 0.2, 1);\n border-bottom: 1px solid rgba(0, 0, 0, 0.12); }\n\n.mdc-textfield:not(.mdc-textfield--upgraded) .mdc-textfield__input:focus {\n border-color: #3f51b5;\n border-color: var(--mdc-theme-primary, #3f51b5); }\n\n.mdc-textfield:not(.mdc-textfield--upgraded) .mdc-textfield__input:disabled {\n color: rgba(0, 0, 0, 0.38);\n color: var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38));\n border-style: dotted;\n border-color: rgba(35, 31, 32, 0.26); }\n\n.mdc-textfield:not(.mdc-textfield--upgraded) .mdc-textfield__input:invalid:not(:focus) {\n border-color: #d50000; }\n\n.mdc-textfield--theme-dark:not(.mdc-textfield--upgraded) .mdc-textfield__input:not(:focus),\n.mdc-theme--dark .mdc-textfield:not(.mdc-textfield--upgraded) .mdc-textfield__input:not(:focus) {\n border-color: rgba(255, 255, 255, 0.12); }\n\n.mdc-textfield--theme-dark:not(.mdc-textfield--upgraded) .mdc-textfield__input:disabled,\n.mdc-theme--dark .mdc-textfield:not(.mdc-textfield--upgraded) .mdc-textfield__input:disabled {\n color: rgba(255, 255, 255, 0.5);\n color: var(--mdc-theme-text-disabled-on-dark, rgba(255, 255, 255, 0.5));\n border-color: rgba(255, 255, 255, 0.3); }\n\n.mdc-textfield--theme-dark:not(.mdc-textfield--upgraded) .mdc-textfield__input:invalid:not(:focus),\n.mdc-theme--dark .mdc-textfield:not(.mdc-textfield--upgraded) .mdc-textfield__input:invalid:not(:focus) {\n border-color: #ff6e6e; }\n\n.mdc-textfield-helptext {\n color: rgba(0, 0, 0, 0.38);\n color: var(--mdc-theme-text-hint-on-light, rgba(0, 0, 0, 0.38));\n margin: 0;\n transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);\n font-size: .75rem;\n opacity: 0;\n will-change: opacity; }\n .mdc-textfield-helptext--theme-dark,\n .mdc-theme--dark .mdc-textfield-helptext {\n color: rgba(255, 255, 255, 0.5);\n color: var(--mdc-theme-text-hint-on-dark, rgba(255, 255, 255, 0.5)); }\n .mdc-textfield + .mdc-textfield-helptext {\n margin-bottom: 8px; }\n .mdc-textfield--dense + .mdc-textfield-helptext {\n margin-bottom: 4px; }\n .mdc-textfield--focused + .mdc-textfield-helptext:not(.mdc-textfield-helptext--validation-msg) {\n opacity: 1; }\n\n.mdc-textfield-helptext--persistent {\n transition: none;\n opacity: 1;\n will-change: initial; }\n\n.mdc-textfield--invalid + .mdc-textfield-helptext--validation-msg {\n color: #d50000;\n opacity: 1; }\n\n.mdc-textfield--theme-dark.mdc-textfield--invalid + .mdc-textfield-helptext--validation-msg,\n.mdc-theme--dark .mdc-textfield--invalid + .mdc-textfield-helptext--validation-msg {\n color: #ff6e6e; }\n\n.mdc-form-field > .mdc-textfield + label {\n align-self: flex-start; }\n", "meta": {"content_hash": "c6c7df31c345e2f7d21c88c53424bacf", "timestamp": "", "source": "github", "line_count": 571, "max_line_length": 197, "avg_line_length": 36.63922942206655, "alnum_prop": 0.6581903350700253, "repo_name": "BCM-Company/octohydra", "id": "ed5e311331e3b72fe7658989d1f2e7e573809a33", "size": "21013", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "node_modules/@material/textfield/dist/mdc.textfield.css", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "547"}, {"name": "CSS", "bytes": "42690"}, {"name": "HTML", "bytes": "36989"}, {"name": "JavaScript", "bytes": "11271"}]}} +{"text": "\n\n#include \"tbb/blocked_range3d.h\"\n#include \"harness_assert.h\"\n\n// First test as much as we can without including other headers.\n// Doing so should catch problems arising from failing to include headers.\n\ntemplate<typename Tag>\nclass AbstractValueType {\n AbstractValueType() {}\n int value;\npublic:\n template<typename OtherTag>\n friend AbstractValueType<OtherTag> MakeAbstractValueType( int i );\n\n template<typename OtherTag>\n friend int GetValueOf( const AbstractValueType<OtherTag>& v ) ;\n};\n\ntemplate<typename Tag>\nAbstractValueType<Tag> MakeAbstractValueType( int i ) {\n AbstractValueType<Tag> x;\n x.value = i;\n return x;\n}\n\ntemplate<typename Tag>\nint GetValueOf( const AbstractValueType<Tag>& v ) {return v.value;}\n\ntemplate<typename Tag>\nbool operator<( const AbstractValueType<Tag>& u, const AbstractValueType<Tag>& v ) {\n return GetValueOf(u)<GetValueOf(v);\n}\n\ntemplate<typename Tag>\nstd::size_t operator-( const AbstractValueType<Tag>& u, const AbstractValueType<Tag>& v ) {\n return GetValueOf(u)-GetValueOf(v);\n}\n\ntemplate<typename Tag>\nAbstractValueType<Tag> operator+( const AbstractValueType<Tag>& u, std::size_t offset ) {\n return MakeAbstractValueType<Tag>(GetValueOf(u)+int(offset));\n}\n\nstruct PageTag {};\nstruct RowTag {};\nstruct ColTag {};\n\nstatic void SerialTest() {\n typedef AbstractValueType<PageTag> page_type;\n typedef AbstractValueType<RowTag> row_type;\n typedef AbstractValueType<ColTag> col_type;\n typedef tbb::blocked_range3d<page_type,row_type,col_type> range_type;\n for( int page_x=-4; page_x<4; ++page_x ) {\n for( int page_y=page_x; page_y<4; ++page_y ) {\n page_type page_i = MakeAbstractValueType<PageTag>(page_x);\n page_type page_j = MakeAbstractValueType<PageTag>(page_y);\n for( int page_grain=1; page_grain<4; ++page_grain ) {\n for( int row_x=-4; row_x<4; ++row_x ) {\n for( int row_y=row_x; row_y<4; ++row_y ) {\n row_type row_i = MakeAbstractValueType<RowTag>(row_x);\n row_type row_j = MakeAbstractValueType<RowTag>(row_y);\n for( int row_grain=1; row_grain<4; ++row_grain ) {\n for( int col_x=-4; col_x<4; ++col_x ) {\n for( int col_y=col_x; col_y<4; ++col_y ) {\n col_type col_i = MakeAbstractValueType<ColTag>(col_x);\n col_type col_j = MakeAbstractValueType<ColTag>(col_y);\n for( int col_grain=1; col_grain<4; ++col_grain ) {\n range_type r( page_i, page_j, page_grain, row_i, row_j, row_grain, col_i, col_j, col_grain );\n AssertSameType( r.is_divisible(), true );\n\n AssertSameType( r.empty(), true );\n\n AssertSameType( static_cast<range_type::page_range_type::const_iterator*>(0), static_cast<page_type*>(0) );\n AssertSameType( static_cast<range_type::row_range_type::const_iterator*>(0), static_cast<row_type*>(0) );\n AssertSameType( static_cast<range_type::col_range_type::const_iterator*>(0), static_cast<col_type*>(0) );\n\n AssertSameType( r.pages(), tbb::blocked_range<page_type>( page_i, page_j, 1 ));\n AssertSameType( r.rows(), tbb::blocked_range<row_type>( row_i, row_j, 1 ));\n AssertSameType( r.cols(), tbb::blocked_range<col_type>( col_i, col_j, 1 ));\n\n ASSERT( r.empty()==(page_x==page_y||row_x==row_y||col_x==col_y), NULL );\n\n ASSERT( r.is_divisible()==(page_y-page_x>page_grain||row_y-row_x>row_grain||col_y-col_x>col_grain), NULL );\n\n if( r.is_divisible() ) {\n range_type r2(r,tbb::split());\n if( (GetValueOf(r2.pages().begin())==GetValueOf(r.pages().begin())) && (GetValueOf(r2.rows().begin())==GetValueOf(r.rows().begin())) ) {\n ASSERT( GetValueOf(r2.pages().end())==GetValueOf(r.pages().end()), NULL );\n ASSERT( GetValueOf(r2.rows().end())==GetValueOf(r.rows().end()), NULL );\n ASSERT( GetValueOf(r2.cols().begin())==GetValueOf(r.cols().end()), NULL );\n } else {\n if ( (GetValueOf(r2.pages().begin())==GetValueOf(r.pages().begin())) && (GetValueOf(r2.cols().begin())==GetValueOf(r.cols().begin())) ) {\n ASSERT( GetValueOf(r2.pages().end())==GetValueOf(r.pages().end()), NULL );\n ASSERT( GetValueOf(r2.cols().end())==GetValueOf(r.cols().end()), NULL );\n ASSERT( GetValueOf(r2.rows().begin())==GetValueOf(r.rows().end()), NULL );\n } else {\n ASSERT( GetValueOf(r2.rows().end())==GetValueOf(r.rows().end()), NULL );\n ASSERT( GetValueOf(r2.cols().end())==GetValueOf(r.cols().end()), NULL );\n ASSERT( GetValueOf(r2.pages().begin())==GetValueOf(r.pages().end()), NULL );\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}\n\n#include \"tbb/parallel_for.h\"\n#include \"harness.h\"\n\nconst int N = 1<<5;\n\nunsigned char Array[N][N][N];\n\nstruct Striker {\n // Note: we use <int> here instead of <long> in order to test for problems similar to Quad 407676\n void operator()( const tbb::blocked_range3d<int>& r ) const {\n for( tbb::blocked_range<int>::const_iterator i=r.pages().begin(); i!=r.pages().end(); ++i )\n for( tbb::blocked_range<int>::const_iterator j=r.rows().begin(); j!=r.rows().end(); ++j )\n for( tbb::blocked_range<int>::const_iterator k=r.cols().begin(); k!=r.cols().end(); ++k )\n ++Array[i][j][k];\n }\n};\n\nvoid ParallelTest() {\n for( int i=0; i<N; i=i<3 ? i+1 : i*3 ) {\n for( int j=0; j<N; j=j<3 ? j+1 : j*3 ) {\n for( int k=0; k<N; k=k<3 ? k+1 : k*3 ) {\n const tbb::blocked_range3d<int> r( 0, i, 5, 0, j, 3, 0, k, 1 );\n tbb::parallel_for( r, Striker() );\n for( int l=0; l<N; ++l ) {\n for( int m=0; m<N; ++m ) {\n for( int n=0; n<N; ++n ) {\n ASSERT( Array[l][m][n]==(l<i && m<j && n<k), NULL );\n Array[l][m][n] = 0;\n }\n }\n }\n }\n }\n }\n}\n\n#include \"tbb/task_scheduler_init.h\"\n\nint TestMain () {\n SerialTest();\n for( int p=MinThread; p<=MaxThread; ++p ) {\n tbb::task_scheduler_init init(p);\n ParallelTest();\n }\n return Harness::Done;\n}\n", "meta": {"content_hash": "d3856c0d319be83a0f77abfd175bd424", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 185, "avg_line_length": 47.08074534161491, "alnum_prop": 0.4737467018469657, "repo_name": "Teaonly/easyLearning.js", "id": "242fcfd97eeabc6589def56b434efb1974fc34df", "size": "8196", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TensorExpress/aten/src/ATen/cpu/tbb/tbb_remote/src/test/test_blocked_range3d.cpp", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "1"}, {"name": "C++", "bytes": "11485"}, {"name": "JavaScript", "bytes": "100936"}, {"name": "Jupyter Notebook", "bytes": "213476"}, {"name": "Lua", "bytes": "17603"}, {"name": "Python", "bytes": "320"}, {"name": "Shell", "bytes": "375"}]}} +{"text": "/* global describe, it */\n/* eslint no-invalid-this: 0 */\nprocess.env.NODE_ENV = \"test\";\n\nconst assertTransform = require(\"assert-transform\");\nconst path = require(\"path\");\n\nconst BABEL_OPTIONS = {\n presets: [],\n plugins: [\n \"syntax-jsx\",\n [path.join(__dirname, \"..\", \"lib\", \"index.js\"), {\n \"cssmodule\": \"path/to/classnames.css\"\n }]\n ]\n};\n\nconst test = (type, babelOptions) => (testCase) => () =>\n assertTransform(\n path.join(__dirname, \"fixtures\", type, testCase, \"actual.js\"),\n path.join(__dirname, \"fixtures\", type, testCase, \"expected.js\"),\n babelOptions || BABEL_OPTIONS\n );\n\ndescribe(\"babel-plugin-react-cssmoduleify\", () => {\n [\"jsx\", \"createElement\", \"compiled\"].forEach((type) => {\n describe(type, () => {\n it(\"should transform simple literals\", test(type)(\"string\"));\n it(\"should transform multiple-class string literals\", test(type)(\"string-multiple\"));\n it(\"should transform JSXExpressionContainer values\", test(type)(\"string-jsx-expression\"));\n it(\"should transform *.join(\\\" \\\") expressions\", test(type)(\"array-join\"));\n it(\"should transform simple identifier expressions\", test(type)(\"identifier\"));\n it(\"should transform a simple call expression\", test(type)(\"call-expression\"));\n it(\"should transform a classnames call\", test(type)(\"classnames\"));\n it(\"should transform a spread assignment\", test(type)(\"jsx-spread\"));\n it(\"should transform binary expressions\", test(type)(\"binary-expression\"));\n it(\"should transform logical expressions\", test(type)(\"logical-expression\"));\n\n if (type === \"createElement\") {\n it(\"should transform prop identifiers\", test(type)(\"identifier-props\"));\n }\n });\n });\n});\n", "meta": {"content_hash": "43076315cb7143fc2411d0663d56f90f", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 96, "avg_line_length": 39.09090909090909, "alnum_prop": 0.6406976744186047, "repo_name": "walmartreact/babel-plugin-react-cssmoduleify", "id": "bad341ae7ac5980c6dba6e707386b5683be5f84f", "size": "1720", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/index.js", "mode": "33188", "license": "mit", "language": [{"name": "JavaScript", "bytes": "16208"}]}} +{"text": "import messages from 'ringcentral-integration/modules/Conference/messages';\n\nexport default {\n [messages.requireAditionalNumbers]: 'Please select the additional dial-in numbers.'\n};\n", "meta": {"content_hash": "f7dec885d192dc0d4ca169853898365d", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 85, "avg_line_length": 36.6, "alnum_prop": 0.8032786885245902, "repo_name": "u9520107/ringcentral-js-widget", "id": "796b798d783702c4fc56c97555c608c47c939e82", "size": "183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/ringcentral-widgets/components/ConferenceAlert/i18n/en-US.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "90533"}, {"name": "HTML", "bytes": "2967"}, {"name": "JavaScript", "bytes": "433434"}, {"name": "Shell", "bytes": "1001"}]}} +{"text": "require File.dirname(__FILE__) + '/../test_helper'\n\nclass SalesforceObjectTypeTest < ActiveSupport::TestCase\n # Replace this with your real tests.\n def test_truth\n assert true\n end\nend\n", "meta": {"content_hash": "73f773a852484d2421cf5c8a0b65a85b", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 56, "avg_line_length": 23.875, "alnum_prop": 0.7225130890052356, "repo_name": "raygao/SFRWatcher", "id": "33f2d2d664eacfc5ea91db62813e6680a0baa629", "size": "191", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/unit/salesforce_object_type_test.rb", "mode": "33188", "license": "apache-2.0", "language": [{"name": "JavaScript", "bytes": "85591"}, {"name": "Ruby", "bytes": "197148"}]}} +{"text": "> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3507)\nin [GitLab Premium](https://about.gitlab.com/pricing/) 10.3.\n\n## Overview\n\nIf your application offers a web interface and you are using\n[GitLab CI/CD](../../../ci/README.md), you can quickly determine the performance\nimpact of pending code changes.\n\nGitLab uses [Sitespeed.io](https://www.sitespeed.io), a free and open source\ntool for measuring the performance of web sites, and has built a simple\n[Sitespeed plugin](https://gitlab.com/gitlab-org/gl-performance)\nwhich outputs the results in a file called `performance.json`. This plugin\noutputs the performance score for each page that is analyzed.\n\nThe [Sitespeed.io performance score](http://examples.sitespeed.io/6.0/2017-11-23-23-43-35/help.html)\nis a composite value based on best practices, and we will be expanding support\nfor [additional metrics](https://gitlab.com/gitlab-org/gitlab-ee/issues/4370)\nin a future release.\n\nGoing a step further, GitLab can show the Performance report right\nin the merge request widget area:\n\n## Use cases\n\nFor instance, consider the following workflow:\n\n1. A member of the marketing team is attempting to track engagement by adding a new tool\n1. With browser performance metrics, they see how their changes are impacting the usability of the page for end users\n1. The metrics show that after their changes the performance score of the page has gone down\n1. When looking at the detailed report, they see that the new Javascript library was included in `<head>` which affects loading page speed\n1. They ask a front end developer to help them, who sets the library to load asynchronously\n1. The frontend developer approves the merge request and authorizes its deployment to production\n\n## How it works\n\nFirst of all, you need to define a job in your `.gitlab-ci.yml` file that generates the\n[Performance report artifact](../../../ci/yaml/README.md#artifactsreportsperformance-premium).\nFor more information on how the Performance job should look like, check the\nexample on [Testing Browser Performance](../../../ci/examples/browser_performance.md).\n\nGitLab then checks this report, compares key performance metrics for each page\nbetween the source and target branches, and shows the information right on the merge request.\n\n>**Note:**\nIf the Performance report doesn't have anything to compare to, no information\nwill be displayed in the merge request area. That is the case when you add the\nPerformance job in your `.gitlab-ci.yml` for the very first time.\nConsecutive merge requests will have something to compare to and the Performance\nreport will be shown properly.\n\n\n", "meta": {"content_hash": "b6b8e0a4c46e5a4c35211cdc3dc31ec1", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 138, "avg_line_length": 51.82692307692308, "alnum_prop": 0.7844155844155845, "repo_name": "iiet/iiet-git", "id": "65ee2e128aed1e530f620d051413214ee8528e60", "size": "2740", "binary": false, "copies": "1", "ref": "refs/heads/release", "path": "doc/user/project/merge_requests/browser_performance_testing.md", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "694819"}, {"name": "Clojure", "bytes": "79"}, {"name": "Dockerfile", "bytes": "1907"}, {"name": "HTML", "bytes": "1386003"}, {"name": "JavaScript", "bytes": "4784137"}, {"name": "Ruby", "bytes": "21288676"}, {"name": "Shell", "bytes": "47962"}, {"name": "Vue", "bytes": "1163492"}]}} +{"text": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n\n <modelVersion>4.0.0</modelVersion>\n\n <groupId>ch.qos.logback</groupId>\n <artifactId>audit-parent</artifactId>\n <version>0.6</version>\n <packaging>pom</packaging>\n <name>Logback Audit Parent</name>\n <description>Logback Audit project</description>\n\n\n <url>http://audit.qos.ch</url>\n\n <modules>\n <module>audit-common</module>\n <module>audit-server</module>\n <module>audit-client</module>\n <module>audit-examples</module>\n <module>audit-site</module>\n </modules>\n\n <licenses>\n <license>\n <name>Eclipse Public License - v 1.0</name>\n <url>http://www.eclipse.org/legal/epl-v10.html</url>\n </license>\n\n <license>\n <name>GNU Lesser General Public License</name>\n <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</url>\n </license>\n </licenses>\n\n <scm>\n <url>https://github.com/qos/logback</url>\n <connection>git@github.com:qos-ch/logback-audit.git</connection>\n </scm>\n\n <developers>\n <developer>\n <id>ceki</id>\n <name>Ceki Gulcu</name>\n <email>ceki@qos.ch</email>\n </developer>\n </developers>\n\n <properties>\n <slf4j.version>1.7.2</slf4j.version>\n <logback.version>1.0.9</logback.version>\n <janino.version>2.6.1</janino.version>\n </properties>\n\n <dependencies>\n <dependency>\n <groupId>junit</groupId>\n <artifactId>junit</artifactId>\n <version>3.8.1</version>\n <scope>test</scope>\n </dependency>\n </dependencies>\n\n\n <dependencyManagement>\n <dependencies>\n <dependency>\n <groupId>javax.servlet</groupId>\n <artifactId>servlet-api</artifactId>\n <version>2.5</version>\n </dependency>\n\n <dependency>\n <groupId>ch.qos.logback</groupId>\n <artifactId>audit-common</artifactId>\n <version>${project.version}</version>\n </dependency>\n\n <dependency>\n <groupId>ch.qos.logback</groupId>\n <artifactId>audit-client</artifactId>\n <version>${project.version}</version>\n </dependency>\n\n <dependency>\n <groupId>ch.qos.logback</groupId>\n <artifactId>logback-core</artifactId>\n <version>${logback.version}</version>\n </dependency>\n\n <dependency>\n <groupId>ch.qos.logback</groupId>\n <artifactId>logback-classic</artifactId>\n <version>${logback.version}</version>\n </dependency>\n\n <dependency>\n <groupId>org.slf4j</groupId>\n <artifactId>slf4j-api</artifactId>\n <version>${slf4j.version}</version>\n </dependency>\n\n <dependency>\n <groupId>org.slf4j</groupId>\n <artifactId>jcl-over-slf4j</artifactId>\n <version>${slf4j.version}</version>\n </dependency>\n\n <dependency>\n <groupId>org.slf4j</groupId>\n <artifactId>slf4j-simple</artifactId>\n <version>${slf4j.version}</version>\n </dependency>\n\n\n <dependency>\n <groupId>janino</groupId>\n <artifactId>janino</artifactId>\n <version>2.5.10</version>\n </dependency>\n <dependency>\n <groupId>javax.mail</groupId>\n <artifactId>mail</artifactId>\n <version>1.4</version>\n </dependency>\n <dependency>\n <groupId>dom4j</groupId>\n <artifactId>dom4j</artifactId>\n <version>1.6.1</version>\n </dependency>\n <dependency>\n <groupId>hsqldb</groupId>\n <artifactId>hsqldb</artifactId>\n <version>1.8.0.7</version>\n </dependency>\n\n </dependencies>\n </dependencyManagement>\n\n <build>\n <extensions>\n <extension>\n <groupId>org.apache.maven.wagon</groupId>\n <artifactId>wagon-ssh</artifactId>\n <version>2.0</version>\n </extension>\n </extensions>\n <plugins>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-compiler-plugin</artifactId>\n <version>2.3.2</version>\n <configuration>\n <source>1.7</source>\n <target>1.7</target>\n </configuration>\n </plugin>\n\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-surefire-plugin</artifactId>\n <version>2.6</version>\n </plugin>\n\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-source-plugin</artifactId>\n <version>2.1.2</version>\n <executions>\n <execution>\n <phase>package</phase>\n <goals>\n <goal>jar</goal>\n </goals>\n </execution>\n </executions>\n </plugin>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-eclipse-plugin</artifactId>\n <version>2.8</version>\n <configuration>\n <downloadSources>true</downloadSources>\n </configuration>\n </plugin>\n\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-assembly-plugin</artifactId>\n <version>2.1</version>\n <configuration>\n <descriptors>\n <descriptor>\n src/main/assembly/dist.xml\n </descriptor>\n </descriptors>\n <finalName>\n logback-audit-${project.version}\n </finalName>\n <appendAssemblyId>false</appendAssemblyId>\n <outputDirectory>target/site/dist/</outputDirectory>\n </configuration>\n </plugin>\n\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-site-plugin</artifactId>\n <version>3.0</version>\n <configuration>\n <reportPlugins>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-javadoc-plugin</artifactId>\n <version>2.8</version>\n <configuration>\n <aggregate>true</aggregate>\n <links>\n <link>\n http://java.sun.com/j2se/1.5.0/docs/api\n </link>\n </links>\n <groups>\n <group>\n <title>Logback Audit Common</title>\n <packages>ch.qos.logback.audit</packages>\n </group>\n <group>\n <title>Logback Audit Client</title>\n <packages>\n ch.qos.logback.audit.client:ch.qos.logback.audit.client.*\n </packages>\n </group>\n <group>\n <title>Logback Audit Server</title>\n <packages>\n ch.qos.logback.audit.server:ch.qos.logback.audit.server.*\n </packages>\n </group>\n <group>\n <title>Examples</title>\n <packages>examples*</packages>\n </group>\n </groups>\n </configuration>\n </plugin>\n\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-jxr-plugin</artifactId>\n <version>2.3</version>\n <configuration>\n <includes>\n <include>examples/*.java</include>\n </includes>\n </configuration>\n </plugin>\n </reportPlugins>\n </configuration>\n </plugin>\n\n </plugins>\n\n </build>\n\n <!--<reporting>-->\n <!--<plugins>-->\n <!--<plugin>-->\n <!--<groupId>org.apache.maven.plugins</groupId>-->\n <!--<artifactId>maven-project-info-reports-plugin</artifactId>-->\n <!--<version>2.4</version>-->\n <!--<reportSets>-->\n <!--<reportSet><reports/></reportSet>-->\n <!--</reportSets>-->\n <!--</plugin>-->\n <!--</plugins>-->\n <!--</reporting>-->\n\n <profiles>\n <profile>\n <id>license</id>\n <build>\n <plugins>\n <plugin>\n <groupId>com.google.code.maven-license-plugin</groupId>\n <artifactId>maven-license-plugin</artifactId>\n <configuration>\n <header>src/main/licenseHeader.txt</header>\n <quiet>false</quiet>\n <failIfMissing>true</failIfMissing>\n <aggregate>true</aggregate>\n <includes>\n <include>src/**/*.java</include>\n </includes>\n <useDefaultExcludes>true</useDefaultExcludes>\n <useDefaultMapping>true</useDefaultMapping>\n <properties>\n <year>2006</year>\n </properties>\n <headerDefinitions>\n <headerDefinition>src/main/javadocHeaders.xml</headerDefinition>\n </headerDefinitions>\n </configuration>\n </plugin>\n </plugins>\n </build>\n </profile>\n\n <profile>\n <id>javadocjar</id>\n <build>\n <plugins>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-javadoc-plugin</artifactId>\n <version>2.8</version>\n <executions>\n <execution>\n <id>attach-javadocs</id>\n <goals>\n <goal>jar</goal>\n </goals>\n </execution>\n </executions>\n </plugin>\n </plugins>\n </build>\n </profile>\n\n <profile>\n <id>sign-artifacts</id>\n <build>\n <plugins>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-gpg-plugin</artifactId>\n <version>1.1</version>\n <executions>\n <execution>\n <id>sign-artifacts</id>\n <phase>verify</phase>\n <goals>\n <goal>sign</goal>\n </goals>\n </execution>\n </executions>\n </plugin>\n </plugins>\n </build>\n </profile>\n\n </profiles>\n\n <distributionManagement>\n <site>\n <id>pixie</id>\n <url>scp://pixie.qos.ch/var/www/audit.qos.ch/htdocs/</url>\n </site>\n\n <repository>\n <id>sonatype-nexus-staging</id>\n <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>\n </repository>\n\n </distributionManagement>\n\n\n</project>\n", "meta": {"content_hash": "8891614e63ca4aa1d165df9a1d9f045c", "timestamp": "", "source": "github", "line_count": 368, "max_line_length": 105, "avg_line_length": 28.230978260869566, "alnum_prop": 0.5372028106651265, "repo_name": "OBHITA/Consent2Share", "id": "4df712f17b7f1f2b34f6665c95d8785df7472e6f", "size": "10389", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ThirdParty/logback-audit/pom.xml", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "CSS", "bytes": "491834"}, {"name": "HTML", "bytes": "2415468"}, {"name": "Java", "bytes": "8076505"}, {"name": "JavaScript", "bytes": "659769"}, {"name": "Ruby", "bytes": "1504"}, {"name": "XSLT", "bytes": "341926"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>metacoq-safechecker: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.15.0 / metacoq-safechecker - 1.0~beta1+8.11</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n metacoq-safechecker\n <small>\n 1.0~beta1+8.11\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-04-08 22:17:07 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-04-08 22:17:07 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-threads base\nbase-unix base\nconf-findutils 1 Virtual package relying on findutils\nconf-gmp 4 Virtual package relying on a GMP lib system installation\ncoq 8.15.0 Formal proof management system\ndune 3.0.3 Fast, portable, and opinionated build system\nocaml 4.10.2 The OCaml compiler (virtual package)\nocaml-base-compiler 4.10.2 Official release 4.10.2\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.3 A library manager for OCaml\nzarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers\n# opam file:\nopam-version: "2.0"\nmaintainer: "matthieu.sozeau@inria.fr"\nhomepage: "https://metacoq.github.io/metacoq"\ndev-repo: "git+https://github.com/MetaCoq/metacoq.git#coq-8.11"\nbug-reports: "https://github.com/MetaCoq/metacoq/issues"\nauthors: ["Abhishek Anand <aa755@cs.cornell.edu>"\n "Simon Boulier <simon.boulier@inria.fr>"\n "Cyril Cohen <cyril.cohen@inria.fr>"\n "Yannick Forster <forster@ps.uni-saarland.de>"\n "Fabian Kunze <fkunze@fakusb.de>"\n "Gregory Malecha <gmalecha@gmail.com>"\n "Matthieu Sozeau <matthieu.sozeau@inria.fr>"\n "Nicolas Tabareau <nicolas.tabareau@inria.fr>"\n "Th\u00e9o Winterhalter <theo.winterhalter@inria.fr>"\n]\nlicense: "MIT"\nbuild: [\n ["sh" "./configure.sh"]\n [make "-j%{jobs}%" "-C" "safechecker"]\n]\ninstall: [\n [make "-C" "safechecker" "install"]\n]\ndepends: [\n "ocaml" {>= "4.07.1"}\n "coq" {>= "8.11" & < "8.12~"}\n "coq-metacoq-template" {= version}\n "coq-metacoq-checker" {= version}\n "coq-metacoq-pcuic" {= version}\n]\nsynopsis: "Implementation and verification of safe conversion and typechecking algorithms for Coq"\ndescription: """\nMetaCoq is a meta-programming framework for Coq.\nThe SafeChecker modules provides a correct implementation of\nweak-head reduction, conversion and typechecking of Coq definitions and global environments.\n"""\nurl {\n src: "https://github.com/MetaCoq/metacoq/archive/v1.0-beta1-8.11.tar.gz"\n checksum: "sha256=1644c5bd9d02385c802535c6c46dbcaf279afcecd4ffb3da5fae08618c628c75"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-metacoq-safechecker.1.0~beta1+8.11 coq.8.15.0</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.15.0).\nThe following dependencies couldn't be met:\n - coq-metacoq-safechecker -> coq-metacoq-checker = 1.0~beta1+8.11 -> coq < 8.12~ -> ocaml < 4.10\n base of this switch (use `--unlock-base' to force)\nYour request can't be satisfied:\n - No available version of coq satisfies the constraints\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-metacoq-safechecker.1.0~beta1+8.11</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "99e866bf91e7a53fc00c807dd3ebfe89", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 159, "avg_line_length": 43.3021978021978, "alnum_prop": 0.5617307448293364, "repo_name": "coq-bench/coq-bench.github.io", "id": "6b4f8ee1d48037b079bcc5fd6fbfc22a751013f7", "size": "7907", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.10.2-2.0.6/released/8.15.0/metacoq-safechecker/1.0~beta1+8.11.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "namespace content {\nclass RenderProcessHost;\n}\n\n#if defined(USE_WEBUI_FILE_PICKER)\nnamespace wm {\nclass WMState;\n}\n#endif\n\nnamespace devtools_http_handler {\nclass DevToolsHttpHandler;\n}\n\nnamespace xwalk {\n\nclass XWalkRunner;\n\nnamespace extensions {\nclass XWalkExtensionService;\n}\n\nclass XWalkBrowserMainParts : public content::BrowserMainParts {\n public:\n explicit XWalkBrowserMainParts(\n const content::MainFunctionParams& parameters);\n\n ~XWalkBrowserMainParts() override;\n\n // BrowserMainParts overrides.\n void PreEarlyInitialization() override;\n int PreCreateThreads() override;\n void PreMainMessageLoopStart() override;\n void PostMainMessageLoopStart() override;\n void PreMainMessageLoopRun() override;\n bool MainMessageLoopRun(int* result_code) override;\n void PostMainMessageLoopRun() override;\n\n // Create all the extensions to be hooked into a new\n // RenderProcessHost. Base class implementation should be called by\n // subclasses overriding this..\n virtual void CreateInternalExtensionsForUIThread(\n content::RenderProcessHost* host,\n extensions::XWalkExtensionVector* extensions);\n virtual void CreateInternalExtensionsForExtensionThread(\n content::RenderProcessHost* host,\n extensions::XWalkExtensionVector* extensions);\n\n devtools_http_handler::DevToolsHttpHandler* devtools_http_handler() {\n return devtools_http_handler_.get();\n }\n\n protected:\n void RegisterExternalExtensions();\n\n XWalkRunner* xwalk_runner_;\n\n extensions::XWalkExtensionService* extension_service_;\n\n // Should be about:blank If no URL is specified in command line arguments.\n GURL startup_url_;\n\n // The main function parameters passed to BrowserMain.\n const content::MainFunctionParams& parameters_;\n\n // True if we need to run the default message loop defined in content.\n bool run_default_message_loop_;\n\n scoped_ptr<devtools_http_handler::DevToolsHttpHandler> devtools_http_handler_;\n\n private:\n#if defined(USE_WEBUI_FILE_PICKER)\n scoped_ptr<wm::WMState> wm_state_;\n#endif\n DISALLOW_COPY_AND_ASSIGN(XWalkBrowserMainParts);\n};\n\n} // namespace xwalk\n\n#endif // XWALK_RUNTIME_BROWSER_XWALK_BROWSER_MAIN_PARTS_H_\n", "meta": {"content_hash": "f97edd8d5bfbdee732e637eed29f6441", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 80, "avg_line_length": 26.95, "alnum_prop": 0.7704081632653061, "repo_name": "minggangw/crosswalk", "id": "9a501cf103cd7acce1ef11eec9aa82ea09c13a64", "size": "2888", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "runtime/browser/xwalk_browser_main_parts.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "C", "bytes": "36257"}, {"name": "C#", "bytes": "10797"}, {"name": "C++", "bytes": "1576784"}, {"name": "CSS", "bytes": "1709"}, {"name": "HTML", "bytes": "118070"}, {"name": "Java", "bytes": "1292551"}, {"name": "JavaScript", "bytes": "112860"}, {"name": "Objective-C", "bytes": "2491"}, {"name": "Objective-C++", "bytes": "16628"}, {"name": "Python", "bytes": "308084"}, {"name": "Shell", "bytes": "2686"}]}} +{"text": "export class RowMapper {\n\n static map(input: Array<Array<string>>) {\n let header = input.shift();\n\n for (let i = 0; i < header.length; i++) {\n header[i] = RowMapper.convertToCamelCase(header[i]);\n }\n\n let output = [];\n\n for (let row of input) {\n let obj = {};\n\n for (let i = 0; i < row.length; i++) {\n obj[header[i]] = row[i];\n }\n\n output.push(obj);\n }\n\n return output;\n }\n\n static convertToCamelCase(content: string): string {\n // content = content.charAt(0).toLowerCase() + content.slice(1);\n // content = contennt.replace(/\\s/g, '');\n // return content.toLowerCase();\n return content.replace(/[^a-z ]/ig, \"\").replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, function (match, index) {\n if (+match === 0) return \"\"; // or if (/\\s+/.test(match)) for white spaces\n return index === 0 ? match.toLowerCase() : match.toUpperCase();\n });\n }\n}", "meta": {"content_hash": "30858a8057443ce0d00e04c03c114621", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 108, "avg_line_length": 29.735294117647058, "alnum_prop": 0.49357072205736896, "repo_name": "Savjee/google-sheets-wrapper", "id": "dfec3b657d5c3dad97ee17066f4152aed5e9d274", "size": "1011", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/RowMapper.ts", "mode": "33188", "license": "mit", "language": [{"name": "TypeScript", "bytes": "8334"}]}} +{"text": "-\t[`latest`, `LTS`, `LTS-2016`, `8`, `8.10`, `FT` (*8.10/Dockerfile*)](https://github.com/nuxeo/docker-nuxeo/blob/4c45ac6f74a5571dd23ee86a00fb85aadbece05c/8.10/Dockerfile)\n-\t[`8.3` (*8.3/Dockerfile*)](https://github.com/nuxeo/docker-nuxeo/blob/d7252d23d06e0ade25a0054a7ae940e8537a99b2/8.3/Dockerfile)\n-\t[`8.2` (*8.2/Dockerfile*)](https://github.com/nuxeo/docker-nuxeo/blob/a02183111045dadb357e68e11e93c5551c570c43/8.2/Dockerfile)\n-\t[`LTS-2015`, `7`, `7.10` (*7.10/Dockerfile*)](https://github.com/nuxeo/docker-nuxeo/blob/a02183111045dadb357e68e11e93c5551c570c43/7.10/Dockerfile)\n-\t[`LTS-2014`, `6`, `6.0` (*6.0/Dockerfile*)](https://github.com/nuxeo/docker-nuxeo/blob/8535464e476b39e10001242ad7c885519fadc2a6/6.0/Dockerfile)\n\nFor more information about this image and its history, please see [the relevant manifest file (`library/nuxeo`)](https://github.com/docker-library/official-images/blob/master/library/nuxeo). This image is updated via [pull requests to the `docker-library/official-images` GitHub repo](https://github.com/docker-library/official-images/pulls?q=label%3Alibrary%2Fnuxeo).\n\nFor detailed information about the virtual/transfer sizes and individual layers of each of the above supported tags, please see [the `repos/nuxeo/tag-details.md` file](https://github.com/docker-library/repo-info/blob/master/repos/nuxeo/tag-details.md) in [the `docker-library/repo-info` GitHub repo](https://github.com/docker-library/repo-info).\n\n# What is Nuxeo ?\n\nThe Nuxeo Platform is a highly customizable and extensible content management platform for building business applications.\n\n\n\n# How to use this image\n\n## Start a bare nuxeo instance\n\n```console\n$ docker run --name mynuxeo -p 8080:8080 -d nuxeo\n```\n\nThis image includes `EXPOSE 8080` (the nuxeo port). The default Nuxeo configuration is applied which feature an embedded database (H2), and an embedded Elasticsearch instance. This setup is not suitable for production. See below to know how to setup a production ready container by specifying environment variables.\n\nThe Nuxeo platform is accesible at http://${DOCKER_HOST}:8080/ and default User and Password are Administrator/Administrator.\n\n## Start a nuxeo with some additional packages\n\n```console\n$ docker run --name mynuxeo -p 8080:8080 -e NUXEO_PACKAGES=\"nuxeo-web-mobile nuxeo-drive nuxeo-diff nuxeo-spreadsheet nuxeo-dam nuxeo-template-rendering nuxeo-template-rendering-samples nuxeo-showcase-content\"\nnuxeo\n```\n\nThis will install the same image as above but comes with some demo Nuxeo packages to demonstrate its various usage (DAM, DM, search etc...)\n\n## Environment Variables\n\nThe Nuxeo image uses several environment variable that allow to specify a more specific setup.\n\n### `NUXEO_DB_TYPE`\n\nThis defines the database type to use. By default it sets an H2 embedded database that is suitable for test purpose only. When specifying a DB type, other variable mays help :\n\n-\t`NUXEO_DB_HOST` : If `NUXEO_DB_TYPE` is defined, this variable is mandatory and has to point to the DB server host.\n-\t`NUXEO_DB_NAME` : name of the database to use (`nuxeo` by default)\n-\t`NUXEO_DB_USER` : user to connect to the database (`nuxeo` by default)\n-\t`NUXEO_DB_PASSWORD` : the password to connect to the database (`nuxeo` by default)\n\n### `NUXEO_TEMPLATES`\n\nThis variables allows to add additional [Nuxeo configuration templates](https://doc.nuxeo.com/x/0AB9) in the `nuxeo.templates` configuration variable.\n\n### `NUXEO_ES_HOSTS`\n\nThis variables allows to setup an external Elasticsearch cluster. Use a comma separated list of Elasticsearch hosts with the 9300 port. Additional environment vars may be setup like :\n\n-\t`NUXEO_ES_CLUSTER_NAME` : name of the Elasticsearch cluster to join\n-\t`NUXEO_ES_INDEX_NAME`: name of the index (`nuxeo` by default)\n-\t`NUXEO_ES_REPLICAS` : number or replicas (`1` by default). If not 0, it means that your ES cluster must have enough node to fullfill the replicas setup.\n-\t`NUXEO_ES_SHARDS` : number or shards (`5` by default).\n\nFor instance :\n\n\tNUXEO_ES_HOSTS=es1:9300,es2:9300\n\tNUXEO_ES_CLUSTER_NAME=dockerCluster\n\tNUXEO_ES_INDEX_NAME=nuxeo1\n\tNUXEO_ES_REPLICAS=0\n\tNUXEO_ES_SHARDS=5\n\n### `NUXEO_REDIS_HOST`\n\nIn order to use Redis, just set up this variable to the Redis host address.\n\n### `NUXEO_REDIS_PORT`\n\nIf Redis is setup, you can ovewrite the default port configuration (default to 6379)\n\n### `NUXEO_CLID`\n\nAllow to setup a CLID for Nuxeo Connect registration.\n\n### `NUXEO_INSTALL_HOTFIX`\n\nThis launch the install of latest Hotfixes. (`true` by default, but needs a `NUXEO_CLID` to be setup)\n\n### `NUXEO_PACKAGES`\n\nAllows to install [Nuxeo packages](https://doc.nuxeo.com/x/aAfF) at startup.\n\n### `NUXEO_URL`\n\nThis variable sets the URL where your Nuxeo instance will be joinable. It's used for instance to refer to it when sending server's address in mails.\n\n### `NUXEO_DATA`\n\nLocation of the Nuxeo data directory. (`/var/lib/nuxeo/data` by default). You will likely customize NUXEO_DATA to map it on docker volume so data like binaries stay persistent.\n\n### `NUXEO_LOG`\n\nLocation of the Nuxeo log directory. (`/var/log/nuxeo` by default)\n\n### `NUXEO_AUTOMATION_TRACE`\n\nIf set to \"true\", this will enable the [automation trace mode](https://doc.nuxeo.com/display/NXDOC/Automation+Tracing).\n\n### `NUXEO_DEV_MODE`\n\nIf set to \"true\", this will enable the development mode that will allow [hot reload](https://doc.nuxeo.com/display/CORG/Supporting+Hot+Reload) when developing with [Nuxeo Studio](http://www.nuxeo.com/products/studio/).\n\n### `NUXEO_BINARY_STORE`\n\nTells the location of the binary store which configure the [binary storage](https://doc.nuxeo.com/x/fYYZAQ)\n\n### `NUXEO_TRANSIENT_STORE`\n\nTells the location of [the transient storage](http://doc.nuxeo.com/display/NXDOC/Transient+Store)\n\n### `NUXEO_DDL_MODE`\n\nAllows to setup [Database creation option](https://doc.nuxeo.com/x/hwQz#RepositoryConfiguration-DatabaseCreationOption) by fixing the `ddlMode` value.\n\n### `NUXEO_CUSTOM_PARAM`\n\nAllows to add custom parameters to `nuxeo.conf`. Multiple parameters can be splitted by a `\\n`. For instance :\n\n\tNUXEO_CUSTOM_PARAM=\"repository.clustering.enabled=false\\nrepository.clustering.delay=1000\"\n\n# How to extend this image\n\n## Adding additional configuration\n\nIf you would like to do additional setup in an image derived from this one, you can add a `/nuxeo.conf` file that will be appended to the end of the regular `nuxeo.conf` file.\n\n```dockerfile\nFROM nuxeo:7.10\nADD nuxeo.conf /nuxeo.conf\n```\n\n## Launching custom shell scripts\n\nYou can add your own shell scripts in a special `/docker-entrypoint-initnuxeo.d` directory. When ending in `.sh`, they will be run on default entrypoint startup.\n\n## ffmpeg\n\nAs it contains some non-free Codecs, we dont't ship a binary version of `ffmpeg` as part of this image. However, you can simply add the compilation in a derived images by adding these lines to your Dockerfile\n\n```dockerfile\nFROM nuxeo:7.10\n\nRUN echo \"deb http://httpredir.debian.org/debian jessie non-free\" >> /etc/apt/sources.list\nRUN apt-get update && apt-get install -y --no-install-recommends libfaac-dev git\n\nWORKDIR /tmp\n# Build ffmpeg\nENV BUILD_YASM true\nENV LIBFAAC true\nRUN git clone https://github.com/nuxeo/ffmpeg-nuxeo.git\nWORKDIR ffmpeg-nuxeo\nRUN ./prepare-packages.sh \\\n && ./build-yasm.sh \\\n && ./build-x264.sh \\\n && ./build-libvpx.sh \\\n && ./build-ffmpeg.sh \\\n && cd /tmp \\\n && rm -Rf ffmpeg-nuxeo \\\n && rm -rf /var/lib/apt/lists/*\n```\n\n## Using Oracle JVM\n\nFor the same reasons as `ffmpeg` we don't ship the Oracle JVM and rely by default on OpenJDK. If you want to use the Hotspot JVM you cans add the following lines in a derived Dockerfile\n\n```dockerfile\nRUN apt-get remove -y --purge openjdk-8-jdk \\\n && add-apt-repository -y ppa:webupd8team/java && apt-get update \\\n && echo \"debconf shared/accepted-oracle-license-v1-1 select true\" | debconf-set-selections \\\n && echo \"debconf shared/accepted-oracle-license-v1-1 seen true\" | debconf-set-selections \\\n && apt-get install -y oracle-java8-installer \\\n && rm -rf /var/lib/apt/lists/*\n```\n\n## Why is this images so big ?\n\nThis image is big because it contains a lot of features. The nuxeo distribution itself is about 250M and in order to make cool things work like generating thumbnails or converting document to PDF we need some additional tools that are bundled in the image. We hope that in the future we will be able to delegate those conversions to external services that would be bundled as additional docker images.\n\n# License\n\nView [license information](http://doc.nuxeo.com/x/gIK7) for the software contained in this image.\n\n# Supported Docker versions\n\nThis image is officially supported on Docker version 1.12.5.\n\nSupport for older versions (down to 1.6) is provided on a best-effort basis.\n\nPlease see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.\n\n# User Feedback\n\n## Issues\n\nIf you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/nuxeo/docker-nuxeo/issues). If the issue is related to a CVE, please check for [a `cve-tracker` issue on the `official-images` repository first](https://github.com/docker-library/official-images/issues?q=label%3Acve-tracker).\n\nYou can also reach many of the official image maintainers via the `#docker-library` IRC channel on [Freenode](https://freenode.net).\n\n## Contributing\n\nYou are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.\n\nBefore you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/nuxeo/docker-nuxeo/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.\n\n## Documentation\n\nDocumentation for this image is stored in the [`nuxeo/` directory](https://github.com/docker-library/docs/tree/master/nuxeo) of the [`docker-library/docs` GitHub repo](https://github.com/docker-library/docs). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/docker-library/docs/blob/master/README.md) before attempting a pull request.\n", "meta": {"content_hash": "65ae485aa966e1ca47867e4b3859367d", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 401, "avg_line_length": 48.43518518518518, "alnum_prop": 0.7599885299177978, "repo_name": "pydio/docs", "id": "608e7a9a11da9e3c237f71c885d5e3121d7ca2e8", "size": "10514", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nuxeo/README.md", "mode": "33188", "license": "mit", "language": [{"name": "Perl", "bytes": "4533"}, {"name": "Shell", "bytes": "8741"}]}} +{"text": "\ufeffusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"UnitTests\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"UnitTests\")]\n[assembly: AssemblyCopyright(\"Copyright \u00a9 2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components. If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"9e1ff7a8-0171-46c0-8be4-0537255b488d\")]\n\n// Version information for an assembly consists of the following four values:\n//\n// Major Version\n// Minor Version \n// Build Number\n// Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n", "meta": {"content_hash": "9e481f543e7bc95fd3f92d08b4701f77", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 38.638888888888886, "alnum_prop": 0.7440690150970525, "repo_name": "ernado-x/X.DynamicData", "id": "bb2624844f751a9465378a6fd557dea503fe4187", "size": "1394", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "UnitTests/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "52784"}, {"name": "C#", "bytes": "128933"}, {"name": "CSS", "bytes": "172121"}, {"name": "HTML", "bytes": "3753"}, {"name": "JavaScript", "bytes": "102576"}]}} +{"text": "package com.salesmanager.core.business.search.model;\n\npublic class SearchFacet {\n\t\n\tprivate String name;\n\tprivate String key;\n\tprivate long count;\n\tpublic void setKey(String key) {\n\t\tthis.key = key;\n\t}\n\tpublic String getKey() {\n\t\treturn key;\n\t}\n\tpublic void setName(String name) {\n\t\tthis.name = name;\n\t}\n\tpublic String getName() {\n\t\treturn name;\n\t}\n\tpublic void setCount(long count) {\n\t\tthis.count = count;\n\t}\n\tpublic long getCount() {\n\t\treturn count;\n\t};\n\n}\n", "meta": {"content_hash": "1444729c321b368c0c1e46b979e39df7", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 52, "avg_line_length": 17.0, "alnum_prop": 0.6884531590413944, "repo_name": "asheshsaraf/ecommerce-simple", "id": "a743b07b39da4ac6301750365c88826f62958f73", "size": "459", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sm-core/src/main/java/com/salesmanager/core/business/search/model/SearchFacet.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "535906"}, {"name": "Java", "bytes": "2745790"}, {"name": "JavaScript", "bytes": "364940"}]}} +{"text": "SYNONYM\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "meta": {"content_hash": "af23e6bb522baecf170eaf4d7bf1cf32", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "b0dfd22111e36e66da958418ebfb4d1e8ed619ad", "size": "182", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Crepis/Crepis vesicaria/ Syn. Lagoseris taurica/README.md", "mode": "33188", "license": "apache-2.0", "language": []}} +{"text": "// Copyright 2014 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n// option. This file may not be copied, modified, or distributed\n// except according to those terms.\n\n//! Trait Resolution. See doc.rs.\n\npub use self::SelectionError::*;\npub use self::FulfillmentErrorCode::*;\npub use self::Vtable::*;\npub use self::ObligationCauseCode::*;\n\nuse middle::mem_categorization::Typer;\nuse middle::subst;\nuse middle::ty::{mod, Ty};\nuse middle::infer::InferCtxt;\nuse std::rc::Rc;\nuse std::slice::Items;\nuse syntax::ast;\nuse syntax::codemap::{Span, DUMMY_SP};\nuse util::common::ErrorReported;\n\npub use self::fulfill::FulfillmentContext;\npub use self::select::SelectionContext;\npub use self::select::SelectionCache;\npub use self::select::{MethodMatchResult, MethodMatched, MethodAmbiguous, MethodDidNotMatch};\npub use self::select::{MethodMatchedData}; // intentionally don't export variants\npub use self::util::supertraits;\npub use self::util::transitive_bounds;\npub use self::util::Supertraits;\npub use self::util::search_trait_and_supertraits_from_bound;\n\nmod coherence;\nmod fulfill;\nmod select;\nmod util;\n\n/// An `Obligation` represents some trait reference (e.g. `int:Eq`) for\n/// which the vtable must be found. The process of finding a vtable is\n/// called \"resolving\" the `Obligation`. This process consists of\n/// either identifying an `impl` (e.g., `impl Eq for int`) that\n/// provides the required vtable, or else finding a bound that is in\n/// scope. The eventual result is usually a `Selection` (defined below).\n#[deriving(Clone)]\npub struct Obligation<'tcx> {\n pub cause: ObligationCause<'tcx>,\n pub recursion_depth: uint,\n pub trait_ref: Rc<ty::TraitRef<'tcx>>,\n}\n\n/// Why did we incur this obligation? Used for error reporting.\n#[deriving(Clone)]\npub struct ObligationCause<'tcx> {\n pub span: Span,\n pub code: ObligationCauseCode<'tcx>\n}\n\nimpl<'tcx> Copy for ObligationCause<'tcx> {}\n\n#[deriving(Clone)]\npub enum ObligationCauseCode<'tcx> {\n /// Not well classified or should be obvious from span.\n MiscObligation,\n\n /// In an impl of trait X for type Y, type Y must\n /// also implement all supertraits of X.\n ItemObligation(ast::DefId),\n\n /// Obligation incurred due to an object cast.\n ObjectCastObligation(/* Object type */ Ty<'tcx>),\n\n /// To implement drop, type must be sendable.\n DropTrait,\n\n /// Various cases where expressions must be sized/copy/etc:\n AssignmentLhsSized, // L = X implies that L is Sized\n StructInitializerSized, // S { ... } must be Sized\n VariableType(ast::NodeId), // Type of each variable must be Sized\n ReturnType, // Return type must be Sized\n RepeatVec, // [T,..n] --> T must be Copy\n\n // Captures of variable the given id by a closure (span is the\n // span of the closure)\n ClosureCapture(ast::NodeId, Span),\n\n // Types of fields (other than the last) in a struct must be sized.\n FieldSized,\n\n // Only Sized types can be made into objects\n ObjectSized,\n}\n\npub type Obligations<'tcx> = subst::VecPerParamSpace<Obligation<'tcx>>;\n\nimpl<'tcx> Copy for ObligationCauseCode<'tcx> {}\n\npub type Selection<'tcx> = Vtable<'tcx, Obligation<'tcx>>;\n\n#[deriving(Clone,Show)]\npub enum SelectionError<'tcx> {\n Unimplemented,\n Overflow,\n OutputTypeParameterMismatch(Rc<ty::TraitRef<'tcx>>, ty::type_err<'tcx>)\n}\n\npub struct FulfillmentError<'tcx> {\n pub obligation: Obligation<'tcx>,\n pub code: FulfillmentErrorCode<'tcx>\n}\n\n#[deriving(Clone)]\npub enum FulfillmentErrorCode<'tcx> {\n CodeSelectionError(SelectionError<'tcx>),\n CodeAmbiguity,\n}\n\n/// When performing resolution, it is typically the case that there\n/// can be one of three outcomes:\n///\n/// - `Ok(Some(r))`: success occurred with result `r`\n/// - `Ok(None)`: could not definitely determine anything, usually due\n/// to inconclusive type inference.\n/// - `Err(e)`: error `e` occurred\npub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;\n\n/// Given the successful resolution of an obligation, the `Vtable`\n/// indicates where the vtable comes from. Note that while we call this\n/// a \"vtable\", it does not necessarily indicate dynamic dispatch at\n/// runtime. `Vtable` instances just tell the compiler where to find\n/// methods, but in generic code those methods are typically statically\n/// dispatched -- only when an object is constructed is a `Vtable`\n/// instance reified into an actual vtable.\n///\n/// For example, the vtable may be tied to a specific impl (case A),\n/// or it may be relative to some bound that is in scope (case B).\n///\n///\n/// ```\n/// impl<T:Clone> Clone<T> for Option<T> { ... } // Impl_1\n/// impl<T:Clone> Clone<T> for Box<T> { ... } // Impl_2\n/// impl Clone for int { ... } // Impl_3\n///\n/// fn foo<T:Clone>(concrete: Option<Box<int>>,\n/// param: T,\n/// mixed: Option<T>) {\n///\n/// // Case A: Vtable points at a specific impl. Only possible when\n/// // type is concretely known. If the impl itself has bounded\n/// // type parameters, Vtable will carry resolutions for those as well:\n/// concrete.clone(); // Vtable(Impl_1, [Vtable(Impl_2, [Vtable(Impl_3)])])\n///\n/// // Case B: Vtable must be provided by caller. This applies when\n/// // type is a type parameter.\n/// param.clone(); // VtableParam(Oblig_1)\n///\n/// // Case C: A mix of cases A and B.\n/// mixed.clone(); // Vtable(Impl_1, [VtableParam(Oblig_1)])\n/// }\n/// ```\n///\n/// ### The type parameter `N`\n///\n/// See explanation on `VtableImplData`.\n#[deriving(Show,Clone)]\npub enum Vtable<'tcx, N> {\n /// Vtable identifying a particular impl.\n VtableImpl(VtableImplData<'tcx, N>),\n\n /// Successful resolution to an obligation provided by the caller\n /// for some type parameter.\n VtableParam(VtableParamData<'tcx>),\n\n /// Successful resolution for a builtin trait.\n VtableBuiltin(VtableBuiltinData<N>),\n\n /// Vtable automatically generated for an unboxed closure. The def\n /// ID is the ID of the closure expression. This is a `VtableImpl`\n /// in spirit, but the impl is generated by the compiler and does\n /// not appear in the source.\n VtableUnboxedClosure(ast::DefId, subst::Substs<'tcx>),\n\n /// Same as above, but for a fn pointer type with the given signature.\n VtableFnPointer(ty::Ty<'tcx>),\n}\n\n/// Identifies a particular impl in the source, along with a set of\n/// substitutions from the impl's type/lifetime parameters. The\n/// `nested` vector corresponds to the nested obligations attached to\n/// the impl's type parameters.\n///\n/// The type parameter `N` indicates the type used for \"nested\n/// obligations\" that are required by the impl. During type check, this\n/// is `Obligation`, as one might expect. During trans, however, this\n/// is `()`, because trans only requires a shallow resolution of an\n/// impl, and nested obligations are satisfied later.\n#[deriving(Clone)]\npub struct VtableImplData<'tcx, N> {\n pub impl_def_id: ast::DefId,\n pub substs: subst::Substs<'tcx>,\n pub nested: subst::VecPerParamSpace<N>\n}\n\n#[deriving(Show,Clone)]\npub struct VtableBuiltinData<N> {\n pub nested: subst::VecPerParamSpace<N>\n}\n\n/// A vtable provided as a parameter by the caller. For example, in a\n/// function like `fn foo<T:Eq>(...)`, if the `eq()` method is invoked\n/// on an instance of `T`, the vtable would be of type `VtableParam`.\n#[deriving(PartialEq,Eq,Clone)]\npub struct VtableParamData<'tcx> {\n // In the above example, this would `Eq`\n pub bound: Rc<ty::TraitRef<'tcx>>,\n}\n\n/// Matches the self type of the inherent impl `impl_def_id`\n/// against `self_ty` and returns the resulting resolution. This\n/// routine may modify the surrounding type context (for example,\n/// it may unify variables).\npub fn select_inherent_impl<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,\n param_env: &ty::ParameterEnvironment<'tcx>,\n typer: &Typer<'tcx>,\n cause: ObligationCause<'tcx>,\n impl_def_id: ast::DefId,\n self_ty: Ty<'tcx>)\n -> SelectionResult<'tcx,\n VtableImplData<'tcx, Obligation<'tcx>>>\n{\n // This routine is only suitable for inherent impls. This is\n // because it does not attempt to unify the output type parameters\n // from the trait ref against the values from the obligation.\n // (These things do not apply to inherent impls, for which there\n // is no trait ref nor obligation.)\n //\n // Matching against non-inherent impls should be done with\n // `try_resolve_obligation()`.\n assert!(ty::impl_trait_ref(infcx.tcx, impl_def_id).is_none());\n\n let mut selcx = select::SelectionContext::new(infcx, param_env, typer);\n selcx.select_inherent_impl(impl_def_id, cause, self_ty)\n}\n\n/// True if neither the trait nor self type is local. Note that `impl_def_id` must refer to an impl\n/// of a trait, not an inherent impl.\npub fn is_orphan_impl(tcx: &ty::ctxt,\n impl_def_id: ast::DefId)\n -> bool\n{\n !coherence::impl_is_local(tcx, impl_def_id)\n}\n\n/// True if there exist types that satisfy both of the two given impls.\npub fn overlapping_impls(infcx: &InferCtxt,\n impl1_def_id: ast::DefId,\n impl2_def_id: ast::DefId)\n -> bool\n{\n coherence::impl_can_satisfy(infcx, impl1_def_id, impl2_def_id) &&\n coherence::impl_can_satisfy(infcx, impl2_def_id, impl1_def_id)\n}\n\n/// Given generic bounds from an impl like:\n///\n/// impl<A:Foo, B:Bar+Qux> ...\n///\n/// along with the bindings for the types `A` and `B` (e.g., `<A=A0, B=B0>`), yields a result like\n///\n/// [[Foo for A0, Bar for B0, Qux for B0], [], []]\n///\n/// Expects that `generic_bounds` have already been fully substituted, late-bound regions liberated\n/// and so forth, so that they are in the same namespace as `type_substs`.\npub fn obligations_for_generics<'tcx>(tcx: &ty::ctxt<'tcx>,\n cause: ObligationCause<'tcx>,\n generic_bounds: &ty::GenericBounds<'tcx>,\n type_substs: &subst::VecPerParamSpace<Ty<'tcx>>)\n -> subst::VecPerParamSpace<Obligation<'tcx>>\n{\n util::obligations_for_generics(tcx, cause, 0, generic_bounds, type_substs)\n}\n\npub fn obligation_for_builtin_bound<'tcx>(tcx: &ty::ctxt<'tcx>,\n cause: ObligationCause<'tcx>,\n source_ty: Ty<'tcx>,\n builtin_bound: ty::BuiltinBound)\n -> Result<Obligation<'tcx>, ErrorReported>\n{\n util::obligation_for_builtin_bound(tcx, cause, builtin_bound, 0, source_ty)\n}\n\nimpl<'tcx> Obligation<'tcx> {\n pub fn new(cause: ObligationCause<'tcx>, trait_ref: Rc<ty::TraitRef<'tcx>>)\n -> Obligation<'tcx> {\n Obligation { cause: cause,\n recursion_depth: 0,\n trait_ref: trait_ref }\n }\n\n pub fn misc(span: Span, trait_ref: Rc<ty::TraitRef<'tcx>>) -> Obligation<'tcx> {\n Obligation::new(ObligationCause::misc(span), trait_ref)\n }\n\n pub fn self_ty(&self) -> Ty<'tcx> {\n self.trait_ref.self_ty()\n }\n}\n\nimpl<'tcx> ObligationCause<'tcx> {\n pub fn new(span: Span, code: ObligationCauseCode<'tcx>)\n -> ObligationCause<'tcx> {\n ObligationCause { span: span, code: code }\n }\n\n pub fn misc(span: Span) -> ObligationCause<'tcx> {\n ObligationCause { span: span, code: MiscObligation }\n }\n\n pub fn dummy() -> ObligationCause<'tcx> {\n ObligationCause { span: DUMMY_SP, code: MiscObligation }\n }\n}\n\nimpl<'tcx, N> Vtable<'tcx, N> {\n pub fn iter_nested(&self) -> Items<N> {\n match *self {\n VtableImpl(ref i) => i.iter_nested(),\n VtableFnPointer(..) => (&[]).iter(),\n VtableUnboxedClosure(..) => (&[]).iter(),\n VtableParam(_) => (&[]).iter(),\n VtableBuiltin(ref i) => i.iter_nested(),\n }\n }\n\n pub fn map_nested<M>(&self, op: |&N| -> M) -> Vtable<'tcx, M> {\n match *self {\n VtableImpl(ref i) => VtableImpl(i.map_nested(op)),\n VtableFnPointer(ref sig) => VtableFnPointer((*sig).clone()),\n VtableUnboxedClosure(d, ref s) => VtableUnboxedClosure(d, s.clone()),\n VtableParam(ref p) => VtableParam((*p).clone()),\n VtableBuiltin(ref b) => VtableBuiltin(b.map_nested(op)),\n }\n }\n\n pub fn map_move_nested<M>(self, op: |N| -> M) -> Vtable<'tcx, M> {\n match self {\n VtableImpl(i) => VtableImpl(i.map_move_nested(op)),\n VtableFnPointer(sig) => VtableFnPointer(sig),\n VtableUnboxedClosure(d, s) => VtableUnboxedClosure(d, s),\n VtableParam(p) => VtableParam(p),\n VtableBuiltin(no) => VtableBuiltin(no.map_move_nested(op)),\n }\n }\n}\n\nimpl<'tcx, N> VtableImplData<'tcx, N> {\n pub fn iter_nested(&self) -> Items<N> {\n self.nested.iter()\n }\n\n pub fn map_nested<M>(&self,\n op: |&N| -> M)\n -> VtableImplData<'tcx, M>\n {\n VtableImplData {\n impl_def_id: self.impl_def_id,\n substs: self.substs.clone(),\n nested: self.nested.map(op)\n }\n }\n\n pub fn map_move_nested<M>(self, op: |N| -> M)\n -> VtableImplData<'tcx, M> {\n let VtableImplData { impl_def_id, substs, nested } = self;\n VtableImplData {\n impl_def_id: impl_def_id,\n substs: substs,\n nested: nested.map_move(op)\n }\n }\n}\n\nimpl<N> VtableBuiltinData<N> {\n pub fn iter_nested(&self) -> Items<N> {\n self.nested.iter()\n }\n\n pub fn map_nested<M>(&self,\n op: |&N| -> M)\n -> VtableBuiltinData<M>\n {\n VtableBuiltinData {\n nested: self.nested.map(op)\n }\n }\n\n pub fn map_move_nested<M>(self, op: |N| -> M) -> VtableBuiltinData<M> {\n VtableBuiltinData {\n nested: self.nested.map_move(op)\n }\n }\n}\n\nimpl<'tcx> FulfillmentError<'tcx> {\n fn new(obligation: Obligation<'tcx>, code: FulfillmentErrorCode<'tcx>)\n -> FulfillmentError<'tcx>\n {\n FulfillmentError { obligation: obligation, code: code }\n }\n\n pub fn is_overflow(&self) -> bool {\n match self.code {\n CodeAmbiguity => false,\n CodeSelectionError(Overflow) => true,\n CodeSelectionError(_) => false,\n }\n }\n}\n", "meta": {"content_hash": "7902609885ce81d551403c8b9729fba8", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 99, "avg_line_length": 35.86492890995261, "alnum_prop": 0.6104393789230261, "repo_name": "emk/rust", "id": "d410a456dc913d01e8df8853c13a12daae78e7cd", "size": "15135", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/librustc/middle/traits/mod.rs", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ANTLR", "bytes": "3093"}, {"name": "Assembly", "bytes": "25901"}, {"name": "Awk", "bytes": "159"}, {"name": "C", "bytes": "676528"}, {"name": "C++", "bytes": "62321"}, {"name": "CSS", "bytes": "21483"}, {"name": "Emacs Lisp", "bytes": "43099"}, {"name": "JavaScript", "bytes": "32526"}, {"name": "Makefile", "bytes": "201910"}, {"name": "Pascal", "bytes": "1654"}, {"name": "Perl", "bytes": "1076"}, {"name": "Puppet", "bytes": "9596"}, {"name": "Python", "bytes": "105676"}, {"name": "Rust", "bytes": "17189000"}, {"name": "Shell", "bytes": "294889"}, {"name": "VimL", "bytes": "36290"}]}} +{"text": "<?php\n\n/**\n * This class provides a list of HTTP status codes and their values\n *\n * @package Nails\n * @subpackage common\n * @category Library\n * @author Nails Dev Team\n */\n\nnamespace Nails\\Common\\Service;\n\nclass HttpCodes\n{\n\n // 1xx Informational\n const STATUS_100 = 'Continue';\n const STATUS_CONTINUE = 100;\n const STATUS_101 = 'Switching Protocols';\n const STATUS_SWITCHING_PROTOCOLS = 101;\n\n // 2xx Success\n const STATUS_200 = 'OK';\n const STATUS_OK = 200;\n const STATUS_201 = 'Created';\n const STATUS_CREATED = 201;\n const STATUS_202 = 'Accepted';\n const STATUS_ACCEPTED = 202;\n const STATUS_203 = 'Non-Authoritative Information';\n const STATUS_NON_AUTHORITATIVE_INFORMATION = 203;\n const STATUS_204 = 'No Content';\n const STATUS_NO_CONTENT = 204;\n const STATUS_205 = 'Reset Content';\n const STATUS_RESET_CONTENT = 205;\n const STATUS_206 = 'Partial Content';\n const STATUS_PARTIAL_CONTENT = 206;\n const STATUS_207 = 'Multi-status';\n const STATUS_MULTI_STATUS = 207;\n const STATUS_208 = 'Already imported';\n const STATUS_ALREADY_IMPORTED = 208;\n const STATUS_226 = 'IM used';\n const STATUS_IM_USED = 226;\n\n // 3xx Redirection\n const STATUS_300 = 'Multiple Choices';\n const STATUS_MULTIPLE_CHOICES = 300;\n const STATUS_301 = 'Moved Permanently';\n const STATUS_MOVED_PERMANENTLY = 301;\n const STATUS_302 = 'Found';\n const STATUS_FOUND = 302;\n const STATUS_303 = 'See Other';\n const STATUS_SEE_OTHER = 303;\n const STATUS_304 = 'Not Modified';\n const STATUS_NOT_MODIFIED = 304;\n const STATUS_305 = 'Use Proxy';\n const STATUS_USE_PROXY = 305;\n const STATUS_306 = 'Switch Proxy';\n const STATUS_SWITCH_PROXY = 306;\n const STATUS_307 = 'Temporary redirect';\n const STATUS_TEMPORARY_REDIRECT = 307;\n const STATUS_308 = 'Permanent redirect';\n const STATUS_PERMANENT_REDIRECT = 308;\n\n // 4xxx Client Error\n const STATUS_400 = 'Bad Request';\n const STATUS_BAD_REQUEST = 400;\n const STATUS_401 = 'Unauthorized';\n const STATUS_UNAUTHORIZED = 401;\n const STATUS_402 = 'Payment Required';\n const STATUS_PAYMENT_REQUIRED = 402;\n const STATUS_403 = 'Forbidden';\n const STATUS_FORBIDDEN = 403;\n const STATUS_404 = 'Not Found';\n const STATUS_NOT_FOUND = 404;\n const STATUS_405 = 'Method Not Allowed';\n const STATUS_METHOD_NOT_ALLOWED = 405;\n const STATUS_406 = 'Not Acceptable';\n const STATUS_NOT_ACCEPTABLE = 406;\n const STATUS_407 = 'Proxy Authentication Required';\n const STATUS_PROXY_AUTHENTICATION_REQUIRED = 407;\n const STATUS_408 = 'Request Timeout';\n const STATUS_REQUEST_TIMEOUT = 408;\n const STATUS_409 = 'Conflict';\n const STATUS_CONFLICT = 409;\n const STATUS_410 = 'Gone';\n const STATUS_GONE = 410;\n const STATUS_411 = 'Length Required';\n const STATUS_LENGTH_REQUIRED = 411;\n const STATUS_412 = 'Precondition Failed';\n const STATUS_PRECONDITION_FAILED = 412;\n const STATUS_413 = 'Request Entity Too Large';\n const STATUS_REQUEST_ENTITY_TOO_LARGE = 413;\n const STATUS_414 = 'Request-URI Too Long';\n const STATUS_REQUES_URI_TOO_LONG = 414;\n const STATUS_415 = 'Unsupported Media Type';\n const STATUS_UNSUPPORTED_MEDIA_TYPE = 415;\n const STATUS_416 = 'Requested Range Not Satisfiable';\n const STATUS_REQUESTED_RANGE_NOT_SATISFIABLE = 416;\n const STATUS_417 = 'Expectation Failed';\n const STATUS_EXPECTATION_FAILED = 417;\n const STATUS_421 = 'Misdirected request';\n const STATUS_MISDIRECTED_REQUEST = 421;\n const STATUS_422 = 'Unprocessable entity';\n const STATUS_UNPROCESSABLE_ENTITY = 422;\n const STATUS_423 = 'Locked';\n const STATUS_LOCKED = 423;\n const STATUS_424 = 'Failed dependency';\n const STATUS_FAILED_DEPENDENCY = 424;\n const STATUS_426 = 'Upgrade required';\n const STATUS_UPGRADE_REQUIRED = 426;\n const STATUS_428 = 'Precondition required';\n const STATUS_PRECONDITION_REQUIRED = 428;\n const STATUS_429 = 'Too many requests';\n const STATUS_TOO_MANY_REQUESTS = 429;\n const STATUS_431 = 'Request header fields too large';\n const STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE = 431;\n\n // 5xx Server Error\n const STATUS_500 = 'Internal Server Error';\n const STATUS_INTERNAL_SERVER_ERROR = 500;\n const STATUS_501 = 'Not Implemented';\n const STATUS_NOT_IMPLEMENTED = 501;\n const STATUS_502 = 'Bad Gateway';\n const STATUS_BAD_GATEWAY = 502;\n const STATUS_503 = 'Service Unavailable';\n const STATUS_SERVICE_UNAVAILABLE = 503;\n const STATUS_504 = 'Gateway Timeout';\n const STATUS_GATEWAY_TIMEOUT = 504;\n const STATUS_505 = 'HTTP Version Not Supported';\n const STATUS_HTTP_VERSION_NOT_SUPPORTED = 505;\n const STATUS_506 = 'Variant also negotiates';\n const STATUS_VARIANT_ALSO_NEGOTIATES = 506;\n const STATUS_507 = 'Insufficient storage';\n const STATUS_INSUFFICIENT_STORAGE = 507;\n const STATUS_508 = 'Loop detected';\n const STATUS_LOOP_DETECTED = 508;\n const STATUS_510 = 'Not extended';\n const STATUS_NOT_EXTENDED = 510;\n const STATUS_511 = 'Network authentication required';\n const STATUS_NETWORK_AUTHENTICATION_REQUIRED = 511;\n\n // --------------------------------------------------------------------------\n\n /**\n * Returns the human readable portion of an HTTP status code\n *\n * @param $iCode integer The numerical HTTP status code\n *\n * @return null\n */\n public static function getByCode($iCode)\n {\n $sConstant = 'static::STATUS_' . $iCode;\n if (defined($sConstant)) {\n return constant($sConstant);\n }\n\n return null;\n }\n}\n", "meta": {"content_hash": "b597f7feca2a35e39b0c3484c9b21c5b", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 85, "avg_line_length": 48.84472049689441, "alnum_prop": 0.4763479145473042, "repo_name": "nailsapp/common", "id": "d5aecb7ece62a97dd3ca4128815a2c61d7f3f296", "size": "7864", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/Common/Service/HttpCodes.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "8531"}, {"name": "HTML", "bytes": "5964"}, {"name": "Hack", "bytes": "57"}, {"name": "JavaScript", "bytes": "1182"}, {"name": "PHP", "bytes": "1032959"}]}} +{"text": "typedef void(^SFAlertViewCompletion)(NSInteger buttonIndex, NSString *buttonTitle);\n\n@interface UIAlertView (SFAddition_quickAlert)\n\n+ (void)sf_dismissPresentingDialogAnimated:(BOOL)animated __attribute__((deprecated));\n\n+ (UIAlertView *)sf_alertWithTitle:(NSString *)title message:(NSString *)message completion:(SFAlertViewCompletion)completion cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... __attribute__((deprecated));\n\n+ (UIAlertView *)sf_alertWithTitle:(NSString *)title message:(NSString *)message completion:(SFAlertViewCompletion)completion cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitleList:(NSArray *)otherButtonTitleList __attribute__((deprecated));\n\n+ (UIAlertView *)sf_alertWithTitle:(NSString *)title message:(NSString *)message completion:(void(^)(void))completion __attribute__((deprecated));\n\n+ (UIAlertView *)sf_alertWithMessage:(NSString *)message completion:(void (^)(void))completion __attribute__((deprecated));\n\n@end\n\n@interface UIAlertView (SFAddition_confirmDialog)\n\n+ (void)sf_confirmWithTitle:(NSString *)title message:(NSString *)message approve:(void(^)(void))approve __attribute__((deprecated));\n+ (void)sf_confirmWithTitle:(NSString *)title message:(NSString *)message approve:(void(^)(void))approve cancel:(void(^)(void))cancel __attribute__((deprecated));\n\n@end\n\n@interface UIAlertView (SFAddition_inputDialog)\n\n+ (UITextField *)sf_inputWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle approveButtonTitle:(NSString *)approveButtonTitle completion:(void(^)(NSString *input, BOOL cancelled))completion __attribute__((deprecated));\n\n+ (UITextField *)sf_inputWithTitle:(NSString *)title message:(NSString *)message secureTextEntry:(BOOL)secureTextEntry cancelButtonTitle:(NSString *)cancelButtonTitle approveButtonTitle:(NSString *)approveButtonTitle completion:(void(^)(NSString *input, BOOL cancelled))completion __attribute__((deprecated));\n\n@end\n\n@interface UIAlertView (SFAddition)\n\n- (UILabel *)sf_messageLabel __attribute__((deprecated));\n- (UILabel *)sf_titleLabel __attribute__((deprecated));\n\n@end\n", "meta": {"content_hash": "309ab5bf0cf4c8b808c6eeeacb7ab59a", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 309, "avg_line_length": 58.513513513513516, "alnum_prop": 0.7778290993071594, "repo_name": "yangzexin/SFLibraries", "id": "51c35ce0ce5ff2971305298ab135dde8424dbdb4", "size": "2354", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SFiOSKit/SFiOSKit/UIAlertView+SFAddition.h", "mode": "33261", "license": "apache-2.0", "language": [{"name": "JavaScript", "bytes": "816"}, {"name": "Objective-C", "bytes": "592585"}, {"name": "Ruby", "bytes": "1810"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:shape=\"rectangle\">\n\n <solid android:color=\"#399C03\"/>\n <corners android:radius=\"25dp\"/>\n</shape>", "meta": {"content_hash": "a4b16a9a0a5370edbf93d4025b098d11", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 65, "avg_line_length": 31.285714285714285, "alnum_prop": 0.6757990867579908, "repo_name": "mohdaquib/DairyWala", "id": "535220fa48c3eadc02d300823e8a87a433f5bc9b", "size": "219", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/drawable/drawable_create_account_button.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "235783"}]}} +{"text": "\r\n//## begin module%3744298B0396.cm preserve=no\r\n//\t %X% %Q% %Z% %W%\r\n//## end module%3744298B0396.cm\r\n\r\n//## begin module%3744298B0396.cp preserve=yes\r\n//\t********************************************************************************\r\n//\r\n//\tCopyright: Nortel Networks 1999\r\n//\r\n//\tClassification: Confidential\r\n//\r\n//\tProject Name: RRM Simulator / Scheduler\r\n//\r\n//\tPackage: Statistics Calculation\r\n//\r\n//\tFile Name: ContinuousHistogram.cpp\r\n//\r\n//\tDescription: Implementation file for the ContinuousHistogram class.\r\n//\r\n//\tAuthor:\tH\u00e9lio Azevedo\r\n//\r\n//\tCreation Date: May/20/99\r\n//\r\n//\tVisual Source Safe $Revision: 8 $\r\n//\r\n//\tLast check in $Date: 16/06/99 9:28 $\r\n//\r\n//\t********************************************************************************\r\n//## end module%3744298B0396.cp\r\n\r\n//## Module: ContinuousHistogram%3744298B0396; Pseudo Package body\r\n//## Source file: T:\\StatisticsCalculation\\ContinuousHistogram.cpp\r\n\r\n//## begin module%3744298B0396.additionalIncludes preserve=no\r\n//## end module%3744298B0396.additionalIncludes\r\n\r\n//## begin module%3744298B0396.includes preserve=yes\r\n\r\n#include \"MemLeak.h\"\r\n#include <assert.h>\t // define the assert macro\r\n\r\n//## end module%3744298B0396.includes\r\n\r\n// ContinuousHistogram\r\n#include \"ContinuousHistogram.h\"\r\n//## begin module%3744298B0396.additionalDeclarations preserve=yes\r\n\r\nusing namespace std;\r\n\r\nnamespace sch {\r\n\r\n//## end module%3744298B0396.additionalDeclarations\r\n\r\n\r\n// Class ContinuousHistogram \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//## Operation: ContinuousHistogram%37442A26021C\r\n//\t********************************************************************************\r\n//\r\n//\tName: ContinuousHistogram(Float minVal,Float maxVal, Int intervals)\r\n//\r\n//\tDescription: Non-default constructor - requires the lower boundary, upper boundary and number of intervals. The pValues array is\r\n//\tallocated.\r\n//\r\n//\tInput parameters: Float minVal; //lower boundary of the input data stream\r\n//\t Float maxVal; //upper boundary of the input data stream\r\n//\t Int intervals; //number of intervals in the histogram\r\n//\r\n//\tReturns: none\r\n//\r\n//\tExceptions: SchException, with one of the following error codes:\r\n//\t SCH_ALLOCATION_ERROR = could not allocate pValues array\r\n//\t SCH_INVALID_RANGE = upper boundary is not greater than lower boundary\r\n//\r\n//\t********************************************************************************\r\nContinuousHistogram::ContinuousHistogram (Float minVal, Float maxVal, Int intervals)\r\n //## begin ContinuousHistogram::ContinuousHistogram%37442A26021C.hasinit preserve=no\r\n : maxValue(maxVal),\r\n minValue(minVal),\r\n numIntervals(intervals),\r\n pValues(NULL),\r\n maxSample(SIM_HUGE_VAL),\r\n minSample(SIM_HUGE_VAL),\r\n numSamples(0),\r\n cumSum(0.0),\r\n cumSumOfSquares(0.0)\r\n //## end ContinuousHistogram::ContinuousHistogram%37442A26021C.hasinit\r\n //## begin ContinuousHistogram::ContinuousHistogram%37442A26021C.initialization preserve=yes\r\n //## end ContinuousHistogram::ContinuousHistogram%37442A26021C.initialization\r\n{\r\n //## begin ContinuousHistogram::ContinuousHistogram%37442A26021C.body preserve=yes\r\n\r\n\tRetCode rc = SCH_SUCCESS; // used to provide a single point for raising exception\r\n\r\n\t//\r\n\t// upper boundary must be greater than lower boundary\r\n\t//\r\n\tif (minValue > maxValue)\r\n\t{\r\n\t\trc = SCH_INVALID_RANGE;\r\n\t}\r\n\r\n\r\n\tif (rc == SCH_SUCCESS)\r\n\t{\r\n\t\t//\r\n\t\t// calculate width of each interval\r\n\t\t//\r\n\t\tintervalWidth = (maxValue - minValue) / numIntervals;\r\n\r\n\t\t//\r\n\t\t// allocate pValues array\r\n\t\t//\r\n\t\tpValues = new Int[numIntervals]; // allocate array\r\n\t\tif (pValues == NULL)\r\n\t\t{\r\n\t\t\trc = SCH_ALLOCATION_ERROR; // could not create array\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tmemset (pValues, 0, numIntervals * sizeof (Int)); // set all values to 0\r\n\t\t}\r\n\t}\r\n\r\n\tif (rc != SCH_SUCCESS)\r\n\t{\r\n\t\tthrow SchException (rc); // an error occurred, abort object construction\r\n\t}\r\n\r\n\treturn;\r\n\r\n //## end ContinuousHistogram::ContinuousHistogram%37442A26021C.body\r\n}\r\n\r\n\r\n\r\n//## Other Operations (implementation)\r\n//## Operation: getResult%37442A34033F\r\n//\t********************************************************************************\r\n//\r\n//\tName: RetCode getResult(Int intervalNumber, Int *pResult)\r\n//\r\n//\tDescription: Returns the contents (frequency) of the corresponding interval number.\r\n//\r\n//\tInput parameters: Int intervalNumber; //first interval number is zero and the last is interval-1\r\n//\r\n//\tOutput parameters: Int *pResult; //contents of the corresponding interval number\r\n//\r\n//\tReturns: SCH_SUCCESS\r\n//\t SCH_INVALID_PARAMETER - pResult is NULL\r\n//\t SCH_INVALID_INTERVAL - interval number is negative or above higher interval - ignore contents of pResult\r\n//\r\n//\t********************************************************************************\r\nRetCode ContinuousHistogram::getResult (Int intervalNumber, Int *pResult)\r\n{\r\n //## begin ContinuousHistogram::getResult%37442A34033F.body preserve=yes\r\n\r\n\tRetCode rc = SCH_SUCCESS;\r\n\t\r\n\tassert (pValues);\r\n\r\n\tif (pResult == NULL)\r\n\t{\r\n\t\trc = SCH_INVALID_PARAMETER;\r\n\t}\r\n\r\n\t//\r\n\t// intervalNumber within valid range?\r\n\t// \r\n\telse if ((intervalNumber >= 0) && (intervalNumber < numIntervals))\r\n\t{\r\n\t\t*pResult = pValues[intervalNumber]; // yes, return interval frequency\r\n\t}\r\n\telse\r\n\t{\r\n\t\trc = SCH_INVALID_INTERVAL;\t\t\t \r\n\t}\r\n\r\n\treturn (rc);\r\n\r\n //## end ContinuousHistogram::getResult%37442A34033F.body\r\n}\r\n\r\n//## Operation: nextSample%37442A34035D\r\n//\t********************************************************************************\r\n//\r\n//\tName: RetCode nextSample (Float sample)\r\n//\r\n//\tDescription: Includes the next sample in the sequence and increments the contents of the interval which this sample falls into.\r\n//\r\n//\tInput parameters:Float sample; //next sample in the sequence\r\n//\r\n//\tReturns: SCH_SUCCESS\r\n//\r\n//\t********************************************************************************\r\nRetCode ContinuousHistogram::nextSample (Float sample)\r\n{\r\n //## begin ContinuousHistogram::nextSample%37442A34035D.body preserve=yes\r\n\r\n\tRetCode rc = SCH_SUCCESS;\r\n\tInt index; \t\t\t // position of pValues to be incremented\r\n\r\n\tassert (pValues);\r\n\r\n\t// update minimum and maximun samples\r\n\tif (numSamples == 0) {\r\n\t\tmaxSample = sample;\r\n\t\tminSample = sample;\r\n\t}\r\n\telse {\r\n\t\tif (sample < minSample) minSample = sample;\r\n\t\tif (sample > maxSample) maxSample = sample;\r\n\t}\r\n\r\n\tnumSamples++;\t\t\t\t// increments number of samples \r\n\tcumSum = cumSum + sample;\r\n\tcumSumOfSquares = cumSumOfSquares + sample*sample;\r\n\r\n\t\t\r\n\r\n\tif (sample < minValue)\r\n\t{\r\n\t\t//\r\n\t\t// account sample in first interval if sample is below the lower boundary \r\n\t\t//\r\n\t\tindex = 0;\r\n\t}\r\n\telse if (sample >= maxValue)\r\n\t{\r\n\t\t//\r\n\t\t// account sample in last interval if sample is above the higher boundary \r\n\t\t//\r\n\t\tindex = numIntervals - 1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t//\r\n\t\t// account sample in appropriate interval\r\n\t\t// the interval number is actually the index of pValues, which is calculated by\r\n\t\t// index = (sample - minValue) div intervalWidth\r\n\t\t// where div is an integer division\r\n\t\t//\r\n\t\tindex = (sample - minValue) / intervalWidth;\r\n\t}\r\n\r\n\t//\r\n\t// increment contents of target interval\r\n\t//\r\n\tpValues [index]++;\r\n\r\n\treturn (rc);\r\n\r\n //## end ContinuousHistogram::nextSample%37442A34035D.body\r\n}\r\n\r\n//## Operation: reset%374C031B03A1\r\n//\t********************************************************************************\r\n//\r\n//\tName:RetCode reset (void)\r\n//\r\n//\tDescription: Reset all attributes allowing the start of a new sequence of samples.\r\n//\r\n//\tParameters: none\r\n//\r\n//\tReturns: SCH_SUCCESS\r\n//\t Error code in case of error\r\n//\r\n//\tRemarks:Note that all old information is lost after the reset.\r\n//\r\n//\t********************************************************************************\r\nRetCode ContinuousHistogram::reset ()\r\n{\r\n //## begin ContinuousHistogram::reset%374C031B03A1.body preserve=yes\r\n\r\n\t// resets attributes variables\r\n\tmaxSample = SIM_HUGE_VAL;\t\r\n\tminSample = SIM_HUGE_VAL;\t \r\n\tnumSamples = 0;\r\n\tcumSum = 0.0;\r\n\tcumSumOfSquares = 0.0;\r\n\r\n\tif (pValues == NULL)\r\n\t\treturn SCH_ALLOCATION_ERROR; // the objetct has not been created\r\n\telse\r\n\t\tmemset (pValues, 0, numIntervals * sizeof (Int)); // set all values to 0\r\n\r\n\treturn SCH_SUCCESS;\r\n\r\n //## end ContinuousHistogram::reset%374C031B03A1.body\r\n}\r\n\r\n// Additional Declarations\r\n //## begin ContinuousHistogram%3744298B0396.declarations preserve=yes\r\n //## end ContinuousHistogram%3744298B0396.declarations\r\n\r\n//## begin module%3744298B0396.epilog preserve=yes\r\n\r\n} // namespace sch\r\n\r\n//## end module%3744298B0396.epilog\r\n", "meta": {"content_hash": "3497174067e147a9b4a7da53a54e1b8c", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 131, "avg_line_length": 28.041800643086816, "alnum_prop": 0.6068111455108359, "repo_name": "aclisp/large-scale", "id": "c162d854b6f7f636ad10ae130a2bd685d82c127b", "size": "8898", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Simulator/Scheduler/StatisticsCalculation/ContinuousHistogram.cpp", "mode": "33188", "license": "mit", "language": [{"name": "Awk", "bytes": "913"}, {"name": "C", "bytes": "5141993"}, {"name": "C++", "bytes": "1756184"}, {"name": "CSS", "bytes": "12830"}, {"name": "Java", "bytes": "28931"}, {"name": "Objective-C", "bytes": "11541"}, {"name": "Python", "bytes": "3656"}, {"name": "Shell", "bytes": "2157"}]}} +{"text": "package com.bbva.kltt.apirest.core.generator.output.language;\r\n\r\nimport org.junit.Test;\r\n\r\nimport com.bbva.kltt.apirest.core.parsed_info.ParsedInfoHandlerTest;\r\nimport com.bbva.kltt.apirest.core.parsed_info.responses.ResponseTest;\r\nimport com.bbva.kltt.apirest.core.util.APIRestGeneratorException;\r\nimport com.bbva.kltt.apirest.core.util.ConstantsTest;\r\n\r\n/**\r\n * ------------------------------------------------\r\n * @author Francisco Manuel Benitez Chico\r\n * ------------------------------------------------\r\n */\r\npublic class OutputLanguageExceptionsTest\r\n{\r\n\t@Test\r\n\tpublic void fullTest() throws APIRestGeneratorException\r\n\t{\r\n\t\tfinal OutputLanguageExceptions outputLanguageExceptions = new OutputLanguageExceptions(ParsedInfoHandlerTest.generateDummyParsedInfoHandler(), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t new MyOutputLanguageNaming(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t new MyOutputLanguageOperations()) ;\r\n\t\t\r\n\t\toutputLanguageExceptions.getCommonException() ;\r\n\t\toutputLanguageExceptions.getCommonExceptionClassName() ;\r\n\t\toutputLanguageExceptions.getCustomExceptionAsClassName(ConstantsTest.OPERATION_ID, ResponseTest.generateDummyResponse()) ;\r\n\t\toutputLanguageExceptions.getCustomExceptionsList(ConstantsTest.OPERATION_ID, ConstantsTest.PATH_OPERATION) ;\r\n\t\toutputLanguageExceptions.getOutboundServerExceptionsMap() ;\r\n\t\t\r\n\t\toutputLanguageExceptions.getParsedInfoHandler() ;\r\n\t}\r\n}\r\n", "meta": {"content_hash": "b1a6692b2ea1b6d37ead704f2e100a0c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 145, "avg_line_length": 43.125, "alnum_prop": 0.7231884057971014, "repo_name": "BBVA-CIB/APIRestGenerator", "id": "b835b3f51346c17bb56871ac848b9d6f4883e1a4", "size": "1380", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/test/java/com/bbva/kltt/apirest/core/generator/output/language/OutputLanguageExceptionsTest.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "229"}, {"name": "CSS", "bytes": "504463"}, {"name": "HTML", "bytes": "9688"}, {"name": "Java", "bytes": "1098093"}, {"name": "JavaScript", "bytes": "136674"}, {"name": "Shell", "bytes": "253"}]}} +{"text": "{% extends \"theme_bootstrap/base.html\" %}\n\n{% load staticfiles %}\n{% load metron_tags %}\n{% load i18n %}\n\n\n{% block styles %}\n{% include \"_styles.html\" %}\n<style>\n html{\n width:100%;height:100%;\n }\n</style>\n{% endblock %}\n\n{% block extra_head_base %}\n{% block extra_head %}\n\n<script src=\"{%static 'js/angular.min.js'%}\"></script>\n<script src=\"{%static 'js/angular-route.min.js'%}\"></script>\n<script src=\"{%static 'js/angular-sanitize.min.js'%}\"></script>\n\n<script src=\"{%static 'js/jquery-1.9.1.min.js'%}\"></script>\n{% endblock %}\n{% endblock %}\n{% block topbar_base %}\n<header>\n <div class=\"navbar navbar-default {% block navbar_class %}navbar-fixed-top{% endblock %}\">\n <div class=\"container\">\n {% block topbar %}\n <div class=\"navbar-header\">\n <button class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\".navbar-collapse\">\n <span class=\"fa fa-bars\"></span>\n </button>\n {% block site_brand %}<a class=\"navbar-brand\" href=\"{% url \"home\" %}\">{{ SITE_NAME }}</a>{% endblock %}\n </div>\n <div class=\"collapse navbar-collapse navbar-responsive-collapse\">\n {% block nav %}\n <ul class=\"nav navbar-nav pull-left\">\n <li><a href=\"{% url 'profiles_list' %}\">People</a></li>\n <li><a href=\"{% url 'team_list' %}\">Teams</a></li>\n </ul>\n {% endblock %}\n {% block account_bar %}{% include \"_account_bar.html\" %}{% endblock %}\n </div>\n {% endblock %}\n </div>\n </div>\n</header>\n{% endblock %}\n\n{% block footer %}\n{% include \"_footer.html\" %}\n{% endblock %}\n\n\n{% block scripts %}\n{% include \"_scripts.html\" %}\n<script src=\"{%static 'bootbox/bootbox.min.js'%}\"></script>\n<script src=\"{%static 'js/ui-bootstrap-tpls-0.13.3.min.js'%}\"></script>\n{% endblock %}\n\n{% block extra_body_base %}\n{% analytics %}\n{% block extra_body %}{% endblock %}\n{% endblock %}\n", "meta": {"content_hash": "523519c31849312ebe7e416186c6c6a6", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 119, "avg_line_length": 30.074626865671643, "alnum_prop": 0.5325062034739454, "repo_name": "bird50/birdproj", "id": "eb90832f3f0aa69dc8baa17e2780b6ab7a898524", "size": "2015", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mapservice/templates/_service_base.html", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "136307"}, {"name": "HTML", "bytes": "500185"}, {"name": "Java", "bytes": "45492"}, {"name": "JavaScript", "bytes": "3734934"}, {"name": "Makefile", "bytes": "773"}, {"name": "PHP", "bytes": "3138"}, {"name": "Python", "bytes": "68448"}, {"name": "Shell", "bytes": "410"}]}} +{"text": "<?php\nnamespace App\\Test\\TestCase\\Model\\Table;\n\nuse App\\Model\\Table\\RoomsTable;\nuse Cake\\ORM\\TableRegistry;\nuse Cake\\TestSuite\\TestCase;\n\n/**\n * App\\Model\\Table\\RoomsTable Test Case\n */\nclass RoomsTableTest extends TestCase\n{\n\n /**\n * Test subject\n *\n * @var \\App\\Model\\Table\\RoomsTable\n */\n public $Rooms;\n\n /**\n * Fixtures\n *\n * @var array\n */\n public $fixtures = [\n 'app.rooms',\n 'app.statuses'\n ];\n\n /**\n * setUp method\n *\n * @return void\n */\n public function setUp()\n {\n parent::setUp();\n $config = TableRegistry::exists('Rooms') ? [] : ['className' => RoomsTable::class];\n $this->Rooms = TableRegistry::get('Rooms', $config);\n }\n\n /**\n * tearDown method\n *\n * @return void\n */\n public function tearDown()\n {\n unset($this->Rooms);\n\n parent::tearDown();\n }\n\n /**\n * Test initialize method\n *\n * @return void\n */\n public function testInitialize()\n {\n $this->markTestIncomplete('Not implemented yet.');\n }\n\n /**\n * Test validationDefault method\n *\n * @return void\n */\n public function testValidationDefault()\n {\n $this->markTestIncomplete('Not implemented yet.');\n }\n\n /**\n * Test buildRules method\n *\n * @return void\n */\n public function testBuildRules()\n {\n $this->markTestIncomplete('Not implemented yet.');\n }\n}\n", "meta": {"content_hash": "fe21b81d936a063c79b273b6a17d6106", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 91, "avg_line_length": 17.55952380952381, "alnum_prop": 0.5369491525423729, "repo_name": "Ashrafdev/rooms_crud_assessment", "id": "b0bb900bd993304fbb459f8a95f0aaf23ce4b651", "size": "1475", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/TestCase/Model/Table/RoomsTableTest.php", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "433"}, {"name": "Batchfile", "bytes": "834"}, {"name": "CSS", "bytes": "12827"}, {"name": "JavaScript", "bytes": "13739"}, {"name": "PHP", "bytes": "110910"}, {"name": "Shell", "bytes": "1457"}]}} +{"text": "<?php\nnamespace Analogue\\ORM\\System\\Proxies;\n\nuse Analogue\\ORM\\Mappable;\n\ninterface ProxyInterface\n{\n /**\n * Convert a proxy into the underlying related Object\n *\n * @return Mappable|\\Analogue\\ORM\\EntityCollection\n */\n public function load();\n\n /**\n * Return true if the underlying relation has been lazy loaded\n *\n * @return boolean\n */\n public function isLoaded();\n}\n", "meta": {"content_hash": "77c124857c297fe416db7da21c294e38", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 66, "avg_line_length": 19.666666666666668, "alnum_prop": 0.648910411622276, "repo_name": "smallhadroncollider/analogue", "id": "feb89d6ceec6ab81e0f02dc7788d64861bc6e2c7", "size": "413", "binary": false, "copies": "1", "ref": "refs/heads/5.1", "path": "src/System/Proxies/ProxyInterface.php", "mode": "33261", "license": "mit", "language": [{"name": "PHP", "bytes": "344712"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<PreferenceScreen\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\">\n\n <Preference\n android:key=\"pref_disable_battery_optimization\"\n android:title=\"@string/pref_disable_battery_optimization\"\n android:summary=\"@string/pref_disable_battery_optimization_summary\"\n android:icon=\"@drawable/ic_exclamation\"\n android:shouldDisableView=\"true\"\n app:isPreferenceVisible=\"false\" />\n\n <com.apps.adrcotfas.goodtime.settings.DayOfWeekPreference\n app:key=\"pref_reminder_days\"\n app:layout=\"@layout/preference_days_of_week\"\n app:allowDividerAbove=\"false\"\n app:iconSpaceReserved=\"false\"/>\n\n <Preference\n app:key=\"pref_reminder_time\"\n app:title=\"@string/reminder_time\"\n android:dependency=\"pref_reminder_days\"\n app:layout=\"@layout/preference_compact\"\n app:iconSpaceReserved=\"false\"/>\n\n <PreferenceCategory\n android:title=\"@string/pref_header_general\"\n app:iconSpaceReserved=\"false\">\n\n <Preference\n android:key=\"pref_timer_duration\"\n app:fragment=\"com.apps.adrcotfas.goodtime.settings.DurationsSettingsFragment\"\n android:title=\"@string/pref_timer_duration\"\n android:summary=\"@string/timer_durations\"\n android:icon=\"@drawable/ic_status_goodtime\"/>\n\n <Preference\n app:key=\"pref_work_day_start\"\n app:title=\"@string/pref_work_day_start\"\n app:layout=\"@layout/preference_compact\"\n app:iconSpaceReserved=\"false\"/>\n\n <ListPreference\n android:dialogTitle=\"@string/pref_timer_style\"\n android:key=\"pref_timer_style\"\n android:entries=\"@array/pref_timer_style\"\n android:defaultValue=\"@string/pref_timer_style_default_value\"\n android:entryValues=\"@array/pref_timer_style_values\"\n android:persistent=\"true\"\n android:summary=\"%s\"\n android:title=\"@string/pref_timer_style\"\n app:iconSpaceReserved=\"false\"/>\n\n <CheckBoxPreference\n android:defaultValue=\"false\"\n android:key=\"pref_fullscreen\"\n android:title=\"@string/pref_fullscreen\"\n app:iconSpaceReserved=\"false\"/>\n\n <CheckBoxPreference\n android:defaultValue=\"true\"\n android:key=\"pref_keep_screen_on\"\n android:title=\"@string/pref_keep_screen_on\"\n app:iconSpaceReserved=\"false\"/>\n\n <CheckBoxPreference\n android:defaultValue=\"false\"\n android:dependency=\"pref_keep_screen_on\"\n android:key=\"pref_screen_saver\"\n android:title=\"@string/pref_screen_saver\"\n android:summary=\"@string/pref_screen_saver_summary\"\n app:iconSpaceReserved=\"false\"/>\n\n <SwitchPreferenceCompat\n android:defaultValue=\"true\"\n android:persistent=\"true\"\n android:key=\"pref_amoled\"\n android:title=\"@string/pref_amoled\"\n app:iconSpaceReserved=\"false\"/>\n\n <CheckBoxPreference\n android:defaultValue=\"true\"\n android:key=\"pref_sessions_counter\"\n android:persistent=\"true\"\n android:title=\"@string/pref_session_counter\"\n android:summary=\"@string/pref_session_counter_summary\"\n app:iconSpaceReserved=\"false\"/>\n\n <CheckBoxPreference\n android:defaultValue=\"false\"\n android:key=\"pref_show_label\"\n android:persistent=\"true\"\n android:title=\"@string/pref_show_label\"\n android:summary=\"@string/pref_show_label_summary\"\n app:iconSpaceReserved=\"false\"/>\n\n </PreferenceCategory>\n\n <PreferenceCategory\n android:title=\"@string/pref_header_notifications\"\n app:iconSpaceReserved=\"false\">\n\n <SwitchPreferenceCompat\n android:defaultValue=\"true\"\n android:key=\"pref_enable_ringtone\"\n android:title=\"@string/pref_enable_ringtone\"\n android:icon=\"@drawable/ic_notifications\"/>\n\n <SwitchPreferenceCompat\n android:defaultValue=\"false\"\n android:key=\"pref_priority_alarm\"\n android:title=\"@string/pref_priority_alarm\"\n android:summary=\"@string/pref_priority_alarm_summary\"\n android:dependency=\"pref_enable_ringtone\"\n app:iconSpaceReserved=\"false\"/>\n\n <Preference\n android:key=\"pref_notification_sound_work\"\n android:summary=\"@string/pref_ringtone_summary\"\n android:title=\"@string/pref_ringtone\"\n android:dependency=\"pref_enable_ringtone\"\n app:layout=\"@layout/preference_default\"\n app:iconSpaceReserved=\"false\"/>\n\n <Preference\n android:key=\"pref_notification_sound_break\"\n android:summary=\"@string/pref_ringtone_summary\"\n android:title=\"@string/pref_ringtone_break\"\n android:dependency=\"pref_enable_ringtone\"\n app:layout=\"@layout/preference_default\"\n app:iconSpaceReserved=\"false\"/>\n\n <ListPreference\n android:key=\"pref_vibration_type\"\n android:defaultValue=\"@string/pref_vibration_values_strong\"\n android:entryValues=\"@array/pref_vibration_values\"\n android:entries=\"@array/pref_vibration_types\"\n android:title=\"@string/pref_vibrate\"\n android:summary=\"%s\"\n android:icon=\"@drawable/ic_vibration\"/>\n\n <SwitchPreferenceCompat\n android:defaultValue=\"false\"\n android:key=\"pref_flashing_notification\"\n android:title=\"@string/pref_flashing_notification\"\n android:summary=\"@string/pref_flashing_notification_summary\"\n android:icon=\"@drawable/ic_flash\"/>\n\n <SwitchPreferenceCompat\n android:defaultValue=\"false\"\n android:key=\"pref_one_minute_left_notification\"\n android:title=\"@string/pref_one_minute_left_notification\"\n android:summary=\"@string/pref_one_minute_left_notification_summary\"\n app:iconSpaceReserved=\"false\">\n </SwitchPreferenceCompat>\n\n <CheckBoxPreference\n android:defaultValue=\"false\"\n android:key=\"pref_auto_start_break\"\n android:title=\"@string/pref_auto_start_break\"\n android:summary=\"@string/pref_auto_start_break_summary\"\n app:iconSpaceReserved=\"false\"/>\n\n <CheckBoxPreference\n android:defaultValue=\"false\"\n android:key=\"pref_auto_start_work\"\n android:title=\"@string/pref_auto_start_work\"\n android:summary=\"@string/pref_auto_start_work_summary\"\n app:iconSpaceReserved=\"false\"/>\n\n <CheckBoxPreference\n android:defaultValue=\"false\"\n android:key=\"pref_ringtone_insistent\"\n android:title=\"@string/pref_ringtone_insistent\"\n android:summary=\"@string/pref_ringtone_insistent_summary\"\n app:iconSpaceReserved=\"false\"/>\n </PreferenceCategory>\n\n <PreferenceCategory\n android:title=\"@string/pref_header_during_work_sessions\"\n app:iconSpaceReserved=\"false\">\n\n <CheckBoxPreference\n android:defaultValue=\"false\"\n android:key=\"pref_disable_sound_and_vibration\"\n android:title=\"@string/pref_disable_sound_and_vibration\"\n app:iconSpaceReserved=\"false\"/>\n\n <CheckBoxPreference\n android:defaultValue=\"false\"\n android:key=\"pref_dnd\"\n android:title=\"@string/pref_dnd\"\n app:iconSpaceReserved=\"false\"/>\n\n <CheckBoxPreference\n android:defaultValue=\"false\"\n android:key=\"pref_disable_wifi\"\n android:title=\"@string/pref_disable_wifi\"\n app:iconSpaceReserved=\"false\"/>\n </PreferenceCategory>\n\n</PreferenceScreen>", "meta": {"content_hash": "2fcf81fa357e196400adedd832102b03", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 89, "avg_line_length": 39.10344827586207, "alnum_prop": 0.6242126480221718, "repo_name": "adrcotfas/Goodtime", "id": "4728c4ffabe6278be2a94ad6bc091cab29a954e2", "size": "7938", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/xml/settings.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "369452"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>equations: Not compatible \ud83d\udc7c</title>\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"../../../../../favicon.png\" />\n <link href=\"../../../../../bootstrap.min.css\" rel=\"stylesheet\">\n <link href=\"../../../../../bootstrap-custom.css\" rel=\"stylesheet\">\n <link href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n <script src=\"../../../../../moment.min.js\"></script>\n <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->\n <!--[if lt IE 9]>\n <script src=\"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <script src=\"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\"></script>\n <![endif]-->\n </head>\n <body>\n <div class=\"container\">\n <div class=\"navbar navbar-default\" role=\"navigation\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"../../../../..\"><i class=\"fa fa-lg fa-flag-checkered\"></i> Coq bench</a>\n </div>\n <div id=\"navbar\" class=\"collapse navbar-collapse\">\n <ul class=\"nav navbar-nav\">\n <li><a href=\"../..\">clean / released</a></li>\n <li class=\"active\"><a href=\"\">8.13.2 / equations - 1.2.3+8.12</a></li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"article\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a href=\"../..\">\u00ab Up</a>\n <h1>\n equations\n <small>\n 1.2.3+8.12\n <span class=\"label label-info\">Not compatible \ud83d\udc7c</span>\n </small>\n </h1>\n <p>\ud83d\udcc5 <em><script>document.write(moment(\"2022-10-06 11:12:50 +0000\", \"YYYY-MM-DD HH:mm:ss Z\").fromNow());</script> (2022-10-06 11:12:50 UTC)</em><p>\n <h2>Context</h2>\n <pre># Packages matching: installed\n# Name # Installed # Synopsis\nbase-bigarray base\nbase-threads base\nbase-unix base\nconf-findutils 1 Virtual package relying on findutils\nconf-gmp 4 Virtual package relying on a GMP lib system installation\ncoq 8.13.2 Formal proof management system\nnum 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml 4.06.1 The OCaml compiler (virtual package)\nocaml-base-compiler 4.06.1 Official 4.06.1 release\nocaml-config 1 OCaml Switch Configuration\nocamlfind 1.9.5 A library manager for OCaml\nzarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers\n# opam file:\nopam-version: "2.0"\nauthors: [ "Matthieu Sozeau <matthieu.sozeau@inria.fr>" "Cyprien Mangin <cyprien.mangin@m4x.org>" ]\ndev-repo: "git+https://github.com/mattam82/Coq-Equations.git#8.12"\nmaintainer: "matthieu.sozeau@inria.fr"\nhomepage: "https://mattam82.github.io/Coq-Equations"\nbug-reports: "https://github.com/mattam82/Coq-Equations/issues"\nlicense: "LGPL-2.1-only"\nsynopsis: "A function definition package for Coq"\ndescription: """\nEquations is a function definition plugin for Coq, that allows the\ndefinition of functions by dependent pattern-matching and well-founded,\nmutual or nested structural recursion and compiles them into core\nterms. It automatically derives the clauses equations, the graph of the\nfunction and its associated elimination principle.\n"""\ntags: [\n "keyword:dependent pattern-matching"\n "keyword:functional elimination"\n "category:Miscellaneous/Coq Extensions"\n "logpath:Equations"\n]\nbuild: [\n ["./configure.sh"]\n [make "-j%{jobs}%"]\n]\ninstall: [\n [make "install"]\n]\nrun-test: [\n [make "test-suite"]\n]\ndepends: [\n "coq" {>= "8.12.0" & < "8.13~"}\n]\nurl {\n src:\n "https://github.com/mattam82/Coq-Equations/archive/v1.2.3-8.12.tar.gz"\n checksum: "sha512=c19617ef127a56916d67b2c347f21cd267b250a23988424bb1486336e784a5df7a6c85ee355eb99e148431f8d7b3534993f3fdba3aaa4769d74f8c3548fb2efa"\n}\n</pre>\n <h2>Lint</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Dry install \ud83c\udfdc\ufe0f</h2>\n <p>Dry install with the current Coq version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam install -y --show-action coq-equations.1.2.3+8.12 coq.8.13.2</code></dd>\n <dt>Return code</dt>\n <dd>5120</dd>\n <dt>Output</dt>\n <dd><pre>[NOTE] Package coq is already installed (current version is 8.13.2).\nThe following dependencies couldn't be met:\n - coq-equations -> coq < 8.13~ -> ocaml < 4.06.0\n base of this switch (use `--unlock-base' to force)\nYour request can't be satisfied:\n - No available version of coq satisfies the constraints\nNo solution found, exiting\n</pre></dd>\n </dl>\n <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-equations.1.2.3+8.12</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n </dl>\n <h2>Install dependencies</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Install \ud83d\ude80</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Duration</dt>\n <dd>0 s</dd>\n </dl>\n <h2>Installation size</h2>\n <p>No files were installed.</p>\n <h2>Uninstall \ud83e\uddf9</h2>\n <dl class=\"dl-horizontal\">\n <dt>Command</dt>\n <dd><code>true</code></dd>\n <dt>Return code</dt>\n <dd>0</dd>\n <dt>Missing removes</dt>\n <dd>\n none\n </dd>\n <dt>Wrong removes</dt>\n <dd>\n none\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <hr/>\n <div class=\"footer\">\n <p class=\"text-center\">\n Sources are on <a href=\"https://github.com/coq-bench\">GitHub</a> \u00a9 Guillaume Claret \ud83d\udc23\n </p>\n </div>\n </div>\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>\n <script src=\"../../../../../bootstrap.min.js\"></script>\n </body>\n</html>\n", "meta": {"content_hash": "5d5f809c6ce7cd50db50095ff0c7d2a2", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 159, "avg_line_length": 41.149171270718234, "alnum_prop": 0.5617615467239527, "repo_name": "coq-bench/coq-bench.github.io", "id": "3f2d530f11b6a1ee8cdee11d728488f7e2d9593c", "size": "7473", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.13.2/equations/1.2.3+8.12.html", "mode": "33188", "license": "mit", "language": []}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"vertical\"\n tools:context=\"huyifei.mymvp.test.HashMapActivity\">\n\n\n <LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_margin=\"5dp\"\n android:orientation=\"horizontal\">\n\n <TextView\n android:textSize=\"25sp\"\n android:layout_width=\"0dp\"\n android:layout_height=\"wrap_content\"\n android:layout_weight=\"1\"\n android:gravity=\"center\"\n android:padding=\"5dp\"\n android:text=\"key: \"/>\n\n <EditText\n android:id=\"@+id/key\"\n android:layout_width=\"0dp\"\n android:layout_height=\"wrap_content\"\n android:layout_margin=\"5dp\"\n android:layout_weight=\"3\"\n android:padding=\"5dp\"/>\n\n </LinearLayout>\n\n <LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_margin=\"5dp\"\n android:orientation=\"horizontal\">\n\n <TextView\n android:textSize=\"25sp\"\n android:layout_width=\"0dp\"\n android:layout_height=\"wrap_content\"\n android:layout_weight=\"1\"\n android:gravity=\"center\"\n android:padding=\"5dp\"\n android:text=\"value: \"/>\n\n <EditText\n android:id=\"@+id/value\"\n android:layout_width=\"0dp\"\n android:layout_height=\"wrap_content\"\n android:layout_margin=\"5dp\"\n android:layout_weight=\"3\"\n android:padding=\"5dp\"/>\n\n </LinearLayout>\n\n <LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_margin=\"5dp\"\n android:orientation=\"horizontal\">\n\n\n <Button\n android:id=\"@+id/put\"\n android:layout_width=\"0dp\"\n android:layout_height=\"wrap_content\"\n android:layout_margin=\"5dp\"\n android:layout_weight=\"1\"\n android:text=\"put\"/>\n\n <Button\n android:id=\"@+id/get\"\n android:layout_width=\"0dp\"\n android:layout_height=\"wrap_content\"\n android:layout_margin=\"5dp\"\n android:layout_weight=\"1\"\n android:text=\"get\"/>\n\n <Button\n android:id=\"@+id/remove\"\n android:layout_width=\"0dp\"\n android:layout_height=\"wrap_content\"\n android:layout_margin=\"5dp\"\n android:layout_weight=\"1\"\n android:text=\"remove\"/>\n\n\n </LinearLayout>\n\n <TextView\n android:id=\"@+id/result\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_margin=\"5dp\"/>\n\n</LinearLayout>\n", "meta": {"content_hash": "08f130df325fe75e3e53716bd352f528", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 62, "avg_line_length": 29.693069306930692, "alnum_prop": 0.5721907302434145, "repo_name": "REBOOTERS/My-MVP", "id": "32958a18304064f89b5ccae66ae1bc73d1cd0162", "size": "2999", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/activity_hash_map.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "346749"}, {"name": "Kotlin", "bytes": "1979"}]}} +{"text": "@{\n\n# Script module or binary module file associated with this manifest.\nRootModule = 'SBAuthorizationRule.psm1'\n\n# Version number of this module.\nModuleVersion = '0.10.1.0'\n\n# Supported PSEditions\n# CompatiblePSEditions = @()\n\n# ID used to uniquely identify this module\nGUID = '286b166a-9bff-4ed0-859a-b22ff26a4733'\n\n# Author of this module\nAuthor = 'Ryan Spletzer'\n\n# Company or vendor of this module\nCompanyName = ''\n\n# Copyright statement for this module\nCopyright = '(c) 2017 Ryan Spletzer. All rights reserved.'\n\n# Description of the functionality provided by this module\n# Description = ''\n\n# Minimum version of the Windows PowerShell engine required by this module\nPowerShellVersion = '5.0'\n\n# Name of the Windows PowerShell host required by this module\n# PowerShellHostName = ''\n\n# Minimum version of the Windows PowerShell host required by this module\n# PowerShellHostVersion = ''\n\n# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.\n# DotNetFrameworkVersion = ''\n\n# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.\n# CLRVersion = ''\n\n# Processor architecture (None, X86, Amd64) required by this module\n# ProcessorArchitecture = ''\n\n# Modules that must be imported into the global environment prior to importing this module\n# RequiredModules = @()\n\n# Assemblies that must be loaded prior to importing this module\n# RequiredAssemblies = @()\n\n# Script files (.ps1) that are run in the caller's environment prior to importing this module.\n# ScriptsToProcess = @()\n\n# Type files (.ps1xml) to be loaded when importing this module\n# TypesToProcess = @()\n\n# Format files (.ps1xml) to be loaded when importing this module\n# FormatsToProcess = @()\n\n# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess\nNestedModules = @( '..\\..\\Modules\\SB.Util\\SB.Util.psd1' )\n\n# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.\n# FunctionsToExport = @()\n\n# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.\n# CmdletsToExport = @()\n\n# Variables to export from this module\n# VariablesToExport = '*'\n\n# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.\n# AliasesToExport = @()\n\n# DSC resources to export from this module\nDscResourcesToExport = 'SBAuthorizationRule'\n\n# List of all modules packaged with this module\n# ModuleList = @()\n\n# List of all files packaged with this module\n# FileList = @()\n\n# HelpInfo URI of this module\n# HelpInfoURI = ''\n\n# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.\n# DefaultCommandPrefix = ''\n\n}\n", "meta": {"content_hash": "16df810e13882c4c6225e3e467cb0adb", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 167, "avg_line_length": 33.77777777777778, "alnum_prop": 0.7578947368421053, "repo_name": "ryanspletzer/ServiceBusForWindowsServerDsc", "id": "ab3ef3521193e63bc1ccca8b175bf0f29cfdce38", "size": "3040", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "DSCClassResources/SBAuthorizationRule/SBAuthorizationRule.psd1", "mode": "33188", "license": "mit", "language": [{"name": "PowerShell", "bytes": "289128"}]}} +{"text": "\n\npackage org.jboss.pnc.executor;\n\nimport org.jboss.pnc.common.Configuration;\nimport org.jboss.pnc.common.json.ConfigurationParseException;\nimport org.jboss.pnc.common.json.moduleconfig.SystemConfig;\nimport org.jboss.pnc.common.json.moduleprovider.PncConfigProvider;\nimport org.jboss.pnc.executor.exceptions.BuildProcessException;\nimport org.jboss.pnc.executor.servicefactories.BuildDriverFactory;\nimport org.jboss.pnc.executor.servicefactories.EnvironmentDriverFactory;\nimport org.jboss.pnc.executor.servicefactories.RepositoryManagerFactory;\nimport org.jboss.pnc.model.RepositoryType;\nimport org.jboss.pnc.spi.BuildExecutionStatus;\nimport org.jboss.pnc.spi.builddriver.BuildDriver;\nimport org.jboss.pnc.spi.builddriver.BuildDriverResult;\nimport org.jboss.pnc.spi.builddriver.BuildDriverStatus;\nimport org.jboss.pnc.spi.builddriver.CompletedBuild;\nimport org.jboss.pnc.spi.builddriver.RunningBuild;\nimport org.jboss.pnc.spi.environment.DestroyableEnvironment;\nimport org.jboss.pnc.spi.environment.EnvironmentDriver;\nimport org.jboss.pnc.spi.environment.RunningEnvironment;\nimport org.jboss.pnc.spi.environment.StartedEnvironment;\nimport org.jboss.pnc.spi.environment.exception.EnvironmentDriverException;\nimport org.jboss.pnc.spi.events.BuildExecutionStatusChangedEvent;\nimport org.jboss.pnc.spi.executor.BuildExecutionConfiguration;\nimport org.jboss.pnc.spi.executor.BuildExecutionSession;\nimport org.jboss.pnc.spi.executor.BuildExecutor;\nimport org.jboss.pnc.spi.executor.exceptions.ExecutorException;\nimport org.jboss.pnc.spi.repositorymanager.BuildExecution;\nimport org.jboss.pnc.spi.repositorymanager.RepositoryManager;\nimport org.jboss.pnc.spi.repositorymanager.RepositoryManagerResult;\nimport org.jboss.pnc.spi.repositorymanager.model.RepositorySession;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport javax.annotation.PreDestroy;\nimport javax.enterprise.context.ApplicationScoped;\nimport javax.inject.Inject;\nimport java.net.URI;\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Optional;\nimport java.util.concurrent.CompletableFuture;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\nimport java.util.function.Consumer;\n\n/**\n * @author <a href=\"mailto:matejonnet@gmail.com\">Matej Lazar</a>\n */\n@ApplicationScoped\npublic class DefaultBuildExecutor implements BuildExecutor {\n\n private final Logger log = LoggerFactory.getLogger(DefaultBuildExecutor.class);\n\n private ExecutorService executor;\n\n private RepositoryManagerFactory repositoryManagerFactory;\n private BuildDriverFactory buildDriverFactory;\n private EnvironmentDriverFactory environmentDriverFactory;\n private final Map<Integer, BuildExecutionSession> runningExecutions = new HashMap<>();\n\n @Deprecated\n public DefaultBuildExecutor() {}; //CDI workaround for constructor injection\n\n @Inject\n public DefaultBuildExecutor(\n RepositoryManagerFactory repositoryManagerFactory,\n BuildDriverFactory buildDriverFactory,\n EnvironmentDriverFactory environmentDriverFactory,\n Configuration configuration) {\n\n this.repositoryManagerFactory = repositoryManagerFactory;\n this.buildDriverFactory = buildDriverFactory;\n this.environmentDriverFactory = environmentDriverFactory;\n\n int executorThreadPoolSize = 12;\n try {\n String executorThreadPoolSizeStr = configuration.getModuleConfig(new PncConfigProvider<>(SystemConfig.class)).getExecutorThreadPoolSize();\n if (executorThreadPoolSizeStr != null) {\n executorThreadPoolSize = Integer.parseInt(executorThreadPoolSizeStr);\n }\n } catch (ConfigurationParseException e) {\n log.warn(\"Unable parse config. Using defaults.\");\n }\n\n executor = Executors.newFixedThreadPool(executorThreadPoolSize);\n }\n\n\n @Override\n public BuildExecutionSession startBuilding(\n BuildExecutionConfiguration buildExecutionConfiguration,\n Consumer<BuildExecutionStatusChangedEvent> onBuildExecutionStatusChangedEvent) throws ExecutorException {\n\n BuildExecutionSession buildExecutionSession = new DefaultBuildExecutionSession(buildExecutionConfiguration, onBuildExecutionStatusChangedEvent);\n buildExecutionSession.setStatus(BuildExecutionStatus.NEW);\n\n //TODO update logging: log.info(\"Staring build execution task: {}; Build Configuration id: {}.\", buildExecutionConfiguration.getId(), buildExecutionConfiguration.etBuildConfiguration().getId());\n\n runningExecutions.put(buildExecutionConfiguration.getId(), buildExecutionSession);\n\n CompletableFuture.supplyAsync(() -> configureRepository(buildExecutionSession), executor)\n .thenApplyAsync(repositoryConfiguration -> setUpEnvironment(buildExecutionSession, repositoryConfiguration), executor)\n .thenComposeAsync(startedEnvironment -> waitForEnvironmentInitialization(buildExecutionSession, startedEnvironment), executor)\n .thenApplyAsync(nul -> buildSetUp(buildExecutionSession), executor)\n .thenComposeAsync(runningBuild -> waitBuildToComplete(buildExecutionSession, runningBuild), executor)\n .thenApplyAsync(completedBuild -> retrieveBuildDriverResults(buildExecutionSession, completedBuild), executor)\n .thenApplyAsync(nul -> retrieveRepositoryManagerResults(buildExecutionSession), executor)\n .thenApplyAsync(nul -> destroyEnvironment(buildExecutionSession), executor)\n .handleAsync((nul, e) -> completeExecution(buildExecutionSession, e), executor);\n\n //TODO re-connect running instances in case of crash\n return buildExecutionSession;\n }\n\n @Override\n public BuildExecutionSession getRunningExecution(int buildExecutionTaskId) {\n return runningExecutions.get(buildExecutionTaskId);\n }\n\n private RepositorySession configureRepository(BuildExecutionSession buildExecutionSession) {\n buildExecutionSession.setStatus(BuildExecutionStatus.REPO_SETTING_UP);\n try {\n RepositoryManager repositoryManager = repositoryManagerFactory.getRepositoryManager(RepositoryType.MAVEN);\n BuildExecution buildExecution = buildExecutionSession.getBuildExecutionConfiguration();\n return repositoryManager.createBuildRepository(buildExecution);\n } catch (Throwable e) {\n throw new BuildProcessException(e);\n }\n }\n\n private StartedEnvironment setUpEnvironment(BuildExecutionSession buildExecutionSession, RepositorySession repositorySession) {\n buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_ENV_SETTING_UP);\n BuildExecutionConfiguration buildExecutionConfiguration = buildExecutionSession.getBuildExecutionConfiguration();\n try {\n EnvironmentDriver envDriver = environmentDriverFactory.getDriver(buildExecutionConfiguration.getBuildType());\n StartedEnvironment startedEnv = envDriver.buildEnvironment(\n buildExecutionConfiguration.getBuildType(),\n repositorySession);\n return startedEnv;\n } catch (Throwable e) {\n throw new BuildProcessException(e);\n }\n }\n\n private CompletableFuture<Void> waitForEnvironmentInitialization(BuildExecutionSession buildExecutionSession, StartedEnvironment startedEnvironment) {\n CompletableFuture<Void> waitToCompleteFuture = new CompletableFuture<>();\n try {\n Consumer<RunningEnvironment> onComplete = (runningEnvironment) -> {\n buildExecutionSession.setRunningEnvironment(runningEnvironment);\n buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_ENV_SETUP_COMPLETE_SUCCESS);\n waitToCompleteFuture.complete(null);\n };\n Consumer<Exception> onError = (e) -> {\n buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_ENV_SETUP_COMPLETE_WITH_ERROR);\n waitToCompleteFuture.completeExceptionally(new BuildProcessException(e, startedEnvironment));\n };\n buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_ENV_WAITING);\n\n startedEnvironment.monitorInitialization(onComplete, onError);\n } catch (Throwable e) {\n waitToCompleteFuture.completeExceptionally(new BuildProcessException(e, startedEnvironment));\n }\n return waitToCompleteFuture;\n }\n\n private RunningBuild buildSetUp(BuildExecutionSession buildExecutionSession) {\n buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_SETTING_UP);\n RunningEnvironment runningEnvironment = buildExecutionSession.getRunningEnvironment();\n try {\n String liveLogWebSocketUrl = runningEnvironment.getBuildAgentUrl();\n log.debug(\"Setting live log websocket url: {}\", liveLogWebSocketUrl);\n buildExecutionSession.setLiveLogsUri(Optional.of(new URI(liveLogWebSocketUrl)));\n buildExecutionSession.setStartTime(new Date());\n BuildDriver buildDriver = buildDriverFactory.getBuildDriver(buildExecutionSession.getBuildExecutionConfiguration().getBuildType());\n return buildDriver.startProjectBuild(buildExecutionSession, runningEnvironment);\n } catch (Throwable e) {\n throw new BuildProcessException(e, runningEnvironment);\n }\n }\n\n private CompletableFuture<CompletedBuild> waitBuildToComplete(BuildExecutionSession buildExecutionSession, RunningBuild runningBuild) {\n CompletableFuture<CompletedBuild> waitToCompleteFuture = new CompletableFuture<>();\n try {\n Consumer<CompletedBuild> onComplete = (completedBuild) -> {\n waitToCompleteFuture.complete(completedBuild);\n };\n Consumer<Throwable> onError = (e) -> {\n waitToCompleteFuture.completeExceptionally(new BuildProcessException(e, runningBuild.getRunningEnvironment()));\n };\n\n buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_WAITING);\n\n runningBuild.monitor(onComplete, onError);\n } catch (Throwable exception) {\n waitToCompleteFuture.completeExceptionally(\n new BuildProcessException(exception, runningBuild.getRunningEnvironment()));\n }\n return waitToCompleteFuture;\n }\n\n private Void retrieveBuildDriverResults(BuildExecutionSession buildExecutionSession, CompletedBuild completedBuild) {\n buildExecutionSession.setStatus(BuildExecutionStatus.COLLECTING_RESULTS_FROM_BUILD_DRIVER);\n try {\n BuildDriverResult buildResult = completedBuild.getBuildResult();\n BuildDriverStatus buildDriverStatus = buildResult.getBuildDriverStatus();\n buildExecutionSession.setBuildDriverResult(buildResult);\n if (buildDriverStatus.completedSuccessfully()) {\n buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_COMPLETED_SUCCESS);\n } else {\n buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_COMPLETED_WITH_ERROR);\n }\n return null;\n } catch (Throwable e) {\n throw new BuildProcessException(e, completedBuild.getRunningEnvironment());\n }\n }\n\n private Void retrieveRepositoryManagerResults(BuildExecutionSession buildExecutionSession) {\n try {\n buildExecutionSession.setStatus(BuildExecutionStatus.COLLECTING_RESULTS_FROM_REPOSITORY_NAMAGER);\n RunningEnvironment runningEnvironment = buildExecutionSession.getRunningEnvironment();\n buildExecutionSession.setRunningEnvironment(runningEnvironment);\n\n RepositorySession repositorySession = runningEnvironment.getRepositorySession();\n RepositoryManagerResult repositoryManagerResult = repositorySession.extractBuildArtifacts();\n buildExecutionSession.setRepositoryManagerResult(repositoryManagerResult);\n } catch (Throwable e) {\n throw new BuildProcessException(e, buildExecutionSession.getRunningEnvironment());\n }\n return null;\n }\n\n private Void destroyEnvironment(BuildExecutionSession buildExecutionSession) {\n try {\n buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_ENV_DESTROYING);\n buildExecutionSession.getRunningEnvironment().destroyEnvironment();\n buildExecutionSession.setStatus(BuildExecutionStatus.BUILD_ENV_DESTROYED);\n } catch (Throwable e) {\n throw new BuildProcessException(e);\n }\n return null;\n }\n\n private Void completeExecution(BuildExecutionSession buildExecutionSession, Throwable e) {\n buildExecutionSession.setStatus(BuildExecutionStatus.FINALIZING_EXECUTION);\n\n if (buildExecutionSession.getStartTime() == null) {\n buildExecutionSession.setException(new ExecutorException(\"Missing start time.\"));\n }\n if (e != null) {\n stopRunningEnvironment(e);\n }\n\n if (e != null) {\n buildExecutionSession.setException(new ExecutorException(e));\n }\n\n if (buildExecutionSession.getEndTime() != null) {\n buildExecutionSession.setException(new ExecutorException(\"End time already set.\"));\n } else {\n buildExecutionSession.setEndTime(new Date());\n }\n\n //check if any of previous statuses indicated \"failed\" state\n if (buildExecutionSession.hasFailed()) { //TODO differentiate build and system error\n buildExecutionSession.setStatus(BuildExecutionStatus.DONE_WITH_ERRORS);\n } else {\n buildExecutionSession.setStatus(BuildExecutionStatus.DONE);\n }\n\n log.debug(\"Removing buildExecutionTask [\" + buildExecutionSession.getId() + \"] form list of running tasks.\");\n runningExecutions.remove(buildExecutionSession.getId());\n\n return null;\n }\n\n /**\n * Tries to stop running environment if the exception contains information about running environment\n *\n * @param ex Exception in build process (To stop the environment it has to be instance of BuildProcessException)\n */\n private void stopRunningEnvironment(Throwable ex) {\n DestroyableEnvironment destroyableEnvironment = null;\n if(ex instanceof BuildProcessException) {\n BuildProcessException bpEx = (BuildProcessException) ex;\n destroyableEnvironment = bpEx.getDestroyableEnvironment();\n } else if(ex.getCause() instanceof BuildProcessException) {\n BuildProcessException bpEx = (BuildProcessException) ex.getCause();\n destroyableEnvironment = bpEx.getDestroyableEnvironment();\n } else {\n //It shouldn't never happen - Throwable should be caught in all steps of build chain\n //and BuildProcessException should be thrown instead of that\n log.warn(\"Possible leak of a running environment! Build process ended with exception, \"\n + \"but the exception didn't contain information about running environment.\", ex);\n }\n\n try {\n if (destroyableEnvironment != null)\n destroyableEnvironment.destroyEnvironment();\n\n } catch (EnvironmentDriverException envE) {\n log.warn(\"Running environment\" + destroyableEnvironment + \" couldn't be destroyed!\", envE);\n }\n }\n\n @Override\n @PreDestroy\n public void shutdown() {\n executor.shutdown();\n }\n}\n", "meta": {"content_hash": "9d8cef4a54935e9a7b11d423fc787cd0", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 202, "avg_line_length": 49.34603174603175, "alnum_prop": 0.7321796191456511, "repo_name": "pgier/pnc", "id": "72b298e7dfad469a5c27f62310d6a82e3fe43049", "size": "16247", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build-executor/src/main/java/org/jboss/pnc/executor/DefaultBuildExecutor.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "102097"}, {"name": "Groovy", "bytes": "884"}, {"name": "HTML", "bytes": "204866"}, {"name": "Java", "bytes": "1948630"}, {"name": "JavaScript", "bytes": "2724526"}, {"name": "Shell", "bytes": "7028"}]}} +{"text": "package mil.nga.giat.mage.sdk.event;\n\npublic interface IUserDispatcher {\n\n\t/**\n\t * Adds a listener\n\t * \n\t * @param listener\n\t * @return\n\t * @throws Exception\n\t */\n boolean addListener(final IUserEventListener listener) throws Exception;\n\n\t/**\n\t * Removes the listener\n\t * \n\t * @param listener\n\t * @return\n\t * @throws Exception\n\t */\n boolean removeListener(final IUserEventListener listener) throws Exception;\n}\n", "meta": {"content_hash": "3a6200d38c7839b97393897632566076", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 79, "avg_line_length": 18.954545454545453, "alnum_prop": 0.6930455635491607, "repo_name": "ngageoint/mage-android", "id": "abecbc68d37d70d5aed5c477f9c7cb874d3f6cba", "size": "417", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mage/src/main/java/mil/nga/giat/mage/sdk/event/IUserDispatcher.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "654440"}, {"name": "Kotlin", "bytes": "906967"}]}} +{"text": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n tools:context=\"com.hmsoft.weargoproremote.ui.TestActivity\">\n <item android:id=\"@+id/action_video_vga60\" android:title=\"@string/action_video_vga60\"\n android:orderInCategory=\"100\" android:showAsAction=\"never\" />\n <item android:id=\"@+id/action_video_72030\" android:title=\"@string/action_video_72030\"\n android:orderInCategory=\"100\" android:showAsAction=\"never\" />\n <item android:id=\"@+id/action_video_720g60\" android:title=\"@string/action_video_72060\"\n android:orderInCategory=\"100\" android:showAsAction=\"never\" />\n <item android:id=\"@+id/action_video_96030\" android:title=\"@string/action_video_96030\"\n android:orderInCategory=\"100\" android:showAsAction=\"never\" />\n <item android:id=\"@+id/action_video_108030\" android:title=\"@string/action_video_108030\"\n android:orderInCategory=\"100\" android:showAsAction=\"never\" />\n</menu>", "meta": {"content_hash": "d45573106dd72af6bd18e93246c54593", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 91, "avg_line_length": 70.71428571428571, "alnum_prop": 0.7202020202020202, "repo_name": "hmrs-cr/android-wear-gopro-remote", "id": "1ece3a71209dcc01a6822e796c70e5f02a31e118", "size": "990", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mobile/src/main/res/menu/menu_video_modes.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "185088"}]}} +{"text": "/*[clinic input]\npreserve\n[clinic start generated code]*/\n\nPyDoc_STRVAR(_io_open__doc__,\n\"open($module, /, file, mode=\\'r\\', buffering=-1, encoding=None,\\n\"\n\" errors=None, newline=None, closefd=True, opener=None)\\n\"\n\"--\\n\"\n\"\\n\"\n\"Open file and return a stream. Raise OSError upon failure.\\n\"\n\"\\n\"\n\"file is either a text or byte string giving the name (and the path\\n\"\n\"if the file isn\\'t in the current working directory) of the file to\\n\"\n\"be opened or an integer file descriptor of the file to be\\n\"\n\"wrapped. (If a file descriptor is given, it is closed when the\\n\"\n\"returned I/O object is closed, unless closefd is set to False.)\\n\"\n\"\\n\"\n\"mode is an optional string that specifies the mode in which the file\\n\"\n\"is opened. It defaults to \\'r\\' which means open for reading in text\\n\"\n\"mode. Other common values are \\'w\\' for writing (truncating the file if\\n\"\n\"it already exists), \\'x\\' for creating and writing to a new file, and\\n\"\n\"\\'a\\' for appending (which on some Unix systems, means that all writes\\n\"\n\"append to the end of the file regardless of the current seek position).\\n\"\n\"In text mode, if encoding is not specified the encoding used is platform\\n\"\n\"dependent: locale.getpreferredencoding(False) is called to get the\\n\"\n\"current locale encoding. (For reading and writing raw bytes use binary\\n\"\n\"mode and leave encoding unspecified.) The available modes are:\\n\"\n\"\\n\"\n\"========= ===============================================================\\n\"\n\"Character Meaning\\n\"\n\"--------- ---------------------------------------------------------------\\n\"\n\"\\'r\\' open for reading (default)\\n\"\n\"\\'w\\' open for writing, truncating the file first\\n\"\n\"\\'x\\' create a new file and open it for writing\\n\"\n\"\\'a\\' open for writing, appending to the end of the file if it exists\\n\"\n\"\\'b\\' binary mode\\n\"\n\"\\'t\\' text mode (default)\\n\"\n\"\\'+\\' open a disk file for updating (reading and writing)\\n\"\n\"\\'U\\' universal newline mode (deprecated)\\n\"\n\"========= ===============================================================\\n\"\n\"\\n\"\n\"The default mode is \\'rt\\' (open for reading text). For binary random\\n\"\n\"access, the mode \\'w+b\\' opens and truncates the file to 0 bytes, while\\n\"\n\"\\'r+b\\' opens the file without truncation. The \\'x\\' mode implies \\'w\\' and\\n\"\n\"raises an `FileExistsError` if the file already exists.\\n\"\n\"\\n\"\n\"Python distinguishes between files opened in binary and text modes,\\n\"\n\"even when the underlying operating system doesn\\'t. Files opened in\\n\"\n\"binary mode (appending \\'b\\' to the mode argument) return contents as\\n\"\n\"bytes objects without any decoding. In text mode (the default, or when\\n\"\n\"\\'t\\' is appended to the mode argument), the contents of the file are\\n\"\n\"returned as strings, the bytes having been first decoded using a\\n\"\n\"platform-dependent encoding or using the specified encoding if given.\\n\"\n\"\\n\"\n\"\\'U\\' mode is deprecated and will raise an exception in future versions\\n\"\n\"of Python. It has no effect in Python 3. Use newline to control\\n\"\n\"universal newlines mode.\\n\"\n\"\\n\"\n\"buffering is an optional integer used to set the buffering policy.\\n\"\n\"Pass 0 to switch buffering off (only allowed in binary mode), 1 to select\\n\"\n\"line buffering (only usable in text mode), and an integer > 1 to indicate\\n\"\n\"the size of a fixed-size chunk buffer. When no buffering argument is\\n\"\n\"given, the default buffering policy works as follows:\\n\"\n\"\\n\"\n\"* Binary files are buffered in fixed-size chunks; the size of the buffer\\n\"\n\" is chosen using a heuristic trying to determine the underlying device\\'s\\n\"\n\" \\\"block size\\\" and falling back on `io.DEFAULT_BUFFER_SIZE`.\\n\"\n\" On many systems, the buffer will typically be 4096 or 8192 bytes long.\\n\"\n\"\\n\"\n\"* \\\"Interactive\\\" text files (files for which isatty() returns True)\\n\"\n\" use line buffering. Other text files use the policy described above\\n\"\n\" for binary files.\\n\"\n\"\\n\"\n\"encoding is the name of the encoding used to decode or encode the\\n\"\n\"file. This should only be used in text mode. The default encoding is\\n\"\n\"platform dependent, but any encoding supported by Python can be\\n\"\n\"passed. See the codecs module for the list of supported encodings.\\n\"\n\"\\n\"\n\"errors is an optional string that specifies how encoding errors are to\\n\"\n\"be handled---this argument should not be used in binary mode. Pass\\n\"\n\"\\'strict\\' to raise a ValueError exception if there is an encoding error\\n\"\n\"(the default of None has the same effect), or pass \\'ignore\\' to ignore\\n\"\n\"errors. (Note that ignoring encoding errors can lead to data loss.)\\n\"\n\"See the documentation for codecs.register or run \\'help(codecs.Codec)\\'\\n\"\n\"for a list of the permitted encoding error strings.\\n\"\n\"\\n\"\n\"newline controls how universal newlines works (it only applies to text\\n\"\n\"mode). It can be None, \\'\\', \\'\\\\n\\', \\'\\\\r\\', and \\'\\\\r\\\\n\\'. It works as\\n\"\n\"follows:\\n\"\n\"\\n\"\n\"* On input, if newline is None, universal newlines mode is\\n\"\n\" enabled. Lines in the input can end in \\'\\\\n\\', \\'\\\\r\\', or \\'\\\\r\\\\n\\', and\\n\"\n\" these are translated into \\'\\\\n\\' before being returned to the\\n\"\n\" caller. If it is \\'\\', universal newline mode is enabled, but line\\n\"\n\" endings are returned to the caller untranslated. If it has any of\\n\"\n\" the other legal values, input lines are only terminated by the given\\n\"\n\" string, and the line ending is returned to the caller untranslated.\\n\"\n\"\\n\"\n\"* On output, if newline is None, any \\'\\\\n\\' characters written are\\n\"\n\" translated to the system default line separator, os.linesep. If\\n\"\n\" newline is \\'\\' or \\'\\\\n\\', no translation takes place. If newline is any\\n\"\n\" of the other legal values, any \\'\\\\n\\' characters written are translated\\n\"\n\" to the given string.\\n\"\n\"\\n\"\n\"If closefd is False, the underlying file descriptor will be kept open\\n\"\n\"when the file is closed. This does not work when a file name is given\\n\"\n\"and must be True in that case.\\n\"\n\"\\n\"\n\"A custom opener can be used by passing a callable as *opener*. The\\n\"\n\"underlying file descriptor for the file object is then obtained by\\n\"\n\"calling *opener* with (*file*, *flags*). *opener* must return an open\\n\"\n\"file descriptor (passing os.open as *opener* results in functionality\\n\"\n\"similar to passing None).\\n\"\n\"\\n\"\n\"open() returns a file object whose type depends on the mode, and\\n\"\n\"through which the standard file operations such as reading and writing\\n\"\n\"are performed. When open() is used to open a file in a text mode (\\'w\\',\\n\"\n\"\\'r\\', \\'wt\\', \\'rt\\', etc.), it returns a TextIOWrapper. When used to open\\n\"\n\"a file in a binary mode, the returned class varies: in read binary\\n\"\n\"mode, it returns a BufferedReader; in write binary and append binary\\n\"\n\"modes, it returns a BufferedWriter, and in read/write mode, it returns\\n\"\n\"a BufferedRandom.\\n\"\n\"\\n\"\n\"It is also possible to use a string or bytearray as a file for both\\n\"\n\"reading and writing. For strings StringIO can be used like a file\\n\"\n\"opened in a text mode, and for bytes a BytesIO can be used like a file\\n\"\n\"opened in a binary mode.\");\n\n#define _IO_OPEN_METHODDEF \\\n {\"open\", (PyCFunction)(void(*)(void))_io_open, METH_FASTCALL|METH_KEYWORDS, _io_open__doc__},\n\nstatic PyObject *\n_io_open_impl(PyObject *module, PyObject *file, const char *mode,\n int buffering, const char *encoding, const char *errors,\n const char *newline, int closefd, PyObject *opener);\n\nstatic PyObject *\n_io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)\n{\n PyObject *return_value = NULL;\n static const char * const _keywords[] = {\"file\", \"mode\", \"buffering\", \"encoding\", \"errors\", \"newline\", \"closefd\", \"opener\", NULL};\n static _PyArg_Parser _parser = {NULL, _keywords, \"open\", 0};\n PyObject *argsbuf[8];\n Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;\n PyObject *file;\n const char *mode = \"r\";\n int buffering = -1;\n const char *encoding = NULL;\n const char *errors = NULL;\n const char *newline = NULL;\n int closefd = 1;\n PyObject *opener = Py_None;\n\n args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 8, 0, argsbuf);\n if (!args) {\n goto exit;\n }\n file = args[0];\n if (!noptargs) {\n goto skip_optional_pos;\n }\n if (args[1]) {\n if (!PyUnicode_Check(args[1])) {\n _PyArg_BadArgument(\"open\", \"argument 'mode'\", \"str\", args[1]);\n goto exit;\n }\n Py_ssize_t mode_length;\n mode = PyUnicode_AsUTF8AndSize(args[1], &mode_length);\n if (mode == NULL) {\n goto exit;\n }\n if (strlen(mode) != (size_t)mode_length) {\n PyErr_SetString(PyExc_ValueError, \"embedded null character\");\n goto exit;\n }\n if (!--noptargs) {\n goto skip_optional_pos;\n }\n }\n if (args[2]) {\n if (PyFloat_Check(args[2])) {\n PyErr_SetString(PyExc_TypeError,\n \"integer argument expected, got float\" );\n goto exit;\n }\n buffering = _PyLong_AsInt(args[2]);\n if (buffering == -1 && PyErr_Occurred()) {\n goto exit;\n }\n if (!--noptargs) {\n goto skip_optional_pos;\n }\n }\n if (args[3]) {\n if (args[3] == Py_None) {\n encoding = NULL;\n }\n else if (PyUnicode_Check(args[3])) {\n Py_ssize_t encoding_length;\n encoding = PyUnicode_AsUTF8AndSize(args[3], &encoding_length);\n if (encoding == NULL) {\n goto exit;\n }\n if (strlen(encoding) != (size_t)encoding_length) {\n PyErr_SetString(PyExc_ValueError, \"embedded null character\");\n goto exit;\n }\n }\n else {\n _PyArg_BadArgument(\"open\", \"argument 'encoding'\", \"str or None\", args[3]);\n goto exit;\n }\n if (!--noptargs) {\n goto skip_optional_pos;\n }\n }\n if (args[4]) {\n if (args[4] == Py_None) {\n errors = NULL;\n }\n else if (PyUnicode_Check(args[4])) {\n Py_ssize_t errors_length;\n errors = PyUnicode_AsUTF8AndSize(args[4], &errors_length);\n if (errors == NULL) {\n goto exit;\n }\n if (strlen(errors) != (size_t)errors_length) {\n PyErr_SetString(PyExc_ValueError, \"embedded null character\");\n goto exit;\n }\n }\n else {\n _PyArg_BadArgument(\"open\", \"argument 'errors'\", \"str or None\", args[4]);\n goto exit;\n }\n if (!--noptargs) {\n goto skip_optional_pos;\n }\n }\n if (args[5]) {\n if (args[5] == Py_None) {\n newline = NULL;\n }\n else if (PyUnicode_Check(args[5])) {\n Py_ssize_t newline_length;\n newline = PyUnicode_AsUTF8AndSize(args[5], &newline_length);\n if (newline == NULL) {\n goto exit;\n }\n if (strlen(newline) != (size_t)newline_length) {\n PyErr_SetString(PyExc_ValueError, \"embedded null character\");\n goto exit;\n }\n }\n else {\n _PyArg_BadArgument(\"open\", \"argument 'newline'\", \"str or None\", args[5]);\n goto exit;\n }\n if (!--noptargs) {\n goto skip_optional_pos;\n }\n }\n if (args[6]) {\n if (PyFloat_Check(args[6])) {\n PyErr_SetString(PyExc_TypeError,\n \"integer argument expected, got float\" );\n goto exit;\n }\n closefd = _PyLong_AsInt(args[6]);\n if (closefd == -1 && PyErr_Occurred()) {\n goto exit;\n }\n if (!--noptargs) {\n goto skip_optional_pos;\n }\n }\n opener = args[7];\nskip_optional_pos:\n return_value = _io_open_impl(module, file, mode, buffering, encoding, errors, newline, closefd, opener);\n\nexit:\n return return_value;\n}\n\nPyDoc_STRVAR(_io_open_code__doc__,\n\"open_code($module, /, path)\\n\"\n\"--\\n\"\n\"\\n\"\n\"Opens the provided file with the intent to import the contents.\\n\"\n\"\\n\"\n\"This may perform extra validation beyond open(), but is otherwise interchangeable\\n\"\n\"with calling open(path, \\'rb\\').\");\n\n#define _IO_OPEN_CODE_METHODDEF \\\n {\"open_code\", (PyCFunction)(void(*)(void))_io_open_code, METH_FASTCALL|METH_KEYWORDS, _io_open_code__doc__},\n\nstatic PyObject *\n_io_open_code_impl(PyObject *module, PyObject *path);\n\nstatic PyObject *\n_io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)\n{\n PyObject *return_value = NULL;\n static const char * const _keywords[] = {\"path\", NULL};\n static _PyArg_Parser _parser = {NULL, _keywords, \"open_code\", 0};\n PyObject *argsbuf[1];\n PyObject *path;\n\n args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);\n if (!args) {\n goto exit;\n }\n if (!PyUnicode_Check(args[0])) {\n _PyArg_BadArgument(\"open_code\", \"argument 'path'\", \"str\", args[0]);\n goto exit;\n }\n if (PyUnicode_READY(args[0]) == -1) {\n goto exit;\n }\n path = args[0];\n return_value = _io_open_code_impl(module, path);\n\nexit:\n return return_value;\n}\n/*[clinic end generated code: output=3df6bc6d91697545 input=a9049054013a1b77]*/\n", "meta": {"content_hash": "615ed382050205b02525cb60879ccdde", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 134, "avg_line_length": 40.99386503067485, "alnum_prop": 0.6135887458844658, "repo_name": "batermj/algorithm-challenger", "id": "1a9651d340813f03dc84800f08758b897b0515b1", "size": "13364", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Modules/_io/clinic/_iomodule.c.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "655185"}, {"name": "Batchfile", "bytes": "127416"}, {"name": "C", "bytes": "33127630"}, {"name": "C++", "bytes": "1364796"}, {"name": "CSS", "bytes": "3163"}, {"name": "Common Lisp", "bytes": "48962"}, {"name": "DIGITAL Command Language", "bytes": "26402"}, {"name": "DTrace", "bytes": "2196"}, {"name": "Go", "bytes": "26248"}, {"name": "HTML", "bytes": "385719"}, {"name": "Haskell", "bytes": "33612"}, {"name": "Java", "bytes": "1084"}, {"name": "JavaScript", "bytes": "20754"}, {"name": "M4", "bytes": "403992"}, {"name": "Makefile", "bytes": "238185"}, {"name": "Objective-C", "bytes": "4934684"}, {"name": "PHP", "bytes": "3513"}, {"name": "PLSQL", "bytes": "45772"}, {"name": "Perl", "bytes": "649"}, {"name": "PostScript", "bytes": "27606"}, {"name": "PowerShell", "bytes": "21737"}, {"name": "Python", "bytes": "55270625"}, {"name": "R", "bytes": "29951"}, {"name": "Rich Text Format", "bytes": "14551"}, {"name": "Roff", "bytes": "292490"}, {"name": "Ruby", "bytes": "519"}, {"name": "Scala", "bytes": "846446"}, {"name": "Shell", "bytes": "491113"}, {"name": "Swift", "bytes": "881"}, {"name": "TeX", "bytes": "337654"}, {"name": "VBScript", "bytes": "140"}, {"name": "XSLT", "bytes": "153"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc (version 1.7.0_11) on Mon Mar 17 10:51:57 PDT 2014 -->\n<title>Uses of Class com.box.boxjavalibv2.BoxConfigBuilder</title>\n<meta name=\"date\" content=\"2014-03-17\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"Uses of Class com.box.boxjavalibv2.BoxConfigBuilder\";\n }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!-- -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"../package-summary.html\">Package</a></li>\n<li><a href=\"../../../../com/box/boxjavalibv2/BoxConfigBuilder.html\" title=\"class in com.box.boxjavalibv2\">Class</a></li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../../../../overview-tree.html\">Tree</a></li>\n<li><a href=\"../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../index-files/index-1.html\">Index</a></li>\n<li><a href=\"../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../index.html?com/box/boxjavalibv2/class-use/BoxConfigBuilder.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"BoxConfigBuilder.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h2 title=\"Uses of Class com.box.boxjavalibv2.BoxConfigBuilder\" class=\"title\">Uses of Class<br>com.box.boxjavalibv2.BoxConfigBuilder</h2>\n</div>\n<div class=\"classUseContainer\">No usage of com.box.boxjavalibv2.BoxConfigBuilder</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!-- -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"../package-summary.html\">Package</a></li>\n<li><a href=\"../../../../com/box/boxjavalibv2/BoxConfigBuilder.html\" title=\"class in com.box.boxjavalibv2\">Class</a></li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../../../../overview-tree.html\">Tree</a></li>\n<li><a href=\"../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../index-files/index-1.html\">Index</a></li>\n<li><a href=\"../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../index.html?com/box/boxjavalibv2/class-use/BoxConfigBuilder.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"BoxConfigBuilder.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n", "meta": {"content_hash": "d79d4bb0eb14299d739f0cba22fbba68", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 137, "avg_line_length": 35.88695652173913, "alnum_prop": 0.619578386236976, "repo_name": "shelsonjava/box-java-sdk-v2", "id": "7caf443b28d63d3702ceace6e8d01a0bf430e345", "size": "4127", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "javadoc/com/box/boxjavalibv2/class-use/BoxConfigBuilder.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "737981"}, {"name": "Shell", "bytes": "1413"}]}} +{"text": "<!DOCTYPE html>\n<html lang=\"en\" xmlns:th=\"http://www.thymeleaf.org\">\n<head>\n <meta charset=\"UTF-8\" />\n <title>Title</title>\n</head>\n<body>\n<h1>SHACLEX API</h1>\n<ul>\n <li><a href=\"/docs/index.html\">API Documentation</a></li>\n <li><a href=\"/dataCheck\">Check RDF Data</a></li>\n <li><a href=\"/schemaCheck\">Check schemas</a></li>\n <li><a href=\"/validate\">Validate RDF Data with a Schema</a></li>\n <li><a href=\"/about.html\">About SHACLEX</a></li>\n</ul>\n\n</body>\n</html>", "meta": {"content_hash": "fe69fea33f09ecee2c6ab948781a6f01", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 68, "avg_line_length": 26.88888888888889, "alnum_prop": 0.6053719008264463, "repo_name": "labra/apiShaclex", "id": "17c0bcc6dbaaa915ff2e8a8a94f6a54a9d3ffb06", "size": "484", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/resources/templates/landing.html", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "5127"}, {"name": "CSS", "bytes": "21"}, {"name": "HTML", "bytes": "3531"}, {"name": "Java", "bytes": "24850"}, {"name": "Shell", "bytes": "7272"}]}} +{"text": "class Scene\n{\npublic:\n\tScene(const std::string& SceneFilePath);\n\n\tvoid UnLoad();\n\n\tvoid LoadSceneObject(const json& obj, Transform* parent);\n\tbool Load(SharedPtr<World> InWorld);\n\tvoid LoadCore(json& core);\n\n\tbool IsNewScene();\n\n\tvoid Save(const std::string& fileName, Transform* root);\n\tvoid SaveSceneRecursively(json& d, Transform* CurrentTransform);\n\n\tSharedPtr<World> GameWorld;\n\tFile CurrentLevel;\n\tPath FilePath;\n};", "meta": {"content_hash": "b48d4b82bab37d2acaba058c264c9234", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 65, "avg_line_length": 21.05, "alnum_prop": 0.7482185273159145, "repo_name": "wobbier/MitchEngine", "id": "7d65a01946eff0a6fb26a94a53a1e9ea88ccdea6", "size": "549", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/World/Scene.h", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "1573"}, {"name": "C", "bytes": "3573353"}, {"name": "C#", "bytes": "35890"}, {"name": "C++", "bytes": "1063321"}, {"name": "GLSL", "bytes": "5521"}, {"name": "HTML", "bytes": "361"}, {"name": "Lua", "bytes": "24016"}, {"name": "Scala", "bytes": "269"}, {"name": "Shell", "bytes": "34054"}]}} +{"text": "<?php\n\n// autoload_psr4.php @generated by Composer\n\n$vendorDir = dirname(dirname(__FILE__));\n$baseDir = dirname($vendorDir);\n\nreturn array(\n 'phpDocumentor\\\\Reflection\\\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-docblock/src'),\n 'Wn\\\\Generators\\\\' => array($vendorDir . '/wn/lumen-generators/src'),\n 'When\\\\' => array($vendorDir . '/tplaner/when/src'),\n 'Webmozart\\\\Assert\\\\' => array($vendorDir . '/webmozart/assert/src'),\n 'TijsVerkoyen\\\\CssToInlineStyles\\\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'),\n 'Symfony\\\\Polyfill\\\\Mbstring\\\\' => array($vendorDir . '/symfony/polyfill-mbstring'),\n 'Symfony\\\\Component\\\\Yaml\\\\' => array($vendorDir . '/symfony/yaml'),\n 'Symfony\\\\Component\\\\Translation\\\\' => array($vendorDir . '/symfony/translation'),\n 'Symfony\\\\Component\\\\Process\\\\' => array($vendorDir . '/symfony/process'),\n 'Symfony\\\\Component\\\\HttpKernel\\\\' => array($vendorDir . '/symfony/http-kernel'),\n 'Symfony\\\\Component\\\\HttpFoundation\\\\' => array($vendorDir . '/symfony/http-foundation'),\n 'Symfony\\\\Component\\\\Finder\\\\' => array($vendorDir . '/symfony/finder'),\n 'Symfony\\\\Component\\\\EventDispatcher\\\\' => array($vendorDir . '/symfony/event-dispatcher'),\n 'Symfony\\\\Component\\\\Debug\\\\' => array($vendorDir . '/symfony/debug'),\n 'Symfony\\\\Component\\\\CssSelector\\\\' => array($vendorDir . '/symfony/css-selector'),\n 'Symfony\\\\Component\\\\Console\\\\' => array($vendorDir . '/symfony/console'),\n 'SocialiteProviders\\\\Manager\\\\Test\\\\' => array($vendorDir . '/socialiteproviders/manager/tests'),\n 'SocialiteProviders\\\\Manager\\\\' => array($vendorDir . '/socialiteproviders/manager/src'),\n 'SocialiteProviders\\\\Google\\\\' => array($vendorDir . '/socialiteproviders/google'),\n 'Psr\\\\Log\\\\' => array($vendorDir . '/psr/log/Psr/Log'),\n 'Psr\\\\Http\\\\Message\\\\' => array($vendorDir . '/psr/http-message/src'),\n 'Monolog\\\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),\n 'League\\\\OAuth1\\\\' => array($vendorDir . '/league/oauth1-client/src'),\n 'League\\\\Flysystem\\\\AwsS3v3\\\\' => array($vendorDir . '/league/flysystem-aws-s3-v3/src'),\n 'League\\\\Flysystem\\\\' => array($vendorDir . '/league/flysystem/src'),\n 'Laravel\\\\Socialite\\\\' => array($vendorDir . '/laravel/socialite/src'),\n 'Laravel\\\\Lumen\\\\' => array($vendorDir . '/laravel/lumen-framework/src'),\n 'JmesPath\\\\' => array($vendorDir . '/mtdowling/jmespath.php/src'),\n 'Illuminate\\\\View\\\\' => array($vendorDir . '/illuminate/view'),\n 'Illuminate\\\\Validation\\\\' => array($vendorDir . '/illuminate/validation'),\n 'Illuminate\\\\Translation\\\\' => array($vendorDir . '/illuminate/translation'),\n 'Illuminate\\\\Support\\\\' => array($vendorDir . '/illuminate/support'),\n 'Illuminate\\\\Session\\\\' => array($vendorDir . '/illuminate/session'),\n 'Illuminate\\\\Queue\\\\' => array($vendorDir . '/illuminate/queue'),\n 'Illuminate\\\\Pipeline\\\\' => array($vendorDir . '/illuminate/pipeline'),\n 'Illuminate\\\\Pagination\\\\' => array($vendorDir . '/illuminate/pagination'),\n 'Illuminate\\\\Mail\\\\' => array($vendorDir . '/illuminate/mail'),\n 'Illuminate\\\\Http\\\\' => array($vendorDir . '/illuminate/http'),\n 'Illuminate\\\\Hashing\\\\' => array($vendorDir . '/illuminate/hashing'),\n 'Illuminate\\\\Filesystem\\\\' => array($vendorDir . '/illuminate/filesystem'),\n 'Illuminate\\\\Events\\\\' => array($vendorDir . '/illuminate/events'),\n 'Illuminate\\\\Encryption\\\\' => array($vendorDir . '/illuminate/encryption'),\n 'Illuminate\\\\Database\\\\' => array($vendorDir . '/illuminate/database'),\n 'Illuminate\\\\Contracts\\\\' => array($vendorDir . '/illuminate/contracts'),\n 'Illuminate\\\\Container\\\\' => array($vendorDir . '/illuminate/container'),\n 'Illuminate\\\\Console\\\\' => array($vendorDir . '/illuminate/console'),\n 'Illuminate\\\\Config\\\\' => array($vendorDir . '/illuminate/config'),\n 'Illuminate\\\\Cache\\\\' => array($vendorDir . '/illuminate/cache'),\n 'Illuminate\\\\Bus\\\\' => array($vendorDir . '/illuminate/bus'),\n 'Illuminate\\\\Broadcasting\\\\' => array($vendorDir . '/illuminate/broadcasting'),\n 'Illuminate\\\\Auth\\\\' => array($vendorDir . '/illuminate/auth'),\n 'Ical\\\\' => array($vendorDir . '/calendar/icsfile/src'),\n 'Hashids\\\\' => array($vendorDir . '/hashids/hashids/src'),\n 'GuzzleHttp\\\\Psr7\\\\' => array($vendorDir . '/guzzlehttp/psr7/src'),\n 'GuzzleHttp\\\\Promise\\\\' => array($vendorDir . '/guzzlehttp/promises/src'),\n 'GuzzleHttp\\\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),\n 'FastRoute\\\\' => array($vendorDir . '/nikic/fast-route/src'),\n 'Faker\\\\' => array($vendorDir . '/fzaninotto/faker/src/Faker'),\n 'Dotenv\\\\' => array($vendorDir . '/vlucas/phpdotenv/src'),\n 'Doctrine\\\\Instantiator\\\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'),\n 'DeepCopy\\\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'),\n 'Cron\\\\' => array($vendorDir . '/mtdowling/cron-expression/src/Cron'),\n 'Collective\\\\Html\\\\' => array($vendorDir . '/vluzrmos/collective-html/src'),\n 'Carbon\\\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'),\n 'Aws\\\\' => array($vendorDir . '/aws/aws-sdk-php/src'),\n 'App\\\\' => array($baseDir . '/app'),\n);\n", "meta": {"content_hash": "86c85fdd6d0a7a0aaed7433e343d278d", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 200, "avg_line_length": 70.53333333333333, "alnum_prop": 0.6512287334593573, "repo_name": "RbnAlexs/GoogleApi", "id": "9677237eee94d1b777f4ea9f8b8b8932ca681933", "size": "5290", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/composer/autoload_psr4.php", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "553"}, {"name": "CSS", "bytes": "53806"}, {"name": "HTML", "bytes": "37402"}, {"name": "JavaScript", "bytes": "1616841"}, {"name": "PHP", "bytes": "57058"}, {"name": "Shell", "bytes": "71"}]}} +{"text": "\r\n// \r\n// This code was auto-generated by AFNOR StoredProcedureSystem, version 1.0\r\n// \r\n\r\nusing SOURCE.Data.Context;\r\nusing SOURCE.Domaine;\r\nusing SOURCE.Business.Depots;\r\nusing System.Linq;\r\n \r\nnamespace SOURCE.Data.Depots\r\n{\r\n public partial class DepotLien_Droit_ActionGenerale : Depot<Lien_Droit_ActionGenerale>, IDepotLien_Droit_ActionGenerale\r\n {\r\n /// <summary>\r\n /// Initialise une nouvelle instance du d\u00e9p\u00f4t.\r\n /// </summary>\r\n /// <param name=\"dataContext\">Contexte de la base de donn\u00e9e.</param>\r\n public DepotLien_Droit_ActionGenerale(ISourceDbContext dataContext)\r\n : base(dataContext)\r\n {\r\n }\r\n }\r\n}\r\n", "meta": {"content_hash": "cd3d63cb0b7bddaa030aa32315cff87e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 123, "avg_line_length": 28.5, "alnum_prop": 0.6491228070175439, "repo_name": "apo-j/Projects_Working", "id": "c92d9034674d34dae99fa618192f961795398b20", "size": "1052", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "S/SOURCE/SOURCE.Common/SOURCE.Data/Depots/Generated/DepotLien_Droit_ActionGenerale.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "16118"}, {"name": "Batchfile", "bytes": "1096"}, {"name": "C#", "bytes": "27262375"}, {"name": "CSS", "bytes": "8474090"}, {"name": "Groff", "bytes": "2101703"}, {"name": "HTML", "bytes": "4910101"}, {"name": "JavaScript", "bytes": "20716565"}, {"name": "PHP", "bytes": "9283"}, {"name": "XSLT", "bytes": "930531"}]}} +{"text": "var ExtensionBase = require('tau/core/extension.base');\n\nmodule.exports = ExtensionBase.extend({\n 'bus afterInit': function () {\n this.fire('dataBind');\n }\n});\n", "meta": {"content_hash": "e4a690efef4863ec56b714aa801dc34e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 55, "avg_line_length": 24.714285714285715, "alnum_prop": 0.6416184971098265, "repo_name": "TargetProcess/tau-tools", "id": "bbe1aea892131e3fdb0ca9fd80a6569bbef92766", "size": "173", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/create/template/component/default/{=instanceName}/extensions/{=instanceName}.extension.js", "mode": "33188", "license": "mit", "language": [{"name": "HTML", "bytes": "63"}, {"name": "JavaScript", "bytes": "16835"}]}} +{"text": "from __future__ import unicode_literals\n\nimport frappe\nfrom frappe import _\nimport frappe.permissions\nimport re, csv, os\nfrom frappe.utils.csvutils import UnicodeWriter\nfrom frappe.utils import cstr, formatdate, format_datetime, parse_json, cint, format_duration\nfrom frappe.core.doctype.data_import_legacy.importer import get_data_keys\nfrom six import string_types\nfrom frappe.core.doctype.access_log.access_log import make_access_log\n\nreflags = {\n\t\"I\":re.I,\n\t\"L\":re.L,\n\t\"M\":re.M,\n\t\"U\":re.U,\n\t\"S\":re.S,\n\t\"X\":re.X,\n\t\"D\": re.DEBUG\n}\n\n@frappe.whitelist()\ndef export_data(doctype=None, parent_doctype=None, all_doctypes=True, with_data=False,\n\t\tselect_columns=None, file_type='CSV', template=False, filters=None):\n\t_doctype = doctype\n\tif isinstance(_doctype, list):\n\t\t_doctype = _doctype[0]\n\tmake_access_log(doctype=_doctype, file_type=file_type, columns=select_columns, filters=filters, method=parent_doctype)\n\texporter = DataExporter(doctype=doctype, parent_doctype=parent_doctype, all_doctypes=all_doctypes, with_data=with_data,\n\t\tselect_columns=select_columns, file_type=file_type, template=template, filters=filters)\n\texporter.build_response()\n\nclass DataExporter:\n\tdef __init__(self, doctype=None, parent_doctype=None, all_doctypes=True, with_data=False,\n\t\tselect_columns=None, file_type='CSV', template=False, filters=None):\n\t\tself.doctype = doctype\n\t\tself.parent_doctype = parent_doctype\n\t\tself.all_doctypes = all_doctypes\n\t\tself.with_data = cint(with_data)\n\t\tself.select_columns = select_columns\n\t\tself.file_type = file_type\n\t\tself.template = template\n\t\tself.filters = filters\n\t\tself.data_keys = get_data_keys()\n\n\t\tself.prepare_args()\n\n\tdef prepare_args(self):\n\t\tif self.select_columns:\n\t\t\tself.select_columns = parse_json(self.select_columns)\n\t\tif self.filters:\n\t\t\tself.filters = parse_json(self.filters)\n\n\t\tself.docs_to_export = {}\n\t\tif self.doctype:\n\t\t\tif isinstance(self.doctype, string_types):\n\t\t\t\tself.doctype = [self.doctype]\n\n\t\t\tif len(self.doctype) > 1:\n\t\t\t\tself.docs_to_export = self.doctype[1]\n\t\t\tself.doctype = self.doctype[0]\n\n\t\tif not self.parent_doctype:\n\t\t\tself.parent_doctype = self.doctype\n\n\t\tself.column_start_end = {}\n\n\t\tif self.all_doctypes:\n\t\t\tself.child_doctypes = []\n\t\t\tfor df in frappe.get_meta(self.doctype).get_table_fields():\n\t\t\t\tself.child_doctypes.append(dict(doctype=df.options, parentfield=df.fieldname))\n\n\tdef build_response(self):\n\t\tself.writer = UnicodeWriter()\n\t\tself.name_field = 'parent' if self.parent_doctype != self.doctype else 'name'\n\n\t\tif self.template:\n\t\t\tself.add_main_header()\n\n\t\tself.writer.writerow([''])\n\t\tself.tablerow = [self.data_keys.doctype]\n\t\tself.labelrow = [_(\"Column Labels:\")]\n\t\tself.fieldrow = [self.data_keys.columns]\n\t\tself.mandatoryrow = [_(\"Mandatory:\")]\n\t\tself.typerow = [_('Type:')]\n\t\tself.inforow = [_('Info:')]\n\t\tself.columns = []\n\n\t\tself.build_field_columns(self.doctype)\n\n\t\tif self.all_doctypes:\n\t\t\tfor d in self.child_doctypes:\n\t\t\t\tself.append_empty_field_column()\n\t\t\t\tif (self.select_columns and self.select_columns.get(d['doctype'], None)) or not self.select_columns:\n\t\t\t\t\t# if atleast one column is selected for this doctype\n\t\t\t\t\tself.build_field_columns(d['doctype'], d['parentfield'])\n\n\t\tself.add_field_headings()\n\t\tself.add_data()\n\t\tif self.with_data and not self.data:\n\t\t\tfrappe.respond_as_web_page(_('No Data'), _('There is no data to be exported'), indicator_color='orange')\n\n\t\tif self.file_type == 'Excel':\n\t\t\tself.build_response_as_excel()\n\t\telse:\n\t\t\t# write out response as a type csv\n\t\t\tfrappe.response['result'] = cstr(self.writer.getvalue())\n\t\t\tfrappe.response['type'] = 'csv'\n\t\t\tfrappe.response['doctype'] = self.doctype\n\n\tdef add_main_header(self):\n\t\tself.writer.writerow([_('Data Import Template')])\n\t\tself.writer.writerow([self.data_keys.main_table, self.doctype])\n\n\t\tif self.parent_doctype != self.doctype:\n\t\t\tself.writer.writerow([self.data_keys.parent_table, self.parent_doctype])\n\t\telse:\n\t\t\tself.writer.writerow([''])\n\n\t\tself.writer.writerow([''])\n\t\tself.writer.writerow([_('Notes:')])\n\t\tself.writer.writerow([_('Please do not change the template headings.')])\n\t\tself.writer.writerow([_('First data column must be blank.')])\n\t\tself.writer.writerow([_('If you are uploading new records, leave the \"name\" (ID) column blank.')])\n\t\tself.writer.writerow([_('If you are uploading new records, \"Naming Series\" becomes mandatory, if present.')])\n\t\tself.writer.writerow([_('Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.')])\n\t\tself.writer.writerow([_('For updating, you can update only selective columns.')])\n\t\tself.writer.writerow([_('You can only upload upto 5000 records in one go. (may be less in some cases)')])\n\t\tif self.name_field == \"parent\":\n\t\t\tself.writer.writerow([_('\"Parent\" signifies the parent table in which this row must be added')])\n\t\t\tself.writer.writerow([_('If you are updating, please select \"Overwrite\" else existing rows will not be deleted.')])\n\n\tdef build_field_columns(self, dt, parentfield=None):\n\t\tmeta = frappe.get_meta(dt)\n\n\t\t# build list of valid docfields\n\t\ttablecolumns = []\n\t\ttable_name = 'tab' + dt\n\t\tfor f in frappe.db.get_table_columns_description(table_name):\n\t\t\tfield = meta.get_field(f.name)\n\t\t\tif field and ((self.select_columns and f.name in self.select_columns[dt]) or not self.select_columns):\n\t\t\t\ttablecolumns.append(field)\n\n\t\ttablecolumns.sort(key = lambda a: int(a.idx))\n\n\t\t_column_start_end = frappe._dict(start=0)\n\n\t\tif dt==self.doctype:\n\t\t\tif (meta.get('autoname') and meta.get('autoname').lower()=='prompt') or (self.with_data):\n\t\t\t\tself._append_name_column()\n\n\t\t\t# if importing only child table for new record, add parent field\n\t\t\tif meta.get('istable') and not self.with_data:\n\t\t\t\tself.append_field_column(frappe._dict({\n\t\t\t\t\t\"fieldname\": \"parent\",\n\t\t\t\t\t\"parent\": \"\",\n\t\t\t\t\t\"label\": \"Parent\",\n\t\t\t\t\t\"fieldtype\": \"Data\",\n\t\t\t\t\t\"reqd\": 1,\n\t\t\t\t\t\"info\": _(\"Parent is the name of the document to which the data will get added to.\")\n\t\t\t\t}), True)\n\n\t\t\t_column_start_end = frappe._dict(start=0)\n\t\telse:\n\t\t\t_column_start_end = frappe._dict(start=len(self.columns))\n\n\t\t\tif self.with_data:\n\t\t\t\tself._append_name_column(dt)\n\n\t\tfor docfield in tablecolumns:\n\t\t\tself.append_field_column(docfield, True)\n\n\t\t# all non mandatory fields\n\t\tfor docfield in tablecolumns:\n\t\t\tself.append_field_column(docfield, False)\n\n\t\t# if there is one column, add a blank column (?)\n\t\tif len(self.columns)-_column_start_end.start == 1:\n\t\t\tself.append_empty_field_column()\n\n\t\t# append DocType name\n\t\tself.tablerow[_column_start_end.start + 1] = dt\n\n\t\tif parentfield:\n\t\t\tself.tablerow[_column_start_end.start + 2] = parentfield\n\n\t\t_column_start_end.end = len(self.columns) + 1\n\n\t\tself.column_start_end[(dt, parentfield)] = _column_start_end\n\n\tdef append_field_column(self, docfield, for_mandatory):\n\t\tif not docfield:\n\t\t\treturn\n\t\tif for_mandatory and not docfield.reqd:\n\t\t\treturn\n\t\tif not for_mandatory and docfield.reqd:\n\t\t\treturn\n\t\tif docfield.fieldname in ('parenttype', 'trash_reason'):\n\t\t\treturn\n\t\tif docfield.hidden:\n\t\t\treturn\n\t\tif self.select_columns and docfield.fieldname not in self.select_columns.get(docfield.parent, []) \\\n\t\t\tand docfield.fieldname!=\"name\":\n\t\t\treturn\n\n\t\tself.tablerow.append(\"\")\n\t\tself.fieldrow.append(docfield.fieldname)\n\t\tself.labelrow.append(_(docfield.label))\n\t\tself.mandatoryrow.append(docfield.reqd and 'Yes' or 'No')\n\t\tself.typerow.append(docfield.fieldtype)\n\t\tself.inforow.append(self.getinforow(docfield))\n\t\tself.columns.append(docfield.fieldname)\n\n\tdef append_empty_field_column(self):\n\t\tself.tablerow.append(\"~\")\n\t\tself.fieldrow.append(\"~\")\n\t\tself.labelrow.append(\"\")\n\t\tself.mandatoryrow.append(\"\")\n\t\tself.typerow.append(\"\")\n\t\tself.inforow.append(\"\")\n\t\tself.columns.append(\"\")\n\n\t@staticmethod\n\tdef getinforow(docfield):\n\t\t\"\"\"make info comment for options, links etc.\"\"\"\n\t\tif docfield.fieldtype == 'Select':\n\t\t\tif not docfield.options:\n\t\t\t\treturn ''\n\t\t\telse:\n\t\t\t\treturn _(\"One of\") + ': %s' % ', '.join(filter(None, docfield.options.split('\\n')))\n\t\telif docfield.fieldtype == 'Link':\n\t\t\treturn 'Valid %s' % docfield.options\n\t\telif docfield.fieldtype == 'Int':\n\t\t\treturn 'Integer'\n\t\telif docfield.fieldtype == \"Check\":\n\t\t\treturn \"0 or 1\"\n\t\telif docfield.fieldtype in [\"Date\", \"Datetime\"]:\n\t\t\treturn cstr(frappe.defaults.get_defaults().date_format)\n\t\telif hasattr(docfield, \"info\"):\n\t\t\treturn docfield.info\n\t\telse:\n\t\t\treturn ''\n\n\tdef add_field_headings(self):\n\t\tself.writer.writerow(self.tablerow)\n\t\tself.writer.writerow(self.labelrow)\n\t\tself.writer.writerow(self.fieldrow)\n\t\tself.writer.writerow(self.mandatoryrow)\n\t\tself.writer.writerow(self.typerow)\n\t\tself.writer.writerow(self.inforow)\n\t\tif self.template:\n\t\t\tself.writer.writerow([self.data_keys.data_separator])\n\n\tdef add_data(self):\n\t\tif self.template and not self.with_data:\n\t\t\treturn\n\n\t\tfrappe.permissions.can_export(self.parent_doctype, raise_exception=True)\n\n\t\t# sort nested set doctypes by `lft asc`\n\t\torder_by = None\n\t\ttable_columns = frappe.db.get_table_columns(self.parent_doctype)\n\t\tif 'lft' in table_columns and 'rgt' in table_columns:\n\t\t\torder_by = '`tab{doctype}`.`lft` asc'.format(doctype=self.parent_doctype)\n\t\t# get permitted data only\n\t\tself.data = frappe.get_list(self.doctype, fields=[\"*\"], filters=self.filters, limit_page_length=None, order_by=order_by)\n\n\t\tfor doc in self.data:\n\t\t\top = self.docs_to_export.get(\"op\")\n\t\t\tnames = self.docs_to_export.get(\"name\")\n\n\t\t\tif names and op:\n\t\t\t\tif op == '=' and doc.name not in names:\n\t\t\t\t\tcontinue\n\t\t\t\telif op == '!=' and doc.name in names:\n\t\t\t\t\tcontinue\n\t\t\telif names:\n\t\t\t\ttry:\n\t\t\t\t\tsflags = self.docs_to_export.get(\"flags\", \"I,U\").upper()\n\t\t\t\t\tflags = 0\n\t\t\t\t\tfor a in re.split('\\W+',sflags):\n\t\t\t\t\t\tflags = flags | reflags.get(a,0)\n\n\t\t\t\t\tc = re.compile(names, flags)\n\t\t\t\t\tm = c.match(doc.name)\n\t\t\t\t\tif not m:\n\t\t\t\t\t\tcontinue\n\t\t\t\texcept Exception:\n\t\t\t\t\tif doc.name not in names:\n\t\t\t\t\t\tcontinue\n\t\t\t# add main table\n\t\t\trows = []\n\n\t\t\tself.add_data_row(rows, self.doctype, None, doc, 0)\n\n\t\t\tif self.all_doctypes:\n\t\t\t\t# add child tables\n\t\t\t\tfor c in self.child_doctypes:\n\t\t\t\t\tfor ci, child in enumerate(frappe.db.sql(\"\"\"select * from `tab{0}`\n\t\t\t\t\t\twhere parent=%s and parentfield=%s order by idx\"\"\".format(c['doctype']),\n\t\t\t\t\t\t(doc.name, c['parentfield']), as_dict=1)):\n\t\t\t\t\t\tself.add_data_row(rows, c['doctype'], c['parentfield'], child, ci)\n\n\t\t\tfor row in rows:\n\t\t\t\tself.writer.writerow(row)\n\n\tdef add_data_row(self, rows, dt, parentfield, doc, rowidx):\n\t\td = doc.copy()\n\t\tmeta = frappe.get_meta(dt)\n\t\tif self.all_doctypes:\n\t\t\td.name = '\"'+ d.name+'\"'\n\n\t\tif len(rows) < rowidx + 1:\n\t\t\trows.append([\"\"] * (len(self.columns) + 1))\n\t\trow = rows[rowidx]\n\n\t\t_column_start_end = self.column_start_end.get((dt, parentfield))\n\n\t\tif _column_start_end:\n\t\t\tfor i, c in enumerate(self.columns[_column_start_end.start:_column_start_end.end]):\n\t\t\t\tdf = meta.get_field(c)\n\t\t\t\tfieldtype = df.fieldtype if df else \"Data\"\n\t\t\t\tvalue = d.get(c, \"\")\n\t\t\t\tif value:\n\t\t\t\t\tif fieldtype == \"Date\":\n\t\t\t\t\t\tvalue = formatdate(value)\n\t\t\t\t\telif fieldtype == \"Datetime\":\n\t\t\t\t\t\tvalue = format_datetime(value)\n\t\t\t\t\telif fieldtype == \"Duration\":\n\t\t\t\t\t\tvalue = format_duration(value, df.hide_days)\n\n\t\t\t\trow[_column_start_end.start + i + 1] = value\n\n\tdef build_response_as_excel(self):\n\t\tfilename = frappe.generate_hash(\"\", 10)\n\t\twith open(filename, 'wb') as f:\n\t\t\tf.write(cstr(self.writer.getvalue()).encode('utf-8'))\n\t\tf = open(filename)\n\t\treader = csv.reader(f)\n\n\t\tfrom frappe.utils.xlsxutils import make_xlsx\n\t\txlsx_file = make_xlsx(reader, \"Data Import Template\" if self.template else 'Data Export')\n\n\t\tf.close()\n\t\tos.remove(filename)\n\n\t\t# write out response as a xlsx type\n\t\tfrappe.response['filename'] = self.doctype + '.xlsx'\n\t\tfrappe.response['filecontent'] = xlsx_file.getvalue()\n\t\tfrappe.response['type'] = 'binary'\n\n\tdef _append_name_column(self, dt=None):\n\t\tself.append_field_column(frappe._dict({\n\t\t\t\"fieldname\": \"name\" if dt else self.name_field,\n\t\t\t\"parent\": dt or \"\",\n\t\t\t\"label\": \"ID\",\n\t\t\t\"fieldtype\": \"Data\",\n\t\t\t\"reqd\": 1,\n\t\t}), True)\n", "meta": {"content_hash": "1746a91e839d8be6f64d11ab63409e01", "timestamp": "", "source": "github", "line_count": 360, "max_line_length": 133, "avg_line_length": 33.13611111111111, "alnum_prop": 0.685807695531897, "repo_name": "adityahase/frappe", "id": "bec8cde7eaec888ea6aad4189f31fdd65eedc361", "size": "12030", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "frappe/core/doctype/data_export/exporter.py", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "288806"}, {"name": "HTML", "bytes": "209164"}, {"name": "JavaScript", "bytes": "2350450"}, {"name": "Less", "bytes": "160693"}, {"name": "Makefile", "bytes": "99"}, {"name": "Python", "bytes": "3035663"}, {"name": "SCSS", "bytes": "45340"}, {"name": "Shell", "bytes": "517"}, {"name": "Vue", "bytes": "73943"}]}} +{"text": "\n#include \"stdafx.h\"\n\n\nint _tmain(int argc, _TCHAR* argv[])\n{\n\tprintf(\"nf1_init.exe [command] [setting]\\r\\n\");\n\tprintf(\"Commands:\\r\\n\");\n\tprintf(\"test [device serial number] - runs bitfury tests to that device\\r\\n\");\n\tprintf(\"fixID [ignored] - Tests for NanoFury devices and fixes Product String\\r\\n\\r\\n\");\n\n\tswitch(argc){\n\t\tcase 2:\n\t\t\tif (wcscmp(argv[1],L\"fixID\")==0){\n\t\t\t\tprintf(\"fixID mode specified.\\r\\n\\r\\n\");\n\t\t\t\tspi_init(NULL, L\"NanoFury NF1 v0.6\");\n\t\t\t\tprintf(\"\\r\\nfixID mode completed. Please run command again to read new values.\\r\\n\\r\\n\");\n\t\t\t}\n\t\tcase 3:\n\t\t\tif (wcscmp(argv[1],L\"test\")==0){\n\t\t\t\tprintf(\"test mode specified for device %s.\\r\\n\\r\\n\", argv[2]);\n\t\t\t\tif (spi_init(argv[2], NULL)){\n\t\t\t\t\tprintf(\"DEVICE FOUND! Proceeding with testing... Press ESC to cancel testing at any time\\r\\n\\r\\n\", argv[3]);\n\t\t\t\t\tspitest_main(osc50);\n\t\t\t\t\tnanofury_device_off(hndNanoFury);\n\t\t\t\t\tReleaseMCP2210(hndNanoFury);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tprintf(\"Device not found. No tests have been performed.\\r\\n\\r\\n\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\tcase 4:\n\t\t\tif (wcscmp(argv[1],L\"test\")==0){\n\t\t\t\tint n = _wtoi(argv[3]);\n\t\t\t\tif ((n<48)||(n>56)) n=48;\n\t\t\t\tprintf(\"test mode specified for device %s with %u bit speed.\\r\\n\\r\\n\", argv[2], n);\n\t\t\t\tif (spi_init(argv[2], NULL)){\n\t\t\t\t\tprintf(\"DEVICE FOUND! Proceeding with testing... Press ESC to cancel testing at any time\\r\\n\\r\\n\", argv[3]);\n\t\t\t\t\tswitch (n){\n\t\t\t\t\t\tcase 49: spitest_main(osc49); break;\n\t\t\t\t\t\tcase 50: spitest_main(osc50); break;\n\t\t\t\t\t\tcase 51: spitest_main(osc51); break;\n\t\t\t\t\t\tcase 52: spitest_main(osc52); break;\n\t\t\t\t\t\tcase 53: spitest_main(osc53); break;\n\t\t\t\t\t\tcase 54: spitest_main(osc54); break;\n\t\t\t\t\t\tcase 55: spitest_main(osc55); break;\n\t\t\t\t\t\tcase 56: spitest_main(osc56); break;\n\t\t\t\t\t\tdefault: spitest_main(osc48); break;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\tnanofury_device_off(hndNanoFury);\n\t\t\t\t\tReleaseMCP2210(hndNanoFury);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tprintf(\"Device not found. No tests have been performed.\\r\\n\\r\\n\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tbreak;\n\tdefault: spi_init(NULL, NULL);\n\t}\n\n\t//spi_init(true, L\"NanoFury NF1 v0.6\");\n\t//spi_init(true, NULL);\n\n\tprintf(\"Press [ENTER] to exit...\");\n\tgetchar();\n\n\treturn 0;\n}\n\n", "meta": {"content_hash": "541e1b9c8ee64ad8ca87b12029050c07", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 113, "avg_line_length": 30.0, "alnum_prop": 0.6150234741784038, "repo_name": "nanofury/NanoFury_Init", "id": "01759d9f1f91bfde17f3493f8a87c34cac33f385", "size": "3333", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "nf1_init/nf1_init.cpp", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "328134"}, {"name": "C++", "bytes": "39677"}, {"name": "Objective-C", "bytes": "1948"}, {"name": "Shell", "bytes": "69"}]}} +{"text": "\ufeff//Copyright (C) Microsoft Corporation. All rights reserved.\n\n// explicit1.cs\ninterface IDimensions \n{\n float Length();\n float Width();\n}\n\nclass Box : IDimensions \n{\n float lengthInches;\n float widthInches;\n\n public Box(float length, float width) \n {\n lengthInches = length;\n widthInches = width;\n }\n // Explicit interface member implementation: \n float IDimensions.Length() \n {\n return lengthInches;\n }\n // Explicit interface member implementation:\n float IDimensions.Width() \n {\n return widthInches; \n }\n\n public static void Main() \n {\n // Declare a class instance \"myBox\":\n Box myBox = new Box(30.0f, 20.0f);\n // Declare an interface instance \"myDimensions\":\n IDimensions myDimensions = (IDimensions) myBox;\n // Print out the dimensions of the box:\n /* The following commented lines would produce compilation \n errors because they try to access an explicitly implemented\n interface member from a class instance: */\n //System.Console.WriteLine(\"Length: {0}\", myBox.Length());\n //System.Console.WriteLine(\"Width: {0}\", myBox.Width());\n /* Print out the dimensions of the box by calling the methods \n from an instance of the interface: */\n System.Console.WriteLine(\"Length: {0}\", myDimensions.Length());\n System.Console.WriteLine(\"Width: {0}\", myDimensions.Width());\n }\n}\n\n", "meta": {"content_hash": "d7d0dcd34b473b161081036126adfe61", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 70, "avg_line_length": 29.714285714285715, "alnum_prop": 0.6318681318681318, "repo_name": "SiddharthMishraPersonal/StudyMaterials", "id": "6d88b805a3e4f9e47db7bf0d829772051e7882ca", "size": "1458", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Linq/CSharpSamples/LanguageSamples/ExplicitInterface/ExplicitInterface1/explicit1.cs", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "1"}, {"name": "C#", "bytes": "1963252"}, {"name": "C++", "bytes": "7401"}, {"name": "CSS", "bytes": "31609"}, {"name": "Java", "bytes": "14635"}, {"name": "Objective-C", "bytes": "368454"}]}} +{"text": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"pt\">\n<head>\n<!-- Generated by javadoc (version 1.7.0_79) on Mon Jun 22 15:50:37 BRT 2015 -->\n<title>Uses of Class net.floodlightcontroller.packet.BPDU</title>\n<meta name=\"date\" content=\"2015-06-22\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"Uses of Class net.floodlightcontroller.packet.BPDU\";\n }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!-- -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"../package-summary.html\">Package</a></li>\n<li><a href=\"../../../../net/floodlightcontroller/packet/BPDU.html\" title=\"class in net.floodlightcontroller.packet\">Class</a></li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../index-files/index-1.html\">Index</a></li>\n<li><a href=\"../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../index.html?net/floodlightcontroller/packet/class-use/BPDU.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"BPDU.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h2 title=\"Uses of Class net.floodlightcontroller.packet.BPDU\" class=\"title\">Uses of Class<br>net.floodlightcontroller.packet.BPDU</h2>\n</div>\n<div class=\"classUseContainer\">No usage of net.floodlightcontroller.packet.BPDU</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!-- -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"../package-summary.html\">Package</a></li>\n<li><a href=\"../../../../net/floodlightcontroller/packet/BPDU.html\" title=\"class in net.floodlightcontroller.packet\">Class</a></li>\n<li class=\"navBarCell1Rev\">Use</li>\n<li><a href=\"../package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../index-files/index-1.html\">Index</a></li>\n<li><a href=\"../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../index.html?net/floodlightcontroller/packet/class-use/BPDU.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"BPDU.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!-- -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n", "meta": {"content_hash": "0b51d7c574d8f01bd992795bd4bcaeb3", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 135, "avg_line_length": 35.61739130434783, "alnum_prop": 0.62109375, "repo_name": "paulorvj/sdnvoip", "id": "c7c40b4705e20d93d66ae5785c646971dc9ad125", "size": "4096", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/net/floodlightcontroller/packet/class-use/BPDU.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "181"}, {"name": "HTML", "bytes": "10186"}, {"name": "Java", "bytes": "3772566"}, {"name": "JavaScript", "bytes": "55112"}, {"name": "Makefile", "bytes": "426"}, {"name": "Python", "bytes": "32743"}, {"name": "Shell", "bytes": "5610"}, {"name": "Thrift", "bytes": "7114"}]}} +{"text": "asp-classic-cms\n===============\n\nASP classic and SQL based Content Management System\n\nI first built this CMS in 2007 for a client. I have since moved to Wordpress for the CMS now, so I'm making this CMS available free to use. If you have questions, Google my name and get in touch.\n", "meta": {"content_hash": "38d92e395e394112e899084b110933e2", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 195, "avg_line_length": 47.0, "alnum_prop": 0.7340425531914894, "repo_name": "mayurjobanputra/asp-classic-cms", "id": "13a9a15be5ab33805b2c9e5050ab7428febdb417", "size": "282", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "25368"}, {"name": "JavaScript", "bytes": "8397"}]}} +{"text": "\"\"\"Main command line interface for fm_server.\"\"\"\n", "meta": {"content_hash": "5f2727069f7bfbcff6521c54fec062ab", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 48, "avg_line_length": 49.0, "alnum_prop": 0.7142857142857143, "repo_name": "nstoik/farm_monitor", "id": "0f0d5a4d526083d45dd8c1e91cca2b0988a38cbd", "size": "49", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "server/fm_server/cli/__init__.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Dockerfile", "bytes": "18259"}, {"name": "HCL", "bytes": "1534"}, {"name": "HTML", "bytes": "611"}, {"name": "JavaScript", "bytes": "268"}, {"name": "Mako", "bytes": "494"}, {"name": "Python", "bytes": "242717"}, {"name": "Shell", "bytes": "2937"}, {"name": "TypeScript", "bytes": "18970"}, {"name": "Vue", "bytes": "14394"}]}} +{"text": "yii2-widget-sidenav\n===================\n\n[](https://packagist.org/packages/kartik-v/yii2-widget-sidenav)\n[](https://packagist.org/packages/kartik-v/yii2-widget-sidenav)\n[](https://packagist.org/packages/kartik-v/yii2-widget-sidenav)\n[](https://packagist.org/packages/kartik-v/yii2-widget-sidenav)\n[](https://packagist.org/packages/kartik-v/yii2-widget-sidenav)\n\nThis widget is a collapsible side navigation menu built to seamlessly work with Bootstrap framework. It is built over Bootstrap [stacked nav](http://getbootstrap.com/components/#nav-pills) component. This widget class extends the [Yii Menu widget](https://github.com/yiisoft/yii2/blob/master/framework/widgets/Menu.php). Upto 3 levels of submenus are by default supported by the CSS styles to balance performance and useability. You can choose to extend it to more or less levels by customizing the [CSS](https://github.com/kartik-v/yii2-widgets/blob/master/assets/css/sidenav.css). \n\n> NOTE: This extension is a sub repo split of [yii2-widgets](https://github.com/kartik-v/yii2-widgets). The split has been done since 08-Nov-2014 to allow developers to install this specific widget in isolation if needed. One can also use the extension the previous way with the whole suite of [yii2-widgets](http://demos.krajee.com/widgets).\n\n## Installation\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/kartik-v/yii2-widget-sidenav/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.\n\nTo install, either run\n\n```\n$ php composer.phar require kartik-v/yii2-widget-sidenav \"*\"\n```\n\nor add\n\n```\n\"kartik-v/yii2-widget-sidenav\": \"*\"\n```\n\nto the ```require``` section of your `composer.json` file.\n\n## Latest Release\n\n> NOTE: The latest version of the module is v1.0.0 released on 08-Nov-2014. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-sidenav/blob/master/CHANGE.md) for details.\n\n## Demo\n\nYou can refer detailed [documentation and demos](http://demos.krajee.com/widget-details/sidenav) on usage of the extension.\n\n## Usage\n\n```php\nuse kartik\\sidenav\\SideNav;\n \necho SideNav::widget([\n\t'type' => SideNav::TYPE_DEFAULT,\n\t'heading' => 'Options',\n\t'items' => [\n\t\t[\n\t\t\t'url' => '#',\n\t\t\t'label' => 'Home',\n\t\t\t'icon' => 'home'\n\t\t],\n\t\t[\n\t\t\t'label' => 'Help',\n\t\t\t'icon' => 'question-sign',\n\t\t\t'items' => [\n\t\t\t\t['label' => 'About', 'icon'=>'info-sign', 'url'=>'#'],\n\t\t\t\t['label' => 'Contact', 'icon'=>'phone', 'url'=>'#'],\n\t\t\t],\n\t\t],\n\t],\n]);\n```\n\n## License\n\n**yii2-widget-sidenav** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details.", "meta": {"content_hash": "3a720d40cebac6054a3def0f59281f29", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 583, "avg_line_length": 47.911764705882355, "alnum_prop": 0.7228360957642725, "repo_name": "aaesis/brdsdev", "id": "cfe4698dcdb793d908ac9c82a97ffcf3e21d2f6e", "size": "3258", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "vendor/kartik-v/yii2-widget-sidenav/README.md", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ApacheConf", "bytes": "112"}, {"name": "Batchfile", "bytes": "1041"}, {"name": "CSS", "bytes": "48678"}, {"name": "JavaScript", "bytes": "55220"}, {"name": "PHP", "bytes": "447086"}]}} +{"text": "struct WebApplicationInfo;\n\nnamespace content {\nstruct LoadCommittedDetails;\n}\n\nnamespace extensions {\nclass Extension;\nclass LocationBarController;\nclass ScriptBadgeController;\nclass ScriptBubbleController;\n\n// Per-tab extension helper. Also handles non-extension apps.\nclass TabHelper : public content::WebContentsObserver,\n public ExtensionFunctionDispatcher::Delegate,\n public ImageLoadingTracker::Observer,\n public AppNotifyChannelSetup::Delegate,\n public base::SupportsWeakPtr<TabHelper>,\n public content::NotificationObserver,\n public content::WebContentsUserData<TabHelper> {\n public:\n // Different types of action when web app info is available.\n // OnDidGetApplicationInfo uses this to dispatch calls.\n enum WebAppAction {\n NONE, // No action at all.\n CREATE_SHORTCUT, // Bring up create application shortcut dialog.\n UPDATE_SHORTCUT // Update icon for app shortcut.\n };\n\n // Observer base class for classes listening for content script messages\n // from the renderer.\n class ContentScriptObserver {\n public:\n // Map of extensions IDs to the executing script paths.\n typedef std::map<std::string, std::set<std::string> > ExecutingScriptsMap;\n\n // Automatically observes and unobserves |tab_helper| on construction\n // and destruction. |tab_helper| must outlive |this|.\n explicit ContentScriptObserver(TabHelper* tab_helper);\n ContentScriptObserver();\n\n virtual void OnContentScriptsExecuting(\n const content::WebContents* web_contents,\n const ExecutingScriptsMap& executing_scripts_map,\n int32 on_page_id,\n const GURL& on_url) = 0;\n\n protected:\n virtual ~ContentScriptObserver();\n\n TabHelper* tab_helper_;\n };\n\n virtual ~TabHelper();\n\n void AddContentScriptObserver(ContentScriptObserver* observer) {\n content_script_observers_.AddObserver(observer);\n }\n\n void RemoveContentScriptObserver(ContentScriptObserver* observer) {\n content_script_observers_.RemoveObserver(observer);\n }\n\n void CreateApplicationShortcuts();\n bool CanCreateApplicationShortcuts() const;\n\n void set_pending_web_app_action(WebAppAction action) {\n pending_web_app_action_ = action;\n }\n\n // App extensions ------------------------------------------------------------\n\n // Sets the extension denoting this as an app. If |extension| is non-null this\n // tab becomes an app-tab. WebContents does not listen for unload events for\n // the extension. It's up to consumers of WebContents to do that.\n //\n // NOTE: this should only be manipulated before the tab is added to a browser.\n // TODO(sky): resolve if this is the right way to identify an app tab. If it\n // is, than this should be passed in the constructor.\n void SetExtensionApp(const Extension* extension);\n\n // Convenience for setting the app extension by id. This does nothing if\n // |extension_app_id| is empty, or an extension can't be found given the\n // specified id.\n void SetExtensionAppById(const std::string& extension_app_id);\n\n // Set just the app icon, used by panels created by an extension.\n void SetExtensionAppIconById(const std::string& extension_app_id);\n\n const Extension* extension_app() const { return extension_app_; }\n bool is_app() const { return extension_app_ != NULL; }\n const WebApplicationInfo& web_app_info() const {\n return web_app_info_;\n }\n\n // If an app extension has been explicitly set for this WebContents its icon\n // is returned.\n //\n // NOTE: the returned icon is larger than 16x16 (its size is\n // Extension::EXTENSION_ICON_SMALLISH).\n SkBitmap* GetExtensionAppIcon();\n\n content::WebContents* web_contents() const {\n return content::WebContentsObserver::web_contents();\n }\n\n ScriptExecutor* script_executor() {\n return &script_executor_;\n }\n\n LocationBarController* location_bar_controller() {\n return location_bar_controller_.get();\n }\n\n ActiveTabPermissionGranter* active_tab_permission_granter() {\n return active_tab_permission_granter_.get();\n }\n\n ScriptBubbleController* script_bubble_controller() {\n return script_bubble_controller_.get();\n }\n\n // Sets a non-extension app icon associated with WebContents and fires an\n // INVALIDATE_TYPE_TITLE navigation state change to trigger repaint of title.\n void SetAppIcon(const SkBitmap& app_icon);\n\n private:\n explicit TabHelper(content::WebContents* web_contents);\n friend class content::WebContentsUserData<TabHelper>;\n\n // content::WebContentsObserver overrides.\n virtual void RenderViewCreated(\n content::RenderViewHost* render_view_host) OVERRIDE;\n virtual void DidNavigateMainFrame(\n const content::LoadCommittedDetails& details,\n const content::FrameNavigateParams& params) OVERRIDE;\n virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;\n virtual void DidCloneToNewWebContents(\n content::WebContents* old_web_contents,\n content::WebContents* new_web_contents) OVERRIDE;\n\n // ExtensionFunctionDispatcher::Delegate overrides.\n virtual extensions::WindowController* GetExtensionWindowController()\n const OVERRIDE;\n virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE;\n\n // Message handlers.\n void OnDidGetApplicationInfo(int32 page_id, const WebApplicationInfo& info);\n void OnInstallApplication(const WebApplicationInfo& info);\n void OnInlineWebstoreInstall(int install_id,\n int return_route_id,\n const std::string& webstore_item_id,\n const GURL& requestor_url);\n void OnGetAppNotifyChannel(const GURL& requestor_url,\n const std::string& client_id,\n int return_route_id,\n int callback_id);\n void OnGetAppInstallState(const GURL& requestor_url,\n int return_route_id,\n int callback_id);\n void OnRequest(const ExtensionHostMsg_Request_Params& params);\n void OnContentScriptsExecuting(\n const ContentScriptObserver::ExecutingScriptsMap& extension_ids,\n int32 page_id,\n const GURL& on_url);\n\n // App extensions related methods:\n\n // Resets app_icon_ and if |extension| is non-null creates a new\n // ImageLoadingTracker to load the extension's image.\n void UpdateExtensionAppIcon(const Extension* extension);\n\n const Extension* GetExtension(\n const std::string& extension_app_id);\n\n // ImageLoadingTracker::Observer.\n virtual void OnImageLoaded(const gfx::Image& image,\n const std::string& extension_id,\n int index) OVERRIDE;\n\n // WebstoreStandaloneInstaller::Callback.\n virtual void OnInlineInstallComplete(int install_id,\n int return_route_id,\n bool success,\n const std::string& error);\n\n // AppNotifyChannelSetup::Delegate.\n virtual void AppNotifyChannelSetupComplete(\n const std::string& channel_id,\n const std::string& error,\n const AppNotifyChannelSetup* setup) OVERRIDE;\n\n // content::NotificationObserver.\n virtual void Observe(int type,\n const content::NotificationSource& source,\n const content::NotificationDetails& details) OVERRIDE;\n\n // Requests application info for the specified page. This is an asynchronous\n // request. The delegate is notified by way of OnDidGetApplicationInfo when\n // the data is available.\n void GetApplicationInfo(int32 page_id);\n\n // Data for app extensions ---------------------------------------------------\n\n // Our content script observers. Declare at top so that it will outlive all\n // other members, since they might add themselves as observers.\n ObserverList<ContentScriptObserver> content_script_observers_;\n\n // If non-null this tab is an app tab and this is the extension the tab was\n // created for.\n const Extension* extension_app_;\n\n // Icon for extension_app_ (if non-null) or a manually-set icon for\n // non-extension apps.\n SkBitmap extension_app_icon_;\n\n // Process any extension messages coming from the tab.\n ExtensionFunctionDispatcher extension_function_dispatcher_;\n\n // Used for loading extension_app_icon_.\n scoped_ptr<ImageLoadingTracker> extension_app_image_loader_;\n\n // Cached web app info data.\n WebApplicationInfo web_app_info_;\n\n // Which deferred action to perform when OnDidGetApplicationInfo is notified\n // from a WebContents.\n WebAppAction pending_web_app_action_;\n\n content::NotificationRegistrar registrar_;\n\n ScriptExecutor script_executor_;\n\n scoped_ptr<LocationBarController> location_bar_controller_;\n\n scoped_ptr<ActiveTabPermissionGranter> active_tab_permission_granter_;\n\n scoped_ptr<ScriptBubbleController> script_bubble_controller_;\n\n DISALLOW_COPY_AND_ASSIGN(TabHelper);\n};\n\n} // namespace extensions\n\n#endif // CHROME_BROWSER_EXTENSIONS_TAB_HELPER_H_\n", "meta": {"content_hash": "7dfb142555823d9cac76d1aac4501339", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 80, "avg_line_length": 36.90204081632653, "alnum_prop": 0.694945249419312, "repo_name": "junmin-zhu/chromium-rivertrail", "id": "5d8708e794eb90839c6b291e6f9f75d1dac1e7f5", "size": "10052", "binary": false, "copies": "1", "ref": "refs/heads/v8-binding", "path": "chrome/browser/extensions/tab_helper.h", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "ASP", "bytes": "853"}, {"name": "AppleScript", "bytes": "6973"}, {"name": "Arduino", "bytes": "464"}, {"name": "Assembly", "bytes": "1172794"}, {"name": "Awk", "bytes": "9519"}, {"name": "C", "bytes": "75806807"}, {"name": "C#", "bytes": "1132"}, {"name": "C++", "bytes": "145161929"}, {"name": "DOT", "bytes": "1559"}, {"name": "F#", "bytes": "381"}, {"name": "Java", "bytes": "1546515"}, {"name": "JavaScript", "bytes": "18675242"}, {"name": "Logos", "bytes": "4517"}, {"name": "Matlab", "bytes": "5234"}, {"name": "Objective-C", "bytes": "6981387"}, {"name": "PHP", "bytes": "97817"}, {"name": "Perl", "bytes": "926245"}, {"name": "Python", "bytes": "8088373"}, {"name": "R", "bytes": "262"}, {"name": "Ragel in Ruby Host", "bytes": "3239"}, {"name": "Shell", "bytes": "1513486"}, {"name": "Tcl", "bytes": "277077"}, {"name": "XML", "bytes": "13493"}]}} +{"text": "void SystemInit(void)\n{\n return;\n}\n", "meta": {"content_hash": "bf1fee85e67006d537e73af12c21cf5b", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 21, "avg_line_length": 9.5, "alnum_prop": 0.631578947368421, "repo_name": "ekohandel/AM335x", "id": "b7fb27ca5d4a223907238ebe495577a0c3bb76cb", "size": "38", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/systeminit.c", "mode": "33188", "license": "mit", "language": [{"name": "Assembly", "bytes": "6062"}, {"name": "C", "bytes": "109"}, {"name": "Makefile", "bytes": "276"}]}} +{"text": "<?php\n\nnamespace AppBundle\\Repository;\n\n/**\n * RateRepository.\n *\n * This class was generated by the Doctrine ORM. Add your own custom\n * repository methods below.\n */\nclass RateRepository extends \\Doctrine\\ORM\\EntityRepository\n{\n public function getActiveRates()\n {\n return $this\n ->createQueryBuilder('r')\n ->where('r.active = true')\n ->getQuery()\n ->getResult();\n }\n}\n", "meta": {"content_hash": "250c2fbab52725ba802381eb04305770", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 68, "avg_line_length": 20.523809523809526, "alnum_prop": 0.6102088167053364, "repo_name": "alexseif/myapp", "id": "24da315b6901b02236ee10f9d46b9117dbb57759", "size": "431", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/AppBundle/Repository/RateRepository.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "144422"}, {"name": "HTML", "bytes": "32801"}, {"name": "JavaScript", "bytes": "113706"}, {"name": "Less", "bytes": "201281"}, {"name": "PHP", "bytes": "512370"}, {"name": "SCSS", "bytes": "221642"}, {"name": "Shell", "bytes": "2824"}, {"name": "Twig", "bytes": "611941"}]}} +{"text": "\n\npackage dlp.snippets;\n\n// [START dlp_deidentify_table_row_suppress]\n\nimport com.google.cloud.dlp.v2.DlpServiceClient;\nimport com.google.privacy.dlp.v2.ContentItem;\nimport com.google.privacy.dlp.v2.DeidentifyConfig;\nimport com.google.privacy.dlp.v2.DeidentifyContentRequest;\nimport com.google.privacy.dlp.v2.DeidentifyContentResponse;\nimport com.google.privacy.dlp.v2.FieldId;\nimport com.google.privacy.dlp.v2.LocationName;\nimport com.google.privacy.dlp.v2.RecordCondition;\nimport com.google.privacy.dlp.v2.RecordCondition.Condition;\nimport com.google.privacy.dlp.v2.RecordCondition.Conditions;\nimport com.google.privacy.dlp.v2.RecordCondition.Expressions;\nimport com.google.privacy.dlp.v2.RecordSuppression;\nimport com.google.privacy.dlp.v2.RecordTransformations;\nimport com.google.privacy.dlp.v2.RelationalOperator;\nimport com.google.privacy.dlp.v2.Table;\nimport com.google.privacy.dlp.v2.Table.Row;\nimport com.google.privacy.dlp.v2.Value;\nimport java.io.IOException;\n\npublic class DeIdentifyTableRowSuppress {\n\n public static void deIdentifyTableRowSuppress() throws IOException {\n // TODO(developer): Replace these variables before running the sample.\n String projectId = \"your-project-id\";\n Table tableToDeIdentify =\n Table.newBuilder()\n .addHeaders(FieldId.newBuilder().setName(\"AGE\").build())\n .addHeaders(FieldId.newBuilder().setName(\"PATIENT\").build())\n .addHeaders(FieldId.newBuilder().setName(\"HAPPINESS SCORE\").build())\n .addRows(\n Row.newBuilder()\n .addValues(Value.newBuilder().setStringValue(\"101\").build())\n .addValues(Value.newBuilder().setStringValue(\"Charles Dickens\").build())\n .addValues(Value.newBuilder().setStringValue(\"95\").build())\n .build())\n .addRows(\n Row.newBuilder()\n .addValues(Value.newBuilder().setStringValue(\"22\").build())\n .addValues(Value.newBuilder().setStringValue(\"Jane Austen\").build())\n .addValues(Value.newBuilder().setStringValue(\"21\").build())\n .build())\n .addRows(\n Row.newBuilder()\n .addValues(Value.newBuilder().setStringValue(\"55\").build())\n .addValues(Value.newBuilder().setStringValue(\"Mark Twain\").build())\n .addValues(Value.newBuilder().setStringValue(\"75\").build())\n .build())\n .build();\n\n deIdentifyTableRowSuppress(projectId, tableToDeIdentify);\n }\n\n public static Table deIdentifyTableRowSuppress(String projectId, Table tableToDeIdentify)\n throws IOException {\n // Initialize client that will be used to send requests. This client only needs to be created\n // once, and can be reused for multiple requests. After completing all of your requests, call\n // the \"close\" method on the client to safely clean up any remaining background resources.\n try (DlpServiceClient dlp = DlpServiceClient.create()) {\n // Specify what content you want the service to de-identify.\n ContentItem contentItem = ContentItem.newBuilder().setTable(tableToDeIdentify).build();\n\n // Specify when the content should be de-identified.\n Condition condition =\n Condition.newBuilder()\n .setField(FieldId.newBuilder().setName(\"AGE\").build())\n .setOperator(RelationalOperator.GREATER_THAN)\n .setValue(Value.newBuilder().setIntegerValue(89).build())\n .build();\n // Apply the condition to record suppression.\n RecordSuppression recordSuppressions =\n RecordSuppression.newBuilder()\n .setCondition(\n RecordCondition.newBuilder()\n .setExpressions(\n Expressions.newBuilder()\n .setConditions(\n Conditions.newBuilder().addConditions(condition).build())\n .build())\n .build())\n .build();\n // Use record suppression as the only transformation\n RecordTransformations transformations =\n RecordTransformations.newBuilder().addRecordSuppressions(recordSuppressions).build();\n\n DeidentifyConfig deidentifyConfig =\n DeidentifyConfig.newBuilder().setRecordTransformations(transformations).build();\n\n // Combine configurations into a request for the service.\n DeidentifyContentRequest request =\n DeidentifyContentRequest.newBuilder()\n .setParent(LocationName.of(projectId, \"global\").toString())\n .setItem(contentItem)\n .setDeidentifyConfig(deidentifyConfig)\n .build();\n\n // Send the request and receive response from the service.\n DeidentifyContentResponse response = dlp.deidentifyContent(request);\n\n // Print the results.\n System.out.println(\"Table after de-identification: \" + response.getItem().getTable());\n\n return response.getItem().getTable();\n }\n }\n}\n// [END dlp_deidentify_table_row_suppress]\n", "meta": {"content_hash": "0640074cb822b1cc55c3a284d1c0cf54", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 97, "avg_line_length": 45.839285714285715, "alnum_prop": 0.6583560576548501, "repo_name": "googleapis/java-dlp", "id": "0c02dc1664967c0fd52d78b953477ce77ad99be5", "size": "5723", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "samples/snippets/src/main/java/dlp/snippets/DeIdentifyTableRowSuppress.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "801"}, {"name": "Java", "bytes": "12264243"}, {"name": "Python", "bytes": "2548"}, {"name": "Shell", "bytes": "22242"}]}} +{"text": "set -o errexit\nset -o nounset\nset -o pipefail\n\nREPO_ROOT=\"$(cd \"$(dirname \"${BASH_SOURCE}\")/..\" && pwd -P)\"\n\nreindex_out=\"$(${REPO_ROOT}/scripts/reindex.sh)\"\nif [[ -n \"${reindex_out}\" ]]; then\n echo \"Invalid index: file name matches directory name\" >&2\n echo \"${reindex_out}\" >&2\n echo \"Please run 'scripts/reindex.sh'\" >&2\n exit 1\nfi\n", "meta": {"content_hash": "75d5f6215b3bfd0e8ccb2fafed37f0a6", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 60, "avg_line_length": 26.076923076923077, "alnum_prop": 0.6283185840707964, "repo_name": "dcos/dcos-docs", "id": "cf200e0250d93f48df062d44a4f84147b21c0654", "size": "360", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scripts/validate-reindex.sh", "mode": "33261", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "172997"}, {"name": "Makefile", "bytes": "28"}, {"name": "Shell", "bytes": "30642"}]}} +{"text": "from django.core.urlresolvers import reverse\nfrom django.views.generic import ListView, CreateView, UpdateView, DeleteView, DetailView\nfrom contacts.models import Address, Contact\n\nimport forms\n\n\n\n#The ListView that we subclass from is itself composed of several mixins that provide some behaviour !!!\nclass ListContactView(ListView):\n\n model = Contact # this view is going to list all the Contacts in our database\n template_name = 'contact_list.html'\n\n\n\n# Most generic views that do form processing have \n# the concept of the 'success URL': where to redirect \n# the user when the form is successfully submitted.\nclass CreateContactView(CreateView):\n\n model = Contact\n template_name = 'edit_contact.html'\n # after adding 'email_filed' in forms.py we have to tell this view to use it\n form_class = forms.ContactForm\n\n def get_success_url(self):\n return reverse('contacts-list') # contact_list - the name of a view defined in URLS !\n\n # in order to use the same template for create and update (add/edit) we have to add info\n # about where the form should redirect to the context\n def get_context_data(self, **kwargs):\n context = super(CreateContactView, self).get_context_data(**kwargs)\n context['action'] = reverse('contacts-new')\n\n return context\n\n\nclass UpdateContactView(UpdateView):\n\n model = Contact\n template_name = 'edit_contact.html'\n # after adding 'email_filed' in forms.py we have to tell this view to use it\n form_class = forms.ContactForm\n\n def get_success_url(self):\n return reverse('contacts-list')\n\n # in order to use the same template for create and update (add/edit) we have to add info\n # about where the form should redirect to the context\n def get_context_data(self, **kwargs):\n context = super(UpdateContactView, self).get_context_data(**kwargs)\n context['action'] = reverse('contacts-edit', kwargs = {'pk': self.get_object().id})\n\n return context\n\nclass DeleteContactView(DeleteView):\n\n model = Contact\n template_name = 'delete_contact.html'\n\n def get_success_url(self):\n return reverse('contacts-list')\n\nclass ContactView(DetailView):\n\n model = Contact\n template_name = 'contact.html'\n\n def get_context_data(self, **kwargs):\n context = super(ContactView, self).get_context_data(**kwargs)\n home_addresses = Address.objects.filter(contact_id=self.get_object().id, address_type='HOME')\n context['home_address'] = home_addresses[0] if home_addresses else None\n\n return context\n\n\n\n\n#\n# to work with Contact and Address models together\n#\n# class EditContactAddressView(UpdateView):\n\n# model = Contact # inline formset takes the parent object as its starting point\n# template_name = 'edit_addresses.html'\n# form_class = forms.ContactAddressFormSet\n\n# def get_success_url(self):\n\n# # redirect to the Contact view.\n# return self.get_object().get_absolute_url()\n\nclass EditContactAddressView(UpdateView):\n\n model = Address # inline formset takes the parent object as its starting point\n template_name = 'edit_addresses.html'\n #form_class = forms.ContactAddressFormSet\n\n def get_success_url(self):\n return reverse('contacts-list')\n\n def get_context_data(self, **kwargs):\n context = super(EditContactAddressView, self).get_context_data(**kwargs)\n context['action'] = reverse('contacts-edit-addresses', kwargs = {'pk': self.get_object().id})\n\n return context", "meta": {"content_hash": "f00c2500cff048bedb2466680547d367", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 109, "avg_line_length": 33.42056074766355, "alnum_prop": 0.6868008948545862, "repo_name": "pyjosh/django_addressbook", "id": "cf9811648e3c79af51e38ddbceef984ad6716568", "size": "3602", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "contacts/views.py", "mode": "33188", "license": "mit", "language": []}} +{"text": "require 'rubygems'\nrequire 'priority_queue'\n\nclass String\n # Convenience method so we can iterate over characters easily\n\n def to_chars\n a = []\n each_byte do |b|\n a << b.chr\n end\n a\n end\nend\n\nmodule TileMap\n # Although start is a plains, its cost is 0\n\n START = 0\n PLAINS = 1\n FOREST = 2\n MOUNTAIN = 3\n WATER = nil\n\n class TilePath < Array\n def initialize(map)\n @map = map\n super([@map.start])\n end\n\n def cost\n inject(0) {|sum, c| sum + @map.tile(*c) }\n end\n end\n\n class Map\n attr_reader :start, :goal\n\n # parse a string contining a tile map into a nested array\n\n def initialize(map_str)\n @tiles = []\n map_str.each do |line|\n @tiles << []\n line.chomp.to_chars.each do |c|\n @tiles.last << case c\n when \"@\"\n START\n when \".\", \"X\"\n PLAINS\n when \"*\"\n FOREST\n when \"^\"\n MOUNTAIN\n when \"~\"\n WATER\n else\n raise \"Invalid tile type\"\n end\n if '@' == c\n @start = [@tiles.last.length - 1, @tiles.length - 1]\n elsif 'X' == c\n @goal = [@tiles.last.length - 1, @tiles.length - 1]\n end\n end\n end\n unless @start && @goal\n raise \"Either position or goal tile are not set\"\n end\n end\n\n def tile(x, y)\n @tiles[y][x]\n end\n\n def move_choices(x, y)\n if tile(x, y) == WATER\n raise \"Illegal tile\"\n end\n choices = []\n (-1..1).each do |i|\n ypos = y + i\n if ypos >= 0 && ypos < @tiles.length\n (-1..1).each do |j|\n xpos = x + j\n if xpos >= 0 && xpos < @tiles[i].length\n new_position = [xpos, ypos]\n if new_position != [x, y] && tile(*new_position) != WATER\n choices << new_position\n end\n end\n end\n end\n end\n choices\n end\n\n def self.manhattan(point1, point2)\n ((point2[0] - point1[0]) + (point2[1] - point1[1])).abs\n end\n end\n\n def self.a_star_search(map)\n # To store points we have already visited, so we don't repeat ourselves\n closed = []\n open = PriorityQueue.new\n # Start off the queue with one path, which will contain the start position\n open.push TilePath.new(map), 0\n while ! open.empty?\n # Get the path with the best cost to expand\n\n current_path = open.delete_min_return_key\n pos = current_path.last\n unless closed.include?(pos)\n if pos == map.goal\n return current_path\n end\n closed << pos\n # Create new paths and add them to the priority queue\n\n map.move_choices(*pos).each do |p|\n heuristic = Map.manhattan(p, map.goal)\n new_path = current_path.clone << p\n open.push(new_path, new_path.cost + heuristic)\n end\n end\n end\n raise \"Cannot be solved\"\n end\nend\n\n@m = TileMap::Map.new(File.read('large_map.txt'))\nresults = TileMap.a_star_search(@m)\nputs results.map! {|pos| pos.join(\",\") }.join(\" \")\n\n", "meta": {"content_hash": "66d92164bb4e682f43505bf198360530", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 78, "avg_line_length": 24.444444444444443, "alnum_prop": 0.4890909090909091, "repo_name": "J-Y/RubyQuiz", "id": "8cc84457ded88669aae7d9c865553113aa3e87f4", "size": "3300", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ruby_quiz/quiz98_sols/solutions/Roland Swingler/a_star.rb", "mode": "33188", "license": "mit", "language": [{"name": "ApacheConf", "bytes": "2281"}, {"name": "Bison", "bytes": "261"}, {"name": "C", "bytes": "23577"}, {"name": "CSS", "bytes": "10128"}, {"name": "GAP", "bytes": "4684"}, {"name": "HTML", "bytes": "186387"}, {"name": "JavaScript", "bytes": "148"}, {"name": "Makefile", "bytes": "6175"}, {"name": "OCaml", "bytes": "7884"}, {"name": "Ruby", "bytes": "8196401"}, {"name": "Shell", "bytes": "1092"}, {"name": "TeX", "bytes": "4601"}]}} +{"text": "// See https://i3wm.org/docs/ipc.html for protocol information\n#define _POSIX_C_SOURCE 200112L\n#include <linux/input-event-codes.h>\n#include <assert.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <json.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/socket.h>\n#include <sys/ioctl.h>\n#include <sys/un.h>\n#include <unistd.h>\n#include <wayland-server-core.h>\n#include \"sway/commands.h\"\n#include \"sway/config.h\"\n#include \"sway/desktop/transaction.h\"\n#include \"sway/ipc-json.h\"\n#include \"sway/ipc-server.h\"\n#include \"sway/output.h\"\n#include \"sway/server.h\"\n#include \"sway/input/input-manager.h\"\n#include \"sway/input/keyboard.h\"\n#include \"sway/input/seat.h\"\n#include \"sway/tree/root.h\"\n#include \"sway/tree/view.h\"\n#include \"sway/tree/workspace.h\"\n#include \"list.h\"\n#include \"log.h\"\n#include \"util.h\"\n\nstatic int ipc_socket = -1;\nstatic struct wl_event_source *ipc_event_source = NULL;\nstatic struct sockaddr_un *ipc_sockaddr = NULL;\nstatic list_t *ipc_client_list = NULL;\nstatic struct wl_listener ipc_display_destroy;\n\nstatic const char ipc_magic[] = {'i', '3', '-', 'i', 'p', 'c'};\n\n#define IPC_HEADER_SIZE (sizeof(ipc_magic) + 8)\n\nstruct ipc_client {\n\tstruct wl_event_source *event_source;\n\tstruct wl_event_source *writable_event_source;\n\tstruct sway_server *server;\n\tint fd;\n\tenum ipc_command_type subscribed_events;\n\tsize_t write_buffer_len;\n\tsize_t write_buffer_size;\n\tchar *write_buffer;\n\t// The following are for storing data between event_loop calls\n\tuint32_t pending_length;\n\tenum ipc_command_type pending_type;\n};\n\nstruct sockaddr_un *ipc_user_sockaddr(void);\nint ipc_handle_connection(int fd, uint32_t mask, void *data);\nint ipc_client_handle_readable(int client_fd, uint32_t mask, void *data);\nint ipc_client_handle_writable(int client_fd, uint32_t mask, void *data);\nvoid ipc_client_disconnect(struct ipc_client *client);\nvoid ipc_client_handle_command(struct ipc_client *client, uint32_t payload_length,\n\tenum ipc_command_type payload_type);\nbool ipc_send_reply(struct ipc_client *client, enum ipc_command_type payload_type,\n\tconst char *payload, uint32_t payload_length);\n\nstatic void handle_display_destroy(struct wl_listener *listener, void *data) {\n\tif (ipc_event_source) {\n\t\twl_event_source_remove(ipc_event_source);\n\t}\n\tclose(ipc_socket);\n\tunlink(ipc_sockaddr->sun_path);\n\n\twhile (ipc_client_list->length) {\n\t\tipc_client_disconnect(ipc_client_list->items[ipc_client_list->length-1]);\n\t}\n\tlist_free(ipc_client_list);\n\n\tfree(ipc_sockaddr);\n\n\twl_list_remove(&ipc_display_destroy.link);\n}\n\nvoid ipc_init(struct sway_server *server) {\n\tipc_socket = socket(AF_UNIX, SOCK_STREAM, 0);\n\tif (ipc_socket == -1) {\n\t\tsway_abort(\"Unable to create IPC socket\");\n\t}\n\tif (fcntl(ipc_socket, F_SETFD, FD_CLOEXEC) == -1) {\n\t\tsway_abort(\"Unable to set CLOEXEC on IPC socket\");\n\t}\n\tif (fcntl(ipc_socket, F_SETFL, O_NONBLOCK) == -1) {\n\t\tsway_abort(\"Unable to set NONBLOCK on IPC socket\");\n\t}\n\n\tipc_sockaddr = ipc_user_sockaddr();\n\n\t// We want to use socket name set by user, not existing socket from another sway instance.\n\tif (getenv(\"SWAYSOCK\") != NULL && access(getenv(\"SWAYSOCK\"), F_OK) == -1) {\n\t\tstrncpy(ipc_sockaddr->sun_path, getenv(\"SWAYSOCK\"), sizeof(ipc_sockaddr->sun_path) - 1);\n\t\tipc_sockaddr->sun_path[sizeof(ipc_sockaddr->sun_path) - 1] = 0;\n\t}\n\n\tunlink(ipc_sockaddr->sun_path);\n\tif (bind(ipc_socket, (struct sockaddr *)ipc_sockaddr, sizeof(*ipc_sockaddr)) == -1) {\n\t\tsway_abort(\"Unable to bind IPC socket\");\n\t}\n\n\tif (listen(ipc_socket, 3) == -1) {\n\t\tsway_abort(\"Unable to listen on IPC socket\");\n\t}\n\n\t// Set i3 IPC socket path so that i3-msg works out of the box\n\tsetenv(\"I3SOCK\", ipc_sockaddr->sun_path, 1);\n\tsetenv(\"SWAYSOCK\", ipc_sockaddr->sun_path, 1);\n\n\tipc_client_list = create_list();\n\n\tipc_display_destroy.notify = handle_display_destroy;\n\twl_display_add_destroy_listener(server->wl_display, &ipc_display_destroy);\n\n\tipc_event_source = wl_event_loop_add_fd(server->wl_event_loop, ipc_socket,\n\t\t\tWL_EVENT_READABLE, ipc_handle_connection, server);\n}\n\nstruct sockaddr_un *ipc_user_sockaddr(void) {\n\tstruct sockaddr_un *ipc_sockaddr = malloc(sizeof(struct sockaddr_un));\n\tif (ipc_sockaddr == NULL) {\n\t\tsway_abort(\"Can't allocate ipc_sockaddr\");\n\t}\n\n\tipc_sockaddr->sun_family = AF_UNIX;\n\tint path_size = sizeof(ipc_sockaddr->sun_path);\n\n\t// Env var typically set by logind, e.g. \"/run/user/<user-id>\"\n\tconst char *dir = getenv(\"XDG_RUNTIME_DIR\");\n\tif (!dir) {\n\t\tdir = \"/tmp\";\n\t}\n\tif (path_size <= snprintf(ipc_sockaddr->sun_path, path_size,\n\t\t\t\"%s/sway-ipc.%u.%i.sock\", dir, getuid(), getpid())) {\n\t\tsway_abort(\"Socket path won't fit into ipc_sockaddr->sun_path\");\n\t}\n\n\treturn ipc_sockaddr;\n}\n\nint ipc_handle_connection(int fd, uint32_t mask, void *data) {\n\t(void) fd;\n\tstruct sway_server *server = data;\n\tsway_log(SWAY_DEBUG, \"Event on IPC listening socket\");\n\tassert(mask == WL_EVENT_READABLE);\n\n\tint client_fd = accept(ipc_socket, NULL, NULL);\n\tif (client_fd == -1) {\n\t\tsway_log_errno(SWAY_ERROR, \"Unable to accept IPC client connection\");\n\t\treturn 0;\n\t}\n\n\tint flags;\n\tif ((flags = fcntl(client_fd, F_GETFD)) == -1\n\t\t\t|| fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) {\n\t\tsway_log_errno(SWAY_ERROR, \"Unable to set CLOEXEC on IPC client socket\");\n\t\tclose(client_fd);\n\t\treturn 0;\n\t}\n\tif ((flags = fcntl(client_fd, F_GETFL)) == -1\n\t\t\t|| fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) {\n\t\tsway_log_errno(SWAY_ERROR, \"Unable to set NONBLOCK on IPC client socket\");\n\t\tclose(client_fd);\n\t\treturn 0;\n\t}\n\n\tstruct ipc_client *client = malloc(sizeof(struct ipc_client));\n\tif (!client) {\n\t\tsway_log(SWAY_ERROR, \"Unable to allocate ipc client\");\n\t\tclose(client_fd);\n\t\treturn 0;\n\t}\n\tclient->server = server;\n\tclient->pending_length = 0;\n\tclient->fd = client_fd;\n\tclient->subscribed_events = 0;\n\tclient->event_source = wl_event_loop_add_fd(server->wl_event_loop,\n\t\t\tclient_fd, WL_EVENT_READABLE, ipc_client_handle_readable, client);\n\tclient->writable_event_source = NULL;\n\n\tclient->write_buffer_size = 128;\n\tclient->write_buffer_len = 0;\n\tclient->write_buffer = malloc(client->write_buffer_size);\n\tif (!client->write_buffer) {\n\t\tsway_log(SWAY_ERROR, \"Unable to allocate ipc client write buffer\");\n\t\tclose(client_fd);\n\t\treturn 0;\n\t}\n\n\tsway_log(SWAY_DEBUG, \"New client: fd %d\", client_fd);\n\tlist_add(ipc_client_list, client);\n\treturn 0;\n}\n\nint ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) {\n\tstruct ipc_client *client = data;\n\n\tif (mask & WL_EVENT_ERROR) {\n\t\tsway_log(SWAY_ERROR, \"IPC Client socket error, removing client\");\n\t\tipc_client_disconnect(client);\n\t\treturn 0;\n\t}\n\n\tif (mask & WL_EVENT_HANGUP) {\n\t\tsway_log(SWAY_DEBUG, \"Client %d hung up\", client->fd);\n\t\tipc_client_disconnect(client);\n\t\treturn 0;\n\t}\n\n\tsway_log(SWAY_DEBUG, \"Client %d readable\", client->fd);\n\n\tint read_available;\n\tif (ioctl(client_fd, FIONREAD, &read_available) == -1) {\n\t\tsway_log_errno(SWAY_INFO, \"Unable to read IPC socket buffer size\");\n\t\tipc_client_disconnect(client);\n\t\treturn 0;\n\t}\n\n\t// Wait for the rest of the command payload in case the header has already been read\n\tif (client->pending_length > 0) {\n\t\tif ((uint32_t)read_available >= client->pending_length) {\n\t\t\t// Reset pending values.\n\t\t\tuint32_t pending_length = client->pending_length;\n\t\t\tenum ipc_command_type pending_type = client->pending_type;\n\t\t\tclient->pending_length = 0;\n\t\t\tipc_client_handle_command(client, pending_length, pending_type);\n\t\t}\n\t\treturn 0;\n\t}\n\n\tif (read_available < (int) IPC_HEADER_SIZE) {\n\t\treturn 0;\n\t}\n\n\tuint8_t buf[IPC_HEADER_SIZE];\n\t// Should be fully available, because read_available >= IPC_HEADER_SIZE\n\tssize_t received = recv(client_fd, buf, IPC_HEADER_SIZE, 0);\n\tif (received == -1) {\n\t\tsway_log_errno(SWAY_INFO, \"Unable to receive header from IPC client\");\n\t\tipc_client_disconnect(client);\n\t\treturn 0;\n\t}\n\n\tif (memcmp(buf, ipc_magic, sizeof(ipc_magic)) != 0) {\n\t\tsway_log(SWAY_DEBUG, \"IPC header check failed\");\n\t\tipc_client_disconnect(client);\n\t\treturn 0;\n\t}\n\n\tmemcpy(&client->pending_length, buf + sizeof(ipc_magic), sizeof(uint32_t));\n\tmemcpy(&client->pending_type, buf + sizeof(ipc_magic) + sizeof(uint32_t), sizeof(uint32_t));\n\n\tif (read_available - received >= (long)client->pending_length) {\n\t\t// Reset pending values.\n\t\tuint32_t pending_length = client->pending_length;\n\t\tenum ipc_command_type pending_type = client->pending_type;\n\t\tclient->pending_length = 0;\n\t\tipc_client_handle_command(client, pending_length, pending_type);\n\t}\n\n\treturn 0;\n}\n\nstatic bool ipc_has_event_listeners(enum ipc_command_type event) {\n\tfor (int i = 0; i < ipc_client_list->length; i++) {\n\t\tstruct ipc_client *client = ipc_client_list->items[i];\n\t\tif ((client->subscribed_events & event_mask(event)) != 0) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nstatic void ipc_send_event(const char *json_string, enum ipc_command_type event) {\n\tstruct ipc_client *client;\n\tfor (int i = 0; i < ipc_client_list->length; i++) {\n\t\tclient = ipc_client_list->items[i];\n\t\tif ((client->subscribed_events & event_mask(event)) == 0) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!ipc_send_reply(client, event, json_string,\n\t\t\t\t(uint32_t)strlen(json_string))) {\n\t\t\tsway_log_errno(SWAY_INFO, \"Unable to send reply to IPC client\");\n\t\t\t/* ipc_send_reply destroys client on error, which also\n\t\t\t * removes it from the list, so we need to process\n\t\t\t * current index again */\n\t\t\ti--;\n\t\t}\n\t}\n}\n\nvoid ipc_event_workspace(struct sway_workspace *old,\n\t\tstruct sway_workspace *new, const char *change) {\n\tif (!ipc_has_event_listeners(IPC_EVENT_WORKSPACE)) {\n\t\treturn;\n\t}\n\tsway_log(SWAY_DEBUG, \"Sending workspace::%s event\", change);\n\tjson_object *obj = json_object_new_object();\n\tjson_object_object_add(obj, \"change\", json_object_new_string(change));\n\tif (old) {\n\t\tjson_object_object_add(obj, \"old\",\n\t\t\t\tipc_json_describe_node_recursive(&old->node));\n\t} else {\n\t\tjson_object_object_add(obj, \"old\", NULL);\n\t}\n\n\tif (new) {\n\t\tjson_object_object_add(obj, \"current\",\n\t\t\t\tipc_json_describe_node_recursive(&new->node));\n\t} else {\n\t\tjson_object_object_add(obj, \"current\", NULL);\n\t}\n\n\tconst char *json_string = json_object_to_json_string(obj);\n\tipc_send_event(json_string, IPC_EVENT_WORKSPACE);\n\tjson_object_put(obj);\n}\n\nvoid ipc_event_window(struct sway_container *window, const char *change) {\n\tif (!ipc_has_event_listeners(IPC_EVENT_WINDOW)) {\n\t\treturn;\n\t}\n\tsway_log(SWAY_DEBUG, \"Sending window::%s event\", change);\n\tjson_object *obj = json_object_new_object();\n\tjson_object_object_add(obj, \"change\", json_object_new_string(change));\n\tjson_object_object_add(obj, \"container\",\n\t\t\tipc_json_describe_node_recursive(&window->node));\n\n\tconst char *json_string = json_object_to_json_string(obj);\n\tipc_send_event(json_string, IPC_EVENT_WINDOW);\n\tjson_object_put(obj);\n}\n\nvoid ipc_event_barconfig_update(struct bar_config *bar) {\n\tif (!ipc_has_event_listeners(IPC_EVENT_BARCONFIG_UPDATE)) {\n\t\treturn;\n\t}\n\tsway_log(SWAY_DEBUG, \"Sending barconfig_update event\");\n\tjson_object *json = ipc_json_describe_bar_config(bar);\n\n\tconst char *json_string = json_object_to_json_string(json);\n\tipc_send_event(json_string, IPC_EVENT_BARCONFIG_UPDATE);\n\tjson_object_put(json);\n}\n\nvoid ipc_event_bar_state_update(struct bar_config *bar) {\n\tif (!ipc_has_event_listeners(IPC_EVENT_BAR_STATE_UPDATE)) {\n\t\treturn;\n\t}\n\tsway_log(SWAY_DEBUG, \"Sending bar_state_update event\");\n\n\tjson_object *json = json_object_new_object();\n\tjson_object_object_add(json, \"id\", json_object_new_string(bar->id));\n\tjson_object_object_add(json, \"visible_by_modifier\",\n\t\t\tjson_object_new_boolean(bar->visible_by_modifier));\n\n\tconst char *json_string = json_object_to_json_string(json);\n\tipc_send_event(json_string, IPC_EVENT_BAR_STATE_UPDATE);\n\tjson_object_put(json);\n}\n\nvoid ipc_event_mode(const char *mode, bool pango) {\n\tif (!ipc_has_event_listeners(IPC_EVENT_MODE)) {\n\t\treturn;\n\t}\n\tsway_log(SWAY_DEBUG, \"Sending mode::%s event\", mode);\n\tjson_object *obj = json_object_new_object();\n\tjson_object_object_add(obj, \"change\", json_object_new_string(mode));\n\tjson_object_object_add(obj, \"pango_markup\",\n\t\t\tjson_object_new_boolean(pango));\n\n\tconst char *json_string = json_object_to_json_string(obj);\n\tipc_send_event(json_string, IPC_EVENT_MODE);\n\tjson_object_put(obj);\n}\n\nvoid ipc_event_shutdown(const char *reason) {\n\tif (!ipc_has_event_listeners(IPC_EVENT_SHUTDOWN)) {\n\t\treturn;\n\t}\n\tsway_log(SWAY_DEBUG, \"Sending shutdown::%s event\", reason);\n\n\tjson_object *json = json_object_new_object();\n\tjson_object_object_add(json, \"change\", json_object_new_string(reason));\n\n\tconst char *json_string = json_object_to_json_string(json);\n\tipc_send_event(json_string, IPC_EVENT_SHUTDOWN);\n\tjson_object_put(json);\n}\n\nvoid ipc_event_binding(struct sway_binding *binding) {\n\tif (!ipc_has_event_listeners(IPC_EVENT_BINDING)) {\n\t\treturn;\n\t}\n\tsway_log(SWAY_DEBUG, \"Sending binding event\");\n\n\tjson_object *json_binding = json_object_new_object();\n\tjson_object_object_add(json_binding, \"command\", json_object_new_string(binding->command));\n\n\tconst char *names[10];\n\tint len = get_modifier_names(names, binding->modifiers);\n\tjson_object *modifiers = json_object_new_array();\n\tfor (int i = 0; i < len; ++i) {\n\t\tjson_object_array_add(modifiers, json_object_new_string(names[i]));\n\t}\n\tjson_object_object_add(json_binding, \"event_state_mask\", modifiers);\n\n\tjson_object *input_codes = json_object_new_array();\n\tint input_code = 0;\n\tjson_object *symbols = json_object_new_array();\n\tjson_object *symbol = NULL;\n\n\tswitch (binding->type) {\n\tcase BINDING_KEYCODE:; // bindcode: populate input_codes\n\t\tuint32_t keycode;\n\t\tfor (int i = 0; i < binding->keys->length; ++i) {\n\t\t\tkeycode = *(uint32_t *)binding->keys->items[i];\n\t\t\tjson_object_array_add(input_codes, json_object_new_int(keycode));\n\t\t\tif (i == 0) {\n\t\t\t\tinput_code = keycode;\n\t\t\t}\n\t\t}\n\t\tbreak;\n\n\tcase BINDING_KEYSYM:\n\tcase BINDING_MOUSESYM:\n\tcase BINDING_MOUSECODE:; // bindsym/mouse: populate symbols\n\t\tuint32_t keysym;\n\t\tchar buffer[64];\n\t\tfor (int i = 0; i < binding->keys->length; ++i) {\n\t\t\tkeysym = *(uint32_t *)binding->keys->items[i];\n\t\t\tif (keysym >= BTN_LEFT && keysym <= BTN_LEFT + 8) {\n\t\t\t\tsnprintf(buffer, 64, \"button%u\", keysym - BTN_LEFT + 1);\n\t\t\t} else if (xkb_keysym_get_name(keysym, buffer, 64) < 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tjson_object *str = json_object_new_string(buffer);\n\t\t\tif (i == 0) {\n\t\t\t\t// str is owned by both symbol and symbols. Make sure\n\t\t\t\t// to bump the ref count.\n\t\t\t\tjson_object_array_add(symbols, json_object_get(str));\n\t\t\t\tsymbol = str;\n\t\t\t} else {\n\t\t\t\tjson_object_array_add(symbols, str);\n\t\t\t}\n\t\t}\n\t\tbreak;\n\n\tdefault:\n\t\tsway_log(SWAY_DEBUG, \"Unsupported ipc binding event\");\n\t\tjson_object_put(input_codes);\n\t\tjson_object_put(symbols);\n\t\tjson_object_put(json_binding);\n\t\treturn; // do not send any event\n\t}\n\n\tjson_object_object_add(json_binding, \"input_codes\", input_codes);\n\tjson_object_object_add(json_binding, \"input_code\", json_object_new_int(input_code));\n\tjson_object_object_add(json_binding, \"symbols\", symbols);\n\tjson_object_object_add(json_binding, \"symbol\", symbol);\n\n\tbool mouse = binding->type == BINDING_MOUSECODE ||\n\t\tbinding->type == BINDING_MOUSESYM;\n\tjson_object_object_add(json_binding, \"input_type\", mouse\n\t\t\t? json_object_new_string(\"mouse\")\n\t\t\t: json_object_new_string(\"keyboard\"));\n\n\tjson_object *json = json_object_new_object();\n\tjson_object_object_add(json, \"change\", json_object_new_string(\"run\"));\n\tjson_object_object_add(json, \"binding\", json_binding);\n\tconst char *json_string = json_object_to_json_string(json);\n\tipc_send_event(json_string, IPC_EVENT_BINDING);\n\tjson_object_put(json);\n}\n\nstatic void ipc_event_tick(const char *payload) {\n\tif (!ipc_has_event_listeners(IPC_EVENT_TICK)) {\n\t\treturn;\n\t}\n\tsway_log(SWAY_DEBUG, \"Sending tick event\");\n\n\tjson_object *json = json_object_new_object();\n\tjson_object_object_add(json, \"first\", json_object_new_boolean(false));\n\tjson_object_object_add(json, \"payload\", json_object_new_string(payload));\n\n\tconst char *json_string = json_object_to_json_string(json);\n\tipc_send_event(json_string, IPC_EVENT_TICK);\n\tjson_object_put(json);\n}\n\nvoid ipc_event_input(const char *change, struct sway_input_device *device) {\n\tif (!ipc_has_event_listeners(IPC_EVENT_INPUT)) {\n\t\treturn;\n\t}\n\tsway_log(SWAY_DEBUG, \"Sending input event\");\n\n\tjson_object *json = json_object_new_object();\n\tjson_object_object_add(json, \"change\", json_object_new_string(change));\n\tjson_object_object_add(json, \"input\", ipc_json_describe_input(device));\n\n\tconst char *json_string = json_object_to_json_string(json);\n\tipc_send_event(json_string, IPC_EVENT_INPUT);\n\tjson_object_put(json);\n}\n\nint ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) {\n\tstruct ipc_client *client = data;\n\n\tif (mask & WL_EVENT_ERROR) {\n\t\tsway_log(SWAY_ERROR, \"IPC Client socket error, removing client\");\n\t\tipc_client_disconnect(client);\n\t\treturn 0;\n\t}\n\n\tif (mask & WL_EVENT_HANGUP) {\n\t\tsway_log(SWAY_DEBUG, \"Client %d hung up\", client->fd);\n\t\tipc_client_disconnect(client);\n\t\treturn 0;\n\t}\n\n\tif (client->write_buffer_len <= 0) {\n\t\treturn 0;\n\t}\n\n\tsway_log(SWAY_DEBUG, \"Client %d writable\", client->fd);\n\n\tssize_t written = write(client->fd, client->write_buffer, client->write_buffer_len);\n\n\tif (written == -1 && errno == EAGAIN) {\n\t\treturn 0;\n\t} else if (written == -1) {\n\t\tsway_log_errno(SWAY_INFO, \"Unable to send data from queue to IPC client\");\n\t\tipc_client_disconnect(client);\n\t\treturn 0;\n\t}\n\n\tmemmove(client->write_buffer, client->write_buffer + written, client->write_buffer_len - written);\n\tclient->write_buffer_len -= written;\n\n\tif (client->write_buffer_len == 0 && client->writable_event_source) {\n\t\twl_event_source_remove(client->writable_event_source);\n\t\tclient->writable_event_source = NULL;\n\t}\n\n\treturn 0;\n}\n\nvoid ipc_client_disconnect(struct ipc_client *client) {\n\tif (!sway_assert(client != NULL, \"client != NULL\")) {\n\t\treturn;\n\t}\n\n\tshutdown(client->fd, SHUT_RDWR);\n\n\tsway_log(SWAY_INFO, \"IPC Client %d disconnected\", client->fd);\n\twl_event_source_remove(client->event_source);\n\tif (client->writable_event_source) {\n\t\twl_event_source_remove(client->writable_event_source);\n\t}\n\tint i = 0;\n\twhile (i < ipc_client_list->length && ipc_client_list->items[i] != client) {\n\t\ti++;\n\t}\n\tlist_del(ipc_client_list, i);\n\tfree(client->write_buffer);\n\tclose(client->fd);\n\tfree(client);\n}\n\nstatic void ipc_get_workspaces_callback(struct sway_workspace *workspace,\n\t\tvoid *data) {\n\tjson_object *workspace_json = ipc_json_describe_node(&workspace->node);\n\t// override the default focused indicator because\n\t// it's set differently for the get_workspaces reply\n\tstruct sway_seat *seat = input_manager_get_default_seat();\n\tstruct sway_workspace *focused_ws = seat_get_focused_workspace(seat);\n\tbool focused = workspace == focused_ws;\n\tjson_object_object_del(workspace_json, \"focused\");\n\tjson_object_object_add(workspace_json, \"focused\",\n\t\t\tjson_object_new_boolean(focused));\n\tjson_object_array_add((json_object *)data, workspace_json);\n\n\tfocused_ws = output_get_active_workspace(workspace->output);\n\tbool visible = workspace == focused_ws;\n\tjson_object_object_add(workspace_json, \"visible\",\n\t\t\tjson_object_new_boolean(visible));\n}\n\nstatic void ipc_get_marks_callback(struct sway_container *con, void *data) {\n\tjson_object *marks = (json_object *)data;\n\tfor (int i = 0; i < con->marks->length; ++i) {\n\t\tchar *mark = (char *)con->marks->items[i];\n\t\tjson_object_array_add(marks, json_object_new_string(mark));\n\t}\n}\n\nvoid ipc_client_handle_command(struct ipc_client *client, uint32_t payload_length,\n\t\tenum ipc_command_type payload_type) {\n\tif (!sway_assert(client != NULL, \"client != NULL\")) {\n\t\treturn;\n\t}\n\n\tchar *buf = malloc(payload_length + 1);\n\tif (!buf) {\n\t\tsway_log_errno(SWAY_INFO, \"Unable to allocate IPC payload\");\n\t\tipc_client_disconnect(client);\n\t\treturn;\n\t}\n\tif (payload_length > 0) {\n\t\t// Payload should be fully available\n\t\tssize_t received = recv(client->fd, buf, payload_length, 0);\n\t\tif (received == -1)\n\t\t{\n\t\t\tsway_log_errno(SWAY_INFO, \"Unable to receive payload from IPC client\");\n\t\t\tipc_client_disconnect(client);\n\t\t\tfree(buf);\n\t\t\treturn;\n\t\t}\n\t}\n\tbuf[payload_length] = '\\0';\n\n\tswitch (payload_type) {\n\tcase IPC_COMMAND:\n\t{\n\t\tchar *line = strtok(buf, \"\\n\");\n\t\twhile (line) {\n\t\t\tsize_t line_length = strlen(line);\n\t\t\tif (line + line_length >= buf + payload_length) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tline[line_length] = ';';\n\t\t\tline = strtok(NULL, \"\\n\");\n\t\t}\n\n\t\tlist_t *res_list = execute_command(buf, NULL, NULL);\n\t\ttransaction_commit_dirty();\n\t\tchar *json = cmd_results_to_json(res_list);\n\t\tint length = strlen(json);\n\t\tipc_send_reply(client, payload_type, json, (uint32_t)length);\n\t\tfree(json);\n\t\twhile (res_list->length) {\n\t\t\tstruct cmd_results *results = res_list->items[0];\n\t\t\tfree_cmd_results(results);\n\t\t\tlist_del(res_list, 0);\n\t\t}\n\t\tlist_free(res_list);\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_SEND_TICK:\n\t{\n\t\tipc_event_tick(buf);\n\t\tipc_send_reply(client, payload_type, \"{\\\"success\\\": true}\", 17);\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_OUTPUTS:\n\t{\n\t\tjson_object *outputs = json_object_new_array();\n\t\tfor (int i = 0; i < root->outputs->length; ++i) {\n\t\t\tstruct sway_output *output = root->outputs->items[i];\n\t\t\tjson_object *output_json = ipc_json_describe_node(&output->node);\n\n\t\t\t// override the default focused indicator because it's set\n\t\t\t// differently for the get_outputs reply\n\t\t\tstruct sway_seat *seat = input_manager_get_default_seat();\n\t\t\tstruct sway_workspace *focused_ws =\n\t\t\t\tseat_get_focused_workspace(seat);\n\t\t\tbool focused = focused_ws && output == focused_ws->output;\n\t\t\tjson_object_object_del(output_json, \"focused\");\n\t\t\tjson_object_object_add(output_json, \"focused\",\n\t\t\t\tjson_object_new_boolean(focused));\n\n\t\t\tconst char *subpixel = sway_wl_output_subpixel_to_string(output->wlr_output->subpixel);\n\t\t\tjson_object_object_add(output_json, \"subpixel_hinting\", json_object_new_string(subpixel));\n\t\t\tjson_object_array_add(outputs, output_json);\n\t\t}\n\t\tstruct sway_output *output;\n\t\twl_list_for_each(output, &root->all_outputs, link) {\n\t\t\tif (!output->enabled && output != root->fallback_output) {\n\t\t\t\tjson_object_array_add(outputs,\n\t\t\t\t\t\tipc_json_describe_disabled_output(output));\n\t\t\t}\n\t\t}\n\t\tconst char *json_string = json_object_to_json_string(outputs);\n\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t(uint32_t)strlen(json_string));\n\t\tjson_object_put(outputs); // free\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_WORKSPACES:\n\t{\n\t\tjson_object *workspaces = json_object_new_array();\n\t\troot_for_each_workspace(ipc_get_workspaces_callback, workspaces);\n\t\tconst char *json_string = json_object_to_json_string(workspaces);\n\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t(uint32_t)strlen(json_string));\n\t\tjson_object_put(workspaces); // free\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_SUBSCRIBE:\n\t{\n\t\t// TODO: Check if they're permitted to use these events\n\t\tstruct json_object *request = json_tokener_parse(buf);\n\t\tif (request == NULL || !json_object_is_type(request, json_type_array)) {\n\t\t\tconst char msg[] = \"{\\\"success\\\": false}\";\n\t\t\tipc_send_reply(client, payload_type, msg, strlen(msg));\n\t\t\tsway_log(SWAY_INFO, \"Failed to parse subscribe request\");\n\t\t\tgoto exit_cleanup;\n\t\t}\n\n\t\tbool is_tick = false;\n\t\t// parse requested event types\n\t\tfor (size_t i = 0; i < json_object_array_length(request); i++) {\n\t\t\tconst char *event_type = json_object_get_string(json_object_array_get_idx(request, i));\n\t\t\tif (strcmp(event_type, \"workspace\") == 0) {\n\t\t\t\tclient->subscribed_events |= event_mask(IPC_EVENT_WORKSPACE);\n\t\t\t} else if (strcmp(event_type, \"barconfig_update\") == 0) {\n\t\t\t\tclient->subscribed_events |= event_mask(IPC_EVENT_BARCONFIG_UPDATE);\n\t\t\t} else if (strcmp(event_type, \"bar_state_update\") == 0) {\n\t\t\t\tclient->subscribed_events |= event_mask(IPC_EVENT_BAR_STATE_UPDATE);\n\t\t\t} else if (strcmp(event_type, \"mode\") == 0) {\n\t\t\t\tclient->subscribed_events |= event_mask(IPC_EVENT_MODE);\n\t\t\t} else if (strcmp(event_type, \"shutdown\") == 0) {\n\t\t\t\tclient->subscribed_events |= event_mask(IPC_EVENT_SHUTDOWN);\n\t\t\t} else if (strcmp(event_type, \"window\") == 0) {\n\t\t\t\tclient->subscribed_events |= event_mask(IPC_EVENT_WINDOW);\n\t\t\t} else if (strcmp(event_type, \"binding\") == 0) {\n\t\t\t\tclient->subscribed_events |= event_mask(IPC_EVENT_BINDING);\n\t\t\t} else if (strcmp(event_type, \"tick\") == 0) {\n\t\t\t\tclient->subscribed_events |= event_mask(IPC_EVENT_TICK);\n\t\t\t\tis_tick = true;\n\t\t\t} else if (strcmp(event_type, \"input\") == 0) {\n\t\t\t\tclient->subscribed_events |= event_mask(IPC_EVENT_INPUT);\n\t\t\t} else {\n\t\t\t\tconst char msg[] = \"{\\\"success\\\": false}\";\n\t\t\t\tipc_send_reply(client, payload_type, msg, strlen(msg));\n\t\t\t\tjson_object_put(request);\n\t\t\t\tsway_log(SWAY_INFO, \"Unsupported event type in subscribe request\");\n\t\t\t\tgoto exit_cleanup;\n\t\t\t}\n\t\t}\n\n\t\tjson_object_put(request);\n\t\tconst char msg[] = \"{\\\"success\\\": true}\";\n\t\tipc_send_reply(client, payload_type, msg, strlen(msg));\n\t\tif (is_tick) {\n\t\t\tconst char tickmsg[] = \"{\\\"first\\\": true, \\\"payload\\\": \\\"\\\"}\";\n\t\t\tipc_send_reply(client, IPC_EVENT_TICK, tickmsg,\n\t\t\t\tstrlen(tickmsg));\n\t\t}\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_INPUTS:\n\t{\n\t\tjson_object *inputs = json_object_new_array();\n\t\tstruct sway_input_device *device = NULL;\n\t\twl_list_for_each(device, &server.input->devices, link) {\n\t\t\tjson_object_array_add(inputs, ipc_json_describe_input(device));\n\t\t}\n\t\tconst char *json_string = json_object_to_json_string(inputs);\n\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t(uint32_t)strlen(json_string));\n\t\tjson_object_put(inputs); // free\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_SEATS:\n\t{\n\t\tjson_object *seats = json_object_new_array();\n\t\tstruct sway_seat *seat = NULL;\n\t\twl_list_for_each(seat, &server.input->seats, link) {\n\t\t\tjson_object_array_add(seats, ipc_json_describe_seat(seat));\n\t\t}\n\t\tconst char *json_string = json_object_to_json_string(seats);\n\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t(uint32_t)strlen(json_string));\n\t\tjson_object_put(seats); // free\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_TREE:\n\t{\n\t\tjson_object *tree = ipc_json_describe_node_recursive(&root->node);\n\t\tconst char *json_string = json_object_to_json_string(tree);\n\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t(uint32_t)strlen(json_string));\n\t\tjson_object_put(tree);\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_MARKS:\n\t{\n\t\tjson_object *marks = json_object_new_array();\n\t\troot_for_each_container(ipc_get_marks_callback, marks);\n\t\tconst char *json_string = json_object_to_json_string(marks);\n\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t(uint32_t)strlen(json_string));\n\t\tjson_object_put(marks);\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_VERSION:\n\t{\n\t\tjson_object *version = ipc_json_get_version();\n\t\tconst char *json_string = json_object_to_json_string(version);\n\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t(uint32_t)strlen(json_string));\n\t\tjson_object_put(version); // free\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_BAR_CONFIG:\n\t{\n\t\tif (!buf[0]) {\n\t\t\t// Send list of configured bar IDs\n\t\t\tjson_object *bars = json_object_new_array();\n\t\t\tfor (int i = 0; i < config->bars->length; ++i) {\n\t\t\t\tstruct bar_config *bar = config->bars->items[i];\n\t\t\t\tjson_object_array_add(bars, json_object_new_string(bar->id));\n\t\t\t}\n\t\t\tconst char *json_string = json_object_to_json_string(bars);\n\t\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t\t(uint32_t)strlen(json_string));\n\t\t\tjson_object_put(bars); // free\n\t\t} else {\n\t\t\t// Send particular bar's details\n\t\t\tstruct bar_config *bar = NULL;\n\t\t\tfor (int i = 0; i < config->bars->length; ++i) {\n\t\t\t\tbar = config->bars->items[i];\n\t\t\t\tif (strcmp(buf, bar->id) == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbar = NULL;\n\t\t\t}\n\t\t\tif (!bar) {\n\t\t\t\tconst char *error = \"{ \\\"success\\\": false, \\\"error\\\": \\\"No bar with that ID\\\" }\";\n\t\t\t\tipc_send_reply(client, payload_type, error,\n\t\t\t\t\t(uint32_t)strlen(error));\n\t\t\t\tgoto exit_cleanup;\n\t\t\t}\n\t\t\tjson_object *json = ipc_json_describe_bar_config(bar);\n\t\t\tconst char *json_string = json_object_to_json_string(json);\n\t\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t\t(uint32_t)strlen(json_string));\n\t\t\tjson_object_put(json); // free\n\t\t}\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_BINDING_MODES:\n\t{\n\t\tjson_object *modes = json_object_new_array();\n\t\tfor (int i = 0; i < config->modes->length; i++) {\n\t\t\tstruct sway_mode *mode = config->modes->items[i];\n\t\t\tjson_object_array_add(modes, json_object_new_string(mode->name));\n\t\t}\n\t\tconst char *json_string = json_object_to_json_string(modes);\n\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t(uint32_t)strlen(json_string));\n\t\tjson_object_put(modes); // free\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_BINDING_STATE:\n\t{\n\t\tjson_object *current_mode = ipc_json_get_binding_mode();\n\t\tconst char *json_string = json_object_to_json_string(current_mode);\n\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t(uint32_t)strlen(json_string));\n\t\tjson_object_put(current_mode); // free\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_GET_CONFIG:\n\t{\n\t\tjson_object *json = json_object_new_object();\n\t\tjson_object_object_add(json, \"config\", json_object_new_string(config->current_config));\n\t\tconst char *json_string = json_object_to_json_string(json);\n\t\tipc_send_reply(client, payload_type, json_string,\n\t\t\t(uint32_t)strlen(json_string));\n\t\tjson_object_put(json); // free\n\t\tgoto exit_cleanup;\n\t}\n\n\tcase IPC_SYNC:\n\t{\n\t\t// It was decided sway will not support this, just return success:false\n\t\tconst char msg[] = \"{\\\"success\\\": false}\";\n\t\tipc_send_reply(client, payload_type, msg, strlen(msg));\n\t\tgoto exit_cleanup;\n\t}\n\n\tdefault:\n\t\tsway_log(SWAY_INFO, \"Unknown IPC command type %x\", payload_type);\n\t\tgoto exit_cleanup;\n\t}\n\nexit_cleanup:\n\tfree(buf);\n\treturn;\n}\n\nbool ipc_send_reply(struct ipc_client *client, enum ipc_command_type payload_type,\n\t\tconst char *payload, uint32_t payload_length) {\n\tassert(payload);\n\n\tchar data[IPC_HEADER_SIZE];\n\n\tmemcpy(data, ipc_magic, sizeof(ipc_magic));\n\tmemcpy(data + sizeof(ipc_magic), &payload_length, sizeof(payload_length));\n\tmemcpy(data + sizeof(ipc_magic) + sizeof(payload_length), &payload_type, sizeof(payload_type));\n\n\twhile (client->write_buffer_len + IPC_HEADER_SIZE + payload_length >=\n\t\t\t\t client->write_buffer_size) {\n\t\tclient->write_buffer_size *= 2;\n\t}\n\n\tif (client->write_buffer_size > 4e6) { // 4 MB\n\t\tsway_log(SWAY_ERROR, \"Client write buffer too big (%zu), disconnecting client\",\n\t\t\t\tclient->write_buffer_size);\n\t\tipc_client_disconnect(client);\n\t\treturn false;\n\t}\n\n\tchar *new_buffer = realloc(client->write_buffer, client->write_buffer_size);\n\tif (!new_buffer) {\n\t\tsway_log(SWAY_ERROR, \"Unable to reallocate ipc client write buffer\");\n\t\tipc_client_disconnect(client);\n\t\treturn false;\n\t}\n\tclient->write_buffer = new_buffer;\n\n\tmemcpy(client->write_buffer + client->write_buffer_len, data, IPC_HEADER_SIZE);\n\tclient->write_buffer_len += IPC_HEADER_SIZE;\n\tmemcpy(client->write_buffer + client->write_buffer_len, payload, payload_length);\n\tclient->write_buffer_len += payload_length;\n\n\tif (!client->writable_event_source) {\n\t\tclient->writable_event_source = wl_event_loop_add_fd(\n\t\t\t\tserver.wl_event_loop, client->fd, WL_EVENT_WRITABLE,\n\t\t\t\tipc_client_handle_writable, client);\n\t}\n\n\tsway_log(SWAY_DEBUG, \"Added IPC reply of type 0x%x to client %d queue: %s\",\n\t\tpayload_type, client->fd, payload);\n\treturn true;\n}\n", "meta": {"content_hash": "20c27542041366fdb74fbe14e45cb399", "timestamp": "", "source": "github", "line_count": 961, "max_line_length": 99, "avg_line_length": 32.19146722164412, "alnum_prop": 0.68470390483579, "repo_name": "1ace/sway", "id": "1bf5a05fe543b555734ac7e6e474dcfc5992e06a", "size": "30936", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sway/ipc-server.c", "mode": "33188", "license": "mit", "language": [{"name": "C", "bytes": "1496495"}, {"name": "Meson", "bytes": "19914"}, {"name": "Python", "bytes": "5532"}, {"name": "Roff", "bytes": "2292"}, {"name": "Shell", "bytes": "10585"}]}} +{"text": "/*\n\nPackage cmp defines a set of comparator interfaces and functions,\nwith default implementations for all standard comparable types.\n\n\nCompare Results\n---------------\n\ncomparing two values results in one of the following (int) constants:\n\n\tcmp.LT = -1 // Less-Than\n\tcmp.EQ = 0 // Equal\n\tcmp.GT = 1 // Greater-Than\n\n\nType: cmp.T\n-------------\n\nType cmp.T defines an interface that allows objects to export a comparator function:\n\n\ttype T interface {\n\t\tCmp(interface{}) int\n\t}\n\n\nType: cmp.F\n-------------\n\nType cmp.F defines a stand-alone comparator function:\n\n\ttype F func(a, b interface{}) int\n\n\nDefault Implementations\n-----------------------\n\nDefault implementations are provided for all standard comparable types:\n\n * byte\n * float(32|64)\n * int & int(8|16|32|64)\n * rune\n * string\n * uint & uint(8|16|32|64)\n\nBelow are the definitions of the included int functions.\nA complimentary set of functions exists for each of the\nstandard comparable types (listed above):\n\n\t// cmp.Int is a cmp.T wrapper for basic type int.\n\t// Example:\n\t// var comparable cmp.T = cmp.Int(3)\n\ttype Int int\n\n\t// cmp.Int::Cmp fulfills the cmp.T interface.\n\t// b_ is expected to also be type cmp.Int.\n\tfunc (a Int) Cmp(b_ interface{}) int\n\n\t// cmp.F_Int is a cmp.F for type cmp.Int\n\t// i.e. You can pass cmp.F_Int to functions\n\t// requiring a cmp.F comparator\n\t// a_ and b_ are expected to be type cmp.Int.\n\tfunc F_Int(a_, b_ interface{}) int\n\n\t// F_int is a cmp.F for basic type int\n\t// i.e. You can pass cmp.F_int to functions\n\t// requiring a cmp.F comparator\n\t// a_ and b_ are expected to be basic type int.\n\tfunc F_int(a_, b_ interface{}) int\n\n\t// cmp.Compare_int is a convenience function\n\t// for explicitly comparing basic type int.\n\tfunc Compare_int(a, b int) int\n\n\nExtras\n------\n\nThe package also contains constructs for treating functions\nand closures as cmp.T interfaces. See the file \"cmp.go\" for details.\n\n\nLicense\n-------\n\nThis package is released under the MIT license.\n\nSee the file \"LICENSE\" for more details.\n\n\nContributors\n------------\n\nDavid Farrell <DavidPFarrell@yahoo.com>\n\n*/\npackage cmp\n", "meta": {"content_hash": "1477b51e850bc26937d4e659b588d133", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 84, "avg_line_length": 21.448979591836736, "alnum_prop": 0.6793529971455756, "repo_name": "iNamik/go_cmp", "id": "b913dee4c642fc515389d273212fe62f111ff416", "size": "2102", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc.go", "mode": "33188", "license": "mit", "language": [{"name": "Go", "bytes": "19996"}]}} +{"text": "<?php\n\n//include the phal .phar file\ninclude \"[phalphar]\";\n", "meta": {"content_hash": "5258b84cdef9656c70208388dce15bad", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 29, "avg_line_length": 14.75, "alnum_prop": 0.6779661016949152, "repo_name": "aparraga/phal", "id": "645fa244c831443a0ca4fbf01ccdd12a4e5f4272", "size": "59", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/index.php", "mode": "33188", "license": "mit", "language": [{"name": "Batchfile", "bytes": "1707"}, {"name": "CSS", "bytes": "163460"}, {"name": "HTML", "bytes": "11747373"}, {"name": "Java", "bytes": "410777"}, {"name": "JavaScript", "bytes": "147997"}, {"name": "PHP", "bytes": "6675966"}, {"name": "PLpgSQL", "bytes": "1325"}, {"name": "Perl", "bytes": "3594"}, {"name": "Ruby", "bytes": "578"}, {"name": "SCSS", "bytes": "16447"}, {"name": "Shell", "bytes": "5431"}, {"name": "Smarty", "bytes": "7974"}, {"name": "XSLT", "bytes": "106717"}, {"name": "Yacc", "bytes": "62595"}]}} +{"text": "title: NRO Symposium hoger onderwijs\nauthor: Klinkenberg\ndate: '2021-01-15'\nslug: nro-symposium-hoger-onderwijs\ncategories: []\ntags: []\nsubtitle: 'Nieuwe richtingen na de pandemie?'\nsummary: ''\nauthors: []\nlastmod: '2021-04-30T10:39:02+02:00'\nfeatured: no\nimage:\n caption: 'NRO Symposium'\n focal_point: ''\n preview_only: no\nprojects: []\n---\n\nBijdrage aan het NRO Symposium 2021.\n\n> Het online onderwijs brengt vraagstukken met zich mee over het op afstand of online toetsen en beoordelen van studenten. Hoe kunnen we dat nu en in de toekomst het beste vormgeven? Hoe kunnen we toetsen meer gaan gebruiken om studenten te ondersteunen bij het leren?\n\nBron: [Toetsen op afstand en monitoren van de studievoortgang](https://www.onderwijskennis.nl/nro-symposium-hoger-onderwijs-nieuwe-richtingen-na-de-pandemie/toetsen-op-afstand-en-monitoren-van-de-studievoortgang)\n\n<iframe width=\"100%\" height=\"315\" src=\"https://www.youtube.com/embed/g6MiiQzOWfI\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n\nHet [verslag van de sessie is hier te lezen](https://www.onderwijskennis.nl/nro-symposium-hoger-onderwijs-nieuwe-richtingen-na-de-pandemie/toetsen-op-afstand-en-monitoren-van-de-studievoortgang/verslag). Mijn [essay over Plaats- en tijdonafhankelijk toetsen is hier](https://www.onderwijskennis.nl/sites/onderwijskennis/files/media-files/Thema%205%20-%20Sharon%20Klinkenberg.pdf) te vinden. De overige essays van [Desir\u00e9e Joosten-ten Brinke](https://www.linkedin.com/in/desir\u00e9e-joosten-ten-brinke-15a9905/) en [Kim Schildkamp](https://www.linkedin.com/in/kim-schildkamp/) zijn [hier](https://www.onderwijskennis.nl/nro-symposium-hoger-onderwijs-nieuwe-richtingen-na-de-pandemie/toetsen-op-afstand-en-monitoren-van-de-studievoortgang) beschikbaar.\n\n", "meta": {"content_hash": "a26bb1c0e9ffa1c72b2f00c284aadbc4", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 746, "avg_line_length": 66.64285714285714, "alnum_prop": 0.7888531618435155, "repo_name": "ShKlinkenberg/site", "id": "f6fcd790b26c4b555a4186b0bf1f516188d3218d", "size": "1872", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "content/event/2021-01-15-nro-symposium-hoger-onderwijs/index.nl.md", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "19391"}, {"name": "HTML", "bytes": "46197"}, {"name": "JavaScript", "bytes": "6851"}]}} +{"text": "<!doctype html public \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<!-- $Id$ -->\n<html>\n<head>\n<title>Tapestry: Web Application Framework</title>\n</head>\n<body>\n\n<p>Provides implementations of callbacks, objects that encapsulate a server request that is deferred,\ntypically to allow a user to login or otherwise authenticate before proceeding with\nsome other activity.\n\n<p>In practice, an implementation of {@link org.apache.tapestry.IPage#validate(IRequestCycle)} or\n{@link org.apache.tapestry.IActionListener} will create a callback, and assign it as a\npersistent page property of an application-specific login page. After the login completes, it \ncan use the callback to return the user to the functionality that was deferred.\n\n<p>Another example use would be to collect billing and shipping information as part of\nan e-commerce site's checkout wizard.\n\n@author Howard Lewis Ship <a href=\"mailto:hlship@apache.org\">hlship@apache.org</a>\n\n</body>\n</html>\n", "meta": {"content_hash": "d5fa677bdfc8b7c7709a0b760fb17225", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 101, "avg_line_length": 39.75, "alnum_prop": 0.7725366876310272, "repo_name": "apache/tapestry3", "id": "662339615e5f58c53e47565cdbb8679887a2c62a", "size": "954", "binary": false, "copies": "2", "ref": "refs/heads/trunk", "path": "tapestry-framework/src/org/apache/tapestry/callback/package.html", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "11210"}, {"name": "HTML", "bytes": "199901"}, {"name": "Java", "bytes": "3116661"}, {"name": "JavaScript", "bytes": "52812"}, {"name": "Perl", "bytes": "2992"}]}} +{"text": "package core\n\nimport (\n\t\"math\"\n\n\t\"github.com/pingcap/errors\"\n\t\"github.com/pingcap/parser/ast\"\n\t\"github.com/pingcap/parser/model\"\n\t\"github.com/pingcap/parser/mysql\"\n\t\"github.com/pingcap/parser/terror\"\n\t\"github.com/pingcap/tidb/expression\"\n\t\"github.com/pingcap/tidb/expression/aggregation\"\n\t\"github.com/pingcap/tidb/planner/property\"\n\t\"github.com/pingcap/tidb/types\"\n\t\"github.com/pingcap/tidb/util/ranger\"\n)\n\nfunc (p *LogicalUnionScan) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\tus := PhysicalUnionScan{Conditions: p.conditions}.Init(p.ctx, p.stats, prop)\n\treturn []PhysicalPlan{us}\n}\n\nfunc getMaxSortPrefix(sortCols, allCols []*expression.Column) []int {\n\ttmpSchema := expression.NewSchema(allCols...)\n\tsortColOffsets := make([]int, 0, len(sortCols))\n\tfor _, sortCol := range sortCols {\n\t\toffset := tmpSchema.ColumnIndex(sortCol)\n\t\tif offset == -1 {\n\t\t\treturn sortColOffsets\n\t\t}\n\t\tsortColOffsets = append(sortColOffsets, offset)\n\t}\n\treturn sortColOffsets\n}\n\nfunc findMaxPrefixLen(candidates [][]*expression.Column, keys []*expression.Column) int {\n\tmaxLen := 0\n\tfor _, candidateKeys := range candidates {\n\t\tmatchedLen := 0\n\t\tfor i := range keys {\n\t\t\tif i < len(candidateKeys) && keys[i].Equal(nil, candidateKeys[i]) {\n\t\t\t\tmatchedLen++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif matchedLen > maxLen {\n\t\t\tmaxLen = matchedLen\n\t\t}\n\t}\n\treturn maxLen\n}\n\nfunc (p *LogicalJoin) moveEqualToOtherConditions(offsets []int) []expression.Expression {\n\totherConds := make([]expression.Expression, len(p.OtherConditions))\n\tcopy(otherConds, p.OtherConditions)\n\tfor i, eqCond := range p.EqualConditions {\n\t\tmatch := false\n\t\tfor _, offset := range offsets {\n\t\t\tif i == offset {\n\t\t\t\tmatch = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !match {\n\t\t\totherConds = append(otherConds, eqCond)\n\t\t}\n\t}\n\treturn otherConds\n}\n\n// Only if the input required prop is the prefix fo join keys, we can pass through this property.\nfunc (p *PhysicalMergeJoin) tryToGetChildReqProp(prop *property.PhysicalProperty) ([]*property.PhysicalProperty, bool) {\n\tlProp := &property.PhysicalProperty{TaskTp: property.RootTaskType, Cols: p.LeftKeys, ExpectedCnt: math.MaxFloat64}\n\trProp := &property.PhysicalProperty{TaskTp: property.RootTaskType, Cols: p.RightKeys, ExpectedCnt: math.MaxFloat64}\n\tif !prop.IsEmpty() {\n\t\t// sort merge join fits the cases of massive ordered data, so desc scan is always expensive.\n\t\tif prop.Desc {\n\t\t\treturn nil, false\n\t\t}\n\t\tif !prop.IsPrefix(lProp) && !prop.IsPrefix(rProp) {\n\t\t\treturn nil, false\n\t\t}\n\t\tif prop.IsPrefix(rProp) && p.JoinType == LeftOuterJoin {\n\t\t\treturn nil, false\n\t\t}\n\t\tif prop.IsPrefix(lProp) && p.JoinType == RightOuterJoin {\n\t\t\treturn nil, false\n\t\t}\n\t}\n\n\treturn []*property.PhysicalProperty{lProp, rProp}, true\n}\n\nfunc (p *LogicalJoin) getMergeJoin(prop *property.PhysicalProperty) []PhysicalPlan {\n\tjoins := make([]PhysicalPlan, 0, len(p.leftProperties))\n\t// The leftProperties caches all the possible properties that are provided by its children.\n\tfor _, lhsChildProperty := range p.leftProperties {\n\t\toffsets := getMaxSortPrefix(lhsChildProperty, p.LeftJoinKeys)\n\t\tif len(offsets) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tleftKeys := lhsChildProperty[:len(offsets)]\n\t\trightKeys := expression.NewSchema(p.RightJoinKeys...).ColumnsByIndices(offsets)\n\n\t\tprefixLen := findMaxPrefixLen(p.rightProperties, rightKeys)\n\t\tif prefixLen == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tleftKeys = leftKeys[:prefixLen]\n\t\trightKeys = rightKeys[:prefixLen]\n\t\toffsets = offsets[:prefixLen]\n\t\tmergeJoin := PhysicalMergeJoin{\n\t\t\tJoinType: p.JoinType,\n\t\t\tLeftConditions: p.LeftConditions,\n\t\t\tRightConditions: p.RightConditions,\n\t\t\tDefaultValues: p.DefaultValues,\n\t\t\tLeftKeys: leftKeys,\n\t\t\tRightKeys: rightKeys,\n\t\t}.Init(p.ctx, p.stats.ScaleByExpectCnt(prop.ExpectedCnt))\n\t\tmergeJoin.SetSchema(p.schema)\n\t\tmergeJoin.OtherConditions = p.moveEqualToOtherConditions(offsets)\n\t\tif reqProps, ok := mergeJoin.tryToGetChildReqProp(prop); ok {\n\t\t\tmergeJoin.childrenReqProps = reqProps\n\t\t\tjoins = append(joins, mergeJoin)\n\t\t}\n\t}\n\t// If TiDB_SMJ hint is existed && no join keys in children property,\n\t// it should to enforce merge join.\n\tif len(joins) == 0 && (p.preferJoinType&preferMergeJoin) > 0 {\n\t\treturn p.getEnforcedMergeJoin(prop)\n\t}\n\n\treturn joins\n}\n\n// Change JoinKeys order, by offsets array\n// offsets array is generate by prop check\nfunc getNewJoinKeysByOffsets(oldJoinKeys []*expression.Column, offsets []int) []*expression.Column {\n\tnewKeys := make([]*expression.Column, 0, len(oldJoinKeys))\n\tfor _, offset := range offsets {\n\t\tnewKeys = append(newKeys, oldJoinKeys[offset])\n\t}\n\tfor pos, key := range oldJoinKeys {\n\t\tisExist := false\n\t\tfor _, p := range offsets {\n\t\t\tif p == pos {\n\t\t\t\tisExist = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !isExist {\n\t\t\tnewKeys = append(newKeys, key)\n\t\t}\n\t}\n\treturn newKeys\n}\n\n// Change EqualConditions order, by offsets array\n// offsets array is generate by prop check\nfunc getNewEqualConditionsByOffsets(oldEqualCond []*expression.ScalarFunction, offsets []int) []*expression.ScalarFunction {\n\tnewEqualCond := make([]*expression.ScalarFunction, 0, len(oldEqualCond))\n\tfor _, offset := range offsets {\n\t\tnewEqualCond = append(newEqualCond, oldEqualCond[offset])\n\t}\n\tfor pos, condition := range oldEqualCond {\n\t\tisExist := false\n\t\tfor _, p := range offsets {\n\t\t\tif p == pos {\n\t\t\t\tisExist = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !isExist {\n\t\t\tnewEqualCond = append(newEqualCond, condition)\n\t\t}\n\t}\n\treturn newEqualCond\n}\n\nfunc (p *LogicalJoin) getEnforcedMergeJoin(prop *property.PhysicalProperty) []PhysicalPlan {\n\t// Check whether SMJ can satisfy the required property\n\toffsets := make([]int, 0, len(p.LeftJoinKeys))\n\tfor _, col := range prop.Cols {\n\t\tisExist := false\n\t\tfor joinKeyPos := 0; joinKeyPos < len(p.LeftJoinKeys); joinKeyPos++ {\n\t\t\tvar key *expression.Column\n\t\t\tif col.Equal(p.ctx, p.LeftJoinKeys[joinKeyPos]) {\n\t\t\t\tkey = p.LeftJoinKeys[joinKeyPos]\n\t\t\t}\n\t\t\tif col.Equal(p.ctx, p.RightJoinKeys[joinKeyPos]) {\n\t\t\t\tkey = p.RightJoinKeys[joinKeyPos]\n\t\t\t}\n\t\t\tif key == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor i := 0; i < len(offsets); i++ {\n\t\t\t\tif offsets[i] == joinKeyPos {\n\t\t\t\t\tisExist = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !isExist {\n\t\t\t\toffsets = append(offsets, joinKeyPos)\n\t\t\t}\n\t\t\tisExist = true\n\t\t\tbreak\n\t\t}\n\t\tif !isExist {\n\t\t\treturn nil\n\t\t}\n\t}\n\t// Generate the enforced sort merge join\n\tleftKeys := getNewJoinKeysByOffsets(p.LeftJoinKeys, offsets)\n\trightKeys := getNewJoinKeysByOffsets(p.RightJoinKeys, offsets)\n\tlProp := &property.PhysicalProperty{TaskTp: property.RootTaskType, Cols: leftKeys, ExpectedCnt: math.MaxFloat64, Enforced: true, Desc: prop.Desc}\n\trProp := &property.PhysicalProperty{TaskTp: property.RootTaskType, Cols: rightKeys, ExpectedCnt: math.MaxFloat64, Enforced: true, Desc: prop.Desc}\n\tenforcedPhysicalMergeJoin := PhysicalMergeJoin{\n\t\tJoinType: p.JoinType,\n\t\tLeftConditions: p.LeftConditions,\n\t\tRightConditions: p.RightConditions,\n\t\tDefaultValues: p.DefaultValues,\n\t\tLeftKeys: leftKeys,\n\t\tRightKeys: rightKeys,\n\t\tOtherConditions: p.OtherConditions,\n\t}.Init(p.ctx, p.stats.ScaleByExpectCnt(prop.ExpectedCnt))\n\tenforcedPhysicalMergeJoin.SetSchema(p.schema)\n\tenforcedPhysicalMergeJoin.childrenReqProps = []*property.PhysicalProperty{lProp, rProp}\n\treturn []PhysicalPlan{enforcedPhysicalMergeJoin}\n}\n\nfunc (p *LogicalJoin) getHashJoins(prop *property.PhysicalProperty) []PhysicalPlan {\n\tif !prop.IsEmpty() { // hash join doesn't promise any orders\n\t\treturn nil\n\t}\n\tjoins := make([]PhysicalPlan, 0, 2)\n\tswitch p.JoinType {\n\tcase SemiJoin, AntiSemiJoin, LeftOuterSemiJoin, AntiLeftOuterSemiJoin, LeftOuterJoin:\n\t\tjoins = append(joins, p.getHashJoin(prop, 1))\n\tcase RightOuterJoin:\n\t\tjoins = append(joins, p.getHashJoin(prop, 0))\n\tcase InnerJoin:\n\t\tjoins = append(joins, p.getHashJoin(prop, 1))\n\t\tjoins = append(joins, p.getHashJoin(prop, 0))\n\t}\n\treturn joins\n}\n\nfunc (p *LogicalJoin) getHashJoin(prop *property.PhysicalProperty, innerIdx int) *PhysicalHashJoin {\n\tchReqProps := make([]*property.PhysicalProperty, 2)\n\tchReqProps[innerIdx] = &property.PhysicalProperty{ExpectedCnt: math.MaxFloat64}\n\tchReqProps[1-innerIdx] = &property.PhysicalProperty{ExpectedCnt: prop.ExpectedCnt}\n\thashJoin := PhysicalHashJoin{\n\t\tEqualConditions: p.EqualConditions,\n\t\tLeftConditions: p.LeftConditions,\n\t\tRightConditions: p.RightConditions,\n\t\tOtherConditions: p.OtherConditions,\n\t\tJoinType: p.JoinType,\n\t\tConcurrency: uint(p.ctx.GetSessionVars().HashJoinConcurrency),\n\t\tDefaultValues: p.DefaultValues,\n\t\tInnerChildIdx: innerIdx,\n\t}.Init(p.ctx, p.stats.ScaleByExpectCnt(prop.ExpectedCnt), chReqProps...)\n\thashJoin.SetSchema(p.schema)\n\treturn hashJoin\n}\n\n// joinKeysMatchIndex checks whether the join key is in the index.\n// It returns a slice a[] what a[i] means keys[i] is related with indexCols[a[i]], -1 for no matching column.\n// It will return nil if there's no column that matches index.\nfunc joinKeysMatchIndex(keys, indexCols []*expression.Column, colLengths []int) []int {\n\tkeyOff2IdxOff := make([]int, len(keys))\n\tfor i := range keyOff2IdxOff {\n\t\tkeyOff2IdxOff[i] = -1\n\t}\n\t// There should be at least one column in join keys which can match the index's column.\n\tmatched := false\n\ttmpSchema := expression.NewSchema(keys...)\n\tfor i, idxCol := range indexCols {\n\t\tif colLengths[i] != types.UnspecifiedLength {\n\t\t\tcontinue\n\t\t}\n\t\tkeyOff := tmpSchema.ColumnIndex(idxCol)\n\t\tif keyOff == -1 {\n\t\t\tcontinue\n\t\t}\n\t\tmatched = true\n\t\tkeyOff2IdxOff[keyOff] = i\n\t}\n\tif !matched {\n\t\treturn nil\n\t}\n\treturn keyOff2IdxOff\n}\n\n// When inner plan is TableReader, the parameter `ranges` will be nil. Because pk only have one column. So all of its range\n// is generated during execution time.\nfunc (p *LogicalJoin) constructIndexJoin(prop *property.PhysicalProperty, innerJoinKeys, outerJoinKeys []*expression.Column, outerIdx int,\n\tinnerPlan PhysicalPlan, ranges []*ranger.Range, keyOff2IdxOff []int) []PhysicalPlan {\n\tjoinType := p.JoinType\n\touterSchema := p.children[outerIdx].Schema()\n\t// If the order by columns are not all from outer child, index join cannot promise the order.\n\tif !prop.AllColsFromSchema(outerSchema) {\n\t\treturn nil\n\t}\n\tchReqProps := make([]*property.PhysicalProperty, 2)\n\tchReqProps[outerIdx] = &property.PhysicalProperty{TaskTp: property.RootTaskType, ExpectedCnt: prop.ExpectedCnt, Cols: prop.Cols, Desc: prop.Desc}\n\tnewInnerKeys := make([]*expression.Column, 0, len(innerJoinKeys))\n\tnewOuterKeys := make([]*expression.Column, 0, len(outerJoinKeys))\n\tnewKeyOff := make([]int, 0, len(keyOff2IdxOff))\n\tnewOtherConds := make([]expression.Expression, len(p.OtherConditions), len(p.OtherConditions)+len(p.EqualConditions))\n\tcopy(newOtherConds, p.OtherConditions)\n\tfor keyOff, idxOff := range keyOff2IdxOff {\n\t\tif keyOff2IdxOff[keyOff] < 0 {\n\t\t\tnewOtherConds = append(newOtherConds, p.EqualConditions[keyOff])\n\t\t\tcontinue\n\t\t}\n\t\tnewInnerKeys = append(newInnerKeys, innerJoinKeys[keyOff])\n\t\tnewOuterKeys = append(newOuterKeys, outerJoinKeys[keyOff])\n\t\tnewKeyOff = append(newKeyOff, idxOff)\n\t}\n\tjoin := PhysicalIndexJoin{\n\t\tOuterIndex: outerIdx,\n\t\tLeftConditions: p.LeftConditions,\n\t\tRightConditions: p.RightConditions,\n\t\tOtherConditions: newOtherConds,\n\t\tJoinType: joinType,\n\t\tOuterJoinKeys: newOuterKeys,\n\t\tInnerJoinKeys: newInnerKeys,\n\t\tDefaultValues: p.DefaultValues,\n\t\tinnerPlan: innerPlan,\n\t\tKeyOff2IdxOff: newKeyOff,\n\t\tRanges: ranges,\n\t}.Init(p.ctx, p.stats.ScaleByExpectCnt(prop.ExpectedCnt), chReqProps...)\n\tjoin.SetSchema(p.schema)\n\treturn []PhysicalPlan{join}\n}\n\n// getIndexJoinByOuterIdx will generate index join by outerIndex. OuterIdx points out the outer child.\n// First of all, we'll check whether the inner child is DataSource.\n// Then, we will extract the join keys of p's equal conditions. Then check whether all of them are just the primary key\n// or match some part of on index. If so we will choose the best one and construct a index join.\nfunc (p *LogicalJoin) getIndexJoinByOuterIdx(prop *property.PhysicalProperty, outerIdx int) []PhysicalPlan {\n\tinnerChild := p.children[1-outerIdx]\n\tvar (\n\t\tinnerJoinKeys []*expression.Column\n\t\touterJoinKeys []*expression.Column\n\t)\n\tif outerIdx == 0 {\n\t\touterJoinKeys = p.LeftJoinKeys\n\t\tinnerJoinKeys = p.RightJoinKeys\n\t} else {\n\t\tinnerJoinKeys = p.LeftJoinKeys\n\t\touterJoinKeys = p.RightJoinKeys\n\t}\n\tds, isDataSource := innerChild.(*DataSource)\n\tus, isUnionScan := innerChild.(*LogicalUnionScan)\n\tif !isDataSource && !isUnionScan {\n\t\treturn nil\n\t}\n\tif isUnionScan {\n\t\tds = us.Children()[0].(*DataSource)\n\t}\n\tvar tblPath *accessPath\n\tfor _, path := range ds.possibleAccessPaths {\n\t\tif path.isTablePath {\n\t\t\ttblPath = path\n\t\t\tbreak\n\t\t}\n\t}\n\tif pkCol := ds.getPKIsHandleCol(); pkCol != nil && tblPath != nil {\n\t\tkeyOff2IdxOff := make([]int, len(innerJoinKeys))\n\t\tpkMatched := false\n\t\tfor i, key := range innerJoinKeys {\n\t\t\tif !key.Equal(nil, pkCol) {\n\t\t\t\tkeyOff2IdxOff[i] = -1\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpkMatched = true\n\t\t\tkeyOff2IdxOff[i] = 0\n\t\t}\n\t\tif pkMatched {\n\t\t\tinnerPlan := p.constructInnerTableScan(ds, pkCol, outerJoinKeys, us)\n\t\t\t// Since the primary key means one value corresponding to exact one row, this will always be a no worse one\n\t\t\t// comparing to other index.\n\t\t\treturn p.constructIndexJoin(prop, innerJoinKeys, outerJoinKeys, outerIdx, innerPlan, nil, keyOff2IdxOff)\n\t\t}\n\t}\n\tvar (\n\t\tbestIndexInfo *model.IndexInfo\n\t\trangesOfBest []*ranger.Range\n\t\tmaxUsedCols int\n\t\tremainedOfBest []expression.Expression\n\t\tkeyOff2IdxOff []int\n\t)\n\tfor _, path := range ds.possibleAccessPaths {\n\t\tif path.isTablePath {\n\t\t\tcontinue\n\t\t}\n\t\tindexInfo := path.index\n\t\tranges, remained, tmpKeyOff2IdxOff := p.buildRangeForIndexJoin(indexInfo, ds, innerJoinKeys)\n\t\t// We choose the index by the number of used columns of the range, the much the better.\n\t\t// Notice that there may be the cases like `t1.a=t2.a and b > 2 and b < 1`. So ranges can be nil though the conditions are valid.\n\t\t// But obviously when the range is nil, we don't need index join.\n\t\tif len(ranges) > 0 && len(ranges[0].LowVal) > maxUsedCols {\n\t\t\tbestIndexInfo = indexInfo\n\t\t\tmaxUsedCols = len(ranges[0].LowVal)\n\t\t\trangesOfBest = ranges\n\t\t\tremainedOfBest = remained\n\t\t\tkeyOff2IdxOff = tmpKeyOff2IdxOff\n\t\t}\n\t}\n\tif bestIndexInfo != nil {\n\t\tinnerPlan := p.constructInnerIndexScan(ds, bestIndexInfo, remainedOfBest, outerJoinKeys, us)\n\t\treturn p.constructIndexJoin(prop, innerJoinKeys, outerJoinKeys, outerIdx, innerPlan, rangesOfBest, keyOff2IdxOff)\n\t}\n\treturn nil\n}\n\n// constructInnerTableScan is specially used to construct the inner plan for PhysicalIndexJoin.\nfunc (p *LogicalJoin) constructInnerTableScan(ds *DataSource, pk *expression.Column, outerJoinKeys []*expression.Column, us *LogicalUnionScan) PhysicalPlan {\n\tranges := ranger.FullIntRange(mysql.HasUnsignedFlag(pk.RetType.Flag))\n\tts := PhysicalTableScan{\n\t\tTable: ds.tableInfo,\n\t\tColumns: ds.Columns,\n\t\tTableAsName: ds.TableAsName,\n\t\tDBName: ds.DBName,\n\t\tfilterCondition: ds.pushedDownConds,\n\t\tRanges: ranges,\n\t\trangeDecidedBy: outerJoinKeys,\n\t}.Init(ds.ctx)\n\tts.SetSchema(ds.schema)\n\n\tvar rowCount float64\n\tpkHist, ok := ds.statisticTable.Columns[pk.ID]\n\tif ok && !ds.statisticTable.Pseudo {\n\t\trowCount = pkHist.AvgCountPerValue(ds.statisticTable.Count)\n\t} else {\n\t\trowCount = ds.statisticTable.PseudoAvgCountPerValue()\n\t}\n\n\tts.stats = property.NewSimpleStats(rowCount)\n\tts.stats.UsePseudoStats = ds.statisticTable.Pseudo\n\n\tcopTask := &copTask{\n\t\ttablePlan: ts,\n\t\tindexPlanFinished: true,\n\t}\n\tts.addPushedDownSelection(copTask, ds.stats)\n\tt := finishCopTask(ds.ctx, copTask)\n\treader := t.plan()\n\treturn p.constructInnerUnionScan(us, reader)\n}\n\nfunc (p *LogicalJoin) constructInnerUnionScan(us *LogicalUnionScan, reader PhysicalPlan) PhysicalPlan {\n\tif us == nil {\n\t\treturn reader\n\t}\n\t// Use `reader.stats` instead of `us.stats` because it should be more accurate. No need to specify\n\t// childrenReqProps now since we have got reader already.\n\tphysicalUnionScan := PhysicalUnionScan{Conditions: us.conditions}.Init(us.ctx, reader.statsInfo(), nil)\n\tphysicalUnionScan.SetChildren(reader)\n\treturn physicalUnionScan\n}\n\n// constructInnerIndexScan is specially used to construct the inner plan for PhysicalIndexJoin.\nfunc (p *LogicalJoin) constructInnerIndexScan(ds *DataSource, idx *model.IndexInfo, remainedConds []expression.Expression, outerJoinKeys []*expression.Column, us *LogicalUnionScan) PhysicalPlan {\n\tis := PhysicalIndexScan{\n\t\tTable: ds.tableInfo,\n\t\tTableAsName: ds.TableAsName,\n\t\tDBName: ds.DBName,\n\t\tColumns: ds.Columns,\n\t\tIndex: idx,\n\t\tdataSourceSchema: ds.schema,\n\t\tKeepOrder: false,\n\t\tRanges: ranger.FullRange(),\n\t\trangeDecidedBy: outerJoinKeys,\n\t}.Init(ds.ctx)\n\tis.filterCondition = remainedConds\n\n\tvar rowCount float64\n\tidxHist, ok := ds.statisticTable.Indices[idx.ID]\n\tif ok && !ds.statisticTable.Pseudo {\n\t\trowCount = idxHist.AvgCountPerValue(ds.statisticTable.Count)\n\t} else {\n\t\trowCount = ds.statisticTable.PseudoAvgCountPerValue()\n\t}\n\tis.stats = property.NewSimpleStats(rowCount)\n\tis.stats.UsePseudoStats = ds.statisticTable.Pseudo\n\n\tcop := &copTask{\n\t\tindexPlan: is,\n\t}\n\tif !isCoveringIndex(ds.schema.Columns, is.Index.Columns, is.Table.PKIsHandle) {\n\t\t// On this way, it's double read case.\n\t\tts := PhysicalTableScan{Columns: ds.Columns, Table: is.Table}.Init(ds.ctx)\n\t\tts.SetSchema(is.dataSourceSchema)\n\t\tcop.tablePlan = ts\n\t}\n\n\tis.initSchema(ds.id, idx, cop.tablePlan != nil)\n\tindexConds, tblConds := splitIndexFilterConditions(remainedConds, idx.Columns, ds.tableInfo)\n\tpath := &accessPath{indexFilters: indexConds, tableFilters: tblConds, countAfterIndex: math.MaxFloat64}\n\tis.addPushedDownSelection(cop, ds, math.MaxFloat64, path)\n\tt := finishCopTask(ds.ctx, cop)\n\treader := t.plan()\n\treturn p.constructInnerUnionScan(us, reader)\n}\n\n// buildRangeForIndexJoin checks whether this index can be used for building index join and return the range if this index is ok.\n// If this index is invalid, just return nil range.\nfunc (p *LogicalJoin) buildRangeForIndexJoin(indexInfo *model.IndexInfo, innerPlan *DataSource, innerJoinKeys []*expression.Column) (\n\t[]*ranger.Range, []expression.Expression, []int) {\n\tidxCols, colLengths := expression.IndexInfo2Cols(innerPlan.Schema().Columns, indexInfo)\n\tif len(idxCols) == 0 {\n\t\treturn nil, nil, nil\n\t}\n\n\t// Extract the filter to calculate access and the filters that must be remained ones.\n\taccess, eqConds, remained, keyOff2IdxOff := p.buildFakeEqCondsForIndexJoin(innerJoinKeys, idxCols, colLengths, innerPlan.pushedDownConds)\n\n\tif len(keyOff2IdxOff) == 0 {\n\t\treturn nil, nil, nil\n\t}\n\n\t// In `buildFakeEqCondsForIndexJoin`, we construct the equal conditions for join keys and remove filters that contain the join keys' column.\n\t// When t1.a = t2.a and t1.a > 1, we can also guarantee that t1.a > 1 won't be chosen as the access condition.\n\t// So the equal conditions we built can be successfully used to build a range if they can be used. They won't be affected by the existing filters.\n\tranges, accesses, moreRemained, _, err := ranger.DetachCondAndBuildRangeForIndex(p.ctx, access, idxCols, colLengths)\n\tif err != nil {\n\t\tterror.Log(errors.Trace(err))\n\t\treturn nil, nil, nil\n\t}\n\n\t// We should guarantee that all the join's equal condition is used.\n\tfor _, eqCond := range eqConds {\n\t\tif !expression.Contains(accesses, eqCond) {\n\t\t\treturn nil, nil, nil\n\t\t}\n\t}\n\n\treturn ranges, append(remained, moreRemained...), keyOff2IdxOff\n}\n\nfunc (p *LogicalJoin) buildFakeEqCondsForIndexJoin(keys, idxCols []*expression.Column, colLengths []int,\n\tinnerFilters []expression.Expression) (accesses, eqConds, remained []expression.Expression, keyOff2IdxOff []int) {\n\t// Check whether all join keys match one column from index.\n\tkeyOff2IdxOff = joinKeysMatchIndex(keys, idxCols, colLengths)\n\tif keyOff2IdxOff == nil {\n\t\treturn nil, nil, nil, nil\n\t}\n\n\tusableKeys := make([]*expression.Column, 0, len(keys))\n\n\tconds := make([]expression.Expression, 0, len(keys)+len(innerFilters))\n\teqConds = make([]expression.Expression, 0, len(keys))\n\t// Construct a fake equal expression for every join key for calculating the range.\n\tfor i, key := range keys {\n\t\tif keyOff2IdxOff[i] < 0 {\n\t\t\tcontinue\n\t\t}\n\t\tusableKeys = append(usableKeys, key)\n\t\t// Int datum 1 can convert to all column's type(numeric type, string type, json, time type, enum, set) safely.\n\t\tfakeConstant := &expression.Constant{Value: types.NewIntDatum(1), RetType: key.GetType()}\n\t\teqFunc := expression.NewFunctionInternal(p.ctx, ast.EQ, types.NewFieldType(mysql.TypeTiny), key, fakeConstant)\n\t\tconds = append(conds, eqFunc)\n\t\teqConds = append(eqConds, eqFunc)\n\t}\n\n\t// Look into every `innerFilter`, if it contains join keys' column, put this filter into `remained` part directly.\n\tremained = make([]expression.Expression, 0, len(innerFilters))\n\tfor _, filter := range innerFilters {\n\t\taffectedCols := expression.ExtractColumns(filter)\n\t\tif expression.ColumnSliceIsIntersect(affectedCols, usableKeys) {\n\t\t\tremained = append(remained, filter)\n\t\t\tcontinue\n\t\t}\n\t\tconds = append(conds, filter)\n\t}\n\n\treturn conds, eqConds, remained, keyOff2IdxOff\n}\n\n// tryToGetIndexJoin will get index join by hints. If we can generate a valid index join by hint, the second return value\n// will be true, which means we force to choose this index join. Otherwise we will select a join algorithm with min-cost.\nfunc (p *LogicalJoin) tryToGetIndexJoin(prop *property.PhysicalProperty) ([]PhysicalPlan, bool) {\n\tif len(p.EqualConditions) == 0 {\n\t\treturn nil, false\n\t}\n\tplans := make([]PhysicalPlan, 0, 2)\n\trightOuter := (p.preferJoinType & preferLeftAsIndexInner) > 0\n\tleftOuter := (p.preferJoinType & preferRightAsIndexInner) > 0\n\tswitch p.JoinType {\n\tcase SemiJoin, AntiSemiJoin, LeftOuterSemiJoin, AntiLeftOuterSemiJoin, LeftOuterJoin:\n\t\tjoin := p.getIndexJoinByOuterIdx(prop, 0)\n\t\tif join != nil {\n\t\t\t// If the plan is not nil and matches the hint, return it directly.\n\t\t\tif leftOuter {\n\t\t\t\treturn join, true\n\t\t\t}\n\t\t\tplans = append(plans, join...)\n\t\t}\n\tcase RightOuterJoin:\n\t\tjoin := p.getIndexJoinByOuterIdx(prop, 1)\n\t\tif join != nil {\n\t\t\t// If the plan is not nil and matches the hint, return it directly.\n\t\t\tif rightOuter {\n\t\t\t\treturn join, true\n\t\t\t}\n\t\t\tplans = append(plans, join...)\n\t\t}\n\tcase InnerJoin:\n\t\tlhsCardinality := p.Children()[0].statsInfo().Count()\n\t\trhsCardinality := p.Children()[1].statsInfo().Count()\n\n\t\tleftJoins := p.getIndexJoinByOuterIdx(prop, 0)\n\t\tif leftOuter && leftJoins != nil {\n\t\t\treturn leftJoins, true\n\t\t}\n\n\t\trightJoins := p.getIndexJoinByOuterIdx(prop, 1)\n\t\tif rightOuter && rightJoins != nil {\n\t\t\treturn rightJoins, true\n\t\t}\n\n\t\tif leftJoins != nil && lhsCardinality < rhsCardinality {\n\t\t\treturn leftJoins, leftOuter\n\t\t}\n\n\t\tif rightJoins != nil && rhsCardinality < lhsCardinality {\n\t\t\treturn rightJoins, rightOuter\n\t\t}\n\n\t\tplans = append(plans, leftJoins...)\n\t\tplans = append(plans, rightJoins...)\n\t}\n\treturn plans, false\n}\n\n// LogicalJoin can generates hash join, index join and sort merge join.\n// Firstly we check the hint, if hint is figured by user, we force to choose the corresponding physical plan.\n// If the hint is not matched, it will get other candidates.\n// If the hint is not figured, we will pick all candidates.\nfunc (p *LogicalJoin) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\tmergeJoins := p.getMergeJoin(prop)\n\tif (p.preferJoinType & preferMergeJoin) > 0 {\n\t\treturn mergeJoins\n\t}\n\tjoins := make([]PhysicalPlan, 0, 5)\n\tjoins = append(joins, mergeJoins...)\n\n\tindexJoins, forced := p.tryToGetIndexJoin(prop)\n\tif forced {\n\t\treturn indexJoins\n\t}\n\tjoins = append(joins, indexJoins...)\n\n\thashJoins := p.getHashJoins(prop)\n\tif (p.preferJoinType & preferHashJoin) > 0 {\n\t\treturn hashJoins\n\t}\n\tjoins = append(joins, hashJoins...)\n\treturn joins\n}\n\n// tryToGetChildProp will check if this sort property can be pushed or not.\n// When a sort column will be replaced by scalar function, we refuse it.\n// When a sort column will be replaced by a constant, we just remove it.\nfunc (p *LogicalProjection) tryToGetChildProp(prop *property.PhysicalProperty) (*property.PhysicalProperty, bool) {\n\tnewProp := &property.PhysicalProperty{TaskTp: property.RootTaskType, ExpectedCnt: prop.ExpectedCnt}\n\tnewCols := make([]*expression.Column, 0, len(prop.Cols))\n\tfor _, col := range prop.Cols {\n\t\tidx := p.schema.ColumnIndex(col)\n\t\tswitch expr := p.Exprs[idx].(type) {\n\t\tcase *expression.Column:\n\t\t\tnewCols = append(newCols, expr)\n\t\tcase *expression.ScalarFunction:\n\t\t\treturn nil, false\n\t\t}\n\t}\n\tnewProp.Cols = newCols\n\tnewProp.Desc = prop.Desc\n\treturn newProp, true\n}\n\nfunc (p *LogicalProjection) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\tnewProp, ok := p.tryToGetChildProp(prop)\n\tif !ok {\n\t\treturn nil\n\t}\n\tproj := PhysicalProjection{\n\t\tExprs: p.Exprs,\n\t\tCalculateNoDelay: p.calculateNoDelay,\n\t\tAvoidColumnEvaluator: p.avoidColumnEvaluator,\n\t}.Init(p.ctx, p.stats.ScaleByExpectCnt(prop.ExpectedCnt), newProp)\n\tproj.SetSchema(p.schema)\n\treturn []PhysicalPlan{proj}\n}\n\nfunc (lt *LogicalTopN) getPhysTopN() []PhysicalPlan {\n\tret := make([]PhysicalPlan, 0, 3)\n\tfor _, tp := range wholeTaskTypes {\n\t\tresultProp := &property.PhysicalProperty{TaskTp: tp, ExpectedCnt: math.MaxFloat64}\n\t\ttopN := PhysicalTopN{\n\t\t\tByItems: lt.ByItems,\n\t\t\tCount: lt.Count,\n\t\t\tOffset: lt.Offset,\n\t\t}.Init(lt.ctx, lt.stats, resultProp)\n\t\tret = append(ret, topN)\n\t}\n\treturn ret\n}\n\nfunc (lt *LogicalTopN) getPhysLimits() []PhysicalPlan {\n\tprop, canPass := getPropByOrderByItems(lt.ByItems)\n\tif !canPass {\n\t\treturn nil\n\t}\n\tret := make([]PhysicalPlan, 0, 3)\n\tfor _, tp := range wholeTaskTypes {\n\t\tresultProp := &property.PhysicalProperty{TaskTp: tp, ExpectedCnt: float64(lt.Count + lt.Offset), Cols: prop.Cols, Desc: prop.Desc}\n\t\tlimit := PhysicalLimit{\n\t\t\tCount: lt.Count,\n\t\t\tOffset: lt.Offset,\n\t\t}.Init(lt.ctx, lt.stats, resultProp)\n\t\tret = append(ret, limit)\n\t}\n\treturn ret\n}\n\n// Check if this prop's columns can match by items totally.\nfunc matchItems(p *property.PhysicalProperty, items []*ByItems) bool {\n\tif len(items) < len(p.Cols) {\n\t\treturn false\n\t}\n\tfor i, col := range p.Cols {\n\t\tsortItem := items[i]\n\t\tif sortItem.Desc != p.Desc || !sortItem.Expr.Equal(nil, col) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (lt *LogicalTopN) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\tif matchItems(prop, lt.ByItems) {\n\t\treturn append(lt.getPhysTopN(), lt.getPhysLimits()...)\n\t}\n\treturn nil\n}\n\nfunc (la *LogicalApply) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\tif !prop.AllColsFromSchema(la.children[0].Schema()) { // for convenient, we don't pass through any prop\n\t\treturn nil\n\t}\n\tapply := PhysicalApply{\n\t\tPhysicalJoin: la.getHashJoin(prop, 1),\n\t\tOuterSchema: la.corCols,\n\t\trightChOffset: la.children[0].Schema().Len(),\n\t}.Init(la.ctx,\n\t\tla.stats.ScaleByExpectCnt(prop.ExpectedCnt),\n\t\t&property.PhysicalProperty{ExpectedCnt: math.MaxFloat64, Cols: prop.Cols, Desc: prop.Desc},\n\t\t&property.PhysicalProperty{ExpectedCnt: math.MaxFloat64})\n\tapply.SetSchema(la.schema)\n\treturn []PhysicalPlan{apply}\n}\n\n// exhaustPhysicalPlans is only for implementing interface. DataSource and Dual generate task in `findBestTask` directly.\nfunc (p *baseLogicalPlan) exhaustPhysicalPlans(_ *property.PhysicalProperty) []PhysicalPlan {\n\tpanic(\"baseLogicalPlan.exhaustPhysicalPlans() should never be called.\")\n}\n\nfunc (la *LogicalAggregation) getStreamAggs(prop *property.PhysicalProperty) []PhysicalPlan {\n\tif len(la.possibleProperties) == 0 {\n\t\treturn nil\n\t}\n\tfor _, aggFunc := range la.AggFuncs {\n\t\tif aggFunc.Mode == aggregation.FinalMode {\n\t\t\treturn nil\n\t\t}\n\t}\n\t// group by a + b is not interested in any order.\n\tif len(la.groupByCols) != len(la.GroupByItems) {\n\t\treturn nil\n\t}\n\n\tstreamAggs := make([]PhysicalPlan, 0, len(la.possibleProperties)*(len(wholeTaskTypes)-1))\n\tchildProp := &property.PhysicalProperty{\n\t\tDesc: prop.Desc,\n\t\tExpectedCnt: math.Max(prop.ExpectedCnt*la.inputCount/la.stats.RowCount, prop.ExpectedCnt),\n\t}\n\n\tfor _, possibleChildProperty := range la.possibleProperties {\n\t\tsortColOffsets := getMaxSortPrefix(possibleChildProperty, la.groupByCols)\n\t\tif len(sortColOffsets) != len(la.groupByCols) {\n\t\t\tcontinue\n\t\t}\n\n\t\tchildProp.Cols = possibleChildProperty[:len(sortColOffsets)]\n\t\tif !prop.IsPrefix(childProp) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// The table read of \"CopDoubleReadTaskType\" can't promises the sort\n\t\t// property that the stream aggregation required, no need to consider.\n\t\tfor _, taskTp := range []property.TaskType{property.CopSingleReadTaskType, property.RootTaskType} {\n\t\t\tcopiedChildProperty := new(property.PhysicalProperty)\n\t\t\t*copiedChildProperty = *childProp // It's ok to not deep copy the \"cols\" field.\n\t\t\tcopiedChildProperty.TaskTp = taskTp\n\n\t\t\tagg := basePhysicalAgg{\n\t\t\t\tGroupByItems: la.GroupByItems,\n\t\t\t\tAggFuncs: la.AggFuncs,\n\t\t\t}.initForStream(la.ctx, la.stats.ScaleByExpectCnt(prop.ExpectedCnt), copiedChildProperty)\n\t\t\tagg.SetSchema(la.schema.Clone())\n\t\t\tstreamAggs = append(streamAggs, agg)\n\t\t}\n\t}\n\treturn streamAggs\n}\n\nfunc (la *LogicalAggregation) getHashAggs(prop *property.PhysicalProperty) []PhysicalPlan {\n\tif !prop.IsEmpty() {\n\t\treturn nil\n\t}\n\thashAggs := make([]PhysicalPlan, 0, len(wholeTaskTypes))\n\tfor _, taskTp := range wholeTaskTypes {\n\t\tagg := basePhysicalAgg{\n\t\t\tGroupByItems: la.GroupByItems,\n\t\t\tAggFuncs: la.AggFuncs,\n\t\t}.initForHash(la.ctx, la.stats.ScaleByExpectCnt(prop.ExpectedCnt), &property.PhysicalProperty{ExpectedCnt: math.MaxFloat64, TaskTp: taskTp})\n\t\tagg.SetSchema(la.schema.Clone())\n\t\thashAggs = append(hashAggs, agg)\n\t}\n\treturn hashAggs\n}\n\nfunc (la *LogicalAggregation) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\taggs := make([]PhysicalPlan, 0, len(la.possibleProperties)+1)\n\taggs = append(aggs, la.getHashAggs(prop)...)\n\taggs = append(aggs, la.getStreamAggs(prop)...)\n\treturn aggs\n}\n\nfunc (p *LogicalSelection) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\tsel := PhysicalSelection{\n\t\tConditions: p.Conditions,\n\t}.Init(p.ctx, p.stats.ScaleByExpectCnt(prop.ExpectedCnt), prop)\n\treturn []PhysicalPlan{sel}\n}\n\nfunc (p *LogicalLimit) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\tif !prop.IsEmpty() {\n\t\treturn nil\n\t}\n\tret := make([]PhysicalPlan, 0, len(wholeTaskTypes))\n\tfor _, tp := range wholeTaskTypes {\n\t\tresultProp := &property.PhysicalProperty{TaskTp: tp, ExpectedCnt: float64(p.Count + p.Offset)}\n\t\tlimit := PhysicalLimit{\n\t\t\tOffset: p.Offset,\n\t\t\tCount: p.Count,\n\t\t}.Init(p.ctx, p.stats, resultProp)\n\t\tret = append(ret, limit)\n\t}\n\treturn ret\n}\n\nfunc (p *LogicalLock) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\tlock := PhysicalLock{\n\t\tLock: p.Lock,\n\t}.Init(p.ctx, p.stats.ScaleByExpectCnt(prop.ExpectedCnt), prop)\n\treturn []PhysicalPlan{lock}\n}\n\nfunc (p *LogicalUnionAll) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\t// TODO: UnionAll can not pass any order, but we can change it to sort merge to keep order.\n\tif !prop.IsEmpty() {\n\t\treturn nil\n\t}\n\tchReqProps := make([]*property.PhysicalProperty, 0, len(p.children))\n\tfor range p.children {\n\t\tchReqProps = append(chReqProps, &property.PhysicalProperty{ExpectedCnt: prop.ExpectedCnt})\n\t}\n\tua := PhysicalUnionAll{}.Init(p.ctx, p.stats.ScaleByExpectCnt(prop.ExpectedCnt), chReqProps...)\n\tua.SetSchema(p.Schema())\n\treturn []PhysicalPlan{ua}\n}\n\nfunc (ls *LogicalSort) getPhysicalSort(prop *property.PhysicalProperty) *PhysicalSort {\n\tps := PhysicalSort{ByItems: ls.ByItems}.Init(ls.ctx, ls.stats.ScaleByExpectCnt(prop.ExpectedCnt), &property.PhysicalProperty{ExpectedCnt: math.MaxFloat64})\n\treturn ps\n}\n\nfunc (ls *LogicalSort) getNominalSort(reqProp *property.PhysicalProperty) *NominalSort {\n\tprop, canPass := getPropByOrderByItems(ls.ByItems)\n\tif !canPass {\n\t\treturn nil\n\t}\n\tprop.ExpectedCnt = reqProp.ExpectedCnt\n\tps := NominalSort{}.Init(ls.ctx, prop)\n\treturn ps\n}\n\nfunc (ls *LogicalSort) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\tif matchItems(prop, ls.ByItems) {\n\t\tret := make([]PhysicalPlan, 0, 2)\n\t\tret = append(ret, ls.getPhysicalSort(prop))\n\t\tns := ls.getNominalSort(prop)\n\t\tif ns != nil {\n\t\t\tret = append(ret, ns)\n\t\t}\n\t\treturn ret\n\t}\n\treturn nil\n}\n\nfunc (p *LogicalMaxOneRow) exhaustPhysicalPlans(prop *property.PhysicalProperty) []PhysicalPlan {\n\tif !prop.IsEmpty() {\n\t\treturn nil\n\t}\n\tmor := PhysicalMaxOneRow{}.Init(p.ctx, p.stats, &property.PhysicalProperty{ExpectedCnt: 2})\n\treturn []PhysicalPlan{mor}\n}\n", "meta": {"content_hash": "c22be47591c7239de75e8374baff00e8", "timestamp": "", "source": "github", "line_count": 924, "max_line_length": 195, "avg_line_length": 35.06060606060606, "alnum_prop": 0.7276206939128288, "repo_name": "mccxj/tidb", "id": "67afd825f923b1dc46ceee9aa6b5f2467c24f960", "size": "32911", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "planner/core/exhaust_physical_plans.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Dockerfile", "bytes": "629"}, {"name": "Go", "bytes": "7562445"}, {"name": "Makefile", "bytes": "5675"}, {"name": "Shell", "bytes": "11200"}]}} +{"text": "listing-bytestring\n==================\n\nlisting instance for bytestring", "meta": {"content_hash": "fba0b08bf7a9f969cdbeb4d1c1be5ca4", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 31, "avg_line_length": 17.5, "alnum_prop": 0.6428571428571429, "repo_name": "nanonaren/listing-bytestring", "id": "41a800072d3d1410fab06bce4c80611ba25a1027", "size": "70", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Haskell", "bytes": "1144"}]}} +{"text": "\npackage org.apache.ode.bpel.memdao;\n\nimport org.apache.ode.bpel.common.ProcessState;\nimport org.apache.ode.bpel.evt.ProcessInstanceEvent;\nimport org.apache.ode.bpel.iapi.ProcessConf.CLEANUP_CATEGORY;\nimport org.apache.ode.dao.bpel.ActivityRecoveryDAO;\nimport org.apache.ode.dao.bpel.BpelDAOConnection;\nimport org.apache.ode.dao.bpel.CorrelationSetDAO;\nimport org.apache.ode.dao.bpel.CorrelatorDAO;\nimport org.apache.ode.dao.bpel.FaultDAO;\nimport org.apache.ode.dao.bpel.MessageExchangeDAO;\nimport org.apache.ode.dao.bpel.ProcessDAO;\nimport org.apache.ode.dao.bpel.ProcessInstanceDAO;\nimport org.apache.ode.dao.bpel.ScopeDAO;\nimport org.apache.ode.dao.bpel.XmlDataDAO;\nimport org.apache.ode.utils.QNameUtils;\nimport org.w3c.dom.Element;\n\nimport javax.xml.namespace.QName;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.HashSet;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\n\n/**\n * A very simple, in-memory implementation of the {@link ProcessInstanceDAO}\n * interface.\n */\npublic class ProcessInstanceDaoImpl extends DaoBaseImpl implements ProcessInstanceDAO {\n private static final Collection<ScopeDAO> EMPTY_SCOPE_DAOS = Collections.emptyList();\n\n private short _previousState;\n private short _state;\n private Long _instanceId;\n private ProcessDaoImpl _processDao;\n private Object _soup;\n private Map<Long, ScopeDAO> _scopes = new HashMap<Long, ScopeDAO>();\n private Map<String, List<ScopeDAO>> _scopesByName = new HashMap<String, List<ScopeDAO>>();\n private Map<String, byte[]> _messageExchanges = new HashMap<String, byte[]>();\n private ScopeDAO _rootScope;\n private FaultDAO _fault;\n private CorrelatorDAO _instantiatingCorrelator;\n private BpelDAOConnection _conn;\n private int _failureCount;\n private Date _failureDateTime;\n private Map<String, ActivityRecoveryDAO> _activityRecoveries = new HashMap<String, ActivityRecoveryDAO>();\n\n // TODO: Remove this, we should be using the main event store...\n private List<ProcessInstanceEvent> _events = new ArrayList<ProcessInstanceEvent>();\n private Date _lastActive;\n private int _seq;\n\n ProcessInstanceDaoImpl(BpelDAOConnection conn, ProcessDaoImpl processDao, CorrelatorDAO correlator) {\n _state = 0;\n _processDao = processDao;\n _instantiatingCorrelator = correlator;\n _soup = null;\n _instanceId = IdGen.newProcessId();\n _conn = conn;\n }\n\n public XmlDataDAO[] getVariables(String variableName, int scopeModelId) {\n ArrayList<XmlDataDAO> res = new ArrayList<XmlDataDAO>();\n for (ScopeDAO scope : _scopes.values()) {\n if (scope.getModelId() == scopeModelId) {\n XmlDataDAO xmld = scope.getVariable(variableName);\n if (xmld != null)\n res.add(xmld);\n }\n }\n return res.toArray(new XmlDataDAO[res.size()]);\n }\n\n public Set<CorrelationSetDAO> getCorrelationSets() {\n HashSet<CorrelationSetDAO> res = new HashSet<CorrelationSetDAO>();\n for (ScopeDAO scopeDAO : _scopes.values()) {\n res.addAll(scopeDAO.getCorrelationSets());\n }\n return res;\n }\n\n public CorrelationSetDAO getCorrelationSet(String name) {\n for (ScopeDAO scopeDAO : _scopes.values()) {\n if (scopeDAO.getCorrelationSet(name) != null)\n return scopeDAO.getCorrelationSet(name);\n }\n return null;\n }\n\n public void setFault(QName name, String explanation, int lineNo, int activityId, Element faultData) {\n _fault = new FaultDaoImpl(QNameUtils.fromQName(name), explanation, faultData, lineNo, activityId);\n }\n\n public void setFault(FaultDAO fault) {\n _fault = fault;\n }\n\n public FaultDAO getFault() {\n return _fault;\n }\n\n /**\n * @see ProcessInstanceDAO#getExecutionState()\n */\n public byte[] getExecutionState() {\n throw new IllegalStateException(\"In-memory instances are never serialized\");\n }\n\n public void setExecutionState(byte[] bytes) {\n throw new IllegalStateException(\"In-memory instances are never serialized\");\n }\n\n public Object getSoup() {\n return _soup;\n }\n\n public void setSoup(Object soup) {\n _soup = soup;\n }\n\n public byte[] getMessageExchange(String identifier) {\n byte[] mex = _messageExchanges.get(identifier);\n assert (mex != null);\n return mex;\n }\n\n /**\n * @see ProcessInstanceDAO#getProcess()\n */\n public ProcessDAO getProcess() {\n return _processDao;\n }\n\n /**\n * @see ProcessInstanceDAO#getRootScope()\n */\n public ScopeDAO getRootScope() {\n return _rootScope;\n }\n\n /**\n * @see ProcessInstanceDAO#setState(short)\n */\n public void setState(short state) {\n _previousState = _state;\n _state = state;\n if (state == ProcessState.STATE_TERMINATED) {\n for (CorrelatorDAO correlatorDAO : _processDao.getCorrelators()) {\n correlatorDAO.removeRoutes(null, this);\n }\n }\n }\n\n /**\n * @see ProcessInstanceDAO#getState()\n */\n public short getState() {\n return _state;\n }\n\n public void addMessageExchange(String identifier, byte[] data) {\n assert (!_messageExchanges.containsKey(identifier));\n _messageExchanges.put(identifier, data);\n }\n\n public ScopeDAO createScope(ScopeDAO parentScope, String scopeType, int scopeModelId) {\n ScopeDaoImpl newScope = new ScopeDaoImpl(this, parentScope, scopeType, scopeModelId);\n _scopes.put(newScope.getScopeInstanceId(), newScope);\n List<ScopeDAO> namedScopes = _scopesByName.get(scopeType);\n if (namedScopes == null) {\n namedScopes = new LinkedList<ScopeDAO>();\n _scopesByName.put(scopeType, namedScopes);\n }\n namedScopes.add(newScope);\n if (parentScope == null) {\n assert _rootScope == null;\n _rootScope = newScope;\n }\n\n return newScope;\n }\n\n public Long getInstanceId() {\n return _instanceId;\n }\n\n /**\n * @see org.apache.ode.dao.bpel.ProcessInstanceDAO#getScope(java.lang.Long)\n */\n public ScopeDAO getScope(Long scopeInstanceId) {\n return _scopes.get(scopeInstanceId);\n }\n\n public List<ProcessInstanceEvent> getEvents(int idx, int count) {\n int sidx = Math.max(idx, 0);\n sidx = Math.min(sidx, _events.size() - 1);\n int eidx = Math.min(sidx + count, _events.size());\n return _events.subList(sidx, eidx);\n }\n\n /**\n * @see org.apache.ode.dao.bpel.ProcessInstanceDAO#insertBpelEvent(org.apache.ode.bpel.evt.ProcessInstanceEvent)\n */\n public void insertBpelEvent(ProcessInstanceEvent event) {\n _events.add(event);\n }\n\n public int getEventCount() {\n return _events.size();\n }\n\n /**\n * @see org.apache.ode.dao.bpel.ProcessInstanceDAO#getInstantiatingCorrelator()\n */\n public CorrelatorDAO getInstantiatingCorrelator() {\n return _instantiatingCorrelator;\n }\n\n /**\n * @see org.apache.ode.dao.bpel.ProcessInstanceDAO#getScopes(java.lang.String)\n */\n public Collection<ScopeDAO> getScopes(String scopeName) {\n List<ScopeDAO> scopes = _scopesByName.get(scopeName);\n return (scopes == null ? EMPTY_SCOPE_DAOS : scopes);\n }\n\n /**\n * @see org.apache.ode.dao.bpel.ProcessInstanceDAO#getPreviousState()\n */\n public short getPreviousState() {\n return _previousState;\n }\n\n /**\n * @see org.apache.ode.dao.bpel.ProcessInstanceDAO#getLastActiveTime()\n */\n public Date getLastActiveTime() {\n return _lastActive;\n }\n\n /**\n * @see org.apache.ode.dao.bpel.ProcessInstanceDAO#setLastActiveTime(java.util.Date)\n */\n public void setLastActiveTime(Date dt) {\n _lastActive = dt;\n }\n\n /**\n * @see org.apache.ode.dao.bpel.ProcessInstanceDAO#finishCompletion()\n */\n public void finishCompletion() {\n // make sure we have completed.\n assert (ProcessState.isFinished(this.getState()));\n // let our process know that we've done our work.\n this.getProcess().instanceCompleted(this);\n }\n\n public void delete(Set<CLEANUP_CATEGORY> cleanupCategories) {\n delete(cleanupCategories, true);\n }\n\n public void delete(Set<CLEANUP_CATEGORY> cleanupCategories, boolean deleteMyRoleMex) {\n _processDao._instances.remove(_instanceId);\n }\n\n public Collection<ScopeDAO> getScopes() {\n return _scopes.values();\n }\n\n public EventsFirstLastCountTuple getEventsFirstLastCount() {\n EventsFirstLastCountTuple ret = new EventsFirstLastCountTuple();\n ret.count = _events.size();\n Date first = new Date();\n Date last = new Date(0);\n for (ProcessInstanceEvent event : _events) {\n if (event.getTimestamp().before(first))\n first = event.getTimestamp();\n if (event.getTimestamp().after(last))\n last = event.getTimestamp();\n }\n ret.first = first;\n ret.last = last;\n return ret;\n }\n\n public int getActivityFailureCount() {\n return _failureCount;\n }\n\n public Date getActivityFailureDateTime() {\n return _failureDateTime;\n }\n\n public Collection<ActivityRecoveryDAO> getActivityRecoveries() {\n return _activityRecoveries.values();\n }\n\n public void createActivityRecovery(String channel, long activityId, String reason, Date dateTime, Element data,\n String[] actions, int retries) {\n _activityRecoveries\n .put(channel, new ActivityRecoveryDAOImpl(channel, activityId, reason, dateTime, data, actions, retries));\n _failureCount = _activityRecoveries.size();\n _failureDateTime = dateTime;\n }\n\n public void deleteActivityRecovery(String channel) {\n _activityRecoveries.remove(channel);\n _failureCount = _activityRecoveries.size();\n }\n\n public synchronized long genMonotonic() {\n return ++_seq;\n }\n\n static class ActivityRecoveryDAOImpl implements ActivityRecoveryDAO {\n\n private long _activityId;\n\n private String _channel;\n\n private String _reason;\n\n private Element _details;\n\n private Date _dateTime;\n\n private String _actions;\n\n private int _retries;\n\n ActivityRecoveryDAOImpl(String channel, long activityId, String reason, Date dateTime, Element details, String[] actions,\n int retries) {\n _activityId = activityId;\n _channel = channel;\n _reason = reason;\n _details = details;\n _dateTime = dateTime;\n _actions = actions[0];\n for (int i = 1; i < actions.length; ++i)\n _actions += \" \" + actions[i];\n _retries = retries;\n }\n\n public long getActivityId() {\n return _activityId;\n }\n\n public String getChannel() {\n return _channel;\n }\n\n public String getReason() {\n return _reason;\n }\n\n public Element getDetails() {\n return _details;\n }\n\n public Date getDateTime() {\n return _dateTime;\n }\n\n public String getActions() {\n return _actions;\n }\n\n public String[] getActionsList() {\n return _actions.split(\" \");\n }\n\n public int getRetries() {\n return _retries;\n }\n\n }\n\n void removeRoutes(String routeGroupId) {\n for (CorrelatorDaoImpl correlator : _processDao._correlators.values())\n correlator._removeRoutes(routeGroupId, this);\n }\n\n public BpelDAOConnection getConnection() {\n return _conn;\n }\n\n public String toString() {\n return \"mem.instance(type=\" + _processDao.getType() + \" iid=\" + _instanceId + \")\";\n }\n\n public Collection<String> getMessageExchangeIds() {\n return _messageExchanges.keySet();\n }\n}\n", "meta": {"content_hash": "0ffeaded8ab79f0a9e1b7b546c786994", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 129, "avg_line_length": 30.468827930174562, "alnum_prop": 0.6341463414634146, "repo_name": "riftsaw/riftsaw-ode", "id": "c25bd46cdb69f61965a908d628b8fdb1ea82dc46", "size": "13026", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/ProcessInstanceDaoImpl.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "HTML", "bytes": "14386"}, {"name": "Java", "bytes": "3864567"}, {"name": "XSLT", "bytes": "4334"}]}} +{"text": "package factory.company;\n\nimport factory.project.SoftwareProject;\n\npublic abstract class SWCompnay {\n\n//\tFactory method let child imp \n\tprotected abstract SoftwareProject createSoftwareProject(String type);\n\n\tpublic SoftwareProject releaseSoftwareProject(String type){\n\t\tSoftwareProject mSoftwareProject;\n\t\tmSoftwareProject = createSoftwareProject(type);\n\t\tmSoftwareProject.prepare();\n\t\tmSoftwareProject.Run();\n\t\treturn mSoftwareProject;\n\t}\n}\n", "meta": {"content_hash": "41dfb83e42cc789ded1de07f2ab4e883", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 71, "avg_line_length": 26.058823529411764, "alnum_prop": 0.8126410835214447, "repo_name": "DeyuGoGo/EasyJavaDesignPatterns", "id": "7a2387b030749e7c53c30b57dbcb4625e8751d23", "size": "443", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "HeadFirstDesignPatterns/src/factory/company/SWCompnay.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "49506"}]}} +{"text": "\npackage com.restfb.types.instagram;\n\nimport java.util.Date;\n\nimport com.restfb.Facebook;\nimport com.restfb.types.FacebookType;\n\nimport lombok.Getter;\nimport lombok.Setter;\n\npublic class IgMediaChild extends FacebookType {\n\n private static final long serialVersionUID = 1L;\n\n @Getter\n @Setter\n @Facebook(\"ig_id\")\n private String igId;\n\n /**\n * Media type. Can be CAROUSEL_ALBUM, IMAGE, or VIDEO.\n */\n @Getter\n @Setter\n @Facebook(\"media_type\")\n private String mediaType;\n\n /**\n * Media URL. Will be omitted from responses if the media contains copyrighted material, or has been flagged for a\n * copyright violation.\n */\n @Getter\n @Setter\n @Facebook(\"media_url\")\n private String mediaUrl;\n\n /**\n * Surface where the media is published. Can be AD, FEED, or STORY.\n */\n @Getter\n @Setter\n @Facebook(\"media_product_type\")\n private String mediaProductType;\n\n /**\n * ID of Instagram user who created the media. Only returned if the app user making the query also created the media,\n * otherwise <code>username</code> field will be returned instead.\n *\n * @deprecated with Graph API 12 or December 13, 2021 for all versions\n */\n @Getter\n @Setter\n @Facebook\n @Deprecated\n private IgUser owner;\n\n /**\n * Permanent URL to the media.\n */\n @Getter\n @Setter\n @Facebook\n private String permalink;\n\n /**\n * Shortcode to the media.\n */\n @Getter\n @Setter\n @Facebook\n private String shortcode;\n\n /**\n * Media thumbnail URL. Only available on VIDEO media.\n */\n @Getter\n @Setter\n @Facebook(\"thumbnail_url\")\n private String thumbnailUrl;\n\n /**\n * ISO 8601 formatted creation date in UTC (default is UTC \u00b100:00)\n */\n @Getter\n @Setter\n @Facebook\n private Date timestamp;\n\n /**\n * Username of user who created the media.\n */\n @Getter\n @Setter\n @Facebook\n private String username;\n}\n", "meta": {"content_hash": "3ba951a33e1329ccb33dcfa330ecc048", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 119, "avg_line_length": 19.082474226804123, "alnum_prop": 0.678011885467315, "repo_name": "restfb/restfb", "id": "42492b93e2887285b8c3e26a227ea279939cdd20", "size": "2989", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/lombok/com/restfb/types/instagram/IgMediaChild.java", "mode": "33188", "license": "mit", "language": [{"name": "Java", "bytes": "2869223"}]}} +{"text": "package com.gdn.venice.server.app.finance.presenter.commands;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\n\nimport com.djarum.raf.utilities.JPQLAdvancedQueryCriteria;\nimport com.djarum.raf.utilities.Locator;\nimport com.gdn.venice.client.app.DataNameTokens;\nimport com.gdn.venice.facade.FinPeriodSessionEJBRemote;\nimport com.gdn.venice.persistence.FinPeriod;\nimport com.gdn.venice.server.command.RafDsCommand;\nimport com.gdn.venice.server.data.RafDsRequest;\nimport com.gdn.venice.server.data.RafDsResponse;\n\n/**\n *This is Datasource-style presenter command use for fetching period data\n * \n * <p>\n * <b>author:</b> <a href=\"mailto:christian.suwuh@pwsindonesia.com\">Christian Suwuh</a>\n * <p>\n * <b>version:</b> 1.0\n * <p>\n * <b>since:</b> 2011\n *\n */\npublic class FetchPeriodDataCommand implements RafDsCommand {\n\n\tRafDsRequest request;\n\t\n\t/**\n\t * Basic constructor for Fetch Period data\n\t * @param request\n\t */\n\tpublic FetchPeriodDataCommand(RafDsRequest rafDsRequest) {\n\n\t\tthis.request = rafDsRequest;\t\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.gdn.venice.server.command.RafDsCommand#execute()\n\t */\n\t@Override\n\tpublic RafDsResponse execute() {\n\n\t\tRafDsResponse rafDsResponse = new RafDsResponse();\n\t\tList<HashMap<String, String>> dataList= new ArrayList<HashMap<String, String>>();\n\t\tLocator<FinPeriod> periodLocator=null;\n\t\t\n\t\ttry{\n\t\t\tperiodLocator = new Locator<FinPeriod>();\n\t\t\t\n\t\t\tFinPeriodSessionEJBRemote finPeriodSessionHome = (FinPeriodSessionEJBRemote) periodLocator.lookup(FinPeriodSessionEJBRemote.class, \"FinPeriodSessionEJBBean\");\n\t\t\t\n\t\t\t/*\n\t\t\t * This is the list that will be used to fetch the periods\n\t\t\t */\n\t\t\tList<FinPeriod> finPeriodList = null;\n\t\t\t\n\t\t\tJPQLAdvancedQueryCriteria criteria = request.getCriteria();\t\t\t\n\t\t\n\t\t\tif (criteria == null) {\n\t\t\t\tString query = \"select o from FinPeriod o\";\t\t\t\n\t\t\t\tfinPeriodList = finPeriodSessionHome.queryByRange(query, 0, 50);\n\t\t\t} else {\n\t\t\t\tFinPeriod finPeriod = new FinPeriod();\n\t\t\t\tfinPeriodList = finPeriodSessionHome.findByFinPeriodLike(finPeriod, criteria, 0, 0);\n\t\t\t}\n\t\t\t\t\n\t\t\t/*\n\t\t\t * Map the data into a map for populating the dataList\n\t\t\t */\n\t\t\tfor(FinPeriod period:finPeriodList){\n\t\t\t\tHashMap<String, String> map = new HashMap<String, String>();\n\t\t\t\tmap.put(DataNameTokens.FINPERIOD_PERIODID, period.getPeriodId()!=null?period.getPeriodId().toString():\"\");\n\t\t\t\tmap.put(DataNameTokens.FINPERIOD_PERIODDESC, period.getPeriodDesc()!=null?period.getPeriodDesc():\"\");\n\t\t\t\tmap.put(DataNameTokens.FINPERIOD_FROMDATETIME, period.getFromDatetime()!=null?period.getFromDatetime().toString():\"\");\n\t\t\t\tmap.put(DataNameTokens.FINPERIOD_TODATETIME, period.getToDatetime()!=null?period.getToDatetime().toString():\"\");\n\t\t\t\tdataList.add(map);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Initialize the data source response settings\n\t\t\t */\n\t\t\trafDsResponse.setStatus(0);\n\t\t\trafDsResponse.setStartRow(request.getStartRow());\n\t\t\trafDsResponse.setTotalRows(finPeriodList.size());\n\t\t\trafDsResponse.setEndRow(request.getStartRow()+finPeriodList.size());\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\trafDsResponse.setStatus(-1);\n\t\t}finally{\n\t\t\ttry{\n\t\t\t\tif(periodLocator!=null){\n\t\t\t\t\tperiodLocator.close();\n\t\t\t\t}\n\t\t\t}catch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\trafDsResponse.setData(dataList);\n\t\treturn rafDsResponse;\n\t}\n\n}", "meta": {"content_hash": "00d30a512380c14df3702edd74ae67a8", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 161, "avg_line_length": 31.0188679245283, "alnum_prop": 0.7271897810218978, "repo_name": "yauritux/venice-legacy", "id": "33e42b6f905b122dc3140660b9e7eb6182ed1331", "size": "3288", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Venice/Venice-Web/src/main/java/com/gdn/venice/server/app/finance/presenter/commands/FetchPeriodDataCommand.java", "mode": "33188", "license": "apache-2.0", "language": [{"name": "ASP", "bytes": "270052"}, {"name": "ActionScript", "bytes": "241582"}, {"name": "C#", "bytes": "77780"}, {"name": "CSS", "bytes": "281718"}, {"name": "Java", "bytes": "19297374"}, {"name": "JavaScript", "bytes": "426505"}, {"name": "PHP", "bytes": "443666"}, {"name": "Perl", "bytes": "1716"}, {"name": "Ruby", "bytes": "152554"}, {"name": "Visual Basic", "bytes": "71378"}, {"name": "XSLT", "bytes": "207588"}]}} +{"text": "require \"sidekiq/testing/inline\"\nrequire_relative \"../../test/support/sidekiq_test_helpers\"\n\nWorld(SidekiqTestHelpers)\n\nAround(\"@without-delay or @not-quite-as-fake-search\") do |_scenario, block|\n Sidekiq::Testing.inline! do\n block.call\n end\nend\n\nAround(\"@disable-sidekiq-test-mode\") do |_scenario, block|\n with_real_sidekiq do\n block.call\n end\nend\n", "meta": {"content_hash": "14db47d6e92ac1e9a95dd57b294023cb", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 75, "avg_line_length": 22.4375, "alnum_prop": 0.7270194986072424, "repo_name": "alphagov/whitehall", "id": "15199882ad39ef7529d55c7e88664205ed8c76fa", "size": "359", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "features/support/sidekiq.rb", "mode": "33188", "license": "mit", "language": [{"name": "Dockerfile", "bytes": "3039"}, {"name": "Gherkin", "bytes": "82444"}, {"name": "HTML", "bytes": "695467"}, {"name": "JavaScript", "bytes": "250602"}, {"name": "Procfile", "bytes": "117"}, {"name": "Ruby", "bytes": "5239261"}, {"name": "SCSS", "bytes": "180354"}, {"name": "Shell", "bytes": "3870"}]}} +{"text": "import $ from 'jquery';\nimport * as Backbone from 'backbone';\nimport project_tpl from '../templates/project-tpl.js';\n\nclass ProjectView extends Backbone.View {\n initialize(options) {\n this.parentEl = options.parentEl;\n\n // listeners\n this.listenTo(this.model, 'view:remove', this.detach);\n this.listenTo(this.model, 'view:restore', this.render);\n\n let isActive = this.model.get(\"active\") == \"true\";\n\n var monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"\n ];\n\n let startDateParts = /^(\\d{4})-?(\\d{2})?-?(\\d{2})?/.exec(this.model.get(\"start\"));\n let startYear = startDateParts ? startDateParts[1] : null;\n let startMonth = startDateParts ? startDateParts[2] : null;\n let endDateParts = /^(\\d{4})-?(\\d{2})?-?(\\d{2})?/.exec(this.model.get(\"end\"));\n let endYear = endDateParts ? endDateParts[1] : null;\n let endMonth = endDateParts ? endDateParts[2] : null;\n let startDate = \"\";\n let endDate = \"\";\n if (startYear && !startMonth){\n startDate = startYear;\n }\n else if (startYear && startMonth) {\n let month = monthNames[parseInt(startMonth)-1];\n if (month) {\n startDate = month + \" \";\n }\n startDate += startYear;\n }\n\n if (endYear && !endMonth){\n endDate = endYear;\n }\n else if (endYear && endMonth) {\n let month = monthNames[parseInt(endMonth)-1];\n if (month) {\n endDate = month + \" \";\n }\n endDate += endYear;\n } else if (isActive) {\n endDate += \"present\";\n } \n\n if (startDate){\n let dateString = endDate ? startDate + \" \u2013 \" + endDate : startDate;\n this.model.set(\"date\", dateString);\n }\n\n }\n render() {\n this.model.set(\"attached\", true);\n this.$el.html(project_tpl(this.model.toJSON()));\n return this.$el;\n } \n detach() {\n this.model.set(\"attached\", false);\n this.$el.empty();\n }\n}\n\nexport default ProjectView;", "meta": {"content_hash": "cab31ad588c83966210ba922ca229f17", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 90, "avg_line_length": 32.470588235294116, "alnum_prop": 0.5276268115942029, "repo_name": "umd-mith/mith-research-explorer", "id": "57123b550a91b821777780e0828df1f5aff18457", "size": "2210", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/js/views/project-view.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "378100"}, {"name": "HTML", "bytes": "134222"}, {"name": "JavaScript", "bytes": "35173"}]}} +{"text": "function [c1,c2]= oox(p1,p2,bounds,Ops)\n% Orderbased crossover takes two parents P1,P2 and performs order\n% based crossover by Davis. \n%\n% function [c1,c2] = orderbasedXover(p1,p2,bounds,Ops)\n% p1 - the first parent ( [solution string function value] )\n% p2 - the second parent ( [solution string function value] )\n% bounds - the bounds matrix for the solution space\n% Ops - Options matrix for simple crossover [gen #SimpXovers].\n\n% Binary and Real-Valued Simulation Evolution for Matlab \n% Copyright (C) 1996 C.R. Houck, J.A. Joines, M.G. Kay \n%\n% C.R. Houck, J.Joines, and M.Kay. A genetic algorithm for function\n% optimization: A Matlab implementation. ACM Transactions on Mathmatical\n% Software, Submitted 1996.\n%\n% This program is free software; you can redistribute it and/or modify\n% it under the terms of the GNU General Public License as published by\n% the Free Software Foundation; either version 1, or (at your option)\n% any later version.\n%\n% This program is distributed in the hope that it will be useful,\n% but WITHOUT ANY WARRANTY; without even the implied warranty of\n% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n% GNU General Public License for more details. A copy of the GNU \n% General Public License can be obtained from the \n% Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\nsz=size(p1,2)-1;\nn=floor(sz/2);\ncut1 = round(rand*(n-1)+0.5); %Generate random cut point U(1,n/2);\ncut2 = round(rand*(sz-cut1-1)+1+cut1); %Generate random cut point U(cut1+1,n-1);\npm1=p1(1:end-1);\npm2=p2(1:end-1);\nc1=p1;\nc2=p2;\nfor i=[1:cut1 (cut2+1):sz]\n pm1=strrep(pm1,p2(i),-1);\n pm2=strrep(pm2,p1(i),-1);\nend\nc1((cut1+1):cut2)=p2(find(pm2>0));\nc2((cut1+1):cut2)=p1(find(pm1>0));\n", "meta": {"content_hash": "b3acbd3907fe9717da8c4c00bff36a16", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 80, "avg_line_length": 41.45238095238095, "alnum_prop": 0.7151062607696727, "repo_name": "xingshulicc/Using-Genetic-Algorithm-to-improve-Artificial-Neural-Network", "id": "a5a551b41324bf91808cc3dbc5ecb32aa5bfca92", "size": "1741", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gaot/orderbasedXover.m", "mode": "33188", "license": "mit", "language": [{"name": "Matlab", "bytes": "122238"}]}} +{"text": "\n\npackage org.deeplearning4j.text.corpora.treeparser;\n\nimport org.deeplearning4j.nn.layers.feedforward.autoencoder.recursive.Tree;\nimport org.deeplearning4j.text.corpora.treeparser.transformer.TreeTransformer;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Collapse unaries such that the\n * tree is only made of preterminals and leaves.\n *\n * @author Adam Gibson\n */\npublic class CollapseUnaries implements TreeTransformer {\n\n\n @Override\n public Tree transform(Tree tree) {\n if (tree.isPreTerminal() || tree.isLeaf()) {\n return tree;\n }\n\n List<Tree> children = tree.children();\n while (children.size() == 1 && !children.get(0).isLeaf()) {\n children = children.get(0).children();\n }\n\n List<Tree> processed = new ArrayList<>();\n for (Tree child : children)\n processed.add(transform(child));\n\n Tree ret = new Tree(tree);\n ret.connect(processed);\n\n return ret;\n }\n\n\n\n}\n", "meta": {"content_hash": "224935f5e77a545e4c8069f5e0884752", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 78, "avg_line_length": 23.023255813953487, "alnum_prop": 0.6454545454545455, "repo_name": "RobAltena/deeplearning4j", "id": "b01bd05f68e690d9495f34e0390c44891c3d7b01", "size": "1751", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-uima/src/main/java/org/deeplearning4j/text/corpora/treeparser/CollapseUnaries.java", "mode": "33261", "license": "apache-2.0", "language": [{"name": "Batchfile", "bytes": "2469"}, {"name": "C", "bytes": "144275"}, {"name": "C#", "bytes": "138404"}, {"name": "C++", "bytes": "16954560"}, {"name": "CMake", "bytes": "77377"}, {"name": "CSS", "bytes": "10363"}, {"name": "Cuda", "bytes": "2324886"}, {"name": "Dockerfile", "bytes": "1329"}, {"name": "FreeMarker", "bytes": "77045"}, {"name": "HTML", "bytes": "38914"}, {"name": "Java", "bytes": "36293636"}, {"name": "JavaScript", "bytes": "436278"}, {"name": "PureBasic", "bytes": "12256"}, {"name": "Python", "bytes": "325018"}, {"name": "Ruby", "bytes": "4558"}, {"name": "Scala", "bytes": "355054"}, {"name": "Shell", "bytes": "80490"}, {"name": "Smarty", "bytes": "900"}, {"name": "Starlark", "bytes": "931"}, {"name": "TypeScript", "bytes": "80252"}]}} +{"text": "import React,{Component} from \"react\"\nimport {render} from 'react-dom'\nimport {connect} from 'react-redux'\nimport { bindActionCreators } from 'redux'\nimport * as actions from '../actions/index'\n\nimport { Layout } from 'antd';\n\nimport PostList from '../components/PostList';\nimport Page from '../components/Page';\n\nimport '../static/scss/main.scss';\n\n\nclass Main extends Component {\n constructor(props) {\n super(props);\n }\n componentDidMount(){\n console.log('main componentDidMount');\n var data = 'currentPage=1&pageSize=10';\n this.props.actions.GetList(data,'initializePoster');\n }\n render() {\n console.log('this.props.posterInfo is ',this.props.posterInfo);\n if(this.props.posterInfo.posterInfo!==null){\n if(this.props.posterInfo.posterInfo.length === 0){\n return (\n <div className='not_found'>\n \u65e0\u76f8\u5173\u8bb0\u5f55\uff0c\u771f\u7684\u662fNOT FOUND\uff0c\u4e0d\u662f404\u54e6\n </div>\n );\n }\n else{\n return (\n <div className='main'>\n <PostList posterInfo = {this.props.posterInfo.posterInfo}></PostList>\n <Page></Page>\n </div>\n );\n }\n }\n else{\n return (\n <div className='not_found'>\n \u65e0\u76f8\u5173\u8bb0\u5f55\uff0c\u771f\u7684\u662fNOT FOUND\uff0c\u4e0d\u662f404\u54e6\n </div>\n );\n } \n }\n}\n\nconst mapStateToProps = (state) => {\n //console.log('Main.js mapStateToProps,state is ',state);\n return {\n posterInfo:state.stores.posterInfo\n }\n}\nconst mapDispatchToProps = (dispatch) => {\n //console.log('Main.js mapDispatchToProps');\n return {\n actions: bindActionCreators(actions, dispatch),\n }\n}\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps\n)(Main)\n\n\n", "meta": {"content_hash": "33385625075d6c76c6bcc503f7a98e64", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 81, "avg_line_length": 23.549295774647888, "alnum_prop": 0.6118421052631579, "repo_name": "kkltmoyu/NightPost", "id": "a0e6df5852444934d4c85c849ec4a1462d33f085", "size": "1724", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/containers/Main.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "5724"}, {"name": "HTML", "bytes": "267"}, {"name": "JavaScript", "bytes": "613233"}, {"name": "Shell", "bytes": "486"}]}} +{"text": "'''\nCreated on 23-Oct-2014\n\n@author: Rahul\n\n@summary: Main file to drive data collection, sentiment calculation, and\n serialization.\n'''\nfrom integrations.twitter import Collector\nfrom integrations.settings import TWITTER_CREDS, TWITTER_SEARCH_PARAMS,\\\n OUTPUT_FILE, FIELDS_TO_SAVE\nfrom core.sentiment import get_sentiment_for_text\nfrom serializers.csv import write\n\n\nTWITTER_HANDLES = {\n \"microsoft\": [\"@microsoft\", \"@bing\"]\n}\n\n\n\ndef prepare_to_serialize(source, company, identifiers, text_sentiment):\n '''\n Prepares the data in the format that is convenient for serialization\n '''\n return {\"source\": source,\n \"company\": company,\n \"identifiers\": str(identifiers),\n \"created_at\": text_sentiment[0],\n \"text\": text_sentiment[1],\n \"sentiment\": text_sentiment[2][0],\n \"p_pos\": text_sentiment[2][1],\n \"p_neg\": text_sentiment[2][2]\n }\n\n\ndef sentiment_on_twitter(twitter_handles):\n '''\n Integrates twitter data and performs sentiment analysis.\n '''\n source = \"twitter\"\n\n for company, handles in twitter_handles.items():\n print \"\\n\\n Processing: %s\" % (handles)\n\n print \"Getting data from twitter.. \"\n tweets = Collector(TWITTER_CREDS).get_updates(handles, **TWITTER_SEARCH_PARAMS) # @IgnorePep8\n\n print \"Preparing data to serialize.. \"\n tweets = [(tweet.created_at, tweet.text.encode('utf-8'), get_sentiment_for_text(tweet.text.encode('utf-8'))) for tweet in tweets] # @IgnorePep8\n\n print \"Serializing data in CSV format.. \"\n ofile = OUTPUT_FILE\n fields = FIELDS_TO_SAVE\n tweets = [prepare_to_serialize(source, company, handles, tweet) for tweet in tweets] # @IgnorePep8\n write(ofile, fields, tweets)\n\nif __name__ == '__main__':\n sentiment_on_twitter(TWITTER_HANDLES)\n", "meta": {"content_hash": "635d7a73e9ab5d64e771a75961c31910", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 152, "avg_line_length": 31.76271186440678, "alnum_prop": 0.6403415154749199, "repo_name": "tanwanirahul/sentiment-on-twitter", "id": "f4e466720b97d050154226f1cbf5b57b9ffffcd7", "size": "1874", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main.py", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Python", "bytes": "4740"}]}} +{"text": "package testdata\n\nimport \"github.com/flexiant/concerto/api/types\"\n\n// GetCloudAccountData loads test data\nfunc GetCloudAccountData() *[]types.CloudAccount {\n\n\ttestCloudAccounts := []types.CloudAccount{\n\t\t{\n\t\t\tId: \"fakeID0\",\n\t\t\tCloudProvId: \"fakeProvID0\",\n\t\t},\n\t\t{\n\t\t\tId: \"fakeID1\",\n\t\t\tCloudProvId: \"fakeProvID1\",\n\t\t},\n\t}\n\n\treturn &testCloudAccounts\n}\n", "meta": {"content_hash": "884b2ff4117bb9004bec78b9dec0cd83", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 50, "avg_line_length": 18.45, "alnum_prop": 0.6639566395663956, "repo_name": "flexiant/concerto", "id": "848a7fc6dc5338956a31f058e5f71699080c728c", "size": "369", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "testdata/cloud_accounts_data.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Cucumber", "bytes": "4087"}, {"name": "Go", "bytes": "344726"}, {"name": "Shell", "bytes": "10235"}]}} +{"text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<TextView\n android:id=\"@+id/txt_country\"\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:gravity=\"center_vertical\"\n android:padding=\"16dp\"\n android:textColor=\"@color/primary_text\"\n android:textSize=\"16sp\"\n android:drawablePadding=\"20dp\"/>", "meta": {"content_hash": "56387da1583058d7c0564296a8ad98ce", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 62, "avg_line_length": 33.416666666666664, "alnum_prop": 0.7007481296758105, "repo_name": "AnkitAggarwalPEC/plumApp", "id": "745adaf878eccddae3b60670d924009da5f51387", "size": "401", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/list_item_search.xml", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Java", "bytes": "214905"}]}} +{"text": "package runner_test\n\nimport (\n\t\"errors\"\n\t\"runtime\"\n\t\"syscall\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/ardanlabs/kit/runner\"\n)\n\n// Success and failure markers.\nvar (\n\tsuccess = \"\\u2713\"\n\tfailed = \"\\u2717\"\n)\n\n//==============================================================================\n\n// task represents a test task.\ntype task struct {\n\tkill chan bool\n\terr error\n}\n\n// Job is the implementation of the Jobber interface.\nfunc (t *task) Job(traceID string) error {\n\t// Pretend you are doing work for the specified\n\t// amount of time.\n\t<-t.kill\n\n\t// Report we received the signal to keep things in\n\t// sync between test functions.\n\tt.kill <- true\n\n\treturn t.err\n}\n\n// Kill will kill the Job method immediately.\nfunc (t *task) Kill() {\n\tselect {\n\tcase t.kill <- true:\n\t\t// If we were able to send the message, wait\n\t\t// for the response to keep things in sync.\n\t\t<-t.kill\n\tdefault:\n\t}\n}\n\n// KillAfter will kill the Job method after the specified duration.\nfunc (t *task) KillAfter(dur time.Duration) {\n\tt.kill = make(chan bool)\n\n\tgo func() {\n\t\ttime.Sleep(dur)\n\t\tt.Kill()\n\t}()\n\n\truntime.Gosched()\n}\n\n//==============================================================================\n\n// TestCompleted tests when jobs complete properly.\nfunc TestCompleted(t *testing.T) {\n\tt.Log(\"Given the need to test a successful task run.\")\n\t{\n\t\tt.Log(\"\\tWhen using a task that will complete in time.\")\n\t\t{\n\t\t\tvar job task\n\t\t\tjob.KillAfter(time.Millisecond)\n\n\t\t\tr := runner.New(time.Second)\n\n\t\t\tif err := r.Run(\"traceID\", &job); err != nil {\n\t\t\t\tt.Fatalf(\"\\t%s\\tShould not receive an error : %v\", failed, err)\n\t\t\t}\n\t\t\tt.Logf(\"\\t%s\\tShould not receive an error.\", success)\n\t\t}\n\t}\n}\n\n// TestError tests when jobs complete properly but with errors.\nfunc TestError(t *testing.T) {\n\tt.Log(\"Given the need to test a successful task run with error.\")\n\t{\n\t\tt.Log(\"\\tWhen using a task that will complete in time.\")\n\t\t{\n\t\t\tjob := task{\n\t\t\t\terr: errors.New(\"Error\"),\n\t\t\t}\n\t\t\tjob.KillAfter(time.Millisecond)\n\n\t\t\tr := runner.New(time.Second)\n\n\t\t\tif err := r.Run(\"traceID\", &job); err == nil {\n\t\t\t\tt.Fatalf(\"\\t%s\\tShould receive our error : %v\", failed, err)\n\t\t\t}\n\t\t\tt.Logf(\"\\t%s\\tShould receive our error.\", success)\n\t\t}\n\t}\n}\n\n// TestTimeout tests when jobs timeout.\nfunc TestTimeout(t *testing.T) {\n\tt.Log(\"Given the need to test a task that timesout.\")\n\t{\n\t\tt.Log(\"\\tWhen using a task that will timeout.\")\n\t\t{\n\t\t\tvar job task\n\t\t\tjob.KillAfter(time.Second)\n\n\t\t\t// Need the job method to quit as soon as we are done.\n\t\t\tdefer job.Kill()\n\n\t\t\tr := runner.New(time.Millisecond)\n\n\t\t\tif err := r.Run(\"traceID\", &job); err != runner.ErrTimeout {\n\t\t\t\tt.Fatalf(\"\\t%s\\tShould receive a timeout error : %v\", failed, err)\n\t\t\t}\n\t\t\tt.Logf(\"\\t%s\\tShould receive a timeout error.\", success)\n\t\t}\n\t}\n}\n\n// TestSignaled tests when jobs is requested to shutdown.\nfunc TestSignaled(t *testing.T) {\n\tt.Log(\"Given the need to test a task that is requested to shutdown.\")\n\t{\n\t\tt.Log(\"\\tWhen using a task that should see the signal.\")\n\t\t{\n\t\t\tvar job task\n\t\t\tjob.KillAfter(100 * time.Millisecond)\n\n\t\t\t// Need the job method to quit as soon as we are done.\n\t\t\tdefer job.Kill()\n\n\t\t\tgo func() {\n\t\t\t\ttime.Sleep(50 * time.Millisecond)\n\t\t\t\tsyscall.Kill(syscall.Getpid(), syscall.SIGINT)\n\t\t\t}()\n\n\t\t\tr := runner.New(3 * time.Second)\n\n\t\t\tif err := r.Run(\"traceID\", &job); err != nil {\n\t\t\t\tt.Errorf(\"\\t%s\\tShould receive no error : %v\", failed, err)\n\t\t\t} else {\n\t\t\t\tt.Logf(\"\\t%s\\tShould receive no error.\", success)\n\t\t\t}\n\n\t\t\tif !r.CheckShutdown() {\n\t\t\t\tt.Errorf(\"\\t%s\\tShould show the check shutdown flag is set.\", failed)\n\t\t\t} else {\n\t\t\t\tt.Logf(\"\\t%s\\tShould show the check shutdown flag is set.\", success)\n\t\t\t}\n\t\t}\n\t}\n}\n", "meta": {"content_hash": "bd61a1eff3ae9544506ae8a87cc0a03b", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 80, "avg_line_length": 22.968553459119498, "alnum_prop": 0.6185651697699891, "repo_name": "ardanlabs/kit", "id": "287554933ac1ef331096d7e7d522d14b4533f923", "size": "3652", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "runner/runner_test.go", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Go", "bytes": "204231"}, {"name": "Shell", "bytes": "449"}]}} +{"text": "if (self.selectedChangeBlock) {\\\n__weak typeof(self)weakSelf = self;\\\nself.selectedChangeBlock(weakSelf,[weakSelf currentSelected],self.identifier);\\\n}\\\n\n#define __set__property(value) \\\n_##value = value;\\\nself.manager.value = value;\\\n\n\n#pragma mark --- DWCheckBoxView ---\n@interface DWCheckBoxView ()\n\n///\u7ba1\u7406\u8005\n@property (nonatomic ,strong) DWCheckBoxManager * manager;\n\n@property (nonatomic ,strong) DWCheckBoxLayout * layout;\n\n@end\n\n@implementation DWCheckBoxView\n@synthesize selectedImage = _selectedImage;\n@synthesize unSelectedImage = _unSelectedImage;\n+(NSArray<UIView<DWCheckBoxCellProtocol> *> *)cellsFromTitles:(NSArray<NSString *> *)titles\n{\n NSMutableArray * arr = [NSMutableArray array];\n [titles enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n DWCheckBoxDefaultCell * cell = [DWCheckBoxDefaultCell cellWithTitle:obj];\n [arr addObject:cell];\n }];\n return arr;\n}\n\n-(instancetype)initWithFrame:(CGRect)frame layout:(DWCheckBoxLayout *)layout manager:(DWCheckBoxManager *)manager multiSelect:(BOOL)multiSelect cells:(NSArray<UIView<DWCheckBoxCellProtocol>*> *)cells\n{\n self = [super initWithFrame:frame];\n if (self) {\n [self initValueWithMultiSelect:multiSelect cells:cells manager:manager layout:layout];\n }\n return self;\n}\n\n-(instancetype)initWithFrame:(CGRect)frame multiSelect:(BOOL)multiSelect cells:(NSArray<UIView<DWCheckBoxCellProtocol>*> *)cells defaultSelect:(NSArray<NSNumber *> *)defaultSelect\n{\n self = [super initWithFrame:frame];\n if (self) {\n [self initValueWithMultiSelect:multiSelect cells:cells manager:[self getDefaultManagerWithCells:cells multiSelect:multiSelect defaultSelect:defaultSelect] layout:[DWCheckBoxDefaultLayout new]];\n }\n return self;\n}\n\n-(instancetype)initWithFrame:(CGRect)frame layout:(DWCheckBoxLayout *)layout multiSelect:(BOOL)multiSelect cells:(NSArray<UIView<DWCheckBoxCellProtocol> *> *)cells defaultSelect:(NSArray<NSNumber *> *)defaultSelect\n{\n return [self initWithFrame:frame layout:layout manager:[self getDefaultManagerWithCells:cells multiSelect:multiSelect defaultSelect:defaultSelect] multiSelect:multiSelect cells:cells];\n}\n\n-(instancetype)initWithFrame:(CGRect)frame multiSelect:(BOOL)multiSelect titles:(NSArray<NSString *> *)titles defaultSelect:(NSArray<NSNumber *> *)defaultSelect\n{\n return [self initWithFrame:frame multiSelect:multiSelect cells:[DWCheckBoxView cellsFromTitles:titles] defaultSelect:defaultSelect];\n}\n\n-(instancetype)initWithFrame:(CGRect)frame layout:(DWCheckBoxLayout *)layout multiSelect:(BOOL)multiSelect titles:(NSArray<NSString *> *)titles defaultSelect:(NSArray<NSNumber *> *)defaultSelect\n{\n NSArray * cells = [DWCheckBoxView cellsFromTitles:titles];\n return [self initWithFrame:frame layout:layout multiSelect:multiSelect cells:cells defaultSelect:defaultSelect];\n}\n\n-(void)selectAtIndex:(NSUInteger)idx\n{\n [self.manager selectAtIndex:idx];\n}\n\n-(void)selectAll\n{\n [self.manager selectAll];\n}\n\n-(void)deselectAtIndex:(NSUInteger)idx\n{\n [self.manager deselectAtIndex:idx];\n}\n\n-(void)deselectAll\n{\n [self.manager deselectAll];\n}\n\n#pragma mark --- Tool Method ---\n-(DWCheckBoxManager *)getDefaultManagerWithCells:(NSArray <UIView<DWCheckBoxCellProtocol>*>*)cells\n multiSelect:(BOOL)multiSelect\n defaultSelect:(NSArray <NSNumber *>*)defaultSelect\n{\n __weak typeof(self)weakSelf = self;\n DWCheckBoxManager * manager = [[DWCheckBoxManager alloc] initWithCountOfBoxes:cells.count multiSelect:multiSelect defaultSelect:defaultSelect selectedChangeBlock:^(DWCheckBoxManager * mgr,id currentSelect, NSString *identifier) {\n NSArray * arr = nil;\n if (currentSelect) {\n if (!weakSelf.multiSelect) {\n arr = @[currentSelect];\n }\n else\n {\n arr = currentSelect;\n }\n }\n [self handleCells:cells withArr:arr manager:mgr];\n }];\n return manager;\n}\n\n-(void)initValueWithMultiSelect:(BOOL)multiSelect\n cells:(NSArray <UIView<DWCheckBoxCellProtocol>*>*)cells\n manager:(DWCheckBoxManager *)manager\n layout:(DWCheckBoxLayout *)layout\n{\n _manager = manager;\n _layout = layout;\n _countOfBoxes = cells.count;\n _multiSelect = multiSelect;\n _cells = cells;\n [self handleCellsWithAction];\n}\n\n-(void)layoutSubviews\n{\n [super layoutSubviews];\n [self.layout layoutCheckBoxView:self cells:self.cells];\n NSArray * arr = nil;\n arr = (!self.manager.currentSelected)?nil:_multiSelect?self.manager.currentSelected:@[self.manager.currentSelected];\n [self handleCells:self.cells withArr:arr manager:self.manager];\n}\n\n-(void)handleCells:(NSArray<UIView<DWCheckBoxCellProtocol>*> *)cells\n withArr:(NSArray *)arr\n manager:(DWCheckBoxManager *)mgr\n{\n [cells enumerateObjectsUsingBlock:^(UIView<DWCheckBoxCellProtocol> * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n if ([arr containsObject:@(idx)]) {\n [obj cellBeSelected:YES withImage:mgr.selectedImage];\n }\n else\n {\n [obj cellBeSelected:NO withImage:mgr.unSelectedImage];\n }\n }];\n}\n\n-(void)handleCellsWithAction\n{\n __weak typeof(self)weakSelf = self;\n [self.cells enumerateObjectsUsingBlock:^(UIView<DWCheckBoxCellProtocol> * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n obj.selectedBlock = ^(BOOL isSelect,UIView<DWCheckBoxCellProtocol> * view){\n NSUInteger idx = [weakSelf.cells indexOfObject:view];\n if (isSelect) {\n [weakSelf.manager deselectAtIndex:idx];\n }\n else\n {\n [weakSelf.manager selectAtIndex:idx];\n }\n };\n }];\n}\n\n#pragma mark --- setter/getter ---\n-(void)setCountOfBoxes:(NSUInteger)countOfBoxes {\n __set__property(countOfBoxes)\n}\n\n-(void)setMultiSelect:(BOOL)multiSelect\n{\n __set__property(multiSelect)\n}\n\n-(void)setSelectedImage:(UIImage *)selectedImage\n{\n __set__property(selectedImage)\n}\n\n-(void)setUnSelectedImage:(UIImage *)unSelectedImage\n{\n __set__property(unSelectedImage)\n}\n\n-(id)currentSelected\n{\n return self.manager.currentSelected;\n}\n\n-(UIImage *)selectedImage\n{\n if (!_selectedImage) {\n return self.manager.selectedImage;\n }\n return _selectedImage;\n}\n\n-(UIImage *)unSelectedImage\n{\n if (!_unSelectedImage) {\n return self.manager.unSelectedImage;\n }\n return _unSelectedImage;\n}\n\n@end\n\n\n\n#pragma mark --- DWCheckBoxLayout ---\n@implementation DWCheckBoxLayout\n\n-(void)layoutCheckBoxView:(UIView *)checkBoxView cells:(NSArray<id<DWCheckBoxCellProtocol>> *)cells\n{\n NSLog(@\"you should use subClass of DWCheckLayout and implement this method by yourself\");\n}\n\n@end\n\n\n\n#pragma mark --- DWCheckBoxDefaultLayout ---\n@implementation DWCheckBoxDefaultLayout\n-(void)layoutCheckBoxView:(UIView *)checkBoxView cells:(NSArray<UIView<DWCheckBoxCellProtocol>*> *)cells\n{\n CGRect frame = checkBoxView.frame;\n CGFloat width = frame.size.width;\n CGFloat height = frame.size.height;\n __block CGFloat originX = 0;\n __block CGFloat originY = 0;\n [cells enumerateObjectsUsingBlock:^(UIView<DWCheckBoxCellProtocol> * obj, NSUInteger idx, BOOL * _Nonnull stop) {\n if ((originX + obj.bounds.size.width + 5) > width) {\n if (originX == 0) {\n CGRect objF = obj.frame;\n CGSize objS = objF.size;\n objS.width = width;\n objF.size = objS;\n obj.frame = objF;\n } else if ((originY + self.spacing + obj.frame.size.height) < height) {\n originX = 0;\n originY += self.spacing + obj.frame.size.height;\n \n }\n else\n {\n *stop = YES;\n }\n }\n if (!*stop) {\n CGPoint origin = CGPointMake(originX, originY);\n CGRect frame = obj.frame;\n frame.origin = origin;\n obj.frame = frame;\n [checkBoxView addSubview:obj];\n originX += obj.bounds.size.width + self.spacing;\n }\n }];\n}\n\n-(instancetype)init\n{\n self = [super init];\n if (self) {\n self.spacing = -1;\n }\n return self;\n}\n\n-(CGFloat)spacing\n{\n if (_spacing == -1) {\n return 5;\n }\n return _spacing;\n}\n\n@end\n\n\n\n#pragma mark --- DWCheckBoxDefaultCell ---\n@implementation DWCheckBoxDefaultCell\n@synthesize isSelected,selectedBlock;\n+(instancetype)cellWithTitle:(NSString *)title\n{\n DWCheckBoxDefaultCell * btn = [self buttonWithType:(UIButtonTypeCustom)];\n if (btn) {\n [btn setTitle:title forState:(UIControlStateNormal)];\n }\n return btn;\n}\n+(instancetype)buttonWithType:(UIButtonType)buttonType\n{\n DWCheckBoxDefaultCell * btn = [super buttonWithType:buttonType];\n if (btn) {\n btn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;\n btn.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;\n [btn setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];\n [btn addTarget:btn action:@selector(buttonAction:) forControlEvents:(UIControlEventTouchUpInside)];\n }\n return btn;\n}\n-(void)buttonAction:(id)sender\n{\n if (self.selectedBlock) {\n __weak typeof(self)weakSelf = self;\n self.selectedBlock(self.isSelected,weakSelf);\n }\n}\n-(void)setFrame:(CGRect)frame\n{\n [super setFrame:frame];\n CGFloat height = frame.size.height;\n height = height > 44?44:height;\n self.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, frame.size.width - height);\n self.titleEdgeInsets = UIEdgeInsetsMake(0, height - 39, 0, 0);\n}\n-(void)cellBeSelected:(BOOL)selected withImage:(UIImage *)image\n{\n self.isSelected = selected;\n [self setImage:image forState:(UIControlStateNormal)];\n}\n\n-(void)setTitle:(NSString *)title forState:(UIControlState)state\n{\n [super setTitle:title forState:state];\n [self sizeToFit];\n}\n\n-(void)sizeToFit\n{\n UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];\n label.text = self.titleLabel.text;\n label.font = self.titleLabel.font;\n [label sizeToFit];\n CGRect frame = self.frame;\n CGSize size = CGSizeZero;\n size.height = label.frame.size.height;\n size.width = size.height + 5 + label.bounds.size.width;\n frame.size = size;\n self.frame = frame;\n}\n@end\n\n\n\n#pragma mark --- DWCheckBoxManager ---\n@interface DWCheckBoxManager ()\n\n@property (nonatomic ,strong) NSMutableArray <NSNumber *>* selectedArr;\n\n@property (nonatomic ,assign) NSUInteger lastSelected;\n\n@end\n\n@implementation DWCheckBoxManager\n\n-(instancetype)initWithCountOfBoxes:(NSUInteger)countOfBoxes multiSelect:(BOOL)multiSelect defaultSelect:(NSArray <NSNumber *>*)defaultSelect selectedChangeBlock:(void (^)(DWCheckBoxManager *,id,NSString *))selechtChangeBlock\n{\n self = [super init];\n if (self) {\n _countOfBoxes = countOfBoxes;\n _multiSelect = multiSelect;\n if (defaultSelect.count) {\n [defaultSelect enumerateObjectsUsingBlock:^(NSNumber * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {\n [self selectAtIndex:obj.unsignedIntegerValue];\n }];\n }\n if (selechtChangeBlock) {\n self.selectedChangeBlock = selechtChangeBlock;\n }\n }\n return self;\n}\n\n-(void)selectAtIndex:(NSUInteger)idx\n{\n if (idx < self.countOfBoxes) {\n if (self.multiSelect) {///\u591a\u9009\u64cd\u4f5c\n if ((![self.selectedArr containsObject:@(idx)]) && (self.selectedArr.count < self.countOfBoxes)) {\n [self.selectedArr addObject:@(idx)];\n __Select__Block__\n }\n } else {///\u5355\u9009\u64cd\u4f5c\n if (self.selectedArr.count) {\n [self.selectedArr removeAllObjects];\n }\n [self.selectedArr addObject:@(idx)];\n __Select__Block__\n }\n }\n}\n\n-(void)deselectAtIndex:(NSUInteger)idx\n{\n if (idx < self.countOfBoxes) {\n if ([self.selectedArr containsObject:@(idx)]) {\n [self.selectedArr removeObject:@(idx)];\n __Select__Block__\n }\n }\n}\n\n-(void)deselectAll\n{\n [self.selectedArr removeAllObjects];\n __Select__Block__\n}\n\n-(void)selectAll\n{\n if (self.multiSelect) {\n if (self.selectedArr.count != self.countOfBoxes) {\n [self.selectedArr removeAllObjects];\n for (int i = 0; i < self.countOfBoxes; i++) {\n [self.selectedArr addObject:@(i)];\n }\n __Select__Block__\n }\n \n } else {\n if (!self.selectedArr.count) {\n [self.selectedArr addObject:@(1)];\n __Select__Block__\n }\n }\n}\n\n-(id)currentSelected\n{\n if (self.multiSelect) {\n return [self.selectedArr sortedArrayUsingSelector:@selector(compare:)];\n } else {\n if (self.selectedArr.count) {\n return self.selectedArr.firstObject;\n }\n return nil;\n }\n}\n\n-(NSMutableArray<NSNumber *> *)selectedArr\n{\n if (!_selectedArr) {\n _selectedArr = [NSMutableArray array];\n }\n return _selectedArr;\n}\n\n-(void)setMultiSelect:(BOOL)multiSelect\n{\n _multiSelect = multiSelect;\n if (!multiSelect && self.selectedArr.count > 1) {\n NSNumber * lastSelected = self.selectedArr.lastObject;\n [self.selectedArr removeAllObjects];\n [self.selectedArr addObject:lastSelected];\n }\n __Select__Block__\n}\n\n-(void)setCountOfBoxes:(NSUInteger)countOfBoxes\n{\n _countOfBoxes = countOfBoxes;\n if (countOfBoxes < self.selectedArr.count) {\n NSMutableArray * arr = [NSMutableArray array];\n for (int i = 0; i < countOfBoxes; i++) {\n [arr addObject:self.selectedArr[i]];\n }\n self.selectedArr = arr;\n __Select__Block__\n }\n}\n\n-(NSString *)identifier\n{\n if (!_identifier) {\n return @\"defaultCheckBox\";\n }\n return _identifier;\n}\n\n-(UIImage *)selectedImage\n{\n if (!_selectedImage) {\n return [UIImage imageNamed:[NSString stringWithFormat:@\"DWCheckBoxBundle.bundle/%@\",self.multiSelect?@\"checkBoxSelected\":@\"radioSelected\"]];\n }\n return _selectedImage;\n}\n\n-(UIImage *)unSelectedImage\n{\n if (!_unSelectedImage) {\n return [UIImage imageNamed:[NSString stringWithFormat:@\"DWCheckBoxBundle.bundle/%@\",self.multiSelect?@\"checkBoxUnselected\":@\"radioUnselected\"]];\n }\n return _unSelectedImage;\n}\n\n@end\n", "meta": {"content_hash": "a625a6e97f891c678cd2e5eb78fb0e8d", "timestamp": "", "source": "github", "line_count": 496, "max_line_length": 233, "avg_line_length": 29.31048387096774, "alnum_prop": 0.6543541064795708, "repo_name": "CodeWicky/DWCheckBox", "id": "546e8262e39ab0bdeda332ba526077eedaab1086", "size": "14742", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DWCheckBox/DWCheckBox.m", "mode": "33188", "license": "mit", "language": [{"name": "Objective-C", "bytes": "91214"}, {"name": "Ruby", "bytes": "646"}]}} +{"text": "var FormComponents = function () {\n\n var handleWysihtml5 = function () {\n if (!jQuery().wysihtml5) {\n return;\n }\n\n if ($('.wysihtml5').size() > 0) {\n $('.wysihtml5').wysihtml5({\n \"stylesheets\": [\"assets/plugins/bootstrap-wysihtml5/wysiwyg-color.css\"]\n });\n }\n }\n\n var resetWysihtml5 = function () {\n if (!jQuery().wysihtml5) {\n return;\n }\n\n if ($('.wysihtml5').size() > 0) {\n $('.wysihtml5').wysihtml5({\n \"stylesheets\": [\"assets/plugins/bootstrap-wysihtml5/wysiwyg-color.css\"]\n });\n }\n }\n\n var handleToggleButtons = function () {\n if (!jQuery().toggleButtons) {\n return;\n }\n $('.basic-toggle-button').toggleButtons();\n $('.text-toggle-button').toggleButtons({\n width: 200,\n label: {\n enabled: \"Lorem Ipsum\",\n disabled: \"Dolor Sit\"\n }\n });\n $('.danger-toggle-button').toggleButtons({\n style: {\n // Accepted values [\"primary\", \"danger\", \"info\", \"success\", \"warning\"] or nothing\n enabled: \"danger\",\n disabled: \"info\"\n }\n });\n $('.info-toggle-button').toggleButtons({\n style: {\n enabled: \"info\",\n disabled: \"\"\n }\n });\n $('.success-toggle-button').toggleButtons({\n style: {\n enabled: \"success\",\n disabled: \"info\"\n }\n });\n $('.warning-toggle-button').toggleButtons({\n style: {\n enabled: \"warning\",\n disabled: \"info\"\n }\n });\n\n $('.height-toggle-button').toggleButtons({\n height: 100,\n font: {\n 'line-height': '100px',\n 'font-size': '20px',\n 'font-style': 'italic'\n }\n });\n }\n\n var handleTagsInput = function () {\n if (!jQuery().tagsInput) {\n return;\n }\n $('#tags_1').tagsInput({\n width: 'auto',\n 'onAddTag': function () {\n //alert(1);\n },\n });\n $('#tags_2').tagsInput({\n width: 240\n });\n }\n\n var handlejQueryUIDatePickers = function () {\n $( \".ui-date-picker\" ).datepicker();\n }\n\n var handleDatePickers = function () {\n\n if (jQuery().datepicker) {\n $('.date-picker').datepicker({\n rtl : App.isRTL()\n });\n }\n }\n\n var handleTimePickers = function () {\n \n if (jQuery().timepicker) {\n $('.timepicker-default').timepicker();\n $('.timepicker-24').timepicker({\n minuteStep: 1,\n showSeconds: true,\n showMeridian: false\n });\n }\n }\n\n var handleDateRangePickers = function () {\n if (!jQuery().daterangepicker) {\n return;\n }\n\n $('.date-range').daterangepicker(\n {\n opens: (App.isRTL() ? 'left' : 'right'),\n format: 'MM/dd/yyyy',\n separator: ' to ',\n startDate: Date.today().add({\n days: -29\n }),\n endDate: Date.today(),\n minDate: '01/01/2012',\n maxDate: '12/31/2014',\n }\n );\n\n $('#form-date-range').daterangepicker({\n ranges: {\n 'Today': ['today', 'today'],\n 'Yesterday': ['yesterday', 'yesterday'],\n 'Last 7 Days': [Date.today().add({\n days: -6\n }), 'today'],\n 'Last 29 Days': [Date.today().add({\n days: -29\n }), 'today'],\n 'This Month': [Date.today().moveToFirstDayOfMonth(), Date.today().moveToLastDayOfMonth()],\n 'Last Month': [Date.today().moveToFirstDayOfMonth().add({\n months: -1\n }), Date.today().moveToFirstDayOfMonth().add({\n days: -1\n })]\n },\n opens: (App.isRTL() ? 'left' : 'right'),\n format: 'MM/dd/yyyy',\n separator: ' to ',\n startDate: Date.today().add({\n days: -29\n }),\n endDate: Date.today(),\n minDate: '01/01/2012',\n maxDate: '12/31/2014',\n locale: {\n applyLabel: 'Submit',\n fromLabel: 'From',\n toLabel: 'To',\n customRangeLabel: 'Custom Range',\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n firstDay: 1\n },\n showWeekNumbers: true,\n buttonClasses: ['btn-danger']\n },\n\n function (start, end) {\n $('#form-date-range span').html(start.toString('MMMM d, yyyy') + ' - ' + end.toString('MMMM d, yyyy'));\n });\n\n $('#form-date-range span').html(Date.today().add({\n days: -29\n }).toString('MMMM d, yyyy') + ' - ' + Date.today().toString('MMMM d, yyyy'));\n\n\n //modal version:\n\n $('#form-date-range-modal').daterangepicker({\n ranges: {\n 'Today': ['today', 'today'],\n 'Yesterday': ['yesterday', 'yesterday'],\n 'Last 7 Days': [Date.today().add({\n days: -6\n }), 'today'],\n 'Last 29 Days': [Date.today().add({\n days: -29\n }), 'today'],\n 'This Month': [Date.today().moveToFirstDayOfMonth(), Date.today().moveToLastDayOfMonth()],\n 'Last Month': [Date.today().moveToFirstDayOfMonth().add({\n months: -1\n }), Date.today().moveToFirstDayOfMonth().add({\n days: -1\n })]\n },\n opens: (App.isRTL() ? 'left' : 'right'),\n format: 'MM/dd/yyyy',\n separator: ' to ',\n startDate: Date.today().add({\n days: -29\n }),\n endDate: Date.today(),\n minDate: '01/01/2012',\n maxDate: '12/31/2014',\n locale: {\n applyLabel: 'Submit',\n fromLabel: 'From',\n toLabel: 'To',\n customRangeLabel: 'Custom Range',\n daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n firstDay: 1\n },\n showWeekNumbers: true,\n buttonClasses: ['btn-danger']\n },\n\n function (start, end) {\n $('#form-date-range-modal span').html(start.toString('MMMM d, yyyy') + ' - ' + end.toString('MMMM d, yyyy'));\n });\n\n $('#form-date-range-modal span').html(Date.today().add({\n days: -29\n }).toString('MMMM d, yyyy') + ' - ' + Date.today().toString('MMMM d, yyyy'));\n\n }\n\n var handleDatetimePicker = function () { \n\n $(\".form_datetime\").datetimepicker({\n format: \"dd MM yyyy - hh:ii\",\n pickerPosition: (App.isRTL() ? \"bottom-right\" : \"bottom-left\")\n });\n\n $(\".form_advance_datetime\").datetimepicker({\n format: \"dd MM yyyy - hh:ii\",\n autoclose: true,\n todayBtn: true,\n startDate: \"2013-02-14 10:00\",\n pickerPosition: (App.isRTL() ? \"bottom-right\" : \"bottom-left\"),\n minuteStep: 10\n });\n\n $(\".form_meridian_datetime\").datetimepicker({\n format: \"dd MM yyyy - HH:ii P\",\n showMeridian: true,\n autoclose: true,\n pickerPosition: (App.isRTL() ? \"bottom-right\" : \"bottom-left\"),\n todayBtn: true\n });\n }\n\n var handleClockfaceTimePickers = function () {\n\n if (!jQuery().clockface) {\n return;\n }\n\n $('.clockface_1').clockface();\n\n $('#clockface_2').clockface({\n format: 'HH:mm',\n trigger: 'manual'\n });\n\n $('#clockface_2_toggle').click(function (e) {\n e.stopPropagation();\n $('#clockface_2').clockface('toggle');\n });\n\n $('#clockface_2_modal').clockface({\n format: 'HH:mm',\n trigger: 'manual'\n });\n\n $('#clockface_2_modal_toggle').click(function (e) {\n e.stopPropagation();\n $('#clockface_2_modal').clockface('toggle');\n });\n\n $('.clockface_3').clockface({\n format: 'H:mm'\n }).clockface('show', '14:30');\n }\n\n var handleColorPicker = function () {\n if (!jQuery().colorpicker) {\n return;\n }\n $('.colorpicker-default').colorpicker({\n format: 'hex'\n });\n $('.colorpicker-rgba').colorpicker();\n }\n\n var handleSelec2 = function () {\n\n $('#select2_sample1').select2({\n placeholder: \"Select an option\",\n allowClear: true\n });\n\n $('#select2_sample2').select2({\n placeholder: \"Select a State\",\n allowClear: true\n });\n\n $(\"#select2_sample3\").select2({\n allowClear: true,\n minimumInputLength: 1,\n query: function (query) {\n var data = {\n results: []\n }, i, j, s;\n for (i = 1; i < 5; i++) {\n s = \"\";\n for (j = 0; j < i; j++) {\n s = s + query.term;\n }\n data.results.push({\n id: query.term + i,\n text: s\n });\n }\n query.callback(data);\n }\n });\n\n function format(state) {\n if (!state.id) return state.text; // optgroup\n return \"<img class='flag' src='assets/img/flags/\" + state.id.toLowerCase() + \".png'/> \" + state.text;\n }\n $(\"#select2_sample4\").select2({\n allowClear: true,\n formatResult: format,\n formatSelection: format,\n escapeMarkup: function (m) {\n return m;\n }\n });\n\n $(\"#select2_sample5\").select2({\n tags: [\"red\", \"green\", \"blue\", \"yellow\", \"pink\"]\n });\n\n\n function movieFormatResult(movie) {\n var markup = \"<table class='movie-result'><tr>\";\n if (movie.posters !== undefined && movie.posters.thumbnail !== undefined) {\n markup += \"<td valign='top'><img src='\" + movie.posters.thumbnail + \"'/></td>\";\n }\n markup += \"<td valign='top'><h5>\" + movie.title + \"</h5>\";\n if (movie.critics_consensus !== undefined) {\n markup += \"<div class='movie-synopsis'>\" + movie.critics_consensus + \"</div>\";\n } else if (movie.synopsis !== undefined) {\n markup += \"<div class='movie-synopsis'>\" + movie.synopsis + \"</div>\";\n }\n markup += \"</td></tr></table>\"\n return markup;\n }\n\n function movieFormatSelection(movie) {\n return movie.title;\n }\n\n $(\"#select2_sample6\").select2({\n placeholder: \"Search for a movie\",\n minimumInputLength: 1,\n ajax: { // instead of writing the function to execute the request we use Select2's convenient helper\n url: \"http://api.rottentomatoes.com/api/public/v1.0/movies.json\",\n dataType: 'jsonp',\n data: function (term, page) {\n return {\n q: term, // search term\n page_limit: 10,\n apikey: \"ju6z9mjyajq2djue3gbvv26t\" // please do not use so this example keeps working\n };\n },\n results: function (data, page) { // parse the results into the format expected by Select2.\n // since we are using custom formatting functions we do not need to alter remote JSON data\n return {\n results: data.movies\n };\n }\n },\n initSelection: function (element, callback) {\n // the input tag has a value attribute preloaded that points to a preselected movie's id\n // this function resolves that id attribute to an object that select2 can render\n // using its formatResult renderer - that way the movie name is shown preselected\n var id = $(element).val();\n if (id !== \"\") {\n $.ajax(\"http://api.rottentomatoes.com/api/public/v1.0/movies/\" + id + \".json\", {\n data: {\n apikey: \"ju6z9mjyajq2djue3gbvv26t\"\n },\n dataType: \"jsonp\"\n }).done(function (data) {\n callback(data);\n });\n }\n },\n formatResult: movieFormatResult, // omitted for brevity, see the source of this page\n formatSelection: movieFormatSelection, // omitted for brevity, see the source of this page\n dropdownCssClass: \"bigdrop\", // apply css that makes the dropdown taller\n escapeMarkup: function (m) {\n return m;\n } // we do not want to escape markup since we are displaying html in results\n });\n }\n\n var handleMultiSelect = function () {\n $('#my_multi_select1').multiSelect();\n $('#my_multi_select2').multiSelect({\n selectableOptgroup: true\n }); \n }\n\n var handleInputMasks = function () {\n $.extend($.inputmask.defaults, {\n 'autounmask': true\n });\n\n $(\"#mask_date\").inputmask(\"d/m/y\", {autoUnmask: true}); //direct mask \n $(\"#mask_date1\").inputmask(\"d/m/y\",{ \"placeholder\": \"*\"}); //change the placeholder\n $(\"#mask_date2\").inputmask(\"d/m/y\",{ \"placeholder\": \"dd/mm/yyyy\" }); //multi-char placeholder\n $(\"#mask_phone\").inputmask(\"mask\", {\"mask\": \"(999) 999-9999\"}); //specifying fn & options\n $(\"#mask_tin\").inputmask({\"mask\": \"99-9999999\"}); //specifying options only\n $(\"#mask_number\").inputmask({ \"mask\": \"9\", \"repeat\": 10, \"greedy\": false }); // ~ mask \"9\" or mask \"99\" or ... mask \"9999999999\"\n $(\"#mask_decimal\").inputmask('decimal', { rightAlignNumerics: false }); //disables the right alignment of the decimal input\n $(\"#mask_currency\").inputmask('\u20ac 999.999.999,99', { numericInput: true }); //123456 => \u20ac ___.__1.234,56\n \n $(\"#mask_currency2\").inputmask('\u20ac 999,999,999.99', { numericInput: true, rightAlignNumerics: false, greedy: false}); //123456 => \u20ac ___.__1.234,56\n $(\"#mask_ssn\").inputmask(\"999-99-9999\", {placeholder:\" \", clearMaskOnLostFocus: true }); //default\n }\n\n var handleIPAddressInput = function () {\n $('#input_ipv4').ipAddress();\n $('#input_ipv6').ipAddress({v:6});\n }\n\n return {\n //main function to initiate the module\n init: function () {\n handleWysihtml5();\n handleToggleButtons();\n handleTagsInput();\n handlejQueryUIDatePickers();\n handleDatePickers();\n handleTimePickers();\n handleDatetimePicker();\n handleDateRangePickers();\n handleClockfaceTimePickers();\n handleColorPicker();\n handleSelec2();\n handleInputMasks();\n handleIPAddressInput();\n handleMultiSelect();\n\n App.addResponsiveHandler(function(){\n resetWysihtml5();\n })\n }\n\n };\n\n}();", "meta": {"content_hash": "02f6f79515271ed22f6b8052821eb660", "timestamp": "", "source": "github", "line_count": 471, "max_line_length": 155, "avg_line_length": 34.54352441613588, "alnum_prop": 0.45230485556238476, "repo_name": "Sparring/sparring-v1.0-beta", "id": "ea29a1dc9497314bb49f157f9d838a867253f892", "size": "16278", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "assets/scripts/form-components.js", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "822740"}, {"name": "CoffeeScript", "bytes": "57172"}, {"name": "Go", "bytes": "6713"}, {"name": "JavaScript", "bytes": "3199127"}, {"name": "PHP", "bytes": "1674408"}, {"name": "Python", "bytes": "5173"}, {"name": "Ruby", "bytes": "861"}, {"name": "Shell", "bytes": "2037"}]}} +{"text": "<?php\n\ndeclare(strict_types=1); // @codeCoverageIgnore\n\nnamespace Recoil;\n\n/**\n * A strand trace is a low-level observer of strand events.\n *\n * @see Strand::setTrace()\n *\n * A trace may only be set on a strand when assertions are enabled. When\n * assertions are disabled, all tracing related code is disabled, and setting\n * a trace has no effect.\n *\n * If an exception is thrown from any of the StrandTrace methods the kernel\n * behaviour is undefined.\n *\n * @link http://php.net/manual/en/ini.core.php#ini.zend.assertions\n */\ninterface StrandTrace\n{\n /**\n * Record a push to the call-stack.\n *\n * @param Strand $strand The strand being traced.\n * @param int $depth The depth of the call-stack BEFORE the push operation.\n *\n * @return null\n */\n public function push(Strand $strand, int $depth);\n\n /**\n * Record a pop from the call-stack.\n *\n * @param Strand $strand The strand being traced.\n * @param int $depth The depth of the call-stack AFTER the pop operation.\n *\n * @return null\n */\n public function pop(Strand $strand, int $depth);\n\n /**\n * Record keys and values yielded from the coroutine on the head of the stack.\n *\n * @param Strand $strand The strand being traced.\n * @param int $depth The current depth of the call-stack.\n * @param mixed $key The key yielded from the coroutine.\n * @param mixed $value The value yielded from the coroutine.\n *\n * @return null\n */\n public function yield(Strand $strand, int $depth, $key, $value);\n\n /**\n * Record the action and value used to resume a yielded coroutine.\n *\n * @param Strand $strand The strand being traced.\n * @param int $depth The current depth of the call-stack.\n * @param string $action The resume action ('send' or 'throw').\n * @param mixed $value The resume value or exception.\n *\n * @return null\n */\n public function resume(Strand $strand, int $depth, string $action, $value);\n\n /**\n * Record the suspension of a strand.\n *\n * @param Strand $strand The strand being traced.\n * @param int $depth The current depth of the call-stack.\n *\n * @return null\n */\n public function suspend(Strand $strand, int $depth);\n\n /**\n * Record the action and value when a strand exits.\n *\n * @param Strand $strand The strand being traced.\n * @param int $depth The current depth of the call-stack.\n * @param string $action The final action performed on the strand's listener ('send' or 'throw').\n * @param mixed $value The strand result or exception.\n *\n * @return null\n */\n public function exit(Strand $strand, int $depth, string $action, $value);\n}\n", "meta": {"content_hash": "e6dfebd9489e1eaa8b4ec9eed350dba1", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 101, "avg_line_length": 31.375, "alnum_prop": 0.6341905106845346, "repo_name": "recoilphp/api", "id": "c5a9393bd3a86144fcaf2307da5ff699c91e0a02", "size": "2761", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/StrandTrace.php", "mode": "33188", "license": "mit", "language": [{"name": "Makefile", "bytes": "144"}, {"name": "PHP", "bytes": "49121"}]}} +{"text": "namespace dawn_native { namespace null {\n\n using BindGroup = BindGroupBase;\n using BindGroupLayout = BindGroupLayoutBase;\n using BlendState = BlendStateBase;\n class Buffer;\n using BufferView = BufferViewBase;\n class CommandBuffer;\n using ComputePipeline = ComputePipelineBase;\n using DepthStencilState = DepthStencilStateBase;\n class Device;\n using InputState = InputStateBase;\n using PipelineLayout = PipelineLayoutBase;\n class Queue;\n using RenderPassDescriptor = RenderPassDescriptorBase;\n using RenderPipeline = RenderPipelineBase;\n using Sampler = SamplerBase;\n using ShaderModule = ShaderModuleBase;\n class SwapChain;\n using Texture = TextureBase;\n using TextureView = TextureViewBase;\n\n struct NullBackendTraits {\n using BindGroupType = BindGroup;\n using BindGroupLayoutType = BindGroupLayout;\n using BlendStateType = BlendState;\n using BufferType = Buffer;\n using BufferViewType = BufferView;\n using CommandBufferType = CommandBuffer;\n using ComputePipelineType = ComputePipeline;\n using DepthStencilStateType = DepthStencilState;\n using DeviceType = Device;\n using InputStateType = InputState;\n using PipelineLayoutType = PipelineLayout;\n using QueueType = Queue;\n using RenderPassDescriptorType = RenderPassDescriptor;\n using RenderPipelineType = RenderPipeline;\n using SamplerType = Sampler;\n using ShaderModuleType = ShaderModule;\n using SwapChainType = SwapChain;\n using TextureType = Texture;\n using TextureViewType = TextureView;\n };\n\n template <typename T>\n auto ToBackend(T&& common) -> decltype(ToBackendBase<NullBackendTraits>(common)) {\n return ToBackendBase<NullBackendTraits>(common);\n }\n\n struct PendingOperation {\n virtual ~PendingOperation() = default;\n virtual void Execute() = 0;\n };\n\n class Device : public DeviceBase {\n public:\n Device();\n ~Device();\n\n BindGroupBase* CreateBindGroup(BindGroupBuilder* builder) override;\n BlendStateBase* CreateBlendState(BlendStateBuilder* builder) override;\n BufferViewBase* CreateBufferView(BufferViewBuilder* builder) override;\n CommandBufferBase* CreateCommandBuffer(CommandBufferBuilder* builder) override;\n DepthStencilStateBase* CreateDepthStencilState(DepthStencilStateBuilder* builder) override;\n InputStateBase* CreateInputState(InputStateBuilder* builder) override;\n RenderPassDescriptorBase* CreateRenderPassDescriptor(\n RenderPassDescriptorBuilder* builder) override;\n RenderPipelineBase* CreateRenderPipeline(RenderPipelineBuilder* builder) override;\n SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;\n TextureViewBase* CreateTextureView(TextureViewBuilder* builder) override;\n\n void TickImpl() override;\n\n void AddPendingOperation(std::unique_ptr<PendingOperation> operation);\n std::vector<std::unique_ptr<PendingOperation>> AcquirePendingOperations();\n\n private:\n ResultOrError<BindGroupLayoutBase*> CreateBindGroupLayoutImpl(\n const BindGroupLayoutDescriptor* descriptor) override;\n ResultOrError<BufferBase*> CreateBufferImpl(const BufferDescriptor* descriptor) override;\n ResultOrError<ComputePipelineBase*> CreateComputePipelineImpl(\n const ComputePipelineDescriptor* descriptor) override;\n ResultOrError<PipelineLayoutBase*> CreatePipelineLayoutImpl(\n const PipelineLayoutDescriptor* descriptor) override;\n ResultOrError<QueueBase*> CreateQueueImpl() override;\n ResultOrError<SamplerBase*> CreateSamplerImpl(const SamplerDescriptor* descriptor) override;\n ResultOrError<ShaderModuleBase*> CreateShaderModuleImpl(\n const ShaderModuleDescriptor* descriptor) override;\n ResultOrError<TextureBase*> CreateTextureImpl(const TextureDescriptor* descriptor) override;\n\n std::vector<std::unique_ptr<PendingOperation>> mPendingOperations;\n };\n\n class Buffer : public BufferBase {\n public:\n Buffer(Device* device, const BufferDescriptor* descriptor);\n ~Buffer();\n\n void MapReadOperationCompleted(uint32_t serial, void* ptr, bool isWrite);\n\n private:\n void SetSubDataImpl(uint32_t start, uint32_t count, const uint8_t* data) override;\n void MapReadAsyncImpl(uint32_t serial, uint32_t start, uint32_t count) override;\n void MapWriteAsyncImpl(uint32_t serial, uint32_t start, uint32_t count) override;\n void UnmapImpl() override;\n\n void MapAsyncImplCommon(uint32_t serial, uint32_t start, uint32_t count, bool isWrite);\n\n std::unique_ptr<char[]> mBackingData;\n };\n\n class CommandBuffer : public CommandBufferBase {\n public:\n CommandBuffer(CommandBufferBuilder* builder);\n ~CommandBuffer();\n\n private:\n CommandIterator mCommands;\n };\n\n class Queue : public QueueBase {\n public:\n Queue(Device* device);\n ~Queue();\n\n private:\n void SubmitImpl(uint32_t numCommands, CommandBufferBase* const* commands) override;\n };\n\n class SwapChain : public SwapChainBase {\n public:\n SwapChain(SwapChainBuilder* builder);\n ~SwapChain();\n\n protected:\n TextureBase* GetNextTextureImpl(const TextureDescriptor* descriptor) override;\n void OnBeforePresent(TextureBase*) override;\n };\n\n}} // namespace dawn_native::null\n\n#endif // DAWNNATIVE_NULL_NULLBACKEND_H_\n", "meta": {"content_hash": "b49971bb8e0f23809fbb333ff7698e73", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 100, "avg_line_length": 39.40845070422535, "alnum_prop": 0.711758398856326, "repo_name": "googlearchive/nxt-standalone", "id": "1a348142225cee4116bd80566e1b7d8da7ba62dd", "size": "6976", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/dawn_native/null/NullBackend.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "11485"}, {"name": "C++", "bytes": "1466911"}, {"name": "CMake", "bytes": "37339"}, {"name": "Objective-C", "bytes": "21701"}, {"name": "Objective-C++", "bytes": "83113"}, {"name": "Python", "bytes": "47104"}, {"name": "Shell", "bytes": "2503"}]}} +{"text": "<footer class=\"content-info\" role=\"contentinfo\">\n <div class=\"footerCallToAction\">\n \t<div class=\"container ctaText\">\n\n\t \t<h2>A great community awaits.</h2>\n <h3><a>Join</a></h3>\n\t </div>\n </div>\n <div class=\"mainFooter\">\n \t<div class=\"container\">\n \t\t<a class=\"footerLogo tk-sarina\" href=\"join\"><img src=\"<?php echo get_template_directory_uri();; ?>/assets/img/logoespacio.png\"></a>\n\n\t <nav class=\"collapse navbar-collapse\" role=\"navigation\">\n <?php\n if (has_nav_menu('primary_navigation')) :\n wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav navbar-nav'));\n endif;\n ?>\n </nav>\n\t</div>\n </div>\n</footer>\n\n<?php wp_footer(); ?>", "meta": {"content_hash": "d057ddd3f79efdbb98dd386e1a854dfd", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 135, "avg_line_length": 30.041666666666668, "alnum_prop": 0.5922330097087378, "repo_name": "heyellieday/coffeeoforigin", "id": "fd17da60860fbcc5a5e0ca21183ba7492231cf37", "size": "721", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/footer.php", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "214391"}, {"name": "JavaScript", "bytes": "7554"}, {"name": "PHP", "bytes": "57095"}]}} +{"text": "import sys\nimport os\nimport re\nimport subprocess as sp\n\ntry:\n from .version import __version__\nexcept ImportError:\n __version__ = 'unknown'\n\n\ndef indent_level(line):\n \"\"\"Get the indent level for a line of mkvinfo output.\n Returns -1 if *line* is not the correct format.\"\"\"\n m = re.search(r'^\\|( *)\\+', line)\n if not m:\n return -1\n return len(m.group(1))\n\n\nclass TrackLineHandler:\n 'Parse a line of (English) mkvinfo output inside \"A track\".'\n _number = '| + Track number: '\n _type = '| + Track type: '\n _codec = '| + Codec ID: '\n _lang = '| + Language: '\n _duration = '| + Default duration: '\n fps = r'\\((.*?) frames/fields per second for a video track\\)'\n _fps_re = re.compile(fps)\n\n def __init__(self, infodict):\n self._info = infodict\n\n def _findvalue(self, key, s):\n idx = s.find(key)\n if idx != -1:\n return s[idx + len(key):]\n return None\n\n def line(self, handlers, l):\n self._track = self._info['tracks'][-1]\n cls = TrackLineHandler\n ind = indent_level(l)\n if ind == -1 or ind < 2:\n handlers.pop(-1)\n return False\n number = self._findvalue(cls._number, l)\n if number:\n endidx = number.find(' ')\n if endidx == -1:\n number = int(number)\n else:\n number = int(number[:endidx])\n self._track['number'] = number - 1\n return True\n typ = self._findvalue(cls._type, l)\n if typ:\n self._track['type'] = typ\n return True\n codec = self._findvalue(cls._codec, l)\n if codec:\n if codec[0] in ('V', 'A', 'S') and len(codec) > 1 and codec[1] == '_':\n codec = codec[2:]\n self._track['codec'] = codec\n return True\n lang = self._findvalue(cls._lang, l)\n if lang:\n self._track['language'] = lang\n return True\n if self._track.get('type', '') == 'video':\n duration = self._findvalue(cls._duration, l)\n if duration:\n match = cls._fps_re.search(l)\n if match:\n self._track['fps'] = float(match.group(1))\n return True\n return True\n\n\nclass MainLineHandler:\n \"Parse a line of (locale='en_US') mkvinfo output.\"\n def __init__(self, infodict):\n self._info = infodict\n self._track = TrackLineHandler(infodict)\n\n def line(self, handlers, l):\n if l.startswith('|+ Segment tracks'):\n self._info.setdefault('tracks', [])\n return True\n elif l.startswith('| + Track'):\n self._info.setdefault('tracks', [])\n self._info['tracks'].append({})\n handlers.append(self._track)\n return True\n return True\n\n\ndef info_locale_opts(locale):\n \"\"\"Example usage with *infostring*::\n\n opts = info_locale_opts('en_US')\n opts.setdefault('arguments', [])\n opts['arguments'].extend(['-x', '-r', 'mkvinfo.log'])\n opts.setdefault('env', {})\n opts['env']['MTX_DEBUG'] = 'topic'\n print infostring(mkv, **opts)\n \"\"\"\n return {'arguments': ['--ui-language', locale]}\n\n\ndef infostring(mkv, env=None, arguments=[], errorfunc=sys.exit, mkvinfo=None):\n \"\"\"Run mkvinfo on the given *mkv* and returns stdout as a single string.\n\n On failure, calls *errorfunc* with an error string.\n\n It's likely you'll want to set *env* or *arguments* to use ``'en_US'``\n locale, since that is what *infodict* requires. See\n *info_locale_opts*.\n \"\"\"\n if not mkvinfo:\n mkvinfo = 'mkvinfo'\n cmd = [mkvinfo] + arguments + [mkv]\n opts = {}\n if env is not None:\n env.setdefault('PATH', os.environ.get('PATH', ''))\n env.setdefault('SystemRoot', os.environ.get('SystemRoot', ''))\n opts = {'env': env}\n proc = sp.Popen(\n cmd, stdout=sp.PIPE, stderr=sp.PIPE, close_fds=True, **opts\n )\n out, err = proc.communicate()\n if proc.returncode != 0:\n if err is not str:\n err = err.decode('utf_8')\n errorfunc('command failed: ' + err.rstrip('\\n'))\n if out is not str:\n out = out.decode('utf_8')\n return out\n\n\ndef infodict(lines):\n \"\"\"Take a list of *lines* of ``locale='en_US'`` mkvinfo output and return a\n dictionary of info.\"\"\"\n infod = {'lines': lines}\n handlers = [MainLineHandler(infod)]\n for l in lines:\n while not handlers[-1].line(handlers, l):\n if not handlers:\n break\n if not handlers:\n break\n return infod\n\n\nif __name__ == '__main__':\n from pprint import pprint\n mkv = sys.argv[1]\n s = infostring(mkv, arguments=['--ui-language', 'en_US'])\n d = infodict(s.rstrip('\\n').split('\\n'))\n del d['lines']\n pprint(d)\n", "meta": {"content_hash": "450fa672ecf9e05263faadb724bc43e5", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 82, "avg_line_length": 30.26086956521739, "alnum_prop": 0.5344827586206896, "repo_name": "gavinbeatty/mkvtomp4", "id": "41b4bcc8aa676cc4c6d7117e92c7f7a10fa3b9df", "size": "4872", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "simplemkv/info.py", "mode": "33188", "license": "mit", "language": [{"name": "Makefile", "bytes": "1767"}, {"name": "Python", "bytes": "36515"}]}} +{"text": "> ## Note: Yosemite (and later)\n>\n> Starting in Yosemite (10.10), the wrapper program does not seem to\n> be needed for pasteboard access. It may still be useful for some\n> [other services][other], however.\n\n[other]: #beyond-pasteboard-access\n\nThe basic configuration is to set *tmux*\u2019s `default-command` so that\nyour interactive shell ends up reattached to the user bootstrap\nnamespace:\n\n set-option -g default-command 'reattach-to-user-namespace -l zsh'\n\nSince the \u201cattachment status\u201d is inherited by child processes, this\nconfiguration will ensure that all the commands started from your\nshell will also be properly attached.\n\n# Configuration Alternatives\n\n## Cross-Platform Conditional Usage\n\nSome users like to share identical configuration files (including\n`.tmux.conf`) with systems where the wrapper program is not\navailable (e.g. same files on both OS X and Linux). Starting with\n*tmux* 1.9, it is safe to use `if-shell` to conditionally configure\nthe use of the wrapper program:\n\n if-shell 'test \"$(uname -s)\" = Darwin' 'set-option -g default-command \"exec reattach-to-user-namespace -l zsh\"'\n\nOr, if you have other platform specific configuration, you can\nconditionally source another file.\n\nIn `.tmux.conf`:\n\n if-shell 'test \"$(uname -s)\" = Darwin' 'source-file ~/.tmux-osx.conf'\n\nThen in `.tmux-osx.conf`, include the `default-command` setting and\nany other bits of OS X configuration (e.g. the buffer-to-pasteboard\nbindings shown below):\n\n set-option -g default-command 'exec reattach-to-user-namespace -l zsh'\n\nWith *tmux* 1.8 and earlier, the above configuration has a race\ncondition (the `if-shell` command is run in the background) and/or\ndoes not affect the initial session/window/pane. Instead, the basic\n`default-command` can be extended with a bit of shell code to\nconditionally use the wrapper only where it is present:\n\n set-option -g default-command 'command -v reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace -l \"$SHELL\" || exec \"$SHELL\"'\n\nThe `default-command` will be run using your `default-shell` (which\ndefaults to SHELL, your login shell, or `/bin/sh`). This particular\ncode should work on most systems, but it may fail if the effective\nshell is not POSIX compliant (old-style `/bin/sh`, a *csh* variant,\n*fish*, etc.). If one of your systems does not understand `command\n-v` (or if it does something unrelated that returns the wrong exit\nvalue), then you might try using `which` instead. Exotic shells may\nalso require different syntax.\n\n## Fine-Grained Usage\n\nInstead of using `default-command` to \u201cwrap\u201d your top-level shells,\nyou can instead use the wrapper on just the tools that need it (see\n\u201cBeyond Pasteboard Access\u201d (below) for other commands that may also\nneed the wrapper).\n\nYou might want to adopt this approach if part of your shell\ninitialization takes a long time to run: the `default-command` will\nstart your shell twice (once to process the `default-command`, and\nonce more for the final, interactive shell that is started by the\n`default-command`). For example if your SHELL is *zsh*, then your\n`.zshenv` (if you have one) will be run twice (the other\ninitialization files will only be run once).\n\nFor example, you could leave your shell \u201cdetached\u201d and run\n`reattach-to-user-namespace pbpaste` to read from the pasteboard. If\nyou take this approach, you may want to use a small script, shell\nalias, or shell function to supply a shorter name for the wrapper\nprogram (or wrap the individual commands\u2014the\n`reattach-to-user-namespace` *Homebrew* recipe has some support for\nthis).\n\nYou will also need to apply this fine-grained \u201cwrapping\u201d if you want\nto have *tmux* directly run commands that need to be reattached.\n\nFor example, you might use bindings like the following to write\na *tmux* buffer to the OS X pasteboard or to paste the OS X\npasteboard into the current *tmux* pane.\n\n bind-key C-c run-shell 'tmux save-buffer - | reattach-to-user-namespace pbcopy'\n bind-key C-v run-shell 'reattach-to-user-namespace pbpaste | tmux load-buffer - \\; paste-buffer -d'\n\nSimilarly, for the `copy-pipe` command (new in *tmux* 1.8):\n\n bind-key -t vi-copy y copy-pipe 'reattach-to-user-namespace pbcopy'\n bind-key -t emacs-copy M-w copy-pipe 'reattach-to-user-namespace pbcopy'\n\n\n\n# Beyond Pasteboard Access\n\nBecause the fix applied by the wrapper program is not limited to\njust pasteboard access, there are other bugs/issues/problems that\ncome up when running under *tmux* that the wrapper can help\nalleviate.\n\n* `nohup`\n\n The *nohup* program aborts if it cannot \u201cdetach from console\u201d.\n Normally, processes running \u201cinside\u201d *tmux* (on the other side\n of a daemon(3) call) are already detached; the wrapper\n reattaches so that *nohup* can successfully detach itself.\n\n *nohup* does generate an error message if it aborts due to\n failing to detach, but it happens after the output has been\n redirected so it ends up in the `nohup.out` file (or wherever\n you sent stdout):\n\n nohup: can't detach from console: Undefined error: 0\n\n References: [problem using nohup within tmux on OSX 10.6][ml nohup]\n\n[ml nohup]: http://thread.gmane.org/gmane.comp.terminal-emulators.tmux.user/4450\n\n* The `export`, `getenv`, `setenv` subcommands of `launchctl`\n\n Notably, the `setenv` subcommand will issue an error when it is\n run from a \u201cdetached\u201d context:\n\n launch_msg(\"SetUserEnvironment\"): Socket is not connected\n\n The `getenv` and `export` commands will simply not have access\n to some variables that have otherwise been configured in the\n user\u2019s *launchd* instance.\n\n References: [tmux \u201cSocket is not connected\u201d error on OS X Lion][so setenv]\n\n[so setenv]: http://stackoverflow.com/q/10193561/193688\n\n* `subl -w` `subl --wait`\n\n[su subl]: http://superuser.com/q/522055/14827\n[so subl]: http://stackoverflow.com/q/13917095/193688\n\n The *subl* command from *Sublime Text* can be used to open files\n in the GUI window from a shell command line. The `-w` (or\n `--wait`) option tells it to wait for the file to be closed in\n the editor before exiting the `subl` command.\n\n Whatever mechanism *Sublime Text* uses to coordinate between the\n `subl` instance and the main *Sublime Text* instance is affected\n by being \u201cdetached\u201d. The result is that `subl -w` commands\n issued inside *tmux* will not exit after the file is closed in\n the GUI. The wrapper lets the `subl` command successfully\n synchronize with the GUI instance.\n\n References: ['subl -w' doesn't ever un-block when running under tmux on OS X][su subl] and [subl --wait doesn't work within tmux][so subl]\n\n* Retina rendering of apps launched under *tmux* (10.9 Mavericks)\n\n From feedback in [issue #22][issue 22]:\n\n[issue 22]: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/issues/22\n\n > Under Mavericks, applications launched from inside a tmux\n > session cannot enable retina rendering (for reasons I don't\n > understand -- this worked under Mountain Lion). If the shell\n > inside the tmux session is reattached to the user namespace,\n > then applications launched from the reattached shell do enable\n > retina rendering when appropriate.\n\n\nThere may also be other contexts (aside from \u201cinside *tmux*\u201d) where\nthese same problems occur, but I have not yet heard of any.\n", "meta": {"content_hash": "16092b79300745f7bcde44ecd3bd73c5", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 148, "avg_line_length": 41.88, "alnum_prop": 0.7422567881020603, "repo_name": "bradparks/tmux-MacOSX-pasteboard", "id": "4266845830d42f2147e0fb51fd11ff302dd5ea4f", "size": "7402", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Usage.md", "mode": "33188", "license": "bsd-2-clause", "language": [{"name": "C", "bytes": "22952"}, {"name": "Makefile", "bytes": "549"}]}} +{"text": "$(function() {\n\tif (!$('#signup-form').length) {\n return false;\n }\n\n var signupValidationSettings = {\n\t rules: {\n\t \tfirstname: {\n\t \t\trequired: true,\n\t \t},\n\t \tlastname: {\n\t \t\trequired: true,\n\t \t},\n\t email: {\n\t required: true,\n\t email: true\n\t },\n\t password: {\n\t\t\t\trequired: true,\n\t\t\t\tminlength: 8\n\t },\n\t retype_password: {\n\t\t\t\trequired: true,\n\t\t\t\tminlength: 8,\n\t\t\t\tequalTo: \"#password\"\n\t\t\t},\n\t\t\tagree: {\n\t\t\t\trequired: true,\n\t\t\t}\n\t },\n\t groups: {\n\t \tname: \"firstname lastname\",\n\t\t\tpass: \"password retype_password\",\n\t\t},\n\t\terrorPlacement: function(error, element) {\n\t\t\tif (\n\t\t\t\telement.attr(\"name\") == \"firstname\" || \n\t\t\t\telement.attr(\"name\") == \"lastname\" \n\t\t\t) {\n\t\t\t\terror.insertAfter($(\"#lastname\").closest('.row'));\n\t\t\t\telement.parents(\"div.form-group\")\n\t\t\t\t.addClass('has-error');\n\t\t\t} \n\t\t\telse if (\n\t\t\t\telement.attr(\"name\") == \"password\" || \n\t\t\t\telement.attr(\"name\") == \"retype_password\" \n\t\t\t) {\n\t\t\t\terror.insertAfter($(\"#retype_password\").closest('.row'));\n\t\t\t\telement.parents(\"div.form-group\")\n\t\t\t\t.addClass('has-error');\n\t\t\t}\n\t\t\telse if (element.attr(\"name\") == \"agree\") {\n\t\t\t\terror.insertAfter(\"#agree-text\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror.insertAfter(element);\n\t\t\t}\n\t\t},\n\t messages: {\n\t \tfirstname: \"Please enter firstname and lastname\",\n\t \tlastname: \"Please enter firstname and lastname\",\n\t email: {\n\t required: \"Please enter email\",\n\t email: \"Please enter a valid email address\"\n\t },\n\t password: {\n\t \trequired: \"Please enter password fields.\",\n\t \tminlength: \"Passwords should be at least 8 characters.\"\n\t },\n\t retype_password: {\n\t \trequired: \"Please enter password fields.\",\n\t \tminlength: \"Passwords should be at least 8 characters.\"\n\t },\n\t agree: \"Please accept our policy\"\n\t },\n\t invalidHandler: function() {\n\t\t\tanimate({\n\t\t\t\tname: 'shake',\n\t\t\t\tselector: '.auth-container > .card'\n\t\t\t});\n\t\t}\n\t}\n\n\t$.extend(signupValidationSettings, config.validations);\n\n $('#signup-form').validate(signupValidationSettings);\n});", "meta": {"content_hash": "657b85b39356dbbe94abb04263a12494", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 65, "avg_line_length": 24.54022988505747, "alnum_prop": 0.5470725995316159, "repo_name": "Cheevil/Cheevil.github.io", "id": "c4468b73a7830e2b49bbd1305e37aa6cf8adfe54", "size": "2159", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/auth/signup/signup.js", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "64035"}, {"name": "HTML", "bytes": "227786"}, {"name": "JavaScript", "bytes": "77924"}]}} +{"text": "require File.dirname(__FILE__) + '/test_helper.rb'\nrequire 'bot'\n\ndescribe \"TestBot\" do\n before(:each) do\n @config = {\n \"server\" => \"server\",\n \"port\" => 6667,\n \"nick\" => \"nick\",\n \"username\" => \"username\",\n \"realname\" => \"realname\",\n \"channels\" => [\"#first\", \"#second\"],\n \"modules_dir\" => \"modules_dir\",\n \"module_config\" => {\"some key\" => \"some value\"}\n }\n @config_path = \"path/to/config_file.yml\"\n expect(YAML).to receive(:load_file).with(@config_path).and_return(@config)\n @module_handler = double()\n\texpect(@module_handler).to receive(:reload)\n end\n \n context \"Bot\" do\n\tbefore (:each) do\n\t @bot = Bot.new(@config_path, @module_handler)\n\tend\n\n it \"load nickname from config in initialization\" do \n\t expect(@bot.nick).to eq(\"nick\")\n end\n\n it \"give module specific configuration\" do \n expect(@bot.module_config).to eq(({\"some key\" => \"some value\"}))\n end\n\n it \"add modules dir to $LOAD_PATH\" do\n expect($LOAD_PATH.include?(\"modules_dir\")).to eq(true)\n end\n end\n\n context \"Disconnected Bot\" do\n\tbefore(:each) do\n\t @connector = double()\n\t @bot = Bot.new(@config_path, @module_handler)\n\t expect(@bot).to receive(:create_connector).\n\t\t with(\"server\", 6667, \"nick\", \"username\", \"realname\", [\"#first\", \"#second\"]).\n\t\t and_return(@connector)\n\tend\n\n it \"connect\" do \n expect(@connector).to receive(:connect).and_return(nil)\n @bot.connect\n expect(@bot.connected).to eq(true)\n end\n\n it \"raise exception\" do\n expect(@connector).to receive(:connect).and_throw(Exception)\n\t expect { @bot.connect }.to raise_error(Exception)\n end\n it \"attempt reconnection and then read input\" do\n expect(@connector).to receive(:connect)\n expect(@connector).to receive(:read_input).and_return(IrcMsg.new(IrcMsg::NO_MSG))\n @bot.handle_state\n end\n end\n \n context \"Connected Bot\" do\n\tbefore(:each) do\n\t @connector = double()\n\t @bot = Bot.new(@config_path, @module_handler)\n\t expect(@bot).to receive(:create_connector).and_return(@connector)\n\t expect(@connector).to receive(:connect)\n\t @bot.connect\n\tend\n\n it \"send raw msg\" do\n expect(@connector).to receive(:send).with(\"a raw message\")\n @bot.send_raw(\"a raw message\")\n end\n\n it \"send privmsg\" do \n expect(@connector).to receive(:privmsg).with(\"target\", \"message body\")\n @bot.send_privmsg(\"target\", \"message body\")\n end\n\n it \"disconnect when receiving disconnect message\" do \n expect(@connector).to receive(:read_input).and_return(IrcMsg.new(IrcMsg::DISCONNECTED))\n @bot.handle_state\n expect(@bot.connected).to eq(false)\n end\n\n it \"print unhandled message\" do\n expect(@bot).to receive(:puts).with(\"<-- some unknown text\").and_return(nil)\n expect(@connector).to receive(:read_input).and_return(UnhandledMsg.new(\"some unknown text\"))\n @bot.handle_state\n end\n\n it \"give handling of privmsg to module handler\" do\n msg = PrivMsg.new(\"from\", \"target\", \"text\")\n expect(@connector).to receive(:read_input).and_return(msg)\n expect(@module_handler).to receive(:handle_privmsg).with(\"from\", \"target\", \"text\")\n @bot.handle_state\n end\n\n it \"reload configuration on request\" do\n msg = PrivMsg.new(\"from\", \"target\", \"!reload\")\n expect(@connector).to receive(:read_input).and_return(msg)\n expect(@bot).to receive(:reload_config)\n @bot.handle_state\n end\n end\nend\n", "meta": {"content_hash": "5284d6d572b5906e63084f6df92e2ee9", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 98, "avg_line_length": 31.036036036036037, "alnum_prop": 0.6339622641509434, "repo_name": "akisaarinen/lullizio", "id": "9f459d19f66965570bd12b976f947b89f92c8581", "size": "3472", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/bot_spec.rb", "mode": "33188", "license": "mit", "language": [{"name": "Ruby", "bytes": "48459"}, {"name": "Shell", "bytes": "130"}]}} +{"text": "\n/*\n * cg.h\n *\n * Created on: July 23, 2016\n * Author: weitan\n */\n\n#ifndef CG_H_\n#define CG_H_\n\nint updateXWithCG(const int batchSize, const int batchOffset, float * ythetaT, float * tt, float * XT,\n\t\tcublasHandle_t handle, const int m, const int n, const int f, const int nnz);\n\t\t\nvoid updateXWithCGHost(float * A, float * x, float * b, const int batchSize, const int f, const float cgIter);\n\nvoid updateXWithCGHost_tt_fp16(float * A, float * x, float * b, const int batchSize, const int f, const float cgIter);\n\nvoid alsUpdateFeature100Host(const int batch_offset,\n\t\tconst int* csrRowIndex, const int* csrColIndex, const float lambda, const int m, const int F,\n\t\tconst float* thetaT, float* XT, float* ythetaT, int cgIter);\n#endif /* CG_H_ */\n", "meta": {"content_hash": "7b1fd83c80d27c85edb87ee7d9dfac00", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 118, "avg_line_length": 34.13636363636363, "alnum_prop": 0.6990679094540613, "repo_name": "wei-tan/CuMF", "id": "538889b352e84d5b385c1b6713397e50b65fc1a8", "size": "1551", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cg.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "C", "bytes": "43142"}, {"name": "C++", "bytes": "16557"}, {"name": "Cuda", "bytes": "220818"}, {"name": "Jupyter Notebook", "bytes": "3140"}, {"name": "Makefile", "bytes": "14741"}, {"name": "Python", "bytes": "8494"}, {"name": "Shell", "bytes": "2815"}]}} +{"text": "class IcmpAttack < Package\n after_initialize :initial_setting\n before_save :initial_setting\n private\n def initial_setting\n self.pre_configured_type = true\n end\nend", "meta": {"content_hash": "4ca42f69c1506613d6bd8745554e0874", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 35, "avg_line_length": 21.375, "alnum_prop": 0.7602339181286549, "repo_name": "HoneyJack/FirewallTool", "id": "e9449b5caa3ae762daa6ff9d69cb1d114b18e783", "size": "171", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/icmp_attack.rb", "mode": "33188", "license": "mit", "language": [{"name": "CSS", "bytes": "19370"}, {"name": "HTML", "bytes": "76470"}, {"name": "JavaScript", "bytes": "1199515"}, {"name": "Ruby", "bytes": "147480"}]}} +{"text": "package com.twitter.zipkin.json\n\nimport java.nio.ByteBuffer\n\nimport com.fasterxml.jackson.annotation.JsonProperty\nimport com.google.common.base.CaseFormat.{UPPER_CAMEL, UPPER_UNDERSCORE}\nimport com.google.common.io.BaseEncoding\nimport com.twitter.io.Charsets.Utf8\nimport com.twitter.zipkin.common._\nimport com.twitter.zipkin.common.AnnotationType._\n\ncase class JsonBinaryAnnotation(key: String,\n value: Any,\n @JsonProperty(\"type\")\n annotationType: Option[String],\n endpoint: Option[JsonEndpoint])\n\nobject JsonBinaryAnnotation extends (BinaryAnnotation => JsonBinaryAnnotation) {\n val base64 = BaseEncoding.base64()\n val upperCamel = UPPER_UNDERSCORE.converterTo(UPPER_CAMEL)\n\n def apply(b: BinaryAnnotation) = {\n val (annotationType: Option[String], value: Any) = try {\n b.annotationType.value match {\n case Bool.value => (None, if (b.value.get(0) != 0) true else false)\n case Bytes.value => (Some(\"BYTES\"), base64.encode(b.value.array(), b.value.position(), b.value.remaining()))\n case I16.value => (Some(\"I16\"), b.value.getShort(0))\n case I32.value => (Some(\"I32\"), b.value.getInt(0))\n case I64.value => (Some(\"I64\"), b.value.getLong(0))\n case Double.value => (Some(\"DOUBLE\"), b.value.getDouble(0))\n case String.value => (None, new String(b.value.array(), b.value.position(), b.value.remaining(), Utf8))\n case _ => throw new Exception(\"Unsupported annotation type: %s\".format(b))\n }\n } catch {\n case e: Exception => \"Error parsing binary annotation: %s\".format(exceptionString(e))\n }\n JsonBinaryAnnotation(b.key, value, annotationType, b.host.map(JsonEndpoint))\n }\n\n def invert(b: JsonBinaryAnnotation) = {\n val annotationType = b.annotationType\n .map(upperCamel.convert(_))\n .map(AnnotationType.fromName(_))\n .getOrElse(b.value match {\n // The only json types that can be implicit are booleans and strings. Numbers vary in shape.\n case bool: Boolean => Bool\n case string: String => String\n case _ => throw new IllegalArgumentException(\"Unsupported json annotation type: %s\".format(b))\n })\n\n val bytes: ByteBuffer = try {\n annotationType.value match {\n case Bool.value => BinaryAnnotationValue(b.value.asInstanceOf[Boolean]).encode\n case Bytes.value => ByteBuffer.wrap(base64.decode(b.value.asInstanceOf[String]))\n case I16.value => BinaryAnnotationValue(b.value.asInstanceOf[Short]).encode\n case I32.value => BinaryAnnotationValue(b.value.asInstanceOf[Int]).encode\n case I64.value => BinaryAnnotationValue(b.value.asInstanceOf[Long]).encode\n case Double.value => BinaryAnnotationValue(b.value.asInstanceOf[Double]).encode\n case String.value => BinaryAnnotationValue(b.value.asInstanceOf[String]).encode\n case _ => throw new IllegalArgumentException(\"Unsupported annotation type: %s\".format(b))\n }\n } catch {\n case e: Exception => BinaryAnnotationValue(\"Error parsing json binary annotation: %s\".format(exceptionString(e))).encode\n }\n new BinaryAnnotation(b.key, bytes, annotationType, b.endpoint.map(JsonEndpoint.invert))\n }\n\n private[this] def exceptionString(e: Exception) =\n \"%s(%s)\".format(e.getClass.getSimpleName, if (e.getMessage == null) \"\" else e.getMessage)\n}\n", "meta": {"content_hash": "103381a5554f126fa2e8dd8e65f991c2", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 126, "avg_line_length": 48.77142857142857, "alnum_prop": 0.6745752782659636, "repo_name": "prat0318/zipkin", "id": "a69d0aef1078656de3e3226973aad8346b80ac83", "size": "3414", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "zipkin-common/src/main/scala/com/twitter/zipkin/json/JsonBinaryAnnotation.scala", "mode": "33188", "license": "apache-2.0", "language": [{"name": "CSS", "bytes": "24629"}, {"name": "HTML", "bytes": "18269"}, {"name": "Java", "bytes": "47962"}, {"name": "JavaScript", "bytes": "201941"}, {"name": "Scala", "bytes": "452429"}, {"name": "Shell", "bytes": "4059"}, {"name": "Thrift", "bytes": "18304"}]}} +{"text": "<?php\n\n\nnamespace lithium\\tests\\mocks\\core;\n\nclass MockMethodFiltering extends \\lithium\\core\\Object {\n\n\tpublic function method($data) {\n\t\t$data[] = 'Starting outer method call';\n\t\t$result = $this->_filter(__METHOD__, compact('data'), function($self, $params, $chain) {\n\t\t\t$params['data'][] = 'Inside method implementation';\n\t\t\treturn $params['data'];\n\t\t});\n\t\t$result[] = 'Ending outer method call';\n\t\treturn $result;\n\t}\n\n\tpublic function method2() {\n\t\t$filters =& $this->_methodFilters;\n\t\t$method = function($self, $params, $chain) use (&$filters) {\n\t\t\treturn $filters;\n\t\t};\n\t\treturn $this->_filter(__METHOD__, array(), $method);\n\t}\n\n\tpublic function manual($filters) {\n\t\t$method = function($self, $params, $chain) {\n\t\t\treturn \"Working\";\n\t\t};\n\t\treturn $this->_filter(__METHOD__, array(), $method, $filters);\n\t}\n\n}\n\n?>", "meta": {"content_hash": "4ab0b4b26fb7f6326cb49a18e81afe4d", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 90, "avg_line_length": 23.34285714285714, "alnum_prop": 0.6340269277845777, "repo_name": "davidpersson/lithium", "id": "9d4200330ec65f3811710b9fa25af5feac75229e", "size": "1020", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "tests/mocks/core/MockMethodFiltering.php", "mode": "33188", "license": "bsd-3-clause", "language": [{"name": "Batchfile", "bytes": "247"}, {"name": "PHP", "bytes": "2998922"}, {"name": "Shell", "bytes": "303"}]}} +{"text": "\n\n/* Define to prevent recursive inclusion -------------------------------------*/\n#ifndef __STM32_HAL_LEGACY\n#define __STM32_HAL_LEGACY\n\n#ifdef __cplusplus\n extern \"C\" {\n#endif\n\n/* Includes ------------------------------------------------------------------*/\n/* Exported types ------------------------------------------------------------*/\n/* Exported constants --------------------------------------------------------*/\n\n/** @defgroup HAL_AES_Aliased_Defines HAL CRYP Aliased Defines maintained for legacy purpose\n * @{\n */\n#define AES_FLAG_RDERR CRYP_FLAG_RDERR\n#define AES_FLAG_WRERR CRYP_FLAG_WRERR\n#define AES_CLEARFLAG_CCF CRYP_CLEARFLAG_CCF\n#define AES_CLEARFLAG_RDERR CRYP_CLEARFLAG_RDERR\n#define AES_CLEARFLAG_WRERR CRYP_CLEARFLAG_WRERR\n\n/**\n * @}\n */\n \n/** @defgroup HAL_ADC_Aliased_Defines HAL ADC Aliased Defines maintained for legacy purpose\n * @{\n */\n#define ADC_RESOLUTION12b ADC_RESOLUTION_12B\n#define ADC_RESOLUTION10b ADC_RESOLUTION_10B\n#define ADC_RESOLUTION8b ADC_RESOLUTION_8B\n#define ADC_RESOLUTION6b ADC_RESOLUTION_6B\n#define OVR_DATA_OVERWRITTEN ADC_OVR_DATA_OVERWRITTEN\n#define OVR_DATA_PRESERVED ADC_OVR_DATA_PRESERVED\n#define EOC_SINGLE_CONV ADC_EOC_SINGLE_CONV\n#define EOC_SEQ_CONV ADC_EOC_SEQ_CONV\n#define EOC_SINGLE_SEQ_CONV ADC_EOC_SINGLE_SEQ_CONV\n#define REGULAR_GROUP ADC_REGULAR_GROUP\n#define INJECTED_GROUP ADC_INJECTED_GROUP\n#define REGULAR_INJECTED_GROUP ADC_REGULAR_INJECTED_GROUP\n#define AWD_EVENT ADC_AWD_EVENT\n#define AWD1_EVENT ADC_AWD1_EVENT\n#define AWD2_EVENT ADC_AWD2_EVENT\n#define AWD3_EVENT ADC_AWD3_EVENT\n#define OVR_EVENT ADC_OVR_EVENT\n#define JQOVF_EVENT ADC_JQOVF_EVENT\n#define ALL_CHANNELS ADC_ALL_CHANNELS\n#define REGULAR_CHANNELS ADC_REGULAR_CHANNELS\n#define INJECTED_CHANNELS ADC_INJECTED_CHANNELS\n#define SYSCFG_FLAG_SENSOR_ADC ADC_FLAG_SENSOR\n#define SYSCFG_FLAG_VREF_ADC ADC_FLAG_VREFINT\n#define ADC_CLOCKPRESCALER_PCLK_DIV1 ADC_CLOCK_SYNC_PCLK_DIV1\n#define ADC_CLOCKPRESCALER_PCLK_DIV2 ADC_CLOCK_SYNC_PCLK_DIV2\n#define ADC_CLOCKPRESCALER_PCLK_DIV4 ADC_CLOCK_SYNC_PCLK_DIV4\n#define ADC_CLOCKPRESCALER_PCLK_DIV6 ADC_CLOCK_SYNC_PCLK_DIV6\n#define ADC_CLOCKPRESCALER_PCLK_DIV8 ADC_CLOCK_SYNC_PCLK_DIV8\n#define ADC_EXTERNALTRIG0_T6_TRGO ADC_EXTERNALTRIGCONV_T6_TRGO \n#define ADC_EXTERNALTRIG1_T21_CC2 ADC_EXTERNALTRIGCONV_T21_CC2 \n#define ADC_EXTERNALTRIG2_T2_TRGO ADC_EXTERNALTRIGCONV_T2_TRGO \n#define ADC_EXTERNALTRIG3_T2_CC4 ADC_EXTERNALTRIGCONV_T2_CC4 \n#define ADC_EXTERNALTRIG4_T22_TRGO ADC_EXTERNALTRIGCONV_T22_TRGO\n#define ADC_EXTERNALTRIG7_EXT_IT11 ADC_EXTERNALTRIGCONV_EXT_IT11\n#define ADC_CLOCK_ASYNC ADC_CLOCK_ASYNC_DIV1\n#define ADC_EXTERNALTRIG_EDGE_NONE ADC_EXTERNALTRIGCONVEDGE_NONE\n#define ADC_EXTERNALTRIG_EDGE_RISING ADC_EXTERNALTRIGCONVEDGE_RISING\n#define ADC_EXTERNALTRIG_EDGE_FALLING ADC_EXTERNALTRIGCONVEDGE_FALLING\n#define ADC_EXTERNALTRIG_EDGE_RISINGFALLING ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING\n#define ADC_SAMPLETIME_2CYCLE_5 ADC_SAMPLETIME_2CYCLES_5\n\n#define HAL_ADC_STATE_BUSY_REG HAL_ADC_STATE_REG_BUSY\n#define HAL_ADC_STATE_BUSY_INJ HAL_ADC_STATE_INJ_BUSY\n#define HAL_ADC_STATE_EOC_REG HAL_ADC_STATE_REG_EOC\n#define HAL_ADC_STATE_EOC_INJ HAL_ADC_STATE_INJ_EOC\n#define HAL_ADC_STATE_ERROR HAL_ADC_STATE_ERROR_INTERNAL\n#define HAL_ADC_STATE_BUSY HAL_ADC_STATE_BUSY_INTERNAL\n#define HAL_ADC_STATE_AWD HAL_ADC_STATE_AWD1 \n/**\n * @}\n */\n \n/** @defgroup HAL_CEC_Aliased_Defines HAL CEC Aliased Defines maintained for legacy purpose\n * @{\n */ \n \n#define __HAL_CEC_GET_IT __HAL_CEC_GET_FLAG \n\n/**\n * @}\n */ \n \n/** @defgroup HAL_COMP_Aliased_Defines HAL COMP Aliased Defines maintained for legacy purpose\n * @{\n */\n#define COMP_WINDOWMODE_DISABLED COMP_WINDOWMODE_DISABLE\n#define COMP_WINDOWMODE_ENABLED COMP_WINDOWMODE_ENABLE\n#define COMP_EXTI_LINE_COMP1_EVENT COMP_EXTI_LINE_COMP1\n#define COMP_EXTI_LINE_COMP2_EVENT COMP_EXTI_LINE_COMP2\n#define COMP_EXTI_LINE_COMP3_EVENT COMP_EXTI_LINE_COMP3\n#define COMP_EXTI_LINE_COMP4_EVENT COMP_EXTI_LINE_COMP4\n#define COMP_EXTI_LINE_COMP5_EVENT COMP_EXTI_LINE_COMP5\n#define COMP_EXTI_LINE_COMP6_EVENT COMP_EXTI_LINE_COMP6\n#define COMP_EXTI_LINE_COMP7_EVENT COMP_EXTI_LINE_COMP7\n#if defined(STM32L0)\n#define COMP_LPTIMCONNECTION_ENABLED ((uint32_t)0x00000003U) /*!< COMPX output generic naming: connected to LPTIM input 1 for COMP1, LPTIM input 2 for COMP2 */\n#endif\n#define COMP_OUTPUT_COMP6TIM2OCREFCLR COMP_OUTPUT_COMP6_TIM2OCREFCLR\n#if defined(STM32F373xC) || defined(STM32F378xx)\n#define COMP_OUTPUT_TIM3IC1 COMP_OUTPUT_COMP1_TIM3IC1\n#define COMP_OUTPUT_TIM3OCREFCLR COMP_OUTPUT_COMP1_TIM3OCREFCLR\n#endif /* STM32F373xC || STM32F378xx */\n\n#if defined(STM32L0) || defined(STM32L4)\n#define COMP_WINDOWMODE_ENABLE COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON\n\n#define COMP_NONINVERTINGINPUT_IO1 COMP_INPUT_PLUS_IO1\n#define COMP_NONINVERTINGINPUT_IO2 COMP_INPUT_PLUS_IO2\n#define COMP_NONINVERTINGINPUT_IO3 COMP_INPUT_PLUS_IO3\n#define COMP_NONINVERTINGINPUT_IO4 COMP_INPUT_PLUS_IO4\n#define COMP_NONINVERTINGINPUT_IO5 COMP_INPUT_PLUS_IO5\n#define COMP_NONINVERTINGINPUT_IO6 COMP_INPUT_PLUS_IO6\n \n#define COMP_INVERTINGINPUT_1_4VREFINT COMP_INPUT_MINUS_1_4VREFINT\n#define COMP_INVERTINGINPUT_1_2VREFINT COMP_INPUT_MINUS_1_2VREFINT\n#define COMP_INVERTINGINPUT_3_4VREFINT COMP_INPUT_MINUS_3_4VREFINT\n#define COMP_INVERTINGINPUT_VREFINT COMP_INPUT_MINUS_VREFINT\n#define COMP_INVERTINGINPUT_DAC1_CH1 COMP_INPUT_MINUS_DAC1_CH1\n#define COMP_INVERTINGINPUT_DAC1_CH2 COMP_INPUT_MINUS_DAC1_CH2\n#define COMP_INVERTINGINPUT_DAC1 COMP_INPUT_MINUS_DAC1_CH1\n#define COMP_INVERTINGINPUT_DAC2 COMP_INPUT_MINUS_DAC1_CH2\n#define COMP_INVERTINGINPUT_IO1 COMP_INPUT_MINUS_IO1\n#if defined(STM32L0)\n/* Issue fixed on STM32L0 COMP driver: only 2 dedicated IO (IO1 and IO2), */\n/* IO2 was wrongly assigned to IO shared with DAC and IO3 was corresponding */\n/* to the second dedicated IO (only for COMP2). */\n#define COMP_INVERTINGINPUT_IO2 COMP_INPUT_MINUS_DAC1_CH2\n#define COMP_INVERTINGINPUT_IO3 COMP_INPUT_MINUS_IO2\n#else\n#define COMP_INVERTINGINPUT_IO2 COMP_INPUT_MINUS_IO2\n#define COMP_INVERTINGINPUT_IO3 COMP_INPUT_MINUS_IO3\n#endif\n#define COMP_INVERTINGINPUT_IO4 COMP_INPUT_MINUS_IO4\n#define COMP_INVERTINGINPUT_IO5 COMP_INPUT_MINUS_IO5\n\n#define COMP_OUTPUTLEVEL_LOW COMP_OUTPUT_LEVEL_LOW\n#define COMP_OUTPUTLEVEL_HIGH COMP_OUTPUT_LEVEL_HIGH\n\n/* Note: Literal \"COMP_FLAG_LOCK\" kept for legacy purpose. */\n/* To check COMP lock state, use macro \"__HAL_COMP_IS_LOCKED()\". */\n#if defined(COMP_CSR_LOCK)\n#define COMP_FLAG_LOCK COMP_CSR_LOCK\n#elif defined(COMP_CSR_COMP1LOCK)\n#define COMP_FLAG_LOCK COMP_CSR_COMP1LOCK\n#elif defined(COMP_CSR_COMPxLOCK)\n#define COMP_FLAG_LOCK COMP_CSR_COMPxLOCK\n#endif\n\n#if defined(STM32L4)\n#define COMP_BLANKINGSRCE_TIM1OC5 COMP_BLANKINGSRC_TIM1_OC5_COMP1\n#define COMP_BLANKINGSRCE_TIM2OC3 COMP_BLANKINGSRC_TIM2_OC3_COMP1\n#define COMP_BLANKINGSRCE_TIM3OC3 COMP_BLANKINGSRC_TIM3_OC3_COMP1\n#define COMP_BLANKINGSRCE_TIM3OC4 COMP_BLANKINGSRC_TIM3_OC4_COMP2\n#define COMP_BLANKINGSRCE_TIM8OC5 COMP_BLANKINGSRC_TIM8_OC5_COMP2\n#define COMP_BLANKINGSRCE_TIM15OC1 COMP_BLANKINGSRC_TIM15_OC1_COMP2\n#define COMP_BLANKINGSRCE_NONE COMP_BLANKINGSRC_NONE\n#endif\n\n#if defined(STM32L0)\n#define COMP_MODE_HIGHSPEED COMP_POWERMODE_MEDIUMSPEED\n#define COMP_MODE_LOWSPEED COMP_POWERMODE_ULTRALOWPOWER\n#else\n#define COMP_MODE_HIGHSPEED COMP_POWERMODE_HIGHSPEED\n#define COMP_MODE_MEDIUMSPEED COMP_POWERMODE_MEDIUMSPEED\n#define COMP_MODE_LOWPOWER COMP_POWERMODE_LOWPOWER\n#define COMP_MODE_ULTRALOWPOWER COMP_POWERMODE_ULTRALOWPOWER\n#endif\n\n#endif\n/**\n * @}\n */\n\n/** @defgroup HAL_CORTEX_Aliased_Defines HAL CORTEX Aliased Defines maintained for legacy purpose\n * @{\n */\n#define __HAL_CORTEX_SYSTICKCLK_CONFIG HAL_SYSTICK_CLKSourceConfig\n/**\n * @}\n */\n\n/** @defgroup HAL_CRC_Aliased_Defines HAL CRC Aliased Defines maintained for legacy purpose\n * @{\n */\n \n#define CRC_OUTPUTDATA_INVERSION_DISABLED CRC_OUTPUTDATA_INVERSION_DISABLE\n#define CRC_OUTPUTDATA_INVERSION_ENABLED CRC_OUTPUTDATA_INVERSION_ENABLE\n\n/**\n * @}\n */\n\n/** @defgroup HAL_DAC_Aliased_Defines HAL DAC Aliased Defines maintained for legacy purpose\n * @{\n */\n\n#define DAC1_CHANNEL_1 DAC_CHANNEL_1\n#define DAC1_CHANNEL_2 DAC_CHANNEL_2\n#define DAC2_CHANNEL_1 DAC_CHANNEL_1\n#define DAC_WAVE_NONE ((uint32_t)0x00000000U)\n#define DAC_WAVE_NOISE ((uint32_t)DAC_CR_WAVE1_0)\n#define DAC_WAVE_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1) \n#define DAC_WAVEGENERATION_NONE DAC_WAVE_NONE\n#define DAC_WAVEGENERATION_NOISE DAC_WAVE_NOISE\n#define DAC_WAVEGENERATION_TRIANGLE DAC_WAVE_TRIANGLE\n\n/**\n * @}\n */\n\n/** @defgroup HAL_DMA_Aliased_Defines HAL DMA Aliased Defines maintained for legacy purpose\n * @{\n */\n#define HAL_REMAPDMA_ADC_DMA_CH2 DMA_REMAP_ADC_DMA_CH2 \n#define HAL_REMAPDMA_USART1_TX_DMA_CH4 DMA_REMAP_USART1_TX_DMA_CH4 \n#define HAL_REMAPDMA_USART1_RX_DMA_CH5 DMA_REMAP_USART1_RX_DMA_CH5 \n#define HAL_REMAPDMA_TIM16_DMA_CH4 DMA_REMAP_TIM16_DMA_CH4 \n#define HAL_REMAPDMA_TIM17_DMA_CH2 DMA_REMAP_TIM17_DMA_CH2 \n#define HAL_REMAPDMA_USART3_DMA_CH32 DMA_REMAP_USART3_DMA_CH32\n#define HAL_REMAPDMA_TIM16_DMA_CH6 DMA_REMAP_TIM16_DMA_CH6\n#define HAL_REMAPDMA_TIM17_DMA_CH7 DMA_REMAP_TIM17_DMA_CH7 \n#define HAL_REMAPDMA_SPI2_DMA_CH67 DMA_REMAP_SPI2_DMA_CH67 \n#define HAL_REMAPDMA_USART2_DMA_CH67 DMA_REMAP_USART2_DMA_CH67 \n#define HAL_REMAPDMA_I2C1_DMA_CH76 DMA_REMAP_I2C1_DMA_CH76 \n#define HAL_REMAPDMA_TIM1_DMA_CH6 DMA_REMAP_TIM1_DMA_CH6 \n#define HAL_REMAPDMA_TIM2_DMA_CH7 DMA_REMAP_TIM2_DMA_CH7 \n#define HAL_REMAPDMA_TIM3_DMA_CH6 DMA_REMAP_TIM3_DMA_CH6 \n \n#define IS_HAL_REMAPDMA IS_DMA_REMAP \n#define __HAL_REMAPDMA_CHANNEL_ENABLE __HAL_DMA_REMAP_CHANNEL_ENABLE\n#define __HAL_REMAPDMA_CHANNEL_DISABLE __HAL_DMA_REMAP_CHANNEL_DISABLE\n \n \n \n/**\n * @}\n */\n\n/** @defgroup HAL_FLASH_Aliased_Defines HAL FLASH Aliased Defines maintained for legacy purpose\n * @{\n */\n \n#define TYPEPROGRAM_BYTE FLASH_TYPEPROGRAM_BYTE\n#define TYPEPROGRAM_HALFWORD FLASH_TYPEPROGRAM_HALFWORD\n#define TYPEPROGRAM_WORD FLASH_TYPEPROGRAM_WORD\n#define TYPEPROGRAM_DOUBLEWORD FLASH_TYPEPROGRAM_DOUBLEWORD\n#define TYPEERASE_SECTORS FLASH_TYPEERASE_SECTORS\n#define TYPEERASE_PAGES FLASH_TYPEERASE_PAGES\n#define TYPEERASE_PAGEERASE FLASH_TYPEERASE_PAGES\n#define TYPEERASE_MASSERASE FLASH_TYPEERASE_MASSERASE\n#define WRPSTATE_DISABLE OB_WRPSTATE_DISABLE\n#define WRPSTATE_ENABLE OB_WRPSTATE_ENABLE\n#define HAL_FLASH_TIMEOUT_VALUE FLASH_TIMEOUT_VALUE\n#define OBEX_PCROP OPTIONBYTE_PCROP\n#define OBEX_BOOTCONFIG OPTIONBYTE_BOOTCONFIG\n#define PCROPSTATE_DISABLE OB_PCROP_STATE_DISABLE\n#define PCROPSTATE_ENABLE OB_PCROP_STATE_ENABLE\n#define TYPEERASEDATA_BYTE FLASH_TYPEERASEDATA_BYTE\n#define TYPEERASEDATA_HALFWORD FLASH_TYPEERASEDATA_HALFWORD\n#define TYPEERASEDATA_WORD FLASH_TYPEERASEDATA_WORD\n#define TYPEPROGRAMDATA_BYTE FLASH_TYPEPROGRAMDATA_BYTE\n#define TYPEPROGRAMDATA_HALFWORD FLASH_TYPEPROGRAMDATA_HALFWORD\n#define TYPEPROGRAMDATA_WORD FLASH_TYPEPROGRAMDATA_WORD\n#define TYPEPROGRAMDATA_FASTBYTE FLASH_TYPEPROGRAMDATA_FASTBYTE\n#define TYPEPROGRAMDATA_FASTHALFWORD FLASH_TYPEPROGRAMDATA_FASTHALFWORD\n#define TYPEPROGRAMDATA_FASTWORD FLASH_TYPEPROGRAMDATA_FASTWORD\n#define PAGESIZE FLASH_PAGE_SIZE\n#define TYPEPROGRAM_FASTBYTE FLASH_TYPEPROGRAM_BYTE\n#define TYPEPROGRAM_FASTHALFWORD FLASH_TYPEPROGRAM_HALFWORD\n#define TYPEPROGRAM_FASTWORD FLASH_TYPEPROGRAM_WORD\n#define VOLTAGE_RANGE_1 FLASH_VOLTAGE_RANGE_1\n#define VOLTAGE_RANGE_2 FLASH_VOLTAGE_RANGE_2\n#define VOLTAGE_RANGE_3 FLASH_VOLTAGE_RANGE_3\n#define VOLTAGE_RANGE_4 FLASH_VOLTAGE_RANGE_4\n#define TYPEPROGRAM_FAST FLASH_TYPEPROGRAM_FAST\n#define TYPEPROGRAM_FAST_AND_LAST FLASH_TYPEPROGRAM_FAST_AND_LAST\n#define WRPAREA_BANK1_AREAA OB_WRPAREA_BANK1_AREAA\n#define WRPAREA_BANK1_AREAB OB_WRPAREA_BANK1_AREAB\n#define WRPAREA_BANK2_AREAA OB_WRPAREA_BANK2_AREAA\n#define WRPAREA_BANK2_AREAB OB_WRPAREA_BANK2_AREAB\n#define IWDG_STDBY_FREEZE OB_IWDG_STDBY_FREEZE\n#define IWDG_STDBY_ACTIVE OB_IWDG_STDBY_RUN\n#define IWDG_STOP_FREEZE OB_IWDG_STOP_FREEZE\n#define IWDG_STOP_ACTIVE OB_IWDG_STOP_RUN\n#define FLASH_ERROR_NONE HAL_FLASH_ERROR_NONE\n#define FLASH_ERROR_RD HAL_FLASH_ERROR_RD\n#define FLASH_ERROR_PG HAL_FLASH_ERROR_PROG\n#define FLASH_ERROR_PGP HAL_FLASH_ERROR_PGS\n#define FLASH_ERROR_WRP HAL_FLASH_ERROR_WRP\n#define FLASH_ERROR_OPTV HAL_FLASH_ERROR_OPTV\n#define FLASH_ERROR_OPTVUSR HAL_FLASH_ERROR_OPTVUSR\n#define FLASH_ERROR_PROG HAL_FLASH_ERROR_PROG\n#define FLASH_ERROR_OP HAL_FLASH_ERROR_OPERATION\n#define FLASH_ERROR_PGA HAL_FLASH_ERROR_PGA\n#define FLASH_ERROR_SIZE HAL_FLASH_ERROR_SIZE\n#define FLASH_ERROR_SIZ HAL_FLASH_ERROR_SIZE\n#define FLASH_ERROR_PGS HAL_FLASH_ERROR_PGS\n#define FLASH_ERROR_MIS HAL_FLASH_ERROR_MIS\n#define FLASH_ERROR_FAST HAL_FLASH_ERROR_FAST\n#define FLASH_ERROR_FWWERR HAL_FLASH_ERROR_FWWERR\n#define FLASH_ERROR_NOTZERO HAL_FLASH_ERROR_NOTZERO\n#define FLASH_ERROR_OPERATION HAL_FLASH_ERROR_OPERATION\n#define FLASH_ERROR_ERS HAL_FLASH_ERROR_ERS\n#define OB_WDG_SW OB_IWDG_SW\n#define OB_WDG_HW OB_IWDG_HW\n#define OB_SDADC12_VDD_MONITOR_SET OB_SDACD_VDD_MONITOR_SET\n#define OB_SDADC12_VDD_MONITOR_RESET OB_SDACD_VDD_MONITOR_RESET\n#define OB_RAM_PARITY_CHECK_SET OB_SRAM_PARITY_SET\n#define OB_RAM_PARITY_CHECK_RESET OB_SRAM_PARITY_RESET\n#define IS_OB_SDADC12_VDD_MONITOR IS_OB_SDACD_VDD_MONITOR\n#define OB_RDP_LEVEL0 OB_RDP_LEVEL_0\n#define OB_RDP_LEVEL1 OB_RDP_LEVEL_1\n#define OB_RDP_LEVEL2 OB_RDP_LEVEL_2\n\n/**\n * @}\n */\n \n/** @defgroup HAL_SYSCFG_Aliased_Defines HAL SYSCFG Aliased Defines maintained for legacy purpose\n * @{\n */\n \n#define HAL_SYSCFG_FASTMODEPLUS_I2C_PA9 I2C_FASTMODEPLUS_PA9\n#define HAL_SYSCFG_FASTMODEPLUS_I2C_PA10 I2C_FASTMODEPLUS_PA10\n#define HAL_SYSCFG_FASTMODEPLUS_I2C_PB6 I2C_FASTMODEPLUS_PB6\n#define HAL_SYSCFG_FASTMODEPLUS_I2C_PB7 I2C_FASTMODEPLUS_PB7\n#define HAL_SYSCFG_FASTMODEPLUS_I2C_PB8 I2C_FASTMODEPLUS_PB8\n#define HAL_SYSCFG_FASTMODEPLUS_I2C_PB9 I2C_FASTMODEPLUS_PB9\n#define HAL_SYSCFG_FASTMODEPLUS_I2C1 I2C_FASTMODEPLUS_I2C1\n#define HAL_SYSCFG_FASTMODEPLUS_I2C2 I2C_FASTMODEPLUS_I2C2\n#define HAL_SYSCFG_FASTMODEPLUS_I2C3 I2C_FASTMODEPLUS_I2C3\n/**\n * @}\n */\n \n\n/** @defgroup LL_FMC_Aliased_Defines LL FMC Aliased Defines maintained for compatibility purpose\n * @{\n */\n#if defined(STM32L4) || defined(STM32F7)\n#define FMC_NAND_PCC_WAIT_FEATURE_DISABLE FMC_NAND_WAIT_FEATURE_DISABLE\n#define FMC_NAND_PCC_WAIT_FEATURE_ENABLE FMC_NAND_WAIT_FEATURE_ENABLE\n#define FMC_NAND_PCC_MEM_BUS_WIDTH_8 FMC_NAND_MEM_BUS_WIDTH_8\n#define FMC_NAND_PCC_MEM_BUS_WIDTH_16 FMC_NAND_MEM_BUS_WIDTH_16\n#else\n#define FMC_NAND_WAIT_FEATURE_DISABLE FMC_NAND_PCC_WAIT_FEATURE_DISABLE\n#define FMC_NAND_WAIT_FEATURE_ENABLE FMC_NAND_PCC_WAIT_FEATURE_ENABLE\n#define FMC_NAND_MEM_BUS_WIDTH_8 FMC_NAND_PCC_MEM_BUS_WIDTH_8\n#define FMC_NAND_MEM_BUS_WIDTH_16 FMC_NAND_PCC_MEM_BUS_WIDTH_16\n#endif\n/**\n * @}\n */\n\n/** @defgroup LL_FSMC_Aliased_Defines LL FSMC Aliased Defines maintained for legacy purpose\n * @{\n */\n \n#define FSMC_NORSRAM_TYPEDEF FSMC_NORSRAM_TypeDef\n#define FSMC_NORSRAM_EXTENDED_TYPEDEF FSMC_NORSRAM_EXTENDED_TypeDef\n/**\n * @}\n */\n\n/** @defgroup HAL_GPIO_Aliased_Macros HAL GPIO Aliased Macros maintained for legacy purpose\n * @{\n */\n#define GET_GPIO_SOURCE GPIO_GET_INDEX\n#define GET_GPIO_INDEX GPIO_GET_INDEX\n\n#if defined(STM32F4)\n#define GPIO_AF12_SDMMC GPIO_AF12_SDIO\n#define GPIO_AF12_SDMMC1 GPIO_AF12_SDIO\n#endif\n\n#if defined(STM32F7)\n#define GPIO_AF12_SDIO GPIO_AF12_SDMMC1\n#define GPIO_AF12_SDMMC GPIO_AF12_SDMMC1\n#endif\n\n#if defined(STM32L4)\n#define GPIO_AF12_SDIO GPIO_AF12_SDMMC1\n#define GPIO_AF12_SDMMC GPIO_AF12_SDMMC1\n#endif\n\n#define GPIO_AF0_LPTIM GPIO_AF0_LPTIM1\n#define GPIO_AF1_LPTIM GPIO_AF1_LPTIM1\n#define GPIO_AF2_LPTIM GPIO_AF2_LPTIM1\n\n#if defined(STM32L0) || defined(STM32L4) || defined(STM32F4) || defined(STM32F2) || defined(STM32F7)\n#define GPIO_SPEED_LOW GPIO_SPEED_FREQ_LOW \n#define GPIO_SPEED_MEDIUM GPIO_SPEED_FREQ_MEDIUM \n#define GPIO_SPEED_FAST GPIO_SPEED_FREQ_HIGH \n#define GPIO_SPEED_HIGH GPIO_SPEED_FREQ_VERY_HIGH \n#endif /* STM32L0 || STM32L4 || STM32F4 || STM32F2 || STM32F7 */\n\n#if defined(STM32L1) \n #define GPIO_SPEED_VERY_LOW GPIO_SPEED_FREQ_LOW \n #define GPIO_SPEED_LOW GPIO_SPEED_FREQ_MEDIUM \n #define GPIO_SPEED_MEDIUM GPIO_SPEED_FREQ_HIGH \n #define GPIO_SPEED_HIGH GPIO_SPEED_FREQ_VERY_HIGH \n#endif /* STM32L1 */\n\n#if defined(STM32F0) || defined(STM32F3) || defined(STM32F1)\n #define GPIO_SPEED_LOW GPIO_SPEED_FREQ_LOW\n #define GPIO_SPEED_MEDIUM GPIO_SPEED_FREQ_MEDIUM\n #define GPIO_SPEED_HIGH GPIO_SPEED_FREQ_HIGH\n#endif /* STM32F0 || STM32F3 || STM32F1 */\n\n#define GPIO_AF6_DFSDM GPIO_AF6_DFSDM1\n/**\n * @}\n */\n\n/** @defgroup HAL_JPEG_Aliased_Macros HAL JPEG Aliased Macros maintained for legacy purpose\n * @{\n */\n \n#if defined(STM32H7)\n #define __HAL_RCC_JPEG_CLK_ENABLE __HAL_RCC_JPGDECEN_CLK_ENABLE\n #define __HAL_RCC_JPEG_CLK_DISABLE __HAL_RCC_JPGDECEN_CLK_DISABLE\n #define __HAL_RCC_JPEG_FORCE_RESET __HAL_RCC_JPGDECRST_FORCE_RESET\n #define __HAL_RCC_JPEG_RELEASE_RESET __HAL_RCC_JPGDECRST_RELEASE_RESET\n #define __HAL_RCC_JPEG_CLK_SLEEP_ENABLE __HAL_RCC_JPGDEC_CLK_SLEEP_ENABLE\n #define __HAL_RCC_JPEG_CLK_SLEEP_DISABLE __HAL_RCC_JPGDEC_CLK_SLEEP_DISABLE\n\n #define DMA_REQUEST_DAC1 DMA_REQUEST_DAC1_CH1 \n #define DMA_REQUEST_DAC2 DMA_REQUEST_DAC1_CH2 \n\n #define BDMA_REQUEST_LP_UART1_RX BDMA_REQUEST_LPUART1_RX\n #define BDMA_REQUEST_LP_UART1_TX BDMA_REQUEST_LPUART1_TX\n\n #define HAL_DMAMUX1_REQUEST_GEN_DMAMUX1_CH0_EVT HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH0_EVT\n #define HAL_DMAMUX1_REQUEST_GEN_DMAMUX1_CH1_EVT HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH1_EVT\n #define HAL_DMAMUX1_REQUEST_GEN_DMAMUX1_CH2_EVT HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH2_EVT\n #define HAL_DMAMUX1_REQUEST_GEN_LPTIM1_OUT HAL_DMAMUX1_REQ_GEN_LPTIM1_OUT\n #define HAL_DMAMUX1_REQUEST_GEN_LPTIM2_OUT HAL_DMAMUX1_REQ_GEN_LPTIM2_OUT\n #define HAL_DMAMUX1_REQUEST_GEN_LPTIM3_OUT HAL_DMAMUX1_REQ_GEN_LPTIM3_OUT\n #define HAL_DMAMUX1_REQUEST_GEN_EXTI0 HAL_DMAMUX1_REQ_GEN_EXTI0\n #define HAL_DMAMUX1_REQUEST_GEN_TIM12_TRGO HAL_DMAMUX1_REQ_GEN_TIM12_TRGO\n\n #define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH0_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH0_EVT\n #define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH1_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH1_EVT\n #define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH2_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH2_EVT\n #define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH3_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH3_EVT\n #define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH4_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH4_EVT\n #define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH5_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH5_EVT\n #define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH6_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH6_EVT\n #define HAL_DMAMUX2_REQUEST_GEN_LPUART1_RX_WKUP HAL_DMAMUX2_REQ_GEN_LPUART1_RX_WKUP\n #define HAL_DMAMUX2_REQUEST_GEN_LPUART1_TX_WKUP HAL_DMAMUX2_REQ_GEN_LPUART1_TX_WKUP\n #define HAL_DMAMUX2_REQUEST_GEN_LPTIM2_WKUP HAL_DMAMUX2_REQ_GEN_LPTIM2_WKUP\n #define HAL_DMAMUX2_REQUEST_GEN_LPTIM2_OUT HAL_DMAMUX2_REQ_GEN_LPTIM2_OUT\n #define HAL_DMAMUX2_REQUEST_GEN_LPTIM3_WKUP HAL_DMAMUX2_REQ_GEN_LPTIM3_WKUP\n #define HAL_DMAMUX2_REQUEST_GEN_LPTIM3_OUT HAL_DMAMUX2_REQ_GEN_LPTIM3_OUT\n #define HAL_DMAMUX2_REQUEST_GEN_LPTIM4_WKUP HAL_DMAMUX2_REQ_GEN_LPTIM4_WKUP\n #define HAL_DMAMUX2_REQUEST_GEN_LPTIM5_WKUP HAL_DMAMUX2_REQ_GEN_LPTIM5_WKUP\n #define HAL_DMAMUX2_REQUEST_GEN_I2C4_WKUP HAL_DMAMUX2_REQ_GEN_I2C4_WKUP\n #define HAL_DMAMUX2_REQUEST_GEN_SPI6_WKUP HAL_DMAMUX2_REQ_GEN_SPI6_WKUP\n #define HAL_DMAMUX2_REQUEST_GEN_COMP1_OUT HAL_DMAMUX2_REQ_GEN_COMP1_OUT\n #define HAL_DMAMUX2_REQUEST_GEN_COMP2_OUT HAL_DMAMUX2_REQ_GEN_COMP2_OUT\n #define HAL_DMAMUX2_REQUEST_GEN_RTC_WKUP HAL_DMAMUX2_REQ_GEN_RTC_WKUP\n #define HAL_DMAMUX2_REQUEST_GEN_EXTI0 HAL_DMAMUX2_REQ_GEN_EXTI0\n #define HAL_DMAMUX2_REQUEST_GEN_EXTI2 HAL_DMAMUX2_REQ_GEN_EXTI2\n #define HAL_DMAMUX2_REQUEST_GEN_I2C4_IT_EVT HAL_DMAMUX2_REQ_GEN_I2C4_IT_EVT\n #define HAL_DMAMUX2_REQUEST_GEN_SPI6_IT HAL_DMAMUX2_REQ_GEN_SPI6_IT\n #define HAL_DMAMUX2_REQUEST_GEN_LPUART1_TX_IT HAL_DMAMUX2_REQ_GEN_LPUART1_TX_IT\n #define HAL_DMAMUX2_REQUEST_GEN_LPUART1_RX_IT HAL_DMAMUX2_REQ_GEN_LPUART1_RX_IT\n #define HAL_DMAMUX2_REQUEST_GEN_ADC3_IT HAL_DMAMUX2_REQ_GEN_ADC3_IT\n #define HAL_DMAMUX2_REQUEST_GEN_ADC3_AWD1_OUT HAL_DMAMUX2_REQ_GEN_ADC3_AWD1_OUT\n #define HAL_DMAMUX2_REQUEST_GEN_BDMA_CH0_IT HAL_DMAMUX2_REQ_GEN_BDMA_CH0_IT\n #define HAL_DMAMUX2_REQUEST_GEN_BDMA_CH1_IT HAL_DMAMUX2_REQ_GEN_BDMA_CH1_IT\n\n #define HAL_DMAMUX_REQUEST_GEN_NO_EVENT HAL_DMAMUX_REQ_GEN_NO_EVENT\n #define HAL_DMAMUX_REQUEST_GEN_RISING HAL_DMAMUX_REQ_GEN_RISING\n #define HAL_DMAMUX_REQUEST_GEN_FALLING HAL_DMAMUX_REQ_GEN_FALLING\n #define HAL_DMAMUX_REQUEST_GEN_RISING_FALLING HAL_DMAMUX_REQ_GEN_RISING_FALLING\n\n\n#endif /* STM32H7 */\n \n \n/**\n * @}\n */ \n \n \n/** @defgroup HAL_HRTIM_Aliased_Macros HAL HRTIM Aliased Macros maintained for legacy purpose\n * @{\n */\n#define HRTIM_TIMDELAYEDPROTECTION_DISABLED HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DISABLED\n#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT1_EEV68 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_EEV6\n#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT2_EEV68 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_EEV6\n#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDBOTH_EEV68 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV6\n#define HRTIM_TIMDELAYEDPROTECTION_BALANCED_EEV68 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV6\n#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT1_DEEV79 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_DEEV7\n#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT2_DEEV79 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_DEEV7\n#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDBOTH_EEV79 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV7\n#define HRTIM_TIMDELAYEDPROTECTION_BALANCED_EEV79 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV7\n \n#define __HAL_HRTIM_SetCounter __HAL_HRTIM_SETCOUNTER\n#define __HAL_HRTIM_GetCounter __HAL_HRTIM_GETCOUNTER\n#define __HAL_HRTIM_SetPeriod __HAL_HRTIM_SETPERIOD\n#define __HAL_HRTIM_GetPeriod __HAL_HRTIM_GETPERIOD\n#define __HAL_HRTIM_SetClockPrescaler __HAL_HRTIM_SETCLOCKPRESCALER\n#define __HAL_HRTIM_GetClockPrescaler __HAL_HRTIM_GETCLOCKPRESCALER\n#define __HAL_HRTIM_SetCompare __HAL_HRTIM_SETCOMPARE\n#define __HAL_HRTIM_GetCompare __HAL_HRTIM_GETCOMPARE\n/**\n * @}\n */\n\n/** @defgroup HAL_I2C_Aliased_Defines HAL I2C Aliased Defines maintained for legacy purpose\n * @{\n */\n#define I2C_DUALADDRESS_DISABLED I2C_DUALADDRESS_DISABLE\n#define I2C_DUALADDRESS_ENABLED I2C_DUALADDRESS_ENABLE\n#define I2C_GENERALCALL_DISABLED I2C_GENERALCALL_DISABLE\n#define I2C_GENERALCALL_ENABLED I2C_GENERALCALL_ENABLE\n#define I2C_NOSTRETCH_DISABLED I2C_NOSTRETCH_DISABLE\n#define I2C_NOSTRETCH_ENABLED I2C_NOSTRETCH_ENABLE\n#define I2C_ANALOGFILTER_ENABLED I2C_ANALOGFILTER_ENABLE\n#define I2C_ANALOGFILTER_DISABLED I2C_ANALOGFILTER_DISABLE\n#if defined(STM32F0) || defined(STM32F1) || defined(STM32F3) || defined(STM32G0) || defined(STM32L4) || defined(STM32L1) || defined(STM32F7)\n#define HAL_I2C_STATE_MEM_BUSY_TX HAL_I2C_STATE_BUSY_TX\n#define HAL_I2C_STATE_MEM_BUSY_RX HAL_I2C_STATE_BUSY_RX\n#define HAL_I2C_STATE_MASTER_BUSY_TX HAL_I2C_STATE_BUSY_TX\n#define HAL_I2C_STATE_MASTER_BUSY_RX HAL_I2C_STATE_BUSY_RX\n#define HAL_I2C_STATE_SLAVE_BUSY_TX HAL_I2C_STATE_BUSY_TX\n#define HAL_I2C_STATE_SLAVE_BUSY_RX HAL_I2C_STATE_BUSY_RX\n#endif\n/**\n * @}\n */\n\n/** @defgroup HAL_IRDA_Aliased_Defines HAL IRDA Aliased Defines maintained for legacy purpose\n * @{\n */\n#define IRDA_ONE_BIT_SAMPLE_DISABLED IRDA_ONE_BIT_SAMPLE_DISABLE\n#define IRDA_ONE_BIT_SAMPLE_ENABLED IRDA_ONE_BIT_SAMPLE_ENABLE\n\n/**\n * @}\n */\n\n/** @defgroup HAL_IWDG_Aliased_Defines HAL IWDG Aliased Defines maintained for legacy purpose\n * @{\n */\n#define KR_KEY_RELOAD IWDG_KEY_RELOAD\n#define KR_KEY_ENABLE IWDG_KEY_ENABLE\n#define KR_KEY_EWA IWDG_KEY_WRITE_ACCESS_ENABLE\n#define KR_KEY_DWA IWDG_KEY_WRITE_ACCESS_DISABLE\n/**\n * @}\n */\n\n/** @defgroup HAL_LPTIM_Aliased_Defines HAL LPTIM Aliased Defines maintained for legacy purpose\n * @{\n */\n\n#define LPTIM_CLOCKSAMPLETIME_DIRECTTRANSISTION LPTIM_CLOCKSAMPLETIME_DIRECTTRANSITION\n#define LPTIM_CLOCKSAMPLETIME_2TRANSISTIONS LPTIM_CLOCKSAMPLETIME_2TRANSITIONS\n#define LPTIM_CLOCKSAMPLETIME_4TRANSISTIONS LPTIM_CLOCKSAMPLETIME_4TRANSITIONS\n#define LPTIM_CLOCKSAMPLETIME_8TRANSISTIONS LPTIM_CLOCKSAMPLETIME_8TRANSITIONS\n\n#define LPTIM_CLOCKPOLARITY_RISINGEDGE LPTIM_CLOCKPOLARITY_RISING\n#define LPTIM_CLOCKPOLARITY_FALLINGEDGE LPTIM_CLOCKPOLARITY_FALLING\n#define LPTIM_CLOCKPOLARITY_BOTHEDGES LPTIM_CLOCKPOLARITY_RISING_FALLING\n\n#define LPTIM_TRIGSAMPLETIME_DIRECTTRANSISTION LPTIM_TRIGSAMPLETIME_DIRECTTRANSITION\n#define LPTIM_TRIGSAMPLETIME_2TRANSISTIONS LPTIM_TRIGSAMPLETIME_2TRANSITIONS\n#define LPTIM_TRIGSAMPLETIME_4TRANSISTIONS LPTIM_TRIGSAMPLETIME_4TRANSITIONS\n#define LPTIM_TRIGSAMPLETIME_8TRANSISTIONS LPTIM_TRIGSAMPLETIME_8TRANSITIONS \n\n/* The following 3 definition have also been present in a temporary version of lptim.h */\n/* They need to be renamed also to the right name, just in case */\n#define LPTIM_TRIGSAMPLETIME_2TRANSITION LPTIM_TRIGSAMPLETIME_2TRANSITIONS\n#define LPTIM_TRIGSAMPLETIME_4TRANSITION LPTIM_TRIGSAMPLETIME_4TRANSITIONS\n#define LPTIM_TRIGSAMPLETIME_8TRANSITION LPTIM_TRIGSAMPLETIME_8TRANSITIONS\n\n/**\n * @}\n */\n\n/** @defgroup HAL_NAND_Aliased_Defines HAL NAND Aliased Defines maintained for legacy purpose\n * @{\n */\n#define HAL_NAND_Read_Page HAL_NAND_Read_Page_8b\n#define HAL_NAND_Write_Page HAL_NAND_Write_Page_8b\n#define HAL_NAND_Read_SpareArea HAL_NAND_Read_SpareArea_8b\n#define HAL_NAND_Write_SpareArea HAL_NAND_Write_SpareArea_8b\n\n#define NAND_AddressTypedef NAND_AddressTypeDef\n\n#define __ARRAY_ADDRESS ARRAY_ADDRESS\n#define __ADDR_1st_CYCLE ADDR_1ST_CYCLE\n#define __ADDR_2nd_CYCLE ADDR_2ND_CYCLE\n#define __ADDR_3rd_CYCLE ADDR_3RD_CYCLE\n#define __ADDR_4th_CYCLE ADDR_4TH_CYCLE\n/**\n * @}\n */\n \n/** @defgroup HAL_NOR_Aliased_Defines HAL NOR Aliased Defines maintained for legacy purpose\n * @{\n */\n#define NOR_StatusTypedef HAL_NOR_StatusTypeDef\n#define NOR_SUCCESS HAL_NOR_STATUS_SUCCESS\n#define NOR_ONGOING HAL_NOR_STATUS_ONGOING\n#define NOR_ERROR HAL_NOR_STATUS_ERROR\n#define NOR_TIMEOUT HAL_NOR_STATUS_TIMEOUT\n\n#define __NOR_WRITE NOR_WRITE\n#define __NOR_ADDR_SHIFT NOR_ADDR_SHIFT\n/**\n * @}\n */\n\n/** @defgroup HAL_OPAMP_Aliased_Defines HAL OPAMP Aliased Defines maintained for legacy purpose\n * @{\n */\n\n#define OPAMP_NONINVERTINGINPUT_VP0 OPAMP_NONINVERTINGINPUT_IO0\n#define OPAMP_NONINVERTINGINPUT_VP1 OPAMP_NONINVERTINGINPUT_IO1\n#define OPAMP_NONINVERTINGINPUT_VP2 OPAMP_NONINVERTINGINPUT_IO2\n#define OPAMP_NONINVERTINGINPUT_VP3 OPAMP_NONINVERTINGINPUT_IO3\n \n#define OPAMP_SEC_NONINVERTINGINPUT_VP0 OPAMP_SEC_NONINVERTINGINPUT_IO0\n#define OPAMP_SEC_NONINVERTINGINPUT_VP1 OPAMP_SEC_NONINVERTINGINPUT_IO1\n#define OPAMP_SEC_NONINVERTINGINPUT_VP2 OPAMP_SEC_NONINVERTINGINPUT_IO2\n#define OPAMP_SEC_NONINVERTINGINPUT_VP3 OPAMP_SEC_NONINVERTINGINPUT_IO3 \n\n#define OPAMP_INVERTINGINPUT_VM0 OPAMP_INVERTINGINPUT_IO0\n#define OPAMP_INVERTINGINPUT_VM1 OPAMP_INVERTINGINPUT_IO1\n\n#define IOPAMP_INVERTINGINPUT_VM0 OPAMP_INVERTINGINPUT_IO0\n#define IOPAMP_INVERTINGINPUT_VM1 OPAMP_INVERTINGINPUT_IO1\n\n#define OPAMP_SEC_INVERTINGINPUT_VM0 OPAMP_SEC_INVERTINGINPUT_IO0\n#define OPAMP_SEC_INVERTINGINPUT_VM1 OPAMP_SEC_INVERTINGINPUT_IO1 \n\n#define OPAMP_INVERTINGINPUT_VINM OPAMP_SEC_INVERTINGINPUT_IO1\n \n#define OPAMP_PGACONNECT_NO OPAMP_PGA_CONNECT_INVERTINGINPUT_NO \n#define OPAMP_PGACONNECT_VM0 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0 \n#define OPAMP_PGACONNECT_VM1 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO1 \n \n/**\n * @}\n */\n\n/** @defgroup HAL_I2S_Aliased_Defines HAL I2S Aliased Defines maintained for legacy purpose\n * @{\n */\n#define I2S_STANDARD_PHILLIPS I2S_STANDARD_PHILIPS\n#if defined(STM32F7) \n #define I2S_CLOCK_SYSCLK I2S_CLOCK_PLL\n#endif\n/**\n * @}\n */\n\n/** @defgroup HAL_PCCARD_Aliased_Defines HAL PCCARD Aliased Defines maintained for legacy purpose\n * @{\n */\n\n/* Compact Flash-ATA registers description */\n#define CF_DATA ATA_DATA \n#define CF_SECTOR_COUNT ATA_SECTOR_COUNT \n#define CF_SECTOR_NUMBER ATA_SECTOR_NUMBER \n#define CF_CYLINDER_LOW ATA_CYLINDER_LOW \n#define CF_CYLINDER_HIGH ATA_CYLINDER_HIGH \n#define CF_CARD_HEAD ATA_CARD_HEAD \n#define CF_STATUS_CMD ATA_STATUS_CMD \n#define CF_STATUS_CMD_ALTERNATE ATA_STATUS_CMD_ALTERNATE\n#define CF_COMMON_DATA_AREA ATA_COMMON_DATA_AREA \n\n/* Compact Flash-ATA commands */\n#define CF_READ_SECTOR_CMD ATA_READ_SECTOR_CMD \n#define CF_WRITE_SECTOR_CMD ATA_WRITE_SECTOR_CMD\n#define CF_ERASE_SECTOR_CMD ATA_ERASE_SECTOR_CMD\n#define CF_IDENTIFY_CMD ATA_IDENTIFY_CMD\n\n#define PCCARD_StatusTypedef HAL_PCCARD_StatusTypeDef\n#define PCCARD_SUCCESS HAL_PCCARD_STATUS_SUCCESS\n#define PCCARD_ONGOING HAL_PCCARD_STATUS_ONGOING\n#define PCCARD_ERROR HAL_PCCARD_STATUS_ERROR\n#define PCCARD_TIMEOUT HAL_PCCARD_STATUS_TIMEOUT\n/**\n * @}\n */\n \n/** @defgroup HAL_RTC_Aliased_Defines HAL RTC Aliased Defines maintained for legacy purpose\n * @{\n */\n \n#define FORMAT_BIN RTC_FORMAT_BIN\n#define FORMAT_BCD RTC_FORMAT_BCD\n\n#define RTC_ALARMSUBSECONDMASK_None RTC_ALARMSUBSECONDMASK_NONE\n#define RTC_TAMPERERASEBACKUP_DISABLED RTC_TAMPER_ERASE_BACKUP_DISABLE\n#define RTC_TAMPERMASK_FLAG_DISABLED RTC_TAMPERMASK_FLAG_DISABLE\n#define RTC_TAMPERMASK_FLAG_ENABLED RTC_TAMPERMASK_FLAG_ENABLE\n\n#define RTC_MASKTAMPERFLAG_DISABLED RTC_TAMPERMASK_FLAG_DISABLE \n#define RTC_MASKTAMPERFLAG_ENABLED RTC_TAMPERMASK_FLAG_ENABLE \n#define RTC_TAMPERERASEBACKUP_ENABLED RTC_TAMPER_ERASE_BACKUP_ENABLE\n#define RTC_TAMPER1_2_INTERRUPT RTC_ALL_TAMPER_INTERRUPT \n#define RTC_TAMPER1_2_3_INTERRUPT RTC_ALL_TAMPER_INTERRUPT \n\n#define RTC_TIMESTAMPPIN_PC13 RTC_TIMESTAMPPIN_DEFAULT\n#define RTC_TIMESTAMPPIN_PA0 RTC_TIMESTAMPPIN_POS1 \n#define RTC_TIMESTAMPPIN_PI8 RTC_TIMESTAMPPIN_POS1\n#define RTC_TIMESTAMPPIN_PC1 RTC_TIMESTAMPPIN_POS2\n\n#define RTC_OUTPUT_REMAP_PC13 RTC_OUTPUT_REMAP_NONE\n#define RTC_OUTPUT_REMAP_PB14 RTC_OUTPUT_REMAP_POS1\n#define RTC_OUTPUT_REMAP_PB2 RTC_OUTPUT_REMAP_POS1\n\n#define RTC_TAMPERPIN_PC13 RTC_TAMPERPIN_DEFAULT \n#define RTC_TAMPERPIN_PA0 RTC_TAMPERPIN_POS1 \n#define RTC_TAMPERPIN_PI8 RTC_TAMPERPIN_POS1\n\n/**\n * @}\n */\n\n \n/** @defgroup HAL_SMARTCARD_Aliased_Defines HAL SMARTCARD Aliased Defines maintained for legacy purpose\n * @{\n */\n#define SMARTCARD_NACK_ENABLED SMARTCARD_NACK_ENABLE\n#define SMARTCARD_NACK_DISABLED SMARTCARD_NACK_DISABLE\n\n#define SMARTCARD_ONEBIT_SAMPLING_DISABLED SMARTCARD_ONE_BIT_SAMPLE_DISABLE\n#define SMARTCARD_ONEBIT_SAMPLING_ENABLED SMARTCARD_ONE_BIT_SAMPLE_ENABLE\n#define SMARTCARD_ONEBIT_SAMPLING_DISABLE SMARTCARD_ONE_BIT_SAMPLE_DISABLE\n#define SMARTCARD_ONEBIT_SAMPLING_ENABLE SMARTCARD_ONE_BIT_SAMPLE_ENABLE\n\n#define SMARTCARD_TIMEOUT_DISABLED SMARTCARD_TIMEOUT_DISABLE\n#define SMARTCARD_TIMEOUT_ENABLED SMARTCARD_TIMEOUT_ENABLE\n\n#define SMARTCARD_LASTBIT_DISABLED SMARTCARD_LASTBIT_DISABLE\n#define SMARTCARD_LASTBIT_ENABLED SMARTCARD_LASTBIT_ENABLE\n/**\n * @}\n */\n\n \n/** @defgroup HAL_SMBUS_Aliased_Defines HAL SMBUS Aliased Defines maintained for legacy purpose\n * @{\n */\n#define SMBUS_DUALADDRESS_DISABLED SMBUS_DUALADDRESS_DISABLE\n#define SMBUS_DUALADDRESS_ENABLED SMBUS_DUALADDRESS_ENABLE\n#define SMBUS_GENERALCALL_DISABLED SMBUS_GENERALCALL_DISABLE\n#define SMBUS_GENERALCALL_ENABLED SMBUS_GENERALCALL_ENABLE\n#define SMBUS_NOSTRETCH_DISABLED SMBUS_NOSTRETCH_DISABLE\n#define SMBUS_NOSTRETCH_ENABLED SMBUS_NOSTRETCH_ENABLE\n#define SMBUS_ANALOGFILTER_ENABLED SMBUS_ANALOGFILTER_ENABLE\n#define SMBUS_ANALOGFILTER_DISABLED SMBUS_ANALOGFILTER_DISABLE\n#define SMBUS_PEC_DISABLED SMBUS_PEC_DISABLE\n#define SMBUS_PEC_ENABLED SMBUS_PEC_ENABLE\n#define HAL_SMBUS_STATE_SLAVE_LISTEN HAL_SMBUS_STATE_LISTEN\n/**\n * @}\n */\n \n/** @defgroup HAL_SPI_Aliased_Defines HAL SPI Aliased Defines maintained for legacy purpose\n * @{\n */\n#define SPI_TIMODE_DISABLED SPI_TIMODE_DISABLE\n#define SPI_TIMODE_ENABLED SPI_TIMODE_ENABLE\n\n#define SPI_CRCCALCULATION_DISABLED SPI_CRCCALCULATION_DISABLE\n#define SPI_CRCCALCULATION_ENABLED SPI_CRCCALCULATION_ENABLE\n\n#define SPI_NSS_PULSE_DISABLED SPI_NSS_PULSE_DISABLE\n#define SPI_NSS_PULSE_ENABLED SPI_NSS_PULSE_ENABLE\n\n/**\n * @}\n */\n \n/** @defgroup HAL_TIM_Aliased_Defines HAL TIM Aliased Defines maintained for legacy purpose\n * @{\n */\n#define CCER_CCxE_MASK TIM_CCER_CCxE_MASK\n#define CCER_CCxNE_MASK TIM_CCER_CCxNE_MASK\n \n#define TIM_DMABase_CR1 TIM_DMABASE_CR1\n#define TIM_DMABase_CR2 TIM_DMABASE_CR2\n#define TIM_DMABase_SMCR TIM_DMABASE_SMCR\n#define TIM_DMABase_DIER TIM_DMABASE_DIER\n#define TIM_DMABase_SR TIM_DMABASE_SR\n#define TIM_DMABase_EGR TIM_DMABASE_EGR\n#define TIM_DMABase_CCMR1 TIM_DMABASE_CCMR1\n#define TIM_DMABase_CCMR2 TIM_DMABASE_CCMR2\n#define TIM_DMABase_CCER TIM_DMABASE_CCER\n#define TIM_DMABase_CNT TIM_DMABASE_CNT\n#define TIM_DMABase_PSC TIM_DMABASE_PSC\n#define TIM_DMABase_ARR TIM_DMABASE_ARR\n#define TIM_DMABase_RCR TIM_DMABASE_RCR\n#define TIM_DMABase_CCR1 TIM_DMABASE_CCR1\n#define TIM_DMABase_CCR2 TIM_DMABASE_CCR2\n#define TIM_DMABase_CCR3 TIM_DMABASE_CCR3\n#define TIM_DMABase_CCR4 TIM_DMABASE_CCR4\n#define TIM_DMABase_BDTR TIM_DMABASE_BDTR\n#define TIM_DMABase_DCR TIM_DMABASE_DCR\n#define TIM_DMABase_DMAR TIM_DMABASE_DMAR\n#define TIM_DMABase_OR1 TIM_DMABASE_OR1\n#define TIM_DMABase_CCMR3 TIM_DMABASE_CCMR3\n#define TIM_DMABase_CCR5 TIM_DMABASE_CCR5\n#define TIM_DMABase_CCR6 TIM_DMABASE_CCR6\n#define TIM_DMABase_OR2 TIM_DMABASE_OR2\n#define TIM_DMABase_OR3 TIM_DMABASE_OR3\n#define TIM_DMABase_OR TIM_DMABASE_OR\n\n#define TIM_EventSource_Update TIM_EVENTSOURCE_UPDATE\n#define TIM_EventSource_CC1 TIM_EVENTSOURCE_CC1\n#define TIM_EventSource_CC2 TIM_EVENTSOURCE_CC2\n#define TIM_EventSource_CC3 TIM_EVENTSOURCE_CC3\n#define TIM_EventSource_CC4 TIM_EVENTSOURCE_CC4\n#define TIM_EventSource_COM TIM_EVENTSOURCE_COM\n#define TIM_EventSource_Trigger TIM_EVENTSOURCE_TRIGGER\n#define TIM_EventSource_Break TIM_EVENTSOURCE_BREAK\n#define TIM_EventSource_Break2 TIM_EVENTSOURCE_BREAK2\n\n#define TIM_DMABurstLength_1Transfer TIM_DMABURSTLENGTH_1TRANSFER\n#define TIM_DMABurstLength_2Transfers TIM_DMABURSTLENGTH_2TRANSFERS\n#define TIM_DMABurstLength_3Transfers TIM_DMABURSTLENGTH_3TRANSFERS\n#define TIM_DMABurstLength_4Transfers TIM_DMABURSTLENGTH_4TRANSFERS\n#define TIM_DMABurstLength_5Transfers TIM_DMABURSTLENGTH_5TRANSFERS\n#define TIM_DMABurstLength_6Transfers TIM_DMABURSTLENGTH_6TRANSFERS\n#define TIM_DMABurstLength_7Transfers TIM_DMABURSTLENGTH_7TRANSFERS\n#define TIM_DMABurstLength_8Transfers TIM_DMABURSTLENGTH_8TRANSFERS\n#define TIM_DMABurstLength_9Transfers TIM_DMABURSTLENGTH_9TRANSFERS\n#define TIM_DMABurstLength_10Transfers TIM_DMABURSTLENGTH_10TRANSFERS\n#define TIM_DMABurstLength_11Transfers TIM_DMABURSTLENGTH_11TRANSFERS\n#define TIM_DMABurstLength_12Transfers TIM_DMABURSTLENGTH_12TRANSFERS\n#define TIM_DMABurstLength_13Transfers TIM_DMABURSTLENGTH_13TRANSFERS\n#define TIM_DMABurstLength_14Transfers TIM_DMABURSTLENGTH_14TRANSFERS\n#define TIM_DMABurstLength_15Transfers TIM_DMABURSTLENGTH_15TRANSFERS\n#define TIM_DMABurstLength_16Transfers TIM_DMABURSTLENGTH_16TRANSFERS\n#define TIM_DMABurstLength_17Transfers TIM_DMABURSTLENGTH_17TRANSFERS\n#define TIM_DMABurstLength_18Transfers TIM_DMABURSTLENGTH_18TRANSFERS\n\n/**\n * @}\n */\n\n/** @defgroup HAL_TSC_Aliased_Defines HAL TSC Aliased Defines maintained for legacy purpose\n * @{\n */\n#define TSC_SYNC_POL_FALL TSC_SYNC_POLARITY_FALLING\n#define TSC_SYNC_POL_RISE_HIGH TSC_SYNC_POLARITY_RISING\n/**\n * @}\n */\n\n/** @defgroup HAL_UART_Aliased_Defines HAL UART Aliased Defines maintained for legacy purpose\n * @{\n */\n#define UART_ONEBIT_SAMPLING_DISABLED UART_ONE_BIT_SAMPLE_DISABLE\n#define UART_ONEBIT_SAMPLING_ENABLED UART_ONE_BIT_SAMPLE_ENABLE\n#define UART_ONE_BIT_SAMPLE_DISABLED UART_ONE_BIT_SAMPLE_DISABLE\n#define UART_ONE_BIT_SAMPLE_ENABLED UART_ONE_BIT_SAMPLE_ENABLE\n\n#define __HAL_UART_ONEBIT_ENABLE __HAL_UART_ONE_BIT_SAMPLE_ENABLE\n#define __HAL_UART_ONEBIT_DISABLE __HAL_UART_ONE_BIT_SAMPLE_DISABLE\n\n#define __DIV_SAMPLING16 UART_DIV_SAMPLING16\n#define __DIVMANT_SAMPLING16 UART_DIVMANT_SAMPLING16\n#define __DIVFRAQ_SAMPLING16 UART_DIVFRAQ_SAMPLING16\n#define __UART_BRR_SAMPLING16 UART_BRR_SAMPLING16\n\n#define __DIV_SAMPLING8 UART_DIV_SAMPLING8\n#define __DIVMANT_SAMPLING8 UART_DIVMANT_SAMPLING8\n#define __DIVFRAQ_SAMPLING8 UART_DIVFRAQ_SAMPLING8\n#define __UART_BRR_SAMPLING8 UART_BRR_SAMPLING8\n\n#define __DIV_LPUART UART_DIV_LPUART\n\n#define UART_WAKEUPMETHODE_IDLELINE UART_WAKEUPMETHOD_IDLELINE\n#define UART_WAKEUPMETHODE_ADDRESSMARK UART_WAKEUPMETHOD_ADDRESSMARK\n\n/**\n * @}\n */\n\n \n/** @defgroup HAL_USART_Aliased_Defines HAL USART Aliased Defines maintained for legacy purpose\n * @{\n */\n\n#define USART_CLOCK_DISABLED USART_CLOCK_DISABLE\n#define USART_CLOCK_ENABLED USART_CLOCK_ENABLE\n\n#define USARTNACK_ENABLED USART_NACK_ENABLE\n#define USARTNACK_DISABLED USART_NACK_DISABLE\n/**\n * @}\n */\n\n/** @defgroup HAL_WWDG_Aliased_Defines HAL WWDG Aliased Defines maintained for legacy purpose\n * @{\n */\n#define CFR_BASE WWDG_CFR_BASE\n\n/**\n * @}\n */\n\n/** @defgroup HAL_CAN_Aliased_Defines HAL CAN Aliased Defines maintained for legacy purpose\n * @{\n */\n#define CAN_FilterFIFO0 CAN_FILTER_FIFO0\n#define CAN_FilterFIFO1 CAN_FILTER_FIFO1\n#define CAN_IT_RQCP0 CAN_IT_TME\n#define CAN_IT_RQCP1 CAN_IT_TME\n#define CAN_IT_RQCP2 CAN_IT_TME\n#define INAK_TIMEOUT CAN_TIMEOUT_VALUE\n#define SLAK_TIMEOUT CAN_TIMEOUT_VALUE\n#define CAN_TXSTATUS_FAILED ((uint8_t)0x00U)\n#define CAN_TXSTATUS_OK ((uint8_t)0x01U)\n#define CAN_TXSTATUS_PENDING ((uint8_t)0x02U)\n\n/**\n * @}\n */\n \n/** @defgroup HAL_ETH_Aliased_Defines HAL ETH Aliased Defines maintained for legacy purpose\n * @{\n */\n\n#define VLAN_TAG ETH_VLAN_TAG\n#define MIN_ETH_PAYLOAD ETH_MIN_ETH_PAYLOAD\n#define MAX_ETH_PAYLOAD ETH_MAX_ETH_PAYLOAD\n#define JUMBO_FRAME_PAYLOAD ETH_JUMBO_FRAME_PAYLOAD\n#define MACMIIAR_CR_MASK ETH_MACMIIAR_CR_MASK\n#define MACCR_CLEAR_MASK ETH_MACCR_CLEAR_MASK\n#define MACFCR_CLEAR_MASK ETH_MACFCR_CLEAR_MASK\n#define DMAOMR_CLEAR_MASK ETH_DMAOMR_CLEAR_MASK\n\n#define ETH_MMCCR ((uint32_t)0x00000100U) \n#define ETH_MMCRIR ((uint32_t)0x00000104U) \n#define ETH_MMCTIR ((uint32_t)0x00000108U) \n#define ETH_MMCRIMR ((uint32_t)0x0000010CU) \n#define ETH_MMCTIMR ((uint32_t)0x00000110U) \n#define ETH_MMCTGFSCCR ((uint32_t)0x0000014CU) \n#define ETH_MMCTGFMSCCR ((uint32_t)0x00000150U) \n#define ETH_MMCTGFCR ((uint32_t)0x00000168U) \n#define ETH_MMCRFCECR ((uint32_t)0x00000194U) \n#define ETH_MMCRFAECR ((uint32_t)0x00000198U) \n#define ETH_MMCRGUFCR ((uint32_t)0x000001C4U)\n \n#define ETH_MAC_TXFIFO_FULL ((uint32_t)0x02000000) /* Tx FIFO full */\n#define ETH_MAC_TXFIFONOT_EMPTY ((uint32_t)0x01000000) /* Tx FIFO not empty */\n#define ETH_MAC_TXFIFO_WRITE_ACTIVE ((uint32_t)0x00400000) /* Tx FIFO write active */\n#define ETH_MAC_TXFIFO_IDLE ((uint32_t)0x00000000) /* Tx FIFO read status: Idle */\n#define ETH_MAC_TXFIFO_READ ((uint32_t)0x00100000) /* Tx FIFO read status: Read (transferring data to the MAC transmitter) */\n#define ETH_MAC_TXFIFO_WAITING ((uint32_t)0x00200000) /* Tx FIFO read status: Waiting for TxStatus from MAC transmitter */\n#define ETH_MAC_TXFIFO_WRITING ((uint32_t)0x00300000) /* Tx FIFO read status: Writing the received TxStatus or flushing the TxFIFO */\n#define ETH_MAC_TRANSMISSION_PAUSE ((uint32_t)0x00080000) /* MAC transmitter in pause */\n#define ETH_MAC_TRANSMITFRAMECONTROLLER_IDLE ((uint32_t)0x00000000) /* MAC transmit frame controller: Idle */\n#define ETH_MAC_TRANSMITFRAMECONTROLLER_WAITING ((uint32_t)0x00020000) /* MAC transmit frame controller: Waiting for Status of previous frame or IFG/backoff period to be over */\n#define ETH_MAC_TRANSMITFRAMECONTROLLER_GENRATING_PCF ((uint32_t)0x00040000) /* MAC transmit frame controller: Generating and transmitting a Pause control frame (in full duplex mode) */\n#define ETH_MAC_TRANSMITFRAMECONTROLLER_TRANSFERRING ((uint32_t)0x00060000) /* MAC transmit frame controller: Transferring input frame for transmission */\n#define ETH_MAC_MII_TRANSMIT_ACTIVE ((uint32_t)0x00010000) /* MAC MII transmit engine active */\n#define ETH_MAC_RXFIFO_EMPTY ((uint32_t)0x00000000) /* Rx FIFO fill level: empty */\n#define ETH_MAC_RXFIFO_BELOW_THRESHOLD ((uint32_t)0x00000100) /* Rx FIFO fill level: fill-level below flow-control de-activate threshold */\n#define ETH_MAC_RXFIFO_ABOVE_THRESHOLD ((uint32_t)0x00000200) /* Rx FIFO fill level: fill-level above flow-control activate threshold */\n#define ETH_MAC_RXFIFO_FULL ((uint32_t)0x00000300) /* Rx FIFO fill level: full */\n#if defined(STM32F1)\n#else\n#define ETH_MAC_READCONTROLLER_IDLE ((uint32_t)0x00000000) /* Rx FIFO read controller IDLE state */\n#define ETH_MAC_READCONTROLLER_READING_DATA ((uint32_t)0x00000020) /* Rx FIFO read controller Reading frame data */\n#define ETH_MAC_READCONTROLLER_READING_STATUS ((uint32_t)0x00000040) /* Rx FIFO read controller Reading frame status (or time-stamp) */\n#endif\n#define ETH_MAC_READCONTROLLER_FLUSHING ((uint32_t)0x00000060) /* Rx FIFO read controller Flushing the frame data and status */\n#define ETH_MAC_RXFIFO_WRITE_ACTIVE ((uint32_t)0x00000010) /* Rx FIFO write controller active */\n#define ETH_MAC_SMALL_FIFO_NOTACTIVE ((uint32_t)0x00000000) /* MAC small FIFO read / write controllers not active */\n#define ETH_MAC_SMALL_FIFO_READ_ACTIVE ((uint32_t)0x00000002) /* MAC small FIFO read controller active */\n#define ETH_MAC_SMALL_FIFO_WRITE_ACTIVE ((uint32_t)0x00000004) /* MAC small FIFO write controller active */\n#define ETH_MAC_SMALL_FIFO_RW_ACTIVE ((uint32_t)0x00000006) /* MAC small FIFO read / write controllers active */\n#define ETH_MAC_MII_RECEIVE_PROTOCOL_ACTIVE ((uint32_t)0x00000001) /* MAC MII receive protocol engine active */\n\n/**\n * @}\n */\n \n/** @defgroup HAL_DCMI_Aliased_Defines HAL DCMI Aliased Defines maintained for legacy purpose\n * @{\n */\n#define HAL_DCMI_ERROR_OVF HAL_DCMI_ERROR_OVR\n#define DCMI_IT_OVF DCMI_IT_OVR\n#define DCMI_FLAG_OVFRI DCMI_FLAG_OVRRI\n#define DCMI_FLAG_OVFMI DCMI_FLAG_OVRMI\n\n#define HAL_DCMI_ConfigCROP HAL_DCMI_ConfigCrop\n#define HAL_DCMI_EnableCROP HAL_DCMI_EnableCrop\n#define HAL_DCMI_DisableCROP HAL_DCMI_DisableCrop\n\n/**\n * @}\n */ \n \n#if defined(STM32L4xx) || defined(STM32F7) || defined(STM32F427xx) || defined(STM32F437xx) ||\\\n defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)\n/** @defgroup HAL_DMA2D_Aliased_Defines HAL DMA2D Aliased Defines maintained for legacy purpose\n * @{\n */\n#define DMA2D_ARGB8888 DMA2D_OUTPUT_ARGB8888\n#define DMA2D_RGB888 DMA2D_OUTPUT_RGB888 \n#define DMA2D_RGB565 DMA2D_OUTPUT_RGB565 \n#define DMA2D_ARGB1555 DMA2D_OUTPUT_ARGB1555\n#define DMA2D_ARGB4444 DMA2D_OUTPUT_ARGB4444\n\n#define CM_ARGB8888 DMA2D_INPUT_ARGB8888\n#define CM_RGB888 DMA2D_INPUT_RGB888 \n#define CM_RGB565 DMA2D_INPUT_RGB565 \n#define CM_ARGB1555 DMA2D_INPUT_ARGB1555\n#define CM_ARGB4444 DMA2D_INPUT_ARGB4444\n#define CM_L8 DMA2D_INPUT_L8 \n#define CM_AL44 DMA2D_INPUT_AL44 \n#define CM_AL88 DMA2D_INPUT_AL88 \n#define CM_L4 DMA2D_INPUT_L4 \n#define CM_A8 DMA2D_INPUT_A8 \n#define CM_A4 DMA2D_INPUT_A4 \n/**\n * @}\n */ \n#endif /* STM32L4xx || STM32F7*/\n\n/** @defgroup HAL_PPP_Aliased_Defines HAL PPP Aliased Defines maintained for legacy purpose\n * @{\n */\n \n/**\n * @}\n */\n\n/* Exported functions --------------------------------------------------------*/\n\n/** @defgroup HAL_CRYP_Aliased_Functions HAL CRYP Aliased Functions maintained for legacy purpose\n * @{\n */\n#define HAL_CRYP_ComputationCpltCallback HAL_CRYPEx_ComputationCpltCallback\n/**\n * @}\n */ \n\n/** @defgroup HAL_HASH_Aliased_Functions HAL HASH Aliased Functions maintained for legacy purpose\n * @{\n */ \n#define HAL_HASH_STATETypeDef HAL_HASH_StateTypeDef\n#define HAL_HASHPhaseTypeDef HAL_HASH_PhaseTypeDef\n#define HAL_HMAC_MD5_Finish HAL_HASH_MD5_Finish\n#define HAL_HMAC_SHA1_Finish HAL_HASH_SHA1_Finish\n#define HAL_HMAC_SHA224_Finish HAL_HASH_SHA224_Finish\n#define HAL_HMAC_SHA256_Finish HAL_HASH_SHA256_Finish\n\n/*HASH Algorithm Selection*/\n\n#define HASH_AlgoSelection_SHA1 HASH_ALGOSELECTION_SHA1 \n#define HASH_AlgoSelection_SHA224 HASH_ALGOSELECTION_SHA224\n#define HASH_AlgoSelection_SHA256 HASH_ALGOSELECTION_SHA256\n#define HASH_AlgoSelection_MD5 HASH_ALGOSELECTION_MD5\n\n#define HASH_AlgoMode_HASH HASH_ALGOMODE_HASH \n#define HASH_AlgoMode_HMAC HASH_ALGOMODE_HMAC\n\n#define HASH_HMACKeyType_ShortKey HASH_HMAC_KEYTYPE_SHORTKEY\n#define HASH_HMACKeyType_LongKey HASH_HMAC_KEYTYPE_LONGKEY\n/**\n * @}\n */\n \n/** @defgroup HAL_Aliased_Functions HAL Generic Aliased Functions maintained for legacy purpose\n * @{\n */\n#define HAL_EnableDBGSleepMode HAL_DBGMCU_EnableDBGSleepMode\n#define HAL_DisableDBGSleepMode HAL_DBGMCU_DisableDBGSleepMode\n#define HAL_EnableDBGStopMode HAL_DBGMCU_EnableDBGStopMode\n#define HAL_DisableDBGStopMode HAL_DBGMCU_DisableDBGStopMode\n#define HAL_EnableDBGStandbyMode HAL_DBGMCU_EnableDBGStandbyMode\n#define HAL_DisableDBGStandbyMode HAL_DBGMCU_DisableDBGStandbyMode\n#define HAL_DBG_LowPowerConfig(Periph, cmd) (((cmd)==ENABLE)? HAL_DBGMCU_DBG_EnableLowPowerConfig(Periph) : HAL_DBGMCU_DBG_DisableLowPowerConfig(Periph))\n#define HAL_VREFINT_OutputSelect HAL_SYSCFG_VREFINT_OutputSelect\n#define HAL_Lock_Cmd(cmd) (((cmd)==ENABLE) ? HAL_SYSCFG_Enable_Lock_VREFINT() : HAL_SYSCFG_Disable_Lock_VREFINT())\n#if defined(STM32L0)\n#else\n#define HAL_VREFINT_Cmd(cmd) (((cmd)==ENABLE)? HAL_SYSCFG_EnableVREFINT() : HAL_SYSCFG_DisableVREFINT())\n#endif\n#define HAL_ADC_EnableBuffer_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINT() : HAL_ADCEx_DisableVREFINT())\n#define HAL_ADC_EnableBufferSensor_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINTTempSensor() : HAL_ADCEx_DisableVREFINTTempSensor())\n/**\n * @}\n */\n\n/** @defgroup HAL_FLASH_Aliased_Functions HAL FLASH Aliased Functions maintained for legacy purpose\n * @{\n */\n#define FLASH_HalfPageProgram HAL_FLASHEx_HalfPageProgram\n#define FLASH_EnableRunPowerDown HAL_FLASHEx_EnableRunPowerDown\n#define FLASH_DisableRunPowerDown HAL_FLASHEx_DisableRunPowerDown\n#define HAL_DATA_EEPROMEx_Unlock HAL_FLASHEx_DATAEEPROM_Unlock\n#define HAL_DATA_EEPROMEx_Lock HAL_FLASHEx_DATAEEPROM_Lock\n#define HAL_DATA_EEPROMEx_Erase HAL_FLASHEx_DATAEEPROM_Erase\n#define HAL_DATA_EEPROMEx_Program HAL_FLASHEx_DATAEEPROM_Program\n\n /**\n * @}\n */\n\n/** @defgroup HAL_I2C_Aliased_Functions HAL I2C Aliased Functions maintained for legacy purpose\n * @{\n */\n#define HAL_I2CEx_AnalogFilter_Config HAL_I2CEx_ConfigAnalogFilter\n#define HAL_I2CEx_DigitalFilter_Config HAL_I2CEx_ConfigDigitalFilter\n#define HAL_FMPI2CEx_AnalogFilter_Config HAL_FMPI2CEx_ConfigAnalogFilter\n#define HAL_FMPI2CEx_DigitalFilter_Config HAL_FMPI2CEx_ConfigDigitalFilter\n\n#define HAL_I2CFastModePlusConfig(SYSCFG_I2CFastModePlus, cmd) (((cmd)==ENABLE)? HAL_I2CEx_EnableFastModePlus(SYSCFG_I2CFastModePlus): HAL_I2CEx_DisableFastModePlus(SYSCFG_I2CFastModePlus))\n /**\n * @}\n */\n\n/** @defgroup HAL_PWR_Aliased HAL PWR Aliased maintained for legacy purpose\n * @{\n */\n#define HAL_PWR_PVDConfig HAL_PWR_ConfigPVD\n#define HAL_PWR_DisableBkUpReg HAL_PWREx_DisableBkUpReg\n#define HAL_PWR_DisableFlashPowerDown HAL_PWREx_DisableFlashPowerDown\n#define HAL_PWR_DisableVddio2Monitor HAL_PWREx_DisableVddio2Monitor\n#define HAL_PWR_EnableBkUpReg HAL_PWREx_EnableBkUpReg\n#define HAL_PWR_EnableFlashPowerDown HAL_PWREx_EnableFlashPowerDown\n#define HAL_PWR_EnableVddio2Monitor HAL_PWREx_EnableVddio2Monitor\n#define HAL_PWR_PVD_PVM_IRQHandler HAL_PWREx_PVD_PVM_IRQHandler\n#define HAL_PWR_PVDLevelConfig HAL_PWR_ConfigPVD\n#define HAL_PWR_Vddio2Monitor_IRQHandler HAL_PWREx_Vddio2Monitor_IRQHandler\n#define HAL_PWR_Vddio2MonitorCallback HAL_PWREx_Vddio2MonitorCallback\n#define HAL_PWREx_ActivateOverDrive HAL_PWREx_EnableOverDrive\n#define HAL_PWREx_DeactivateOverDrive HAL_PWREx_DisableOverDrive\n#define HAL_PWREx_DisableSDADCAnalog HAL_PWREx_DisableSDADC\n#define HAL_PWREx_EnableSDADCAnalog HAL_PWREx_EnableSDADC\n#define HAL_PWREx_PVMConfig HAL_PWREx_ConfigPVM\n\n#define PWR_MODE_NORMAL PWR_PVD_MODE_NORMAL\n#define PWR_MODE_IT_RISING PWR_PVD_MODE_IT_RISING\n#define PWR_MODE_IT_FALLING PWR_PVD_MODE_IT_FALLING\n#define PWR_MODE_IT_RISING_FALLING PWR_PVD_MODE_IT_RISING_FALLING\n#define PWR_MODE_EVENT_RISING PWR_PVD_MODE_EVENT_RISING\n#define PWR_MODE_EVENT_FALLING PWR_PVD_MODE_EVENT_FALLING\n#define PWR_MODE_EVENT_RISING_FALLING PWR_PVD_MODE_EVENT_RISING_FALLING\n\n#define CR_OFFSET_BB PWR_CR_OFFSET_BB\n#define CSR_OFFSET_BB PWR_CSR_OFFSET_BB\n\n#define DBP_BitNumber DBP_BIT_NUMBER\n#define PVDE_BitNumber PVDE_BIT_NUMBER\n#define PMODE_BitNumber PMODE_BIT_NUMBER\n#define EWUP_BitNumber EWUP_BIT_NUMBER\n#define FPDS_BitNumber FPDS_BIT_NUMBER\n#define ODEN_BitNumber ODEN_BIT_NUMBER\n#define ODSWEN_BitNumber ODSWEN_BIT_NUMBER\n#define MRLVDS_BitNumber MRLVDS_BIT_NUMBER\n#define LPLVDS_BitNumber LPLVDS_BIT_NUMBER\n#define BRE_BitNumber BRE_BIT_NUMBER\n\n#define PWR_MODE_EVT PWR_PVD_MODE_NORMAL\n \n /**\n * @}\n */ \n \n/** @defgroup HAL_SMBUS_Aliased_Functions HAL SMBUS Aliased Functions maintained for legacy purpose\n * @{\n */\n#define HAL_SMBUS_Slave_Listen_IT HAL_SMBUS_EnableListen_IT\n#define HAL_SMBUS_SlaveAddrCallback HAL_SMBUS_AddrCallback \n#define HAL_SMBUS_SlaveListenCpltCallback HAL_SMBUS_ListenCpltCallback \n/**\n * @}\n */\n\n/** @defgroup HAL_SPI_Aliased_Functions HAL SPI Aliased Functions maintained for legacy purpose\n * @{\n */\n#define HAL_SPI_FlushRxFifo HAL_SPIEx_FlushRxFifo\n/**\n * @}\n */ \n\n/** @defgroup HAL_TIM_Aliased_Functions HAL TIM Aliased Functions maintained for legacy purpose\n * @{\n */\n#define HAL_TIM_DMADelayPulseCplt TIM_DMADelayPulseCplt\n#define HAL_TIM_DMAError TIM_DMAError\n#define HAL_TIM_DMACaptureCplt TIM_DMACaptureCplt\n#define HAL_TIMEx_DMACommutationCplt TIMEx_DMACommutationCplt\n/**\n * @}\n */\n \n/** @defgroup HAL_UART_Aliased_Functions HAL UART Aliased Functions maintained for legacy purpose\n * @{\n */ \n#define HAL_UART_WakeupCallback HAL_UARTEx_WakeupCallback\n/**\n * @}\n */\n \n/** @defgroup HAL_LTDC_Aliased_Functions HAL LTDC Aliased Functions maintained for legacy purpose\n * @{\n */ \n#define HAL_LTDC_LineEvenCallback HAL_LTDC_LineEventCallback\n/**\n * @}\n */ \n \n \n/** @defgroup HAL_PPP_Aliased_Functions HAL PPP Aliased Functions maintained for legacy purpose\n * @{\n */\n \n/**\n * @}\n */\n\n/* Exported macros ------------------------------------------------------------*/\n\n/** @defgroup HAL_AES_Aliased_Macros HAL CRYP Aliased Macros maintained for legacy purpose\n * @{\n */\n#define AES_IT_CC CRYP_IT_CC\n#define AES_IT_ERR CRYP_IT_ERR\n#define AES_FLAG_CCF CRYP_FLAG_CCF\n/**\n * @}\n */ \n \n/** @defgroup HAL_Aliased_Macros HAL Generic Aliased Macros maintained for legacy purpose\n * @{\n */\n#define __HAL_GET_BOOT_MODE __HAL_SYSCFG_GET_BOOT_MODE\n#define __HAL_REMAPMEMORY_FLASH __HAL_SYSCFG_REMAPMEMORY_FLASH\n#define __HAL_REMAPMEMORY_SYSTEMFLASH __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH\n#define __HAL_REMAPMEMORY_SRAM __HAL_SYSCFG_REMAPMEMORY_SRAM\n#define __HAL_REMAPMEMORY_FMC __HAL_SYSCFG_REMAPMEMORY_FMC\n#define __HAL_REMAPMEMORY_FMC_SDRAM __HAL_SYSCFG_REMAPMEMORY_FMC_SDRAM \n#define __HAL_REMAPMEMORY_FSMC __HAL_SYSCFG_REMAPMEMORY_FSMC\n#define __HAL_REMAPMEMORY_QUADSPI __HAL_SYSCFG_REMAPMEMORY_QUADSPI\n#define __HAL_FMC_BANK __HAL_SYSCFG_FMC_BANK\n#define __HAL_GET_FLAG __HAL_SYSCFG_GET_FLAG\n#define __HAL_CLEAR_FLAG __HAL_SYSCFG_CLEAR_FLAG\n#define __HAL_VREFINT_OUT_ENABLE __HAL_SYSCFG_VREFINT_OUT_ENABLE\n#define __HAL_VREFINT_OUT_DISABLE __HAL_SYSCFG_VREFINT_OUT_DISABLE\n\n#define SYSCFG_FLAG_VREF_READY SYSCFG_FLAG_VREFINT_READY\n#define SYSCFG_FLAG_RC48 RCC_FLAG_HSI48\n#define IS_SYSCFG_FASTMODEPLUS_CONFIG IS_I2C_FASTMODEPLUS\n#define UFB_MODE_BitNumber UFB_MODE_BIT_NUMBER\n#define CMP_PD_BitNumber CMP_PD_BIT_NUMBER\n\n/**\n * @}\n */\n\n \n/** @defgroup HAL_ADC_Aliased_Macros HAL ADC Aliased Macros maintained for legacy purpose\n * @{\n */\n#define __ADC_ENABLE __HAL_ADC_ENABLE\n#define __ADC_DISABLE __HAL_ADC_DISABLE\n#define __HAL_ADC_ENABLING_CONDITIONS ADC_ENABLING_CONDITIONS\n#define __HAL_ADC_DISABLING_CONDITIONS ADC_DISABLING_CONDITIONS\n#define __HAL_ADC_IS_ENABLED ADC_IS_ENABLE\n#define __ADC_IS_ENABLED ADC_IS_ENABLE\n#define __HAL_ADC_IS_SOFTWARE_START_REGULAR ADC_IS_SOFTWARE_START_REGULAR\n#define __HAL_ADC_IS_SOFTWARE_START_INJECTED ADC_IS_SOFTWARE_START_INJECTED\n#define __HAL_ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED\n#define __HAL_ADC_IS_CONVERSION_ONGOING_REGULAR ADC_IS_CONVERSION_ONGOING_REGULAR\n#define __HAL_ADC_IS_CONVERSION_ONGOING_INJECTED ADC_IS_CONVERSION_ONGOING_INJECTED\n#define __HAL_ADC_IS_CONVERSION_ONGOING ADC_IS_CONVERSION_ONGOING\n#define __HAL_ADC_CLEAR_ERRORCODE ADC_CLEAR_ERRORCODE\n\n#define __HAL_ADC_GET_RESOLUTION ADC_GET_RESOLUTION\n#define __HAL_ADC_JSQR_RK ADC_JSQR_RK\n#define __HAL_ADC_CFGR_AWD1CH ADC_CFGR_AWD1CH_SHIFT\n#define __HAL_ADC_CFGR_AWD23CR ADC_CFGR_AWD23CR\n#define __HAL_ADC_CFGR_INJECT_AUTO_CONVERSION ADC_CFGR_INJECT_AUTO_CONVERSION\n#define __HAL_ADC_CFGR_INJECT_CONTEXT_QUEUE ADC_CFGR_INJECT_CONTEXT_QUEUE\n#define __HAL_ADC_CFGR_INJECT_DISCCONTINUOUS ADC_CFGR_INJECT_DISCCONTINUOUS\n#define __HAL_ADC_CFGR_REG_DISCCONTINUOUS ADC_CFGR_REG_DISCCONTINUOUS\n#define __HAL_ADC_CFGR_DISCONTINUOUS_NUM ADC_CFGR_DISCONTINUOUS_NUM\n#define __HAL_ADC_CFGR_AUTOWAIT ADC_CFGR_AUTOWAIT\n#define __HAL_ADC_CFGR_CONTINUOUS ADC_CFGR_CONTINUOUS\n#define __HAL_ADC_CFGR_OVERRUN ADC_CFGR_OVERRUN\n#define __HAL_ADC_CFGR_DMACONTREQ ADC_CFGR_DMACONTREQ\n#define __HAL_ADC_CFGR_EXTSEL ADC_CFGR_EXTSEL_SET\n#define __HAL_ADC_JSQR_JEXTSEL ADC_JSQR_JEXTSEL_SET\n#define __HAL_ADC_OFR_CHANNEL ADC_OFR_CHANNEL\n#define __HAL_ADC_DIFSEL_CHANNEL ADC_DIFSEL_CHANNEL\n#define __HAL_ADC_CALFACT_DIFF_SET ADC_CALFACT_DIFF_SET\n#define __HAL_ADC_CALFACT_DIFF_GET ADC_CALFACT_DIFF_GET\n#define __HAL_ADC_TRX_HIGHTHRESHOLD ADC_TRX_HIGHTHRESHOLD\n\n#define __HAL_ADC_OFFSET_SHIFT_RESOLUTION ADC_OFFSET_SHIFT_RESOLUTION\n#define __HAL_ADC_AWD1THRESHOLD_SHIFT_RESOLUTION ADC_AWD1THRESHOLD_SHIFT_RESOLUTION\n#define __HAL_ADC_AWD23THRESHOLD_SHIFT_RESOLUTION ADC_AWD23THRESHOLD_SHIFT_RESOLUTION\n#define __HAL_ADC_COMMON_REGISTER ADC_COMMON_REGISTER\n#define __HAL_ADC_COMMON_CCR_MULTI ADC_COMMON_CCR_MULTI\n#define __HAL_ADC_MULTIMODE_IS_ENABLED ADC_MULTIMODE_IS_ENABLE\n#define __ADC_MULTIMODE_IS_ENABLED ADC_MULTIMODE_IS_ENABLE\n#define __HAL_ADC_NONMULTIMODE_OR_MULTIMODEMASTER ADC_NONMULTIMODE_OR_MULTIMODEMASTER\n#define __HAL_ADC_COMMON_ADC_OTHER ADC_COMMON_ADC_OTHER\n#define __HAL_ADC_MULTI_SLAVE ADC_MULTI_SLAVE\n\n#define __HAL_ADC_SQR1_L ADC_SQR1_L_SHIFT\n#define __HAL_ADC_JSQR_JL ADC_JSQR_JL_SHIFT\n#define __HAL_ADC_JSQR_RK_JL ADC_JSQR_RK_JL\n#define __HAL_ADC_CR1_DISCONTINUOUS_NUM ADC_CR1_DISCONTINUOUS_NUM\n#define __HAL_ADC_CR1_SCAN ADC_CR1_SCAN_SET\n#define __HAL_ADC_CONVCYCLES_MAX_RANGE ADC_CONVCYCLES_MAX_RANGE\n#define __HAL_ADC_CLOCK_PRESCALER_RANGE ADC_CLOCK_PRESCALER_RANGE\n#define __HAL_ADC_GET_CLOCK_PRESCALER ADC_GET_CLOCK_PRESCALER\n\n#define __HAL_ADC_SQR1 ADC_SQR1\n#define __HAL_ADC_SMPR1 ADC_SMPR1\n#define __HAL_ADC_SMPR2 ADC_SMPR2\n#define __HAL_ADC_SQR3_RK ADC_SQR3_RK\n#define __HAL_ADC_SQR2_RK ADC_SQR2_RK\n#define __HAL_ADC_SQR1_RK ADC_SQR1_RK\n#define __HAL_ADC_CR2_CONTINUOUS ADC_CR2_CONTINUOUS\n#define __HAL_ADC_CR1_DISCONTINUOUS ADC_CR1_DISCONTINUOUS\n#define __HAL_ADC_CR1_SCANCONV ADC_CR1_SCANCONV\n#define __HAL_ADC_CR2_EOCSelection ADC_CR2_EOCSelection\n#define __HAL_ADC_CR2_DMAContReq ADC_CR2_DMAContReq\n#define __HAL_ADC_JSQR ADC_JSQR\n\n#define __HAL_ADC_CHSELR_CHANNEL ADC_CHSELR_CHANNEL\n#define __HAL_ADC_CFGR1_REG_DISCCONTINUOUS ADC_CFGR1_REG_DISCCONTINUOUS\n#define __HAL_ADC_CFGR1_AUTOOFF ADC_CFGR1_AUTOOFF\n#define __HAL_ADC_CFGR1_AUTOWAIT ADC_CFGR1_AUTOWAIT\n#define __HAL_ADC_CFGR1_CONTINUOUS ADC_CFGR1_CONTINUOUS\n#define __HAL_ADC_CFGR1_OVERRUN ADC_CFGR1_OVERRUN\n#define __HAL_ADC_CFGR1_SCANDIR ADC_CFGR1_SCANDIR\n#define __HAL_ADC_CFGR1_DMACONTREQ ADC_CFGR1_DMACONTREQ\n\n/**\n * @}\n */\n\n/** @defgroup HAL_DAC_Aliased_Macros HAL DAC Aliased Macros maintained for legacy purpose\n * @{\n */\n#define __HAL_DHR12R1_ALIGNEMENT DAC_DHR12R1_ALIGNMENT\n#define __HAL_DHR12R2_ALIGNEMENT DAC_DHR12R2_ALIGNMENT\n#define __HAL_DHR12RD_ALIGNEMENT DAC_DHR12RD_ALIGNMENT\n#define IS_DAC_GENERATE_WAVE IS_DAC_WAVE\n\n/**\n * @}\n */\n \n/** @defgroup HAL_DBGMCU_Aliased_Macros HAL DBGMCU Aliased Macros maintained for legacy purpose\n * @{\n */\n#define __HAL_FREEZE_TIM1_DBGMCU __HAL_DBGMCU_FREEZE_TIM1\n#define __HAL_UNFREEZE_TIM1_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM1\n#define __HAL_FREEZE_TIM2_DBGMCU __HAL_DBGMCU_FREEZE_TIM2\n#define __HAL_UNFREEZE_TIM2_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM2\n#define __HAL_FREEZE_TIM3_DBGMCU __HAL_DBGMCU_FREEZE_TIM3\n#define __HAL_UNFREEZE_TIM3_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM3\n#define __HAL_FREEZE_TIM4_DBGMCU __HAL_DBGMCU_FREEZE_TIM4\n#define __HAL_UNFREEZE_TIM4_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM4\n#define __HAL_FREEZE_TIM5_DBGMCU __HAL_DBGMCU_FREEZE_TIM5\n#define __HAL_UNFREEZE_TIM5_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM5\n#define __HAL_FREEZE_TIM6_DBGMCU __HAL_DBGMCU_FREEZE_TIM6\n#define __HAL_UNFREEZE_TIM6_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM6\n#define __HAL_FREEZE_TIM7_DBGMCU __HAL_DBGMCU_FREEZE_TIM7\n#define __HAL_UNFREEZE_TIM7_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM7\n#define __HAL_FREEZE_TIM8_DBGMCU __HAL_DBGMCU_FREEZE_TIM8\n#define __HAL_UNFREEZE_TIM8_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM8\n\n#define __HAL_FREEZE_TIM9_DBGMCU __HAL_DBGMCU_FREEZE_TIM9\n#define __HAL_UNFREEZE_TIM9_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM9\n#define __HAL_FREEZE_TIM10_DBGMCU __HAL_DBGMCU_FREEZE_TIM10\n#define __HAL_UNFREEZE_TIM10_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM10\n#define __HAL_FREEZE_TIM11_DBGMCU __HAL_DBGMCU_FREEZE_TIM11\n#define __HAL_UNFREEZE_TIM11_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM11\n#define __HAL_FREEZE_TIM12_DBGMCU __HAL_DBGMCU_FREEZE_TIM12\n#define __HAL_UNFREEZE_TIM12_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM12\n#define __HAL_FREEZE_TIM13_DBGMCU __HAL_DBGMCU_FREEZE_TIM13\n#define __HAL_UNFREEZE_TIM13_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM13\n#define __HAL_FREEZE_TIM14_DBGMCU __HAL_DBGMCU_FREEZE_TIM14\n#define __HAL_UNFREEZE_TIM14_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM14\n#define __HAL_FREEZE_CAN2_DBGMCU __HAL_DBGMCU_FREEZE_CAN2\n#define __HAL_UNFREEZE_CAN2_DBGMCU __HAL_DBGMCU_UNFREEZE_CAN2\n\n\n#define __HAL_FREEZE_TIM15_DBGMCU __HAL_DBGMCU_FREEZE_TIM15\n#define __HAL_UNFREEZE_TIM15_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM15\n#define __HAL_FREEZE_TIM16_DBGMCU __HAL_DBGMCU_FREEZE_TIM16\n#define __HAL_UNFREEZE_TIM16_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM16\n#define __HAL_FREEZE_TIM17_DBGMCU __HAL_DBGMCU_FREEZE_TIM17\n#define __HAL_UNFREEZE_TIM17_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM17\n#define __HAL_FREEZE_RTC_DBGMCU __HAL_DBGMCU_FREEZE_RTC\n#define __HAL_UNFREEZE_RTC_DBGMCU __HAL_DBGMCU_UNFREEZE_RTC\n#define __HAL_FREEZE_WWDG_DBGMCU __HAL_DBGMCU_FREEZE_WWDG\n#define __HAL_UNFREEZE_WWDG_DBGMCU __HAL_DBGMCU_UNFREEZE_WWDG\n#define __HAL_FREEZE_IWDG_DBGMCU __HAL_DBGMCU_FREEZE_IWDG\n#define __HAL_UNFREEZE_IWDG_DBGMCU __HAL_DBGMCU_UNFREEZE_IWDG\n#define __HAL_FREEZE_I2C1_TIMEOUT_DBGMCU __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT\n#define __HAL_UNFREEZE_I2C1_TIMEOUT_DBGMCU __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT\n#define __HAL_FREEZE_I2C2_TIMEOUT_DBGMCU __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT\n#define __HAL_UNFREEZE_I2C2_TIMEOUT_DBGMCU __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT\n#define __HAL_FREEZE_I2C3_TIMEOUT_DBGMCU __HAL_DBGMCU_FREEZE_I2C3_TIMEOUT\n#define __HAL_UNFREEZE_I2C3_TIMEOUT_DBGMCU __HAL_DBGMCU_UNFREEZE_I2C3_TIMEOUT\n#define __HAL_FREEZE_CAN1_DBGMCU __HAL_DBGMCU_FREEZE_CAN1\n#define __HAL_UNFREEZE_CAN1_DBGMCU __HAL_DBGMCU_UNFREEZE_CAN1\n#define __HAL_FREEZE_LPTIM1_DBGMCU __HAL_DBGMCU_FREEZE_LPTIM1\n#define __HAL_UNFREEZE_LPTIM1_DBGMCU __HAL_DBGMCU_UNFREEZE_LPTIM1\n#define __HAL_FREEZE_LPTIM2_DBGMCU __HAL_DBGMCU_FREEZE_LPTIM2\n#define __HAL_UNFREEZE_LPTIM2_DBGMCU __HAL_DBGMCU_UNFREEZE_LPTIM2\n\n/**\n * @}\n */\n\n/** @defgroup HAL_COMP_Aliased_Macros HAL COMP Aliased Macros maintained for legacy purpose\n * @{\n */\n#if defined(STM32F3)\n#define COMP_START __HAL_COMP_ENABLE\n#define COMP_STOP __HAL_COMP_DISABLE\n#define COMP_LOCK __HAL_COMP_LOCK\n \n#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\n#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_RISING_EDGE() : \\\n __HAL_COMP_COMP6_EXTI_ENABLE_RISING_EDGE())\n#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_RISING_EDGE() : \\\n __HAL_COMP_COMP6_EXTI_DISABLE_RISING_EDGE())\n#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_FALLING_EDGE() : \\\n __HAL_COMP_COMP6_EXTI_ENABLE_FALLING_EDGE())\n#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_FALLING_EDGE() : \\\n __HAL_COMP_COMP6_EXTI_DISABLE_FALLING_EDGE())\n#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_IT() : \\\n __HAL_COMP_COMP6_EXTI_ENABLE_IT())\n#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_IT() : \\\n __HAL_COMP_COMP6_EXTI_DISABLE_IT())\n#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_GET_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_GET_FLAG() : \\\n __HAL_COMP_COMP6_EXTI_GET_FLAG())\n#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_CLEAR_FLAG() : \\\n __HAL_COMP_COMP6_EXTI_CLEAR_FLAG())\n# endif\n# if defined(STM32F302xE) || defined(STM32F302xC)\n#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_RISING_EDGE() : \\\n __HAL_COMP_COMP6_EXTI_ENABLE_RISING_EDGE())\n#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_RISING_EDGE() : \\\n __HAL_COMP_COMP6_EXTI_DISABLE_RISING_EDGE())\n#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_FALLING_EDGE() : \\\n __HAL_COMP_COMP6_EXTI_ENABLE_FALLING_EDGE())\n#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_FALLING_EDGE() : \\\n __HAL_COMP_COMP6_EXTI_DISABLE_FALLING_EDGE())\n#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_IT() : \\\n __HAL_COMP_COMP6_EXTI_ENABLE_IT())\n#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_IT() : \\\n __HAL_COMP_COMP6_EXTI_DISABLE_IT())\n#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_GET_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_GET_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_GET_FLAG() : \\\n __HAL_COMP_COMP6_EXTI_GET_FLAG())\n#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_CLEAR_FLAG() : \\\n __HAL_COMP_COMP6_EXTI_CLEAR_FLAG())\n# endif\n# if defined(STM32F303xE) || defined(STM32F398xx) || defined(STM32F303xC) || defined(STM32F358xx)\n#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_ENABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_ENABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_ENABLE_RISING_EDGE() : \\\n __HAL_COMP_COMP7_EXTI_ENABLE_RISING_EDGE())\n#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_DISABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_DISABLE_RISING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_DISABLE_RISING_EDGE() : \\\n __HAL_COMP_COMP7_EXTI_DISABLE_RISING_EDGE())\n#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_ENABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_ENABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_ENABLE_FALLING_EDGE() : \\\n __HAL_COMP_COMP7_EXTI_ENABLE_FALLING_EDGE())\n#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_DISABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_DISABLE_FALLING_EDGE() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_DISABLE_FALLING_EDGE() : \\\n __HAL_COMP_COMP7_EXTI_DISABLE_FALLING_EDGE())\n#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_ENABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_ENABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_ENABLE_IT() : \\\n __HAL_COMP_COMP7_EXTI_ENABLE_IT())\n#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_DISABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_DISABLE_IT() : \\\n ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_DISABLE_IT() : \\\n __HAL_COMP_COMP7_EXTI_DISABLE_IT())\n#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_GET_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_GET_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_GET_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_GET_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_GET_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_GET_FLAG() : \\\n __HAL_COMP_COMP7_EXTI_GET_FLAG())\n#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_CLEAR_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_CLEAR_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_CLEAR_FLAG() : \\\n ((__FLAG__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_CLEAR_FLAG() : \\\n __HAL_COMP_COMP7_EXTI_CLEAR_FLAG())\n# endif\n# if defined(STM32F373xC) ||defined(STM32F378xx)\n#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() : \\\n __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE())\n#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() : \\\n __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE())\n#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() : \\\n __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE())\n#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() : \\\n __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE())\n#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_IT() : \\\n __HAL_COMP_COMP2_EXTI_ENABLE_IT())\n#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_IT() : \\\n __HAL_COMP_COMP2_EXTI_DISABLE_IT())\n#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_GET_FLAG() : \\\n __HAL_COMP_COMP2_EXTI_GET_FLAG())\n#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() : \\\n __HAL_COMP_COMP2_EXTI_CLEAR_FLAG())\n# endif\n#else\n#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() : \\\n __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE())\n#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() : \\\n __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE())\n#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() : \\\n __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE())\n#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() : \\\n __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE())\n#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_IT() : \\\n __HAL_COMP_COMP2_EXTI_ENABLE_IT())\n#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_IT() : \\\n __HAL_COMP_COMP2_EXTI_DISABLE_IT())\n#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_GET_FLAG() : \\\n __HAL_COMP_COMP2_EXTI_GET_FLAG())\n#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() : \\\n __HAL_COMP_COMP2_EXTI_CLEAR_FLAG())\n#endif\n\n#define __HAL_COMP_GET_EXTI_LINE COMP_GET_EXTI_LINE\n\n#if defined(STM32L0) || defined(STM32L4)\n/* Note: On these STM32 families, the only argument of this macro */\n/* is COMP_FLAG_LOCK. */\n/* This macro is replaced by __HAL_COMP_IS_LOCKED with only HAL handle */\n/* argument. */\n#define __HAL_COMP_GET_FLAG(__HANDLE__, __FLAG__) (__HAL_COMP_IS_LOCKED(__HANDLE__))\n#endif\n/**\n * @}\n */\n\n#if defined(STM32L0) || defined(STM32L4)\n/** @defgroup HAL_COMP_Aliased_Functions HAL COMP Aliased Functions maintained for legacy purpose\n * @{\n */\n#define HAL_COMP_Start_IT HAL_COMP_Start /* Function considered as legacy as EXTI event or IT configuration is done into HAL_COMP_Init() */\n#define HAL_COMP_Stop_IT HAL_COMP_Stop /* Function considered as legacy as EXTI event or IT configuration is done into HAL_COMP_Init() */\n/**\n * @}\n */\n#endif\n\n/** @defgroup HAL_DAC_Aliased_Macros HAL DAC Aliased Macros maintained for legacy purpose\n * @{\n */\n\n#define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_WAVE_NONE) || \\\n ((WAVE) == DAC_WAVE_NOISE)|| \\\n ((WAVE) == DAC_WAVE_TRIANGLE))\n \n/**\n * @}\n */\n\n/** @defgroup HAL_FLASH_Aliased_Macros HAL FLASH Aliased Macros maintained for legacy purpose\n * @{\n */\n\n#define IS_WRPAREA IS_OB_WRPAREA\n#define IS_TYPEPROGRAM IS_FLASH_TYPEPROGRAM\n#define IS_TYPEPROGRAMFLASH IS_FLASH_TYPEPROGRAM\n#define IS_TYPEERASE IS_FLASH_TYPEERASE\n#define IS_NBSECTORS IS_FLASH_NBSECTORS\n#define IS_OB_WDG_SOURCE IS_OB_IWDG_SOURCE\n\n/**\n * @}\n */\n \n/** @defgroup HAL_I2C_Aliased_Macros HAL I2C Aliased Macros maintained for legacy purpose\n * @{\n */\n \n#define __HAL_I2C_RESET_CR2 I2C_RESET_CR2\n#define __HAL_I2C_GENERATE_START I2C_GENERATE_START\n#define __HAL_I2C_FREQ_RANGE I2C_FREQ_RANGE\n#define __HAL_I2C_RISE_TIME I2C_RISE_TIME\n#define __HAL_I2C_SPEED_STANDARD I2C_SPEED_STANDARD\n#define __HAL_I2C_SPEED_FAST I2C_SPEED_FAST\n#define __HAL_I2C_SPEED I2C_SPEED\n#define __HAL_I2C_7BIT_ADD_WRITE I2C_7BIT_ADD_WRITE\n#define __HAL_I2C_7BIT_ADD_READ I2C_7BIT_ADD_READ\n#define __HAL_I2C_10BIT_ADDRESS I2C_10BIT_ADDRESS\n#define __HAL_I2C_10BIT_HEADER_WRITE I2C_10BIT_HEADER_WRITE\n#define __HAL_I2C_10BIT_HEADER_READ I2C_10BIT_HEADER_READ\n#define __HAL_I2C_MEM_ADD_MSB I2C_MEM_ADD_MSB\n#define __HAL_I2C_MEM_ADD_LSB I2C_MEM_ADD_LSB\n#define __HAL_I2C_FREQRANGE I2C_FREQRANGE\n/**\n * @}\n */\n \n/** @defgroup HAL_I2S_Aliased_Macros HAL I2S Aliased Macros maintained for legacy purpose\n * @{\n */\n \n#define IS_I2S_INSTANCE IS_I2S_ALL_INSTANCE\n#define IS_I2S_INSTANCE_EXT IS_I2S_ALL_INSTANCE_EXT\n\n/**\n * @}\n */\n\n/** @defgroup HAL_IRDA_Aliased_Macros HAL IRDA Aliased Macros maintained for legacy purpose\n * @{\n */\n \n#define __IRDA_DISABLE __HAL_IRDA_DISABLE\n#define __IRDA_ENABLE __HAL_IRDA_ENABLE\n\n#define __HAL_IRDA_GETCLOCKSOURCE IRDA_GETCLOCKSOURCE\n#define __HAL_IRDA_MASK_COMPUTATION IRDA_MASK_COMPUTATION\n#define __IRDA_GETCLOCKSOURCE IRDA_GETCLOCKSOURCE\n#define __IRDA_MASK_COMPUTATION IRDA_MASK_COMPUTATION\n\n#define IS_IRDA_ONEBIT_SAMPLE IS_IRDA_ONE_BIT_SAMPLE \n\n\n/**\n * @}\n */\n\n\n/** @defgroup HAL_IWDG_Aliased_Macros HAL IWDG Aliased Macros maintained for legacy purpose\n * @{\n */\n#define __HAL_IWDG_ENABLE_WRITE_ACCESS IWDG_ENABLE_WRITE_ACCESS\n#define __HAL_IWDG_DISABLE_WRITE_ACCESS IWDG_DISABLE_WRITE_ACCESS\n/**\n * @}\n */\n\n\n/** @defgroup HAL_LPTIM_Aliased_Macros HAL LPTIM Aliased Macros maintained for legacy purpose\n * @{\n */\n\n#define __HAL_LPTIM_ENABLE_INTERRUPT __HAL_LPTIM_ENABLE_IT\n#define __HAL_LPTIM_DISABLE_INTERRUPT __HAL_LPTIM_DISABLE_IT\n#define __HAL_LPTIM_GET_ITSTATUS __HAL_LPTIM_GET_IT_SOURCE\n\n/**\n * @}\n */\n \n \n/** @defgroup HAL_OPAMP_Aliased_Macros HAL OPAMP Aliased Macros maintained for legacy purpose\n * @{\n */\n#define __OPAMP_CSR_OPAXPD OPAMP_CSR_OPAXPD\n#define __OPAMP_CSR_S3SELX OPAMP_CSR_S3SELX\n#define __OPAMP_CSR_S4SELX OPAMP_CSR_S4SELX\n#define __OPAMP_CSR_S5SELX OPAMP_CSR_S5SELX\n#define __OPAMP_CSR_S6SELX OPAMP_CSR_S6SELX\n#define __OPAMP_CSR_OPAXCAL_L OPAMP_CSR_OPAXCAL_L\n#define __OPAMP_CSR_OPAXCAL_H OPAMP_CSR_OPAXCAL_H\n#define __OPAMP_CSR_OPAXLPM OPAMP_CSR_OPAXLPM\n#define __OPAMP_CSR_ALL_SWITCHES OPAMP_CSR_ALL_SWITCHES\n#define __OPAMP_CSR_ANAWSELX OPAMP_CSR_ANAWSELX\n#define __OPAMP_CSR_OPAXCALOUT OPAMP_CSR_OPAXCALOUT\n#define __OPAMP_OFFSET_TRIM_BITSPOSITION OPAMP_OFFSET_TRIM_BITSPOSITION\n#define __OPAMP_OFFSET_TRIM_SET OPAMP_OFFSET_TRIM_SET\n\n/**\n * @}\n */\n\n\n/** @defgroup HAL_PWR_Aliased_Macros HAL PWR Aliased Macros maintained for legacy purpose\n * @{\n */\n#define __HAL_PVD_EVENT_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_EVENT\n#define __HAL_PVD_EVENT_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_EVENT\n#define __HAL_PVD_EXTI_FALLINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE\n#define __HAL_PVD_EXTI_FALLINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE\n#define __HAL_PVD_EXTI_RISINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE\n#define __HAL_PVD_EXTI_RISINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE\n#define __HAL_PVM_EVENT_DISABLE __HAL_PWR_PVM_EVENT_DISABLE\n#define __HAL_PVM_EVENT_ENABLE __HAL_PWR_PVM_EVENT_ENABLE\n#define __HAL_PVM_EXTI_FALLINGTRIGGER_DISABLE __HAL_PWR_PVM_EXTI_FALLINGTRIGGER_DISABLE\n#define __HAL_PVM_EXTI_FALLINGTRIGGER_ENABLE __HAL_PWR_PVM_EXTI_FALLINGTRIGGER_ENABLE\n#define __HAL_PVM_EXTI_RISINGTRIGGER_DISABLE __HAL_PWR_PVM_EXTI_RISINGTRIGGER_DISABLE\n#define __HAL_PVM_EXTI_RISINGTRIGGER_ENABLE __HAL_PWR_PVM_EXTI_RISINGTRIGGER_ENABLE\n#define __HAL_PWR_INTERNALWAKEUP_DISABLE HAL_PWREx_DisableInternalWakeUpLine\n#define __HAL_PWR_INTERNALWAKEUP_ENABLE HAL_PWREx_EnableInternalWakeUpLine\n#define __HAL_PWR_PULL_UP_DOWN_CONFIG_DISABLE HAL_PWREx_DisablePullUpPullDownConfig\n#define __HAL_PWR_PULL_UP_DOWN_CONFIG_ENABLE HAL_PWREx_EnablePullUpPullDownConfig\n#define __HAL_PWR_PVD_EXTI_CLEAR_EGDE_TRIGGER() do { __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE(); } while(0)\n#define __HAL_PWR_PVD_EXTI_EVENT_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_EVENT\n#define __HAL_PWR_PVD_EXTI_EVENT_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_EVENT\n#define __HAL_PWR_PVD_EXTI_FALLINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE\n#define __HAL_PWR_PVD_EXTI_FALLINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE\n#define __HAL_PWR_PVD_EXTI_RISINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE\n#define __HAL_PWR_PVD_EXTI_RISINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE\n#define __HAL_PWR_PVD_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE\n#define __HAL_PWR_PVD_EXTI_SET_RISING_EDGE_TRIGGER __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE\n#define __HAL_PWR_PVM_DISABLE() do { HAL_PWREx_DisablePVM1();HAL_PWREx_DisablePVM2();HAL_PWREx_DisablePVM3();HAL_PWREx_DisablePVM4(); } while(0)\n#define __HAL_PWR_PVM_ENABLE() do { HAL_PWREx_EnablePVM1();HAL_PWREx_EnablePVM2();HAL_PWREx_EnablePVM3();HAL_PWREx_EnablePVM4(); } while(0)\n#define __HAL_PWR_SRAM2CONTENT_PRESERVE_DISABLE HAL_PWREx_DisableSRAM2ContentRetention\n#define __HAL_PWR_SRAM2CONTENT_PRESERVE_ENABLE HAL_PWREx_EnableSRAM2ContentRetention\n#define __HAL_PWR_VDDIO2_DISABLE HAL_PWREx_DisableVddIO2\n#define __HAL_PWR_VDDIO2_ENABLE HAL_PWREx_EnableVddIO2\n#define __HAL_PWR_VDDIO2_EXTI_CLEAR_EGDE_TRIGGER __HAL_PWR_VDDIO2_EXTI_DISABLE_FALLING_EDGE\n#define __HAL_PWR_VDDIO2_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_PWR_VDDIO2_EXTI_ENABLE_FALLING_EDGE\n#define __HAL_PWR_VDDUSB_DISABLE HAL_PWREx_DisableVddUSB\n#define __HAL_PWR_VDDUSB_ENABLE HAL_PWREx_EnableVddUSB\n\n#if defined (STM32F4)\n#define __HAL_PVD_EXTI_ENABLE_IT(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_ENABLE_IT()\n#define __HAL_PVD_EXTI_DISABLE_IT(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_DISABLE_IT()\n#define __HAL_PVD_EXTI_GET_FLAG(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_GET_FLAG() \n#define __HAL_PVD_EXTI_CLEAR_FLAG(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_CLEAR_FLAG()\n#define __HAL_PVD_EXTI_GENERATE_SWIT(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_GENERATE_SWIT()\n#else\n#define __HAL_PVD_EXTI_CLEAR_FLAG __HAL_PWR_PVD_EXTI_CLEAR_FLAG\n#define __HAL_PVD_EXTI_DISABLE_IT __HAL_PWR_PVD_EXTI_DISABLE_IT\n#define __HAL_PVD_EXTI_ENABLE_IT __HAL_PWR_PVD_EXTI_ENABLE_IT\n#define __HAL_PVD_EXTI_GENERATE_SWIT __HAL_PWR_PVD_EXTI_GENERATE_SWIT\n#define __HAL_PVD_EXTI_GET_FLAG __HAL_PWR_PVD_EXTI_GET_FLAG \n#endif /* STM32F4 */\n/** \n * @}\n */ \n \n \n/** @defgroup HAL_RCC_Aliased HAL RCC Aliased maintained for legacy purpose\n * @{\n */\n \n#define RCC_StopWakeUpClock_MSI RCC_STOP_WAKEUPCLOCK_MSI\n#define RCC_StopWakeUpClock_HSI RCC_STOP_WAKEUPCLOCK_HSI\n\n#define HAL_RCC_CCSCallback HAL_RCC_CSSCallback\n#define HAL_RC48_EnableBuffer_Cmd(cmd) (((cmd)==ENABLE) ? HAL_RCCEx_EnableHSI48_VREFINT() : HAL_RCCEx_DisableHSI48_VREFINT())\n\n#define __ADC_CLK_DISABLE __HAL_RCC_ADC_CLK_DISABLE\n#define __ADC_CLK_ENABLE __HAL_RCC_ADC_CLK_ENABLE\n#define __ADC_CLK_SLEEP_DISABLE __HAL_RCC_ADC_CLK_SLEEP_DISABLE\n#define __ADC_CLK_SLEEP_ENABLE __HAL_RCC_ADC_CLK_SLEEP_ENABLE\n#define __ADC_FORCE_RESET __HAL_RCC_ADC_FORCE_RESET\n#define __ADC_RELEASE_RESET __HAL_RCC_ADC_RELEASE_RESET\n#define __ADC1_CLK_DISABLE __HAL_RCC_ADC1_CLK_DISABLE\n#define __ADC1_CLK_ENABLE __HAL_RCC_ADC1_CLK_ENABLE\n#define __ADC1_FORCE_RESET __HAL_RCC_ADC1_FORCE_RESET\n#define __ADC1_RELEASE_RESET __HAL_RCC_ADC1_RELEASE_RESET\n#define __ADC1_CLK_SLEEP_ENABLE __HAL_RCC_ADC1_CLK_SLEEP_ENABLE \n#define __ADC1_CLK_SLEEP_DISABLE __HAL_RCC_ADC1_CLK_SLEEP_DISABLE \n#define __ADC2_CLK_DISABLE __HAL_RCC_ADC2_CLK_DISABLE\n#define __ADC2_CLK_ENABLE __HAL_RCC_ADC2_CLK_ENABLE\n#define __ADC2_FORCE_RESET __HAL_RCC_ADC2_FORCE_RESET\n#define __ADC2_RELEASE_RESET __HAL_RCC_ADC2_RELEASE_RESET\n#define __ADC3_CLK_DISABLE __HAL_RCC_ADC3_CLK_DISABLE\n#define __ADC3_CLK_ENABLE __HAL_RCC_ADC3_CLK_ENABLE\n#define __ADC3_FORCE_RESET __HAL_RCC_ADC3_FORCE_RESET\n#define __ADC3_RELEASE_RESET __HAL_RCC_ADC3_RELEASE_RESET\n#define __AES_CLK_DISABLE __HAL_RCC_AES_CLK_DISABLE\n#define __AES_CLK_ENABLE __HAL_RCC_AES_CLK_ENABLE\n#define __AES_CLK_SLEEP_DISABLE __HAL_RCC_AES_CLK_SLEEP_DISABLE\n#define __AES_CLK_SLEEP_ENABLE __HAL_RCC_AES_CLK_SLEEP_ENABLE\n#define __AES_FORCE_RESET __HAL_RCC_AES_FORCE_RESET\n#define __AES_RELEASE_RESET __HAL_RCC_AES_RELEASE_RESET\n#define __CRYP_CLK_SLEEP_ENABLE __HAL_RCC_CRYP_CLK_SLEEP_ENABLE\n#define __CRYP_CLK_SLEEP_DISABLE __HAL_RCC_CRYP_CLK_SLEEP_DISABLE\n#define __CRYP_CLK_ENABLE __HAL_RCC_CRYP_CLK_ENABLE\n#define __CRYP_CLK_DISABLE __HAL_RCC_CRYP_CLK_DISABLE\n#define __CRYP_FORCE_RESET __HAL_RCC_CRYP_FORCE_RESET\n#define __CRYP_RELEASE_RESET __HAL_RCC_CRYP_RELEASE_RESET\n#define __AFIO_CLK_DISABLE __HAL_RCC_AFIO_CLK_DISABLE\n#define __AFIO_CLK_ENABLE __HAL_RCC_AFIO_CLK_ENABLE\n#define __AFIO_FORCE_RESET __HAL_RCC_AFIO_FORCE_RESET\n#define __AFIO_RELEASE_RESET __HAL_RCC_AFIO_RELEASE_RESET\n#define __AHB_FORCE_RESET __HAL_RCC_AHB_FORCE_RESET\n#define __AHB_RELEASE_RESET __HAL_RCC_AHB_RELEASE_RESET\n#define __AHB1_FORCE_RESET __HAL_RCC_AHB1_FORCE_RESET\n#define __AHB1_RELEASE_RESET __HAL_RCC_AHB1_RELEASE_RESET\n#define __AHB2_FORCE_RESET __HAL_RCC_AHB2_FORCE_RESET\n#define __AHB2_RELEASE_RESET __HAL_RCC_AHB2_RELEASE_RESET\n#define __AHB3_FORCE_RESET __HAL_RCC_AHB3_FORCE_RESET\n#define __AHB3_RELEASE_RESET __HAL_RCC_AHB3_RELEASE_RESET\n#define __APB1_FORCE_RESET __HAL_RCC_APB1_FORCE_RESET\n#define __APB1_RELEASE_RESET __HAL_RCC_APB1_RELEASE_RESET\n#define __APB2_FORCE_RESET __HAL_RCC_APB2_FORCE_RESET\n#define __APB2_RELEASE_RESET __HAL_RCC_APB2_RELEASE_RESET\n#define __BKP_CLK_DISABLE __HAL_RCC_BKP_CLK_DISABLE\n#define __BKP_CLK_ENABLE __HAL_RCC_BKP_CLK_ENABLE\n#define __BKP_FORCE_RESET __HAL_RCC_BKP_FORCE_RESET\n#define __BKP_RELEASE_RESET __HAL_RCC_BKP_RELEASE_RESET\n#define __CAN1_CLK_DISABLE __HAL_RCC_CAN1_CLK_DISABLE\n#define __CAN1_CLK_ENABLE __HAL_RCC_CAN1_CLK_ENABLE\n#define __CAN1_CLK_SLEEP_DISABLE __HAL_RCC_CAN1_CLK_SLEEP_DISABLE\n#define __CAN1_CLK_SLEEP_ENABLE __HAL_RCC_CAN1_CLK_SLEEP_ENABLE\n#define __CAN1_FORCE_RESET __HAL_RCC_CAN1_FORCE_RESET\n#define __CAN1_RELEASE_RESET __HAL_RCC_CAN1_RELEASE_RESET\n#define __CAN_CLK_DISABLE __HAL_RCC_CAN1_CLK_DISABLE\n#define __CAN_CLK_ENABLE __HAL_RCC_CAN1_CLK_ENABLE\n#define __CAN_FORCE_RESET __HAL_RCC_CAN1_FORCE_RESET\n#define __CAN_RELEASE_RESET __HAL_RCC_CAN1_RELEASE_RESET\n#define __CAN2_CLK_DISABLE __HAL_RCC_CAN2_CLK_DISABLE\n#define __CAN2_CLK_ENABLE __HAL_RCC_CAN2_CLK_ENABLE\n#define __CAN2_FORCE_RESET __HAL_RCC_CAN2_FORCE_RESET\n#define __CAN2_RELEASE_RESET __HAL_RCC_CAN2_RELEASE_RESET\n#define __CEC_CLK_DISABLE __HAL_RCC_CEC_CLK_DISABLE\n#define __CEC_CLK_ENABLE __HAL_RCC_CEC_CLK_ENABLE\n#define __COMP_CLK_DISABLE __HAL_RCC_COMP_CLK_DISABLE\n#define __COMP_CLK_ENABLE __HAL_RCC_COMP_CLK_ENABLE\n#define __COMP_FORCE_RESET __HAL_RCC_COMP_FORCE_RESET\n#define __COMP_RELEASE_RESET __HAL_RCC_COMP_RELEASE_RESET\n#define __COMP_CLK_SLEEP_ENABLE __HAL_RCC_COMP_CLK_SLEEP_ENABLE\n#define __COMP_CLK_SLEEP_DISABLE __HAL_RCC_COMP_CLK_SLEEP_DISABLE\n#define __CEC_FORCE_RESET __HAL_RCC_CEC_FORCE_RESET\n#define __CEC_RELEASE_RESET __HAL_RCC_CEC_RELEASE_RESET\n#define __CRC_CLK_DISABLE __HAL_RCC_CRC_CLK_DISABLE\n#define __CRC_CLK_ENABLE __HAL_RCC_CRC_CLK_ENABLE\n#define __CRC_CLK_SLEEP_DISABLE __HAL_RCC_CRC_CLK_SLEEP_DISABLE\n#define __CRC_CLK_SLEEP_ENABLE __HAL_RCC_CRC_CLK_SLEEP_ENABLE\n#define __CRC_FORCE_RESET __HAL_RCC_CRC_FORCE_RESET\n#define __CRC_RELEASE_RESET __HAL_RCC_CRC_RELEASE_RESET\n#define __DAC_CLK_DISABLE __HAL_RCC_DAC_CLK_DISABLE\n#define __DAC_CLK_ENABLE __HAL_RCC_DAC_CLK_ENABLE\n#define __DAC_FORCE_RESET __HAL_RCC_DAC_FORCE_RESET\n#define __DAC_RELEASE_RESET __HAL_RCC_DAC_RELEASE_RESET\n#define __DAC1_CLK_DISABLE __HAL_RCC_DAC1_CLK_DISABLE\n#define __DAC1_CLK_ENABLE __HAL_RCC_DAC1_CLK_ENABLE\n#define __DAC1_CLK_SLEEP_DISABLE __HAL_RCC_DAC1_CLK_SLEEP_DISABLE\n#define __DAC1_CLK_SLEEP_ENABLE __HAL_RCC_DAC1_CLK_SLEEP_ENABLE\n#define __DAC1_FORCE_RESET __HAL_RCC_DAC1_FORCE_RESET\n#define __DAC1_RELEASE_RESET __HAL_RCC_DAC1_RELEASE_RESET\n#define __DBGMCU_CLK_ENABLE __HAL_RCC_DBGMCU_CLK_ENABLE\n#define __DBGMCU_CLK_DISABLE __HAL_RCC_DBGMCU_CLK_DISABLE\n#define __DBGMCU_FORCE_RESET __HAL_RCC_DBGMCU_FORCE_RESET\n#define __DBGMCU_RELEASE_RESET __HAL_RCC_DBGMCU_RELEASE_RESET\n#define __DFSDM_CLK_DISABLE __HAL_RCC_DFSDM_CLK_DISABLE\n#define __DFSDM_CLK_ENABLE __HAL_RCC_DFSDM_CLK_ENABLE\n#define __DFSDM_CLK_SLEEP_DISABLE __HAL_RCC_DFSDM_CLK_SLEEP_DISABLE\n#define __DFSDM_CLK_SLEEP_ENABLE __HAL_RCC_DFSDM_CLK_SLEEP_ENABLE\n#define __DFSDM_FORCE_RESET __HAL_RCC_DFSDM_FORCE_RESET\n#define __DFSDM_RELEASE_RESET __HAL_RCC_DFSDM_RELEASE_RESET\n#define __DMA1_CLK_DISABLE __HAL_RCC_DMA1_CLK_DISABLE\n#define __DMA1_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE\n#define __DMA1_CLK_SLEEP_DISABLE __HAL_RCC_DMA1_CLK_SLEEP_DISABLE\n#define __DMA1_CLK_SLEEP_ENABLE __HAL_RCC_DMA1_CLK_SLEEP_ENABLE\n#define __DMA1_FORCE_RESET __HAL_RCC_DMA1_FORCE_RESET\n#define __DMA1_RELEASE_RESET __HAL_RCC_DMA1_RELEASE_RESET\n#define __DMA2_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE\n#define __DMA2_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE\n#define __DMA2_CLK_SLEEP_DISABLE __HAL_RCC_DMA2_CLK_SLEEP_DISABLE\n#define __DMA2_CLK_SLEEP_ENABLE __HAL_RCC_DMA2_CLK_SLEEP_ENABLE\n#define __DMA2_FORCE_RESET __HAL_RCC_DMA2_FORCE_RESET\n#define __DMA2_RELEASE_RESET __HAL_RCC_DMA2_RELEASE_RESET\n#define __ETHMAC_CLK_DISABLE __HAL_RCC_ETHMAC_CLK_DISABLE\n#define __ETHMAC_CLK_ENABLE __HAL_RCC_ETHMAC_CLK_ENABLE\n#define __ETHMAC_FORCE_RESET __HAL_RCC_ETHMAC_FORCE_RESET\n#define __ETHMAC_RELEASE_RESET __HAL_RCC_ETHMAC_RELEASE_RESET\n#define __ETHMACRX_CLK_DISABLE __HAL_RCC_ETHMACRX_CLK_DISABLE\n#define __ETHMACRX_CLK_ENABLE __HAL_RCC_ETHMACRX_CLK_ENABLE\n#define __ETHMACTX_CLK_DISABLE __HAL_RCC_ETHMACTX_CLK_DISABLE\n#define __ETHMACTX_CLK_ENABLE __HAL_RCC_ETHMACTX_CLK_ENABLE\n#define __FIREWALL_CLK_DISABLE __HAL_RCC_FIREWALL_CLK_DISABLE\n#define __FIREWALL_CLK_ENABLE __HAL_RCC_FIREWALL_CLK_ENABLE\n#define __FLASH_CLK_DISABLE __HAL_RCC_FLASH_CLK_DISABLE\n#define __FLASH_CLK_ENABLE __HAL_RCC_FLASH_CLK_ENABLE\n#define __FLASH_CLK_SLEEP_DISABLE __HAL_RCC_FLASH_CLK_SLEEP_DISABLE\n#define __FLASH_CLK_SLEEP_ENABLE __HAL_RCC_FLASH_CLK_SLEEP_ENABLE\n#define __FLASH_FORCE_RESET __HAL_RCC_FLASH_FORCE_RESET\n#define __FLASH_RELEASE_RESET __HAL_RCC_FLASH_RELEASE_RESET\n#define __FLITF_CLK_DISABLE __HAL_RCC_FLITF_CLK_DISABLE\n#define __FLITF_CLK_ENABLE __HAL_RCC_FLITF_CLK_ENABLE\n#define __FLITF_FORCE_RESET __HAL_RCC_FLITF_FORCE_RESET\n#define __FLITF_RELEASE_RESET __HAL_RCC_FLITF_RELEASE_RESET\n#define __FLITF_CLK_SLEEP_ENABLE __HAL_RCC_FLITF_CLK_SLEEP_ENABLE\n#define __FLITF_CLK_SLEEP_DISABLE __HAL_RCC_FLITF_CLK_SLEEP_DISABLE\n#define __FMC_CLK_DISABLE __HAL_RCC_FMC_CLK_DISABLE\n#define __FMC_CLK_ENABLE __HAL_RCC_FMC_CLK_ENABLE\n#define __FMC_CLK_SLEEP_DISABLE __HAL_RCC_FMC_CLK_SLEEP_DISABLE\n#define __FMC_CLK_SLEEP_ENABLE __HAL_RCC_FMC_CLK_SLEEP_ENABLE\n#define __FMC_FORCE_RESET __HAL_RCC_FMC_FORCE_RESET\n#define __FMC_RELEASE_RESET __HAL_RCC_FMC_RELEASE_RESET\n#define __FSMC_CLK_DISABLE __HAL_RCC_FSMC_CLK_DISABLE\n#define __FSMC_CLK_ENABLE __HAL_RCC_FSMC_CLK_ENABLE\n#define __GPIOA_CLK_DISABLE __HAL_RCC_GPIOA_CLK_DISABLE\n#define __GPIOA_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE\n#define __GPIOA_CLK_SLEEP_DISABLE __HAL_RCC_GPIOA_CLK_SLEEP_DISABLE\n#define __GPIOA_CLK_SLEEP_ENABLE __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE\n#define __GPIOA_FORCE_RESET __HAL_RCC_GPIOA_FORCE_RESET\n#define __GPIOA_RELEASE_RESET __HAL_RCC_GPIOA_RELEASE_RESET\n#define __GPIOB_CLK_DISABLE __HAL_RCC_GPIOB_CLK_DISABLE\n#define __GPIOB_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE\n#define __GPIOB_CLK_SLEEP_DISABLE __HAL_RCC_GPIOB_CLK_SLEEP_DISABLE\n#define __GPIOB_CLK_SLEEP_ENABLE __HAL_RCC_GPIOB_CLK_SLEEP_ENABLE\n#define __GPIOB_FORCE_RESET __HAL_RCC_GPIOB_FORCE_RESET\n#define __GPIOB_RELEASE_RESET __HAL_RCC_GPIOB_RELEASE_RESET\n#define __GPIOC_CLK_DISABLE __HAL_RCC_GPIOC_CLK_DISABLE\n#define __GPIOC_CLK_ENABLE __HAL_RCC_GPIOC_CLK_ENABLE\n#define __GPIOC_CLK_SLEEP_DISABLE __HAL_RCC_GPIOC_CLK_SLEEP_DISABLE\n#define __GPIOC_CLK_SLEEP_ENABLE __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE\n#define __GPIOC_FORCE_RESET __HAL_RCC_GPIOC_FORCE_RESET\n#define __GPIOC_RELEASE_RESET __HAL_RCC_GPIOC_RELEASE_RESET\n#define __GPIOD_CLK_DISABLE __HAL_RCC_GPIOD_CLK_DISABLE\n#define __GPIOD_CLK_ENABLE __HAL_RCC_GPIOD_CLK_ENABLE\n#define __GPIOD_CLK_SLEEP_DISABLE __HAL_RCC_GPIOD_CLK_SLEEP_DISABLE\n#define __GPIOD_CLK_SLEEP_ENABLE __HAL_RCC_GPIOD_CLK_SLEEP_ENABLE\n#define __GPIOD_FORCE_RESET __HAL_RCC_GPIOD_FORCE_RESET\n#define __GPIOD_RELEASE_RESET __HAL_RCC_GPIOD_RELEASE_RESET\n#define __GPIOE_CLK_DISABLE __HAL_RCC_GPIOE_CLK_DISABLE\n#define __GPIOE_CLK_ENABLE __HAL_RCC_GPIOE_CLK_ENABLE\n#define __GPIOE_CLK_SLEEP_DISABLE __HAL_RCC_GPIOE_CLK_SLEEP_DISABLE\n#define __GPIOE_CLK_SLEEP_ENABLE __HAL_RCC_GPIOE_CLK_SLEEP_ENABLE\n#define __GPIOE_FORCE_RESET __HAL_RCC_GPIOE_FORCE_RESET\n#define __GPIOE_RELEASE_RESET __HAL_RCC_GPIOE_RELEASE_RESET\n#define __GPIOF_CLK_DISABLE __HAL_RCC_GPIOF_CLK_DISABLE\n#define __GPIOF_CLK_ENABLE __HAL_RCC_GPIOF_CLK_ENABLE\n#define __GPIOF_CLK_SLEEP_DISABLE __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE\n#define __GPIOF_CLK_SLEEP_ENABLE __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE\n#define __GPIOF_FORCE_RESET __HAL_RCC_GPIOF_FORCE_RESET\n#define __GPIOF_RELEASE_RESET __HAL_RCC_GPIOF_RELEASE_RESET\n#define __GPIOG_CLK_DISABLE __HAL_RCC_GPIOG_CLK_DISABLE\n#define __GPIOG_CLK_ENABLE __HAL_RCC_GPIOG_CLK_ENABLE\n#define __GPIOG_CLK_SLEEP_DISABLE __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE\n#define __GPIOG_CLK_SLEEP_ENABLE __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE\n#define __GPIOG_FORCE_RESET __HAL_RCC_GPIOG_FORCE_RESET\n#define __GPIOG_RELEASE_RESET __HAL_RCC_GPIOG_RELEASE_RESET\n#define __GPIOH_CLK_DISABLE __HAL_RCC_GPIOH_CLK_DISABLE\n#define __GPIOH_CLK_ENABLE __HAL_RCC_GPIOH_CLK_ENABLE\n#define __GPIOH_CLK_SLEEP_DISABLE __HAL_RCC_GPIOH_CLK_SLEEP_DISABLE\n#define __GPIOH_CLK_SLEEP_ENABLE __HAL_RCC_GPIOH_CLK_SLEEP_ENABLE\n#define __GPIOH_FORCE_RESET __HAL_RCC_GPIOH_FORCE_RESET\n#define __GPIOH_RELEASE_RESET __HAL_RCC_GPIOH_RELEASE_RESET\n#define __I2C1_CLK_DISABLE __HAL_RCC_I2C1_CLK_DISABLE\n#define __I2C1_CLK_ENABLE __HAL_RCC_I2C1_CLK_ENABLE\n#define __I2C1_CLK_SLEEP_DISABLE __HAL_RCC_I2C1_CLK_SLEEP_DISABLE\n#define __I2C1_CLK_SLEEP_ENABLE __HAL_RCC_I2C1_CLK_SLEEP_ENABLE\n#define __I2C1_FORCE_RESET __HAL_RCC_I2C1_FORCE_RESET\n#define __I2C1_RELEASE_RESET __HAL_RCC_I2C1_RELEASE_RESET\n#define __I2C2_CLK_DISABLE __HAL_RCC_I2C2_CLK_DISABLE\n#define __I2C2_CLK_ENABLE __HAL_RCC_I2C2_CLK_ENABLE\n#define __I2C2_CLK_SLEEP_DISABLE __HAL_RCC_I2C2_CLK_SLEEP_DISABLE\n#define __I2C2_CLK_SLEEP_ENABLE __HAL_RCC_I2C2_CLK_SLEEP_ENABLE\n#define __I2C2_FORCE_RESET __HAL_RCC_I2C2_FORCE_RESET\n#define __I2C2_RELEASE_RESET __HAL_RCC_I2C2_RELEASE_RESET\n#define __I2C3_CLK_DISABLE __HAL_RCC_I2C3_CLK_DISABLE\n#define __I2C3_CLK_ENABLE __HAL_RCC_I2C3_CLK_ENABLE\n#define __I2C3_CLK_SLEEP_DISABLE __HAL_RCC_I2C3_CLK_SLEEP_DISABLE\n#define __I2C3_CLK_SLEEP_ENABLE __HAL_RCC_I2C3_CLK_SLEEP_ENABLE\n#define __I2C3_FORCE_RESET __HAL_RCC_I2C3_FORCE_RESET\n#define __I2C3_RELEASE_RESET __HAL_RCC_I2C3_RELEASE_RESET\n#define __LCD_CLK_DISABLE __HAL_RCC_LCD_CLK_DISABLE\n#define __LCD_CLK_ENABLE __HAL_RCC_LCD_CLK_ENABLE\n#define __LCD_CLK_SLEEP_DISABLE __HAL_RCC_LCD_CLK_SLEEP_DISABLE\n#define __LCD_CLK_SLEEP_ENABLE __HAL_RCC_LCD_CLK_SLEEP_ENABLE\n#define __LCD_FORCE_RESET __HAL_RCC_LCD_FORCE_RESET\n#define __LCD_RELEASE_RESET __HAL_RCC_LCD_RELEASE_RESET\n#define __LPTIM1_CLK_DISABLE __HAL_RCC_LPTIM1_CLK_DISABLE\n#define __LPTIM1_CLK_ENABLE __HAL_RCC_LPTIM1_CLK_ENABLE\n#define __LPTIM1_CLK_SLEEP_DISABLE __HAL_RCC_LPTIM1_CLK_SLEEP_DISABLE\n#define __LPTIM1_CLK_SLEEP_ENABLE __HAL_RCC_LPTIM1_CLK_SLEEP_ENABLE\n#define __LPTIM1_FORCE_RESET __HAL_RCC_LPTIM1_FORCE_RESET\n#define __LPTIM1_RELEASE_RESET __HAL_RCC_LPTIM1_RELEASE_RESET\n#define __LPTIM2_CLK_DISABLE __HAL_RCC_LPTIM2_CLK_DISABLE\n#define __LPTIM2_CLK_ENABLE __HAL_RCC_LPTIM2_CLK_ENABLE\n#define __LPTIM2_CLK_SLEEP_DISABLE __HAL_RCC_LPTIM2_CLK_SLEEP_DISABLE\n#define __LPTIM2_CLK_SLEEP_ENABLE __HAL_RCC_LPTIM2_CLK_SLEEP_ENABLE\n#define __LPTIM2_FORCE_RESET __HAL_RCC_LPTIM2_FORCE_RESET\n#define __LPTIM2_RELEASE_RESET __HAL_RCC_LPTIM2_RELEASE_RESET\n#define __LPUART1_CLK_DISABLE __HAL_RCC_LPUART1_CLK_DISABLE\n#define __LPUART1_CLK_ENABLE __HAL_RCC_LPUART1_CLK_ENABLE\n#define __LPUART1_CLK_SLEEP_DISABLE __HAL_RCC_LPUART1_CLK_SLEEP_DISABLE\n#define __LPUART1_CLK_SLEEP_ENABLE __HAL_RCC_LPUART1_CLK_SLEEP_ENABLE\n#define __LPUART1_FORCE_RESET __HAL_RCC_LPUART1_FORCE_RESET\n#define __LPUART1_RELEASE_RESET __HAL_RCC_LPUART1_RELEASE_RESET\n#define __OPAMP_CLK_DISABLE __HAL_RCC_OPAMP_CLK_DISABLE\n#define __OPAMP_CLK_ENABLE __HAL_RCC_OPAMP_CLK_ENABLE\n#define __OPAMP_CLK_SLEEP_DISABLE __HAL_RCC_OPAMP_CLK_SLEEP_DISABLE\n#define __OPAMP_CLK_SLEEP_ENABLE __HAL_RCC_OPAMP_CLK_SLEEP_ENABLE\n#define __OPAMP_FORCE_RESET __HAL_RCC_OPAMP_FORCE_RESET\n#define __OPAMP_RELEASE_RESET __HAL_RCC_OPAMP_RELEASE_RESET\n#define __OTGFS_CLK_DISABLE __HAL_RCC_OTGFS_CLK_DISABLE\n#define __OTGFS_CLK_ENABLE __HAL_RCC_OTGFS_CLK_ENABLE\n#define __OTGFS_CLK_SLEEP_DISABLE __HAL_RCC_OTGFS_CLK_SLEEP_DISABLE\n#define __OTGFS_CLK_SLEEP_ENABLE __HAL_RCC_OTGFS_CLK_SLEEP_ENABLE\n#define __OTGFS_FORCE_RESET __HAL_RCC_OTGFS_FORCE_RESET\n#define __OTGFS_RELEASE_RESET __HAL_RCC_OTGFS_RELEASE_RESET\n#define __PWR_CLK_DISABLE __HAL_RCC_PWR_CLK_DISABLE\n#define __PWR_CLK_ENABLE __HAL_RCC_PWR_CLK_ENABLE\n#define __PWR_CLK_SLEEP_DISABLE __HAL_RCC_PWR_CLK_SLEEP_DISABLE\n#define __PWR_CLK_SLEEP_ENABLE __HAL_RCC_PWR_CLK_SLEEP_ENABLE\n#define __PWR_FORCE_RESET __HAL_RCC_PWR_FORCE_RESET\n#define __PWR_RELEASE_RESET __HAL_RCC_PWR_RELEASE_RESET\n#define __QSPI_CLK_DISABLE __HAL_RCC_QSPI_CLK_DISABLE\n#define __QSPI_CLK_ENABLE __HAL_RCC_QSPI_CLK_ENABLE\n#define __QSPI_CLK_SLEEP_DISABLE __HAL_RCC_QSPI_CLK_SLEEP_DISABLE\n#define __QSPI_CLK_SLEEP_ENABLE __HAL_RCC_QSPI_CLK_SLEEP_ENABLE\n#define __QSPI_FORCE_RESET __HAL_RCC_QSPI_FORCE_RESET\n#define __QSPI_RELEASE_RESET __HAL_RCC_QSPI_RELEASE_RESET\n#define __RNG_CLK_DISABLE __HAL_RCC_RNG_CLK_DISABLE\n#define __RNG_CLK_ENABLE __HAL_RCC_RNG_CLK_ENABLE\n#define __RNG_CLK_SLEEP_DISABLE __HAL_RCC_RNG_CLK_SLEEP_DISABLE\n#define __RNG_CLK_SLEEP_ENABLE __HAL_RCC_RNG_CLK_SLEEP_ENABLE\n#define __RNG_FORCE_RESET __HAL_RCC_RNG_FORCE_RESET\n#define __RNG_RELEASE_RESET __HAL_RCC_RNG_RELEASE_RESET\n#define __SAI1_CLK_DISABLE __HAL_RCC_SAI1_CLK_DISABLE\n#define __SAI1_CLK_ENABLE __HAL_RCC_SAI1_CLK_ENABLE\n#define __SAI1_CLK_SLEEP_DISABLE __HAL_RCC_SAI1_CLK_SLEEP_DISABLE\n#define __SAI1_CLK_SLEEP_ENABLE __HAL_RCC_SAI1_CLK_SLEEP_ENABLE\n#define __SAI1_FORCE_RESET __HAL_RCC_SAI1_FORCE_RESET\n#define __SAI1_RELEASE_RESET __HAL_RCC_SAI1_RELEASE_RESET\n#define __SAI2_CLK_DISABLE __HAL_RCC_SAI2_CLK_DISABLE\n#define __SAI2_CLK_ENABLE __HAL_RCC_SAI2_CLK_ENABLE\n#define __SAI2_CLK_SLEEP_DISABLE __HAL_RCC_SAI2_CLK_SLEEP_DISABLE\n#define __SAI2_CLK_SLEEP_ENABLE __HAL_RCC_SAI2_CLK_SLEEP_ENABLE\n#define __SAI2_FORCE_RESET __HAL_RCC_SAI2_FORCE_RESET\n#define __SAI2_RELEASE_RESET __HAL_RCC_SAI2_RELEASE_RESET\n#define __SDIO_CLK_DISABLE __HAL_RCC_SDIO_CLK_DISABLE\n#define __SDIO_CLK_ENABLE __HAL_RCC_SDIO_CLK_ENABLE\n#define __SDMMC_CLK_DISABLE __HAL_RCC_SDMMC_CLK_DISABLE\n#define __SDMMC_CLK_ENABLE __HAL_RCC_SDMMC_CLK_ENABLE\n#define __SDMMC_CLK_SLEEP_DISABLE __HAL_RCC_SDMMC_CLK_SLEEP_DISABLE\n#define __SDMMC_CLK_SLEEP_ENABLE __HAL_RCC_SDMMC_CLK_SLEEP_ENABLE\n#define __SDMMC_FORCE_RESET __HAL_RCC_SDMMC_FORCE_RESET\n#define __SDMMC_RELEASE_RESET __HAL_RCC_SDMMC_RELEASE_RESET\n#define __SPI1_CLK_DISABLE __HAL_RCC_SPI1_CLK_DISABLE\n#define __SPI1_CLK_ENABLE __HAL_RCC_SPI1_CLK_ENABLE\n#define __SPI1_CLK_SLEEP_DISABLE __HAL_RCC_SPI1_CLK_SLEEP_DISABLE\n#define __SPI1_CLK_SLEEP_ENABLE __HAL_RCC_SPI1_CLK_SLEEP_ENABLE\n#define __SPI1_FORCE_RESET __HAL_RCC_SPI1_FORCE_RESET\n#define __SPI1_RELEASE_RESET __HAL_RCC_SPI1_RELEASE_RESET\n#define __SPI2_CLK_DISABLE __HAL_RCC_SPI2_CLK_DISABLE\n#define __SPI2_CLK_ENABLE __HAL_RCC_SPI2_CLK_ENABLE\n#define __SPI2_CLK_SLEEP_DISABLE __HAL_RCC_SPI2_CLK_SLEEP_DISABLE\n#define __SPI2_CLK_SLEEP_ENABLE __HAL_RCC_SPI2_CLK_SLEEP_ENABLE\n#define __SPI2_FORCE_RESET __HAL_RCC_SPI2_FORCE_RESET\n#define __SPI2_RELEASE_RESET __HAL_RCC_SPI2_RELEASE_RESET\n#define __SPI3_CLK_DISABLE __HAL_RCC_SPI3_CLK_DISABLE\n#define __SPI3_CLK_ENABLE __HAL_RCC_SPI3_CLK_ENABLE\n#define __SPI3_CLK_SLEEP_DISABLE __HAL_RCC_SPI3_CLK_SLEEP_DISABLE\n#define __SPI3_CLK_SLEEP_ENABLE __HAL_RCC_SPI3_CLK_SLEEP_ENABLE\n#define __SPI3_FORCE_RESET __HAL_RCC_SPI3_FORCE_RESET\n#define __SPI3_RELEASE_RESET __HAL_RCC_SPI3_RELEASE_RESET\n#define __SRAM_CLK_DISABLE __HAL_RCC_SRAM_CLK_DISABLE\n#define __SRAM_CLK_ENABLE __HAL_RCC_SRAM_CLK_ENABLE\n#define __SRAM1_CLK_SLEEP_DISABLE __HAL_RCC_SRAM1_CLK_SLEEP_DISABLE\n#define __SRAM1_CLK_SLEEP_ENABLE __HAL_RCC_SRAM1_CLK_SLEEP_ENABLE\n#define __SRAM2_CLK_SLEEP_DISABLE __HAL_RCC_SRAM2_CLK_SLEEP_DISABLE\n#define __SRAM2_CLK_SLEEP_ENABLE __HAL_RCC_SRAM2_CLK_SLEEP_ENABLE\n#define __SWPMI1_CLK_DISABLE __HAL_RCC_SWPMI1_CLK_DISABLE\n#define __SWPMI1_CLK_ENABLE __HAL_RCC_SWPMI1_CLK_ENABLE\n#define __SWPMI1_CLK_SLEEP_DISABLE __HAL_RCC_SWPMI1_CLK_SLEEP_DISABLE\n#define __SWPMI1_CLK_SLEEP_ENABLE __HAL_RCC_SWPMI1_CLK_SLEEP_ENABLE\n#define __SWPMI1_FORCE_RESET __HAL_RCC_SWPMI1_FORCE_RESET\n#define __SWPMI1_RELEASE_RESET __HAL_RCC_SWPMI1_RELEASE_RESET\n#define __SYSCFG_CLK_DISABLE __HAL_RCC_SYSCFG_CLK_DISABLE\n#define __SYSCFG_CLK_ENABLE __HAL_RCC_SYSCFG_CLK_ENABLE\n#define __SYSCFG_CLK_SLEEP_DISABLE __HAL_RCC_SYSCFG_CLK_SLEEP_DISABLE\n#define __SYSCFG_CLK_SLEEP_ENABLE __HAL_RCC_SYSCFG_CLK_SLEEP_ENABLE\n#define __SYSCFG_FORCE_RESET __HAL_RCC_SYSCFG_FORCE_RESET\n#define __SYSCFG_RELEASE_RESET __HAL_RCC_SYSCFG_RELEASE_RESET\n#define __TIM1_CLK_DISABLE __HAL_RCC_TIM1_CLK_DISABLE\n#define __TIM1_CLK_ENABLE __HAL_RCC_TIM1_CLK_ENABLE\n#define __TIM1_CLK_SLEEP_DISABLE __HAL_RCC_TIM1_CLK_SLEEP_DISABLE\n#define __TIM1_CLK_SLEEP_ENABLE __HAL_RCC_TIM1_CLK_SLEEP_ENABLE\n#define __TIM1_FORCE_RESET __HAL_RCC_TIM1_FORCE_RESET\n#define __TIM1_RELEASE_RESET __HAL_RCC_TIM1_RELEASE_RESET\n#define __TIM10_CLK_DISABLE __HAL_RCC_TIM10_CLK_DISABLE\n#define __TIM10_CLK_ENABLE __HAL_RCC_TIM10_CLK_ENABLE\n#define __TIM10_FORCE_RESET __HAL_RCC_TIM10_FORCE_RESET\n#define __TIM10_RELEASE_RESET __HAL_RCC_TIM10_RELEASE_RESET\n#define __TIM11_CLK_DISABLE __HAL_RCC_TIM11_CLK_DISABLE\n#define __TIM11_CLK_ENABLE __HAL_RCC_TIM11_CLK_ENABLE\n#define __TIM11_FORCE_RESET __HAL_RCC_TIM11_FORCE_RESET\n#define __TIM11_RELEASE_RESET __HAL_RCC_TIM11_RELEASE_RESET\n#define __TIM12_CLK_DISABLE __HAL_RCC_TIM12_CLK_DISABLE\n#define __TIM12_CLK_ENABLE __HAL_RCC_TIM12_CLK_ENABLE\n#define __TIM12_FORCE_RESET __HAL_RCC_TIM12_FORCE_RESET\n#define __TIM12_RELEASE_RESET __HAL_RCC_TIM12_RELEASE_RESET\n#define __TIM13_CLK_DISABLE __HAL_RCC_TIM13_CLK_DISABLE\n#define __TIM13_CLK_ENABLE __HAL_RCC_TIM13_CLK_ENABLE\n#define __TIM13_FORCE_RESET __HAL_RCC_TIM13_FORCE_RESET\n#define __TIM13_RELEASE_RESET __HAL_RCC_TIM13_RELEASE_RESET\n#define __TIM14_CLK_DISABLE __HAL_RCC_TIM14_CLK_DISABLE\n#define __TIM14_CLK_ENABLE __HAL_RCC_TIM14_CLK_ENABLE\n#define __TIM14_FORCE_RESET __HAL_RCC_TIM14_FORCE_RESET\n#define __TIM14_RELEASE_RESET __HAL_RCC_TIM14_RELEASE_RESET\n#define __TIM15_CLK_DISABLE __HAL_RCC_TIM15_CLK_DISABLE\n#define __TIM15_CLK_ENABLE __HAL_RCC_TIM15_CLK_ENABLE\n#define __TIM15_CLK_SLEEP_DISABLE __HAL_RCC_TIM15_CLK_SLEEP_DISABLE\n#define __TIM15_CLK_SLEEP_ENABLE __HAL_RCC_TIM15_CLK_SLEEP_ENABLE\n#define __TIM15_FORCE_RESET __HAL_RCC_TIM15_FORCE_RESET\n#define __TIM15_RELEASE_RESET __HAL_RCC_TIM15_RELEASE_RESET\n#define __TIM16_CLK_DISABLE __HAL_RCC_TIM16_CLK_DISABLE\n#define __TIM16_CLK_ENABLE __HAL_RCC_TIM16_CLK_ENABLE\n#define __TIM16_CLK_SLEEP_DISABLE __HAL_RCC_TIM16_CLK_SLEEP_DISABLE\n#define __TIM16_CLK_SLEEP_ENABLE __HAL_RCC_TIM16_CLK_SLEEP_ENABLE\n#define __TIM16_FORCE_RESET __HAL_RCC_TIM16_FORCE_RESET\n#define __TIM16_RELEASE_RESET __HAL_RCC_TIM16_RELEASE_RESET\n#define __TIM17_CLK_DISABLE __HAL_RCC_TIM17_CLK_DISABLE\n#define __TIM17_CLK_ENABLE __HAL_RCC_TIM17_CLK_ENABLE\n#define __TIM17_CLK_SLEEP_DISABLE __HAL_RCC_TIM17_CLK_SLEEP_DISABLE\n#define __TIM17_CLK_SLEEP_ENABLE __HAL_RCC_TIM17_CLK_SLEEP_ENABLE\n#define __TIM17_FORCE_RESET __HAL_RCC_TIM17_FORCE_RESET\n#define __TIM17_RELEASE_RESET __HAL_RCC_TIM17_RELEASE_RESET\n#define __TIM2_CLK_DISABLE __HAL_RCC_TIM2_CLK_DISABLE\n#define __TIM2_CLK_ENABLE __HAL_RCC_TIM2_CLK_ENABLE\n#define __TIM2_CLK_SLEEP_DISABLE __HAL_RCC_TIM2_CLK_SLEEP_DISABLE\n#define __TIM2_CLK_SLEEP_ENABLE __HAL_RCC_TIM2_CLK_SLEEP_ENABLE\n#define __TIM2_FORCE_RESET __HAL_RCC_TIM2_FORCE_RESET\n#define __TIM2_RELEASE_RESET __HAL_RCC_TIM2_RELEASE_RESET\n#define __TIM3_CLK_DISABLE __HAL_RCC_TIM3_CLK_DISABLE\n#define __TIM3_CLK_ENABLE __HAL_RCC_TIM3_CLK_ENABLE\n#define __TIM3_CLK_SLEEP_DISABLE __HAL_RCC_TIM3_CLK_SLEEP_DISABLE\n#define __TIM3_CLK_SLEEP_ENABLE __HAL_RCC_TIM3_CLK_SLEEP_ENABLE\n#define __TIM3_FORCE_RESET __HAL_RCC_TIM3_FORCE_RESET\n#define __TIM3_RELEASE_RESET __HAL_RCC_TIM3_RELEASE_RESET\n#define __TIM4_CLK_DISABLE __HAL_RCC_TIM4_CLK_DISABLE\n#define __TIM4_CLK_ENABLE __HAL_RCC_TIM4_CLK_ENABLE\n#define __TIM4_CLK_SLEEP_DISABLE __HAL_RCC_TIM4_CLK_SLEEP_DISABLE\n#define __TIM4_CLK_SLEEP_ENABLE __HAL_RCC_TIM4_CLK_SLEEP_ENABLE\n#define __TIM4_FORCE_RESET __HAL_RCC_TIM4_FORCE_RESET\n#define __TIM4_RELEASE_RESET __HAL_RCC_TIM4_RELEASE_RESET\n#define __TIM5_CLK_DISABLE __HAL_RCC_TIM5_CLK_DISABLE\n#define __TIM5_CLK_ENABLE __HAL_RCC_TIM5_CLK_ENABLE\n#define __TIM5_CLK_SLEEP_DISABLE __HAL_RCC_TIM5_CLK_SLEEP_DISABLE\n#define __TIM5_CLK_SLEEP_ENABLE __HAL_RCC_TIM5_CLK_SLEEP_ENABLE\n#define __TIM5_FORCE_RESET __HAL_RCC_TIM5_FORCE_RESET\n#define __TIM5_RELEASE_RESET __HAL_RCC_TIM5_RELEASE_RESET\n#define __TIM6_CLK_DISABLE __HAL_RCC_TIM6_CLK_DISABLE\n#define __TIM6_CLK_ENABLE __HAL_RCC_TIM6_CLK_ENABLE\n#define __TIM6_CLK_SLEEP_DISABLE __HAL_RCC_TIM6_CLK_SLEEP_DISABLE\n#define __TIM6_CLK_SLEEP_ENABLE __HAL_RCC_TIM6_CLK_SLEEP_ENABLE\n#define __TIM6_FORCE_RESET __HAL_RCC_TIM6_FORCE_RESET\n#define __TIM6_RELEASE_RESET __HAL_RCC_TIM6_RELEASE_RESET\n#define __TIM7_CLK_DISABLE __HAL_RCC_TIM7_CLK_DISABLE\n#define __TIM7_CLK_ENABLE __HAL_RCC_TIM7_CLK_ENABLE\n#define __TIM7_CLK_SLEEP_DISABLE __HAL_RCC_TIM7_CLK_SLEEP_DISABLE\n#define __TIM7_CLK_SLEEP_ENABLE __HAL_RCC_TIM7_CLK_SLEEP_ENABLE\n#define __TIM7_FORCE_RESET __HAL_RCC_TIM7_FORCE_RESET\n#define __TIM7_RELEASE_RESET __HAL_RCC_TIM7_RELEASE_RESET\n#define __TIM8_CLK_DISABLE __HAL_RCC_TIM8_CLK_DISABLE\n#define __TIM8_CLK_ENABLE __HAL_RCC_TIM8_CLK_ENABLE\n#define __TIM8_CLK_SLEEP_DISABLE __HAL_RCC_TIM8_CLK_SLEEP_DISABLE\n#define __TIM8_CLK_SLEEP_ENABLE __HAL_RCC_TIM8_CLK_SLEEP_ENABLE\n#define __TIM8_FORCE_RESET __HAL_RCC_TIM8_FORCE_RESET\n#define __TIM8_RELEASE_RESET __HAL_RCC_TIM8_RELEASE_RESET\n#define __TIM9_CLK_DISABLE __HAL_RCC_TIM9_CLK_DISABLE\n#define __TIM9_CLK_ENABLE __HAL_RCC_TIM9_CLK_ENABLE\n#define __TIM9_FORCE_RESET __HAL_RCC_TIM9_FORCE_RESET\n#define __TIM9_RELEASE_RESET __HAL_RCC_TIM9_RELEASE_RESET\n#define __TSC_CLK_DISABLE __HAL_RCC_TSC_CLK_DISABLE\n#define __TSC_CLK_ENABLE __HAL_RCC_TSC_CLK_ENABLE\n#define __TSC_CLK_SLEEP_DISABLE __HAL_RCC_TSC_CLK_SLEEP_DISABLE\n#define __TSC_CLK_SLEEP_ENABLE __HAL_RCC_TSC_CLK_SLEEP_ENABLE\n#define __TSC_FORCE_RESET __HAL_RCC_TSC_FORCE_RESET\n#define __TSC_RELEASE_RESET __HAL_RCC_TSC_RELEASE_RESET\n#define __UART4_CLK_DISABLE __HAL_RCC_UART4_CLK_DISABLE\n#define __UART4_CLK_ENABLE __HAL_RCC_UART4_CLK_ENABLE\n#define __UART4_CLK_SLEEP_DISABLE __HAL_RCC_UART4_CLK_SLEEP_DISABLE\n#define __UART4_CLK_SLEEP_ENABLE __HAL_RCC_UART4_CLK_SLEEP_ENABLE\n#define __UART4_FORCE_RESET __HAL_RCC_UART4_FORCE_RESET\n#define __UART4_RELEASE_RESET __HAL_RCC_UART4_RELEASE_RESET\n#define __UART5_CLK_DISABLE __HAL_RCC_UART5_CLK_DISABLE\n#define __UART5_CLK_ENABLE __HAL_RCC_UART5_CLK_ENABLE\n#define __UART5_CLK_SLEEP_DISABLE __HAL_RCC_UART5_CLK_SLEEP_DISABLE\n#define __UART5_CLK_SLEEP_ENABLE __HAL_RCC_UART5_CLK_SLEEP_ENABLE\n#define __UART5_FORCE_RESET __HAL_RCC_UART5_FORCE_RESET\n#define __UART5_RELEASE_RESET __HAL_RCC_UART5_RELEASE_RESET\n#define __USART1_CLK_DISABLE __HAL_RCC_USART1_CLK_DISABLE\n#define __USART1_CLK_ENABLE __HAL_RCC_USART1_CLK_ENABLE\n#define __USART1_CLK_SLEEP_DISABLE __HAL_RCC_USART1_CLK_SLEEP_DISABLE\n#define __USART1_CLK_SLEEP_ENABLE __HAL_RCC_USART1_CLK_SLEEP_ENABLE\n#define __USART1_FORCE_RESET __HAL_RCC_USART1_FORCE_RESET\n#define __USART1_RELEASE_RESET __HAL_RCC_USART1_RELEASE_RESET\n#define __USART2_CLK_DISABLE __HAL_RCC_USART2_CLK_DISABLE\n#define __USART2_CLK_ENABLE __HAL_RCC_USART2_CLK_ENABLE\n#define __USART2_CLK_SLEEP_DISABLE __HAL_RCC_USART2_CLK_SLEEP_DISABLE\n#define __USART2_CLK_SLEEP_ENABLE __HAL_RCC_USART2_CLK_SLEEP_ENABLE\n#define __USART2_FORCE_RESET __HAL_RCC_USART2_FORCE_RESET\n#define __USART2_RELEASE_RESET __HAL_RCC_USART2_RELEASE_RESET\n#define __USART3_CLK_DISABLE __HAL_RCC_USART3_CLK_DISABLE\n#define __USART3_CLK_ENABLE __HAL_RCC_USART3_CLK_ENABLE\n#define __USART3_CLK_SLEEP_DISABLE __HAL_RCC_USART3_CLK_SLEEP_DISABLE\n#define __USART3_CLK_SLEEP_ENABLE __HAL_RCC_USART3_CLK_SLEEP_ENABLE\n#define __USART3_FORCE_RESET __HAL_RCC_USART3_FORCE_RESET\n#define __USART3_RELEASE_RESET __HAL_RCC_USART3_RELEASE_RESET\n#define __USART4_CLK_DISABLE __HAL_RCC_UART4_CLK_DISABLE\n#define __USART4_CLK_ENABLE __HAL_RCC_UART4_CLK_ENABLE\n#define __USART4_CLK_SLEEP_ENABLE __HAL_RCC_UART4_CLK_SLEEP_ENABLE\n#define __USART4_CLK_SLEEP_DISABLE __HAL_RCC_UART4_CLK_SLEEP_DISABLE \n#define __USART4_FORCE_RESET __HAL_RCC_UART4_FORCE_RESET\n#define __USART4_RELEASE_RESET __HAL_RCC_UART4_RELEASE_RESET\n#define __USART5_CLK_DISABLE __HAL_RCC_UART5_CLK_DISABLE\n#define __USART5_CLK_ENABLE __HAL_RCC_UART5_CLK_ENABLE\n#define __USART5_CLK_SLEEP_ENABLE __HAL_RCC_UART5_CLK_SLEEP_ENABLE\n#define __USART5_CLK_SLEEP_DISABLE __HAL_RCC_UART5_CLK_SLEEP_DISABLE \n#define __USART5_FORCE_RESET __HAL_RCC_UART5_FORCE_RESET\n#define __USART5_RELEASE_RESET __HAL_RCC_UART5_RELEASE_RESET\n#define __USART7_CLK_DISABLE __HAL_RCC_UART7_CLK_DISABLE\n#define __USART7_CLK_ENABLE __HAL_RCC_UART7_CLK_ENABLE\n#define __USART7_FORCE_RESET __HAL_RCC_UART7_FORCE_RESET\n#define __USART7_RELEASE_RESET __HAL_RCC_UART7_RELEASE_RESET\n#define __USART8_CLK_DISABLE __HAL_RCC_UART8_CLK_DISABLE\n#define __USART8_CLK_ENABLE __HAL_RCC_UART8_CLK_ENABLE\n#define __USART8_FORCE_RESET __HAL_RCC_UART8_FORCE_RESET\n#define __USART8_RELEASE_RESET __HAL_RCC_UART8_RELEASE_RESET\n#define __USB_CLK_DISABLE __HAL_RCC_USB_CLK_DISABLE\n#define __USB_CLK_ENABLE __HAL_RCC_USB_CLK_ENABLE\n#define __USB_FORCE_RESET __HAL_RCC_USB_FORCE_RESET\n#define __USB_CLK_SLEEP_ENABLE __HAL_RCC_USB_CLK_SLEEP_ENABLE\n#define __USB_CLK_SLEEP_DISABLE __HAL_RCC_USB_CLK_SLEEP_DISABLE\n#define __USB_OTG_FS_CLK_DISABLE __HAL_RCC_USB_OTG_FS_CLK_DISABLE\n#define __USB_OTG_FS_CLK_ENABLE __HAL_RCC_USB_OTG_FS_CLK_ENABLE\n#define __USB_RELEASE_RESET __HAL_RCC_USB_RELEASE_RESET\n#define __WWDG_CLK_DISABLE __HAL_RCC_WWDG_CLK_DISABLE\n#define __WWDG_CLK_ENABLE __HAL_RCC_WWDG_CLK_ENABLE\n#define __WWDG_CLK_SLEEP_DISABLE __HAL_RCC_WWDG_CLK_SLEEP_DISABLE\n#define __WWDG_CLK_SLEEP_ENABLE __HAL_RCC_WWDG_CLK_SLEEP_ENABLE\n#define __WWDG_FORCE_RESET __HAL_RCC_WWDG_FORCE_RESET\n#define __WWDG_RELEASE_RESET __HAL_RCC_WWDG_RELEASE_RESET\n#define __TIM21_CLK_ENABLE __HAL_RCC_TIM21_CLK_ENABLE\n#define __TIM21_CLK_DISABLE __HAL_RCC_TIM21_CLK_DISABLE\n#define __TIM21_FORCE_RESET __HAL_RCC_TIM21_FORCE_RESET\n#define __TIM21_RELEASE_RESET __HAL_RCC_TIM21_RELEASE_RESET\n#define __TIM21_CLK_SLEEP_ENABLE __HAL_RCC_TIM21_CLK_SLEEP_ENABLE\n#define __TIM21_CLK_SLEEP_DISABLE __HAL_RCC_TIM21_CLK_SLEEP_DISABLE\n#define __TIM22_CLK_ENABLE __HAL_RCC_TIM22_CLK_ENABLE\n#define __TIM22_CLK_DISABLE __HAL_RCC_TIM22_CLK_DISABLE\n#define __TIM22_FORCE_RESET __HAL_RCC_TIM22_FORCE_RESET\n#define __TIM22_RELEASE_RESET __HAL_RCC_TIM22_RELEASE_RESET\n#define __TIM22_CLK_SLEEP_ENABLE __HAL_RCC_TIM22_CLK_SLEEP_ENABLE\n#define __TIM22_CLK_SLEEP_DISABLE __HAL_RCC_TIM22_CLK_SLEEP_DISABLE\n#define __CRS_CLK_DISABLE __HAL_RCC_CRS_CLK_DISABLE\n#define __CRS_CLK_ENABLE __HAL_RCC_CRS_CLK_ENABLE\n#define __CRS_CLK_SLEEP_DISABLE __HAL_RCC_CRS_CLK_SLEEP_DISABLE\n#define __CRS_CLK_SLEEP_ENABLE __HAL_RCC_CRS_CLK_SLEEP_ENABLE\n#define __CRS_FORCE_RESET __HAL_RCC_CRS_FORCE_RESET\n#define __CRS_RELEASE_RESET __HAL_RCC_CRS_RELEASE_RESET\n#define __RCC_BACKUPRESET_FORCE __HAL_RCC_BACKUPRESET_FORCE\n#define __RCC_BACKUPRESET_RELEASE __HAL_RCC_BACKUPRESET_RELEASE\n\n#define __USB_OTG_FS_FORCE_RESET __HAL_RCC_USB_OTG_FS_FORCE_RESET\n#define __USB_OTG_FS_RELEASE_RESET __HAL_RCC_USB_OTG_FS_RELEASE_RESET\n#define __USB_OTG_FS_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_FS_CLK_SLEEP_ENABLE\n#define __USB_OTG_FS_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_FS_CLK_SLEEP_DISABLE\n#define __USB_OTG_HS_CLK_DISABLE __HAL_RCC_USB_OTG_HS_CLK_DISABLE\n#define __USB_OTG_HS_CLK_ENABLE __HAL_RCC_USB_OTG_HS_CLK_ENABLE\n#define __USB_OTG_HS_ULPI_CLK_ENABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE\n#define __USB_OTG_HS_ULPI_CLK_DISABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_DISABLE \n#define __TIM9_CLK_SLEEP_ENABLE __HAL_RCC_TIM9_CLK_SLEEP_ENABLE\n#define __TIM9_CLK_SLEEP_DISABLE __HAL_RCC_TIM9_CLK_SLEEP_DISABLE \n#define __TIM10_CLK_SLEEP_ENABLE __HAL_RCC_TIM10_CLK_SLEEP_ENABLE\n#define __TIM10_CLK_SLEEP_DISABLE __HAL_RCC_TIM10_CLK_SLEEP_DISABLE \n#define __TIM11_CLK_SLEEP_ENABLE __HAL_RCC_TIM11_CLK_SLEEP_ENABLE\n#define __TIM11_CLK_SLEEP_DISABLE __HAL_RCC_TIM11_CLK_SLEEP_DISABLE \n#define __ETHMACPTP_CLK_SLEEP_ENABLE __HAL_RCC_ETHMACPTP_CLK_SLEEP_ENABLE\n#define __ETHMACPTP_CLK_SLEEP_DISABLE __HAL_RCC_ETHMACPTP_CLK_SLEEP_DISABLE\n#define __ETHMACPTP_CLK_ENABLE __HAL_RCC_ETHMACPTP_CLK_ENABLE\n#define __ETHMACPTP_CLK_DISABLE __HAL_RCC_ETHMACPTP_CLK_DISABLE \n#define __HASH_CLK_ENABLE __HAL_RCC_HASH_CLK_ENABLE\n#define __HASH_FORCE_RESET __HAL_RCC_HASH_FORCE_RESET\n#define __HASH_RELEASE_RESET __HAL_RCC_HASH_RELEASE_RESET\n#define __HASH_CLK_SLEEP_ENABLE __HAL_RCC_HASH_CLK_SLEEP_ENABLE\n#define __HASH_CLK_SLEEP_DISABLE __HAL_RCC_HASH_CLK_SLEEP_DISABLE\n#define __HASH_CLK_DISABLE __HAL_RCC_HASH_CLK_DISABLE \n#define __SPI5_CLK_ENABLE __HAL_RCC_SPI5_CLK_ENABLE\n#define __SPI5_CLK_DISABLE __HAL_RCC_SPI5_CLK_DISABLE\n#define __SPI5_FORCE_RESET __HAL_RCC_SPI5_FORCE_RESET\n#define __SPI5_RELEASE_RESET __HAL_RCC_SPI5_RELEASE_RESET\n#define __SPI5_CLK_SLEEP_ENABLE __HAL_RCC_SPI5_CLK_SLEEP_ENABLE\n#define __SPI5_CLK_SLEEP_DISABLE __HAL_RCC_SPI5_CLK_SLEEP_DISABLE \n#define __SPI6_CLK_ENABLE __HAL_RCC_SPI6_CLK_ENABLE\n#define __SPI6_CLK_DISABLE __HAL_RCC_SPI6_CLK_DISABLE\n#define __SPI6_FORCE_RESET __HAL_RCC_SPI6_FORCE_RESET\n#define __SPI6_RELEASE_RESET __HAL_RCC_SPI6_RELEASE_RESET\n#define __SPI6_CLK_SLEEP_ENABLE __HAL_RCC_SPI6_CLK_SLEEP_ENABLE\n#define __SPI6_CLK_SLEEP_DISABLE __HAL_RCC_SPI6_CLK_SLEEP_DISABLE \n#define __LTDC_CLK_ENABLE __HAL_RCC_LTDC_CLK_ENABLE\n#define __LTDC_CLK_DISABLE __HAL_RCC_LTDC_CLK_DISABLE\n#define __LTDC_FORCE_RESET __HAL_RCC_LTDC_FORCE_RESET\n#define __LTDC_RELEASE_RESET __HAL_RCC_LTDC_RELEASE_RESET\n#define __LTDC_CLK_SLEEP_ENABLE __HAL_RCC_LTDC_CLK_SLEEP_ENABLE \n#define __ETHMAC_CLK_SLEEP_ENABLE __HAL_RCC_ETHMAC_CLK_SLEEP_ENABLE\n#define __ETHMAC_CLK_SLEEP_DISABLE __HAL_RCC_ETHMAC_CLK_SLEEP_DISABLE \n#define __ETHMACTX_CLK_SLEEP_ENABLE __HAL_RCC_ETHMACTX_CLK_SLEEP_ENABLE\n#define __ETHMACTX_CLK_SLEEP_DISABLE __HAL_RCC_ETHMACTX_CLK_SLEEP_DISABLE \n#define __ETHMACRX_CLK_SLEEP_ENABLE __HAL_RCC_ETHMACRX_CLK_SLEEP_ENABLE\n#define __ETHMACRX_CLK_SLEEP_DISABLE __HAL_RCC_ETHMACRX_CLK_SLEEP_DISABLE \n#define __TIM12_CLK_SLEEP_ENABLE __HAL_RCC_TIM12_CLK_SLEEP_ENABLE\n#define __TIM12_CLK_SLEEP_DISABLE __HAL_RCC_TIM12_CLK_SLEEP_DISABLE \n#define __TIM13_CLK_SLEEP_ENABLE __HAL_RCC_TIM13_CLK_SLEEP_ENABLE\n#define __TIM13_CLK_SLEEP_DISABLE __HAL_RCC_TIM13_CLK_SLEEP_DISABLE \n#define __TIM14_CLK_SLEEP_ENABLE __HAL_RCC_TIM14_CLK_SLEEP_ENABLE\n#define __TIM14_CLK_SLEEP_DISABLE __HAL_RCC_TIM14_CLK_SLEEP_DISABLE \n#define __BKPSRAM_CLK_ENABLE __HAL_RCC_BKPSRAM_CLK_ENABLE\n#define __BKPSRAM_CLK_DISABLE __HAL_RCC_BKPSRAM_CLK_DISABLE\n#define __BKPSRAM_CLK_SLEEP_ENABLE __HAL_RCC_BKPSRAM_CLK_SLEEP_ENABLE\n#define __BKPSRAM_CLK_SLEEP_DISABLE __HAL_RCC_BKPSRAM_CLK_SLEEP_DISABLE \n#define __CCMDATARAMEN_CLK_ENABLE __HAL_RCC_CCMDATARAMEN_CLK_ENABLE\n#define __CCMDATARAMEN_CLK_DISABLE __HAL_RCC_CCMDATARAMEN_CLK_DISABLE \n#define __USART6_CLK_ENABLE __HAL_RCC_USART6_CLK_ENABLE\n#define __USART6_CLK_DISABLE __HAL_RCC_USART6_CLK_DISABLE\n#define __USART6_FORCE_RESET __HAL_RCC_USART6_FORCE_RESET\n#define __USART6_RELEASE_RESET __HAL_RCC_USART6_RELEASE_RESET\n#define __USART6_CLK_SLEEP_ENABLE __HAL_RCC_USART6_CLK_SLEEP_ENABLE\n#define __USART6_CLK_SLEEP_DISABLE __HAL_RCC_USART6_CLK_SLEEP_DISABLE \n#define __SPI4_CLK_ENABLE __HAL_RCC_SPI4_CLK_ENABLE\n#define __SPI4_CLK_DISABLE __HAL_RCC_SPI4_CLK_DISABLE\n#define __SPI4_FORCE_RESET __HAL_RCC_SPI4_FORCE_RESET\n#define __SPI4_RELEASE_RESET __HAL_RCC_SPI4_RELEASE_RESET\n#define __SPI4_CLK_SLEEP_ENABLE __HAL_RCC_SPI4_CLK_SLEEP_ENABLE\n#define __SPI4_CLK_SLEEP_DISABLE __HAL_RCC_SPI4_CLK_SLEEP_DISABLE \n#define __GPIOI_CLK_ENABLE __HAL_RCC_GPIOI_CLK_ENABLE\n#define __GPIOI_CLK_DISABLE __HAL_RCC_GPIOI_CLK_DISABLE\n#define __GPIOI_FORCE_RESET __HAL_RCC_GPIOI_FORCE_RESET\n#define __GPIOI_RELEASE_RESET __HAL_RCC_GPIOI_RELEASE_RESET\n#define __GPIOI_CLK_SLEEP_ENABLE __HAL_RCC_GPIOI_CLK_SLEEP_ENABLE\n#define __GPIOI_CLK_SLEEP_DISABLE __HAL_RCC_GPIOI_CLK_SLEEP_DISABLE \n#define __GPIOJ_CLK_ENABLE __HAL_RCC_GPIOJ_CLK_ENABLE\n#define __GPIOJ_CLK_DISABLE __HAL_RCC_GPIOJ_CLK_DISABLE\n#define __GPIOJ_FORCE_RESET __HAL_RCC_GPIOJ_FORCE_RESET\n#define __GPIOJ_RELEASE_RESET __HAL_RCC_GPIOJ_RELEASE_RESET\n#define __GPIOJ_CLK_SLEEP_ENABLE __HAL_RCC_GPIOJ_CLK_SLEEP_ENABLE\n#define __GPIOJ_CLK_SLEEP_DISABLE __HAL_RCC_GPIOJ_CLK_SLEEP_DISABLE \n#define __GPIOK_CLK_ENABLE __HAL_RCC_GPIOK_CLK_ENABLE\n#define __GPIOK_CLK_DISABLE __HAL_RCC_GPIOK_CLK_DISABLE\n#define __GPIOK_RELEASE_RESET __HAL_RCC_GPIOK_RELEASE_RESET\n#define __GPIOK_CLK_SLEEP_ENABLE __HAL_RCC_GPIOK_CLK_SLEEP_ENABLE\n#define __GPIOK_CLK_SLEEP_DISABLE __HAL_RCC_GPIOK_CLK_SLEEP_DISABLE \n#define __ETH_CLK_ENABLE __HAL_RCC_ETH_CLK_ENABLE\n#define __ETH_CLK_DISABLE __HAL_RCC_ETH_CLK_DISABLE \n#define __DCMI_CLK_ENABLE __HAL_RCC_DCMI_CLK_ENABLE\n#define __DCMI_CLK_DISABLE __HAL_RCC_DCMI_CLK_DISABLE\n#define __DCMI_FORCE_RESET __HAL_RCC_DCMI_FORCE_RESET\n#define __DCMI_RELEASE_RESET __HAL_RCC_DCMI_RELEASE_RESET\n#define __DCMI_CLK_SLEEP_ENABLE __HAL_RCC_DCMI_CLK_SLEEP_ENABLE\n#define __DCMI_CLK_SLEEP_DISABLE __HAL_RCC_DCMI_CLK_SLEEP_DISABLE \n#define __UART7_CLK_ENABLE __HAL_RCC_UART7_CLK_ENABLE\n#define __UART7_CLK_DISABLE __HAL_RCC_UART7_CLK_DISABLE\n#define __UART7_RELEASE_RESET __HAL_RCC_UART7_RELEASE_RESET\n#define __UART7_FORCE_RESET __HAL_RCC_UART7_FORCE_RESET\n#define __UART7_CLK_SLEEP_ENABLE __HAL_RCC_UART7_CLK_SLEEP_ENABLE\n#define __UART7_CLK_SLEEP_DISABLE __HAL_RCC_UART7_CLK_SLEEP_DISABLE \n#define __UART8_CLK_ENABLE __HAL_RCC_UART8_CLK_ENABLE\n#define __UART8_CLK_DISABLE __HAL_RCC_UART8_CLK_DISABLE\n#define __UART8_FORCE_RESET __HAL_RCC_UART8_FORCE_RESET\n#define __UART8_RELEASE_RESET __HAL_RCC_UART8_RELEASE_RESET\n#define __UART8_CLK_SLEEP_ENABLE __HAL_RCC_UART8_CLK_SLEEP_ENABLE\n#define __UART8_CLK_SLEEP_DISABLE __HAL_RCC_UART8_CLK_SLEEP_DISABLE \n#define __OTGHS_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE\n#define __OTGHS_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE\n#define __OTGHS_FORCE_RESET __HAL_RCC_USB_OTG_HS_FORCE_RESET\n#define __OTGHS_RELEASE_RESET __HAL_RCC_USB_OTG_HS_RELEASE_RESET \n#define __OTGHSULPI_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE\n#define __OTGHSULPI_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE\n#define __HAL_RCC_OTGHS_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE\n#define __HAL_RCC_OTGHS_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE\n#define __HAL_RCC_OTGHS_IS_CLK_SLEEP_ENABLED __HAL_RCC_USB_OTG_HS_IS_CLK_SLEEP_ENABLED\n#define __HAL_RCC_OTGHS_IS_CLK_SLEEP_DISABLED __HAL_RCC_USB_OTG_HS_IS_CLK_SLEEP_DISABLED\n#define __HAL_RCC_OTGHS_FORCE_RESET __HAL_RCC_USB_OTG_HS_FORCE_RESET\n#define __HAL_RCC_OTGHS_RELEASE_RESET __HAL_RCC_USB_OTG_HS_RELEASE_RESET \n#define __HAL_RCC_OTGHSULPI_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE\n#define __HAL_RCC_OTGHSULPI_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE \n#define __HAL_RCC_OTGHSULPI_IS_CLK_SLEEP_ENABLED __HAL_RCC_USB_OTG_HS_ULPI_IS_CLK_SLEEP_ENABLED\n#define __HAL_RCC_OTGHSULPI_IS_CLK_SLEEP_DISABLED __HAL_RCC_USB_OTG_HS_ULPI_IS_CLK_SLEEP_DISABLED \n#define __SRAM3_CLK_SLEEP_ENABLE __HAL_RCC_SRAM3_CLK_SLEEP_ENABLE \n#define __CAN2_CLK_SLEEP_ENABLE __HAL_RCC_CAN2_CLK_SLEEP_ENABLE\n#define __CAN2_CLK_SLEEP_DISABLE __HAL_RCC_CAN2_CLK_SLEEP_DISABLE \n#define __DAC_CLK_SLEEP_ENABLE __HAL_RCC_DAC_CLK_SLEEP_ENABLE\n#define __DAC_CLK_SLEEP_DISABLE __HAL_RCC_DAC_CLK_SLEEP_DISABLE \n#define __ADC2_CLK_SLEEP_ENABLE __HAL_RCC_ADC2_CLK_SLEEP_ENABLE\n#define __ADC2_CLK_SLEEP_DISABLE __HAL_RCC_ADC2_CLK_SLEEP_DISABLE \n#define __ADC3_CLK_SLEEP_ENABLE __HAL_RCC_ADC3_CLK_SLEEP_ENABLE\n#define __ADC3_CLK_SLEEP_DISABLE __HAL_RCC_ADC3_CLK_SLEEP_DISABLE \n#define __FSMC_FORCE_RESET __HAL_RCC_FSMC_FORCE_RESET\n#define __FSMC_RELEASE_RESET __HAL_RCC_FSMC_RELEASE_RESET\n#define __FSMC_CLK_SLEEP_ENABLE __HAL_RCC_FSMC_CLK_SLEEP_ENABLE\n#define __FSMC_CLK_SLEEP_DISABLE __HAL_RCC_FSMC_CLK_SLEEP_DISABLE \n#define __SDIO_FORCE_RESET __HAL_RCC_SDIO_FORCE_RESET\n#define __SDIO_RELEASE_RESET __HAL_RCC_SDIO_RELEASE_RESET\n#define __SDIO_CLK_SLEEP_DISABLE __HAL_RCC_SDIO_CLK_SLEEP_DISABLE\n#define __SDIO_CLK_SLEEP_ENABLE __HAL_RCC_SDIO_CLK_SLEEP_ENABLE \n#define __DMA2D_CLK_ENABLE __HAL_RCC_DMA2D_CLK_ENABLE\n#define __DMA2D_CLK_DISABLE __HAL_RCC_DMA2D_CLK_DISABLE\n#define __DMA2D_FORCE_RESET __HAL_RCC_DMA2D_FORCE_RESET\n#define __DMA2D_RELEASE_RESET __HAL_RCC_DMA2D_RELEASE_RESET\n#define __DMA2D_CLK_SLEEP_ENABLE __HAL_RCC_DMA2D_CLK_SLEEP_ENABLE\n#define __DMA2D_CLK_SLEEP_DISABLE __HAL_RCC_DMA2D_CLK_SLEEP_DISABLE\n\n/* alias define maintained for legacy */\n#define __HAL_RCC_OTGFS_FORCE_RESET __HAL_RCC_USB_OTG_FS_FORCE_RESET\n#define __HAL_RCC_OTGFS_RELEASE_RESET __HAL_RCC_USB_OTG_FS_RELEASE_RESET\n\n#define __ADC12_CLK_ENABLE __HAL_RCC_ADC12_CLK_ENABLE\n#define __ADC12_CLK_DISABLE __HAL_RCC_ADC12_CLK_DISABLE\n#define __ADC34_CLK_ENABLE __HAL_RCC_ADC34_CLK_ENABLE\n#define __ADC34_CLK_DISABLE __HAL_RCC_ADC34_CLK_DISABLE\n#define __DAC2_CLK_ENABLE __HAL_RCC_DAC2_CLK_ENABLE\n#define __DAC2_CLK_DISABLE __HAL_RCC_DAC2_CLK_DISABLE\n#define __TIM18_CLK_ENABLE __HAL_RCC_TIM18_CLK_ENABLE\n#define __TIM18_CLK_DISABLE __HAL_RCC_TIM18_CLK_DISABLE\n#define __TIM19_CLK_ENABLE __HAL_RCC_TIM19_CLK_ENABLE\n#define __TIM19_CLK_DISABLE __HAL_RCC_TIM19_CLK_DISABLE\n#define __TIM20_CLK_ENABLE __HAL_RCC_TIM20_CLK_ENABLE\n#define __TIM20_CLK_DISABLE __HAL_RCC_TIM20_CLK_DISABLE\n#define __HRTIM1_CLK_ENABLE __HAL_RCC_HRTIM1_CLK_ENABLE\n#define __HRTIM1_CLK_DISABLE __HAL_RCC_HRTIM1_CLK_DISABLE\n#define __SDADC1_CLK_ENABLE __HAL_RCC_SDADC1_CLK_ENABLE\n#define __SDADC2_CLK_ENABLE __HAL_RCC_SDADC2_CLK_ENABLE\n#define __SDADC3_CLK_ENABLE __HAL_RCC_SDADC3_CLK_ENABLE\n#define __SDADC1_CLK_DISABLE __HAL_RCC_SDADC1_CLK_DISABLE\n#define __SDADC2_CLK_DISABLE __HAL_RCC_SDADC2_CLK_DISABLE\n#define __SDADC3_CLK_DISABLE __HAL_RCC_SDADC3_CLK_DISABLE\n\n#define __ADC12_FORCE_RESET __HAL_RCC_ADC12_FORCE_RESET\n#define __ADC12_RELEASE_RESET __HAL_RCC_ADC12_RELEASE_RESET\n#define __ADC34_FORCE_RESET __HAL_RCC_ADC34_FORCE_RESET\n#define __ADC34_RELEASE_RESET __HAL_RCC_ADC34_RELEASE_RESET\n#define __DAC2_FORCE_RESET __HAL_RCC_DAC2_FORCE_RESET\n#define __DAC2_RELEASE_RESET __HAL_RCC_DAC2_RELEASE_RESET\n#define __TIM18_FORCE_RESET __HAL_RCC_TIM18_FORCE_RESET\n#define __TIM18_RELEASE_RESET __HAL_RCC_TIM18_RELEASE_RESET\n#define __TIM19_FORCE_RESET __HAL_RCC_TIM19_FORCE_RESET\n#define __TIM19_RELEASE_RESET __HAL_RCC_TIM19_RELEASE_RESET\n#define __TIM20_FORCE_RESET __HAL_RCC_TIM20_FORCE_RESET\n#define __TIM20_RELEASE_RESET __HAL_RCC_TIM20_RELEASE_RESET\n#define __HRTIM1_FORCE_RESET __HAL_RCC_HRTIM1_FORCE_RESET\n#define __HRTIM1_RELEASE_RESET __HAL_RCC_HRTIM1_RELEASE_RESET\n#define __SDADC1_FORCE_RESET __HAL_RCC_SDADC1_FORCE_RESET\n#define __SDADC2_FORCE_RESET __HAL_RCC_SDADC2_FORCE_RESET\n#define __SDADC3_FORCE_RESET __HAL_RCC_SDADC3_FORCE_RESET\n#define __SDADC1_RELEASE_RESET __HAL_RCC_SDADC1_RELEASE_RESET\n#define __SDADC2_RELEASE_RESET __HAL_RCC_SDADC2_RELEASE_RESET\n#define __SDADC3_RELEASE_RESET __HAL_RCC_SDADC3_RELEASE_RESET\n\n#define __ADC1_IS_CLK_ENABLED __HAL_RCC_ADC1_IS_CLK_ENABLED\n#define __ADC1_IS_CLK_DISABLED __HAL_RCC_ADC1_IS_CLK_DISABLED\n#define __ADC12_IS_CLK_ENABLED __HAL_RCC_ADC12_IS_CLK_ENABLED\n#define __ADC12_IS_CLK_DISABLED __HAL_RCC_ADC12_IS_CLK_DISABLED\n#define __ADC34_IS_CLK_ENABLED __HAL_RCC_ADC34_IS_CLK_ENABLED\n#define __ADC34_IS_CLK_DISABLED __HAL_RCC_ADC34_IS_CLK_DISABLED\n#define __CEC_IS_CLK_ENABLED __HAL_RCC_CEC_IS_CLK_ENABLED\n#define __CEC_IS_CLK_DISABLED __HAL_RCC_CEC_IS_CLK_DISABLED\n#define __CRC_IS_CLK_ENABLED __HAL_RCC_CRC_IS_CLK_ENABLED\n#define __CRC_IS_CLK_DISABLED __HAL_RCC_CRC_IS_CLK_DISABLED\n#define __DAC1_IS_CLK_ENABLED __HAL_RCC_DAC1_IS_CLK_ENABLED\n#define __DAC1_IS_CLK_DISABLED __HAL_RCC_DAC1_IS_CLK_DISABLED\n#define __DAC2_IS_CLK_ENABLED __HAL_RCC_DAC2_IS_CLK_ENABLED\n#define __DAC2_IS_CLK_DISABLED __HAL_RCC_DAC2_IS_CLK_DISABLED\n#define __DMA1_IS_CLK_ENABLED __HAL_RCC_DMA1_IS_CLK_ENABLED\n#define __DMA1_IS_CLK_DISABLED __HAL_RCC_DMA1_IS_CLK_DISABLED\n#define __DMA2_IS_CLK_ENABLED __HAL_RCC_DMA2_IS_CLK_ENABLED\n#define __DMA2_IS_CLK_DISABLED __HAL_RCC_DMA2_IS_CLK_DISABLED\n#define __FLITF_IS_CLK_ENABLED __HAL_RCC_FLITF_IS_CLK_ENABLED\n#define __FLITF_IS_CLK_DISABLED __HAL_RCC_FLITF_IS_CLK_DISABLED\n#define __FMC_IS_CLK_ENABLED __HAL_RCC_FMC_IS_CLK_ENABLED\n#define __FMC_IS_CLK_DISABLED __HAL_RCC_FMC_IS_CLK_DISABLED\n#define __GPIOA_IS_CLK_ENABLED __HAL_RCC_GPIOA_IS_CLK_ENABLED\n#define __GPIOA_IS_CLK_DISABLED __HAL_RCC_GPIOA_IS_CLK_DISABLED\n#define __GPIOB_IS_CLK_ENABLED __HAL_RCC_GPIOB_IS_CLK_ENABLED\n#define __GPIOB_IS_CLK_DISABLED __HAL_RCC_GPIOB_IS_CLK_DISABLED\n#define __GPIOC_IS_CLK_ENABLED __HAL_RCC_GPIOC_IS_CLK_ENABLED\n#define __GPIOC_IS_CLK_DISABLED __HAL_RCC_GPIOC_IS_CLK_DISABLED\n#define __GPIOD_IS_CLK_ENABLED __HAL_RCC_GPIOD_IS_CLK_ENABLED\n#define __GPIOD_IS_CLK_DISABLED __HAL_RCC_GPIOD_IS_CLK_DISABLED\n#define __GPIOE_IS_CLK_ENABLED __HAL_RCC_GPIOE_IS_CLK_ENABLED\n#define __GPIOE_IS_CLK_DISABLED __HAL_RCC_GPIOE_IS_CLK_DISABLED\n#define __GPIOF_IS_CLK_ENABLED __HAL_RCC_GPIOF_IS_CLK_ENABLED\n#define __GPIOF_IS_CLK_DISABLED __HAL_RCC_GPIOF_IS_CLK_DISABLED\n#define __GPIOG_IS_CLK_ENABLED __HAL_RCC_GPIOG_IS_CLK_ENABLED\n#define __GPIOG_IS_CLK_DISABLED __HAL_RCC_GPIOG_IS_CLK_DISABLED\n#define __GPIOH_IS_CLK_ENABLED __HAL_RCC_GPIOH_IS_CLK_ENABLED\n#define __GPIOH_IS_CLK_DISABLED __HAL_RCC_GPIOH_IS_CLK_DISABLED\n#define __HRTIM1_IS_CLK_ENABLED __HAL_RCC_HRTIM1_IS_CLK_ENABLED\n#define __HRTIM1_IS_CLK_DISABLED __HAL_RCC_HRTIM1_IS_CLK_DISABLED\n#define __I2C1_IS_CLK_ENABLED __HAL_RCC_I2C1_IS_CLK_ENABLED\n#define __I2C1_IS_CLK_DISABLED __HAL_RCC_I2C1_IS_CLK_DISABLED\n#define __I2C2_IS_CLK_ENABLED __HAL_RCC_I2C2_IS_CLK_ENABLED\n#define __I2C2_IS_CLK_DISABLED __HAL_RCC_I2C2_IS_CLK_DISABLED\n#define __I2C3_IS_CLK_ENABLED __HAL_RCC_I2C3_IS_CLK_ENABLED\n#define __I2C3_IS_CLK_DISABLED __HAL_RCC_I2C3_IS_CLK_DISABLED\n#define __PWR_IS_CLK_ENABLED __HAL_RCC_PWR_IS_CLK_ENABLED\n#define __PWR_IS_CLK_DISABLED __HAL_RCC_PWR_IS_CLK_DISABLED\n#define __SYSCFG_IS_CLK_ENABLED __HAL_RCC_SYSCFG_IS_CLK_ENABLED\n#define __SYSCFG_IS_CLK_DISABLED __HAL_RCC_SYSCFG_IS_CLK_DISABLED\n#define __SPI1_IS_CLK_ENABLED __HAL_RCC_SPI1_IS_CLK_ENABLED\n#define __SPI1_IS_CLK_DISABLED __HAL_RCC_SPI1_IS_CLK_DISABLED\n#define __SPI2_IS_CLK_ENABLED __HAL_RCC_SPI2_IS_CLK_ENABLED\n#define __SPI2_IS_CLK_DISABLED __HAL_RCC_SPI2_IS_CLK_DISABLED\n#define __SPI3_IS_CLK_ENABLED __HAL_RCC_SPI3_IS_CLK_ENABLED\n#define __SPI3_IS_CLK_DISABLED __HAL_RCC_SPI3_IS_CLK_DISABLED\n#define __SPI4_IS_CLK_ENABLED __HAL_RCC_SPI4_IS_CLK_ENABLED\n#define __SPI4_IS_CLK_DISABLED __HAL_RCC_SPI4_IS_CLK_DISABLED\n#define __SDADC1_IS_CLK_ENABLED __HAL_RCC_SDADC1_IS_CLK_ENABLED\n#define __SDADC1_IS_CLK_DISABLED __HAL_RCC_SDADC1_IS_CLK_DISABLED\n#define __SDADC2_IS_CLK_ENABLED __HAL_RCC_SDADC2_IS_CLK_ENABLED\n#define __SDADC2_IS_CLK_DISABLED __HAL_RCC_SDADC2_IS_CLK_DISABLED\n#define __SDADC3_IS_CLK_ENABLED __HAL_RCC_SDADC3_IS_CLK_ENABLED\n#define __SDADC3_IS_CLK_DISABLED __HAL_RCC_SDADC3_IS_CLK_DISABLED\n#define __SRAM_IS_CLK_ENABLED __HAL_RCC_SRAM_IS_CLK_ENABLED\n#define __SRAM_IS_CLK_DISABLED __HAL_RCC_SRAM_IS_CLK_DISABLED\n#define __TIM1_IS_CLK_ENABLED __HAL_RCC_TIM1_IS_CLK_ENABLED\n#define __TIM1_IS_CLK_DISABLED __HAL_RCC_TIM1_IS_CLK_DISABLED\n#define __TIM2_IS_CLK_ENABLED __HAL_RCC_TIM2_IS_CLK_ENABLED\n#define __TIM2_IS_CLK_DISABLED __HAL_RCC_TIM2_IS_CLK_DISABLED\n#define __TIM3_IS_CLK_ENABLED __HAL_RCC_TIM3_IS_CLK_ENABLED\n#define __TIM3_IS_CLK_DISABLED __HAL_RCC_TIM3_IS_CLK_DISABLED\n#define __TIM4_IS_CLK_ENABLED __HAL_RCC_TIM4_IS_CLK_ENABLED\n#define __TIM4_IS_CLK_DISABLED __HAL_RCC_TIM4_IS_CLK_DISABLED\n#define __TIM5_IS_CLK_ENABLED __HAL_RCC_TIM5_IS_CLK_ENABLED\n#define __TIM5_IS_CLK_DISABLED __HAL_RCC_TIM5_IS_CLK_DISABLED\n#define __TIM6_IS_CLK_ENABLED __HAL_RCC_TIM6_IS_CLK_ENABLED\n#define __TIM6_IS_CLK_DISABLED __HAL_RCC_TIM6_IS_CLK_DISABLED\n#define __TIM7_IS_CLK_ENABLED __HAL_RCC_TIM7_IS_CLK_ENABLED\n#define __TIM7_IS_CLK_DISABLED __HAL_RCC_TIM7_IS_CLK_DISABLED\n#define __TIM8_IS_CLK_ENABLED __HAL_RCC_TIM8_IS_CLK_ENABLED\n#define __TIM8_IS_CLK_DISABLED __HAL_RCC_TIM8_IS_CLK_DISABLED\n#define __TIM12_IS_CLK_ENABLED __HAL_RCC_TIM12_IS_CLK_ENABLED\n#define __TIM12_IS_CLK_DISABLED __HAL_RCC_TIM12_IS_CLK_DISABLED\n#define __TIM13_IS_CLK_ENABLED __HAL_RCC_TIM13_IS_CLK_ENABLED\n#define __TIM13_IS_CLK_DISABLED __HAL_RCC_TIM13_IS_CLK_DISABLED\n#define __TIM14_IS_CLK_ENABLED __HAL_RCC_TIM14_IS_CLK_ENABLED\n#define __TIM14_IS_CLK_DISABLED __HAL_RCC_TIM14_IS_CLK_DISABLED\n#define __TIM15_IS_CLK_ENABLED __HAL_RCC_TIM15_IS_CLK_ENABLED\n#define __TIM15_IS_CLK_DISABLED __HAL_RCC_TIM15_IS_CLK_DISABLED\n#define __TIM16_IS_CLK_ENABLED __HAL_RCC_TIM16_IS_CLK_ENABLED\n#define __TIM16_IS_CLK_DISABLED __HAL_RCC_TIM16_IS_CLK_DISABLED\n#define __TIM17_IS_CLK_ENABLED __HAL_RCC_TIM17_IS_CLK_ENABLED\n#define __TIM17_IS_CLK_DISABLED __HAL_RCC_TIM17_IS_CLK_DISABLED\n#define __TIM18_IS_CLK_ENABLED __HAL_RCC_TIM18_IS_CLK_ENABLED\n#define __TIM18_IS_CLK_DISABLED __HAL_RCC_TIM18_IS_CLK_DISABLED\n#define __TIM19_IS_CLK_ENABLED __HAL_RCC_TIM19_IS_CLK_ENABLED\n#define __TIM19_IS_CLK_DISABLED __HAL_RCC_TIM19_IS_CLK_DISABLED\n#define __TIM20_IS_CLK_ENABLED __HAL_RCC_TIM20_IS_CLK_ENABLED\n#define __TIM20_IS_CLK_DISABLED __HAL_RCC_TIM20_IS_CLK_DISABLED\n#define __TSC_IS_CLK_ENABLED __HAL_RCC_TSC_IS_CLK_ENABLED\n#define __TSC_IS_CLK_DISABLED __HAL_RCC_TSC_IS_CLK_DISABLED\n#define __UART4_IS_CLK_ENABLED __HAL_RCC_UART4_IS_CLK_ENABLED\n#define __UART4_IS_CLK_DISABLED __HAL_RCC_UART4_IS_CLK_DISABLED\n#define __UART5_IS_CLK_ENABLED __HAL_RCC_UART5_IS_CLK_ENABLED\n#define __UART5_IS_CLK_DISABLED __HAL_RCC_UART5_IS_CLK_DISABLED\n#define __USART1_IS_CLK_ENABLED __HAL_RCC_USART1_IS_CLK_ENABLED\n#define __USART1_IS_CLK_DISABLED __HAL_RCC_USART1_IS_CLK_DISABLED\n#define __USART2_IS_CLK_ENABLED __HAL_RCC_USART2_IS_CLK_ENABLED\n#define __USART2_IS_CLK_DISABLED __HAL_RCC_USART2_IS_CLK_DISABLED\n#define __USART3_IS_CLK_ENABLED __HAL_RCC_USART3_IS_CLK_ENABLED\n#define __USART3_IS_CLK_DISABLED __HAL_RCC_USART3_IS_CLK_DISABLED\n#define __USB_IS_CLK_ENABLED __HAL_RCC_USB_IS_CLK_ENABLED\n#define __USB_IS_CLK_DISABLED __HAL_RCC_USB_IS_CLK_DISABLED\n#define __WWDG_IS_CLK_ENABLED __HAL_RCC_WWDG_IS_CLK_ENABLED\n#define __WWDG_IS_CLK_DISABLED __HAL_RCC_WWDG_IS_CLK_DISABLED\n\n#if defined(STM32F4)\n#define __HAL_RCC_SDMMC1_FORCE_RESET __HAL_RCC_SDIO_FORCE_RESET\n#define __HAL_RCC_SDMMC1_RELEASE_RESET __HAL_RCC_SDIO_RELEASE_RESET\n#define __HAL_RCC_SDMMC1_CLK_SLEEP_ENABLE __HAL_RCC_SDIO_CLK_SLEEP_ENABLE\n#define __HAL_RCC_SDMMC1_CLK_SLEEP_DISABLE __HAL_RCC_SDIO_CLK_SLEEP_DISABLE\n#define __HAL_RCC_SDMMC1_CLK_ENABLE __HAL_RCC_SDIO_CLK_ENABLE\n#define __HAL_RCC_SDMMC1_CLK_DISABLE __HAL_RCC_SDIO_CLK_DISABLE\n#define __HAL_RCC_SDMMC1_IS_CLK_ENABLED __HAL_RCC_SDIO_IS_CLK_ENABLED\n#define __HAL_RCC_SDMMC1_IS_CLK_DISABLED __HAL_RCC_SDIO_IS_CLK_DISABLED\n#define Sdmmc1ClockSelection SdioClockSelection\n#define RCC_PERIPHCLK_SDMMC1 RCC_PERIPHCLK_SDIO\n#define RCC_SDMMC1CLKSOURCE_CLK48 RCC_SDIOCLKSOURCE_CK48\n#define RCC_SDMMC1CLKSOURCE_SYSCLK RCC_SDIOCLKSOURCE_SYSCLK\n#define __HAL_RCC_SDMMC1_CONFIG __HAL_RCC_SDIO_CONFIG\n#define __HAL_RCC_GET_SDMMC1_SOURCE __HAL_RCC_GET_SDIO_SOURCE\n#endif\n\n#if defined(STM32F7) || defined(STM32L4)\n#define __HAL_RCC_SDIO_FORCE_RESET __HAL_RCC_SDMMC1_FORCE_RESET\n#define __HAL_RCC_SDIO_RELEASE_RESET __HAL_RCC_SDMMC1_RELEASE_RESET\n#define __HAL_RCC_SDIO_CLK_SLEEP_ENABLE __HAL_RCC_SDMMC1_CLK_SLEEP_ENABLE\n#define __HAL_RCC_SDIO_CLK_SLEEP_DISABLE __HAL_RCC_SDMMC1_CLK_SLEEP_DISABLE\n#define __HAL_RCC_SDIO_CLK_ENABLE __HAL_RCC_SDMMC1_CLK_ENABLE\n#define __HAL_RCC_SDIO_CLK_DISABLE __HAL_RCC_SDMMC1_CLK_DISABLE\n#define __HAL_RCC_SDIO_IS_CLK_ENABLED __HAL_RCC_SDMMC1_IS_CLK_ENABLED\n#define __HAL_RCC_SDIO_IS_CLK_DISABLED __HAL_RCC_SDMMC1_IS_CLK_DISABLED\n#define SdioClockSelection Sdmmc1ClockSelection\n#define RCC_PERIPHCLK_SDIO RCC_PERIPHCLK_SDMMC1\n#define __HAL_RCC_SDIO_CONFIG __HAL_RCC_SDMMC1_CONFIG\n#define __HAL_RCC_GET_SDIO_SOURCE __HAL_RCC_GET_SDMMC1_SOURCE\t\n#endif\n\n#if defined(STM32F7)\n#define RCC_SDIOCLKSOURCE_CLK48 RCC_SDMMC1CLKSOURCE_CLK48\n#define RCC_SDIOCLKSOURCE_SYSCLK RCC_SDMMC1CLKSOURCE_SYSCLK\n#endif\n\n#define __HAL_RCC_I2SCLK __HAL_RCC_I2S_CONFIG\n#define __HAL_RCC_I2SCLK_CONFIG __HAL_RCC_I2S_CONFIG\n\n#define __RCC_PLLSRC RCC_GET_PLL_OSCSOURCE\n\n#define IS_RCC_MSIRANGE IS_RCC_MSI_CLOCK_RANGE\n#define IS_RCC_RTCCLK_SOURCE IS_RCC_RTCCLKSOURCE\n#define IS_RCC_SYSCLK_DIV IS_RCC_HCLK\n#define IS_RCC_HCLK_DIV IS_RCC_PCLK\n#define IS_RCC_PERIPHCLK IS_RCC_PERIPHCLOCK\n\n#define RCC_IT_HSI14 RCC_IT_HSI14RDY\n\n#define RCC_IT_CSSLSE RCC_IT_LSECSS\n#define RCC_IT_CSSHSE RCC_IT_CSS\n\n#define RCC_PLLMUL_3 RCC_PLL_MUL3\n#define RCC_PLLMUL_4 RCC_PLL_MUL4\n#define RCC_PLLMUL_6 RCC_PLL_MUL6\n#define RCC_PLLMUL_8 RCC_PLL_MUL8\n#define RCC_PLLMUL_12 RCC_PLL_MUL12\n#define RCC_PLLMUL_16 RCC_PLL_MUL16\n#define RCC_PLLMUL_24 RCC_PLL_MUL24\n#define RCC_PLLMUL_32 RCC_PLL_MUL32\n#define RCC_PLLMUL_48 RCC_PLL_MUL48\n\n#define RCC_PLLDIV_2 RCC_PLL_DIV2\n#define RCC_PLLDIV_3 RCC_PLL_DIV3\n#define RCC_PLLDIV_4 RCC_PLL_DIV4\n\n#define IS_RCC_MCOSOURCE IS_RCC_MCO1SOURCE\n#define __HAL_RCC_MCO_CONFIG __HAL_RCC_MCO1_CONFIG\n#define RCC_MCO_NODIV RCC_MCODIV_1\n#define RCC_MCO_DIV1 RCC_MCODIV_1\n#define RCC_MCO_DIV2 RCC_MCODIV_2\n#define RCC_MCO_DIV4 RCC_MCODIV_4\n#define RCC_MCO_DIV8 RCC_MCODIV_8\n#define RCC_MCO_DIV16 RCC_MCODIV_16\n#define RCC_MCO_DIV32 RCC_MCODIV_32\n#define RCC_MCO_DIV64 RCC_MCODIV_64\n#define RCC_MCO_DIV128 RCC_MCODIV_128\n#define RCC_MCOSOURCE_NONE RCC_MCO1SOURCE_NOCLOCK\n#define RCC_MCOSOURCE_LSI RCC_MCO1SOURCE_LSI\n#define RCC_MCOSOURCE_LSE RCC_MCO1SOURCE_LSE\n#define RCC_MCOSOURCE_SYSCLK RCC_MCO1SOURCE_SYSCLK\n#define RCC_MCOSOURCE_HSI RCC_MCO1SOURCE_HSI\n#define RCC_MCOSOURCE_HSI14 RCC_MCO1SOURCE_HSI14\n#define RCC_MCOSOURCE_HSI48 RCC_MCO1SOURCE_HSI48\n#define RCC_MCOSOURCE_HSE RCC_MCO1SOURCE_HSE\n#define RCC_MCOSOURCE_PLLCLK_DIV1 RCC_MCO1SOURCE_PLLCLK\n#define RCC_MCOSOURCE_PLLCLK_NODIV RCC_MCO1SOURCE_PLLCLK\n#define RCC_MCOSOURCE_PLLCLK_DIV2 RCC_MCO1SOURCE_PLLCLK_DIV2\n\n#if defined(STM32WB) || defined(STM32G0)\n#else\n#define RCC_RTCCLKSOURCE_NONE RCC_RTCCLKSOURCE_NO_CLK\n#endif\n\n#define RCC_USBCLK_PLLSAI1 RCC_USBCLKSOURCE_PLLSAI1\n#define RCC_USBCLK_PLL RCC_USBCLKSOURCE_PLL\n#define RCC_USBCLK_MSI RCC_USBCLKSOURCE_MSI\n#define RCC_USBCLKSOURCE_PLLCLK RCC_USBCLKSOURCE_PLL\n#define RCC_USBPLLCLK_DIV1 RCC_USBCLKSOURCE_PLL\n#define RCC_USBPLLCLK_DIV1_5 RCC_USBCLKSOURCE_PLL_DIV1_5\n#define RCC_USBPLLCLK_DIV2 RCC_USBCLKSOURCE_PLL_DIV2\n#define RCC_USBPLLCLK_DIV3 RCC_USBCLKSOURCE_PLL_DIV3\n\n#define HSION_BitNumber RCC_HSION_BIT_NUMBER\n#define HSION_BITNUMBER RCC_HSION_BIT_NUMBER\n#define HSEON_BitNumber RCC_HSEON_BIT_NUMBER\n#define HSEON_BITNUMBER RCC_HSEON_BIT_NUMBER\n#define MSION_BITNUMBER RCC_MSION_BIT_NUMBER\n#define CSSON_BitNumber RCC_CSSON_BIT_NUMBER\n#define CSSON_BITNUMBER RCC_CSSON_BIT_NUMBER\n#define PLLON_BitNumber RCC_PLLON_BIT_NUMBER\n#define PLLON_BITNUMBER RCC_PLLON_BIT_NUMBER\n#define PLLI2SON_BitNumber RCC_PLLI2SON_BIT_NUMBER\n#define I2SSRC_BitNumber RCC_I2SSRC_BIT_NUMBER\n#define RTCEN_BitNumber RCC_RTCEN_BIT_NUMBER\n#define RTCEN_BITNUMBER RCC_RTCEN_BIT_NUMBER\n#define BDRST_BitNumber RCC_BDRST_BIT_NUMBER\n#define BDRST_BITNUMBER RCC_BDRST_BIT_NUMBER\n#define RTCRST_BITNUMBER RCC_RTCRST_BIT_NUMBER\n#define LSION_BitNumber RCC_LSION_BIT_NUMBER\n#define LSION_BITNUMBER RCC_LSION_BIT_NUMBER\n#define LSEON_BitNumber RCC_LSEON_BIT_NUMBER\n#define LSEON_BITNUMBER RCC_LSEON_BIT_NUMBER\n#define LSEBYP_BITNUMBER RCC_LSEBYP_BIT_NUMBER\n#define PLLSAION_BitNumber RCC_PLLSAION_BIT_NUMBER\n#define TIMPRE_BitNumber RCC_TIMPRE_BIT_NUMBER\n#define RMVF_BitNumber RCC_RMVF_BIT_NUMBER\n#define RMVF_BITNUMBER RCC_RMVF_BIT_NUMBER\n#define RCC_CR2_HSI14TRIM_BitNumber RCC_HSI14TRIM_BIT_NUMBER\n#define CR_BYTE2_ADDRESS RCC_CR_BYTE2_ADDRESS\n#define CIR_BYTE1_ADDRESS RCC_CIR_BYTE1_ADDRESS\n#define CIR_BYTE2_ADDRESS RCC_CIR_BYTE2_ADDRESS\n#define BDCR_BYTE0_ADDRESS RCC_BDCR_BYTE0_ADDRESS\n#define DBP_TIMEOUT_VALUE RCC_DBP_TIMEOUT_VALUE\n#define LSE_TIMEOUT_VALUE RCC_LSE_TIMEOUT_VALUE\n\n#define CR_HSION_BB RCC_CR_HSION_BB\n#define CR_CSSON_BB RCC_CR_CSSON_BB\n#define CR_PLLON_BB RCC_CR_PLLON_BB\n#define CR_PLLI2SON_BB RCC_CR_PLLI2SON_BB\n#define CR_MSION_BB RCC_CR_MSION_BB\n#define CSR_LSION_BB RCC_CSR_LSION_BB\n#define CSR_LSEON_BB RCC_CSR_LSEON_BB\n#define CSR_LSEBYP_BB RCC_CSR_LSEBYP_BB\n#define CSR_RTCEN_BB RCC_CSR_RTCEN_BB\n#define CSR_RTCRST_BB RCC_CSR_RTCRST_BB\n#define CFGR_I2SSRC_BB RCC_CFGR_I2SSRC_BB\n#define BDCR_RTCEN_BB RCC_BDCR_RTCEN_BB\n#define BDCR_BDRST_BB RCC_BDCR_BDRST_BB\n#define CR_HSEON_BB RCC_CR_HSEON_BB\n#define CSR_RMVF_BB RCC_CSR_RMVF_BB\n#define CR_PLLSAION_BB RCC_CR_PLLSAION_BB\n#define DCKCFGR_TIMPRE_BB RCC_DCKCFGR_TIMPRE_BB\n\n#define __HAL_RCC_CRS_ENABLE_FREQ_ERROR_COUNTER __HAL_RCC_CRS_FREQ_ERROR_COUNTER_ENABLE\n#define __HAL_RCC_CRS_DISABLE_FREQ_ERROR_COUNTER __HAL_RCC_CRS_FREQ_ERROR_COUNTER_DISABLE\n#define __HAL_RCC_CRS_ENABLE_AUTOMATIC_CALIB __HAL_RCC_CRS_AUTOMATIC_CALIB_ENABLE\n#define __HAL_RCC_CRS_DISABLE_AUTOMATIC_CALIB __HAL_RCC_CRS_AUTOMATIC_CALIB_DISABLE\n#define __HAL_RCC_CRS_CALCULATE_RELOADVALUE __HAL_RCC_CRS_RELOADVALUE_CALCULATE\n\n#define __HAL_RCC_GET_IT_SOURCE __HAL_RCC_GET_IT\n\n#define RCC_CRS_SYNCWARM RCC_CRS_SYNCWARN\n#define RCC_CRS_TRIMOV RCC_CRS_TRIMOVF\n\n#define RCC_PERIPHCLK_CK48 RCC_PERIPHCLK_CLK48\n#define RCC_CK48CLKSOURCE_PLLQ RCC_CLK48CLKSOURCE_PLLQ\n#define RCC_CK48CLKSOURCE_PLLSAIP RCC_CLK48CLKSOURCE_PLLSAIP\n#define RCC_CK48CLKSOURCE_PLLI2SQ RCC_CLK48CLKSOURCE_PLLI2SQ\n#define IS_RCC_CK48CLKSOURCE IS_RCC_CLK48CLKSOURCE\n#define RCC_SDIOCLKSOURCE_CK48 RCC_SDIOCLKSOURCE_CLK48\n\n#define __HAL_RCC_DFSDM_CLK_ENABLE __HAL_RCC_DFSDM1_CLK_ENABLE\n#define __HAL_RCC_DFSDM_CLK_DISABLE __HAL_RCC_DFSDM1_CLK_DISABLE\n#define __HAL_RCC_DFSDM_IS_CLK_ENABLED __HAL_RCC_DFSDM1_IS_CLK_ENABLED\n#define __HAL_RCC_DFSDM_IS_CLK_DISABLED __HAL_RCC_DFSDM1_IS_CLK_DISABLED\n#define __HAL_RCC_DFSDM_FORCE_RESET __HAL_RCC_DFSDM1_FORCE_RESET\n#define __HAL_RCC_DFSDM_RELEASE_RESET __HAL_RCC_DFSDM1_RELEASE_RESET\n#define __HAL_RCC_DFSDM_CLK_SLEEP_ENABLE __HAL_RCC_DFSDM1_CLK_SLEEP_ENABLE\n#define __HAL_RCC_DFSDM_CLK_SLEEP_DISABLE __HAL_RCC_DFSDM1_CLK_SLEEP_DISABLE\n#define __HAL_RCC_DFSDM_IS_CLK_SLEEP_ENABLED __HAL_RCC_DFSDM1_IS_CLK_SLEEP_ENABLED\n#define __HAL_RCC_DFSDM_IS_CLK_SLEEP_DISABLED __HAL_RCC_DFSDM1_IS_CLK_SLEEP_DISABLED\n#define DfsdmClockSelection Dfsdm1ClockSelection\n#define RCC_PERIPHCLK_DFSDM RCC_PERIPHCLK_DFSDM1\n#define RCC_DFSDMCLKSOURCE_PCLK RCC_DFSDM1CLKSOURCE_PCLK\n#define RCC_DFSDMCLKSOURCE_SYSCLK RCC_DFSDM1CLKSOURCE_SYSCLK\n#define __HAL_RCC_DFSDM_CONFIG __HAL_RCC_DFSDM1_CONFIG\n#define __HAL_RCC_GET_DFSDM_SOURCE __HAL_RCC_GET_DFSDM1_SOURCE\n/**\n * @}\n */\n\n/** @defgroup HAL_RNG_Aliased_Macros HAL RNG Aliased Macros maintained for legacy purpose\n * @{\n */\n#define HAL_RNG_ReadyCallback(__HANDLE__) HAL_RNG_ReadyDataCallback((__HANDLE__), uint32_t random32bit) \n\n/**\n * @}\n */\n \n/** @defgroup HAL_RTC_Aliased_Macros HAL RTC Aliased Macros maintained for legacy purpose\n * @{\n */\n#if defined (STM32G0)\n#else\n#define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG\n#endif\n#define __HAL_RTC_DISABLE_IT __HAL_RTC_EXTI_DISABLE_IT\n#define __HAL_RTC_ENABLE_IT __HAL_RTC_EXTI_ENABLE_IT\n\n#if defined (STM32F1)\n#define __HAL_RTC_EXTI_CLEAR_FLAG(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_CLEAR_FLAG()\n\n#define __HAL_RTC_EXTI_ENABLE_IT(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_ENABLE_IT()\n\n#define __HAL_RTC_EXTI_DISABLE_IT(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_DISABLE_IT()\n\n#define __HAL_RTC_EXTI_GET_FLAG(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_GET_FLAG()\n\n#define __HAL_RTC_EXTI_GENERATE_SWIT(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_GENERATE_SWIT()\n#else\n#define __HAL_RTC_EXTI_CLEAR_FLAG(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() : \\\n (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() : \\\n __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG()))\n#define __HAL_RTC_EXTI_ENABLE_IT(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_ENABLE_IT() : \\\n (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() : \\\n __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT()))\n#define __HAL_RTC_EXTI_DISABLE_IT(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_DISABLE_IT() : \\\n (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() : \\\n __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT()))\n#define __HAL_RTC_EXTI_GET_FLAG(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_GET_FLAG() : \\\n (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() : \\\n __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG()))\n#define __HAL_RTC_EXTI_GENERATE_SWIT(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() : \\\n (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() : \\\n __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT()))\n#endif /* STM32F1 */\n\n#define IS_ALARM IS_RTC_ALARM\n#define IS_ALARM_MASK IS_RTC_ALARM_MASK\n#define IS_TAMPER IS_RTC_TAMPER\n#define IS_TAMPER_ERASE_MODE IS_RTC_TAMPER_ERASE_MODE\n#define IS_TAMPER_FILTER IS_RTC_TAMPER_FILTER \n#define IS_TAMPER_INTERRUPT IS_RTC_TAMPER_INTERRUPT\n#define IS_TAMPER_MASKFLAG_STATE IS_RTC_TAMPER_MASKFLAG_STATE\n#define IS_TAMPER_PRECHARGE_DURATION IS_RTC_TAMPER_PRECHARGE_DURATION\n#define IS_TAMPER_PULLUP_STATE IS_RTC_TAMPER_PULLUP_STATE\n#define IS_TAMPER_SAMPLING_FREQ IS_RTC_TAMPER_SAMPLING_FREQ\n#define IS_TAMPER_TIMESTAMPONTAMPER_DETECTION IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION\n#define IS_TAMPER_TRIGGER IS_RTC_TAMPER_TRIGGER\n#define IS_WAKEUP_CLOCK IS_RTC_WAKEUP_CLOCK\n#define IS_WAKEUP_COUNTER IS_RTC_WAKEUP_COUNTER\n\n#define __RTC_WRITEPROTECTION_ENABLE __HAL_RTC_WRITEPROTECTION_ENABLE\n#define __RTC_WRITEPROTECTION_DISABLE __HAL_RTC_WRITEPROTECTION_DISABLE\n\n/**\n * @}\n */\n\n/** @defgroup HAL_SD_Aliased_Macros HAL SD Aliased Macros maintained for legacy purpose\n * @{\n */\n\n#define SD_OCR_CID_CSD_OVERWRIETE SD_OCR_CID_CSD_OVERWRITE\n#define SD_CMD_SD_APP_STAUS SD_CMD_SD_APP_STATUS\n\n#if defined(STM32F4)\n#define SD_SDMMC_DISABLED SD_SDIO_DISABLED\n#define SD_SDMMC_FUNCTION_BUSY SD_SDIO_FUNCTION_BUSY \n#define SD_SDMMC_FUNCTION_FAILED SD_SDIO_FUNCTION_FAILED \n#define SD_SDMMC_UNKNOWN_FUNCTION SD_SDIO_UNKNOWN_FUNCTION \n#define SD_CMD_SDMMC_SEN_OP_COND SD_CMD_SDIO_SEN_OP_COND \n#define SD_CMD_SDMMC_RW_DIRECT SD_CMD_SDIO_RW_DIRECT \n#define SD_CMD_SDMMC_RW_EXTENDED SD_CMD_SDIO_RW_EXTENDED \n#define __HAL_SD_SDMMC_ENABLE __HAL_SD_SDIO_ENABLE \n#define __HAL_SD_SDMMC_DISABLE __HAL_SD_SDIO_DISABLE \n#define __HAL_SD_SDMMC_DMA_ENABLE __HAL_SD_SDIO_DMA_ENABLE \n#define __HAL_SD_SDMMC_DMA_DISABLE __HAL_SD_SDIO_DMA_DISABL \n#define __HAL_SD_SDMMC_ENABLE_IT __HAL_SD_SDIO_ENABLE_IT \n#define __HAL_SD_SDMMC_DISABLE_IT __HAL_SD_SDIO_DISABLE_IT \n#define __HAL_SD_SDMMC_GET_FLAG __HAL_SD_SDIO_GET_FLAG \n#define __HAL_SD_SDMMC_CLEAR_FLAG __HAL_SD_SDIO_CLEAR_FLAG \n#define __HAL_SD_SDMMC_GET_IT __HAL_SD_SDIO_GET_IT \n#define __HAL_SD_SDMMC_CLEAR_IT __HAL_SD_SDIO_CLEAR_IT \n#define SDMMC_STATIC_FLAGS SDIO_STATIC_FLAGS\t \n#define SDMMC_CMD0TIMEOUT SDIO_CMD0TIMEOUT\t \n#define SD_SDMMC_SEND_IF_COND SD_SDIO_SEND_IF_COND\n/* alias CMSIS */\n#define SDMMC1_IRQn SDIO_IRQn\n#define SDMMC1_IRQHandler SDIO_IRQHandler\n#endif\n\n#if defined(STM32F7) || defined(STM32L4)\n#define SD_SDIO_DISABLED SD_SDMMC_DISABLED\n#define SD_SDIO_FUNCTION_BUSY SD_SDMMC_FUNCTION_BUSY \n#define SD_SDIO_FUNCTION_FAILED SD_SDMMC_FUNCTION_FAILED \n#define SD_SDIO_UNKNOWN_FUNCTION SD_SDMMC_UNKNOWN_FUNCTION\n#define SD_CMD_SDIO_SEN_OP_COND SD_CMD_SDMMC_SEN_OP_COND\n#define SD_CMD_SDIO_RW_DIRECT SD_CMD_SDMMC_RW_DIRECT\n#define SD_CMD_SDIO_RW_EXTENDED SD_CMD_SDMMC_RW_EXTENDED\n#define __HAL_SD_SDIO_ENABLE __HAL_SD_SDMMC_ENABLE\n#define __HAL_SD_SDIO_DISABLE __HAL_SD_SDMMC_DISABLE\n#define __HAL_SD_SDIO_DMA_ENABLE __HAL_SD_SDMMC_DMA_ENABLE\n#define __HAL_SD_SDIO_DMA_DISABL __HAL_SD_SDMMC_DMA_DISABLE\n#define __HAL_SD_SDIO_ENABLE_IT __HAL_SD_SDMMC_ENABLE_IT\n#define __HAL_SD_SDIO_DISABLE_IT __HAL_SD_SDMMC_DISABLE_IT\n#define __HAL_SD_SDIO_GET_FLAG __HAL_SD_SDMMC_GET_FLAG\n#define __HAL_SD_SDIO_CLEAR_FLAG __HAL_SD_SDMMC_CLEAR_FLAG\n#define __HAL_SD_SDIO_GET_IT __HAL_SD_SDMMC_GET_IT\n#define __HAL_SD_SDIO_CLEAR_IT __HAL_SD_SDMMC_CLEAR_IT\n#define SDIO_STATIC_FLAGS\t SDMMC_STATIC_FLAGS\n#define SDIO_CMD0TIMEOUT\t SDMMC_CMD0TIMEOUT\n#define SD_SDIO_SEND_IF_COND\t SD_SDMMC_SEND_IF_COND\n/* alias CMSIS for compatibilities */\n#define SDIO_IRQn SDMMC1_IRQn\n#define SDIO_IRQHandler SDMMC1_IRQHandler\n#endif\n/**\n * @}\n */\n\n/** @defgroup HAL_SMARTCARD_Aliased_Macros HAL SMARTCARD Aliased Macros maintained for legacy purpose\n * @{\n */\n\n#define __SMARTCARD_ENABLE_IT __HAL_SMARTCARD_ENABLE_IT\n#define __SMARTCARD_DISABLE_IT __HAL_SMARTCARD_DISABLE_IT\n#define __SMARTCARD_ENABLE __HAL_SMARTCARD_ENABLE\n#define __SMARTCARD_DISABLE __HAL_SMARTCARD_DISABLE\n#define __SMARTCARD_DMA_REQUEST_ENABLE __HAL_SMARTCARD_DMA_REQUEST_ENABLE\n#define __SMARTCARD_DMA_REQUEST_DISABLE __HAL_SMARTCARD_DMA_REQUEST_DISABLE\n\n#define __HAL_SMARTCARD_GETCLOCKSOURCE SMARTCARD_GETCLOCKSOURCE\n#define __SMARTCARD_GETCLOCKSOURCE SMARTCARD_GETCLOCKSOURCE\n\n#define IS_SMARTCARD_ONEBIT_SAMPLING IS_SMARTCARD_ONE_BIT_SAMPLE \n\n/**\n * @}\n */\n\n/** @defgroup HAL_SMBUS_Aliased_Macros HAL SMBUS Aliased Macros maintained for legacy purpose\n * @{\n */\n#define __HAL_SMBUS_RESET_CR1 SMBUS_RESET_CR1\n#define __HAL_SMBUS_RESET_CR2 SMBUS_RESET_CR2\n#define __HAL_SMBUS_GENERATE_START SMBUS_GENERATE_START\n#define __HAL_SMBUS_GET_ADDR_MATCH SMBUS_GET_ADDR_MATCH\n#define __HAL_SMBUS_GET_DIR SMBUS_GET_DIR\n#define __HAL_SMBUS_GET_STOP_MODE SMBUS_GET_STOP_MODE\n#define __HAL_SMBUS_GET_PEC_MODE SMBUS_GET_PEC_MODE\n#define __HAL_SMBUS_GET_ALERT_ENABLED SMBUS_GET_ALERT_ENABLED\n/**\n * @}\n */\n\n/** @defgroup HAL_SPI_Aliased_Macros HAL SPI Aliased Macros maintained for legacy purpose\n * @{\n */\n\n#define __HAL_SPI_1LINE_TX SPI_1LINE_TX\n#define __HAL_SPI_1LINE_RX SPI_1LINE_RX\n#define __HAL_SPI_RESET_CRC SPI_RESET_CRC\n\n/**\n * @}\n */\n \n/** @defgroup HAL_UART_Aliased_Macros HAL UART Aliased Macros maintained for legacy purpose\n * @{\n */\n\n#define __HAL_UART_GETCLOCKSOURCE UART_GETCLOCKSOURCE\n#define __HAL_UART_MASK_COMPUTATION UART_MASK_COMPUTATION\n#define __UART_GETCLOCKSOURCE UART_GETCLOCKSOURCE\n#define __UART_MASK_COMPUTATION UART_MASK_COMPUTATION\n\n#define IS_UART_WAKEUPMETHODE IS_UART_WAKEUPMETHOD\n\n#define IS_UART_ONEBIT_SAMPLE IS_UART_ONE_BIT_SAMPLE \n#define IS_UART_ONEBIT_SAMPLING IS_UART_ONE_BIT_SAMPLE \n\n/**\n * @}\n */\n\n\n/** @defgroup HAL_USART_Aliased_Macros HAL USART Aliased Macros maintained for legacy purpose\n * @{\n */\n\n#define __USART_ENABLE_IT __HAL_USART_ENABLE_IT\n#define __USART_DISABLE_IT __HAL_USART_DISABLE_IT\n#define __USART_ENABLE __HAL_USART_ENABLE\n#define __USART_DISABLE __HAL_USART_DISABLE\n\n#define __HAL_USART_GETCLOCKSOURCE USART_GETCLOCKSOURCE\n#define __USART_GETCLOCKSOURCE USART_GETCLOCKSOURCE\n\n/**\n * @}\n */\n\n/** @defgroup HAL_USB_Aliased_Macros HAL USB Aliased Macros maintained for legacy purpose\n * @{\n */\n#define USB_EXTI_LINE_WAKEUP USB_WAKEUP_EXTI_LINE\n\n#define USB_FS_EXTI_TRIGGER_RISING_EDGE USB_OTG_FS_WAKEUP_EXTI_RISING_EDGE\n#define USB_FS_EXTI_TRIGGER_FALLING_EDGE USB_OTG_FS_WAKEUP_EXTI_FALLING_EDGE\n#define USB_FS_EXTI_TRIGGER_BOTH_EDGE USB_OTG_FS_WAKEUP_EXTI_RISING_FALLING_EDGE\n#define USB_FS_EXTI_LINE_WAKEUP USB_OTG_FS_WAKEUP_EXTI_LINE\n\n#define USB_HS_EXTI_TRIGGER_RISING_EDGE USB_OTG_HS_WAKEUP_EXTI_RISING_EDGE\n#define USB_HS_EXTI_TRIGGER_FALLING_EDGE USB_OTG_HS_WAKEUP_EXTI_FALLING_EDGE\n#define USB_HS_EXTI_TRIGGER_BOTH_EDGE USB_OTG_HS_WAKEUP_EXTI_RISING_FALLING_EDGE\n#define USB_HS_EXTI_LINE_WAKEUP USB_OTG_HS_WAKEUP_EXTI_LINE\n\n#define __HAL_USB_EXTI_ENABLE_IT __HAL_USB_WAKEUP_EXTI_ENABLE_IT\n#define __HAL_USB_EXTI_DISABLE_IT __HAL_USB_WAKEUP_EXTI_DISABLE_IT\n#define __HAL_USB_EXTI_GET_FLAG __HAL_USB_WAKEUP_EXTI_GET_FLAG\n#define __HAL_USB_EXTI_CLEAR_FLAG __HAL_USB_WAKEUP_EXTI_CLEAR_FLAG\n#define __HAL_USB_EXTI_SET_RISING_EDGE_TRIGGER __HAL_USB_WAKEUP_EXTI_ENABLE_RISING_EDGE\n#define __HAL_USB_EXTI_SET_FALLING_EDGE_TRIGGER __HAL_USB_WAKEUP_EXTI_ENABLE_FALLING_EDGE\n#define __HAL_USB_EXTI_SET_FALLINGRISING_TRIGGER __HAL_USB_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE\n\n#define __HAL_USB_FS_EXTI_ENABLE_IT __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT\n#define __HAL_USB_FS_EXTI_DISABLE_IT __HAL_USB_OTG_FS_WAKEUP_EXTI_DISABLE_IT\n#define __HAL_USB_FS_EXTI_GET_FLAG __HAL_USB_OTG_FS_WAKEUP_EXTI_GET_FLAG\n#define __HAL_USB_FS_EXTI_CLEAR_FLAG __HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG\n#define __HAL_USB_FS_EXTI_SET_RISING_EGDE_TRIGGER __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE\n#define __HAL_USB_FS_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_FALLING_EDGE\n#define __HAL_USB_FS_EXTI_SET_FALLINGRISING_TRIGGER __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE\n#define __HAL_USB_FS_EXTI_GENERATE_SWIT __HAL_USB_OTG_FS_WAKEUP_EXTI_GENERATE_SWIT\n\n#define __HAL_USB_HS_EXTI_ENABLE_IT __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_IT\n#define __HAL_USB_HS_EXTI_DISABLE_IT __HAL_USB_OTG_HS_WAKEUP_EXTI_DISABLE_IT\n#define __HAL_USB_HS_EXTI_GET_FLAG __HAL_USB_OTG_HS_WAKEUP_EXTI_GET_FLAG\n#define __HAL_USB_HS_EXTI_CLEAR_FLAG __HAL_USB_OTG_HS_WAKEUP_EXTI_CLEAR_FLAG\n#define __HAL_USB_HS_EXTI_SET_RISING_EGDE_TRIGGER __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_EDGE\n#define __HAL_USB_HS_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_FALLING_EDGE\n#define __HAL_USB_HS_EXTI_SET_FALLINGRISING_TRIGGER __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE\n#define __HAL_USB_HS_EXTI_GENERATE_SWIT __HAL_USB_OTG_HS_WAKEUP_EXTI_GENERATE_SWIT\n\n#define HAL_PCD_ActiveRemoteWakeup HAL_PCD_ActivateRemoteWakeup\n#define HAL_PCD_DeActiveRemoteWakeup HAL_PCD_DeActivateRemoteWakeup\n\n#define HAL_PCD_SetTxFiFo HAL_PCDEx_SetTxFiFo\n#define HAL_PCD_SetRxFiFo HAL_PCDEx_SetRxFiFo\n/**\n * @}\n */\n\n/** @defgroup HAL_TIM_Aliased_Macros HAL TIM Aliased Macros maintained for legacy purpose\n * @{\n */\n#define __HAL_TIM_SetICPrescalerValue TIM_SET_ICPRESCALERVALUE\n#define __HAL_TIM_ResetICPrescalerValue TIM_RESET_ICPRESCALERVALUE\n\n#define TIM_GET_ITSTATUS __HAL_TIM_GET_IT_SOURCE\n#define TIM_GET_CLEAR_IT __HAL_TIM_CLEAR_IT\n\n#define __HAL_TIM_GET_ITSTATUS __HAL_TIM_GET_IT_SOURCE\n\n#define __HAL_TIM_DIRECTION_STATUS __HAL_TIM_IS_TIM_COUNTING_DOWN\n#define __HAL_TIM_PRESCALER __HAL_TIM_SET_PRESCALER\n#define __HAL_TIM_SetCounter __HAL_TIM_SET_COUNTER\n#define __HAL_TIM_GetCounter __HAL_TIM_GET_COUNTER\n#define __HAL_TIM_SetAutoreload __HAL_TIM_SET_AUTORELOAD\n#define __HAL_TIM_GetAutoreload __HAL_TIM_GET_AUTORELOAD\n#define __HAL_TIM_SetClockDivision __HAL_TIM_SET_CLOCKDIVISION\n#define __HAL_TIM_GetClockDivision __HAL_TIM_GET_CLOCKDIVISION\n#define __HAL_TIM_SetICPrescaler __HAL_TIM_SET_ICPRESCALER\n#define __HAL_TIM_GetICPrescaler __HAL_TIM_GET_ICPRESCALER\n#define __HAL_TIM_SetCompare __HAL_TIM_SET_COMPARE\n#define __HAL_TIM_GetCompare __HAL_TIM_GET_COMPARE\n\n#define TIM_BREAKINPUTSOURCE_DFSDM TIM_BREAKINPUTSOURCE_DFSDM1\n/**\n * @}\n */\n\n/** @defgroup HAL_ETH_Aliased_Macros HAL ETH Aliased Macros maintained for legacy purpose\n * @{\n */\n \n#define __HAL_ETH_EXTI_ENABLE_IT __HAL_ETH_WAKEUP_EXTI_ENABLE_IT\n#define __HAL_ETH_EXTI_DISABLE_IT __HAL_ETH_WAKEUP_EXTI_DISABLE_IT\n#define __HAL_ETH_EXTI_GET_FLAG __HAL_ETH_WAKEUP_EXTI_GET_FLAG\n#define __HAL_ETH_EXTI_CLEAR_FLAG __HAL_ETH_WAKEUP_EXTI_CLEAR_FLAG\n#define __HAL_ETH_EXTI_SET_RISING_EGDE_TRIGGER __HAL_ETH_WAKEUP_EXTI_ENABLE_RISING_EDGE_TRIGGER\n#define __HAL_ETH_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_ETH_WAKEUP_EXTI_ENABLE_FALLING_EDGE_TRIGGER\n#define __HAL_ETH_EXTI_SET_FALLINGRISING_TRIGGER __HAL_ETH_WAKEUP_EXTI_ENABLE_FALLINGRISING_TRIGGER\n\n#define ETH_PROMISCIOUSMODE_ENABLE ETH_PROMISCUOUS_MODE_ENABLE \n#define ETH_PROMISCIOUSMODE_DISABLE ETH_PROMISCUOUS_MODE_DISABLE\n#define IS_ETH_PROMISCIOUS_MODE IS_ETH_PROMISCUOUS_MODE\n/**\n * @}\n */\n\n/** @defgroup HAL_LTDC_Aliased_Macros HAL LTDC Aliased Macros maintained for legacy purpose\n * @{\n */\n#define __HAL_LTDC_LAYER LTDC_LAYER\n/**\n * @}\n */\n\n/** @defgroup HAL_SAI_Aliased_Macros HAL SAI Aliased Macros maintained for legacy purpose\n * @{\n */\n#define SAI_OUTPUTDRIVE_DISABLED SAI_OUTPUTDRIVE_DISABLE\n#define SAI_OUTPUTDRIVE_ENABLED SAI_OUTPUTDRIVE_ENABLE\n#define SAI_MASTERDIVIDER_ENABLED SAI_MASTERDIVIDER_ENABLE\n#define SAI_MASTERDIVIDER_DISABLED SAI_MASTERDIVIDER_DISABLE\n#define SAI_STREOMODE SAI_STEREOMODE\n#define SAI_FIFOStatus_Empty SAI_FIFOSTATUS_EMPTY\n#define SAI_FIFOStatus_Less1QuarterFull SAI_FIFOSTATUS_LESS1QUARTERFULL\n#define SAI_FIFOStatus_1QuarterFull SAI_FIFOSTATUS_1QUARTERFULL\n#define SAI_FIFOStatus_HalfFull SAI_FIFOSTATUS_HALFFULL\n#define SAI_FIFOStatus_3QuartersFull SAI_FIFOSTATUS_3QUARTERFULL\n#define SAI_FIFOStatus_Full SAI_FIFOSTATUS_FULL\n#define IS_SAI_BLOCK_MONO_STREO_MODE IS_SAI_BLOCK_MONO_STEREO_MODE\n#define SAI_SYNCHRONOUS_EXT SAI_SYNCHRONOUS_EXT_SAI1\n#define SAI_SYNCEXT_IN_ENABLE SAI_SYNCEXT_OUTBLOCKA_ENABLE\n/**\n * @}\n */\n\n\n/** @defgroup HAL_PPP_Aliased_Macros HAL PPP Aliased Macros maintained for legacy purpose\n * @{\n */\n \n/**\n * @}\n */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* ___STM32_HAL_LEGACY */\n\n/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\n\n", "meta": {"content_hash": "e2cf38a20efc64a259ee614b35523c11", "timestamp": "", "source": "github", "line_count": 3181, "max_line_length": 189, "avg_line_length": 55.5014146494813, "alnum_prop": 0.6491645426224866, "repo_name": "AubrCool/rt-thread", "id": "77647df28f19395359eced096e0cd88040347d2b", "size": "178654", "binary": false, "copies": "28", "ref": "refs/heads/master", "path": "bsp/stm32/libraries/STM32L0xx_HAL/STM32L0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "12839996"}, {"name": "Batchfile", "bytes": "186191"}, {"name": "C", "bytes": "615578916"}, {"name": "C++", "bytes": "7535608"}, {"name": "CMake", "bytes": "148026"}, {"name": "CSS", "bytes": "9978"}, {"name": "DIGITAL Command Language", "bytes": "13234"}, {"name": "GDB", "bytes": "11796"}, {"name": "HTML", "bytes": "5455013"}, {"name": "Lex", "bytes": "7026"}, {"name": "Logos", "bytes": "7078"}, {"name": "M4", "bytes": "17515"}, {"name": "Makefile", "bytes": "271627"}, {"name": "Module Management System", "bytes": "1548"}, {"name": "Objective-C", "bytes": "4110192"}, {"name": "Pawn", "bytes": "1427"}, {"name": "Perl", "bytes": "9520"}, {"name": "Python", "bytes": "1375160"}, {"name": "RPC", "bytes": "14162"}, {"name": "Rich Text Format", "bytes": "355402"}, {"name": "Roff", "bytes": "4486"}, {"name": "Ruby", "bytes": "869"}, {"name": "Shell", "bytes": "407723"}, {"name": "TeX", "bytes": "3113"}, {"name": "Yacc", "bytes": "16084"}]}} +{"text": "\ufeff//------------------------------------------------------------------------------\n// <auto-generated>\n// This code was generated by a tool.\n// Runtime Version:4.0.30319.18034\n//\n// Changes to this file may cause incorrect behavior and will be lost if\n// the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace Autumn.Mvc.Infrastructure.Resources {\n using System;\n \n \n /// <summary>\n /// A strongly-typed resource class, for looking up localized strings, etc.\n /// </summary>\n // This class was auto-generated by the StronglyTypedResourceBuilder\n // class via a tool like ResGen or Visual Studio.\n // To add or remove a member, edit your .ResX file then rerun ResGen\n // with the /str option, or rebuild your VS project.\n [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\n [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n internal class Strings {\n \n private static global::System.Resources.ResourceManager resourceMan;\n \n private static global::System.Globalization.CultureInfo resourceCulture;\n \n [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n internal Strings() {\n }\n \n /// <summary>\n /// Returns the cached ResourceManager instance used by this class.\n /// </summary>\n [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n internal static global::System.Resources.ResourceManager ResourceManager {\n get {\n if (object.ReferenceEquals(resourceMan, null)) {\n global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"Autumn.Mvc.Infrastructure.Resources.Strings\", typeof(Strings).Assembly);\n resourceMan = temp;\n }\n return resourceMan;\n }\n }\n \n /// <summary>\n /// Overrides the current thread's CurrentUICulture property for all\n /// resource lookups using this strongly typed resource class.\n /// </summary>\n [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n internal static global::System.Globalization.CultureInfo Culture {\n get {\n return resourceCulture;\n }\n set {\n resourceCulture = value;\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to <RSAKeyValue><Modulus>lKdHGicZnSE+8QOrCRxd2v2wTE0Kjdu5ur7kziv5SFVDe30O41ysr9exxws1VszFxwQNwvJYWp5JV0kJhWpycxiAqMYhZFyYy1Jk0pWJvCly6vic6IZNzm7Vgo4izu9kN1RcS9CgoOUTmCe1hjJz82XqkT36EUDn8Ssi6AfDS80=</Modulus><Exponent>AQAB</Exponent><P>0C4fajhXEzO+gqkt7TJWbqJCIlP4CTMz5i/l4EKwz+7JmB0Mhbu5dUimSYylci6KEwp7XK9cH22+Cxzzn1cWTw==</P><Q>tsy67q0EAwSM2eDO7nA2k2Mw7L+a8NXzrt/M0avGSMqZJ4sJ49PXDodSFryZX44MN3/t6xORZaHy6Bsk66ARIw==</Q><DP>XS1XqD5BUvnk+ixovvK51tjPCvhUWyHMx+mGVSLkapzxJCFUWoMUVhdHPkIyRvHnoPAfGPPwIq0G04iIzje3Zw==< [rest of string was truncated]";.\n /// </summary>\n internal static string RSAPrivateKey {\n get {\n return ResourceManager.GetString(\"RSAPrivateKey\", resourceCulture);\n }\n }\n \n /// <summary>\n /// Looks up a localized string similar to <RSAKeyValue><Modulus>lKdHGicZnSE+8QOrCRxd2v2wTE0Kjdu5ur7kziv5SFVDe30O41ysr9exxws1VszFxwQNwvJYWp5JV0kJhWpycxiAqMYhZFyYy1Jk0pWJvCly6vic6IZNzm7Vgo4izu9kN1RcS9CgoOUTmCe1hjJz82XqkT36EUDn8Ssi6AfDS80=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>.\n /// </summary>\n internal static string RSAPublicKey {\n get {\n return ResourceManager.GetString(\"RSAPublicKey\", resourceCulture);\n }\n }\n }\n}\n", "meta": {"content_hash": "293fb9b95230e124d394277790e20082", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 667, "avg_line_length": 52.55555555555556, "alnum_prop": 0.6553911205073996, "repo_name": "brschwalm/Autumn", "id": "8f81f2d123590a890ee0a56aa020479463126ddf", "size": "4259", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Infrastructure/Resources/Strings.Designer.cs", "mode": "33188", "license": "mit", "language": [{"name": "ASP", "bytes": "105"}, {"name": "C#", "bytes": "121864"}, {"name": "JavaScript", "bytes": "1640365"}, {"name": "PowerShell", "bytes": "69747"}, {"name": "Puppet", "bytes": "1877"}]}} +{"text": "\n\n \n/** @file\n *\n * @defgroup memory_pool_internal Memory Pool Internal\n * @{\n * @ingroup memory_pool\n *\n * @brief Memory pool internal definitions\n */\n \n#ifndef MEM_POOL_INTERNAL_H__\n#define MEM_POOL_INTERNAL_H__\n\n#define TX_BUF_SIZE 600u /**< TX buffer size in bytes. */\n#define RX_BUF_SIZE TX_BUF_SIZE /**< RX buffer size in bytes. */\n\n#define RX_BUF_QUEUE_SIZE 4u /**< RX buffer element size. */\n\n#endif // MEM_POOL_INTERNAL_H__\n \n/** @} */\n", "meta": {"content_hash": "9378dd5a12ddda705444777593cec84f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 71, "avg_line_length": 20.695652173913043, "alnum_prop": 0.6008403361344538, "repo_name": "arostm/mbed-os", "id": "92594915ac66ea81b9ea23f02a809a72058fc161", "size": "2528", "binary": false, "copies": "79", "ref": "refs/heads/master", "path": "targets/TARGET_NORDIC/TARGET_NRF5/TARGET_SDK11/libraries/hci/config/hci_mem_pool_internal.h", "mode": "33188", "license": "apache-2.0", "language": [{"name": "Assembly", "bytes": "6349650"}, {"name": "Batchfile", "bytes": "22"}, {"name": "C", "bytes": "277785832"}, {"name": "C++", "bytes": "9306614"}, {"name": "CMake", "bytes": "5235"}, {"name": "HTML", "bytes": "2026143"}, {"name": "Makefile", "bytes": "103011"}, {"name": "Objective-C", "bytes": "432766"}, {"name": "Perl", "bytes": "2589"}, {"name": "Python", "bytes": "36524"}, {"name": "Shell", "bytes": "16819"}, {"name": "XSLT", "bytes": "5596"}]}} +{"text": "cd ../vendor/dojo/util/buildscripts/\n./build.sh --profile ../../../../builds/single-file.js", "meta": {"content_hash": "4103e352f717750ab6dcac1dd26402d7", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 54, "avg_line_length": 45.5, "alnum_prop": 0.6593406593406593, "repo_name": "sirprize/dojorama", "id": "b822e9b7355e79daa0b5e2a6628c9f982057d898", "size": "185", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "builds/single-file.sh", "mode": "33261", "license": "mit", "language": [{"name": "CSS", "bytes": "140402"}, {"name": "JavaScript", "bytes": "8787868"}, {"name": "PHP", "bytes": "23352"}, {"name": "Shell", "bytes": "755"}]}}