query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Determine the number of bytes it would take to encode the given data with the given encoding.
function byteLength(data, encoding) { if (data == null) { return 0; } return LiteBuffer.byteLength(data, encoding); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static byteLength(string, encoding = 'utf8') {\n if (typeof string != 'string') {\n return string.byteLength;\n }\n\n encoding = normalizeEncoding(encoding) || 'utf8';\n return encodingOps[encoding].byteLength(string);\n }", "function chunkLength ...
[ "0.6355137", "0.6007946", "0.6007946", "0.6007946", "0.6007946", "0.59578556", "0.59578556", "0.5851342", "0.5818989", "0.5818989", "0.5668678", "0.56513315", "0.56418854", "0.5594199", "0.5594199", "0.5594199", "0.5594199", "0.5594199", "0.5594199", "0.5594199", "0.5508662",...
0.7508973
0
Reads a frame from a buffer that is prefixed with the frame length.
function deserializeFrameWithLength(buffer, encoders) { const frameLength = readUInt24BE(buffer, 0); return deserializeFrame( buffer.slice(UINT24_SIZE, UINT24_SIZE + frameLength), encoders ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "readFrame() {\n if (this.isReadFrameReady()) {\n // Retrieve frame data.\n const frameData = this.videoDataBuffer.slice(0, this.frameSize);\n\n // Remove frame data from accumulated data buffer.\n this.videoDataBuffer = this.videoDataBuffer.slice(this.frameSize);\n // Reset frame size.\...
[ "0.59783", "0.5656008", "0.56511444", "0.561859", "0.560587", "0.5374045", "0.5337657", "0.5337657", "0.5304827", "0.52557904", "0.51940364", "0.51744825", "0.513378", "0.50741154", "0.50531936", "0.50467813", "0.50162673", "0.4990401", "0.4990401", "0.4976516", "0.4969056", ...
0.67716515
0
Given a buffer that may contain zero or more lengthprefixed frames followed by zero or more bytes of a (partial) subsequent frame, returns an array of the frames and a buffer of the leftover bytes.
function deserializeFrames(buffer, encoders) { const frames = []; let offset = 0; while (offset + UINT24_SIZE < buffer.length) { const frameLength = readUInt24BE(buffer, offset); const frameStart = offset + UINT24_SIZE; const frameEnd = frameStart + frameLengt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function frame(data, frameLength, hopLength) {\n const bufferCount = Math.floor((data.length - frameLength) / hopLength) + 1;\n const buffers = Array.from(\n { length: bufferCount }, (x, i) => new Float32Array(frameLength));\n for (let i = 0; i < bufferCount; i++) {\n const ind = i * hopLeng...
[ "0.675133", "0.62478346", "0.6086804", "0.5758965", "0.573075", "0.56858695", "0.5636544", "0.55996907", "0.5586995", "0.5557779", "0.5534225", "0.5491777", "0.5491777", "0.5491777", "0.5491777", "0.5491777", "0.5491777", "0.5491777", "0.5491777", "0.5491777", "0.5491777", ...
0.67203456
1
Writes a frame to a buffer with a length prefix.
function serializeFrameWithLength(frame, encoders) { const buffer = serializeFrame(frame, encoders); const lengthPrefixed = createBuffer(buffer.length + UINT24_SIZE); writeUInt24BE(lengthPrefixed, buffer.length, 0); buffer.copy(lengthPrefixed, UINT24_SIZE, 0, buffer.length); retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeLength(buffer, pos, length) {\n var digit = 0\n , origPos = pos\n\n do {\n digit = length % 128 | 0\n length = length / 128 | 0\n if (length > 0) {\n digit = digit | 0x80\n }\n buffer.writeUInt8(digit, pos++, true)\n } while (length > 0)\n\n return pos - origPos\n}", "f...
[ "0.61015093", "0.61015093", "0.590761", "0.5880467", "0.5647925", "0.54106015", "0.5388239", "0.5388239", "0.53477603", "0.5205863", "0.5037637", "0.5033589", "0.48465046", "0.48338938", "0.4800526", "0.47876045", "0.47656196", "0.47655687", "0.47175133", "0.46586555", "0.465...
0.6595387
0
Byte size of frame without size prefix
function sizeOfFrame(frame, encoders) { encoders = encoders || Utf8Encoders; switch (frame.type) { case FRAME_TYPES.SETUP: return sizeOfSetupFrame(frame, encoders); case FRAME_TYPES.PAYLOAD: return sizeOfPayloadFrame(frame, encoders); c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPayloadLength(frame, encoders) {\n let payloadLength = 0;\n if (frame.data != null) {\n payloadLength += encoders.data.byteLength(frame.data);\n }\n if (isMetadata(frame.flags)) {\n payloadLength += UINT24_SIZE;\n if (frame.metadata != null) ...
[ "0.69680214", "0.67547655", "0.6669128", "0.6643831", "0.65302825", "0.6423013", "0.64132786", "0.63854265", "0.636892", "0.63344735", "0.6321273", "0.6297602", "0.62858975", "0.62604445", "0.62604445", "0.62593716", "0.6254489", "0.6254057", "0.6246079", "0.62456286", "0.623...
0.7107063
0
Reads a SETUP frame from the buffer and returns it.
function deserializeSetupFrame(buffer, streamId, flags, encoders) { invariant_1( streamId === 0, 'RSocketBinaryFraming: Invalid SETUP frame, expected stream id to be 0.' ); const length = buffer.length; let offset = FRAME_HEADER_SIZE; const majorVersion =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "readFrame() {\n if (this.isReadFrameReady()) {\n // Retrieve frame data.\n const frameData = this.videoDataBuffer.slice(0, this.frameSize);\n\n // Remove frame data from accumulated data buffer.\n this.videoDataBuffer = this.videoDataBuffer.slice(this.frameSize);\n // Reset frame size.\...
[ "0.55252963", "0.5281992", "0.48262608", "0.4776808", "0.4719193", "0.4622049", "0.45842084", "0.45814842", "0.45717806", "0.45714003", "0.45392993", "0.44964635", "0.4431436", "0.44080505", "0.44035152", "0.43966243", "0.43881863", "0.43215474", "0.42927253", "0.42821905", "...
0.65361065
0
Reads an ERROR frame from the buffer and returns it.
function deserializeErrorFrame(buffer, streamId, flags, encoders) { const length = buffer.length; let offset = FRAME_HEADER_SIZE; const code = buffer.readInt32BE(offset); offset += 4; invariant_1( code >= 0 && code <= MAX_CODE, 'RSocketBinaryFraming: Inval...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readIlpError (reader) {\n const type = Buffer.from([ reader.readUInt8() ])\n reader.bookmark()\n const length = Buffer.from([ reader.readLengthPrefix() ])\n reader.restore()\n const contents = reader.readVarOctetString()\n return Buffer.concat([ type, length, contents ])\n}", "function frameError(...
[ "0.6017727", "0.5805062", "0.5711833", "0.5711833", "0.5711833", "0.5711833", "0.56922853", "0.55603445", "0.5411339", "0.5411339", "0.5411339", "0.5411339", "0.5381815", "0.53783333", "0.5367092", "0.5298766", "0.5298766", "0.5298766", "0.5298766", "0.5298766", "0.5298766", ...
0.71341926
0
Reads a KEEPALIVE frame from the buffer and returns it.
function deserializeKeepAliveFrame(buffer, streamId, flags, encoders) { invariant_1( streamId === 0, 'RSocketBinaryFraming: Invalid KEEPALIVE frame, expected stream id to be 0.' ); const length = buffer.length; let offset = FRAME_HEADER_SIZE; const lastRe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "readFrame() {\n if (this.isReadFrameReady()) {\n // Retrieve frame data.\n const frameData = this.videoDataBuffer.slice(0, this.frameSize);\n\n // Remove frame data from accumulated data buffer.\n this.videoDataBuffer = this.videoDataBuffer.slice(this.frameSize);\n // Reset frame size.\...
[ "0.65941614", "0.5619266", "0.52879196", "0.5041787", "0.4980465", "0.49449888", "0.49229094", "0.4882699", "0.4856183", "0.48135352", "0.47821623", "0.4781178", "0.47577733", "0.47525924", "0.47500437", "0.4733986", "0.47213048", "0.47197267", "0.46938398", "0.46938235", "0....
0.6019223
1
Reads a LEASE frame from the buffer and returns it.
function deserializeLeaseFrame(buffer, streamId, flags, encoders) { invariant_1( streamId === 0, 'RSocketBinaryFraming: Invalid LEASE frame, expected stream id to be 0.' ); const length = buffer.length; let offset = FRAME_HEADER_SIZE; const ttl = buffer.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hex2LEbuf(hex)\n{\n\tvar buffer = new Buffer(hex, 'hex'); \t\n\treturn swapBufferEndian(buffer);\n}", "function decodeRLE(input) {\n let handlers = {\n onstart: (evt) => {},\n ondata: (evt) => {},\n onstop: (evt) => {},\n onerror: (evt, msg) => {},\n }\n\n let flushed = false\n let lenPo...
[ "0.4561704", "0.4556928", "0.45560098", "0.45545086", "0.45260954", "0.44853956", "0.4453074", "0.43909618", "0.43673995", "0.42678443", "0.42115423", "0.4190763", "0.4173929", "0.41674048", "0.41474363", "0.41426778", "0.41426778", "0.41426778", "0.41426778", "0.4142383", "0...
0.5515593
0
Writes a REQUEST_FNF or REQUEST_RESPONSE frame to a new buffer and returns it. Note that these frames have the same shape and only differ in their type.
function serializeRequestFrame(frame, encoders) { const payloadLength = getPayloadLength(frame, encoders); const buffer = createBuffer(FRAME_HEADER_SIZE + payloadLength); const offset = writeHeader(frame, buffer); writePayload(frame, buffer, encoders, offset); return buffer; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formServerResponse(reqUrl, response) {\n return (err, res, type) => {\n\n if (err) {\n finishResponse(response, 404, err.toString(), reqUrl);\n }\n else {\n\n // Image\n if (type && typeof(type) == 'string') {\n response.setHeader('Co...
[ "0.45396328", "0.4508709", "0.4504918", "0.44957316", "0.44846034", "0.4442778", "0.44113788", "0.4404237", "0.4395884", "0.4370331", "0.43147865", "0.43095502", "0.42846107", "0.426878", "0.42572907", "0.42572907", "0.42572907", "0.42572907", "0.42572907", "0.42572907", "0.4...
0.56844074
0
Writes a CANCEL frame to a new buffer and returns it.
function serializeCancelFrame(frame, encoders) { const buffer = createBuffer(FRAME_HEADER_SIZE); writeHeader(frame, buffer); return buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canceled() {\n var error = new Error(canceledName);\n error.name = error.message;\n return error;\n}", "acceptCancel() {}", "cancelForm() {\n this.sendAction(\"onCancel\", null);\n }", "cancel() {\n this.dispatchEvent(new PayloadEvent(ModifyEventType.CANCEL, this.clone_));\n this.setAct...
[ "0.5924533", "0.5759375", "0.5615689", "0.5609986", "0.5599416", "0.55651164", "0.55235475", "0.5515734", "0.55074334", "0.54911834", "0.5490397", "0.54849726", "0.54248655", "0.5418203", "0.54142827", "0.53927577", "0.53923976", "0.53517383", "0.5339338", "0.5329554", "0.530...
0.6618333
0
Writes a PAYLOAD frame to a new buffer and returns it.
function serializePayloadFrame(frame, encoders) { const payloadLength = getPayloadLength(frame, encoders); const buffer = createBuffer(FRAME_HEADER_SIZE + payloadLength); const offset = writeHeader(frame, buffer); writePayload(frame, buffer, encoders, offset); return buffer; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writePayload(frame, buffer, encoders, offset) {\n if (isMetadata(frame.flags)) {\n if (frame.metadata != null) {\n const metaLength = encoders.metadata.byteLength(frame.metadata);\n offset = writeUInt24BE(buffer, metaLength, offset);\n offset ...
[ "0.5669607", "0.51552874", "0.4993241", "0.49590683", "0.4890338", "0.4830054", "0.4678691", "0.4637847", "0.46033704", "0.4498664", "0.44870982", "0.44869727", "0.4484266", "0.44802448", "0.44571638", "0.4447989", "0.44280204", "0.442412", "0.44140413", "0.44022176", "0.4390...
0.5688339
0
Write the header of the frame into the buffer.
function writeHeader(frame, buffer) { const offset = buffer.writeInt32BE(frame.streamId, 0); // shift frame to high 6 bits, extract lowest 10 bits from flags return buffer.writeUInt16BE( (frame.type << FRAME_TYPE_OFFFSET) | (frame.flags & FLAGS_MASK), offset ); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeHeader(header, view) {\n var littleEndian = Targa.LITTLE_ENDIAN;\n\n view.setUint8(0x00, header.idLength);\n view.setUint8(0x01, header.colorMapType);\n view.setUint8(0x02, header.imageType);\n view.setUint16(0x03, header.colorMapIndex, littleEndian);\n view.setUint16(0x05, header.c...
[ "0.64509964", "0.64509964", "0.64096326", "0.64096326", "0.5775509", "0.57700187", "0.5719289", "0.56585664", "0.56035227", "0.55702066", "0.55583954", "0.55123913", "0.54516673", "0.54445976", "0.54445976", "0.53880864", "0.53880864", "0.5225545", "0.51733", "0.5119009", "0....
0.773756
0
Determine the length of the payload section of a frame. Only applies to frame types that MAY have both metadata and data.
function getPayloadLength(frame, encoders) { let payloadLength = 0; if (frame.data != null) { payloadLength += encoders.data.byteLength(frame.data); } if (isMetadata(frame.flags)) { payloadLength += UINT24_SIZE; if (frame.metadata != null) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPayloadLength64 () {\n const buf = this.consume(8);\n if (buf === null) return;\n\n const num = buf.readUInt32BE(0, true);\n\n //\n // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n // if payload length is greater than this number.\n //\n if (num > Math.pow(2,...
[ "0.7120925", "0.7054732", "0.6836908", "0.6792787", "0.6660691", "0.6646054", "0.6623754", "0.66146225", "0.6600223", "0.6591929", "0.6587465", "0.65455824", "0.6464178", "0.6464178", "0.6387121", "0.6365924", "0.6344497", "0.63017374", "0.6270625", "0.6248396", "0.62333274",...
0.78937024
0
Write the payload of a frame into the given buffer. Only applies to frame types that MAY have both metadata and data.
function writePayload(frame, buffer, encoders, offset) { if (isMetadata(frame.flags)) { if (frame.metadata != null) { const metaLength = encoders.metadata.byteLength(frame.metadata); offset = writeUInt24BE(buffer, metaLength, offset); offset = encoders...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serializePayloadFrame(frame, encoders) {\n const payloadLength = getPayloadLength(frame, encoders);\n const buffer = createBuffer(FRAME_HEADER_SIZE + payloadLength);\n const offset = writeHeader(frame, buffer);\n writePayload(frame, buffer, encoders, offset);\n return bu...
[ "0.6533951", "0.62081933", "0.5742867", "0.5528221", "0.5398609", "0.5199891", "0.5119013", "0.5114501", "0.5013149", "0.50109196", "0.4956713", "0.49207187", "0.4904625", "0.48751852", "0.48636246", "0.4816889", "0.4796463", "0.47635844", "0.47445288", "0.4679086", "0.467580...
0.7719587
0
Read the payload from a buffer and write it into the frame. Only applies to frame types that MAY have both metadata and data.
function readPayload(buffer, frame, encoders, offset) { if (isMetadata(frame.flags)) { const metaLength = readUInt24BE(buffer, offset); offset += UINT24_SIZE; if (metaLength > 0) { frame.metadata = encoders.metadata.decode( buffer, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writePayload(frame, buffer, encoders, offset) {\n if (isMetadata(frame.flags)) {\n if (frame.metadata != null) {\n const metaLength = encoders.metadata.byteLength(frame.metadata);\n offset = writeUInt24BE(buffer, metaLength, offset);\n offset ...
[ "0.68926305", "0.6010901", "0.5847432", "0.5614521", "0.5224524", "0.51629305", "0.51344603", "0.5055282", "0.4987204", "0.4978246", "0.49382472", "0.49330807", "0.49067926", "0.48861262", "0.4837466", "0.48008588", "0.47974062", "0.47600418", "0.4752226", "0.47507787", "0.47...
0.7182906
0
create a method that finds the area of a sphere
areaSphere(radius){ this.area = 4 * Math.PI * (Math.pow(radius, 2)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function surfaceAreaSphere( radius ) {\n return multiply( 4, Math.PI, square( radius ) );\n}", "function sphere() {\n\n}", "function Sphere(radius){\n return -1;\n }", "area() {\n return 4 * (3.14) * (this.radius**2)\n }", "function calculateArea(radius) {\n retu...
[ "0.7400358", "0.7088338", "0.70508695", "0.6915251", "0.68174016", "0.67966044", "0.6795338", "0.67326283", "0.6714871", "0.6591308", "0.6581265", "0.6536898", "0.65164036", "0.6492905", "0.6455534", "0.6453046", "0.64276165", "0.6351925", "0.6347962", "0.6278339", "0.6249927...
0.78165764
0
hide center logo function
function hideLogo() { // toggle center logo $(".right-side").css({ animation: "scaleX-hide 1s forwards" }); $(".left-side").css({ animation: "scaleX-hide 1s forwards" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showLogo() {\n // toggle center logo\n $(\".right-side\").css({\n animation: \"scaleX-display 1s forwards \"\n });\n $(\".left-side\").css({\n animation: \"scaleX-display 1s forwards \"\n });\n }", "function set_logo() {\r\n\t \r\n var window_width = $(window).width();\r\n ...
[ "0.738308", "0.7065385", "0.6711202", "0.6546943", "0.65083176", "0.64785117", "0.6377306", "0.63169974", "0.627822", "0.624122", "0.6177997", "0.6093552", "0.6088304", "0.607519", "0.6056415", "0.6043931", "0.60142666", "0.6009868", "0.5999376", "0.59916615", "0.5982404", ...
0.784992
0
display center logo function
function showLogo() { // toggle center logo $(".right-side").css({ animation: "scaleX-display 1s forwards " }); $(".left-side").css({ animation: "scaleX-display 1s forwards " }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function centeredLogoHeaderInit() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($('#header-outer[data-format=\"centered-logo-between-menu\"]').length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!usingLogoImage) {\r\n\t\t\t\t\t\t\tcenteredLogoMargins();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(usingLogoImage && $('#header-outer[data...
[ "0.6815837", "0.6663271", "0.66189206", "0.65459853", "0.644251", "0.6433071", "0.63956356", "0.638019", "0.63406235", "0.6323478", "0.6269685", "0.61798686", "0.6158215", "0.6152318", "0.61411595", "0.6138605", "0.6135064", "0.60976315", "0.60729134", "0.6041248", "0.6025303...
0.6834221
0
Extract callback and options arguments from the given arguments array, based on the type and order of arguments: The first Function encountered is used as the success/done callback. Second Function becomes the failure callback. An Object becomes the options argument. Arguments of other types are ignored.
function extractArgs(args) { var extracted = {}; $.each(args, function (i, arg) { switch (arg.constructor) { case Function: extracted.successFn = extracted.successFn || arg; extracted.failureFn = !extracted.successFn && arg; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function optArguments_ES6(...args){\n const err=args.shift();\n const callback=(typeof args[args.length-1]=='function')? args.pop() : null;\n const optionalA=(args.length>0) ? args.shift() : null;\n const optionalB=(args.length>0)? args.shift(): null;\n\n if(err && callback) return callbac...
[ "0.7014076", "0.62881166", "0.6228165", "0.6124672", "0.5972496", "0.58306444", "0.58306444", "0.58306444", "0.58306444", "0.5769603", "0.57150304", "0.5667511", "0.56632215", "0.5647105", "0.563913", "0.563913", "0.5630721", "0.5630721", "0.5630721", "0.5630721", "0.5630721"...
0.6944004
1
BELOW ARE SEVERAL METHODS THAT ADD HTML AND EVENTS TO THE CONTENT THEY ARE CALLED ABOVE Add the peildatum option to the overview
function addPeildatum() { // add the gui $overview.append('<label>Peildatum tekst afdrukken<input type="checkbox" data-change-toggle="peildatum" class="cb"/></label>'); // add handling a change in the gui $(document).on('change', '[data-change-toggle]', function() { $('[data-role=' + $(this).data('change-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onPageBeforeShow(e){\n\t\t\t\t\t\t\t\t\n\t\t\t\t//adding content from lstest data selection\n\t\t\t\tpopulateListContent(App.data.selection);\n\t\t\t\t\n\t\t\t}", "function eventsMoreDescription() {\n $('.show-more' + self.pref).unbind('click');\n $('.show-m...
[ "0.6181921", "0.6146479", "0.60003227", "0.5989698", "0.5945545", "0.58530515", "0.5848238", "0.583502", "0.5831442", "0.5816056", "0.5816024", "0.5810738", "0.58045274", "0.5802505", "0.5799898", "0.5798718", "0.5794608", "0.5758895", "0.57496595", "0.57336265", "0.5733264",...
0.6424981
0
addInvoicenumberUpdater(); Adds the invoicetypes as per the available invoices
function addInvoiceTypeGUI() { // add the various holders for the number and listing of the invoices var dynamicInvoiceIDExists = false; $overview.append( '<label>' + '<input class="readonly twice" readonly="readonly" value="Bedrag incl BTW"/>' + '<input class="readonly twice" readonly="readonly"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addInvoicenumberUpdater() {\n\t\tvar \tcookiename = 'initialInvoiceNumber'\n\t\t\t\t, cookieval;\t\n\t\n\t\tif ( $.isNumeric(cookieval = $.cookie(cookiename)) ) {\n\t\t\tinitialInvoiceNumber = parseInt(cookieval);\n\t\t}\n\t\t\n\t\t// add the triggering of the update event to the document\n\t\t$(document)...
[ "0.65489745", "0.55238646", "0.5357361", "0.51882327", "0.51284397", "0.51122534", "0.501654", "0.49766594", "0.4928928", "0.49192923", "0.48964292", "0.48685956", "0.4856769", "0.48513883", "0.48430145", "0.4837344", "0.48364538", "0.48237306", "0.4794532", "0.47800997", "0....
0.6244405
1
addInvoiceTypeGUI(); Add location for the various actions to be added
function addActionContainer() { // create the location for the actions $overview.append('<span style="margin-bottom: 1em;" id="overview_actions">Acties</span>'); // add the show invoices button, since the invoices won't do that themselves $('#overview_actions').append('<button data-click-switch="invoices" cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addInvoiceTypeGUI() {\n\t\t// add the various holders for the number and listing of the invoices\n\t\tvar dynamicInvoiceIDExists = false;\n\t\t\n\t\t$overview.append(\n\t\t\t\t'<label>'\n\t\t\t\t\t+ '<input class=\"readonly twice\" readonly=\"readonly\" value=\"Bedrag incl BTW\"/>'\n\t\t\t\t\t+ '<input cl...
[ "0.77636695", "0.59752715", "0.5903998", "0.58227676", "0.5797293", "0.57897794", "0.5787938", "0.5756911", "0.5740605", "0.57364005", "0.5728922", "0.56915814", "0.56513935", "0.56328464", "0.5617946", "0.5586851", "0.5577487", "0.55146646", "0.5483958", "0.5482255", "0.5446...
0.60882956
1
convert ms time difference to a lovely, readable string
function convert_ms(ms) { let time_left = ''; for (k in ms_conversion) { time_left += zero_pad(Math.floor(ms / ms_conversion[k]).toString(), 2); if (k !== 's') { time_left += ':'; } ms = ms % ms_conversion[k]; } return time_left; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sec2hms(diff) {\n var str = \"\";\n var hours = parseInt( diff / 3600 ) % 24;\n var minutes = parseInt( diff / 60 ) % 60;\n var seconds = diff % 60;\n if (hours) str += pad(hours)+\":\";\n return str+pad(minutes)+\":\"+pad(seconds);\n}", "function time_string(ms) {\n let secs = Math.f...
[ "0.7103467", "0.70765245", "0.70246947", "0.69873893", "0.6987266", "0.6961715", "0.68840736", "0.685308", "0.68141735", "0.6769351", "0.6751063", "0.6735484", "0.6713534", "0.668535", "0.6675874", "0.66131914", "0.657604", "0.65476084", "0.6485756", "0.64750576", "0.6471306"...
0.72001487
0
make str fit to show on page htm2specil rn2br tab2space blank2space
function strHtmFmt(str){ if(typeof(str)!="string")return str; str=htm2specil(str); str=rn2br(str); str=tab2space(str); str=blank2space(str); return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setw(pStr, pLen, before)\n{\n var browser=navigator.appName;\n var nbSpace = \"&nbsp;\";\n if (browser==\"Microsoft Internet Explorer\")\n {\n nbSpace = \" \"; \n }\n var rStr = pStr;\n var spaceToAdd = 0;\n if (rStr.length > pLen)\n {\n rStr = rStr.substring(0,pLen);\n }\n ...
[ "0.5998535", "0.5685997", "0.5600669", "0.5572146", "0.54648054", "0.54445493", "0.5423334", "0.54114133", "0.5405073", "0.536258", "0.5360555", "0.5340266", "0.5295911", "0.52775", "0.5221823", "0.52105516", "0.5174014", "0.51560694", "0.5152584", "0.51408446", "0.5127293", ...
0.64367914
0
1.7 Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0. idea: iterate through matrix find 0s store the values of the columns and rows that are zeroes iterate through matrix again change values of the rows and columns that have 0s (recorded above) to 0s
function setZeros(matrix){ var row = []; var column = []; for (var i = 0; i < matrix.length; i++){ for (var j = 0; j< matrix[i].length; j++){ if (matrix[i][j] === 0){ if (row.indexOf(i) === -1){ row.push(i); } if (column.indexOf(j) === -1){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setZeroes(matrix) {\n // 要不使用 额外的空间 就必须将 额外的数据依然存在 数组上\n // 每次检测到 0 的时候 就 将改行的 行首 和 列首 设置为0\n // 再次循环 按照行首 和 列首的 值设置 一列 和一行的值\n // 处理所有非行首 和 列首的值\n // 需要注意的是 第一样和第一列 的 标志位 都是 [0][0] 位置的值\n // 所以需要一个额外的判断\n let isCol = false; // 记录第一列 是不是都要设置为 0\n // 将 matrix[0][0] 的位置\n for (let y = 0; y < matrix...
[ "0.86592656", "0.84130853", "0.8333595", "0.83324325", "0.81413347", "0.81378174", "0.80996877", "0.8073813", "0.8051371", "0.8028634", "0.789377", "0.7648046", "0.76338655", "0.7584133", "0.74647385", "0.7462039", "0.72734034", "0.727029", "0.7186694", "0.71010983", "0.70606...
0.8634277
1
Reads from a readstream and emits line events.
function ReadStreamLineEmitter(stream, options) { var incompleteLine, self = this; EventEmitter.call(this); // prepare stream for character processing and listen to events stream.setEncoding(options.encoding); function processData(data) { var lastLineIncomplete, lines; if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readStreamByLine(stream, callback) {\n var streamReader = new System.IO.StreamReader(stream, textEncoding.UTF8);\n var wholeResponse = \"\";\n var readNextLine = function readNextLine() {\n Await(streamReader.ReadLineAsync(), function (err, line) {\n if (line != null) {\n ...
[ "0.6002968", "0.5782094", "0.57470524", "0.57261527", "0.5711514", "0.5629561", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", "0.5628412", ...
0.7011847
0
cronRule determines a typical cron string from the humanlegible schedule object field provided with each task.
function cronRule( rule ) { return ( typeof rule === "undefined" ) ? "*" : rule; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cronRuleFromSchedule( schedule ) {\n return [ schedule.second, schedule.minute, schedule.hour, schedule.dayOfMonth, schedule.month, schedule.dayOfWeek ].map( cronRule ).join(' ');\n}", "function cronMaker(obj) {\n let hour = obj.hour;\n let min = obj.min;\n let weekDay = obj.weekDay;\n le...
[ "0.7787294", "0.6907297", "0.6542353", "0.58396137", "0.5754541", "0.5701261", "0.5693035", "0.55628866", "0.5469746", "0.541753", "0.54029113", "0.5386693", "0.5379093", "0.5354097", "0.53192645", "0.5226904", "0.5206708", "0.51119465", "0.50436956", "0.4996896", "0.49935007...
0.7118623
1
cronRuleFromSchedule builds a cron string for the set of available cron schedule items.
function cronRuleFromSchedule( schedule ) { return [ schedule.second, schedule.minute, schedule.hour, schedule.dayOfMonth, schedule.month, schedule.dayOfWeek ].map( cronRule ).join(' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cronMaker(obj) {\n let hour = obj.hour;\n let min = obj.min;\n let weekDay = obj.weekDay;\n let monthdate = obj.monthdate;\n let delayInDays = obj.delayInDays;\n\n let expression = \"\";\n if (obj.type === 'Daily') {\n expression = min + \" \" + hour + \" */\" + delayInDays + \...
[ "0.6555933", "0.5996869", "0.58363974", "0.569826", "0.5644004", "0.55064577", "0.5364527", "0.5353802", "0.52881444", "0.51934564", "0.5187817", "0.51757216", "0.5146835", "0.50881165", "0.50382936", "0.5011522", "0.49457425", "0.488992", "0.485506", "0.48118135", "0.4802833...
0.82839555
0
save the test result
function saveResults(result) { const original = redirect( "testresult.json" ); putstr( JSON.stringify(result) ); redirect( original ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveResult(){\n // TODO implementar salvar os dados em arquivo:\n // Salvar: http://phantomjs.org/api/fs/method/write.html\n // Converter JSON array para CSV\n console.log(JSON.stringify(serie));\n phantom.exit();\n}", "function saveTestResult(testCase) {\n\n var line = `${testCase.id}, \"${testCa...
[ "0.7154152", "0.67711675", "0.653866", "0.64435494", "0.64412236", "0.6334935", "0.62940234", "0.62749726", "0.6202534", "0.61953384", "0.61574227", "0.6086295", "0.6071493", "0.6071493", "0.60703266", "0.603204", "0.602324", "0.6017569", "0.59514624", "0.59150785", "0.590792...
0.7171635
0
Create a function that returns true if an array is special, and false otherwise.
function specialArray(array){ for (var i = 0; i <array.length; i++){ if (i % 2 === 1) { if (array[i] % 2 ===0){ return false } } if (i % 2 === 0){ if (array[i] % 2 ===1){ return false } } } return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static is_data_array_ok(data){\n return this.is_1d_array(data) ||\n this.is_2d_array(data) ||\n this.is_3d_array(data) ||\n this.is_heat_map_suitable_data(data)\n }", "function testArray(array) {\n if (\n (array[0] === 1 || array[0] === 3) &&\n (array[1] === 1 || arr...
[ "0.6369578", "0.63344055", "0.6333167", "0.6307625", "0.62981653", "0.6284998", "0.627448", "0.62658936", "0.622218", "0.622029", "0.6189981", "0.61537856", "0.6112002", "0.610992", "0.60904366", "0.60729927", "0.60723436", "0.6069962", "0.6067088", "0.6051465", "0.60458463",...
0.6449631
0
Add the sticky class to the navbar when you reach its scroll position. Remove "sticky" when you leave the scroll position
function stickyScroll() { if (window.pageYOffset >= sticky) { navbar.classList.add("sticky") } else { navbar.classList.remove("sticky"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function navfixedScroll() {\n if (window.pageYOffset > sticky+200) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "function scrollFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\...
[ "0.87005734", "0.86504966", "0.8563614", "0.8527841", "0.8514592", "0.8434269", "0.8409989", "0.8407807", "0.8368612", "0.8312437", "0.8286539", "0.82725877", "0.82656956", "0.8265004", "0.8253818", "0.8247006", "0.82235307", "0.82235307", "0.82235307", "0.82203585", "0.82203...
0.89609355
0
Prioritize non 'node_modules' files and opened files
function _priorityForFile(filePath, openedFiles) { if (filePath.includes('node_modules')) return 0; if ( openedFiles.find(file => file.filePathWithoutCWD() === filePath.substr(1)) ) { return 2; } return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeOrginalFiles() {\n return (tree) => {\n [\n `${project.root}/README.md`,\n `${project.sourceRoot}/main.ts`,\n `${project.sourceRoot}/environments/environment.prod.ts`,\n `${project.sourceRoot}/environments/environment.ts`,\n `${project...
[ "0.59295696", "0.5834528", "0.5682269", "0.5657399", "0.56219697", "0.5618639", "0.55008906", "0.54459995", "0.5356072", "0.5342695", "0.53211296", "0.52697635", "0.52654535", "0.5256095", "0.5225913", "0.52094316", "0.5202747", "0.51990306", "0.51924044", "0.51802355", "0.51...
0.732817
0
Move Paddle On Canvas
function movePaddle() { paddle.xPos += paddle.dx; // Prevent passing through the walls if (paddle.xPos + paddle.width > canvas.width) { paddle.xPos = canvas.width - paddle.width; } if (paddle.xPos < 0) { paddle.xPos = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function movePaddle() {\n paddle.x += paddle.dx;\n\n // Wall detection\n if (paddle.x + paddle.w > canvas.width) {\n paddle.x = canvas.width - paddle.w;\n }\n\n if (paddle.x < 0) {\n paddle.x = 0;\n }\n}", "function movePaddle() {\n if (rightPressed) {\n paddleDX = paddleSpeed;\n paddleX += pa...
[ "0.8364481", "0.8136523", "0.8125316", "0.8100101", "0.80160314", "0.7931409", "0.76443416", "0.75759625", "0.7550704", "0.7538341", "0.74422866", "0.7439376", "0.7406068", "0.7400731", "0.7398822", "0.7391745", "0.73563737", "0.7336731", "0.73326635", "0.7327814", "0.7325489...
0.82196003
1
Make All Bricks Visible
function showAllBricks() { bricks.forEach((column) => { column.forEach((brick) => (brick.visible = true)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAllBricks() {\n bricks.forEach(column => {\n column.forEach(brick => (brick.visible = true));\n });\n}", "function showAllBricks() {\r\n bricks.forEach(column => {\r\n column.forEach(brick => {\r\n brick.visible = true;\r\n })\r\n })\r\n}", "function dra...
[ "0.7462211", "0.7391009", "0.71560585", "0.7143004", "0.7109593", "0.6936992", "0.65967155", "0.65932673", "0.6590889", "0.65600336", "0.65589446", "0.65377456", "0.6527178", "0.64958686", "0.6488678", "0.64669853", "0.64348793", "0.63666105", "0.6341681", "0.62859684", "0.62...
0.74865866
0
Execute a command to retrieve disks list.
function getDrives(command) { var result = exec(command, 2000); var drives = result.stdout.split('\n'); drives.splice(0, 1); drives.splice(-1, 1); // Removes ram drives return drives.filter(function(item){ return item != 'none';}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shellLS()\n{\n krnDiskLS();\n}", "function commandList(game_ID, player_ID, executeCommand) {\n\n getPlayer(player_ID, function(playerfound) {\n\n var currentPlayer = playerfound; \n var currentRoom = currentPlayer.room;\n var folders = []; \n var items = [];\n\n ...
[ "0.55602294", "0.5508288", "0.5481596", "0.54258585", "0.54158", "0.5201224", "0.5161403", "0.50313723", "0.49821192", "0.497074", "0.49460024", "0.4910809", "0.48850036", "0.48090172", "0.47919753", "0.47919753", "0.47755888", "0.4770827", "0.47431946", "0.47422928", "0.4739...
0.6452607
0
Retrieve space information about one drive.
function detail(drive) { var used = getUsed(drive); var available = getAvailable(drive); var mountpoint = getMountpoint(drive); var volumename = getVolumename(drive); var freePer = Number(available / (used + available) * 100); var usedPer = Number(used / (used + available) * 100); return { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_drive(dr){\r\n\tif(dr.IsReady){\r\n\t\treturn {\r\n\t\t\tspace : {\r\n\t\t\t\tavailable : dr.AvailableSpace,\r\n\t\t\t\tfree : dr.FreeSpace,\r\n\t\t\t\ttotal : dr.TotalSize\r\n\t\t\t},\r\n\t\t\tletter : dr.DriveLetter,\r\n\t\t\ttype : dr.DriveType,\r\n\t\t\ttypeString : $io.drive.types[dr.DriveType] |...
[ "0.6833546", "0.634997", "0.6335994", "0.60813475", "0.5826091", "0.58093894", "0.57912695", "0.5782496", "0.5651499", "0.5496941", "0.54875845", "0.5466901", "0.5461589", "0.5453748", "0.5352485", "0.51622766", "0.51602834", "0.5128238", "0.5047481", "0.5047481", "0.5038344"...
0.64179856
1
Method for rendering static text used in to tie some model data to a given html element
function onStaticTextRender(json) { $('#' + json.Id).html(json.Value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TextRenderer(){}// no need for block level renderers", "static rendered () {}", "static rendered () {}", "function TextRenderer() {} // no need for block level renderers", "function TextRenderer() {} // no need for block level renderers", "function renderStaticTpl() {\n\t\t$(\"#from-text-span\")...
[ "0.68090594", "0.6806131", "0.6806131", "0.67378145", "0.67378145", "0.66768783", "0.64694613", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287", "0.635287"...
0.683374
0
Remove changes if inside [start8n, end8n)
removeWithinInterval(start8n, end8n) { this.changes = this.changes.filter( change => !(start8n.leq(change.start8n) && (!end8n || change.start8n.lessThan(end8n)))); this._dedupFirstChangeWithDefaultVal(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeStartEnd(req) {\n\tif (req.indexOf(1) > -1) {\t// Remove start node (1) if included\n\t\treq.splice(req.indexOf(1),1);\n\t}\n\t\n\tif (req.indexOf(16) > -1) {\t// Remove end node (9) if included\n\t\treq.splice(req.indexOf(16),1);\n\t}\n\treturn req;\n}", "remove(range) {\n // this.list.reduce(...
[ "0.60926455", "0.6071058", "0.5955418", "0.5955418", "0.5891132", "0.5879688", "0.58429134", "0.5814828", "0.5812151", "0.5792231", "0.57215047", "0.5676211", "0.5668784", "0.5668784", "0.5668784", "0.5666493", "0.5666493", "0.5666493", "0.5666493", "0.5666493", "0.5666493", ...
0.79696995
0
works similarily to String.matchAll except that it looks for matching substrings even in areas where matches were found already
function searchAll(str, search, substr = null, resultArr = []){ const result = substr ? substr.search(search) : str.search(search); if(result === -1) {return resultArr} // difference is used to account for the decreasing length of the substring when computing the index const difference = substr ? str.length - s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repeatedSubstringPatterm(string) {\n let subStr = '';\n\n for (let i = 1; i < string.length; i += 1) {\n subStr = string.slice(0, i);\n let substrings = [];\n [...string].reduce((str, char) => {\n if (str !== subStr) {\n str += char;\n } else {\n substrings.push(str)\n ...
[ "0.67507136", "0.6558435", "0.6538521", "0.64769244", "0.6373687", "0.62415665", "0.6129995", "0.6129563", "0.6119863", "0.6098332", "0.60972774", "0.6073652", "0.60405266", "0.60350007", "0.60350007", "0.601132", "0.6009315", "0.599151", "0.5979815", "0.5975279", "0.59401876...
0.6870316
0
return a 2D array that separates groups of letters' indexes by tags example: "he%%llo" will be separated into [[0,1],[2,3,4]]
function getDiffArray(str, tagRegex) { return str.split('').reduce((acc, letter, index) => { // firstChars and prevChars will be used to check if we are currently iterating over tags const firstChars = letter + str.charAt(index + 1); const prevChars = str.charAt(index - 1) + letter; const match = firs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitIntoGroups(word) {\n if (word.length <= 6) {\n return [word];\n }\n if (word.length > 6) {\n var leftSplit = splitIntoGroups(word.substring(0, word.length/2));\n var rightSplit = splitIntoGroups(word.substring(word.length/2));\n return [].concat(leftSplit).concat(rightSplit);\n }\n}",...
[ "0.64557534", "0.56896275", "0.56278485", "0.5553384", "0.55218756", "0.5494769", "0.5483739", "0.5476509", "0.546238", "0.54544187", "0.5425522", "0.5413978", "0.5412804", "0.53545797", "0.5341986", "0.53349686", "0.533318", "0.5284956", "0.52783346", "0.525495", "0.52355736...
0.57137454
1
Given a word and the translation this function returns the html that should be inserted in the place of original english word.
function getTranslationHTML(word, translation){ var style = " style = '\ border-bottom: 1px dotted grey;\ cursor: pointer;\ '" var onClick = " onclick = \"return onTranslationClick(this, '" + word + "','" + translation + "');\" " return "<span ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translation(word) {\n translationDiv.innerHTML = word\n}", "function insertTranslatedWord(str, n, m){\n word = str.substring(n, m)\n\ttranslation = words[word];\n\tif (translation == null){\n\t\treturn null;\n\t};\n\treturn str.slice(0, n) + getTranslationHTML(word, translation) + str.slice(m);\n}...
[ "0.71676683", "0.6629652", "0.6593962", "0.64415133", "0.6425438", "0.6342995", "0.6313121", "0.6055718", "0.60392547", "0.60207975", "0.5986385", "0.59342", "0.5925778", "0.58064747", "0.5785945", "0.5785645", "0.5765437", "0.57640374", "0.5715006", "0.5698343", "0.5672759",...
0.75324404
0
Check if the word between index n and m is in the dictionary of translatable words. If it is replace the substring between n and m with the translation of the word.
function insertTranslatedWord(str, n, m){ word = str.substring(n, m) translation = words[word]; if (translation == null){ return null; }; return str.slice(0, n) + getTranslationHTML(word, translation) + str.slice(m); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modernDictionaryTranslate(texto)\n{ \n\nvar smiley = /\\:\\)/gi;\nvar happy = /\\:D/gi;\nvar sad = /\\:\\(/gi;\nvar reallyHappy = /\\=D/gi;\n if(language==0)\n {\n texto=texto.replace(/\\bpz\\b/gi,\"pues\");\n texto=texto.replace(/\\bk\\b/gi,\"que\");\n texto=texto.replace(/\\bgad\\b/gi,\"Graci...
[ "0.65958685", "0.65781355", "0.6149787", "0.60878205", "0.6027558", "0.6009283", "0.59469867", "0.5925793", "0.5904074", "0.58026606", "0.5801951", "0.5754557", "0.5700907", "0.55844116", "0.55714864", "0.5564194", "0.5564194", "0.5564194", "0.5547795", "0.54783964", "0.54050...
0.75799906
0
Methods to increase or decrease the number of guests. Has logic that cap the guests
decrease() { if (this.state.guests - 1 > 0) { this.setState({ guests: this.state.guests - 1 }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setNumberOfGuests(num) {\n if(num < 1)\n num = 1;\n this.nrGuests = num;\n }", "set numGuests(val) {\n this._numGuests = typeof val !== 'number' || val < 1 ? 1 : val;\n // if (typeof val !== 'number' || val < 1) {\n // this._numGuests = 1;\n // } else {\n // this._numGuests = val;\...
[ "0.7476495", "0.68976414", "0.6006336", "0.5959649", "0.57608014", "0.575571", "0.56985825", "0.56142426", "0.5588327", "0.5554276", "0.55474246", "0.5515491", "0.5503612", "0.5489149", "0.548506", "0.5428503", "0.5414591", "0.54119873", "0.5408315", "0.54029983", "0.53991044...
0.7197307
1
add ScrnRefresh to onconfig to rotate the app screen when the device rotates
function OnConfig() { gl.ScrRefresh(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onDeviceReorientation() {\n this.data.orientation = (window.orientation * this.RAD) || 0;\n }", "onDeviceReorientation() {\n this.data.orientation = (window.orientation * this.RAD) || 0;\n }", "set refreshMode(value) {}", "function changeRefreshInterval(){\n\t// Update resolution\n\tresol...
[ "0.61471313", "0.61471313", "0.5952849", "0.58040804", "0.5757917", "0.5652596", "0.56296635", "0.5614737", "0.5603865", "0.5499023", "0.5436707", "0.54350364", "0.54341", "0.53726745", "0.5350127", "0.53297186", "0.53152835", "0.528772", "0.527681", "0.527681", "0.5266848", ...
0.6625096
0
Check if there are bookings in the current logged in session
function checkIfBookings() { 'use strict'; if ($('#currentBookings').children().length === 0) { $('#currentBookings').append($('<p style="margin-left:15px"></p>') .attr('class', '') .text('You have no current bookings') ); } if ($('#pastBookings').children().length === 0) { $('#pastBook...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasBookedSpot(r){ \n var c = r.enrolled || r.standby;\n return idCompare(r.user, reservation.user._id) && idCompare(r.arkadevent, reservation.arkadevent) && c;\n }", "function displayAvailableBooks () {\r\n if (bookStore.length == 0) {\r\n console.log('Book Store Empty');\r\n r...
[ "0.66645706", "0.6356422", "0.61223924", "0.6038188", "0.58757955", "0.5874003", "0.580434", "0.5796324", "0.57507396", "0.5744996", "0.5730912", "0.5693224", "0.5691742", "0.5683489", "0.5615002", "0.5529541", "0.5529056", "0.5526162", "0.5517708", "0.5500496", "0.5485261", ...
0.7094385
0
exercise: myEvery(array, condition): true if all condition are true, false otherwise
function myEvery_foreach(arr, condition) { var comp = true; arr.forEach(function(element) { comp = (condition(element) && comp); }); return comp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function every(arr, func)\n{\n\tvar result = true;\n\tif (arr.length == 0) return result;\n\tfor (var i = 0; i < arr.length; i++)\n\t{\n\t\tif (!func(arr[i], i, arr))\n\t\t{\n\t\t\tresult = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}", "function every(array, predicate){\n for (var i=0; i< array.leng...
[ "0.78193295", "0.779829", "0.77787095", "0.776399", "0.7757894", "0.7757894", "0.7739365", "0.76561254", "0.7643219", "0.76270413", "0.76131415", "0.7607619", "0.7594191", "0.75259274", "0.75036675", "0.7494084", "0.7476399", "0.74251395", "0.73887616", "0.73702675", "0.73116...
0.7981744
0
Middleware function. Accepts single JSON document or NDJSON stream of documents and passes them to the document handler.
async function ndjson(req, res, next) { let documents = 0; // check for unacceptable request if (!(req.is(Type.json) || req.is(Type.ndjson))) { res.status(415); res.setHeader("content-type", Type.text); res.send(`Unsupported Media Type\n`); return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getDocument(req, res, next) {\n const documentId = req.params.id\n this.engine.getDocument(documentId, function(err, jsonDoc, version) {\n if (err) return next(err)\n res.json({\n data: jsonDoc,\n version: version\n })\n })\n }", "function findHandler(err, docs, res, url) ...
[ "0.60161763", "0.5320673", "0.5278517", "0.52644676", "0.5259534", "0.52583843", "0.510571", "0.501164", "0.5011114", "0.49816406", "0.4968781", "0.49656373", "0.4911821", "0.4860262", "0.48395568", "0.4828406", "0.48000705", "0.4791319", "0.47056916", "0.47056916", "0.468707...
0.727164
0
Get organism's taxid (NCBI Taxonomy ID) given its common or scientific name
function getTaxid(name) { var organism, taxid, commonName, scientificName, ideo = this, organisms = ideo.organisms; name = slug(name); for (taxid in organisms) { organism = organisms[taxid]; commonName = slug(organism.commonName); scientificName = slug(organism.scientificName); if (commo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getScientificName(taxid) {\n var ideo = this;\n if (taxid in ideo.organisms) {\n return ideo.organisms[taxid].scientificName;\n }\n return null;\n}", "function getTaxidFromEutils(orgName, ideo) {\n var taxonomySearch, taxid;\n\n taxonomySearch = ideo.esearch + '&db=taxonomy&term=' + orgName;\n\...
[ "0.7370883", "0.72759074", "0.70009035", "0.6873409", "0.62966496", "0.6008696", "0.59227204", "0.5726641", "0.5721528", "0.5631077", "0.5462706", "0.5401511", "0.538922", "0.5301125", "0.52866143", "0.52743816", "0.5258445", "0.52286637", "0.52014595", "0.51931083", "0.51598...
0.80887556
0
Get organism's common name given its taxid
function getCommonName(taxid) { var ideo = this; if (taxid in ideo.organisms) { return ideo.organisms[taxid].commonName; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTaxid(name) {\n var organism, taxid, commonName, scientificName,\n ideo = this,\n organisms = ideo.organisms;\n\n name = slug(name);\n\n for (taxid in organisms) {\n organism = organisms[taxid];\n commonName = slug(organism.commonName);\n scientificName = slug(organism.scientificName)...
[ "0.7195337", "0.7033362", "0.6945434", "0.5927591", "0.5926849", "0.5837935", "0.5622629", "0.5619029", "0.5587873", "0.5547434", "0.5476368", "0.5472545", "0.54409355", "0.5440902", "0.54232615", "0.5412167", "0.54005426", "0.53868395", "0.5378025", "0.53672993", "0.5361754"...
0.8800148
0
Get organism's scientific name given its taxid
function getScientificName(taxid) { var ideo = this; if (taxid in ideo.organisms) { return ideo.organisms[taxid].scientificName; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrganismFromEutils(taxid, callback) {\n var organism, taxonomySearch,\n ideo = this;\n\n taxid = ideo.config.organism;\n\n taxonomySearch = ideo.esummary + '&db=taxonomy&id=' + taxid;\n\n d3.json(taxonomySearch).then(function(data) {\n organism = data.result[String(taxid)].commonname;\n id...
[ "0.71394354", "0.7052976", "0.68805796", "0.6498108", "0.6209144", "0.6109376", "0.5958228", "0.5827473", "0.5758886", "0.5656963", "0.5582799", "0.55316615", "0.5529226", "0.54373324", "0.53590816", "0.5340942", "0.52756697", "0.5243708", "0.5242425", "0.52406883", "0.523268...
0.87561387
0
Determine if a string is a Roman numeral From
function isRoman(s) { // http://stackoverflow.com/a/267405/1447675 return /^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/i.test(s); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get romanNumeral() {\n return /^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/;\n }", "function RomanNumeralsHelper() {\n}", "function parseRoman(s) {\n var val = {M: 1000, D: 500, C: 100, L: 50, X: 10, V: 5, I: 1};\n return s.toUpperCase().split('').reduce(function(r, a, i, aa) {\n r...
[ "0.7548928", "0.72545725", "0.711785", "0.69041467", "0.68974227", "0.6765819", "0.64969784", "0.63709587", "0.6304701", "0.61717886", "0.61715144", "0.6169663", "0.6159747", "0.61263293", "0.61084294", "0.6062872", "0.60616904", "0.6019532", "0.59880686", "0.59736085", "0.59...
0.8603152
0
Download a PNG image of the ideogram Includes any annotations, but not legend.
function downloadPng(ideo) { var ideoSvg = document.querySelector(ideo.selector); // Create a hidden canvas. This will contain the raster image to download. var canvas = document.createElement('canvas'); var canvasId = '_ideo-undisplayed-dl-canvas'; canvas.setAttribute('style', 'display: none'); canvas.se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function downloadImage() {\n var data = canvas.toDataURL('image/png');\n download.href = data;\n }", "downloadURL(imgData){\n var a = document.createElement('a');\n a.href = imgData.replace(\"image/png\", \"image/octet-stream\");\n a.download = 'graph.png';\n a.click();\n }", "function down...
[ "0.70688426", "0.705628", "0.69528383", "0.6865353", "0.66502184", "0.66463023", "0.66392225", "0.6614082", "0.6614082", "0.6614082", "0.6614082", "0.6614082", "0.6614082", "0.6614082", "0.6614082", "0.6614082", "0.6614082", "0.6614082", "0.6614082", "0.6614082", "0.6614082",...
0.7575238
0
Implementation to extract adventure ID from query params
function getAdventureIdFromURL(search) { // TODO: MODULE_ADVENTURE_DETAILS // 1. Get the Adventure Id from the URL return search.split("=")[1]; // Place holder for functionality to work in the Stubs // return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAdventureIdFromURL(search) {\n // TODO: MODULE_ADVENTURE_DETAILS\n // 1. Get the Adventure Id from the URL\n console.log(search);\n const id = search.split(\"=\")[1];\n console.log(id);\n return id;\n\n // Place holder for functionality to work in the Stubs\n //return null;\n}", "function get...
[ "0.7572828", "0.7213527", "0.6636608", "0.6304334", "0.6302255", "0.6261155", "0.62197435", "0.6198733", "0.6173786", "0.6062232", "0.59733194", "0.5862261", "0.57975715", "0.5793666", "0.57736254", "0.57614696", "0.5748358", "0.5736671", "0.57241315", "0.561295", "0.5495717"...
0.74398524
1
Destroys all the ckeditors in the specified element and removes all the script tags in it
function DestroyElementEditors(pJQElement){ lResult = {}; pJQElement.find('textarea').each(function(pIdx, pElement){ var lTextareaId = pElement.id; var lEditorInstance = CKEDITOR.instances[lTextareaId]; if(lEditorInstance){ lEditorInstance.updateElement(); // console.log(lTextareaId, lEditorInstance.getData(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n this.element.remove();\n this.subscriptions.dispose();\n this.editorSubs.dispose();\n }", "function destroy() {\n var jqMe = element.jqSelf();\n jqMe.html();\n }", "function unloadEditorContainer() {\n\t$(\"#editorContainer\").fadeOut(\"fast\");\...
[ "0.64824724", "0.6389672", "0.63657117", "0.6264786", "0.6159402", "0.61593074", "0.615805", "0.6105496", "0.6085487", "0.6082267", "0.6073351", "0.60450506", "0.604447", "0.5956816", "0.59507644", "0.58734626", "0.5834234", "0.58191353", "0.5811434", "0.58071077", "0.5805961...
0.7098056
0
List of figures form by document id
function GetDocumentFigures( pDocId, pFiguresHolderId ) { if(pDocId) { $.ajax({ url : gListFiguresAjaxSrv, dataType: 'json', async: false, data :{ document_id: pDocId, }, success : function(pAjaxResult){ if(pAjaxResult['err_cnt']){ alert(pAjaxResult['err_msg']); return; } else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ChangeFiguresForm(pFormName, pDocumentId, pUpdateHolder, pClear, pShowEdit, pPhotoId, pPlateId, pCitation) {\n\tif(pClear == 1) {\n\t\tvar lWrapper = $('.' + pUpdateHolder);\n\t\tlWrapper.html('');\n\t\t$(\"#plate_id_value\").val('');\n\t} else {\n\t\tif(!pPhotoId)\n\t\t\tpPhotoId = 0;\n\t\tif(!pPlateId)\...
[ "0.56951165", "0.5526633", "0.54877007", "0.5476737", "0.5452213", "0.54369485", "0.5409661", "0.53820264", "0.52880883", "0.5279416", "0.5222422", "0.52051675", "0.51534426", "0.51214546", "0.5038294", "0.50061035", "0.5002409", "0.50000745", "0.49955046", "0.4990682", "0.49...
0.6309822
0
List of tables form by document id
function GetDocumentTables( pDocId, pTableHolderId ) { if(pDocId) { $.ajax({ url : gListTablesAjaxSrv, dataType: 'json', async: false, data :{ document_id: pDocId, }, success : function(pAjaxResult){ if(pAjaxResult['err_cnt']){ alert(pAjaxResult['err_msg']); return; } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initOtherDocumentsTable() {\r\n var $table = $('table[data-type=\"other-documents\"]');\r\n var candidateId = $table.data('candidate');\r\n var path = ['filings'];\r\n tables.DataTable.defer($table, {\r\n path: path,\r\n query: {\r\n candidate_id: candidateId,\r\n form_type: 'F99'\r\n ...
[ "0.6005742", "0.5701535", "0.56779134", "0.5656615", "0.56447035", "0.557496", "0.5392268", "0.538782", "0.5381541", "0.53567183", "0.5307855", "0.53022546", "0.5297773", "0.5295682", "0.5268929", "0.52640396", "0.52611476", "0.5258216", "0.5248772", "0.524288", "0.5226925", ...
0.62168807
0
List of endnotes form by document id
function GetDocumentEndnotes(pDocId, pEndnoteHolderId) { if(pDocId) { $.ajax({ url: gListEndnotesAjaxSrv, dataType: 'json', async: false, data: { document_id: pDocId, }, success: function (pAjaxResult) { if(pAjaxResult['err_cnt']) { alert(pAjaxResult['err_msg']); return; } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDocuments(){\n document.getElementById('response-box').innerHTML = \"\";\n //split the input text into separate paragraphs\n parahs = input_text.split('\\n\\n\\n');\n //generate unique document id\n for(let i=0; i<parahs.length; i++){\n var doc_id = \"docid_\" + String(i+1);\n ...
[ "0.54971385", "0.5366942", "0.535108", "0.5345731", "0.5290501", "0.5243135", "0.5241504", "0.5228306", "0.5199527", "0.5165115", "0.51398087", "0.5117427", "0.511576", "0.51141596", "0.51019424", "0.50938183", "0.50349474", "0.5032778", "0.49981242", "0.4959003", "0.49453533...
0.6686229
0
Loop through elements in menu and show the list if it has warning class
function showAllWarningInstancesInMenu(pMenuId, pWarningClass) { $("#articleMenu li div").each(function(index) { if($(this).hasClass(pWarningClass)) { $(this).parents("ul").show(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showMenu(){\n var listMenu = this.getElementsByClassName(\"itemList\")[0];\n\n if (listMenu.classList.contains(\"hide\")){//si mi elemento tiene hide, muestrame\n //remove-add para agregar y quitar clases\n listMenu.classList.remove(\"hide\");//quitamos la clase hide\n listMenu.classList.add(\"...
[ "0.5919156", "0.5806984", "0.57999164", "0.5791827", "0.57261103", "0.57054245", "0.56747526", "0.5605505", "0.5597536", "0.5588813", "0.5583902", "0.5568396", "0.5566914", "0.55403656", "0.55292916", "0.5529213", "0.55264455", "0.55216527", "0.54863614", "0.5481036", "0.5476...
0.7549391
0
Returns the first text node which is following the specified node or false if there is no such node
function GetNextTextNode(pNode) { var lNextSibling = false; var lParent = pNode; while(lParent){ lNextSibling = lParent.nextSibling; while(lNextSibling){ if(lNextSibling.nodeType == 3) return lNextSibling; if(lNextSibling.nodeType == 1){ var lTextNode = GetFirstTextNodeDescendant(lNextSibling); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetPreviousTextNode(pNode) {\n\tvar lPreviuosSibling = false;\n\tvar lParent = pNode;\n\twhile(lParent){\n\t\tlPreviuosSibling = lParent.previousSibling;\n\t\twhile(lPreviuosSibling){\n\t\t\tif(lPreviuosSibling.nodeType == 3)\n\t\t\t\treturn lPreviuosSibling;\n\t\t\tif(lPreviuosSibling.nodeType == 1){\n\t...
[ "0.6388554", "0.62376666", "0.62376666", "0.6213287", "0.61618674", "0.61618674", "0.61618674", "0.61254567", "0.61254567", "0.60215974", "0.59413457", "0.5879818", "0.58720815", "0.5824161", "0.5824161", "0.5744514", "0.56755835", "0.56341064", "0.56303716", "0.5626123", "0....
0.67690504
0
Returns the first text node which is a child of the passed node or false if there is no such node If the node is a text node itself it will be returned
function GetFirstTextNodeDescendant(pNode) { if(pNode.nodeType == 3){ return pNode; } for(var i = 0; i < pNode.childNodes.length; ++i){ var lChild = pNode.childNodes[i]; if(lChild.nodeType == 3){ return lChild; } if(lChild.nodeType == 1){ var lChildFirstTextNode = GetFirstTextNodeDescendant(lChild); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasChildNodes(node) {\n return firstChild(node) != null;\n}", "function text(node) {\n return node && node.type === 'text';\n}", "function text(node) {\n return node && node.type === 'text';\n}", "function isText(node) {\n return node.nodeType === 'text';\n}", "function findFirstTextNode(nod...
[ "0.6794756", "0.66270715", "0.66270715", "0.6608429", "0.6488297", "0.6488297", "0.6488297", "0.64857996", "0.6472483", "0.636223", "0.63155484", "0.62917805", "0.6215701", "0.61035675", "0.609451", "0.60916233", "0.6088892", "0.60862374", "0.6073042", "0.6049463", "0.6006112...
0.7299245
0
Returns the first text node which is preceding the specified node or false if there is no such node
function GetPreviousTextNode(pNode) { var lPreviuosSibling = false; var lParent = pNode; while(lParent){ lPreviuosSibling = lParent.previousSibling; while(lPreviuosSibling){ if(lPreviuosSibling.nodeType == 3) return lPreviuosSibling; if(lPreviuosSibling.nodeType == 1){ var lTextNode = GetLastTextNo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prev(n){\n while((n = n.previousSibling) && n.nodeType != 1);\n return n;\n }", "function isPreviousLineEmpty(text, node) {\n let idx = locStart$1(node) - 1;\n idx = skipSpaces(text, idx, { backwards: true });\n idx = skipNewline(text, idx, { backwards: true });\n idx = skipSpaces(t...
[ "0.65964067", "0.65741765", "0.63965786", "0.6378244", "0.6378244", "0.62684095", "0.6206229", "0.6206229", "0.6148655", "0.61326367", "0.6117331", "0.602992", "0.6003103", "0.5936094", "0.59307677", "0.59307677", "0.59307677", "0.5842648", "0.5831141", "0.5796907", "0.578790...
0.7117637
0
Returns the last text node which is a descendent of the passed node or false if there is no such node If the node is a text node itself it will be returned
function GetLastTextNodeDescendant(pNode) { if(pNode.nodeType == 3){ return pNode; } for(var i = pNode.childNodes.length - 1; i >= 0; --i){ var lChild = pNode.childNodes[i]; if(lChild.nodeType == 3){ return lChild; } if(lChild.nodeType == 1){ var lChildLastTextNode = GetLastTextNodeDescendant(lChild)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLastTextNode(elem) {\n // if we have children, search inside the last one\n if (elem.lastChild) {\n return getLastTextNode(elem.lastChild);\n }\n\n //we don't have children, and this is the root => we can't find anything here\n if (e...
[ "0.69317317", "0.6793771", "0.66179806", "0.6194032", "0.6084136", "0.6069397", "0.60016775", "0.5984065", "0.5956036", "0.5941849", "0.59397215", "0.59279263", "0.5925277", "0.5925277", "0.5915533", "0.5817943", "0.58155483", "0.57927233", "0.57684267", "0.5755383", "0.57502...
0.7498847
0
GET NAMES OF ALL THE CONTRACTS
function getContractNames (success, data, compiler, compilerFullName) { var contractNames = document.querySelector(`.${css.contractNames.classNames[0]}`) contractNames.innerHTML = '' if (success) { selectContractNames.removeAttribute('disabled') compiler.visitContracts((contract) => { co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllNames() {\n return Array.from(this.commitPerName.keys());\n }", "function contract_list(request, response, next) {\n console.log('List of contracts');\n}", "list() {\n return this.contract.methods.getOwnerTokens(this.contract.defaultAccount).call();\n }", "contactListNames() {\n\t ...
[ "0.6336391", "0.5929018", "0.5815636", "0.57927686", "0.57387316", "0.5674921", "0.56143236", "0.5532785", "0.5525061", "0.5492793", "0.54868096", "0.5455583", "0.5453467", "0.5414377", "0.5409665", "0.540508", "0.53911567", "0.5379731", "0.5379293", "0.5371122", "0.5336321",...
0.624301
1
exercises from Complete the function cube that returns the cube of x
function cube(x) { return x * x * x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cube(x) {\n return x * x * x;\n }", "function cube (x) {\n\treturn x * x * x\n}", "function cube(x) {\n return x * x * x * PI;\n}", "function cube(x){\n return Math.pow(x, 3);\n}", "function cube( x ) {\n return Math.pow( x, 3 );\n}", "function cube(a){\n return a*a*a\n}", ...
[ "0.88889116", "0.88611245", "0.8421253", "0.8403999", "0.83648795", "0.83566546", "0.834377", "0.8179232", "0.8172036", "0.8116512", "0.8085698", "0.79950255", "0.78174645", "0.7816648", "0.7796611", "0.7772481", "0.7621196", "0.76122415", "0.7509713", "0.7417535", "0.7400295...
0.88970816
0
=> 64 Complete the function fullName that should take two parameters, firstName and lastName, and returns the firstName and lastName concatenated together with a space in between.
function fullName(firstName, lastName){ return firstName + ' ' + lastName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fullName(firstName, lastName) {\n\treturn firstName + \" \" + lastName;\n}", "function fullName(firstName, lastName) {\n\t return `${firstName} ${lastName}`;\n\t}", "function fullName(firstName, lastName) {\n return firstName + lastName;\n}", "function fullName(firstName, lastName) {\n\treturn `${...
[ "0.87736607", "0.87363315", "0.8720768", "0.86657435", "0.86471826", "0.86393285", "0.8607595", "0.84804845", "0.84804845", "0.8452177", "0.84485173", "0.8440116", "0.84260017", "0.8423998", "0.84158885", "0.8395393", "0.8388774", "0.8387392", "0.8354652", "0.8328203", "0.830...
0.87522656
1
=> 'Hello Shawn!' Write a function greeter that takes a name as an argument and greets that name by returning something along the lines of "Hello, !"
function greeter(name){ return "Hello, " + name + "!"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function greeter(name){\n\treturn 'Hello ' + name + '!';\n}", "function greet(name) {\n return 'Hello ' + name\n}", "function greet(name) {\n return 'Hello ' + name;\n}", "function greet(name) {\n return 'Hello, ' + name;\n}", "function greet(name){\n return 'hi ' + name\n}", "function greet(name...
[ "0.907909", "0.8994115", "0.8922334", "0.8884366", "0.8874385", "0.8857575", "0.87662435", "0.8709562", "0.8653308", "0.86486995", "0.86126596", "0.85890394", "0.8574778", "0.85629106", "0.8535388", "0.8510565", "0.8507575", "0.8492401", "0.8474404", "0.84478766", "0.84361017...
0.90053934
1
Translate these geometric formulas (the area & perimeter of a square, rectangle, parallelogram, trapezoid, and triangle and area & circumference of a circle) intro JavaScript functions. Square
function areaSquare(s) { //A = s^2 return Math.pow(s, 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function areaSquare(side) {\n// Returns the 2D Area of a Square\n return side ** 2;\n}", "function square() {\n var v = [1,1], off; var a = arguments, p = a[0];\n if(p&&!p.size) v = [p,p];\n if(p&&p.length) v = a[0], p = a[1];\n if(p&&p.size&&p.size.length) v = p.size;\n\n off = [v[0]/2,v[1]/2];\n ...
[ "0.7052929", "0.69593376", "0.6750627", "0.66647214", "0.6664531", "0.65993917", "0.65607035", "0.64919126", "0.64294547", "0.63622355", "0.6349233", "0.63457215", "0.63145095", "0.6255398", "0.62229455", "0.6218365", "0.6197838", "0.6192915", "0.618206", "0.61595964", "0.613...
0.7023369
1
Columns of user_pub table user_id|pub_id|date_created
function makeUserPubArray() { return [ {user_id: 1, pub_id: 1, date_created: '2029-01-22T16:28:32.615Z'}, {user_id: 1, pub_id: 2, date_created: '2029-01-22T16:28:32.615Z'}, {user_id: 1, pub_id: 3, date_created: '2029-01-22T16:28:32.615Z'}, {user_id: 2, pub_id: 1, date_created: '2029-01-22T16:28:32.615...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPublicByUserCreated(userId) {\n return db('lists as l')\n // .join('twitter_users as tu', 'tu.twitter_id', \"l.twitter_id\")\n .where('l.twitter_id', userId)\n .where('public', true)\n}", "function getPrivateByUserCreated(userId) {\n return db('lists as l')\n // .join('twitter_users as ...
[ "0.6126831", "0.5331259", "0.52727646", "0.5151599", "0.5023615", "0.49138257", "0.48796743", "0.48648125", "0.4819257", "0.472096", "0.47118154", "0.4654399", "0.46406293", "0.46389854", "0.46256775", "0.46156195", "0.460658", "0.45933017", "0.45652556", "0.45334196", "0.452...
0.65131354
0
Columns of benrinote_publications table id |title|cover|summary|date_created|date_modified|author_id|publisher_id
function makePublicationsArray() { return [ {id: 1, title: 'Publication 1', cover: 'https://octodex.github.com/images/minion.png', summary: 'Examples of things you can do with markdown. Source: https://markdown-it.github.io/', date_created: '2029-01-22T16:28:32.615Z', date_modified: '2029-01-22T16:28:32.615Z', au...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMetadata(article) {\n // Authors. Title. Journal. Year Month;Volume(Issue):Pages. Times cited: n. Percentile rank in Field: n.\n var year = parseInt(article.cover_date.split(\".\")[2]);\n var month = parseInt(article.cover_date.split(\".\")[1]);\n return article.authors.replace(new RegEx...
[ "0.576867", "0.5612828", "0.5329926", "0.5273373", "0.52635074", "0.52620167", "0.52032155", "0.5196161", "0.5179948", "0.51699483", "0.51097155", "0.5036854", "0.5023519", "0.5006747", "0.5005159", "0.49956897", "0.49890095", "0.49493775", "0.48823273", "0.4873101", "0.48661...
0.56173855
1
Columns of benrinote_sections table id|pub_id|section|title|text|type
function makeSectionsArray() { return [ {id: 1, pub_id: 1, section: 1, title: 'First Section', text: 'Lorem ipsum dolor sit amet', type: 'md'}, {id: 2, pub_id: 1, section: 2, title: 'Second Section', text: 'Lorem ipsum dolor sit amet', type: 'md'}, {id: 3, pub_id: 1, section: 3, title: 'Third Section', te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Sections () {\n let sections = ToC[categoryIndex].docs[docIndex].sections\n // ... but if the doc is active because performance\n // and then check to make sure the doc actually has sections in the ToC tree\n // if so, execute getSections to assemble the doc section list HTML\n if (active &...
[ "0.55182505", "0.54953045", "0.532152", "0.5200399", "0.51798195", "0.5149183", "0.5107008", "0.5102909", "0.50867105", "0.50673306", "0.50537515", "0.5046969", "0.50074977", "0.49959448", "0.49892473", "0.49843833", "0.4959777", "0.4931073", "0.4925225", "0.4889999", "0.4881...
0.5834913
0
Columns of benrinote_notes table id|user_id|pub_id|section|date_created|date_modified|text
function makeNotesArray() { return [ {id: 1, user_id: 1, pub_id: 1, section: 1, date_created: '2029-01-22T16:28:32.615Z', date_modified: '2029-01-22T16:28:32.615Z', text: 'Test notes for USER 1s PUBLICATION 1s SECTION 1 NOTES'}, {id: 2, user_id: 1, pub_id: 1, section: 2, date_created: '2029-01-22T16:28:32.615...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderNotes(user) {\n db.collection('notes').where('UID', '==', user.uid).orderBy('created').get().then((snapshot) => {\n\n snapshot.docs.forEach(doc => {\n\n data = doc.data();\n subject = data.subject;\n pinned = data.pinned\n note = data.note\n ...
[ "0.59367394", "0.5859289", "0.5733424", "0.55921125", "0.55077296", "0.5496918", "0.54749805", "0.54646885", "0.54300916", "0.5424444", "0.54046375", "0.5383213", "0.5373187", "0.53661925", "0.53636855", "0.53454566", "0.53376836", "0.53282905", "0.5326217", "0.53092825", "0....
0.60756534
0
event listener to respond to clicks on the page when user clicks anywhere on the page, the "makeQuote" function is called
function addListenerToLoadQuote() { var button = document.getElementById('loadQuote'); button.addEventListener("click", makeQuote, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printQuote() {\n //return (\"hello\")\n let savedQuote = getRandomQuote();\n let html = `\n \n <p class=\"quote\"> ${savedQuote.quote} </p> \n <p class=\"source\"> ${savedQuote.source}\n `\n \n if(savedQuote.citation) {\n html += `<span class=\"citation\">${savedQuote.citation}</span>`;\...
[ "0.69025797", "0.66510534", "0.6483391", "0.6206409", "0.61640173", "0.6161452", "0.60990095", "0.6075998", "0.607119", "0.6041806", "0.6041806", "0.59872323", "0.5956596", "0.58995366", "0.5877398", "0.58351856", "0.5830606", "0.5805985", "0.57806474", "0.57732147", "0.57644...
0.7190273
0
Makes a call to fetch counter from specified endpoint Creates a counter array if not able to fetch it NOT MAKING USE OF THIS YET
function getCounter(){ // Add fetch to make calls every x seconds (x~5 ideally) // To avoid polling, can make use of sockets var getOptions = { } fetch(url) .then(checkStatus) .then(getJSON) .then(function(){ }) .catch(function(err){ }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCounters(req, res) {\n var userId = req.user.sub;\n if (req.params.id) {\n userId = req.params.id;\n }\n getCountFollow(userId).then((value) => {\n // if (err) return res.status(200).send({ err });\n return res.status(200).send({ value });\n });\n}", "function fetc...
[ "0.653565", "0.6475429", "0.6191957", "0.6088605", "0.6088605", "0.6032872", "0.60003406", "0.59981334", "0.5964618", "0.59533054", "0.594058", "0.5902315", "0.5883828", "0.58438313", "0.58358103", "0.57868093", "0.5750611", "0.574936", "0.5747868", "0.5726689", "0.5714723", ...
0.73790187
0
Whenever the trades displayed on asset line graph changes, we need to update the list of senators that users can filter against
function updateSenatorSelect(trades) { let senatorSelect = document.getElementById('senatorSelect'); let selectedSenator = senatorSelect.value; clearSenatorSelect(); // add back the All option let allOption = document.createElement('option'); allOption.setAttribute('value', 'All'); allOption.innerHTML = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function botToViewerRatio() {\n // Checks for new users\n checkForUsers = setInterval(() => {\n console.log(\"Searching for new users and applying points to them.\");\n var currentUsersFiltered = [...new Set(currentUsers)];\n currentUsers = [];\n console.log(currentUsersFiltered);...
[ "0.56819254", "0.5381538", "0.5304455", "0.529904", "0.52524126", "0.5251047", "0.5192442", "0.51787156", "0.517662", "0.5147232", "0.5132558", "0.51192135", "0.5115647", "0.50946474", "0.509135", "0.50781", "0.50752515", "0.5065937", "0.50613344", "0.50473136", "0.5045297", ...
0.60600686
0
Reads a blob as text. Returns a promise, which supplies the text.
function readBlobAsText(blob) { return new Promise((resolve, reject) => { var reader = new FileReader(); reader.addEventListener('load', () => resolve(reader.result)); reader.addEventListener('abort', () => reject(new Error("aborted"))); reader.addEventListener('error', () => reject(reader.error)); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readBlobAsText(blob) {\r\n return readBlobAs(blob, \"string\");\r\n}", "function readBlobAsText(blob) {\n return readBlobAs(blob, \"string\");\n}", "static readBlobAsText(fileOrBlob) {\n return new Promise(resolve => { \n const reader = new FileReader();\n reader.onload = eve...
[ "0.7713449", "0.76829296", "0.75688356", "0.74586576", "0.71949476", "0.7153984", "0.7117068", "0.70744807", "0.6665513", "0.6654233", "0.6583995", "0.6583995", "0.6583995", "0.6583995", "0.6583995", "0.6583995", "0.6583995", "0.6583995", "0.6583995", "0.6583995", "0.6583995"...
0.8202361
0
Creates a element for a table with simple text in each cell (MDL style). |cells| is an array of strings.
function createTableRow(cells) { var tr = document.createElement('tr'); for (var i = 0; i < cells.length; i++) { var td = document.createElement('td'); td.setAttribute('class', 'mdl-data-table__cell--non-numeric'); td.appendChild(document.createTextNode(cells[i])); tr.appendChild(td); } return t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeTable(array) {\n tbl = document.createElement('table');\n tbl.setAttribute('class', 'table table-bordered table-responsive-md table-striped')\n tbl.setAttribute('id', 'tbl')\n let thead = tbl.createTHead();\n let row = thead.insertRow();\n for (let key of scenarios) {\n let th = document.cr...
[ "0.6412954", "0.62203646", "0.6004431", "0.59963757", "0.59879714", "0.597004", "0.5950624", "0.5894903", "0.5880353", "0.58788276", "0.5834822", "0.582309", "0.5822276", "0.5812523", "0.58101386", "0.5805703", "0.5794994", "0.57938313", "0.5776809", "0.57406825", "0.5709413"...
0.7407276
0
Call this to rerun the MDL upgrade step on a table (to regenerate the checkboxes). This should be called whenever |table| is changed.
function reUpgradeTable(table, selectionChangedCallback) { // Delete all the checkbox cells. var trs = table.querySelectorAll('tr'); for (var i = 0; i < trs.length; i++) { var tr = trs[i]; var firstCell = tr.querySelector('th,td'); var firstCellInput = firstCell.querySelector('input'); if (firstCe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTableUpdate() {\n\n}", "function addUpgradesToTable(){\n for (upgrade in upgrades){\n if (checkIfCanUpgrade(upgrade, true)){\n writeUpgradeHTML(upgrade);\n }\n }\n}", "function theQwertyGrid_reFillTable(data) {\n\t\t\ttheQwertyGrid_clearAllRows();\n\t\t\ttheQwertyGrid_addRows(data, _th...
[ "0.5760071", "0.5580673", "0.5564435", "0.55613476", "0.5468981", "0.5463916", "0.53969234", "0.5366701", "0.5364019", "0.5335977", "0.5319763", "0.53051597", "0.5295492", "0.5260244", "0.52398837", "0.52222204", "0.5220243", "0.5181285", "0.5158982", "0.51580244", "0.5148908...
0.7605596
0
deviceprinting Functions This function captures the User Agent String from the Client Browser
function deviceprint_browser () { t = ua +SEP+ navigator.appVersion +SEP+ navigator.platform; if (ie) { t += SEP + navigator.appMinorVersion +SEP+ navigator.cpuClass +SEP+ navigator.browserLanguage; t += SEP + ScriptEngineBuildVersion(); } else if (moz) { t += SEP + navigator.language; } retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get userAgent() {\n return this.randomUa\n ? `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${\n Math.floor(Math.random() * 14) + 65\n }.0.4044.113 Safari/537.36`\n : this.ua;\n }", "function userAgent() {\n const osxVer = Math.floor(...
[ "0.62286055", "0.61083204", "0.59958994", "0.59828997", "0.5981588", "0.5969619", "0.5919327", "0.59081244", "0.5877701", "0.5846327", "0.577749", "0.57115704", "0.5663349", "0.56467", "0.56346834", "0.56346834", "0.56346834", "0.56346834", "0.56216353", "0.5620828", "0.56202...
0.7082597
0
This function captures the user's timezone in GMT
function deviceprint_timezone () { var gmtHours = (new Date().getTimezoneOffset()/60)*(-1); return gmtHours; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_time_zone_offset( ) {\n\tvar current_date = new Date( );\n\tvar gmt_offset = current_date.getTimezoneOffset( ) / 60;\n\treturn (gmt_offset);\n}", "function timezone_info() {\n return {\n cookie: getCookie(\"z.tz\"),\n user_agent: timezone()\n };\n}", "function timezones_guess()...
[ "0.693167", "0.6775744", "0.670065", "0.6669154", "0.66531956", "0.6554242", "0.6541373", "0.65405864", "0.6523333", "0.6496136", "0.6468583", "0.64558524", "0.6441859", "0.64233714", "0.6409974", "0.6371536", "0.63162357", "0.629098", "0.629098", "0.6290024", "0.62872016", ...
0.68538785
1
Deviceprint to the query string Encoded Deviceprint Encodes The Deviceprint
function encode_deviceprint() { var t = "version=" + ver +"&pm_fpua=" + deviceprint_browser("") + "&pm_fpsc=" + deviceprint_display("") + "&pm_fpsw=" + deviceprint_software("") + "&pm_fptz=" + deviceprint_timezone("")+ "&pm_fpln=" + deviceprint_language("") + "&pm_fpjv=" + deviceprint_java("") + "&pm_fpco=" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decode_deviceprint()\n\t{\tvar t = \"version=\" + ver +\"&pm_fpua=\" + deviceprint_browser(\"\") + \"&pm_fpsc=\" + deviceprint_display(\"\") + \"&pm_fpsw=\" + deviceprint_software(\"\")\n\t\t\t\t+ \"&pm_fptz=\" + deviceprint_timezone(\"\")+ \"&pm_fpln=\" + deviceprint_language(\"\")\n\t\t\t\t+ \"&pm_fpjv=...
[ "0.6162346", "0.6051615", "0.5802916", "0.57889503", "0.57272243", "0.5701426", "0.5633467", "0.5633467", "0.5610394", "0.5610394", "0.5607997", "0.5542456", "0.5535938", "0.5535938", "0.5535938", "0.5535938", "0.5535938", "0.5535938", "0.55256885", "0.550633", "0.54996055", ...
0.72313595
0
Helper Function Shows How to Decode The Deviceprint
function decode_deviceprint() { var t = "version=" + ver +"&pm_fpua=" + deviceprint_browser("") + "&pm_fpsc=" + deviceprint_display("") + "&pm_fpsw=" + deviceprint_software("") + "&pm_fptz=" + deviceprint_timezone("")+ "&pm_fpln=" + deviceprint_language("") + "&pm_fpjv=" + deviceprint_java("") + "&pm_fpco=" + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encode_deviceprint()\n\t{\n\t\tvar t = \"version=\" + ver +\"&pm_fpua=\" + deviceprint_browser(\"\") + \"&pm_fpsc=\" + deviceprint_display(\"\") + \"&pm_fpsw=\" + deviceprint_software(\"\")\n\t\t\t\t+ \"&pm_fptz=\" + deviceprint_timezone(\"\")+ \"&pm_fpln=\" + deviceprint_language(\"\")\n\t\t\t\t+ \"&pm_f...
[ "0.65032274", "0.6464771", "0.6365424", "0.61609864", "0.60681635", "0.60017115", "0.5916883", "0.59114516", "0.58755684", "0.58703285", "0.57773924", "0.57438624", "0.5631213", "0.55656", "0.5560995", "0.5525436", "0.5492816", "0.5484493", "0.5474293", "0.5451662", "0.543097...
0.8216774
0
helper function to return the code associated with a function
static _functionToCode(fn, name) { var txt = fn.toString() .replace(/\/\/.*/g, '') .replace(/\s+/g, '') .replace(/var/g,'var ') .replace('return','return ') + ';'; return txt }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFunc() { return \"gate\"; }", "function functionName(func) {\n var result = /^function\\s+([\\w\\$]+)\\s*\\(/.exec(func.toString());\n return result ? result[1] : '<anonymous>'; // for an anonymous function there won't be a match\n}", "function functionExecutor(functionName){\n\t\treturn func...
[ "0.68020064", "0.6685358", "0.66634715", "0.6629182", "0.6575292", "0.65371704", "0.64674836", "0.6453952", "0.64512503", "0.63392264", "0.6299367", "0.6283895", "0.6280608", "0.62765205", "0.6271091", "0.6259445", "0.6254984", "0.62479913", "0.62479913", "0.62479913", "0.622...
0.73792803
0
convert a template to a processing function
static convertTemplate(src, pretty=false, debug=false) { var fx = ( src.match(/{{\^/) // add escape function if there is any escaping in template ? 'function '+Renderer._functionToCode(Renderer.escape) : '' ) + (src.match(/{{@/) // add mangle function if there is any mangling in t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processor(data) {\n return function process(content) {\n return _.template(content.toString().replace(/\\n<%([^-=])/g, '<%$1'), data);\n };\n}", "visitTemplate(template) { }", "function defaultProcess( template, content ) {\n\t\t\treturn template.replace( /\\{\\{([.\\-\\w]*)\\}\\}/g, function( ma...
[ "0.6626445", "0.63461345", "0.62813085", "0.6041309", "0.5940337", "0.58883506", "0.587109", "0.5866767", "0.5734598", "0.57199", "0.57197845", "0.57168776", "0.5691189", "0.5644593", "0.5624067", "0.55912733", "0.5565819", "0.55585986", "0.55504173", "0.5495419", "0.5479279"...
0.6905231
0
run the actual callbacks
function runCallbacks() { callbacks.forEach((callback) => { callback(); }); running = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runCallbacks() {\n\n\t\tcallbacks.forEach(function (callback) {\n\t\t\tcallback();\n\t\t});\n\n\t\trunning = false;\n\t}", "function runCallbacks() {\n callbacks.forEach(function(callback) {\n callback();\n });\n\n running = false;\n }", "function runCallbacks() {\n ca...
[ "0.737414", "0.7199021", "0.71888113", "0.71410716", "0.7115456", "0.71132296", "0.70812243", "0.6933893", "0.6933893", "0.6933893", "0.6933893", "0.6933893", "0.68923867", "0.6711463", "0.6711463", "0.6708043", "0.6704581", "0.6573042", "0.64736503", "0.64400434", "0.6418094...
0.72092474
1
Collect GIFs from chat.meatspac.es
function collectMeat() { // Messages that haven't been scraped yet. var lis = document.querySelectorAll('.chats li[data-key]:not(.scraped)'); for (var li of lis) { li.className += ' scraped'; var key = li.getAttribute('data-key'); var src = li.querySelector('img').src; // Ex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processGifs(obj){\n let imageTags = obj.data.map(gif => `<img src=\"${gif.images.original.url}\" width=\"200px\"/>`).join(\"\\n\")\n document.querySelector(\"#giphy-div\").innerHTML = imageTags\n}", "async function returnGif(msg) {\n if (msg.content == \"gif\") {\n let url =\n \"https://api.t...
[ "0.6971643", "0.66736406", "0.664316", "0.66420543", "0.6527094", "0.6514151", "0.6492814", "0.6480541", "0.6407598", "0.63861614", "0.6380432", "0.63757014", "0.6357578", "0.63450044", "0.6316143", "0.62834346", "0.6265414", "0.6262938", "0.62593454", "0.6254376", "0.6242481...
0.73854214
0
Movie listitem click handler
function listitemClickHandler (e) { // Read out TMDB id from listitem data-tmdbid const tmdbid = this.getAttribute('data-tmdbid'); // Alert if tmdbid is missing if (tmdbid == '') { alert('Ehhez a filmhez nincs megadva TMDB azonosító.'); return; }; // Otherwise fetch and display movie data from tmdb API const...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clicked(element){\r\n\tlet getLiIndex = element.getAttribute('li-index');\r\n\tmusicIndex = getLiIndex;\r\n\tloadMusic(musicIndex);\r\n\tplayMusic();\r\n\tplayingSong();\r\n}", "function carouselItemClick(event)\n{\n /*\n try\n {\n var urlName,\n item;\n console.log('carouselItemClick ',...
[ "0.6589199", "0.6518273", "0.64726204", "0.6449865", "0.64197135", "0.637541", "0.6348422", "0.63476133", "0.6328209", "0.6279231", "0.6220891", "0.6139232", "0.6117033", "0.60705775", "0.60652596", "0.6049734", "0.60339385", "0.6013492", "0.5979504", "0.597314", "0.59706724"...
0.7336062
0
Filter & sort movies based on sortAndFilter global object
function sortFilterMovies () { let filteredMovies = foundMoviesArr; // Begin with filtering (if any) if (sortAndFilter.filter !== 'all') { filteredMovies = foundMoviesArr.filter(movie => movie.status === sortAndFilter.filter); }; // Now comes the sorting if (sortAndFilter.sort === 'title') { filteredMovies.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFilter() {\n let year = $('#w1-slider .tooltip-inner')[0].innerHTML.split(' : ');\n let reating = $('#w2-slider .tooltip-inner')[0].innerHTML.split(' : ');\n\n filter_value = 'Year,' + year[0] + ',' + year[1] + ',imdbRating,' + reating[0] + ',' + reating[1];\n sendData(genre, searchValue, l...
[ "0.69737077", "0.6626377", "0.65223235", "0.64522874", "0.64337313", "0.6379725", "0.6360148", "0.6359451", "0.63459694", "0.63437223", "0.6335522", "0.6300602", "0.6251916", "0.6233388", "0.62264407", "0.6226024", "0.6189708", "0.61875606", "0.61740744", "0.615033", "0.61415...
0.7968907
0
main clickHandler function that takes the input, sends the request to sever and gets the translated texxt back
function clickHandler(){ var inputTxt= inputText.value; fetch(getTranslationUrl(inputTxt)) .then(response => response.json()) .then(json => { var translatedText= json.contents.translated; outputDiv.innerText= translatedText; } ) .catch(errorHandler) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buttonclickEvent() {\n var inputTxt = inputBox.value;\n // calling server for processing\n fetch(getTranslationUrl(inputTxt))\n .then((response) => response.json())\n .then((json) => {\n var translateText = json.contents.translated;\n outputBox.innerText = tran...
[ "0.76226074", "0.7553808", "0.7284406", "0.7198621", "0.71741277", "0.69261897", "0.6729194", "0.66317505", "0.63251776", "0.6321565", "0.6304599", "0.62137806", "0.62108886", "0.6202248", "0.6161827", "0.6133978", "0.61142075", "0.6075537", "0.60643977", "0.6050875", "0.6030...
0.78331834
0
Check Log List For page analytic Transfer Date
function getPageAnalyticsLogLastUpdateDate() { try { var clientContext = new SP.ClientContext(); var oList = clientContext.get_web().get_lists().getByTitle('Log'); var camlQuery = new SP.CamlQuery(); domain = getdomainnamesphosturl(); camlQuery.set_viewXml( '<Vie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function date_checker() {\n // If date is new, added to date_tracker array\n date_only = DateTime.substr(0, 10);\n if (!date_tracker.includes(date_only)) {\n date_tracker.push(date_only);\n\n // Completes auto_transfers before CSV i...
[ "0.6140858", "0.5777323", "0.5706191", "0.56314784", "0.5565938", "0.5485287", "0.53797996", "0.5311595", "0.52656364", "0.5258314", "0.525808", "0.5253923", "0.5238296", "0.51650494", "0.51546997", "0.5132923", "0.51317453", "0.51185995", "0.5095669", "0.5063441", "0.5055616...
0.60926396
1
Funcion para mostrar los datos
function showData(){ let rows = ""; for(let index = 0; index < productos.length; index++){ rows += '<tr>' rows += '<td>' + productos[index].codigo + '</td>' rows += '<td>' + productos[index].nombre + '</td>' rows += '<td>' + productos[index].precio + '</td>' rows += '</tr>' } document.g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show(data) {\n // console.log(data)\n var inserir = data.map(function (item, indice) {\n\n return `<tr>\n <td>${item.date}</td>\n <td>${item.weekday}</td>\n <td>${item.max + '°C'}</td>\n <td>${item.min + '°C'}...
[ "0.6982909", "0.67758304", "0.6757539", "0.6737346", "0.65798855", "0.65798855", "0.65499675", "0.65367645", "0.65084136", "0.64151335", "0.64132124", "0.6380511", "0.6354735", "0.63390374", "0.6323525", "0.63198674", "0.6317574", "0.63170195", "0.6315697", "0.6301649", "0.63...
0.6866698
1
QUIZ CONTENT this hides the welcomeSection menu page section and reveals the questions section (both within index.html) questions are presented while starting the timer by calling on the startTimer and askQuestions functions. the timer begins to count down as a result, and the user is presented with multiple choices to...
function startQuiz() { welcomeSection.style.display = "none"; questionSection.style.display = "block"; currentQuestion = 0; startTimer(); askQuestions(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startQuiz() { \r\n quizQuestionpage.style.display = \"block\";\r\n finalScorePage.style.display = \"none\"; // Hide Final Core Page \r\n quizChallengePage.style.display = \"none\"; // Hide Quiz Challenge Page \r\n choice1.style.display = \"block\";\r\n choice2.style.display = \"block\";\r\n choice3....
[ "0.75251895", "0.7283989", "0.722376", "0.71189857", "0.7087115", "0.70839703", "0.70740014", "0.70147604", "0.6978898", "0.69758075", "0.69578993", "0.6922394", "0.68739784", "0.6857812", "0.68496996", "0.6845808", "0.6845044", "0.68432695", "0.6838339", "0.6827428", "0.6823...
0.74363047
1
Send code message to phone
function sendCode() { var user_phone = $("#user-phone").val(); var check_code = $("#write-code").val(); if(check_code == "" && user_phone == "") { return; } $.ajax({ type: "get", url:"index.php?m=sms&f=sms&v=sendsms", data:'mobile='+user_phone, dataType: "json", success: function(data){ console.log...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendSMS(smsCode, pNumber) {\n\tthis.smsCode = smsCode;\n\tclient.messages.create({\n\t\tbody: smsCode,\n\t\tto: pNumber, \t\t // Text this number\n\t\tfrom: '+19546136096' // My personal Twilio number\n\t}, function(err, message) {\n\tif (err) {\n\t\tconsole.log(err);\n\t} else {\n\t\tconsole.log(message...
[ "0.7213952", "0.6821429", "0.68147516", "0.67661256", "0.6718578", "0.6680262", "0.65240604", "0.64723504", "0.6455504", "0.64110583", "0.6362714", "0.62938255", "0.62641555", "0.62375027", "0.61891437", "0.6174225", "0.61734915", "0.61632", "0.614525", "0.61124486", "0.61056...
0.7556545
0
Return a list of login of login's followers that followed login
async function getReFollower(login) { const authObj = { headers: { Authorization: "token 7f6831a6cf06cfcb4fc1f436b59ffae465d04462", }, }; const followers = await fetch( `https://api.github.com/users/${login}/followers`, authObj ) .then((res) => (result = res.json())) .catch((err) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getFollowings() {\n console.log('Getting users which are followed by you')\n let hash = 'd04b0a864b4b54837c0d870b0e77e076'\n let body = await rp.get({\n url: 'https://www.instagram.com/graphql/query/',\n headers: {\n 'cookie': `sessionid=${sessionId};`\n },\n...
[ "0.721915", "0.69913834", "0.6908917", "0.6866565", "0.683597", "0.6724184", "0.66738147", "0.66610867", "0.6657678", "0.6575679", "0.65378904", "0.6518083", "0.6434543", "0.6400276", "0.6389323", "0.6379696", "0.63697386", "0.63139313", "0.63125324", "0.62968916", "0.6292049...
0.70983994
1
saves the changes of travel into db
editTravel() { const { departureCity, destinationCity, dateArray, price, content, travel } = this.state; if (departureCity !== "") { firebase.database().ref('travels/' + travel.key + '/fromCity').set(departureCity); } if (destinationCity !== "") { firebase.database().ref('travels/'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSave() {\n console.log('in handleSave');\n const updatedList = {\n id: trip.id,\n location: title,\n start_date: date,\n days: days,\n }\n console.log('Updated trip info:', updatedList);\n //update list to reflect changes...
[ "0.6608211", "0.63170815", "0.62840927", "0.61403245", "0.6120087", "0.61139536", "0.61039346", "0.60719246", "0.6070853", "0.6060557", "0.60521024", "0.6030383", "0.59756184", "0.59532124", "0.593899", "0.5931858", "0.58996564", "0.58917874", "0.5887421", "0.5848805", "0.583...
0.6636446
0
Converts calendar event into spreadsheet data row
function calEventToSheet(calEvent, idxMap, dataRow) { convertedEvent = convertCalEvent(calEvent); for (var idx = 0; idx < idxMap.length; idx++) { if (idxMap[idx] !== null) { dataRow[idx] = convertedEvent[idxMap[idx]]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eventToSheetRow_(event, infoCol, sheetIdx) {\n\n let sheetRow = [];\n\n // Find the index that we need to use to set the Title and EventID.\n let splitedTitle = event.title.split(\" - \");\n if (splitedTitle.length > 2) {\n splitedTitle[1] = splitedTitle.slice(1).join(' - ')\n }\n let idx = heade...
[ "0.7671279", "0.6740315", "0.6627874", "0.65362966", "0.63108635", "0.62616384", "0.6061736", "0.59963673", "0.5961496", "0.5960733", "0.5922945", "0.58846956", "0.5868046", "0.5776298", "0.5741483", "0.573851", "0.5725914", "0.57247114", "0.5718296", "0.5684548", "0.5682538"...
0.69604105
1
find referLink (ed) items
function myFindLink(list, referLink) { return _.find(list, function(obj) { return obj.referLink == referLink }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "refersTo() {\n //calculate links\n this.compute('coreference')\n // return them\n return this.map(m => {\n if (!m.found) {\n return m.none()\n }\n let term = m.docs[0][0]\n if (term.reference) {\n return m.update([term.reference])\n }\n ...
[ "0.6553494", "0.62024003", "0.6189308", "0.59743834", "0.5892185", "0.5868899", "0.58681387", "0.58516115", "0.58516115", "0.58504", "0.5828407", "0.57851845", "0.57785106", "0.5718252", "0.5692131", "0.567905", "0.5664373", "0.56459266", "0.5629191", "0.5628907", "0.5599273"...
0.6568095
0
init inithttpDevice item hostVerb
function inithttpDevice(item) { device = myFindId(httpDevices, item.hostName); item.hostAddress = device.hostAddress; item.hostVerb = device.hostVerb; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n\t\tthis.replaceData(\n\t\t\tthis.manager.get(\"hostReq\"),\n\t\t\tthis.endpoints.check,\n\t\t\tthis.data.check\n\t\t);\n\t}", "init() {\n this.router.post('/generate', (request, response, next) => {\n this.generateKeys(request, response, next);\n });\n this.router.get('...
[ "0.5789745", "0.56856245", "0.5551139", "0.55480987", "0.5417284", "0.54063183", "0.5384609", "0.5333609", "0.5330874", "0.5277382", "0.52519786", "0.5229805", "0.5175908", "0.5175191", "0.5145741", "0.5121028", "0.51115", "0.5107719", "0.5091669", "0.50683707", "0.505081", ...
0.80764127
0
Load FrontendStats XML file and return the object
function loadFrontendStats() { var request = new XMLHttpRequest(); request.open("GET", "frontend_status.xml",false); request.send(null); var frontendStats=request.responseXML.firstChild; return frontendStats; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async load (filename) {\n const xml = await fs.readFile(filename, { encoding: \"utf8\" })\n this.options.log(2, `loading XML file ${chalk.blue(filename)}: ${xml.length} bytes`)\n const dom = slimdomSAX.sync(xml, { position: false })\n let m\n if ((m = xml.match(/^(<\\?xml.+?\\?>\...
[ "0.5610529", "0.5592601", "0.5405139", "0.5383385", "0.53464377", "0.5208913", "0.51746583", "0.51064533", "0.5094171", "0.5091915", "0.50904804", "0.50899655", "0.50592023", "0.5056485", "0.50076157", "0.49414057", "0.49197558", "0.4915998", "0.4908253", "0.4905471", "0.4873...
0.78363496
0
Extract group names from a frontendStats XML object
function getFrontendGroups(frontendStats) { groups=new Array(); for (var elc=0; elc<frontendStats.childNodes.length; elc++) { var el=frontendStats.childNodes[elc]; if ((el.nodeType==1) && (el.nodeName=="groups")) { for (var etc=0; etc<el.childNodes.length; etc++) { var group=el.childNodes[etc]; if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFrontendGroupFoS(frontendStats, group_name, fos_tag_top, fos_tag_one) {\n factories=new Array();\n\n if(group_name==\"total\") {\n for (var i=0; i<frontendStats.childNodes.length; i++) {\n var el=frontendStats.childNodes[i];\n if ((el.nodeType==1) && (el.nodeName==fos_tag_top)) {\n ...
[ "0.6833173", "0.5912836", "0.5732324", "0.52644944", "0.5240366", "0.51742685", "0.5156219", "0.5141777", "0.5102823", "0.5090094", "0.5078292", "0.50411075", "0.50128293", "0.49910867", "0.49773026", "0.4968912", "0.49664393", "0.49269652", "0.49252236", "0.49136722", "0.491...
0.75209045
0