Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    ArrowInvalid
Message:      JSON parse error: Missing a closing quotation mark in string. in row 761
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 145, in _generate_tables
                  dataset = json.load(f)
                File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
                  return loads(fp.read(),
                File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
                  return _default_decoder.decode(s)
                File "/usr/local/lib/python3.9/json/decoder.py", line 340, in decode
                  raise JSONDecodeError("Extra data", s, end)
              json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 2878)
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1995, in _prepare_split_single
                  for _, table in generator:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 148, in _generate_tables
                  raise e
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 122, in _generate_tables
                  pa_table = paj.read_json(
                File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
                File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
                File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
              pyarrow.lib.ArrowInvalid: JSON parse error: Missing a closing quotation mark in string. in row 761
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

text
string
meta
dict
using System; using System.Data; namespace Quasar.HabboHotel.Users.Authenticator { public static class HabboFactory { public static Habbo GenerateHabbo(DataRow Row, DataRow UserInfo) { return new Habbo(Convert.ToInt32(Row["id"]), Convert.ToString(Row["username"]), Convert.ToInt32(Row["rank"]), Convert.ToString(Row["motto"]), Convert.ToString(Row["look"]), Convert.ToString(Row["gender"]), Convert.ToInt32(Row["credits"]), Convert.ToInt32(Row["activity_points"]), Convert.ToInt32(Row["home_room"]), QuasarEnvironment.EnumToBool(Row["block_newfriends"].ToString()), Convert.ToInt32(Row["last_online"]), QuasarEnvironment.EnumToBool(Row["hide_online"].ToString()), QuasarEnvironment.EnumToBool(Row["hide_inroom"].ToString()), Convert.ToDouble(Row["account_created"]), Convert.ToInt32(Row["vip_points"]), Convert.ToString(Row["machine_id"]), Convert.ToString(Row["volume"]), QuasarEnvironment.EnumToBool(Row["chat_preference"].ToString()), QuasarEnvironment.EnumToBool(Row["focus_preference"].ToString()), QuasarEnvironment.EnumToBool(Row["pets_muted"].ToString()), QuasarEnvironment.EnumToBool(Row["bots_muted"].ToString()), QuasarEnvironment.EnumToBool(Row["advertising_report_blocked"].ToString()), Convert.ToDouble(Row["last_change"].ToString()), Convert.ToInt32(Row["gotw_points"]), Convert.ToInt32(Row["user_points"]), QuasarEnvironment.EnumToBool(Convert.ToString(Row["ignore_invites"])), Convert.ToDouble(Row["time_muted"]), Convert.ToDouble(UserInfo["trading_locked"]), QuasarEnvironment.EnumToBool(Row["allow_gifts"].ToString()), Convert.ToInt32(Row["friend_bar_state"]), QuasarEnvironment.EnumToBool(Row["disable_forced_effects"].ToString()), QuasarEnvironment.EnumToBool(Row["allow_mimic"].ToString()), Convert.ToInt32(Row["rank_vip"]), Convert.ToByte(Row["guia"].ToString()), Convert.ToByte(Row["hulptroepen"].ToString()), (Row["nux_user"].ToString() == "true"), Convert.ToInt32(Row["pumpkins"]), Convert.ToInt32(Row["camera_count"].ToString())); } } }
{ "content_hash": "86786819cde8b6a85ea5146fb5ed6e8b", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 266, "avg_line_length": 94.52173913043478, "alnum_prop": 0.68721251149954, "repo_name": "slaapkopamy/PlusEmu-making-ready-for-linux-server", "id": "39ff3671ae800614dde0d40168b3fed321e28c6d", "size": "2176", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "HabboHotel/Users/Authenticator/Authenticator.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "2982743" }, { "name": "Roff", "bytes": "94372435" } ] }
<?xml version="1.0"?> <fest:template xmlns:fest="http://fest.mail.ru" context_name="json"> <fest:set name="headline-menu"> <div class="portal-menu portal-menu_mail"> <div class="portal-menu__width"> <div class="portal-menu__logo__mailru"> <a href="/" class="portal-menu__logo__mailru__link"> <img class="portal-menu__logo__mailru__link_img" src="http://img.imgsmail.ru/r/portal/portal-menu/logo-mailru.png" width="142" height="30" alt="mail.ru"/> </a> </div> <div class="portal-menu__buttons" id="ddbuttons"> <div class="portal-menu__buttons__item"> <span class="dd-sentmsg portal-menu__buttons__cont"> <a class="portal-menu__buttons__link portal-menu__buttons__link_mail portal-menu__buttons__link_mail_send" href="/cgi-bin/sentmsg?compose" onmousedown="__rc(this, 8984);" rel="history" id="HeaderBtnSentMsg"> Написать </a> </span> </div> <div class="portal-menu__buttons__item"> <span class="dd-msglist portal-menu__buttons__cont"> <a class="portal-menu__buttons__link portal-menu__buttons__link_mail portal-menu__buttons__link_mail_reload" href="http://e.mail.ru/cgi-bin/msglist?folder=0" onmousedown="__rc(this, 8985);" rel="history" id="HeaderBtnCheckNewMsg"> Проверить </a> </span> </div> <div class="portal-menu__buttons__item"> <span class="dd-addressbook portal-menu__buttons__cont"> <a class="portal-menu__buttons__link portal-menu__buttons__link_mail portal-menu__buttons__link_mail_addressbook" href="/cgi-bin/addressbook" onmousedown="__rc(this, 8986);"> Адреса </a> </span> </div> <div class="portal-menu__buttons__item" id="portal-menu__dropdown"> <span class="js-link portal-menu__buttons__cont" id="portal-menu__buttons__cont"> <a class="portal-menu__buttons__link portal-menu__buttons__link_mail portal-menu__buttons__link_mail_more" href="#"> Ещё </a> </span> <div class="js-menu portal-menu__dropdown" style="display: none; "> <!--[if gte IE 7]><!--> <div class="portal-menu__dropdown__list__item"> <a class="portal-menu__dropdown__list__link" href="/cgi-bin/themes" onmousedown="__rc(this, 9689);"> <span class="portal-menu__dropdown__list__text">Темы<span class="marker marker_new">new</span></span> </a> </div> <!--<![endif]--> <div class="portal-menu__dropdown__list__item"> <a class="portal-menu__dropdown__list__link" href="/cgi-bin/options" onmousedown="__rc(this, 8987);"> <span class="portal-menu__dropdown__list__text">Настройки</span> </a> </div> <div class="portal-menu__dropdown__list__item"> <a class="portal-menu__dropdown__list__link" href="/cgi-bin/view_organizer" target="_blank" onmousedown="__rc(this, 8988);"> <span class="portal-menu__dropdown__list__text">Ежедневник</span> </a> </div> <div class="portal-menu__dropdown__list__item"> <a class="portal-menu__dropdown__list__link" href="http://my.mail.ru/community/mailru/" target="_blank" onmousedown="__rc(this, 9063);"> <span class="portal-menu__dropdown__list__text">Сообщество</span> </a> </div> <div class="portal-menu__dropdown__list__item"> <a class="portal-menu__dropdown__list__link" href="http://help.mail.ru/mail-help" target="_blank" onmousedown="__rc(this, 8990);"> <span class="portal-menu__dropdown__list__text">Помощь</span> </a> </div> </div> </div> </div> <div class="portal-menu__banner" id="header__banner"> </div> <!-- Количество показов новой шапки --> <script type="text/javascript">new Image().src = 'http://rs.mail.ru/d413519.gif?' + Math.random();</script> <noscript><img src="http://rs.mail.ru/d413519.gif?1583319330" alt="" style="position: absolute;" width="1" height="1"/></noscript> </div> </div> </fest:set> </fest:template>
{ "content_hash": "8d6c38538e07ead2289ebf5a000b91cb", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 238, "avg_line_length": 50.25, "alnum_prop": 0.6109452736318408, "repo_name": "aCyber/fest", "id": "9aabc42306607c43f8c6ead681bebe7088177375", "size": "4112", "binary": false, "copies": "3", "ref": "refs/heads/0.9", "path": "bench/messagelist/portal-menu.xml", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "56" }, { "name": "JavaScript", "bytes": "1020206" } ] }
export { default } from './DmnTab';
{ "content_hash": "796f36366088134a16a9d7cb480b1f93", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 35, "avg_line_length": 12.333333333333334, "alnum_prop": 0.6216216216216216, "repo_name": "camunda/bpmn-io-modeler", "id": "ef81520b83471d8c4ef663c876108aef67c57e00", "size": "411", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/src/app/tabs/dmn/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "19847" }, { "name": "HTML", "bytes": "172" }, { "name": "JavaScript", "bytes": "241023" } ] }
//----------------------------------------------- // // This file is part of the Siv3D Engine. // // Copyright (c) 2008-2022 Ryo Suzuki // Copyright (c) 2016-2022 OpenSiv3D Project // // Licensed under the MIT License. // //----------------------------------------------- # include <Siv3D/ZIPReader.hpp> # include "ZIPReaderDetail.hpp" namespace s3d { ZIPReader::ZIPReader() : pImpl{ std::make_shared<ZIPReaderDetail>() } { } ZIPReader::ZIPReader(const FilePathView path) : ZIPReader{} { open(path); } ZIPReader::~ZIPReader() { // do nothing } bool ZIPReader::open(const FilePathView path) { return pImpl->open(path); } void ZIPReader::close() { pImpl->close(); } bool ZIPReader::isOpen() const noexcept { return pImpl->isOpen(); } ZIPReader::operator bool() const noexcept { return pImpl->isOpen(); } const Array<FilePath>& ZIPReader::enumPaths() const { return pImpl->enumPaths(); } bool ZIPReader::extractAll(const FilePathView targetDirectory) const { return pImpl->extractAll(targetDirectory); } bool ZIPReader::extractFiles(const StringView pattern, const FilePathView targetDirectory) const { return pImpl->extract(pattern, targetDirectory); } MemoryReader ZIPReader::extract(const FilePathView filePath) const { return MemoryReader{ pImpl->extractToBlob(filePath) }; } Blob ZIPReader::extractToBlob(const FilePathView filePath) const { return pImpl->extractToBlob(filePath); } }
{ "content_hash": "b5572ceb83558a1bc1a3d85812a5af4c", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 97, "avg_line_length": 18.76923076923077, "alnum_prop": 0.6612021857923497, "repo_name": "Siv3D/OpenSiv3D", "id": "a6d581eb825516a32d7970f10b75f1c86deade36", "size": "1466", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "Siv3D/src/Siv3D/ZIPReader/SivZIPReader.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "AngelScript", "bytes": "29105" }, { "name": "Assembly", "bytes": "147" }, { "name": "C", "bytes": "1514971" }, { "name": "C++", "bytes": "13315018" }, { "name": "CMake", "bytes": "178934" }, { "name": "GLSL", "bytes": "370938" }, { "name": "HLSL", "bytes": "123042" }, { "name": "HTML", "bytes": "32876" }, { "name": "Inno Setup", "bytes": "1635" }, { "name": "JavaScript", "bytes": "52781" }, { "name": "Metal", "bytes": "2383" }, { "name": "Objective-C", "bytes": "4914" }, { "name": "Objective-C++", "bytes": "139706" }, { "name": "Shell", "bytes": "8168" }, { "name": "Smarty", "bytes": "20525" }, { "name": "TypeScript", "bytes": "19085" } ] }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_05) on Fri Jun 27 13:35:09 EDT 2014 --> <title>org.triplehelix.lib.properties Class Hierarchy</title> <meta name="date" content="2014-06-27"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.triplehelix.lib.properties Class Hierarchy"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/triplehelix/lib/pid/package-tree.html">Prev</a></li> <li><a href="../../../../org/triplehelix/lib/properties/provides/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/triplehelix/lib/properties/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 class="title">Hierarchy For Package org.triplehelix.lib.properties</h1> <span class="strong">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../../../../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.<a href="file:///C:/Users/Matthew.Lythgoe/sunspotfrcsdk/doc/javadoc/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="strong">Object</span></a> <ul> <li type="circle">org.triplehelix.lib.properties.<a href="../../../../org/triplehelix/lib/properties/PropertyReader.html" title="class in org.triplehelix.lib.properties"><span class="strong">PropertyReader</span></a></li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/triplehelix/lib/pid/package-tree.html">Prev</a></li> <li><a href="../../../../org/triplehelix/lib/properties/provides/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/triplehelix/lib/properties/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "b5b05cab2994df9998eb84b82b9cc0b7", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 221, "avg_line_length": 37.492063492063494, "alnum_prop": 0.6081710414902625, "repo_name": "TripleHelixProgramming/triple-helix-utilities", "id": "013f3fcb5b663a9850a7af3a6fc908145601c325", "size": "4724", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/org/triplehelix/lib/properties/package-tree.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "18391" } ] }
app.controller('ReviewAssignmentController', function($scope, $http, toastr, $window, $location, ActionBarService) { console.log('Debug: ReviewAssignmentController') vId = $location.search().vId; if(!vId) { return } $scope.user = null; $scope.solution = null; ActionBarService.extraActionsMenu = []; ActionBarService.extraActionsMenu.push( { clickAction: $scope.goBack, title: '<i class="ionicons ion-arrow-return-left"></i> &nbsp; BACK', aTitle: 'Back' }, { separator: true }, { clickAction: $scope.redirectPRHome, title: '<i class="ionicons ion-home"></i> &nbsp; PEER REVIEWS HOME', aTitle: 'Peer Review Home' } ); console.log('Peer Review Id: ', vId) var url = '/api/peerassessment/' + $scope.course._id + '/peerreviews/' + vId + '/reviews/new'; $http.get(url).then(function (response) { console.log(response.data); if(response && response.data) { $scope.assignedReviews = response.data.assignedReviews; $scope.users = response.data.users; $scope.solutions = response.data.solutions; if($scope.users.length) $scope.user = $scope.users[0]._id; if($scope.solutions.length) $scope.solution = $scope.solutions[0]._id; } }, function(err) { toastr.error('Internal Server error. Please try again later'); }); $scope.assignReview = function() { if(!$scope.user || !$scope.solution) { toastr.error('Please select a valid student and solution before assigning'); return; } console.log($scope.user, $scope.solution) var url = '/api/peerassessment/' + $scope.course._id + '/peerreviews/' + vId + '/reviews/assign'; $http.post(url, {assignedTo: $scope.user, solutionId: $scope.solution}).then(function(response) { console.log($scope.solution) if(response && response.data && response.data.result) { toastr.success('Review successfully created'); window.location.reload(); } else { toastr.error('Internal Server error. Please try again later'); } }, function(err) { toastr.error('Internal Server error. Please try again later'); }); } $scope.deleteReview = function(id, e) { var url = '/api/peerassessment/' + $scope.course._id + '/peerreviews/' + vId + '/reviews/' + id; $http.delete(url).then(function(response) { if(response && response.data && response.data.result) { toastr.success('Review successfully deleted'); window.location.reload(); } else { toastr.error('Internal Server error. Please try again later'); } }, function(err) { toastr.error('Internal Server error. Please try again later'); }) } })
{ "content_hash": "89a2e3c0d6b95cbc9e85c6d5f5f9561b", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 116, "avg_line_length": 39.15384615384615, "alnum_prop": 0.56286836935167, "repo_name": "CourseMapper/course-mapper", "id": "eb61f0043104b5b735c71bc15cf8e6743c4fae8f", "size": "3054", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "frontend-modules/angular/peerAssessment/review/pages/reviewAssignment.controller.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "87151" }, { "name": "Dockerfile", "bytes": "597" }, { "name": "HTML", "bytes": "634613" }, { "name": "Java", "bytes": "937331" }, { "name": "JavaScript", "bytes": "1721309" }, { "name": "Makefile", "bytes": "287" } ] }
/* * $Id: BinFileInputStream.cpp 568078 2007-08-21 11:43:25Z amassari $ */ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- #include <xercesc/util/BinFileInputStream.hpp> #include <xercesc/util/Janitor.hpp> #include <xercesc/util/PlatformUtils.hpp> #include <xercesc/util/XMLExceptMsgs.hpp> #include <xercesc/util/XMLString.hpp> XERCES_CPP_NAMESPACE_BEGIN // --------------------------------------------------------------------------- // BinFileInputStream: Constructors and Destructor // --------------------------------------------------------------------------- BinFileInputStream::BinFileInputStream(const XMLCh* const fileName , MemoryManager* const manager) : fSource(XMLPlatformUtils::openFile(fileName, manager)) , fMemoryManager(manager) { } BinFileInputStream::BinFileInputStream(const char* const fileName, MemoryManager* const manager) : fSource(XMLPlatformUtils::openFile(fileName, manager)) , fMemoryManager(manager) { } BinFileInputStream::BinFileInputStream(const FileHandle toAdopt , MemoryManager* const manager) : fSource(toAdopt) , fMemoryManager(manager) { } BinFileInputStream::~BinFileInputStream() { if (getIsOpen()) XMLPlatformUtils::closeFile(fSource, fMemoryManager); } // --------------------------------------------------------------------------- // BinFileInputStream: Getter methods // --------------------------------------------------------------------------- unsigned int BinFileInputStream::getSize() const { return XMLPlatformUtils::fileSize(fSource, fMemoryManager); } // --------------------------------------------------------------------------- // BinFileInputStream: Stream management methods // --------------------------------------------------------------------------- void BinFileInputStream::reset() { XMLPlatformUtils::resetFile(fSource, fMemoryManager); } // --------------------------------------------------------------------------- // BinFileInputStream: Implementation of the input stream interface // --------------------------------------------------------------------------- unsigned int BinFileInputStream::curPos() const { return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); } unsigned int BinFileInputStream::readBytes( XMLByte* const toFill , const unsigned int maxToRead) { // // Read up to the maximum bytes requested. We return the number // actually read. // return XMLPlatformUtils::readFileBuffer(fSource, maxToRead, toFill, fMemoryManager); } XERCES_CPP_NAMESPACE_END
{ "content_hash": "627b959c17d78746fa46a5f7c08982ed", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 88, "avg_line_length": 32.31111111111111, "alnum_prop": 0.49002751031636865, "repo_name": "ksmyth/xerces-c", "id": "40414cd2c0902df7dc15653a46deee5d84ac70bc", "size": "3727", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/xercesc/util/BinFileInputStream.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "4944" }, { "name": "Batchfile", "bytes": "580" }, { "name": "C", "bytes": "252322" }, { "name": "C++", "bytes": "13006245" }, { "name": "HTML", "bytes": "16836" }, { "name": "Makefile", "bytes": "982416" }, { "name": "Perl", "bytes": "73028" }, { "name": "Rebol", "bytes": "1011" }, { "name": "Shell", "bytes": "54757" } ] }
/** * This is a modified version of Prism.js line numbers plugin that adds * necessary properties and event listeners to line numbers <span> tags. */ var globals = require('./globals'); var utils = require('./utils'); (function () { if (typeof self === 'undefined' || !self.Prism || !self.document) { return; } /** * Plugin name which is used as a class name for <pre> which is activating the plugin * @type {String} */ var PLUGIN_NAME = 'line-numbers'; /** * Regular expression used for determining line breaks * @type {RegExp} */ var NEW_LINE_EXP = /\n(?!$)/g; /** * Resizes line numbers spans according to height of line of code * @param {Element} element <pre> element */ var _resizeElement = function (element) { var codeStyles = getStyles(element); var whiteSpace = codeStyles['white-space']; if (whiteSpace === 'pre-wrap' || whiteSpace === 'pre-line') { var codeElement = element.querySelector('code'); var lineNumbersWrapper = element.querySelector('.line-numbers-rows'); var lineNumberSizer = element.querySelector('.line-numbers-sizer'); var codeLines = codeElement.textContent.split(NEW_LINE_EXP); if (!lineNumberSizer) { lineNumberSizer = document.createElement('span'); lineNumberSizer.className = 'line-numbers-sizer'; codeElement.appendChild(lineNumberSizer); } lineNumberSizer.style.display = 'block'; codeLines.forEach(function (line, lineNumber) { lineNumberSizer.textContent = line || '\n'; var lineSize = lineNumberSizer.getBoundingClientRect().height; lineNumbersWrapper.children[lineNumber].style.height = lineSize + 'px'; }); lineNumberSizer.textContent = ''; lineNumberSizer.style.display = 'none'; } }; /** * Returns style declarations for the element * @param {Element} element */ var getStyles = function (element) { if (!element) { return null; } return window.getComputedStyle ? getComputedStyle(element) : (element.currentStyle || null); }; window.addEventListener('resize', function () { Array.prototype.forEach.call(document.querySelectorAll('pre.' + PLUGIN_NAME), _resizeElement); }); Prism.hooks.add('complete', function (env) { if (!env.code) { return; } // works only for <code> wrapped inside <pre> (not inline) var pre = env.element.parentNode; var clsReg = /\s*\bline-numbers\b\s*/; if ( !pre || !/pre/i.test(pre.nodeName) || // Abort only if nor the <pre> nor the <code> have the class (!clsReg.test(pre.className) && !clsReg.test(env.element.className)) ) { return; } if (env.element.querySelector('.line-numbers-rows')) { // Abort if line numbers already exists return; } if (clsReg.test(env.element.className)) { // Remove the class 'line-numbers' from the <code> env.element.className = env.element.className.replace(clsReg, ' '); } if (!clsReg.test(pre.className)) { // Add the class 'line-numbers' to the <pre> pre.className += ' line-numbers'; } var match = env.code.match(NEW_LINE_EXP); var linesNum = match ? match.length + 1 : 1; var lineNumbersWrapper; // var lines = new Array(linesNum + 1); // lines = lines.join('<span></span>'); lineNumbersWrapper = document.createElement('span'); lineNumbersWrapper.setAttribute('aria-hidden', 'true'); lineNumbersWrapper.className = 'line-numbers-rows'; // lineNumbersWrapper.innerHTML = lines; // Create <span> elements for line numbers with all necessary attributes for (var i = 1; i < linesNum + 1; i++) { var span = document.createElement('span'); span.id = 'lineno_' + i; span.onclick = function(event) { var line_number = event.currentTarget.id.split('_')[1]; if (event.currentTarget.className == 'breakpoint') { utils.send_command('cl ' + globals.state.dirname + globals.state.filename + ':' + line_number); } else { utils.send_command('b ' + globals.state.dirname + globals.state.filename + ':' + line_number); } }; if (globals.state.breakpoints.indexOf(i) != -1) { span.className = 'breakpoint'; } lineNumbersWrapper.appendChild(span); } if (pre.hasAttribute('data-start')) { pre.style.counterReset = 'linenumber ' + (parseInt(pre.getAttribute('data-start'), 10) - 1); } env.element.appendChild(lineNumbersWrapper); _resizeElement(pre); Prism.hooks.run('line-numbers', env); }); Prism.hooks.add('line-numbers', function (env) { env.plugins = env.plugins || {}; env.plugins.lineNumbers = true; }); /** * Global exports */ Prism.plugins.lineNumbers = { /** * Get node for provided line number * @param {Element} element pre element * @param {Number} number line number * @return {Element|undefined} */ getLine: function (element, number) { if (element.tagName !== 'PRE' || !element.classList.contains(PLUGIN_NAME)) { return; } var lineNumberRows = element.querySelector('.line-numbers-rows'); var lineNumberStart = parseInt(element.getAttribute('data-start'), 10) || 1; var lineNumberEnd = lineNumberStart + (lineNumberRows.children.length - 1); if (number < lineNumberStart) { number = lineNumberStart; } if (number > lineNumberEnd) { number = lineNumberEnd; } var lineIndex = number - lineNumberStart; return lineNumberRows.children[lineIndex]; } }; }());
{ "content_hash": "f1cea510d4472de1ab383112a5a7f96d", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 100, "avg_line_length": 28.864864864864863, "alnum_prop": 0.6657303370786517, "repo_name": "romanvm/python-web-pdb", "id": "8bfacf288f89c7180900b2ae5fde844d502e7322", "size": "5340", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "frontend/src/prism-line-numbers.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1898" }, { "name": "HTML", "bytes": "6942" }, { "name": "JavaScript", "bytes": "27534" }, { "name": "Python", "bytes": "34601" } ] }
BEGIN; CREATE TABLE decreto( empleado int, nro_decreto int, fecha date NOT NULL, nombre_cargo varchar(50) NOT NULL, CONSTRAINT pk_decreto PRIMARY KEY (empleado, nro_decreto), CONSTRAINT fk_empleado FOREIGN KEY (empleado) REFERENCES empleado (documento) ); COMMIT;
{ "content_hash": "0a33582ca4533a47dcf8c5ee319308e9", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 38, "avg_line_length": 15.777777777777779, "alnum_prop": 0.7323943661971831, "repo_name": "yo-alan/personal", "id": "e0b0e3eb724ed9585ddfecfdc9fb8bd231422a3e", "size": "284", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/decreto.sql", "mode": "33188", "license": "mit", "language": [ { "name": "PLpgSQL", "bytes": "4583" }, { "name": "Python", "bytes": "135749" } ] }
<div> <b>Here are our terms and conditions</b> </div>
{ "content_hash": "9ada7537a5ef3db9d15e5e85a7dde711", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 42, "avg_line_length": 18.333333333333332, "alnum_prop": 0.6545454545454545, "repo_name": "avadhuts-cuelogic/angular-seed", "id": "b9978471ec77c380009faa3b10637f4e10bdf274", "size": "55", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/partials/terms-and-conditions.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "857" }, { "name": "JavaScript", "bytes": "9005" } ] }
/** * @author Pranava Raparla * Created: October 24th, 2014 * Modified: October 24th, 2014 */ package application.slogonode.TurtleCommands; import java.util.*; import application.Actions.AbstractAction; public class ShowTurtleNode extends DisplayTurtleNode { public ShowTurtleNode() { super(); myType = "ShowTurtle"; } @Override public List<AbstractAction> evaluate() { myValue = 1; return super.evaluate(); } }
{ "content_hash": "f1c3c0299802c0164eb65884859f819e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 55, "avg_line_length": 18.25, "alnum_prop": 0.7191780821917808, "repo_name": "ngbalk/SLOGO", "id": "eaccd77145bd3018fb39e8a8efd875b4c517d832", "size": "438", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/application/slogonode/TurtleCommands/ShowTurtleNode.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "130808" } ] }
FROM buildpack-deps:trusty ENV DEBIAN_FRONTEND noninteractive # Upgrade and install basic Python dependencies RUN apt-get -y purge \ && apt-get -y update \ && apt-get -y install --fix-missing python2.7 python-gevent python-flask \ \ # Upgrade and install Swift dependencies && apt-get -y install --fix-missing build-essential curl wget libicu-dev \ \ # Install zip for compiling Swift actions && apt-get -y install zip \ \ # Clean up && apt-get clean # Install clang manually, since SPM wants at least Clang 3-6 RUN cd / &&\ (curl -L -k http://llvm.org/releases/3.6.2/clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04.tar.xz | tar xJ) &&\ cp -r /clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04/* /usr/ &&\ rm -rf /clang+llvm-3.6.2-x86_64-linux-gnu-ubuntu-14.04 RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++ 20 RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang 20 # Install Swift keys RUN wget --no-verbose -O - https://swift.org/keys/all-keys.asc | gpg --import - && \ gpg --keyserver hkp://pool.sks-keyservers.net --refresh-keys Swift # Install Swift Ubuntu 14.04 Snapshot #https://swift.org/builds/swift-3.0.1-release/ubuntu1404/swift-3.0.1-RELEASE/swift-3.0.1-RELEASE-ubuntu14.04.tar.gz ENV SWIFT_VERSION 3.0.2 ENV SWIFT_RELEASE_TYPE RELEASE ENV SWIFT_PLATFORM ubuntu14.04 RUN SWIFT_ARCHIVE_NAME=swift-$SWIFT_VERSION-$SWIFT_RELEASE_TYPE-$SWIFT_PLATFORM && \ SWIFT_URL=https://swift.org/builds/swift-$SWIFT_VERSION-$(echo "$SWIFT_RELEASE_TYPE" | tr '[:upper:]' '[:lower:]')/$(echo "$SWIFT_PLATFORM" | tr -d .)/swift-$SWIFT_VERSION-$SWIFT_RELEASE_TYPE/$SWIFT_ARCHIVE_NAME.tar.gz && \ echo $SWIFT_URL && \ wget --no-verbose $SWIFT_URL && \ wget --no-verbose $SWIFT_URL.sig && \ gpg --verify $SWIFT_ARCHIVE_NAME.tar.gz.sig && \ tar -xzf $SWIFT_ARCHIVE_NAME.tar.gz --directory / --strip-components=1 && \ rm -rf $SWIFT_ARCHIVE_NAME* /tmp/* /var/tmp/* # Add the action proxy RUN mkdir -p /actionProxy ADD actionproxy.py /actionProxy # Add files needed to build and run action RUN mkdir -p /swift3Action ADD epilogue.swift /swift3Action ADD buildandrecord.py /swift3Action ADD swift3runner.py /swift3Action ADD spm-build /swift3Action/spm-build # Build kitura net RUN touch /swift3Action/spm-build/main.swift RUN python /swift3Action/buildandrecord.py && rm /swift3Action/spm-build/.build/release/Action #RUN cd /swift3Action/spm-build; swift build -c release; rm /swift3Action/spm-build/.build/release/Action ENV FLASK_PROXY_PORT 8080 CMD ["/bin/bash", "-c", "cd /swift3Action && PYTHONIOENCODING='utf-8' python -u swift3runner.py"]
{ "content_hash": "929226ea028d32b7139369bb2eb15d2d", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 227, "avg_line_length": 39.59090909090909, "alnum_prop": 0.7164179104477612, "repo_name": "lzbj/openwhisk", "id": "aa766d4eb5366068bf02a3e02c954e84608a583c", "size": "2783", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/swift3Action/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "623" }, { "name": "Java", "bytes": "42901" }, { "name": "JavaScript", "bytes": "127209" }, { "name": "Python", "bytes": "38090" }, { "name": "Scala", "bytes": "2150166" }, { "name": "Shell", "bytes": "9971" }, { "name": "Swift", "bytes": "24731" } ] }
import FamousEngine from 'famous/core/FamousEngine' // Our dependencies import Flog from './Flog' FamousEngine.init() var scene = FamousEngine.createScene().addChild(new Flog())
{ "content_hash": "3f9b3bbb58e31d046300476fa404384d", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 59, "avg_line_length": 22.5, "alnum_prop": 0.7722222222222223, "repo_name": "nicolaslabbe/flog", "id": "643b9c844d17233b06e9983aa09e1bca74bfeaee", "size": "203", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1125" }, { "name": "HTML", "bytes": "4550" }, { "name": "JavaScript", "bytes": "465659" } ] }
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. package org.apache.doris.monitor.jvm; import org.apache.doris.monitor.unit.ByteSizeValue; import org.apache.doris.monitor.unit.TimeValue; import java.lang.management.BufferPoolMXBean; import java.lang.management.ClassLoadingMXBean; import java.lang.management.GarbageCollectorMXBean; import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; import java.lang.management.MemoryPoolMXBean; import java.lang.management.MemoryUsage; import java.lang.management.RuntimeMXBean; import java.lang.management.ThreadMXBean; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.concurrent.TimeUnit; public class JvmStats { private static final RuntimeMXBean runtimeMXBean; private static final MemoryMXBean memoryMXBean; private static final ThreadMXBean threadMXBean; private static final ClassLoadingMXBean classLoadingMXBean; static { runtimeMXBean = ManagementFactory.getRuntimeMXBean(); memoryMXBean = ManagementFactory.getMemoryMXBean(); threadMXBean = ManagementFactory.getThreadMXBean(); classLoadingMXBean = ManagementFactory.getClassLoadingMXBean(); } public static JvmStats jvmStats() { MemoryUsage memUsage = memoryMXBean.getHeapMemoryUsage(); long heapUsed = memUsage.getUsed() < 0 ? 0 : memUsage.getUsed(); long heapCommitted = memUsage.getCommitted() < 0 ? 0 : memUsage.getCommitted(); long heapMax = memUsage.getMax() < 0 ? 0 : memUsage.getMax(); memUsage = memoryMXBean.getNonHeapMemoryUsage(); long nonHeapUsed = memUsage.getUsed() < 0 ? 0 : memUsage.getUsed(); long nonHeapCommitted = memUsage.getCommitted() < 0 ? 0 : memUsage.getCommitted(); List<MemoryPoolMXBean> memoryPoolMXBeans = ManagementFactory.getMemoryPoolMXBeans(); List<MemoryPool> pools = new ArrayList<>(); for (MemoryPoolMXBean memoryPoolMXBean : memoryPoolMXBeans) { try { MemoryUsage usage = memoryPoolMXBean.getUsage(); MemoryUsage peakUsage = memoryPoolMXBean.getPeakUsage(); String name = GcNames.getByMemoryPoolName(memoryPoolMXBean.getName(), null); if (name == null) { // if we can't resolve it, its not interesting.... (Per Gen, Code Cache) continue; } pools.add(new MemoryPool(name, usage.getUsed() < 0 ? 0 : usage.getUsed(), usage.getMax() < 0 ? 0 : usage.getMax(), peakUsage.getUsed() < 0 ? 0 : peakUsage.getUsed(), peakUsage.getMax() < 0 ? 0 : peakUsage.getMax() )); } catch (Exception ex) { /* ignore some JVMs might barf here with: * java.lang.InternalError: Memory Pool not found * we just omit the pool in that case!*/ } } Mem mem = new Mem(heapCommitted, heapUsed, heapMax, nonHeapCommitted, nonHeapUsed, Collections.unmodifiableList(pools)); Threads threads = new Threads(threadMXBean.getThreadCount(), threadMXBean.getPeakThreadCount()); List<GarbageCollectorMXBean> gcMxBeans = ManagementFactory.getGarbageCollectorMXBeans(); GarbageCollector[] collectors = new GarbageCollector[gcMxBeans.size()]; for (int i = 0; i < collectors.length; i++) { GarbageCollectorMXBean gcMxBean = gcMxBeans.get(i); collectors[i] = new GarbageCollector(GcNames.getByGcName(gcMxBean.getName(), gcMxBean.getName()), gcMxBean.getCollectionCount(), gcMxBean.getCollectionTime()); } GarbageCollectors garbageCollectors = new GarbageCollectors(collectors); List<BufferPool> bufferPoolsList = Collections.emptyList(); try { List<BufferPoolMXBean> bufferPools = ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class); bufferPoolsList = new ArrayList<>(bufferPools.size()); for (BufferPoolMXBean bufferPool : bufferPools) { bufferPoolsList.add(new BufferPool(bufferPool.getName(), bufferPool.getCount(), bufferPool.getTotalCapacity(), bufferPool.getMemoryUsed())); } } catch (Exception e) { // buffer pools are not available } Classes classes = new Classes(classLoadingMXBean.getLoadedClassCount(), classLoadingMXBean.getTotalLoadedClassCount(), classLoadingMXBean.getUnloadedClassCount()); return new JvmStats(System.currentTimeMillis(), runtimeMXBean.getUptime(), mem, threads, garbageCollectors, bufferPoolsList, classes); } private final long timestamp; private final long uptime; private final Mem mem; private final Threads threads; private final GarbageCollectors gc; private final List<BufferPool> bufferPools; private final Classes classes; public JvmStats(long timestamp, long uptime, Mem mem, Threads threads, GarbageCollectors gc, List<BufferPool> bufferPools, Classes classes) { this.timestamp = timestamp; this.uptime = uptime; this.mem = mem; this.threads = threads; this.gc = gc; this.bufferPools = bufferPools; this.classes = classes; } public long getTimestamp() { return timestamp; } public TimeValue getUptime() { return new TimeValue(uptime); } public Mem getMem() { return this.mem; } public Threads getThreads() { return threads; } public GarbageCollectors getGc() { return gc; } public List<BufferPool> getBufferPools() { return bufferPools; } public Classes getClasses() { return classes; } static final class Fields { static final String JVM = "jvm"; static final String TIMESTAMP = "timestamp"; static final String UPTIME = "uptime"; static final String UPTIME_IN_MILLIS = "uptime_in_millis"; static final String MEM = "mem"; static final String HEAP_USED = "heap_used"; static final String HEAP_USED_IN_BYTES = "heap_used_in_bytes"; static final String HEAP_USED_PERCENT = "heap_used_percent"; static final String HEAP_MAX = "heap_max"; static final String HEAP_MAX_IN_BYTES = "heap_max_in_bytes"; static final String HEAP_COMMITTED = "heap_committed"; static final String HEAP_COMMITTED_IN_BYTES = "heap_committed_in_bytes"; static final String NON_HEAP_USED = "non_heap_used"; static final String NON_HEAP_USED_IN_BYTES = "non_heap_used_in_bytes"; static final String NON_HEAP_COMMITTED = "non_heap_committed"; static final String NON_HEAP_COMMITTED_IN_BYTES = "non_heap_committed_in_bytes"; static final String POOLS = "pools"; static final String USED = "used"; static final String USED_IN_BYTES = "used_in_bytes"; static final String MAX = "max"; static final String MAX_IN_BYTES = "max_in_bytes"; static final String PEAK_USED = "peak_used"; static final String PEAK_USED_IN_BYTES = "peak_used_in_bytes"; static final String PEAK_MAX = "peak_max"; static final String PEAK_MAX_IN_BYTES = "peak_max_in_bytes"; static final String THREADS = "threads"; static final String COUNT = "count"; static final String PEAK_COUNT = "peak_count"; static final String GC = "gc"; static final String COLLECTORS = "collectors"; static final String COLLECTION_COUNT = "collection_count"; static final String COLLECTION_TIME = "collection_time"; static final String COLLECTION_TIME_IN_MILLIS = "collection_time_in_millis"; static final String BUFFER_POOLS = "buffer_pools"; static final String TOTAL_CAPACITY = "total_capacity"; static final String TOTAL_CAPACITY_IN_BYTES = "total_capacity_in_bytes"; static final String CLASSES = "classes"; static final String CURRENT_LOADED_COUNT = "current_loaded_count"; static final String TOTAL_LOADED_COUNT = "total_loaded_count"; static final String TOTAL_UNLOADED_COUNT = "total_unloaded_count"; } public static class GarbageCollectors implements Iterable<GarbageCollector> { private final GarbageCollector[] collectors; public GarbageCollectors(GarbageCollector[] collectors) { this.collectors = collectors; } public GarbageCollector[] getCollectors() { return this.collectors; } @Override public Iterator<GarbageCollector> iterator() { return Arrays.stream(collectors).iterator(); } } public static class GarbageCollector { private final String name; private final long collectionCount; private final long collectionTime; public GarbageCollector(String name, long collectionCount, long collectionTime) { this.name = name; this.collectionCount = collectionCount; this.collectionTime = collectionTime; } public String getName() { return this.name; } public long getCollectionCount() { return this.collectionCount; } public TimeValue getCollectionTime() { return new TimeValue(collectionTime, TimeUnit.MILLISECONDS); } @Override public String toString() { StringBuilder sb = new StringBuilder(name); sb.append(": collection count: ").append(collectionCount); sb.append(", collection time: ").append(getCollectionTime().getStringRep()); return sb.toString(); } } public static class Threads { private final int count; private final int peakCount; public Threads(int count, int peakCount) { this.count = count; this.peakCount = peakCount; } public int getCount() { return count; } public int getPeakCount() { return peakCount; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("count: ").append(count).append(", peak count: ").append(peakCount); return sb.toString(); } } public static class MemoryPool { private final String name; private final long used; private final long max; private final long peakUsed; private final long peakMax; public MemoryPool(String name, long used, long max, long peakUsed, long peakMax) { this.name = name; this.used = used; this.max = max; this.peakUsed = peakUsed; this.peakMax = peakMax; } public String getName() { return this.name; } public ByteSizeValue getUsed() { return new ByteSizeValue(used); } public ByteSizeValue getMax() { return new ByteSizeValue(max); } public ByteSizeValue getPeakUsed() { return new ByteSizeValue(peakUsed); } public ByteSizeValue getPeakMax() { return new ByteSizeValue(peakMax); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("name: ").append(name).append(", used: ").append(getUsed().toString()); sb.append(", max: ").append(getMax().toString()).append(", peak used: ").append(getPeakUsed().toString()); sb.append(", peak max: ").append(getPeakMax().toString()); return sb.toString(); } } public static class Mem implements Iterable<MemoryPool> { private final long heapCommitted; private final long heapUsed; private final long heapMax; private final long nonHeapCommitted; private final long nonHeapUsed; private final List<MemoryPool> pools; public Mem(long heapCommitted, long heapUsed, long heapMax, long nonHeapCommitted, long nonHeapUsed, List<MemoryPool> pools) { this.heapCommitted = heapCommitted; this.heapUsed = heapUsed; this.heapMax = heapMax; this.nonHeapCommitted = nonHeapCommitted; this.nonHeapUsed = nonHeapUsed; this.pools = pools; } @Override public Iterator<MemoryPool> iterator() { return pools.iterator(); } public ByteSizeValue getHeapCommitted() { return new ByteSizeValue(heapCommitted); } public ByteSizeValue getHeapUsed() { return new ByteSizeValue(heapUsed); } /** * returns the maximum heap size. 0 bytes signals unknown. */ public ByteSizeValue getHeapMax() { return new ByteSizeValue(heapMax); } /** * returns the heap usage in percent. -1 signals unknown. */ public short getHeapUsedPercent() { if (heapMax == 0) { return -1; } return (short) (heapUsed * 100 / heapMax); } public ByteSizeValue getNonHeapCommitted() { return new ByteSizeValue(nonHeapCommitted); } public ByteSizeValue getNonHeapUsed() { return new ByteSizeValue(nonHeapUsed); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("heap committed: ").append(getHeapCommitted().toString()); sb.append(", heap used: ").append(getHeapUsed().toString()); sb.append(", heap max: ").append(getHeapMax().toString()); sb.append(", non heap committed: ").append(getNonHeapCommitted().toString()); sb.append(", non heap used: ").append(getNonHeapUsed().toString()); sb.append("\nMem pools: "); for (MemoryPool memoryPool : pools) { sb.append(memoryPool.toString()).append("\n"); } return sb.toString(); } } public static class BufferPool { private final String name; private final long count; private final long totalCapacity; private final long used; public BufferPool(String name, long count, long totalCapacity, long used) { this.name = name; this.count = count; this.totalCapacity = totalCapacity; this.used = used; } public String getName() { return this.name; } public long getCount() { return this.count; } public ByteSizeValue getTotalCapacity() { return new ByteSizeValue(totalCapacity); } public ByteSizeValue getUsed() { return new ByteSizeValue(used); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("name: ").append(name).append(", count: ").append(count); sb.append("total capacity: ").append(totalCapacity).append(", used: ").append(used); return sb.toString(); } } public static class Classes { private final long loadedClassCount; private final long totalLoadedClassCount; private final long unloadedClassCount; public Classes(long loadedClassCount, long totalLoadedClassCount, long unloadedClassCount) { this.loadedClassCount = loadedClassCount; this.totalLoadedClassCount = totalLoadedClassCount; this.unloadedClassCount = unloadedClassCount; } public long getLoadedClassCount() { return loadedClassCount; } public long getTotalLoadedClassCount() { return totalLoadedClassCount; } public long getUnloadedClassCount() { return unloadedClassCount; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Classes: ").append("loaded: ").append(loadedClassCount); sb.append(", total loaded: ").append(totalLoadedClassCount); sb.append(", unloaded: ").append(unloadedClassCount); return sb.toString(); } } }
{ "content_hash": "4bd472c00a98b3f181529e032e88d646", "timestamp": "", "source": "github", "line_count": 480, "max_line_length": 118, "avg_line_length": 36.4125, "alnum_prop": 0.6220963496967616, "repo_name": "imay/palo", "id": "a758f36637a362f94e7af0dbd3a26240d2f0f112", "size": "17478", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fe/src/main/java/org/apache/doris/monitor/jvm/JvmStats.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "439083" }, { "name": "C++", "bytes": "9302365" }, { "name": "CMake", "bytes": "59781" }, { "name": "CSS", "bytes": "3843" }, { "name": "Java", "bytes": "6067362" }, { "name": "JavaScript", "bytes": "383133" }, { "name": "Lex", "bytes": "28991" }, { "name": "Makefile", "bytes": "9065" }, { "name": "Protocol Buffer", "bytes": "6901" }, { "name": "Python", "bytes": "124344" }, { "name": "Shell", "bytes": "31602" }, { "name": "Thrift", "bytes": "168000" }, { "name": "Yacc", "bytes": "96795" } ] }
class PrefService; namespace policy { class ConfigurationPolicyProvider; #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) class ChromeBrowserCloudManagementController; class MachineLevelUserCloudPolicyManager; #endif // Extends BrowserPolicyConnector with the setup shared among the desktop // implementations and Android. class ChromeBrowserPolicyConnector : public BrowserPolicyConnector { public: // Service initialization delay time in millisecond on startup. (So that // displaying Chrome's GUI does not get delayed.) static const int64_t kServiceInitializationStartupDelay = 5000; // Builds an uninitialized ChromeBrowserPolicyConnector, suitable for testing. // Init() should be called to create and start the policy machinery. ChromeBrowserPolicyConnector(); ~ChromeBrowserPolicyConnector() override; // Called once the resource bundle has been created. Calls through to super // class to notify observers. void OnResourceBundleCreated(); void Init(PrefService* local_state, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory) override; bool IsEnterpriseManaged() const override; bool HasMachineLevelPolicies() override; void Shutdown() override; ConfigurationPolicyProvider* GetPlatformProvider(); #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) ChromeBrowserCloudManagementController* chrome_browser_cloud_management_controller() { return chrome_browser_cloud_management_controller_.get(); } MachineLevelUserCloudPolicyManager* machine_level_user_cloud_policy_manager() { return machine_level_user_cloud_policy_manager_; } #endif protected: // BrowserPolicyConnector: std::vector<std::unique_ptr<policy::ConfigurationPolicyProvider>> CreatePolicyProviders() override; private: std::unique_ptr<ConfigurationPolicyProvider> CreatePlatformProvider(); // Owned by base class. ConfigurationPolicyProvider* platform_provider_ = nullptr; #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) std::unique_ptr<ChromeBrowserCloudManagementController> chrome_browser_cloud_management_controller_; // Owned by base class. MachineLevelUserCloudPolicyManager* machine_level_user_cloud_policy_manager_ = nullptr; #endif DISALLOW_COPY_AND_ASSIGN(ChromeBrowserPolicyConnector); }; } // namespace policy #endif // CHROME_BROWSER_POLICY_CHROME_BROWSER_POLICY_CONNECTOR_H_
{ "content_hash": "d86130877eb4ecf2b1ad925f206187fd", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 80, "avg_line_length": 31.592105263157894, "alnum_prop": 0.7775926697209496, "repo_name": "endlessm/chromium-browser", "id": "c1d13b9fa8528b48cf0a6c5df94db46a1481afde", "size": "2920", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chrome/browser/policy/chrome_browser_policy_connector.h", "mode": "33188", "license": "bsd-3-clause", "language": [] }
<?php namespace Maltronic\Bundle\ConfigSwitcherBundle; use Maltronic\Bundle\DependencyInjection\Security\Factory\ConfigSwitcherFactory; use Maltronic\Bundle\ConfigSwitcherBundle\DependencyInjection\Security\Factory\Sw; use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; /** * MaltronicConfigSwitcherBundle * * @author Malcolm Davis <maltronic.email@gmail.com> */ class MaltronicConfigSwitcherBundle extends Bundle { /** * {@inheritdoc} */ public function build(ContainerBuilder $container) { parent::build($container); /** @var SecurityExtension $extension */ $extension = $container->getExtension('security'); $extension->addSecurityListenerFactory(new ConfigSwitcherFactory()); } }
{ "content_hash": "87e3132286e838cbbb173a2e7ad97a9b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 82, "avg_line_length": 31.357142857142858, "alnum_prop": 0.7642369020501139, "repo_name": "Maltronic/ConfigSwitcherBundle", "id": "c265d52b34825d0f9030f4ed4277ad94b1f203de", "size": "878", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MaltronicSwitchboardBundle.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "3642" } ] }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:id="@+id/LinearLayout1" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.example.tetianapriadko.myapplication.Lesson105"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <Button android:id="@+id/btnAdd" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="onClick" android:text="@string/add"> </Button> <Button android:id="@+id/btnRemove" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="onClick" android:text="@string/remove"> </Button> <Button android:id="@+id/btnReplace" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="onClick" android:text="@string/replace"> </Button> <CheckBox android:id="@+id/chbStack" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/stack"> </CheckBox> </LinearLayout> <FrameLayout android:id="@+id/frgmCont" android:layout_width="match_parent" android:layout_height="match_parent"> </FrameLayout> </LinearLayout>
{ "content_hash": "dfd7063af3739fa33c4d41153d6b83cd", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 72, "avg_line_length": 36.60377358490566, "alnum_prop": 0.6231958762886598, "repo_name": "ChipiHenzj/androidLessons", "id": "9613cc2cf68753277551fcccbbb618894bdd9a8c", "size": "1940", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MyApplication/app/src/main/res/layout/activity_lesson105.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "523433" } ] }
@interface WindowController : NSWindowController - (void)saveData; @end
{ "content_hash": "960d9826f8b3100100cc73ab9f74209c", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 48, "avg_line_length": 14.8, "alnum_prop": 0.7837837837837838, "repo_name": "sdrpa/DebtCalc", "id": "a2edf88eebd8bc728f6bcb98a8a19f16e0d6c1f1", "size": "100", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "DebtCalc/WindowController.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "9949" } ] }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="author" content="Niek van Ulzen"> <title>Veni Vidi Fietsie - Giroweek in de Dolomieten</title> <meta name="description" content= "In 2017 organiseert Veni Vidi Fietsie in samenwerking met hotel Lory weer een week vol met pasta en prachtige passen. Een week wielrennen in de Brenta Dolomieten vanuit het dorpje Molveno nabij het Gardameer." > <!-- Bootstrap Core CSS - Uses Bootswatch Flatly Theme: http://bootswatch.com/flatly/ --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- Favicon--> <link rel="icon" href="img/logo/favicon.png"> <!-- Custom CSS --> <link href="css/freelancer.css" rel="stylesheet"> <link href="css/owl.theme.css" rel="stylesheet"> <link href="css/owl.carousel.css" rel="stylesheet"> <link href="css/venividifietsie.css" rel="stylesheet"> <link href="css/venividifietsiegiro.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body id="page-top" class="index"> <!-- Navigation --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">Veni Vidi Fietsie</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li class="hidden"> <a href="#page-top"></a> </li> <li class="page-scroll"> <a href="#vvf-portfolio-giro">Info</a> </li> <li class="page-scroll"> <a href="#giro-hoogteprofielen">Passen</a> </li> <li class="page-scroll"> <a href="index.html">Terug</a> </li> </ul> </div> <!-- /.navbar-collapse --> </div> </nav> <!-- PROMOWEEK --> <!--Foto--> <header> <div class="container"> <div class="row"> <div class="col-xs-12 col-md-6 col-md-offset-3"> <img class="img-responsive" src="img/logo/venividifietsiekopie300px.png" alt=""> <div class="intro-text"> <!--span class="name">Veni Vidi Fietsie</span> <hr class="star-light"--> <span class="skills">Giro di Molveno</span> </div> </div> </div> </div> </header> <!-- Giro di Molveno section --> <section id="vvf-portfolio-giro"> <div class="container"> <div class="row"> <div class="col-xs-12 text-center"> <div class="vvf-main-text"> <h2>Giro di Molveno</h2> <div class="tagline"> Ploegentactiek, linkeballen en la maglia rosa... </div> <p> Je eigen Giro d'Italia met ploegen, kopmannen & knechten, een proloog, tijdrit, sprint- en bergetappes en dagelijks bijgehouden klassementen. In de jacht op het roze kunnen de renners tijdens de Giro di Molveno hun klimmerscapaciteiten ten enenmale etaleren aan het Italiaanse volk. Aanschouw de andere pedaalridders en overwin door een uitgekiende ploegentactiek! </p> </div> </div> </div> <div class="row"> <div class="col-sm-6 col-xs-12 portfolio-item"> <a href="#GiroModal1" class="portfolio-link" data-toggle="modal"> <img src="img/portfolio/vlak_info.jpg" class="img-responsive" alt=""> </a> </div> <div class="col-sm-6 col-xs-12 portfolio-item"> <a href="#GiroModal2" class="portfolio-link" data-toggle="modal"> <img src="img/portfolio/vlak_users.jpg" class="img-responsive" alt=""> </a> </div> <!--div class="col-sm-4 col-xs-12 portfolio-item"> <a href="#GiroModal3" class="portfolio-link" data-toggle="modal"> <img src="img/portfolio/vlak_euro.jpg" class="img-responsive" alt=""> </a> </div--> </div> </div> </section> <!--giro-hoogteprofielen--> <section id="giro-hoogteprofielen"> <div class="container-fluid"> <div class="row"> <div class="col-xs-12 text-center"> <div class="vvf-main-text"> <h2>Passen</h2> <div class="tagline"> Een greep uit de mogelijkheden... </div> </div> </div> </div> <div class="row"> <div class="col-xs-12 col-md-4 col-lg-4"> <div class="thumbnail vvf-thumbnail"> <div class="caption text-center"> <h3>Sella Andalo</h3> <div class="row"> <div class="col-xs-6"> <p><span class="fa fa-arrows-h" aria-hidden="true"></span> 14.30 km</p> </div> <div class="col-xs-6"> <p><span class="fa fa-arrows-v" aria-hidden="true"></span> 793 m</p> </div> <div class="col-xs-6"> <p><span>Gemiddeld</span> 5.4%</p> </div> <div class="col-xs-6"> <p><span>Maximaal</span> 10.2%</p> </div> </div> </div> <img src="img/hoogteprofielen/excelandalo2.png" alt="..."> </div> </div> <div class="col-xs-12 col-md-4 col-lg-4"> <div class="thumbnail vvf-thumbnail"> <div class="caption text-center"> <h3>Monte Bondone</h3> <div class="row"> <div class="col-xs-6"> <p><span class="fa fa-arrows-h" aria-hidden="true"></span> 17.47 km</p> </div> <div class="col-xs-6"> <p><span class="fa fa-arrows-v" aria-hidden="true"></span> 1372 m</p> </div> <div class="col-xs-6"> <p><span>Gemiddeld</span> 7.9%</p> </div> <div class="col-xs-6"> <p><span>Maximaal</span> 13%</p> </div> </div> </div> <img src="img/hoogteprofielen/excelbondone2.png" alt="..."> </div> </div> <div class="col-xs-12 col-md-4 col-lg-4"> <div class="thumbnail vvf-thumbnail"> <div class="caption text-center"> <h3>Passo Daone</h3> <div class="row"> <div class="col-xs-6"> <p><span class="fa fa-arrows-h" aria-hidden="true"></span> 8.40 km</p> </div> <div class="col-xs-6"> <p><span class="fa fa-arrows-v" aria-hidden="true"></span> 775 m</p> </div> <div class="col-xs-6"> <p><span>Gemiddeld</span> 9.2%</p> </div> <div class="col-xs-6"> <p><span>Maximaal</span> 14%</p> </div> </div> </div> <img src="img/hoogteprofielen/exceldaone2.png" alt="..."> </div> </div> </div> <div class="row"> <div class="col-xs-12 col-md-4 col-md-offset-4 text-center"> <a href="klimtijdrit.html" class="btn btn-lg vvf-btn-2 vvf-btn-video">KLIMTIJDRIT ERICA</a> </div> </div> </div> </section> <!-- Footer --> <footer class="text-center"> <div class="footer-below"> <div class="container"> <div class="row"> <div class="col-lg-12"> Copyright &copy; Veni Vidi Fietsie 2015 </div> </div> </div> </div> </footer> <!--POPUPS--> <!-- Portfolio Giro di Molveno Modals --> <div class="portfolio-modal modal fade" id="GiroModal1" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-content"> <div class="close-modal" data-dismiss="modal"> <div class="lr"> <div class="rl"> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-xs-12"> <div class="modal-body"> <h2>Hoe & Wat</h2> <hr class="star-primary"> <div class="row"> <div class="col-xs-12 text-left"> <div class="panel panel-default vvf-panel"> <div class="panel-heading">Giro di Molveno</div> <div class="panel-body"> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Het peloton wordt opgedeeld in gelijkwaardige teams</p> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Het team bestaat één of meerdere kopmannen, klimgeiten, sprinters en/of knechten</p> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Een dag bestaat uit een bepaalde route met verschillende soorten etappes</p> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Tijdens de etappes wordt om (berg)punten en/of tijd gestreden</p> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Tussen de etappes wordt er en groupe naar de volgende etappe gereden</p> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Veni Vidi Fietsie verzorgt de routes, start- en eindpunten en neemt de tijd/aankomsten waar</p> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Aan het einde van de dag wordt de balans opgemaakt en worden de truien uitgedeeld</p> </div> </div> </div> <div class="col-xs-12 text-left"> <div class="panel panel-default vvf-panel"> <div class="panel-heading">Hoe een dag eruit kan zien</div> <div class="panel-body"> <p> Omdat de vorige avond niemand iets snapte van de <span class="vvf-panel-label">ploegentactiek</span> wordt deze tijdens het volledig verzorgde ontbijt nog wat aangescherpt.De vertrektijd komt rap dichterbij en de bandjes worden nog snel op spanning gezet. Gelletjes ingeladen, bidonnetjes gevuld. </p> <p> Het peloton fietst en groupe richting het startpunt van de eerste etappe; een vlakke rit over 15 km bij uitstek geschikt voor <span class="vvf-panel-label"> rasavonturiers </span>en vroege vluchters. Zodra alle renners de meet zijn gepasseerd wordt kort gerecapituleerd. </p> <p> Dan op weg naar de start van de middagetappe: een bergetappe naar de top van de <span class="vvf-panel-label">Monte Bondone</span>. Er volgt een waar schouwspel op de flanken van deze illustere berg. Knechten worden opgebrand, kopmannen uitgespeeld. </p> <p> Aan de streep krijgen de benen eindelijk rust... maar die is van korte duur. Molveno roept en de renners maken zich klaar om de lange valsplatte route langs het meer te trotseren. De laatste finish van de dag ligt na een venijne <span class="vvf-panel-label">slotklim</span> bij het terras van hotel Lory, onder toeziend oog van de koersdirecteur en meegereisde fans. </p> </div> </div> </div> </div> <div class="btn-group btn-group-justified" role="group" aria-label="..."> <div class="btn-group btn-group-lg" role="group"> <button type="button" class="btn btn-default" data-dismiss="modal">Sluiten</button> </div> </div> </div> </div> </div> </div> </div> </div> <div class="portfolio-modal modal fade" id="GiroModal2" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-content"> <div class="close-modal" data-dismiss="modal"> <div class="lr"> <div class="rl"> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-xs-12"> <div class="modal-body"> <h2>Wie & Waar</h2> <hr class="star-primary"> <div class="row"> <div class="col-xs-12 text-left"> <div class="panel panel-default vvf-panel"> <div class="panel-heading">Voor groepen</div> <div class="panel-body"> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Van minimaal 10 tot maximaal 40 renners</p> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Die niet terug deinzen voor 80-150km per dag</p> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Die wel vaker in de bergen hebben gefietst</p> <p><span class="glyphicon glyphicon-hand-right vvf-panel-span" aria-hidden="true"></span>Die een fiks aantal hoogtemeters durven weg te tikken</p> </div> </div> </div> <div class="col-xs-12 text-left"> <div class="panel panel-default vvf-panel"> <div class="panel-heading">Standplaats Molveno</div> <div class="panel-body"> <p> Decors voor de Giro di Molveno zijn de bergen tussen het Gardameer en de Passo di Gavia. De koersdirectie heeft een tocht uitgestippeld over hoge pieken en door glooiende dalen. Onder andere de Monte Bondone, Passo Daone en Passo del Ballino staan op het program, maar ook peddelt het peloton door de Altopiano della Paganella en de vallei der meren en zien de renners een glimp van het Gardameer. </p> <p> Uitvalsbasis voor dit spektakel: Hotel Lory, Molveno. </p> </div> </div> </div> </div> <div class="btn-group btn-group-justified" role="group" aria-label="..."> <div class="btn-group btn-group-lg" role="group"> <button type="button" class="btn btn-default" data-dismiss="modal">Sluiten</button> </div> </div> </div> </div> </div> </div> </div> </div> <div class="portfolio-modal modal fade" id="GiroModal3" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-content"> <div class="close-modal" data-dismiss="modal"> <div class="lr"> <div class="rl"> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-xs-12"> <div class="modal-body"> <h2>Kosten & Zo</h2> <hr class="star-primary"> <p> Een Giro wordt altijd op maat aangeboden, de mogelijkheden zijn talloos en onder andere afhankelijk van groepsgrootte, verblijfsduur, niveau en specifieke wensen van de renners. </p> <div class="row"> <div class="col-xs-12 text-left"> <div class="panel panel-default vvf-panel"> <div class="panel-heading">Prijsvoorbeeld 20 renners/4 overnachtingen/3 Girodagen<br /> Inclusief</div> <div class="panel-body"> <p>4 overnachtingen, inclusief ontbijt en diner</p> <p>3 dagen fietsen</p> <p>Routeboek en routes in gpx</p> <p>Begeleiding per auto of fiets</p> <p>Up-to-date rangen en standen</p> <p>Bijbehorende leiderstruien</p> </div> <div class="panel-footer"> <p><span class="glyphicon glyphicon-euro" aria-hidden="true"></span> 350,- per persoon</p> </div> </div> </div> <div class="col-xs-12 text-left"> <div class="panel panel-default vvf-panel"> <div class="panel-heading">Exclusief</div> <div class="panel-body"> <p>Vervoer Nederland-Italië en terug</p> <p>Racefiets</p> <p>Lunch en eten/drinken voor onderweg</p> <p>Helm, reparatiesetje, etc</p> </div> </div> </div> <div class="col-xs-12 text-left"> <div class="panel panel-default vvf-panel"> <div class="panel-heading">Optioneel</div> <div class="panel-body"> <p>Lunch: Picnic of pasta</p> <p>Pastabuffet in hotel</p> <p>Bezoek museum en wijnproeverij Francesco Moser</p> <p>Dagje Stelvio of Gavia/Mortirolo</p> </div> </div> </div> </div> <div class="btn-group btn-group-justified" role="group" aria-label="..."> <div class="btn-group btn-group-lg" role="group"> <button type="button" class="btn btn-default" data-dismiss="modal">Sluiten</button> </div> </div> </div> </div> </div> </div> </div> </div> <!-- jQuery --> <script src="js/jquery.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Plugin JavaScript --> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> <script src="js/classie.js"></script> <script src="js/cbpAnimatedHeader.js"></script> <!-- Contact Form JavaScript --> <script src="js/jqBootstrapValidation.js"></script> <script src="js/contact_me.js"></script> <!-- Custom Theme JavaScript --> <script src="js/freelancer.js"></script> <script src="js/owl.carousel.js"></script> <script src="js/venividifietsie.js"></script> </body> </html>
{ "content_hash": "a93546e2cd123db753ffe3c8818615a4", "timestamp": "", "source": "github", "line_count": 467, "max_line_length": 248, "avg_line_length": 54.224839400428266, "alnum_prop": 0.42060577340757416, "repo_name": "Oekidoebi/GiroDiMolveno", "id": "f1084e09d2ff3a73abc6652f758449008e9e5d36", "size": "25326", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "site/giroweek.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "311518" }, { "name": "HTML", "bytes": "295283" }, { "name": "JavaScript", "bytes": "211214" }, { "name": "PHP", "bytes": "1437" } ] }
package parser import ( "testing" "github.com/elm-tangram/tangram/ast" "github.com/elm-tangram/tangram/report" "github.com/elm-tangram/tangram/source" "github.com/elm-tangram/tangram/token" "github.com/stretchr/testify/require" ) func TestResolvePattern(t *testing.T) { r := newTestResolver(t) newScope := func() *ast.NodeScope { return scopeWithObjects( ast.NewObject("Just", ast.Ctor, nil), ast.NewObject("Int", ast.Typ, nil), ast.NewObject("String", ast.Typ, nil), ) } t.Run("AliasPattern", func(t *testing.T) { require := require.New(t) scope := newScope() r.resolvePattern(scope, &ast.AliasPattern{ Name: ast.NewIdent("foo", token.NoPos), Pattern: &ast.LiteralPattern{ &ast.BasicLit{ Type: ast.Int, Value: "1", }, }, }) require.Len(scope.Objects, 1) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["foo"]) require.True(r.reporter.IsOK()) }) t.Run("CtorPattern", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.CtorPattern{ Ctor: ast.NewIdent("Just", token.NoPos), Args: []ast.Pattern{ &ast.VarPattern{ast.NewIdent("a", token.NoPos)}, }, } r.resolvePattern(scope, node) require.Len(scope.Objects, 1) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["a"]) assertObj(t, node.Ctor, "Just") require.True(r.reporter.IsOK()) }) t.Run("TuplePattern", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.TuplePattern{ Elems: []ast.Pattern{ &ast.VarPattern{ast.NewIdent("a", token.NoPos)}, &ast.VarPattern{ast.NewIdent("b", token.NoPos)}, }, } r.resolvePattern(scope, node) require.Len(scope.Objects, 2) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["a"]) require.NotNil(scope.Objects["b"]) require.True(r.reporter.IsOK()) }) t.Run("ListPattern", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.ListPattern{ Elems: []ast.Pattern{ &ast.VarPattern{ast.NewIdent("a", token.NoPos)}, &ast.VarPattern{ast.NewIdent("b", token.NoPos)}, }, } r.resolvePattern(scope, node) require.Len(scope.Objects, 2) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["a"]) require.NotNil(scope.Objects["b"]) require.True(r.reporter.IsOK()) }) t.Run("RecordPattern", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.RecordPattern{ Fields: []ast.Pattern{ &ast.VarPattern{ast.NewIdent("a", token.NoPos)}, &ast.VarPattern{ast.NewIdent("b", token.NoPos)}, new(ast.AnythingPattern), }, } r.resolvePattern(scope, node) require.Len(scope.Objects, 2) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["a"]) require.NotNil(scope.Objects["b"]) require.True(r.reporter.IsOK()) }) t.Run("VarPattern", func(t *testing.T) { require := require.New(t) scope := newScope() r.resolvePattern(scope, &ast.VarPattern{ast.NewIdent("a", token.NoPos)}) require.Len(scope.Objects, 1) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["a"]) require.True(r.reporter.IsOK()) }) } func TestResolveType(t *testing.T) { r := newTestResolver(t) newScope := func() *ast.NodeScope { return scopeWithObjects( ast.NewObject("Int", ast.Typ, nil), ast.NewObject("String", ast.Typ, nil), ast.NewObject("Result", ast.Typ, nil), ) } t.Run("NamedType", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.NamedType{ Name: ast.NewIdent("Result", token.NoPos), Args: []ast.Type{ &ast.NamedType{Name: ast.NewIdent("String", token.NoPos)}, &ast.NamedType{Name: ast.NewIdent("Int", token.NoPos)}, }, } r.resolveType(scope, node, false) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Name, "Result") assertObj(t, node.Args[0].(*ast.NamedType).Name, "String") assertObj(t, node.Args[1].(*ast.NamedType).Name, "Int") require.True(r.reporter.IsOK()) }) t.Run("VarType", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.VarType{ast.NewIdent("a", token.NoPos)} r.resolveType(scope, node, false) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) require.Nil(node.Obj) require.True(r.reporter.IsOK()) }) t.Run("FuncType", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.FuncType{ Args: []ast.Type{ &ast.NamedType{Name: ast.NewIdent("String", token.NoPos)}, &ast.NamedType{Name: ast.NewIdent("Int", token.NoPos)}, }, Return: &ast.NamedType{Name: ast.NewIdent("Int", token.NoPos)}, } r.resolveType(scope, node, false) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Return.(*ast.NamedType).Name, "Int") assertObj(t, node.Args[0].(*ast.NamedType).Name, "String") assertObj(t, node.Args[1].(*ast.NamedType).Name, "Int") require.True(r.reporter.IsOK()) }) t.Run("TupleType", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.TupleType{ Elems: []ast.Type{ &ast.NamedType{Name: ast.NewIdent("String", token.NoPos)}, &ast.NamedType{Name: ast.NewIdent("Int", token.NoPos)}, }, } r.resolveType(scope, node, false) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Elems[0].(*ast.NamedType).Name, "String") assertObj(t, node.Elems[1].(*ast.NamedType).Name, "Int") require.True(r.reporter.IsOK()) }) t.Run("RecordType", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.RecordType{ Fields: []*ast.RecordField{ { Name: ast.NewIdent("x", token.NoPos), Type: &ast.NamedType{Name: ast.NewIdent("Int", token.NoPos)}, }, { Name: ast.NewIdent("y", token.NoPos), Type: &ast.NamedType{Name: ast.NewIdent("Int", token.NoPos)}, }, }, } r.resolveType(scope, node, false) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) require.Nil(node.Fields[0].Name.Obj) assertObj(t, node.Fields[0].Type.(*ast.NamedType).Name, "Int") require.Nil(node.Fields[1].Name.Obj) assertObj(t, node.Fields[1].Type.(*ast.NamedType).Name, "Int") require.True(r.reporter.IsOK()) }) t.Run("RecordType repeated fields", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.RecordType{ Fields: []*ast.RecordField{ { Name: ast.NewIdent("x", token.NoPos), Type: &ast.NamedType{Name: ast.NewIdent("Int", token.NoPos)}, }, { Name: ast.NewIdent("x", token.NoPos), Type: &ast.NamedType{Name: ast.NewIdent("Int", token.NoPos)}, }, }, } r.resolveType(scope, node, false) assertReports(t, r.reporter, new(report.RepeatedFieldError)) require.False(r.reporter.IsOK()) }) } func TestResolveDecl(t *testing.T) { r := newTestResolver(t) newScope := func() *ast.NodeScope { return scopeWithObjects( ast.NewObject("Int", ast.Typ, nil), ast.NewObject("String", ast.Typ, nil), ast.NewObject("Result", ast.Typ, nil), ast.NewObject("c", ast.Var, nil), ast.NewObject("d", ast.Var, nil), ast.NewObject("?", ast.Var, nil), ast.NewObject("A", ast.Ctor, nil), ) } t.Run("DestructuringAssignment", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.DestructuringAssignment{ Pattern: &ast.TuplePattern{ Elems: []ast.Pattern{ &ast.VarPattern{ast.NewIdent("a", token.NoPos)}, &ast.VarPattern{ast.NewIdent("b", token.NoPos)}, }, }, Expr: &ast.TupleLit{ Elems: []ast.Expr{ ast.NewIdent("c", token.NoPos), ast.NewIdent("d", token.NoPos), }, }, } r.resolveDecl(scope, node) require.Len(scope.Objects, 2) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["a"]) require.NotNil(scope.Objects["b"]) assertObj(t, node.Expr.(*ast.TupleLit).Elems[0], "c") assertObj(t, node.Expr.(*ast.TupleLit).Elems[1], "d") require.True(r.reporter.IsOK()) }) t.Run("InfixDecl", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.InfixDecl{ Op: ast.NewIdent("?", token.NoPos), } r.resolveDecl(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Op, "?") require.True(r.reporter.IsOK()) }) t.Run("Definition", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.Definition{ Annotation: &ast.TypeAnnotation{ Type: &ast.FuncType{ Args: []ast.Type{ &ast.NamedType{Name: ast.NewIdent("String", token.NoPos)}, &ast.NamedType{Name: ast.NewIdent("Int", token.NoPos)}, }, Return: &ast.NamedType{Name: ast.NewIdent("String", token.NoPos)}, }, }, Name: ast.NewIdent("formatNum", token.NoPos), Args: []ast.Pattern{ &ast.VarPattern{ast.NewIdent("format", token.NoPos)}, &ast.VarPattern{ast.NewIdent("n", token.NoPos)}, }, Body: ast.NewIdent("c", token.NoPos), } r.resolveDecl(scope, node) require.Len(scope.Objects, 1) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["formatNum"]) assertObj(t, node.Annotation.Type.(*ast.FuncType).Args[0].(*ast.NamedType).Name, "String") assertObj(t, node.Annotation.Type.(*ast.FuncType).Args[1].(*ast.NamedType).Name, "Int") assertObj(t, node.Annotation.Type.(*ast.FuncType).Return.(*ast.NamedType).Name, "String") assertObj(t, node.Body, "c") require.Len(scope.Children(), 1) scope = scope.Children()[0] require.Len(scope.Objects, 2) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["format"]) require.NotNil(scope.Objects["n"]) require.True(r.reporter.IsOK()) }) t.Run("AliasDecl", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.AliasDecl{ Name: ast.NewIdent("FancyResult", token.NoPos), Args: []*ast.Ident{ ast.NewIdent("a", token.NoPos), ast.NewIdent("b", token.NoPos), }, Type: &ast.NamedType{ Name: ast.NewIdent("Result", token.NoPos), Args: []ast.Type{ &ast.VarType{ast.NewIdent("a", token.NoPos)}, &ast.VarType{ast.NewIdent("b", token.NoPos)}, }, }, } r.resolveDecl(scope, node) require.Len(scope.Objects, 1) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["FancyResult"]) assertObj(t, node.Type.(*ast.NamedType).Name, "Result") require.True(r.reporter.IsOK()) }) t.Run("AliasDecl repeated var types", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.AliasDecl{ Name: ast.NewIdent("FancyResult", token.NoPos), Args: []*ast.Ident{ ast.NewIdent("a", token.NoPos), ast.NewIdent("a", token.NoPos), }, Type: &ast.NamedType{ Name: ast.NewIdent("Result", token.NoPos), Args: []ast.Type{ &ast.VarType{ast.NewIdent("a", token.NoPos)}, &ast.VarType{ast.NewIdent("a", token.NoPos)}, }, }, } r.resolveDecl(scope, node) require.False(r.reporter.IsOK()) assertReports(t, r.reporter, new(report.RepeatedVarTypeError)) }) t.Run("UnionDecl", func(t *testing.T) { r := newTestResolver(t) require := require.New(t) scope := newScope() node := &ast.UnionDecl{ Name: ast.NewIdent("Maybe", token.NoPos), Args: []*ast.Ident{ ast.NewIdent("a", token.NoPos), }, Ctors: []*ast.Constructor{ &ast.Constructor{ Name: ast.NewIdent("Just", token.NoPos), Args: []ast.Type{ &ast.VarType{ast.NewIdent("a", token.NoPos)}, }, }, &ast.Constructor{ Name: ast.NewIdent("Nothing", token.NoPos), }, }, } r.resolveDecl(scope, node) require.Len(scope.Objects, 3) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["Maybe"]) require.NotNil(scope.Objects["Just"]) require.NotNil(scope.Objects["Nothing"]) require.Len(r.reporter.Reports("test"), 0) require.True(r.reporter.IsOK()) }) t.Run("UnionDecl repeated vars", func(t *testing.T) { r := newTestResolver(t) require := require.New(t) scope := newScope() node := &ast.UnionDecl{ Name: ast.NewIdent("Result", token.NoPos), Args: []*ast.Ident{ ast.NewIdent("a", token.NoPos), ast.NewIdent("a", token.NoPos), }, Ctors: []*ast.Constructor{ &ast.Constructor{ Name: ast.NewIdent("Foo", token.NoPos), }, }, } r.resolveDecl(scope, node) require.False(r.reporter.IsOK()) assertReports(t, r.reporter, new(report.RepeatedVarTypeError)) }) t.Run("UnionDecl repeated ctor", func(t *testing.T) { r := newTestResolver(t) require := require.New(t) scope := newScope() node := &ast.UnionDecl{ Name: ast.NewIdent("Cmp", token.NoPos), Ctors: []*ast.Constructor{ &ast.Constructor{Name: ast.NewIdent("Gt", token.NoPos)}, &ast.Constructor{Name: ast.NewIdent("Gt", token.NoPos)}, }, } r.resolveDecl(scope, node) require.False(r.reporter.IsOK()) assertReports(t, r.reporter, new(report.RepeatedCtorError)) }) } func TestResolveQualifiedName(t *testing.T) { parent := ast.NewModuleScope(nil) fooBarBazMod := &ast.Module{ Scope: modScopeWithObjects( ast.NewObject("Qux", ast.Typ, nil), ), } parent.ImportModule(ast.NewObject("Foo.Bar.Baz", ast.Mod, fooBarBazMod)) fooBarMod := &ast.Module{ Scope: modScopeWithObjects( ast.NewObject("qux", ast.Var, nil), ast.NewObject("Gux", ast.Ctor, nil), ), } parent.ImportModule(ast.NewObject("Foo.Bar", ast.Mod, fooBarMod)) scope := ast.NewNodeScope(nil, parent) r := newTestResolver(t) fooBarBazPath := []*ast.Ident{ ast.NewIdent("Foo", token.NoPos), ast.NewIdent("Bar", token.NoPos), ast.NewIdent("Baz", token.NoPos), } fooBarPath := []*ast.Ident{ ast.NewIdent("Foo", token.NoPos), ast.NewIdent("Bar", token.NoPos), } t.Run("Type", func(t *testing.T) { ident := ast.NewIdent("Qux", token.NoPos) node := ast.NewSelectorExpr(append(fooBarBazPath, ident)...) r.resolveQualifiedName(scope, node, ast.Typ) for _, id := range fooBarBazPath { assertObj(t, id, "Foo.Bar.Baz") } assertObj(t, ident, "Qux") require.True(t, r.reporter.IsOK()) }) t.Run("Var", func(t *testing.T) { ident := ast.NewIdent("qux", token.NoPos) node := ast.NewSelectorExpr(append(fooBarPath, ident)...) r.resolveQualifiedName(scope, node, ast.Var) for _, id := range fooBarPath { assertObj(t, id, "Foo.Bar") } assertObj(t, ident, "qux") require.True(t, r.reporter.IsOK()) }) t.Run("Ctor", func(t *testing.T) { ident := ast.NewIdent("Gux", token.NoPos) node := ast.NewSelectorExpr(append(fooBarPath, ident)...) r.resolveQualifiedName(scope, node, ast.Var) for _, id := range fooBarPath { assertObj(t, id, "Foo.Bar") } assertObj(t, ident, "Gux") require.True(t, r.reporter.IsOK()) }) t.Run("Var field", func(t *testing.T) { ident := ast.NewIdent("qux", token.NoPos) field := ast.NewIdent("f", token.NoPos) node := ast.NewSelectorExpr(append(fooBarPath, ident, field)...) r.resolveQualifiedName(scope, node, ast.Var) for _, id := range fooBarPath { assertObj(t, id, "Foo.Bar") } assertObj(t, ident, "qux") require.Nil(t, field.Obj) require.True(t, r.reporter.IsOK()) }) t.Run("Module not imported", func(t *testing.T) { r := newTestResolver(t) node := ast.NewSelectorExpr( ast.NewIdent("Foo", token.NoPos), ast.NewIdent("bar", token.NoPos), ) r.resolveQualifiedName(scope, node, ast.Var) assertReports(t, r.reporter, new(report.ModuleNotImportedError)) require.False(t, r.reporter.IsOK()) }) t.Run("Import error", func(t *testing.T) { r := newTestResolver(t) node := ast.NewSelectorExpr(append(fooBarPath, ast.NewIdent("fux", token.NoPos))...) r.resolveQualifiedName(scope, node, ast.Var) assertReports(t, r.reporter, new(report.ImportError)) require.False(t, r.reporter.IsOK()) }) } func TestResolveExpr(t *testing.T) { r := newTestResolver(t) newScope := func() *ast.NodeScope { return scopeWithObjects( ast.NewObject("a", ast.Var, nil), ast.NewObject("b", ast.Var, nil), ast.NewObject("c", ast.Var, nil), ast.NewObject("Just", ast.Ctor, nil), ast.NewObject("Nothing", ast.Ctor, nil), ast.NewObject("-", ast.Var, nil), ast.NewObject("+", ast.Var, nil), ) } t.Run("IfExpr", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.IfExpr{ Cond: ast.NewIdent("a", token.NoPos), ThenExpr: ast.NewIdent("b", token.NoPos), ElseExpr: ast.NewIdent("c", token.NoPos), } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Cond, "a") assertObj(t, node.ThenExpr, "b") assertObj(t, node.ElseExpr, "c") require.True(r.reporter.IsOK()) }) t.Run("CaseExpr", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.CaseExpr{ Expr: ast.NewIdent("a", token.NoPos), Branches: []*ast.CaseBranch{ { Pattern: &ast.CtorPattern{ Ctor: ast.NewIdent("Just", token.NoPos), Args: []ast.Pattern{ &ast.VarPattern{ast.NewIdent("d", token.NoPos)}, }, }, Expr: ast.NewIdent("d", token.NoPos), }, { Pattern: &ast.CtorPattern{ Ctor: ast.NewIdent("Nothing", token.NoPos), }, Expr: ast.NewIdent("c", token.NoPos), }, }, } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Expr, "a") assertObj(t, node.Branches[0].Pattern.(*ast.CtorPattern).Ctor, "Just") assertObj(t, node.Branches[0].Expr, "d") assertObj(t, node.Branches[1].Pattern.(*ast.CtorPattern).Ctor, "Nothing") assertObj(t, node.Branches[1].Expr, "c") require.True(r.reporter.IsOK()) }) t.Run("LetExpr", func(t *testing.T) { require := require.New(t) scope := newScope() xDecl := &ast.Definition{ Name: ast.NewIdent("x", token.NoPos), Body: ast.NewIdent("a", token.NoPos), } yDecl := &ast.Definition{ Name: ast.NewIdent("y", token.NoPos), Body: ast.NewIdent("b", token.NoPos), } node := &ast.LetExpr{ Decls: []ast.Decl{ xDecl, yDecl, }, Body: &ast.BinaryOp{ Op: ast.NewIdent("+", token.NoPos), Lhs: ast.NewIdent("y", token.NoPos), Rhs: ast.NewIdent("x", token.NoPos), }, } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) require.Len(scope.Children(), 1) scope = scope.Children()[0] require.Len(scope.Objects, 2) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["x"]) require.NotNil(scope.Objects["y"]) expr := node.Body.(*ast.BinaryOp) assertObj(t, expr.Op, "+") assertObj(t, expr.Rhs, "x") assertObj(t, expr.Lhs, "y") require.True(r.reporter.IsOK()) }) t.Run("TupleLit", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.TupleLit{ Elems: []ast.Expr{ ast.NewIdent("a", token.NoPos), ast.NewIdent("b", token.NoPos), ast.NewIdent("c", token.NoPos), }, } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Elems[0], "a") assertObj(t, node.Elems[1], "b") assertObj(t, node.Elems[2], "c") require.True(r.reporter.IsOK()) }) t.Run("ListLit", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.ListLit{ Elems: []ast.Expr{ ast.NewIdent("a", token.NoPos), ast.NewIdent("b", token.NoPos), ast.NewIdent("c", token.NoPos), }, } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Elems[0], "a") assertObj(t, node.Elems[1], "b") assertObj(t, node.Elems[2], "c") require.True(r.reporter.IsOK()) }) t.Run("FuncApp", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.FuncApp{ Func: ast.NewIdent("a", token.NoPos), Args: []ast.Expr{ ast.NewIdent("b", token.NoPos), ast.NewIdent("c", token.NoPos), }, } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Func, "a") assertObj(t, node.Args[0], "b") assertObj(t, node.Args[1], "c") require.True(r.reporter.IsOK()) }) t.Run("RecordLit", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.RecordLit{ Fields: []*ast.FieldAssign{ {Field: ast.NewIdent("x", token.NoPos), Expr: ast.NewIdent("a", token.NoPos)}, {Field: ast.NewIdent("y", token.NoPos), Expr: ast.NewIdent("b", token.NoPos)}, }, } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) require.Nil(node.Fields[0].Field.Obj) assertObj(t, node.Fields[0].Expr, "a") require.Nil(node.Fields[1].Field.Obj) assertObj(t, node.Fields[1].Expr, "b") require.True(r.reporter.IsOK()) }) t.Run("RecordLit repeated field", func(t *testing.T) { require := require.New(t) r := newTestResolver(t) scope := newScope() node := &ast.RecordLit{ Fields: []*ast.FieldAssign{ {Field: ast.NewIdent("x", token.NoPos), Expr: ast.NewIdent("a", token.NoPos)}, {Field: ast.NewIdent("x", token.NoPos)}, }, } r.resolveExpr(scope, node) require.False(r.reporter.IsOK()) assertReports(t, r.reporter, new(report.RepeatedFieldError)) }) t.Run("RecordUpdate", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.RecordUpdate{ Record: ast.NewIdent("c", token.NoPos), Fields: []*ast.FieldAssign{ {Field: ast.NewIdent("x", token.NoPos), Expr: ast.NewIdent("a", token.NoPos)}, {Field: ast.NewIdent("y", token.NoPos), Expr: ast.NewIdent("b", token.NoPos)}, }, } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Record, "c") require.Nil(node.Fields[0].Field.Obj) assertObj(t, node.Fields[0].Expr, "a") require.Nil(node.Fields[1].Field.Obj) assertObj(t, node.Fields[1].Expr, "b") require.True(r.reporter.IsOK()) }) t.Run("RecordUpdate repeated field", func(t *testing.T) { require := require.New(t) r := newTestResolver(t) scope := newScope() node := &ast.RecordUpdate{ Record: ast.NewIdent("c", token.NoPos), Fields: []*ast.FieldAssign{ {Field: ast.NewIdent("x", token.NoPos), Expr: ast.NewIdent("a", token.NoPos)}, {Field: ast.NewIdent("x", token.NoPos)}, }, } r.resolveExpr(scope, node) require.False(r.reporter.IsOK()) assertReports(t, r.reporter, new(report.RepeatedFieldError)) }) t.Run("UnaryOp", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.UnaryOp{ Op: ast.NewIdent("-", token.NoPos), Expr: ast.NewIdent("a", token.NoPos), } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Expr, "a") assertObj(t, node.Op, "-") require.True(r.reporter.IsOK()) }) t.Run("BinaryOp", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.BinaryOp{ Op: ast.NewIdent("-", token.NoPos), Lhs: ast.NewIdent("a", token.NoPos), Rhs: ast.NewIdent("b", token.NoPos), } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Lhs, "a") assertObj(t, node.Rhs, "b") assertObj(t, node.Op, "-") require.True(r.reporter.IsOK()) }) t.Run("Lambda", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.Lambda{ Args: []ast.Pattern{ &ast.VarPattern{ast.NewIdent("x", token.NoPos)}, &ast.VarPattern{ast.NewIdent("y", token.NoPos)}, }, Expr: &ast.BinaryOp{ Op: ast.NewIdent("+", token.NoPos), Lhs: ast.NewIdent("x", token.NoPos), Rhs: ast.NewIdent("y", token.NoPos), }, } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) require.Len(scope.Children(), 1) scope = scope.Children()[0] require.Len(scope.Objects, 2) require.Len(scope.Unresolved, 0) require.NotNil(scope.Objects["x"]) require.NotNil(scope.Objects["y"]) require.Nil(node.Args[0].(*ast.VarPattern).Name.Obj) require.Nil(node.Args[1].(*ast.VarPattern).Name.Obj) expr := node.Expr.(*ast.BinaryOp) assertObj(t, expr.Op, "+") assertObj(t, expr.Lhs, "x") assertObj(t, expr.Rhs, "y") require.True(r.reporter.IsOK()) }) t.Run("ParensExpr", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.ParensExpr{ Expr: ast.NewIdent("a", token.NoPos), } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) assertObj(t, node.Expr, "a") require.True(r.reporter.IsOK()) }) t.Run("AccessorExpr", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.AccessorExpr{ Field: ast.NewIdent("foo", token.NoPos), } r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) require.Nil(node.Field.Obj) require.True(r.reporter.IsOK()) }) t.Run("TupleCtor", func(t *testing.T) { require := require.New(t) scope := newScope() node := &ast.TupleCtor{Elems: 1} r.resolveExpr(scope, node) require.Len(scope.Objects, 0) require.Len(scope.Unresolved, 0) require.True(r.reporter.IsOK()) }) } func TestResolveImport(t *testing.T) { cases := []struct { name string decl *ast.ImportDecl imported []string reports []report.Report }{ { "open list", &ast.ImportDecl{ Module: ast.NewIdent("Foo", token.NoPos), Alias: ast.NewIdent("FooAlias", token.NoPos), Exposing: new(ast.OpenList), }, []string{"foo", "bar", "Cmp"}, nil, }, { "closed list 2 exposed vars", &ast.ImportDecl{ Module: ast.NewIdent("Foo", token.NoPos), Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("foo", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("bar", token.NoPos)}, }, }, }, []string{"foo", "bar"}, nil, }, { "closed list no exposed var", &ast.ImportDecl{ Module: ast.NewIdent("Foo", token.NoPos), Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("foo", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("baz", token.NoPos)}, }, }, }, nil, []report.Report{new(report.ImportError)}, }, { "closed list wrong exposed var", &ast.ImportDecl{ Module: ast.NewIdent("Foo", token.NoPos), Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("foo", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("Eq", token.NoPos)}, }, }, }, nil, []report.Report{new(report.ImportError)}, }, { "exposed union is not union", &ast.ImportDecl{ Module: ast.NewIdent("Foo", token.NoPos), Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Eq", token.NoPos), Ctors: new(ast.OpenList), }, }, }, }, nil, []report.Report{new(report.ImportError)}, }, { "exposed union open list", &ast.ImportDecl{ Module: ast.NewIdent("Foo", token.NoPos), Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Cmp", token.NoPos), Ctors: new(ast.OpenList), }, }, }, }, []string{"Cmp", "Eq", "Lt", "Gt"}, nil, }, { "exposed union closed list", &ast.ImportDecl{ Module: ast.NewIdent("Foo", token.NoPos), Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Cmp", token.NoPos), Ctors: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("Eq", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("Gt", token.NoPos)}, }, }, }, }, }, }, []string{"Cmp", "Eq", "Gt"}, nil, }, { "exposed union closed list import error", &ast.ImportDecl{ Module: ast.NewIdent("Foo", token.NoPos), Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Cmp", token.NoPos), Ctors: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("Baz", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("Gt", token.NoPos)}, }, }, }, }, }, }, nil, []report.Report{new(report.ImportError)}, }, { "exposed union closed list wrong type", &ast.ImportDecl{ Module: ast.NewIdent("Foo", token.NoPos), Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Cmp", token.NoPos), Ctors: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("Cmp", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("Gt", token.NoPos)}, }, }, }, }, }, }, nil, []report.Report{new(report.ImportError)}, }, { "exposed union type does not exist", &ast.ImportDecl{ Module: ast.NewIdent("Foo", token.NoPos), Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Qux", token.NoPos), Ctors: new(ast.OpenList), }, }, }, }, nil, []report.Report{new(report.ImportError)}, }, } fooScope := ast.NewModuleScope(nil) fooScope.Expose(ast.NewObject("foo", ast.Var, nil)) fooScope.Expose(ast.NewObject("bar", ast.Var, nil)) fooScope.Expose(ast.NewObject("Cmp", ast.Typ, &ast.UnionDecl{ Ctors: []*ast.Constructor{ {Name: ast.NewIdent("Eq", token.NoPos)}, {Name: ast.NewIdent("Lt", token.NoPos)}, {Name: ast.NewIdent("Gt", token.NoPos)}, }, })) fooScope.Expose(ast.NewObject("Eq", ast.Ctor, &ast.Constructor{Name: ast.NewIdent("Eq", token.NoPos)})) fooScope.Expose(ast.NewObject("Gt", ast.Ctor, &ast.Constructor{Name: ast.NewIdent("Gt", token.NoPos)})) fooScope.Expose(ast.NewObject("Lt", ast.Ctor, &ast.Constructor{Name: ast.NewIdent("Lt", token.NoPos)})) pkg := &ast.Package{ Modules: map[string]*ast.Module{ "Foo": &ast.Module{ Scope: fooScope, }, }, } for _, c := range cases { r := newTestResolver(t) r.pkg = pkg t.Run(c.name, func(t *testing.T) { require := require.New(t) scope := ast.NewModuleScope(nil) r.resolveImport(scope, c.decl) if c.decl.Alias != nil { require.NotNil(scope.Modules[c.decl.Alias.Name]) } require.NotNil(scope.Modules[c.decl.ModuleName()]) if len(c.reports) > 0 { assertReports(t, r.reporter, c.reports...) require.False(r.reporter.IsOK()) } else { for _, i := range c.imported { require.NotNil(scope.Imported[i], "expected %s to be imported", i) } require.Len(scope.Imported, len(c.imported)) require.True(r.reporter.IsOK()) } }) } } func TestResolveModuleDecl(t *testing.T) { cases := []struct { name string decl *ast.ModuleDecl exported []string reports []report.Report }{ { "open list", &ast.ModuleDecl{ Exposing: new(ast.OpenList), }, []string{"foo", "bar", "Cmp", "Eq", "Lt", "Gt"}, nil, }, { "closed list 2 exposed vars", &ast.ModuleDecl{ Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("foo", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("bar", token.NoPos)}, }, }, }, []string{"foo", "bar"}, nil, }, { "closed list no exposed var", &ast.ModuleDecl{ Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("foo", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("baz", token.NoPos)}, }, }, }, nil, []report.Report{new(report.ExportError)}, }, { "closed list wrong exposed var", &ast.ModuleDecl{ Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("foo", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("Eq", token.NoPos)}, }, }, }, nil, []report.Report{new(report.ExportError)}, }, { "exposed union is not union", &ast.ModuleDecl{ Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Eq", token.NoPos), Ctors: new(ast.OpenList), }, }, }, }, nil, []report.Report{new(report.ExportError)}, }, { "exposed union open list", &ast.ModuleDecl{ Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Cmp", token.NoPos), Ctors: new(ast.OpenList), }, }, }, }, []string{"Cmp", "Eq", "Lt", "Gt"}, nil, }, { "exposed union closed list", &ast.ModuleDecl{ Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Cmp", token.NoPos), Ctors: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("Eq", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("Gt", token.NoPos)}, }, }, }, }, }, }, []string{"Cmp", "Eq", "Gt"}, nil, }, { "exposed union closed list import error", &ast.ModuleDecl{ Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Cmp", token.NoPos), Ctors: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("Baz", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("Gt", token.NoPos)}, }, }, }, }, }, }, nil, []report.Report{new(report.ExportError)}, }, { "exposed union closed list wrong type", &ast.ModuleDecl{ Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Cmp", token.NoPos), Ctors: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedVar{ast.NewIdent("Cmp", token.NoPos)}, &ast.ExposedVar{ast.NewIdent("Gt", token.NoPos)}, }, }, }, }, }, }, nil, []report.Report{new(report.ExportError)}, }, { "exposed union type does not exist", &ast.ModuleDecl{ Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("Qux", token.NoPos), Ctors: new(ast.OpenList), }, }, }, }, nil, []report.Report{new(report.ExportError)}, }, { "exposed union type is not union", &ast.ModuleDecl{ Exposing: &ast.ClosedList{ Exposed: []ast.ExposedIdent{ &ast.ExposedUnion{ Type: ast.NewIdent("bar", token.NoPos), Ctors: new(ast.OpenList), }, }, }, }, nil, []report.Report{new(report.ExpectedUnionError)}, }, } for _, c := range cases { r := newTestResolver(t) scope := ast.NewModuleScope(&ast.Module{ Module: c.decl, }) scope.Add(ast.NewObject("foo", ast.Var, ast.NewIdent("foo", token.NoPos))) scope.Add(ast.NewObject("bar", ast.Var, ast.NewIdent("bar", token.NoPos))) scope.Add(ast.NewObject("Cmp", ast.Typ, &ast.UnionDecl{ Ctors: []*ast.Constructor{ {Name: ast.NewIdent("Eq", token.NoPos)}, {Name: ast.NewIdent("Lt", token.NoPos)}, {Name: ast.NewIdent("Gt", token.NoPos)}, }, })) scope.Add(ast.NewObject("Eq", ast.Ctor, &ast.Constructor{Name: ast.NewIdent("Eq", token.NoPos)})) scope.Add(ast.NewObject("Gt", ast.Ctor, &ast.Constructor{Name: ast.NewIdent("Gt", token.NoPos)})) scope.Add(ast.NewObject("Lt", ast.Ctor, &ast.Constructor{Name: ast.NewIdent("Lt", token.NoPos)})) t.Run(c.name, func(t *testing.T) { require := require.New(t) r.resolveModuleDecl(scope, c.decl) if len(c.reports) > 0 { assertReports(t, r.reporter, c.reports...) require.False(r.reporter.IsOK()) } else { for _, i := range c.exported { require.NotNil(scope.Exposed[i], "expected %s to be exported", i) } require.Len(scope.Exposed, len(c.exported)) require.True(r.reporter.IsOK()) } }) } } func assertReports(t *testing.T, r *report.Reporter, reports ...report.Report) { reps := r.Reports("test") require.Len(t, reps, len(reports), "incorrect number of reports") for i := range reports { require.IsType(t, reports[i], reps[i], "incorrect report type for report number %d", i) } } func assertObj(t *testing.T, node ast.Node, name string) { ident, ok := node.(*ast.Ident) require.True(t, ok, "expected node to be ident with name %s", name) require.NotNil(t, ident.Obj, "expected node to have object with name %s", name) require.Equal(t, name, ident.Obj.Name, "expected ident object to be %s", name) } func scopeWithObjects(objs ...*ast.Object) *ast.NodeScope { parent := ast.NewModuleScope(nil) for _, obj := range objs { parent.Add(obj) } return ast.NewNodeScope(nil, parent) } func modScopeWithObjects(objs ...*ast.Object) *ast.ModuleScope { parent := ast.NewModuleScope(nil) for _, obj := range objs { parent.Add(obj) } return parent } func newTestResolver(t *testing.T) *resolver { path := "test" loader := source.NewMemLoader() loader.Add(path, "") cm := source.NewCodeMap(loader) require.NoError(t, cm.Add(path), "adding %s", path) reporter := report.NewReporter(cm, report.Stderr(true, true)) return &resolver{nil, reporter, path} }
{ "content_hash": "c657661489ed8bbb21bba705d02ebd3b", "timestamp": "", "source": "github", "line_count": 1418, "max_line_length": 104, "avg_line_length": 26.404090267983076, "alnum_prop": 0.627280254266713, "repo_name": "elm-tangram/tangram", "id": "971b9ce14b7f326956e16d6aea880deeeac67603", "size": "37441", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "parser/resolve_test.go", "mode": "33188", "license": "mit", "language": [ { "name": "Elm", "bytes": "1314" }, { "name": "Go", "bytes": "258409" }, { "name": "Makefile", "bytes": "488" } ] }
var App = require('app'); App.MainDatasetJobsController = Em.Controller.extend({ name: 'mainDatasetJobsController', suspend: function () { App.ajax.send({ name: 'mirroring.suspend_entity', sender: this, data: { name: this.get('content.prefixedName'), type: 'feed', falconServer: App.get('falconServerURL') }, success: 'onSuspendSuccess', error: 'onError' }); }, onSuspendSuccess: function() { this.set('content.status', 'SUSPENDED'); this.get('content.datasetJobs').filterProperty('status', 'RUNNING').setEach('status', 'SUSPENDED'); }, resume: function () { App.ajax.send({ name: 'mirroring.resume_entity', sender: this, data: { name: this.get('content.prefixedName'), type: 'feed', falconServer: App.get('falconServerURL') }, success: 'onResumeSuccess', error: 'onError' }); }, onResumeSuccess: function() { this.set('content.status', 'RUNNING'); this.get('content.datasetJobs').filterProperty('status', 'SUSPENDED').setEach('status', 'RUNNING'); }, schedule: function () { App.ajax.send({ name: 'mirroring.schedule_entity', sender: this, data: { name: this.get('content.prefixedName'), type: 'feed', falconServer: App.get('falconServerURL') }, success: 'onScheduleSuccess', error: 'onError' }); }, onScheduleSuccess: function() { this.set('content.status', 'RUNNING'); }, delete: function () { var self = this; App.showConfirmationPopup(function () { App.ajax.send({ name: 'mirroring.delete_entity', sender: self, data: { name: self.get('content.prefixedName'), type: 'feed', falconServer: App.get('falconServerURL') }, success: 'onDeleteSuccess', error: 'onError' }); }); }, onDeleteSuccess: function() { var dataset = this.get('content'); dataset.deleteRecord(); App.store.commit(); dataset.get('stateManager').transitionTo('loading'); this.set('content', null); App.router.get('mainMirroringController').set('selectedDataset', null); App.router.send('gotoShowJobs'); }, suspendInstance: function (event) { App.ajax.send({ name: 'mirroring.suspend_instance', sender: this, data: { feed: this.get('content.prefixedName'), name: event.context.get('name'), job: event.context, falconServer: App.get('falconServerURL') }, success: 'onSuspendInstanceSuccess', error: 'onError' }); }, onSuspendInstanceSuccess: function () { this.get('content.datasetJobs').filterProperty('name', arguments[2].name).setEach('status', 'SUSPENDED'); }, resumeInstance: function (event) { App.ajax.send({ name: 'mirroring.resume_instance', sender: this, data: { feed: this.get('content.prefixedName'), name: event.context.get('name'), job: event.context, falconServer: App.get('falconServerURL') }, success: 'onResumeInstanceSuccess', error: 'onError' }); }, onResumeInstanceSuccess: function () { this.get('content.datasetJobs').filterProperty('name', arguments[2].name).setEach('status', 'RUNNING'); }, killInstance: function (event) { App.ajax.send({ name: 'mirroring.kill_instance', sender: this, data: { feed: this.get('content.prefixedName'), name: event.context.get('name'), job: event.context, falconServer: App.get('falconServerURL') }, success: 'onKillInstanceSuccess', error: 'onError' }); }, onKillInstanceSuccess: function () { this.get('content.datasetJobs').filterProperty('name', arguments[2].name).setEach('status', 'KILLED'); }, onError: function () { App.showAlertPopup(Em.I18n.t('common.error'), arguments[2]); }, downloadEntity: function () { var xml = this.formatDatasetXML(this.get('content')); if ($.browser.msie && $.browser.version < 10) { this.openInfoInNewTab(xml); } else { try { var blob = new Blob([xml], {type: 'text/xml;charset=utf-8;'}); saveAs(blob, Em.I18n.t('mirroring.dataset.entity') + '.xml'); } catch (e) { this.openInfoInNewTab(xml); } } }, openInfoInNewTab: function (xml) { var newWindow = window.open(''); var newDocument = newWindow.document; newDocument.write('<pre>' + xml + '</pre>'); newWindow.focus(); }, formatDatasetXML: function (dataset) { return '<?xml version="1.0"?>\n' + '<feed description="" name="' + dataset.get('name') + '" xmlns="uri:falcon:feed:0.1">\n' + '<frequency>' + dataset.get('frequencyUnit') + '(' + dataset.get('frequency') + ')' + '</frequency>\n' + '<clusters>\n<cluster name="' + dataset.get('sourceClusterName') + '" type="source">\n' + '<validity start="' + dataset.get('scheduleStartDate') + '" end="' + dataset.get('scheduleEndDate') + '"/>\n' + '<retention limit="days(7)" action="delete"/>\n</cluster>\n<cluster name="' + dataset.get('targetClusterName') + '" type="target">\n<validity start="' + dataset.get('scheduleStartDate') + '" end="' + dataset.get('scheduleEndDate') + '"/>\n' + '<retention limit="months(1)" action="delete"/>\n<locations>\n<location type="data" path="' + dataset.get('targetDir') + '" />\n' + '</locations>\n</cluster>\n</clusters>\n<locations>\n<location type="data" path="' + dataset.get('sourceDir') + '" />\n' + '</locations>\n<ACL owner="hue" group="users" permission="0755" />\n<schema location="/none" provider="none"/>\n</feed>'; } });
{ "content_hash": "8e3394d846ba0c2c18975525b9a66663", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 139, "avg_line_length": 31.216216216216218, "alnum_prop": 0.5942857142857143, "repo_name": "keedio/ambari-web", "id": "dded921443f389be3ab0459fd1d5c86b34a0982e", "size": "6581", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/main/mirroring/jobs_controller.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "454646" }, { "name": "CoffeeScript", "bytes": "3291" }, { "name": "HTML", "bytes": "479881" }, { "name": "JavaScript", "bytes": "11003846" }, { "name": "Shell", "bytes": "3467" } ] }
namespace MiniUML.Model.behaviour { using System.Windows; using System.Windows.Input; using MiniUML.Framework.helpers; /// <summary> /// Drag and drop behviour to drag & drop elements from /// the toolbox on to the canvas /// or create elements on canvas through a single click. /// </summary> public static class DragAndDropProps { #region fields private static readonly DependencyProperty DragStartPointProperty = DependencyProperty.RegisterAttached("DragStartPoint", typeof(Point?), typeof(DragAndDropProps)); private static readonly DependencyProperty EnabledForDragProperty = DependencyProperty.RegisterAttached("EnabledForDrag", typeof(bool), typeof(DragAndDropProps), new FrameworkPropertyMetadata((bool)false, new PropertyChangedCallback(OnEnabledForDragChanged))); #endregion fields #region DragStartPoint /// <summary> /// Standard method of DragStartPoint dependency property. /// </summary> /// <param name="d"></param> /// <returns></returns> public static Point? GetDragStartPoint(DependencyObject d) { return (Point?)d.GetValue(DragStartPointProperty); } /// <summary> /// Standard method of DragStartPoint dependency property. /// </summary> /// <param name="d"></param> /// <param name="value"></param> public static void SetDragStartPoint(DependencyObject d, Point? value) { d.SetValue(DragStartPointProperty, value); } #endregion #region EnabledForDrag /// <summary> /// Standard method of EnabledForDrag dependency property. /// </summary> /// <param name="d"></param> /// <returns></returns> public static bool GetEnabledForDrag(DependencyObject d) { return (bool)d.GetValue(EnabledForDragProperty); } /// <summary> /// Standard method of EnabledForDrag dependency property. /// </summary> /// <param name="d"></param> /// <param name="value"></param> public static void SetEnabledForDrag(DependencyObject d, bool value) { d.SetValue(EnabledForDragProperty, value); } private static void OnEnabledForDragChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { FrameworkElement fe = (FrameworkElement)d; if ((bool)e.NewValue) { fe.PreviewMouseDown += Fe_PreviewMouseDown; fe.MouseMove += Fe_MouseMove; fe.MouseUp += fe_MouseUp; } else { fe.PreviewMouseDown -= Fe_PreviewMouseDown; fe.MouseMove -= Fe_MouseMove; fe.MouseUp -= fe_MouseUp; } } /// <summary> /// Use the mouse up event to imitate a mouse click (together with mouse down). /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void fe_MouseUp(object sender, MouseButtonEventArgs e) { Point? dragStartPoint = GetDragStartPoint((DependencyObject)sender); if (dragStartPoint != null) { if (((FrameworkElement)sender).DataContext is ToolBoxData) { ToolBoxData d = ((FrameworkElement)sender).DataContext as ToolBoxData; if (d.CreateShapeCommand.CreateShape.CanExecute(null)) d.CreateShapeCommand.CreateShape.Execute(null); } } } #endregion private static void Fe_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) { Point? dragStartPoint = GetDragStartPoint((DependencyObject)sender); if (e.LeftButton != MouseButtonState.Pressed) { dragStartPoint = null; } if (dragStartPoint.HasValue) { DragObject dataObject = new DragObject(); if (((FrameworkElement)sender).DataContext is ToolBoxData) { ToolBoxData d = ((FrameworkElement)sender).DataContext as ToolBoxData; dataObject.ObjectInstance = (object)d.CreateShapeCommand; DragDrop.DoDragDrop((DependencyObject)sender, dataObject, DragDropEffects.Copy); e.Handled = true; } } } private static void Fe_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { SetDragStartPoint((DependencyObject)sender, e.GetPosition((IInputElement)sender)); } } }
{ "content_hash": "5c8b866800867986d652128d949fff54", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 105, "avg_line_length": 30.986013986013987, "alnum_prop": 0.6377792823290453, "repo_name": "Dirkster99/Edi", "id": "84c702d613ac88533791a49dc1e63e4693b2f5b1", "size": "4433", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MiniUML/MiniUML.Model/behaviour/DragAndDropProps.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4739" }, { "name": "C#", "bytes": "3068045" }, { "name": "XSLT", "bytes": "1558" } ] }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class StafPersonelPerencanaan extends MY_Controller { function __construct() { parent::__construct(); $this->checkLogin(); $this->data["pageTitle"] = "Staf Personel Bidang Perencanaan"; } public function komposisiKekuatanPersonel($by) { #tni #perMatra $this->data["page"] = $this->getClass()."/" . $this->getMethod(); $this->load->view('layout',$this->data); } }
{ "content_hash": "dd77575633a473f76da9afe6a7d5c499", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 67, "avg_line_length": 16.20689655172414, "alnum_prop": 0.648936170212766, "repo_name": "lapakku2016/ciproject", "id": "e3590bd42b89b50ffc38180386b190cf75590fb6", "size": "470", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/controllers/StafPersonelPerencanaan.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "363" }, { "name": "CSS", "bytes": "879387" }, { "name": "HTML", "bytes": "10159864" }, { "name": "JavaScript", "bytes": "9677317" }, { "name": "PHP", "bytes": "2579697" } ] }
import Dom from '../util/Dom' import ColorSetsList from './module/ColorSetsList' import UIElement from './UIElement' import ColorManager from './module/ColorManager'; import BaseStore from './BaseStore'; export default class BaseColorPicker extends UIElement { constructor (opt) { super(opt); this.isColorPickerShow = false; this.isShortCut = false; this.hideDelay = +(typeof this.opt.hideDeplay == 'undefined' ? 2000 : this.opt.hideDelay); this.timerCloseColorPicker; this.autoHide = this.opt.autoHide || true; this.outputFormat = this.opt.outputFormat this.$checkColorPickerClass = this.checkColorPickerClass.bind(this); } initialize () { this.$body = null; this.$root = null; this.$store = new BaseStore({ modules: [ ColorManager, ColorSetsList ] }); this.callbackChange = () => { this.callbackColorValue() } this.callbackLastUpdate = () => { this.callbackLastUpdateColorValue() } this.colorpickerShowCallback = function () { }; this.colorpickerHideCallback = function () { }; this.colorpickerLastUpdateCallback = function () { }; this.$body = new Dom(this.getContainer()); this.$root = new Dom('div', 'codemirror-colorpicker'); // append colorpicker to container (ex : body) if (this.opt.position == 'inline') { this.$body.append(this.$root); } if (this.opt.type) { // to change css style this.$root.addClass(this.opt.type); } if (this.opt.hideInformation) { this.$root.addClass('hide-information') } if (this.opt.hideColorsets) { this.$root.addClass('hide-colorsets') } this.$arrow = new Dom('div', 'arrow'); this.$root.append(this.$arrow); this.$store.dispatch('/setUserPalette', this.opt.colorSets); this.render() this.$root.append(this.$el) this.initColorWithoutChangeEvent(this.opt.color); // 이벤트 연결 this.initializeEvent(); } initColorWithoutChangeEvent (color) { this.$store.dispatch('/initColor', color); } /** * public method * */ /** * * show colorpicker with position * * @param {{left, top, hideDelay, isShortCut}} opt * @param {String|Object} color * @param {Function} showCallback it is called when colorpicker is shown * @param {Function} hideCallback it is called once when colorpicker is hidden */ show(opt, color, showCallback, hideCallback, lastUpdateCallback) { // 매번 이벤트를 지우고 다시 생성할 필요가 없어서 초기화 코드는 지움. // this.destroy(); // this.initializeEvent(); // define colorpicker callback this.colorpickerShowCallback = showCallback; this.colorpickerHideCallback = hideCallback; this.colorpickerLastUpdateCallback = lastUpdateCallback; this.$root.css(this.getInitalizePosition()).show(); this.isColorPickerShow = true; this.isShortCut = opt.isShortCut || false; this.outputFormat = opt.outputFormat // define hide delay this.hideDelay = +(typeof opt.hideDelay == 'undefined' ? 2000 : opt.hideDelay ); if (this.hideDelay > 0) { this.setHideDelay(this.hideDelay); } this.$root.appendTo(this.$body); this.definePosition(opt); this.initColorWithoutChangeEvent(color); } /** * * initialize color for colorpicker * * @param {String|Object} newColor * @param {String} format hex, rgb, hsl */ initColor(newColor, format) { this.$store.dispatch('/changeColor', newColor, format); } /** * hide colorpicker * */ hide() { if (this.isColorPickerShow) { // this.destroy(); this.$root.hide(); this.$root.remove(); // not empty this.isColorPickerShow = false; this.callbackHideColorValue() } } /** * set to colors in current sets that you see * @param {Array} colors */ setColorsInPalette (colors = []) { this.$store.dispatch('/setCurrentColorAll', colors); } /** * refresh all color palette * * @param {*} list */ setUserPalette (list = []) { this.$store.dispatch('/setUserPalette', list); } /** * private method */ getOption(key) { return this.opt[key]; } setOption (key, value) { this.opt[key] = value; } isType (key) { return this.getOption('type') == key; } isPaletteType() { return this.isType('palette'); } isSketchType() { return this.isType('sketch'); } getContainer () { return this.opt.container || document.body; } getColor(type) { return this.$store.dispatch('/toColor', type); } definePositionForArrow(opt, elementScreenLeft, elementScreenTop) { // console.log(arguments) } definePosition(opt) { var width = this.$root.width(); var height = this.$root.height(); // set left position for color picker var elementScreenLeft = opt.left - this.$body.scrollLeft(); if (width + elementScreenLeft > window.innerWidth) { elementScreenLeft -= (width + elementScreenLeft) - window.innerWidth; } if (elementScreenLeft < 0) { elementScreenLeft = 0; } // set top position for color picker var elementScreenTop = opt.top - this.$body.scrollTop(); if (height + elementScreenTop > window.innerHeight) { elementScreenTop -= (height + elementScreenTop) - window.innerHeight; } if (elementScreenTop < 0) { elementScreenTop = 0; } // set position this.$root.css({ left: (elementScreenLeft) + 'px', top: (elementScreenTop) + 'px' }); // this.definePositionForArrow(opt, elementScreenLeft, elementScreenTop); } getInitalizePosition() { if (this.opt.position == 'inline') { return { position: 'relative', left: 'auto', top: 'auto', display: 'inline-block' } } else { return { position: 'fixed', // color picker has fixed position left: '-10000px', top: '-10000px' } } } isAbsolute () { return this.opt.position !== 'inline' } // Event Bindings 'mouseup.isAbsolute document' (e) { this.__isMouseDown = false; // when color picker clicked in outside if (this.checkInHtml(e.target)) { //this.setHideDelay(hideDelay); } else if (this.checkColorPickerClass(e.target) == false) { this.hide(); } else { if (!this.__isMouseIn) { clearTimeout(this.timerCloseColorPicker); this.timerCloseColorPicker = setTimeout(this.hide.bind(this), this.delayTime || this.hideDelay); } } } 'keyup.isAbsolute.escape $root' (e) { this.hide(); } 'mouseover.isAbsolute $root' (e) { clearTimeout(this.timerCloseColorPicker); // this.__isMouseDown = true; } 'mousemove.isAbsolute $root' (e) { clearTimeout(this.timerCloseColorPicker) } 'mouseenter.isAbsolute $root' (e) { clearTimeout(this.timerCloseColorPicker); this.__isMouseIn = true; } 'mouseleave.isAbsolute $root' (e) { this.__isMouseIn = false; if (!this.__isMouseDown) { clearTimeout(this.timerCloseColorPicker); this.timerCloseColorPicker = setTimeout(this.hide.bind(this), this.delayTime || this.hideDelay); } } 'mousedown.isAbsolute $root' (e) { this.__isMouseDown = true; } setHideDelay(delayTime) { this.delayTime = delayTime || 0; } runHideDelay () { if (this.isColorPickerShow) { this.setHideDelay(); // const hideCallback = this.setHideDelay(delayTime); // this.timerCloseColorPicker = setTimeout(hideCallback, delayTime); } } callbackColorValue(color) { color = color || this.getCurrentColor(); if (typeof this.opt.onChange == 'function') { this.opt.onChange.call(this, color); } if (typeof this.colorpickerShowCallback == 'function') { this.colorpickerShowCallback(color); } } callbackLastUpdateColorValue(color) { color = color || this.getCurrentColor(); if (typeof this.opt.onLastUpdate == 'function') { this.opt.onLastUpdate.call(this, color); } if (typeof this.colorpickerLastUpdateCallback == 'function') { this.colorpickerLastUpdateCallback(color); } } callbackHideColorValue(color) { color = color || this.getCurrentColor(); if (typeof this.opt.onHide == 'function') { this.opt.onHide.call(this, color); } if (typeof this.colorpickerHideCallback == 'function') { this.colorpickerHideCallback(color); } } getCurrentColor() { return this.$store.dispatch('/toColor', this.outputFormat); } checkColorPickerClass(el) { var hasColorView = new Dom(el).closest('codemirror-colorview'); var hasColorPicker = new Dom(el).closest('codemirror-colorpicker'); var hasCodeMirror = new Dom(el).closest('CodeMirror'); var IsInHtml = el.nodeName == 'HTML'; return !!(hasColorPicker || hasColorView || hasCodeMirror); } checkInHtml(el) { var IsInHtml = el.nodeName == 'HTML'; return IsInHtml; } initializeStoreEvent () { super.initializeStoreEvent() this.$store.on('changeColor', this.callbackChange) this.$store.on('lastUpdateColor', this.callbackLastUpdate) this.$store.on('changeFormat', this.callbackChange) } destroy() { super.destroy(); this.$store.off('changeColor', this.callbackChange); this.$store.off('lastUpdateColor', this.callbackLastUpdate) this.$store.off('changeFormat', this.callbackChange); this.callbackChange = undefined; this.callbackLastUpdate = undefined; // remove color picker callback this.colorpickerShowCallback = undefined; this.colorpickerHideCallback = undefined; } }
{ "content_hash": "0e278ddcaee6d9e38f2b545711495cc7", "timestamp": "", "source": "github", "line_count": 403, "max_line_length": 112, "avg_line_length": 27.21588089330025, "alnum_prop": 0.5638220277169949, "repo_name": "easylogic/codemirror-colorpicker", "id": "4040b066828bd343f72213be34511cef73a49412", "size": "11034", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/colorpicker/BaseColorPicker.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "63936" }, { "name": "HTML", "bytes": "86301" }, { "name": "JavaScript", "bytes": "682914" }, { "name": "SCSS", "bytes": "51661" } ] }
Accept a set of file descriptors you are interested in performing I/O with. Tell you, repeatedly, when any file descriptors are ready for I/O. # Proper Implementations * Handle all the weird corner cases that crop up on different systems. * Provide lots of nice abstractions to help you use the reactor with the least amount of effort. * Provide implementations of public protocols that you can use out of the box. # Notes During a callback, the Twisted loop is effectively “blocked” on our code. So we should make sure our callback code doesn’t waste any time. In particular, we should avoid making blocking I/O calls in our callbacks. Otherwise, we would be defeating the whole point of using the reactor pattern in the first place. Twisted will not take any special precautions to prevent our code from blocking, we just have to make sure not to do it. As we will eventually see, for the common case of network I/O we don’t have to worry about it as we let Twisted do the asynchronous communication for us. Other examples of potentially blocking operations include reading or writing from a non-socket file descriptor (like a pipe) or waiting for a subprocess to finish. Exactly how you switch from blocking to non-blocking operations is specific to what you are doing, but there is often a Twisted API that will help you do it. Note that many standard Python functions have no way to switch to a non-blocking mode. For example, the os.system function will always block until the subprocess is finished. That’s just how it works. So when using Twisted, you will have to eschew os.system in favor of the Twisted API for launching subprocesses.
{ "content_hash": "ea95ffc4b98249591b0137368e7e0807", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 98, "avg_line_length": 61.370370370370374, "alnum_prop": 0.7923958961979481, "repo_name": "mr-uuid/snippets", "id": "32afdc21add896fb6db6da5bf45cad037ac69ca4", "size": "1683", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "python/later/twisted/README.md", "mode": "33261", "license": "mit", "language": [ { "name": "Jupyter Notebook", "bytes": "1274" }, { "name": "Python", "bytes": "38641" }, { "name": "Shell", "bytes": "1839" } ] }
import os import sys import logging import h5py from collections import deque from neon import NervanaObject from neon.util.persist import save_obj from timeit import default_timer logger = logging.getLogger(__name__) class Callbacks(NervanaObject): """ Container class for storing and iterating over callbacks. Attributes: callbacks (list): Ordered set of Callback objects to be run. """ def __init__(self, model, train_set, output_file=None, valid_set=None, valid_freq=None, progress_bar=True): """ Create a callbacks container with the default callbacks. Arguments: model (Model): the model object train_set (DataIterator): the training dataset output_file (string, optional): path to save callback data to valid_set (DataIterator, optional): the validation dataset to use valid_freq (int, optional): how often (in epochs) to run validation progress_bar (bool): control whether a progress bar callback is created. Defaults to True. """ self.callbacks = list() self.epoch_marker = 0 if output_file is None: self.callback_data = h5py.File("no_file", driver='core', backing_store=False) else: if os.path.isfile(output_file): logger.warn("Overwriting output file %s", output_file) os.remove(output_file) self.callback_data = h5py.File(output_file, "w") self.model = model self.train_set = train_set self.callbacks.append(TrainCostCallback(self.callback_data, self.model)) if valid_set and valid_freq: self.callbacks.append(ValidationCallback(self.callback_data, self.model, valid_set, valid_freq)) if progress_bar: self.callbacks.append(ProgressBarCallback(self.callback_data, model, train_set)) self.callbacks.append(TrainLoggerCallback(self.callback_data, model, epoch_freq=1, minibatch_freq=None)) def add_validation_callback(self, valid_set, epoch_freq): """ Convenience function to create and add a Validation callback. Arguments: valid_set (DataIterator): the validation dataset to use epoch_freq (int): how often (in epochs) to run validation """ # Insert before other callbacks since some depend on validation cost self.add_callback(ValidationCallback(self.callback_data, self.model, valid_set, epoch_freq), insert_pos=0) def add_serialize_callback(self, serialize_schedule, save_path, history=1): """ Convenience function to create and add a model serialization callback. Arguments: serialize_schedule (Schedule): the serialization schedule to follow save_path (string): where to save the serialized data history (int): number of previous checkpoint files to retain """ if save_path and serialize_schedule: # TODO can serialize be handled by regular data callback or should it be separate? self.callbacks.append(SerializeModelCallback(self.model, save_path, epoch_freq=serialize_schedule, history=history)) def add_save_best_state_callback(self, path): """ Convenience function to create and add a save best state callback. Arguments: path (string): where to save the best model state. """ self.callbacks.append(SaveBestStateCallback(self.callback_data, self.model, path)) def add_early_stop_callback(self, stop_func): """ Convenience function to create and add an early stopping callback. Arguments: stop_func (function): function to determine when to stop. """ self.callbacks.append(EarlyStopCallback(self.callback_data, self.model, stop_func)) def add_callback(self, callback, insert_pos=None): """ Add a user supplied callback. Since callbacks are run serially and share data, order can matter. If the default behavior (to append the callback) is not sufficient, insert position can be controlled. Arguments: callback (Callback): callback object to be registered insert_pos (int, optional): position in the list to insert the callback. Defaults to None, meaning append """ if insert_pos is None: insert_pos = len(self.callbacks) self.callbacks.insert(insert_pos, callback) def on_train_begin(self, epochs): """ Call all registered callbacks' on_train_begin functions """ # data iterator wraps around to avoid partial minibatches # callbacks producing per-minibatch data need a way to preallocate buffers config = self.callback_data.create_group('config') total_minibatches = -((-self.train_set.ndata * epochs) // self.be.bsz) config.attrs['total_minibatches'] = total_minibatches config.attrs['total_epochs'] = epochs time_markers = self.callback_data.create_group("time_markers") time_markers.create_dataset("minibatch", (epochs,)) for c in self.callbacks: c.on_train_begin(epochs) def on_train_end(self): """ Call all registered callbacks' on_train_end functions """ for c in self.callbacks: c.on_train_end() self.callback_data.close() def on_epoch_begin(self, epoch): """ Call all registered callbacks' on_epoch_begin functions Arguments: epoch (int): index of epoch that is beginning """ for c in self.callbacks: if c.should_fire(epoch, c.epoch_freq): c.on_epoch_begin(epoch) def on_epoch_end(self, epoch): """ Call all registered callbacks' on_epoch_end functions Arguments: epoch (int): index of epoch that is ending """ for c in self.callbacks: if c.should_fire(epoch, c.epoch_freq): c.on_epoch_end(epoch) self.epoch_marker += self.epoch_minibatches self.callback_data['time_markers/minibatch'][epoch] = self.epoch_marker self.callback_data['time_markers'].attrs['epochs_complete'] = epoch + 1 self.callback_data['time_markers'].attrs['minibatches_complete'] = self.epoch_marker self.callback_data.flush() def on_minibatch_begin(self, epoch, minibatch): """ Call all registered callbacks' on_minibatch_begin functions Arguments: epoch (int): index of current epoch minibatch (int): index of minibatch that is beginning """ for c in self.callbacks: if c.should_fire(minibatch, c.minibatch_freq): c.on_minibatch_begin(epoch, minibatch) def on_minibatch_end(self, epoch, minibatch): """ Call all registered callbacks' on_minibatch_end functions Arguments: epoch (int): index of current epoch minibatch (int): index of minibatch that is ending """ for c in self.callbacks: if c.should_fire(minibatch, c.minibatch_freq): c.on_minibatch_end(epoch, minibatch) # keep track of the number of mb per epoch, since they vary self.epoch_minibatches = minibatch + 1 class Callback(NervanaObject): """ Interface defining common callback functions. Implement a callback by subclassing Callback and overriding the necessary on_[train,epoch,minibatch]_[begin,end] functions. Callback functions provide time queues as arguments but derived callback classes must manage their own state """ def __init__(self, epoch_freq=1, minibatch_freq=1): self.epoch_freq = epoch_freq self.minibatch_freq = minibatch_freq def on_train_begin(self, epochs): """ Called when training is about to begin """ pass def on_train_end(self): """ Called when training is about to end """ pass def on_epoch_begin(self, epoch): """ Called when an epoch is about to begin Arguments: epoch (int): index of epoch that is beginning """ pass def on_epoch_end(self, epoch): """ Called when an epoch is about to end Arguments: epoch (int): index of epoch that is ending """ pass def on_minibatch_begin(self, epoch, minibatch): """ Called when a minibatch is about to begin Arguments: epoch (int): index of current epoch minibatch (int): index of minibatch that is begininning """ pass def on_minibatch_end(self, epoch, minibatch): """ Called when a minibatch is about to end Arguments: epoch (int): index of current epoch minibatch (int): index of minibatch that is ending """ pass def should_fire(self, time, freq): """ Helper function for determining if a callback should do work at a given interval. Arguments: time (int): current time, in an arbitrary unit freq (int, list, None): firing frequency, in multiples of the unit used for time, or a list of times, or None (never fire) """ fire = False if isinstance(freq, int) and (time + 1) % freq == 0: fire = True elif isinstance(freq, list) and time in freq: fire = True return fire class SerializeModelCallback(Callback): """ Callback for serializing the state of the model. Arguments: model (Model): model object save_path (str): where to save the model dataset epoch_freq (int, optional): how often (in epochs) to serialize the model. If not specified, we default to running every epoch. history (int, optional): number of checkpoint files to retain, newest files up to this count are retained. filename for the check point files will be <save_path>_<epoch>. """ def __init__(self, model, save_path, epoch_freq=1, history=1): super(SerializeModelCallback, self).__init__(epoch_freq=epoch_freq) self.model = model self.save_path = save_path self.history = history self.checkpoint_files = deque() def on_epoch_end(self, epoch): if self.history > 1: self.save_history(epoch) else: save_obj(self.model.serialize(keep_states=True), self.save_path) def save_history(self, epoch): # if history > 1, this function will save the last N checkpoints # where N is equal to self.history. The files will have the form # of save_path with the epoch added to the filename before the ext if len(self.checkpoint_files) > self.history: # remove oldest checkpoint file when max count have been saved fn = self.checkpoint_files.popleft() try: os.remove(fn) logger.info('removed old checkpoint %s' % fn) except OSError: logger.warn('Could not delete old checkpoint file %s' % fn) path_split = os.path.splitext(self.save_path) save_path = '%s_%d%s' % (path_split[0], epoch, path_split[1]) # add the current file to the deque self.checkpoint_files.append(save_path) save_obj(self.model.serialize(keep_states=True), save_path) class TrainCostCallback(Callback): """ Callback for computing average training cost periodically during training. Arguments: callback_data (HDF5 dataset): shared data between callbacks model (Model): model object """ def __init__(self, callback_data, model): super(TrainCostCallback, self).__init__(epoch_freq=1) self.model = model self.callback_data = callback_data def on_train_begin(self, epochs): # preallocate space for the number of minibatches in the whole run points = self.callback_data['config'].attrs['total_minibatches'] self.callback_data.create_dataset("cost/train", (points,)) # clue in the data reader to use the 'minibatch' time_markers self.callback_data['cost/train'].attrs['time_markers'] = 'minibatch' def on_minibatch_end(self, epoch, minibatch): mb_complete = minibatch + 1 mean_cost = float(self.model.total_cost.get() / mb_complete) prev_epoch_minibatches = 0 if epoch > 0: prev_epoch_minibatches = self.callback_data['time_markers/minibatch'][epoch-1] self.callback_data['cost/train'][prev_epoch_minibatches + minibatch] = mean_cost class ValidationCallback(Callback): """ Callback for processing the validation dataset periodically during training. Arguments: callback_data (HDF5 dataset): shared data between callbacks model (Model): model object valid_set (DataIterator): Validation dataset to process epoch_freq (int, optional): how often (in epochs) to log training info. Defaults to every 1 epoch. minibatch_freq (int, optional): how often (in minibatches) to log training info, or None to log only on epoch boundaries. Defaults to None. """ def __init__(self, callback_data, model, valid_set, epoch_freq=1): super(ValidationCallback, self).__init__(epoch_freq=epoch_freq) self.model = model self.valid_set = valid_set self.valid_cost = self.be.zeros((1, 1)) self.callback_data = callback_data def on_train_begin(self, epochs): vdata = self.callback_data.create_dataset("cost/validation", (epochs/self.epoch_freq,)) vdata.attrs['time_markers'] = 'epoch_freq' vdata.attrs['epoch_freq'] = self.epoch_freq self.callback_data.create_dataset("time/validation", (epochs/self.epoch_freq,)) def on_epoch_end(self, epoch): model = self.model start_validation = default_timer() nprocessed = 0 self.valid_cost[:] = 0 self.valid_set.reset() for batch_index, (x, t) in enumerate(self.valid_set, 1): x = model.fprop(x) bsz = min(self.valid_set.ndata - nprocessed, self.be.bsz) model.cost.get_cost(x, t) costbuf = model.cost.outputs[:, :bsz] nprocessed += bsz self.valid_cost[:] = self.valid_cost + self.be.sum(costbuf, axis=1) mean_cost = float(self.valid_cost.get() / nprocessed) end_validation = default_timer() self.callback_data["cost/validation"][epoch/self.epoch_freq] = mean_cost self.callback_data["time/validation"][epoch/self.epoch_freq] = (end_validation - start_validation) def get_progress_string(tag, epoch, minibatch, nbatches, cost, time, blockchar=u'\u2588'): """ Generate a progress bar string. Arguments: tag (string): Label to print before the bar (i.e. Train, Valid, Test ) epoch (int): current epoch to display minibatch (int): current minibatch to display nbatches (int): total number of minibatches, used to display relative progress cost (float): current cost value time (float): time elapsed so far in epoch blockchar (str, optional): character to display for each step of progress in the bar. Defaults to u2588 (solid block) """ max_bar_width = 20 bar_width = int(float(minibatch) / nbatches * max_bar_width) s = u'Epoch {:<3} [{} |{:<%s}| {:4}/{:<4} batches, {:.2f} cost, {:.2f}s]' % max_bar_width return s.format(epoch, tag, blockchar * bar_width, minibatch, nbatches, cost, time) class ProgressBarCallback(Callback): """ Callback providing a live updating console based progress bar. Arguments: model (Model): model object dataset (DataIterator): dataset object """ def __init__(self, callback_data, model, dataset, epoch_freq=1, minibatch_freq=1, update_thresh_s=0.1): super(ProgressBarCallback, self).__init__(epoch_freq=epoch_freq, minibatch_freq=minibatch_freq) self.model = model self.dataset = dataset self.callback_data = callback_data self.update_thresh_s = update_thresh_s def on_epoch_begin(self, epoch): self.start_epoch = self.last_update = default_timer() self.nbatches = self.dataset.nbatches def on_minibatch_end(self, epoch, minibatch): now = default_timer() mb_complete = minibatch + 1 if (now - self.last_update > self.update_thresh_s or mb_complete == self.nbatches): self.last_update = now prev_epoch_minibatches = 0 if epoch > 0: prev_epoch_minibatches = self.callback_data['time_markers/minibatch'][epoch-1] train_cost = self.callback_data['cost/train'][prev_epoch_minibatches + minibatch] progress_string = get_progress_string("Train", epoch, mb_complete, self.nbatches, train_cost, now - self.start_epoch) sys.stdout.write('\r') sys.stdout.write(progress_string.encode('utf-8')) sys.stdout.flush() def on_epoch_end(self, epoch): if 'cost/validation' in self.callback_data: val_freq = self.callback_data['cost/validation'].attrs['epoch_freq'] if (epoch + 1) % val_freq == 0: validation_cost = self.callback_data['cost/validation'][epoch/val_freq] validation_time = self.callback_data['time/validation'][epoch/val_freq] progress_string = "[Validation %.2f cost, %.2fs]" % (validation_cost, validation_time) sys.stdout.write(progress_string.encode('utf-8')) sys.stdout.flush() sys.stdout.write('\n') class TrainLoggerCallback(Callback): """ Callback for logging training progress. Arguments: model (Model): model object epoch_freq (int, optional): how often (in epochs) to log training info. Defaults to every 1 epoch. minibatch_freq (int, optional): how often (in minibatches) to log training info, or None to log only on epoch boundaries. Defaults to None. """ def __init__(self, callback_data, model, epoch_freq=1, minibatch_freq=None): self.callback_data = callback_data self.model = model super(TrainLoggerCallback, self).__init__(epoch_freq=epoch_freq, minibatch_freq=minibatch_freq) self.epoch_freq = epoch_freq self.minibatch_freq = minibatch_freq def on_minibatch_end(self, epoch, minibatch): prev_epoch_minibatches = 0 if epoch > 0: prev_epoch_minibatches = self.callback_data['time_markers/minibatch'][epoch-1] train_cost = self.callback_data['cost/train'][prev_epoch_minibatches + minibatch] logger.info("Epoch %d Minibatch %d complete. Train cost: %f", epoch, minibatch, train_cost) def on_epoch_end(self, epoch): log_str = "Epoch %d complete. Train Cost %f" % (epoch, self.model.total_cost.get()) if 'cost/validation' in self.callback_data: val_freq = self.callback_data['cost/validation'].attrs['epoch_freq'] if (epoch + 1) % val_freq == 0: validation_cost = self.callback_data['cost/validation'][epoch/val_freq] log_str += ", Validation Cost %f" % (validation_cost) logger.info(log_str) class SaveBestStateCallback(Callback): """ Callback for saving the best model state so far. Arguments: callback_data model (Model): model object path (str): repeatedly write the best model parameters seen so far to the filesystem path specified. """ def __init__(self, callback_data, model, path): super(SaveBestStateCallback, self).__init__(epoch_freq=1) self.callback_data = callback_data self.model = model self.best_path = path self.best_cost = None def on_epoch_end(self, epoch): if 'cost/validation' in self.callback_data: val_freq = self.callback_data['cost/validation'].attrs['epoch_freq'] if (epoch + 1) % val_freq == 0: validation_cost = self.callback_data['cost/validation'][epoch/val_freq] if validation_cost < self.best_cost or self.best_cost is None: save_obj(self.model.serialize(keep_states=True), self.best_path) self.best_cost = validation_cost class EarlyStopCallback(Callback): """ Callback for stopping training when a threshold has been triggered. Arguments: model (Model): model object callback_data: stop_func (Function): Takes a function that receives a tuple (State, Val[t]) of the current state and the validation error at this time and returns a tuple (State', Bool) that returns the updated state and an indication of whether to stop training. """ def __init__(self, callback_data, model, stop_func): super(EarlyStopCallback, self).__init__(epoch_freq=1) self.callback_data = callback_data self.model = model self.stop_func = stop_func self.stop_state = None # state needed for the stop func def on_epoch_end(self, epoch): if 'cost/validation' in self.callback_data: val_freq = self.callback_data['cost/validation'].attrs['epoch_freq'] if (epoch + 1) % val_freq == 0: validation_cost = self.callback_data['cost/validation'][epoch/val_freq] self.stop_state, finished = self.stop_func(self.stop_state, validation_cost) if finished: # should this just exit instead? self.model.finished = True logger.warn('Early stopping function has been triggered with mean_cost %f.' % (validation_cost))
{ "content_hash": "dc3d746a9b98b7f5b9063acfd20d9010", "timestamp": "", "source": "github", "line_count": 603, "max_line_length": 99, "avg_line_length": 38.966832504145934, "alnum_prop": 0.5862450525599012, "repo_name": "FighterLYL/neon", "id": "1441a28b2e950e8203fc0257bcbc0726a9a2863b", "size": "24238", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "neon/callbacks/callbacks.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "6534" }, { "name": "C++", "bytes": "13448" }, { "name": "CSS", "bytes": "810211" }, { "name": "Cuda", "bytes": "87750" }, { "name": "Makefile", "bytes": "9478" }, { "name": "Python", "bytes": "773134" } ] }
<md-content class="l-content"> <h1 class="md-display-1">Login</h1> <md-input-container> <label>Email</label> <input ng-model="auth.email" type="text"> </md-input-container> <md-input-container> <label>Password</label> <input type="password" ng-model="auth.password" type="text"> </md-input-container> <md-button class="md-raised md-primary submit" ng-click="auth.login()">Login</md-button> </md-content>
{ "content_hash": "6e5fb7670349fb49ed83ac5c3d11f085", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 90, "avg_line_length": 36, "alnum_prop": 0.6712962962962963, "repo_name": "TudorStegarescu/predictr", "id": "ace482785f67c790eaef5859f8b02cc69ee2e28c", "size": "432", "binary": false, "copies": "1", "ref": "refs/heads/development", "path": "src/auth/signinView.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2618" }, { "name": "HTML", "bytes": "21163" }, { "name": "JavaScript", "bytes": "68433" }, { "name": "TypeScript", "bytes": "836" } ] }
<?php // Check for empty fields if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['phone']) || empty($_POST['message']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "No arguments Provided!"; return false; } $name = strip_tags(htmlspecialchars($_POST['name'])); $email_address = strip_tags(htmlspecialchars($_POST['email'])); $phone = strip_tags(htmlspecialchars($_POST['phone'])); $message = strip_tags(htmlspecialchars($_POST['message'])); // Create the email and send the message $to = 'tejas.sathe@gmail.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to. $email_subject = "Website Contact Form: $name"; $email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message"; $headers = "From: noreply@yourdomain.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com. $headers .= "Reply-To: $email_address"; mail($to,$email_subject,$email_body,$headers); return true; ?>
{ "content_hash": "e1491460ca5707275ca0d6c9500f44ed", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 187, "avg_line_length": 47, "alnum_prop": 0.6857610474631751, "repo_name": "tsathe/handhelp", "id": "3d793a7beafe2286466aa800f660d2a4fe031b28", "size": "1222", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "mail/contact_me.php", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "98345" }, { "name": "HTML", "bytes": "89140" }, { "name": "JavaScript", "bytes": "44300" }, { "name": "PHP", "bytes": "1222" } ] }
using System; namespace SciChart.UI.Reactive.Tests.QualityTools.XmlCompare { public class XmlDifferentException : Exception { public XmlDifferentException(string message) : base("Xml documents were different: " + message) { } } }
{ "content_hash": "cbd569bb2951a870c10acb05b1b1159e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 62, "avg_line_length": 24.636363636363637, "alnum_prop": 0.6715867158671587, "repo_name": "ABTSoftware/SciChart.Wpf.UI", "id": "443f0840792c35d93083e5dbb8533151441dee72", "size": "273", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SciChart.UI.Reactive.Tests/QualityTools/XmlCompare/XmlDifferentException.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1800" }, { "name": "C#", "bytes": "402050" }, { "name": "PowerShell", "bytes": "403" } ] }
""" The monitoring API provides an `eventlet`_-based polling layer allowing you to respond to changes in state of Philips Hue devices. .. note:: Use of the monitoring API requires you install `eventlet`_. You can do so using pip:: pip install eventlet There are two stages to setting up this monitoring: 1. Setup your the changes you wish to monitor. 2. Call :func:`hue_api.start_monitor_loop()`. Doing so will pause execution and begin monitoring for events. For example:: def handle(resource, field, previous, current): print "Change from {} to {}".format(previous, current) switch = TapSwitch.objects.get(id=3) # Monitor the entire state of the switch switch.monitor(field=lambda sw: sw.state.as_dict(), callback=handle, poll_interval=0.2) light = Light.objects.get(id=1) # Monitor only the on state of the light light.monitor(field=lambda l: l.state.on, callback=handle, poll_interval=1) # Start the monitoring loop hue_api.start_monitor_loop() print "This will never be printed!" The value given by ``field`` will be checked every ``poll_interval`` seconds. If the values changes, ``callback`` will be called. See :func:`MonitorMixin.monitor()` for more information, and details of callback parameters. .. _eventlet: http://eventlet.net """ class Monitor(object): """ Manages the process of monitoring a resource .. note: You probably do not need to worry about this to much. You can monitor resources without having to use this class. Attributes: field (string|callable): The field to monitor. See :func:`MonitorMixin.monitor`. resource (Resource): The :class:`Resource` instance to monitor. See :func:`MonitorMixin.monitor`. callback (callable): The callback to call when complete poll_interval (float): The interval between polls in milliseconds event_queue (Queue): The :class:`eventlet.queue.Queue` onto which to push the change events poll_pool (GreenPool): The :class:`eventlet.greenpool.GreenPool` for the eventlets tasked with polling the API """ def __init__(self, resource, field, callback, poll_interval, event_queue, poll_pool): """ Initialise a Monitor instance See above for definitions of arguments """ self.field = field self.resource = resource self.callback = callback self.poll_interval = poll_interval self.event_queue = event_queue self.poll_pool = poll_pool self._previous_value = self._get_field_value() def _get_field_value(self): if callable(self.field): return self.field(self.resource) else: return getattr(self.resource, self.field) def trigger(self, resource): self.callback(resource) def start(self): self.poll_pool.spawn_n(self.poll_loop) def poll_loop(self): from eventlet import sleep while True: self.resource.refresh() current_value = self._get_field_value() if self._previous_value != current_value: self.event_queue.put( (self.callback, self.resource, self.field, self._previous_value, current_value) ) self._previous_value = current_value sleep(self.poll_interval) class MonitorMixin(object): """ Mixin to provide monitoring functionality to Resources. Attributes: monitor_class (Monitor): The :class:`Monitor` class to instantiate. Provided to facilitate extending monitoring functionality. """ monitor_class = Monitor def monitor(self, field, callback, poll_interval=None): """ Monitor `field` for change Will monitor ``field`` for change and execute ``callback`` when change is detected. Example usage:: def handle(resource, field, previous, current): print "Change from {} to {}".format(previous, current) switch = TapSwitch.objects.get(id=3) # Note that we monitor the entire state of the Hue Tap # switch rather than a specific field switch.monitor(lambda sw: sw.state.as_dict(), handle, poll_interval=0.2) # Execution will stop here and the API client will begin polling for changes hue_api.start_monitor_loop() Args: field (string): The name of the field to be monitored. This may also be a callable which will be called with the resource instance as its single argument and must return a value which can be compared to previous values. callback (callable): The callable to be called when a change is detected. It will be called with parameters as follows: * resource instance * field name, * previous value * current value. poll_interval (float): Interval between polling in seconds. Defaults to the API's `poll_interval` value (which defaults to 0.1 second. Returns: Monitor: """ poll_interval = poll_interval or self.api.poll_interval monitor = self.monitor_class( resource=self, field=field, callback=callback, poll_interval=poll_interval, event_queue=self.api.event_queue, poll_pool=self.api.poll_pool, ) monitor.start() return monitor
{ "content_hash": "18ed64f14164884b0e3be58dcd182757", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 118, "avg_line_length": 34.29090909090909, "alnum_prop": 0.6233651466949452, "repo_name": "adamcharnock/python-hue-client", "id": "682c9826430ad73d0cfe4851221bb565e0ee1cfc", "size": "5658", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hueclient/monitor.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "37311" } ] }
End of preview.

No dataset card yet

Downloads last month
3