query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Chapter 12 After Class When Amanda spanks the player | function C012_AfterClass_Amanda_AmandaSpankPlayer() {
C012_AfterClass_Amanda_SpankCount++;
if (C012_AfterClass_Amanda_SpankCount > C012_AfterClass_Amanda_SpankMaxCount) {
C012_AfterClass_Amanda_CurrentStage = 3933;
OverridenIntroText = "";
OverridenIntroImage = "";
} else {
OverridenIntroText = GetText("Span... | [
"function C009_Library_Jennifer_TestPleasurePlayer() {\n\tif ((ActorGetValue(ActorSubmission) <= -3) && (!C009_Library_Jennifer_OrgasmDone)) {\n\t\tOverridenIntroText = GetText(\"PleasureMeFirst\");\n\t\tC009_Library_Jennifer_CurrentStage = 270;\n\t}\n\tC009_Library_Jennifer_SetPose();\n}",
"function C009_Library... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call to refresh cut status of bookmark rows in a bookmark search, if there is one active a_bnId = list of BookmarkNodes Ids on which to modify cut status status = Boolean, if true set cut status on (dim), else set it off | function refreshCutSearch (a_bnId, status) {
if (SearchTextInput.value.length > 0) { // Refresh only if a search is active
let row;
let len = a_bnId.length;
for (let i=0 ; i<len ; i++) {
row = curResultRowList[a_bnId[i]];
if (row != undefined) { // There is a result in search pane corresponding to that BTN
... | [
"function refreshCutPanel (a_bnId, status) {\n let row;\n let len = a_bnId.length;\n for (let i=0 ; i<len ; i++) {\n\trow = curRowList[a_bnId[i]];\n\tif (row != undefined) { // There is a result in search pane corresponding to that BTN\n\t // Update only the row, do not change anything else\n\t if (status) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the visible rectangle | function visibleRect(_posX, _posY, _width, _height, _size) {
if(bounded) {
var upperLeft = toWorld(0, 0);
var lowerRight = toWorld(screenSizeX, screenSizeY);
var xMin = upperLeft.x - _posX;
var yMin = upperLeft.y - _posY;
... | [
"GetVisibleRect(int, int, int, int, int) {\n\n }",
"get visibleRect() {\n return this._visibleRect;\n }",
"function tswUtilsGetVisibleRect()\n{\n\tvar width, height, x, y;\n\t\n\t//From http://thewebdevelopmentblog.com/2008/10/tutorial-pop-overs-part-2-centering-the-pop-over/\n if (document.all) \n\t{... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for setting comma to output | function addComma() {
if (!isDirty) {
setNum1Array('.');
} else {
setNum2Array('.');
}
setOutput(',');
} | [
"function withComma(value) {\n return value ? value + ', ' : '';\n}",
"function toComma(value) { \n return value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n} // END of toComma function",
"function toggleComma() {\n if (comma_separated) {\n try {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the directive keyword that matches the given text or undefined, if not found. | static _findMatch(text) {
return DirectiveState.keywords.find(elem => {
return elem === text;
});
} | [
"function fnFindWord(reString, text) {\n var re = new RegExp(reString);\n var result = re.exec(text);\n return result ? result[0] : result;\n }",
"function keyword(word) {\n return option('lang').keyword[word] || option('lang').keyword[word.toLowerCase()] || word;\n}",
"function resol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This class provides access to the telephony features of the device. | function Telephony() {
} | [
"function Telephony() {\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t }",
"static get supportsAccelerometer() {}",
"function getDeviceCapability()\r\n{\r\n\txrxDeviceConfigGetDeviceCapabilities( \"http://127.0.0.1\", getDeviceCapabilities_success, getDeviceCapatilities_failure, null);\r\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up the connection to the watchman client. Return a promise that is fulfilled when we have a client that has finished the capabilityCheck. | _setupClient() {
if (!this._clientPromise) {
this._clientPromise = new Promise((resolve, reject) => {
this._handleClientAndCheck(resolve, reject);
});
}
return this._clientPromise;
} | [
"_createClientAndCheck() {\n return new Promise((resolve, reject) => {\n let client;\n\n try {\n client = new watchman.Client(\n this._watchmanBinaryPath\n ? { watchmanBinaryPath: this._watchmanBinaryPath }\n : {}\n );\n } catch (error) {\n // if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialize function setting the balance, and letting the game know that it is not over yet | function init() {
cash = 100;
document.getElementById('balance').textContent = "Balance: $" + cash;
spinner.innerText = "Spin";
isGameOver = false;
} | [
"function initialBalanceUpdate(){\n\tbalance = balance - betAmount;\n\tsetBalance(balance);\n}",
"initialBal() {\n\t\t// 2. Add to transaction history\n\t\tlet bankAccount = searchAcctHolder(bankNum);\n\t\t// 3. Update new balance\n\t\tthis.balance = bankAccount.balance;\n\t}",
"constructor (balance) {\n thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
used to pass in the props to edit or clear them for the new form | componentWillReceiveProps(nextProps){
if(Object.keys(nextProps.edit).length > 0){
this.editForm(nextProps)
} else{
this.newForm()
}
} | [
"AddEditForm(props) {\n let formFields = [];\n for (var prop in props.curObject) {\n const thisProp = prop;\n if (thisProp[0] === thisProp[0].toUpperCase()) {\n formFields.push(\n <form>\n <label className=\"modalBodyLabel\">{prop}</label>\n <label className=\"m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validacion de los datos del 1er automata | function validarDatos(tipoautomata,entrada,alfabeto,inicial,final){
var strAlert = `!! Error ¡¡\nNo puedes ingresar una ',' (coma) al final del input.\nDebes finalizar la entrada con el ultimo dato.`,
strAlertAll = `!! Error ¡¡\nPuede que hayas ingresado una palabra no valida en alguno de los input.\nPrueb... | [
"validarDados() {\n\n\t\t//alert(document.getElementById('data').value);\n\t\tfor (let i in this) {\n\t\t\tif (this[i] == undefined || this[i] == '' || this[i] == null) {\n\n\t\t\t}\n\t\t}\n\n\t\tif (this.valor == 'e' || this.parcela == 'e') {\n\t\t\treturn false\n\t\t}\n\t\telse if (this.parcela < 1 || this.valor ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mouse Given a callback, and x, y coordinates, only execute the callback if the coordinates have changed by more than minPointerDifference | static executeOnGreatEnoughChange(x, y, minPointerDifference, name, callback) {
if (!window['lastPointers']) {
window.lastPointers = {};
}
var lastPointer = window.lastPointers[name];
if (!lastPointer) {
window.lastPointers[name] = [x, y];
return callback(0);
}
var diff = M... | [
"onActivePointerMove(callback, isOnce = false) {\n if (this._hoverMode === HOVER_MODE_EXTERNAL) {\n this._pointerActiveMoveCallbacks.push([\n callback,\n isOnce\n ]);\n\n return;\n }\n\n this._landing... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the new AccessConfig | setAccessConfig(valueNew){let t=e.ValueConverter.toObject(valueNew);if(null===t&&(t=this.getAttributeDefaultValueInternal("AccessConfig")),!Array.isArray(t))return void(TCHMI_CONSOLE_LOG_LEVEL>=1&&e.Log.error("[Source=Control, Module=TcHmi.Controls.System.TcHmiControl, Id="+this.getId()+", Attribute=AccessConfig] Non a... | [
"set config(obj) {\n this._config = obj;\n }",
"setAccessId(value) {\n super.put(\"access_id\", value);\n }",
"function setConfig(config) {\n appConfig = config;\n}",
"setConfig() {\n\t\tthis.config = config.get();\n\t}",
"setAccessKey(value) {\n super.put(\"access_key\", value);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
increments the index in storage and saves it again | static setsIndexTotalPlusOne() {
let total = this.getIndexTotal();
total += 1;
localStorage.setItem('index', JSON.stringify(total));
} | [
"async saveCurentIndex(newStep, filename) {\n\n this.check()\n await this.storage.saveIndex(newStep, filename)\n }",
"save() {\n if (this._history.length > 9){\n this._history.shift();\n }\n this._history.push(this.internalData);\n // Make the commit to setup the index and the state\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate the script tags for all the client code. | function _generateScriptTags() {
var root = path.join(__dirname, '../../dist/');
var files = glob.sync([
//vendors libraries
root + "js/vendors/jquery*.js",
root + "js/vendors/angular.js*",
root + "js/vendors/angular*.js",
root + "js/vendors/*",
//application file... | [
"entryPointScriptTags(name) {\n const scripts = this.entryPointJsFiles(name);\n const scriptAttributes = this.config.script ? this.config.script.attributes || {} : {};\n return scripts\n .map((url) => `<script src=\"${url}\"${stringify_attributes_1.default(scriptAttributes)}></script... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disposes incremental build resources present in the context. | async dispose() {
try {
return __classPrivateFieldGet(this, _BundlerContext_esbuildContext, "f")?.dispose();
}
finally {
__classPrivateFieldSet(this, _BundlerContext_esbuildContext, undefined, "f");
}
} | [
"function dispose() {\n queue.then(function () { return disposeProjects(); });\n}",
"disposeResources() {\n\n if ( this.bPassThrough ) {\n this.bPassThrough.disposeResources_and_recycleToPool();\n this.bPassThrough = null;\n }\n\n if ( this.afterBias ) {\n this.afterBias.disposeResource... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the map markers with the current places | updateMapMarkers(){
let places = this.filteredPlaces();
this._mapService.fitPlaces(places);
this._mapService.clearMarkers();
places.forEach(place => {
let marker = this._mapService.placeMarker(place);
marker.addListener('click', () => {
this.selec... | [
"function updateMarkers() {\n markerList.forEach(marker => {\n placesMap().forEach(place => {\n if (place.title() === marker.title) {\n if (place.visible()) {\n marker.setMap(map);\n } else {\n marker.setMap(null);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_checkParams( fn, current, changes ) Verifies parameters in [changes] and copies them to [current] Returns AQ.DONE on success, else AQ.ERROR | function _checkParams ( fn, current, changes )
{
var type, val;
type = _typeOf( changes );
if ( !changes || ( type === "undefined" ) )
{
return AQ.DONE;
}
if ( type !== "object" )
{
return _error( fn + "params not an object" );
}
// check .path property
val = changes.path;
type = _typeO... | [
"function _checkParams ( fn, current, changes )\n\t{\n\t\tvar type, val;\n\n\t\ttype = _typeOf( changes );\n\t\tif ( ( type === \"undefined\" ) || !changes )\n\t\t{\n\t\t\treturn AQ.DONE;\n\t\t}\n\n\t\tif ( type !== \"object\" )\n\t\t{\n\t\t\treturn _error( fn + \"params not an object\" );\n\t\t}\n\n\t\t// check .p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generally third parties should not use this constructor. The recommended way to start a batch is by calling SPHttpClient.beginBatch(). | function SPHttpClientBatch(serviceScope, batchCreationOptions) {
var _this = this;
this._batchedRequests = [];
serviceScope.whenFinished(function () {
_this._fetchProvider = serviceScope.consume(fetchProviderServiceKey);
_this._randomNumberGenerator = serviceScope.co... | [
"function SPHttpClientBatch(serviceScope, batchCreationOptions) {\n var _this = this;\n this._batchedRequests = [];\n serviceScope.whenFinished(function () {\n _this._fetchProvider = serviceScope.consume(_httpClient_FetchProvider__WEBPACK_IMPORTED_MODULE_4__[\"fetchProviderServiceKey... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creating function to list items in basket | function listItems() {
for( let items of basket){
console.log('items in the basket', items);
}
} | [
"function listItems ( basket ) {\n console.log('Basket contains the following items:');\n for ( let i in basket ) {\n console.log(basket[i]);\n }\n}",
"function listItems(){\n for(let i = 0; i < basket.length; i++){\n console.log(basket[i]);\n }\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Radioactive substances for nonnuclear sites | async radioactiveSubstanceNonNuclearSiteRadio(title) {
return this.browser.wait(until.elementLocated(By.id("chosen-category-radioactive-input")), 5 * 20000);
} | [
"function psyRadio(radio) {\n\tvar psyArray = d3.values(psySymp);\n\t\n\td3.select(\"body\")\n .selectAll(\"svg#graph\")\n .selectAll(\"g\")\n .selectAll(\"rect\")\n .style(\"visibility\", function (d) {\n if (radio.value == \"any_psy\" && (psyArray[d.index].psySymp[0] == \"1\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Utility function to remove driver marker | function removeDriverMarker(driverData){
const index = markers.findIndex(marker => marker.phoneNumber == driverData.phoneNumber);
if(index === -1){
console.error("Marker not found");
}
else{
//console.log(markers[index]);
markers[index].mark.setMap(null);
markers.splice(index,1);
console.log('Rem... | [
"function clearDriverMarker(){\n if(driverMarkers.length>0){\n driverMarkers.forEach(function(valu,key,arry){\n valu.setMap(null);\n if(key===arry.length-1){\n driverMarkers=[];\n }\n });\n }\n\n }",
"function destructivelyRemoveFirstDriver() {\n drivers.shift();\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Class BookTreeBuilder builds trees from book description XML | function BookTreeBuilder() {
} | [
"static async _initAdventureBookElements () {\n\t\tconst [adventureBookIndex] = await Promise.all([\n\t\t\tDataUtil.loadJSON(`${Renderer.get().baseUrl}data/generated/gendata-nav-adventure-book-index.json`),\n\t\t\tExcludeUtil.pInitialise(),\n\t\t]);\n\t\tconst brew = await BrewUtil.pAddBrewData();\n\n\t\t[\n\t\t\t/... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The renderer used by the running sessions widget. | get renderer() {
return this._renderer;
} | [
"getRenderer() {\n return this.renderer;\n }",
"get renderer(){\r\n\t\treturn this.__render_root ?? this }",
"get interactiveRenderer () {\n return this._interactiveRenderer = (this._interactiveRenderer || InteractiveRendererModel.parse({\n session: this\n }))\n }",
"function renderer()\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes all Pause and plays and makes each image as before | function resetEverything(){
resetImages();
resetPlay();
resetPause();
} | [
"function resetPlayerImages(){\n var addresses = collectImagesInfo();\n setPlayerImages(addresses);\n }",
"function resetImages(){\n resetButtonHolders();\n changeImageBackTank();\n changeImageBackAA();\n changeImageBackPlane();\n changeImageBackUCS();\n}",
"undoAllPlays() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Declare prompts to allow them to select what information they specifically want to update... | function updateInfoPrompt () {
return inquirer.prompt ([
{
type: "list",
name: "itemToUpdate",
message: "What would you like to update?",
choices: [
"The role for an existing employee"
]
}... | [
"async function whatToUpdate(){\n const updateOptions = await inquirer\n .prompt([\n {\n type: \"list\",\n name: \"viewList\",\n message: \"Please select the type of employee information you would like to update\",\n choices: [\"Employees Manager\", \"Employees Role\", \"Go Back\"]\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SimpleKeyNavigation handles left/right or top/bottom keys to move the focus. It is a very simple version of key navigation. It only moves the focus among an array. Please note that this module listens key event and changes focus while we start it. If we don't need it, we should stop it. | function SimpleKeyNavigation() {
} | [
"triggerNavigation(key){switch(key){case\"Enter\":this.selectFocused();break;case\"ArrowLeft\":this.focusPrevious();break;case\"End\":this.focusLast();break;case\"Home\":this.focusFirst();break;case\"ArrowRight\":this.focusNext();break;// close the focused tab\ncase\"Escape\":this.closeFocused();break;}}",
"trigg... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
exported CalculationStepPlot / global explorableGroup / global ExplorableHintedText / global functionPlotter | function CalculationStepPlot(options) {
//TODO: DONT HARDCODE THESE VALUES
const leftColumnPosition = 100;
const middleColumnPosition = 100;
let columns,
color,
stepPlot,
domain,
range,
height,
width,
where,
functionToPlot,
lineTextColor;
stepPlot = {};
init(options);... | [
"function CalculationStepNumberLinePlot(options) {\n let color,\n fontFamily,\n fontSize,\n functionToPlot,\n labelText,\n linePlot,\n where;\n\n linePlot = this;\n\n init(options);\n\n return linePlot;\n\n /* INITIALIZE */\n function init(options) {\n\n _required(options);\n _defaults... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Comprueba si los 'datos' pasados coinciden con los que hay en $scope | function necesitaRefresco(datos) {
LogZimbra.log("Popup Defecto. Necesita Refresco. Inicio")
LogZimbra.log("Popup Defecto. Necesita Refresco. datos=" + JSON.stringify(datos))
LogZimbra.log("Popup Defecto. Necesita Refresco. $scope.datos=" + JSON.stringify($scope.datos))
let hayOcultos = datos.me... | [
"function validarDatos() {\n let regreso = true;\n //Itera por todo el arreglo\n for (let i = 0; i < datos.length; i++) {\n if (datos[i] == \"\" || valores[i] == \"\") {\n //Si en algun indice esta vacio, cambiamos la variable a falso\n regreso = false;\n }\n }\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates whether a vertical position property matches the expected values. | function validateVerticalPosition(property, value) {
if (value !== 'top' && value !== 'bottom' && value !== 'center') {
throw Error("ConnectedPosition: Invalid ".concat(property, " \"").concat(value, "\". ") + "Expected \"top\", \"bottom\" or \"center\".");
}
} | [
"function _validateVerticalPosition(property, value) {\n if (value !== 'top' && value !== 'bottom' && value !== 'center') {\n throw Error(\"ConnectedPosition: Invalid \".concat(property, \" \\\"\").concat(value, \"\\\". \") + \"Expected \\\"top\\\", \\\"bottom\\\" or \\\"center\\\".\");\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function assigns colors based on a numeric value (1,2,3) | function assignColor(value) {
var color;
if( value == 3 ){
color = 'green';
} else if( value == 2 ){
color = 'yellow';
} else if( value == 1 ){
color = 'red';
}
return color;
} | [
"function setNumColor(num){\n return num <= 4 ? '#e6ff9a' : '#fff' ;\n}",
"function setColor(num){\r\n\t\t\t\tcolorVal = num;\r\n\t\t\t\treturn getColor(colorVal);\r\n\t\t\t}",
"function changeColor(number) {\n var color = \"\";\n if (number < 0) {\n color = \"red\";\n } else if (number > 0) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find_elems() retrieves the active element, sets to input gets parent of input which is a form, stores to form | function find_elems(){
inp = $(document.activeElement)
inp_store = inp.clone().wrap('<p>').parent().html();
inp.parents().each(function(){
var cur = $(this);
//console.log(cur.prop('tagName'))
if(cur.prop('tagName')=="FORM"){
form = cur;
form_store = form.clone().wrap('<p>').parent().html();
}
});
} | [
"function getInputElements(parent) {\r\n\t//CQ28461 - make the for-loop more efficient by not selecting types we don't want (ie. hidden, submit, image, etc...)\r\n\tvar p = $(parent);\r\n\tvar elems = p.find('input:enabled[type=text]');\r\n\telems = $.merge(elems, p.find('input:enabled[type=checkbox]'));\r\n\telems... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mapWxToIconAndDescr Extract weather ID (condition code) and text description from weather object returned by OpenWeatherMap.org API. Map the condition code to a weather type and corresponding icon. Return the icon url and the description. | function mapWxToIconAndDescr(wxAPIreturn) {
// note we are not handling day vs. night (wrt icons)
var descr = wxAPIreturn.weather[0].description;
var iconUrl = "";
var coarseWeatherCode = Math.floor(wxAPIreturn.weather[0].id / 100);
switch (coarseWeatherCode) {
case 2:
iconU... | [
"function getWeatherIcon(weather) {\r\n\tvar iconUrl = \"http://openweathermap.org/img/wn/\" + weather.icon + \"@2x.png\"\r\n\tvar iconDescr = weather.description;\r\n\treturn [iconUrl, iconDescr];\r\n}",
"getWeatherIcon(desc) {\n // we pass through a parameter from the caller in html. We are calling i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mds is the subset to seach in searchKey is the string we want to check in the keys | function findObjectKeys(mds, searchKey) {
if (searches.hasOwnProperty(searchKey) === false) {
searches[searchKey] = false;
}
for (var item in mds) {
// check if the key has a value or points to an object
if (typeof (mds[item]) === "object") {
// if value is an object call recursively the functi... | [
"function validateKey (mds, searchKey, searchValue) {\n if (searches.hasOwnProperty(searchKey) === false) {\n searches[searchKey] = {};\n searches[searchKey][searchValue] = false;\n }\n else {\n if (searches[searchKey].hasOwnProperty(searchValue) === false) {\n searches[searchKey][searchValue] = fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the time in seconds from the offset in pixels | function calcTime(dist){
//Get duration of the video
var dur = Popcorn("#video").duration();
//Get width of timeline in pixels
var wdth = document.getElementById("visualPoints").style.width;
//Trim for calculations
wdth = wdth.substr(0,wdth.length - 2);
//Calculate pixel/total ratio
var ratio = dist / wdth;
//... | [
"calculateTime(x){\n //var mapSeconds = multitrackPlayer.map_range(x, 0, 1, 0, this.currentBuffer.duration);\n var mapSeconds = multitrackPlayer.map_range(x, 0, 1, 0, this.totalSamples);\n \n return mapSeconds;\n }",
"function changeInTime() {\r\n let now = Date.now();\r\n let... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
expire() replace full page with given text | function expire(text) {
// clear interval
clearInterval(ival);
// clear page
D.body.innerText = text;
// fire event after page has been cleared
fire('forcedtimeout');
} | [
"function mostra_news(){\r\n cancella_cookie('forum_news');\r\n location.reload();\r\n}",
"function gh_write_cache(page, content) {\r\n var path = gh_cache_dir(page);\r\n if (content) {\r\n fs.writeFileSync(path, content);\r\n }\r\n}",
"function BouncePage( time, page )\n{\n\n\tif( page == undefined... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
snippetend:[s3.JavaScript.s3_PhotoViewer.config] Functions snippetstart:[s3.JavaScript.s3_PhotoViewer.listAlbums] List the photo albums that exist in the bucket. | function listAlbums() {
s3.listObjects({Delimiter: '/'}, function(err, data) {
if (err) {
return alert('There was an error listing your albums: ' + err.message);
} else {
var albums = data.CommonPrefixes.map(function(commonPrefix) {
var prefix = commonPrefix.Prefix;
var albu... | [
"function listAlbums() {\n s3.listObjects({Delimiter: '/'}, function(err, data) {\n if (err) {\n return alert('There was an error listing your albums: ' + err.message);\n } else {\n var albums = data.CommonPrefixes.map(function(commonPrefix) {\n var prefix = commonPrefix.Prefix... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
drawBackground(); drawHour(4,30); drawMin(30); drawSec(50); drawDot(); | function draw(){
ctx.clearRect(0,0,width,height); //清空工作区重画,不然所有的轨迹都有
var now = new Date();
var hour = now.getHours();
var min = now.getMinutes();
var sec = now.getSeconds();
drawBackground();
drawHour(hour,min);
drawMin(min);
drawSec(sec);
drawDot();
ctx.restore();//恢复原来环境,坐标原点左上角.因为中间调用了一次原点是设置,所以需要还原
} | [
"function draw() {\n\n\tctx.clearRect(0,0,width,height);//清除整个时钟\n\n\tvar now=new Date();\n\tvar hour=now.getHours();\n\tvar minute=now.getMinutes();\n\tvar second=now.getSeconds();\n\tvar millisecond=now.getMilliseconds();\n\tdrawBackground();\n\tdrawHour(hour,minute);\n\tdrawMinute(minute,second);\n\tdrawSecond(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get deposit needed for house value. | deposit_for(value) {
this.deposit_amount = this.opts.mortgage_deposit(value);
this.cmhc_insurance = this.opts.mortgage_insurance(value, this.deposit_amount);
return this.deposit_needed = value * (this.deposit_amount + this.opts.property_transaction_fees);
} | [
"get saldo() {\n\t\treturn this.ingreso - this.deuda\n\t}",
"get amountPerDose() {\n if (!this._entry.dosage\n || !this._entry.dosage.doseAmount\n || !this._entry.dosage.doseAmount.value) return null;\n return {\n value: this._entry.dosage.doseAmount.value.number.dec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the necessary content script css into the provided document | function load_css(document) {
// taken from https://stackoverflow.com/questions/574944/how-to-load-up-css-files-using-javascript
var cssId = "psono-css"; // you could encode the css path itself to generate id..
if (!document.getElementById(cssId)) {
var head = document.getElementsByT... | [
"function loadCss() {\n $.post('/get-css', function (data) {\n var style = document.createElement('style');\n style.innerHTML = data;\n document.head.appendChild(style);\n });\n}",
"async loadCss(){\n //render css elements to dom\n this.styles.forEach(el=>{\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the storage key for the current conversation state. | getStorageKey(context) {
const activity = context.activity;
const channelId = activity.channelId;
const conversationId = activity && activity.conversation && activity.conversation.id ? activity.conversation.id : undefined;
if (!channelId) {
throw new Error('missing activity.c... | [
"storagePref(){\n if(this.state.currentValues.hasOwnProperty(this.keys.storage)){\n return this.state.currentValues[this.keys.storage];\n } else {\n if(this.state.storageList.length>0)\n return this.state.storageList[0].id;\n else\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the scale of the wall | onUpdateScale() {
this.wall.scale.set(this.size.x, this.size.y, 1);
} | [
"updateScale() {\n this.scale = this.getDrawingScale();\n }",
"scaleChanged() {\n this.updateBoundary();\n }",
"scale() {\n this._mesh.scaling.x = 1.1;\n this._mesh.scaling.z = 1.1;\n this._mesh.scaling.y = 5.5;\n }",
"updateRadiusScaling(){\n // Get distance fro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Click handler for new customer form | function new_customer(e){
e.preventDefault();
test.templateScenariosPromise = prepare_scenario_check();
//after the template data has loaded, we create the the customer
test.templateScenariosPromise.always(create_customer);
} | [
"function createNewCustomerForm() {\n var editable = true;\n var str = createField('name_', 'Name: ', '', editable);\n str += createField('email', 'Email: ', '', editable);\n str += createField('line1', 'Address Line1: ', '', editable);\n str += createField('line2', 'Address Line2: ', '', editable);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Missing Letters Finds missing letter in str range and returns it | function fearNotLetter(str) {
// Defining numeric range of str using the charCodes of the letters at first and last index
// Start of range
var start = str.charCodeAt(0);
// End of range
var end = str.charCodeAt(str.length - 1);
// Variable for sum of all charCodes from start to end
var ... | [
"function findMissingLetter(str) {\n let checker = str.charCodeAt(0);\n for (let i=0;i<str.length;i++) {\n if (str.charCodeAt(i) - checker === 0 || str.charCodeAt(i) - checker === 1) {\n checker = str.charCodeAt(i);\n } else {\n return String.fromCharCode(str.charCodeAt(i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Press the Select button | *pressButtonSelect() {
yield this.sendEvent({ type: 0x01, code: 0x13a, value: 1 });
} | [
"select() {\r\n this.ui.input.select();\r\n }",
"function clickOptiontoSelect(){\n\n}",
"static get BUTTON_SELECT() {\n return \"select\";\n }",
"select() {\n this.callMethodOnElementOrChild(this.input, 'select');\n }",
"function select() {\n selection.select(swimlane)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function smaller(arr) that given an array arr, you have to return the amount of numbers that are smaller than arr[i] to the right. For example: smaller([5, 4, 3, 2, 1]) === [4, 3, 2, 1, 0] smaller([1, 2, 0]) === [1, 1, 0] | function smaller(arr) {
const smallerArr = [];
let count = 0;
let count2 = 0;
for (let i=0; i<arr.length; i++) {
count2++;
for (let j=count2; j<arr.length; j++) {
if (arr[i] > arr[j]) {
count++;
}
}
smallerArr.push(count);
count = 0;
}
return smallerArr;
} | [
"function smaller(arr) {\n let res = [];\n let i = 0;\n for (i; i < arr.length; i++) {\n res.push(countSmaller(arr, arr[i], i + 1));\n }\n return res;\n}",
"function smaller(arr) {\n let ans = [];\n let count = 0;\n\n for (let i = 0; i < arr.length; i++) {\n count = 0;\n\n for (let ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recursively flattens an array. A new array containing all the elements is returned. If level is specified, it will only flatten up to that level. | function flatten(arr, level) {
if (arr == null) {
return [];
}
level = level == null ? -1 : level;
return flattenTo(arr, [], level);
} | [
"function flatten(arr, level) {\n if (arr == null) {\n return [];\n }\n\n level = level == null ? -1 : level;\n return flattenTo(arr, [], level);\n }",
"function flatten$1(array, depth) {\n return flatten(array, depth, false);\n }",
"function flatten$1(array, depth)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computes a list of TapeNodes that connect x to y, filtering everything else out and preserving the order of the original tape elements. | function getFilteredNodesXToY(tape, xs, y) {
// Forward pass to compute all the nodes and Tensors that are transitively a
// function of x.
var tensorsFromX = {};
var nodesFromX = {};
for (var i = 0; i < xs.length; i++) {
tensorsFromX[xs[i].id] = true;
}
for (var i = 0; i < tape.leng... | [
"function getFilteredNodesXToY(tape, xs, y) {\n // Forward pass to compute all the nodes and Tensors that are transitively a\n // function of x.\n const tensorsFromX = {};\n const nodesFromX = {};\n for (let i = 0; i < xs.length; i++) {\n tensorsFromX[xs[i].id] = true;\n }\n for (let i =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a tweetable url | function generateTweetableUrl(text, url, handleName) {
var tweetableText = "https://twitter.com/intent/tweet?url=" + url + "&via=" + handleName + "&text=" +
encodeURIComponent(
text);
return tweetableText;
} | [
"function getTweetUrl(tweetId, twitterId) {\n return 'http://twitter.com/' + twitterId + '/statuses/' + tweetId.toString();\n}",
"function getTweetUrl(data) {\n return 'https://twitter.com/' + data.user.screen_name + '/status/' + data.id_str\n}",
"getTweetUrl(handletype) {\n let tweetUrl = '';\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes text color of all selected cells in grid to clr clr is color name like "Red" Adds the color class to cell Class attribute | function ChangeColor(G,clr){
if(clr=="Black") clr = ""; else clr = " Color"+clr;
var S = G.GetSelRanges(), update = S.length>0;
if(!G.FRect) S[S.length] = [G.FRow,G.FCol,G.FRow,G.FCol]; // Adds focused cell, because this example does not select one focused cell
if(update) G.StartUpdate();
for(var i=0;i<S.length;i++){
... | [
"function ChangeBackground(G,clr){\nif(clr==\"White\") clr = \"\";\nvar S = G.GetSelRanges(), update = S.length>0;\nif(!G.FRect) S[S.length] = [G.FRow,G.FCol,G.FRow,G.FCol]; // Adds focused cell, because this example does not select one focused cell\nif(update) G.StartUpdate();\nfor(var i=0;i<S.length;i++){\n for... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Submits a new note and brings user to notes page upon completion | function submitnote(note) {
$.post("/api/notes", note, function() {
window.location.href = "/notes";
});
} | [
"function submitNote(note) {\n $.post(\"/api/notes\", note, function() {\n var id = note.EntryId;\n window.location.href = \"/notes?entry_id=\" + id;\n });\n }",
"function submitNote(event) {\n props.onAdd(note);\n setNote({\n title: \"\",\n content: \"\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Analysis data for single file | function FileAnalysis(path, analysis) {
this.path = path;
const cyclomatic = analysis.functions.map(f => f.cyclomatic);
// Scale to between 0 and 100
this.maintainability = Math.max(0, analysis.maintainability * 100 / 171);
this.sloc = analysis.aggregate.sloc.logical;
this.cyclomati... | [
"function openDataFile() {\n\n \n // Grab the file object\n \n let selectedFile = document.getElementById('loadFile').files[0];\n \n if(typeof(selectedFile) === 'undefined') return;\n \n // Set the mimetype of files to be read as 'text.*'\n \n let textType = /text.*/;\n \n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test.assertSimilar(dirReduc(["NORTH", "SOUTH", "SOUTH", "EAST", "WEST", "NORTH", "WEST"]), ["WEST"]) | function dirReduc(dir){
for (let i = 1; i < dir.length; ++i) {
const unnecessary = (dir[i - 1] === 'NORTH' && dir[i] === 'SOUTH')
|| (dir[i - 1] === 'SOUTH' && dir[i] === 'NORTH')
|| (dir[i - 1] === 'WEST' && dir[i] === 'EAST')
|| (dir[i - 1] === 'EAST' && dir[i] === 'WEST');
if (unnece... | [
"function dirReduc(arr) {\n var i = 0;\n while (i < arr.length) {\n if (arr[i] === 'NORTH') {\n if (arr[i + 1] === 'SOUTH') {\n arr = removeArrayIndexAt(arr, i);\n i = -1;\n }\n } else if (arr[i] == 'SOUTH') {\n if (arr[i + 1] === 'NORTH') {\n arr = removeArrayIndexAt(arr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copy the current video frame to our canvas. If there is a cached frame ready to render and the video hasn't caught up, the cached frame will render first. For testing, we'll render the cache if it exists and ignore the video. | drawCurrentFrame() {
const ctx = this.canvas.current.getContext('2d');
// const backbufferContext = this.backbuffer.current.getContext('2d');
// Draw the cached frame if we have it and no higher quality source
// frame to draw (video still seeking)
if (this.cacheFrameReady && !t... | [
"function drawFrameOnCanvas(frame) {\n\t\n\t\tvar reset = frame.reset;\n\t\n canvas.height = video.videoHeight;\n canvas.width = video.videoWidth;\n\t\t// retrieve context for drawing\n\t\tvar context = canvas.getContext(\"2d\");\n\t\t\t\t\n\t\t// Start by clearing the canvas\n\t\tcontext.clearRect(0,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adjust the labels for the vertices and blossoms. Takes O(m) time. | function relabel() {
let d1 = evh.empty() ? 0 : evh.key(evh.findmin());
let e = exh.findmin();
let d2 = (e && e <= g.edgeRange ? slack(e) : Infinity);
e = eeh.findmin();
while (e && bloss.outer(g.left(e)) == bloss.outer(g.right(e))) {
eeh.delete(e); e = eeh.findmin(); steps++;
}
let d3 = (e ? eeh.key(e) : In... | [
"function updateLabels() {\n\tlabels = []\n\tfor (var i in nodes) {\n\t\tif ('label' in nodes[i]) {\n\t\t\tlabels.push({'id':nodes[i]['id'], 'label':nodes[i]['label']})\n\t\t}\n\t}\n}",
"function improve_labelling()\n {\n if (debug) console.log('improve labelling');\n stat_improve++; // stat\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a and b are both lists of mappings, and each mapping is valid for some subset of the same formula. The list of output mappings is the list of all mappings that fit at least one mapping in a and b. We take the cross product of a and b, and include in the final list every combination of elements in a and b that does not ... | function tf$mergeMappings(a, b) {
if(a.length == 0 || b.length == 0)
return [];
var mapLength = a[0].length;
var mappings = [];
for(var i = 0; i < a.length; ++i) {
for(var j = 0; j < b.length; ++j) {
var candidate = [];
for(var k = 0; k < mapLength; ++k) {
if(a[i][k] === null &&... | [
"static cartesianProduct(a, b) {\n b = b ? b : a;\n const cartesianProductSet = new XSet();\n for (const aValue of a) {\n for (const bValue of b) {\n cartesianProductSet.add([aValue, bValue]);\n }\n }\n return cartesianProductSet;\n }",
"function sub_map(a, b) {\n // Pick the lon... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the total number of authors in a category Note: this function's signature must match the signature of the "selectedauthorsprediction" function. | function getTotalAuthorsInCategory(category, filterName, filterValue) {
if ( filterValue === LIST_ITEM_DEFAULT_VALUE ) {
return get("total-authors");
}
if ( no(category) ) {
return 0;
}
var categoryAuthors = category[CATEGORY_AUTHORS];
return categoryAuthors.length;
} | [
"function countAuthors() {\n let authors = []\n\n for(let category of booksByCategory) {\n for(let book of category.books) {\n if(authors.indexOf(book.author) == -1) { // which means 'there is no author with this name in the \"authors array\" yet'.\n authors.push(book.author)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the expansion symbol template for the game; called from registerGame. Talisman does its own custom expansion symbol painting, and uses logical variants (see the description of ExpansionSymbolTemplate in the Strange Eons API). | function createExpansionSymbolTemplate() {
const STANDARD_EXP_SYM_SIZE = 78;
const GOLD = 0xd7c926;
return new JavaAdapter(
AbstractExpansionSymbolTemplate, {
// Returns the number of visual variants: this is the number
// of different design variants required for each symbol... | [
"function registerGame() {\n // the expansion symbol template; note that it differentiates\n // between visual (design style) and logical (intended purpose)\n // expansion symbol variants\n let est = new AbstractExpansionSymbolTemplate() {};\n\n\n // this is the class gamedata.Game; the extension\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PATCH to make user goal public or mark complete | patchUserGoal(goal_id, data) {
return fetch(`${config.API_ENDPOINT}/goals/${goal_id}`, {
method: 'PATCH',
headers: {
'content-type': 'application/json',
'authorization': `bearer ${TokenService.getAuthToken()}`
},
body: JSON.stringify(data),
})
.then(res =>
(... | [
"setUserTaskCompletion(goalId, taskId, boolData) {\n return axios.patch(`/goals/${goalId}/tasks/${taskId}/user`, boolData)\n }",
"function updateGoal(e) {\n e.preventDefault();\n requestData = `${$(this).serialize()}&userId=${currentUser.userId}`;\n $.ajax({\n method: 'PUT',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
data_type: the type of field onFieldChange: the event handler the value for this field data_index: this field's item index custom_index: this field's custom_field index (null if not a custom field) | function handleChange(e, index, custom_index = null) {
onFieldChange(index, custom_index, e);
} | [
"handleDataTypeChange(e, index, dataType) {\n this.validateObjectType(dataType);\n this.changeFieldValue('dataType', dataType);\n }",
"renderEditableField(dataColumn, dataRow, rowIdx) {\n const { editIdx, dataErrors, handleChange } = this.props;\n\n let value = dataRow[dataColumn.prop];\n switch (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sorts the entries array by date | function sortEntries() {
entries.sort((a, b) => (new Date(a.date).getTime() - new Date(b.date).getTime()));
} | [
"function sortEntriesMRU(entries){\n\t// Comparison function for sort\n\tvar date_sort_desc = function (entry1, entry2) {\n\t\tvar date1 = Date.parse(entry1.dateAccessed);\n\t\tvar date2 = Date.parse(entry2.dateAccessed);\n\t\tif (date1 > date2) return -1;\n\t\tif (date1 < date2) return 1;\n\t\treturn 0;\n\t};\n c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get search key from state if not generate new one from server | function getSearchKey() {
var searchKey;
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function getSearchKey$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
_context5.next = 2;
return Object(redux_saga_effects__WEBPAC... | [
"function getSearchKey() {\n let searchKeys = require('./data.js').searchKeys;\n return searchKeys[Math.floor(Math.random() * searchKeys.length)].toLowerCase();\n }",
"function get_key(query) {\n return 'q:' + hash(query)\n}",
"onSearchChange(e) {\n const value = e.target.value;\n this.s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
same as the doDamage for the enemywill update the healthbar and check if dead | doDamage(dmg){
if (!(dmg > 0))
return;
this.hp -= dmg;
if (this.hp <= 0){
this.alive = false;
this.hp = 0;
}
} | [
"function updateDamage() {\n\t\t\thealthBar.set('value',hits);\n\n\t\t\tif (hits >= 100) {\n\t\t\t\tgameEnded();\n\t\t\t}\n\t\t}",
"applyDamage(damage) {\n if (this.health > 0) {\n this.health = Math.max( this.health - damage, 0 );\n if (this.health === 0) {\n // TODO: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch expo tokens in the database | async function getPushTokens() {
try {
const expoTokens = await Account.find(
{ expoToken: { $ne: null }}, {expoToken: 1})
var tokens = [];
expoTokens.forEach((device) => tokens.push(device.expoToken));
return tokens;
} catch (error) {
console.log(error.message);
}
} | [
"async tokens() {\n\t\tif (tokens.length > 0) {\n\t\t\treturn tokens;\n\t\t}\n\t\tconst data = await fetch(tokenLists.honeyswap, {\n\t\t\tmethods: 'GET',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t}).then(response => {\n\t\t\treturn response.json();\n\t\t});\n\n\t\ttokens = data.tokens;\n\t\tretur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the Debugger. Called after the DOM, and all external scripts, have been loaded. | function initializeDebugger() {
if (document.readyState === 'loading')
return;
document.removeEventListener('DOMContentLoaded', initializeDebugger);
cr.ui.login.debug.DebuggerUI.getInstance().register(document.body);
} | [
"function init() {\n initializeVariables();\n initializeHtmlElements();\n}",
"function initializeDebugger() {\n try {\n initDebugger(kOutputContainer, kShouldUseConsole);\n } catch (failedToInitializeException) {\n log(failedToInitializeException);\n throw kFailedT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Alex Norton :: 2015 Recursive Neuron (w/ ArrayList) A class for extending a Neuron with Sum Weighted Forces across nodes Contructor: P5.Vector: position P5.Vector: velocity Float: neuron_timer Integer: depth > Current depth Integer: max_depth P5, p > instance | function Node (args) {
args = args || {};
// Private arguments from constructor
var p = args.p;
// Public P5.Vector objects
this.start = args.position.copy() || p.createVector();
this.position = args.position.copy() || p.createVector();
this.velocity = args.velocity.copy() || p.createVector();
// Public flo... | [
"buildLayers(){\r\n this.layers = []\r\n this.topology.forEach(layer => this.layers.push([]))\r\n \r\n this.topology.forEach((layerSize, iLayer) => {\r\n let layer = this.layers[iLayer],\r\n prevLayer = this.layers[iLayer - 1] || undefined,\r\n nextLayer = this.layers[iLayer + 1] ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fixes broken google maps iframe titles | static fixIframe(){
const iframe = document.getElementsByTagName('iframe')[0];
//console.log(iframe);
iframe.setAttribute('title', 'Map of New York Restaurants');
} | [
"function setTitle()\n {\n var newTitle=document.title;\n //Bug 11844503 : Processing Icon For Popups\n //Once the popup contents are fetched from the popup region for parametrized\n //popups this method is called on iframe onload event.\n //call the processing icon javascript API to hide the icon.\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
build css from filter settings, filters and/or options and set it | function applycss(which) {
_F('applycss', which);
var style = [];
var name;
for (var i in which) {
style = [];
name = which[i];
switch(name) {
case 'filter': //anything that ... | [
"initCustomCss() {\n const uglifycss = require('uglifycss');\n\n const rawCss = this.configManager.getConfig('crowi', 'customize:css') || '';\n\n // uglify and store\n this.customCss = uglifycss.processString(rawCss);\n\n this.lastLoadedAt = new Date();\n }",
"addStyle() {\n //write own css... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Objects / Functions / Trace when needed ... text = string to trace force (optional) = if true, force putting trace in box even if not activated (for later display) | function trace (text, force = false) {
if (options.traceEnabled || force) {
TracePlace.textContent += text + "\r\n";
}
} | [
"function trace (text, force = false) {\r\n if (options.traceEnabled || force) {\r\n\tconsole.log(text+\"\\r\\n\");\r\n }\r\n}",
"function trace(txt) {\r\n\tif (DEBUG_MODE) { \r\n\t\tconsole.log(txt);\r\n\t}\r\n}",
"function trace(bytLevel, strText) {\n\n if (g_bytTraceLevel >= bytLevel) {\n WScript... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start page defines the start of the application. It gets the videos from the backend, creates the loader and starts the loader of the player. | function startApp() {
if(debug) {
console.log("Page ready...");
}
// Add loader
$('#container').append('<div id="loader"><img src="imgs/loader.gif">LOADING</div>');
// Add Events
addEvents();
// Split Into Timecodes
convertTimecodes();
// Load Player
//setTimeo... | [
"function Start()\n {\n console.log(\"App Started...\");\n //calling all functions required to start website\n SetProjects();\n InjectHR();\n InjectBottomNav();\n switch (document.title) \n {\n // Case statements for display functions\n case \"Home\":\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check the stack of queue. If it has enough queued items then run exec handle | checkQueue() {
if (this._locked === false && this._stack.length > 0 && this._current < this._numberOfExecution) {
this._locked = true;
console.log('Received new item');
let items = [];
let remainSlots = this._numberOfExecution - this._current;
let max ... | [
"handleQueue_() {\n if (!this.active || this.run) {\n return;\n }\n\n if (!(this.default_group in this.stack_) ||\n this.stack_[this.default_group].length <= 0) {\n this.active = false;\n return;\n }\n\n let task = this.stack_[this.default_group].shift();\n let callback = tas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the highprecision uniform data of a material used to render a [[HighPrecisionObject]]. | function updateHpUniforms(object, camera, shaderMaterial) {
const highPrecisionCameraInfo = createHighPrecisionCameraPos(camera, object.matrixWorldInverse);
const mvp = highPrecisionCameraInfo.viewProjection;
if (shaderMaterial !== undefined && shaderMaterial.isMaterial) {
if (shader... | [
"function updateMaterial(materialObject, dataTexture){\n\n materialObject.hmDataTextureLow = dataTexture[0];\n materialObject.hmDataTextureHigh = dataTexture[1];\n materialObject.hmHashTextureLow = dataTexture[2];\n materialObject.hmHashTextureHigh = dataTexture[3];\n\n materialObject.generateHm = 1;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for validating the meeting creating | function validateCreateMeeting(meeting) {
const schema =
{
topic: Joi.string().required(),
discussion_points: Joi.string().required(),
timming: Joi.string().required(),
sender_email: Joi.string().required(),
reciever_email: Joi.array().required(),... | [
"function createMeeting(formInfoObj){\n\n\t\n}",
"function validNewMeeting(req, res, next) {\n const meeting = req.body;\n if (!meeting) {\n res.status(400).json({\n message: 'Missing Meeting Data',\n });\n } else if (!meeting.meeting_topic) {\n res.status(400).json({\n message: 'Missing mee... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scripts: modernizr / global: if src/modernizr exists, move it to dist/scripts/ production: minify | function modernizr(done) {
if (!paths.src.modernizr) { done(); return; }
return gulp.src(paths.src.modernizr + '*.js')
.pipe($.if( production, $.uglify(config.uglify) ))
.pipe(gulp.dest(paths.dist.scripts));
} | [
"function compileModernizr() {\n return src(\n [\n pageJSFiles,\n './inc/pages/**/assets/css/*.css',\n './build/js/**/*.js',\n stylesDistPath + '/*.css',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update the state with proided data | update(data={}) {
this.state = Object.assign(this.state, data);
// notify all the Listeners of updated state
this.notifyObervers(this.state);
} | [
"update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }",
"stateUpdate() {\n this.points.power = this.purchases.botnetLevel + this.purchases.hackers.length * 3;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate Items to add to subscription | addItems(data) {
return new Promise((resolve, reject) => {
joi.validate(data, lib.Schemas.subscription.addItems, (err, value) => {
if (err) {
return reject(new Errors.ValidationError(err))
}
return resolve(value)
})
})
} | [
"addItems(data) {\n return new Promise((resolve, reject) => {\n joi.validate(data, lib.Schemas.subscription.addItems, (err, value) => {\n if (err) {\n return reject(new Errors.ValidationError(err))\n }\n return resolve(value)\n })\n })\n }",
"validateList() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the url status of a task with the given ID. | function setUrl(id, url) {
bookmarkTable.get(id).set('url', url);
} | [
"function changeCompletionStatus(bool, id){\n const task = {\n completionStatus:bool\n };\n API.updateTask(task, id)\n .then(()=>{\n getTasks();\n }).catch();\n }",
"function changeTaskStatus(taskId) {\n\t\tfetch('/taskUpdate', {\n\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The user clicks on the search again button to review the list of search results for the selected waypoint. Search results are shown, displaying map features is triggered. | function handleSearchAgainWaypointClick(e) {
var wpElement = $(e.currentTarget).parent();
var index = wpElement.attr('id');
var addrElement = wpElement.get(0).querySelector('.address');
var featureId = addrElement.getAttribute('id');
var layer = addrElement.getAttribute('data-layer');
var resultComp... | [
"function handleSearchWaypointResultClick(e) {\n\t\t\tvar rootElement = $(e.currentTarget).parent().parent().parent().parent();\n\t\t\tvar index = rootElement.attr('id');\n\t\t\trootElement.removeClass('unset');\n\t\t\trootElement = rootElement.get(0);\n\n\t\t\trootElement.querySelector('.searchAgainButton').show()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
close and retruncate ul_box Call from: showMoreEvents() Call to: truncate() | function closeULbox(){
var monthL = getElementsByClassName(document.getElementById('month_viewcal'), "span", "monthvalue");
var ul = this.parentNode.parentNode;
/* -- Today icon is moving!!! Bug -- */
/*if(monthL[0].id == getCalendarDate()){
document.getElementById('today_image').style.display = 'inline';
ul.parentNo... | [
"function truncateList(listToTruncate, linesToShow) {\n\t\t\tvar children = $(listToTruncate).children(\"li\");\n\t\t\tvar x=0;\n\t\t\tif (children.size() > linesToShow) {\n\t\t\t\t$(children).each(function() {\n\t\t\t\t\tif (x >= linesToShow) {\n\t\t\t\t\t\t$(this).addClass(\"hidden\");\n\t\t\t\t\t}\n\t\t\t\t\tx++... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for snippetsWorkspaceEncodedIdWatchPut / Used to start watching a specific snippet. Returns 204 (No Content). | snippetsWorkspaceEncodedIdWatchPut(incomingOptions, cb) {
const Bitbucket = require('./dist');
let defaultClient = Bitbucket.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = incomingOptions.apiKey;
// Uncomme... | [
"snippetsWorkspaceEncodedIdWatchGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
count all study guest participants | async countStudyGuestParticipants(parent, args, ctx, info) {
const { where } = args;
if (!ctx.request.userId) {
throw new Error("You must be logged in to do that!");
}
return ctx.db.query.guestsConnection({ where }, info);
} | [
"async countStudyParticipants(parent, args, ctx, info) {\n const { where } = args;\n if (!ctx.request.userId) {\n throw new Error(\"You must be logged in to do that!\");\n }\n return ctx.db.query.profilesConnection({ where }, info);\n }",
"findTotalGuests(){\n let guestsArray = this.props... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable the use of keyboard press events in the Game. | function enableKeyPress() {
// Add event listener for keyboard press events to the canvas
window.addEventListener("keydown", function (evt) {
connectedGame.keyPressEvent(evt);
}, false);
} | [
"function enableKeyRelease() {\n // Add event listener for keyboard release events to the canvas\n window.addEventListener(\"keyup\", function (evt) {\n connectedGame.keyReleaseEvent(evt);\n }, false);\n }",
"enableEventListeners() {\n\n if (this.eventList... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handleFeePaymentNote is the handler for the 'feepayment'type notification, which is used to update the dex registration status. | handleFeePaymentNote (note) {
switch (note.subject) {
case 'regupdate':
this.updateExchangeRegistration(note.dex, false, note.confirmations)
break
case 'Account registered':
this.updateExchangeRegistration(note.dex, true)
break
default:
break
}
} | [
"handleFeePayment (note) {\n const dexAddr = note.dex\n if (dexAddr !== this.market.dex.host) return\n // update local dex\n this.market.dex = app.exchanges[dexAddr]\n this.setRegistrationStatusVisibility()\n }",
"handleNotification(notification) { }",
"handleOrderNote (note) {\n const order ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create Json for delete Camera | function deleteSuccessJson(resJson) {
let data = {};
resJson = {
"status": "SUCCESS",
"data": null,
"msg": "Camera Deleted Successfully",
"errormsg": "",
}
return resJson;
} | [
"function delete_picture(viewer_phone, picture_id)\n{\n\tvar API_URL = \"http://75.101.134.112/stream/1.0/api/delete_picture.php?viewer_phone=\" + viewer_phone + \"&picture_id=\" + picture_id;\n\tconsole.log(API_URL);\n\n\t$.getJSON(API_URL, function (data) \n\t{\n\t\tconsole.log(data);\n\t});\n}",
"function cam_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ghost Movement Logic Informed Search | function ghostDirectionInformedSearch(node){
nodeHistory.push({x: node.x, y: node.y});
var eyeDirection = 0;
var nextNode = {};
//Goal (Solution)
if(pacmanSprite.x == node.x && pacmanSprite.y == node.y){
alert("LOST!");
} else {
// Pacman Located Bottom Left
if(pacmanS... | [
"function hitSearch(x,y,shipGrid,shotGrid)\n {\n var cell = {};\n //indicate if we have found our nearest target\n var found = false;\n //position modifier\n var posMod = 0;\n \n //search the selected cell and if it is valid return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HANDLES Request handle constructor | function RequestHandle(request) {
this.getId = function() {
return request.id;
};
this.getSettings = function() {
return request.settings;
};
this.getQueue = function() {
if (request.queue !== undefined) {
return request.queue.getHandle();
}
... | [
"function RequestHandler() {}",
"function handleRequest(request, response) {}",
"function Request(){\n // default constructor: call super.constructor\n http.IncomingMessage.prototype.constructor.apply(this,arguments)\n //properties\n //method: string\n //url: string\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updata the distance that from the given point to a point in the distancee label | function updateDistance(distanceLabel, point) {
//target location in a data tag "data-location"
$("." + distanceLabel).each(function () {
var self = $(this);
var point2 = self.attr("data-location");
amplify.request({
resourceId: "DistanceBetween",
data: {
... | [
"function calcDist(point, click){\n var num = e.latlng.distanceTo([point.geometry.coordinates[1], point.geometry.coordinates[0]]);\n var distance = num/1000;\n var distance = distance.toFixed(2);\n}",
"set ['distance'](val){\r\n\t\tthis.d = val * this.shapeOfDif;\r\n\t\tthis.dist = val;\r\n\t\tthis.calculateDi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an import document with a base tag, transform all of its URLs and set link and form target attributes and remove the base tag. | _rewriteAstToEmulateBaseTag(ast, docUrl) {
const baseTag = dom5.query(ast, matchers.base);
const p = dom5.predicates;
// If there's no base tag, there's nothing to do.
if (!baseTag) {
return;
}
for (const baseTag of dom5.queryAll(ast, matchers.base)) {
... | [
"function normalizeBase(base) {\n if (!base) {\n if (isBrowser) {\n // respect <base> tag\n const baseEl = document.querySelector('base');\n base = (baseEl && baseEl.getAttribute('href')) || '/';\n // strip full URL origin\n base = base.replace(/^\\w+... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stop the background changer function cycle | function stopInterval() {
clearInterval(interval_background_change);
} | [
"function onCheckSwitchedBackground(){\n\t\t\tvar i = checkBlockAnimationStatus();\n\n\t\t\tif(i === blocks.length)\n\t\t\t{\n\t\t\t\tcompleteFunct();\n\t\t\t\tcreatejs.Ticker.removeEventListener('tick', switchBgFunct);\n\t\t\t\tswitchBgFunct = null;\n\t\t\t\tcompleteFunct = null;\n\t\t\t}\n\t\t}",
"function stop... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setting up default grid | function defaultGrid(){
gridSize(24)
createDivs(24)
} | [
"function setDefaultGrid(){\n setGridSize(16);\n createGrid(16);\n}",
"function defaultGrid() {\n setGridSize(24);\n fillGrid(24);\n}",
"function standardGrid(){\n makeRows(16);\n makeColumns(16);\n}",
"createGrids () {\n }",
"init() {\n this.prepareGrid();\n this.configureC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a list of apps that will be visible to a user with a pending invitation. | function listAllAppsVisibleToInvitedUser(api, id, query) {
return api_1.GET(api, `/userInvitations/${id}/visibleApps`, { query })
} | [
"seeAllApplications(req, res) {\n\t\tvar currentUser = req.currentUser;\n\t\tif(currentUser) {\n\t\t\treturn Application\n\t\t\t\t.findAll({\n\t\t\t\t\twhere: {\n\t\t\t\t\t\tpmId: currentUser,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.then(applications => {\n\t\t\t\t\treturn res.status(200).send(applications)\n\t\t\t\t})\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
After clicking on button Registracija, load form for regitration | function loadRegistracijaForm() {
$("#registracijaDiv").removeClass("hidden");
$("#btns").addClass("hidden");
$("#uspesna_registracija").addClass("hidden");
$("#regEmail").val('');
$("#regLoz").val('');
$("#regLoz2").val('');
} | [
"function seeRegForm() {\n // clear #seeForm (we may write an error there)\n $(\"#seeForm\").html(\"\");\n player.UserRegistration.registerFields();\n}",
"function mostrarFormularioRetirado(){\n var acum; \n listadoCamposFormulario = Ext.getCmp('listadoCamposFormulario');\n if (listadoC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Setter for evidence The method is expecting an array of reason strings The method will lookup the corresponding coding/codesystem and set the evidence array | set evidence(evidence) {
// filter evidence to ignore case and to make sure there are no duplicates
const filteredEvidence = evidence.map(e => e.toLowerCase()).filter((e, index, arr) => {
return arr.indexOf(e) === index;
});
this._cancerDiseaseStatus.evidenceType = filteredE... | [
"get evidence() {\n if (!this._cancerDiseaseStatus.evidenceType) return [];\n return this._cancerDiseaseStatus.evidenceType.map((e) => {\n return e.value;\n });\n }",
"get evidence () {\n\t\treturn this._evidence;\n\t}",
"function evidenceList() {\n return evidence;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
tfnewGetMeters This function will add a circle to map. | function tfnewGetMeters( miles ) {
return miles * 1609.344;
} | [
"function tfnewAddCircleToMap( map, center, radius = 50, style = {} ) {\n\n const strokeColor = style.strokeColor ? style.strokeColor : '#0FC3B2',\n strokeOpacity = style.strokeOpacity ? style.strokeOpacity : '0.2',\n strokeWeight = style.strokeWeight ? style.strokeWeight : 0,\n fillColor = st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recursively copy a config object | function cloneConfig(obj, isTopLevel) {
var clone;
var toString = Object.prototype.toString;
var hasOwnProperty = Object.prototype.hasOwnProperty;
if (obj == null || typeof obj !== "object" || obj['isCloned']) {
return obj;
}
if (obj instanceof Array) {
clone = [];
for (var i = 0, len = obj.length; i < le... | [
"function copyConfig(obj) {\n return lang.deeplikeCopy(obj, deepCopyProps);\n }",
"cloneConfig(config) {\n\t\treturn Object.assign({}, config);\n\t}",
"get deepCopy() {\n return new ExtConfig(super.deepCopy$());\n }",
"function deep_clone(source) {\n return jQuery.extend(true, {}, source)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Complete the matrixRotation function below. | function matrixRotation(matrix, r) {
// set row number m and column number
let m = matrix.length;
let n = matrix[0].length;
/*
A layer represents all elements in the edge of the matrix
In order to rotate all matrix , we will rotate layer by layer
*/
let layersList = getAllMatri... | [
"function matrixRotation(matrix, r) {}",
"function rotateMatrix(matrix) {\n\n}",
"setRotation(rotationMatrix) {\n this.rotation = new Matrix4(rotationMatrix);\n this.matrixNeedsUpdate = true;\n }",
"function matrixRotation(matrix, r) {\n const rows = matrix.length;\n const columns = matrix[0].length;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is the implementation which calls all registered $onInit method symbols. | [PRIVATE.$onInit] () {
this[PRIVATE.callSymbols](PRIVATE.onInitSymbols, []);
} | [
"_dispatchOnInit(){\n for (const instance of this._instances.values()) {\n instance.onInit&&instance.onInit()\n }\n }",
"function init() {\n loadDependencies();\n attachEventHandlers();\n}",
"$onInit() {\n this.init();\n }",
"static _onInit() {\n for (let q in this.queries) this.addQu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the deleted salary from the button attribute, then recalc and rewrite the budget on the DOM. | function deleteEmployee(){
let deletedSalary = parseFloat($(this).attr('sal'));
remainingBudget += deletedSalary;
if (remainingBudget > 0){
$('#remainingBudget').removeClass('overBudget');
}
let remainingBudgetString = remainingBudget.toLocaleString('en-US', {style: 'currency', currency: 'U... | [
"function delScheduleSalary() {\r\n\r\n\tif ($('#scheduleSalaryAddRow')[0].parentNode.children.length > 16) {\r\n\r\n\t\tfor (var i = 0; i < 14; i++) {\r\n\r\n\t\t\t$('#scheduleSalaryAddRow')[0].parentNode\r\n\t\t\t\t\t.deleteRow($('#scheduleSalaryAddRow')[0].parentNode.children.length - 3);\r\n\t\t}\r\n\r\n\t}\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uses for strike laco active pointer move event in external hover mode | _strikeActivePointerMove() {
for (let i = 0; i < this._pointerActiveMoveCallbacks.length; i++) {
let currentCallback = this._pointerActiveMoveCallbacks[i][0];
currentCallback(this, event);
}
for (let i = 0; i < this._pointerActiveMoveCallbacks.length... | [
"_strikeActiveMouseMove() {\n for (let i = 0; i < this._mouseActiveMoveCallbacks.length; i++) {\n let currentCallback = this._mouseActiveMoveCallbacks[i][0];\n\n currentCallback(this, event);\n }\n\n for (let i = 0; i < this._mouseActiveMoveCallbacks.le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save the current time to permit basic benchmark | bench(name, display) {
let time = new Date().getTime() - this._time;
this._benchmarks[time + 'ms'] = name;
display && this.log('Bench: ', this._benchmarks);
} | [
"startBenchmarking() {\n if (this._benchmarkStart === null) {\n this._benchmarkStart = window.performance.now();\n }\n }",
"enableBenchmarking()\n {\n this.benchmark = {}\n this.benchmark.enabled = true\n this.benchmark.recentTime = window.performance.now()\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the collection of answered challenges, allowing the user to try the examples again | function clearAnsweredChallenges() {
Session.set("answeredChallenges", []);
Session.set("currentChallengeId", null);
//Since we've cleared out all answered challenges, and are ready for the next one,
//set the game state to answering
Session.set("gameState", "answering");
} | [
"function clearAnswers(){\n answerArray = [];\n}",
"clearAllAnswers() {\n this.fastestFingerChoices = [];\n this.fastestFingerTime = undefined;\n this.hotSeatChoice = undefined;\n this.hotSeatTime = undefined;\n }",
"function clearUserAnswers() {\n for(i = 0; i < questions.length; i++) {\n que... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |