{"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": "\n\n\n \n Invitation to calendar\n \n\n\n

You was invited to calendar.

\n\n

You can login and set password procceed by link:

\n\n\">\n\n", "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\n--FILE--\nini_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 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 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 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 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 createBinding(GrailsDomainClass domainClass) {\n\t\tboolean hasHibernate = pluginManager.hasGrailsPlugin(\"hibernate\") || pluginManager.hasGrailsPlugin(\"hibernate4\");\n\n\t\tMap binding = new HashMap();\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 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 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 resources = new HashSet();\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 extractNames(Resource[] resources) {\n\t\tSet names = new HashSet();\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// \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// \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 /// \r\n /// Represents a set of methods for creating instances of the \r\n /// provider's implementation of the data source classes.\r\n /// \r\n public class EffortProviderFactory : DbProviderFactory, IServiceProvider\r\n {\r\n /// \r\n /// Provides a singleton instance of the class.\r\n /// \r\n public static readonly EffortProviderFactory Instance = new EffortProviderFactory();\r\n\r\n /// \r\n /// Prevents a default instance of the class\r\n /// from being created.\r\n /// \r\n private EffortProviderFactory()\r\n {\r\n }\r\n\r\n /// \r\n /// Returns a new instance of the class.\r\n /// \r\n /// \r\n /// A new instance of .\r\n /// \r\n public override DbConnection CreateConnection()\r\n {\r\n return new EffortConnection();\r\n }\r\n\r\n /// \r\n /// Gets the service object of the specified type.\r\n /// \r\n /// \r\n /// An object that specifies the type of service object to get.\r\n /// \r\n /// \r\n /// A service object of type .-or- null if there is\r\n /// no service object of type .\r\n /// \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& V,\n const Eigen::PlainObjectBase& F,\n Eigen::PlainObjectBase& NV,\n Eigen::PlainObjectBase& 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": "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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 *

\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 = '%s' % (street_content,)\n street_dom = pyxb.utils.domutils.StringToDOM(street_xml).documentElement\n\n address1_xml = 'Customer95 Main St'\n address2_xml = 'Sugar Mama24 E. Dearling Ave.'\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' % (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 = '%s' % (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 = 'Customer95 Main StSugar Mama24 E. Dearling AveThanks!'\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 = 'Customer95 Main StSugar Mama24 E. Dearling AveThanks!'\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('General DeliveryRobert Smith', 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 \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 :\n label:

\n \n
\n
\n
\n \u00ab Up\n

\n classical-realizability\n \n 8.7.0\n Not compatible\n \n

\n

(2020-07-19 14:21:56 UTC)

\n

Context

\n
# 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
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-classical-realizability.8.7.0 coq.8.5.1
\n
Return code
\n
5120
\n
Output
\n
[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
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-classical-realizability.8.7.0
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub. \u00a9 Guillaume Claret.\n

\n
\n
\n \n \n \n\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
\n \n Loading...\n
\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 *

\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 positions;\n \n public SelectionRangeParams() {\n }\n \n public SelectionRangeParams(@NonNull final TextDocumentIdentifier textDocument, @NonNull final List positions) {\n this.textDocument = Preconditions.checkNotNull(textDocument, \"textDocument\");\n this.positions = Preconditions.>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 getPositions() {\n return this.positions;\n }\n \n /**\n * The positions inside the text document.\n */\n public void setPositions(@NonNull final List 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;\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, 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 = (row: Structs.ElementNew[], comparator: CompElm): Structs.ElementNew[] => {\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[]);\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>();\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": "\n\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": "\n\n\n\t\n\n\n\u041a\u043b\u0430\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0458\u0430\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

\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

\n\n\n\t \n\n
\n\n\n\n", "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": "

Installing XFramework Generator

\n\n

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 Hello world! app. XFramework Generator can make everything for you.

\n\n

XF Generator has a number of dependencies such as:

\n\n\n\n

To install first two of them on Mac OS X or Windows computers you just need to download a package from nodejs.org/download/. For other platforms see the readme.

\n\n

After installing node.js and npm go to terminal and install Yeoman writing npm install -g yo (with sudo if necessary).

\n\n

Almost there! After these steps you need to install XF Generator with npm install -g generator-xf.

", "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 /// Represents subscription registered features. \n public partial class CustomerSubscriptionRegisteredFeatures\n {\n /// Initializes a new instance of CustomerSubscriptionRegisteredFeatures. \n public CustomerSubscriptionRegisteredFeatures()\n {\n }\n\n /// Name of subscription registered feature. \n public string Name { get; set; }\n /// State of subscription registered feature. \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": "\n\n\n\n\n\nUses of Interface org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer (BOM: * : All 2.3.1.Final-SNAPSHOT API)\n\n\n\n\n\n\n\n\n
\n\n\n\n\n\n\n\n
Thorntail API, 2.3.1.Final-SNAPSHOT
\n
\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n
\n

Uses of Interface
org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer

\n
\n
\n\n
\n\n
\n\n\n\n\n\n\n\n
Thorntail API, 2.3.1.Final-SNAPSHOT
\n
\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n

Copyright © 2019 JBoss by Red Hat. All rights reserved.

\n\n\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 \n#include \"../tensor/broadcast_reduce_op.h\"\n\nnamespace mxnet {\nnamespace op {\n\nstruct MomentsParam : public dmlc::Parameter {\n dmlc::optional axes;\n bool keepdims;\n DMLC_DECLARE_PARAMETER(MomentsParam) {\n DMLC_DECLARE_FIELD(axes).set_default(dmlc::optional())\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(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* in_attrs,\n std::vector* 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\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\ninline void MomentsForwardImpl(const OpContext& ctx,\n const std::vector& inputs,\n const std::vector& req,\n const std::vector& outputs,\n const dmlc::optional& axes,\n const bool keepdims) {\n using namespace mshadow;\n using namespace mshadow_op;\n using namespace mxnet_op;\n\n Stream *s = ctx.get_stream();\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(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 temp_data =\n ctx.requested[0].get_space_typed(Shape1(data.shape_.Size()), s);;\n Kernel::Launch(s, data.shape_.Size(), temp_data.dptr_,\n data.dptr(), mean.dptr(), data_shape, mean_shape);\n ReduceAxesComputeImpl(\n ctx, {TBlob(temp_data).reshape(data.shape_)}, {kWriteTo}, {var}, small);\n });\n}\n\ntemplate\ninline void MomentsForward(const nnvm::NodeAttrs& attrs,\n const OpContext& ctx,\n const std::vector& inputs,\n const std::vector& req,\n const std::vector& 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(attrs.parsed);\n\n MomentsForwardImpl(ctx, inputs, req, outputs, param.axes, param.keepdims);\n}\n\ntemplate\nstruct VarBackwardKernel {\n template\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\ninline void MomentsBackwardImpl(const nnvm::NodeAttrs& attrs,\n const OpContext& ctx,\n const std::vector& inputs,\n const std::vector& req,\n const std::vector& outputs,\n const dmlc::optional& axes) {\n using namespace mshadow;\n using namespace mshadow::expr;\n using namespace mshadow_op;\n using namespace mxnet_op;\n\n Stream *s = ctx.get_stream();\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(attrs, ctx, {mean_grad}, req, outputs, small);\n MSHADOW_TYPE_SWITCH(outputs[0].type_flag_, DType, {\n Tensor igrad = outputs[0].FlatTo1D(s);\n igrad /= scalar(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, xpu>::Launch(\n s, data_grad.shape_.Size(), data_grad.dptr(), var_grad.dptr(),\n data.dptr(), mean.dptr(), data_shape, var_shape, N);\n });\n}\n\ntemplate\ninline void MomentsBackward(const nnvm::NodeAttrs& attrs,\n const OpContext& ctx,\n const std::vector& inputs,\n const std::vector& req,\n const std::vector& 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(attrs.parsed);\n\n MomentsBackwardImpl(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 {\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 m) {\r\n\t\tSet 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 *
        \n *     pDst[n] = pSrc[n] + offset,   0 <= n < blockSize.        \n * 
\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": "\n\n \n \n \n \n \n \n\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 /// \n /// Marks a simple auto property to be bound to a DependencyProperty\n /// Note: use , this class will be deprecated soon\n /// \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": "\n\n \n \n \n \n Facecat\n\n \n \n\n \n \n \n \n \n \n \n
\n\n\n
\n
\n
\n \n Facecat\n
\n
\n \n
\n
\n
\n\n\n\n % if 'error' in locals():\n
An error happend while processing your request.
\n % end\n
\n

Upload a picture It's more fun if it's the picture of someone.

\n\n
\n \n
\n
\n
\n \n \n Browse… \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", "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 /// \n /// Required designer variable.\n /// \n private System.ComponentModel.IContainer components = null;\n\n /// \n /// Clean up any resources being used.\n /// \n /// true if managed resources should be disposed; otherwise, false.\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 /// \n /// Required method for Designer support - do not modify\n /// the contents of this method with the code editor.\n /// \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 implements PatientGroupDAO {\n @Override\n public List 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"}]}}