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 |
|---|---|---|---|---|---|---|
Return a CRUD instruction that updates the scalar fields of an instance of the specified `type` in the database, or return `undefined` if `type` does not have any updatable fields. Use the specified `legend` to map message fields to table columns. | function instructionUpdateMessage({type, legend}) {
const {scalarFieldSources} = byMultiplicity(legend.fieldSources);
const keyColumnName = scalarFieldSources
.find(({fieldName}) => fieldName === type.idFieldName)
.columnName;
const fieldTypes = Object.fromEntries(
type.fields.map(({... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function instructionsUpdateMessage({type, legend}) {\n // \"Update\" is interesting because it takes field inclusion into account\n // (i.e. when somebody does an update, they can specify some subset of\n // message fields to be updated, rather than all of them).\n const {arrayFieldSources} = byMultipl... | [
"0.59834427",
"0.5636925",
"0.55522",
"0.55335045",
"0.5373769",
"0.5207028",
"0.5172922",
"0.51702434",
"0.51328665",
"0.51025605",
"0.50913787",
"0.5016247",
"0.49833557",
"0.49762353",
"0.49359715",
"0.48897025",
"0.4879964",
"0.48639268",
"0.48464918",
"0.4832366",
"0.479... | 0.71695286 | 0 |
Deal the specified `fieldSources` array into two arrays: one for scalar fields, and the other for arraylike fields. An arraylike field is either an array or a FieldMask. | function byMultiplicity(fieldSources) {
// We can distinguish scalar fields (e.g. int32, string) from array fields
// (e.g. repeated int32) by the presence of a "tableName" property in the
// corresponding element of the type's legend's `.fieldSources`. Values of
// array fields are stored in dedicated ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"parseFields(fields) {\n const formattedFields = [];\n fields.forEach(field => {\n const clonedField = Object.assign({}, field);\n if(clonedField.type == 'reference') {\n clonedField.type = 'url';\n }\n formattedFields.push(clonedField);\n ... | [
"0.5242899",
"0.504838",
"0.50414735",
"0.49917012",
"0.49672744",
"0.49250647",
"0.489872",
"0.48406032",
"0.47746354",
"0.4765",
"0.47635964",
"0.47513306",
"0.47513306",
"0.47513306",
"0.47513306",
"0.47312158",
"0.47237203",
"0.47179636",
"0.4624938",
"0.4612852",
"0.4609... | 0.64174986 | 0 |
_____ _ / ____| | | | | _ __ ___ __ _| |_ ___ | | | '__/ _ \/ _` | __/ _ \ | |____| | | __/ (_| | || __/ \_____|_| \___|\__,_|\__\___| Return an array of CRUD instructions that add a new instance of the specified `type` to the database. Use the specified `legend` to map message fields to table columns. | function instructionsCreateMessage({type, legend}) {
const {
scalarFieldSources,
arrayFieldSources
} = byMultiplicity(legend.fieldSources);
const fieldTypes = Object.fromEntries(
type.fields.map(({name, type}) => [name, type]));
const scalarFieldInfos = scalarFieldSources
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_instance(id, type) {\n return included_types(type)\n .then(function(inc_types) {\n var types = [{id:t.id, connect:\"insert\"} for each (t in inc_types)];\n types.push({id:type, connect:\"insert\"});\n var q = {\n id: id,\n type: types\n };\n return freebase.m... | [
"0.594629",
"0.57791495",
"0.57336724",
"0.5628151",
"0.54488134",
"0.5441905",
"0.54318166",
"0.54255223",
"0.5417001",
"0.53860945",
"0.5353441",
"0.53457004",
"0.52948666",
"0.5290201",
"0.52697676",
"0.5211307",
"0.5175948",
"0.5163848",
"0.51325184",
"0.51243776",
"0.511... | 0.7261938 | 0 |
_____ _ | __ \ | | | |__) |___ __ _ __| | | _ // _ \/ _` |/ _` | | | \ \ __/ (_| | (_| | |_| \_\___|\__,_|\__,_| Return an array of CRUD instructions that read an instance of the specified message `type` from the database. Use the specified `legend` to map message fields to table columns. | function instructionsReadMessage({type, legend}) {
const {
scalarFieldSources,
arrayFieldSources
} = byMultiplicity(legend.fieldSources);
const fieldTypes = Object.fromEntries(
type.fields.map(({name, type}) => [name, type]));
return [
// Query the message table.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function instructionsCreateMessage({type, legend}) {\n const {\n scalarFieldSources,\n arrayFieldSources\n } = byMultiplicity(legend.fieldSources);\n\n const fieldTypes = Object.fromEntries(\n type.fields.map(({name, type}) => [name, type]));\n const scalarFieldInfos = scalarFieldS... | [
"0.689043",
"0.65871274",
"0.630846",
"0.6141926",
"0.5845291",
"0.57753855",
"0.5541527",
"0.4897875",
"0.48232165",
"0.47788176",
"0.470014",
"0.46987253",
"0.46744958",
"0.46731538",
"0.46459332",
"0.45809004",
"0.45719448",
"0.4549864",
"0.45375243",
"0.45291758",
"0.4528... | 0.75355905 | 0 |
_ _ _ _ | | | | | | | | | | | |_ __ __| | __ _| |_ ___ | | | | '_ \ / _` |/ _` | __/ _ \ | |__| | |_) | (_| | (_| | || __/ \____/| .__/ \__,_|\__,_|\__\___| | | |_| Return an array of CRUD instructions that update an instance of the specified message `type` in the database. Use the specified `legend` to map message fie... | function instructionsUpdateMessage({type, legend}) {
// "Update" is interesting because it takes field inclusion into account
// (i.e. when somebody does an update, they can specify some subset of
// message fields to be updated, rather than all of them).
const {arrayFieldSources} = byMultiplicity(legen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function instructionUpdateMessage({type, legend}) {\n const {scalarFieldSources} = byMultiplicity(legend.fieldSources);\n const keyColumnName = scalarFieldSources\n .find(({fieldName}) => fieldName === type.idFieldName)\n .columnName;\n const fieldTypes = Object.fromEntries(\n type.fi... | [
"0.7028955",
"0.6800658",
"0.6562237",
"0.60329306",
"0.5759873",
"0.56896865",
"0.56436217",
"0.5429943",
"0.5403087",
"0.5306236",
"0.5246012",
"0.5004558",
"0.5003143",
"0.49828884",
"0.49359795",
"0.4927753",
"0.491293",
"0.48831305",
"0.48314717",
"0.48275357",
"0.481462... | 0.7089657 | 0 |
_____ _ _ | __ \ | | | | | | | | ___| | ___| |_ ___ | | | |/ _ \ |/ _ \ __/ _ \ | |__| | __/ | __/ || __/ |_____/ \___|_|\___|\__\___| Return an array of CRUD instructions that delete an instance of the specified message `type` from the database. Use the specified `legend` to map message fields to table columns. | function instructionsDeleteMessage({type, legend}) {
const {
scalarFieldSources,
arrayFieldSources
} = byMultiplicity(legend.fieldSources);
const keyColumnName = scalarFieldSources
.find(({fieldName}) => fieldName === type.idFieldName)
.columnName;
const fieldTypes = Obj... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function instructionsCreateMessage({type, legend}) {\n const {\n scalarFieldSources,\n arrayFieldSources\n } = byMultiplicity(legend.fieldSources);\n\n const fieldTypes = Object.fromEntries(\n type.fields.map(({name, type}) => [name, type]));\n const scalarFieldInfos = scalarFieldS... | [
"0.65178835",
"0.60378605",
"0.56935114",
"0.5659532",
"0.5565526",
"0.5441393",
"0.54277277",
"0.54159766",
"0.5392184",
"0.53682697",
"0.532061",
"0.53098565",
"0.52777135",
"0.5277001",
"0.52147466",
"0.5193115",
"0.5189474",
"0.5184577",
"0.51526743",
"0.5144624",
"0.5125... | 0.83693194 | 0 |
__ ___ _ _ _ _ _ _ _ ___ \ \ / / | | | ( ) | | | | | | | | |__ \ \ \ /\ / /| |__ __ _| |_|/ ___ | |_| |__ __ _| |_ ___ _ __ ___| | | ) | \ \/ \/ / | '_ \ / _` | __| / __| | __| '_ \ / _` | __| / __| '_ \ / _ \ | | / / \ /\ / | | | | (_| | |_ \__ \ | |_| | | | (_| | |_ \__ \ |_) | __/ | ||_| \/ \/ |_| |_|\__,_|\__| |___... | function types2crud(types) {
// Verify that `types` has the expected shape.
tisch.compileFunction(({Any, etc}) => ({
// Each property is the name of the type it describes.
[Any]: {
'type': schemas.type, // either a message or an enum
'legend?': schemas.legend // present i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function admin_api (r) {\n let keys = Object.keys(models)\n let i = keys.length\n let model, name, action;\n while (i--) {\n model = models[keys[i]]\n name = model.modelName\n action = actions(model)\n\n if (name==='user') {\n r.post(`/admin/${name}`, bSigned, bAdmin, action.create)\n r.g... | [
"0.5569461",
"0.5294318",
"0.51890373",
"0.5135004",
"0.51094407",
"0.50038457",
"0.49962515",
"0.49380398",
"0.49338868",
"0.4902698",
"0.48522457",
"0.48443443",
"0.48408437",
"0.48301983",
"0.47659197",
"0.47481936",
"0.47412762",
"0.47349527",
"0.47076872",
"0.4705308",
"... | 0.61477536 | 0 |
8. Write a function called `greet` that takes a single parameter and returns a string that is formated like "Hello, Name!" where Name is the parameter that was passed in. A: | function greet(name) {
return "Hello," + " " + name + "!"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function greet(name){\n return (\"Hello, \" + name +\"!\");\n}",
"function greet(name, age) {\n return \"Hello \" + name + \"Your \" + age + \" Years Old\";\n}",
"function greet(name) {\n return \"Hello, \" + name + \"!\";\n}",
"function greet(name) {\n return \"Hello, \" + name +\"!\";\n}",
"functio... | [
"0.84592724",
"0.84037524",
"0.83640236",
"0.83403",
"0.83269227",
"0.8245307",
"0.8226269",
"0.8197403",
"0.81912",
"0.81700057",
"0.81700057",
"0.81569374",
"0.81197923",
"0.8113469",
"0.81091857",
"0.8097357",
"0.8093937",
"0.80688965",
"0.8067031",
"0.80596316",
"0.805291... | 0.8426685 | 1 |
Mutation setData que recebe dados por parametro e os atribui ao state | setData(state, data) {
state.data = data
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setData(data) {\n this.data = data;\n }",
"set data(data) {\n this.set_data(data);\n }",
"setData(data) {\n this.data = data;\n }",
"setData(data) {\n this.data = data;\n }",
"function setData(data){\n\tdata && K.mix(stored_data, data);\n}",
"setData(data) {\n this.__da... | [
"0.6684098",
"0.6661165",
"0.6555261",
"0.6555261",
"0.64686507",
"0.6461848",
"0.6450279",
"0.6362682",
"0.62511975",
"0.6210726",
"0.61815816",
"0.61173326",
"0.6040393",
"0.5970483",
"0.59552574",
"0.5887583",
"0.5886225",
"0.58714694",
"0.5825905",
"0.5820166",
"0.5818676... | 0.7204444 | 0 |
alternatively, navMenu.setAttribute('inert', ''); ====== function to add class on nav menu, so it slides and removing invert on nav when visible, adding inert when not visible ====== | function menuSlide(){
$('.nav-menu').toggleClass('nav-menu-is-showing');
if($('.nav-menu').hasClass('nav-menu-is-showing')) {
navMenu.inert = false;
}
else {
navMenu.inert = true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function navMenuControl () { \n const navButton = document.getElementById('navButton');\n const navMenu = document.getElementById('navMenu');\n\n navButton.onclick = () => { \n if (navMenu.className.indexOf('header_nav-menu--hidden') > -1) {\n navMenu.classList.add(\"header_nav-menu--shown\");\n na... | [
"0.678855",
"0.6726718",
"0.6656077",
"0.664755",
"0.66292214",
"0.65729797",
"0.65032744",
"0.6489904",
"0.6485339",
"0.64686173",
"0.64163977",
"0.6397871",
"0.6394576",
"0.63799435",
"0.63718134",
"0.6362838",
"0.6362225",
"0.6357675",
"0.6347242",
"0.6328168",
"0.6327002"... | 0.7134467 | 0 |
dispatch shipment to P44 | function dispatchShipment(){
var recId = nlapiGetRecordId();
//generate Base64 credential key
var creds = 'andy.reeder@priority-logistics.com:Leftfoot5510!';
var enCreds = nlapiEncrypt(creds, 'base64');
//p44 endPoint URL for Rating
var url = 'https://test.p-44.com/api/v3/shipments';
//setting request headers
v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function process()\r\n{ \r\n\tvar payloadRecord = '';\r\n\r\n\t\r\n\ttry\r\n\t{\r\n\t\tgetRequiredData();\r\n\t\t\r\n\t\t//if shipping status is 'packed'\r\n\t\tif(status == 'B')\r\n\t\t{\r\n\t\t\tSOAPTemplate = getAndCreateSOAPMessageTemplate('createAndAllocateConsignments');\r\n\r\n\t\t\tnlapiLogExecution('debug... | [
"0.59023315",
"0.5738163",
"0.5731558",
"0.56549996",
"0.55300164",
"0.55140966",
"0.5476221",
"0.5455019",
"0.54402894",
"0.543325",
"0.5425321",
"0.5422724",
"0.54033697",
"0.53527045",
"0.5327833",
"0.53121597",
"0.5307143",
"0.5301008",
"0.53007233",
"0.5298601",
"0.52929... | 0.73945403 | 0 |
the getCerasisRates function gets the xml envelop, parses, and writes the RatePass records | function getCerasisRates(batId){
var recId = nlapiGetRecordId();
//var batId = Date.now();
var btEnt = '119';
var scacCodes = new Array();
var carriername = new Array();
var shipRate = new Array();
var transDays = new Array();
var lolnew = new Array();
var lolused = new Array();
var guarprice = new Array();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillXmlRatesArr( data ) {\n\n\t\t\t\t$(data).find('RATE').each(function(i, v){\n\n\t\t\t\t\tlet xmlText \t= new XMLSerializer().serializeToString(v),\n\t\t\t\t\t\tparser \t\t= new DOMParser(), \n\t\t\t\t\t\txmlDoc \t\t= parser.parseFromString( xmlText,\"text/xml\"),\n\t\t\t\t\t\tflagOrig \t= xmlDoc.getEle... | [
"0.65094066",
"0.5845692",
"0.5577324",
"0.5510111",
"0.5205097",
"0.51335293",
"0.51055855",
"0.5011145",
"0.49268293",
"0.4857063",
"0.48569077",
"0.4782694",
"0.477869",
"0.4718423",
"0.46740225",
"0.46703428",
"0.46310934",
"0.46274835",
"0.46130005",
"0.46087775",
"0.460... | 0.71560484 | 0 |
Function: drawTile Draws an individual tile. Paramaters: i I iterator of array j J iterator of array x X coordinate (07) of tile y Y coordiante (07) of tile piece ID of piece | function drawTile(i,j,x,y,piece) {
drawBGTile(i,j,x,y);
drawPiece(i,j,x,y,piece);
drawFGTile(i,j,x,y,piece);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawTile(i, j) {\n var tileType = arena[i][j];\n var x = i * 35;\n var y = j * 35;\n if (tileType == 0) {\n context.fillStyle = \"black\";\n context.fillRect(x, y, 35, 35);\n }\n if (tileType == 1) {\n context.fillStyle = \"blue\";... | [
"0.7290915",
"0.72728646",
"0.7034876",
"0.6866839",
"0.6836736",
"0.6823003",
"0.6787158",
"0.67665726",
"0.6695363",
"0.6632646",
"0.6632394",
"0.6613095",
"0.64981514",
"0.6491641",
"0.6466358",
"0.6450671",
"0.64448035",
"0.6439171",
"0.6431648",
"0.64057666",
"0.639251",... | 0.7798345 | 0 |
Function: drawBGTile Draws background tiles. Paramaters: i i iterator of array j j iterator of array x X coordinate (07) of tile y Y coordinate (07) of tile | function drawBGTile(i,j,x,y) {
var bgcolor;
if (j%2 == 0) {
if (i%2 == 0) {
bgcolor = '#BFBFBF';
} else {
bgcolor = '#FFFFFF';
}
} else {
if (i%2 == 0) {
bgcolor = '#FFFFFF';
} else {
bgcolor = '#BFBFBF'
}
} var id = String(i) + String(j);
var newRect = new Kinetic.Rect({
width: tileSize,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decorateBG() {\n\tdrawTile(bgs[0], 16, canvas.height - 64, 0);\n\tdrawTile(bgs[1], (240 - 10) * 16, 17 * 16, 0);\n}",
"function drawBackground(canvasContext) {\n\n // The width and height of a chess tile are captured here. \n let width = 50;\n let height = 50;\n\n let isWhiteTile = false;\n\... | [
"0.7218886",
"0.7188822",
"0.71861887",
"0.70819956",
"0.6851073",
"0.6807803",
"0.6759401",
"0.6755682",
"0.6729909",
"0.67155457",
"0.66984695",
"0.65290564",
"0.6448796",
"0.6434587",
"0.642396",
"0.6395365",
"0.6382859",
"0.6354113",
"0.6323276",
"0.6274893",
"0.62633234"... | 0.77299213 | 0 |
Function: drawPiece Draws pieces. Paramaters: i I iterator of array j J iterator of array x X coordinate (07) of tile y Y coordinate (07) of tile piece ID of piece (color(b,w), piece ID(r,h,k,p,b,q)) | function drawPiece(i,j,x,y,piece) {
var newImg;
var pieceSet;
switch (piece.charAt(0)) {
case 'b':
pieceSet = pieces.black;
break;
case 'w':
pieceSet = pieces.white;
break;
}
switch(piece.charAt(1)) {
case 'b':
newImg = pieceSet.bishop;
break;
case 'h':
newImg = pieceSet.knight;
bre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawPieces() {\n //var parsedChessboard = JSON.parse(chessboard);\n for (var key in chessboard) {\n // get information about position\n var column = key.charAt(0); //0\n var row = key.charAt(1); //0\n var pieceName = chessboard[key];\n if (pieceName !== null && ... | [
"0.72823334",
"0.70606583",
"0.69137824",
"0.690134",
"0.68217355",
"0.6815587",
"0.66818994",
"0.6628594",
"0.6547005",
"0.6429391",
"0.63853693",
"0.6338468",
"0.6336427",
"0.62784183",
"0.62471193",
"0.62183195",
"0.61428875",
"0.6127991",
"0.61069494",
"0.61063796",
"0.61... | 0.7557458 | 0 |
Function: drawFGTile Draws foreground tiles. Paramaters: i I iterator of array j J iterator of array x X coordinate (07) of tile y Y coordinate (07) of tile piece ID of piece (color(b,w), piece ID(r,h,k,p,b,q)) | function drawFGTile(i,j,x,y,piece) {
var newRect = new Kinetic.Rect({
width:tileSize,
height: tileSize,
x:x,
y:y,
strokeWidth:1,
stroke: 'black',
id: String(i) + String(j)
});
newRect.highlighted = false;
newRect.i = i;
newRect.j = j;
newRect.piece = piece;
newRect.on('click', function() {
move(t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawTile(i,j,x,y,piece) {\n\tdrawBGTile(i,j,x,y);\n\tdrawPiece(i,j,x,y,piece);\n\tdrawFGTile(i,j,x,y,piece);\n}",
"function drawBGTile(i,j,x,y) {\n\tvar bgcolor;\n\tif (j%2 == 0) {\n\t\tif (i%2 == 0) {\n\t\t\tbgcolor = '#BFBFBF';\n\t\t} else {\n\t\t\tbgcolor = '#FFFFFF';\n\t\t}\n\t} else {\n\t\tif (i%2 ... | [
"0.7075157",
"0.6792303",
"0.66355217",
"0.64873123",
"0.64546824",
"0.6447053",
"0.6413721",
"0.61076516",
"0.61058277",
"0.60918367",
"0.60525507",
"0.60153204",
"0.60133785",
"0.5997245",
"0.59873843",
"0.5955251",
"0.5923276",
"0.5915698",
"0.59134364",
"0.59057224",
"0.5... | 0.6876597 | 1 |
Function: clearBoard Clears all the layers so that the board can be redrawn | function clearBoard() {
bgTileLayer.removeChildren();
pieceLayer.removeChildren();
fgTileLayer.removeChildren();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearBoard() {\n context.clearRect(0, 0, width, height);\n drawGrid();\n}",
"function clear() {\n board.clear();\n log.clearLog();\n}",
"clearBoard(){\r\n\t\tthis.board.forEach( elem =>\r\n\t\t\telem.forEach( e => e.setColor('Empty') ));\r\n\t}",
"function clearBoard() {\n // Set each BitBoar... | [
"0.8199622",
"0.7980477",
"0.7958504",
"0.7799235",
"0.7772626",
"0.7638121",
"0.75887924",
"0.7575804",
"0.75330764",
"0.7501163",
"0.74748456",
"0.7471205",
"0.7459685",
"0.74399483",
"0.7428442",
"0.74001306",
"0.7389991",
"0.73463005",
"0.7302291",
"0.7299678",
"0.7284458... | 0.8624832 | 0 |
Function: move Handles the moving of pieces. Paramaters: i I iterator of array j J iterator of array piece ID of piece (color(b,w), piece ID(r,h,k,p,b,q)) | function move(i,j,piece) {
i = Number(i);
j = Number(j);
console.log(i,j,piece);
if ((piece.charAt(0) == 'b' && isWhite || piece.charAt(0) == 'w' && !isWhite) && !lookupTile(2,i,j).highlighted) {
return;
} else if (lookupTile(2,i,j).highlighted) {
handleSpecialMoveCheck(lookupTile(2,currSelectedPiece.i,currSel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveOpponentsPiece(move) {\n\n var $opponentPiece;\n\n move.from.x = Math.abs(move.from.x - 7);\n move.from.y = Math.abs(move.from.y - 7);\n move.to.x = Math.abs(move.to.x - 7);\n move.to.y = Math.abs(move.to.y - 7);\n\n\n if (move.color == black) {\n var $opponentsPieces = $('div.piece.dark').ea... | [
"0.6671265",
"0.666996",
"0.6381578",
"0.63040304",
"0.63012433",
"0.6253205",
"0.62307835",
"0.6205845",
"0.61779666",
"0.61463785",
"0.61306876",
"0.6107265",
"0.6077966",
"0.60269135",
"0.6023904",
"0.5991907",
"0.59886765",
"0.5985614",
"0.59436315",
"0.594013",
"0.592354... | 0.73118126 | 0 |
Function: handleSpecialMoveCheck Checks for various special moves to enable things like castling. Called by . Global vars: | function handleSpecialMoveCheck(tile,i,j) {
if (isWhite) {
if (tile.piece.charAt(1) == 'k')
kingMoved = true;
if (tile.piece.charAt(1) == 'r' && i == 0 && j == 0)
rook1Moved = true;
if (tile.piece.charAt(1) == 'r' && i == 7 && j == 0)
rook2Moved = true;
} else {
if (tile.piece.charAt(1) == 'k')
ki... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkStillInCheck(move) {\r\n\t//sets inCheck to default value of true\r\n\tlet inCheck = true;\r\n\r\n\t//creates an empty array to hold the possible moves\r\n\tlet possibleMoves = [];\r\n\r\n\t//sets the default value fo the kings x,y to -1\r\n\tlet kingX = -1;\r\n\tlet kingY = -1;\r\n\r\n\t//it then st... | [
"0.6947664",
"0.67476106",
"0.65015036",
"0.6485867",
"0.63507146",
"0.63060594",
"0.6305634",
"0.6244769",
"0.62387735",
"0.6230977",
"0.6229583",
"0.6214886",
"0.6163797",
"0.6160861",
"0.613933",
"0.61307806",
"0.6094464",
"0.60898703",
"0.6041129",
"0.60203975",
"0.600416... | 0.75888526 | 0 |
Function: highlightBishop Highlights squares for bishop movement. Paramaters: i I iterator of array j J iterator of array | function highlightBishop(i,j) {
var enemyToken;
if (isWhite)
enemyToken = 'b';
else
enemyToken = 'w';
helper(i,j,1,1);
helper(i,j,-1,-1);
helper(i,j,-1,1);
helper(i,j,1,-1);
/*
Function: helper
Highlights each diagonal. Used in <highlightBishop>
Paramaters:
i - I iterator of array
j - J... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function highlightRook(i,j) {\n\tvar enemyToken;\n\tif (isWhite)\n\t\tenemyToken = 'b';\n\telse\n\t\tenemyToken = 'w';\n\thelper(i,j,1,0);\n\thelper(i,j,-1,0);\n\thelper(i,j,0,1);\n\thelper(i,j,0,-1);\n\t\n\t/*\n\t\tFunction: helper\n\t\t\n\t\tHighlights each square. Used in <highlightRook>.\n\t\t\n\t\tParamaters... | [
"0.70350343",
"0.674416",
"0.64845854",
"0.63573337",
"0.6220098",
"0.6192277",
"0.5986783",
"0.59073687",
"0.5775449",
"0.57415307",
"0.5714138",
"0.5692212",
"0.5692212",
"0.5692212",
"0.5671388",
"0.56621087",
"0.56582433",
"0.56578594",
"0.5646403",
"0.5556216",
"0.550551... | 0.7764192 | 0 |
Function: highlightKing Highlights squares for king movement. Paramaters: i I iterator of array j J iterator of array | function highlightKing(i,j) {
var enemyToken;
if (isWhite)
enemyToken = 'b';
else
enemyToken = 'w';
helper(i,j,1,1);
helper(i,j,-1,-1);
helper(i,j,-1,1);
helper(i,j,1,-1);
helper(i,j,1,0);
helper(i,j,-1,0);
helper(i,j,0,1);
helper(i,j,0,-1);
castle(i,j);
/*
Function: helper
Highlights eac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function highlightKnight(i,j) {\n\thelper(i+1,j-2);\n\thelper(i-1,j-2);\n\thelper(i+1,j+2);\n\thelper(i-1,j+2);\n\thelper(i+2,j-1);\n\thelper(i+2,j+1);\n\thelper(i-2,j-1);\n\thelper(i-2,j+1);\n\t\n\t/*\n\t\tFunction: helper\n\t\t\n\t\tHighlights each square. Used in <highlightKnight>.\n\t\t\n\t\tParamaters:\n\t\t... | [
"0.78014266",
"0.739023",
"0.71867037",
"0.70256764",
"0.6732427",
"0.6608882",
"0.6602527",
"0.6492515",
"0.6418052",
"0.63142073",
"0.6307558",
"0.62484497",
"0.620937",
"0.61487186",
"0.60878426",
"0.6068558",
"0.6058246",
"0.60545313",
"0.59665895",
"0.58723223",
"0.58116... | 0.80610836 | 0 |
Function: highlightKnight Highlights squares for knight movement. Paramaters: i I iterator of array j J iterator of array | function highlightKnight(i,j) {
helper(i+1,j-2);
helper(i-1,j-2);
helper(i+1,j+2);
helper(i-1,j+2);
helper(i+2,j-1);
helper(i+2,j+1);
helper(i-2,j-1);
helper(i-2,j+1);
/*
Function: helper
Highlights each square. Used in <highlightKnight>.
Paramaters:
i - I iterator of array of square to highl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function highlightRook(i,j) {\n\tvar enemyToken;\n\tif (isWhite)\n\t\tenemyToken = 'b';\n\telse\n\t\tenemyToken = 'w';\n\thelper(i,j,1,0);\n\thelper(i,j,-1,0);\n\thelper(i,j,0,1);\n\thelper(i,j,0,-1);\n\t\n\t/*\n\t\tFunction: helper\n\t\t\n\t\tHighlights each square. Used in <highlightRook>.\n\t\t\n\t\tParamaters... | [
"0.7199345",
"0.7031468",
"0.70026773",
"0.6859545",
"0.67448306",
"0.6650344",
"0.6387192",
"0.6302721",
"0.61935353",
"0.61648375",
"0.605393",
"0.59517294",
"0.5883237",
"0.5883237",
"0.5883237",
"0.58829087",
"0.5878148",
"0.5846298",
"0.584077",
"0.58162636",
"0.58113164... | 0.840771 | 0 |
Function: highlightPawn Highlights squares for pawn movement. Paramaters: i I iterator of array j J iterator of array | function highlightPawn(i,j) {
if (isWhite) {
if (j < 7) {
if (lookupTile(2,i,j+1).piece == 'ee')
highlight(i,j+1);
if (i < 7) {
if (lookupTile(2,i+1,j+1).piece.charAt(0) == 'b')
highlight(i+1,j+1);
}
if (i > 0) {
if (lookupTile(2,i-1,j+1).piece.charAt(0) == 'b')
highlight(i-1,j+1);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function highlightKnight(i,j) {\n\thelper(i+1,j-2);\n\thelper(i-1,j-2);\n\thelper(i+1,j+2);\n\thelper(i-1,j+2);\n\thelper(i+2,j-1);\n\thelper(i+2,j+1);\n\thelper(i-2,j-1);\n\thelper(i-2,j+1);\n\t\n\t/*\n\t\tFunction: helper\n\t\t\n\t\tHighlights each square. Used in <highlightKnight>.\n\t\t\n\t\tParamaters:\n\t\t... | [
"0.7645677",
"0.7386965",
"0.6797368",
"0.6729233",
"0.6603219",
"0.6585474",
"0.6523751",
"0.6465745",
"0.63757575",
"0.63350385",
"0.622704",
"0.6188032",
"0.61617726",
"0.61511344",
"0.61237204",
"0.6120924",
"0.60975116",
"0.60975116",
"0.60975116",
"0.6082915",
"0.604422... | 0.7768456 | 0 |
Function: highlightQueen Highlights squares for queen movement. Paramaters: i I iterator of array j J iterator of array | function highlightQueen(i,j) {
var enemyToken;
if (isWhite)
enemyToken = 'b';
else
enemyToken = 'w';
helper(i,j,1,1);
helper(i,j,-1,-1);
helper(i,j,-1,1);
helper(i,j,1,-1);
helper(i,j,1,0);
helper(i,j,-1,0);
helper(i,j,0,1);
helper(i,j,0,-1);
/*
Function: helper
Highlights each square. Used in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function highlightRook(i,j) {\n\tvar enemyToken;\n\tif (isWhite)\n\t\tenemyToken = 'b';\n\telse\n\t\tenemyToken = 'w';\n\thelper(i,j,1,0);\n\thelper(i,j,-1,0);\n\thelper(i,j,0,1);\n\thelper(i,j,0,-1);\n\t\n\t/*\n\t\tFunction: helper\n\t\t\n\t\tHighlights each square. Used in <highlightRook>.\n\t\t\n\t\tParamaters... | [
"0.72874016",
"0.7221902",
"0.71055645",
"0.7052",
"0.6872126",
"0.6458897",
"0.6303996",
"0.62638456",
"0.62238574",
"0.6217925",
"0.61617404",
"0.6156224",
"0.61204123",
"0.60524464",
"0.6028032",
"0.5975469",
"0.5965299",
"0.5965299",
"0.5965299",
"0.59324294",
"0.59300846... | 0.83212703 | 0 |
Function: highlightRook Highlights squares for rook movement. Paramaters: i I iterator of array j J iterator of array | function highlightRook(i,j) {
var enemyToken;
if (isWhite)
enemyToken = 'b';
else
enemyToken = 'w';
helper(i,j,1,0);
helper(i,j,-1,0);
helper(i,j,0,1);
helper(i,j,0,-1);
/*
Function: helper
Highlights each square. Used in <highlightRook>.
Paramaters:
i - I iterator of array
j - J iterat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function highlightKnight(i,j) {\n\thelper(i+1,j-2);\n\thelper(i-1,j-2);\n\thelper(i+1,j+2);\n\thelper(i-1,j+2);\n\thelper(i+2,j-1);\n\thelper(i+2,j+1);\n\thelper(i-2,j-1);\n\thelper(i-2,j+1);\n\t\n\t/*\n\t\tFunction: helper\n\t\t\n\t\tHighlights each square. Used in <highlightKnight>.\n\t\t\n\t\tParamaters:\n\t\t... | [
"0.72877896",
"0.68937147",
"0.6651255",
"0.65248454",
"0.6402212",
"0.63860315",
"0.6301632",
"0.6190815",
"0.61471957",
"0.6080058",
"0.6072125",
"0.6018689",
"0.5970846",
"0.58821607",
"0.58537227",
"0.58537227",
"0.58537227",
"0.58536714",
"0.5838037",
"0.57864636",
"0.57... | 0.8148029 | 0 |
Function: lookupTile Looks up & returns tile Paramaters: layer 0 for bgTileLayer, 1 for pieceLayer, 2 for fgTileLayer i I iterator of array j J iterator of array | function lookupTile(layer,i,j) {
switch(layer) {
case 0:
layer = bgTileLayer;
break;
case 1:
layer = pieceLayer;
break;
case 2:
layer = fgTileLayer;
break;
}
var id = '#' + i + j;
return layer.get(id)[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"tileAt([tileX: number, tileY: number]: Position, layer: number = 0): Tile {\n tileX = Math.floor(tileX)\n tileY = Math.floor(tileY)\n layer = Math.floor(layer)\n\n let ts = this.tiles.filter(tile =>\n tile.layer === layer &&\n tile.x === tileX &&\n tile.y === tileY)\n\n return ts.leng... | [
"0.62690866",
"0.5994224",
"0.5899247",
"0.58304536",
"0.58213526",
"0.5741115",
"0.5741115",
"0.57320815",
"0.5727121",
"0.57164854",
"0.565167",
"0.565106",
"0.5633309",
"0.56318593",
"0.5598001",
"0.5540478",
"0.5537715",
"0.54831874",
"0.5464235",
"0.54067487",
"0.540606"... | 0.8133935 | 0 |
Function: listeners Sets up all socket.io listeners Global vars: | function listeners() {
//Connection event--currently no data passed
socket.on('connect', function() {
});
//Sets colors
socket.on('color', function(data) {
if (data.color == 'white')
isWhite = true;
else
isWhite = false;
});
//Updates board from server
socket.on('update', function(data) {
board ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"eventosDeSockets() {\n this.io.on('connection', socketController);\n }",
"setupListeners() {\n\t\tthis.server.on('businessUpdate', this.updateBusiness.bind(this));\n\t\tthis.server.on('deviceUpdate', this.updateDevice.bind(this));\n\t}",
"setUpListeners () {\n this.net.on('connection', socket => {... | [
"0.7436171",
"0.7380365",
"0.7362351",
"0.732465",
"0.72074705",
"0.7202395",
"0.71423334",
"0.71381515",
"0.7055343",
"0.69566894",
"0.6909823",
"0.68767565",
"0.68347573",
"0.6828155",
"0.6808292",
"0.67813826",
"0.6754885",
"0.6733644",
"0.6686535",
"0.6686278",
"0.6657189... | 0.7777945 | 0 |
NewtonRaphson step complex number, polynomial, differential of polynomial | function newtonstep(c, pn, dpn) {
return subc(c, divc(applyp(c, pn),applyp(c, dpn)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Newton (tuples) {\n\t\t// TODO: tuples should be sorted\n\n\t\tvar modifiedTuples = {},\n\t\t\tcoefficients = [],\n\t\t\tpolynomial,\n\t\t\ti, j;\n\n\t\tfunction finiteDifferences(params, step) {\n\t\t\tif (params.ys.length === 1) {\n\t\t\t\treturn [params.ys[0]];\n\t\t\t}\n\n\t\t\tvar newDifferences = {x... | [
"0.67818403",
"0.61787975",
"0.5771625",
"0.57598686",
"0.5627889",
"0.56011605",
"0.5523344",
"0.5523344",
"0.5516333",
"0.54507625",
"0.5448241",
"0.54402924",
"0.5285715",
"0.5246827",
"0.5244785",
"0.5243845",
"0.5240663",
"0.52283114",
"0.52283114",
"0.52283114",
"0.5216... | 0.63391083 | 1 |
Checks to see if inputs are all present; override if you don't need them all present to work | validateInputs() {
for (let id in this.inputs) {
if (this.inputs[id].value === undefined) {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkInputs() {\n\t\tfor (let item in this.data) {\n\t\t\tif (this.data[item] == '') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"function isAllFilled() {\n if (isEmpty('descricao') || isEmpty('codigo') || isEmpty('categoria') || isEmpty('quantidade') || isEmpty(\n 'valor') ... | [
"0.71931344",
"0.66659194",
"0.65600204",
"0.63648796",
"0.6289948",
"0.6247064",
"0.6231627",
"0.6222867",
"0.61739725",
"0.6146631",
"0.61378074",
"0.61378074",
"0.61265546",
"0.60201883",
"0.599099",
"0.59854853",
"0.5978173",
"0.5951893",
"0.5937533",
"0.59324145",
"0.592... | 0.67943895 | 1 |
Create Triggers and start tweeting every 30 mins | function setTiming () {
// clear any existing triggers
var triggers = ScriptApp.getProjectTriggers();
for (var i = 0; i < triggers.length; i++) {
ScriptApp.deleteTrigger(triggers[i]);
}
// get the value set in the timing menu
var trigger = ScriptApp.newTrigger("generateTweet").timeBased().every... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Triggers() {}",
"function triggerReminders(){\n setAllReminders();\n setInterval(setAllReminders, 3000);\n}",
"function createDailyTrigger() {\n ScriptApp.newTrigger('main')\n .timeBased()\n .everyDays(1)\n .create();\n}",
"function startHour() { //GoogleApps script-runtime limita... | [
"0.68011224",
"0.6585621",
"0.62558436",
"0.6191022",
"0.60122305",
"0.5974794",
"0.59662443",
"0.59466374",
"0.58759284",
"0.5844551",
"0.58319414",
"0.5723197",
"0.57194555",
"0.56244063",
"0.5599654",
"0.5594997",
"0.55731833",
"0.5569913",
"0.55638057",
"0.5551189",
"0.55... | 0.6679337 | 1 |
Add testing, start tweeting, and stop tweeting options to menu in sheet | function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Bot Commands').addItem('Send a Test Tweet', 'generateTweet').addItem('Start Posting Tweets', 'setTiming').addItem('Stop Posting Tweets', 'clearTiming').addToUi();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onOpen() {\n\n SpreadsheetApp\n .getUi()\n .createMenu('Test log library')\n .addItem('Run tests' , 'test_log_gs')\n .addToUi();\n}",
"function onOpen() {\n var ui = SpreadsheetApp.getUi();\n ui.createMenu('Maestro Actions')\n .addItem('Generate Maestro Casting Notice', 'generateMaestr... | [
"0.6537893",
"0.64754707",
"0.6415041",
"0.6413201",
"0.6381377",
"0.63487506",
"0.63422966",
"0.6283146",
"0.624123",
"0.62245774",
"0.60971487",
"0.6034625",
"0.60089105",
"0.5955816",
"0.5950213",
"0.5939609",
"0.5870813",
"0.58700997",
"0.5848238",
"0.5839756",
"0.5830283... | 0.65956604 | 0 |
Get callback URL from Twitter Library for use with developer.twitter.com | function getCallback(){
Logger.log(Twitter.getCallbackUrl(projectID));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_twitter_auth_url() {\n return AppObj.config.apps.user.twitter_auth_url;\n }",
"async function getTwitterRedirectURL() {\n return httpClient.get(`${endpoint}/twitter`);\n}",
"function get_twitter_reactivate_url() {\n return AppObj.config.apps.user.twitter_reactivate_url;\n }",
"f... | [
"0.7953783",
"0.73861074",
"0.71712923",
"0.6772032",
"0.6585966",
"0.64806724",
"0.6387732",
"0.62949485",
"0.6259579",
"0.6209204",
"0.61995995",
"0.6119153",
"0.61172503",
"0.60854256",
"0.6083396",
"0.59912103",
"0.5772495",
"0.5771478",
"0.5731562",
"0.5719216",
"0.57053... | 0.8003881 | 0 |
Element Processing / Element processing consists of three parts data processing that cannot go stale and data processing that can go stale (i.e. thirdparty style modifications): 1) PreQueueing: Elementwide variables, including the element's data storage, are instantiated. Call options are prepared. If triggered, the St... | function processElement () {
/*************************
Part I: Pre-Queueing
*************************/
/***************************
Element-Wide Variables
***************************/
var element = this,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processElement () {\n\n /*************************\n Part I: Pre-Queueing\n *************************/\n\n /***************************\n Element-Wide Variables\n ***************************/\n\n var element = this,\n ... | [
"0.79219157",
"0.7626603",
"0.7626603",
"0.75956273",
"0.725717",
"0.7216083",
"0.71889216",
"0.7188061",
"0.71793556",
"0.71793556",
"0.71793556",
"0.71793556",
"0.71793556",
"0.71793556",
"0.7174132",
"0.7174132",
"0.71698093",
"0.6663418",
"0.6649773",
"0.6609739",
"0.6609... | 0.7636077 | 1 |
Separates a property value into its numeric value and its unit type. | function separateValue (property, value) {
var unitType,
numericValue;
numericValue = (value || "0")
.toString()
.toLowerCase()
/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function separateValue (property, value) {\n\t var unitType,\n\t numericValue;\n\t\n\t numericValue = (value || \"0\")\n\t .toString()\n\t .toLowerCase()\n\t ... | [
"0.86934584",
"0.86839086",
"0.86839086",
"0.8667559",
"0.5804178",
"0.56781083",
"0.5667825",
"0.5665447",
"0.55996245",
"0.5598638",
"0.55884516",
"0.55751157",
"0.55630076",
"0.55630076",
"0.55630076",
"0.55630076",
"0.55630076",
"0.55630076",
"0.55630076",
"0.55630076",
"... | 0.8685817 | 1 |
Tick / Note: All calls to Velocity are pushed to the Velocity.State.calls array, which is fully iterated through upon each tick. | function tick (timestamp) {
/* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on.
We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever
the browser's next tick sync time occurs, whic... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tick(timestamp) {\n /* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on.\n We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever\n the browser's next tick sync time occurs, which resu... | [
"0.7213978",
"0.7194792",
"0.7192244",
"0.71611357",
"0.7159162",
"0.7152031",
"0.7120714",
"0.70891833",
"0.70891833",
"0.70891833",
"0.70891833",
"0.70891833",
"0.70891833",
"0.70891833",
"0.70891833",
"0.7052827",
"0.7052827",
"0.6719113",
"0.6717726",
"0.66683054",
"0.662... | 0.72238547 | 0 |
Draw the legend showing colors for each frontier in the dataset | function makeFrontierColorLegend() {
var width = 1000,
height = 75,
boxWidth = 18;
var legSvg = d3.select("#legendHolder")
.style("background-color", "#eee")
.style("border-radius", "6px")
.append("svg")
.attr('id', "legendSVG")
.attr('viewBox', "0 0 " + ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function transferLegendColours(datasets) {\n /* we don't want to see the legend data so hide immediately, only use it to pinch the colour! */\n $('#' + legendDivId).hide();\n $.each(datasets, function(key, val) {\n /* class legendColorBox defined in jquery.flot.js in function insertLegend() */\n var thisDa... | [
"0.63929343",
"0.63466316",
"0.62622315",
"0.6193742",
"0.6176905",
"0.61750144",
"0.61750144",
"0.61750144",
"0.61750144",
"0.61750144",
"0.61750144",
"0.61750144",
"0.61750144",
"0.61750144",
"0.6166092",
"0.6166092",
"0.6166092",
"0.6166092",
"0.6166092",
"0.6166092",
"0.6... | 0.71223354 | 0 |
load all active cookies in global object | _loadCookies() {
var decookie = decodeURIComponent(document.cookie);
var cookies = decookie.split('; ')
for(var i=0; i<cookies.length; i++) {
var cnew = this._createCookie();
cnew.name = cookies[i].split('=')[0];
cnew.value = cookies[i].split('=')[1];
this.cookies[cnew.name] = cnew;
}
return this.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadCookies() {\n let cookies = document.cookie.split(\";\");\n cookies.forEach(function(element) {\n let keyCombo = element.split(\"=\");\n if (keyCombo[0].includes(\"language\")) {\n setLanguage = parseInt(keyCombo[1]);\n }\n if (keyCombo[0].includes(\"temperature_unit\")) {\n se... | [
"0.71314996",
"0.6822055",
"0.67842424",
"0.65176415",
"0.64765674",
"0.6457551",
"0.64474",
"0.6420518",
"0.631449",
"0.6245881",
"0.61738604",
"0.612148",
"0.6092135",
"0.6067101",
"0.6016493",
"0.5974111",
"0.5965433",
"0.59631854",
"0.5946726",
"0.58823085",
"0.58626693",... | 0.7016511 | 1 |
Total download speed , in bytes/sec. | downloadSpeed() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get downloadSpeed() {\n return this.__torrent.download_speed;\n }",
"function updateSpeed () {\n var progress = (100 * torrent.progress).toFixed(1)\n console.log(progress)\n // '<b>Peers:</b> ' + torrent.swarm.wires.length + ' ' +\n // '<b>Pro... | [
"0.8109711",
"0.72217387",
"0.71036553",
"0.6874182",
"0.6874182",
"0.6541892",
"0.63618714",
"0.63129",
"0.6182178",
"0.6128235",
"0.6110393",
"0.60403794",
"0.6012408",
"0.6002576",
"0.5958943",
"0.5924583",
"0.58988684",
"0.58988684",
"0.5887026",
"0.5867753",
"0.58579975"... | 0.7730333 | 1 |
Total upload speed , in bytes/sec. | uploadSpeed() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get uploadSpeed() {\n return this.__torrent.upload_speed;\n }",
"startSpeedCalc() {\n this.file.speed = 0;\n let lastUploadedBytes = 0;\n if (!this.speedInterval) {\n this.speedInterval = window.setInterval(() => {\n let uploadedBytes = (this.progress / 100) * this.fileSi... | [
"0.81536746",
"0.72302747",
"0.7021112",
"0.6968958",
"0.6938193",
"0.6938193",
"0.6931686",
"0.673215",
"0.65836704",
"0.6521544",
"0.6443977",
"0.6240874",
"0.62058854",
"0.6070204",
"0.60608554",
"0.6057706",
"0.60391945",
"0.6010947",
"0.6002052",
"0.6002052",
"0.5983575"... | 0.7469224 | 1 |
TODO: a hack to get current targets. | get targets()
{
if (this._cachePath.length <= 0) return [];
const cache = this._cachePath[this._cachePath.length - 1];
return cache.targets;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get targets() {\n return Array.from(proxySources.values());\n }",
"get allTargetName() { return this._allTargetName(); }",
"get targetsUrls() {\n return this.openurl.map(m => (`${this.lookupURL}?ip=${this.ipAddress}&url=${encodeURIComponent(m)}`));\n }",
"getTarget(targetIndex) {\n ... | [
"0.6903575",
"0.6902149",
"0.64479953",
"0.6402262",
"0.63961595",
"0.6392163",
"0.6319897",
"0.6289214",
"0.62793076",
"0.6236431",
"0.6235201",
"0.6111148",
"0.6087526",
"0.60280734",
"0.6000367",
"0.595446",
"0.5950999",
"0.59280634",
"0.5893048",
"0.5893048",
"0.5784001",... | 0.7126871 | 0 |
Modify the app's preloader to track the loading process in the Puzzles Editor. | function puzzlesEditorPreparePreloader(preloader) {
// backward compatibility for loading new projects within the old Puzzles Editor
if (v3d.PE.loadingUpdateCb !== undefined && v3d.PE.loadingFinishCb !== undefined) {
var _onUpdate = preloader.onUpdate.bind(preloader);
preloader.onUpdate = functi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onPreLoading() {}",
"function preload() {\r\n\r\n\t// Display loading animation\r\n\text.displayToggle(Loader);\r\n\r\n\t// Start load \r\n\tManager.LoadAssets();\r\n\r\n}",
"createPreloader() {\n this.preloader = new Preloader();\n }",
"preload() {\n TheFragebogen.logger.debug(this.constructor.na... | [
"0.7143213",
"0.6963715",
"0.6888727",
"0.68776536",
"0.68776536",
"0.686505",
"0.686505",
"0.686505",
"0.6741599",
"0.6657257",
"0.6559885",
"0.65272015",
"0.6515158",
"0.65036815",
"0.6470501",
"0.6466717",
"0.6466717",
"0.6466717",
"0.6466717",
"0.64437634",
"0.64437634",
... | 0.72332174 | 0 |
Arrow functions Write a function that takes in 2 numbers and returns the sum of those 2 numbers | function sum(a, b) {
let add = a + b;
return add;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sum(num1, num2) { return num1 + num2 }",
"function sum(a, b){ return a + b;}",
"function sum(num1, num2) {}",
"function sum(a, b) { return a+b;}",
"function sum(a, b) { return a+b;}",
"function sum(a,b){\n return multiply(a,b)+b\n}",
"function sum(a, b) {\n return a + b\n}",
"function su... | [
"0.74558324",
"0.74396294",
"0.7418376",
"0.7354976",
"0.7354976",
"0.7347049",
"0.73418057",
"0.7324299",
"0.7251386",
"0.72357315",
"0.7231691",
"0.7228075",
"0.7206005",
"0.7203107",
"0.71847683",
"0.7163905",
"0.7160431",
"0.7153442",
"0.71462005",
"0.71462005",
"0.714620... | 0.7474346 | 0 |
Rerender component if any of protons has been changed and update nuclear state | shouldComponentUpdate (nextProps) {
/* Find changed protons */
let nextProtons = Object.keys(nextProps.cursors)
.filter(this._isProtonChanged);
if (nextProtons.length > 0) {
nextProtons.forEach(nextProton => {
let nextProton... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"update() {\n this.components.each((c) => {\n if (c.active)\n c.update();\n });\n }",
"static update () {\n _components.forEach((component) => {\n if (component.update) {\n component.update();\n }\n });\n }",
"_forceRender(np, ns) {\n if ... | [
"0.6698757",
"0.65143454",
"0.6451361",
"0.6420613",
"0.6351275",
"0.6300522",
"0.62755346",
"0.62716204",
"0.626745",
"0.6187703",
"0.6168427",
"0.61643237",
"0.61484927",
"0.6140351",
"0.6140351",
"0.61326414",
"0.6121669",
"0.611537",
"0.6115206",
"0.6115206",
"0.60978377"... | 0.707493 | 0 |
Check if a single proton has been changed | _isProtonChanged (nextProtonName) {
let currentProton = this._nuclearState[nextProtonName],
nextProton = atom.getIn(this.props.cursors[nextProtonName]);
if (_.equals(currentProton, nextProton)) {
return false;
}
else {
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _check_if_exist_change(){\n try{\n return _is_make_changed;\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _check_if_exist_change');\n return... | [
"0.67130274",
"0.670801",
"0.6333089",
"0.6306352",
"0.6257252",
"0.6181847",
"0.61770207",
"0.6165654",
"0.6115989",
"0.6115482",
"0.61077017",
"0.60197943",
"0.6010243",
"0.5993542",
"0.5979514",
"0.59694386",
"0.5966845",
"0.5954983",
"0.59438765",
"0.5911386",
"0.5890018"... | 0.71935487 | 0 |
Helpers Sorts provided config breakpoints and uses defaults. | function processConfig(config) {
let sortedBreakpoints = {};
if (config.breakpoints) {
sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b);
}
return Object.assign({}, defaultConfig, config, sortedBreakpoints);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resolveBreakpointsFromConfig() {\r\n const sortByScreenSize = (next, prev) => {\r\n const maxNext = Math.max(this.getMinSize(next) + 1 || 0, this.getMaxSize(next) || 0);\r\n const maxPrev = Math.max(this.getMinSize(prev) + 1 || 0, this.getMaxSize(prev) || 0);\r\n return maxN... | [
"0.74590474",
"0.60734636",
"0.53443867",
"0.53252685",
"0.5304077",
"0.52893245",
"0.5286663",
"0.51315826",
"0.49652416",
"0.4908471",
"0.4857513",
"0.48432598",
"0.4836054",
"0.4833817",
"0.48245507",
"0.47970822",
"0.47675234",
"0.4757727",
"0.4757727",
"0.47573718",
"0.4... | 0.7837418 | 0 |
Assert functions Verifies that there is no `src` set on a host element. | function assertNoConflictingSrc(dir) {
if (dir.src) {
throw new RuntimeError(2950 /* RuntimeErrorCode.UNEXPECTED_SRC_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \`src\` and \`ngSrc\` have been set. ` +
`Supplying both of these attributes breaks lazy loading. ` +
`The NgOptimized... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertNoConflictingSrcset(dir) {\n if (dir.srcset) {\n throw new RuntimeError(2951 /* RuntimeErrorCode.UNEXPECTED_SRCSET_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \\`srcset\\` and \\`ngSrcset\\` have been set. ` +\n `Supplying both of these attributes breaks lazy loading. ` +\n... | [
"0.5823677",
"0.57467175",
"0.5708421",
"0.5593618",
"0.5585431",
"0.55797935",
"0.5579683",
"0.5483822",
"0.5466152",
"0.54494715",
"0.54486185",
"0.54448414",
"0.542835",
"0.5406483",
"0.5370869",
"0.53627646",
"0.53627646",
"0.5327666",
"0.53087085",
"0.5295594",
"0.525616... | 0.64971983 | 0 |
Verifies that there is no `srcset` set on a host element. | function assertNoConflictingSrcset(dir) {
if (dir.srcset) {
throw new RuntimeError(2951 /* RuntimeErrorCode.UNEXPECTED_SRCSET_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. ` +
`Supplying both of these attributes breaks lazy loading. ` +
`... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertNoNgSrcsetWithoutLoader(dir, imageLoader) {\n if (dir.ngSrcset && imageLoader === noopImageLoader) {\n console.warn(formatRuntimeError(2963 /* RuntimeErrorCode.MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \\`ngSrcset\\` attribute is present but ` +\n `no i... | [
"0.58234817",
"0.5677892",
"0.5640083",
"0.5612011",
"0.56052524",
"0.55839795",
"0.5513263",
"0.5376809",
"0.5361398",
"0.53030556",
"0.5286783",
"0.5261541",
"0.5167551",
"0.5153054",
"0.510944",
"0.5094876",
"0.50232446",
"0.50150317",
"0.50084305",
"0.50053823",
"0.500538... | 0.68679553 | 0 |
Verifies that the `ngSrc` is not a Base64encoded image. | function assertNotBase64Image(dir) {
let ngSrc = dir.ngSrc.trim();
if (ngSrc.startsWith('data:')) {
if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) {
ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + '...';
}
throw new RuntimeError(2952 /* RuntimeErrorCode.INVAL... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isBase64(str) {\n\tif (typeof str !== 'string') return false;\n\tassertTrue(str.length > 0, \"Cannot determine if empty string is base64\");\n\ttry {\n\t\treturn btoa(atob(str)) == str;\n\t} catch (err) {\n\t\treturn false;\n\t}\n}",
"function isBase64(str) {\n\tif (typeof str !== 'string') return false... | [
"0.62736934",
"0.62736934",
"0.6220121",
"0.60857195",
"0.60297215",
"0.5982007",
"0.5917326",
"0.5879804",
"0.5844386",
"0.5811356",
"0.57788074",
"0.5763443",
"0.56966627",
"0.56480443",
"0.5610574",
"0.5608048",
"0.55703646",
"0.5569702",
"0.5545406",
"0.55383056",
"0.5537... | 0.7615133 | 0 |
Verifies that the 'sizes' only includes responsive values. | function assertNoComplexSizes(dir) {
let sizes = dir.sizes;
if (sizes?.match(/((\)|,)\s|^)\d+px/)) {
throw new RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including ` +
`pixel values. For automatic \`srcset\`... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasSizes(unit) {\n return unit.sizes && unit.sizes.length;\n }",
"function responsive() {\n var widthLimit = getOptions().responsive || getOptions().responsiveWidth; //backwards compatiblity\n\n var heightLimit = getOptions().responsiveHeight; //only calculating what we need. Remember its ... | [
"0.72419894",
"0.62692153",
"0.62463146",
"0.62129194",
"0.62129194",
"0.61892307",
"0.61435",
"0.61222863",
"0.61209345",
"0.6104544",
"0.6030656",
"0.60280406",
"0.60189",
"0.6017652",
"0.6000401",
"0.5999601",
"0.5999601",
"0.5999601",
"0.5961531",
"0.59018886",
"0.5897952... | 0.65642166 | 1 |
Verifies that the `ngSrc` is not a Blob URL. | function assertNotBlobUrl(dir) {
const ngSrc = dir.ngSrc.trim();
if (ngSrc.startsWith('blob:')) {
throw new RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrc\` was set to a blob URL (${ngSrc}). ` +
`Blob URLs are not supported by the NgOptimiz... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}",
"function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}",
"function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}",
"function isBlob(va... | [
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.62902623",
"0.6198583",
"0.6093601",
"0.6069158",
"0.59976476",
"0.57781583",
"0.5774685",
... | 0.73726267 | 0 |
Verifies that the rendered image is not visually distorted. Effectively this is checking: Whether the "width" and "height" attributes reflect the actual dimensions of the image. Whether image styling is "correct" (see below for a longer explanation). | function assertNoImageDistortion(dir, img, renderer) {
const removeListenerFn = renderer.listen(img, 'load', () => {
removeListenerFn();
const computedStyle = window.getComputedStyle(img);
let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));
let renderedHeight = p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function imageDimensions(img) {\n if (img.height > img.width) {\n return false;\n } else {\n return true;\n }\n}",
"function assertNonEmptyWidthAndHeight(dir) {\n let missingAttributes = [];\n if (dir.width === undefined)\n missingAttributes.push('width');\n if (dir.height ... | [
"0.6604123",
"0.61977667",
"0.59642994",
"0.59031826",
"0.5889582",
"0.58799064",
"0.5845976",
"0.58371615",
"0.5811997",
"0.5781984",
"0.574143",
"0.5695754",
"0.5680457",
"0.5680042",
"0.56765264",
"0.5649983",
"0.5631954",
"0.56115156",
"0.5545015",
"0.55402476",
"0.549199... | 0.7068893 | 0 |
Verifies that width and height are not set. Used in fill mode, where those attributes don't make sense. | function assertEmptyWidthAndHeight(dir) {
if (dir.width || dir.height) {
throw new RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present ` +
`along with the \`fill\` attribute. Because \`fill\` mode cause... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertNonEmptyWidthAndHeight(dir) {\n let missingAttributes = [];\n if (dir.width === undefined)\n missingAttributes.push('width');\n if (dir.height === undefined)\n missingAttributes.push('height');\n if (missingAttributes.length > 0) {\n throw new RuntimeError(2954 /* Ru... | [
"0.7225891",
"0.6496825",
"0.637718",
"0.63507813",
"0.62926114",
"0.6134854",
"0.6070146",
"0.5933416",
"0.59238213",
"0.5907803",
"0.5899781",
"0.57825553",
"0.5740963",
"0.5670738",
"0.5655554",
"0.5638842",
"0.5611756",
"0.5603159",
"0.5535466",
"0.5530916",
"0.5526405",
... | 0.72569644 | 0 |
Verifies that the rendered image has a nonzero height. If the image is in fill mode, provides guidance that this can be caused by the containing element's CSS position property. | function assertNonZeroRenderedHeight(dir, img, renderer) {
const removeListenerFn = renderer.listen(img, 'load', () => {
removeListenerFn();
const renderedHeight = img.clientHeight;
if (dir.fill && renderedHeight === 0) {
console.warn(formatRuntimeError(2952 /* RuntimeErrorCode.I... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function imageLoaded(img) {\n return img.complete && (typeof img.naturalWidth === 'undefined' || img.naturalWidth !== 0);\n }",
"static imageIsLoaded(img){\n\t\tif (!(img instanceof Image)) return false;\n\t\treturn img.complete && img.naturalWidth !== 0 && img.naturalHeight !== 0;\n\t}",
"function imageLo... | [
"0.6568476",
"0.6558645",
"0.63465285",
"0.6320868",
"0.631255",
"0.6069642",
"0.58314925",
"0.58152133",
"0.5781785",
"0.5720628",
"0.5716417",
"0.56901145",
"0.5642404",
"0.56392896",
"0.5608782",
"0.55988896",
"0.5542847",
"0.54501235",
"0.5437041",
"0.5433288",
"0.5414348... | 0.7442303 | 0 |
Verifies that the `loading` attribute is set to a valid input & is not used on priority images. | function assertValidLoadingInput(dir) {
if (dir.loading && dir.priority) {
throw new RuntimeError(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` +
`was used on an image that was marked "priority". ` +
`Setting \`loading\` on ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get observedAttributes() { return ['loading']; }",
"function imgLoadChecks(e) {\n\tvar checks = {\n\t\t/** true if the src attribute exists and is not empty */\n\t\thasSrc \t\t: function () {\n\t\t\treturn e.src != '' && e.src != undefined\n\t\t},\n\t\t\n\t\t/** true if data-src is defined on the element.... | [
"0.6255429",
"0.61776865",
"0.61365324",
"0.6014617",
"0.60134006",
"0.5917486",
"0.58936584",
"0.587221",
"0.58656365",
"0.57625496",
"0.57625496",
"0.5736436",
"0.5736436",
"0.5701378",
"0.56955665",
"0.56920636",
"0.568471",
"0.56555575",
"0.5646599",
"0.56404114",
"0.5632... | 0.7830866 | 0 |
Warns if NOT using a loader (falling back to the generic loader) and the image appears to be hosted on one of the image CDNs for which we do have a builtin image loader. Suggests switching to the builtin loader. | function assertNotMissingBuiltInLoader(ngSrc, imageLoader) {
if (imageLoader === noopImageLoader) {
let builtInLoaderName = '';
for (const loader of BUILT_IN_LOADERS) {
if (loader.testUrl(ngSrc)) {
builtInLoaderName = loader.name;
break;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function monkey_patch_loader () {\n let fn = PIXI.loader.onComplete.add;\n PIXI.loader.onComplete.add = function (cb) {\n let f = function (m) {\n Object.keys(m.resources).forEach(key => {\n let source = m.resources[key].texture.baseTexture.source;\n if (source... | [
"0.63157314",
"0.62165135",
"0.62133604",
"0.6162737",
"0.6155054",
"0.61520875",
"0.61520875",
"0.61520875",
"0.61520875",
"0.61520875",
"0.61520875",
"0.61520875",
"0.61520875",
"0.61520875",
"0.61520875",
"0.61520875",
"0.61520875",
"0.6118607",
"0.6118607",
"0.6109248",
"... | 0.7258071 | 0 |
Warns if ngSrcset is present and no loader is configured (i.e. the default one is being used). | function assertNoNgSrcsetWithoutLoader(dir, imageLoader) {
if (dir.ngSrcset && imageLoader === noopImageLoader) {
console.warn(formatRuntimeError(2963 /* RuntimeErrorCode.MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but ` +
`no image loade... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assertNoConflictingSrcset(dir) {\n if (dir.srcset) {\n throw new RuntimeError(2951 /* RuntimeErrorCode.UNEXPECTED_SRCSET_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \\`srcset\\` and \\`ngSrcset\\` have been set. ` +\n `Supplying both of these attributes breaks lazy loading. ` +\n... | [
"0.63538575",
"0.59642345",
"0.5784813",
"0.5392004",
"0.514923",
"0.5009902",
"0.48764208",
"0.4857918",
"0.4848687",
"0.4740022",
"0.4703786",
"0.47027004",
"0.46896",
"0.467444",
"0.46639293",
"0.46200296",
"0.45972013",
"0.45741874",
"0.45664605",
"0.4550359",
"0.45390505... | 0.6828842 | 0 |
Warns if loaderParams is present and no loader is configured (i.e. the default one is being used). | function assertNoLoaderParamsWithoutLoader(dir, imageLoader) {
if (dir.loaderParams && imageLoader === noopImageLoader) {
console.warn(formatRuntimeError(2963 /* RuntimeErrorCode.MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \`loaderParams\` attribute is present but ` +
`no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleLoader (loader) {\n if (typeof loader === 'string') {\n return {\n loader: loader + '-loader',\n options: {\n sourceMap: options.sourceMap\n }\n }\n } else if (typeof loader === 'object' && loader.constructor === Object) {\n return loader\n }\n ... | [
"0.58521247",
"0.56266695",
"0.55097216",
"0.54599625",
"0.545227",
"0.5410386",
"0.5376427",
"0.53485924",
"0.53404063",
"0.5339886",
"0.5326232",
"0.5311263",
"0.53106636",
"0.52982825",
"0.5280878",
"0.5280878",
"0.5254599",
"0.5219509",
"0.5209493",
"0.5181049",
"0.518002... | 0.6429227 | 0 |
Transform function to handle SafeValue input for ngSrc. This doesn't do any sanitization, as that is not needed for img.src and img.srcset. This transform is purely for compatibility. | function unwrapSafeUrl(value) {
if (typeof value === 'string') {
return value;
}
return unwrapSafeValue(value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function trustSrc(src) {\n return $sce.trustAsResourceUrl(src);\n }",
"onInput(value) {\n // Use NgControl patchValue to prevent the issue on validation\n this.el.control.patchValue(value.replace(/[^0-9.]|\\.(?=.*\\.)/g, '')); // /[^0-9.]/g /[^0-9.]|\\.(?=.*\\.)/g\n }",
"function s... | [
"0.5492745",
"0.5034905",
"0.5032588",
"0.5013573",
"0.5013573",
"0.49903944",
"0.49852338",
"0.49852338",
"0.49852338",
"0.49666664",
"0.49572527",
"0.49366835",
"0.49366835",
"0.49266756",
"0.4913572",
"0.48823252",
"0.48798075",
"0.48387122",
"0.48212788",
"0.47975418",
"0... | 0.52140856 | 1 |
Had to use this janky copy pasted text3d thing because using Title, Heading3D here didn't work | render() {
return (
<div>
<Text3D><Letterwave>Lets have fun!</Letterwave></Text3D>
</div>
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create3DText(text) { return createGeometry(text,'TextGeometry'); }",
"function fnMakeText (argFontURL, argText, argX, argY, argZ) {\n var loader = new THREE.FontLoader();\n\tloader.load (\n argFontURL,\n function (response) {\n\t oGlobalFont = response;\n // Create mesh only when ready\n ... | [
"0.7285848",
"0.6731082",
"0.6688772",
"0.66871315",
"0.66817194",
"0.66028744",
"0.64118195",
"0.6282587",
"0.62436754",
"0.62160075",
"0.61861145",
"0.6185362",
"0.61382157",
"0.61361134",
"0.61079323",
"0.5961983",
"0.59476024",
"0.5926576",
"0.5867583",
"0.5854305",
"0.58... | 0.6745631 | 1 |
Handle rolling of an item from the Actor sheet, obtaining the Item instance and dispatching to it's roll method | _onItemRoll (event) {
event.preventDefault()
const itemId = event.currentTarget.closest('.item').dataset.itemId
const item = this.actor.getOwnedItem(itemId)
// Trigger the item roll
if (item.data.type === 'scroll') {
return ui.notifications.warn('Scrolls cannot be ro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onItemRoll(event) {\n event.preventDefault();\n let itemId = Number($(event.currentTarget).parents(\".item\").attr(\"data-item-id\")),\n item = this.actor.getOwnedItem(itemId);\n item.roll();\n }",
"function roll () {\n\t\t\tinstance.roll();\n\t\t}",
"function roll() {\n var roll = RollS... | [
"0.7551252",
"0.6069933",
"0.5363763",
"0.5273781",
"0.52676034",
"0.5217975",
"0.5184605",
"0.5111461",
"0.5043638",
"0.49728206",
"0.49728206",
"0.49359274",
"0.49178126",
"0.49172246",
"0.4896849",
"0.48750758",
"0.48646897",
"0.48609915",
"0.48401496",
"0.48218307",
"0.48... | 0.7996726 | 0 |
Return the execution time of the current task in Miliseconds | getExecutionTime() {
let task = this.currentTask
return Number((this.getTime() - task.enqueuedTime))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getExecutionTime() {\n if (this.scheduler.currentTask)\n return this.scheduler.currentTask.elapsedTime;\n return undefined;\n }",
"function executingAt() {\n return (performance.now() - startTime) / 1000;\n}",
"getExecutionTime() {\n const lastEvent = this.events[this.events... | [
"0.8321018",
"0.7291122",
"0.7246659",
"0.67653614",
"0.6730782",
"0.6646414",
"0.6540821",
"0.6417073",
"0.6388171",
"0.63839895",
"0.636402",
"0.6350693",
"0.6326628",
"0.63181496",
"0.62856776",
"0.6273116",
"0.6222316",
"0.61829334",
"0.6169917",
"0.6168089",
"0.61667866"... | 0.8495368 | 0 |
Helper function that determines when to update scroll offsets to ensure that a scrolltoindex remains visible. This function also ensures that the scroll ofset isn't past the last column/row of cells. | function updateScrollIndexHelper(_ref) {
var cellSize = _ref.cellSize,
cellSizeAndPositionManager = _ref.cellSizeAndPositionManager,
previousCellsCount = _ref.previousCellsCount,
previousCellSize = _ref.previousCellSize,
previousScrollToAlignment = _ref.previousScrollToAlignment,
previou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateScrollIndexHelper(_ref) {\n\t var cellSize = _ref.cellSize;\n\t var cellSizeAndPositionManager = _ref.cellSizeAndPositionManager;\n\t var previousCellsCount = _ref.previousCellsCount;\n\t var previousCellSize = _ref.previousCellSize;\n\t var previousScrollToAlignment = _ref.previousScrollToAlig... | [
"0.6243465",
"0.62295717",
"0.62289757",
"0.6159668",
"0.6108936",
"0.6108936",
"0.6108936",
"0.6108936",
"0.6108936",
"0.60131997",
"0.59770757",
"0.59514713",
"0.5920141",
"0.58937776",
"0.589298",
"0.588185",
"0.5837799",
"0.5837799",
"0.5822874",
"0.5817863",
"0.58080345"... | 0.62472034 | 1 |
:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof HTMLElement); | function isHTMLElement(node) {
var OwnElement = (0, _getWindow.default)(node).HTMLElement;
return node instanceof OwnElement || node instanceof HTMLElement;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isHTMLElement(node) {\n const OwnElement = getWindow_1.default(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}",
"function isHTMLElement(node) {\n if (!node || !node.ownerDocument) {\n return false;\n }\n\n if (!node.ownerDocument.defaultView) {\n ... | [
"0.88158834",
"0.8687304",
"0.8687304",
"0.86749595",
"0.86670744",
"0.86604303",
"0.86604303",
"0.86604303",
"0.86604303",
"0.86604303",
"0.86604303",
"0.86604303",
"0.86604303",
"0.86604303",
"0.8644943",
"0.86257917",
"0.86257917",
"0.86257917",
"0.86257917",
"0.86257917",
... | 0.8774769 | 1 |
:: declare function isShadowRoot(node: mixed): boolean %checks(node instanceof ShadowRoot); | function isShadowRoot(node) {
var OwnElement = (0, _getWindow.default)(node).ShadowRoot;
return node instanceof OwnElement || node instanceof ShadowRoot;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isShadowRoot(node) {\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}",
"function isShadowRoot(node) {\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}",
"functio... | [
"0.8679404",
"0.8679404",
"0.8679404",
"0.8591532",
"0.8591532",
"0.8591532",
"0.85863537",
"0.85863537",
"0.85863537",
"0.85863537",
"0.84275305",
"0.8261917",
"0.75999826",
"0.7321518",
"0.72874635",
"0.69515",
"0.6862761",
"0.6860925",
"0.6859185",
"0.6720384",
"0.6718859"... | 0.8689406 | 0 |
Return the URL for writing data to this table | writeURL({ table, id, attributes }) {
const formURL = buildUrl('https://script.google.com/', {
path: `macros/s/AKfycbypjmWHNvoID5K5tyodKMzbagGSA3UzHPArgvtJrcpx-LsmVaw/exec`,
queryParams: {
[self.formFields.table]: table,
[self.formFields.id]: id,
[self.formFields.attr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get_add_url(){\n return \"base/\" + this.nameSpace + \"/table/\" + this.state.tableName + \"/\";\n }",
"function save()\n {\n var url = \"?\";\n \n //add rows to URL\n var numRows = $('.row').length;\n \n $(\".row\").each(function(rowIndex)\n {\n ... | [
"0.5916499",
"0.55197936",
"0.54975504",
"0.54433566",
"0.5397235",
"0.53856194",
"0.53732765",
"0.5367646",
"0.532997",
"0.525396",
"0.5250626",
"0.52447283",
"0.52295965",
"0.5201312",
"0.5180542",
"0.5123126",
"0.5102048",
"0.5102048",
"0.50728387",
"0.5060237",
"0.500838"... | 0.63633317 | 0 |
Generate an array with random values with huge numbers | function randomGenBigNumber(size) {
return Array.from({length: size}, () => Math.floor(Math.random() * 100000000));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createNElementArray(num) {\n return Array.apply(null, { length: 100000 }).map(Function.call, Math.random);\n}",
"resultGenerator() {\n let resultArray = [];\n for (let i = 0; i <= 50; i++) {\n resultArray[i] = Math.round(Math.random() * (3500000 - 1) + 1);\n }\n r... | [
"0.7607739",
"0.75321245",
"0.74609697",
"0.7448933",
"0.74485165",
"0.7221921",
"0.7148647",
"0.7118964",
"0.71014744",
"0.7093492",
"0.7087858",
"0.7069782",
"0.69760257",
"0.69760257",
"0.69760257",
"0.69760257",
"0.69760257",
"0.69751376",
"0.6956107",
"0.6942373",
"0.693... | 0.7747922 | 0 |
Generate a sorted array in ascending order with an eighth of his values shuffled | function pseudoSorted(size) {
let arr = Array.from({length: size}, (v, k) => k);
for (let i = 0; i < Math.floor(size / 4); i++) {
swap(arr, Math.floor(Math.random() * (size - 1)), Math.floor((Math.random() * (size - 1))));
}
return arr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FY_Algorithm(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n}",
"function fisher_yeates_randomize(array) {\n let current... | [
"0.7114671",
"0.70938754",
"0.7080978",
"0.69988984",
"0.69972706",
"0.6986753",
"0.6960056",
"0.6953907",
"0.69506735",
"0.694044",
"0.6907034",
"0.68968856",
"0.6895364",
"0.6890794",
"0.68876225",
"0.68391514",
"0.68353724",
"0.68226135",
"0.68200964",
"0.68138766",
"0.680... | 0.7188766 | 0 |
Set `widget` as the current widget while evaluating `fn`. | function withCurrentWidget(fn, widget) {
var current = currentWidget.get();
try {
currentWidget.set(widget);
fn();
} finally {
currentWidget.set(current);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function withCtx(fn, ctx = currentRenderingInstance) {\r\n if (!ctx)\r\n return fn;\r\n const renderFnWithContext = (...args) => {\r\n // If a user calls a compiled slot inside a template expression (#1745), it\r\n // can mess up block tracking, so by default we need to push a null block... | [
"0.53900516",
"0.5385265",
"0.5189125",
"0.5189125",
"0.5189125",
"0.5037177",
"0.50052",
"0.50014675",
"0.49676517",
"0.492906",
"0.4843817",
"0.4823044",
"0.48141694",
"0.4812183",
"0.4801722",
"0.47871655",
"0.47871655",
"0.4772669",
"0.4737754",
"0.4737754",
"0.4737754",
... | 0.7660068 | 0 |
get wallet transfer map | async WalletTransferMap ({dispatch, commit}) {
let walletTransferMap = await dispatch('GET', `/api/wallet-transfer-map`)
commit('setWalletTransferMap', walletTransferMap)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getWalletInfo() {\n if (window.ethereum) {\n window.ethereum.autoRefreshOnNetworkChange = false;\n window.web3 = new Web3(window.ethereum);\n } else {\n console.log(\n \"Please install MetaMask. How To instructions can be found here: https://www.youtube.com/watch?v=wTlI2_zxXpU\"\n... | [
"0.61126924",
"0.5927546",
"0.5900131",
"0.58783144",
"0.57680833",
"0.57377696",
"0.56255025",
"0.5604959",
"0.5588694",
"0.55851555",
"0.5578034",
"0.5463354",
"0.5442784",
"0.5438892",
"0.54031664",
"0.539722",
"0.5361932",
"0.5345359",
"0.5297545",
"0.52848744",
"0.526751... | 0.73768777 | 0 |
get wallet transfer rate | async WalletTransferRate ({dispatch, commit}) {
let walletTransferRate = await dispatch('GET', `/api/wallet-transfer-rate`)
commit('setWalletTransferRate', walletTransferRate)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWalletBalance() {\n return lndService.getWalletBalance();\n}",
"async getWalletBalance() {\n if (!this.address)\n return 0;\n const winston = await exports.arweave.wallets.getBalance(this.address);\n const ar = exports.arweave.ar.winstonToAr(winston);\n return ... | [
"0.7002989",
"0.6937806",
"0.66656893",
"0.65378505",
"0.6520281",
"0.639564",
"0.6274894",
"0.62705517",
"0.6252222",
"0.6242813",
"0.62283635",
"0.61961293",
"0.6168516",
"0.61476105",
"0.6133672",
"0.60977674",
"0.60871357",
"0.60588604",
"0.60445905",
"0.6015013",
"0.6001... | 0.7699771 | 0 |
get card application list | async GetCardApplyList ({dispatch, commit}, data) {
const json = await dispatch('GET', `/api/card-applications`)
commit('setApplyList', json)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async listApps() {\n return this.get('/apps')\n }",
"getApps () {\n this._checkProfile()\n return this._getResources('apps')\n }",
"static async fetchAllApplications() {\n let results = await dbGetApplications();\n return this.fillArray(results);\n }",
"function getApp(results) {\... | [
"0.6910072",
"0.66012967",
"0.6579324",
"0.63150823",
"0.62884104",
"0.62791896",
"0.6258848",
"0.62262565",
"0.6211891",
"0.62112737",
"0.6190475",
"0.6190475",
"0.6190475",
"0.6190475",
"0.6190475",
"0.6190475",
"0.61728567",
"0.61688864",
"0.61688864",
"0.61647093",
"0.616... | 0.6636755 | 1 |
numeric (con decimales) pasa transformar 123,123,123,123.4545 a 123.123.123.123.45 trendArrow (porcentaje para tablas) pasa transformar 123,123,123,123.4545 a 123.123.123.123.45 > formattedText (sin decimales) pasa transformar 123,123,123,123.4545 a 123.123.123.123 percentage para transformar de 0.67232387 a 67% dinami... | function format_number(value, type)
{
value = ""+value;
//busca primer numero
var firstNumberPosition = getFirstNumberPosition(value);
//si el resultado es -1 entonces no encontro ningun numero
if (firstNumberPosition != -1)
{
var newValue = "";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function string2Moeda(valor){\n\t\t\tvar valorFormatado = \"\";\n\t\t\tvar array = valor.split(\".\");\n\t\t\tvar parteInteira = array[0];\n\t\t\tvar qtdParteInteira = (array[0]).length;\n\t\t\tvar separadorMilhar = 1;\n\t\t\tvar cloneTam = parteInteira;\n\t\t\tfor(i = 0 ; i < qtdParteInteira ; qtdParteInteira--){... | [
"0.64117426",
"0.6364348",
"0.62438196",
"0.6193402",
"0.6179648",
"0.61590654",
"0.6156091",
"0.61394936",
"0.61091423",
"0.6015553",
"0.6010113",
"0.5998967",
"0.5989693",
"0.5959345",
"0.59568274",
"0.5955665",
"0.59536004",
"0.59004736",
"0.58793014",
"0.5871913",
"0.5856... | 0.67065084 | 0 |
Draws a line from x1,y1 to x2,y2 beneath the specified element and with the specified style and id. | function svgDrawLine(x1, y1, x2, y2, style, id, rootNode, startmarker, endmarker) {
svgDrawLine(x1, y1, x2, y2, style, id, rootNode, null, null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function svgDrawLine(x1, y1, x2, y2, style, id, rootNode, startmarker, endmarker) {\r\n\tvar lineNode = document.createElementNS(svgNS,\"svg:line\");\r\n\tlineNode.setAttribute(\"x1\",x1);\r\n\tlineNode.setAttribute(\"y1\",y1);\r\n\tlineNode.setAttribute(\"x2\",x2);\r\n\tlineNode.setAttribute(\"y2\",y2);\r\n\tif (... | [
"0.7230913",
"0.70198286",
"0.6753659",
"0.6304835",
"0.62965643",
"0.6251805",
"0.6231589",
"0.61409456",
"0.60756546",
"0.60416883",
"0.60127234",
"0.60009855",
"0.59994644",
"0.5976466",
"0.59758836",
"0.59437853",
"0.59107006",
"0.5895285",
"0.58950233",
"0.5889366",
"0.5... | 0.737289 | 0 |
Draws a line from x1,y1 to x2,y2 beneath the specified element and with the specified style and id. | function svgDrawLine(x1, y1, x2, y2, style, id, rootNode, startmarker, endmarker) {
var lineNode = document.createElementNS(svgNS,"svg:line");
lineNode.setAttribute("x1",x1);
lineNode.setAttribute("y1",y1);
lineNode.setAttribute("x2",x2);
lineNode.setAttribute("y2",y2);
if (style!=null) {
lineNode.setAtt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function svgDrawLine(x1, y1, x2, y2, style, id, rootNode, startmarker, endmarker) {\r\n\tsvgDrawLine(x1, y1, x2, y2, style, id, rootNode, null, null);\r\n}",
"function svgDrawLinePc(x1, y1, x2, y2, style, id, rootNode) {\r\n\tvar lineNode = document.createElementNS(svgNS,\"line\");\r\n\tlineNode.setAttribute(\"x... | [
"0.7369728",
"0.70168203",
"0.67511547",
"0.6299768",
"0.62924063",
"0.6247222",
"0.62280416",
"0.61367464",
"0.6072028",
"0.60369176",
"0.60052365",
"0.5996839",
"0.5996118",
"0.5972303",
"0.59715813",
"0.5939171",
"0.5905644",
"0.58923316",
"0.5890946",
"0.5885252",
"0.5879... | 0.72271955 | 1 |
Moves an ellipse from current position to a new X,Y position with dimensions rx,ry and rotation. | function svgMoveEllipse(x, y, rx, ry, rotation, id) {
var node = document.getElementById(id);
if (node!=null) {
node.setAttribute("cx", x);
node.setAttribute("cy", y);
node.setAttribute("rx", rx);
node.setAttribute("ry", ry);
if (rotation!=null && rotation!=0.0) {
node.setAttribute("transform", "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveEllipse() {\n posX = posX + direction * step;\n}",
"function moveCircle() {\r\n svg.select('#iss')\r\n .attr(\"x\", projection(current.coords)[0] -33)\r\n .attr(\"y\", projection(current.coords)[1] -18);\r\n\r\n }",
"function Ellipse(rx, ry, ax) {\n... | [
"0.75265485",
"0.62993",
"0.62647265",
"0.62647265",
"0.62647265",
"0.6221399",
"0.61138165",
"0.6065405",
"0.6062454",
"0.60306907",
"0.60068214",
"0.5938206",
"0.5929665",
"0.589014",
"0.58572996",
"0.58124083",
"0.5784586",
"0.57678604",
"0.57544106",
"0.57441735",
"0.5741... | 0.70060223 | 1 |
Draws a symbol at location x, y with width and height as specified and scale/rotation and symbol as specified. | function svgSymbol(x, y, scalar, rotation, width, height, symbol, id, rootNode) {
var posx = x;
var posy = y;
posx = (x/scalar)+(height/scalar);
posy = (y/scalar)+(width/scalar);
var useNode = document.createElementNS(svgNS,"svg:use");
useNode.setAttributeNS(linkNS, "xlink:href", "#" + symbol);
use... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawSymbolAt(x, y) {\n fill(color(random(255), random(255), random(255)));\n push();\n translate(x, y);\n drawSymbol();\n pop();\n}",
"function drawSymbol(id, symbol){\n cellObj[id].append(symbol);\n\n //store the variables\n content[id] = symbol;\n isFilled[id] = ... | [
"0.7336972",
"0.6545091",
"0.6520218",
"0.6520218",
"0.6319084",
"0.6304528",
"0.6232898",
"0.6164724",
"0.61092806",
"0.6026535",
"0.6003691",
"0.59751976",
"0.59381425",
"0.58648884",
"0.58484554",
"0.5805896",
"0.5805896",
"0.58037925",
"0.5755505",
"0.5755505",
"0.5739766... | 0.6623519 | 1 |
Moves a symbol from current position to a new X,Y position recalculated based on scalar and rotation. | function svgMoveSymbol(x, y, scalar, rotation, width, height, id) {
var posx = 0.0 + x;
var posy = 0.0 + y;
// posx = (x/scalar)+(height/scalar);
// posy = (y/scalar)+(width/scalar);
var node = document.getElementById(id);
if (node!=null) {
node.setAttribute("x", posx);
node.setAttribute("y", po... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"moveToFinalPosition() {\n // Match position of skier\n const { x, y } = this.skier.getPosition();\n this.x = x;\n this.y = y;\n }",
"moveShark() {\n\n this.sharkPos.x -= this.sharkSpeed;\n }",
"function moveCircle() {\r\n svg.select('#iss')\r\n ... | [
"0.6281442",
"0.62209344",
"0.6051188",
"0.6008688",
"0.6000792",
"0.5923693",
"0.58526176",
"0.58315605",
"0.5824282",
"0.5771793",
"0.57015467",
"0.5690363",
"0.5646343",
"0.56144875",
"0.55936915",
"0.5590779",
"0.5577883",
"0.5574327",
"0.55629325",
"0.55593747",
"0.55560... | 0.7325892 | 0 |
Create new entry, but only if haven't been created before. stockData is undefined in case we don't have the data yet | function createEntry(stockData, symbol) {
if (stockData && stockData.symbol) {
symbol = stockData.symbol;
}
var entryDiv;
//Create new entry if this is a new symbol
if (renderedSymbolList.indexOf(symbol) < 0) {
renderedSymbolList.push(symbol);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addToLocalStorage(e) {\n var storedStock = storage.get();\n var x = this.children;\n var name = $(x[1]).text();\n var exchange = $(x[2]).text()\n var symbol = $($(this)[0].firstChild).text();\n var stockToAdd = {\n 'Symbol': symbol,\n 'Name':... | [
"0.6556564",
"0.6304121",
"0.6219379",
"0.5895126",
"0.57183564",
"0.5703913",
"0.5703145",
"0.56892145",
"0.5665852",
"0.5620469",
"0.55133253",
"0.54769695",
"0.5466217",
"0.53962797",
"0.53856856",
"0.5366919",
"0.53641045",
"0.5359369",
"0.53489697",
"0.53477615",
"0.5343... | 0.6753283 | 0 |
Update query string param | function updateQueryStringParam(key, value) {
let uri = window.location.href;
const re = new RegExp("([?|&])" + key + "=.*?(&|$)", "i");
const separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {
uri = uri.replace(re, '$1' + key + "=" + value + '$2');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateQueryString() {\n\tif (urlParams.get('range')) {\n\t\turlParams.delete('range');\n\t}\n\turlParams.append('range', $('#distance-slider').val());\n\tlocation.search = urlParams;\n}",
"updateQueryStringParameter(obj) {\n\t\t\tlet url = window.location.search;\n\n\t\t\tfor (let key in obj) {\n\t\t\t\... | [
"0.77657294",
"0.75234944",
"0.75234944",
"0.7332425",
"0.7321304",
"0.7291503",
"0.7288205",
"0.7237516",
"0.7171534",
"0.71651626",
"0.7163771",
"0.7130364",
"0.71172106",
"0.7113671",
"0.7110344",
"0.71096575",
"0.7103782",
"0.7090291",
"0.70589787",
"0.7014425",
"0.701312... | 0.76087487 | 1 |
This function release the db connection ,this is confirmed by verifying the value of connection by calling'pool._freeConnections.indexOf(connection)' If it 0 then connection is released else not. However some time it still returns 1,in that case i have called 'connection.release();' function,if it throws exception then... | function releaseDbCon(connection)
{
connection.release();
var conRelease=pool._freeConnections.indexOf(connection);
if(conRelease==0)
{
logger.debug('db connection is released succ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"closeConnection() {\n if (this.connection.pool) {\n this.connection.close();\n }\n }",
"function closePool() {\n conn.close();\n}",
"function release(connection) {\n if (this.pool) {\n this.pool.release(connection);\n }\n }",
"function closeConnection(){\n le... | [
"0.74689275",
"0.7322908",
"0.6834954",
"0.6758423",
"0.667804",
"0.6670355",
"0.65670395",
"0.64387757",
"0.6403128",
"0.6395401",
"0.6380539",
"0.634179",
"0.63310266",
"0.63310266",
"0.6283676",
"0.6230014",
"0.6212392",
"0.6212392",
"0.6193789",
"0.61755013",
"0.6157704",... | 0.88318473 | 0 |
Returns a DriveApp folder object corresponding to the given path. | function getCreateDriveFolderFromPath(fullPath){
return (fullPath || "/").split("/").reduce ( function(prev,current) {
if (prev && current) { //if folder exists for path, go inside to the next level and repeat
var fldrs = prev.getFoldersByName(current);
return fldrs.hasNext() ? fldrs.next() : prev.cre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFolder(folderPath) {\n var folder = DriveApp.getRootFolder();\n var folderNamesArray = folderPath.split(\"/\");\n for (var idx = 0; idx < folderNamesArray.length; idx++) {\n var newFolderName = folderNamesArray[idx];\n // Skip if new folder name is empty (possibly due to slash at... | [
"0.6516428",
"0.6106008",
"0.54077834",
"0.5305283",
"0.50868815",
"0.50703895",
"0.5028731",
"0.49614006",
"0.48736578",
"0.47790822",
"0.47452995",
"0.47385737",
"0.4729242",
"0.47201538",
"0.46773097",
"0.46201238",
"0.4584438",
"0.4573422",
"0.4570809",
"0.45588863",
"0.4... | 0.61253196 | 1 |
Addiert einen Link auf die Bilanz hinter den SpielberichtsLink cell Tabellenzelle mit Link auf den SpielberichtsLink gameType Name des Wettbewerbs eines Spiels label Anzuklickender Text des neuen Links | function addBilanzLinkToCell(cell, gameType, label) {
var bilanzLink = getBilanzLinkFromCell(cell, gameType, label);
if (bilanzLink != "") {
cell.innerHTML += bilanzLink;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addBilanzLinkToCell(cell, gameType, label) {\n const __BILANZLINK = getBilanzLinkFromCell(cell, gameType, label);\n\n if (__BILANZLINK !== \"\") {\n cell.innerHTML += __BILANZLINK;\n }\n}",
"function linkcell(thing) {\n\t\tif(thing !== undefined) {\n\t\t\tvar content = $(\"<a>\");\n\t\t\... | [
"0.7418788",
"0.64395",
"0.63015705",
"0.6205234",
"0.6181147",
"0.61702967",
"0.61627626",
"0.61627626",
"0.61627626",
"0.61627626",
"0.6141271",
"0.6129205",
"0.61051387",
"0.60898966",
"0.6073261",
"0.60644436",
"0.60251725",
"0.6024997",
"0.60179687",
"0.6009597",
"0.5999... | 0.75521123 | 0 |
Stop the temporary server | stopServer() {
if (this.server) {
this.server.close();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"stop()\n {\n this.server.close();\n }",
"stopServer() {\n this.server && this.server.close();\n }",
"stop() {\n\t\tthis.ws.close((err) => this.sendStatus({\n\t\t\tstatudID: 1,\n\t\t\tmessage: 'Server stopped',\n\t\t\terror: err\n\t\t}))\n\t}",
"function stop(exec) {\n server.close(exec());\... | [
"0.8144983",
"0.764383",
"0.75173444",
"0.7512212",
"0.7445061",
"0.7208026",
"0.7153902",
"0.71250546",
"0.7029885",
"0.7026323",
"0.69803",
"0.69554394",
"0.6935817",
"0.6923995",
"0.69085646",
"0.68328106",
"0.6810058",
"0.677751",
"0.6774403",
"0.67709625",
"0.67709625",
... | 0.777433 | 1 |
Renders HTML and uses CustomCanvas component Can have either a progress or a completed state Shows a number in the center indicating the percentage of Arc drawn | render() {
// Default className of the main container
var containerClassNames = ['arc-loader'];
// append "completed" to the default className
// if completed
if(this.props.completed) {
containerClassNames.push('completed');
}
return (
<div className={containerClassNames.join(' ')}>
<div class... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderProgressCircle() {\n progressCircleCtx.clearRect(0, 0, width, height);\n progressCircleCtx.strokeStyle = fractionObserved === 1 ? '#00dd00' : '#404040';\n progressCircleCtx.beginPath();\n progressCircleCtx.arc(width - 20, 20, 16, toRadians(-90), toRadians(fractionObserved... | [
"0.68654484",
"0.6454793",
"0.64117795",
"0.63519305",
"0.6338321",
"0.6141927",
"0.6122558",
"0.6113865",
"0.6098781",
"0.60655797",
"0.6047613",
"0.603828",
"0.5958692",
"0.5956272",
"0.59524685",
"0.5932444",
"0.59318894",
"0.5917213",
"0.59061486",
"0.5901264",
"0.5857932... | 0.6974317 | 0 |
Normalize tensor to only include values from 0 to 1 | function normalizeTensor(tensor) {
const max = tensor.max();
const min = tensor.min();
return tensor.sub(min).div(max.sub(min));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalize(value){\n\t\tif( value > 1){\n\t\t\tvalue = 1;\n\t\t}else if(value < 0){\n\t\t\tvalue = 0;\n\t\t}\n\t\treturn value;\n\t}",
"normalize() {\n let m = this.mag();\n if(m != 0) {\n this.div(m);\n }\n }",
"normalize() {\n return this.mult(1 / this.magnitude);\n }",
"Normaliz... | [
"0.6494365",
"0.631581",
"0.62007266",
"0.6130774",
"0.6109763",
"0.61042595",
"0.6020164",
"0.59989226",
"0.5978194",
"0.591447",
"0.59035456",
"0.5901307",
"0.58317596",
"0.57861334",
"0.5775182",
"0.5767473",
"0.56928873",
"0.56928873",
"0.5660416",
"0.5646541",
"0.5609726... | 0.734122 | 0 |
Translate species name into onehot encoding | function speciesOneHotEncoding(species) {
return [
species === 'setosa' ? 1 : 0,
species === 'virginica' ? 1 : 0,
species === 'versicolor' ? 1 : 0,
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decodeOneHotEncoding(arr) {\n\t// convert all the preditions to integers\n\tconst intArr = arr.map(Math.round);\n\n\t//\tworkout which encode is turned on?\n\t//\tfor now, if there are more specieis with probability more than 0.5\n\t//\tuse the last one\n\tlet specie = 'unknown';\n\tif (intArr[0] === 1) {... | [
"0.6874635",
"0.53961647",
"0.53233445",
"0.5185201",
"0.5115471",
"0.5044887",
"0.50210935",
"0.49343678",
"0.48998627",
"0.48767865",
"0.4829545",
"0.4790396",
"0.4746089",
"0.4714005",
"0.4705956",
"0.46986338",
"0.46955946",
"0.4667499",
"0.46627298",
"0.46626073",
"0.462... | 0.73189735 | 0 |
Translate predicted onehot array into a species name | function decodeOneHotEncoding(arr) {
// convert all the preditions to integers
const intArr = arr.map(Math.round);
// workout which encode is turned on?
// for now, if there are more specieis with probability more than 0.5
// use the last one
let specie = 'unknown';
if (intArr[0] === 1) {
specie = 'setosa';
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function speciesOneHotEncoding(species) {\n\treturn [\n\t\tspecies === 'setosa' ? 1 : 0,\n species === 'virginica' ? 1 : 0,\n species === 'versicolor' ? 1 : 0,\n\t];\n}",
"function preprocessLabels() {\n for (let i = 0; i < labels.length; i++) {\n switch (labels[i]) {\n ... | [
"0.60862803",
"0.57222426",
"0.52592725",
"0.5161453",
"0.5138008",
"0.5069534",
"0.48616233",
"0.47344896",
"0.47293842",
"0.47080866",
"0.47046697",
"0.47042316",
"0.46955648",
"0.46357325",
"0.46233338",
"0.45318535",
"0.45282915",
"0.45003217",
"0.44884762",
"0.44735223",
... | 0.67442286 | 0 |
Split shuffled data into a training and testing datasets | function splitData(data) {
tf.util.shuffle(data);
const testCasesNum = 10;
const train = data.slice(0, data.length - testCasesNum);
const test = data.slice(data.length - testCasesNum);
return [train, test];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function splitDataset(data, testCount) {\n\tconst shuffled = _.shuffle(data);\n\tconst testSet = _.slice(shuffled, 0, testCount);\n\tconst trainingSet = _.slice(shuffled, testCount);\n\treturn [testSet, trainingSet];\n}",
"function splitDataForTrainAndTest(data,LettersToSplit,trainPercent) {\n let testPrecent... | [
"0.8380299",
"0.7442988",
"0.72329146",
"0.71911114",
"0.69636303",
"0.6745926",
"0.609508",
"0.59341115",
"0.5663814",
"0.56533355",
"0.5595177",
"0.5520635",
"0.5472108",
"0.54014504",
"0.53396666",
"0.53206325",
"0.5287762",
"0.5268481",
"0.5264129",
"0.52603203",
"0.52572... | 0.8106072 | 1 |
Use trained model to make prediction on a testing data stored in a tensor. | async function predict(model, testTensor) {
console.log('Predicting');
const pred = model.predict(testTensor);
// get typed array from prediction tensor and convert it
// to untyped
const predArr = Array.from(pred.dataSync());
pred.print();
// slice it 3
const predictions = chunk(predArr, 3);
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doPrediction(model) {\n //doPrediction(model, data, testDataSize)\n const IMAGE_WIDTH = 28;\n const IMAGE_HEIGHT = 28;\n //This selects a random examples from the data\n // const testData = data.nextTestBatch(testDataSize);\n // const testx... | [
"0.7582523",
"0.7103371",
"0.6834185",
"0.63015455",
"0.6293572",
"0.6218445",
"0.6169403",
"0.60519874",
"0.5941769",
"0.5844179",
"0.5838163",
"0.5834434",
"0.580664",
"0.5721739",
"0.5711742",
"0.5711742",
"0.57098573",
"0.56953704",
"0.5688241",
"0.5685757",
"0.56604713",... | 0.7515848 | 1 |
Function to draw the board on the canvas Also initializes all of the hexagons Takes no arguments | function drawBoard() {
// Canvas background color
ctx.fillStyle = "white";
ctx.fillRect(0, 0, canvas.width, canvas.height);
var i, j;
// Define all of the hexagons on the grid (get their points)
for (j = 0; j < numRows; j++) {
for (i = 0; i < numCols; i++) {
getPoints(startX + i*3*sideLen, startY + j*(side... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawHexagonBoard(ctx, hexagonBoard) {\n\n // determine dimensions and units on the canvas\n var canvasWidth = ctx.canvas.width;\n var canvasHeight = ctx.canvas.height;\n var x_center = canvasWidth / 2;\n var y_center = canvasHeight / 2;\n var max_width = Math.min(canvasWidth, canvasHeigh... | [
"0.73616034",
"0.68834233",
"0.6882466",
"0.6872491",
"0.68201995",
"0.6743465",
"0.6738624",
"0.6661157",
"0.66571003",
"0.6654392",
"0.66434884",
"0.6629967",
"0.66122365",
"0.65914893",
"0.6579547",
"0.6543521",
"0.6543228",
"0.6538433",
"0.6530027",
"0.65296155",
"0.65291... | 0.7608481 | 0 |
Function that defines the path around a hexagon hex: the hexagon to define the path around | function definePath(hex) {
var XPoints = hex.Xpts;
var YPoints = hex.Ypts;
ctx.beginPath();
ctx.moveTo(XPoints[0], YPoints[0]);
for(var i = 1; i < XPoints.length; i++) {
ctx.lineTo(XPoints[i], YPoints[i]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hexagon() {\n push();\n polygon(0, 0, 50, 6);\n pop();\n }",
"function Hexagon2()\n{\n\tthis.MAP_COLS = 10;\n\tthis.MAP_ROWS = 10;\n\t\n\tthis.HEXAGON_R = 30;\n\n\t//行间距和列间距\n\tthis.H_INTERVAL = 1.732 * this.HEXAGON_R;\n\tthis.V_INTERVAL = 1.5 * this.HEXAGON_R;\n\n\tthis.HEXAGON_X0 = this.H_IN... | [
"0.72515947",
"0.6921",
"0.6634156",
"0.65726453",
"0.65671223",
"0.6406271",
"0.6324713",
"0.63222873",
"0.6299437",
"0.62681735",
"0.62681735",
"0.62681735",
"0.6266096",
"0.62355965",
"0.622094",
"0.6220434",
"0.61189294",
"0.601859",
"0.60108244",
"0.59638286",
"0.5939315... | 0.7662862 | 0 |
Function to handle a click inside the canvas This will put up a wall in the hexagon clicked Nothing will happen if it is not the player's turn e: the mouse click event | function handleClick(e) {
//console.log('here');
// Check that it's the user's turn
if (yourTurn) {
// Figure out where has been clicked
var x = event.pageX;
var y = event.pageY;
x -= canvas.offsetLeft;
y -= canvas.offsetTop;
// Figure out which hexagon has been clicked
for (var i = 0; i < hexes.l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function board_click(ev)\n{\n if(playerTeam=== state.currentTurn){//ONLY handle click events if the player's team matches the current turn team\n var rect = canvasVar.getBoundingClientRect();\n var clickedX = event.clientX - rect.left;//YOU NEED THIS OFFSETTING OR SCROLLING WILL FUCK UP YOUR SHIT\n var c... | [
"0.7615401",
"0.74528813",
"0.7336059",
"0.7253394",
"0.7207475",
"0.7126235",
"0.70682216",
"0.6970352",
"0.69249207",
"0.6921687",
"0.6918109",
"0.68926793",
"0.685915",
"0.68238306",
"0.67901707",
"0.67734265",
"0.67702234",
"0.67633843",
"0.6760096",
"0.6749721",
"0.67352... | 0.8538522 | 0 |
Create infowindow on top of markers | function createInfowindow() {
marker = this;
infowindow = largeInfowindow;
// Bounce when show infowindow
marker.setAnimation(google.maps.Animation.BOUNCE);
// Set BOUNCE animation timeout
setTimeout(function() {
self.marker.setAnimation(null);
}, 1200);
// Fill the fetched info from Foursquare API
setFoursq... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createInfoWindowObject() {\n infowindow = new google.maps.InfoWindow({\n /* The pixelOffset tells the infoWindow to move 35 pixels above its position.\n * This is so the user can still see the marker that was clicked.\n * Taken from:\n * https://stackover... | [
"0.79489756",
"0.77680707",
"0.757599",
"0.7543346",
"0.754213",
"0.73425704",
"0.73358923",
"0.7331893",
"0.7331133",
"0.7329461",
"0.7327969",
"0.73276246",
"0.72982675",
"0.7280793",
"0.7276156",
"0.72752666",
"0.72496724",
"0.7237368",
"0.7225249",
"0.7204057",
"0.7188313... | 0.807065 | 0 |
Function called to generate demo signals (when no physical device is attached) | function on_build_demo_signals()
{
//Use the function below to get the number of samples to be built
var samples_to_build = ScanaStudio.builder_get_maximum_samples_count();
var sdio_builder = ScanaStudio.BuilderObject;
var sample_rate = ScanaStudio.builder_get_sample_rate();
var ch_cmd = ScanaStudio.gui_get_v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function on_build_demo_signals()\n{\n //Use the function below to get the number of samples to be built\n var samples_to_build = ScanaStudio.builder_get_maximum_samples_count();\n var silence_period = (samples_to_build / (125*ScanaStudio.builder_get_sample_rate()));\n var spi_builder = ScanaStudio.BuilderObjec... | [
"0.6628927",
"0.6008784",
"0.5816447",
"0.5705043",
"0.5658078",
"0.5648008",
"0.56378686",
"0.56182885",
"0.5525977",
"0.5520905",
"0.5504659",
"0.5493245",
"0.54901254",
"0.54838777",
"0.54816765",
"0.545131",
"0.54407066",
"0.5422361",
"0.5420073",
"0.54181623",
"0.5415929... | 0.61759084 | 1 |
end BuilderObject Some useful functions / A helper function add leading "0"s to numbers Parameters num_str: A string of the number to be 0padded size: The total wanted size of the output string | function pad(num_str, size) {
while (num_str.length < size) num_str = "0" + num_str;
return num_str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function padZeros(num, totalLen) {\n var numStr = num.toString();\n var numZeros = totalLen - numStr.length;\n for (var i = 1; i <= numZeros; i++) {\n numStr=\"0\" + numStr; \n } \n return numStr;\n }",
"function padZeros(num, totalLen) {\n var numStr = num.toString(); // Inicia liza un valo... | [
"0.76736075",
"0.7579478",
"0.75724494",
"0.75724494",
"0.7560556",
"0.75349903",
"0.74731606",
"0.74529177",
"0.74390227",
"0.74322015",
"0.7388813",
"0.73814017",
"0.7330917",
"0.7307149",
"0.7298081",
"0.7294054",
"0.72839814",
"0.72686833",
"0.7267271",
"0.7267271",
"0.72... | 0.7806033 | 1 |
Used for packet view, automately put the right Colors accordly to the types and change the data string item accordly to the GUI | function packet_view_add_wide_width_packet(ch,sdio_simple,title,content,types)
{
switch (types)
{
case "Wrap" :
{
ScanaStudio.packet_view_add_packet(false,
ch,
sdio_simple.start_sample,
sdio_simple.end_sample,
title,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function display_types() \n {\n var types_x = {\"Voice\": 150, \"SMS\": width / 2, \"Data\":width - 150};\n var types_data = d3.keys(types_x);\n var types = vis.selectAll(\".types\")\n .data(types_data);\n\n types.enter().append(\"text\")\n .attr(\"class\", \"... | [
"0.5746502",
"0.5736065",
"0.56849605",
"0.55106086",
"0.54486215",
"0.5417957",
"0.5414791",
"0.54103774",
"0.5357159",
"0.5341537",
"0.5341463",
"0.5331023",
"0.53173",
"0.5314123",
"0.53124684",
"0.5305074",
"0.5296656",
"0.52849156",
"0.5278175",
"0.52758324",
"0.52687746... | 0.62168705 | 0 |
Used to know if the CMD will lead to a data transfer | function switch_data_transfer(CMD,CMD_mode)
{
switch(Number(CMD))
{
case 6 :
case 17 :
case 18 :
case 19 :
case 24 :
case 25 :
case 27 :
case 30 :
case 40 :
case 46 :
case 47 :
case 48 :
case 49 :
ca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isSending() {\n return commandSocket && commandSocket.isSending();\n }",
"function processCommand(cmd){\n if(cmd[0] === 'b'){\n setButtonReadout(cmd[1] == '1');\n\n return true;\n }\n\n return false;\n}",
"function isConnect() {\n return !needWait;\n }",
"f... | [
"0.65216655",
"0.61233115",
"0.5968152",
"0.5848051",
"0.56879264",
"0.56373566",
"0.5570597",
"0.5569947",
"0.5515601",
"0.54807746",
"0.54614425",
"0.54614425",
"0.5434943",
"0.5430559",
"0.5359383",
"0.5358162",
"0.53491515",
"0.5337259",
"0.5337259",
"0.53276706",
"0.5325... | 0.6141218 | 1 |
Used for the READ_BL_LEN value in the CSD Register | function BL_LEN(value, CSD_version)
{
var content = "";
if (CSD_version == 0)
{
switch (Number(value))
{
case 9 :
{
return content = 512 + "Bytes";
}
case 10 :
{
return content = 1024 + "Bytes";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bnByteLength() {\n\t return this.bitLength() >> 3\n\t}",
"get length() { return grok_BitSet_Get_Length(this.d); }",
"function bnByteLength() {\n return this.bitLength() >> 3\n}",
"function bnByteLength() {\n return this.bitLength() >> 3\n}",
"function bnByteLength() {\n return this.bitLength()... | [
"0.58140373",
"0.5717894",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5647976",
"0.5594939",
"0.5558316",
"0.5553786",
"0.5535683",
"0.54996383",
"0.54672736",
... | 0.7098292 | 0 |
Return decimal value of nbits bits array | function bin2dec (array, nbits)
{
var dec = 0;
for (i = 0; i < nbits; i++)
{
dec += array[i]*Math.pow(2,(nbits-1-i));
}
return dec;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nbits(x){var t,r=1;return 0!=(t=x>>>16)&&(x=t,r+=16),0!=(t=x>>8)&&(x=t,r+=8),0!=(t=x>>4)&&(x=t,r+=4),0!=(t=x>>2)&&(x=t,r+=2),0!=(t=x>>1)&&(x=t,r+=1),r}",
"function bitsToNum(bitArray){\n\treturn bitArray.reduce(function(s, n) { return s * 2 + n; }, 0);\n}",
"function nbits(x) {\r\nvar r = 1, t;\r\nif(... | [
"0.68879044",
"0.68530023",
"0.6833774",
"0.6804379",
"0.6804379",
"0.6804379",
"0.6773321",
"0.6773321",
"0.6735481",
"0.67179704",
"0.67179704",
"0.67179704",
"0.67179704",
"0.67179704",
"0.67179704",
"0.67179704",
"0.67179704",
"0.67179704",
"0.67179704",
"0.67179704",
"0.... | 0.7377579 | 0 |
Return 5 decimal value in final_array from a 40 bits array | function crc_array(array)
{
var final_array = [];
var dec = 0;
for (j=0; j<array.length/8; j++)
{
for (i=0; i<8; i++)
{
dec += array[(j*8)+i]*Math.pow(2,7-i);
}
final_array.push(dec);
dec = 0;
}
return final_array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function QR__pi2ba(output, val, size) {\n\tvar mask = 1;\n\tvar end = output.length;\n\tfor (var i = output.length + size - 1; i >= end; i--) {\n\t\toutput[i] = val & mask ? true : false;\n\t\tmask = mask << 1;\n\t}\n}",
"function dilateArray(a) {\n\tvar i, j, n;\n\tfor (i = 0; i < 5; i++) {\n\t\tn = 1 << i;\n\t... | [
"0.57057047",
"0.568053",
"0.5633955",
"0.5629065",
"0.562255",
"0.5617947",
"0.5617334",
"0.5593265",
"0.55622494",
"0.55398613",
"0.55138993",
"0.5490991",
"0.54541856",
"0.5425807",
"0.54257166",
"0.5420371",
"0.54197866",
"0.54110855",
"0.5388028",
"0.5386794",
"0.5384279... | 0.6119518 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.