text
stringlengths
4
5.48M
meta
stringlengths
14
6.54k
function showLimitedOptionsQuestion(questionUid, numberOfOptions){ var questionDB = DB.child("questions/"+questionUid+"/options"); DB.child("questions/"+questionUid+"/options").orderByChild("votes").limitToLast(numberOfOptions).once("value",function(options){ //adjust the votes to a counting of votes DB.child("questions/"+questionUid+"/simpleVoting").once("value", function(voters){ console.log("adjust the votes to a counting of votes") var counts = new Object(); //get all options DB.child("questions/"+questionUid+"/options").once("value", function(options){ options.forEach(function(option){ counts[option.key] = 0; }) voters.forEach(function(voter){ if (!counts[voter.val()]){counts[voter.val()] = 0}; counts[voter.val()]++; }); for (i in counts){ questionDB.child(i).update({votes:counts[i]}); } }) }) var optionsObject = new Object(); options.forEach(function(option){ // if (color == undefined){ // var color = getRandomColor(); // DB.child("questions/"+questionUid+"/options/"+option.key).update({color:color}); // } optionsObject[option.key]= {uuid: option.key, title: option.val().title, votes: option.val().votes,color: option.val().color}; }) var preContext = new Array(); for (i in optionsObject){ preContext.push({questionUuid: questionUid ,uuid: optionsObject[i].uuid, title: optionsObject[i].title, votes: optionsObject[i].votes , color: optionsObject[i].color}); }; var context = {options: preContext}; console.dir(context); renderTemplate("#simpleVote-tmpl", context, "wrapper"); renderTemplate("#simpleVoteBtns-tmpl", context, "footer"); $(".voteBtn").ePulse({ bgColor: "#ded9d9", size: 'medium' }); adjustHighetLimitedOptions(optionsObject); listenToLimitedOptions(optionsObject, questionDB); }) lightCheckedBtn(questionUid); var turnOff = function(){ console.log("turning off"); questionDB.once("value", function(activeListeners){ activeListeners.forEach(function(activeListenr){ console.log("turning off: "+ activeListenr.key); questionDB.child(activeListenr.key).off(); }) }) }; setActiveEntity("questions",questionUid,"","",turnOff) } function voteSimple(questionUid, optionUid){ $("#info").hide(400); var optionUidStr = JSON.stringify(optionUid); //check to see what have the user voted last DB.child("questions/"+questionUid+"/simpleVoting/"+userUuid).once("value", function(vote){ var isExists = vote.exists(); if (!isExists){ DB.child("questions/"+questionUid+"/simpleVoting/"+userUuid).set(optionUid); DB.child("questions/"+questionUid+"/options/"+optionUid+"/votes").transaction(function(currentVote){ return currentVote +1; }) $(".voteBtn").css("border" , "0px solid black"); $("#"+optionUid+"_btn").css("border" , "3px solid black"); } else { var lastVoted = vote.val(); if (optionUid == lastVoted){ DB.child("questions/"+questionUid+"/options/"+optionUid+"/votes").transaction(function(currentVote){ return currentVote -1; }) DB.child("questions/"+questionUid+"/simpleVoting/"+userUuid).remove(); $(".voteBtn").css("border" , "0px solid black"); } else { DB.child("questions/"+questionUid+"/options/"+lastVoted+"/votes").transaction(function(currentVote){ return currentVote -1; }); DB.child("questions/"+questionUid+"/options/"+optionUid+"/votes").transaction(function(currentVote){ return currentVote +1; }) DB.child("questions/"+questionUid+"/simpleVoting/"+userUuid).set(optionUid); $(".voteBtn").css("border" , "0px solid black"); $("#"+optionUid+"_btn").css("border" , "3px solid black"); } } }) } function lightCheckedBtn(questionUid){ DB.child("questions/"+questionUid+"/simpleVoting/"+userUuid).once("value", function(checkedOption){ $(".voteBtn").css("border" , "0px solid black"); $("#"+checkedOption.val()+"_btn").css("border" , "3px solid black"); }) } function listenToLimitedOptions (optionsObject, questionDB){ for (i in optionsObject){ questionDB.child(optionsObject[i].uuid).on("value",function(optionVote){ optionsObject[optionVote.key].votes = optionVote.val().votes; adjustHighetLimitedOptions(optionsObject); }) } } function adjustHighetLimitedOptions(optionsObject){ //look for max votes var maxVotes = 20; for (i in optionsObject){ if (optionsObject[i].votes > maxVotes){ maxVotes = optionsObject[i].votes; } } //find the dimensions of the wrapper to adjust drawing var NumberOfOptionsActualy = Object.keys(optionsObject).length; var divBarWidth = $("wrapper").width()/NumberOfOptionsActualy; var barWidth = 0.8*divBarWidth; var wrapperDimensions = new Object(); var wrapperHeight = $("wrapper").height() - $("footer").height()-20; for (i in optionsObject){ var relativeToMaxBar; if (optionsObject[i].votes==undefined||optionsObject[i].votes<=0){ relativeToMaxBar=0.1/maxVotes; } else{ relativeToMaxBar = (optionsObject[i].votes/maxVotes); } $("#"+optionsObject[i].uuid+"_div").css('height', wrapperHeight*relativeToMaxBar).css("width", barWidth).text(optionsObject[i].votes); $("#"+optionsObject[i].uuid+"_btn").css("background-color", optionsObject[i].color); } }
{'content_hash': '4fe37c240353a5a86b6ee95c43ba6a07', 'timestamp': '', 'source': 'github', 'line_count': 164, 'max_line_length': 195, 'avg_line_length': 35.98780487804878, 'alnum_prop': 0.6104710267705863, 'repo_name': 'delib-org/delib-fron2', 'id': '9c5413af8e60915768c1f0f7671d4c1b3b78ddfd', 'size': '5902', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'public/js/questions/limitedOptions.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '439329'}, {'name': 'HTML', 'bytes': '23894'}, {'name': 'JavaScript', 'bytes': '1157562'}]}
/* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } .ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; border-collapse: collapse; } .ui-helper-clearfix:after { clear: both; } .ui-helper-clearfix { min-height: 0; /* support: IE7 */ } .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } .ui-front { z-index: 100; } /* Interaction Cues ----------------------------------*/ .ui-state-disabled { cursor: default !important; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } /* Misc visuals ----------------------------------*/ /* Overlays */ .ui-widget-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; } .ui-resizable { position: relative; } .ui-resizable-handle { position: absolute; font-size: 0.1px; display: block; } .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px; } .ui-button { display: inline-block; position: relative; padding: 0; line-height: normal; margin-right: .1em; cursor: pointer; vertical-align: middle; text-align: center; overflow: visible; /* removes extra width in IE */ } .ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; } /* to make room for the icon, a width needs to be set here */ .ui-button-icon-only { width: 2.2em; } /* button elements seem to need a little more width */ button.ui-button-icon-only { width: 2.4em; } .ui-button-icons-only { width: 3.4em; } button.ui-button-icons-only { width: 3.7em; } /* button text element */ .ui-button .ui-button-text { display: block; line-height: normal; } .ui-button-text-only .ui-button-text { padding: .4em 1em; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } /* no icon support for input elements, provide padding by default */ input.ui-button { padding: .4em 1em; } /* button icon element(s) */ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } /* button sets */ .ui-buttonset { margin-right: 7px; } .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } /* workarounds */ /* reset extra padding in Firefox, see h5bp.com/l */ input.ui-button::-moz-focus-inner, button.ui-button::-moz-focus-inner { border: 0; padding: 0; } .ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; outline: 0; } .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 0; white-space: nowrap; width: 90%; overflow: hidden; text-overflow: ellipsis; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 21px; margin: -10px 0 0 0; padding: 1px; height: 20px; } .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; } .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin-top: .5em; padding: .3em 1em .5em .4em; } .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } .ui-dialog .ui-resizable-se { width: 12px; height: 12px; right: -5px; bottom: -5px; background-position: 16px 16px; } .ui-draggable .ui-dialog-titlebar { cursor: move; } .ui-tooltip { padding: 8px; position: absolute; z-index: 9999; max-width: 300px; -webkit-box-shadow: 0 0 5px #aaa; box-shadow: 0 0 5px #aaa; } body .ui-tooltip { border-width: 2px; } /* Component containers ----------------------------------*/ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } .ui-widget-header a { color: #222222; } /* Interaction states ----------------------------------*/ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } /* Interaction Cues ----------------------------------*/ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a { color: #363636; } .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } .ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { width: 16px; height: 16px; } .ui-icon, .ui-widget-content .ui-icon { background-image: url(images/ui-icons_222222_256x240.png); } .ui-widget-header .ui-icon { background-image: url(images/ui-icons_222222_256x240.png); } .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon { background-image: url(images/ui-icons_454545_256x240.png); } .ui-state-active .ui-icon { background-image: url(images/ui-icons_454545_256x240.png); } .ui-state-highlight .ui-icon { background-image: url(images/ui-icons_2e83ff_256x240.png); } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background-image: url(images/ui-icons_cd0a0a_256x240.png); } /* positioning */ .ui-icon-blank { background-position: 16px 16px; } .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } .ui-icon-carat-1-se { background-position: -48px 0; } .ui-icon-carat-1-s { background-position: -64px 0; } .ui-icon-carat-1-sw { background-position: -80px 0; } .ui-icon-carat-1-w { background-position: -96px 0; } .ui-icon-carat-1-nw { background-position: -112px 0; } .ui-icon-carat-2-n-s { background-position: -128px 0; } .ui-icon-carat-2-e-w { background-position: -144px 0; } .ui-icon-triangle-1-n { background-position: 0 -16px; } .ui-icon-triangle-1-ne { background-position: -16px -16px; } .ui-icon-triangle-1-e { background-position: -32px -16px; } .ui-icon-triangle-1-se { background-position: -48px -16px; } .ui-icon-triangle-1-s { background-position: -64px -16px; } .ui-icon-triangle-1-sw { background-position: -80px -16px; } .ui-icon-triangle-1-w { background-position: -96px -16px; } .ui-icon-triangle-1-nw { background-position: -112px -16px; } .ui-icon-triangle-2-n-s { background-position: -128px -16px; } .ui-icon-triangle-2-e-w { background-position: -144px -16px; } .ui-icon-arrow-1-n { background-position: 0 -32px; } .ui-icon-arrow-1-ne { background-position: -16px -32px; } .ui-icon-arrow-1-e { background-position: -32px -32px; } .ui-icon-arrow-1-se { background-position: -48px -32px; } .ui-icon-arrow-1-s { background-position: -64px -32px; } .ui-icon-arrow-1-sw { background-position: -80px -32px; } .ui-icon-arrow-1-w { background-position: -96px -32px; } .ui-icon-arrow-1-nw { background-position: -112px -32px; } .ui-icon-arrow-2-n-s { background-position: -128px -32px; } .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } .ui-icon-arrow-2-e-w { background-position: -160px -32px; } .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } .ui-icon-arrowstop-1-n { background-position: -192px -32px; } .ui-icon-arrowstop-1-e { background-position: -208px -32px; } .ui-icon-arrowstop-1-s { background-position: -224px -32px; } .ui-icon-arrowstop-1-w { background-position: -240px -32px; } .ui-icon-arrowthick-1-n { background-position: 0 -48px; } .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } .ui-icon-arrowthick-1-e { background-position: -32px -48px; } .ui-icon-arrowthick-1-se { background-position: -48px -48px; } .ui-icon-arrowthick-1-s { background-position: -64px -48px; } .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } .ui-icon-arrowthick-1-w { background-position: -96px -48px; } .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } .ui-icon-arrow-4 { background-position: 0 -80px; } .ui-icon-arrow-4-diag { background-position: -16px -80px; } .ui-icon-extlink { background-position: -32px -80px; } .ui-icon-newwin { background-position: -48px -80px; } .ui-icon-refresh { background-position: -64px -80px; } .ui-icon-shuffle { background-position: -80px -80px; } .ui-icon-transfer-e-w { background-position: -96px -80px; } .ui-icon-transferthick-e-w { background-position: -112px -80px; } .ui-icon-folder-collapsed { background-position: 0 -96px; } .ui-icon-folder-open { background-position: -16px -96px; } .ui-icon-document { background-position: -32px -96px; } .ui-icon-document-b { background-position: -48px -96px; } .ui-icon-note { background-position: -64px -96px; } .ui-icon-mail-closed { background-position: -80px -96px; } .ui-icon-mail-open { background-position: -96px -96px; } .ui-icon-suitcase { background-position: -112px -96px; } .ui-icon-comment { background-position: -128px -96px; } .ui-icon-person { background-position: -144px -96px; } .ui-icon-print { background-position: -160px -96px; } .ui-icon-trash { background-position: -176px -96px; } .ui-icon-locked { background-position: -192px -96px; } .ui-icon-unlocked { background-position: -208px -96px; } .ui-icon-bookmark { background-position: -224px -96px; } .ui-icon-tag { background-position: -240px -96px; } .ui-icon-home { background-position: 0 -112px; } .ui-icon-flag { background-position: -16px -112px; } .ui-icon-calendar { background-position: -32px -112px; } .ui-icon-cart { background-position: -48px -112px; } .ui-icon-pencil { background-position: -64px -112px; } .ui-icon-clock { background-position: -80px -112px; } .ui-icon-disk { background-position: -96px -112px; } .ui-icon-calculator { background-position: -112px -112px; } .ui-icon-zoomin { background-position: -128px -112px; } .ui-icon-zoomout { background-position: -144px -112px; } .ui-icon-search { background-position: -160px -112px; } .ui-icon-wrench { background-position: -176px -112px; } .ui-icon-gear { background-position: -192px -112px; } .ui-icon-heart { background-position: -208px -112px; } .ui-icon-star { background-position: -224px -112px; } .ui-icon-link { background-position: -240px -112px; } .ui-icon-cancel { background-position: 0 -128px; } .ui-icon-plus { background-position: -16px -128px; } .ui-icon-plusthick { background-position: -32px -128px; } .ui-icon-minus { background-position: -48px -128px; } .ui-icon-minusthick { background-position: -64px -128px; } .ui-icon-close { background-position: -80px -128px; } .ui-icon-closethick { background-position: -96px -128px; } .ui-icon-key { background-position: -112px -128px; } .ui-icon-lightbulb { background-position: -128px -128px; } .ui-icon-scissors { background-position: -144px -128px; } .ui-icon-clipboard { background-position: -160px -128px; } .ui-icon-copy { background-position: -176px -128px; } .ui-icon-contact { background-position: -192px -128px; } .ui-icon-image { background-position: -208px -128px; } .ui-icon-video { background-position: -224px -128px; } .ui-icon-script { background-position: -240px -128px; } .ui-icon-alert { background-position: 0 -144px; } .ui-icon-info { background-position: -16px -144px; } .ui-icon-notice { background-position: -32px -144px; } .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } .ui-icon-radio-on { background-position: -96px -144px; } .ui-icon-radio-off { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-play { background-position: 0 -160px; } .ui-icon-pause { background-position: -16px -160px; } .ui-icon-seek-next { background-position: -32px -160px; } .ui-icon-seek-prev { background-position: -48px -160px; } .ui-icon-seek-end { background-position: -64px -160px; } .ui-icon-seek-start { background-position: -80px -160px; } /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ .ui-icon-seek-first { background-position: -80px -160px; } .ui-icon-stop { background-position: -96px -160px; } .ui-icon-eject { background-position: -112px -160px; } .ui-icon-volume-off { background-position: -128px -160px; } .ui-icon-volume-on { background-position: -144px -160px; } .ui-icon-power { background-position: 0 -176px; } .ui-icon-signal-diag { background-position: -16px -176px; } .ui-icon-signal { background-position: -32px -176px; } .ui-icon-battery-0 { background-position: -48px -176px; } .ui-icon-battery-1 { background-position: -64px -176px; } .ui-icon-battery-2 { background-position: -80px -176px; } .ui-icon-battery-3 { background-position: -96px -176px; } .ui-icon-circle-plus { background-position: 0 -192px; } .ui-icon-circle-minus { background-position: -16px -192px; } .ui-icon-circle-close { background-position: -32px -192px; } .ui-icon-circle-triangle-e { background-position: -48px -192px; } .ui-icon-circle-triangle-s { background-position: -64px -192px; } .ui-icon-circle-triangle-w { background-position: -80px -192px; } .ui-icon-circle-triangle-n { background-position: -96px -192px; } .ui-icon-circle-arrow-e { background-position: -112px -192px; } .ui-icon-circle-arrow-s { background-position: -128px -192px; } .ui-icon-circle-arrow-w { background-position: -144px -192px; } .ui-icon-circle-arrow-n { background-position: -160px -192px; } .ui-icon-circle-zoomin { background-position: -176px -192px; } .ui-icon-circle-zoomout { background-position: -192px -192px; } .ui-icon-circle-check { background-position: -208px -192px; } .ui-icon-circlesmall-plus { background-position: 0 -208px; } .ui-icon-circlesmall-minus { background-position: -16px -208px; } .ui-icon-circlesmall-close { background-position: -32px -208px; } .ui-icon-squaresmall-plus { background-position: -48px -208px; } .ui-icon-squaresmall-minus { background-position: -64px -208px; } .ui-icon-squaresmall-close { background-position: -80px -208px; } .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } .ui-icon-grip-solid-vertical { background-position: -32px -224px; } .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { border-top-left-radius: 4px; } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { border-top-right-radius: 4px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { border-bottom-left-radius: 4px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { border-bottom-right-radius: 4px; } /* Overlays */ .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3; filter: Alpha(Opacity=30); } .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3; filter: Alpha(Opacity=30); border-radius: 8px; }
{'content_hash': '191522e64e11f60c4a079dade6237c16', 'timestamp': '', 'source': 'github', 'line_count': 719, 'max_line_length': 91, 'avg_line_length': 29.581363004172463, 'alnum_prop': 0.6894541351262401, 'repo_name': 'ZeusWPI/FK-enrolment', 'id': '0d81a92f50179d23db780f8a1e26de9633d09710', 'size': '22864', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'vendor/assets/stylesheets/jquery-ui.custom.css', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '11594'}, {'name': 'HTML', 'bytes': '41784'}, {'name': 'JavaScript', 'bytes': '2088'}, {'name': 'Ruby', 'bytes': '140042'}]}
#pragma once #include <kernel/thread.h> #include <lk/compiler.h> #include <lk/debug.h> #include <stdint.h> __BEGIN_CDECLS #define MUTEX_MAGIC (0x6D757478) // 'mutx' typedef struct mutex { uint32_t magic; thread_t *holder; int count; wait_queue_t wait; } mutex_t; #define MUTEX_INITIAL_VALUE(m) \ { \ .magic = MUTEX_MAGIC, \ .holder = NULL, \ .count = 0, \ .wait = WAIT_QUEUE_INITIAL_VALUE((m).wait), \ } /* Rules for Mutexes: * - Mutexes are only safe to use from thread context. * - Mutexes are non-recursive. */ void mutex_init(mutex_t *); void mutex_destroy(mutex_t *); status_t mutex_acquire_timeout(mutex_t *, lk_time_t); /* try to acquire the mutex with a timeout value */ status_t mutex_release(mutex_t *); static inline status_t mutex_acquire(mutex_t *m) { return mutex_acquire_timeout(m, INFINITE_TIME); } /* does the current thread hold the mutex? */ static bool is_mutex_held(mutex_t *m) { return m->holder == get_current_thread(); } __END_CDECLS
{'content_hash': '3ea7f0a02373e74ad276588c857845ef', 'timestamp': '', 'source': 'github', 'line_count': 47, 'max_line_length': 105, 'avg_line_length': 21.53191489361702, 'alnum_prop': 0.6590909090909091, 'repo_name': 'travisg/lk', 'id': 'b0182dcad4b7a19644c5503c40752c22cfea84f9', 'size': '1253', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'kernel/include/kernel/mutex.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '155785'}, {'name': 'C', 'bytes': '3642589'}, {'name': 'C++', 'bytes': '237085'}, {'name': 'Makefile', 'bytes': '97565'}, {'name': 'Objective-C', 'bytes': '12298'}, {'name': 'Python', 'bytes': '4345'}, {'name': 'Shell', 'bytes': '10818'}, {'name': 'Tcl', 'bytes': '288'}]}
UIMiniWindowContainer = extends(UIWidget, "UIMiniWindowContainer") function UIMiniWindowContainer.create() local container = UIMiniWindowContainer.internalCreate() container.scheduledWidgets = {} container:setFocusable(false) container:setPhantom(true) return container end -- TODO: connect to window onResize event -- TODO: try to resize another widget? -- TODO: try to find another panel? function UIMiniWindowContainer:fitAll(noRemoveChild) if not self:isVisible() then return end if not noRemoveChild then local children = self:getChildren() if #children > 0 then noRemoveChild = children[#children] else return end end local sumHeight = 0 local children = self:getChildren() for i=1,#children do if children[i]:isVisible() then sumHeight = sumHeight + children[i]:getHeight() end end local selfHeight = self:getHeight() - (self:getPaddingTop() + self:getPaddingBottom()) if sumHeight <= selfHeight then return end local removeChildren = {} -- try to resize noRemoveChild local maximumHeight = selfHeight - (sumHeight - noRemoveChild:getHeight()) if noRemoveChild:isResizeable() and noRemoveChild:getMinimumHeight() <= maximumHeight then sumHeight = sumHeight - noRemoveChild:getHeight() + maximumHeight addEvent(function() noRemoveChild:setHeight(maximumHeight) end) end -- try to remove no-save widget for i=#children,1,-1 do if sumHeight <= selfHeight then break end local child = children[i] if child ~= noRemoveChild and not child.save then local childHeight = child:getHeight() sumHeight = sumHeight - childHeight table.insert(removeChildren, child) end end -- try to remove save widget for i=#children,1,-1 do if sumHeight <= selfHeight then break end local child = children[i] if child ~= noRemoveChild and child:isVisible() then local childHeight = child:getHeight() sumHeight = sumHeight - childHeight table.insert(removeChildren, child) end end -- close widgets for i=1,#removeChildren do removeChildren[i]:close() end end function UIMiniWindowContainer:onDrop(widget, mousePos) if widget:getClassName() == 'UIMiniWindow' then local oldParent = widget:getParent() if oldParent == self then return true end if oldParent then oldParent:removeChild(widget) end if widget.movedWidget then local index = self:getChildIndex(widget.movedWidget) self:insertChild(index + widget.movedIndex, widget) else self:addChild(widget) end self:fitAll(widget) return true end end function UIMiniWindowContainer:swapInsert(widget, index) local oldParent = widget:getParent() local oldIndex = self:getChildIndex(widget) if oldParent == self and oldIndex ~= index then local oldWidget = self:getChildByIndex(index) if oldWidget then self:removeChild(oldWidget) self:insertChild(oldIndex, oldWidget) end self:removeChild(widget) self:insertChild(index, widget) end end function UIMiniWindowContainer:scheduleInsert(widget, index) if index - 1 > self:getChildCount() then if self.scheduledWidgets[index] then pdebug('replacing scheduled widget id ' .. widget:getId()) end self.scheduledWidgets[index] = widget else local oldParent = widget:getParent() if oldParent ~= self then if oldParent then oldParent:removeChild(widget) end self:insertChild(index, widget) while true do local placed = false for nIndex,nWidget in pairs(self.scheduledWidgets) do if nIndex - 1 <= self:getChildCount() then self:insertChild(nIndex, nWidget) self.scheduledWidgets[nIndex] = nil placed = true break end end if not placed then break end end end end end function UIMiniWindowContainer:order() local children = self:getChildren() for i=1,#children do if not children[i].miniLoaded then return end end for i=1,#children do if children[i].miniIndex then self:swapInsert(children[i], children[i].miniIndex) end end end function UIMiniWindowContainer:saveChildren() local children = self:getChildren() local ignoreIndex = 0 for i=1,#children do if children[i].save then children[i]:saveParentIndex(self:getId(), i - ignoreIndex) else ignoreIndex = ignoreIndex + 1 end end end
{'content_hash': '97c7c2107f2c4e082086aff8889ecfbf', 'timestamp': '', 'source': 'github', 'line_count': 176, 'max_line_length': 92, 'avg_line_length': 25.72159090909091, 'alnum_prop': 0.6920698034018113, 'repo_name': 'Riverlance/kingdom-age-game-linux', 'id': 'a95841588f9ab6cb5bf9ebfbe7fa2cd8a7160a70', 'size': '4540', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'modules/corelib/ui/uiminiwindowcontainer.lua', 'mode': '33188', 'license': 'mit', 'language': []}
ogex_int_array_t *ogex_int_array_create(int capacity) { ogex_int_array_t *array = calloc(1, sizeof(ogex_int_array_t)); if (array == NULL) { return NULL; } vec_init(array); vec_reserve(array, capacity); return array; } void ogex_int_array_free(ogex_int_array_t *array) { assert(array != NULL); vec_deinit(array); free(array); } void ogex_int_array_destroy(ogex_int_array_t *array) { assert(array != NULL); vec_deinit(array); free(array); } int ogex_int_array_push(ogex_int_array_t *array, int value) { assert(array != NULL); int result = vec_push(array, value); return result != -1; } int ogex_int_array_get(ogex_int_array_t *array, int index) { assert(array != NULL); assert(index < 0 && index >= array->length); return vec_get(array, index); } int ogex_int_array_pop(ogex_int_array_t *array) { assert(array != NULL); return vec_pop(array); }
{'content_hash': '93c563d65b0f97e9bcda631bdb976f27', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 66, 'avg_line_length': 19.583333333333332, 'alnum_prop': 0.6212765957446809, 'repo_name': 'warmwaffles/openddl', 'id': 'fdca7e6ac1d9923e6f9258b94062f52b9a53e6b5', 'size': '1013', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'opengex/src/opengex/int_array.c', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '147318'}, {'name': 'CMake', 'bytes': '1293'}, {'name': 'Objective-C', 'bytes': '501'}]}
var React = require('react'); var mdlHandler = require('./mdlComponentHandler'); function mdlUpgradable(spec) { var mdlPrefix = 'mdl-', jsPrefix = 'js-', displayName = spec.displayName, componentName = displayName.replace('Material', ''); var upgradeMdlComponent = function (node) { mdlHandler.upgradeElement(node, displayName); }; var downgradeMdlComponent = function(node) { mdlHandler.downgradeElements(node, displayName); }; return React.createClass({ displayName: displayName, propTypes: { className: React.PropTypes.string }, getDefaultProps: function() { return { className: '' }; }, componentDidMount: function() { upgradeMdlComponent(this.getDOMNode()); }, componentWillUpdate: function() { downgradeMdlComponent(this.getDOMNode()); }, componentDidUpdate: function() { upgradeMdlComponent(this.getDOMNode()); }, componentWillUnmount: function() { downgradeMdlComponent(this.getDOMNode()); }, getUpgradedMDLClassList: function() { var cssClass = mdlPrefix + jsPrefix + componentName.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(), baseClass = cssClass.replace(jsPrefix, ''); return [baseClass, cssClass]; }, render: function() { var classList = this.props.className.split(' '), mdlClassList = this.getUpgradedMDLClassList(); this.element = React.createElement(spec, this.props); return React.cloneElement(this.element, { className: mdlClassList.concat(classList).join(' ') }); } }); } module.exports = mdlUpgradable;
{'content_hash': '42adb3eb020dac4c91d3d2473d775452', 'timestamp': '', 'source': 'github', 'line_count': 68, 'max_line_length': 108, 'avg_line_length': 24.220588235294116, 'alnum_prop': 0.6490588949605343, 'repo_name': 'EdStudio/react-mdlite', 'id': '4b6bd5768c7399c8c84c538ad865561f68d8b748', 'size': '1647', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/utils/mdlUpgradable.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '50429'}, {'name': 'Shell', 'bytes': '190'}]}
/* Generic definitions */ /* Assertions (useful to generate conditional code) */ /* Current type and class (and size, if applicable) */ /* Value methods */ /* Interfaces (keys) */ /* Interfaces (values) */ /* Abstract implementations (keys) */ /* Abstract implementations (values) */ /* Static containers (keys) */ /* Static containers (values) */ /* Implementations */ /* Synchronized wrappers */ /* Unmodifiable wrappers */ /* Other wrappers */ /* Methods (keys) */ /* Methods (values) */ /* Methods (keys/values) */ /* Methods that have special names depending on keys (but the special names depend on values) */ /* Equality */ /* Object/Reference-only definitions (keys) */ /* Primitive-type-only definitions (keys) */ /* Object/Reference-only definitions (values) */ /* Primitive-type-only definitions (values) */ /* * Copyright (C) 2002-2013 Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package it.unimi.dsi.fastutil.ints; import it.unimi.dsi.fastutil.chars.CharCollection; import it.unimi.dsi.fastutil.objects.ObjectSet; import it.unimi.dsi.fastutil.objects.ObjectIterator; import java.util.Map; /** A type-specific {@link Map}; provides some additional methods that use polymorphism to avoid (un)boxing, and handling of a default return value. * * <P>Besides extending the corresponding type-specific {@linkplain it.unimi.dsi.fastutil.Function function}, this interface strengthens {@link #entrySet()}, * {@link #keySet()} and {@link #values()}. Maps returning entry sets of type {@link FastEntrySet} support also fast iteration. * * <P>A submap or subset may or may not have an * independent default return value (which however must be initialized to the * default return value of the originator). * * @see Map */ public interface Int2CharMap extends Int2CharFunction , Map<Integer,Character> { /** An entry set providing fast iteration. * * <p>In some cases (e.g., hash-based classes) iteration over an entry set requires the creation * of a large number of {@link java.util.Map.Entry} objects. Some <code>fastutil</code> * maps might return {@linkplain #entrySet() entry set} objects of type <code>FastEntrySet</code>: in this case, {@link #fastIterator() fastIterator()} * will return an iterator that is guaranteed not to create a large number of objects, <em>possibly * by returning always the same entry</em> (of course, mutated). */ public interface FastEntrySet extends ObjectSet<Int2CharMap.Entry > { /** Returns a fast iterator over this entry set; the iterator might return always the same entry object, suitably mutated. * * @return a fast iterator over this entry set; the iterator might return always the same {@link java.util.Map.Entry} object, suitably mutated. */ public ObjectIterator<Int2CharMap.Entry > fastIterator(); } /** Returns a set view of the mappings contained in this map. * <P>Note that this specification strengthens the one given in {@link Map#entrySet()}. * * @return a set view of the mappings contained in this map. * @see Map#entrySet() */ ObjectSet<Map.Entry<Integer, Character>> entrySet(); /** Returns a type-specific set view of the mappings contained in this map. * * <p>This method is necessary because there is no inheritance along * type parameters: it is thus impossible to strengthen {@link #entrySet()} * so that it returns an {@link it.unimi.dsi.fastutil.objects.ObjectSet} * of objects of type {@link java.util.Map.Entry} (the latter makes it possible to * access keys and values with type-specific methods). * * @return a type-specific set view of the mappings contained in this map. * @see #entrySet() */ ObjectSet<Int2CharMap.Entry > int2CharEntrySet(); /** Returns a set view of the keys contained in this map. * <P>Note that this specification strengthens the one given in {@link Map#keySet()}. * * @return a set view of the keys contained in this map. * @see Map#keySet() */ IntSet keySet(); /** Returns a set view of the values contained in this map. * <P>Note that this specification strengthens the one given in {@link Map#values()}. * * @return a set view of the values contained in this map. * @see Map#values() */ CharCollection values(); /** * @see Map#containsValue(Object) */ boolean containsValue( char value ); /** A type-specific {@link java.util.Map.Entry}; provides some additional methods * that use polymorphism to avoid (un)boxing. * * @see java.util.Map.Entry */ interface Entry extends Map.Entry <Integer,Character> { /** * @see java.util.Map.Entry#getKey() */ int getIntKey(); /** * @see java.util.Map.Entry#setValue(Object) */ char setValue(char value); /** * @see java.util.Map.Entry#getValue() */ char getCharValue(); } }
{'content_hash': 'f7b493ffff62b2666644acc3e1429312', 'timestamp': '', 'source': 'github', 'line_count': 138, 'max_line_length': 157, 'avg_line_length': 38.48550724637681, 'alnum_prop': 0.7122952363020146, 'repo_name': 'karussell/fastutil', 'id': 'c3d7d0f6fcb18d4600e1f865e62d92aa5142198b', 'size': '5311', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/it/unimi/dsi/fastutil/ints/Int2CharMap.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '554418'}, {'name': 'Shell', 'bytes': '23387'}]}
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wts.models.DisMELS.IBMFunctions.Spawning; import com.wtstockhausen.utils.RandomNumberGenerator; import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProviders; import wts.models.DisMELS.framework.GlobalInfo; import wts.models.DisMELS.framework.IBMFunctions.AbstractIBMFunction; import wts.models.DisMELS.framework.IBMFunctions.IBMFunctionInterface; import wts.models.DisMELS.framework.IBMFunctions.IBMParameter; /** * This class provides an implementation of batch spawning activity with" * a poisson-distributed recovery period * Type: * spawning function * Parameters (by key): * minRecoveryPeriod - Double - minimum recovery period (d) * meaRecoveryPeriod - Double - mean recovery period (d) * randomize - Boolean - randomize recovery period * Variables: * vars - any Object or null * Value: * t - time to next spawning event(d) * t ~ Poisson[meanRP,1/(meanRP-minRP)] * * @author William.Stockhausen */ @ServiceProviders(value={ @ServiceProvider(service=IBMFunctionInterface.class)} ) public class BatchSpawningFunction extends AbstractIBMFunction { /** random number generator */ protected static final RandomNumberGenerator rng = GlobalInfo.getInstance().getRandomNumberGenerator(); /** function classification */ public static final String DEFAULT_type = "Spawning"; /** user-friendly function name */ public static final String DEFAULT_name = "batch spawning function"; /** function description */ public static final String DEFAULT_descr = "batch spawning function"; /** full description */ public static final String DEFAULT_fullDescr = "\n\t**************************************************************************"+ "\n\t* This class provides an implementation of batch spawning activity with"+ "\n\t* a poisson-distributed recovery period."+ "\n\t* Type: "+ "\n\t* spawning function"+ "\n\t* Parameters (by key):"+ "\n\t* minRecoveryPeriod - Double - minimum recovery period (d)"+ "\n\t* meaRecoveryPeriod - Double - mean recovery period (d)"+ "\n\t* randomize - Boolean - randomize recovery period "+ "\n\t* Variables:"+ "\n\t* vars - any Object or null"+ "\n\t* Value:"+ "\n\t* t - time to next spawning event(d)"+ "\n\t* t ~ Poisson[meanRP,1/(meanRP-minRP)]"+ "\n\t* author: William.Stockhausen"+ "\n\t**************************************************************************"; /** number of settable parameters */ public static final int numParams = 2; /** number of sub-functions */ public static final int numSubFuncs = 0; /** key to set min recovery period parameter */ public static final String PARAM_minRecoveryPeriod = "minimum recovery period (d)"; /** key to set mean recovery period parameter */ public static final String PARAM_meanRecoveryPeriod = "mean recovery period (d)"; /** key to set stochastic flag */ public static final String PARAM_randomize = "randomize recovery period"; /** value of min recovery period parameter */ private double minRP = 0.0; /** value of mean recovery period parameter */ private double meanRP = 0.0; /** value of mean recovery period parameter */ private boolean randomize = false; /** constructor for class */ public BatchSpawningFunction(){ super(numParams,numSubFuncs,DEFAULT_type,DEFAULT_name,DEFAULT_descr,DEFAULT_fullDescr); String key; key = PARAM_minRecoveryPeriod; addParameter(key,Double.class, key); key = PARAM_meanRecoveryPeriod; addParameter(key,Double.class, key); key = PARAM_randomize; addParameter(key,Boolean.class, key); } @Override public BatchSpawningFunction clone(){ BatchSpawningFunction clone = new BatchSpawningFunction(); clone.setFunctionType(getFunctionType()); clone.setFunctionName(getFunctionName()); clone.setDescription(getDescription()); clone.setFullDescription(getFullDescription()); for (String key: getParameterNames()) { IBMParameter op = getParameter(key); IBMParameter np = clone.getParameter(key); np.setDescription(op.getDescription()); np.setValue(op.getValue()); } // for (String key: getSubfunctionNames()) clone.setSubfunction(key,(IBMFunctionInterface)getSubfunction(key).clone()); return clone; } /** * Sets the parameter value corresponding to the key associated with param. * * @param param - the parameter key (name) * @param value - its value * @return */ @Override public boolean setParameterValue(String param,Object value){ if (super.setParameterValue(param, value)){ switch (param) { case PARAM_minRecoveryPeriod: minRP = ((Double) value); break; case PARAM_meanRecoveryPeriod: meanRP = ((Double) value); break; case PARAM_randomize: randomize = ((Boolean) value); break; } return true; } return false; } /** * Calculates the value of the function, given the current parameters. * * @param vars - any Object or null * @return - Double - time to next spawning event */ @Override public Double calculate(Object vars) { double res = meanRP; if (randomize){ res = minRP-Math.log(rng.computeUniformVariate(0.0, 1.0))*(meanRP-minRP); } return res; } }
{'content_hash': '4d00d82f37cdf42637f7022e825081e9', 'timestamp': '', 'source': 'github', 'line_count': 150, 'max_line_length': 126, 'avg_line_length': 40.08, 'alnum_prop': 0.6124417831004657, 'repo_name': 'wStockhausen/DisMELS', 'id': '97e537bbb194da928e21b2550d55af66b4d558f1', 'size': '6012', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'DisMELS_IBMFunctions/src/wts/models/DisMELS/IBMFunctions/Spawning/BatchSpawningFunction.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '3320511'}]}
package com.entity; import java.io.Serializable; import java.util.Set; public class Hall implements Serializable{ /** * */ private static final long serialVersionUID = -2972907068930528292L; private int hall_id; private String roomname; private String version;//放映的版本 //一个播放厅播放多个场次的电影 private Set<Play> play; private int seat;//一个放映厅的座位数 public int getSeat() { return seat; } public void setSeat(int seat) { this.seat = seat; } public String getVersion() { return version; } public void setVersion(String version) { this.version = version; } public Set<Play> getPlay() { return play; } public void setPlay(Set<Play> play) { this.play = play; } public String getRoomname() { return roomname; } public int getHall_id() { return hall_id; } public void setHall_id(int hall_id) { this.hall_id = hall_id; } public void setRoomname(String roomname) { this.roomname = roomname; } public Hall() { super(); } }
{'content_hash': 'ff4e155f31edb907f21c66883f056b9d', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 68, 'avg_line_length': 17.14814814814815, 'alnum_prop': 0.7213822894168467, 'repo_name': 'blueiou/mymovie', 'id': 'a98ec59f3cb723249116381b58403b33afd5254d', 'size': '982', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/com/entity/Hall.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '24139'}, {'name': 'CSS', 'bytes': '101766'}, {'name': 'HTML', 'bytes': '74262'}, {'name': 'Java', 'bytes': '193574'}, {'name': 'JavaScript', 'bytes': '441586'}]}
package com.hazelcast.transaction; import com.hazelcast.core.DistributedObject; import javax.transaction.xa.XAResource; /** * Interface for providing Hazelcast as an XAResource */ public interface HazelcastXAResource extends XAResource, DistributedObject { /** * Returns the TransactionContext associated with the current thread. * * @return TransactionContext associated with the current thread * @throws IllegalStateException if no context found */ TransactionContext getTransactionContext(); }
{'content_hash': 'c0d1c1b2fa7ae7b0a044584208bb3b0f', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 76, 'avg_line_length': 23.47826086956522, 'alnum_prop': 0.7574074074074074, 'repo_name': 'lmjacksoniii/hazelcast', 'id': 'df14336954e7d4ddba7db64cc133846a0faa4dd8', 'size': '1165', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'hazelcast/src/main/java/com/hazelcast/transaction/HazelcastXAResource.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '948'}, {'name': 'Java', 'bytes': '28952463'}, {'name': 'Shell', 'bytes': '13259'}]}
using System; namespace Orleans.Runtime { [Serializable] public struct MembershipVersion : IComparable<MembershipVersion>, IEquatable<MembershipVersion> { private readonly long version; public MembershipVersion(long version) { this.version = version; } public static MembershipVersion MinValue => new MembershipVersion(long.MinValue); public int CompareTo(MembershipVersion other) => this.version.CompareTo(other.version); public bool Equals(MembershipVersion other) => this.version == other.version; public override bool Equals(object obj) => obj is MembershipVersion other && this.Equals(other); public override int GetHashCode() => this.version.GetHashCode(); public override string ToString() => this.version.ToString(); public static bool operator ==(MembershipVersion left, MembershipVersion right) => left.version == right.version; public static bool operator !=(MembershipVersion left, MembershipVersion right) => left.version != right.version; public static bool operator >=(MembershipVersion left, MembershipVersion right) => left.version >= right.version; public static bool operator <=(MembershipVersion left, MembershipVersion right) => left.version <= right.version; public static bool operator >(MembershipVersion left, MembershipVersion right) => left.version > right.version; public static bool operator <(MembershipVersion left, MembershipVersion right) => left.version < right.version; } }
{'content_hash': 'a36ddfd0fb6a0a7997dba91fc19af85d', 'timestamp': '', 'source': 'github', 'line_count': 34, 'max_line_length': 121, 'avg_line_length': 46.3235294117647, 'alnum_prop': 0.7123809523809523, 'repo_name': 'sergeybykov/orleans', 'id': '9adc17ab78c005aff1760ce3a241197063c2a2a6', 'size': '1577', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Orleans.Core/Runtime/MembershipVersion.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '8670'}, {'name': 'C#', 'bytes': '9688518'}, {'name': 'F#', 'bytes': '2313'}, {'name': 'PLSQL', 'bytes': '23892'}, {'name': 'PLpgSQL', 'bytes': '53037'}, {'name': 'PowerShell', 'bytes': '1743'}, {'name': 'Shell', 'bytes': '3725'}, {'name': 'Smalltalk', 'bytes': '1436'}, {'name': 'TSQL', 'bytes': '22730'}]}
#include <pebble.h> #include "sliding-text-layer.h" #define ANIMATION_DIRECTION_UP 0 #define ANIMATION_DIRECTION_DOWN 1 typedef struct SlidingTextLayerData { char* text_next; char* text_current; GColor color_text; GFont font; bool is_animating; GTextOverflowMode overflow; GTextAlignment align; Animation* animation; AnimationImplementation implementation; AnimationImplementation implementation_bounce; uint16_t offset; uint8_t direction; AnimationCurve curve; int8_t adjustment; uint16_t duration; } SlidingTextLayerData; static void animate(SlidingTextLayer* layer, uint8_t direction); static void animate_bounce(SlidingTextLayer* layer, uint8_t direction); static void render(Layer* layer, GContext* ctx); static void animation_started(Animation *anim, void *context); static void animation_stopped(Animation *anim, bool stopped, void *context); static void animation_stopped_bounce(Animation *anim, bool stopped, void *context); static void update(Animation* anim, AnimationProgress dist_normalized); static void update_bounce(Animation* anim, AnimationProgress dist_normalized); #define get_layer(layer) (Layer*)layer #define get_data(layer) (SlidingTextLayerData*) layer_get_data(get_layer(layer)) #define layer_get_height(layer) layer_get_bounds(layer).size.h #define layer_get_width(layer) layer_get_bounds(layer).size.w static int getDuration(){ int multiplierNumber = ((rand() % 6) + 1) * 100; return multiplierNumber; } SlidingTextLayer* sliding_text_layer_create(GRect rect) { SlidingTextLayer* layer = (SlidingTextLayer*)layer_create_with_data(rect, sizeof(SlidingTextLayerData)); SlidingTextLayerData* data = get_data(layer); data->color_text = GColorBlack; data->align = GTextAlignmentCenter; data->overflow = GTextOverflowModeFill; data->offset = 0; data->is_animating = false; data->implementation.update = update; data->implementation_bounce.update = update_bounce; data->curve = AnimationCurveEaseInOut; data->duration = getDuration(); layer_set_update_proc(get_layer(layer), render); return layer; } void sliding_text_layer_destroy(SlidingTextLayer* layer) { SlidingTextLayerData* data = get_data(layer); if (data->is_animating) { } layer_destroy(get_layer(layer)); } void sliding_text_layer_animate_up(SlidingTextLayer* layer) { animate(layer, ANIMATION_DIRECTION_UP); } void sliding_text_layer_animate_down(SlidingTextLayer* layer) { animate(layer, ANIMATION_DIRECTION_DOWN); } void sliding_text_layer_animate_bounce_up(SlidingTextLayer* layer) { animate_bounce(layer, ANIMATION_DIRECTION_UP); } void sliding_text_layer_animate_bounce_down(SlidingTextLayer* layer) { animate_bounce(layer, ANIMATION_DIRECTION_DOWN); } void sliding_text_layer_set_text(SlidingTextLayer* layer, char* text) { if (! layer) { return; } SlidingTextLayerData* data = get_data(layer); if (! data) { return; } free(data->text_current); data->text_current = text; layer_mark_dirty(get_layer(layer)); } void sliding_text_layer_set_next_text(SlidingTextLayer* layer, char* text) { if (! layer) { return; } SlidingTextLayerData* data = get_data(layer); if (! data) { return; } data->text_next = text; } void sliding_text_layer_set_duration(SlidingTextLayer* layer, uint16_t duration) { if (! layer) { return; } SlidingTextLayerData* data = get_data(layer); if (! data) { return; } data->duration = duration; } void sliding_text_layer_set_animation_curve(SlidingTextLayer* layer, AnimationCurve curve) { if (! layer) { return; } SlidingTextLayerData* data = get_data(layer); if (! data) { return; } data->curve = curve; } void sliding_text_layer_set_font(SlidingTextLayer* layer, GFont font) { if (! layer) { return; } SlidingTextLayerData* data = get_data(layer); if (! data) { return; } data->font = font; layer_mark_dirty(get_layer(layer)); } void sliding_text_layer_set_text_color(SlidingTextLayer* layer, GColor color) { if (! layer) { return; } SlidingTextLayerData* data = get_data(layer); if (! data) { return; } data->color_text = color; layer_mark_dirty(get_layer(layer)); } void sliding_text_layer_set_text_alignment(SlidingTextLayer* layer, GTextAlignment alignment) { if (! layer) { return; } SlidingTextLayerData* data = get_data(layer); if (! data) { return; } data->align = alignment; } void sliding_text_layer_set_vertical_adjustment(SlidingTextLayer* layer, int8_t adjustment) { if (! layer) { return; } SlidingTextLayerData* data = get_data(layer); if (! data) { return; } data->adjustment = adjustment; } bool sliding_text_layer_is_animating(SlidingTextLayer* layer) { if (! layer) { return false; } SlidingTextLayerData* data = get_data(layer); if (! data) { return false; } return data->is_animating; } static void animate(SlidingTextLayer* layer, uint8_t direction) { if (! layer) { return; } SlidingTextLayerData* data = get_data(layer); if (! data) { return; } if (data->is_animating) { return; } data->direction = direction; data->offset = 0; data->animation = animation_create(); animation_set_duration(data->animation, data->duration); animation_set_curve(data->animation, data->curve); animation_set_implementation(data->animation, &data->implementation); animation_set_handlers(data->animation, (AnimationHandlers) { .started = animation_started, .stopped = animation_stopped }, (void*)layer); animation_schedule(data->animation); } static void animate_bounce(SlidingTextLayer* layer, uint8_t direction) { if (! layer) { return; } SlidingTextLayerData* data = get_data(layer); if (! data) { return; } if (data->is_animating) { return; } data->direction = direction; data->offset = 0; data->animation = animation_create(); animation_set_duration(data->animation, data->duration / 2); animation_set_curve(data->animation, data->curve); animation_set_implementation(data->animation, &data->implementation_bounce); animation_set_handlers(data->animation, (AnimationHandlers) { .started = animation_started, .stopped = animation_stopped_bounce }, (void*)layer); animation_schedule(data->animation); } static void render(Layer* layer, GContext* ctx) { SlidingTextLayerData* data = get_data(layer); graphics_context_set_text_color(ctx, data->color_text); #if STL_DEBUG graphics_context_set_fill_color(ctx, GColorBlack); graphics_fill_rect(ctx, layer_get_bounds(layer), 0, GCornerNone); #endif if (data->is_animating) { graphics_draw_text(ctx, data->direction == ANIMATION_DIRECTION_UP ? data->text_next : data->text_current, data->font, GRect(0, data->adjustment - data->offset, layer_get_width(layer), layer_get_height(layer)), data->overflow, data->align, NULL); graphics_draw_text(ctx, data->direction == ANIMATION_DIRECTION_UP ? data->text_current : data->text_next, data->font, GRect(0, layer_get_height(layer) + data->adjustment - data->offset, layer_get_width(layer), layer_get_height(layer)), data->overflow, data->align, NULL); } else { graphics_draw_text(ctx, data->text_current, data->font, GRect(0, data->adjustment, layer_get_width(layer), layer_get_height(layer)), data->overflow, data->align, NULL); } } static void animation_started(Animation *anim, void *context) { #if STL_DEBUG APP_LOG(APP_LOG_LEVEL_DEBUG, "%d", heap_bytes_free()); #endif SlidingTextLayerData* data = get_data((SlidingTextLayer*)context); data->is_animating = true; } static void animation_stopped(Animation *anim, bool stopped, void *context) { SlidingTextLayerData* data = get_data((SlidingTextLayer*)context); data->is_animating = false; data->text_current = data->text_next; data->text_next = false; #ifdef PBL_SDK_2 animation_destroy(anim); #endif } static void animation_stopped_bounce(Animation *anim, bool stopped, void *context) { SlidingTextLayerData* data = get_data((SlidingTextLayer*)context); data->is_animating = false; } static void update(Animation* anim, AnimationProgress dist_normalized) { SlidingTextLayer* layer = (SlidingTextLayer*)animation_get_context(anim); SlidingTextLayerData* data = get_data(layer); uint16_t percent = (100 * dist_normalized) / (ANIMATION_NORMALIZED_MAX); if (data->direction == ANIMATION_DIRECTION_UP) { data->offset = layer_get_height(layer) - ((uint16_t)(layer_get_height(layer) * percent) / 100); } else { data->offset = (uint16_t)((layer_get_height(layer) * percent) / 100); } layer_mark_dirty(get_layer(layer)); } static void update_bounce(Animation* anim, AnimationProgress dist_normalized) { SlidingTextLayer* layer = (SlidingTextLayer*)animation_get_context(anim); SlidingTextLayerData* data = get_data(layer); uint16_t max_height = (layer_get_height(layer) * 100) / 3; uint16_t percent = (dist_normalized * 100) / ANIMATION_NORMALIZED_MAX; if (data->direction == ANIMATION_DIRECTION_UP) { data->offset = (layer_get_height(layer) - (uint16_t)(max_height * percent) / 10000); } else { data->offset = (uint16_t)((max_height * percent) / 10000); } layer_mark_dirty(get_layer(layer)); }
{'content_hash': 'd95942fadeb3525b3e99348bfdd4757b', 'timestamp': '', 'source': 'github', 'line_count': 330, 'max_line_length': 123, 'avg_line_length': 28.35757575757576, 'alnum_prop': 0.6994015815345159, 'repo_name': 'chrisschlitt/Pebble_MLB', 'id': 'd3cefa38ee9497bf94941320675a4c0cb3ec1a26', 'size': '10538', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/sliding-text-layer.c', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '57862'}, {'name': 'JavaScript', 'bytes': '15057'}, {'name': 'Python', 'bytes': '1136'}]}
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace OakIdeas.Schema.Core.CreativeWorks { public class ItemListElement { public string Value { get; set; } public string Order { get; set; } } }
{'content_hash': '34e6bcb3c61905271db69b3ecf73a655', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 44, 'avg_line_length': 20.46153846153846, 'alnum_prop': 0.6842105263157895, 'repo_name': 'oakcool/OakIdeas.Schema', 'id': 'd54987f615832be193ae406beee917da8d8a2342', 'size': '268', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'OakIdeas.Schema.Core/CreativeWorks/ItemListElement.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '184653'}]}
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{'content_hash': '76ed169cedffe0ece8a30b3ff94e43ee', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': 'd785f2806c0140eba2364cfb298587c9616ed2c6', 'size': '183', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Liliopsida/Liliales/Liliaceae/Gagea/Gagea pauciflora/ Syn. Lloydia szechenyiana/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
package com.themodernway.server.core.security; import java.io.IOException; import java.util.List; import com.themodernway.server.core.AbstractCoreLoggingBase; import com.themodernway.server.core.ICoreCommon; import com.themodernway.server.core.logging.IHasLogging; import com.themodernway.server.core.logging.LoggingOps; public class DefaultAuthorizationProvider extends AbstractCoreLoggingBase implements IAuthorizationProvider, ICoreCommon, IHasLogging { public DefaultAuthorizationProvider() { if (logger().isInfoEnabled()) { logger().info(LoggingOps.THE_MODERN_WAY_MARKER, "DefaultAuthorizationProvider()"); } } @Override public IAuthorizationResult isAuthorized(final Object target, List<String> roles) { if (null == target) { if (logger().isErrorEnabled()) { logger().error(LoggingOps.THE_MODERN_WAY_MARKER, "error null target"); } return new AuthorizationResult(false, E_RUNTIMEERROR, "error null target"); } if (null == roles) { if (logger().isErrorEnabled()) { logger().error(LoggingOps.THE_MODERN_WAY_MARKER, "error null roles"); } return new AuthorizationResult(false, E_RUNTIMEERROR, "error null roles"); } roles = toUnique(roles); if (roles.isEmpty()) { if (logger().isErrorEnabled()) { logger().error(LoggingOps.THE_MODERN_WAY_MARKER, "error empty roles"); } return new AuthorizationResult(false, E_RUNTIMEERROR, "error empty roles"); } if (target instanceof IAuthorizedObject) { if (logger().isDebugEnabled()) { logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, "dispatch authorization roles " + toPrintableString(roles)); } final IAuthorizationResult result = ((IAuthorizedObject) target).isAuthorized(roles); if (null != result) { if (logger().isDebugEnabled()) { logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, "dispatch to authorization result " + result.toString()); } return result; } if (logger().isErrorEnabled()) { logger().error(LoggingOps.THE_MODERN_WAY_MARKER, "error null authorization result"); } return new AuthorizationResult(false, E_RUNTIMEERROR, "error null authorization result"); } final Authorized authorized = target.getClass().getAnnotation(Authorized.class); if (null == authorized) { if (logger().isDebugEnabled()) { logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, "pass no authorizations present"); } return new AuthorizationResult(true, I_WASVALIDATED, "pass no authorizations present"); } List<String> list = toUnique(authorized.not()); if (false == list.isEmpty()) { for (final String type : list) { if (roles.contains(type)) { if (logger().isDebugEnabled()) { logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, "fail not role " + type + " in roles " + toPrintableString(roles)); } return new AuthorizationResult(false, E_EXCLUDEDROLE, "fail not role " + type); } } } long look = 0; list = toUnique(authorized.all()); if (false == list.isEmpty()) { for (final String type : list) { if (false == roles.contains(type)) { if (logger().isDebugEnabled()) { logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, "fail and role " + type + " in roles " + toPrintableString(roles)); } return new AuthorizationResult(false, E_NOTVALIDROLE, "fail and role " + type); } } look++; } list = toUnique(authorized.any()); if (false == list.isEmpty()) { for (final String type : list) { if (roles.contains(type)) { if (logger().isDebugEnabled()) { logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, "pass any role " + type + " in roles " + toPrintableString(roles)); } return new AuthorizationResult(true, I_WASVALIDATED, "pass any role " + type); } } if (logger().isDebugEnabled()) { logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, "fail any " + toPrintableString(list) + " in roles " + toPrintableString(roles)); } return new AuthorizationResult(false, E_NOTVALIDROLE, "fail any role"); } if (look < 1) { list = toUnique(authorized.value()); if (false == list.isEmpty()) { for (final String type : list) { if (false == roles.contains(type)) { if (logger().isDebugEnabled()) { logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, "fail value role " + type + " in roles " + toPrintableString(roles)); } return new AuthorizationResult(false, E_NOTVALIDROLE, "fail value role " + type); } } } } if (logger().isDebugEnabled()) { logger().debug(LoggingOps.THE_MODERN_WAY_MARKER, "pass no authorizations matched in roles " + toPrintableString(roles)); } return new AuthorizationResult(true, I_WASVALIDATED, "pass no authorizations matched"); } @Override public void close() throws IOException { if (logger().isInfoEnabled()) { logger().info(LoggingOps.THE_MODERN_WAY_MARKER, "DefaultAuthorizationProvider().close()"); } } }
{'content_hash': '02eff669fe596dfb657b72e2f02eacab', 'timestamp': '', 'source': 'github', 'line_count': 174, 'max_line_length': 146, 'avg_line_length': 36.770114942528735, 'alnum_prop': 0.5236011253516724, 'repo_name': 'themodernway/themodernway-server-core', 'id': 'b543982865557fafc9b0c7763ddf61c4e7cd09ad', 'size': '7022', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/groovy/com/themodernway/server/core/security/DefaultAuthorizationProvider.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Groovy', 'bytes': '132081'}, {'name': 'Java', 'bytes': '761126'}, {'name': 'JavaScript', 'bytes': '187'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>founify: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.6.1 / founify - 8.10.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> founify <small> 8.10.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-04-26 16:21:57 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-04-26 16:21:57 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.6.1 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/founify&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/FOUnify&quot;] depends: [ &quot;camlp5&quot; &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.11~&quot;} ] tags: [ &quot;keyword: First-order Unification&quot; &quot;keyword: Robinson&quot; &quot;category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms&quot; &quot;category: Miscellaneous/Extracted Programs/Type checking unification and normalization&quot; ] authors: [ &quot;Jocelyne Rouyer&quot; ] bug-reports: &quot;https://github.com/coq-contribs/founify/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/founify.git&quot; synopsis: &quot;Correctness and extraction of the unification algorithm&quot; description: &quot;&quot;&quot; A notion of terms based on symbols without fixed arities is defined and an extended unification problem is proved solvable on these terms. An algorithm, close from Robinson algorithm, can be extracted from the proof.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/founify/archive/v8.10.0.tar.gz&quot; checksum: &quot;md5=2f68b8dc8c863e75077d1667a36cf10f&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-founify.8.10.0 coq.8.6.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.6.1). The following dependencies couldn&#39;t be met: - coq-founify -&gt; coq &gt;= 8.10 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-founify.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{'content_hash': '37e8885d5d42534bdbcae4a57fa8a332', 'timestamp': '', 'source': 'github', 'line_count': 176, 'max_line_length': 159, 'avg_line_length': 40.94886363636363, 'alnum_prop': 0.5534896628278063, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': '70b78f7588db0c24354178252cf62d75e1aa0265', 'size': '7232', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.05.0-2.0.1/released/8.6.1/founify/8.10.0.html', 'mode': '33188', 'license': 'mit', 'language': []}
package com.vmware.vim25; /** * @author Steve Jin (http://www.doublecloud.org) * @version 5.1 */ @SuppressWarnings("all") public class VspanPortgroupPromiscChangeFault extends DvsFault { public String portgroupName; public String getPortgroupName() { return this.portgroupName; } public void setPortgroupName(String portgroupName) { this.portgroupName=portgroupName; } }
{'content_hash': '81f1c8fac893060265bb88e1b652204c', 'timestamp': '', 'source': 'github', 'line_count': 21, 'max_line_length': 64, 'avg_line_length': 18.761904761904763, 'alnum_prop': 0.7436548223350253, 'repo_name': 'xebialabs/vijava', 'id': 'cd0e2477baaac7cc6b732ec4c4b1743717a76d24', 'size': '2034', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/com/vmware/vim25/VspanPortgroupPromiscChangeFault.java', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Groovy', 'bytes': '377'}, {'name': 'Java', 'bytes': '7842140'}]}
layout: post published: true title: "It might not get weirder than this" link: https://sites.google.com/site/sophieinnorthkorea/ permalink: /2013/02/it-might-not-get-weirder-than-this/ --- Fascinating account by Eric Schmidt's daughter Sophie about their trip to North Korea. > Top Level Take-aways: > > 1. Go to North Korea if you can. It is very, very strange. > 2. If it is January, disregard the above. It is very, very cold. > 3. Nothing I'd read or heard beforehand really prepared me for what we saw.
{'content_hash': '0a43c10c31d1bff63f9b91d5b655d492', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 86, 'avg_line_length': 36.42857142857143, 'alnum_prop': 0.7470588235294118, 'repo_name': 'alexbilbie/alexbilbie.github.com', 'id': '845e5208c4bcdb05e221f4452e45385c24fe1f39', 'size': '514', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_posts/2013-02-10-it-might-not-get-weirder-than-this.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '250805'}, {'name': 'HTML', 'bytes': '42201'}]}
package net.firejack.platform.web.security.action; import net.firejack.platform.api.registry.domain.Action; import net.firejack.platform.core.model.registry.HTTPMethod; public enum StandardAction { READ, READ_ALL, CREATE, UPDATE, DELETE, ADVANCED_SEARCH; public static StandardAction detectStandardAction(Action action) { return isReadAction(action) ? READ : isReadAllAction(action) ? READ_ALL : isCreateAction(action) ? CREATE : isUpdateAction(action) ? UPDATE : isDeleteAction(action) ? DELETE : isAdvancedSearchAction(action) ? ADVANCED_SEARCH : null; } public static boolean isReadAction(Action action) { return HTTPMethod.GET.equals(action.getMethod()) && action.getName().equalsIgnoreCase(ActionDetectorFactory.READ_ACTION); } public static boolean isCreateAction(Action action) { return HTTPMethod.POST.equals(action.getMethod()) && action.getName().equalsIgnoreCase(ActionDetectorFactory.CREATE_ACTION); } public static boolean isUpdateAction(Action action) { return HTTPMethod.PUT.equals(action.getMethod()) && action.getName().equalsIgnoreCase(ActionDetectorFactory.UPDATE_ACTION); } public static boolean isDeleteAction(Action action) { return HTTPMethod.DELETE.equals(action.getMethod()) && action.getName().equalsIgnoreCase(ActionDetectorFactory.DELETE_ACTION); } public static boolean isReadAllAction(Action action) { return HTTPMethod.GET.equals(action.getMethod()) && action.getName().equalsIgnoreCase(ActionDetectorFactory.READ_ALL_ACTION); } public static boolean isAdvancedSearchAction(Action action) { return action.getName().equalsIgnoreCase(ActionDetectorFactory.ADVANCED_SEARCH_ACTION); } }
{'content_hash': '6535fd23b4485e1a90a32cc3a2df8367', 'timestamp': '', 'source': 'github', 'line_count': 47, 'max_line_length': 114, 'avg_line_length': 39.61702127659574, 'alnum_prop': 0.7056928034371643, 'repo_name': 'firejack-open/Firejack-Platform', 'id': '62e3725bb24d868722ca944899a32be7fed6ec33', 'size': '2669', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'integration/src/main/java/net/firejack/platform/web/security/action/StandardAction.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ActionScript', 'bytes': '4068'}, {'name': 'CSS', 'bytes': '5861839'}, {'name': 'Java', 'bytes': '8816378'}, {'name': 'JavaScript', 'bytes': '37310201'}, {'name': 'Python', 'bytes': '7764'}, {'name': 'Ruby', 'bytes': '11804'}, {'name': 'Shell', 'bytes': '38753'}]}
using System.Collections.Generic; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Z.Collections.Test { [TestClass] public class System_Collections_Generic_IDictionary_TKey_TValue_ContainsAllKey { [TestMethod] public void ContainsAllKey() { // Type var @this = new Dictionary<string, string> {{"Fizz", "Buzz"}, {"Fizz2", "Buzz2"}}; // Exemples bool value1 = @this.ContainsAllKey("Fizz", "Fizz2"); // return true; bool value2 = @this.ContainsAllKey("Fizz", "Fizz3"); // return false; // Unit Test Assert.IsTrue(value1); Assert.IsFalse(value2); } } }
{'content_hash': 'e916fc765b3b65ba55f2862e5ff51e4c', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 94, 'avg_line_length': 29.5, 'alnum_prop': 0.5861581920903954, 'repo_name': 'zzzprojects/Z.ExtensionMethods', 'id': 'e982aba02782c2a6ac82d6bd1d7ff7c275490348', 'size': '1133', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/Z.Collections.Test/System.Collections.Generic.IDictionary[TKey,TValue]/IDictionary[TKey,TValue].ContainsAllKey.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '2614731'}, {'name': 'Visual Basic', 'bytes': '1411898'}]}
// Calculates and returns the force components needed to achieve the // given velocity. <params> is a dictionary containing the rider and // environmental parameters all in metric units. 'velocity' is in km/h. function CalculateForces(velocity, params) { // calculate Fgravity var Fgravity = 9.8067 * (params.rp_wr + params.rp_wb) * Math.sin(Math.atan(params.ep_g / 100.0)); // calculate Frolling var Frolling = 9.8067 * (params.rp_wr + params.rp_wb) * Math.cos(Math.atan(params.ep_g / 100.0)) * (params.ep_crr); // calculate Fdrag var Fdrag = 0.5 * (params.rp_a) * (params.rp_cd) * (params.ep_rho) * (velocity * 1000.0 / 3600.0) * (velocity * 1000.0 / 3600.0); // cons up and return the force components var ret = { }; ret.Fgravity = Fgravity; ret.Frolling = Frolling; ret.Fdrag = Fdrag; return ret; } // Calculates and returns the power needed to achieve the given // velocity. <params> is a dictionary containing the rider and // environmenetal parameters all in metric units. 'velocity' // is in km/h. Returns power in watts. function CalculatePower(velocity, params) { // calculate the forces on the rider. var forces = CalculateForces(velocity, params); var totalforce = forces.Fgravity + forces.Frolling + forces.Fdrag; // calculate necessary wheelpower var wheelpower = totalforce * (velocity * 1000.0 / 3600.0); // calculate necessary legpower var legpower = wheelpower / (1.0 - (params.rp_dtl/100.0)); return legpower; } // Calculates the velocity obtained from a given power. <params> is a // dictionary containing the rider and model parameters, all in // metric units. // // Runs a simple midpoint search, using CalculatePower(). // // Returns velocity, in km/h. export function CalculateVelocity(power, params) { // How close to get before finishing. var epsilon = 0.000001; // Set some reasonable upper / lower starting points. var lowervel = -1000.0; var uppervel = 1000.0; var midvel = 0.0; var midpow = CalculatePower(midvel, params); // Iterate until completion. var itcount = 0; do { if (Math.abs(midpow - power) < epsilon) break; if (midpow > power) uppervel = midvel; else lowervel = midvel; midvel = (uppervel + lowervel) / 2.0; midpow = CalculatePower(midvel, params); } while (itcount++ < 100); return midvel; }
{'content_hash': '540f5fc9838ca6b1c4e2dc4ba93bb685', 'timestamp': '', 'source': 'github', 'line_count': 86, 'max_line_length': 72, 'avg_line_length': 29.569767441860463, 'alnum_prop': 0.6354699174203696, 'repo_name': 'chadj/gpedal', 'id': '2ac95b635b27f49c241e9cbd32abda6e1ded8f3e', 'size': '2704', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/lib/power_v_speed.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '96082'}]}
<?xml version="1.0" encoding="ISO-8859-1"?> <module version="0.1"> <name lang="en">Course Properties</name> <description lang="en">Allows instructors and administrators to delete a course, or manage its various properties such as title, description, access level, course icon and more. </description> <maintainers> <maintainer> <name>ATutor Team</name> <email>[email protected]</email> </maintainer> </maintainers> <url>http://atutor.ca</url> <license>GPL</license> <release> <version>0.1</version> <privileges> <instructor_privilege>existing</instructor_privilege> <admin_privilege></admin_privilege> </privileges> <date>2005-08-22</date> <state>stable</state> <notes>This is a core module.</notes> </release> </module>
{'content_hash': '0d62030ad92b3dd03847e022de9df918', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 197, 'avg_line_length': 37.69565217391305, 'alnum_prop': 0.615916955017301, 'repo_name': 'CaviereFabien/Test', 'id': '21f8865d4ab8e4228d0a224ef046863b3e5fe515', 'size': '867', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ATutor/mods/_core/properties/module.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
<!DOCTYPE html> <html> <head> <title>Pseudo Blog</title> <link rel="stylesheet" type="text/css" href="stylesheets/analysis_blog.css"> <meta charset="utf-8"> </head> <body> <div id="wrapper"> <header> <h1>Keyboard Thoughts</h1> <ul id="menu"> <a href="week1_technical_blog.html"><li>Blog</li></a> <a href=""><li>About Me</li></a> <a href=""><li>Contact</li></a> </ul> </header> <div id="main"> <div id="primary"> <div class="post"> <a href="http://www.codecademy.com/" target="_blank"><img src="images/codecademy.png" alt="codecademy" class="logo"></a> <p class="website_name">Codecademy</p> <p class="question">Why is this one of your favorite sites?</p> <p class="answer">This is one of the places that I realized that I loved to code!</p> <p class="question">What area of the site is your eye drawn to when looking at the homepage? Stand back further, what area is your eye drawn to now? Is that area the most important area of the site?</p> <p class="answer">The two areas that my eyes are drawn to are the text-line interface and the "sign-up" button.</p> <p class="question">How would you describe the website visually? List 5 adjectives. (i.e. "pretty", "elegant", "simple", "dark", "cluttered", "basic" etc)</p> <p class="answer">simple, minimalistic, sleek, dull, subdued</p> <p class="question">What problem does this website solve? What content does it have?</p> <p class="answer">This website gives people the opportunity to learn how to code. It gives simple information on what the purpose of the website is and provides a clear call to action.</p> <p class="question">What 5 adjectives would you use to describe the content, focus, and purpose of the site? (i.e. "practical", "fun", "whimsical", "silly", "serious" etc) How does that compare to the adjectives you used to describe the site visually?</p> <p class="answer">"simple, clear, unambiguous, instructional, and concise" -- These adjectives match the visual adjectives quite closely.</p> <p class="question">How easy is it to find what you are looking for from the homepage? How about from another page?</p> <p class="answer">It is very easy; everything has been laid out quite simply in plain view.</p> <p class="question">How easy is it to browse through all the content of the site?</p> <p class="answer">It is easy to browse through the content.</p> <p class="question">How do you feel after being on the site for a while? (i.e. "bored", "happy", "anxious or hyper", "like I wasted a lot of time" etc)</p> <p class="answer">I would be excited to get crackin'!</p> <p class="question">Does the site sell anything? If so, have you purchased any of it? Why or why not?</p> <p class="answer">The site sells the opportunity to learn, but for FREE! I've taken part in several tracks on Codecademy.</p> </div> <div class="post"> <a href="http://www.apple.com/" target="_blank"><img src="images/apple.jpg" alt="apple" class="logo"></a> <p class="website_name">Apple</p> <p class="question">Why is this one of your favorite sites?</p> <p class="answer">This is not my favorite website, but it's a website that I admire for it's ability to maintain the attention of its customers.</p> <p class="question">What area of the site is your eye drawn to when looking at the homepage? Stand back further, what area is your eye drawn to now? Is that area the most important area of the site?</p> <p class="answer">The graphics are what draws my attention, and then the text that overlays the graphics.</p> <p class="question">How would you describe the website visually? List 5 adjectives. (i.e. "pretty", "elegant", "simple", "dark", "cluttered", "basic" etc)</p> <p class="answer">penetrating, stunning, saturated, colorful, vibrant</p> <p class="question">What problem does this website solve? What content does it have?</p> <p class="answer">This website promises an experience through its graphics and powerful text. The graphics coupled with the caption allows for multiple, positive interpretations.</p> <p class="question">What 5 adjectives would you use to describe the content, focus, and purpose of the site? (i.e. "practical", "fun", "whimsical", "silly", "serious" etc) How does that compare to the adjectives you used to describe the site visually?</p> <p class="answer">"fun, powerful, smart, clean, and simple" -- These adjectives are very much in line with the visual description I came up with.</p> <p class="question">How easy is it to find what you are looking for from the homepage? How about from another page?</p> <p class="answer">The menu bar makes it quite easy to pick out how to navigate through the website.</p> <p class="question">How easy is it to browse through all the content of the site?</p> <p class="answer">It is easy to browse through the content.</p> <p class="question">How do you feel after being on the site for a while? (i.e. "bored", "happy", "anxious or hyper", "like I wasted a lot of time" etc)</p> <p class="answer">I would be excited to start looking at specs in hopes of buying my next Apple product!</p> <p class="question">Does the site sell anything? If so, have you purchased any of it? Why or why not?</p> <p class="answer">I've bought my first Mac Air from this website in hopes that it would put me on the right path to becoming a web developer.</p> </div> <div class="post"> <a href="http://mangastream.com/" target="_blank"><img src="images/mangastream.png" alt="mangastream" class="logo"></a> <p class="website_name">Manga Stream</p> <p class="question">Why is this one of your favorite sites?</p> <p class="answer">I read manga on occasion, and this is my favorite website to go to for scanned translations.</p> <p class="question">What area of the site is your eye drawn to when looking at the homepage? Stand back further, what area is your eye drawn to now? Is that area the most important area of the site?</p> <p class="answer">What draws my attention is the neatly organized list of chapter posts. Standing further away gives focus to the three graphic panels that display the three latest chapter posts.</p> <p class="question">How would you describe the website visually? List 5 adjectives. (i.e. "pretty", "elegant", "simple", "dark", "cluttered", "basic" etc)</p> <p class="answer">subdued, comfortable, easy, basic, lists</p> <p class="question">What problem does this website solve? What content does it have?</p> <p class="answer">This website attempts to solve the conflict between blog posts and chapter posts. I'm not sure if this has been effectively solved.</p> <p class="question">What 5 adjectives would you use to describe the content, focus, and purpose of the site? (i.e. "practical", "fun", "whimsical", "silly", "serious" etc) How does that compare to the adjectives you used to describe the site visually?</p> <p class="answer">"plain, simple, detailed, separated, and compact"</p> <p class="question">How easy is it to find what you are looking for from the homepage? How about from another page?</p> <p class="answer">If it's difficult to parse the content at first glance, the menu bar comes in handy.</p> <p class="question">How easy is it to browse through all the content of the site?</p> <p class="answer">It is easy to browse through the content.</p> <p class="question">How do you feel after being on the site for a while? (i.e. "bored", "happy", "anxious or hyper", "like I wasted a lot of time" etc)</p> <p class="answer">Reading manga usually makes me feel like I've wasted a great deal of time.</p> <p class="question">Does the site sell anything? If so, have you purchased any of it? Why or why not?</p> <p class="answer">The site doesn't sell anything.</p> </div> </div> <div id="secondary"> <p>Useful Links</p> <a href="wireframe_sites.html">Wireframe Post</a> </div> <div id="clearFix">.</div> </div> <footer> Copyright 2014 - Brian H. Paak </footer> </div> </body> </html>
{'content_hash': '8b2882ccda0cea62709bf8e7d58ce2e2', 'timestamp': '', 'source': 'github', 'line_count': 98, 'max_line_length': 261, 'avg_line_length': 84.88775510204081, 'alnum_prop': 0.6833754056978002, 'repo_name': 'bhpaak/bhpaak.github.io', 'id': '9a10e0bc007029a281c2241949eb8eadbecd65ae', 'size': '8319', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'unit1_projects/analysis_blog.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '5475'}]}
module DeepCover class Node::Const < Node check_completion has_child scope: [Node, nil] has_child const_name: Symbol end class Node::Cbase < Node end end
{'content_hash': 'cbd22c85ad356fa0db7b06840b24b50a', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 32, 'avg_line_length': 17.5, 'alnum_prop': 0.6742857142857143, 'repo_name': 'deep-cover/deep-cover', 'id': '5a6b78b80de6fb471ba9b393b47c6f5249b98b2a', 'size': '206', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'core_gem/lib/deep_cover/node/const.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '47229'}, {'name': 'HTML', 'bytes': '13770'}, {'name': 'JavaScript', 'bytes': '339680'}, {'name': 'Ruby', 'bytes': '645848'}, {'name': 'Shell', 'bytes': '1152'}]}
<?php /** * DO NOT EDIT! * This file was automatically generated via bin/generate-validator-spec.php. */ namespace AmpProject\Validator\Spec\Tag; use AmpProject\Format; use AmpProject\Html\Attribute; use AmpProject\Validator\Spec\AttributeList; use AmpProject\Validator\Spec\Identifiable; use AmpProject\Validator\Spec\SpecRule; use AmpProject\Validator\Spec\Tag; /** * Tag class AmpLiveListItemsItem. * * @package ampproject/amp-toolbox. * * @property-read string $tagName * @property-read string $specName * @property-read array $attrs * @property-read array<string> $attrLists * @property-read string $specUrl * @property-read array<string> $htmlFormat * @property-read string $descriptiveName */ final class AmpLiveListItemsItem extends Tag implements Identifiable { /** * ID of the tag. * * @var string */ const ID = 'AMP-LIVE-LIST [items] item'; /** * Array of spec rules. * * @var array */ const SPEC = [ SpecRule::TAG_NAME => '$REFERENCE_POINT', SpecRule::SPEC_NAME => 'AMP-LIVE-LIST [items] item', SpecRule::ATTRS => [ Attribute::DATA_SORT_TIME => [ SpecRule::MANDATORY => true, ], Attribute::DATA_TOMBSTONE => [], Attribute::DATA_UPDATE_TIME => [], ], SpecRule::ATTR_LISTS => [ AttributeList\MandatoryIdAttr::ID, ], SpecRule::SPEC_URL => 'https://amp.dev/documentation/components/amp-live-list/#items', SpecRule::HTML_FORMAT => [ Format::AMP, ], SpecRule::DESCRIPTIVE_NAME => 'amp-live-list [data-sort-time] child', ]; }
{'content_hash': '7249a3b7f875db7e8dd4b59af86f41b0', 'timestamp': '', 'source': 'github', 'line_count': 63, 'max_line_length': 94, 'avg_line_length': 26.650793650793652, 'alnum_prop': 0.6206075044669446, 'repo_name': 'ampproject/amp-toolbox-php', 'id': 'c8e92f41e3a3ff9a153c47e19cc4bce49df5ca9b', 'size': '1679', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'src/Validator/Spec/Tag/AmpLiveListItemsItem.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'PHP', 'bytes': '1530243'}, {'name': 'Shell', 'bytes': '653'}]}
<?php namespace tunect\Yii2PageHelp; use yii\base\BootstrapInterface; class Bootstrap implements BootstrapInterface { /** * @inheritdoc */ public function bootstrap($app) { $name = Module::$moduleName; if (!$app->hasModule($name)) { $app->setModule($name, new Module($name)); } if ($app instanceof \yii\web\Application) { $rules[] = [ 'class' => 'yii\web\GroupUrlRule', 'prefix' => $name, 'rules' => [ '/' => 'default/index', '<action:[\w-]+>' => 'default/<action>', ], ]; $app->getUrlManager()->addRules($rules, false); } elseif ($app instanceof \yii\console\Application) { $app->controllerMap = array_merge($app->controllerMap, [ 'migrate' => [ 'migrationNamespaces' => [ 'tunect\Yii2PageHelp\migrations', ], ], ]); if (empty($app->controllerMap['migrate']['class'])) { $app->controllerMap['migrate']['class'] = 'yii\console\controllers\MigrateController'; } } } }
{'content_hash': '064800a60b0dc8e262c15abe63900ef6', 'timestamp': '', 'source': 'github', 'line_count': 42, 'max_line_length': 90, 'avg_line_length': 26.571428571428573, 'alnum_prop': 0.5206093189964157, 'repo_name': 'dvatri/yii2-page-help', 'id': 'c769b6de1151a9a161654a800c5ee11abdaade64', 'size': '1116', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Bootstrap.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'PHP', 'bytes': '14094'}]}
#pragma once #include <uc/types.h> static inline bool plus_overflow_u64(uint64_t x, uint64_t y) { return ((((uint64_t)(~0)) - x) < y); } static inline bool plus_overflow_u32(uint32_t x, uint32_t y) { return ((((uint32_t)(~0)) - x) < y); } /* * This checks to see if two numbers multiplied together are larger * than the type that they are. Returns TRUE if OVERFLOWING. * If the first parameter "x" is greater than zero and * if that is true, that the largest possible value 0xFFFFFFFF / "x" * is less than the second parameter "y". If "y" is zero then * it will also fail because no unsigned number is less than zero. */ static inline bool multiply_overflow_u32(uint32_t x, uint32_t y) { return (x > 0) ? ((((uint32_t)(~0))/x) < y) : false; } #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) #define AP_WAKE_TRIGGER_DEF 0xffffffff
{'content_hash': 'e4712aa9fca7f3af949b65d0c1509661', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 70, 'avg_line_length': 28.193548387096776, 'alnum_prop': 0.6533180778032036, 'repo_name': 'AMOSSYS/OpenDTeX-Secure-Boot-DRTM', 'id': '8b939c39d43ec2b697182ec982051d4beb4fca5d', 'size': '874', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'libtxt/src/include/stuff.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Assembly', 'bytes': '20578'}, {'name': 'C', 'bytes': '1003462'}, {'name': 'C++', 'bytes': '98079'}, {'name': 'Logos', 'bytes': '721'}, {'name': 'Objective-C', 'bytes': '4708'}, {'name': 'Shell', 'bytes': '853'}]}
Este repositorio contiene una plantilla LaTeX para el Trabajo de Fin de Grado de la Escuela Técnica de Ingeniería Informática (ETSInf) de la Universidad Politécnica de Valencia (UPV). Está basada en la plantilla para Microsoft Word [disponible en la web de la ETSInf](http://www.upv.es/entidades/ETSINF/info/plantillaTFG.doc). # English This repository contains a LaTeX template for degree's final project of ETSInf (UPV). It's based on the Microsoft Word template [available on ETSInf's website](http://www.upv.es/entidades/ETSINF/info/plantillaTFG.doc).
{'content_hash': '607e97347baebc686a5256b6887c2aac', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 183, 'avg_line_length': 56.0, 'alnum_prop': 0.7946428571428571, 'repo_name': 'Sumolari/TemplateTFG', 'id': '939322df11044ed99899014cb8a098f2a2b13d35', 'size': '577', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Readme.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'TeX', 'bytes': '20797'}]}
package org.apache.jena.test; import junit.framework.TestCase ; import junit.framework.TestSuite ; import org.apache.jena.rdf.model.impl.RDFReaderFImpl; /** * All developers should edit this file to add their tests. * Please try to name your tests and test suites appropriately. * Note, it is better to name your test suites on creation * rather than in this file. */ public class TestPackage extends TestCase { static public TestSuite suite() { // Reads Turtle (old parser, not up-to-date but we need something for testing.) RDFReaderFImpl.alternative(new X_RDFReaderF()); TestSuite ts = new TestSuite() ; ts.setName("Jena") ; addTest(ts, "System setup", TestSystemSetup.suite()); addTest(ts, "IRI", org.apache.jena.irix.TS_IRIx.suite()); addTest(ts, "Enhanced", org.apache.jena.enhanced.test.TestPackage.suite()); addTest(ts, "Datatypes", org.apache.jena.datatypes.TestPackage.suite()) ; addTest(ts, "Graph", org.apache.jena.graph.test.TestPackage.suite()); addTest(ts, "Mem", org.apache.jena.mem.test.TestMemPackage.suite() ); addTest(ts, "Mem2", org.apache.jena.mem.test.TestGraphMemPackage.suite() ); addTest(ts, "Model", org.apache.jena.rdf.model.test.TestPackage.suite()); addTest(ts, "StandardModels", org.apache.jena.rdf.model.test.TestStandardModels.suite() ); addTest(ts, "Turtle", org.apache.jena.ttl_test.turtle.TurtleTestSuite.suite()) ; addTest(ts, "XML Output", org.apache.jena.rdfxml.xmloutput.TestPackage_xmloutput.suite()); addTest(ts, "Util", org.apache.jena.util.TestPackage.suite()); addTest(ts, "Jena iterator", org.apache.jena.util.iterator.test.TestPackage.suite() ); addTest(ts, "Assembler", org.apache.jena.assembler.test.TestAssemblerPackage.suite() ); addTest(ts, "ARP", org.apache.jena.rdfxml.xmlinput.TestPackage_xmlinput.suite()); addTest(ts, "Vocabularies", org.apache.jena.vocabulary.test.TestVocabularies.suite() ); addTest(ts, "Shared", org.apache.jena.shared.TestSharedPackage.suite() ); addTest(ts, "Reasoners", org.apache.jena.reasoner.test.TestPackage.suite()); addTest(ts, "Composed graphs", org.apache.jena.graph.compose.test.TestPackage.suite() ); addTest(ts, "Ontology", org.apache.jena.ontology.impl.TestPackage.suite() ); return ts ; } private static void addTest(TestSuite ts, String name, TestSuite tc) { if ( name != null ) tc.setName(name); ts.addTest(tc); } }
{'content_hash': '2c98a67fbcc7857071faa6d496646640', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 99, 'avg_line_length': 47.96296296296296, 'alnum_prop': 0.6745173745173745, 'repo_name': 'apache/jena', 'id': '39d218c0715388936529219d4ecc4098fad98b46', 'size': '3395', 'binary': False, 'copies': '2', 'ref': 'refs/heads/main', 'path': 'jena-core/src/test/java/org/apache/jena/test/TestPackage.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '22246'}, {'name': 'C++', 'bytes': '5877'}, {'name': 'CSS', 'bytes': '3241'}, {'name': 'Dockerfile', 'bytes': '3341'}, {'name': 'Elixir', 'bytes': '2548'}, {'name': 'HTML', 'bytes': '69029'}, {'name': 'Haml', 'bytes': '30030'}, {'name': 'Java', 'bytes': '35185092'}, {'name': 'JavaScript', 'bytes': '72788'}, {'name': 'Lex', 'bytes': '82672'}, {'name': 'Makefile', 'bytes': '198'}, {'name': 'Perl', 'bytes': '35662'}, {'name': 'Python', 'bytes': '416'}, {'name': 'Ruby', 'bytes': '216471'}, {'name': 'SCSS', 'bytes': '4242'}, {'name': 'Shell', 'bytes': '264124'}, {'name': 'Thrift', 'bytes': '3755'}, {'name': 'Vue', 'bytes': '104702'}, {'name': 'XSLT', 'bytes': '65126'}]}
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace ClipboardText { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
{'content_hash': '5bd49dec0fbb9364d9ffccb78717b974', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 56, 'avg_line_length': 19.727272727272727, 'alnum_prop': 0.7235023041474654, 'repo_name': 'kobake/ClipboardText', 'id': '0c15a999f607b57eac8d1ec7f854fe6bc4428450', 'size': '436', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Program.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '2475'}]}
create index PID_PATHTION_INTERACTIO on PID_PATHWAY_INTERACTION(INTERACTION_ID) PARALLEL NOLOGGING tablespace CABIO_FUT; create index PID_PATHTION_PATHWAY_ID on PID_PATHWAY_INTERACTION(PATHWAY_ID) PARALLEL NOLOGGING tablespace CABIO_FUT; --EXIT;
{'content_hash': '9aa38791226eabc138d885d62bd57791', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 120, 'avg_line_length': 42.5, 'alnum_prop': 0.803921568627451, 'repo_name': 'NCIP/cabio', 'id': '67201ac24db10a27e7d9abaf19b337525d059f6f', 'size': '407', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'software/cabio-database/scripts/sql_loader/no_longer_used/indexes/pid_pathway_interaction.cols.sql', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C++', 'bytes': '58'}, {'name': 'CSS', 'bytes': '790679'}, {'name': 'HTML', 'bytes': '227415'}, {'name': 'Java', 'bytes': '1695785'}, {'name': 'JavaScript', 'bytes': '5101781'}, {'name': 'PHP', 'bytes': '14325'}, {'name': 'PLSQL', 'bytes': '319454'}, {'name': 'Perl', 'bytes': '201567'}, {'name': 'SQLPL', 'bytes': '17416'}, {'name': 'Shell', 'bytes': '106383'}, {'name': 'SourcePawn', 'bytes': '3477'}, {'name': 'XSLT', 'bytes': '19561'}]}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/titleTextView" android:layout_width="150dip" android:layout_height="60dip" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:text="Item" android:textAppearance="?android:attr/textAppearanceLarge" android:textSize="48dp" /> <TextView android:id="@+id/occursText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/titleTextView" android:text="Occured on: " android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/expenseDateView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/occursText" android:layout_alignParentRight="true" android:layout_alignTop="@+id/occursText" android:layout_toRightOf="@+id/occursText" android:text="Date" android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/catView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/categoryText" android:layout_alignBottom="@+id/categoryText" android:layout_alignParentRight="true" android:layout_toRightOf="@+id/occursText" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/descView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/editExpButton" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:layout_below="@+id/describeText" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/dollarSign" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/amount" android:layout_alignBottom="@+id/amount" android:layout_alignParentLeft="true" android:layout_toLeftOf="@+id/amount" android:text="$" android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/CurrencyTExt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/amount" android:layout_alignBottom="@+id/amount" android:layout_alignParentRight="true" android:layout_toRightOf="@+id/amount" android:text="Currency" android:textAppearance="?android:attr/textAppearanceLarge" /> <Button android:id="@+id/backButton2" android:layout_width="wrap_content" android:layout_height="100dip" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:onClick="returnAction" android:text="Expense Items" /> <Button android:id="@+id/editExpButton" android:layout_width="wrap_content" android:layout_height="100dip" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_toRightOf="@+id/backButton2" android:onClick="editExpenseClaimAction" android:text="Edit" /> <TextView android:id="@+id/describeText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:text="Description:" android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/amount" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/describeText" android:layout_alignRight="@+id/categoryText" android:layout_marginBottom="24dp" android:text="Amount" android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/categoryText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/dollarSign" android:layout_alignParentLeft="true" android:layout_marginBottom="26dp" android:text="Category:" android:textAppearance="?android:attr/textAppearanceLarge" /> </RelativeLayout>
{'content_hash': 'd667573fe365d0bc0e6079e76e4ddd4c', 'timestamp': '', 'source': 'github', 'line_count': 128, 'max_line_length': 74, 'avg_line_length': 38.2109375, 'alnum_prop': 0.6595788182375792, 'repo_name': 'bkhunter/bkhunter-notes', 'id': 'e502707defaba77da2109c74b5c78172e9805dc1', 'size': '4891', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'res/layout/view_expense_item_activity.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '70590'}]}
@class NSString; @interface UIKeyboardCandidateSingle : UIKeyboardCandidate { NSString* _candidate; } -(id)initWithCandidate:(id)candidate; // inherited: -(void)dealloc; // inherited: -(id)candidate; // inherited: -(id)copyWithZone:(NSZone*)zone; @end #endif
{'content_hash': 'f0c5ca7823d052d699be2c0b83cbf283', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 60, 'avg_line_length': 21.833333333333332, 'alnum_prop': 0.7404580152671756, 'repo_name': 'codyd51/libPassword', 'id': '11f24b118a2b7ec37f6b07fca982f79d10d2f76a', 'size': '374', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'libPassPrefs/include/UIKit/UIKeyboardCandidateSingle.h', 'mode': '33188', 'license': 'mit', 'language': []}
from typing import List, Optional import os.path from pathlib import Path from collections import ChainMap import json from click import BadParameter from requests import Session from doit.action import CmdAction from doit.tools import create_folder, config_changed from elm_doc import elm_project from elm_doc import elm_codeshift from elm_doc import elm_parser from elm_doc.elm_project import ElmPackage, ElmProject, ProjectConfig, ModuleName from elm_doc.run_config import RunConfig, Validate from elm_doc.tasks import package as package_tasks from elm_doc.utils import Namespace class actions(Namespace): def write_project_elm_json( project: ElmProject, project_config: ProjectConfig, project_modules: List[ModuleName], build_path: Path): elm_project_with_exposed_modules = dict(ChainMap( {'exposed-modules': [module for module in project_modules]}, project.as_package(project_config).as_json(), )) elm_json_path = build_path / ElmPackage.DESCRIPTION_FILENAME with open(str(elm_json_path), 'w') as f: json.dump(elm_project_with_exposed_modules, f) def run_elm_codeshift(src_dir: Path): for elm_file_path in src_dir.glob('**/*.elm'): if elm_parser.is_port_module(elm_file_path): elm_codeshift.strip_ports_from_file(elm_file_path) def validate_elm_path(elm_path: Optional[Path]): if not elm_path: raise BadParameter('please specify the elm executable to use with --elm-path') class ElmMake(CmdAction): def __init__(self, elm_path: Path, build_path: Path, output_path: Path): command = [str(elm_path), 'make', '--docs', str(output_path), '--output', '/dev/null'] super().__init__(command, cwd=str(build_path), shell=False) class SyncSources(CmdAction): '''Copy source files to a single directory. This meets the requirement of Elm that a package project can only have a single source directory and gives us an isolated environment so that Elm can run in parallel with any invocation of Elm within the actual project. ''' def __init__(self, project: ElmProject, target_directory: Path): sources = ['{}/./'.format(os.path.normpath(source_dir)) for source_dir in project.source_directories] command = ['rsync', '-a', '--delete', '--recursive', '--ignore-errors'] + sources + [str(target_directory)] super().__init__(command, cwd=str(project.path), shell=False) def create_main_project_tasks( session: Session, project: ElmProject, project_config: ProjectConfig, run_config: RunConfig): task_name = '{}/{}'.format(project_config.fake_user, project_config.fake_project) project_modules = list(elm_project.glob_project_modules( project, project_config)) project_as_package = project.as_package(project_config) file_dep = [run_config.elm_path] if run_config.elm_path else [] file_dep.extend([module.path for module in project_modules]) uptodate_config = {'elm_json': project_as_package.as_json()} build_src_dir = run_config.build_path / 'src' docs_actions = [ (create_folder, (str(run_config.build_path),)), (actions.write_project_elm_json, ( project, project_config, [module.name for module in project_modules], run_config.build_path, )), (create_folder, (str(build_src_dir),)), actions.SyncSources(project, build_src_dir), (actions.run_elm_codeshift, (build_src_dir,)), (actions.validate_elm_path, (run_config.elm_path,)), ] if isinstance(run_config, Validate): # don't update the final artifact; write to build dir instead docs_path = run_config.build_path / project.DOCS_FILENAME docs_actions.append(actions.ElmMake(run_config.elm_path, run_config.build_path, docs_path)) yield { 'basename': 'validate_docs_json', 'name': task_name, 'actions': docs_actions, 'targets': [], 'file_dep': file_dep, 'uptodate': [config_changed(uptodate_config)], } return # project docs.json project_output_path = package_tasks.package_docs_root( run_config.output_path, project_as_package) docs_actions.insert(0, (create_folder, (str(project_output_path),))) docs_path = project_output_path / project.DOCS_FILENAME docs_actions.append(actions.ElmMake(run_config.elm_path, run_config.build_path, docs_path)) yield { 'basename': 'build_docs_json', 'name': task_name, 'actions': docs_actions, 'targets': [docs_path], 'file_dep': file_dep, 'uptodate': [config_changed(uptodate_config)], } yield from package_tasks.create_package_page_tasks( package_tasks.Context.Project, session, project_as_package, [module.name for module in project_modules], run_config)
{'content_hash': '4a85bf4941be040c258baa7ba3ca9e22', 'timestamp': '', 'source': 'github', 'line_count': 126, 'max_line_length': 119, 'avg_line_length': 40.56349206349206, 'alnum_prop': 0.6388182351790256, 'repo_name': 'ento/elm-doc', 'id': 'ffe0d0003529c06405aec67bc31966fa695228f3', 'size': '5111', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/elm_doc/tasks/project.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Elm', 'bytes': '280'}, {'name': 'Nix', 'bytes': '3275'}, {'name': 'Python', 'bytes': '116334'}, {'name': 'Shell', 'bytes': '778'}]}
package org.cyclops.integrateddynamics.api.evaluate.variable; /** * A value type that can be null. * @author rubensworks */ public interface IValueTypeNullable<V extends IValue> extends IValueType<V> { public boolean isNull(V a); }
{'content_hash': '883375b764d897e795f8c0ea63279318', 'timestamp': '', 'source': 'github', 'line_count': 11, 'max_line_length': 77, 'avg_line_length': 22.0, 'alnum_prop': 0.743801652892562, 'repo_name': 'CyclopsMC/IntegratedDynamics', 'id': 'b9a6231daf64e25814bb93382da5ade26c6e2650', 'size': '242', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master-1.19', 'path': 'src/main/java/org/cyclops/integrateddynamics/api/evaluate/variable/IValueTypeNullable.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '3437058'}]}
The purpose of this guide is to provide the reader with step by step instructions on how to deploy Kubernetes on vSphere infrastructure. The instructions use `kubeadm`, a tool built to provide best-practice “fast paths” for creating Kubernetes clusters. The reader will also learn how to deploy the Container Storage Interface and Cloud Provider Interface plugins for vSphere specific operations. At the end of this tutorial you will have a fully running K8s on vSphere environment that allows for dynamic provisioning of volumes. ## Prerequisites This section will cover the prerequisites that need to be in place before attempting the deployment. ### vSphere requirements vSphere 6.7U3 (or later) is a prerequisite for using CSI and CPI at the time of writing. This may change going forward, and the documentation will be updated to reflect any changes in this support statement. If you are on a vSphere version that is below 6.7 U3, you can either upgrade vSphere to 6.7U3 or follow one of the tutorials for earlier vSphere versions. Here is the tutorial on deploying Kubernetes with kubeadm, using the VCP - [Deploying Kubernetes using kubeadm with the vSphere Cloud Provider (in-tree)](./k8s-vcp-on-vsphere-with-kubeadm.md). ### Firewall requirements Providing the K8s master node(s) access to the vCenter management interface will be sufficient, given the CPI and CSI pods are deployed on the master node(s). Should these components be deployed on worker nodes or otherwise - those nodes will also need access to the vCenter management interface. If you want to use topology-aware volume provisioning and the late binding feature using `zone`/`region`, the node need to discover its topology by connecting to the vCenter, for this every node should be able to communicate to the vCenter. You can disable this optional feature if you want to open only the master node to the vCenter management interface. ### Recommended Guest Operating System VMware recommends that you create a virtual machine template using Guest OS Ubuntu 18.04.1 LTS (Bionic Beaver) 64-bit PC (AMD64) Server. Check it out on [VMware PartnerWeb](http://partnerweb.vmware.com/GOSIG/Ubuntu_18_04_LTS.html). This template is cloned to act as base images for your Kubernetes cluster. For instructions on how to do this, please refer to the guidance provided in [this blog post by Myles Gray of VMware](https://blah.cloud/kubernetes/creating-an-ubuntu-18-04-lts-cloud-image-for-cloning-on-vmware/). Ensure that SSH access is enabled on all nodes. This must be done in order to run commands on both the Kubernetes master and worker nodes in this guide. ### Virtual Machine Hardware requirements Virtual Machine Hardware must be version 15 or higher. For Virtual Machine CPU and Memory requirements, size adequately based on workload requirements. VMware also recommend that virtual machines use the VMware Paravirtual SCSI controller for Primary Disk on the Node VM. This should be the default, but it is always good practice to check. Finally, the disk.EnableUUID parameter must be set for each node VMs. This step is necessary so that the VMDK always presents a consistent UUID to the VM, thus allowing the disk to be mounted properly. It is recommended to not take snapshots of CNS node VMs to avoid errors and unpredictable behavior. ### Docker Images The following is the list of docker images that are required for the installation of CSI and CPI on Kubernetes. These images are automatically pulled in when CSI and CPI manifests are deployed. VMware distributes and recommends the following images: ```bash gcr.io/cloud-provider-vsphere/csi/release/driver:v1.0.1 gcr.io/cloud-provider-vsphere/csi/release/syncer:v1.0.1 http://gcr.io/cloud-provider-vsphere/cpi/release/manager:v1.0.0 ``` In addition, you can use the following images or any of the open source or commercially available container images appropriate for the CSI deployment. Note that the tags reference the version of various components. This will change with future versions: ```bash quay.io/k8scsi/csi-provisioner:v1.2.2 quay.io/k8scsi/csi-attacher:v1.1.1 quay.io/k8scsi/csi-node-driver-registrar:v1.1.0 quay.io/k8scsi/livenessprobe:v1.1.0 k8s.gcr.io/kube-apiserver:v1.14.2 k8s.gcr.io/kube-controller-manager:v1.14.2 k8s.gcr.io/kube-scheduler:v1.14.2 k8s.gcr.io/kube-proxy:v1.14.2 k8s.gcr.io/pause:3.1 k8s.gcr.io/etcd:3.3.10 k8s.gcr.io/coredns:1.3.1 ``` ### Tools If you plan to deploy Kubernetes on vSphere from a MacOS environment, the `brew` package manager may be used to install and manage the necessary tools. If using Linux or Windows environment to initiate the deployment, links to the tools are included. Follow the tool specific instructions for installing the tools on the different operating systems. For each tool, the brew install command for MacOS is shown here. * `brew` - <https://brew.sh> * `govc` - brew tap govmomi/tap/govc && brew install govmomi/tap/govc * `kubectl` - brew install kubernetes-cli * `tmux` (optional) - brew install tmux Here are the links to the tools and install instructions for other operating systems: * [govc for other Operating Systems](https://github.com/vmware/govmomi/tree/master/govc) - version 0.20.0 or higher recommended * [kubectl for other Operating Systems](https://kubernetes.io/docs/tasks/tools/install-kubectl/) * [tmux for other Operating Systems](https://github.com/tmux/tmux) ## Setting up VMs and Guest OS The next step is to install the necessary Kubernetes components on the Ubuntu OS virtual machines. Some components must be installed on all of the nodes. In other cases, some of the components need only be installed on the master, and in other cases, only the workers. In each case, where the components are installed is highlighted. All installation and configuration commands should be executed with root privilege. You can switch to the root environment using the "sudo su" command. Setup steps required on all nodes The following section details the steps that are needed on both the master and worker nodes. ### Install VMTools (if necessary) For more information about VMTools including installation, please visit the [official documentation](https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.html.hostclient.doc/GUID-28C39A00-743B-4222-B697-6632E94A8E72.html). ### disk.EnableUUID=1 The following govc commands will set the disk.EnableUUID=1 on all nodes. ```bash # export GOVC_INSECURE=1 # export GOVC_URL='https://<VC_IP>' # export GOVC_USERNAME=VC_Admin_User # export GOVC_PASSWORD=VC_Admin_Passwd # govc ls /datacenter/vm /datacenter/network /datacenter/host /datacenter/datastore ``` To retrieve all Node VMs, use the following command: ```bash # govc ls /<datacenter-name>/vm /datacenter/vm/k8s-node3 /datacenter/vm/k8s-node4 /datacenter/vm/k8s-node1 /datacenter/vm/k8s-node2 /datacenter/vm/k8s-master ``` To use govc to enable Disk UUID, use the following command: ```bash # govc vm.change -vm '/datacenter/vm/k8s-node1' -e="disk.enableUUID=1" # govc vm.change -vm '/datacenter/vm/k8s-node2' -e="disk.enableUUID=1" # govc vm.change -vm '/datacenter/vm/k8s-node3' -e="disk.enableUUID=1" # govc vm.change -vm '/datacenter/vm/k8s-node4' -e="disk.enableUUID=1" # govc vm.change -vm '/datacenter/vm/k8s-master' -e="disk.enableUUID=1" ``` Further information on disk.enableUUID can be found in [VMware Knowledgebase Article 52815](https://kb.vmware.com/s/article/52815). ### Upgrade Virtual Machine Hardware VM Hardware should be at version 15 or higher. ```bash # govc vm.upgrade -version=15 -vm '/datacenter/vm/k8s-node1' # govc vm.upgrade -version=15 -vm '/datacenter/vm/k8s-node2' # govc vm.upgrade -version=15 -vm '/datacenter/vm/k8s-node3' # govc vm.upgrade -version=15 -vm '/datacenter/vm/k8s-node4' # govc vm.upgrade -version=15 -vm '/datacenter/vm/k8s-master' ``` Check the VM Hardware version after running the above command: ```bash # govc vm.option.info '/datacenter/vm/k8s-node1' | grep HwVersion HwVersion: 15 ``` ### Disable Swap SSH into all K8s worker nodes and disable swap on all nodes including master node. This is a prerequisite for kubeadm. IF you have followed the previous guidance on how to create the OS template image, this step will have already been implemented. ```bash # swapoff -a # vi /etc/fstab ... remove any swap entry from this file ... ``` ### Install Docker CE The following steps should be used to install the container runtime on all of the nodes. Docker CE 18.06 must be used. Kubernetes has explicit supported versions, so it has to be this version First, update the apt package index. ```bash # apt update ``` The next step is to install packages to allow apt to use a repository over HTTPS. ```bash # apt install ca-certificates software-properties-common \ apt-transport-https curl -y ``` Now add Docker’s official GPG key. ```bash # curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - ``` To complete the install, add the docker apt repository. ```bash # add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" ``` Now we can install Docker CE. To install a specific version, replace the version string with the desired version number. ```bash # apt update # apt install docker-ce=18.06.0~ce~3-0~ubuntu -y ``` Finally, setup the daemon parameters, like log rotation and cgroups. ```bash # tee /etc/docker/daemon.json >/dev/null <<EOF { "exec-opts": ["native.cgroupdriver=systemd"], "log-driver": "json-file", "log-opts": { "max-size": "100m" }, "storage-driver": "overlay2" } EOF ``` ```bash # mkdir -p /etc/systemd/system/docker.service.d ``` And to complete, restart docker to pickup the new parameters. ```bash # systemctl daemon-reload ``` ```bash # systemctl restart docker ``` Docker is now installed. Verify the status of docker via the following command: ```bash #systemctl status docker docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2019-09-06 12:37:27 UTC; 4min 15s ago #docker info | egrep "Server Version|Cgroup Driver" Server Version: 18.06.0-ce Cgroup Driver: systemd ``` ### Install Kubelet, Kubectl, Kubeadm The next step is to install the main Kubernetes components on each of the nodes. `kubeadm` is the command to bootstrap the cluster. It runs on the master and all worker nodes. `kubelet` is the component that runs on all nodes in the cluster and performs such tasks as starting pods and containers. `kubectl` is the command line utility to communicate with your cluster. It runs only on the master node. For Ubuntu distributions, a specific version can be installed with specifying version of the package name, e.g. `apt install -qy kubeadm=1.14.2-00 kubelet=1.14.2-00 kubectl=1.14.2-00`. These should be the minimum versions installed. First, the Kubernetes repository needs to be added to apt. ```bash # curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - ``` ```bash # cat <<EOF >/etc/apt/sources.list.d/kubernetes.list deb https://apt.kubernetes.io/ kubernetes-xenial main EOF ``` Next, install kubelet, kubectl and kubeadm. ```bash # apt update # apt install -qy kubeadm=1.14.2-00 kubelet=1.14.2-00 kubectl=1.14.2-00 ``` Finally, hold Kubernetes packages at their installed version so as not to upgrade unexpectedly on an apt upgrade. ```bash # apt-mark hold kubelet kubeadm kubectl ``` ### Setup step for flannel (Pod Networking) We will be using flannel for pod networking in this example, so the below needs to be run on all nodes to pass bridged IPv4 traffic to iptables chains: ```bash # sysctl net.bridge.bridge-nf-call-iptables=1 ``` That completes the common setup steps across both masters and worker nodes. We will now look at the steps involved in enabling the vSphere Cloud Provider Interface (CPI) and Container Storage Interface (CSI) before we are ready to deploy our Kubernetes cluster. Pay attention to where the steps are carried out, which will be either on the master or the worker nodes. ## Installing the Kubernetes master node(s) Again, these steps are only carried out on the master. Use kubeadminit to initialize the master node. In order to initialize the master node, we need to first of all create a `kubeadminit.yaml` manifest file that needs to be passed to the `kubeadm` command. Note the reference to an external cloud provider in the `nodeRegistration` part of the manifest. ```bash # tee /etc/kubernetes/kubeadminit.yaml >/dev/null <<EOF apiVersion: kubeadm.k8s.io/v1beta1 kind: InitConfiguration bootstrapTokens: - groups: - system:bootstrappers:kubeadm:default-node-token token: y7yaev.9dvwxx6ny4ef8vlq ttl: 0s usages: - signing - authentication nodeRegistration: kubeletExtraArgs: cloud-provider: external --- apiVersion: kubeadm.k8s.io/v1beta1 kind: ClusterConfiguration useHyperKubeImage: false kubernetesVersion: v1.14.2 networking: serviceSubnet: "10.96.0.0/12" podSubnet: "10.244.0.0/16" etcd: local: imageRepository: "k8s.gcr.io" imageTag: "3.3.10" dns: type: "CoreDNS" imageRepository: "k8s.gcr.io" imageTag: "1.5.0" EOF ``` Bootstrap the Kubernetes master node using the cluster configuration file created in the step above. ```bash # kubeadm init --config /etc/kubernetes/kubeadminit.yaml [init] Using Kubernetes version: v1.14.2 . . . . [preflight] Pulling images required for setting up a Kubernetes cluster [preflight] This might take a minute or two, depending on the speed of your internet connection [preflight] You can also perform this action in beforehand using 'kubeadm config images pull' . . . . You should now deploy a pod network to the cluster. Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at: https://kubernetes.io/docs/concepts/cluster-administration/addons/ Then you can join any number of worker nodes by running the following on each as root: kubeadm join 10.192.116.47:6443 --token y7yaev.9dvwxx6ny4ef8vlq \ --discovery-token-ca-cert-hash sha256:[sha sum from above output] ``` Note that the last part of the output provides the command to join the worker nodes to the master in this Kubernetes cluster. We will return to that step shortly. Next, setup the kubeconfig file on the master so that Kubernetes CLI commands such as kubectl may be used on your newly created Kubernetes cluster. ```bash # mkdir -p $HOME/.kube ``` ```bash # cp /etc/kubernetes/admin.conf $HOME/.kube/config ``` You can also use `kubectl` on external (non-master) systems by copying the contents of the master’s `/etc/kubernetes/admin.conf` to your local computer's `~/.kube/config` file. At this stage, you may notice coredns pods remain in the pending state with `FailedScheduling` status. This is because the master node has taints that the coredns pods cannot tolerate. This is expected, as we have started `kubelet` with `cloud-provider: external`. Once the vSphere Cloud Provider Interface is installed, and the nodes are initialized, the taints will be automatically removed from node, and that will allow scheduling of the coreDNS pods. ```bash # kubectl get pods --namespace=kube-system NAME READY STATUS RESTARTS AGE coredns-fb8b8dccf-q57f9 0/1 Pending 0 87s coredns-fb8b8dccf-scgp2 0/1 Pending 0 87s etcd-k8s-master 1/1 Running 0 54s kube-apiserver-k8s-master 1/1 Running 0 39s kube-controller-manager-k8s-master 1/1 Running 0 54s kube-proxy-rljk8 1/1 Running 0 87s kube-scheduler-k8s-master 1/1 Running 0 37s ``` ```bash # kubectl describe pod coredns-fb8b8dccf-q57f9 --namespace=kube-system . . Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedScheduling 7s (x21 over 2m1s) default-scheduler 0/1 nodes are available: 1 node(s) had taints that the pod didn't tolerate. ``` ### Install flannel pod overlay networking The next step that needs to be carried out on the master node is that the flannel pod overlay network must be installed so the pods can communicate with each other. The command to install flannel on the master is as follows: ```bash # kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/62e44c867a2846fefb68bd5f178daf4da3095ccb/Documentation/kube-flannel.yml ``` Please follow [these alternative instructions to install a pod overlay network other than flannel](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#pod-network). At this point, you can check if the overlay network is deployed. ```bash # kubectl get pods --namespace=kube-system NAME READY STATUS RESTARTS AGE coredns-6557d7f7d6-9s7sm 0/1 Pending 0 107s coredns-6557d7f7d6-wgxtq 0/1 Pending 0 107s etcd-k8s-mstr 1/1 Running 0 70s kube-apiserver-k8s-mstr 1/1 Running 0 54s kube-controller-manager-k8s-mstr 1/1 Running 0 53s kube-flannel-ds-amd64-pm9m9 1/1 Running 0 11s kube-proxy-8dfm9 1/1 Running 0 107s kube-scheduler-k8s-mstr 1/1 Running 0 49s ``` ### Export the master node configuration Finally, the master node configuration needs to be exported as it is used by the worker nodes wishing to join to the master. ```bash # kubectl -n kube-public get configmap cluster-info -o jsonpath='{.data.kubeconfig}' > discovery.yaml ``` The `discovery.yaml` file will need to be copied to `/etc/kubernetes/discovery.yaml` on each of the worker nodes. ## Installing the Kubernetes worker node(s) Perform this task on the worker nodes. Verify that you have installed Docker CE, kubeadm, etc, on the worker nodes before attempting to add them to the master. To have the worker node(s) join to the master, a worker node kubeadm config yaml file must be created. Notice it is using `/etc/kubernetes/discovery.yaml` as the input for master discovery. We will show how to copy the file from the workers to the master in the next step. Also, notice that the token used in the worker node config is the same as we put in the master `kubeadminitmaster.yaml` configuration above. Finally, we once more specify that the cloud-provider is external for the workers, as we are going to use the new CPI. ```bash # tee /etc/kubernetes/kubeadminitworker.yaml >/dev/null <<EOF apiVersion: kubeadm.k8s.io/v1beta1 caCertPath: /etc/kubernetes/pki/ca.crt discovery: file: kubeConfigPath: /etc/kubernetes/discovery.yaml timeout: 5m0s tlsBootstrapToken: y7yaev.9dvwxx6ny4ef8vlq kind: JoinConfiguration nodeRegistration: criSocket: /var/run/dockershim.sock kubeletExtraArgs: cloud-provider: external EOF ``` You can copy the `discovery.yaml` to your local machine with `scp`. First, as superuser, use `scp` to copy `/etc/kubernetes/discovery.yaml` on the master to `/home/ubuntu/discovery.yaml` on all the nodes. You will now need to login to each of the nodes and copy the `discovery.yaml` file from `/home/ubuntu` to `/etc/kubernetes`. The `discovery.yaml` file must exist in `/etc/kubernetes` on the nodes. Once that step is completed, run the following command on each worker node to have it join the master (and other worker nodes that are already joined) in the cluster: ```bash # kubeadm join --config /etc/kubernetes/kubeadminitworker.yaml ``` You can check if the node has joined by running `# kubectl get nodes` on the master. ## Install the vSphere Cloud Provider Interface The following steps are only done on the master. Please note that the CSI driver requires the presence of a `ProviderID` label on each node in the K8s cluster. This can be populated by whatever means is most convenient - Ideally, the Cloud Provider Interface (CPI) would be used as it is actively maintained and updated, but if the vSphere Cloud Provider (VCP) must be used due to brownfield requirements or architectural constraints of your distribution - that is also acceptable. As long as the `ProviderID` is populated by some means - the vSphere CSI driver will work. ### Create a CPI configMap This cloud-config configmap file, passed to the CPI on initialization, contains details about the vSphere configuration. This file, which here we have called `vsphere.conf` has been populated with some sample values. Obviously, you will need to modify this file to reflect your own vSphere configuration. **NOTE:** As of CPI version 1.2.0 or higher, the preferred cloud-config format will be `YAML` based. The `INI` based format will be deprecated but supported until the transition to the preferred `YAML` based configuration has been completed. This deprecation notice will be placed in the CPI logs when using the `INI` based configuration format. ```bash # tee /etc/kubernetes/vsphere.conf >/dev/null <<EOF # Global properties in this section will be used for all specified vCenters unless overriden in VirtualCenter section. global: port: 443 # set insecureFlag to true if the vCenter uses a self-signed cert insecureFlag: true # settings for using k8s secret secretName: cpi-global-secret secretNamespace: kube-system # vcenter section vcenter: tenant-finance: server: 1.1.1.1 datacenters: - finanace tenant-hr: server: 192.168.0.1 datacenters: - hrwest - hreast tenant-engineering: server: 10.0.0.1 datacenters: - engineering secretName: cpi-engineering-secret secretNamespace: kube-system # labels for regions and zones labels: region: k8s-region zone: k8s-zone EOF ``` Here is a description of the fields used in the vsphere.conf configmap. * `insecureFlag` should be set to true to use self-signed certificate for login. * `server` section is defined to hold property of vcenter IP address or FQDN. * `secretName` holds the credential(s) for a single or list of vCenter Servers. * `secretNamespace` is set to the namespace where the secret has been created. * `port` is the vCenter Server Port. The default is 443 if not specified. * `datacenters` should be the list of datacenters where kubernetes node VMs are present. For those users deploying CPI versions 1.1.0 or earlier, the corresponding `INI` based configuration that mirrors the above configuration appears as the following: ```bash # tee /etc/kubernetes/vsphere.conf >/dev/null <<EOF [Global] port = "443" insecure-flag = "true" secret-name = "cpi-global-secret" secret-namespace = "kube-system" [VirtualCenter "1.1.1.1"] datacenters = "finance" [VirtualCenter "192.168.0.1"] datacenters = "hrwest,hreast" [VirtualCenter "10.0.0.1"] datacenters = "engineering" secret-name = "cpi-engineering-secret" secret-namespace = "kube-system" EOF ``` Create the configmap by running the following command: ```bash # cd /etc/kubernetes ``` ```bash # kubectl create configmap cloud-config --from-file=vsphere.conf --namespace=kube-system ``` Verify that the configmap has been successfully created in the kube-system namespace. ```bash # kubectl get configmap cloud-config --namespace=kube-system NAME DATA AGE cloud-config 1 82s ``` ### Create a CPI secret The CPI supports storing vCenter credentials either in: * a shared global secret containing all vCenter credentials, or * a secret dedicated for a particular vCenter configuration which takes precedence over anything that might be configured within the global secret In the example `vsphere.conf` above, there are two configured [Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets). The vCenter at `10.0.0.1` contains credentials in the secret named `cpi-engineering-secret` in the namespace `kube-system` and the vCenter at `1.1.1.1` and `192.168.0.1` contains credentials in the secret named `cpi-global-secret` in the namespace `kube-system` defined in the `global:` section. An example [Secrets YAML](https://github.com/kubernetes/cloud-provider-vsphere/raw/master/manifests/controller-manager/vccm-secret.yaml) can be used for reference when creating your own `secrets`. If the example secret YAML is used, update the secret name to use a `<unique secret name>`, the vCenter IP address in the keys of `stringData`, and the `username` and `password` for each key. The secret for the vCenter at `10.0.0.1` might look like the following: ```yaml apiVersion: v1 kind: Secret metadata: name: cpi-engineering-secret namespace: kube-system stringData: 10.0.0.1.username: "[email protected]" 10.0.0.1.password: "password" ``` This is a second Secret example, this time showing an alternative format. This alternative format allows for IPv6 server addresses. This format requires server_{id}, username_{id} and password_{id} entries, where the entries have a common suffix per server: ```yaml apiVersion: v1 kind: Secret metadata: name: cpi-engineering-secret namespace: kube-system stringData: server_prod: fd01::102 username_prod: "[email protected]" password_prod: "password" server_test: 10.0.0.2 username_test: "[email protected]" password_test: "sekret" ``` Then to create the secret, run the following command replacing the name of the YAML file with the one you have used: ```bash # kubectl create -f cpi-engineering-secret.yaml ``` Verify that the credential secret is successfully created in the kube-system namespace. ```bash # kubectl get secret cpi-engineering-secret --namespace=kube-system NAME TYPE DATA AGE cpi-engineering-secret Opaque 1 43s ``` If you have multiple vCenters as in the example vsphere.conf above, your Kubernetes Secret YAML could look like the following to storage the vCenter credentials for vCenters at `1.1.1.1` and `192.168.0.1`: ```yaml apiVersion: v1 kind: Secret metadata: name: cpi-global-secret namespace: kube-system stringData: 1.1.1.1.username: "[email protected]" 1.1.1.1.password: "password" 192.168.0.1.username: "[email protected]" 192.168.0.1.password: "password" ``` ### Zones and Regions for Pod and Volume Placement - CPI Kubernetes allows you to place Pods and Persistent Volumes on specific parts of the underlying infrastructure, e.g. different DataCenters or different vCenters, using the concept of Zones and Regions. However, to use placement controls, the required configuration steps needs to be put in place at Kubernetes deployment time, and require additional settings in the vSphere.conf of both the CPI and CSI. For more information on how to implement zones/regions support, [there is a zones/regions tutorial on how to do it here](https://cloud-provider-vsphere.sigs.k8s.io/tutorials/deploying_cpi_with_multi_dc_vc_aka_zones.html). If you are not interested in K8s object placement, this section can be ignored, and you can proceed with the remaining CPI setup steps. ### Check that all nodes are tainted Before installing vSphere Cloud Controller Manager, make sure all nodes are tainted with `node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule`. When the kubelet is started with “external” cloud provider, this taint is set on a node to mark it as unusable. After a controller from the cloud provider initializes this node, the kubelet removes this taint. ```bash # kubectl describe nodes | egrep "Taints:|Name:" Name: k8s-master Taints: node-role.kubernetes.io/master:NoSchedule Name: k8s-node1 Taints: node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule Name: k8s-node2 Taints: node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule Name: k8s-node3 Taints: node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule Name: k8s-node4 Taints: node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule ``` ### Deploy the CPI manifests There are 3 manifests that must be deployed to install the vSphere Cloud Provider Interface. The following example applies the RBAC roles and the RBAC bindings to your Kubernetes cluster. It also deploys the Cloud Controller Manager in a DaemonSet. ```bash # kubectl apply -f https://raw.githubusercontent.com/kubernetes/cloud-provider-vsphere/master/manifests/controller-manager/cloud-controller-manager-roles.yaml clusterrole.rbac.authorization.k8s.io/system:cloud-controller-manager created # kubectl apply -f https://raw.githubusercontent.com/kubernetes/cloud-provider-vsphere/master/manifests/controller-manager/cloud-controller-manager-role-bindings.yaml clusterrolebinding.rbac.authorization.k8s.io/system:cloud-controller-manager created # kubectl apply -f https://github.com/kubernetes/cloud-provider-vsphere/raw/master/manifests/controller-manager/vsphere-cloud-controller-manager-ds.yaml serviceaccount/cloud-controller-manager created daemonset.extensions/vsphere-cloud-controller-manager created service/vsphere-cloud-controller-manager created ``` ### Verify that the CPI has been successfully deployed Verify vsphere-cloud-controller-manager is running and all other system pods are up and running (note that the coredns pods were not running previously - they should be running now as the taints have been removed by installing the CPI): ```bash # kubectl get pods --namespace=kube-system NAME READY STATUS RESTARTS AGE coredns-fb8b8dccf-bq7qq 1/1 Running 0 71m coredns-fb8b8dccf-r47q2 1/1 Running 0 71m etcd-k8s-master 1/1 Running 0 69m kube-apiserver-k8s-master 1/1 Running 0 70m kube-controller-manager-k8s-master 1/1 Running 0 69m kube-flannel-ds-amd64-7kmk9 1/1 Running 0 38m kube-flannel-ds-amd64-dtvbg 1/1 Running 0 63m kube-flannel-ds-amd64-hq57c 1/1 Running 0 30m kube-flannel-ds-amd64-j7g4s 1/1 Running 0 22m kube-flannel-ds-amd64-q4zsn 1/1 Running 0 21m kube-proxy-6jcng 1/1 Running 0 30m kube-proxy-bh8kh 1/1 Running 0 21m kube-proxy-rb9xp 1/1 Running 0 22m kube-proxy-srhpj 1/1 Running 0 71m kube-proxy-vh4lg 1/1 Running 0 38m kube-scheduler-k8s-master 1/1 Running 0 70m vsphere-cloud-controller-manager-549hb 1/1 Running 0 25s ``` ### Check that all nodes are untainted Verify node.cloudprovider.kubernetes.io/uninitialized taint is removed from all nodes. ```bash # kubectl describe nodes | egrep "Taints:|Name:" Name: k8s-master Taints: node-role.kubernetes.io/master:NoSchedule Name: k8s-node1 Taints: <none> Name: k8s-node2 Taints: <none> Name: k8s-node3 Taints: <none> Name: k8s-node4 Taints: <none> ``` Note: If you happen to make an error with the `vsphere.conf`, simply delete the CPI components and the configMap, make any necessary edits to the configMap `vSphere.conf` file, and reapply the steps above. You may now remove the `vsphere.conf` file created at `/etc/kubernetes/`. ## Install vSphere Container Storage Interface Driver Now that the CPI is installed, we can focus on the CSI. Please visit <https://vsphere-csi-driver.sigs.k8s.io/driver-deployment/installation.html> to install vSphere CSI Driver. ## Sample manifests to test CSI driver functionality The following are some sample manifests that can be used to verify that some provisioning workflows using the vSphere CSI driver are working as expected. The example provided here will show how to create a stateful containerized application and use the vSphere Client to access the volumes that back your application. The following sample workflow shows how to deploy a MongoDB application with one replica. While performing the workflow tasks, you alternate the roles of a vSphere user and Kubernetes user. The tasks use the following items: * Storage class YAML file * MongoDB service YAML file * MongoDB StatefulSet YAML file ### Create a Storage Policy The virtual disk (VMDK) that will back your containerized application needs to meet specific storage requirements. As a vSphere user, you create a VM storage policy based on the requirements provided to you by the Kubernetes user. The storage policy will be associated with the VMDK backing your application. If you have multiple vCenter Server instances in your environment, create the VM storage policy on each instance. Use the same policy name across all instances. * In the vSphere Client, on the main landing page, select `VM Storage Policies`. * Under `Policies and Profiles`, select `VM Storage Policies`. * Click `Create VM Storage Policy`. * Enter the policy name and description, and click Next. For the purposes of this demonstration we will name it `Space-Efficient`. * On the Policy structure page under Datastore-specific rules, select `Enable rules for "vSAN" storage` and click Next. * On the vSAN page, we will keep the defaults for this policy, which is `standard cluster` and `RAID-1 (Mirroring)`. * On the Storage compatibility page, review the list of vSAN datastores that match this policy and click Next. * On the Review and finish page, review the policy settings, and click Finish. ![Space-Efficient Storage Policy Review](https://raw.githubusercontent.com/kubernetes/cloud-provider-vsphere/master/docs/images/space-efficient.png) You can now inform the Kubernetes user of the storage policy name. The VM storage policy you created will be used as a part of storage class definition for dynamic volume provisioning. ### Create a StorageClass As a Kubernetes user, define and deploy the storage class that references previously created VM storage policy. We will use kubectl to perform the following steps. Generally, you provide the information to kubectl in a YAML file. kubectl converts the information to JSON when making the API request. We will now create a StorageClass YAML file that describes storage requirements for the container and references the VM storage policy to be used. The `csi.vsphere.vmware.com` is the name of the vSphere CSI provisioner, and is what is placed in the provisioner field in the StorageClass yaml. The following sample YAML file includes the Space-Efficient storage policy that you created earlier using the vSphere Client. The resulting persistent volume VMDK is placed on a compatible datastore with the maximum free space that satisfies the Space-Efficient storage policy requirements. ```bash # cat mongodb-storageclass.yaml kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: mongodb-sc annotations: storageclass.kubernetes.io/is-default-class: "true" provisioner: csi.vsphere.vmware.com parameters: storagepolicyname: "Space-Efficient" fstype: ext4 ``` ```bash # kubectl create -f mongodb-storageclass.yaml storageclass.storage.k8s.io/mongodb-sc created ``` ```bash # kubectl get storageclass mongodb-sc NAME PROVISIONER AGE mongodb-sc csi.vsphere.vmware.com 5s ``` ### Create a Service As a Kubernetes user, define and deploy a Kubernetes Service. The Service provides a networking endpoint for the application. The following is a sample YAML file that defines the service for the MongoDB application. ```bash # cat mongodb-service.yaml apiVersion: v1 kind: Service metadata: name: mongodb-service labels: name: mongodb-service spec: ports: - port: 27017 targetPort: 27017 clusterIP: None selector: role: mongo ``` ```bash # kubectl create -f mongodb-service.yaml service/mongodb-service created ``` ```bash # kubectl get svc mongodb-service NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE mongodb-service ClusterIP None <none> 27017/TCP 15s ``` ### Create and Deploy a StatefulSet As a Kubernetes user, define and deploy a StatefulSet that specifies the number of replicas to be used for your application. First, create secret for the key file. MongoDB will use this key to communicate with the internal cluster. ```bash # openssl rand -base64 741 > key.txt ``` ```bash # kubectl create secret generic shared-bootstrap-data --from-file=internal-auth-mongodb-keyfile=key.txt secret/shared-bootstrap-data created ``` Next we need to define specifications for the containerized application in the StatefulSet YAML file . The following sample specification requests one instance of the MongoDB application, specifies the external image to be used, and references the mongodb-sc storage class that you created earlier. This storage class maps to the Space-Efficient VM storage policy that you defined previously on the vSphere Client side. Note that this manifest expects that the Kubernetes node can reach the image called `mongo:3.4`. If your Kubernetes nodes are not able to reach external repositories, then this YAML file needs to be modified to reach your local internal repo. Of course, this repo also needs to contain the Mongo image. We have set the number of replicas to 3, indicating that there will be 3 Pods, 3 PVCs and 3 PVs instantiated as part of this StatefulSet. ```bash # cat mongodb-statefulset.yaml apiVersion: apps/v1 kind: StatefulSet metadata: name: mongod spec: serviceName: mongodb-service replicas: 3 selector: matchLabels: role: mongo environment: test replicaset: MainRepSet template: metadata: labels: role: mongo environment: test replicaset: MainRepSet spec: containers: - name: mongod-container image: mongo:3.4 command: - "numactl" - "--interleave=all" - "mongod" - "--bind_ip" - "0.0.0.0" - "--replSet" - "MainRepSet" - "--auth" - "--clusterAuthMode" - "keyFile" - "--keyFile" - "/etc/secrets-volume/internal-auth-mongodb-keyfile" - "--setParameter" - "authenticationMechanisms=SCRAM-SHA-1" resources: requests: cpu: 0.2 memory: 200Mi ports: - containerPort: 27017 volumeMounts: - name: secrets-volume readOnly: true mountPath: /etc/secrets-volume - name: mongodb-persistent-storage-claim mountPath: /data/db volumes: - name: secrets-volume secret: secretName: shared-bootstrap-data defaultMode: 256 volumeClaimTemplates: - metadata: name: mongodb-persistent-storage-claim annotations: volume.beta.kubernetes.io/storage-class: "mongodb-sc" spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: 1Gi ``` ```bash # kubectl create -f mongodb-statefulset.yaml statefulset.apps/mongo created ``` Verify that the MongoDB application has been deployed. Wait for pods to start running and PVCs to be created for each replica. ```bash # kubectl get statefulset mongod NAME READY AGE mongod 3/3 96s ``` ```bash # kubectl get pod -l role=mongo NAME READY STATUS RESTARTS AGE mongod-0 1/1 Running 0 13h mongod-1 1/1 Running 0 13h mongod-2 1/1 Running 0 13h ``` ```bash # kubectl get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE mongodb-persistent-storage-claim-mongod-0 Bound pvc-ea98b22a-b8cf-11e9-b1d3-005056a0e4f0 1Gi RWO mongodb-sc 13h mongodb-persistent-storage-claim-mongod-1 Bound pvc-0267fa7d-b8d0-11e9-b1d3-005056a0e4f0 1Gi RWO mongodb-sc 13h mongodb-persistent-storage-claim-mongod-2 Bound pvc-24d86a37-b8d0-11e9-b1d3-005056a0e4f0 1Gi RWO mongodb-sc 13h ``` ### Set up the Mongo replica set configuration To setup the Mongo replica set configuration, we need to connect to one of the mongod container processes to configure the replica set. Run the following command to connect to the first container. In the shell, initiate the replica set. You can rely on the host names to be the same, due to having employed the StatefulSet. ```bash # kubectl exec -it mongod-0 -c mongod-container bash root@mongod-0:/# mongo MongoDB shell version v3.4.22 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.4.22 Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user > rs.initiate({_id: "MainRepSet", version: 1, members: [ ... { _id: 0, host : "mongod-0.mongodb-service.default.svc.cluster.local:27017" }, ... { _id: 1, host : "mongod-1.mongodb-service.default.svc.cluster.local:27017" }, ... { _id: 2, host : "mongod-2.mongodb-service.default.svc.cluster.local:27017" } ... ]}); { "ok" : 1 } ``` This makes mongodb-0 the primary node and other two nodes are secondary. ### Verify Cloud Native Storage functionality is working in vSphere After your application gets deployed, its state is backed by the VMDK file associated with the specified storage policy. As a vSphere administrator, you can review the VMDK that is created for your container volume. In this step, we will verify that the Cloud Native Storage feature released with vSphere 6.7U3 is working. To go to the CNS UI, login to the vSphere client, then navigate to Datacenter → Monitor → Cloud Native Storage → Container Volumes and observe that the newly created persistent volumes are present. These should match the `kubectl get pvc` output from earlier. You can also monitor their storage policy compliance status. ![Cloud Native Storage view of the MongoDB Persistent Volumes](https://raw.githubusercontent.com/kubernetes/cloud-provider-vsphere/master/docs/images/cns-mongo-pvs-labels.png) That completes the testing. CSI, CPI and CNS are all now working.
{'content_hash': '45327874560df60c2e202694a20a0fee', 'timestamp': '', 'source': 'github', 'line_count': 953, 'max_line_length': 883, 'avg_line_length': 44.92969569779643, 'alnum_prop': 0.7326124527068055, 'repo_name': 'kubernetes/cloud-provider-vsphere', 'id': '72cb5d96b9a2c02bb1625fe6cce8d2c24a68c374', 'size': '42898', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/book/tutorials/kubernetes-on-vsphere-with-kubeadm.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '13339'}, {'name': 'Go', 'bytes': '862422'}, {'name': 'Makefile', 'bytes': '25413'}, {'name': 'Mustache', 'bytes': '1770'}, {'name': 'Shell', 'bytes': '39575'}]}
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-us" xml:lang="en-us"> <!-- 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. --> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta name="copyright" content="(C) Copyright 2005" /> <meta name="DC.rights.owner" content="(C) Copyright 2005" /> <meta content="public" name="security" /> <meta content="index,follow" name="Robots" /> <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' /> <meta content="concept" name="DC.Type" /> <meta name="DC.Title" content="About this guide and the Network Server documentation" /> <meta scheme="URI" name="DC.Relation" content="cadminov11108.html" /> <meta scheme="URI" name="DC.Relation" content="cadminov17524.html" /> <meta content="XHTML" name="DC.Format" /> <meta content="cadminov38650" name="DC.Identifier" /> <meta content="en-us" name="DC.Language" /> <link href="commonltr.css" type="text/css" rel="stylesheet" /> <title>About this guide and the Network Server documentation</title> </head> <body id="cadminov38650"><a name="cadminov38650"><!-- --></a> <h1 class="topictitle1">About this guide and the Network Server documentation</h1> <div> <p>This guide assumes that you are familiar with <span>Derby</span> features and tuning. Before reading this guide, you should first learn about basic <span>Derby</span> functionality by reading the <cite><span><em>Derby Developer's Guide</em></span></cite>. Also, because multi-user environments typically have performance and tuning issues, you should read <cite><span><em>Tuning Derby</em></span></cite>.</p> </div> <div> <div class="familylinks"> <div class="parentlink"><strong>Parent topic:</strong> <a href="cadminov11108.html" title="">Derby in a multi-user environment</a></div> </div> <div class="relconcepts"><strong>Related concepts</strong><br /> <div><a href="cadminov17524.html" title="">Derby in a server framework</a></div> </div> </div> </body> </html>
{'content_hash': 'c6f548d4af5e2bb9c99a2c88bc3f3e6f', 'timestamp': '', 'source': 'github', 'line_count': 59, 'max_line_length': 261, 'avg_line_length': 51.728813559322035, 'alnum_prop': 0.713302752293578, 'repo_name': 'mminella/jsr-352-ri-tck', 'id': 'c9444e9e5e21f67be8e779765382e49fc95bdcae', 'size': '3052', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'JSR352.BinaryDependencies/shipped/derby/docs/html/adminguide/cadminov38650.html', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '1743336'}, {'name': 'Perl', 'bytes': '80042'}, {'name': 'Racket', 'bytes': '180'}, {'name': 'Ruby', 'bytes': '1444'}, {'name': 'Shell', 'bytes': '45633'}]}
// Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED #define LIB_JSONCPP_JSON_TOOL_H_INCLUDED /* This header provides common string manipulation support, such as UTF-8, * portable conversion from/to string... * * It is an internal header that must not be exposed. */ namespace Json { /// Converts a unicode code-point to UTF-8. static inline std::string codePointToUTF8(unsigned int cp) { std::string result; // based on description from http://en.wikipedia.org/wiki/UTF-8 if (cp <= 0x7f) { result.resize(1); result[0] = static_cast<char>(cp); } else if (cp <= 0x7FF) { result.resize(2); result[1] = static_cast<char>(0x80 | (0x3f & cp)); result[0] = static_cast<char>(0xC0 | (0x1f & (cp >> 6))); } else if (cp <= 0xFFFF) { result.resize(3); result[2] = static_cast<char>(0x80 | (0x3f & cp)); result[1] = 0x80 | static_cast<char>((0x3f & (cp >> 6))); result[0] = 0xE0 | static_cast<char>((0xf & (cp >> 12))); } else if (cp <= 0x10FFFF) { result.resize(4); result[3] = static_cast<char>(0x80 | (0x3f & cp)); result[2] = static_cast<char>(0x80 | (0x3f & (cp >> 6))); result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 12))); result[0] = static_cast<char>(0xF0 | (0x7 & (cp >> 18))); } return result; } /// Returns true if ch is a control character (in range [0,32[). static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } enum { /// Constant that specify the size of the buffer that must be passed to /// uintToString. uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 }; // Defines a char buffer for use with uintToString(). typedef char UIntToStringBuffer[uintToStringBufferSize]; /** Converts an unsigned integer to string. * @param value Unsigned interger to convert to string * @param current Input/Output string buffer. * Must have at least uintToStringBufferSize chars free. */ static inline void uintToString(LargestUInt value, char*& current) { *--current = 0; do { *--current = char(value % 10) + '0'; value /= 10; } while (value != 0); } /** Change ',' to '.' everywhere in buffer. * * We had a sophisticated way, but it did not work in WinCE. * @see https://github.com/open-source-parsers/jsoncpp/pull/9 */ static inline void fixNumericLocale(char* begin, char* end) { while (begin < end) { if (*begin == ',') { *begin = '.'; } ++begin; } } } // namespace Json { #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED
{'content_hash': '948136242f3847cd8316adcba9e59d2b', 'timestamp': '', 'source': 'github', 'line_count': 87, 'max_line_length': 80, 'avg_line_length': 31.080459770114942, 'alnum_prop': 0.6479289940828402, 'repo_name': 'Zuppka/RLG', 'id': '5e66b117b96fec78e548981c6132d972678f9696', 'size': '2704', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'include/json_tool.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '189304'}, {'name': 'C++', 'bytes': '1854318'}]}
<?php class Cities extends Eloquent { /** * The database table used by the model. * * @var string */ protected $table = 'cities'; public function getList() { return DB::table('cities')->distinct()->lists('name','id'); } public function getName() { return $this->attributes['name']; } }
{'content_hash': 'b5af477c5b65a19be5e61913fb165b32', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 67, 'avg_line_length': 14.44, 'alnum_prop': 0.5318559556786704, 'repo_name': 'kamyh/ArcNotes', 'id': '893b19e22f3339012410c6abd2e36a1d5dbd8127', 'size': '361', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/models/Cities.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '7390'}, {'name': 'JavaScript', 'bytes': '6436'}, {'name': 'PHP', 'bytes': '549089'}, {'name': 'Python', 'bytes': '556'}]}
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{'content_hash': '15b4ea027ea00f2a061025cec15ac1ae', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': '4ea5f07221765efd9fe7e07b3f1ae82134cfc144', 'size': '186', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Hordeum/Hordeum muticum/ Syn. Hordeum muticum andicola/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
ACCEPTED #### According to NUB Generator [autonym] #### Published in null #### Original name null ### Remarks null
{'content_hash': '2fbce14ec94f9576820c9b1aade4dd66', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 23, 'avg_line_length': 9.076923076923077, 'alnum_prop': 0.6779661016949152, 'repo_name': 'mdoering/backbone', 'id': 'da088a8bc506c8e05d499b7124aa85fdca2b43f7', 'size': '173', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Apocynaceae/Asclepias/Asclepias ovalifolia/Asclepias ovalifolia ovalifolia/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
const prerender = require('prerender') const server = prerender() server.start()
{'content_hash': '8e4986a0b7909f3324ef33525bc55ddd', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 38, 'avg_line_length': 27.0, 'alnum_prop': 0.7530864197530864, 'repo_name': 'imuntil/nodejs', 'id': 'd3f0f4bf0d15f0387bac88d7c049b0614c8880ae', 'size': '81', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Prerender/start/server.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '110680'}, {'name': 'D', 'bytes': '1339'}, {'name': 'HTML', 'bytes': '1534621'}, {'name': 'Handlebars', 'bytes': '44291'}, {'name': 'Java', 'bytes': '393'}, {'name': 'JavaScript', 'bytes': '2978825'}, {'name': 'Less', 'bytes': '682'}, {'name': 'Pug', 'bytes': '21144'}, {'name': 'SCSS', 'bytes': '5505'}, {'name': 'Shell', 'bytes': '62'}, {'name': 'TypeScript', 'bytes': '59149'}, {'name': 'Vue', 'bytes': '179321'}]}
var test = require('tape'); var shell = require('shelljs'); var path = require('path'); var fs = require('fs'); test('bundle', function(t) { shell.cd(__dirname); var indexPath = path.resolve(__dirname, 'bundle_index.js'); var cliPath = path.resolve(__dirname, '../runtimeify.js'); var outPath = path.resolve(__dirname, 'initrd'); if (shell.exec(cliPath + ' ' + indexPath).code !== 0) { shell.exit(1); } fs.statSync(outPath); shell.rm(outPath); t.end(); });
{'content_hash': 'bde7529e81d211f94392f31c7e049b35', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 61, 'avg_line_length': 25.36842105263158, 'alnum_prop': 0.6203319502074689, 'repo_name': 'runtimejs/runtimeify', 'id': '3279384ba2466bb989ee7a5992234ea5258acf34', 'size': '482', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/test.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'JavaScript', 'bytes': '6364'}]}
title: "Mutators" description: "Reference documentation for Sensu Mutators." version: 1.1 weight: 7 --- # Sensu Mutators ## Reference documentation - [What is a Sensu mutator?](#what-is-a-sensu-mutator) - [The Sensu mutator specification](#the-sensu-mutator-specification) - [When to use a mutator](#when-to-use-a-mutator) - [How do Sensu mutators work?](#how-do-sensu-mutators-work) - [Mutator commands](#mutator-commands) - [What is a mutator command?](#what-is-a-mutator-command) - [Mutator command arguments](#mutator-command-arguments) - [How and where are mutator commands executed?](#how-and-where-are-mutator-commands-executed) - [Mutator configuration](#mutator-configuration) - [Example mutator definition](#example-mutator-definition) - [Mutator definition specification](#mutator-definition-specification) - [Mutator name(s)](#mutator-names) - [Mutator attributes](#mutator-attributes) ## What are Sensu mutators? {#what-are-sensu-mutators} Sensu mutators are executable scripts or other programs that modify [event data][1] for [Sensu event handlers][2] which may expect additional or modified event data (e.g. custom attributes that are not provided by the default [event data specification][3]. ### The Sensu mutator specification - Accept input/data via `STDIN` - Able to parse a JSON data payload (i.e. a [event data][1]) - Output JSON data (the modified event data) to `STDOUT` or `STDERR` - Produce an exit status code to indicate state: - `0` indicates OK - exit status codes other than `0` indicates a failure ### When to use a mutator Many [Sensu event handlers][2] will modify [event data][1] in the course of processing an [event][9], and in many cases this is recommended because modifying the event data and performing some action in memory (in the same process) will result in better performance than [executing a mutator][5] _and_ a handler (two separate processes). However, when multiple handlers require similar event data modifications, mutators provide the ability to avoid code duplication (<abbr title="DON'T REPEAT YOURSELF!">DRY</abbr>), and simplify event handler logic. ## How do Sensu mutators work? Sensu mutators are applied when [event handlers][2] are configured to use a `mutator`. Prior to executing a Handler, the Sensu server will execute the configured `mutator`. If the mutator is successfully executed, the modified event data is then provided to the handler and the handler will be executed. If the mutator fails to execute for any reason, an error will be logged and the handler will not be executed. The complete process may be described as follows: - When the Sensu server is processing an event, it will check for the definition of a `mutator`. Prior to executing each handler, the Sensu server will first execute the configured `mutator` (if any) for the handler - If the mutator is successfully executed (i.e. if it returns an exit status code of `0`), the modified event data is provided to the handler and the handler will be executed. - If the mutator fails to execute (i.e. returns a non-zero exit status code, or does not complete execution within the configured `timeout`), an error will be logged and the handler will not be executed Please refer to the [Sensu event handler definition specification][8] for more information about applying a mutator to an event handler (see the `mutator` attribute). ## Mutator commands ### What is a mutator command? Each [Sensu mutator definition][6] defines a command to be executed. Mutator commands are literally executable commands which will be executed on a [Sensu server][4], run as the `sensu` user. Most mutator commands are provided by [Sensu plugins][7]. ### Mutator command arguments Sensu mutator `command` attributes may include command line arguments for controlling the behavior of the `command` executable. Many [Sensu mutator plugins][7] provide support for command line arguments for reusability. ### How and where are mutator commands executed? As mentioned above, all mutator commands are executed by a [Sensu server][4] as the `sensu` user. Commands must be executable files that are discoverable on the Sensu server system (i.e. installed in a system `$PATH` directory). _NOTE: By default, the Sensu installer packages will modify the system `$PATH` for the Sensu processes to include `/etc/sensu/plugins`. As a result, executable scripts (e.g. plugins) located in `/etc/sensu/plugins` will be valid commands. This allows `command` attributes to use "relative paths" for Sensu plugin commands;<br><br>e.g.: `"command": "check-http.rb -u https://sensuapp.org"`_ ## Mutator configuration ### Example mutator definition The following is an example Sensu mutator definition, a JSON configuration file located at `/etc/sensu/conf.d/example_mutator.json`. This mutator definition uses an imaginary [Sensu plugin][7] called `example_mutator.rb` to modify event data prior to handling the event. ~~~ json { "mutators": { "example_mutator": { "command": "example_mutator.rb" } } } ~~~ ### Mutator definition specification #### Mutator name(s) Each mutator definition has a unique mutator name, used for the definition key. Every mutator definition is within the `"mutators": {}` definition scope. - A unique string used to name/identify the mutator - Cannot contain special characters or spaces - Validated with [Ruby regex][10] `/^[\w\.-]+$/.match("mutator-name")` #### Mutator attributes `command` : description : The mutator command to be executed. The event data is passed to the process via `STDIN`. : required : true : type : String : example : ~~~ shell "command": "/etc/sensu/plugins/mutated.rb" ~~~ `timeout` : description : The mutator execution duration timeout in seconds (hard stop). : required : false : type : Integer : example : ~~~ shell "timeout": 30 ~~~ [1]: events.html#event-data [2]: handlers.html [3]: events.html#event-data-specification [4]: server.html [5]: #how-and-where-are-mutator-commands-executed [6]: #mutator-definition-specification [7]: plugins.html [8]: handlers.html#handler-definition-specification [9]: events.html [10]: http://ruby-doc.org/core-2.2.0/Regexp.html
{'content_hash': '0db453126667cf7c39a9fc117f5c259d', 'timestamp': '', 'source': 'github', 'line_count': 168, 'max_line_length': 96, 'avg_line_length': 37.220238095238095, 'alnum_prop': 0.7454022069406685, 'repo_name': 'palourde/sensu-docs', 'id': '66bb9d3b8e678bf43db952808fbb1c9ce3dc111b', 'size': '6257', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/1.1/reference/mutators.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '74696'}, {'name': 'Shell', 'bytes': '12056'}]}
package com.mgmtp.perfload.core.client.web.flow; import static com.mgmtp.perfload.core.common.util.LtUtils.checkInterrupt; import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.Set; import java.util.UUID; import javax.inject.Inject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.mgmtp.perfload.core.client.config.annotations.ExecutionId; import com.mgmtp.perfload.core.client.config.scope.ExecutionScoped; import com.mgmtp.perfload.core.client.runner.ErrorHandler; import com.mgmtp.perfload.core.client.util.PlaceholderContainer; import com.mgmtp.perfload.core.client.util.WaitingTimeManager; import com.mgmtp.perfload.core.client.web.event.RequestFlowEvent; import com.mgmtp.perfload.core.client.web.event.RequestFlowEventListener; import com.mgmtp.perfload.core.client.web.request.InvalidRequestHandlerException; import com.mgmtp.perfload.core.client.web.request.RequestHandler; import com.mgmtp.perfload.core.client.web.response.DetailExtractor; import com.mgmtp.perfload.core.client.web.response.HeaderExtractor; import com.mgmtp.perfload.core.client.web.response.ResponseInfo; import com.mgmtp.perfload.core.client.web.response.ResponseValidator; import com.mgmtp.perfload.core.client.web.template.RequestTemplate; import com.mgmtp.perfload.core.client.web.template.TemplateTransformer; /** * Default implementation of a {@link RequestFlowHandler}. It handles the complete logic for a run * of a Web load test and fires {@link RequestFlowEvent}s before and after request flows and before * and after requests. The "after" events are fired in {@code finally} blocks so that they are also * triggered in case of an exception. The exception will then be available through the * {@link RequestFlowEvent}. * * @author rnaegele */ @ExecutionScoped public final class DefaultRequestFlowHandler implements RequestFlowHandler { private final Logger log = LoggerFactory.getLogger(getClass()); private final Map<String, RequestHandler> requestHandlers; private final List<RequestFlow> requestFlows; private final TemplateTransformer templateTransformer; private final ResponseValidator responseValidator; private final DetailExtractor detailExtractor; private final HeaderExtractor headerExtractor; private final WaitingTimeManager waitingTimeManager; private final PlaceholderContainer placeholderContainer; private final Set<RequestFlowEventListener> listeners; private final ErrorHandler errorHandler; private final UUID executionId; /** * Constructs a new instance. * * @param requestFlows * the list of {@link RequestFlow}s to be processed * @param requestHandlers * a map of {@link RequestHandler}s; must contain a request handler for each type of * request in the request flow * @param templateTransformer * the {@link TemplateTransformer} used to make request template executable * @param responseValidator * the {@link ResponseValidator} for validating the HTTP reponses * @param detailExtractor * the {@link DetailExtractor} for extracting details from the reponse bodies * @param headerExtractor * the {@link HeaderExtractor} for extracting headers from the reponses * @param waitingTimeManager * the {@link WaitingTimeManager} that introduces a waiting time as configured before * each request * @param placeholderContainer * the {@link PlaceholderContainer} * @param listeners * a set of {@link RequestFlowEventListener}s * @param errorHandler * the error handler which determines whether and exception should lead to the * abortion of the whole test * @param executionId * the execution id */ @Inject public DefaultRequestFlowHandler(final List<RequestFlow> requestFlows, final Map<String, RequestHandler> requestHandlers, final TemplateTransformer templateTransformer, final ResponseValidator responseValidator, final DetailExtractor detailExtractor, final HeaderExtractor headerExtractor, final WaitingTimeManager waitingTimeManager, final PlaceholderContainer placeholderContainer, final Set<RequestFlowEventListener> listeners, final ErrorHandler errorHandler, @ExecutionId final UUID executionId) { this.requestFlows = requestFlows; this.requestHandlers = requestHandlers; this.templateTransformer = templateTransformer; this.responseValidator = responseValidator; this.detailExtractor = detailExtractor; this.headerExtractor = headerExtractor; this.waitingTimeManager = waitingTimeManager; this.placeholderContainer = placeholderContainer; this.listeners = listeners; this.errorHandler = errorHandler; this.executionId = executionId; } @Override public void execute() throws Exception { Exception exception = null; for (ListIterator<RequestFlow> it = requestFlows.listIterator(); it.hasNext();) { RequestFlow requestFlow = it.next(); // 1-based index, so we use "nextIndex()" int flowIndex = it.nextIndex(); try { // fire event fireBeforeRequestFlow(flowIndex); // process requests for (final RequestTemplate template : requestFlow) { RequestTemplate executableTemplate = null; ResponseInfo responseInfo = null; UUID requestId = UUID.randomUUID(); try { waitingTimeManager.sleepBeforeRequest(); // check for interrupt and abort if necessary checkInterrupt(); // fire event, also called for skipped requests, because event handler may decide whether to skip // must be called before the template is made executable, so parameters // can be put into the placeholder container fireBeforeRequest(flowIndex, template); executableTemplate = templateTransformer.makeExecutable(template, placeholderContainer); if (executableTemplate.isSkipped()) { log.info("Skipping request: {}", executableTemplate); continue; } log.debug("Executing request template: {}", executableTemplate); // look up request handler for the request's type String type = template.getType(); RequestHandler handler = requestHandlers.get(type); if (handler == null) { throw new InvalidRequestHandlerException(String.format("No request handler for type '%s' available.", type)); } responseInfo = handler.execute(executableTemplate, requestId); if (responseInfo != null) { log.debug(responseInfo.toString()); // process response if (executableTemplate.isValidateResponse()) { responseValidator.validate(responseInfo); } detailExtractor.extractDetails(responseInfo, executableTemplate.getDetailExtractions(), placeholderContainer); headerExtractor.extractHeaders(responseInfo, executableTemplate.getHeaderExtractions(), placeholderContainer); } } catch (Exception ex) { exception = ex; // Handle error. Depending on the exception, the error handler may choose to abort the test. errorHandler.execute(ex); if (responseInfo != null) { // In case of an error we additionally log the response info at warn level log.warn(responseInfo.toString()); } // In any case, we don't want to execute the remainder of // the current request flow if an exception occurred and break out of the loop. break; } finally { RequestTemplate template4Event = executableTemplate != null ? executableTemplate : template; // ResponseInfo is null the request is skipped of if an exception occurs when the HttpClient executes // the request. In order to make sure that we still get an entry in the measuring log in the case of and // exceptiohn, we need to create one. However, it must remain null, when the request is skipped in // order to avoid an entry in the measuring log. if (responseInfo == null && executableTemplate != null && !executableTemplate.isSkipped()) { responseInfo = new ResponseInfo.Builder() .methodType(template4Event.getType()) .uri(template4Event.getUri()) .uriAlias(template4Event.getUriAlias()) .timestamp(System.currentTimeMillis()) .executionId(executionId) .requestId(requestId) .build(); } // always fire event, including skipped requests fireAfterRequest(flowIndex, template4Event, exception, responseInfo); } } } catch (Exception ex) { exception = ex; errorHandler.execute(ex); } finally { // fire event fireAfterRequestFlow(flowIndex, exception); } // In case of an exception, we don't want to execute potential subsequent request flows. if (exception != null) { break; } } } private void fireBeforeRequestFlow(final int flowIndex) { RequestFlowEvent event = new RequestFlowEvent(flowIndex); log.debug("fireBeforeRequestFlow: {}", event); for (RequestFlowEventListener listener : listeners) { log.debug("Executing listener: {}", listener); listener.beforeRequestFlow(event); } } private void fireAfterRequestFlow(final int flowIndex, final Exception ex) { RequestFlowEvent event = new RequestFlowEvent(flowIndex, ex); log.debug("fireAfterRequestFlow: {}", event); for (RequestFlowEventListener listener : listeners) { log.debug("Executing listener: {}", listener); listener.afterRequestFlow(event); } } private void fireBeforeRequest(final int flowIndex, final RequestTemplate template) { RequestFlowEvent event = new RequestFlowEvent(flowIndex, template); log.debug("fireBeforeRequestTemplate: {}", event); for (RequestFlowEventListener listener : listeners) { log.debug("Executing listener: {}", listener); listener.beforeRequest(event); } } private void fireAfterRequest(final int flowIndex, final RequestTemplate template, final Exception ex, final ResponseInfo responseInfo) { RequestFlowEvent event = new RequestFlowEvent(flowIndex, template, ex, responseInfo); log.debug("fireAfterRequestTemplate: {}", event); for (RequestFlowEventListener listener : listeners) { log.debug("Executing listener: {}", listener); listener.afterRequest(event); } } }
{'content_hash': '3ec8aceb24096942fdf3d7cf0699be7c', 'timestamp': '', 'source': 'github', 'line_count': 252, 'max_line_length': 122, 'avg_line_length': 40.78968253968254, 'alnum_prop': 0.7367448195349742, 'repo_name': 'mgm-tp/perfload-core', 'id': 'c4111ae0037ebc5d72c69b0036eaa04d012161f4', 'size': '10899', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'perfload-client/src/main/java/com/mgmtp/perfload/core/client/web/flow/DefaultRequestFlowHandler.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '3125'}, {'name': 'Java', 'bytes': '623964'}, {'name': 'Shell', 'bytes': '2729'}]}
declare namespace CodeceptJS { export interface I { createCitizenUser: () => string createSolicitorUser: () => Promise<string> deleteUser: (email) => Promise<void> deleteUsers: (emails) => Promise<void> createClaim: (claimData: ClaimData, submitterEmail: string) => string linkDefendantToClaim: (referenceNumber: string, ownerEmail: string, defendantEmail: string) => void respondToClaim: (referenceNumber: string, ownerEmail: string, responseData: ResponseData, defendantEmail: string) => void amOnLegalAppPage: (path: string) => void waitForLegalAppPage: (path?: string) => void downloadPDF: (pdfUrl: string, sessionCookie: string) => Promise<void> attachFile: (locator: string, path: string) => any grabAttributeFrom: (locator: string, attr: string) => any fillField: (locator: string | object, value: string) => any selectOption: (select: string, option: string) => any } } type CodeceptJSHelper = { _before: () => void; _after: () => void; } declare const codecept_helper: { new(): CodeceptJSHelper } declare function session(selector: string, callback: Function): Promise<any>; declare function session(selector: string, config: any, callback: Function): Promise<any>;
{'content_hash': '13d0e3ccbcf6f9ad669ab0106c374736', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 125, 'avg_line_length': 41.46666666666667, 'alnum_prop': 0.7065916398713826, 'repo_name': 'hmcts/cmc-legal-rep-frontend', 'id': 'f89264741b284cb589edcccc79afd1c40749a966', 'size': '1244', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'types/steps-override.d.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Dockerfile', 'bytes': '909'}, {'name': 'Groovy', 'bytes': '2124'}, {'name': 'HCL', 'bytes': '1611'}, {'name': 'JavaScript', 'bytes': '16357'}, {'name': 'Nunjucks', 'bytes': '86720'}, {'name': 'SCSS', 'bytes': '10124'}, {'name': 'Shell', 'bytes': '4590'}, {'name': 'TypeScript', 'bytes': '682938'}]}
from collections import namedtuple from datetime import datetime from scopus.classes import Retrieval class CitationOverview(Retrieval): @property def authors(self): """A list of namedtuples storing author information, where each namedtuple corresponds to one author. The information in each namedtuple is (name surname initials id url). All entries are strings. """ out = [] order = 'name surname initials id url' auth = namedtuple('Author', order) for author in self._citeInfoMatrix.get('author'): author = {k.split(":", 1)[-1]: v for k, v in author.items()} new = auth(name=author.get('index-name'), id=author.get('authid'), surname=author.get('surname'), initials=author.get('initials'), url=author.get('author-url')) out.append(new) return out or None @property def cc(self): """List of tuples of yearly number of citations for specified years.""" _years = range(self._start, self._end+1) try: return list(zip(_years, [d.get('$') for d in self._citeInfoMatrix['cc']])) except AttributeError: # No citations return list(zip(_years, [0]*len(_years))) @property def citationType_long(self): """Type (long version) of the abstract (e.g. article, review).""" return self._citeInfoMatrix.get('citationType', {}).get('$') @property def citationType_short(self): """Type (short version) of the abstract (e.g. ar, re).""" return self._citeInfoMatrix.get('citationType', {}).get('@code') @property def doi(self): """Document Object Identifier (DOI) of the abstract.""" return self._identifierlegend.get('doi') @property def endingPage(self): """Ending page.""" return self._citeInfoMatrix.get('endingPage') @property def h_index(self): """h-index of ciations of the abstract (according to Scopus).""" return self._data['h-index'] @property def issn(self): """ISSN of the publisher. Note: If E-ISSN is known to Scopus, this returns both ISSN and E-ISSN in random order separated by blank space. """ return self._citeInfoMatrix.get('issn') @property def issueIdentifier(self): """Issue number for abstract.""" return self._citeInfoMatrix.get('issueIdentifier') @property def lcc(self): """Number of citations the abstract received after the specified end year. """ return self._citeInfoMatrix.get('lcc') @property def pcc(self): """Number of citations the abstract received before the specified start year. """ return self._citeInfoMatrix.get('pcc') @property def pii(self): """The Publication Item Identifier (PII) of the abstract.""" return self._identifierlegend.get('pii') @property def publicationName(self): """Name of source the abstract is published in (e.g. the Journal).""" return self._citeInfoMatrix.get('publicationName') @property def scopus_id(self): """The Scopus ID of the abstract. It is the second part of an EID. The Scopus ID might differ from the one provided. """ return self._identifierlegend.get('scopus_id') @property def startingPage(self): """Starting page.""" return self._citeInfoMatrix.get('startingPage') @property def rangeCount(self): """Number of citations for specified years.""" return self._citeInfoMatrix.get('rangeCount') @property def rowTotal(self): """Number of citations (specified and omitted years).""" return self._citeInfoMatrix.get('rowTotal') @property def title(self): """Abstract title.""" return self._citeInfoMatrix.get('title') @property def url(self): """URL to Citation Overview API view of the abstract.""" return self._citeInfoMatrix.get('url') @property def volume(self): """Volume for the abstract.""" return self._citeInfoMatrix.get('volume') def __init__(self, eid, start, end=datetime.now().year, refresh=False): """Class to represent the results from a Scopus Citation Overview. See https://api.elsevier.com/documentation/guides/AbstractCitationViews.htm. Parameters ---------- eid : str The EID of the abstract. start : str or int The first year for which the citation count should be loaded end : str or int (optional, default=datetime.now().year) The last year for which the citation count should be loaded. Default is the current year. refresh : bool (optional, default=False) Whether to refresh the cached file if it exists or not. Notes ----- The files are cached in ~/.scopus/citation_overview/STANDARD/{eid}. Your API Key needs to be approved by Elsevier to access this API. """ # Variables self._start = int(start) self._end = int(end) view = "STANDARD" # In case Scopus adds different views in future # Get file content date = '{}-{}'.format(start, end) Retrieval.__init__(self, eid, 'CitationOverview', refresh, view=view, date=date) self._data = self._json['abstract-citations-response'] # citeInfoMatrix m = self._data['citeInfoMatrix']['citeInfoMatrixXML']['citationMatrix']['citeInfo'][0] self._citeInfoMatrix = _parse_dict(m) # identifier-legend l = self._data['identifier-legend']['identifier'][0] self._identifierlegend = _parse_dict(l) # citeColumnTotalXML self._citeColumnTotalXML = self._data['citeColumnTotalXML'] # not used def __str__(self): """Return a summary string.""" authors = [a.name for a in self.authors] if len(authors) > 1: authors[-1] = " and ".join([authors[-2], authors[-1]]) s = "Document '{self.title}' by {authors} published in "\ "'{self.publicationName}' has the following citation trajectory "\ "for years {self._start} to {self._end}:\n"\ "{self.cc}\n"\ "Additionally cited {self.pcc} times before {self._start}, and "\ "{self.lcc} times after {self._end}".format( self=self, authors=", ".join(authors)) return s def _parse_dict(dct): """Auxiliary function to change the keys of a dictionary.""" return {k.split(":", 1)[-1]: v for k, v in dct.items()}
{'content_hash': '12c6f57bb5dd4496acb1d1dbed409ae3', 'timestamp': '', 'source': 'github', 'line_count': 197, 'max_line_length': 94, 'avg_line_length': 34.63959390862944, 'alnum_prop': 0.5943728018757327, 'repo_name': 'scopus-api/scopus', 'id': '7cfb19dc03b943ee876da79e64ee6355ef17eec7', 'size': '6824', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'scopus/abstract_citations.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '133243'}]}
taxer ===== [![Build Status](https://travis-ci.org/teracyhq/taxer.svg?branch=develop)](https://travis-ci.org/teracyhq/taxer) [![Coverage Status](https://coveralls.io/repos/github/teracyhq/taxer/badge.svg?branch=develop)](https://coveralls.io/github/teracyhq/taxer?branch=develop) [![Code Climate](https://codeclimate.com/github/teracyhq/taxer/badges/gpa.svg)](https://codeclimate.com/github/teracyhq/taxer) universal tax calculator javascript library to calculate all kinds of taxes through out the world. Library Architecture -------------------- It's designed with plugin mechanism and minimalist in mind. By default: ```js const taxer = new Taxer(); taxer.use(new CustomCalctor()); const taxInfo = taxer.calc(countryCode, income, options); ``` in which: CustomCalctor should be a class implements Calctor interface which has: - isMatched(countryCode, taxableIncome, options) method: to be hooked up if it is the first to return true. - calc(taxableIncome, options) method: the taxInfo is calculated and returned. If no matched calculator, an error will be thrown. For example: ```js export default class VnCalctor { constructor() { } calc(taxableIncome, options={}) { return { taxableIncome: taxableIncome } } isMatched(countryCode, income, options) { if (typeof countryCode === 'string') { countryCode = countryCode.toLowerCase(); } return ['vn', 'vnm', 704, 'vietnam', 'viet nam'].indexOf(countryCode) > -1; } // required by exector under the hood, usually ignored by calctors exec() { return undefined; } } ``` For easier implementation, we should extend the base class Calctor, as the following: ```js import { Calctor } from 'taxer'; export default class VnCalctor extends Calctor { get currency() { return 'VND'; } get supportedCountryCodes() { return ['vn', 'vnm', 704, 'vietnam', 'viet nam']; } doMonthlyGrossPayrollCalc(income, options) { return monthlyPayrollProgressiveCalctor.calc(income, options); } doYearlyGrossPayrollCalc(income, options) { return yearlyPayrollProgressiveCalctor.calc(income, options); } doMonthlyNetPayrollCalc(income, options) { return monthlyPayrollProgressiveCalctor.calc(income, options); } doYearlyNetPayrollCalc(income, options) { return yearlyPayrollProgressiveCalctor.calc(income, options); } } ``` That's how the library architecture works. How to use ---------- 1. Configure 1.1. From the default taxer with built-in tax calculators: ```js const taxer = defaultTaxer(); // add more custom calculator taxer.use(new CustomCalctor(options)); ``` 1.2. From scratch ```js const taxer = new Taxer(); taxer.use(VnCalctor()); taxer.use(UsaCalctor()); taxer.use(SgCalctor()); taxer.use(CustomCalctor(options)); ``` 2. Use ```js const taxInfo = taxer.calc(countryCode, income, options); console.log(taxInfo); ``` How to develop -------------- This is the minimalist plugin architecture inspired by express.js and koa.js a lot. Let's keep it as minimal and lightweight as possible. Clone this repository and: ``` $ npm install $ npm run test ``` Or with Docker: ``` $ docker-compose up ``` How to contribute ----------------- By writing custom tax plugins to create a good solid universal tax system throughout the world. Follow Teracy workflow: http://dev.teracy.org/docs/workflow.html References ---------- These are related similar projects we should take a look: - https://github.com/rkh/income-tax - https://www.npmjs.com/package/uk-income-tax License ------- MIT license. See LICENSE file.
{'content_hash': '95ed2cf3f49d345c7c8a7023a5203579', 'timestamp': '', 'source': 'github', 'line_count': 165, 'max_line_length': 154, 'avg_line_length': 21.903030303030302, 'alnum_prop': 0.7047592695074709, 'repo_name': 'teracyhq/taxer', 'id': '17aeb699df5e3c2473606bd3e901bad19c310fed', 'size': '3614', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '70665'}]}
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{'content_hash': '4694f1d12a3d5887668ae1f505b24542', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': '7837baa18f220933aadbcb5818aa6a8008db5d31', 'size': '171', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Polygonaceae/Rumex/Rumex hagensis/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
/** * @author Nidin Vinayakan */ module nid{ export function saveAs(data:any,name:string="Unnamed"){ var blob = new Blob([data],{type: 'application/octet-binary'}); var url = URL.createObjectURL(blob); var save_link:any = document.createElementNS("http://www.w3.org/1999/xhtml", "a"); save_link.href = url; save_link.download = name; var event:any = document.createEvent("MouseEvents"); event.initMouseEvent( "click", true, false, null, 0, 0, 0, 0, 0 , false, false, false, false, 0, null ); save_link.dispatchEvent(event); } }
{'content_hash': '0513ceb82eee2d854878ef2ed195398b', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 90, 'avg_line_length': 35.22222222222222, 'alnum_prop': 0.5883280757097792, 'repo_name': 'nidin/TS-ImageLibrary', 'id': '5fa5845cf6a2df0a488087ae19a39f3f2e1e5a96', 'size': '634', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/nid/utils/FileUtils.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '1087'}, {'name': 'JavaScript', 'bytes': '268980'}, {'name': 'TypeScript', 'bytes': '44439'}]}
export * from "./src/CodeCompletionCore"; export * from "./src/SymbolTable";
{'content_hash': '48e7fecea4e513a3ee50133c1f55da34', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 41, 'avg_line_length': 19.75, 'alnum_prop': 0.6962025316455697, 'repo_name': 'mike-lischke/antlr4-c3', 'id': 'a6567adcd01e3762430347e01f420034f4d80e89', 'size': '212', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'index.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ANTLR', 'bytes': '30037'}, {'name': 'C#', 'bytes': '43645'}, {'name': 'C++', 'bytes': '18356'}, {'name': 'Java', 'bytes': '39569'}, {'name': 'TypeScript', 'bytes': '125622'}]}
var dialog = function(opt){ if(typeof opt.content == "string" || opt.content instanceof jQuery){ $("#dialog .content").html(opt.content); } else{ $("#dialog .content").html(content()); } $("#dialogBackground").css("display", "block"); $("#dialogConfirm").click(function(){ if(opt.confirm != undefined && typeof opt.confirm == "function"){ if(!opt.confirm()){ return; } } $("#dialogBackground").css("display", "none"); $(this).unbind("click"); }); $("#dialogCancel").click(function(){ if(opt.cancel != undefined && typeof opt.cancel == "function"){ opt.cancel(); } $("#dialogBackground").css("display", "none"); $(this).unbind("click"); }); } var logAppend = function(text){ $("#logArea").append(text + "</br>"); document.getElementById('logArea').scrollTop = document.getElementById('logArea').scrollHeight; } var warnning = function(content){ if(typeof content == "string" || content instanceof jQuery){ $("#warnning .content").html(content); } else{ $("#warnning .content").html(content()); } $("#warnningBackground").css("display", "block"); $("#warnningConfirm").click(function(){ $("#warnningBackground").css("display", "none"); $(this).unbind("click"); }); }
{'content_hash': '94ce361cdedd7087198a6c752a211320', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 99, 'avg_line_length': 26.555555555555557, 'alnum_prop': 0.5355648535564853, 'repo_name': 'liuzip/delve', 'id': 'b3c2fd0e32acfa57ad0b8e6ef8f9e467c52e3eb3', 'size': '1434', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'assets/js/common.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '3136'}, {'name': 'HTML', 'bytes': '10701'}, {'name': 'JavaScript', 'bytes': '564079'}]}
Google Code Veterans 2013 ========================= ## Problems * Hedgemony * Baby Height * Ocean View
{'content_hash': '0e93a685b21de319fc3c517657a37733', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 25, 'avg_line_length': 14.857142857142858, 'alnum_prop': 0.5576923076923077, 'repo_name': 'jdavis/code-jelly', 'id': '5652f923b321da9865e40e5bef3c91c0ef1b9570', 'size': '104', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'veterans2013/README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C++', 'bytes': '9699'}]}
// === // Daisy Chain! // === // * unhappy daisies in Opera Browser due to rendering glitch // properties // var //width, height, // plot pi = Math.PI; //horizon, //block, // palette //sky; // body width, 3:1 ratio c.width = width = b.clientWidth; c.height = height = width / 3; // set plot horizon = height * 0.2; block = 10; // set sky drop sky = a.createLinearGradient(0, 0, 0, height); sky.addColorStop(0, '#0FF'); sky.addColorStop(1, '#00F'); // set fill to sky a.fillStyle = sky; a.fillRect(0, 0, width, height); /** * Generate random number. * @param {Number} min Minimum number to generate * @param {Number} max Maximum number to generate */ function random_(min, max) { // _.random() return min + Math.floor(Math.random() * (max - min + 1)); } /** * Intelligently render on framerate intervals. (reduces lag) * @param {Function} frame Callback function to generate frame */ function render_(frame) { // requestAnimationFrame shim (@paul_irish) (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(fn){ window.setTimeout(fn, 1000 / 60); })(frame); } /** * Blossoms a daisy! */ function blossom() { // set scope var multiplier, posMultiplier, startX, startY, stopX, stopY, ctrlX, ctrlY, deltaX, deltaY, diffX, diffY, posX, posY; // set random multiplier, determines size posMultiplier = 0; multiplier = random_(5, (horizon * 3) / block); // set where to start posX = startX = random_(block, width - block); posY = startY = height - horizon + block; // set where to end stopX = random_(startX - multiplier, startX + multiplier); stopY = startY - (block * multiplier); // set gradient for quadratic curve ctrlX = random_(startX - multiplier, stopX + multiplier); ctrlY = random_(startY, stopY); // determine velocity in x and y directions deltaX = Math.abs(stopX - startX); deltaY = Math.abs(stopY - startY); // velocity, where diff = distance per frame diffX = diffY = 1; (deltaX > deltaY) ? diffY = deltaY / deltaX : diffX = deltaX / deltaY; /** * Renders daisy flower. */ function flower() { // render stamen a.beginPath(); a.fillStyle = '#FF0'; a.arc(stopX, stopY, (block * posMultiplier)/pi/1.5/1.5, 0, pi*2); a.fill(); //a.restore(); // render petals (unicode chars ftw) a.fillStyle = '#FFF'; a.font = (block * posMultiplier) + "pt serif"; a.fillText("\u273f", stopX - (block * posMultiplier)/2, stopY + (block * posMultiplier)/2, block * posMultiplier); // progress position posMultiplier++; // loop until flower is fully rendered if(posMultiplier !== multiplier) render_(flower); } /** * Renders daisy stalk. */ function stalk() { // render quadratic curve a.beginPath(); a.lineWidth = block; a.strokeStyle = '#000'; a.moveTo(startX, startY); a.quadraticCurveTo(ctrlX, ctrlY, posX, posY); a.stroke(); //a.restore(); // set ground drop (maintains position above stalk) a.fillStyle = '#080'; a.fillRect(0, height - horizon, width, horizon); // progress position posX += diffX; posY -= diffY; // loop, or move on to the flower (posY !== stopY) ? render_(stalk) : flower(); } // render only when coordinates are different, else try again // fixes rendering bug where flowers would appear without stalk (stopX !== startX) ? stalk() : blossom(); // and we're done! // return; } // generate random number of daisies, *spor*adically between 0.5s and 8s // excuse the pun... blossom(); for(var x=0, limit=random_(0, 25); x<limit; x++) { window.setTimeout(blossom, random_(500, 8000)); }
{'content_hash': 'd7214b229e80d7df58341aaaf3912072', 'timestamp': '', 'source': 'github', 'line_count': 157, 'max_line_length': 116, 'avg_line_length': 23.070063694267517, 'alnum_prop': 0.6535063500828272, 'repo_name': 'cs-au-dk/TAJS', 'id': '81de9c0aa6ae88041cec7c84455baf65d7c6993e', 'size': '3622', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test-resources/src/1k2013spring/1524.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '1661159'}, {'name': 'Java', 'bytes': '4740144'}, {'name': 'JavaScript', 'bytes': '3347530'}, {'name': 'Shell', 'bytes': '1839'}, {'name': 'TypeScript', 'bytes': '1299'}]}
// stats.js // ------------------------------------------------------------------ // // created: Mon Oct 15 17:23:24 2018 // last saved: <2022-April-01 14:17:51> /* jshint esversion:9, node:true, strict:implied */ const common = require('./common.js'), utility = require('./utility.js'), promiseWrap = require('./promiseWrap.js'), urljoin = require('url-join'), sprintf = require('sprintf-js').sprintf, request = require('request'), dateFormat = require('dateformat'); function utcOffset_apigeeTimeFormat(date) { var s = dateFormat(date, "isoUtcDateTime"); s = s.slice(0, -4); return s.slice(-5); } function getTimeRange(start, end) { start = dateFormat(start, 'mm/dd/yyyy') + ' ' + utcOffset_apigeeTimeFormat(start); end = dateFormat(end, 'mm/dd/yyyy') + ' ' + utcOffset_apigeeTimeFormat(end); return start + '~' + end; } function Stat(conn) {this.conn = conn;} Stat.prototype.get = promiseWrap(function(options, cb) { // GET "$mgmtserver/v1/o/$ORG/e/$ENV/stats/apis?select=sum(message_count)&timeRange=01/01/2018%2000:00~08/01/2018%2000:00&timeUnit=month" // var options = { // environment : 'test', // dimension: 'apis', // metric: 'sum(message_count)', // startTime: startTime, // endTime : endTime, // timeUnit : 'month', // limit : 1024, // optimize : true/false, // cacheCheck : fn // }; if ( ! cb) { cb = options; options = {}; } var conn = this.conn; var env = options.environmentName || options.environment; if (!env) { throw new Error("missing environment name"); } if (!options.dimension) { throw new Error("missing dimension"); } if (!options.metric) { throw new Error("missing metric"); } common.insureFreshToken(conn, function(requestOptions) { var query = sprintf('?select=%s&timeUnit=%s&timeRange=%s', options.metric, options.timeUnit, getTimeRange(options.startTime, options.endTime)); if (options.limit) { query += '&limit=' + options.limit; } if (options.optimize) { query += '&_optimize=js'; } if (options.metric.indexOf('percentile')>=0) { query += '&t=agg_percentile'; } if (options.filter) { // filter=(apiproxy%20eq%20%%27${APIPROXY}%27) query += '&filter=' + options.filter; } requestOptions.url = urljoin(conn.urlBase, 'environments', env, 'stats', options.dimension) + query; if (conn.verbosity>0) { utility.logWrite(sprintf('GET %s', requestOptions.url)); } // it takes a long time to retrieve some stats data. So let's // allow the use of a cache via an upcall. if (typeof options.cacheCheck == 'function') { let uniquifier = sprintf('%s-%s-%s-%s-%s-%s-%s', conn.orgname, env, options.dimension, options.metric, dateFormat(options.startTime, 'yyyymmdd'), dateFormat(options.endTime, 'yyyymmdd'), options.timeUnit); let cacheResponse = options.cacheCheck(requestOptions.url, uniquifier); if (cacheResponse) { if (cacheResponse.data) { return cb(null, {data: JSON.parse(cacheResponse.data) }); } else if (cacheResponse.cachefile) { return request.get(requestOptions, common.callback(conn, [200], function(e, data){ cb(e, {cachefile: cacheResponse.cachefile, data:data}); })); } } } return request.get(requestOptions, common.callback(conn, [200], function(e, data){ cb(e, {data:data}); })); }); }); module.exports = Stat;
{'content_hash': '50b2a67220284b88f4324d19c0c92a4a', 'timestamp': '', 'source': 'github', 'line_count': 109, 'max_line_length': 139, 'avg_line_length': 34.22018348623853, 'alnum_prop': 0.5761394101876676, 'repo_name': 'DinoChiesa/apigee-edge-js', 'id': '052d5489fbb513f7a5c69c79d9f297277b8aa5a3', 'size': '3730', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'lib/stat.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'JavaScript', 'bytes': '411640'}, {'name': 'XSLT', 'bytes': '2212'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>classical-realizability: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1+2 / classical-realizability - 8.5.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> classical-realizability <small> 8.5.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-22 11:23:20 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-22 11:23:20 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.1+2 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.04.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.04.2 Official 4.04.2 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/classical-realizability&quot; license: &quot;BSD&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/ClassicalRealizability&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.5&quot; &amp; &lt; &quot;8.6~&quot;} ] tags: [ &quot;keyword:classical realizability&quot; &quot;keyword:krivine&#39;s realizability&quot; &quot;keyword:primitive datatype&quot; &quot;keyword:non determinism&quot; &quot;keyword:quote&quot; &quot;keyword:axiom of countable choice&quot; &quot;keyword:real numbers&quot; &quot;category:Mathematics/Logic/Foundations&quot; ] authors: [ &quot;Lionel Rieg &lt;[email protected]&gt;&quot; ] bug-reports: &quot;https://github.com/coq-contribs/classical-realizability/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/classical-realizability.git&quot; synopsis: &quot;Krivine&#39;s classical realizability&quot; description: &quot;&quot;&quot; The aim of this Coq library is to provide a framework for checking proofs in Krivine&#39;s classical realizability for second-order Peano arithmetic. It is designed to be as extensible as the original theory by Krivine and to support on-the-fly extensions by new instructions with their evaluation rules.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/classical-realizability/archive/v8.5.0.tar.gz&quot; checksum: &quot;md5=7e6fb42bd18a9d7282d8d694d322f9a6&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-classical-realizability.8.5.0 coq.8.7.1+2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+2). The following dependencies couldn&#39;t be met: - coq-classical-realizability -&gt; coq &lt; 8.6~ -&gt; ocaml &lt; 4.03.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-classical-realizability.8.5.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{'content_hash': '32178ad3e89633f7ce45dbc1ccb06dad', 'timestamp': '', 'source': 'github', 'line_count': 171, 'max_line_length': 332, 'avg_line_length': 44.228070175438596, 'alnum_prop': 0.5651196615099828, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': 'a67cb9af7ad5c8170da3f92608554c4cfda2ec05', 'size': '7588', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.04.2-2.0.5/released/8.7.1+2/classical-realizability/8.5.0.html', 'mode': '33188', 'license': 'mit', 'language': []}
#import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "FBFetchedAppSettings.h" @class FBRequest; @class FBSession; @protocol FBGraphObject; typedef enum FBAdvertisingTrackingStatus { AdvertisingTrackingAllowed, AdvertisingTrackingDisallowed, AdvertisingTrackingUnspecified } FBAdvertisingTrackingStatus; @interface FBUtility : NSObject + (NSDictionary*)queryParamsDictionaryFromFBURL:(NSURL*)url; + (NSDictionary*)dictionaryByParsingURLQueryPart:(NSString *)encodedString; + (NSString *)stringBySerializingQueryParameters:(NSDictionary *)queryParameters; + (NSString *)stringByURLDecodingString:(NSString*)escapedString; + (NSString*)stringByURLEncodingString:(NSString*)unescapedString; + (id<FBGraphObject>)graphObjectInArray:(NSArray*)array withSameIDAs:(id<FBGraphObject>)item; + (unsigned long)currentTimeInMilliseconds; + (NSTimeInterval)randomTimeInterval:(NSTimeInterval)minValue withMaxValue:(NSTimeInterval)maxValue; + (void)centerView:(UIView*)view tableView:(UITableView*)tableView; + (NSString *)stringFBIDFromObject:(id)object; + (NSString *)stringAppBaseUrlFromAppId:(NSString *)appID urlSchemeSuffix:(NSString *)urlSchemeSuffix; + (NSDate*)expirationDateFromExpirationTimeIntervalString:(NSString*)expirationTime; + (NSDate*)expirationDateFromExpirationUnixTimeString:(NSString*)expirationTime; + (NSBundle *)facebookSDKBundle; + (NSString *)localizedStringForKey:(NSString *)key withDefault:(NSString *)value; + (NSString *)localizedStringForKey:(NSString *)key withDefault:(NSString *)value inBundle:(NSBundle *)bundle; // Returns YES when the bundle identifier is for one of the native facebook apps + (BOOL)isFacebookBundleIdentifier:(NSString *)bundleIdentifier; + (BOOL)isPublishPermission:(NSString*)permission; + (BOOL)areAllPermissionsReadPermissions:(NSArray*)permissions; + (NSArray*)addBasicInfoPermission:(NSArray*)permissions; + (void)fetchAppSettings:(NSString *)appID callback:(void (^)(FBFetchedAppSettings *, NSError *))callback; + (FBFetchedAppSettings *)fetchedAppSettings; + (NSString *)attributionID; + (NSString *)advertiserID; + (FBAdvertisingTrackingStatus)advertisingTrackingStatus; + (void)updateParametersWithEventUsageLimits:(NSMutableDictionary *)parameters; // Encode a data structure in JSON, any errors will just be logged. + (NSString *)simpleJSONEncode:(id)data; + (id)simpleJSONDecode:(NSString *)jsonEncoding; + (NSString *)simpleJSONEncode:(id)data error:(NSError **)error writingOptions:(NSJSONWritingOptions)writingOptions; + (id)simpleJSONDecode:(NSString *)jsonEncoding error:(NSError **)error; + (BOOL) isRetinaDisplay; + (NSString *)newUUIDString; + (BOOL)isRegisteredURLScheme:(NSString *)urlScheme; + (NSString *) buildFacebookUrlWithPre:(NSString*)pre; + (NSString *) buildFacebookUrlWithPre:(NSString*)pre withPost:(NSString *)post; @end #define FBConditionalLog(condition, desc, ...) \ do { \ if (!(condition)) { \ NSString *msg = [NSString stringWithFormat:(desc), ##__VA_ARGS__]; \ NSLog(@"FBConditionalLog: %@", msg); \ } \ } while(NO) #define FB_BASE_URL @"facebook.com"
{'content_hash': 'af69a6a40fff78a1b6be8183fbde563d', 'timestamp': '', 'source': 'github', 'line_count': 80, 'max_line_length': 102, 'avg_line_length': 41.0375, 'alnum_prop': 0.7401766676819982, 'repo_name': 'bliustar/couponquest', 'id': 'f8e9a455c850ec7a394c32558c1a36edab59cb45', 'size': '3881', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Pods/Facebook-iOS-SDK/src/FBUtility.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'AppleScript', 'bytes': '18419'}, {'name': 'C', 'bytes': '270586'}, {'name': 'C++', 'bytes': '6727'}, {'name': 'CSS', 'bytes': '6111'}, {'name': 'JavaScript', 'bytes': '111'}, {'name': 'M', 'bytes': '163592'}, {'name': 'Objective-C', 'bytes': '7524991'}, {'name': 'Ruby', 'bytes': '13807'}, {'name': 'Shell', 'bytes': '40797'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>historical-examples: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.6 / historical-examples - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> historical-examples <small> 8.7.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-11-21 00:31:44 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-21 00:31:44 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-ocamlbuild base OCamlbuild binary and libraries distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.6 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.02.3 The OCaml compiler (virtual package) ocaml-base-compiler 4.02.3 Official 4.02.3 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/historical-examples&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/HistoricalExamples&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword: Newman&#39;s lemma&quot; &quot;keyword: Tarski&#39;s fixpoint theorem&quot; &quot;keyword: line formatting&quot; &quot;keyword: binary-search paradigm&quot; &quot;keyword: square root approximation&quot; &quot;keyword: Calculus of Constructions&quot; &quot;keyword: history of Coq&quot; &quot;category: Miscellaneous/Coq Use Examples&quot; ] authors: [ &quot;Gérard Huet&quot; &quot;Christine Paulin&quot; ] bug-reports: &quot;https://github.com/coq-contribs/historical-examples/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/historical-examples.git&quot; synopsis: &quot;Historical examples developed in the (pure) Calculus of Constructions&quot; description: &quot;&quot;&quot; This is a collection of historical examples developed in system CoC that implemented Coquand&#39;s Calculus of Constructions. Newman.v and Tarski.v originate in version 1.10, Manna.v and Format.v are from version 4.3. Their evolution to the Calculus of Inductive Constructions (up to Coq V6.3) are in MannaCIC.v and FormatCIC.v. (Collection by Hugo Herbelin.)&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/historical-examples/archive/v8.7.0.tar.gz&quot; checksum: &quot;md5=b77b1bc10c081e5fce0ce9fb46e7a661&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-historical-examples.8.7.0 coq.8.6</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.6). The following dependencies couldn&#39;t be met: - coq-historical-examples -&gt; coq &gt;= 8.7 -&gt; ocaml &gt;= 4.05.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-historical-examples.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{'content_hash': 'db15d63af738afb6716f3fed684f578b', 'timestamp': '', 'source': 'github', 'line_count': 173, 'max_line_length': 364, 'avg_line_length': 44.68208092485549, 'alnum_prop': 0.5670116429495472, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': 'a1f2f1b4873915d54307d2751605a717d19f08e6', 'size': '7756', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.02.3-2.0.6/released/8.6/historical-examples/8.7.0.html', 'mode': '33188', 'license': 'mit', 'language': []}
<?xml version="1.0" encoding="utf-8"?> <resources> <!-- From: file:/C:/Users/Orlyn/Documents/MyOffice/personal/umedinfo/deb/uMedInfo/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/res/values-zh-rHK/values-zh-rHK.xml --> <eat-comment/> <string msgid="4600421777120114993" name="abc_action_bar_home_description">"瀏覽主頁"</string> <string msgid="1594238315039666878" name="abc_action_bar_up_description">"向上瀏覽"</string> <string msgid="3588849162933574182" name="abc_action_menu_overflow_description">"更多選項"</string> <string msgid="4076576682505996667" name="abc_action_mode_done">"完成"</string> <string msgid="7468859129482906941" name="abc_activity_chooser_view_see_all">"顯示全部"</string> <string msgid="2031811694353399454" name="abc_activitychooserview_choose_application">"選擇應用程式"</string> <string msgid="3691816814315814921" name="abc_searchview_description_clear">"清除查詢"</string> <string msgid="2550479030709304392" name="abc_searchview_description_query">"搜尋查詢"</string> <string msgid="8264924765203268293" name="abc_searchview_description_search">"搜尋"</string> <string msgid="8928215447528550784" name="abc_searchview_description_submit">"提交查詢"</string> <string msgid="893419373245838918" name="abc_searchview_description_voice">"語音搜尋"</string> <string msgid="3421042268587513524" name="abc_shareactionprovider_share_with">"分享對象"</string> <string msgid="7165123711973476752" name="abc_shareactionprovider_share_with_application">"與「%s」分享"</string> </resources>
{'content_hash': '3f9e163499f8e614270043234dc8f1ea', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 198, 'avg_line_length': 85.88888888888889, 'alnum_prop': 0.7509702457956016, 'repo_name': 'orlyngerano/searchmedicine', 'id': '64ebf00c15a4b4d8ef6557b0e32bbd795413bf04', 'size': '1648', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'uMedInfo/build/intermediates/res/debug/values-zh-rHK/values-zh-rHK.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '485262'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>dictionaries: 18 s 🏆</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.0 / dictionaries - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> dictionaries <small> 8.7.0 <span class="label label-success">18 s 🏆</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-03-24 00:13:48 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-24 00:13:48 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/dictionaries&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Dictionaries&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword: modules&quot; &quot;keyword: functors&quot; &quot;keyword: search trees&quot; &quot;category: Computer Science/Data Types and Data Structures&quot; &quot;category: Miscellaneous/Extracted Programs/Data structures&quot; &quot;date: 2003-02-6&quot; ] authors: [ &quot;Pierre Castéran &lt;[email protected]&gt;&quot; ] bug-reports: &quot;https://github.com/coq-contribs/dictionaries/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/dictionaries.git&quot; synopsis: &quot;Dictionaries (with modules)&quot; description: &quot;&quot;&quot; This file contains a specification for dictionaries, and an implementation using binary search trees. Coq&#39;s module system, with module types and functors, is heavily used. It can be considered as a certified version of an example proposed by Paulson in Standard ML. A detailed description (in French) can be found in the chapter 11 of The Coq&#39;Art, the book written by Yves Bertot and Pierre Castéran (please follow the link http://coq.inria.fr/doc-eng.html)&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/dictionaries/archive/v8.7.0.tar.gz&quot; checksum: &quot;md5=1e1e78b0a76827b75de4f43ec8602c1d&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-dictionaries.8.7.0 coq.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-dictionaries.8.7.0 coq.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>11 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-dictionaries.8.7.0 coq.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>18 s</dd> </dl> <h2>Installation size</h2> <p>Total: 320 K</p> <ul> <li>193 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Dictionaries/dict.vo</code></li> <li>94 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Dictionaries/dict.glob</code></li> <li>33 K <code>../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Dictionaries/dict.v</code></li> </ul> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq-dictionaries.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{'content_hash': '9ab734753a1548b92a97ce193d2beae4', 'timestamp': '', 'source': 'github', 'line_count': 174, 'max_line_length': 159, 'avg_line_length': 43.298850574712645, 'alnum_prop': 0.556941863551898, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': 'a90ec1506139dd590b76b2326309e3fdb4f4ad78', 'size': '7561', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.07.1-2.0.6/released/8.7.0/dictionaries/8.7.0.html', 'mode': '33188', 'license': 'mit', 'language': []}
using System.Collections; using System.Collections.Generic; using UnityEngine; public class DebugLogPositionInformation : MonoBehaviour { [SerializeField] private string ObjectName = ""; [SerializeField] private Vector3 RectTransformPosition = Vector3.zero; [SerializeField] private float TimeSinceStart = 0.0f; [SerializeField, Range(0, 1000000)] private float ComparisonThreshold = 500.0f; Vector3 PreviousRectTransformPosition = Vector3.zero; // Use this for initialization void Start () { } // Update is called once per frame void Update () { ObjectName = gameObject.name; PreviousRectTransformPosition = RectTransformPosition; RectTransformPosition = GetComponent<RectTransform>().anchoredPosition; TimeSinceStart = Time.unscaledTime; CompareCurrentAndPreviousRectTransformPositions(); } void CompareCurrentAndPreviousRectTransformPositions() { if(Mathf.Abs(RectTransformPosition.x - PreviousRectTransformPosition.x) > ComparisonThreshold || Mathf.Abs(RectTransformPosition.y - PreviousRectTransformPosition.y) > ComparisonThreshold || Mathf.Abs(RectTransformPosition.z - PreviousRectTransformPosition.z) > ComparisonThreshold) { Debug.Log("Position drastically changed from <" + PreviousRectTransformPosition + "> to <" + RectTransformPosition + "> at: <" + Time.unscaledTime + ">."); } } }
{'content_hash': 'ed929c523db0a213362286cdb4dd86ba', 'timestamp': '', 'source': 'github', 'line_count': 42, 'max_line_length': 167, 'avg_line_length': 34.92857142857143, 'alnum_prop': 0.7143830947511929, 'repo_name': 'Alfabits/Pip-Pup-Source-Backup', 'id': '94b3c6b5fcc451512399d0869c840482ab34d18c', 'size': '1469', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Scripts/Debugging/DebugLogPositionInformation.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '191984'}]}
@implementation RVMutableDictionary -(instancetype) init { self = [super init]; if(self) { _backingDict = [[NSMutableDictionary alloc] init]; } return self; } -(void) setObject:(id)anObject forKey:(id<NSCopying>)aKey { if(anObject == nil) { return; } [_backingDict setObject:anObject forKey:aKey]; } -(id) valueForKey:(NSString *) key { return [_backingDict objectForKey:key]; } - (void)setValue:(id)value forKey:(NSString *)key{ [_backingDict setObject:value forKey:key]; } //Dont override. We do want the app to error out if there is a missing key //- (id)valueForUndefinedKey:(NSString *)key { // //} - (void)setValue:(id)value forUndefinedKey:(NSString *)key{ [_backingDict setObject:value forKey:key]; } #pragma mark - passing messages to the backing dictionary - (void)forwardInvocation:(NSInvocation *)anInvocation { if ([_backingDict respondsToSelector: [anInvocation selector]]) [anInvocation invokeWithTarget:_backingDict]; else [super forwardInvocation:anInvocation]; } - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { return [NSMutableDictionary instanceMethodSignatureForSelector:aSelector]; } #pragma mark - remaing KVO compliant. Invisibly ignoring this class - (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context { [_backingDict addObserver:observer forKeyPath:keyPath options:options context:context]; } - (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath context:(void *)context { [_backingDict removeObserver:observer forKeyPath:keyPath context:context]; } - (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath { [_backingDict removeObserver:observer forKeyPath: keyPath]; } -(NSString *) description { return [_backingDict description]; } @end
{'content_hash': '3ae7ee87f8c58ea0846bb47b1abe6a50', 'timestamp': '', 'source': 'github', 'line_count': 66, 'max_line_length': 141, 'avg_line_length': 29.303030303030305, 'alnum_prop': 0.7233712512926577, 'repo_name': 'aaronSig/rivet', 'id': 'a08a8f7ab37aa9b8cc4afe73a46d18da7ae7a656', 'size': '2296', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Rivet/RVMutableDictionary.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '24549'}, {'name': 'Ruby', 'bytes': '6100'}]}
StroikaRoot=$(abspath ../../../../../../)/ ifneq ($(CONFIGURATION),) #no error if missing cuz could be doing make clobber -include $(StroikaRoot)IntermediateFiles/$(CONFIGURATION)/Configuration.mk endif include $(StroikaRoot)ScriptsLib/Makefile-Common.mk include $(StroikaRoot)ScriptsLib/SharedMakeVariables-Default.mk SrcDir = $(StroikaRoot)Library/Sources/Stroika/Frameworks/SystemPerformance/Support/ ObjDir = $(StroikaRoot)IntermediateFiles/$(CONFIGURATION)/Library/Frameworks/SystemPerformance/Support/ ifeq ($(WIN_USE_PROGRAM_DATABASE),1) CXXFLAGS+=-Fd$(call FUNCTION_CONVERT_FILEPATH_TO_COMPILER_NATIVE,$(StroikaRoot)Builds/$(CONFIGURATION)/Stroika-Frameworks.pdb) endif vpath %cpp $(SrcDir) Objs = \ ifneq ($(findstring Windows,$(TARGET_PLATFORMS)),) Objs+= $(ObjDir)WMICollector${OBJ_SUFFIX} endif include $(StroikaRoot)ScriptsLib/SharedBuildRules-Default.mk all: $(Objs)
{'content_hash': '9407a90a5290fa8528827bedf1a69352', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 126, 'avg_line_length': 28.93548387096774, 'alnum_prop': 0.770345596432553, 'repo_name': 'SophistSolutions/Stroika', 'id': '4304dff40e9711abd881197b35dbe3326c40b894', 'size': '897', 'binary': False, 'copies': '1', 'ref': 'refs/heads/v2.1-Release', 'path': 'Library/Sources/Stroika/Frameworks/SystemPerformance/Support/Makefile', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '438'}, {'name': 'C', 'bytes': '15598'}, {'name': 'C++', 'bytes': '12952163'}, {'name': 'Dockerfile', 'bytes': '38254'}, {'name': 'Makefile', 'bytes': '299984'}, {'name': 'Perl', 'bytes': '52501'}, {'name': 'R', 'bytes': '29685'}, {'name': 'Shell', 'bytes': '81240'}]}
<!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nubi - Place to learn, way to heaven</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="https://unpkg.com/vue"></script> </head> <body> <div class="container"> <div id="app" class="panel-group"> {{ message }} <div v-for="conver in convers" class="panel panel-default"> <div class="panel-heading panel-title"> <a data-toggle="collapse" v-bind:href="'#coll' + conver.id">{{conver.id}}</a> </div> <div v-bind:id="'coll' + conver.id" class="panel-collapse collapse"> <div v-for="msg in conver.msgs" class="panel-body"> {{msg.id}}: {{msg.text}} </div> </div> </div> </div> </div> <script> var app = new Vue({ el: '#app', data: { message: 'Hello Vue!', convers: [{ id: 1, msgs: [{ id: 1, text: "Hello, how are you?" }, { id: 2, text: "fine, thank you. How are you too?" }, { id: 3, text: "Never been better" }]}, { id: 2, msgs: [{ id: 1, text: "Do you have a plan to night?" }, { id: 2, text: "No, not yet. Do you want to go to movie?" }, { id: 3, text: "Sound's great! let's go for the ticket." }, { id: 4, text: "Can't wait fot it" }] }] } }); </script> </body> </html>
{'content_hash': '016cd4166851c0a29e46c56318d748c9', 'timestamp': '', 'source': 'github', 'line_count': 72, 'max_line_length': 108, 'avg_line_length': 35.638888888888886, 'alnum_prop': 0.41504286827747466, 'repo_name': 'nevaku/kurniakue', 'id': 'c1fddfd7854036c4244440c7bdccd95d47a78c02', 'size': '2566', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'kurse/src/main/webapp/nubi.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '2850'}, {'name': 'CSS', 'bytes': '1394'}, {'name': 'HTML', 'bytes': '23766'}, {'name': 'Java', 'bytes': '743067'}, {'name': 'JavaScript', 'bytes': '47267'}, {'name': 'PHP', 'bytes': '1021'}]}
<?xml version="1.0" encoding="UTF-8"?> <!-- Pass: (1500) A Parameter's 'units' must be a UnitKind, a built-in unit, or the id of a UnitDefinition. --> <sbml xmlns="http://www.sbml.org/sbml/level1" level="1" version="2"> <model> <listOfUnitDefinitions> <unitDefinition name="mmls"> <listOfUnits> <unit kind="mole" scale="-3"/> <unit kind="litre" exponent="-1"/> <unit kind="second" exponent="-1"/> </listOfUnits> </unitDefinition> </listOfUnitDefinitions> <listOfCompartments> <compartment name="c"/> </listOfCompartments> <listOfParameters> <parameter name="p" units="mmls" value="1"/> </listOfParameters> </model> </sbml>
{'content_hash': 'd81b1eb2822bc24de68518d7b5a4a6a9', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 68, 'avg_line_length': 28.0, 'alnum_prop': 0.6488095238095238, 'repo_name': 'TheCoSMoCompany/biopredyn', 'id': '17535b5e576ec46677ba11487ae6f18a49e3210a', 'size': '672', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'Prototype/src/libsbml-5.10.0/src/sbml/validator/test/test-data/sbml-unit-constraints/20701-pass-00-15.xml', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '3535918'}, {'name': 'C++', 'bytes': '26120778'}, {'name': 'CMake', 'bytes': '455400'}, {'name': 'CSS', 'bytes': '49020'}, {'name': 'Gnuplot', 'bytes': '206'}, {'name': 'HTML', 'bytes': '193068'}, {'name': 'Java', 'bytes': '66517'}, {'name': 'JavaScript', 'bytes': '3847'}, {'name': 'Makefile', 'bytes': '30905'}, {'name': 'Perl', 'bytes': '3018'}, {'name': 'Python', 'bytes': '7891301'}, {'name': 'Shell', 'bytes': '247654'}, {'name': 'TeX', 'bytes': '22566'}, {'name': 'XSLT', 'bytes': '55564'}]}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <title>Uses of Package org.eclipse.emf.cdo.common.admin (CDO Model Repository Documentation)</title> <meta name="date" content=""> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package org.eclipse.emf.cdo.common.admin (CDO Model Repository Documentation)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <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">Use</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>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/eclipse/emf/cdo/common/admin/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;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 title="Uses of Package org.eclipse.emf.cdo.common.admin" class="title">Uses of Package<br>org.eclipse.emf.cdo.common.admin</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../org/eclipse/emf/cdo/common/admin/package-summary.html">org.eclipse.emf.cdo.common.admin</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.eclipse.emf.cdo.admin">org.eclipse.emf.cdo.admin</a></td> <td class="colLast"> <div class="block">Client side of the protocol to administer CDO repositories remotely.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.eclipse.emf.cdo.common.admin">org.eclipse.emf.cdo.common.admin</a></td> <td class="colLast"> <div class="block">Common concepts for the protocol to administer CDO repositories remotely.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.eclipse.emf.cdo.spi.common.admin">org.eclipse.emf.cdo.spi.common.admin</a></td> <td class="colLast"> <div class="block">Common concepts for dealing with protocols and CDO administration-specific I/O.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.eclipse.emf.cdo.admin"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../org/eclipse/emf/cdo/common/admin/package-summary.html">org.eclipse.emf.cdo.common.admin</a> used by <a href="../../../../../../org/eclipse/emf/cdo/admin/package-summary.html">org.eclipse.emf.cdo.admin</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdmin.html#org.eclipse.emf.cdo.admin">CDOAdmin</a> <div class="block">An administrative interface to a remote server with CDO <a href="../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html" title="interface in org.eclipse.emf.cdo.common"><code>repositories</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdminRepository.html#org.eclipse.emf.cdo.admin">CDOAdminRepository</a> <div class="block">An administrative interface to a remote <a href="../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html" title="interface in org.eclipse.emf.cdo.common"><code>repository</code></a>.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.eclipse.emf.cdo.common.admin"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../org/eclipse/emf/cdo/common/admin/package-summary.html">org.eclipse.emf.cdo.common.admin</a> used by <a href="../../../../../../org/eclipse/emf/cdo/common/admin/package-summary.html">org.eclipse.emf.cdo.common.admin</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdmin.html#org.eclipse.emf.cdo.common.admin">CDOAdmin</a> <div class="block">An administrative interface to a remote server with CDO <a href="../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html" title="interface in org.eclipse.emf.cdo.common"><code>repositories</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdminRepository.html#org.eclipse.emf.cdo.common.admin">CDOAdminRepository</a> <div class="block">An administrative interface to a remote <a href="../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html" title="interface in org.eclipse.emf.cdo.common"><code>repository</code></a>.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.eclipse.emf.cdo.spi.common.admin"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../org/eclipse/emf/cdo/common/admin/package-summary.html">org.eclipse.emf.cdo.common.admin</a> used by <a href="../../../../../../org/eclipse/emf/cdo/spi/common/admin/package-summary.html">org.eclipse.emf.cdo.spi.common.admin</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdmin.html#org.eclipse.emf.cdo.spi.common.admin">CDOAdmin</a> <div class="block">An administrative interface to a remote server with CDO <a href="../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html" title="interface in org.eclipse.emf.cdo.common"><code>repositories</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/eclipse/emf/cdo/common/admin/class-use/CDOAdminRepository.html#org.eclipse.emf.cdo.spi.common.admin">CDOAdminRepository</a> <div class="block">An administrative interface to a remote <a href="../../../../../../org/eclipse/emf/cdo/common/CDOCommonRepository.html" title="interface in org.eclipse.emf.cdo.common"><code>repository</code></a>.</div> </td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <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">Use</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>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/eclipse/emf/cdo/common/admin/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;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 ======= --> <p class="legalCopy"><small><i>Copyright (c) 2011-2015 Eike Stepper (Berlin, Germany) and others.</i></small></p> </body> </html>
{'content_hash': '8c93c173c927df36696dec6c331ff3bc', 'timestamp': '', 'source': 'github', 'line_count': 221, 'max_line_length': 330, 'avg_line_length': 44.55656108597285, 'alnum_prop': 0.6509596831522291, 'repo_name': 'kribe48/wasp-mbse', 'id': 'fadde866ac62a4737e451d1f307a64d73404c347', 'size': '9847', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'WASP-turtlebot-DSL/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/org.eclipse.osgi/142/0/.cp/javadoc/org/eclipse/emf/cdo/common/admin/package-use.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CMake', 'bytes': '6732'}, {'name': 'CSS', 'bytes': '179891'}, {'name': 'GAP', 'bytes': '163745'}, {'name': 'HTML', 'bytes': '1197667'}, {'name': 'Java', 'bytes': '1369191'}, {'name': 'JavaScript', 'bytes': '1555'}, {'name': 'Python', 'bytes': '11033'}, {'name': 'Roff', 'bytes': '303'}, {'name': 'Xtend', 'bytes': '13981'}]}
<!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 (1.8.0_151) on Sun Mar 17 11:03:31 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>ClusterPassivationStoreConsumer (BOM: * : All 2.4.0.Final API)</title> <meta name="date" content="2019-03-17"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ClusterPassivationStoreConsumer (BOM: * : All 2.4.0.Final API)"; } } catch(err) { } //--> var methods = {"i0":6,"i1":18}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <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="navBarCell1Rev">Class</li> <li><a href="class-use/ClusterPassivationStoreConsumer.html">Use</a></li> <li><a href="package-tree.html">Tree</a></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 class="aboutLanguage">Thorntail API, 2.4.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStore.html" title="class in org.wildfly.swarm.config.ejb3"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreSupplier.html" title="interface in org.wildfly.swarm.config.ejb3"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" target="_top">Frames</a></li> <li><a href="ClusterPassivationStoreConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.wildfly.swarm.config.ejb3</div> <h2 title="Interface ClusterPassivationStoreConsumer" class="title">Interface ClusterPassivationStoreConsumer&lt;T extends <a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStore.html" title="class in org.wildfly.swarm.config.ejb3">ClusterPassivationStore</a>&lt;T&gt;&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">ClusterPassivationStoreConsumer&lt;T extends <a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStore.html" title="class in org.wildfly.swarm.config.ejb3">ClusterPassivationStore</a>&lt;T&gt;&gt;</span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html#accept-T-">accept</a></span>(<a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" title="type parameter in ClusterPassivationStoreConsumer">T</a>&nbsp;value)</code> <div class="block">Configure a pre-constructed instance of ClusterPassivationStore resource</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>default <a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" title="interface in org.wildfly.swarm.config.ejb3">ClusterPassivationStoreConsumer</a>&lt;<a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" title="type parameter in ClusterPassivationStoreConsumer">T</a>&gt;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html#andThen-org.wildfly.swarm.config.ejb3.ClusterPassivationStoreConsumer-">andThen</a></span>(<a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" title="interface in org.wildfly.swarm.config.ejb3">ClusterPassivationStoreConsumer</a>&lt;<a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" title="type parameter in ClusterPassivationStoreConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="accept-org.wildfly.swarm.config.ejb3.ClusterPassivationStore-"> <!-- --> </a><a name="accept-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>accept</h4> <pre>void&nbsp;accept(<a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" title="type parameter in ClusterPassivationStoreConsumer">T</a>&nbsp;value)</pre> <div class="block">Configure a pre-constructed instance of ClusterPassivationStore resource</div> </li> </ul> <a name="andThen-org.wildfly.swarm.config.ejb3.ClusterPassivationStoreConsumer-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>andThen</h4> <pre>default&nbsp;<a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" title="interface in org.wildfly.swarm.config.ejb3">ClusterPassivationStoreConsumer</a>&lt;<a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" title="type parameter in ClusterPassivationStoreConsumer">T</a>&gt;&nbsp;andThen(<a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" title="interface in org.wildfly.swarm.config.ejb3">ClusterPassivationStoreConsumer</a>&lt;<a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" title="type parameter in ClusterPassivationStoreConsumer">T</a>&gt;&nbsp;after)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <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="navBarCell1Rev">Class</li> <li><a href="class-use/ClusterPassivationStoreConsumer.html">Use</a></li> <li><a href="package-tree.html">Tree</a></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 class="aboutLanguage">Thorntail API, 2.4.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStore.html" title="class in org.wildfly.swarm.config.ejb3"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/wildfly/swarm/config/ejb3/ClusterPassivationStoreSupplier.html" title="interface in org.wildfly.swarm.config.ejb3"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html" target="_top">Frames</a></li> <li><a href="ClusterPassivationStoreConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
{'content_hash': '23a40d844598ca106cb55992db8a162b', 'timestamp': '', 'source': 'github', 'line_count': 248, 'max_line_length': 732, 'avg_line_length': 47.068548387096776, 'alnum_prop': 0.6682086867129272, 'repo_name': 'wildfly-swarm/wildfly-swarm-javadocs', 'id': '502b0b4e3260af1ed1411b9f43ef8f2ae16f3149', 'size': '11673', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': '2.4.0.Final/apidocs/org/wildfly/swarm/config/ejb3/ClusterPassivationStoreConsumer.html', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
using System; using NUnit.Framework; using Moq; using Rothko.Model; using Rothko.Commands; using Rothko.Interfaces.Services; using System.Collections.Generic; using Rothko.Enumerators; namespace Rothko.Tests.Commands { [TestFixture] public class AttackCommandTests { Mock<IRandomNumberGeneratorService> _RandomNumberGeneratorServiceMock; IRandomNumberGeneratorService _RandomNumberGeneratorService; Unit _AttackingUnit; Unit _DefendingUnit; Unit _CarriedUnit; Tile _AttackingUnitTile; Tile _DefendingUnitTile; DefenseMultiplier _DefenseMultiplierDefendingUnit; AttackMultiplier _AttackMultiplier; List<Tile> _Tiles; List<DefenseMultiplier> _DefenseMultipliers; List<AttackMultiplier> _AttackMultipliers; Map _Map; AttackCommand _Command; [SetUp] public void SetUp() { _RandomNumberGeneratorServiceMock = new Mock<IRandomNumberGeneratorService>(); _RandomNumberGeneratorService = _RandomNumberGeneratorServiceMock.Object; _AttackingUnit = new Unit() { ID = 1, IDUnitType = 1, HealthPoints = 10, X = 1, Y = 1, State = UnitState.Attacking }; _DefendingUnit = new Unit() { ID = 2, IDUnitType = 2, HealthPoints = 10, X = 2, Y = 1, NumberOfUnitsBeingCarried = 1, NumberOfUnitsThatCanBeCarried = 1 }; _CarriedUnit = new Unit() { ID = 3, HealthPoints = 10, IDUnitCarrier = _DefendingUnit.ID }; _AttackingUnitTile = new Tile() { ID = 1, IDTileType = 1, X = _AttackingUnit.X, Y = _AttackingUnit.Y }; _DefendingUnitTile = new Tile() { ID = 2, IDTileType = 2, X = _DefendingUnit.X, Y = _DefendingUnit.Y }; _AttackMultiplier = new AttackMultiplier() { AttackingUnitIDUnitType = _AttackingUnit.IDUnitType, DefendingUnitIDUnitType = _DefendingUnit.IDUnitType }; _DefenseMultiplierDefendingUnit = new DefenseMultiplier() { IDTileType = 2, IDUnitType = 2 }; _Tiles = new List<Tile>(); _Tiles.Add (_AttackingUnitTile); _Tiles.Add (_DefendingUnitTile); _Map = new Map(); _Map.Units.Add (_AttackingUnit); _Map.Units.Add (_DefendingUnit); _Map.Units.Add (_CarriedUnit); _Map.Tiles = _Tiles; _Map.IDUnit_Selected = 1; _DefenseMultipliers = new List<DefenseMultiplier>(); _DefenseMultipliers.Add (_DefenseMultiplierDefendingUnit); _AttackMultipliers = new List<AttackMultiplier>(); _AttackMultipliers.Add (_AttackMultiplier); _Command = new AttackCommand( _RandomNumberGeneratorService, _Map, _Map.Units, _Tiles, _AttackMultipliers, _DefenseMultipliers, _DefendingUnit.X, _DefendingUnit.Y); } [Test] [TestCase(5, 10, 1, 1, 1, 5, 10, Result = 1)] [TestCase(5, 10, 1, 1, 1, 4, 10, Result = 1)] [TestCase(5, 10, 1, 1, 1, 3, 10, Result = 2)] [TestCase(5, 10, 1, 1, 1, 2, 10, Result = 3)] [TestCase(5, 10, 1, 1, 1, 1, 10, Result = 5)] [TestCase(1, 10, 1, 1, 1, 5, 10, Result = 0)] [TestCase(2, 10, 1, 1, 1, 5, 10, Result = 0)] [TestCase(3, 10, 1, 1, 1, 5, 10, Result = 1)] [TestCase(4, 10, 1, 1, 1, 5, 10, Result = 1)] [TestCase(5, 9, 1, 1, 1, 5, 10, Result = 1)] [TestCase(5, 8, 1, 1, 1, 5, 10, Result = 1)] [TestCase(5, 7, 1, 1, 1, 5, 10, Result = 1)] [TestCase(5, 6, 1, 1, 1, 5, 10, Result = 1)] [TestCase(5, 5, 1, 1, 1, 5, 10, Result = 1)] [TestCase(5, 4, 1, 1, 1, 5, 10, Result = 0)] [TestCase(5, 3, 1, 1, 1, 5, 10, Result = 0)] [TestCase(5, 2, 1, 1, 1, 5, 10, Result = 0)] [TestCase(5, 1, 1, 1, 1, 5, 10, Result = 0)] [TestCase(5, 10, 1.5, 1, 1, 5, 10, Result = 2)] [TestCase(5, 10, 1.5, 1, 1, 4, 10, Result = 2)] [TestCase(5, 10, 1.5, 1, 1, 3, 10, Result = 3)] [TestCase(5, 10, 1.5, 1, 1, 2, 10, Result = 4)] [TestCase(5, 10, 1.5, 1, 1, 1, 10, Result = 8)] public int TestDefendingUnitHealthPointsAfterAttack( int attackingUnitAttackPoints, int attackingUnitHealthPoints, decimal attackingMultiplier, decimal terrainDefenseMultiplier, decimal luckMultiplier, int defendingUnitDefensePoints, int defendingUnitHealthPoints) { _AttackingUnit.AttackPoints = attackingUnitAttackPoints; _AttackingUnit.HealthPoints = attackingUnitHealthPoints; _AttackMultiplier.Multiplier = attackingMultiplier; _DefenseMultiplierDefendingUnit.Multiplier = terrainDefenseMultiplier; _DefendingUnit.DefensePoints = defendingUnitDefensePoints; _DefendingUnit.HealthPoints = defendingUnitHealthPoints; _RandomNumberGeneratorServiceMock .Setup(r => r.GetRandomNumber(It.IsAny<int>(), It.IsAny<int>())) .Returns((int)(luckMultiplier * 100)); _Command.Execute(); return defendingUnitHealthPoints - _DefendingUnit.HealthPoints; } [Test] public void IfUnitBeingAttackedGetsKilledAndIsCarryingOtherUnitsThoseUnitsShouldAlsoBeKilled() { SetUpKillingAttackCommand(); _Command.Execute(); Assert.IsTrue(_DefendingUnit.HealthPoints <= 0); Assert.AreEqual(0, _CarriedUnit.HealthPoints); Assert.AreEqual(UnitState.Destroyed, _CarriedUnit.State); } [Test] public void IfUnitGetsHealthBellowZeroShouldHaveItsStateChangedToBeingDestroyed() { SetUpKillingAttackCommand(); _Command.Execute(); Assert.AreEqual(UnitState.BeingDestroyed, _DefendingUnit.State); } [Test] public void ExecuteCommandShouldSetAttackingUnitStateToIdle () { SetUpKillingAttackCommand(); _Command.Execute(); Assert.AreEqual(UnitState.Idle, _AttackingUnit.State); } private void SetUpKillingAttackCommand() { _AttackingUnit.AttackPoints = 9999; _AttackingUnit.HealthPoints = 9999; _AttackMultiplier.Multiplier = 1; _DefenseMultiplierDefendingUnit.Multiplier = 1; _DefendingUnit.DefensePoints = 1; _DefendingUnit.HealthPoints = 1; _RandomNumberGeneratorServiceMock .Setup(r => r.GetRandomNumber(It.IsAny<int>(), It.IsAny<int>())) .Returns(100); } [Test] public void ExecuteCommandShouldSetGameStateToIdle() { SetUpKillingAttackCommand(); _Map.GameState = GameState.UnitAttacking; _Command.Execute(); Assert.AreEqual(GameState.Idle, _Map.GameState); } [Test] public void UnitsBeingCarriedShouldNotBeSelectedAsDefendingUnit() { SetUpKillingAttackCommand(); _Map.Units.Remove (_DefendingUnit); _Map.Units.Add (_DefendingUnit); _CarriedUnit.X = _DefendingUnit.X; _CarriedUnit.Y = _DefendingUnit.Y; _Command.Execute(); Assert.IsFalse(_DefendingUnit.Active); } } }
{'content_hash': '6d4e799356a3df83d65f3e57e5f0f516', 'timestamp': '', 'source': 'github', 'line_count': 245, 'max_line_length': 96, 'avg_line_length': 26.30204081632653, 'alnum_prop': 0.6814090626939789, 'repo_name': 't-recx/Rothko', 'id': 'f0f3e6bdeb1854fb44abdbad2b1ed45de4c80b69', 'size': '6444', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Rothko.Tests/Commands/AttackCommandTests.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '832326'}]}
using DragonSpark.Text; using Markdig; using Markdig.Renderers; using SmartFormat; using System.IO; using System.Text; namespace DragonSpark.Application.Messaging; public class MarkdownEmailTemplate<T> : IFormatter<T> where T : notnull { readonly string _template; protected MarkdownEmailTemplate(byte[] data) : this(Encoding.UTF8.GetString(data)) {} protected MarkdownEmailTemplate(string template) => _template = template; public string Get(T parameter) { var content = Smart.Format(_template, parameter); var pipeline = new MarkdownPipelineBuilder().Build(); var markdown = Markdown.Parse(content, pipeline); using var writer = new StringWriter(); var renderer = new HtmlRenderer(writer); pipeline.Setup(renderer); renderer.Render(markdown); var result = writer.ToString(); return result; } }
{'content_hash': 'a90e8fffaeade1285e68fb308a0a7eee', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 86, 'avg_line_length': 26.6875, 'alnum_prop': 0.7330210772833724, 'repo_name': 'DragonSpark/Framework', 'id': '7d2a367e52dc451c643279466c2677a8a03c0455', 'size': '856', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'DragonSpark.Application/Messaging/MarkdownEmailTemplate.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '2079497'}, {'name': 'CSS', 'bytes': '673'}, {'name': 'HTML', 'bytes': '103546'}, {'name': 'JavaScript', 'bytes': '1311'}, {'name': 'TypeScript', 'bytes': '2495'}]}
/* @flow */ import React from 'react'; import Icon from 'mineral-ui/Icon'; import type { IconProps } from 'mineral-ui/Icon/types'; /* eslint-disable prettier/prettier */ export default function IconTrendingFlat(props: IconProps) { const iconProps = { rtl: true, ...props }; return ( <Icon {...iconProps}> <g> <path d="M22 12l-4-4v3H3v2h15v3z"/> </g> </Icon> ); } IconTrendingFlat.displayName = 'IconTrendingFlat'; IconTrendingFlat.category = 'action';
{'content_hash': '604ed3a973322110cb450160ad49f68d', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 60, 'avg_line_length': 20.833333333333332, 'alnum_prop': 0.642, 'repo_name': 'mineral-ui/mineral-ui', 'id': '13fda35f9455c000ba3c83ee973168843dcaf16d', 'size': '500', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'packages/mineral-ui-icons/src/IconTrendingFlat.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '9584'}, {'name': 'HTML', 'bytes': '6548'}, {'name': 'JavaScript', 'bytes': '2408689'}]}
package centreon::common::emc::navisphere::mode::faults; use base qw(centreon::plugins::mode); use strict; use warnings; sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; $options{options}->add_options(arguments => { }); return $self; } sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); } sub run { my ($self, %options) = @_; my $clariion = $options{custom}; my $response = $clariion->execute_command(cmd => 'faults -list', secure_only => 1); chomp $response; if ($response =~ /The array is operating normally/msg) { $self->{output}->output_add(severity => 'ok', short_msg => 'The array is operating normally'); } else { $self->{output}->output_add(long_msg => $response); $self->{output}->output_add(severity => 'critical', short_msg => 'Problem detected (see detailed output for more details'); } $self->{output}->display(); $self->{output}->exit(); } 1; __END__ =head1 MODE Detect faults on the array. =over 8 =back =cut
{'content_hash': '10a72fe84164bebf091b4d7bd81810c1', 'timestamp': '', 'source': 'github', 'line_count': 57, 'max_line_length': 107, 'avg_line_length': 22.50877192982456, 'alnum_prop': 0.5276695245518317, 'repo_name': 'centreon/centreon-plugins', 'id': 'c82a0c097bb01cc0e6f09fb6bcb4c57221adacab', 'size': '2043', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'centreon/common/emc/navisphere/mode/faults.pm', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '719'}, {'name': 'Perl', 'bytes': '21731182'}]}
ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Opegrapha urosperma var. substellata Redinger ### Remarks null
{'content_hash': '37112b011a3115e21bd00371621d378e', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 45, 'avg_line_length': 11.538461538461538, 'alnum_prop': 0.7333333333333333, 'repo_name': 'mdoering/backbone', 'id': '1c839667d5252f95ecd899d67bf20cbdafd4c512', 'size': '219', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Fungi/Ascomycota/Arthoniomycetes/Arthoniales/Roccellaceae/Opegrapha/Opegrapha urosperma/Opegrapha urosperma substellata/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
var autoSignIn = function(mode) { if (cmapiAvailable) { return navigator.credentials.get({ // TODO 8-4: Reflect a silent access password: true }).then(function(cred) { if (cred) { var form = new FormData(); var csrf_token = document.querySelector('#csrf_token').value; form.append('csrf_token', csrf_token); switch (cred.type) { case 'password': form.append('email', cred.id); form.append('password', cred.password); return fetch('/auth/password', { method: 'POST', credentials: 'include', body: form }); } return Promise.reject(); } else { return Promise.reject(); } }).then(function(res) { if (res.status === 200) { return Promise.resolve(); } else { return Promise.reject(); } }); } else { return Promise.reject(); } }; // TODO 7-1: Sign-In a user upon landing the page
{'content_hash': '7de7adefe33127422255c46659aa8c8c', 'timestamp': '', 'source': 'github', 'line_count': 37, 'max_line_length': 69, 'avg_line_length': 27.56756756756757, 'alnum_prop': 0.5205882352941177, 'repo_name': 'googlecodelabs/credential-management-api', 'id': '56766ba8e89debefc7bb9ccff55fccb65acec421', 'size': '1020', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'step06/static/scripts/auto.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '5384419'}, {'name': 'JavaScript', 'bytes': '47506'}, {'name': 'Python', 'bytes': '59500'}]}
// Copyright 2016-2022, University of Colorado Boulder /** * Property whose value must be true or false. Truthy/falsy values are invalid. * * @author Sam Reid (PhET Interactive Simulations) * @author Chris Malley (PixelZoom, Inc.) */ import optionize, { EmptySelfOptions } from '../../phet-core/js/optionize.js'; import StrictOmit from '../../phet-core/js/types/StrictOmit.js'; import BooleanIO from '../../tandem/js/types/BooleanIO.js'; import axon from './axon.js'; import Property, { PropertyOptions } from './Property.js'; type SelfOptions = EmptySelfOptions; // client cannot specify superclass options that are controlled by BooleanProperty export type BooleanPropertyOptions = SelfOptions & StrictOmit<PropertyOptions<boolean>, 'isValidValue' | 'valueType' | 'phetioValueType'>; export default class BooleanProperty extends Property<boolean> { public constructor( value: boolean, providedOptions?: BooleanPropertyOptions ) { // Fill in superclass options that are controlled by BooleanProperty. const options = optionize<BooleanPropertyOptions, SelfOptions, PropertyOptions<boolean>>()( { valueType: 'boolean', phetioValueType: BooleanIO }, providedOptions ); super( value, options ); } public toggle(): void { this.value = !this.value; } } axon.register( 'BooleanProperty', BooleanProperty );
{'content_hash': 'e8a23d1cddb84f274fec18ffa493257c', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 138, 'avg_line_length': 34.743589743589745, 'alnum_prop': 0.7357933579335794, 'repo_name': 'phetsims/axon', 'id': 'bdb01e38dcb468ddb5fc90c93960c53ce807de2a', 'size': '1355', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'js/BooleanProperty.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '4146'}, {'name': 'JavaScript', 'bytes': '22970'}, {'name': 'TypeScript', 'bytes': '329832'}]}
FROM balenalib/jetson-nano-fedora:33-build ENV NODE_VERSION 15.14.0 ENV YARN_VERSION 1.22.4 RUN for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-arm64.tar.gz" \ && echo "6d5e0074fe4a45d444bc581aa1fd7ce7081b8491b0f785414a6e5cc30c42854a node-v$NODE_VERSION-linux-arm64.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-arm64.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-arm64.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/[email protected]" \ && echo "Running test-stack@node" \ && chmod +x [email protected] \ && bash [email protected] \ && rm -rf [email protected] RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Fedora 33 \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v15.14.0, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{'content_hash': 'eb72559500ecf971f1c4e10f93954ff3', 'timestamp': '', 'source': 'github', 'line_count': 41, 'max_line_length': 691, 'avg_line_length': 66.65853658536585, 'alnum_prop': 0.7083790706183681, 'repo_name': 'nghiant2710/base-images', 'id': '8bf87e3dd50f9b2e6725744ad4056b6ff0cc30cf', 'size': '2754', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'balena-base-images/node/jetson-nano/fedora/33/15.14.0/build/Dockerfile', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '144558581'}, {'name': 'JavaScript', 'bytes': '16316'}, {'name': 'Shell', 'bytes': '368690'}]}
#include <windows.h> #include "iup.h" #include "iup_object.h" #include "iup_attrib.h" #include "iup_str.h" #include "iup_dialog.h" #include "iup_drv.h" #include "iupwin_drv.h" #include "iupwin_str.h" static void winMessageDlgHelpCallback(HELPINFO* HelpInfo) { Ihandle* ih = (Ihandle*)HelpInfo->dwContextId; Icallback cb = (Icallback)IupGetCallback(ih, "HELP_CB"); if (cb && cb(ih) == IUP_CLOSE) { if (iupStrEqualNoCase(iupAttribGetStr(ih, "BUTTONS"), "OK")) /* only one button */ EndDialog((HWND)HelpInfo->hItemHandle, IDOK); else EndDialog((HWND)HelpInfo->hItemHandle, IDCANCEL); } } static int winMessageDlgPopup(Ihandle* ih, int x, int y) { InativeHandle* parent = iupDialogGetNativeParent(ih); int result, num_but = 2; DWORD dwStyle = MB_TASKMODAL; char *icon, *buttons; (void)x; (void)y; /* if parent is used then it will be modal only relative to it */ /* if (!parent) parent = GetActiveWindow(); */ icon = iupAttribGetStr(ih, "DIALOGTYPE"); if (iupStrEqualNoCase(icon, "ERROR")) dwStyle |= MB_ICONERROR; else if (iupStrEqualNoCase(icon, "WARNING")) dwStyle |= MB_ICONWARNING; else if (iupStrEqualNoCase(icon, "INFORMATION")) dwStyle |= MB_ICONINFORMATION; else if (iupStrEqualNoCase(icon, "QUESTION")) dwStyle |= MB_ICONQUESTION; buttons = iupAttribGetStr(ih, "BUTTONS"); if (iupStrEqualNoCase(buttons, "OKCANCEL")) dwStyle |= MB_OKCANCEL; else if (iupStrEqualNoCase(buttons, "YESNO")) dwStyle |= MB_YESNO; else { dwStyle |= MB_OK; num_but = 1; } if (IupGetCallback(ih, "HELP_CB")) dwStyle |= MB_HELP; if (num_but == 2 && iupAttribGetInt(ih, "BUTTONDEFAULT") == 2) dwStyle |= MB_DEFBUTTON2; else dwStyle |= MB_DEFBUTTON1; { MSGBOXPARAMS MsgBoxParams; MsgBoxParams.cbSize = sizeof(MSGBOXPARAMS); MsgBoxParams.hwndOwner = parent; MsgBoxParams.hInstance = NULL; MsgBoxParams.lpszText = iupwinStrToSystem(iupAttribGet(ih, "VALUE")); MsgBoxParams.lpszCaption = iupwinStrToSystem(iupAttribGet(ih, "TITLE")); MsgBoxParams.dwStyle = dwStyle; MsgBoxParams.lpszIcon = NULL; MsgBoxParams.dwContextHelpId = (DWORD_PTR)ih; MsgBoxParams.lpfnMsgBoxCallback = (MSGBOXCALLBACK)winMessageDlgHelpCallback; MsgBoxParams.dwLanguageId = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT); result = MessageBoxIndirect(&MsgBoxParams); } if (result == 0) { iupAttribSet(ih, "BUTTONRESPONSE", NULL); return IUP_ERROR; } if (result == IDNO || result == IDCANCEL) iupAttribSet(ih, "BUTTONRESPONSE", "2"); else iupAttribSet(ih, "BUTTONRESPONSE", "1"); return IUP_NOERROR; } void iupdrvMessageDlgInitClass(Iclass* ic) { ic->DlgPopup = winMessageDlgPopup; } /* In Windows it will always sound a beep. The beep is different for each dialog type. */
{'content_hash': 'cc08d3cb78c48be79fdb4b402c86c4d8', 'timestamp': '', 'source': 'github', 'line_count': 109, 'max_line_length': 86, 'avg_line_length': 26.08256880733945, 'alnum_prop': 0.6820260288427717, 'repo_name': 'sanikoyes/iup', 'id': '3090312abfb4d6ad094d86fad44862978fc88022', 'size': '2945', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/win/iupwin_messagedlg.c', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '34'}, {'name': 'Batchfile', 'bytes': '10717'}, {'name': 'C', 'bytes': '9868012'}, {'name': 'C++', 'bytes': '6978963'}, {'name': 'CSS', 'bytes': '14107'}, {'name': 'HTML', 'bytes': '2240422'}, {'name': 'Lua', 'bytes': '682394'}, {'name': 'Makefile', 'bytes': '139721'}, {'name': 'Shell', 'bytes': '12420'}]}
Sync Facebook Events Calendar to Google Calendar. For Facebook and Google Calendar users Who want to be super organised and not miss out on events or double book themselves FacebookGoogleCalendarSync Is a gem That imports Facebook events into Google Calendar. Unlike the existing "import the iCal URL provided by Facebook" solution This gem allows the user to delete events that they are not interested in without going to Facebook to click "Not Going", While also allowing synchronisation to be reliably and regularly scheduled* using cron or similar. It also displays the details of the "private" Facebook events which would otherwise be hidden by Google Calendar. *Google Calendar updates external calendars at unpredictable times, far too rarely (often more than 24 hours between updates) and doesn't allow manual refreshes. It also doesn't notify you when it has been unable to update your calendar, so you don't know when you're looking at an out of date version. ## Installation $ gem install facebook-google-calendar-sync Create a Goggle permissions file to allow the gem to access your Google Calendar. This command will open a browser window. (Have found this did not work in jruby, tested succesfully in MRI ruby-1.9.3-p392) $ bundle exec google-api oauth-2-login --scope=https://www.googleapis.com/auth/calendar --client-id=436161995365.apps.googleusercontent.com --client-secret=WgTEjg-b8rXCRL28hweLcSuV You will now have a .google-api.yaml file in your home directory. Note: the gem can only access your calendar data if it has this file. The synchronisation process will run locally on your computer - no external service will have access to your Google Calendar. For more information on the last step see https://developers.google.com/google-apps/calendar/firstapp#register and the Ruby tab on https://developers.google.com/google-apps/calendar/instantiate ## Usage You can find your Facebook iCal URL by going to your Events page, and clicking the cog icon and selecting Export. Copy the URL from the "upcoming events" link, and change the "webcal://" prefix to "http://". To run: $ bundle exec facebook-google-calendar-sync -f "http://www.facebook.com/ical/u.php?uid=12345&key=67890" If your Google API YAML file isn't stored at ~/.google-api.yaml, you can specify the location using the command line option "-c" By default, your events will be synchronised to a calendar called "My Facebook Events". If this does not exist, it will be created using the timezone of your primary calendar. You can specify the name of the calendar (which may be a pre-existing one) using the command line option "-n" ## Long term usage You will probably want to set this up as a cron job or similar. See the examples directory for more information. ## Known issues When a Facebook event does not have a location, the time in the iCal export will be up to 2 days ahead of the actual date displayed in Facebook. This behaviour can also be observed in the Android mobile client. This may be because the timezone is incorrectly set when there is no location. If a Facebook event has synchronised to your Google calendar then deleted, if the synchronisation process attempts (incorrectly) to add it again, Google Calendar will throw an exception saying that an event with this identifier already exists. ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request ## TODO * Tests.... * Work out if there is a way to fix the event date when there is no location.
{'content_hash': 'ceb8b37f67696d23c8179c5f440009d2', 'timestamp': '', 'source': 'github', 'line_count': 68, 'max_line_length': 302, 'avg_line_length': 54.0735294117647, 'alnum_prop': 0.7813434865379385, 'repo_name': 'bethesque/facebook-google-calendar-sync', 'id': '13e25798c6504df93563fb1cbab6e02899efb3d9', 'size': '3707', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '21511'}]}
<img src="https://mir-cdn.behance.net/v1/rendition/project_modules/1400/49ea4a53385057.59325596f150b.jpg" width="420"> ## Agivest Agivest is a populous investment platform with a Crowd Investment system that allows everyone to invest from a hundred thousand rupiah. ``` Select the comodities you want invest Input nominal invest Transfer Money ``` ## Architecture MVC (Model View Controller) - Code Igniter ## Library Used - Admin LTE ## Running - Clone this repository - Activate your xamp / wamp - Open your browser and type localhost/agivest ## Preview check website : -
{'content_hash': '3f573c569132827bbb5e554a793c0432', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 135, 'avg_line_length': 26.318181818181817, 'alnum_prop': 0.768566493955095, 'repo_name': 'kahell/agivest', 'id': 'c3fbb88080027a0368cab380375da7c762891627', 'size': '589', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '808277'}, {'name': 'HTML', 'bytes': '12170319'}, {'name': 'JavaScript', 'bytes': '2243760'}, {'name': 'PHP', 'bytes': '2923840'}, {'name': 'Shell', 'bytes': '4440'}]}
using namespace std; MiddleEarSimpleFilter::MiddleEarSimpleFilter() { memset(this, 0, sizeof(MiddleEarSimpleFilter)); mLogger = new Logger(); SetModuleName("MiddleEarSimpleFilter"); } MiddleEarSimpleFilter::~MiddleEarSimpleFilter() { if (mModuleName != NULL) delete [] mModuleName; } int MiddleEarSimpleFilter::ReadParameters(char *ParameterFileName) { if (mModuleName == NULL) return ReadParameters(ParameterFileName, "MiddleEarSimpleFilter"); else return ReadParameters(ParameterFileName, mModuleName); } int MiddleEarSimpleFilter::ReadParameters(char *ParameterFileName, char *SectionName) { CParameterFile theParamFile(ParameterFileName); ParameterStatus Status; mLogger->Log(" ReadParameters: %s \"%s\"", mModuleName, ParameterFileName); // Number of channels and Frame Size are passed as parameters to Start, see that function for details Status = theParamFile.GetParameter(SectionName, "SampleRate_Hz", mSampleRate_Hz, 0); Status = theParamFile.GetParameter(SectionName, "HighpassCornerFreq_Hz", mHighpassCornerFreq_Hz, 500.0); Status = theParamFile.GetParameter(SectionName, "HighpassFilterOrder", mHighpassFilterOrder, 2); Status = theParamFile.GetParameter(SectionName, "Gain", mGain, 30.0); return 1; } int MiddleEarSimpleFilter::Start(int NumInputs, EarlabDataStreamType InputTypes[EarlabMaxIOStreamCount], int InputSize[EarlabMaxIOStreamCount][EarlabMaxIOStreamDimensions], int NumOutputs, EarlabDataStreamType OutputTypes[EarlabMaxIOStreamCount], int OutputSize[EarlabMaxIOStreamCount][EarlabMaxIOStreamDimensions], unsigned long OutputElementCounts[EarlabMaxIOStreamCount]) { int i; mLogger->Log(" Start: %s", mModuleName); // Perform some validation on my parameters to make sure I can handle the requested input and output streams... if (NumInputs != 1) throw EarlabException("%s: Currently this module can only handle one input stream. Sorry!", mModuleName); if (NumOutputs != 1) throw EarlabException("%s: Currently this module can only handle one output stream. Sorry!", mModuleName); if (InputTypes[0] != WaveformData) throw EarlabException("%s: Currently this module can only handle waveform input data streams. Sorry!", mModuleName); if (OutputTypes[0] != WaveformData) throw EarlabException("%s: Currently this module can only handle waveform output data streams. Sorry!", mModuleName); if (InputSize[0][0] != OutputSize[0][0]) throw EarlabException("%s: Input and output frame lengths must be identical. Sorry!", mModuleName); if (InputSize[0][1] != 0) throw EarlabException("%s: Input data must be one-dimensional array. Sorry!", mModuleName); if (OutputSize[0][1] != 0) throw EarlabException("%s: Output signal must be one-dimensional array. Sorry!", mModuleName); OutputElementCounts[0] = OutputSize[0][0]; mFrameSize_Samples = OutputSize[0][0]; mHighpassFilter = new FirstOrderHighpass[mHighpassFilterOrder]; for (i = 0; i < mHighpassFilterOrder; i++) { mHighpassFilter[i].SetSampleRate_Hz(mSampleRate_Hz); mHighpassFilter[i].SetCornerFrequency_Hz(mHighpassCornerFreq_Hz); } return 1; } int MiddleEarSimpleFilter::Advance(EarlabDataStream *InputStream[EarlabMaxIOStreamCount], EarlabDataStream *OutputStream[EarlabMaxIOStreamCount]) { int i, j; double CurSample; FloatMatrixN *Input, *Output; mLogger->Log(" Advance: %s", mModuleName); Input = ((EarlabWaveformStream *)InputStream[0])->GetData(); // Only supporting one output at the present moment Output = ((EarlabWaveformStream *)OutputStream[0])->GetData(); // Only supporting one output at the present moment if (Input->Rank(0) != mFrameSize_Samples) throw EarlabException("%s: Input size mismatch with Start()", mModuleName); if (Output->Rank(0) != mFrameSize_Samples) throw EarlabException("%s: Output size mismatch with Start()", mModuleName); for (j = 0; j < mFrameSize_Samples; j++) { CurSample = Input->Data(j); for (i = 0; i < mHighpassFilterOrder; i++) CurSample = mHighpassFilter[i].Filter(CurSample); Output->Data(j) = (float)(CurSample * mGain); } return j; } int MiddleEarSimpleFilter::Stop(void) { mLogger->Log(" Stop: %s", mModuleName); return 1; } int MiddleEarSimpleFilter::Unload(void) { mLogger->Log(" Unload: %s", mModuleName); return 1; } void MiddleEarSimpleFilter::SetModuleName(char *ModuleName) { if (mModuleName != NULL) delete [] mModuleName; mModuleName = new char[strlen(ModuleName) + 1]; strcpy(mModuleName, ModuleName); } void MiddleEarSimpleFilter::SetLogger(Logger *TheLogger) { if (mLogger != NULL) delete mLogger; mLogger = TheLogger; }
{'content_hash': 'e243bbabd83dae712c3addf03d058f57', 'timestamp': '', 'source': 'github', 'line_count': 134, 'max_line_length': 175, 'avg_line_length': 35.54477611940298, 'alnum_prop': 0.726222968717195, 'repo_name': 'AuditoryBiophysicsLab/EarLab', 'id': 'c9b235585df0551e3d40148cbbb708f0924894e5', 'size': '4992', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tags/release-2.0/Modules/MiddleEarSimpleFilter/MiddleEarSimpleFilter.cpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '2897'}, {'name': 'C', 'bytes': '2948189'}, {'name': 'C#', 'bytes': '2669637'}, {'name': 'C++', 'bytes': '13833969'}, {'name': 'HTML', 'bytes': '100731'}, {'name': 'Inno Setup', 'bytes': '76845'}, {'name': 'MATLAB', 'bytes': '155995'}, {'name': 'Makefile', 'bytes': '414201'}]}
#ifndef msvolume_h #define msvolume_h #include "msfilter.h" /** * The Volume MSFilter can do: * - measurements of the input signal power, returned in dbm0 or linear scale * - apply a gain to the input signal and output this amplified signal to its output. * By default gain is 1, in which case the filter does not modify the signal (and even does not * copy the buffers, just post them on its output queue. **/ /*returns a volume meter in db0 (max=0 db0)*/ #define MS_VOLUME_GET MS_FILTER_METHOD(MS_VOLUME_ID,0,float) /*returns a volume in linear scale between 0 and 1 */ #define MS_VOLUME_GET_LINEAR MS_FILTER_METHOD(MS_VOLUME_ID,1,float) /* set a gain */ #define MS_VOLUME_SET_GAIN MS_FILTER_METHOD(MS_VOLUME_ID,2,float) #define MS_VOLUME_GET_EA_STATE MS_FILTER_METHOD(MS_VOLUME_ID,3, int) #define MS_VOLUME_SET_PEER MS_FILTER_METHOD(MS_VOLUME_ID,4, MSFilter ) #define MS_VOLUME_SET_EA_THRESHOLD MS_FILTER_METHOD(MS_VOLUME_ID,5,float) #define MS_VOLUME_SET_EA_SPEED MS_FILTER_METHOD(MS_VOLUME_ID,6,float) #define MS_VOLUME_SET_EA_FORCE MS_FILTER_METHOD(MS_VOLUME_ID,7,float) #define MS_VOLUME_ENABLE_AGC MS_FILTER_METHOD(MS_VOLUME_ID,8,int) #define MS_VOLUME_ENABLE_NOISE_GATE MS_FILTER_METHOD(MS_VOLUME_ID,9,int) #define MS_VOLUME_SET_NOISE_GATE_THRESHOLD MS_FILTER_METHOD(MS_VOLUME_ID,10,float) #define MS_VOLUME_SET_EA_SUSTAIN MS_FILTER_METHOD(MS_VOLUME_ID,11,int) #define MS_VOLUME_SET_NOISE_GATE_FLOORGAIN MS_FILTER_METHOD(MS_VOLUME_ID,12,float) /* set a gain in db */ #define MS_VOLUME_SET_DB_GAIN MS_FILTER_METHOD(MS_VOLUME_ID,13,float) /* get a linear gain */ #define MS_VOLUME_GET_GAIN MS_FILTER_METHOD(MS_VOLUME_ID,14,float) extern MSFilterDesc ms_volume_desc; #endif
{'content_hash': 'fdbb7dd4986ee23e8f5ece23b3b04bb1', 'timestamp': '', 'source': 'github', 'line_count': 52, 'max_line_length': 95, 'avg_line_length': 33.01923076923077, 'alnum_prop': 0.7396622015142691, 'repo_name': 'Huawei/eSDK_eLTE_SDK_Windows', 'id': 'da20da48627d51b0867b95decaadb9f1e67e4c15', 'size': '2536', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/platform/SDK/include/mediastreamer2/include/mediastreamer2/msvolume.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '45600'}, {'name': 'C', 'bytes': '1941730'}, {'name': 'C++', 'bytes': '9810262'}, {'name': 'CMake', 'bytes': '3613'}, {'name': 'Makefile', 'bytes': '209539'}, {'name': 'Objective-C', 'bytes': '250083'}, {'name': 'Protocol Buffer', 'bytes': '9363'}]}
#ifndef __RenderTargetListener_H__ #define __RenderTargetListener_H__ #include "OgrePrerequisites.h" namespace Ogre { /** \addtogroup Core * @{ */ /** \addtogroup RenderSystem * @{ */ /** Struct containing information about a RenderTarget event. */ struct RenderTargetEvent { /// The source of the event being raised RenderTarget* source; }; /** Struct containing information about a RenderTarget Viewport-specific event. */ struct RenderTargetViewportEvent { /// The source of the event being raised Viewport* source; }; /** A interface class defining a listener which can be used to receive notifications of RenderTarget events. @remarks A 'listener' is an interface designed to be called back when particular events are called. This class defines the interface relating to RenderTarget events. In order to receive notifications of RenderTarget events, you should create a subclass of RenderTargetListener and override the methods for which you would like to customise the resulting processing. You should then call RenderTarget::addListener passing an instance of this class. There is no limit to the number of RenderTarget listeners you can register, allowing you to register multiple listeners for different purposes. </p> RenderTarget events occur before and after the target is updated as a whole, and before and after each viewport on that target is updated. Each RenderTarget holds it's own set of listeners, but you can register the same listener on multiple render targets if you like since the event contains details of the originating RenderTarget. */ class _OgreExport RenderTargetListener { /* Note that this could have been an abstract class, but I made the explicit choice not to do this, because I wanted to give people the option of only implementing the methods they wanted, rather than having to create 'do nothing' implementations for those they weren't interested in. As such this class follows the 'Adapter' classes in Java rather than pure interfaces. */ public: virtual ~RenderTargetListener() {} /** Called just before a RenderTarget is about to be rendered into. @remarks This event is raised just before any of the viewports on the target are rendered to. You can perform manual rendering operations here if you want, but please note that if the Viewport objects attached to this target are set up to clear the background, you will lose whatever you render. If you want some kind of backdrop in this event you should turn off background clearing off on the viewports, and either clear the viewports yourself in this event handler before doing your rendering or just render over the top if you don't need to. */ virtual void preRenderTargetUpdate(const RenderTargetEvent& evt) { (void)evt; } /** Called just after a RenderTarget has been rendered to. @remarks This event is called just after all the viewports attached to the target in question have been rendered to. You can perform your own manual rendering commands in this event handler if you like, these will be composited with the contents of the target already there (depending on the material settings you use etc). */ virtual void postRenderTargetUpdate(const RenderTargetEvent& evt) { (void)evt; } /* Called just before a Viewport on a RenderTarget is to be updated. @remarks This method is called before each viewport on the RenderTarget is rendered to. You can use this to perform per-viewport settings changes, such as showing / hiding particular overlays. */ virtual void preViewportUpdate(const RenderTargetViewportEvent& evt) { (void)evt; } /* Called just after a Viewport on a RenderTarget is to be updated. @remarks This method is called after each viewport on the RenderTarget is rendered to. */ virtual void postViewportUpdate(const RenderTargetViewportEvent& evt) { (void)evt; } /** Called to notify listener that a Viewport has been added to the target in question. */ virtual void viewportAdded(const RenderTargetViewportEvent& evt) { (void)evt; } /** Called to notify listener that a Viewport has been removed from the target in question. */ virtual void viewportRemoved(const RenderTargetViewportEvent& evt) { (void)evt; } }; /** @} */ /** @} */ } #endif
{'content_hash': 'c160bbe7f01882dffc30934d275802ea', 'timestamp': '', 'source': 'github', 'line_count': 120, 'max_line_length': 91, 'avg_line_length': 42.391666666666666, 'alnum_prop': 0.6457637114212699, 'repo_name': 'Misterblue/LookingGlass-Viewer', 'id': '2e26f7cd85e5da24b3f50113bb41182822f67082', 'size': '6476', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/Ogre/include/OgreRenderTargetListener.h', 'mode': '33261', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '2087188'}, {'name': 'C#', 'bytes': '1035483'}, {'name': 'C++', 'bytes': '15139935'}, {'name': 'JavaScript', 'bytes': '7396'}, {'name': 'Objective-C', 'bytes': '6832'}, {'name': 'Perl', 'bytes': '2099'}, {'name': 'Rust', 'bytes': '1342'}, {'name': 'Shell', 'bytes': '15994'}]}
require File.expand_path('../boot', __FILE__) require 'rails/all' Bundler.require(*Rails.groups) require "breakpoint_rails" module Dummy class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de # Do not swallow errors in after_commit/after_rollback callbacks. config.active_record.raise_in_transactional_callbacks = true end end
{'content_hash': 'b3f876e4b12166bbf9cbc3f92d5bfff1', 'timestamp': '', 'source': 'github', 'line_count': 26, 'max_line_length': 99, 'avg_line_length': 39.46153846153846, 'alnum_prop': 0.7173489278752436, 'repo_name': 'Stex/breakpoint_rails', 'id': 'd50222e947e79d0f9d6a602b047fb3b0dd4b1839', 'size': '1026', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/dummy/config/application.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '36700'}, {'name': 'HTML', 'bytes': '4883'}, {'name': 'JavaScript', 'bytes': '596'}, {'name': 'Ruby', 'bytes': '17259'}]}
import Display from "./Display" import Editor from "./Editor" import RenderMixin from "../utility/RenderMixin" var ButtonInput = ReactBootstrap.ButtonInput var Sample = React.createClass({ mixins: [RenderMixin], propTypes: { path: React.PropTypes.string.isRequired, code: React.PropTypes.string, title: React.PropTypes.string.isRequired, desc: React.PropTypes.string.isRequired, isEditorVisible: React.PropTypes.bool }, render: function() { console.log("Sample:render", arguments); var props = this.props; var path = props.path; var isEditorVisible = props.isEditorVisible; return ( <div> <div><h3 id={path.substring(0, path.indexOf("."))}>{props.title}</h3></div> <p>{props.desc}</p> <Display ref="display" code={props.editingCode!=undefined? props.editingCode:props.code}className="sample-display"></Display> { isEditorVisible? null: <ButtonInput bsStyle="info" className="btn-xs" onClick={() => props.showEditor(path)} value="Show Code" /> } <Editor ref="editor" path={path} code={props.code} editingCode={props.editingCode} updateEditor={props.updateEditor} isEditorVisible={isEditorVisible}></Editor> { isEditorVisible? <ButtonInput bsStyle="info" className="btn-xs" onClick={() => props.hideEditor(path)} value="Hide Code" /> : null} <p></p> </div> ); }, // componentWillReceiveProps: function() { // console.log("Sample:componentWillReceiveProps", arguments); // }, // componentDidUpdate: function() { // console.log("Sample:componentDidUpdate", arguments); // } }); export default Sample
{'content_hash': '706a41f7884de0cee7742ef6206b3506', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 176, 'avg_line_length': 45.05128205128205, 'alnum_prop': 0.6317586795674445, 'repo_name': 'elfandsummer/boilerplate', 'id': 'd213c2fe2c1107a7f522c9462281b786d67ef1ad', 'size': '1757', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/components/Sample.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '1517'}, {'name': 'HTML', 'bytes': '1536'}, {'name': 'JavaScript', 'bytes': '27778'}]}
using System; using System.Collections.Generic; using System.Linq; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.Owin; using Microsoft.Owin.Security.Cookies; using Microsoft.Owin.Security.Google; using Microsoft.Owin.Security.OAuth; using Owin; using TestWebApiApp.Providers; using TestWebApiApp.Models; namespace TestWebApiApp { public partial class Startup { public static OAuthAuthorizationServerOptions OAuthOptions { get; private set; } public static string PublicClientId { get; private set; } // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864 public void ConfigureAuth(IAppBuilder app) { // Configure the db context and user manager to use a single instance per request app.CreatePerOwinContext(ApplicationDbContext.Create); app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create); // Enable the application to use a cookie to store information for the signed in user // and to use a cookie to temporarily store information about a user logging in with a third party login provider app.UseCookieAuthentication(new CookieAuthenticationOptions()); app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); // Configure the application for OAuth based flow PublicClientId = "self"; OAuthOptions = new OAuthAuthorizationServerOptions { TokenEndpointPath = new PathString("/Token"), Provider = new ApplicationOAuthProvider(PublicClientId), AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"), AccessTokenExpireTimeSpan = TimeSpan.FromDays(14), AllowInsecureHttp = true }; // Enable the application to use bearer tokens to authenticate users app.UseOAuthBearerTokens(OAuthOptions); // Uncomment the following lines to enable logging in with third party login providers //app.UseMicrosoftAccountAuthentication( // clientId: "", // clientSecret: ""); //app.UseTwitterAuthentication( // consumerKey: "", // consumerSecret: ""); //app.UseFacebookAuthentication( // appId: "", // appSecret: ""); //app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions() //{ // ClientId = "", // ClientSecret = "" //}); } } }
{'content_hash': '9ec934dfa0d13ffa58838a7443b03f1a', 'timestamp': '', 'source': 'github', 'line_count': 68, 'max_line_length': 125, 'avg_line_length': 39.86764705882353, 'alnum_prop': 0.649206934710439, 'repo_name': 'idoychinov/Telerik_Academy_Homework', 'id': 'fc099f7cba0cb6b149835f8e45e331aa794d023f', 'size': '2713', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ASP.NETWeb Forms/1.IntroductionToAspNet/WebApps/TestWebApiApp/App_Start/Startup.Auth.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '224148'}, {'name': 'C#', 'bytes': '3952663'}, {'name': 'CSS', 'bytes': '3475942'}, {'name': 'CoffeeScript', 'bytes': '4453'}, {'name': 'JavaScript', 'bytes': '8996873'}, {'name': 'Pascal', 'bytes': '14823'}, {'name': 'PowerShell', 'bytes': '1717649'}, {'name': 'Puppet', 'bytes': '404631'}, {'name': 'Shell', 'bytes': '315'}, {'name': 'TypeScript', 'bytes': '11219'}, {'name': 'XSLT', 'bytes': '2081'}]}
package com.xcode.mobile.smilealarm; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
{'content_hash': 'b21a9600719a2c1d4e73911d8f2e36bc', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 93, 'avg_line_length': 27.53846153846154, 'alnum_prop': 0.7513966480446927, 'repo_name': 'anhnguyenbk/XCODE-MOBILE-APPS-DEV', 'id': '70ec47085cc929fc009a0a2fd6b91a228c7705c0', 'size': '358', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'SmileAlarm/app/src/androidTest/java/com/xcode/mobile/smilealarm/ApplicationTest.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '5543'}, {'name': 'Java', 'bytes': '219057'}, {'name': 'JavaScript', 'bytes': '662'}]}
package com.twitter.zipkin.builder import com.twitter.finagle.stats.{OstrichStatsReceiver, StatsReceiver} import com.twitter.logging.config._ import com.twitter.logging.{ConsoleHandler, Logger, LoggerFactory} import com.twitter.ostrich.admin._ import java.net.{InetAddress, InetSocketAddress} import scala.util.matching.Regex /** * Base builder for a Zipkin service */ case class ZipkinServerBuilder( serverPort : Int, adminPort : Int, serverAddress : InetAddress = InetAddress.getByAddress(Array[Byte](0,0,0,0)), loggers : List[LoggerFactory] = List(LoggerFactory(level = Some(Level.DEBUG), handlers = List(ConsoleHandler()))), adminStatsNodes : List[StatsFactory] = List(StatsFactory(reporters = List(TimeSeriesCollectorFactory()))), adminStatsFilters : List[Regex] = List.empty, statsReceiver : StatsReceiver = new OstrichStatsReceiver ) extends Builder[(RuntimeEnvironment) => Unit] { def serverPort(p: Int) : ZipkinServerBuilder = copy(serverPort = p) def adminPort(p: Int) : ZipkinServerBuilder = copy(adminPort = p) def serverAddress(a: InetAddress) : ZipkinServerBuilder = copy(serverAddress = a) def loggers(l: List[LoggerFactory]) : ZipkinServerBuilder = copy(loggers = l) def statsReceiver(s: StatsReceiver) : ZipkinServerBuilder = copy(statsReceiver = s) def addLogger(l: LoggerFactory) : ZipkinServerBuilder = copy(loggers = loggers :+ l) def addAdminStatsNode(n: StatsFactory): ZipkinServerBuilder = copy(adminStatsNodes = adminStatsNodes :+ n) def addAdminStatsFilter(f: Regex) : ZipkinServerBuilder = copy(adminStatsFilters = adminStatsFilters :+ f) private lazy val adminServiceFactory: AdminServiceFactory = AdminServiceFactory( httpPort = adminPort, statsNodes = adminStatsNodes, statsFilters = adminStatsFilters ) lazy val socketAddress = new InetSocketAddress(serverAddress, serverPort) var adminHttpService: Option[AdminHttpService] = None def apply() = (runtime: RuntimeEnvironment) => { Logger.configure(loggers) adminHttpService = Some(adminServiceFactory(runtime)) } }
{'content_hash': '0719ee0a862370c19d8fb48e77c5a744', 'timestamp': '', 'source': 'github', 'line_count': 49, 'max_line_length': 138, 'avg_line_length': 47.97959183673469, 'alnum_prop': 0.6741811994895789, 'repo_name': 'coursera/zipkin', 'id': 'e0b70118772b4d9252bd767cfdcdb36b2215aecf', 'size': '2947', 'binary': False, 'copies': '1', 'ref': 'refs/heads/coursera-zipkin', 'path': 'zipkin-query-service/src/main/scala/com/twitter/zipkin/builder/ZipkinServerBuilder.scala', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '10180'}, {'name': 'HTML', 'bytes': '18713'}, {'name': 'Java', 'bytes': '37218'}, {'name': 'JavaScript', 'bytes': '322607'}, {'name': 'Scala', 'bytes': '422991'}, {'name': 'Shell', 'bytes': '3977'}, {'name': 'Thrift', 'bytes': '7894'}]}
package matchers import ( "fmt" "reflect" "github.com/mysza/go-service-template/Godeps/_workspace/src/github.com/onsi/gomega/format" ) type AssignableToTypeOfMatcher struct { Expected interface{} } func (matcher *AssignableToTypeOfMatcher) Match(actual interface{}) (success bool, err error) { if actual == nil || matcher.Expected == nil { return false, fmt.Errorf("Refusing to compare <nil> to <nil>.\nBe explicit and use BeNil() instead. This is to avoid mistakes where both sides of an assertion are erroneously uninitialized.") } actualType := reflect.TypeOf(actual) expectedType := reflect.TypeOf(matcher.Expected) return actualType.AssignableTo(expectedType), nil } func (matcher *AssignableToTypeOfMatcher) FailureMessage(actual interface{}) string { return format.Message(actual, fmt.Sprintf("to be assignable to the type: %T", matcher.Expected)) } func (matcher *AssignableToTypeOfMatcher) NegatedFailureMessage(actual interface{}) string { return format.Message(actual, fmt.Sprintf("not to be assignable to the type: %T", matcher.Expected)) }
{'content_hash': 'f5c410e8325c697313f45b4aff3e6566', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 194, 'avg_line_length': 34.67741935483871, 'alnum_prop': 0.7646511627906977, 'repo_name': 'mysza/go-service-template', 'id': 'f6d4c8b05877dcdedcaa13f476846f81fbdddd79', 'size': '1075', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Godeps/_workspace/src/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '429'}, {'name': 'Makefile', 'bytes': '799'}]}
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Getting Started</title> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <link rel="stylesheet" href="css/reveal.css"> <link rel="stylesheet" href="css/improve-formatting.css"> <link rel="stylesheet" href="css/theme/black.css" id="theme"> <!-- For syntax highlighting --> <link rel="stylesheet" href="lib/css/zenburn.css"> <!-- If the query includes 'print-pdf', include the PDF print sheet --> <script> if( window.location.search.match( /print-pdf/gi ) ) { var link = document.createElement( 'link' ); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'css/print/pdf.css' document.getElementsByTagName( 'head' )[0].appendChild( link ); } </script> <script src="js/jquery-1.7.2.min.js" charset="utf-8" type="text/javascript"></script> <script src="js/raphael-min.js" type="text/javascript" charset="utf-8"></script> </head> <body> <div class="reveal"> <!-- Any section element inside of this container is displayed as a slide --> <div class="slides"> <section data-state="cover"> <h1><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/InteractiveResource" property="dct:title" rel="dct:type"> Social Hacking with ML </span></h1> <br> <h3 xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName">Devananda van der Veen</h3> <h3> twitter: @devananda </h3> <br> <h4><a xmlns:cc="http://creativecommons.org/ns#" rel="cc:attributionURL" href='http://devananda.github.io/talks/'>devananda.github.io/talks/</a> </h4> </section> <section id="who-am-i"> <h1>Trends...</h1> <ul> <li>1999 - "Peer to Peer" networking</li> <li>2003 - LAMP stack</li> <li>2008 - Cloud</li> <li>2016 - Machine Learning</li> </ul> </section> <section id="what-to-talk-about"> <img src="ml-trends.png"> <h1>Cloud vs Machine Learning</h1> </section> <section id='whatcanitdo'> <h1>What can it do?</h1> </section> <section id="whatcanitdo2"> <img src="dogs_v_cats.jpg" width="500"> </section> <section id="sowhat"> <h1>... and then what?</h1> </section> <section id="what-about-fire"> <h1>FireWise</h1> </section> <section id="what-about-data"> https://cloud.google.com/public-datasets/ </section> <section id="what-about-money"> <h1>$?</h1> </section> <section id="what-about-time"> <h1>Get involved</h1> </section> </div> </div> <script src="lib/js/head.min.js"></script> <script src="js/reveal.js"></script> <script> // Full list of configuration options available here: // https://github.com/hakimel/reveal.js#configuration Reveal.initialize({ controls: true, progress: true, history: true, center: true, theme: Reveal.getQueryHash().theme, // available themes are in /css/theme transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none // Optional libraries used to extend on reveal.js dependencies: [ { src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } }, { src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }, { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } } // { src: 'plugin/search/search.js', async: true, condition: function() { return !!document.body.classList; } } // { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } } ] }); </script> </body> </html>
{'content_hash': 'fbd073ac3cfff277d1d8ba2b7103607f', 'timestamp': '', 'source': 'github', 'line_count': 122, 'max_line_length': 134, 'avg_line_length': 40.114754098360656, 'alnum_prop': 0.5657948508377605, 'repo_name': 'devananda/talks', 'id': '9af03f9def530e6e42346ad2f09ad23e7827719c', 'size': '4894', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'social-hacking-with-ml.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '201296'}, {'name': 'HTML', 'bytes': '225649'}, {'name': 'JavaScript', 'bytes': '254227'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>maths: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.5.2~camlp4 / maths - 8.10.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> maths <small> 8.10.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-06-19 05:53:44 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-06-19 05:53:44 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp4 4.05+1 Camlp4 is a system for writing extensible parsers for programming languages conf-findutils 1 Virtual package relying on findutils coq 8.5.2~camlp4 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlbuild 0.14.1 OCamlbuild is a build system with builtin rules to easily build most OCaml projects # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/maths&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Maths&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.11~&quot;} ] tags: [ &quot;keyword: mathematics&quot; &quot;category: Mathematics/Arithmetic and Number Theory/Number theory&quot; ] authors: [ &quot;Jean-Christophe Filliâtre&quot; ] bug-reports: &quot;https://github.com/coq-contribs/maths/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/maths.git&quot; synopsis: &quot;Basic mathematics&quot; description: &quot;&quot;&quot; Basic mathematics (gcd, primality, etc.) from French ``Mathematiques Superieures&#39;&#39; (first year of preparation to high schools)&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/maths/archive/v8.10.0.tar.gz&quot; checksum: &quot;md5=0bb016a4357e219f2099e242366e71bf&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-maths.8.10.0 coq.8.5.2~camlp4</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.5.2~camlp4). The following dependencies couldn&#39;t be met: - coq-maths -&gt; coq &gt;= 8.10 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-maths.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{'content_hash': '02cfa1100842832565a40ea18f5843ad', 'timestamp': '', 'source': 'github', 'line_count': 171, 'max_line_length': 159, 'avg_line_length': 40.538011695906434, 'alnum_prop': 0.54399884593191, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': '877305d35e80b58eb9d8462a60af22c7891b3386', 'size': '6958', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.05.0-2.0.1/released/8.5.2~camlp4/maths/8.10.0.html', 'mode': '33188', 'license': 'mit', 'language': []}
// Created by Andrea Arteaga, MeteoSwiss // Email: [email protected] // January 2013 #pragma once #include "SavePoint.h" class Serializer; class SerializerOutput { public: /** * Default constructor */ SerializerOutput() { } /** * Copy constructor */ SerializerOutput(const SerializerOutput& other) { *this = other; } /** * Assignment operator */ SerializerOutput& operator=(const SerializerOutput& other) { pSerializer_ = other.pSerializer_; savePoint_ = other.savePoint_; return *this; } inline void Init(Serializer& serializer, std::string savePointName); inline void set_SavePoint(const SavePoint& other) { savePoint_ = other; } inline SerializerOutput& operator<< (const MetaInfo& info); template<typename TDataField> inline SerializerOutput& operator<< (const TDataField& field); private: SavePoint savePoint_; Serializer* pSerializer_; };
{'content_hash': '4561ea1c1321f29eb8166410449be86e', 'timestamp': '', 'source': 'github', 'line_count': 50, 'max_line_length': 77, 'avg_line_length': 20.8, 'alnum_prop': 0.6182692307692308, 'repo_name': 'bcumming/mini-stencil', 'id': '91d2b75d9e79fcd19737b34b71a588c0457eb6d8', 'size': '1040', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/serialize/src/SerializerOutput.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '617485'}, {'name': 'C++', 'bytes': '1517839'}, {'name': 'FORTRAN', 'bytes': '310206'}, {'name': 'Objective-C', 'bytes': '12105'}, {'name': 'Python', 'bytes': '81906'}]}
leakless ======== Miscellaneous process related resource management modules API Document ------------ see: [Edoc](doc/README.md)
{'content_hash': '39cae2f424da051aaf4cbf61b2900399', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 57, 'avg_line_length': 13.3, 'alnum_prop': 0.6691729323308271, 'repo_name': 'sile/leakless', 'id': 'f0ca93e9cb76d5527484e694146074f0496c2c62', 'size': '133', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Erlang', 'bytes': '33606'}, {'name': 'Makefile', 'bytes': '1140'}]}
package awsiam import ( "encoding/json" "errors" "code.cloudfoundry.org/lager" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/iam" ) type UserPolicy struct { Version string `json:"Version"` ID string `json:"Id"` Statements []UserPolicyStatement `json:"Statement"` } type UserPolicyStatement struct { SID string `json:"Sid"` Effect string `json:"Effect"` Action string `json:"Action"` Resource string `json:"Resource"` } type IAMUser struct { iamsvc *iam.IAM logger lager.Logger } func NewIAMUser( iamsvc *iam.IAM, logger lager.Logger, ) *IAMUser { return &IAMUser{ iamsvc: iamsvc, logger: logger.Session("iam-user"), } } func (i *IAMUser) Describe(userName string) (UserDetails, error) { userDetails := UserDetails{ UserName: userName, } getUserInput := &iam.GetUserInput{ UserName: aws.String(userName), } i.logger.Debug("get-user", lager.Data{"input": getUserInput}) getUserOutput, err := i.iamsvc.GetUser(getUserInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return userDetails, errors.New(awsErr.Code() + ": " + awsErr.Message()) } return userDetails, err } i.logger.Debug("get-user", lager.Data{"output": getUserOutput}) userDetails.UserARN = aws.StringValue(getUserOutput.User.Arn) userDetails.UserID = aws.StringValue(getUserOutput.User.UserId) return userDetails, nil } func (i *IAMUser) Create(userName string) (string, error) { createUserInput := &iam.CreateUserInput{ UserName: aws.String(userName), } i.logger.Debug("create-user", lager.Data{"input": createUserInput}) createUserOutput, err := i.iamsvc.CreateUser(createUserInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return "", errors.New(awsErr.Code() + ": " + awsErr.Message()) } return "", err } i.logger.Debug("create-user", lager.Data{"output": createUserOutput}) return aws.StringValue(createUserOutput.User.Arn), nil } func (i *IAMUser) Delete(userName string) error { deleteUserInput := &iam.DeleteUserInput{ UserName: aws.String(userName), } i.logger.Debug("delete-user", lager.Data{"input": deleteUserInput}) deleteUserOutput, err := i.iamsvc.DeleteUser(deleteUserInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return errors.New(awsErr.Code() + ": " + awsErr.Message()) } return err } i.logger.Debug("delete-user", lager.Data{"output": deleteUserOutput}) return nil } func (i *IAMUser) ListAccessKeys(userName string) ([]string, error) { var accessKeys []string listAccessKeysInput := &iam.ListAccessKeysInput{ UserName: aws.String(userName), } i.logger.Debug("list-access-keys", lager.Data{"input": listAccessKeysInput}) listAccessKeysOutput, err := i.iamsvc.ListAccessKeys(listAccessKeysInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return accessKeys, errors.New(awsErr.Code() + ": " + awsErr.Message()) } return accessKeys, err } i.logger.Debug("list-access-keys", lager.Data{"output": listAccessKeysOutput}) for _, accessKey := range listAccessKeysOutput.AccessKeyMetadata { accessKeys = append(accessKeys, aws.StringValue(accessKey.AccessKeyId)) } return accessKeys, nil } func (i *IAMUser) CreateAccessKey(userName string) (string, string, error) { createAccessKeyInput := &iam.CreateAccessKeyInput{ UserName: aws.String(userName), } i.logger.Debug("create-access-key", lager.Data{"input": createAccessKeyInput}) createAccessKeyOutput, err := i.iamsvc.CreateAccessKey(createAccessKeyInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return "", "", errors.New(awsErr.Code() + ": " + awsErr.Message()) } return "", "", err } i.logger.Debug("create-access-key", lager.Data{"output": createAccessKeyOutput}) return aws.StringValue(createAccessKeyOutput.AccessKey.AccessKeyId), aws.StringValue(createAccessKeyOutput.AccessKey.SecretAccessKey), nil } func (i *IAMUser) DeleteAccessKey(userName string, accessKeyID string) error { deleteAccessKeyInput := &iam.DeleteAccessKeyInput{ UserName: aws.String(userName), AccessKeyId: aws.String(accessKeyID), } i.logger.Debug("delete-access-key", lager.Data{"input": deleteAccessKeyInput}) deleteAccessKeyOutput, err := i.iamsvc.DeleteAccessKey(deleteAccessKeyInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return errors.New(awsErr.Code() + ": " + awsErr.Message()) } return err } i.logger.Debug("delete-access-key", lager.Data{"output": deleteAccessKeyOutput}) return nil } func (i *IAMUser) CreatePolicy(policyName string, effect string, action string, resource string) (string, error) { policyDocument, err := i.buildUserPolicy(policyName, effect, action, resource) if err != nil { return "", err } createPolicyInput := &iam.CreatePolicyInput{ PolicyName: aws.String(policyName), PolicyDocument: aws.String(policyDocument), } i.logger.Debug("create-policy", lager.Data{"input": createPolicyInput}) createPolicyOutput, err := i.iamsvc.CreatePolicy(createPolicyInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return "", errors.New(awsErr.Code() + ": " + awsErr.Message()) } return "", err } i.logger.Debug("create-policy", lager.Data{"output": createPolicyOutput}) return aws.StringValue(createPolicyOutput.Policy.Arn), nil } func (i *IAMUser) DeletePolicy(policyARN string) error { deletePolicyInput := &iam.DeletePolicyInput{ PolicyArn: aws.String(policyARN), } i.logger.Debug("delete-policy", lager.Data{"input": deletePolicyInput}) deletePolicyOutput, err := i.iamsvc.DeletePolicy(deletePolicyInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return errors.New(awsErr.Code() + ": " + awsErr.Message()) } return err } i.logger.Debug("delete-policy", lager.Data{"output": deletePolicyOutput}) return nil } func (i *IAMUser) ListAttachedUserPolicies(userName string) ([]string, error) { var userPolicies []string listAttachedUserPoliciesInput := &iam.ListAttachedUserPoliciesInput{ UserName: aws.String(userName), } i.logger.Debug("list-attached-user-policies", lager.Data{"input": listAttachedUserPoliciesInput}) listAttachedUserPoliciesOutput, err := i.iamsvc.ListAttachedUserPolicies(listAttachedUserPoliciesInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return userPolicies, errors.New(awsErr.Code() + ": " + awsErr.Message()) } return userPolicies, err } i.logger.Debug("list-attached-user-policies", lager.Data{"output": listAttachedUserPoliciesOutput}) for _, userPolicy := range listAttachedUserPoliciesOutput.AttachedPolicies { userPolicies = append(userPolicies, aws.StringValue(userPolicy.PolicyArn)) } return userPolicies, nil } func (i *IAMUser) AttachUserPolicy(userName string, policyARN string) error { attachUserPolicyInput := &iam.AttachUserPolicyInput{ PolicyArn: aws.String(policyARN), UserName: aws.String(userName), } i.logger.Debug("attach-user-policy", lager.Data{"input": attachUserPolicyInput}) attachUserPolicyOutput, err := i.iamsvc.AttachUserPolicy(attachUserPolicyInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return errors.New(awsErr.Code() + ": " + awsErr.Message()) } return err } i.logger.Debug("attach-user-policy", lager.Data{"output": attachUserPolicyOutput}) return nil } func (i *IAMUser) DetachUserPolicy(userName string, policyARN string) error { detachUserPolicyInput := &iam.DetachUserPolicyInput{ PolicyArn: aws.String(policyARN), UserName: aws.String(userName), } i.logger.Debug("detach-user-policy", lager.Data{"input": detachUserPolicyInput}) detachUserPolicyOutput, err := i.iamsvc.DetachUserPolicy(detachUserPolicyInput) if err != nil { i.logger.Error("aws-iam-error", err) if awsErr, ok := err.(awserr.Error); ok { return errors.New(awsErr.Code() + ": " + awsErr.Message()) } return err } i.logger.Debug("detach-user-policy", lager.Data{"output": detachUserPolicyOutput}) return nil } func (i *IAMUser) buildUserPolicy(policyID string, effect string, action string, resource string) (string, error) { userPolicy := UserPolicy{ Version: "2012-10-17", ID: policyID, Statements: []UserPolicyStatement{ UserPolicyStatement{ SID: "1", Effect: effect, Action: action, Resource: resource, }, UserPolicyStatement{ SID: "2", Effect: effect, Action: action, Resource: resource + "/*", }, }, } policy, err := json.Marshal(userPolicy) if err != nil { return "", err } return string(policy), nil }
{'content_hash': '012bdc53874db2f6be588cb6028dcbf7', 'timestamp': '', 'source': 'github', 'line_count': 304, 'max_line_length': 139, 'avg_line_length': 29.713815789473685, 'alnum_prop': 0.7079597033100853, 'repo_name': 'jmcarp/s3-broker', 'id': '93fb4e93663e94e491e74787fe4a57e5fa19e481', 'size': '9033', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'awsiam/iam_user.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Go', 'bytes': '61277'}, {'name': 'Shell', 'bytes': '7278'}]}
<?php /** * Subclass for representing a row from the 'sf_user_recommendation' table. * * * * @package plugins.sfPropelActAsRecommendableBehaviorPlugin.lib.model */ class sfUserRecommendation extends BasesfUserRecommendation { }
{'content_hash': 'dde0041571ec04721cb5a0f4631e44c8', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 75, 'avg_line_length': 19.75, 'alnum_prop': 0.759493670886076, 'repo_name': 'Symfony-Plugins/sfPropelActAsRecommendableBehaviorPlugin', 'id': '0c7be833819526959a5436704e776a96769db5d9', 'size': '237', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/model/sfUserRecommendation.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '58812'}]}
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Collapsible = _react2.default.createClass({ displayName: 'Collapsible', //Set validation for prop types propTypes: { transitionTime: _react2.default.PropTypes.number, easing: _react2.default.PropTypes.string, open: _react2.default.PropTypes.bool, classParentString: _react2.default.PropTypes.string, openedClassName: _react2.default.PropTypes.string, triggerClassName: _react2.default.PropTypes.string, triggerOpenedClassName: _react2.default.PropTypes.string, contentOuterClassName: _react2.default.PropTypes.string, contentInnerClassName: _react2.default.PropTypes.string, accordionPosition: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number]), handleTriggerClick: _react2.default.PropTypes.func, trigger: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element]), triggerWhenOpen: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.element]), triggerDisabled: _react2.default.PropTypes.bool, lazyRender: _react2.default.PropTypes.bool, overflowWhenOpen: _react2.default.PropTypes.oneOf(['hidden', 'visible', 'auto', 'scroll', 'inherit', 'initial', 'unset']), triggerSibling: _react2.default.PropTypes.element }, //If no transition time or easing is passed then default to this getDefaultProps: function getDefaultProps() { return { transitionTime: 400, easing: 'linear', open: false, classParentString: 'Collapsible', triggerDisabled: false, lazyRender: false, overflowWhenOpen: 'hidden', openedClassName: '', triggerClassName: '', triggerOpenedClassName: '', contentOuterClassName: '', contentInnerClassName: '', className: '', triggerSibling: null }; }, //Defaults the dropdown to be closed getInitialState: function getInitialState() { if (this.props.open) { return { isClosed: false, shouldSwitchAutoOnNextCycle: false, height: 'auto', transition: 'none', hasBeenOpened: true, overflow: this.props.overflowWhenOpen }; } else { return { isClosed: true, shouldSwitchAutoOnNextCycle: false, height: 0, transition: 'height ' + this.props.transitionTime + 'ms ' + this.props.easing, hasBeenOpened: false, overflow: 'hidden' }; } }, // Taken from https://github.com/EvandroLG/transitionEnd/ // Determines which prefixed event to listen for whichTransitionEnd: function whichTransitionEnd(element) { var transitions = { 'WebkitTransition': 'webkitTransitionEnd', 'MozTransition': 'transitionend', 'OTransition': 'oTransitionEnd otransitionend', 'transition': 'transitionend' }; for (var t in transitions) { if (element.style[t] !== undefined) { return transitions[t]; } } }, componentDidMount: function componentDidMount() { var _this = this; //Set up event listener to listen to transitionend so we can switch the height from fixed pixel to auto for much responsiveness; //TODO: Once Synthetic transitionend events have been exposed in the next release of React move this funciton to a function handed to the onTransitionEnd prop this.refs.outer.addEventListener(this.whichTransitionEnd(this.refs.outer), function (event) { if (_this.state.isClosed === false) { _this.setState({ shouldSwitchAutoOnNextCycle: true }); } }); }, componentDidUpdate: function componentDidUpdate(prevProps) { if (this.state.shouldSwitchAutoOnNextCycle === true && this.state.isClosed === false) { //Set the height to auto to make compoenent re-render with the height set to auto. //This way the dropdown will be responsive and also change height if there is another dropdown within it. this.makeResponsive(); } if (this.state.shouldSwitchAutoOnNextCycle === true && this.state.isClosed === true) { this.prepareToOpen(); } //If there has been a change in the open prop (controlled by accordion) if (prevProps.open != this.props.open) { if (this.props.open === true) { this.openCollapsible(); } else { this.closeCollapsible(); } } }, handleTriggerClick: function handleTriggerClick(event) { event.preventDefault(); if (this.props.triggerDisabled) { return; } if (this.props.handleTriggerClick) { this.props.handleTriggerClick(this.props.accordionPosition); } else { if (this.state.isClosed === true) { this.openCollapsible(); } else { this.closeCollapsible(); } } }, closeCollapsible: function closeCollapsible() { this.setState({ isClosed: true, shouldSwitchAutoOnNextCycle: true, height: this.refs.inner.offsetHeight, overflow: 'hidden' }); }, openCollapsible: function openCollapsible() { this.setState({ height: this.refs.inner.offsetHeight, transition: 'height ' + this.props.transitionTime + 'ms ' + this.props.easing, isClosed: false, hasBeenOpened: true }); if(typeof(this.props.onOpen) != 'undefined' && typeof(this.props.dateString) != 'undefined') this.props.onOpen(this.props.dateString); }, makeResponsive: function makeResponsive() { this.setState({ height: 'auto', transition: 'none', shouldSwitchAutoOnNextCycle: false, overflow: this.props.overflowWhenOpen }); }, prepareToOpen: function prepareToOpen() { var _this2 = this; //The height has been changes back to fixed pixel, we set a small timeout to force the CSS transition back to 0 on the next tick. window.setTimeout(function () { _this2.setState({ height: 0, shouldSwitchAutoOnNextCycle: false, transition: 'height ' + _this2.props.transitionTime + 'ms ' + _this2.props.easing }); }, 50); }, renderNonClickableTriggerElement: function renderNonClickableTriggerElement() { if (this.props.triggerSibling) { return _react2.default.createElement( 'span', { className: this.props.classParentString + "__trigger-sibling" }, this.props.triggerSibling ); } return null; }, render: function render() { var dropdownStyle = { height: this.state.height, WebkitTransition: this.state.transition, msTransition: this.state.transition, transition: this.state.transition, overflow: this.state.overflow }; var openClass = this.state.isClosed ? 'is-closed' : 'is-open'; var disabledClass = this.props.triggerDisabled ? 'is-disabled' : ''; //If user wants different text when tray is open var trigger = this.state.isClosed === false && this.props.triggerWhenOpen !== undefined ? this.props.triggerWhenOpen : this.props.trigger; // Don't render children until the first opening of the Collapsible if lazy rendering is enabled var children = this.props.children; if (this.props.lazyRender) if (!this.state.hasBeenOpened) children = null; var triggerClassName = this.props.classParentString + "__trigger" + ' ' + openClass + ' ' + disabledClass; if (this.state.isClosed) { triggerClassName = triggerClassName + ' ' + this.props.triggerClassName; } else { triggerClassName = triggerClassName + ' ' + this.props.triggerOpenedClassName; } return _react2.default.createElement( 'div', { className: this.props.classParentString + ' ' + (this.state.isClosed ? this.props.className : this.props.openedClassName) }, _react2.default.createElement( 'span', { className: triggerClassName.trim(), onClick: this.handleTriggerClick }, trigger ), this.renderNonClickableTriggerElement(), _react2.default.createElement( 'div', { className: this.props.classParentString + "__contentOuter" + ' ' + this.props.contentOuterClassName, ref: 'outer', style: dropdownStyle }, _react2.default.createElement( 'div', { className: this.props.classParentString + "__contentInner" + ' ' + this.props.contentInnerClassName, ref: 'inner' }, children ) ) ); } }); exports.default = Collapsible;
{'content_hash': 'b36b68782b2c05ccff786afe82fb3fbf', 'timestamp': '', 'source': 'github', 'line_count': 260, 'max_line_length': 163, 'avg_line_length': 33.473076923076924, 'alnum_prop': 0.6664368608525796, 'repo_name': 'RegOpz/RegOpzWebApp', 'id': '5ff80782ed6f0747b0b10fa7f9c1d99e48813c19', 'size': '8703', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'src/components/CollapsibleModified/Collapsible.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '108960'}, {'name': 'HTML', 'bytes': '1643'}, {'name': 'JavaScript', 'bytes': '1754113'}, {'name': 'Shell', 'bytes': '206'}]}
using System; using System.Collections.Generic; using CH.Testing.T2.Interface; namespace CH.Testing.T2.Component { internal sealed class LineParser : ILineParser { private static readonly string[] Separator = {Environment.NewLine}; IEnumerable<string> ILineParser.Parse(string s) { return s.Split(Separator, int.MaxValue, StringSplitOptions.None); } } }
{'content_hash': '28521ab9590d115155657130252a534a', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 77, 'avg_line_length': 25.6875, 'alnum_prop': 0.6861313868613139, 'repo_name': 'tanglebones/ch-testing', 'id': '9ee20b4060b4932893501e2a28328329e257dc88', 'size': '411', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'T2/Component/LineParser.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '41263'}]}
import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.DatabaseUtils; import android.database.sqlite.SQLiteDatabase; import android.net.Uri; import android.util.Log; import com.google.android.libraries.social.autobackup.MediaRecordEntry; import java.io.IOException; public final class hbm { private static final String a = MediaRecordEntry.a.a; private static final String b; private static final String c; private static final String d; private static final String e; static { String str1 = String.valueOf("upload_account_id = -1 AND _id > ? AND media_url NOT IN ( SELECT media_url FROM "); String str2 = a; String str3 = String.valueOf("upload_account_id"); String str4 = String.valueOf("bucket_id"); String str5 = String.valueOf("bucket_id"); String str6 = String.valueOf("bucket_id"); String str7 = String.valueOf("exclude_bucket"); b = 57 + String.valueOf(str1).length() + String.valueOf(str2).length() + String.valueOf(str3).length() + String.valueOf(str4).length() + String.valueOf(str5).length() + String.valueOf(str6).length() + String.valueOf(str7).length() + str1 + str2 + " WHERE " + str3 + " = ? )" + " AND (" + str4 + " IS NULL OR " + str5 + " NOT IN ( SELECT " + str6 + " FROM " + str7 + " ))"; String str8 = String.valueOf(MediaRecordEntry.a.a); String str9 = String.valueOf("upload_account_id = ? AND upload_state = 100"); c = 28 + String.valueOf(str8).length() + String.valueOf(str9).length() + "SELECT count(*) FROM " + str8 + " WHERE " + str9; String str10 = a; String str11 = String.valueOf("upload_account_id = ? AND ( upload_state = 100 OR upload_state = 200 ) AND upload_reason = ?"); d = 28 + String.valueOf(str10).length() + String.valueOf(str11).length() + "SELECT COUNT(*) FROM " + str10 + " WHERE " + str11; String str12 = String.valueOf("upload_account_id = -1 AND bucket_id = ? AND media_url NOT IN ( SELECT media_url FROM "); String str13 = a; String str14 = String.valueOf("upload_account_id"); e = 13 + String.valueOf(str12).length() + String.valueOf(str13).length() + String.valueOf(str14).length() + str12 + str13 + " WHERE " + str14 + " = ? )"; } private static int a(SQLiteDatabase paramSQLiteDatabase, int paramInt1, int paramInt2) { Cursor localCursor = a(paramSQLiteDatabase, paramInt1, -1L, 500); int i = 0; try { while (localCursor.moveToNext()) { MediaRecordEntry localMediaRecordEntry = MediaRecordEntry.a(localCursor); localMediaRecordEntry.id = 0L; localMediaRecordEntry.mUploadAccountId = paramInt1; localMediaRecordEntry.mUploadReason = paramInt2; localMediaRecordEntry.mUploadState = 100; MediaRecordEntry.a.a(paramSQLiteDatabase, localMediaRecordEntry); i++; } return i; } finally { localCursor.close(); } } static Cursor a(SQLiteDatabase paramSQLiteDatabase, int paramInt1, long paramLong, int paramInt2) { String str1 = a; String[] arrayOfString1 = MediaRecordEntry.a.b; String str2 = b; String[] arrayOfString2 = new String[2]; arrayOfString2[0] = Long.toString(paramLong); arrayOfString2[1] = Integer.toString(paramInt1); return paramSQLiteDatabase.query(true, str1, arrayOfString1, str2, arrayOfString2, null, null, "_id ASC", Integer.toString(paramInt2)); } public static void a(SQLiteDatabase paramSQLiteDatabase, int paramInt, String paramString) { if (paramInt == -1) {} int i; do { return; i = 0; int j; do { j = b(paramSQLiteDatabase, paramInt, paramString); if (Log.isLoggable("iu.UploadsManager", 4)) { new StringBuilder(56).append("ADD; medias added in batch: ").append(j).append("; iu: ").append(paramInt); } i += j; } while (j > 0); } while (!Log.isLoggable("iu.UploadsManager", 4)); new StringBuilder(60).append("ADD; complete; total scheduled: ").append(i).append("; iu: ").append(paramInt); } public static void a(SQLiteDatabase paramSQLiteDatabase, String paramString) { paramSQLiteDatabase.delete(a, "upload_account_id != -1 AND bucket_id = ? AND upload_state != 400", new String[] { paramString }); } public static void a(hci paramhci, int paramInt) { if (paramInt == -1) { return; } String[] arrayOfString = new String[1]; arrayOfString[0] = Integer.toString(paramInt); paramhci.getWritableDatabase().delete(a, "upload_account_id = ? AND upload_state = 100", arrayOfString); } static void a(hci paramhci, int paramInt1, int paramInt2) { if ((paramInt2 != 40) && (paramInt2 != 30)) { throw new IllegalArgumentException("only REASON_UPLOAD_ALL and REASON_INSTANT_UPLOAD supported"); } SQLiteDatabase localSQLiteDatabase = paramhci.getWritableDatabase(); String str = a; String[] arrayOfString = new String[2]; arrayOfString[0] = Integer.toString(paramInt1); arrayOfString[1] = Integer.toString(paramInt2); localSQLiteDatabase.delete(str, "upload_account_id = ? AND ( upload_state = 100 OR upload_state = 200 ) AND upload_reason = ?", arrayOfString); } static boolean a(ContentResolver paramContentResolver, Uri paramUri) { String str1 = efj.a(paramContentResolver, paramUri, "_data"); if (str1 != null) { int i = str1.lastIndexOf('.'); if (i >= 0) {} for (String str2 = str1.substring(i + 1); (!"jpg".equalsIgnoreCase(str2)) && (!"jpeg".equalsIgnoreCase(str2)); str2 = "") { return false; } for (;;) { try { hxp localhxp = new hxp(); try { localhxp.a(str1); int j = hxp.h; localhya = localhxp.a(j, localhxp.d(j)); if (localhya != null) { continue; } localObject = null; if ((localObject == null) || (!((String)localObject).contains("Google"))) { break label290; } if (!Log.isLoggable("iu.UploadsManager", 4)) { break label292; } String str4 = String.valueOf(localObject); if (str4.length() == 0) { continue; } "*** Found Google EXIF tag; value: ".concat(str4); } catch (IOException localIOException) { if (!Log.isLoggable("iu.UploadsManager", 4)) { break label294; } } new StringBuilder(37 + String.valueOf(str1).length()).append("INFO: ").append(str1).append(" does not contain any EXIF data"); } catch (Throwable localThrowable) { hya localhya; Object localObject; if (!Log.isLoggable("iu.UploadsManager", 4)) { continue; } String str3 = String.valueOf(localThrowable); new StringBuilder(27 + String.valueOf(str1).length() + String.valueOf(str3).length()).append("INFO: ").append(str1).append(" error getting EXIF; ").append(str3); return false; } localObject = localhya.a(); } new String("*** Found Google EXIF tag; value: "); } else { label290: return false; } label292: return true; label294: return false; } static boolean a(Context paramContext) { Cursor localCursor = ((hci)mbb.a(paramContext, hci.class)).getReadableDatabase().query(true, a, MediaRecordEntry.a.b, "upload_reason = 30 AND upload_state = 400", null, null, null, null, "1"); try { boolean bool = localCursor.moveToFirst(); return bool; } finally { localCursor.close(); } } public static boolean a(Context paramContext, int paramInt1, int paramInt2) { hci localhci = (hci)mbb.a(paramContext, hci.class); String str1; String[] arrayOfString; if (paramInt1 == -1) { str1 = "upload_account_id != -1 AND upload_state = 200"; arrayOfString = null; } for (;;) { if (Log.isLoggable("iu.UploadsManager", 4)) { String str2 = a; String str3 = 28 + String.valueOf(str2).length() + String.valueOf(str1).length() + "SELECT COUNT(*) FROM " + str2 + " WHERE " + str1; long l = DatabaseUtils.longForQuery(localhci.getReadableDatabase(), str3, arrayOfString); new StringBuilder(40).append("num queued entries: ").append(l); } ContentValues localContentValues = new ContentValues(1); localContentValues.put("upload_state", Integer.valueOf(100)); int i = localhci.getWritableDatabase().update(a, localContentValues, str1, arrayOfString); if (Log.isLoggable("iu.UploadsManager", 4)) { new StringBuilder(32).append("num updated entries: ").append(i); } if (i <= 0) { break; } return true; str1 = "upload_account_id = ? AND upload_state = 200"; arrayOfString = new String[1]; arrayOfString[0] = Integer.toString(paramInt1); } return false; } public static boolean a(Context paramContext, ContentResolver paramContentResolver, SQLiteDatabase paramSQLiteDatabase, ContentValues paramContentValues, String paramString, long paramLong, Uri paramUri, boolean paramBoolean1, boolean paramBoolean2) { hba localhba = (hba)mbb.a(paramContext, hba.class); String str1 = paramUri.toString(); paramContentValues.clear(); paramContentValues.putNull("album_id"); paramContentValues.putNull("event_id"); paramContentValues.put("upload_account_id", Integer.valueOf(-1)); paramContentValues.put("bucket_id", paramString); paramContentValues.put("is_image", Boolean.valueOf(paramBoolean1)); paramContentValues.put("media_id", Long.valueOf(paramLong)); paramContentValues.put("media_time", Long.valueOf(efj.a(paramContentResolver, paramUri))); String str2 = efj.a(paramContentResolver, paramUri, "_data"); if (str2 == null) { str2 = str1; } paramContentValues.put("media_hash", Integer.valueOf(str2.hashCode())); paramContentValues.put("media_url", str1); paramContentValues.put("upload_reason", Integer.valueOf(0)); paramContentValues.put("upload_state", Integer.valueOf(500)); MediaRecordEntry.a.a(paramSQLiteDatabase, MediaRecordEntry.a(paramContentValues)); if ((!paramBoolean2) || (a(paramContentResolver, paramUri))) { return false; } int i = localhba.d(); paramContentValues.putNull("event_id"); if (!hbj.a(paramContext)) { paramContentValues.put("upload_account_id", Integer.valueOf(i)); paramContentValues.put("upload_reason", Integer.valueOf(30)); paramContentValues.put("upload_state", Integer.valueOf(100)); MediaRecordEntry.a.a(paramSQLiteDatabase, MediaRecordEntry.a(paramContentValues)); if (Log.isLoggable("iu.UploadsManager", 4)) { new StringBuilder(59).append("NEW; upload media id: ").append(paramLong).append("; iu: ").append(i); } } if (Log.isLoggable("iu.UploadsManager", 4)) { new StringBuilder(39).append("NEW; add media id: ").append(paramLong); } return true; } /* Error */ private static int b(SQLiteDatabase paramSQLiteDatabase, int paramInt, String paramString) { // Byte code: // 0: aload_0 // 1: invokevirtual 370 android/database/sqlite/SQLiteDatabase:beginTransaction ()V // 4: getstatic 22 hbm:a Ljava/lang/String; // 7: astore 4 // 9: getstatic 17 com/google/android/libraries/social/autobackup/MediaRecordEntry:a Liao; // 12: getfield 124 iao:b [Ljava/lang/String; // 15: astore 5 // 17: getstatic 86 hbm:e Ljava/lang/String; // 20: astore 6 // 22: iconst_2 // 23: anewarray 26 java/lang/String // 26: astore 7 // 28: aload 7 // 30: iconst_0 // 31: aload_2 // 32: aastore // 33: aload 7 // 35: iconst_1 // 36: iload_1 // 37: invokestatic 134 java/lang/Integer:toString (I)Ljava/lang/String; // 40: aastore // 41: aload_0 // 42: aload 4 // 44: aload 5 // 46: aload 6 // 48: aload 7 // 50: aconst_null // 51: aconst_null // 52: aconst_null // 53: sipush 500 // 56: invokestatic 134 java/lang/Integer:toString (I)Ljava/lang/String; // 59: invokevirtual 373 android/database/sqlite/SQLiteDatabase:query (Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor; // 62: astore 8 // 64: iconst_0 // 65: istore 9 // 67: aload 8 // 69: invokeinterface 98 1 0 // 74: ifeq +52 -> 126 // 77: aload 8 // 79: invokestatic 101 com/google/android/libraries/social/autobackup/MediaRecordEntry:a (Landroid/database/Cursor;)Lcom/google/android/libraries/social/autobackup/MediaRecordEntry; // 82: astore 11 // 84: aload 11 // 86: lconst_0 // 87: putfield 105 com/google/android/libraries/social/autobackup/MediaRecordEntry:id J // 90: aload 11 // 92: iload_1 // 93: putfield 109 com/google/android/libraries/social/autobackup/MediaRecordEntry:mUploadAccountId I // 96: aload 11 // 98: bipush 30 // 100: putfield 112 com/google/android/libraries/social/autobackup/MediaRecordEntry:mUploadReason I // 103: aload 11 // 105: bipush 100 // 107: putfield 115 com/google/android/libraries/social/autobackup/MediaRecordEntry:mUploadState I // 110: getstatic 17 com/google/android/libraries/social/autobackup/MediaRecordEntry:a Liao; // 113: aload_0 // 114: aload 11 // 116: invokevirtual 118 iao:a (Landroid/database/sqlite/SQLiteDatabase;Lial;)J // 119: pop2 // 120: iinc 9 1 // 123: goto -56 -> 67 // 126: aload_0 // 127: invokevirtual 376 android/database/sqlite/SQLiteDatabase:setTransactionSuccessful ()V // 130: aload 8 // 132: invokeinterface 121 1 0 // 137: aload_0 // 138: invokevirtual 379 android/database/sqlite/SQLiteDatabase:endTransaction ()V // 141: iload 9 // 143: ireturn // 144: astore 10 // 146: aload 8 // 148: invokeinterface 121 1 0 // 153: aload 10 // 155: athrow // 156: astore_3 // 157: aload_0 // 158: invokevirtual 379 android/database/sqlite/SQLiteDatabase:endTransaction ()V // 161: aload_3 // 162: athrow // Local variable table: // start length slot name signature // 0 163 0 paramSQLiteDatabase SQLiteDatabase // 0 163 1 paramInt int // 0 163 2 paramString String // 156 6 3 localObject1 Object // 7 36 4 str1 String // 15 30 5 arrayOfString1 String[] // 20 27 6 str2 String // 26 23 7 arrayOfString2 String[] // 62 85 8 localCursor Cursor // 65 77 9 i int // 144 10 10 localObject2 Object // 82 33 11 localMediaRecordEntry MediaRecordEntry // Exception table: // from to target type // 67 120 144 finally // 126 130 144 finally // 4 64 156 finally // 130 137 156 finally // 146 156 156 finally } static int b(hci paramhci, int paramInt1, int paramInt2) { if (paramInt1 == -1) { return 0; } SQLiteDatabase localSQLiteDatabase = paramhci.getReadableDatabase(); String str = d; String[] arrayOfString = new String[2]; arrayOfString[0] = Integer.toString(paramInt1); arrayOfString[1] = Integer.toString(paramInt2); return (int)DatabaseUtils.longForQuery(localSQLiteDatabase, str, arrayOfString); } public static MediaRecordEntry b(hci paramhci, int paramInt) { String str; String[] arrayOfString; if (paramInt == -1) { str = "upload_account_id != -1 AND upload_state = 100"; arrayOfString = null; } for (;;) { Cursor localCursor = paramhci.getReadableDatabase().query(a, MediaRecordEntry.a.b, str, arrayOfString, null, null, "upload_reason ASC, upload_state ASC, upload_status ASC, is_image DESC, retry_end_time ASC LIMIT 1"); try { if (localCursor.moveToNext()) { MediaRecordEntry localMediaRecordEntry = MediaRecordEntry.a(localCursor); return localMediaRecordEntry; str = "upload_account_id = ? AND upload_state = 100"; arrayOfString = new String[1]; arrayOfString[0] = Integer.toString(paramInt); continue; } return null; } finally { localCursor.close(); } } } public static int c(hci paramhci, int paramInt) { SQLiteDatabase localSQLiteDatabase = paramhci.getReadableDatabase(); String str = c; String[] arrayOfString = new String[1]; arrayOfString[0] = Integer.toString(paramInt); return (int)DatabaseUtils.longForQuery(localSQLiteDatabase, str, arrayOfString); } static void c(hci paramhci, int paramInt1, int paramInt2) { if (paramInt1 == -1) { throw new IllegalStateException(52 + "can't enable upload for invalid account: " + paramInt1); } SQLiteDatabase localSQLiteDatabase1 = paramhci.getWritableDatabase(); int i = 0; for (;;) { localSQLiteDatabase1.beginTransaction(); try { int j = a(localSQLiteDatabase1, paramInt1, 40); localSQLiteDatabase1.setTransactionSuccessful(); localSQLiteDatabase1.endTransaction(); i += j; if (j <= 0) { if (Log.isLoggable("iu.UploadsManager", 4)) { new StringBuilder(35).append("START; scheduled ").append(i).append(" photos"); } SQLiteDatabase localSQLiteDatabase2 = paramhci.getReadableDatabase(); String str = a; String[] arrayOfString1 = MediaRecordEntry.a.b; String[] arrayOfString2 = new String[1]; arrayOfString2[0] = Integer.toString(paramInt1); Cursor localCursor = localSQLiteDatabase2.query(true, str, arrayOfString1, "upload_account_id = ? AND upload_state = 300", arrayOfString2, null, null, null, null); MediaRecordEntry localMediaRecordEntry; localCursor.close(); } } finally {} } } /* Error */ static int d(hci paramhci, int paramInt) { // Byte code: // 0: aload_0 // 1: invokevirtual 260 hci:getReadableDatabase ()Landroid/database/sqlite/SQLiteDatabase; // 4: iconst_1 // 5: getstatic 22 hbm:a Ljava/lang/String; // 8: iconst_1 // 9: anewarray 26 java/lang/String // 12: dup // 13: iconst_0 // 14: ldc_w 404 // 17: aastore // 18: ldc_w 406 // 21: aconst_null // 22: aconst_null // 23: aconst_null // 24: aconst_null // 25: aconst_null // 26: invokevirtual 142 android/database/sqlite/SQLiteDatabase:query (ZLjava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor; // 29: astore_2 // 30: aload_2 // 31: invokeinterface 98 1 0 // 36: ifeq +25 -> 61 // 39: aload_2 // 40: iconst_0 // 41: invokeinterface 409 2 0 // 46: istore 5 // 48: iload 5 // 50: istore 4 // 52: aload_2 // 53: invokeinterface 121 1 0 // 58: iload 4 // 60: ireturn // 61: iconst_0 // 62: istore 4 // 64: goto -12 -> 52 // 67: astore_3 // 68: aload_2 // 69: invokeinterface 121 1 0 // 74: aload_3 // 75: athrow // Local variable table: // start length slot name signature // 0 76 0 paramhci hci // 0 76 1 paramInt int // 29 40 2 localCursor Cursor // 67 8 3 localObject Object // 50 13 4 i int // 46 3 5 j int // Exception table: // from to target type // 30 48 67 finally } } /* Location: F:\apktool\apktool\com.google.android.apps.plus\classes-dex2jar.jar * Qualified Name: hbm * JD-Core Version: 0.7.0.1 */
{'content_hash': '7a0744910524651372847a2df967f466', 'timestamp': '', 'source': 'github', 'line_count': 547, 'max_line_length': 376, 'avg_line_length': 38.04753199268738, 'alnum_prop': 0.6075341149336921, 'repo_name': 'ChiangC/FMTech', 'id': 'e2130c80069385b9bc76776af795a61f615ab637', 'size': '20812', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'GooglePlus/app/src/main/java/hbm.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C++', 'bytes': '935'}, {'name': 'CMake', 'bytes': '1767'}, {'name': 'HTML', 'bytes': '28061'}, {'name': 'Java', 'bytes': '47051212'}, {'name': 'JavaScript', 'bytes': '1535'}, {'name': 'Makefile', 'bytes': '5823'}]}
import { Component } from '@angular/core'; @Component({ templateUrl: 'index.html', styleUrls: ['index.css'], }) export class Home { }
{'content_hash': 'db90c23e0b2c7340190c522b21f4c61e', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 28, 'avg_line_length': 14.4, 'alnum_prop': 0.6319444444444444, 'repo_name': 'MiningTheDisclosures/conflict-minerals-data', 'id': '221fc21ccf27026a2ab8cd0402a118631cce1c7a', 'size': '144', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'conflict_minerals_data/frontend/app/components/home/index.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2784'}, {'name': 'HTML', 'bytes': '4624'}, {'name': 'JavaScript', 'bytes': '4426886'}, {'name': 'Jupyter Notebook', 'bytes': '69090'}, {'name': 'Python', 'bytes': '37833'}, {'name': 'TypeScript', 'bytes': '15706'}]}
var params = { tables: 14, currentTable: 0, currentQuestion: -1 }; var questions = [ { q: "¿Cuál es el color preferido de Silvina?", o: [ "Verde", "Amarillo", "Azul" ], a: 1 }, { q: "¿A qué edad salió Pablo del closet?", o: [ "15", "18", "Hoy" ], a: 0 }, { q: "¿Quién se tomó todo el vino?", o: [ "La mona Gimenez", "Silchu", "Pablo" ], a: 2 }, { q: "¿Cual de estas prendas no usaria pablo?", o: [ "Pollera", "Zapatos con taco", "Medias de red" ], a: 0 } ]; $().ready(function() { var nextTable = function() { params.currentTable++; params.currentQuestion = -1; next(); }; var showQuestion = function() { var question = questions[params.currentQuestion]; $('#question').text(question.q); $('#answers').empty(); for (var i in question.o) { var value = question.o[i]; $('#answers').append($('<button />').addClass('btn btn-danger').text(value)); } $('#prev').toggle(params.currentQuestion > 0); $('#next').attr('disabled', 'disabled').toggle(params.currentQuestion <= questions.length); }; var next = function() { if (params.currentQuestion == questions.length) nextTable(); params.currentQuestion++; showQuestion(); }; var prev = function() { params.currentQuestion--; showQuestion(); }; $('#next').click(next); $('#prev').click(prev); $('#answers').on('click', 'button', function() { $('#next').removeAttr('disabled'); }); nextTable(); });
{'content_hash': 'c32d1c14b830626baec26c3dc2a7bdbd', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 111, 'avg_line_length': 27.24074074074074, 'alnum_prop': 0.5764785859959212, 'repo_name': 'eduardocampano/silpa', 'id': '81b1ba090fe9d9169bc05d5c7fa7116df600be4e', 'size': '1480', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'main.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '932'}, {'name': 'JavaScript', 'bytes': '3872'}]}
import { Component } from '@angular/core'; @Component({ selector: 'footer-sticky', template: require('./footer-sticky.component.html') }) export class FooterStickyComponent { }
{'content_hash': '76260f14e5990339d57e3415c7bb4857', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 55, 'avg_line_length': 23.25, 'alnum_prop': 0.7043010752688172, 'repo_name': 'SokolovArtur/aspnetcore', 'id': '9cf36526eac1961a6fad2ec214e0bc51eb986b27', 'size': '186', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'AspNetCore/ClientApp/app/home/components/footer-sticky/footer-sticky.component.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '80925'}, {'name': 'CSS', 'bytes': '822940'}, {'name': 'HTML', 'bytes': '1533815'}, {'name': 'JavaScript', 'bytes': '2540296'}, {'name': 'PHP', 'bytes': '153457'}, {'name': 'Shell', 'bytes': '7411'}, {'name': 'TypeScript', 'bytes': '5338'}]}
struct QVariantMeshWrapper { QVariantMeshWrapper() {} Ogre::Item* item; }; Q_DECLARE_METATYPE(QVariantMeshWrapper); SaveAsDialog::SaveAsDialog(QWidget* parent, OgreManager* ogre) : QDialog(parent) { ui = new Ui::SaveAsDialog; ui->setupUi(this); mOgre = ogre; ui->progressBar->setVisible(false); connect(ui->browseButton, &QPushButton::clicked, this, &SaveAsDialog::browseButtonClicked); connect(ui->saveButton, &QPushButton::clicked, this, &SaveAsDialog::saveButtonClicked); connect(ui->cancelButton, &QPushButton::clicked, this, &SaveAsDialog::cancelButtonClicked); } SaveAsDialog::~SaveAsDialog() { delete ui; } void SaveAsDialog::showEvent(QShowEvent*) { if (!mInitialized) { ui->savePathText->setText(mOutputFolder); listAllMeshesFromScene(); mInitialized = true; } } void SaveAsDialog::browseButtonClicked() { QString initialPath = ui->savePathText->text(); QString folder = QFileDialog::getExistingDirectory(this, "Output path", initialPath); if (!folder.isEmpty()) { ui->savePathText->setText(folder); mOutputFolder = folder; } } void SaveAsDialog::saveButtonClicked() { lockListWidget(); std::vector<Ogre::Item*> ogreItems; QListWidget* listWidget = ui->listWidget; for (int i = 0; i < listWidget->count(); ++i) { QListWidgetItem* item = listWidget->item(i); bool checked = (item->checkState() == Qt::Checked); if (checked) { auto wrapper = item->data(Qt::UserRole).value<QVariantMeshWrapper>(); ogreItems.push_back(wrapper.item); } } ui->progressBar->setVisible(true); ui->progressBar->setMaximum(ogreItems.size()); QApplication::processEvents(QEventLoop::DialogExec); saveOgreMeshes(ogreItems); Ogre::SceneNode* rootNode = mOgre->meshRootNode(); std::vector<Ogre::SceneNode*> nodes; collectNodeRecursively(rootNode, nodes); saveLuaScript(nodes, ogreItems); QSettings settings("OgreV2ModelViewer", "OgreV2ModelViewer"); settings.setValue("actionSaveMesh", mOutputFolder); accept(); } void SaveAsDialog::cancelButtonClicked() { reject(); } void SaveAsDialog::listAllMeshesFromScene() { Ogre::SceneNode* node = mOgre->meshRootNode(); std::vector<Ogre::Item*> items; collectMeshRecursively(node, items); for (const Ogre::Item* m : items) { qDebug() << m->getName().c_str(); } createListItems(items); } void SaveAsDialog::collectMeshRecursively(Ogre::SceneNode* node, std::vector<Ogre::Item*>& ogreItems) { size_t count = node->numAttachedObjects(); for (size_t i = 0; i < count; ++i) { Ogre::Item* item = dynamic_cast<Ogre::Item*>(node->getAttachedObject(i)); if (item) { ogreItems.push_back(item); } } for (int i = 0; i < node->numChildren(); ++i) { Ogre::SceneNode* child = static_cast<Ogre::SceneNode*>(node->getChild(i)); collectMeshRecursively(child, ogreItems); } } void SaveAsDialog::collectNodeRecursively(Ogre::SceneNode* node, std::vector<Ogre::SceneNode*>& ogreNodes) { ogreNodes.push_back(node); for (int i = 0; i < node->numChildren(); ++i) { Ogre::SceneNode* child = static_cast<Ogre::SceneNode*>(node->getChild(i)); collectNodeRecursively(child, ogreNodes); } } void SaveAsDialog::createListItems(const std::vector<Ogre::Item*>& ogreItems) { for (Ogre::Item* i : ogreItems) { QString meshName = QString::fromStdString(i->getName()); QListWidgetItem* listItem = new QListWidgetItem(meshName, ui->listWidget); listItem->setFlags(listItem->flags() | Qt::ItemIsUserCheckable); listItem->setCheckState(Qt::Checked); QVariantMeshWrapper wrapper; wrapper.item = i; listItem->setData(Qt::UserRole, QVariant::fromValue(wrapper)); ui->listWidget->addItem(listItem); } //QSignalBlocker b(ui->selectAllCheckbox); //ui->selectAllCheckbox->setChecked(true); } void SaveAsDialog::lockListWidget() { QListWidget* listWidget = ui->listWidget; for (int i = 0; i < listWidget->count(); ++i) { QListWidgetItem* item = listWidget->item(i); item->setFlags(Qt::NoItemFlags); } QApplication::processEvents(QEventLoop::DialogExec); } void SaveAsDialog::saveOgreMeshes(const std::vector<Ogre::Item*>& ogreItems) { for (int i = 0; i < ogreItems.size(); ++i) { applySubMeshMaterialNames(ogreItems[i]); QString meshName = validateFileName(QString::fromStdString(ogreItems[i]->getMesh()->getName())); QString fullPath = QDir(mOutputFolder).filePath(meshName); Ogre::Mesh* mesh = ogreItems[i]->getMesh().get(); Ogre::Root* root = mOgre->ogreRoot(); Ogre::MeshSerializer meshSerializer2(root->getRenderSystem()->getVaoManager()); meshSerializer2.exportMesh(mesh, fullPath.toStdString()); saveHlmsJson(ogreItems[i]); ui->progressBar->setValue(i + 1); QApplication::processEvents(QEventLoop::DialogExec); } } void SaveAsDialog::saveHlmsJson(const Ogre::Item* ogreItem) { auto hlmsManager = Ogre::Root::getSingleton().getHlmsManager(); size_t numSubItem = ogreItem->getNumSubItems(); for (int i = 0; i < numSubItem; ++i) { Ogre::HlmsDatablock* datablock = ogreItem->getSubItem(i)->getDatablock(); Ogre::HlmsJson hlmsJson(hlmsManager, nullptr); std::string outJson; hlmsJson.saveMaterial(datablock, outJson, ""); QString outputPath = QDir(mOutputFolder).filePath(datablock->getNameStr()->c_str()); if (!outputPath.endsWith(".material.json")) { outputPath.append(".material.json"); } QFile f(outputPath); if (f.open(QFile::WriteOnly)) { QTextStream fout(&f); fout.setCodec("UTF-8"); fout << QString::fromStdString(outJson); } f.close(); qDebug() << "Write Hlms Json: " << outputPath; } } QString SaveAsDialog::validateFileName(QString fileName) { if (fileName.endsWith(" (v1)")) { fileName = fileName.mid(0, fileName.size() - 5); // remove the (v1) part } if (fileName.endsWith(".mesh.xml")) { fileName = fileName.mid(0, fileName.size() - 4); // remove the .xml part } if (!fileName.endsWith(".mesh")) { fileName.append(".mesh"); // make sure the file extension is .mesh } return fileName; } void SaveAsDialog::applySubMeshMaterialNames(Ogre::Item* ogreItem) { // Otherwise the exported mesh won't contain the material name. // Check OgreMesh2SerializerImpl.cpp line 269 (in MeshSerializerImpl::writeSubMesh()) size_t numSubItems = ogreItem->getNumSubItems(); for (size_t i = 0; i < numSubItems; ++i) { std::string datablockName = *ogreItem->getSubItem(i)->getDatablock()->getNameStr(); ogreItem->getSubItem(i)->getSubMesh()->setMaterialName(datablockName); } } void SaveAsDialog::saveLuaScript(const std::vector<Ogre::SceneNode*>& nodes, const std::vector<Ogre::Item*>& ogreItems) { // This function is just for my engine. QString fileName = "mesh_load2.lua"; QString fullPath = QDir(mOutputFolder).filePath(fileName); QFile f(fullPath); if (!f.open(QFile::WriteOnly)) return; QTextStream fout(&f); fout << "local node_list = {}\n"; for (size_t i = 0; i < nodes.size(); ++i) { Ogre::SceneNode* node = nodes[i]; Ogre::Vector3 pos = node->getPosition(); const Ogre::Quaternion quaternion = node->getOrientation(); Ogre::Matrix3 matrix3; quaternion.ToRotationMatrix(matrix3); Ogre::Radian rx, ry, rz; matrix3.ToEulerAnglesXYZ(rx, ry, rz); Ogre::Vector3 scale = node->getScale(); QString parentNodeName = (node == mOgre->meshRootNode()) ? "main_building" : QString::fromStdString(node->getParent()->getName()); QString line = QString("node_list[%1] = { name=\"%2\", pos={x=%3, y=%4, z=%5}, rot={x=%6, y=%7, z=%8}, scale={x=%9, y=%10, z=%11}, parent=\"%12\" }") .arg(i) .arg(node->getName().c_str()) .arg(pos.x, 0, 'f', 4) .arg(pos.y, 0, 'f', 4) .arg(pos.z, 0, 'f', 4) .arg(rx.valueDegrees(), 0, 'f', 4) .arg(ry.valueDegrees(), 0, 'f', 4) .arg(rz.valueDegrees(), 0, 'f', 4) .arg(scale.x, 0, 'f', 4) .arg(scale.y, 0, 'f', 4) .arg(scale.z, 0, 'f', 4) .arg(parentNodeName); fout << line << "\n"; } QString funcNodes = "" "\n" "function create_nodes() \n" "\n" " for key, value in pairs(node_list) do \n" " local node_name = value.name \n" " log_info(key .. ': ' .. node_name) \n" "\n" " local parent_node = get_object_by_name(value.parent) \n" "\n" " local node = create_persistent_object('CSceneNodeOgre') \n" " node:set_name(node_name) \n" " node:set_ref('Parent', parent_node) \n" " node:set_vec3('Position', { x = value.pos.x, y = value.pos.y, z = value.pos.z }) \n" " node:set_vec3('Rotation', { x = value.rot.x, y = -value.rot.y, z = value.rot.z }) \n" " node:set_vec3('Scale', { x = value.scale.x, y = value.scale.y, z = value.scale.z }) \n" " node:set_bool('Is Pickable', false) \n" " node:signal_attribute('Parent') \n" " node:signal_attribute('Name') \n" " node:signal_attribute('Position') \n" " node:signal_attribute('Rotation') \n" " node:signal_attribute('Scale') \n" " end \n" "end \n"; fout << funcNodes; fout.flush(); fout << "local mesh_list = {}\n"; for (size_t i = 0; i < ogreItems.size(); ++i) { Ogre::Item* item = ogreItems[i]; QString line = QString("mesh_list[%1] = { name=\"Mesh_%2\", mesh=\"%3\", parent=\"%4\" }") .arg(i) .arg(QString::fromStdString(item->getName())) .arg(QString::fromStdString(item->getMesh()->getName())) .arg(QString::fromStdString(item->getParentNode()->getName())); fout << line << "\n"; } fout << "\n"; QString func = "\n" "function create_meshes() \n" " local mesh_map = {} \n" " for key, value in pairs(mesh_list) do \n" " local path = 'script/' .. value.mesh .. '.mesh' \n" " log_info(path) \n" "\n" " local parent_node = get_object_by_name(value.parent) \n" "\n" " local mesh = mesh_map[value.mesh]\n" " if mesh == nil then\n" " mesh = create_persistent_object('COgreMesh')\n" " mesh:set_string('Path', path)\n" " mesh_map[value.mesh] = mesh\n" " end\n" "\n" " local node = create_persistent_object('CSceneNodeOgreMesh') \n" " node:set_name(value.name) \n" " node:set_ref('Ogre Mesh', mesh) \n" " node:set_ref('Parent', parent_node) \n" " node:set_bool('Is Pickable', false) \n" " node:signal_attribute('Parent') \n" " node:signal_attribute('Name') \n" " end \n" "end \n"; fout << func; fout << "\n" "function go()\n" " create_nodes()\n" " create_meshes()\n" "end"; fout.flush(); f.close(); }
{'content_hash': '1af4e233bb5e21aaa90206b14f9ccf9c', 'timestamp': '', 'source': 'github', 'line_count': 382, 'max_line_length': 157, 'avg_line_length': 30.853403141361255, 'alnum_prop': 0.5774647887323944, 'repo_name': 'chchwy/ogre-v2-mesh-viewer', 'id': '5ecc5f4d6f1de3661f6d9d71b7706fe6042b6412', 'size': '12045', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'src/saveasdialog.cpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '1004'}, {'name': 'C', 'bytes': '293672'}, {'name': 'C++', 'bytes': '1424407'}, {'name': 'GLSL', 'bytes': '143159'}, {'name': 'HLSL', 'bytes': '115917'}, {'name': 'Metal', 'bytes': '92848'}, {'name': 'QMake', 'bytes': '3811'}]}