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 |
|---|---|---|---|---|---|---|
end TriggerObject Function called to generate demo siganls (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();
sampling_rate = ScanaStudio.get_capture_sample_rate();
var silence_period_samples = 1000 + (samples_to_build / 125);
var builde... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function on_build_demo_signals()\n{\n var samples_to_build = ScanaStudio.builder_get_maximum_samples_count();\n var silence_period_samples = 1000 + (samples_to_build / 125);\n var uart_builder = ScanaStudio.BuilderObject;\n reload_dec_gui_values();\n uart_builder.config(\n Number(ScanaStudio.... | [
"0.60951835",
"0.5782208",
"0.57530516",
"0.55693483",
"0.53640825",
"0.53618425",
"0.5300245",
"0.5263109",
"0.5242181",
"0.5233182",
"0.51686513",
"0.51574963",
"0.51501834",
"0.5137507",
"0.5069329",
"0.5068728",
"0.5068728",
"0.5068728",
"0.5068728",
"0.5068728",
"0.50687... | 0.583604 | 1 |
Same as check_stuffing but for the CRC field of CAN FD frames where different stuffing rules applies | function stuffing_build_fd_crc(b)
{
var ret = -1;
stuff_crc_counter++;
if ((stuff_crc_counter >= 4) || (stuff_first_crc_bit))
{
ret = (!stuff_last_bit) & 0x1;
stuff_crc_counter = 0;
stuff_first_crc_bit = false;
}
stuff_last_bit = b;
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_stuffing()\n{\n\tvar tmp_bit = bit_sampler_next(ch); \t// Read stuffed bit and advance to next bit\n\n\tif (last_bit == tmp_bit) \t\t\t\t// Check for stuffing error\n\t{\n\t\tif(!edl_mode)\n\t\t\tdec_item_new(ch, s + frame_length_in_sample -0.5 * spb, s + frame_length_in_sample - 0.5 * spb); \t// Ad... | [
"0.6319823",
"0.60086226",
"0.5904838",
"0.5865375",
"0.5730037",
"0.57249844",
"0.56091756",
"0.55684745",
"0.54849154",
"0.5387255",
"0.53837806",
"0.53668904",
"0.5212047",
"0.5166426",
"0.5143074",
"0.51401293",
"0.50831133",
"0.50769293",
"0.5052354",
"0.5039661",
"0.496... | 0.67547023 | 0 |
END CAN Usefull Functions // // // PGN Alert/Alert RSP/Alert Text // | function alert_byte (decoder_items)
{
var str = "";
switch (fast_packet_byte)
{
case 1 :
{
var alert_type = (hex_value>>4);
var alert_category = hex_value&0xF;
switch (alert_type)
{
case 1 :
{
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AlertNoRecordFound(mess,title)\n{\n //There are no Agency records.\n var alert = String.format(\"<p style=\\\"font-size:10.5pt;color:#000000\\\">{0}</p>\",mess); \n \n if(mess.length <= 50)\n GCTWindow.MessageBox(alert,'FACE SEARCH - ' + title,325,110,null);\n else \n GC... | [
"0.6233901",
"0.61916554",
"0.6171608",
"0.6063491",
"0.6058554",
"0.60427105",
"0.60100216",
"0.6003753",
"0.6000332",
"0.5997406",
"0.59760654",
"0.5969681",
"0.59667516",
"0.59513694",
"0.5941656",
"0.5924858",
"0.59196156",
"0.5903826",
"0.589423",
"0.5894144",
"0.5892078... | 0.6247346 | 0 |
end function get_pgn_name / A helper function add leading "0"s to numbers Parameters num_str: A string of the number to be 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 numToStringWithPadZero() {\n\tvar num = arguments[0];\n\tvar digit = arguments[1];\n\tvar val1 = \"\" + num\n\tvar val2 = (\"0000000000\" + num).slice(-digit);\n\tval2 = (val2.length < val1.length) ? val1 : val2;\n\treturn val2;\n}",
"function strPadZeroes(num, size) {\n let s = num+\"\";\n while ... | [
"0.7204509",
"0.71702",
"0.7017742",
"0.70076495",
"0.6980645",
"0.69598556",
"0.6954034",
"0.6950447",
"0.69184655",
"0.6918402",
"0.68964595",
"0.68945944",
"0.6872834",
"0.68482363",
"0.68222576",
"0.6816577",
"0.6805207",
"0.6791331",
"0.67647356",
"0.6762016",
"0.6759123... | 0.72483397 | 1 |
Cloudinary class with jQuery support | function CloudinaryJQuery(options) {
CloudinaryJQuery.__super__.constructor.call(this, options);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openUploadWidget () {\n cloudinary.openUploadWidget({\n cloud_name: 'ddanielnp',\n upload_preset: 'profile_preset',\n multiple: false\n }, function (error, result) {\n $('.profile_image').attr('src', result[0].eager[0].secure_url)\n $('#account_profile_image').val(result[0].eager[0].secur... | [
"0.58638835",
"0.53081155",
"0.530331",
"0.5275295",
"0.5213758",
"0.51817924",
"0.51111525",
"0.5108157",
"0.50734353",
"0.50652564",
"0.50595146",
"0.5015013",
"0.50103927",
"0.49978113",
"0.4978982",
"0.4943019",
"0.49292448",
"0.49142942",
"0.49092287",
"0.4908343",
"0.49... | 0.76633924 | 0 |
Simple formula generating a random value around the average in between min and max | function vary(avg, percentage, min, max) {
var value = avg * (1 + ((percentage / 100) * (2 * Math.random() - 1)));
value = Math.max(value, min);
value = Math.min(value, max);
return value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function arpa(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}",
"function genNextValue(prevValue, min, max) {\n var value = prevValue + ((max - min) * (Math.random() - 0.5)) * 0.03;\n value = Math.max(min, Math.min(max, value));\n return Math.round(value * 10) / 10;\n}",
"fun... | [
"0.72333765",
"0.7009206",
"0.70006144",
"0.69829535",
"0.69576114",
"0.69357604",
"0.6896653",
"0.68715674",
"0.68620986",
"0.6854347",
"0.6832965",
"0.6830469",
"0.6830423",
"0.6791223",
"0.6784099",
"0.6761859",
"0.6756303",
"0.67432314",
"0.67135584",
"0.6712831",
"0.6708... | 0.76923037 | 1 |
Constructor helper: initialize a public config store. This store is used to make some config info available to Dapps synchronously. | createPublicConfigStore () {
// subset of state for metamask inpage provider
const publicConfigStore = new ObservableStore()
// setup memStore subscription hooks
this.on('update', updatePublicConfigStore)
updatePublicConfigStore(this.getState())
publicConfigStore.destroy = () => {
this.r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"init(storeConfig) {\n this[config] = thorin.util.extend({\n credentials: null, // Google Cloud credentials json content\n namespace: '',\n projectId: null,\n idSize: 26, // the size of the \"id\" field\n path: path.normalize(thorin.root + '/app/entities')\n }, storeConf... | [
"0.6522274",
"0.6504542",
"0.6349657",
"0.63421047",
"0.63050044",
"0.6295981",
"0.6278548",
"0.62514263",
"0.6158942",
"0.6151801",
"0.6070789",
"0.60446316",
"0.60385025",
"0.6036301",
"0.6024602",
"0.601454",
"0.5979861",
"0.59301937",
"0.59138817",
"0.5903202",
"0.5874229... | 0.71361166 | 0 |
read the lambda arn | arn(callback) {
lambda.getFunction({
FunctionName: `${app}-${env}-get-index`
},
function getFunction(err, result) {
if (err) callback(err)
else {
callback(null, result.Configuration.FunctionArn)
}
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listLambdas () {\n cmdListLambdas.run(function (err, lambdas) {\n if (err) return logError(err)\n\n for (let lambda of lambdas) {\n console.log(lambda)\n }\n })\n}",
"function isLambdaArn(arn) {\r\n return /arn:aws(-cn|-us-gov)*:lambda:[\\w-]+:(\\d+):.*:.*/.test(arn);\r\n}",
"handle... | [
"0.5462163",
"0.53997517",
"0.522178",
"0.51444894",
"0.51180816",
"0.5102708",
"0.5082749",
"0.5056855",
"0.49766463",
"0.49681854",
"0.49368045",
"0.48945898",
"0.48603335",
"0.48431134",
"0.4834696",
"0.47987854",
"0.469855",
"0.46879774",
"0.46879774",
"0.46328902",
"0.46... | 0.5853843 | 0 |
function to add 'click' event listener for meal card to store meal ID being clicked in order to load the correct data at recipedetails page | function viewRecipeDetails() {
$('div.meal-card-data > a').each(function() {
$(this).click(function() {
saveToLocalStorage('recipeIdToDisplay', $(this).attr('id'));
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleClick(d){\r\n fetchRecipeCard(d);\r\n }",
"function onClick(event) {\n const id = event.target.id;\n fecthMeal(id);\n}",
"function getMealRecipe(e){\ne.preventDefault();\nif(e.target.classList.contains('recipe-btn')){\n let mealItem = e.target.parentElement.parentElement.parentEleme... | [
"0.70751077",
"0.70191413",
"0.6956432",
"0.6776189",
"0.6481512",
"0.63287824",
"0.6318308",
"0.63022697",
"0.6277824",
"0.62571824",
"0.62373406",
"0.62314993",
"0.6228368",
"0.61953956",
"0.6187009",
"0.6176658",
"0.61397463",
"0.6121762",
"0.61132497",
"0.6095034",
"0.608... | 0.7037349 | 1 |
functions to gather user's diet preference and intolerances as query parameter to parse to API call | function getUserDiet(e) {
if (this.checked) {
diet = this.labels[0].innerText;
}
// set visual cues for vegan diet to include dairy and egg as intolerances by default. Since vegan diet parameter already returns results excluding dairy and egg, it's not needed to also set intolerance param in this case.
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDistance(){\n if (departure.value == \"dep-auck\" && destination.value == \"dest-taup\" || departure.value == \"dep-taup\" && destination.value == \"dest-auck\"){\n tripDistance = distance.taupAuck;\n }\n else if (departure.value == \"dep-well\" && destination.value == \"dest-taup\" || de... | [
"0.5353674",
"0.5283593",
"0.5282321",
"0.5260051",
"0.52229726",
"0.51934046",
"0.5182488",
"0.5156476",
"0.5133805",
"0.5050863",
"0.5044419",
"0.50285226",
"0.50108266",
"0.50064087",
"0.5005621",
"0.50012946",
"0.49936104",
"0.49854344",
"0.49520108",
"0.49472854",
"0.493... | 0.65105945 | 0 |
load the values from sessionStorage and help add input children to the form id 'container' in makeMatches.html | function loadValues(){
const singleValue = sessionStorage.getItem('singleValue')
const coupleValue = sessionStorage.getItem('coupleValue') //not doubled
//this should be the <form>
var mainElement = document.getElementById('container')
//add title: singles and add to mainElement
var singText = document.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storeForm() {\n\t\t\n\t\t$( \".sessioninput\" ).each(function( index ) {\n\t\t\t\n\t\t\twindow.localStorage.setItem($(this).attr(\"name\"), $(this).val());\n\t\t\t\n\t\t});\n\t\t\n\t\t\n\t\tstartSession()\n\t}",
"function redesign(){\n $.each(sessionStorage, function(key, value){\n if (sessionStorag... | [
"0.6239246",
"0.6155249",
"0.6063518",
"0.6026808",
"0.5961372",
"0.584709",
"0.5790058",
"0.57551867",
"0.56944793",
"0.5681123",
"0.5678877",
"0.5661208",
"0.5606837",
"0.5566387",
"0.54967976",
"0.54571176",
"0.54545856",
"0.5441688",
"0.541525",
"0.54105014",
"0.5391767",... | 0.6312915 | 0 |
Axios.delete method that takes from the parent the id of the house to make a delete method to delete that house. | deleteHouse() {
return axios.delete(`/api/houses/${this.props.id}`)
.then(res => {
console.log(res.data.message);
//It refreshes the page after the house has been successfully deleted.
window.location.reload();
}).catch(err => console.log('Edit Hou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onDelete(){\n let id = this.state.details.id;\n axios.delete(`http://localhost:3000/api/patients/${id}`)\n .then(response => {\n this.props.history.push('/patients')\n }).catch(err => console.log(err))\n }",
"deleteHouse(id) {\n housesService.deleteHouse... | [
"0.71628064",
"0.6775667",
"0.6712995",
"0.6637005",
"0.661596",
"0.65666705",
"0.6536698",
"0.6531175",
"0.6487929",
"0.6453775",
"0.6439563",
"0.6428131",
"0.64275724",
"0.64224637",
"0.641868",
"0.6416481",
"0.6401211",
"0.6323162",
"0.631959",
"0.6318361",
"0.63158256",
... | 0.69462776 | 1 |
Axios.edit method that takes from the parent the id of the house to make a edit method to edit that house. | editHouse() {
const { nameInput, addressInput, cityInput, stateInput, zipcodeInput } = this.props;
return axios.put(`/api/houses/${this.props.id}`, { nameInput, addressInput, cityInput, stateInput, zipcodeInput })
.then(res => {
console.log(res.data.house);
//It refreshes the ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"editHouse(houseId, houseObj) {\n axios({\n method: 'put',\n url: 'http://localhost:3005/household?houseId=' + houseId,\n data: houseObj,\n headers: { 'x-access-token': localStorage.getItem('jwt_token') },\n\n })\n .then((response) => {this.getHouse(this.state.currentHouseId);})\n .c... | [
"0.7266509",
"0.65355617",
"0.65029925",
"0.65029925",
"0.65029925",
"0.65029925",
"0.65029925",
"0.65029925",
"0.65029925",
"0.6363243",
"0.6361196",
"0.63116795",
"0.6304149",
"0.6261701",
"0.6247251",
"0.6200408",
"0.6152987",
"0.61368436",
"0.61276",
"0.61213213",
"0.6114... | 0.70637923 | 1 |
Validating for circular dependency injection in "calls" and "arguments" service options | function validateArguments(arg, argType)
{
if (typeof arg == 'string' && arg.match(/^@[a-z_0-9]+$/i)) {
var serviceName = arg.substr(1);
var service = serviceManager.get(serviceName);
if ((
!service.isSingleton()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateEndpointOptions(options)\n{\n if (!options.hasOwnProperty('name') || !checkType(options.name, 'string'))\n throw new Error('Name is required for endpoints');\n if (!options.http || !checkType(options.http, 'object')) throw new Error('http object is required for endpoints');\n if (!... | [
"0.56536037",
"0.53165776",
"0.5261753",
"0.49366248",
"0.4924289",
"0.4883798",
"0.48473522",
"0.48435354",
"0.47576338",
"0.47399735",
"0.47396636",
"0.47359937",
"0.47232196",
"0.4722658",
"0.47118968",
"0.47026163",
"0.46961126",
"0.4679981",
"0.46484706",
"0.46461484",
"... | 0.7094627 | 0 |
Parse the analysis info to show the info correctly formatted. | function parseAnalysisInfo(item) {
switch (item.typ) {
case 'numeric':
item.average = item.data.reduce(function (prev, current) {
return prev + parseInt(current, 10);
}, 0) / item.data.length;
item.template = 'numeric';
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async postParsingAnalysis () {\n var sortedByCount = this.sortEntriesByCount(this.results)\n var topNentries = this.getTopN(sortedByCount, N)\n\n var fileName = `${this.baseOutPath}-${analysisName}.json`\n var fileContent = {\n // Signal and format to visualize as barchart\n piechart: {\n ... | [
"0.57792544",
"0.565212",
"0.5211324",
"0.510422",
"0.50614667",
"0.50311726",
"0.501795",
"0.49658784",
"0.49411014",
"0.49340296",
"0.4920267",
"0.4916049",
"0.4909046",
"0.48603752",
"0.48501563",
"0.48415467",
"0.48336586",
"0.4829979",
"0.4781563",
"0.47672686",
"0.47470... | 0.67443126 | 0 |
Simple verification of the token sent in the auth header Also retrieves information about the user that the portal uses for rendering | async verifyAuth(req, res) {
const user = res.locals.user
logger.log('verbose', 'Verifying authentication token')
res.status(200).json({
email: user.email
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"verifyToken(req, res, next) {\n const token = req.get('Authorization');\n jsonwebtoken_1.default.verify(token, config_1.config.SEED, (err, decode) => {\n if (err) {\n return res.status(401).json({\n err: {\n message: 'Autorization (t... | [
"0.70063764",
"0.69886804",
"0.6943923",
"0.6927475",
"0.69039893",
"0.68739605",
"0.68234646",
"0.679192",
"0.6764138",
"0.6705371",
"0.6684813",
"0.666348",
"0.66609806",
"0.6660918",
"0.6654689",
"0.6647599",
"0.6628279",
"0.66261435",
"0.6624722",
"0.66198015",
"0.6616496... | 0.7210833 | 0 |
Level:7kyu / Write function alternateCase which switch every letter in string from upper to lower and from lower to upper. E.g: Hello World > hELLO wORLD | function alternateCase(s) {
const str = s.split('');
for (let i = 0; i < str.length; i++) {
let c = str[i];
if (c == c.toLowerCase()) {
str[i] = c.toUpperCase();
} else {
str[i] = c.toLowerCase();
}
}
return str.join('');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cycleCase() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Word,\n pat: /\\b([\\w\\- ]+)\\b/g,\n repl: function (_match, p1) {\n ... | [
"0.69263905",
"0.683548",
"0.6728699",
"0.6687766",
"0.65837014",
"0.65824866",
"0.6523228",
"0.6510237",
"0.6421689",
"0.6416255",
"0.64140517",
"0.6411791",
"0.64058614",
"0.63535976",
"0.6328205",
"0.63148236",
"0.63111556",
"0.6291906",
"0.62779814",
"0.6268972",
"0.62603... | 0.7263652 | 0 |
I wanted to showcase one way of doing this with Exercise Two Exercise Three: Create a function called 'sayMyName'. It will take one parameter. Call this parameter 'myName'. Return the phrase "Hello, my name is " and the myName parameter. eg: if name is 'Dan' it should return the string: 'Hello, my name is Dan'. | function sayMyName(myName) {
return ("Hello, my name is " + myName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function myName(name){\n\treturn \"Hello \" + name + \". \";\n}",
"function sayHeyFriend(name) {\n return `Hey, ${name}!`;\n}",
"function wellcome (myName){\n\treturn(\"Hello \"+myName);\n}",
"function sayName(name){\n return `Hi, I'm ${name}`\n}",
"function howdyEd(name){ \n return `Howdy ${name}... | [
"0.81706303",
"0.8064729",
"0.7977922",
"0.79494894",
"0.79225504",
"0.7858403",
"0.7846947",
"0.7835898",
"0.7814357",
"0.7814158",
"0.78101903",
"0.7788003",
"0.77478826",
"0.7743372",
"0.7743086",
"0.76991713",
"0.76920474",
"0.76917654",
"0.76912427",
"0.76663333",
"0.765... | 0.83877015 | 0 |
In case the status is OK, which means the pano was found, compute the position of the streetview image, then calculate the heading, then get a panorama from that and set the options | function getStreetView(data, status) {
if (status == google.maps.StreetViewStatus.OK) {
var nearStreetViewLocation = data.location.latLng;
var heading = google.maps.geometry.spherical.computeHeading(
nearStreetViewLocation, location.marker.position);
infowindow.setConte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, nearStreetViewLocation);\n var panoramaOptions = {\n position: ... | [
"0.75004953",
"0.71983343",
"0.7192496",
"0.7183606",
"0.71759236",
"0.7170377",
"0.71505797",
"0.7132704",
"0.71303034",
"0.7127606",
"0.71114045",
"0.69904333",
"0.6973033",
"0.6955717",
"0.69540703",
"0.6903121",
"0.6902546",
"0.6787787",
"0.66030407",
"0.65495557",
"0.653... | 0.7271388 | 1 |
Add a new route definition | addRoute(route, fn) {
this.routes.push({
params: this._getParams(route),
pattern: this._getPattern(route),
route,
fn
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addRoute(route, callback) {\n this.routes[route] = callback;\n }",
"function addRoute(app, nodecg, bundleName, pageName, graphicName, validationTemplate){\n let handlerReqRes = createHandlerReqRes(nodecg, bundleName, pageName, graphicName, validationTemplate)\n\n let route = getRouteName(bundleNa... | [
"0.7065158",
"0.6968913",
"0.69628465",
"0.68844676",
"0.6667802",
"0.6621975",
"0.6489515",
"0.62913096",
"0.6286274",
"0.626804",
"0.62530696",
"0.6251089",
"0.6202825",
"0.60943925",
"0.6037639",
"0.59772855",
"0.5974325",
"0.59591633",
"0.59430957",
"0.5919407",
"0.591275... | 0.7402329 | 0 |
inserindo tag de desconto | function inserirDesconto() {
if (desconto > 0) {
const divDesconto = document.createElement('div');
divDesconto.classList.add('desconto');
const descricao = document.createElement('h2');
descricao.appendChild(document.createTextNode('Descontos'));
divDesconto.appendChild(descricao);
const divV... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function do_insertTag(tag, value, $caleer){\n _TEXT.init();\n if( value )\n _TEXT.wrapValue(tag, value);\n else\n _TEXT.wrapValue(tag);\n\n if( ($.inArray(tag, [\"FONT\",\"COLOR\",\"SIZE\"]) != -1) && $caleer && $caleer.length ){\n $caleer.closest('ul').hide();\n }\n}",
"function insereTagsImp() {\... | [
"0.5956442",
"0.5941794",
"0.5839076",
"0.5753659",
"0.5752695",
"0.57134116",
"0.570876",
"0.569957",
"0.5641994",
"0.5624713",
"0.5624713",
"0.5620899",
"0.56058115",
"0.56003034",
"0.55894816",
"0.5580709",
"0.5502044",
"0.54742473",
"0.5434358",
"0.5430459",
"0.54081947",... | 0.61183345 | 0 |
Load the sound from URI then play it. | function loadSound(audioContext, sourceNode, uri)
{
let request = new XMLHttpRequest();
request.open('GET', uri, true);
request.responseType = 'arraybuffer';
// Decode the data when loaded
request.onload = function()
{
// Decode the data
audioContext.decodeAudioData(request.response, function(buf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function playSound() {\n console.log('Loading Sound');\n const { sound } = await Audio.Sound.createAsync( // class that creates a sound object\n {uri: RecordedURI} // source of the sound\n );\n setSound(sound); // state of sound\n\n console.log('Playing Sound');\n await sound.playAs... | [
"0.73848957",
"0.71264577",
"0.7013781",
"0.7010579",
"0.6994898",
"0.69374835",
"0.69119984",
"0.69049686",
"0.6888077",
"0.68841666",
"0.6876875",
"0.6867487",
"0.6865312",
"0.68454134",
"0.68318945",
"0.68207437",
"0.6808127",
"0.67585087",
"0.6751802",
"0.67434436",
"0.67... | 0.7195093 | 1 |
activates the map for the markers in the hipsterShops array so they display on the map | function setHipsterMarkers() {
for (var i = 0; i < vm.hipsterShops().length; i++) {
vm.hipsterShops()[i].setMap(map);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initializeMap() {\n var shops = shopsDisplayed();\n\n var mapOptions = {\n disableDefaultUI: true\n };\n\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\n\n window.mapBounds = new google.maps.LatLngBounds();\n\n // only one infoWindow exists. the associated marker and con... | [
"0.7478315",
"0.7350879",
"0.71687746",
"0.7113526",
"0.70951253",
"0.7093128",
"0.7081765",
"0.7073472",
"0.7072551",
"0.7072551",
"0.7072551",
"0.7033872",
"0.7020215",
"0.7014685",
"0.699768",
"0.699768",
"0.69871825",
"0.6986517",
"0.6985365",
"0.6976935",
"0.69570315",
... | 0.7917115 | 0 |
activates the map for the markers in the coffeeShops array so all shops display on the map | function setAllMarkers() {
for (var i = 0; i < vm.coffeeShops().length; i++) {
vm.coffeeShops()[i].setMap(map);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initializeMap() {\n var shops = shopsDisplayed();\n\n var mapOptions = {\n disableDefaultUI: true\n };\n\n map = new google.maps.Map(document.getElementById('map'), mapOptions);\n\n window.mapBounds = new google.maps.LatLngBounds();\n\n // only one infoWindow exists. the associated marker and con... | [
"0.7604984",
"0.7528247",
"0.7092503",
"0.70737803",
"0.7066473",
"0.70555925",
"0.70516557",
"0.7049533",
"0.7049533",
"0.7049533",
"0.7028454",
"0.7027637",
"0.7013102",
"0.69837415",
"0.69837415",
"0.69822997",
"0.6951076",
"0.6949585",
"0.6946252",
"0.6943408",
"0.6942919... | 0.76794946 | 0 |
call stack to reset the markers if the map center changes | function resetMarkers() {
deleteMarkers();
updateShops();
//setAllMarkers();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetMarkers() {\n getMarkers(true);\n }",
"cleanMap() {\n this.savedMarker.forEach(marker => {\n marker.setMap(null);\n });\n this.savedMarker = new Array();\n }",
"function clearMarkers() {\n setMapOnAll(null);\n ... | [
"0.8245331",
"0.7619362",
"0.75880677",
"0.7576495",
"0.7552926",
"0.75473",
"0.7546242",
"0.75349075",
"0.7533989",
"0.75273395",
"0.7511521",
"0.75089693",
"0.75089693",
"0.7506435",
"0.75058794",
"0.7497456",
"0.7486458",
"0.7486458",
"0.7474499",
"0.7474499",
"0.7474499",... | 0.79162925 | 1 |
updates the url for the foursquare ajax call, calls createFSQMarkerList to retrieve new data | function updateShops() {
// update the request:
url = "https://api.foursquare.com/v2/venues/search\?" +
"client_id=" + client_id +
"&client_secret=" + client_secret +
"&v=20170406" +
"&ll=" + map.getCenter().lat().toString() + "," + map.getCenter().lng().toString() +
"&query=coffee" +
"&limi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateFoursquareVenues() {\n\n console.log(\"Updating the list of Foursquare venues.\");\n\n if (localStorage.foursquare_access_token != '') {\n var xhr = new XMLHttpRequest({mozSystem: true, responseType: 'json'});\n xhr.addEventListener(\"load\", transferComplete, false);\n xh... | [
"0.68887043",
"0.673452",
"0.6708424",
"0.66971767",
"0.6667972",
"0.6627289",
"0.6612221",
"0.657941",
"0.6558478",
"0.65529716",
"0.6501771",
"0.64371544",
"0.6416486",
"0.6415048",
"0.63909894",
"0.635543",
"0.6352216",
"0.63432395",
"0.6342053",
"0.62987083",
"0.62459624"... | 0.73138016 | 0 |
info [03: name,cname,desc,cdesc(opt.) for order, 4i4i+3: name, cname, desc,cdesc(opt.) for families] | function myOrder(info){
var tmp = cnrexp.test(info[3]);
var fams = (info.slice(tmp?4:3)).reduce((fam,el,ind,ar)=>{if(frexp.test(el))fam.push({name:el,cname:ar[ind+1],desc:ar[ind+2],cdesc:(cnrexp.test(ar[ind+3]))?ar[ind+3]:ar[ind+1].substring(0,ar[ind+1].length-1)}); return fam;},[]);
return {name:info... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', разработчики: ' + this.getDevelopers() ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}",
"info() { }",
"info() {}",
"info() {}",
"helpInfo () {\n\t\tlet me = this;\n\n\t\treturn [\n\t\t\t$('<h3>').append(\n\t\t\t\tt('Adicionar um novo equ... | [
"0.5548119",
"0.5459815",
"0.54262155",
"0.54262155",
"0.5247108",
"0.52283955",
"0.5200718",
"0.5162523",
"0.5153783",
"0.51195484",
"0.5080379",
"0.50648767",
"0.50451523",
"0.5042561",
"0.50361615",
"0.50248224",
"0.5017161",
"0.50006044",
"0.4999883",
"0.4999883",
"0.4999... | 0.6961134 | 0 |
A normal pokemon card | function PokemonCard({name, weight, height, sprites}) {
/**
* Sometimes we don't have some photos of the pokemon in sprites => for these cases we simply normalize the array
* @return {[]}
* @private
*/
function _normalizeSpritesArray() {
const result = []
if (sprites) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createCard(pokemon) {\n const pokemonEl = document.createElement('div');\n pokemonEl.classList.add('card');\n pokemonEl.classList.add(`${pokemon.types[0].type.name}`)\n const pokeId = (id) => {\n if(id < 10) { return id = \"00\"+id }\n if(id < 100) { return id = \"0\"+id }\n ... | [
"0.73981005",
"0.7101847",
"0.70581186",
"0.70298195",
"0.6960421",
"0.68724495",
"0.68482965",
"0.6838788",
"0.678933",
"0.6775325",
"0.6767266",
"0.6724145",
"0.66936535",
"0.6651037",
"0.66507876",
"0.6605914",
"0.6602766",
"0.65825933",
"0.6561418",
"0.65562624",
"0.65062... | 0.7279483 | 1 |
get the user answer for the question | function getUserAnswer() {
userAnswer = this.value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAnswer() {\n var currentAnswer = questions[questionIndex].answer;\n return currentAnswer;\n}",
"function getUserAnswer() {\n var radios = document.getElementsByName(\"question\" + currentQuestion + \"Choices\");\n for (var i=0, len=radios.length; i<len; i++) { \n if ( radios[i].ch... | [
"0.7705981",
"0.7537941",
"0.74595135",
"0.7443146",
"0.7411078",
"0.7346086",
"0.7229886",
"0.7206223",
"0.7170275",
"0.7127186",
"0.71083295",
"0.7095049",
"0.70932937",
"0.7064359",
"0.70349425",
"0.7028017",
"0.69909406",
"0.6920268",
"0.6911862",
"0.6888142",
"0.6877115"... | 0.7811503 | 0 |
display the score and max score | function displayScore() {
id("this-score").innerText = scoreGot;
id("score").innerText = score;
id("max-score").innerText = maxScore;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateScores() {\n lastScore.innerText = 'Last score: ' + score;\n if (score > bestScore) {\n bestScore = score;\n displayBestScore.innerText = 'Best Score: ' + bestScore;\n }\n}",
"function maxscore(v){\r\n if(v>temp){\r\n document.getElementById('score').innerHTML=v;\r\n temp=v;\r\n }\r... | [
"0.72259367",
"0.7166939",
"0.71146166",
"0.710234",
"0.70883393",
"0.7008858",
"0.6975881",
"0.693796",
"0.6885247",
"0.68834007",
"0.6829007",
"0.68217736",
"0.6756108",
"0.67254865",
"0.6697105",
"0.6696857",
"0.6690247",
"0.6664905",
"0.66644704",
"0.66397285",
"0.6631771... | 0.7450956 | 0 |
Logs the server's mode (based on command line arguments). | function logServeMode() {
switch (getServeMode()) {
case 'compiled':
log(green('Serving'), cyan('minified'), green('JS'));
break;
case 'cdn':
log(green('Serving'), cyan('current prod'), green('JS'));
break;
case 'rtv':
log(green('Serving JS from RTV'), cyan(`${argv.rtv}`));
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setLogMode(mode) {\n logMode = mode;\n }",
"function logServerStarted(opt = {}) {\n let message = _chalk2.default.green(`Running ${(opt.chalk || _chalk2.default.bold)(opt.type)} in ${_chalk2.default.bold(\"production\")} mode\\n\\n`);\n message += `- ${_chalk2.default.bold('Local: ')} ${... | [
"0.7017706",
"0.61727923",
"0.61243236",
"0.6036964",
"0.59355366",
"0.58350223",
"0.5827964",
"0.5822797",
"0.5806406",
"0.57962644",
"0.57662386",
"0.57612896",
"0.5758441",
"0.5755882",
"0.5753237",
"0.57353216",
"0.56987256",
"0.56525284",
"0.56496745",
"0.5635511",
"0.56... | 0.7034946 | 0 |
Clears server files from the require cache to allow for inprocess server livereload. | function resetServerFiles() {
for (const serverFile in serverFiles) {
delete require.cache[serverFiles[serverFile]];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reset() {\n delete require.cache[\n require.resolve('../../../app/scripts/persistence/file-system')\n ];\n fileSystem = require('../../../app/scripts/persistence/file-system');\n}",
"function clearCache() {\n util._.each(util._.keys(exports.instances), function (x) {\n exports.in... | [
"0.6399097",
"0.6380369",
"0.62903816",
"0.62805015",
"0.62805015",
"0.62805015",
"0.62756014",
"0.62715155",
"0.6248886",
"0.6248886",
"0.6248886",
"0.6228344",
"0.62174726",
"0.6162928",
"0.61308926",
"0.61308926",
"0.6098531",
"0.6028619",
"0.5985888",
"0.5954043",
"0.5953... | 0.8011539 | 0 |
Closes the existing server and restarts it | function restartServer() {
stopServer();
resetServerFiles();
startServer();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"restartServer() {\n this.subscriptions.dispose();\n this.restartAllServers().then(() => {\n atom.notifications.addInfo(\"HIE is has been restarted, and is currently initializing!\");\n }).catch(() => {\n atom.notifications.addError(\"Something went wrong trying to restart HIE!\");\n });\n }"... | [
"0.67607594",
"0.67113626",
"0.6657232",
"0.6415819",
"0.6340941",
"0.62820715",
"0.6280169",
"0.621871",
"0.62076914",
"0.6110106",
"0.6082749",
"0.6047232",
"0.60236126",
"0.5981814",
"0.5975383",
"0.5931223",
"0.5924677",
"0.5924677",
"0.5918727",
"0.5894405",
"0.5894405",... | 0.7028438 | 0 |
Performs prebuild steps requested via command line args. | async function performPreBuildSteps() {
if (!argv._.includes('serve')) {
await preBuildRuntimeFiles();
await preBuildExtensions();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function main() {\n const dependencyList = core.getInput('dependencies')\n const rubyVersion = core.getInput('ruby-version')\n\n try {\n // restores from cache if this ruby version was previously built and cached\n await restoreRubyFromCache(rubyVersion)\n\n // skip setting up environment when we... | [
"0.5868521",
"0.57294524",
"0.5530801",
"0.54517436",
"0.5391639",
"0.53854394",
"0.5311685",
"0.52343726",
"0.522536",
"0.52217823",
"0.5170509",
"0.5159092",
"0.51466674",
"0.51434726",
"0.5067327",
"0.5058444",
"0.50519866",
"0.50274813",
"0.5006663",
"0.4960746",
"0.49230... | 0.73007375 | 0 |
Composes the menu from user's roles. | function composeMenu(path) {
//before composes the menu, refresh the currentUser
$rootScope.currentUser = AuthenticationService.currentUser();
$rootScope.hasRightToSwitchSchool = false;
$rootScope.currentUser.roles.forEach(function (i, index) {
i.permissions.forEach(function ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function modulesMenuServiceProvider(USER_ROLES) {\n var _items = [];\n var items = [];\n this.addItem = addItem;\n this.$get = modulesMenuService;\n\n function addItem(item) {\n items.push(item);\n return this;\n }\n\n function modulesMenuService() {\n return {\n ... | [
"0.6348573",
"0.6268304",
"0.6240785",
"0.6097315",
"0.60076493",
"0.5938201",
"0.5887142",
"0.58734673",
"0.57939184",
"0.5791116",
"0.57660174",
"0.5696402",
"0.56909895",
"0.5657032",
"0.56364584",
"0.5636066",
"0.5629283",
"0.56046015",
"0.5604295",
"0.5591175",
"0.558624... | 0.6535716 | 0 |
Route change start handler. It does authorization and authentication at client side. It redirects to login page if user has not login yet. It redirects to home page if user is trying to access a location which he does not have access to. Also it composes the menu for the new page and store it in $rootScope. | function onRouteChangeStart() {//cy 当且仅当路由发生改变时 才会触发
//console.log('On route change start : ' + $location.path() + ', authenticated = ' + AuthenticationService.authenticated());
$rootScope.isChrome = true;
$rootScope.setVersions = 'v=1000';
$rootScope.authenticated = AuthenticationServi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onRouteChangeStart(event, next, current) {\n // Check Whether User Logged In Or Not..\n var isLoggedIn = AuthServ.isLoggedIn();\n $scope.isLoggedIn = isLoggedIn;\n\n // Check Whether The Next Route Needs Authentication..\n var isAuthNeeded = !(next.$$... | [
"0.72558653",
"0.71774393",
"0.65942466",
"0.65175545",
"0.63993657",
"0.62416184",
"0.6150243",
"0.6059882",
"0.6059324",
"0.60149604",
"0.59382993",
"0.59036946",
"0.5898718",
"0.5896893",
"0.5879085",
"0.587717",
"0.58651686",
"0.5847986",
"0.57947105",
"0.5792238",
"0.578... | 0.74246764 | 0 |
Change the current user's landline | function changeLandline() {
$rootScope.landline = AuthenticationService.currentUser().landline;
$rootScope.pwdModalTitle = '修改座机号';
$rootScope.pwdModal = $modal({
scope: $rootScope,
templateUrl: 'partials/modal.changeLandline.html?' + new Date().getTime(),
sho... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setEditable() {\n if (!this.currentVertex())\n return;\n modules.map.setEditable(this.currentVertex());\n this.currentVertex().forEach(e => e.type === edge.prototype.LANDMARK ? modules.map.createLine(e) : {});\n }",
"function endUserLocation() {\n $scope.endUserLocat... | [
"0.5406484",
"0.5406475",
"0.535832",
"0.5344007",
"0.51634634",
"0.51221204",
"0.5113044",
"0.5109928",
"0.510784",
"0.510373",
"0.50896555",
"0.50873554",
"0.5077124",
"0.5076751",
"0.50735676",
"0.50735676",
"0.50735676",
"0.50735676",
"0.50735676",
"0.50735676",
"0.507356... | 0.6849482 | 0 |
2 Given an integer n, return the largest number that contains exactly n digits. | function largestNumber(n) {
let x=""
for(i=0;i<n;i++){
x+="9";
}
return parseInt(x);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nextBigger(n){\n let arr = n.toString().split(\"\") // creates string from number and splits it to an array\n let num = -1\n for (let i = arr.length-1; i >0; i--) { // sets up loop to look for the moment when the digit to the right if \"i\" is larger than \"i\"\n if (arr[i] > arr[i-1]) {\n num ... | [
"0.75720143",
"0.73524094",
"0.70424557",
"0.7020435",
"0.6940909",
"0.68808895",
"0.6875764",
"0.6851013",
"0.6840362",
"0.6756019",
"0.67396307",
"0.67253923",
"0.6714677",
"0.67080706",
"0.6707665",
"0.67012227",
"0.66784406",
"0.66045105",
"0.6604251",
"0.66033584",
"0.65... | 0.8087356 | 0 |
6 Consider integer numbers from 0 to n 1 written down along the circle in such a way that the distance between any two neighbouring numbers is equal (note that 0 and n 1 are neighbouring, too). Given n and firstNumber, find the number which is written in the radially opposite position to firstNumber. | function circleOfNumbers(n, firstNumber) {
let x = 360/n;
let y = 180/x;
let z = y + firstNumber;
console.log(z);
if(z == n){
return 0;
}
if(z > n){
return firstNumber - n + y;
}
else{
return z;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function circleOfNumbers(n, firstNumber) {\nlet half = n/2;\nlet result = firstNumber + half;\n if(result > (n-1)){\n result = result - n;\n }\n return result;\n}",
"function circleOfNumbers(n, firstNumber) {\n if(firstNumber === n/2) return 0\n if(firstNumber === 0) return n/2\n return firstN... | [
"0.75885785",
"0.73849577",
"0.6621671",
"0.6410127",
"0.62272894",
"0.6202316",
"0.61840105",
"0.6072027",
"0.60603124",
"0.6002228",
"0.5982601",
"0.59659547",
"0.59591484",
"0.5954711",
"0.59245104",
"0.5920371",
"0.59187126",
"0.5906034",
"0.5881427",
"0.584323",
"0.57928... | 0.7406075 | 1 |
9 You are playing an RPG game. Currently your experience points (XP) total is equal to experience. To reach the next level your XP should be at least at threshold. If you kill the monster in front of you, you will gain more experience points in the amount of the reward. Given values experience, threshold and reward, ch... | function reachNextLevel(experience, threshold, reward) {
if(experience + reward >= threshold){
return true;
}
else{
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkExperience(experience, level) {\n const y = (BASE*level) * (Math.pow(Math.E, level));\n return experience >= y ? ++level : level;\n}",
"function CalculateNewLevel(CurrentExp, totalExpGained, skill) {\n\tif (skill === \"Herblore\") {\n\t\tvar newExp = (parseInt(CurrentExp) + parseInt(totalExpGaine... | [
"0.6511854",
"0.62288857",
"0.62010974",
"0.61651933",
"0.61651933",
"0.59684587",
"0.5840017",
"0.5822921",
"0.57359904",
"0.5694828",
"0.56092906",
"0.5608095",
"0.5587262",
"0.55057096",
"0.5487366",
"0.54588145",
"0.5378442",
"0.53592193",
"0.5346512",
"0.53423965",
"0.53... | 0.79250515 | 0 |
12 Given integers a and b, determine whether the following pseudocode results in an infinite loop while a is not equal to b do increase a by 1 decrease b by 1 Assume that the program is executed on a virtual machine which can store arbitrary long numbers and execute forever. | function isInfiniteProcess(a, b) {
if(a>b){
return true;
}
if((b-a)%2 == 0){
return false;
}
else{
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isInfiniteProcess(a, b) {\r\n if ( a > b ) return true;\r\n else if ( a % 2 !== b % 2 ) return true;\r\n else return false;\r\n}",
"function checkNumber(a, b) {\n if (a == 8 || b == 8) {\n console.log(true);\n } else if (a + b == 8) {\n console.log(true);\n } else if (a -... | [
"0.6863653",
"0.63695043",
"0.6337371",
"0.62940246",
"0.6270229",
"0.62596625",
"0.6182761",
"0.6178696",
"0.6059772",
"0.6050514",
"0.6019056",
"0.59483397",
"0.5946127",
"0.59189713",
"0.59090036",
"0.59004056",
"0.59004056",
"0.58780265",
"0.5872267",
"0.5865196",
"0.5861... | 0.68272257 | 1 |
14 In tennis, a set is finished when one of the players wins 6 games and the other one wins less than 5, or, if both players win at least 5 games, until one of the players wins 7 games. Determine if it is possible for a tennis set to be finished with the score score1 : score2. | function tennisSet(score1, score2) {
if(score1>7 || score2>7){
return false;
}
if(score1==7 && score2==7){
return false;
}
if(score1>6 && score2<5){
return false;
}
if(score2>6 && score1<5){
return false;
}
if(score1 == 7 || score2==7){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decodeSet(set, data) {\n var score = [0, 0];\n while(data.length > 0) {\n var game = new Game();\n game.tieBreak = (score[0] == 6 && score[1] == 6) ? 'yes' : 'no';\n if (!decodeGame(game, data)) {\n return false;\n }\n togglePlayer = 1 - togglePlayer;\n ... | [
"0.65392745",
"0.6527893",
"0.647203",
"0.6463552",
"0.6424066",
"0.6398534",
"0.63730496",
"0.62527084",
"0.6243278",
"0.6217536",
"0.6200734",
"0.61509645",
"0.6148525",
"0.61435324",
"0.6138242",
"0.6128749",
"0.61271006",
"0.6106693",
"0.6069265",
"0.60556173",
"0.6054647... | 0.662519 | 0 |
15 Once Mary heard a famous song, and a line from it stuck in her head. That line was "Will you still love me when I'm no longer young and beautiful?". Mary believes that a person is loved if and only if he/she is both young and beautiful, but this is quite a depressing thought, so she wants to put her belief to the te... | function willYou(young, beautiful, loved) {
if(young === true && beautiful === true && loved === true){
return false;
}
if(young === true && beautiful === true && loved === false){
return true;
}
if(young === false && beautiful === false && loved === false){
return fa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function feelsEvil() {\n let mood = getMood();\n\n let chance = 0;\n\n if (mood === VERY_PLEASED_MOOD) {\n chance = getStrictnessForCharacter() * 10;\n } else if (mood === PLEASED_MOOD) {\n chance = getStrictnessForCharacter() * 15;\n } else if (mood === NEUTRAL_MOOD) {\n chance... | [
"0.6190381",
"0.5944442",
"0.57293177",
"0.57252717",
"0.5724166",
"0.5715417",
"0.5708072",
"0.570125",
"0.5701159",
"0.5674596",
"0.5664123",
"0.5646787",
"0.55982983",
"0.5595989",
"0.5590684",
"0.5578247",
"0.55712414",
"0.55339515",
"0.55328494",
"0.54935604",
"0.5472649... | 0.6347335 | 0 |
16 You just bought a public transit card that allows you to ride the Metro for a certain number of days. Here is how it works: upon first receiving the card, the system allocates you a 31day pass, which equals the number of days in January. The second time you pay for the card, your pass is extended by 28 days, i.e. th... | function metroCard(lastNumberOfDays) {
if(lastNumberOfDays == 31){
return [28,30,31];
}
if(lastNumberOfDays == 30){
return [31];
}
if(lastNumberOfDays == 28){
return [31];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function aceOptions(num) {\n let optionsArr = [];\n for (let i = 0; i <= num; i++) {\n let total = (11 * i) + (num - i);\n optionsArr.push(total);\n }\n return optionsArr;\n}",
"function antiguedadGrado(fecha, fecha_retiro){ \n var arr = [];\n \n var fecha_r = fecha_retiro.split(\"-\");\n ... | [
"0.5829728",
"0.58044237",
"0.570187",
"0.54956555",
"0.5402465",
"0.5353271",
"0.5352674",
"0.5274337",
"0.52642894",
"0.52318",
"0.52216715",
"0.52025926",
"0.5193502",
"0.51539147",
"0.51098955",
"0.5088647",
"0.50859314",
"0.5085766",
"0.50812286",
"0.50760883",
"0.507123... | 0.6231833 | 0 |
17 In order to stop the Mad Coder evil genius you need to decipher the encrypted message he sent to his minions. The message contains several numbers that, when typed into a supercomputer, will launch a missile into the sky blocking out the sun, and making all the people on Earth grumpy and sad. You figured out that so... | function killKthBit(n, k) {
return n & ~(1 << (k - 1)) ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function killKthBit(n, k) {\n return n.toString(2)[ n.toString(2).length - k ] == '1' ?\n n -= 2 ** (k - 1) : n;\n}",
"function intakeBits(amt){\r\n\r\n}",
"function flippingBits(N) {\n // 2진수 만들기\n // let binaryArr = [];\n // while (N >= 1) {\n // binaryArr.unshift(N % 2 === 1 ? 0 : 1);\n // ... | [
"0.70278865",
"0.6324414",
"0.6135732",
"0.6056887",
"0.591834",
"0.5910088",
"0.5898333",
"0.58630955",
"0.5858546",
"0.58027804",
"0.57981086",
"0.5780991",
"0.5780991",
"0.5780991",
"0.5780991",
"0.5780991",
"0.5780991",
"0.5780991",
"0.5780991",
"0.5780991",
"0.5780991",
... | 0.66354597 | 1 |
21 Presented with the integer n, find the 0based position of the second rightmost zero bit in its binary representation (it is guaranteed that such a bit exists), counting from right to left. Return the value of 2position_of_the_found_bit. | function secondRightmostZeroBit(n) {
return -~((n-~(n^(n+1))/2)^(n-~(n^(n+1))/2+1))/2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNthBit(bit, number) {\n\treturn (number >> bit) % 2;\n}",
"function differentRightmostBit(n, m) {\n return 2 ** Number(n^m).toString(2).split('').reverse().indexOf('1');\n}",
"function getBit(n, i) {\n const mask = 1 << i;\n return (n & mask) === 0 ? 0 : 1;\n}",
"function read_bits_n(buf, ... | [
"0.6865355",
"0.68280303",
"0.65139073",
"0.6419619",
"0.6419619",
"0.6419619",
"0.6419619",
"0.63447315",
"0.62803787",
"0.6213091",
"0.61601615",
"0.61494464",
"0.61405355",
"0.61405355",
"0.61405355",
"0.61405355",
"0.61405355",
"0.61405355",
"0.61405355",
"0.6138966",
"0.... | 0.75025326 | 0 |
Function to update the id of each task | function updateTaskID() {
for (let i = 0; i < tasks.length; i++) {
tasks[i].id = i;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function assignTaskID() {\n const data = $(\"body\").data();\n const taskID = data.taskID + 1;\n data.taskID++;\n return taskID;\n}",
"function updateTask(task, id){\n API.updateTask(task, id)\n .then(()=>{\n getTasks();\n }).catch();\n }",
"getTaskById(taskId) ... | [
"0.7001959",
"0.69833577",
"0.6838177",
"0.6727286",
"0.6669283",
"0.6615914",
"0.6578282",
"0.65507",
"0.6548268",
"0.65353197",
"0.65208286",
"0.6491015",
"0.645844",
"0.64542705",
"0.6427806",
"0.64124465",
"0.63835955",
"0.63051784",
"0.62981427",
"0.62737757",
"0.6250211... | 0.9043012 | 0 |
Ends the editing of a task | function endEdit(){
// Reset task form and update UI
displayTaskForm();
updateUI()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function editTask() {\n vm.task = {};\n jQuery('#editTaskModal').modal('hide');\n }",
"function endTask() {\r\n\tvar parentdiv = $(event.target).parent(\"div\"); //div belonging to button clicked\r\n\tvar id = parentdiv.attr(\"id\").substring(4); //div id is always \"task###\" and w... | [
"0.6951231",
"0.6744683",
"0.6641652",
"0.6576084",
"0.6571801",
"0.65600127",
"0.6552153",
"0.6545739",
"0.64132696",
"0.6395056",
"0.63864416",
"0.638267",
"0.63766474",
"0.6351708",
"0.6343078",
"0.6305321",
"0.6294199",
"0.62925464",
"0.62515795",
"0.62515795",
"0.6251579... | 0.828804 | 0 |
loading the prefs when the page is called to show the current values | async function load_Prefs() {
let prefs = await browser.storage.local.get("Prefs");
let settings = prefs.Prefs;
if (settings != null && settings != undefined){
for (let key of Object.keys(settings)){
let elem = document.getElementById(key);
if (!elem) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reloadPagePreferences() {\n TimelineEventTypes.forEach(function (type) {\n // Prefs are stored as strings, UI tests on booleans, so we\n // convert here.\n var pref_name = 'display_events_' + type;\n $scope[pref_name] = Preference.get(... | [
"0.68751746",
"0.68716097",
"0.6833777",
"0.6722907",
"0.6697769",
"0.6672997",
"0.6638484",
"0.66007805",
"0.6580316",
"0.65279764",
"0.6506473",
"0.64979565",
"0.6493708",
"0.64511764",
"0.64505583",
"0.6445924",
"0.6426123",
"0.6413257",
"0.63939774",
"0.6390692",
"0.63199... | 0.725783 | 0 |
resets the values of the sliders and checkbox to the standard values given in DEFAULT_VALUES | function resetValues(){
document.getElementById("localOnly").checked = DEFAULT_VALUES.local_only;
document.getElementById("spf_slider").value = DEFAULT_VALUES.spf_value;
document.getElementById("tz_slider").value = DEFAULT_VALUES.tz_value;
document.getElementById("bl_slider").value = DEFAULT_VALUES.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function restoreDefaults(){\r\n\tvar amountString = \"\";\r\n\tvar sliderString = \"\";\r\n\tfor (var i=0;i<inputs.length;i++){\r\n\t\tamountString = \"#amount\"+i;\r\n\t\tsliderString = \"#slider\"+i;\r\n\t\t$(amountString).val(getInputDefault(i));\r\n\t\t$(sliderString).slider('value',getInputDefault(i));\r\n\t}... | [
"0.70631",
"0.6959838",
"0.69518346",
"0.69119173",
"0.68762845",
"0.68520117",
"0.67743826",
"0.67295986",
"0.6727447",
"0.6723409",
"0.6706961",
"0.6689866",
"0.6662975",
"0.663373",
"0.66101176",
"0.65902805",
"0.65880215",
"0.65749145",
"0.6554257",
"0.65374404",
"0.65275... | 0.7973158 | 0 |
Destroys the chip and removes the root element from the DOM. | remove() {
this.root_.parentNode.removeChild(this.root_);
this.destroy();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"destroy() {\n\t\tthis.element.remove();\n\t}",
"destroy() {\n this.element.remove();\n }",
"destroy() {\n this.element.remove();\n }",
"destroy() {\n this.element.remove();\n }",
"destroy() {\n this.element.remove();\n }",
"destroy() {\n this.node.parentNode.rem... | [
"0.6720328",
"0.66434497",
"0.66434497",
"0.66434497",
"0.66434497",
"0.66431886",
"0.6558507",
"0.6543027",
"0.6531152",
"0.6505842",
"0.6482889",
"0.64515436",
"0.6446626",
"0.6446626",
"0.6446626",
"0.6446626",
"0.6446626",
"0.6446626",
"0.6446626",
"0.6446626",
"0.6446626... | 0.66609 | 1 |
Creates the permutationSum, i.e., AAA, AAA + AAB, etc... | function sum(numPermutations) {
var total = 0;
for (var i = 0; i < numPermutations; ++i) {
total += permutationProduct[i];
}
permutationSum.push(total);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculatePermutations(){\n \n // Calculate number of possible permutations\n var permutations = str(adjective.length * medium.length * material1.length * material2.length * action.length * subject.length);\n \n return permutations;\n}",
"function numOfPermutations(lettersArr) { let num = 1; for (le... | [
"0.6039219",
"0.5978859",
"0.591615",
"0.5631883",
"0.5629683",
"0.5554739",
"0.55327183",
"0.55252844",
"0.5483451",
"0.5462695",
"0.5442846",
"0.5442135",
"0.54414797",
"0.54305124",
"0.5401994",
"0.5375768",
"0.5367255",
"0.5288896",
"0.5284743",
"0.5284143",
"0.52589834",... | 0.7132627 | 0 |
Create a new effort | addEffort (contributorId, title) {
console.log('addEffort:', contributorId, title);
let user = Auth.requireAuthentication();
// Validate the data is complete
check(contributorId, String);
check(title, String);
// Validate that the current user is an administrator
if (user.managesCo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createAssignment(assignment_name_to_create, assignment_points_to_create, klass_id_to_create) {\n return new Promise(\n (resolve, reject) => {\n $.post(\"/create_assignment\", {assignment_name: assignment_name_to_create, assignment_points: assignment_points_to_create, klass_id: klass_i... | [
"0.58182776",
"0.57915616",
"0.5630224",
"0.55686414",
"0.5490302",
"0.54829186",
"0.54069054",
"0.5340643",
"0.53130823",
"0.5301229",
"0.52931714",
"0.52759945",
"0.52551264",
"0.525477",
"0.5251128",
"0.52378577",
"0.52287674",
"0.5224465",
"0.5222639",
"0.522009",
"0.5205... | 0.67806095 | 0 |
Edit an effort record | editEffort (effortId, key, value) {
console.log('editEffort:', effortId, key);
let user = Auth.requireAuthentication();
// Validate the data is complete
check(effortId, String);
check(key, String);
check(value, Match.Any);
// Load the effort to authorize the edit
let effort = E... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function editAdmit() {\n var testAdmit = {\n KEYID: $scope.currentAdmitKEYID,\n PATSTATUS: 'A',\n SOCDATE: $scope.M0030_START_CARE_DT\n };\n dataService.edit('admission', testAdmit).then(function(response){\n console.log(response);\n });\n //edit patient table to udpate PATSTAT... | [
"0.6691608",
"0.6631969",
"0.6631969",
"0.6631969",
"0.6631969",
"0.6631969",
"0.6631969",
"0.6631969",
"0.6605853",
"0.660182",
"0.66009843",
"0.65722394",
"0.6469157",
"0.63875973",
"0.62887794",
"0.62544256",
"0.6248132",
"0.6178968",
"0.61541724",
"0.6138888",
"0.608562",... | 0.75039375 | 0 |
Delete an effort record | deleteEffort (effortId) {
console.log('deleteEffort:', effortId);
let user = Auth.requireAuthentication();
// Validate the data is complete
check(effortId, String);
// Load the effort to authorize the edit
let effort = Efforts.findOne(effortId);
// Validate that the current us... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteRecord(db, table, key) {\n var $def = $.Deferred();\n var transaction = db.transaction([table], 'readwrite');\n var req = transaction.objectStore(table).delete(key);\n req.onerror = function(e) {\n $def.reject('delete record failed');\n };\n trans... | [
"0.65259814",
"0.64361227",
"0.6429147",
"0.63906795",
"0.634292",
"0.6329621",
"0.6316811",
"0.63119453",
"0.6237533",
"0.6235598",
"0.6234098",
"0.6210239",
"0.61986995",
"0.6189739",
"0.61794937",
"0.617141",
"0.6151328",
"0.61478114",
"0.6133568",
"0.6124235",
"0.6118613"... | 0.6909796 | 0 |
GET EVEN 1. Write a for loop that will log only the even numbers 0 through 200. | function even(){
for(let i = 0; i <= 200; i++){
if(i % 2 === 0){
console.log(i);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function evenNumber(){\n for(i=0;i<=100;i++){\n if(i%2==0){\n console.log(i);\n }\n }\n}",
"function evenNumbers () {\n for (i= 0; i <= 100; i++) {\n if (i % 2 === 0) {\n console.log(i);\n }\n }\n}",
"function evens() {\n for (let i = 0; i < 101; i++... | [
"0.8176424",
"0.8111341",
"0.8038646",
"0.79745764",
"0.79341483",
"0.790572",
"0.76803493",
"0.7538085",
"0.75313365",
"0.75073445",
"0.74524146",
"0.7421149",
"0.7302323",
"0.72653353",
"0.7264084",
"0.7257706",
"0.7243938",
"0.72403353",
"0.7209677",
"0.7209677",
"0.719106... | 0.84543794 | 0 |
FIZZ BUZZ Write a javascript application that logs all numbers from 1 100. If a number is divisible by 3 log "Fizz" instead of the number. If a number is divisible by 5 log "Buzz" instead of the number. If a number is divisible by 3 and 5 log "FizzBuzz" instead of the number. | function number(){
for(let i = 1; i <= 100; i++){
if(i % 3 === 0 && i % 5 === 0){
console.log("FizzBuzz")
}else if(i % 3 === 0){
console.log("Fizz");
}else if(i % 5 === 0){
console.log("Buzz");
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fizzBuzz() {\r\n for(i = 1; i<101;i++)\r\n {\r\n if(i%3===0 && i%5===0)\r\n console.log(\"FizzBuzz\")\r\n else if(i%3===0)\r\n console.log(\"Fizz\")\r\n else if(i%5===0)\r\n console.log(\"Buzz\")\r\n else \r\n console.log(i);\r\n }\r\n}",
"function fizzBuzz() {\n fo... | [
"0.8298282",
"0.8276816",
"0.8255407",
"0.8210462",
"0.8188261",
"0.81745416",
"0.8167547",
"0.81495696",
"0.81465656",
"0.8112006",
"0.8110686",
"0.8099414",
"0.8084233",
"0.8081709",
"0.807872",
"0.8075186",
"0.80710727",
"0.8061298",
"0.8058976",
"0.8058227",
"0.8053026",
... | 0.8276855 | 1 |
Creates new pipe function depending on mask type, source and destination options | function createPipe(mask) {
var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : PIPE_TYPE.MASKED;
var to = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : PIPE_TYPE.MASKED;
var masked = Object(_factory_js__WEBPACK_IMPORTED_MODULE_0__["default"])(mask);
return funct... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createPipe(mask) {\n\t var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : PIPE_TYPE.MASKED;\n\t var to = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : PIPE_TYPE.MASKED;\n\t var masked = createMask(mask);\n\t return function (value) {\n\t return mask... | [
"0.7454119",
"0.61895776",
"0.61248296",
"0.6095053",
"0.59070104",
"0.5749059",
"0.57185763",
"0.56605685",
"0.5462969",
"0.5433761",
"0.5433761",
"0.5371092",
"0.5371092",
"0.5371092",
"0.5368081",
"0.5368081",
"0.5368081",
"0.5368081",
"0.5249515",
"0.5249515",
"0.5249515"... | 0.7379061 | 1 |
1. The Greatest Thing Since Sliced Bread Find the onclick event in the h3 element and create a function that will italicize the contents and change the font color to cornflowerblue in the div id of 'bread'. | function italics(){
bread.style.color = 'cornflowerblue';
bread.style.fontStyle = 'italic';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onClick(){\n myitem.style.color = \"green\";\n //When the onClick function is ran, the text located withing the tag is turned green.\n myitem.style.fontFamily = \"serif\";\n}",
"function changeText2() {\n var sen = document.getElementById(\"changeMe\");\n var sen2 = document.getElementByI... | [
"0.6404448",
"0.6011137",
"0.59347045",
"0.57784545",
"0.5737736",
"0.5723019",
"0.57202834",
"0.5688307",
"0.5651693",
"0.5633589",
"0.5625474",
"0.56247056",
"0.562204",
"0.55999607",
"0.55972123",
"0.5522252",
"0.5520257",
"0.55136037",
"0.5500019",
"0.54883003",
"0.547203... | 0.66543126 | 0 |
This function handles fire logic. First it updates the crosshair, and determines the players position. Next it increments the bullet count (to keep track of how often the player shot), and the current bullet counter (to keep track of which bullet is in use). If the bullet is not currently in use, initialize the paramet... | function fire(e){
if(!gameOver){
// First update the crosshair;
updateCrosshair(e);
// Next figure out the players position
// This is where the bullet will go.
var playerposx = $("#player").x() + (PLAYER_WIDTH - BULLET_SIZE)/2;
var playerposy = $("#player").y() + (P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fire(target_x, target_y){\n\t\tif (this.type == \"player\"){\n\t\t\t// the player fires\n\t\t\t// check if the player has enough bullets\n\t\t\tif (this.bullets <= 0){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.bullets -= 1;\n\t\t\tvar actual_x = this.stage.canvas_width / 2 + this.length / 2; // the x-coordinate of the... | [
"0.7467752",
"0.6974876",
"0.687176",
"0.67736113",
"0.676597",
"0.6764488",
"0.66810304",
"0.6598374",
"0.6584932",
"0.65623945",
"0.6548679",
"0.6542521",
"0.6521711",
"0.6489509",
"0.64800537",
"0.6476197",
"0.64121306",
"0.63882905",
"0.63759476",
"0.637124",
"0.6365022",... | 0.80519986 | 0 |
Handler to print result of scan / query | function printResult(result) {
ResultSet.printScanResult(result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleEvent(event){\r\n \r\n var results = event.results;\r\n\r\n cli.print(format(results));\r\n }",
"function showResults() {\n\t\t\t\tconsole.clear();\n\t\t\t\tconsole.log(data);\n\t\t\t}",
"function output(result){ console.log(result); }",
"function logResults(data) {\n con... | [
"0.6417668",
"0.62243545",
"0.61114925",
"0.60704213",
"0.5867157",
"0.580187",
"0.57753223",
"0.57655424",
"0.57222027",
"0.5696906",
"0.56613225",
"0.5658899",
"0.56216985",
"0.5611882",
"0.557645",
"0.5575528",
"0.5566258",
"0.55255646",
"0.5519727",
"0.54715437",
"0.54636... | 0.70076275 | 0 |
set the classname of all toolSelector elements to emptyString | function resetAllToolselectionClasses(){
document.getElementById("tool-toolSelector-paint").className = "";
document.getElementById("tool-toolSelector-erase").className = "";
document.getElementById("tool-toolSelector-select").className = "";
document.getElementById("tool-toolSelector-move").className =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearAll() {\n for (var i = 0; i < tds.length; i++) {\n tds[i].className = '';\n }\n }",
"updateStyling() {\n this.optionTargets.forEach((elem) => elem.classList = '')\n }",
"function resetCss() {\n\t\tif (element) {\n\t\t\telement.className = Command.css.base + \" \" +... | [
"0.6416236",
"0.62461525",
"0.6207515",
"0.6074546",
"0.6034519",
"0.5967787",
"0.5880889",
"0.5880853",
"0.5858507",
"0.58578455",
"0.58402175",
"0.5803446",
"0.57752836",
"0.57538617",
"0.5732569",
"0.5714513",
"0.57109344",
"0.568044",
"0.56636804",
"0.56562334",
"0.564813... | 0.7754828 | 0 |
prepend or append count zeros to a string. | function _zeroPad(str, count, left) {
var l;
for (l = str.length; l < count; l += 1) {
// eslint-disable-next-line no-param-reassign
str = (left ? ('0' + str) : (str + '0'));
}
return str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addLeadingZero(str) {\n return str.length < 2 ? `0${str}` : str\n}",
"function padZero(str) {\n var len = 2;\n var zeros = new Array(len).join('0');\n return (zeros + str).slice(-len);\n }",
"function prependZero(time, length) {\n time = new String(time);\... | [
"0.7779997",
"0.7574511",
"0.75449395",
"0.7490517",
"0.7454875",
"0.7435335",
"0.74041593",
"0.7352541",
"0.734231",
"0.73319644",
"0.7315347",
"0.7309471",
"0.72938746",
"0.72787774",
"0.72540075",
"0.72031987",
"0.71266484",
"0.6999924",
"0.69669515",
"0.6962588",
"0.69544... | 0.7605341 | 1 |
_toCompactNumber does compact formatting like 3000>3K for short and "3 thousand" for long | function _toCompactNumber(number, options, numberSettings) {
function _getZerosInPattern(s) {
var i = 0;
var n = 0;
var idx = 0;
var prefix = '';
if (s[0] !== '0') {
while (s[i] !== '0' && i < s.length) {
i += 1;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function prettyNumber(number) {\n\t//\t3210 to 3,210\n\t//\t3210 to 3k\n\t//\t3210 to 3.21k\n\t//\tgoing for last one, 2 decimal places\n\n\t//\tnot relevant if number is 999 or less\n\tif (number <= 999) {\n\t\treturn number;\n\t}\n\tlet newmber = number;\n\tnumber = number / 1000;\n\tnewmber = 'k';\n\twhile ((nu... | [
"0.71907425",
"0.6934795",
"0.6725628",
"0.648325",
"0.6449489",
"0.6449343",
"0.6439045",
"0.64250016",
"0.6315632",
"0.63027173",
"0.6244272",
"0.62398505",
"0.6218743",
"0.6159688",
"0.6147129",
"0.6126632",
"0.61128545",
"0.6088505",
"0.60881174",
"0.6081478",
"0.6035679"... | 0.76354 | 0 |
Assuming these are the x and y vectors, shuffle them by row to eliminate ordering effects | function shuffleTensorsTogether(x,y){
return tf.tidy(() => {
// Combines x and y, Assumes y is 2 cols
let data = x.concat(y, 1);
// console.log("shuffling", data.shape);
let origShape = data.shape;
// Shuffle the data using a tf util
let dataArray = data.arraySync();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shuffleTiles () {\n tiles.sort(() => 0.5 - Math.random()); // Randomise the positions of the items in the main array to allow \"shuffling\"\n}",
"function shuffleTwoArrays(w) {\n var j, x, i;\n var [a,b] = w;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i +... | [
"0.641917",
"0.6358446",
"0.61618364",
"0.6105986",
"0.60856307",
"0.60821223",
"0.606995",
"0.60558075",
"0.6044374",
"0.6038745",
"0.6018797",
"0.6004281",
"0.6004281",
"0.6004281",
"0.5990499",
"0.59780264",
"0.5964855",
"0.5956669",
"0.59317136",
"0.5923792",
"0.5913652",... | 0.6906626 | 0 |
return the domainNetwork object. | getDomainNetwork(domainNetworkName)
{
for (let domainNetwork of this.dataElement.domainNetworks)
if (domainNetwork.domainNetworkName === domainNetworkName) return domainNetwork;
return undefined;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getNetworkObject() {\n return new Network(this.getNetwork());\n }",
"function domain() {\n return wrap('domain', function domainCheckTLD() {\n var result = or(obsDomain, dotAtom, domainLiteral)();\n if (opts.rejectTLD) {\n if (result.semantic.indexOf('.') < 0) {\n ... | [
"0.73823255",
"0.5841084",
"0.5841084",
"0.5841084",
"0.58253235",
"0.58253235",
"0.582385",
"0.56666106",
"0.56220436",
"0.5467104",
"0.53586656",
"0.53586656",
"0.53586656",
"0.53586656",
"0.5331951",
"0.5223749",
"0.5204987",
"0.50921273",
"0.50822216",
"0.50615054",
"0.50... | 0.702434 | 1 |
query the subnetwokrs table | getSubnetworks(domainNetworkName, tierName, gdbVersion="sde.DEFAULT")
{
let subnetworkTableUrl = this.featureServiceUrl + "/" + this.layerDefinition.systemLayers.subnetworksTableId + "/query";
let postJson = {
token: this.token,
where: "DOMAIN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function trigger(){\r\n\t_in = document.getElementById(\"subnet\");\r\n\t_ip = document.getElementById(\"ip_addr\")\r\n\t_dbg(\"\");\r\n\t\r\n\tvar subn = new IPv4SubnetUtils();\r\n\tsubn.initialize(_in.value);\r\n\t\t\r\n\tif (subn.is_valid_format() && IPv4SubnetUtils.is_valid_address(_ip.value)){\r\n\t\t\r\n\t\t... | [
"0.5713339",
"0.54917014",
"0.54151744",
"0.5180748",
"0.51110137",
"0.5093142",
"0.5053718",
"0.49652737",
"0.49548352",
"0.48813215",
"0.4874192",
"0.4871078",
"0.48684424",
"0.47827545",
"0.47520122",
"0.4738757",
"0.46971908",
"0.4659468",
"0.46444038",
"0.46193847",
"0.4... | 0.5726601 | 0 |
get the terminal configuration using the id | getTerminalConfiguration(terminalConfigurationId)
{
return this.dataElement.terminalConfigurations.find(tc => tc.terminalConfigurationId === terminalConfigurationId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getCommandForId(id) {\n return this.db.get(\"commands\").getById(id).value();\n }",
"function getOrgConf(org_id){\n console.log(org_id)\n Organization.getConfig(org_id)\n .then(function(response){\n self.activeOrgConfig = response.data;\n ... | [
"0.5805924",
"0.5110551",
"0.5066271",
"0.50565344",
"0.5038357",
"0.49907118",
"0.496595",
"0.4943945",
"0.4920125",
"0.49039888",
"0.4886457",
"0.48680657",
"0.48659766",
"0.48595193",
"0.48448485",
"0.48347747",
"0.48212573",
"0.47817326",
"0.47787654",
"0.4774414",
"0.475... | 0.69715595 | 0 |
get the subenetline layer | getSubnetLineLayerId()
{
//esriUNFCUTSubnetLine
let domainNetworks = this.dataElement.domainNetworks;
for (let i = 0; i < domainNetworks.length; i ++)
{
let domainNetwork = domainNetworks[i];
//only search edgeSources... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getLineLayers() {\n return this.getLayer(\"esriUNFCUTLine\");\n }",
"function getSublayers(d) {\n //If object d has a sublayers property, return it\n if (d.hasOwnProperty('sublayers')) {\n return d.sublayers\n }\n //Otherwise return 0\n return 0\n ... | [
"0.70256895",
"0.6257977",
"0.6244562",
"0.6117215",
"0.6090215",
"0.59239286",
"0.590307",
"0.5757507",
"0.57304496",
"0.5648543",
"0.56456894",
"0.56394976",
"0.5596978",
"0.55959857",
"0.55090916",
"0.5496112",
"0.54792947",
"0.54674643",
"0.5418007",
"0.53768516",
"0.5365... | 0.68191254 | 1 |
return the first device layer | getDeviceLayers() {
return this.getLayer("esriUNFCUTDevice");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DeviceLayer() {}",
"getClearedDevice(layer, port) {\nconst device = this.getLayerPort(layer, port).device;\nif (!device || !device.connected) {\nreturn null;\n}\nif (device._onInterval) {\nclearInterval(device._onInterval);\ndevice._onInterval = null;\n}\nreturn device;\n}",
"function YLightSensor_Fir... | [
"0.65679127",
"0.6149894",
"0.5912958",
"0.5881138",
"0.57415354",
"0.5649178",
"0.55431384",
"0.55413973",
"0.55228233",
"0.5501582",
"0.54948723",
"0.54733646",
"0.54209584",
"0.54102844",
"0.5359981",
"0.53477246",
"0.53205866",
"0.5294553",
"0.5231545",
"0.5231545",
"0.52... | 0.63087654 | 1 |
return the first junction layer | getJunctionLayers() {
return this.getLayer("esriUNFCUTJunction");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"junction() {\n if(this.graph.unclean) { this.graph.clean(); }\n return this.graph.junctions.slice().filter(function(junction) {\n return junction.origin === this;\n },this).shift();\n }",
"function getFirstTransitLeg(itinerary) {\n return itinerary?.legs?.find((leg) => leg.transitLeg)\n}",
"fun... | [
"0.66271436",
"0.57075715",
"0.5705159",
"0.5705159",
"0.56470424",
"0.56102353",
"0.56102353",
"0.53930616",
"0.53359616",
"0.53037703",
"0.5248402",
"0.5248402",
"0.5248402",
"0.51521575",
"0.51474845",
"0.5144009",
"0.51099926",
"0.50753474",
"0.50494426",
"0.5046958",
"0.... | 0.6822773 | 0 |
return the first Line layer | getLineLayers() {
return this.getLayer("esriUNFCUTLine");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw_first_line(){\n points.push(start);\n points.push(end);\n}",
"function getFirstPointIdOfLine(featureId, layer) {\n\t\t\tvar mapLayer = this.theMap.getLayersByName(layer);\n\t\t\tif (mapLayer && mapLayer.length > 0) {\n\t\t\t\tmapLayer = mapLayer[0];\n\t\t\t}\n\t\t\tvar ft = mapLayer.getFeatur... | [
"0.65303093",
"0.6528004",
"0.6365772",
"0.6151635",
"0.6151635",
"0.6151635",
"0.61261076",
"0.6084913",
"0.6054059",
"0.6054059",
"0.6054059",
"0.6054059",
"0.6054059",
"0.60241383",
"0.5969869",
"0.59688926",
"0.5946444",
"0.58963305",
"0.58788455",
"0.58661216",
"0.586612... | 0.7202435 | 0 |
get layer id from Source Id used to map sourceid to layer id | getLayerIdfromSourceId(sourceId)
{
let domainNetworks = this.dataElement.domainNetworks;
let layerObj = undefined;
for (let i = 0; i < domainNetworks.length; i ++)
{
let domainNetwork = domainNetworks[i];
for (let j = 0; j < domai... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLayerTargetId(catalog, lyr) {\n var nameCount = 0,\n name = lyr.name,\n id;\n catalog.getLayers().forEach(function(o, i) {\n if (lyr.name && o.layer.name == lyr.name) nameCount++;\n if (lyr == o.layer) id = String(i + 1);\n });\n if (!id) error('Layer not found');\n ... | [
"0.7162636",
"0.6809944",
"0.670252",
"0.65532035",
"0.6527205",
"0.6524237",
"0.62714714",
"0.625159",
"0.6203828",
"0.6164873",
"0.6144906",
"0.6067564",
"0.58144444",
"0.5779344",
"0.5761243",
"0.57510436",
"0.570896",
"0.57084954",
"0.56978637",
"0.56488496",
"0.56390893"... | 0.78191507 | 0 |
FIXME: this doesn't need to be it's own function. event handler that toggles manual coordinate entry | function _coordinatesCheckboxClicked(elem) {
$('#explicitCoordinatesDiv').toggle(elem.checked);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleCoordinate(e) {\n setCoordinate(e.target.value);\n }",
"function change(e){\n var canvas = document.getElementById(\"GOLCanvas\");\n var rect = canvas.getBoundingClientRect();\n let x = (e.clientX - rect.left) / (rect.right - rect.left) * canvas.width;\n let y = (e.clientY - rect.t... | [
"0.7436516",
"0.69410336",
"0.69385815",
"0.6701389",
"0.6501524",
"0.64915776",
"0.640386",
"0.63904995",
"0.62964886",
"0.6199689",
"0.6134077",
"0.61244",
"0.61195666",
"0.61178774",
"0.6096127",
"0.6094342",
"0.6077847",
"0.6073268",
"0.606049",
"0.60405064",
"0.6000347",... | 0.7039192 | 1 |
Initialize bootstrap galleries that have .imagecarousel class. Bootstrap Gallery typically doesn't require initialization, but we do extra stuff such as lazyloading of thumbnails for big lists, and binding of analytics events. | function _initImageGallery() {
//init bootstrap image gallery (if found)
$(".image-carousel").each(function(idx, divGallery) {
//for big galleries, defer the loading of thumbnails that can't be seen yet
$(divGallery).find(".thumbnailLink[data-src]").each(function(idx, elem){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n setupThumbnailGallery(0);\n bindEvents();\n }",
"function init() {\n initGalleryToolbar();\n initGalleryList();\n initGalleryListEvents();\n }",
"function addBootstrapPhotoGallery(images) {\n // TODO: MODULE_ADVENTURE_DETAILS\n // 1. Ad... | [
"0.7079934",
"0.69678855",
"0.69611835",
"0.6959604",
"0.6934503",
"0.6914322",
"0.6868755",
"0.68569857",
"0.68397766",
"0.6831942",
"0.67899036",
"0.6768796",
"0.6766642",
"0.6764081",
"0.6702247",
"0.66871196",
"0.66756135",
"0.6665179",
"0.6645506",
"0.66230917",
"0.66206... | 0.7943463 | 0 |
TODO: _checkWindowSize is a costly event handler determine if it's still necessary after upgrading to Bootstrap v3 (TDAR3295). Assigns css classes to the body tag based on the current width. These sizes match the bootstrap responsive grid sizes. | function _checkWindowSize() {
var width = $(window).width()
var new_class = _determineResponsiveClass(width);
$(document.body).removeClass('responsive-large-desktop responsive-desktop responsive-tablet responsive-phone responsive-phone-portrait').addClass(new_class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function body_class() {\n\n\t\twindow_width = $( window ).width();\n\t\t$( 'body' ).removeClass( 'small-screen medium-screen large-screen' );\n\t\tif ( window_width >= 1020 ) {\n\t\t\t$( 'body' ).addClass( 'small-screen medium-screen large-screen' );\n\t\t} else if ( window_width >= 768 ) {\n\t\t\t$( 'body' ).addC... | [
"0.7284412",
"0.66210824",
"0.65362704",
"0.64201957",
"0.6149873",
"0.6141833",
"0.60241216",
"0.5932989",
"0.5929627",
"0.5911437",
"0.58899033",
"0.5821149",
"0.58088243",
"0.5795531",
"0.5795531",
"0.5768201",
"0.57571346",
"0.57565725",
"0.57342154",
"0.5727578",
"0.5706... | 0.74833465 | 0 |
change the keys from ambigous string that bitpay provides to unique subject strings and associated pubkeys | function fixcerts(){
var tmpcerts = {'trusted_pubkeys':[]};
var i = 0;
for (var key in certs){
i += 1;
var certpem = certs[key];
var certder = pem2der(certpem);
//getfield(certder);
var subj = getSubjectString(certder, 'own');
if (tmpcerts.hasOwnProperty(subj)){
//Duplicate found. Rename the existing... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fixcerts() {\n var tmpcerts = { 'trusted_pubkeys': [] };\n for (var key in certs) {\n var certpem = certs[key];\n var certder = pem2der(certpem);\n //getfield(certder);\n var subj = getSubjectString(certder, 'own');\n if (tmpcerts.hasOwnProperty(subj)) {\n //Duplicate found. Rename t... | [
"0.64375365",
"0.6143184",
"0.5997875",
"0.5953129",
"0.5903078",
"0.576655",
"0.5735011",
"0.57045746",
"0.5684639",
"0.5684639",
"0.5595481",
"0.559227",
"0.5590233",
"0.5585334",
"0.55590266",
"0.5502506",
"0.54701895",
"0.54658467",
"0.54112244",
"0.5405147",
"0.5404246",... | 0.63222545 | 1 |
Usually CN=&O= is enough to uniquely identify a CA, however there are 6 certs in rootstore which have the same O&CN and are only distinguished by OU= | function getSubjectString(cert, whose, extended){
if (typeof(extended) === "undefined"){
extended = false;
}
var c = Certificate.decode(new Buffer(cert), 'der');
var fields;
if (whose === 'issuer'){
fields = c.tbsCertificate.issuer.value;
}
else if (whose === 'own'){
fields = c.tbsCertificate.subject.value... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSubjectString(cert, whose, extended) {\n if (typeof extended === 'undefined') {\n extended = false;\n }\n var c = Certificate.decode(new Buffer(cert), 'der');\n var fields;\n if (whose === 'issuer') {\n fields = c.tbsCertificate.issuer.value;\n } else if (whose === 'own') {\n fields = c.... | [
"0.6812094",
"0.5785218",
"0.5717592",
"0.55791134",
"0.5571727",
"0.5448244",
"0.53993785",
"0.5349801",
"0.5320432",
"0.52540606",
"0.5205043",
"0.5176205",
"0.5176205",
"0.51360536",
"0.5130657",
"0.5079217",
"0.5079217",
"0.5077359",
"0.50551426",
"0.5039486",
"0.5004304"... | 0.68546027 | 0 |
Returns true if the password change forms are filled for suite Number | function pwSuiteFieldsFilled() {
return (!($(".currentPW").val().length === 0) && (!($('#newSuite').val().length === 0)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validatechangePasswordForm()\n{\n\tvar currentPassword = validatePassword(\"changePasswordForm\",\"currentPassword\",\"currentPasswordSpan\");\n\tvar equal = passwordEqual(\"changePasswordForm\",\"newPassword\",\"confirmPassword\",\"newPasswordSpan\",\"confirmPasswordSpan\");\n\tif (currentPassword & equa... | [
"0.6667522",
"0.65520716",
"0.63365257",
"0.63223255",
"0.6288027",
"0.6263071",
"0.6215739",
"0.61864513",
"0.61674196",
"0.616652",
"0.6161975",
"0.6161601",
"0.61472964",
"0.61301935",
"0.6117412",
"0.6115022",
"0.6108552",
"0.6090405",
"0.6089499",
"0.60848147",
"0.608481... | 0.73494154 | 0 |
Get articles of a category | function getArticles(cat) {
fetch('https://api.nytimes.com/svc/archive/v1/2019/2.json?api-key=8793dBix9MPRBW5QM1noEAMn1cZRxQ8R')
.then(res => res.json())
.then(data => {
console.log(data.response.docs.filter(art => art.section_name === cat));
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPostsByCategory() {\n\tvar snippet = {\n\t\tquery: {category: \"testodd\"}\n\t}\n\trimer.post.findByCategory(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}",
"function findArticles() {}",
"async categories() ... | [
"0.7237355",
"0.6851337",
"0.6720286",
"0.6679098",
"0.6663666",
"0.6636934",
"0.65844524",
"0.6554914",
"0.6465922",
"0.6408702",
"0.6362489",
"0.63444704",
"0.6331049",
"0.628564",
"0.6241779",
"0.6226295",
"0.6224455",
"0.6199512",
"0.6190314",
"0.61504316",
"0.61316955",
... | 0.75935924 | 0 |
create and append dom elements with any type or value | function el(type, ...value) {
const newElement = document.createElement(type);
if (typeof value[0] === 'string') {
newElement.textContent = value[0];
} else {
value.forEach(e => newElement.appendChild(e));
}
return newElement;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addHTML(elementType, type, id, clas, value, div) {\n //Create an input type dynamically. \n var element = document.createElement(elementType);\n //Assign different attributes to the element. \n element.setAttribute(\"type\", type);\n element.setAttribute(\"id\", id);\n element.setAttribute(\"class... | [
"0.6869538",
"0.6768279",
"0.6718915",
"0.6671937",
"0.66398185",
"0.66114396",
"0.64594537",
"0.64455223",
"0.64375895",
"0.6414948",
"0.6368684",
"0.63555986",
"0.63505906",
"0.63155866",
"0.62931526",
"0.6224197",
"0.6216796",
"0.62133884",
"0.6206636",
"0.6156435",
"0.615... | 0.70559925 | 0 |
Searches through doxygen site using embedded doxysearch capabilities See for more information | function search_documentation(query) {
var doc_url = "https://projectchrono.org";
var doc_search_url = "/doxygen";
var page = "0";
var number = "40";
var callback = "docshow"
var search_string = "?q=" + query +"&n=" + number + "&p=" + page + "&cb=" + callback;
$.ajax({
url: doc_url + d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DocScannerConfig() { }",
"function Docs() {}",
"function domqlsearch() {\n var outp = document.querySelector('#domql-output');\n outp.innerText = \"\";\n\n var query = document.getElementById(\"domql-search\").value;\n try {\n var result = domql.$(query);\n var sep = \"\\n-------------------... | [
"0.5952187",
"0.5921713",
"0.55015534",
"0.54993296",
"0.5459428",
"0.5406108",
"0.53212965",
"0.53157526",
"0.52813023",
"0.52395016",
"0.5213956",
"0.51905257",
"0.5166952",
"0.5144834",
"0.5096207",
"0.506764",
"0.5054207",
"0.5016674",
"0.50116146",
"0.5007677",
"0.500677... | 0.6589925 | 0 |
Extend gameObject for invObject | function invObject() {
this.name = '';
this.projectileImg = null;
this.damageOutput = [];
this.attackRadius = [];
this.attackRate = [];
this.cost = [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GameObjectEx2() {\n return _super.call(this) || this;\n }",
"constructor(inv){\n this.inventory = inv;\n }",
"get gameObject() {}",
"get gameObject() {}",
"get gameObject() {}",
"get gameObject() {}",
"copy(){\r\n let copy = new Enemy(this.name, true);\r\n ret... | [
"0.6096594",
"0.59919053",
"0.5799744",
"0.5799744",
"0.5799744",
"0.5799744",
"0.5766069",
"0.57202834",
"0.56515497",
"0.5627535",
"0.54962033",
"0.5488462",
"0.5475717",
"0.5433688",
"0.5409518",
"0.53850496",
"0.53800684",
"0.53516656",
"0.53474",
"0.53474",
"0.53474",
... | 0.68741864 | 0 |
Extend gameObject for enemyObject | function enemyObject() {
this.speed = 0;
this.startHealth = 0;
this.health = 0;
this.wp = [];
this.imagel = null;
this.imager = null;
this.imageu = null;
this.imaged = null;
this.isDestroyed = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function EnemyBase(game,event,param){\r\n\t/*param{\r\n\t\tx:x, y:y\r\n\t}*/\r\n\tvar t=this;\r\n\tt.x=param.x, t.y=param.y;\r\n\tt.hp=t.maxhp;\r\n\tevent.on(\"damage\",function(power){\r\n\t\tt.hp-=power;\r\n\t\tif(t.hp<=0){\r\n\t\t\tevent.emit(\"die\");\r\n\t\t\t//爆発\r\n\t\t\tgame.event.emit(\"effect\",\"explode... | [
"0.7087146",
"0.68540806",
"0.6803836",
"0.67829025",
"0.67710423",
"0.6738839",
"0.6738351",
"0.6730163",
"0.6676563",
"0.6652854",
"0.6642481",
"0.6628295",
"0.66239595",
"0.66073567",
"0.6587927",
"0.65625566",
"0.65611714",
"0.65467227",
"0.6545017",
"0.6524318",
"0.65147... | 0.73798686 | 0 |
Sends the given "wave" of enemies | function sendWave(waveNo) {
var wave = waves[waveNo - 1];
var spawns = [];
for (var i = 0; i < wave.length; i++) {
for (var j = 0; j < wave[i]; j++) {
spawns.push(i + 1);
}
}
var delay = 1000;
spawnTimer = setInterval(doSpawn, delay);
var counter = 0;
function doSpawn() {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function StartNewWave()\n{\n\t//Set the GUI\n\tUpdateGUI();\n\t\n\t//spawn the first enemy\n\tSpawnNewEnemy();\n\t\n\t//set the wave end time\n\twaveEndTime = Time.time + waveLength;\n\t\n\t//activate the wave\n\twaveActive = true;\n\tspawnEnemies = true;\n}",
"function enemyGenerator(){\n\tif(game.running_frame... | [
"0.6659558",
"0.6509452",
"0.6352155",
"0.6086608",
"0.60813475",
"0.60613936",
"0.59485555",
"0.59453404",
"0.59336734",
"0.58864367",
"0.58331823",
"0.57884717",
"0.5777962",
"0.5775105",
"0.576648",
"0.5753133",
"0.57016706",
"0.569705",
"0.56601185",
"0.56600654",
"0.5651... | 0.75444627 | 0 |
Stops the spawn timer | function stopSpawnTimer() {
clearInterval(spawnTimer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_stopTimer() {\n this.game.time.events.remove(this.timer)\n }",
"function stopTimer() {\n secondsElapsed = 0;\n setTime();\n renderTime();\n}",
"_stopTimer() {\n this._tock.end();\n }",
"function stop() {\n timer.stop();\n}",
"function stopTimer() {clearTimeout(startTimer)... | [
"0.7258673",
"0.698868",
"0.6978449",
"0.6918843",
"0.6887338",
"0.6876044",
"0.6841306",
"0.679546",
"0.6728176",
"0.67214364",
"0.67178535",
"0.67155826",
"0.67076373",
"0.6682073",
"0.6678759",
"0.6675469",
"0.66745377",
"0.6672732",
"0.66684234",
"0.6662389",
"0.6653041",... | 0.88224435 | 0 |
Starts the wave timer | function startWaveTimer() {
_timeToNextWave = 40;
waveTimer = setInterval(countDown, 1000);
function countDown() {
_timeToNextWave -= 1;
if (_timeToNextWave == 0) {
clearInterval(waveTimer);
_currentWave += 1;
sendWave(_currentWave);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startWave() {\n // Resets the boxes to initial state\n resetGameBoxes();\n // Sets the difficulty\n setDifficulty(info.level);\n // Sapwns the weeds\n updateWeeds(randomizeElements());\n // Updates the graphics\n updateGraphics();\n // Set an interval based on the difficulty\n info.timeout = set... | [
"0.71562475",
"0.69873345",
"0.6780647",
"0.67701966",
"0.66760296",
"0.6648699",
"0.6615209",
"0.65840787",
"0.6534494",
"0.6508174",
"0.64849174",
"0.6478389",
"0.6470013",
"0.64402723",
"0.6430734",
"0.6422883",
"0.63687575",
"0.6365267",
"0.6342882",
"0.63351715",
"0.6323... | 0.7549894 | 0 |
Stops the wave timer | function stopWaveTimer() {
clearInterval(waveTimer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"stopSoundWave() {\n this.stream = undefined;\n cancelAnimationFrame(this.stopId);\n }",
"function stopTime ()\t{\n\t\t\tclearInterval (time);\n\t\t}",
"function stop () {\n clearInterval(timerHandle)\n }",
"function stop() {\n timer.stop();\n}",
"function stop() {\n clearInterval... | [
"0.76033735",
"0.75417644",
"0.7506977",
"0.7501522",
"0.7444054",
"0.7361773",
"0.73479515",
"0.7325053",
"0.73027676",
"0.72475225",
"0.7233839",
"0.72250617",
"0.7220734",
"0.7219457",
"0.71962446",
"0.7193736",
"0.71932876",
"0.7180153",
"0.71423256",
"0.7135321",
"0.7134... | 0.8629785 | 0 |
Draws the wave timer | function drawWaveTimer() {
if (_timeToNextWave > 0) {
ctx.beginPath();
ctx.fillStyle = '#000000';
ctx.font = '22px sans-serif';
ctx.fillText('Next wave in: ' + _timeToNextWave, 180, 550);
ctx.closePath();
ctx.fill();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\n\n\t\t\t\t// キャンバスの描画をクリア\n\t\t\t\tcontext.clearRect(0, 0, width, height);\n\n\t\t\t\t//波を描画\n\t\t\t\tdrawWave('rgba(7, 126, 195, 0.30)', 1, 3, 0);\n\n\t\t\t\t// Update the time and draw again\n\t\t\t\tdraw.seconds = draw.seconds + .009;\n\t\t\t\tdraw.t = draw.seconds * Math.PI;\n\t\t\t\tsetTime... | [
"0.7505239",
"0.7497181",
"0.736977",
"0.7282148",
"0.72071195",
"0.7031771",
"0.699292",
"0.6961453",
"0.68618",
"0.68571407",
"0.6846437",
"0.68087053",
"0.68071765",
"0.6798916",
"0.67842984",
"0.6755348",
"0.6751716",
"0.6700598",
"0.66925347",
"0.6666168",
"0.6644816",
... | 0.81691366 | 0 |
Spawns an enemy of the given type | function spawnEnemy(enemyType) {
var e;
if (enemyType == 1) {
e = new beetle_lvl1();
} else if (enemyType == 2) {
e = new beetle_lvl2();
} else if (enemyType == 3) {
e = new beetle_lvl3();
} else if (enemyType == 4) {
e = new beetle_lvl4();
} else if (enemyType == 5) {
e = n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function spawnEnemy(enemyType){\n\tvar tempEnemyObj = new (eval(enemyType))(null, null, null, null, null, null);\n\tenemiesOnBoard.push(tempEnemyObj);\n\tconsole.log(\"NEW \" + enemyType + \" MADE!\");\n\tconsole.log(\"Health = \" + enemiesOnBoard[enemiesOnBoard.length-1].health);\n\tconsole.log(\"Damage = \" + en... | [
"0.7704242",
"0.7263163",
"0.70788974",
"0.70233953",
"0.700076",
"0.69198436",
"0.6830337",
"0.68192804",
"0.6810748",
"0.6807065",
"0.678227",
"0.6747664",
"0.67474836",
"0.66409606",
"0.6639755",
"0.6633556",
"0.6612838",
"0.6596827",
"0.6560517",
"0.6516012",
"0.6515369",... | 0.7999129 | 0 |
Snaps the given Xcoordinate to a grid on the scene. | function snapToGridX(coord) {
coord -= sceneX;
for (var i = 1; i <= sceneWidth / tileSize; i++) {
if (i * tileSize > coord) {
coord = (i - 1) * tileSize;
break;
}
}
if (coord <= sceneX) {
ret = sceneX;
}
if (coord >= sceneX - tileSize) {
ret = sceneX - tileSize;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function snapToGrid(activity, xValue, yValue) {\n\n}",
"function snapGrid(element) {\r\n let x = 0;\r\n let y = 0\r\n interact(element)\r\n .draggable({\r\n modifiers: [\r\n i... | [
"0.7490244",
"0.7115089",
"0.6394035",
"0.6062398",
"0.5982038",
"0.59680027",
"0.59388876",
"0.5902076",
"0.5887239",
"0.58818704",
"0.5755027",
"0.5707195",
"0.56512725",
"0.5521287",
"0.5513626",
"0.55096054",
"0.54951894",
"0.5451294",
"0.5445426",
"0.54446274",
"0.540002... | 0.78298 | 0 |
Snaps the given Ycoordinate to a grid on the scene. | function snapToGridY(coord) {
coord -= sceneY;
for (var i = 1; i <= sceneHeight / tileSize; i++) {
if (i * tileSize > coord) {
coord = (i - 1) * tileSize;
break;
}
}
if (coord <= sceneY) {
ret = sceneY;
}
if (coord >= sceneY - tileSize) {
ret = sceneY - tileSize;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function snapToGrid(activity, xValue, yValue) {\n\n}",
"function snapToGridX(coord) {\r\n coord -= sceneX;\r\n\r\n for (var i = 1; i <= sceneWidth / tileSize; i++) {\r\n if (i * tileSize > coord) {\r\n coord = (i - 1) * tileSize;\r\n break;\r\n }\r\n }\r\n\r\n if (coord <= sceneX) {\r\n re... | [
"0.7420884",
"0.6184847",
"0.61488795",
"0.5773015",
"0.57657856",
"0.57645917",
"0.5695224",
"0.56679857",
"0.56679857",
"0.56679857",
"0.56679857",
"0.56285745",
"0.5618195",
"0.5600074",
"0.5574466",
"0.55553955",
"0.55300444",
"0.54835916",
"0.54671663",
"0.5461046",
"0.5... | 0.7680127 | 0 |
Draws all objects in sceneObj[][] on the screen | function drawSceneObjects() {
for (var i = 0; i < sceneWidth / tileSize; i++) {
for (var j = 0; j < sceneHeight / tileSize; j++) {
if (sceneObj[i] != null && sceneObj[i][j] != null) {
ctx.drawImage(sceneObj[i][j].image, sceneObj[i][j].x, sceneObj[i][j].y);
}
}
}
if (selectedO... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawScene() {\n for(let line of sceneVisibleLines)\n line.draw();\n for(let scobj of objects)\n scobj.draw();\n}",
"function drawObjects() {\n\n\t\n\t\n\tvar pMatrix;\n\t\n\tvar mvMatrix = mat4();\n\n\t\t\n\t// Clearing the frame-buffer and the depth-buffer\n\t\n\tgl.clear(gl.COLOR_BU... | [
"0.8221827",
"0.80414635",
"0.79511654",
"0.75794345",
"0.74638456",
"0.744416",
"0.74410415",
"0.73842216",
"0.7294993",
"0.71373403",
"0.7091524",
"0.7005977",
"0.6996485",
"0.69948673",
"0.69937146",
"0.697529",
"0.6940226",
"0.692576",
"0.6913261",
"0.68587536",
"0.684639... | 0.8179032 | 1 |
Starts the game timer that calls gameLoop() every 14ms | function startGameTimer() {
var mspf = 15;
function timer() {
gameLoop();
window.setTimeout(timer, mspf);
}
window.setTimeout(timer, mspf);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startGame() {\r\n console.log(\"in startgame\");\r\n myTimer = setInterval(gameLoop, 16);\r\n}",
"function startGameTimer() {\n clearInterval(gameClock);\n gameClock = setInterval(gameTimer, 1000);\n}",
"function timerola (){\n\tsetInterval(startGame,1000/60);\n}",
"function gameLoop() {\n var ... | [
"0.7614906",
"0.73063445",
"0.7104726",
"0.7104336",
"0.7103948",
"0.7096584",
"0.7067287",
"0.7054044",
"0.7047093",
"0.70427215",
"0.6989851",
"0.691079",
"0.68498814",
"0.682317",
"0.6802796",
"0.67902243",
"0.6757148",
"0.6740432",
"0.67378736",
"0.67146266",
"0.6688643",... | 0.74903274 | 1 |
Starts the timer that calls fps() every 1000ms. | function startFPSCounter() {
var mspf = 1000;
lastLoop = new Date().getTime();
function instance() {
fps();
window.setTimeout(instance, mspf);
}
window.setTimeout(instance, mspf);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"start() {\n var time = new Date;\n var _this = this;\n\n if (this.fps == 60) {\n this.runLoop = displayBind(function tick() {\n _this.onTick(new Date - time);\n _this.runLoop = displayBind(tick);\n time = new Date;\n });\n } else {\n this.runLoop ... | [
"0.82618916",
"0.76671416",
"0.7427609",
"0.7373964",
"0.73299015",
"0.7307745",
"0.72543794",
"0.722965",
"0.7212856",
"0.7212856",
"0.71804976",
"0.7071082",
"0.70283276",
"0.7012261",
"0.69929266",
"0.69469494",
"0.69438225",
"0.68124115",
"0.67876387",
"0.67763036",
"0.67... | 0.78734404 | 1 |
Checks if coordinates are in range (inside the scene) | function isInRange(x, y) {
var inRange = true;
if (
x < sceneX ||
x > sceneEndX - tileSize ||
y < sceneY ||
y > sceneEndY - tileSize
) {
inRange = false;
}
if (x == sceneEndX && y == 270) {
inRange = true;
}
return inRange;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"inBounds(low, high) {\n if (this.x < low || this.x > high) return false;\n if (this.y < low || this.y > high) return false;\n return true;\n }",
"function inBounds(coord) {\n return coord.getX() < canvas.width && coord.getY() < canvas.height;\n}",
"function inRange(cx, cy, r, mouseX, mouseY){\n\t//v... | [
"0.7429796",
"0.7412467",
"0.7361654",
"0.7345565",
"0.73013526",
"0.7297972",
"0.728571",
"0.72223574",
"0.7197958",
"0.7166006",
"0.7147298",
"0.7146329",
"0.7140239",
"0.709684",
"0.70305926",
"0.70305926",
"0.7004632",
"0.69965905",
"0.6977051",
"0.6955818",
"0.69316906",... | 0.7451391 | 0 |
DISPLAYRESULTS ARTICLES We create a link variable that is going to use the a element, the anchor tag which will allow us to create an 'href' link. We create a current variable that holds the data of the current article as we iterate. We log the current data so that we can see it in the console. Since link is an a eleme... | function displayResults(json) {
let articles = json.response.docs;
while (section.firstChild) {
section.removeChild(section.firstChild);
}
if(articles.length === 0) {
console.log("No results");
} else {
for(let i = 0; i < articles.length; i++) {
let article = do... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showResults(json) {\n document.getElementById('results').innerHTML = `<a href=${json.html_url}>${\n json.html_url\n }</a>`;\n}",
"function displayResults(json) {\r\n\t\tvar data = json.results;\r\n\t\tlet index = 0;\r\n\t\tconsole.table(data);\r\n\t\t//make sure section is empty. while loop convent... | [
"0.6338188",
"0.62798434",
"0.6157503",
"0.60424066",
"0.60343975",
"0.5996253",
"0.593246",
"0.5906132",
"0.5861302",
"0.5807645",
"0.57928926",
"0.571337",
"0.5694286",
"0.5692112",
"0.5675674",
"0.56677",
"0.5662772",
"0.56564194",
"0.5643169",
"0.55957115",
"0.5552288",
... | 0.63608456 | 0 |
checks if component has "block_" prefix that defines a group | function isGrouped(anObject){
try
{
var isGrouped = false;
var currentObject = anObject;
while (isGrouped == false && currentObject != null)
{
if(currentObject.name != null){
isGrouped = (currentObject.name.indexOf("block_") != -1);
}
else{
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function l(e) {\n return e && \"group\" === e.type;\n }",
"isBlock() {\n const parentNode = this.parentNode\n return (parentNode && parentNode.isContainer())\n }",
"defineBEMBlocks() {\n return {\n container: (this.props.mod || 'cr-search-summary')\n }\n }",
"function canContai... | [
"0.59237325",
"0.57793546",
"0.5692654",
"0.56589043",
"0.56543106",
"0.5608816",
"0.55723095",
"0.5556382",
"0.55510515",
"0.5526635",
"0.5524866",
"0.5501948",
"0.54830223",
"0.5472309",
"0.54636806",
"0.54261196",
"0.54002666",
"0.5400213",
"0.5368884",
"0.5366574",
"0.536... | 0.6036376 | 0 |
checks if component has prefix "noLabels_" which allows it to hide the label for example for something like a grouped component like the address field | function isHideLabel(anObject){
try
{
var currentObject = anObject;
return (currentObject.name.indexOf("noLabel_") != -1); // If noLabel_ exists in the name, return true.
}
catch(err)
{
try
{
var isVisible = true;
var currentObject = anObject;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_hideLabelIfEmpty() {\n const label = this._elements.label;\n\n // If it's empty and has no non-textnode children, hide the label\n const hiddenValue = !(label.children.length === 0 && label.textContent.replace(/\\s*/g, '') === '');\n\n // Toggle the screen reader text\n this._elements.labelWrapper.... | [
"0.6719144",
"0.65654606",
"0.6512091",
"0.64771265",
"0.6430962",
"0.6403646",
"0.6345821",
"0.6268667",
"0.6197071",
"0.6152713",
"0.61371803",
"0.6098542",
"0.6015976",
"0.6014712",
"0.5983657",
"0.59513104",
"0.5939076",
"0.5873327",
"0.5833946",
"0.5758209",
"0.57569546"... | 0.67773867 | 0 |
checks if component has prefix "noLink_" which allows it to hide the link eg. for pre populated fields | function isHideLink(anObject){
try
{
var currentObject = anObject;
return (currentObject.name.indexOf("noLink_") != -1); // If noLink_ exists in the name, return true.
}
catch(err)
{
console.log("Excception: " + err);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function noLink(){\nreturn false;\n}",
"function isLinkInvalid(link){\nreturn (!link.prop('source/id') || !link.prop('target/id'));\n}",
"if ( ! url || link . rel ! == ' folha de estilo ' || link . hasAttribute ( ' data-noprefix ' )) {\n\t\t\t\tretorno ;\n\t\t\t}",
"function isNotLink(cell) {\r\n\t i... | [
"0.60892665",
"0.60429084",
"0.60311675",
"0.6023666",
"0.57554317",
"0.5715604",
"0.5695346",
"0.5649564",
"0.5538663",
"0.5528116",
"0.5441622",
"0.5433861",
"0.53835416",
"0.5378347",
"0.5378347",
"0.53731245",
"0.5372995",
"0.5354249",
"0.5320599",
"0.52923435",
"0.529095... | 0.7077251 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.