query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
TODO: Write a function named getLowestNumber that takes in 3 arguments. If all 3 inputs are numbers or numeric strings, then return the lowest number. If any of the 3 inputs is missing or nonnumeric, then return false. | function getLowestNumber(x, y, z) {
if (isNaN(x) || isNaN(y) || isNaN(z)) {
return false;
} else {
return Math.min(x, y, z);
}
} | [
"function minimum3(a, b, c) {\n if (a <= b && a <= c) {\n return a + \" is smallest\";\n } else if (b <= a && b <= c) {\n return b + \" is smallest\";\n } else if (c <= a && c <= b) {\n return c + \" is smallest\";\n }\n}",
"findSmallestInt(args) {\n/*return Math.min() static func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if corner3 is ready to be placed in | function checkCorner3(cube) {
if( ((cube[up][0][0] == 'G') && (cube[back][2][0] == 'W') && (cube[left][0][0] == 'O')) || ((cube[up][0][0] == 'W') && (cube[back][2][0] == 'O') && (cube[left][0][0] == 'G')) || ((cube[up][0][0] == 'O') && (cube[back][2][0] == 'G') && (cube[left][0][0] == 'W')) ) return true;
else re... | [
"function checkCorner4(cube) {\n if( ((cube[up][2][0] == 'R') && (cube[right][2][0] == 'W') && (cube[back][0][0] == 'G')) || ((cube[up][2][0] == 'W') && (cube[right][2][0] == 'G') && (cube[back][0][0] == 'R')) || ((cube[up][2][0] == 'G') && (cube[right][2][0] == 'R') && (cube[back][0][0] == 'W')) ) return true;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
qcontent = qtext / quotedpair | function qcontent() {
return wrap('qcontent', or(qtext, quotedPair)());
} | [
"visitQuoted_string(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function getBlockQuote() {\r\n\t\t\tvar result = $scope.replyContent\r\n\t\t\t\t\t + \"<blockquote class=\\\"gmail_quote\\\" \" \r\n\t\t\t\t\t + \"style=\\\"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex\\\">\"\r\n\t\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Play a list of sound files, with optional time in between. | function sounds(soundlist, between, onComplete) {
var soundIdx = 0;
if(!between){
between = 0;
}
waitSoundInit(function() {
var playNext = function () {
if (soundIdx < soundlist.length) {
var soundpath = soundlist[soundIdx];
var sound;
if (soundpath in _preloadedSounds) {
... | [
"function play_sound(sounds) {\n\tvar max = 4;\n\tfor (var i = 0; i < max; i++) {\n\t\tif (sounds[i] != '') {\n\t\t\tallSounds[allSoundNames.indexOf(sounds[i])].play();\n\t\t}\n\t}\n}",
"function playAudio(filename){\n\tif (soundEnabled) {\n\t\tvar audio = new Audio(\"audio/\" + filename) ;\n\t\taudio.play();\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
throw blocked indefinitely exception to the first thread waiting on an unreferenced MVar | function h$finalizeMVars() {
;
var i, t, iter = h$blocked.iter();
while((t = iter.next()) !== null) {
if(t.status === h$threadBlocked && t.blockedOn instanceof h$MVar) {
// if h$unboxFFIResult is the top of the stack, then we cannot kill
// the thr... | [
"flushedWriteRetainingLock() {\n throw new Error(); // make a stupid call, get a stupid error.\n }",
"verifyNotTerminated() {\n if (this.asyncQueue.isShuttingDown) throw new K(q.FAILED_PRECONDITION, \"The client has already been terminated.\");\n }",
"function rejected(x){\n\t if(async) context = cat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
render a piece on the editor nd stuff | function render_editor()
{
// first get the piece to make show up
var piece = get_selected_piece();
// get the pixel width and height to set the canvas
// add space for the extra grid pixels
var canvas_width = tile_size * piece.width + grid_thickness;
var canvas_height = tile_size * piece.height + grid_thickness... | [
"render() {\n this.snippet = new vscode_1.SnippetString();\n this.spacer = new spacer_helper_1.SpacerHelper(this.snippet, this.eol);\n this.entities.forEach((entity, index, entities) => {\n if (!this.shouldRenderEntity(entity)) {\n return;\n }\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This represents an screenshot for an addon | function AddonScreenshot(aURL, aWidth, aHeight, aThumbnailURL,
aThumbnailWidth, aThumbnailHeight, aCaption) {
this.url = aURL;
if (aWidth) this.width = aWidth;
if (aHeight) this.height = aHeight;
if (aThumbnailURL) this.thumbnailURL = aThumbnailURL;
if (aThumbnailWidth) this.thumbnail... | [
"function captureScreen() {\n chrome.tabs.captureVisibleTab({format: 'png'}, function (imgData) {\n sendMessage('saveImg', imgData)\n });\n}",
"function captureScreenshot() {\n setTimeout(() => {\n Page.captureScreenshot({ format: 'png' }).then(afterCapture);\n },... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the server to join a voice channel NOTE: this is async, so if you want to run a continuation use the callback. | joinVoiceChannel(channel_id, callback) {
var server = this;
if (!callback) callback = function () { };
if (server.current_voice_channel_id == channel_id) return Common.error('joinVoiceChannel(' + channel_id + '): ohhoooo çokan buradayım');
if (server.connecting) return Common.error('joinVoiceChannel(' ... | [
"function JoinCommand(channelName) { \r\n var voiceChannel = GetChannelByName(channelName); \r\n \r\n if (voiceChannel) { \r\n voiceChannel.join(); \r\n console.log(\"Joined \" + voiceChannel.name); \r\n } \r\n \r\n return voiceChannel; \r\n }",
"function getVo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to filter country | function filterCountry(aliens) {
return aliens.country == $countryInput.value.trim().toLowerCase();
} | [
"function searchByCountryName() {\n const selectedCountryName = convertToLowerCase(select.value);\n result = products.filter(item => {\n return item.shipsTo.some(shippingCountry => {\n return convertToLowerCase(shippingCountry) === select.value;\n });\n });\n renderProducts(result);\n}",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
In the 'AwaitingWithBuffer' state, the client is waiting for an operation to be acknowledged by the server while buffering the edits the user makes | function AwaitingWithBuffer (outstanding, buffer) {
// Save the pending operation and the user's edits since then
this.outstanding = outstanding;
this.buffer = buffer;
} | [
"processNextBufferUpdate(editor:atom$TextEditor) {\n const bufferNumber = editor[$$textEditorBufferNumber];\n invariant(bufferNumber != null, 'Expected processNextBufferUpdate to be called only once editor has buffer matched to it');\n const updates = this.queuedBufferUpdates[bufferNumber] || [... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function ajax call to Destroy Company | function destroyCompany(target_id, page){
var myThis = this;
$.ajax({
url: '/company/delete/' + target_id,
data: {
"_token": $('meta[name="csrf-token"]').attr('content'),
id: target_id
},
success: function(results){
getCompanies(page);
console.log('s... | [
"delete(req, res) {\n Model.Company.destroy({\n where: {\n id: req.params.id\n }\n })\n .then(function (deletedRecords) {\n res.status(200).json(deletedRecords);\n })\n .catch(function (error){\n res.status(500).json(error);\n });\n }",
"function deleteLead(leadId) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function LMSGetStudentName() Inputs:none Return:Full name of the Stdent as stored by the LMS Description: Note: The student_name is a read only field in SCORM and there is no corresponding SetValue | function LMSGetStudentName()
{
return(LMSGetValue("cmi.core.student_name"))
} | [
"function LMSGetStudentID()\n{\n\treturn(LMSGetValue(\"cmi.core.student_id\"))\n}",
"function getStudentNames(students) {\n\treturn students.map( x => x.name);\n}",
"function SBR_display_student() {\n //console.log(\"===== SBR_display_student =====\");\n t_MSSSS_display_in_sbr(\"student\", setting... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Question Two Write a function that takes in a callback and a boolean. If the boolean is true, call the callback, otherwise log "Ignoring the callback" to the console. | function callback2(callback, boolean){
if (boolean === true) {
return callback
} else {
console.log("Ignoring the callback.")
}
} | [
"static checkCallbackFnOrThrow(callbackFn){if(!callbackFn){throw new ArgumentException('`callbackFn` is a required parameter, you cannot capture results without it.');}}",
"hasCallback() {}",
"function callback(callback){\n callback()\n}",
"function check(callback,input){\n try{\n return callback(i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET TEXT "A" ICON WITH A BOX SURROUNDING | function getTextBoxIcon(x,y,s){
var result=getTextIcon(x,y,s);
var ss=s*1.2;
result=result+getRectToPath(x-ss/2,y-ss/2,ss,ss);
return result;
} | [
"function getLineIcon(x,y,s){\n\tvar result=\"M\"+(x-s/2)+\" \"+(y+s/2)+\",\";\n\tresult=result+\"L\"+(x+s/2)+\" \"+(y-s/2);\n\t\n\treturn result;\n}",
"drawIcon() {\n return `<i class=\"fab fa-sketch\"></i>`\n }",
"function drawBackgroundText() {\n textSize(24);\n fill(255);\n textFont(promptFont)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shortcut for setting seperator prefix and suffix to the same string | set surround_seperator(string){
this.seperator_prefix = string
this.seperator_suffix = string
} | [
"function Separator() { bind.Separator(); }",
"get seperator() { return this._seperator }",
"set surround_key(string){ \n this.key_prefix = string\n this.key_suffix = string\n }",
"function addSeparatorsNF(nStr, inD, outD, sep)\n{\n\tnStr += '';\n\tvar dpos = nStr.indexOf(inD);\n\tvar nStrEnd = '';\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates Counter of items (if add is false decrease the counter) | function updateNitems(add=true){
if(add){
nItems++;
}else{
nItems--;
}
document.getElementById( "counter" ).innerHTML =nItems+" items";
} | [
"addItem() {\n this.setState({\n itemCount: this.state.itemCount + 1\n });\n }",
"function updateUncheckedCountSpan(incr) {\n uncheckedCountSpan.innerHTML = parseInt(uncheckedCountSpan.innerHTML) + incr\n}",
"countDecrease(item) {\n if (item.count <= 1) {\n this.ms... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a behavior for the provided target node. | createBehavior(target) {
return new this.behavior(target, this.options);
} | [
"static registerTarget(creep, target, range, priority) {\n if (!target) return;\n if (!creep) return;\n if (target.pos) target = target.pos;\n if (!range) range = 1;\n if (!priority) priority = 1;\n if (!creep.memory._trav) creep.memory._trav = {};\n if (this.isExit(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called to position the wrapper div fixed (if not IE7 or FF) | function PositionWrapper(){
//define universal dsoc left point
var dsocleft=document.all? iebody.scrollLeft : pageXOffset;
//define universal dsoc top point
var dsoctop=document.all? iebody.scrollTop : pageYOffset;
//if the user is using IE 4+ or Firefox/ NS6+
if (document.all||document.... | [
"function setHeaderPositonForDiv()\r\n{\r\n var ctHeader;\r\n if(!IE)\r\n {\r\n ctHeader = getElemnt(\"changeTrackingHeader\");\r\n if(ctHeader)\r\n {\r\n ctHeader.style.position = \"relative\";\r\n }\r\n }\r\n}",
"function initFixedScrollBlock() {\n jQuery('#... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
renders the select dropdox menu for choosing the datatypes in the overlay | function renderTypeOptions(overlay, currentType, datatypes) {
var selectedFound = false;
for (var i = 0; i < datatypes.length; i++) {
var selected = '';
if (datatypes[i] == currentType && !selectedFound) {
selected = ' selected';
selectedFound = true;
}
va... | [
"renderSelect() {\n const options = {\n 0: 'Present',\n 1: 'Unexcused Absent',\n 2: 'Excused Absent',\n 3: 'Unexcused Late',\n 4: 'Excused Late'\n }\n\n const optionsAbbrev = {\n 0: 'Present',\n 1: 'UA',\n 2: 'EA',\n 3: 'UL',\n 4: 'EL'\n }\n\n const o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
resets the display value to 0 | clearDisplay() {
const {displayValue} = this.state
this.setState({
displayValue: '0'
})
} | [
"function clearDisplay(val){\n\t\tprimaryOutput.innerHTML = \"\";\t\n\t\tif (val === \"AC\") {\n\t\t\ttotal = 0;\n\t\t\tsecondaryOutput.innerHTML = \"\";\n\t\t\tsecondaryOutput.style.right = \"0px\";\n\t\t\tlastOperator.length = 0;\n\t\t}\n\t}",
"function clearEntry() {\n changeDisplay('0');\n }",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the heights of the z vertex in triangles using the diamondsquare algorithm | changeHeights() {
//1) Initalize height of four corners to random value (between 0 and 1)
this.vBuffer[2] = Math.random()*0.5;
this.vBuffer[this.numVertices*3 - 1] = Math.random()*0.5;
this.vBuffer[this.div*3 + 2] = Math.random()*0.5;
this.vBuffer[this.numVertices*3 - 1 - th... | [
"function fit3D( d, h, x, y, z){\n\t// three possible orientations\n\tvar\n\t a= fit2D( d, x, y),\n\t b= fit2D( d, x, z),\n\t c= fit2D( d, y, z)\n\t// calculate how many deep\n\ta.z= z\n\ta.depth= Math.floor( z/ h)\n\ta.freeZ= z- ( a.depth* h)\n\ta.count*= a.depth\n\n\tb.z= y\n\tb.depth= Math.floor( y/ h)\n\tb.f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PRIVATE Helper method. Returns a random tetronimo type other than random. | _randomType() {
const validTypes = Object.keys(TETRONIMO_TYPES).filter(t => t !== TETRONIMO_TYPES.RANDOM);
const key = Math.floor(Math.random() * (validTypes.length));
return validTypes[key];
} | [
"function getRandomHowl(type){\n var howls = successHowls;\n\n if(type == \"success\" || type == \"Success\"){\n var howls = successHowls;\n } else if(type == \"failure\" || type == \"Failure\"){\n var howls = failureHowls;\n } else {\n return {};\n }\n\n var randomIndex = Mat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tabs hook to manage each tab button. A tab can be disabled and focusable, or both, hence the use of `useClickable` to handle this scenario | function useTab(props) {
var {
isDisabled,
isFocusable
} = props,
htmlProps = _objectWithoutPropertiesLoose(props, ["isDisabled", "isFocusable"]);
var {
setSelectedIndex,
isManual,
id,
setFocusedIndex,
enabledDomContext,
domContext,
selectedIndex
} = useTabsContext();
... | [
"renderTabBar() {\n return (\n <ul\n className={classNames({\n 'usaf-tab-group__tabs': this.props.type === 'tab',\n 'usaf-tab-group__pills': this.props.type === 'pill'\n })}\n >\n {\n this.childrenArray.map(\n (child, index) => (\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isApplicative : a > Boolean | function isApplicative(m) {
return isApply(m)
&& (hasAlg('of', m) || hasAlg('of', m.constructor))
} | [
"function isApplicativeRepr(Repr) {\n\t return typeof Repr[$of] === 'function' &&\n\t typeof Repr[$of] ()[$ap] === 'function';\n\t }",
"function is_predef_app(name) {\n var rule = get_predefined_rules(name);\n\n if(rule.length) {\n rule = rule.split(\"\\x02\");\n if(rule[_categor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save currencies to IDB | function saveCurrenciesListtoIDB(key, value) {
return idbPromise
.then(db => {
const transaction = db.transaction('currencyConverter', 'readwrite');
const objectStore = transaction.objectStore('currencyConverter');
objectStore.put(value, key);
... | [
"function saveCurrencyConversionRatetoIDB(key, value) {\n return idbPromise\n .then(db => {\n const transaction = db.transaction('currencyConverter', 'readwrite');\n const objectStore = transaction.objectStore('currencyConverter');\n\n objectStore.put(v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserindex_name. | visitIndex_name(ctx) {
return this.visitChildren(ctx);
} | [
"visitIndex_expr(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitNew_index_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitIndextype_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitTable_index_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitLocal_xmlindex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
abstraction for converting each row object into user object for better modularity | function convertIntoUserObjects(rows) {
var userObjects = [];
rows.forEach( function(item) {
var user = new User();
user.setId(item.id)
.setSalutation(item.salutation)
.setFirstName(item.first_name)
.setMiddleName(item.middle_name)
.setLastName(ite... | [
"function objectizeRowData(_row) {\r\n\tiobj = new Object();\r\n\tiobj.id = _row.getValue(_row.getAllColumns()[0].getName(),_row.getAllColumns()[0].getJoin()); //internal id\r\n\tiobj.cfrom = _row.getValue(_row.getAllColumns()[1].getName(),_row.getAllColumns()[1].getJoin()); //created from (Linked Trx)\r\n\tiobj.tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the line and columnbased `position` for `offset` in the bound indices. | function offsetToPosition(offset) {
var index = -1;
var length = indices.length;
if (offset < 0) {
return {}
}
while (++index < length) {
if (indices[index] > offset) {
return {
... | [
"function lineColPositionFromOffset(offset, lineBreaks) {\n let line = remix_lib_1.util.findLowerBound(offset, lineBreaks);\n\n if (lineBreaks[line] !== offset) {\n line += 1;\n }\n\n const beginColumn = line === 0 ? 0 : lineBreaks[line - 1] + 1;\n return {\n line: line + 1,\n character: offset - begi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a timestamp in seconds with milliseconds precision. | function timestampWithMs() {
return Date.now() / 1000;
} | [
"function getSecs(ms){\n if(ms)\n return (new Date().getTime() );\n else\n return (new Date().getTime() / 1000);\n}",
"function convertToMilliseconds(timestamp) {\n var numbers = timestamp.match(/(\\d{2}):(\\d{2}):(\\d{2})\\.(\\d{3})/);\n var [stamp, hours, minutes, seconds, milliseconds] = numbers.map(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return UI for radio button,receive items in props | function RadioButton(props) {
return (
<div className={classes.RadioButton}>
{props.buttonList.map((item, i) => [
<input
type="radio"
id={item}
name={props.name}
value={item}
defaultChecked={i === 0}
key={item}
onChange={props.cha... | [
"renderItems() {\n var style = {\n marginRight: '10px'\n }\n var lblStyle = {\n fontWeight: 'normal',\n marginLeft: '2px'\n }\n let props = this.props;\n return (\n lodash.map(\n this.data,\n (d, inde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the column status and submit to action | function checkColumn() {
var i = 0;
var colStr = ',';
for (i = 0; i < grid.colModel.config.length; i++) {
var cm = grid.colModel.config[i];
// 判断列标识不为空,并且不是hidden
if (cm.dataIndex != '' && !cm.hidden) {
//可以获得 其index,及header 参见 grid的定义;
colStr = colStr + cm.dataIndex + ",";
}
}
... | [
"action() {\n if (this.selectedRows().length > 0) {\n dispatch.action(this.element, this.selectedRows());\n }\n }",
"@action\n statusChangeAction(field, value) {\n if (value == 'approved') {\n this.editEntry.set('create_entry', 1);\n }\n }",
"toggleColumn(e) {\n const t = !this.col... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function called sumOfSquares(a, b) that uses only your add() function and your square function and not + or operators | function sumOfSquares(a , b) {
var aSquare = square(a)
var bSquare = square(b)
return add(aSquare, bSquare)
} | [
"function simpleSum(num1, num2) {\n var sum = num1 + num2;\n return sum;\n}",
"function add(numA, numB) {\n return numA + numB;\n}",
"function sumOfSquares(array){\n let squaresArray=array.map(i=>Math.pow(i,2));\n let sum=squaresArray.reduce((a,b)=>{\n return a+b;\n },0)\n return sum;\n}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create an object and pass the values in the text fields to that object the values in the object is send to the admin end point by using axios if the success value that is returned from the backend is true display successfully logged in alert using sweetalert if the success value that is returned from the backend is fal... | onSubmit(e){
e.preventDefault();
const storemanager = {
name: this.state.name,
password: this.state.password
};
console.log(storemanager);
axios.post('http://localhost:5000/userDetails/admin', storemanager)
.then(res => {
... | [
"function checkAdminUserNameAndPasswordAndDeletHighScoreData() {\n\n\tconst adminData = {\n\t\tpassword : element(\"admin-pass\").value,\n\t\tuserName : element(\"admin-user\").value,\n\t}\n\tconsole.log(adminData);\n\tlet xhttp = new XMLHttpRequest();\n\txhttp.onreadystatechange = function() {\n\t\tif (this.readyS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CONCATENATED MODULE: ./node_modules/reactvirtualized/dist/es/utils/getUpdatedOffsetForIndex.js Determines a new offset that ensures a certain cell is visible, given the current offset. If the cell is already visible then the current offset will be returned. If the current offset is too great or small, it will be adjust... | function getUpdatedOffsetForIndex(_ref) {
var _ref$align = _ref.align,
align = _ref$align === undefined ? 'auto' : _ref$align,
cellOffset = _ref.cellOffset,
cellSize = _ref.cellSize,
containerSize = _ref.containerSize,
currentOffset = _ref.currentOffset;
var maxOffset = cellOffset;
... | [
"function calculateCellPosition(index) {\n const position = new Map()\n\n if (index < config.cellsPerRow) {\n position.set(Cell.ATTR_POSITION_Y, 0)\n position.set(Cell.ATTR_POSITION_X, index)\n } else {\n position.set(Cell.ATTR_POSITION_Y, Math.floor(index / config.cellsPerRow))\n posit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Submit the prepared query to the PEDASI API and render the result into the 'results' panel. | function submitQuery() {
"use strict";
const results = document.getElementById("queryResults");
const query = getBaseURL() + "data/?" + getQueryParamString();
fetch(query).then(function (response) {
const contentType = response.headers.get("content-type");
if (contentType && contentType... | [
"runSoqlQuery()\n {\n this.setSelectedMapping();\n this.setSelectedAction();\n this.callRetrieveRecordsUsingWrapperApex();\n }",
"async function submitQuery() {\n\n var credentials = await Auth.currentCredentials();\n\n const redshiftDataClient = new RedshiftData({\n region: state.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
document.getElementById("demo").innerHTML = workout + group; switch input btns between 3 days and 4 days per week workout | function Workout3() {
if(workout1){
document.getElementById("demo").innerHTML = workout1 + group1;
document.getElementById("3d").value = "Gymbox x 3 days/week";
document.getElementById("4d").value = "Gymbox x 4 days/week";
}
} | [
"function dates_on_base_screen() {\n let date_array = current_date(); // makes an array of strings representing dates in the coming week\n let weekdays = make_weekday(); // makes an array of strings representing weekdays in the coming wee... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new ComAdobeGraniteFragsImplRandomFeatureProperties. | constructor() {
ComAdobeGraniteFragsImplRandomFeatureProperties.initialize(this);
} | [
"_generatePaletteRandom( palette, firstHue )\t{\r\n\t\tlet colorHsv = { \r\n\t\t\th : firstHue, \r\n\t\t\ts : this._options.palette.saturation, \r\n\t\t\tv : this._options.palette.brightness,\r\n\t\t\ta : 1 // alpha\r\n\t\t};\r\n\r\n\t\tconst bgToFgFunction = z42easing[ this._options.palette.easeFunctionBgToFg ]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
start tracking the hour block checks current time every minute to see if color blocks for past present future need to change | function hourTracker() {
const checkHourInterval = setInterval(function () {
if (moment().isAfter(hourRendered, "minute")) {
initCalendar(); // if it's the next hour, re-render the calendar to change the colors
}
}, 60000);
} | [
"function colorBlocks() {\n //console.log(now)\n if (now > 9) {\n $(\"#9am\").addClass(\"past\");\n } else if (now >= 9 && now < 10) {\n $(\"#9am\").addClass(\"present\");\n } else if (now < 9) {\n $(\"#9am\").addClass(\"future\");\n }\n if (now >... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if valid mumail email | function check_email(email) {
if(email === null) {
return false;
}
else if(email.domain === "mumail.") {
return true;
}
else return false;
} | [
"function validateMail() {\n \n var mail = document.querySelector(\"#mail\").value;\n var regex = /^(([^<>()[\\]\\\\.,;:\\s@\\“]+(\\.[^<>()[\\]\\\\.,;:\\s@\\“]+)*)|(\\“.+\\“))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\n return regex.test(mail);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the output of the Right content block. | function displayRightContentOutput() {
return (
<div
key="content-block"
className="content-block-content content-block-right"
style={ { textAlign: props.attributes.alignmentRight } }
>
{ props.attributes.contentRight }
</div>
);
} | [
"function displayRightContentOutput() {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey=\"content-block\"\n\t\t\t\t\t\t\tclassName=\"content-block-content content-block-right\"\n\t\t\t\t\t\t\tstyle={ { textAlign: props.attributes.alignmentRight } }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ props.attributes.contentRi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that indicates if an element (finds by its value) is checked. | function isChecked(elementValue) {
return $("[value='" + elementValue + "']").prop("checked");
} | [
"function checkElementsByValues(elementValues) {\n // Check elements one by one\n for(var i = 0; i < elementValues.length; i++) {\n changeElementPropertyByValue(elementValues[i], \"checked\", true);\n }\n}",
"contains(value) {\n if (this.value === value) {\n return true;\n }\n if (th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Memory history stores the current location in memory. It is designed for use in stateful nonbrowser environments like tests and React Native. | function router_createMemoryHistory(options) {
if (options === void 0) {
options = {};
}
let {
initialEntries = ["/"],
initialIndex,
v5Compat = false
} = options;
let entries; // Declare so we can access from createMemoryLocation
entries = initialEntries.map((entry, index) => createMemoryLoc... | [
"_setHistory(currentRoute) {\n for (let i = 0; i < this.history.length; i++) {\n let previousRoute = this.history[i];\n if (currentRoute.controller === previousRoute.controller &&\n currentRoute.method === previousRoute.method &&\n _.isEqual(currentRoute.va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds a rectangel given a label | function findRectangleFromLabel(label, rectangles){
for (var i = 0; i < rectangles.length; i++){
if (label.trim() == rectangles[i].label.trim()){
return rectangles[i];
}
}
} | [
"function findCircle(label){\n\tfor (var i = 0; i < circles.length; i++){\n\t\tif (label == circles[i].label){\n\t\t\treturn circles[i];\n\t\t}\n\t}\n}",
"function getLabelBBox(textWidth, textHeight, align, baseline, angle, margin){\n \n var polygon = getLabelPolygon(textWidth, textHeight, align, ba... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Agend Particpant Id in array of participants | function getAgentParticipantId(conversation) {
let ida = 0;
// Participant : "id", "address", "startTime", "connectedTime", "endTime", "state": "disconnected",
// "direction": "disconnectType", "held", "user", "queue", "attributes","recordingState": "none",
// "purpose": "user", ...
// Participant.purpose: "... | [
"function matchParticipants(participant, index, array) {\n\t\n\t//Check for last participant in array & push with first participant in array\n\tif (index === array.length - 1) {\n\t\tparticipant.push(array[0][0]);\n\t\tconsole.log(participant);\n\t} else {\n\t\tparticipant.push(array[index + 1][0]);\n\t\tconsole.lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update an object with the given id | updateById(id, data) {
return this.post('/' + id + '/edit', data);
} | [
"function update(id, property){\n return db('property').where('id', '=', id).update(property)\n}",
"set id(newId) {\n this._id = newId;\n setValue(`cmi.objectives.${this.index}.id`, newId);\n }",
"function update(Model,_id,updated_obj){\n const promise = new Promise((resolve,reject)=>{\n Model.f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that removes the used props | removeUsedProps(aProps) {
//METODO: change this to actual source cleanup
delete aProps["input"];
delete aProps["groupBy"];
} | [
"_getPartialProperties(props) {\n const options = this.get(); // remove attributes from the prop that are not in the partial\n\n Object.keys(options).forEach(name => {\n if ((0, _TypeCheck.isUndef)(props[name])) {\n delete options[name];\n }\n });\n return options;\n }",
"clear() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
5. create a function that returns the sum of integers of an array, it should handle all nested levels | function arraySum(arr){
// code goes here
// similar to flatten, handle all levels of depth
// use reduce to flatten the array and add integers to the startValue
// if the curr value is an array, use recursion to run the function on the array again
// if the value is a number, then add that to the total sum... | [
"function sumOfNumbers(arr) {\n function sum(total, num) {\n return total + num;\n }\n return arr.reduce(sum);\n}",
"function arraySum(array){\n var sum=0;\n var index=0;\n function add(){\n if(index===array.length-1)\n return sum;\n\n sum=sum+array[index];\n index++;\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Implements a EBNF grammar using the Myna parsing library See | function CreateGrammar(myna) {
// Setup a shorthand for the Myna parsing library object
let m = myna;
let g = new function() {
// comment and whitespace
this.comment = m.choice(m.seq("/*", m.advanceUntilPast("*/")), m.seq('//', m.advanceUntilPast("\n")));
this.ws ... | [
"function CreateEbnfGrammar(myna) {\r\n // Setup a shorthand for the Myna parsing library object\r\n let m = myna; \r\n\r\n let g = new function() {\r\n // comment and whitespace \r\n this.comment \t= m.seq(\"/*\", m.advanceUntilPast(\"*/\"));\r\n this.ws = m.char(\" ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolve output port from requested property. | function resolveOutputPort(property, value) {
return resolvePort('output', property, value);
} | [
"function resolvePort(type, property, value) {\n var availablePorts = type === 'output' ? outputPorts : inputPorts,\n length = availablePorts.length,\n resolvedPorts = [],\n i;\n\n // Go through each port and compare property.\n for (i = 0; i < length; i++) {\n // Check if port has the property... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A helper function that gets the blank node name from an RDF quad node (subject or object). If the node is a blank node and its value does not match the given blank node ID, it will be returned. | function _getAdjacentBlankNodeName(node, id) {
return (node.type === 'blank node' && node.value !== id ? node.value : null);
} | [
"function get_node_value(which_doc, which_id){\t\t\r\n\tvar node = get_xml_node(which_doc, which_id);\r\n\tvar node_value = \"\";\r\n\t\r\n\tif (node != null){\r\n\t\tif (node.nodeType != 3){\t// NS6/Mozilla will treat space as an element, so we need to ingore it\r\n\t\t\tif (node.childNodes.length > 0){\r\n\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load cash to ATM available for admin only EXTENDED | loadAtmCash(amount) {
if (this.auth()) {
if (this.currentUser.type === "admin") {
this.cash += amount;
console.log('ATM account credited to' + amount);
this.logs.push(this.currentUser.id + 'ATM account credited to' + amount)
... | [
"async fetchGlobalDamLockedIn() {\n const dam_url = 'https://api.etherscan.io/api?module=account&action=tokenbalance&contractaddress=0xF80D589b3Dbe130c270a69F1a69D050f268786Df&address=0x469eda64aed3a3ad6f868c44564291aa415cb1d9&tag=latest&apiKey=' + api_key;\n const dam_response = await fetch(dam_url);\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
intitates a game board with armies | function intitateGame() {
intiateBoard()
W_KING = initiateArmy(WHITE_ARMY, `WHITE`, 7, getWhitePieces())
B_KING = initiateArmy(BLACK_ARMY, `BLACK`, 0, getBlackPieces())
GRAVEYARD.length = 0
WHITES_TURN = true
GAME_OVER = false
updatePlayer()
} | [
"function fillBoard() {\n for (var i = 0; i < 8; i++) {\n game.board[i] = fillRow(i);\n };\n}",
"function resetBoard() {\r\n gameboard.forEach(function(space, index) { \r\n this[index] = null; \r\n }, gameboard)\r\n _render()\r\n }",
"setBoard(height,width,start) {\nlet color = 'w';\nlet pie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fireTorpedoHandler: Called by fire button press event or by spacebar hit If we didn't just fire a torp and are in our timeout loop then it sets the torp fired flag to true. Sets the torps x and left values to + TORP_RANGE, plays audio then waits for the timer interval before checking for a hit. This gives the page time... | function fireTorpedoHandler() {
"use strict";
if (bTorpFired) {
// we just handled one.. time not up yet
// do nothing!
}
else {
bTorpFired = true; // set our flag so we don't stomp ourselves.
// Fire the photon torpedo!
// CSS animation occurs whe... | [
"function startGameHandler() {\r\n \"use strict\";\r\n // Hide the intro screen, show the game screen\r\n introScreen.style.display = \"none\";\r\n gameScreen.style.display = \"block\";\r\n rocket.img.style.display = \"block\";\r\n ufo.img.style.display = \"block\";\r\n\r\n // set up torp start... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sync the db. force true for now to create/recreate w/dummy data | function sync(force = false) {
return db
.sync({ force })
.then((_) => console.log("synced models to db ", connectionString))
.catch((fail) => {
console.log("db failed to sync because: ", fail);
});
} | [
"sync() {\n each(this.models, method(\"sync\"));\n }",
"function seed() {\n process.env.ENVIRONMENT = 'test';\n const test = require('./config/db');\n const db = require('./db');\n\n return shared.importDB(test, sql_file).then(() => {\n // various deleting commands\n const seed = require('./se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return a list of colors from a given family | function getBiganColorList(family, steps) {
var colors=[];
for (i=0;i<steps;++i){
colors.push(getBiganColor(family, steps, i));
}
return colors;
} | [
"function getColors(){\n var rgb = mixerBottle.attr('style').replace('background-color: rgb(', '').replace(')', '').split(',');\n return rgb.map(x => parseInt(x));\n }",
"function getThemeColors(r, g, b) {\n var shades = [];\t\t\t\t\t\t\t\t\t\t\t\t\t // reset the shades array\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
nested loop for pairing cards with type, then allocating it in single array as deck of cards | function createDeck(){
for (let i = 1; i <= cards.length+1; i++) {
for (let y = 0; y <= types.length; y++) {
let x = { type: y, value: i };
darkmoonDeck.push(x);
}
}
return darkmoonDeck;
} | [
"createCards () {\n let suits = ['♣', '♦', '♥', '♠']\n let values = ['A', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K']\n\n for (let suit in suits) {\n suit = suits[suit]\n for (let value in values) {\n value = values[value]\n let card = new Card(suit, value)\n this.deck.push(ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a Circle constructor that creates a circle object: it should take the circle's radius as a parameter it should have a "getCircumference" method that returns it's circumference it should have a "getArea" method that returns it's area it should have a "toString" method that returns it's stats as a string like: 'Ra... | function Circle(radius) {
this.radius = radius;
this.area = 0;
this.circumference = 0;
this.stats = "";
this.pi = Math.PI;
this.getCircumference = function(radius) {
this.circumference = this.radius * (2 * this.pi)
return this.circumference;
}
this.getArea = function(radius) {
this.area = this.radius * th... | [
"function areaCircle (radius)\n{\n\t// var circle_Area = Math.PI * (radius * radius);\n\tvar circle_Area = Math.PI * (Math.pow(radius,2));\n\treturn circle_Area;\n}",
"function areaCircle(d){\n var rad = d / 2;\n\n var areaC = 3.14 * (rad * rad);\n\n return(areaC)\n}",
"function circleFactory(X, Y){\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executing global flag handlers. The global flag handlers are not async as of now, but later we can look into making them async. | executeGlobalFlagsHandlers(argv, command) {
const globalFlags = Object.keys(this.flags);
const parsedOptions = new Parser_1.Parser(this.flags).parse(argv, command);
globalFlags.forEach((name) => {
const value = parsedOptions[name];
/**
* Flag was not specifie... | [
"getFlags() {\n this.context.store.dispatch(getFlags());\n }",
"function runLoadHandlers() {\n while (loadHandlers.length) {\n loadHandlers.shift()();\n }\n // And, if someone tries to add another, just run it right away\n sergis.addLoadHandler = function (handler) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove all messages from screen (for win/lose/draw message) a lock is used to prevent from removing the message when we attempt to trigger it. there are 3 status(lock, hold, free) for the lock | function removeMessages(){
//remove note message
document.getElementById("notePopup1").classList.remove("notePopup1");
document.getElementById("notePopup2").classList.remove("notePopup2");
//remove win/lose/draw message
var status = Session.get("onMessage");
if(status == "lock"){
Session.set("onMessage", "hold... | [
"unlockMessage() {\n // if message is over a day old (10 seconds for testing), unlock it and allow deletion\n if(Date.now() - this.posted > 10000) {\n this.isLocked = false;\n }\n }",
"function clearScreen()\n{\n document.body.removeChild( document.getElementById( \"space\" ) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extends default console reporter options | function getConsoleReporterOpts(opts) {
return _.extend({
colors: typeof options.showColors === 'boolean'
? options.showColors : true,
verbose: typeof options.verboseReport === 'boolean'
? options.verboseReport : true,
c... | [
"function setupConsoleLogging() {\n (new goog.debug.Console).setCapturing(true);\n}",
"resetCommandLineOptions () {\n this.setCommandLineOption(\"url\", undefined);\n this.setCommandLineOption(\"dir\", undefined);\n\n super.resetCommandLineOptions();\n }",
"function BrowserRunner$(confi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Damage by one member of the party, takes in member and whether physical (true/false) | function pDamage(member, physical) {
if (member.active == 0) {
return 0;
}
var baseD = member.weapon.baseDamage;
if (Math.random() < member.weapon.critP) {
baseD *= member.weapon.critM;
}
if (physical) {
return (baseD * member.weapon.phys);
} else {
return (baseD * member.weapon.mag);
}
... | [
"function mDamage(physical) {\n var baseD = enemy.damage;\n if (physical) {\n return (baseD * enemy.phys);\n } else {\n return (baseD * enemy.mag);\n }\n}",
"_hasDamage(type) {\n if (type === \"weapon\") {return true};\n // if (!this.data.data.causeDamage) {return false};\n if (type... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Activate all the components in the Latency Histogram package. | function activate() {
// Register the LatencyHistogramComponent as a role in Compass
//
// Available roles are:
// - Instance.Tab
// - Database.Tab
// - Collection.Tab
// - CollectionHUD.Item
// - Header.Item
global.hadronApp.appRegistry.registerRole('Collection.Tab', ROLE);
global.hadron... | [
"function activateCurrentComponents() {\n\t\tcurrentChild.children('.koi-component')\n\t\t\t.removeClass('deeplink-component-disabled')\n\t\t\t.trigger('load-component');\n\t}",
"activate()\r\n\t{\r\n\t\t// TODO\r\n\t\tsuper.activate();\r\n\t\tthis.gl.enableVertexAttribArray(this.colorAttribLocation);\r\n\t\tthis... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Estimate how it is relevant to choose an article. | estimate(link, callback) {
// If articles aren't loaded, we wait
if (this._articlesCount == 0) {
let that = this;
setTimeout(() => { that.estimate(link, callback); }, 3000);
return;
}
// We check if the user already saw this page1
i... | [
"function relevance() { \n\n\tfor (var i = 0; i < selection.network.links.length; i++) { // for each link\n\t\tif ((selection.network.links[i].source == selection.seed || selection.network.links[i].target == selection.seed) && // one of the arguments is the seed\n\t\t\t(selection.network.links[i].source != selectio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by KotlinParserliteralConstant. | enterLiteralConstant(ctx) {
} | [
"_completeLiteral(token) {\n // Create a simple string literal by default\n let literal = this._literal(this._literalValue);\n\n switch (token.type) {\n // Create a datatyped literal\n case 'type':\n case 'typeIRI':\n const datatype = this._readEntity(token);\n\n if (datatype =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get page title by its sorted index (this is the usual way. all page titles in Unicode order) | function getTitle(dump, indexS, gotTitle) {
var haystackLen = dump.files.st.byteLen / 4;
var indexR = new Buffer(4), title = new Buffer(256);
if (indexS < 0 || indexS >= haystackLen) {
if (indexS === -1) {
gotTitle('** beginning of list **');
} else if (indexS === haystackLen) {
gotTitle('** ... | [
"function getTitleByRawIndex(dump, indexR, gotTitle) {\n var haystackLen = dump.files.to.byteLen / dump.sizeof_txt_told;\n var offset = new Buffer(dump.sizeof_txt_told);\n\n if (indexR < 0 || indexR >= haystackLen) throw 'raw index ' + indexR + ' out of range';\n\n if (dump.files.tp.eleBitSize) {\n offset = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks whether a domain satisfies the access control list. The access control list has a whitelist and a blacklist. In order to satisfy the acl, the domain must be on the whitelist, and must not be on the blacklist. | function checkACL(accessControlList, origin) {
var aclWhitelist = accessControlList.whitelist;
var aclBlacklist = accessControlList.blacklist;
var isWhitelisted = false;
var isBlacklisted = false;
for (var i=0; i<aclWhitelist.length; ++i) {
var aclRegex = convertWildcardToRegex(acl... | [
"static isFioDomainValid(fioDomain) {\n const validation = (0, validation_1.validate)({ fioDomain }, { fioDomain: validation_1.allRules.fioDomain });\n if (!validation.isValid) {\n throw new ValidationError_1.ValidationError(validation.errors);\n }\n return true;\n }",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO Simpan variabel di argument let a = parseInt(prompt('Angka')); let b = parseInt(prompt('Angka')); let hasil = tambah(a, b); console.log(hasil); TODO Tambah operasi math di argument let x = 6; let y = 9; let kali = tambah(x 1, y + 1); console.log(kali); | function tambah(a, b) {
return a + b;
} | [
"function input(jumlahanak){\n var jumlahanak;\n var maksimalanak = 3; //maksimal anak 3\n var gajipokok =1000000; // gajipokok Rp1.000.000\n var tunjangananak = 100000; // mendapatkan 10% dari gaji pokok\n if(jumlahanak <= 3){\n total= ju... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get right diagonal winning pattern which can be used to check the winner | function getRightDiagonalPattern() {
let initial = rowCount - 1;
let increaseBy = 0;
let diagonalMatchPattern = [];
for (let i = 0; i < rowCount; i++) {
diagonalMatchPattern.push(initial + increaseBy);
increaseBy += rowCount;
initial -= 1;
}
... | [
"function getWinningPattern() {\n winningPattern = getHorizontalPattern().concat(getVerticalPattern());\n winningPattern.push(getLeftDiagonalPattern());\n winningPattern.push(getRightDiagonalPattern());\n console.log(winningPattern)\n }",
"function check_game_winner(state) {\n\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used the getElementById and querySelector methods along with the innerHTML property This function updates the images in the itembox, itembox backgroubd color, and text in the price paragraph element | function callProductFour(){
//update image
var smoothie = document.getElementById('smoothies_pics'); //finds the image element that is going to be updated
var newContent = '<img src="images/Greek-yogurt-smoothie-peanut-butter_WH_360_392.jpg" alt="Greek-yogurt-peanut-butter-smoothie-_">'; //creates a var... | [
"function callProductTwo(){\n\n //update image\n var smoothie = document.getElementById('smoothies_pics'); //finds the image element that is going to be updated\n var newContent = '<img src=\"images/Strawberry-Mango-Smoothie_WH_360_392.jpg\" alt=\"strawberry_mango\">'; //creates a variable which contains... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds elements passed as parameters to the set. Potential duplicate insertion attempts are skipped. | add(...elements) {
for (const element of elements) {
if (this.set.indexOf(element) !== -1) {
console.log("Element " + element + " already in set, skipping...");
} else {
this.set.push(element);
}
}
} | [
"addSet() {\n const elemIndex = this.getNumElements();\n this.parents.push(elemIndex);\n this.sizes.push(1);\n this.numSets++;\n return elemIndex;\n }",
"addAll(iterable) {\n if (!iterable || typeof iterable.forEach !== 'function') {\n return\n }\n iterable.forE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the debt interest rate in the database | function updateDebtInterestRate(token, debtID, newInterestRate) {
try {
var userData = validateToken(token);
var userEmail = userData.email;
var updateQuery = 'UPDATE Debts SET interestRate=?, lastUpdated=CURRENT_TIMESTAMP WHERE email=? AND debtID=?;';
var parameters = [newInterestRate, userEmail, deb... | [
"function updateRating(rscName, rating, rerate, old_rating) {\n var newRating;\n Resource.findOne({ className: rscName }, function(err, resource) {\n if (err) console.log(err);\n else {\n if (rerate) {\n newRating = (resource.rating * resource.numRatings - old_rating + rating)/ resource.numRatin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called by the C++ internals when the socket is closed. When this is called, the only thing left to do is destroy the QuicSocket instance. | function onSocketClose() {
this[owner_symbol].destroy();
} | [
"destroy(error) {\n // If the QuicSocket is already destroyed, do nothing\n if (this.#state === kSocketDestroyed)\n return;\n\n // Mark the QuicSocket as being destroyed.\n this.#state = kSocketDestroyed;\n\n // Immediately close any sessions that may be remaining.\n // If the udp socket is i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get map data for a destination. | async MapData (dest) {
// Get zoom level.
const { zoom } = this.settings;
// Get geocoding data.
const geocoding = await this.GeocodingData(dest);
// Get coordinates.
const coords = [geocoding.center[1], geocoding.center[0]];
// Get tile coordinates.
const tile = GlobalMercator.Coord... | [
"async GeocodingData (dest) {\n\n // Get geocoding data for the given destination.\n const response = await axios.get(this.endpoint.geocoding(dest));\n\n // Return data for the first location match.\n return response.data.features[0];\n\n }",
"function getMapData(url) {\n\tconsole.log('fetching');\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get children of this HTMLELement that have the provided RDFa property attribute | function getElementsByProperty(property, value) {
var query = '[property~="{property}"]'.replace('{property}', property);
var childrenWithProperty = this.querySelectorAll(query);
return [].slice.call(childrenWithProperty)
} | [
"async expandProperty(property) {\n // JavaScript requires keys containing colons to be quoted,\n // so prefixed names would need to written as path['foaf:knows'].\n // We thus allow writing path.foaf_knows or path.foaf$knows instead.\n property = property.replace(/^([a-z][a-z0-9]*)[_$]/i, '$1:');\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This update occurs if sync all data is done, it will update sync bit with the inserted sync activity id having status as OK | function updActivityDataWithSyncActivityId(syncId){
console.log("updating all rows with sync id : "+syncId);
// for(var i=0;i<l_synAllData.length();i++){
// if(l_synAllData[i].syncStatus=="OK"){
// updSyncAllDetailsInActivityWithActivityId(l_synAllData[i].activityId, l_synAllData[i].syncImmedia... | [
"function syncActivityDataCB(data){\n var wasImmediateSync = data.isImmediate;\n var l_data = data.activityData;\n \n console.log(\"IsImmediate : \"+wasImmediateSync+\"||\"+l_data[0].activityId);\n \n if(wasImmediateSync){\n l_synAllData = {};\n //for(var i=0;i<l_data.length();i++){\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to run the game. Needs to keep track of bug and food locations, update score, update animations, etc | function runGame() {
score = 0;
gamePaused = false;
curTime = 0;
nextBug = 1
lastBugTime = 0;
bugList = [];
foodList = [];
drawScoreboard();
bugInterval = window.setInterval(addRandomBug, 1000);
createRandomFoods(5);
window.requestAnimationFrame(animateBoard);
} | [
"function run(){\n\n console.log(\"Attempting Setup\");\n stage = new PIXI.Stage(0x66FF99);\n canvas = document.getElementById(\"game\");\n renderer = PIXI.autoDetectRenderer(800, 300,{view: canvas});\n document.body.appendChild(renderer.view);\n\n\tmain_menu();\n\tconsole.log(\"G... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
used to extract msaccount details like customer info, premise address, emergency contacts and Equipment Details and load into the SWING UI msAccount result from search system details | function load_msaccount_details(vm, msAccount, cb) {
//Load data on UI for Premise Address
dataservice.swingaccountsrv.CustomerSwingPremiseAddress.read({
id: msAccount.AccountID
},
null, utils.safeCallback(cb, function(err, resp) {
if (err) {
notify.error(err, 10);
... | [
"function subtest_get_an_account(w) {\n // Make sure we don't have bar as the default engine yet.\n let engine = Services.search.getEngineByName(\"bar\");\n Assert.notEqual(engine, Services.search.defaultEngine);\n\n wait_for_provider_list_loaded(w);\n wait_for_search_ready(w);\n\n // Fill in some data\n typ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merge takes care of merging the states and city arrays nested in the country objects when two country objects are merged together | merge(country){
this.states = this.states.concat(country.states);
this.states = this.states.filter(function(state, iState,self){
var firstIndex = self.findIndex(function(findState){
return findState.name == state.name;
})
if (firstIndex != iState){
... | [
"_mergeDataObjects(){\n return Object.assign({}, this.refPoints['AMS2'] , this.refPoints['PCARS1']);\n }",
"function MergeRecursive(obj1, obj2) {\n\n for (var p in obj2) {\n try {\n // Property in destination object set; update its value.\n if ( obj2[p].constructor==Object ) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper Functions to print out dims and measures | function printDims(){
var ret = [];
dataDims.forEach(function(e,i,a){
ret.push( {'name' : e, 'value' : i} );
});
return ret;
} | [
"function array_dimensions(test_array) {\n /*\n This block prints out the dimensions of the array.\n */\n // This block sends out the correct dimensions\n console.log('\\nList the Dimensions of the test array');\n console.log('X Dimension = ' + test_array.length);\n console.log('Y Dimension = '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Would love to figure out how to modify a category, but so that it is somehow connected to it's firebase key and then it would update all of the existing entries with the modified category name. We realize this might be a big question, but even a nudge in the right direction would be great! | modifyCategory(e, category) {
let firebaseRef = firebase.database().ref('dataset/expenseCategories');
const newCategory = this.state.newCategory;
firebaseRef.push(newCategory);
this.setState({ newCategory: '' });
} | [
"function write_tag(category=\"\",item=\"\"){\n if(document.getElementById(\"selected_tags\").value.indexOf(item)!==-1){\n var newKey = firebase.database().ref('kidsBox/'+kid+'/showBox/'+category).push();\n newKey.set({\n tag:item\n });\n firebase.database().ref('/kidsBox/'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The sensitivity to control how responsive to the input signal the filter is. | get sensitivity() {
return (0, _Conversions.gainToDb)(1 / this._inputBoost.gain.value);
} | [
"function goToChangeSensitivity(){\n clientValuesFactory.setActiveWindow(windowViews.changeSensitivity);\n }",
"function setSourceFrequencyFn(scope) {\n\tsource_frequency = scope.source_frequency_value; /**Frequency of sound will be slider's current value */\n}",
"function recommenderSensitivi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a highlevel function used to register the client with this Client with the Server. It calls the registration function, writes out the support files, builds the Docker container, and launches the Docker container. | function registerDevice() {
//Simulate benchmark tests with dummy data.
const now = new Date();
const deviceSpecs = {
memory: "Fake Test Data",
diskSpace: "Fake Test Data",
processor: "Fake Test Data",
internetSpeed: "Fake Test Data",
checkinTimeStamp: now.toISOString(),
};
const config =... | [
"register() {\n this._container.instance('expressApp', require('express')())\n\n //TODO: add Socket.io here @url https://trello.com/c/KFCXzYom/71-socketio-adapter\n\n this._container.register('httpServing', require(FRAMEWORK_PATH + '/lib/HTTPServing'))\n .dependencies('config', 'expressApp')\n .s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register a theme (which is a collection of color palettes to use with various states ie. warn, accent, primary ) Optionally inherit from an existing theme $mdThemingProvider.theme('customtheme').primaryPalette('red'); | function registerTheme(name, inheritFrom) {
if (THEMES[name]) return THEMES[name];
inheritFrom = inheritFrom || 'default';
var parentTheme = typeof inheritFrom === 'string' ? THEMES[inheritFrom] : inheritFrom;
var theme = new Theme(name);
if (parentTheme) {
angular.forEach(parentTheme.color... | [
"function setupTheme() {\n var theme = interactive.theme;\n\n if (arrays[\"a\" /* default */].isArray(theme)) {\n // [\"a\", \"b\"] => \"lab-theme-a lab-theme-b\"\n theme = theme.map(function (el) {\n return 'lab-theme-' + el;\n }).join(' ');\n } else if (theme) {\n theme = 'lab-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new PeeringAttachmentStatus. The status of the transit gateway peering attachment. | function PeeringAttachmentStatus() {
_classCallCheck(this, PeeringAttachmentStatus);
PeeringAttachmentStatus.initialize(this);
} | [
"get participantStatus() {\n\t\treturn this.__participantStatus;\n\t}",
"function TransitGatewayAttachment(props) {\n return __assign({ Type: 'AWS::EC2::TransitGatewayAttachment' }, props);\n }",
"async function createAnExchangePeering() {\n const subscriptionId = \"subId\";\n const resource... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Glue footnote tokens to end of token stream | function footnote_tail(state) {
var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel,
insideRef = false,
refTokens = {};
if (!state.env.footnotes) { return; }
state.tokens = state.tokens.filter(function (tok) {
if (tok.type === 'footnote_reference_open') {
... | [
"static addBlankLine(excerptTokens) {\n let newlines = '\\n\\n';\n // If the existing text already ended with a newline, then only append one newline\n if (excerptTokens.length > 0) {\n const previousText = excerptTokens[excerptTokens.length - 1].text;\n if (/\\n$/.test(pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets new value for shard. | set shard(value) {
this._options.shard = value;
// shard setting changed so let's schedule a new keep-alive check if connected
if (this._oneSuccessfulConnect) {
this._maybeStartWSKeepAlive();
}
} | [
"function setValue(param, value) {\n if (lmsConnected) {\n DEBUG.LOG(`setting ${param} to ${value}`);\n scorm.set(param, value);\n scorm.save();\n } else {\n DEBUG.WARN('LMS NOT CONNECTED');\n }\n}",
"set score(val) {\n this._score = val;\n console.log('score updated');\n emitter.emit(G.SC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the absolute values in Series | abs(options) {
const { inplace } = { inplace: false, ...options };
if (this.dtypes[0] == "string") ErrorThrower.throwStringDtypeOperationError("abs");
let newValues;
newValues = this.values.map((val) => Math.abs(val));
if (inplace) {
this.$setValues(newValues);
} else {
const sf ... | [
"function getAbsSum(arr) {\n\tlet sum = 0\n\tfor(let i = 0; i < arr.length; i++) {\n\t\tif(arr[i] < 0) {\n\t\t\tsum += arr[i] * -1\n\t\t} else {\n\t\t\tsum += arr[i]\n\t\t}\n\t}\n\treturn sum\n} // Or this way:",
"function calcNiceNegValues(rawMin, rawMax)\n{\n var absValues = [];\n if(rawMin==0) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : deleteLinkFromDev AUTHOR : Mark Anthony Elbambo DATE : March 21, 2013 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : deletes link on the canvas when device is deleted PARAMETERS : dev | function deleteLinkFromDev(dev){
if(globalInfoType == "JSON"){
var devices = getDevicesNodeJSON();
}else{
var devices =devicesArr;
}
var allline =[];
for(var i = 0; i < devices.length; i++){ // checks if the hitted object is equal to the array
allline = gettargetmap(devices[i].ObjectPath,... | [
"function deleteLink(source,destination){\n\tif(globalInfoType == \"JSON\"){\n\t\tvar devices = getDevicesNodeJSON();\n var prtArr =[];\n for(var s=0;s < devices.length; s++){\n prtArr = getDeviceChildPort(devices[s],prtArr);\n }\n }else{\n var prtArr= portArr;\n }\n\tf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show no products screen | function showNoProductsScreen() {
$("section.jsContainer #js-table").css("display", "none");
$("section.jsContainer #extractResults").css("display", "none");
$("section.jsContainer .export-section").css("display", "none");
$("section.jsContainer #filterPopup").css("display", "none");
$("section.jsContainer #option... | [
"function displayEmpty() {\n productContainer.empty();\n var messageH2 = $(\"<h2>\");\n messageH2.attr('id', 'no-product');\n messageH2.html(\"No products have been added that match your search yet. Check back regularly to see new products! <br> Try a different <a href='/index'>search.</... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display registered classes for the day | function displayClassesForTheDay(){
$('.today-classes').click(function(event){
event.preventDefault();
toggleResponsiveClass();
displayErrorMessage('');
if(($('.registered-today-count').text() === "(0)")) {
$('.registered-classes-today').addClass('hdden');
$('.map-canvas').addClass('hidden');
displayE... | [
"function initDisplayClasses ()\n {\n\tshowByClass('type_occs');\n\tshowByClass('taxon_reso');\n\tshowByClass('advanced');\n\t\n\thideByClass('taxon_mods');\n\thideByClass('mult_cc3');\n\thideByClass('mult_cc2');\n\t\n\thideByClass('type_colls');\n\thideByClass('type_taxa');\n\thideByClass('type_ops');\n\thideBy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
toggle district selection by mouse. | function enableDistrictSelect() {
cleanMap();
selectControl.activate();
} | [
"function ontoggle() {\n selected = !selected;\n logic.ontoggle(selected);\n }",
"function setDown() {\n mouseDown = true;\n}",
"function toggleSelected(oldSet, newSet) {\n var unSel = oldSet.subtract(newSet)\n var toSel = newSet.subtract(oldSet)\n logMsg(\"clear \", unSel)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is this expression already a value? | isValue() {
return false;
} | [
"function isLValue(tree) {\n\tif (!isExpression(tree)) {\n\t\treturn false;\n\t}\n\t// is an expression\n\tvar ls = [\"Identifier\", \"MemberExpression\", \"IndexExpression\"];\n\treturn ls.contains(tree.type);\n}",
"get takesValue() {\n return this._memoize('takesValue', () => {\n return this.takesValueF... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all children or by selector | function _getChildren(element, selector) {
var allChildren = element.childNodes,
length = allChildren.length,
children = [],
i = 0;
for(; i < length; i++) {
var item = allChildren[i];
if(allChildren[i].nodeType === 1) {
if(selector) {
if(_isId.test(selector) && item.id === selector.substr(... | [
"function children(selector) {\n var nodes = [];\n each(this, function(element) {\n each(element.children, function(child) {\n if (!selector || (selector && matches(child, selector))) {\n nodes.push(child);\n }\n });\n });\n return $(nodes);\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Designed to be called after retrieving the trailshred settings from Apex. Typically invoked from `connectedCallback`. Loops through the settings and organizes them into two filtered lists for simpler access in the `onsuccess` and `onerror` functions. | onSettingsLoaded(settings) {
const that = this;
if (settings && settings.length > 0) {
this.trailshredFieldValueSettings = settings.filter(setting => {
return (
setting.Active__c &&
setting.Audio_Static_Resource_Path__c &&
... | [
"static async findAll() {\n const settings = await this.find().sort({ triggerPath: 1 });\n\n return settings;\n }",
"function initializeSettings() {\n if (Drupal.eu_cookie_compliance !== undefined && Drupal.eu_cookie_compliance.hasAgreed()) {\n $('.js-social-media-settings-open').removeClass('hidde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Shows documentation for the selected filter | function showJavaDoc() {
if (filterBox.selectedIndex < 1) return;
let url = 'https://cgjennings.github.io/se3docs/assets/javadoc/' + 'ca/cgjennings/graphics/filters/' + filterBox.selectedItem;
java.awt.Desktop.desktop.browse(new java.net.URI(url));
} | [
"function onChangeFilter() {\n requestSubMain(0)\n}",
"static listAction(filter = null, pager = null){\n\t\tlet kparams = {};\n\t\tkparams.filter = filter;\n\t\tkparams.pager = pager;\n\t\treturn new kaltura.RequestBuilder('livechannelsegment', 'list', kparams);\n\t}",
"static listAction(filter = null, pager... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loop throught the userInput and play one note/letter | function myLoop() {
setTimeout(function() {
let character = userInput.charAt(k).toLowerCase();
//console.log('play sound: ' + character);
newRipplePos = false;
//switch statment decides which sound should be played
switch (character) {
case 'a':
playNewSound(0);
... | [
"function play(){\n\treadAndPlayNote(readInNotes(), 0, currentInstrument);\n}",
"handleInteraction(input) {\n this.activePhrase.checkLetter(input);\n Array.from(document.getElementsByClassName('key')).forEach(key => { //Creating an array of the QWERTY keys to loop through.\n if (key.textContent === inp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ManagedUserSettings class: Encapsulated handling of the Managed User Settings page. | function ManagedUserSettings() {
OptionsPage.call(
this,
'manageduser',
loadTimeData.getString('managedUserSettingsPageTabTitle'),
'managed-user-settings-page');
} | [
"function updateSettings(k,v) {\n\t\tuserSettings[k] = v;\n\t\twindow.localStorage.setItem(settingsName, JSON.stringify(userSettings));\n\t}",
"function settingPage(autoSave = autoSaveGET,useLibraryJS = useLibraryJSGET,language = languageGET) {\n\t\t//___CREATED obj SETTING___\n\t\tvar objSetting = {\n\t\t\t'auto... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculator Processor object. Main Processor object for handling all context and state. | function Processor() {
console.log('Processor: constructor');
// Initialize state on first construction.
this.accumulator = '';
this.operator = '';
this.value = '';
this.implied = '';
this.usedImplied = false;
this.lastEquals = false;
// Boolean to lock calculator on error, until c... | [
"compute() {\n // so to compute we have already settled that both prev and main result must have a value in our operationChoice method\n let computation\n const prev = parseFloat(this.prevResult)\n const main = parseFloat(this.mainResult)\n\n if(isNaN(prev) || isNaN(main)) return\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load a new assembly request | load(req) {
let self = this;
// Default the model type to assembly
req.type = req.modelType ? req.modelType : 'assembly';
delete req.modelType;
// Load the model
this._loader.load(req, function(err, model) {
if (err) {
console.log('CADManager.l... | [
"function load(req, res, next, id) {\n Adopt.get(id)\n .then((adopt) => {\n req.adopt = adopt; // eslint-disable-line no-param-reassign\n return next();\n })\n .catch(e => next(e));\n}",
"function handle_location_load(req, startTime, apiName) {\n this.req = req; this.startTime = startTim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that makes the whale shark button in the interactive reef | function makeWhaleSharkButton() {
// Create the clickable object
whaleSharkButton = new Clickable();
whaleSharkButton.text = "";
whaleSharkButton.image = images[23];
//makes the button color transparent
whaleSharkButton.color = "#00000000";
whaleSharkButton.strokeWeight = 0;
//set width + heig... | [
"function mousePressed() {\n shocked = true;\n}",
"function C006_Isolation_Yuki_Click() {\t\n\tClickInteraction(C006_Isolation_Yuki_CurrentStage);\n}",
"_createSceneryButton(buttons) {\r\n\t\tlet tokenButton = buttons.find((b) => b.name === 'token');\r\n\t\tif (tokenButton && game.user.isGM) {\r\n\t\t\ttokenBu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |