text stringlengths 232 16.3k | domain stringclasses 1
value | difficulty stringclasses 3
values | meta dict |
|---|---|---|---|
<|fim_suffix|>for (let plan of plans) {
for (i = 0; i < move_types.length; i++){
if (plan === move_types[i]) {
nx = x + dx[i];
ny = y + dy[i];
}
}
if (nx < 1 || ny < 1 || nx > n || ny > n){
continue;
}
x = nx;
y = ny;
}
//2번째 코드
// plans.forEach((plan) => {
// ... | code_fim | hard | {
"lang": "javascript",
"repo": "jsj1510/woowahan-agile-codingtest",
"path": "/coding-test/wonji/implement/상하좌우.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> objClientNew.setValue({ fieldId: "firstname", value: objJson.nombre });
objClientNew.setValue({ fieldId: "lastname", value: objJson.apellido });
objClientNew.setValue({ fieldId: "email", value: objJson.correo });
objClientNew.setValue({ fieldId: "custentity286", value: objJson.c... | code_fim | hard | {
"lang": "javascript",
"repo": "vaibhavantil2/kaloniScripts",
"path": "/rl_testOarrs.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> const value = shielded[prop] // not writing that logic again
if (value === undefined) return undefined
return { // just set everything to true, that'll be the end result anyway
value,
writable: true,
enumerable: true,
configurable: true
}
},
... | code_fim | hard | {
"lang": "javascript",
"repo": "b3nsn0w/veraverto",
"path": "/shield.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
return (
<View style={{flexDirection: 'column', flex: 1}}>
<TopMenu navigator={this.navigator} eventEmitter={this.eventEmitter} selected="form"/>
<View style={{flex:9}}>
<TextInput
style={{height: 50}}
... | code_fim | hard | {
"lang": "javascript",
"repo": "WasimFar/Schedme",
"path": "/components/pages/form.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> it('propagates all props to <WrappedComponent>', () => {
const Injected = withIntl(Wrapped);
const props = {
foo: 'bar',
};
rendered = mountWithContext(intl, <Injected {...props} />);
const wrappedComponent = rendered.find(Wrapped);
Object.keys(props).forEach(key => {
... | code_fim | hard | {
"lang": "javascript",
"repo": "4Catalyzer/react-intl",
"path": "/test/unit/components/withIntl.js",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: rollup/plugins path: /packages/commonjs/test/fixtures/function/import-esm-require-returns-default-function-external/_config.js
module.exports = {
description: 'allows configuring requireReturnsDefault for externals with a function',<|fim_suffix|> if (id === 'external-esm-default') return fals... | code_fim | hard | {
"lang": "javascript",
"repo": "rollup/plugins",
"path": "/packages/commonjs/test/fixtures/function/import-esm-require-returns-default-function-external/_config.js",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> if (id === 'external-esm-default') return false;
return 'auto';
},
esmExternals: true
}
};<|fim_prefix|>// repo: rollup/plugins path: /packages/commonjs/test/fixtures/function/import-esm-require-returns-default-function-external/_config.js
module.exports = {
description: 'allows confi... | code_fim | hard | {
"lang": "javascript",
"repo": "rollup/plugins",
"path": "/packages/commonjs/test/fixtures/function/import-esm-require-returns-default-function-external/_config.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>export function post(url, data, config) {
const source = CancelToken.source()
const request = _girderClient.post(url, data, { ...config, cancelToken: source.token })
request[CANCEL] = () => source.cancel()
return request
}
export function put(url, data, config) {
const source = CancelToken.sour... | code_fim | hard | {
"lang": "javascript",
"repo": "ayushshivani/mongochemclient",
"path": "/src/rest/index.js",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>// let i = json_data.envelopes.length ;
// let colorListsize = circleColor_list.length;
// while(i--)
// {
// let env_peaks = [];
// let mono_mass = parseFloat(json_data.envelopes[i].mono_mass);
// let charge = parseFloat(json_data.envelopes[i].charge);
// let color = circleColor_list[i%colo... | code_fim | hard | {
"lang": "javascript",
"repo": "animesh/topmsv",
"path": "/public/resources/topview/spectrum/ms.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>test('FlagsetsList render', (t) => {
t.equal(wrapper.find(Card).length, 1, 'it should render correct count of Card');
t.equal(wrapper.find(Table).length, 1, 'it should render correct count of Table');
t.equal(wrapper.find(Table).find('tr').length, 5, 'it should render correct tr count');
t.equal(w... | code_fim | hard | {
"lang": "javascript",
"repo": "triniti/cms-js",
"path": "/src/plugins/sys/components/flagsets-list/index.test.jsx",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> render(rowData) {
let val = this.getValue(rowData), level,
dom = this._getDom();
val = val !== undefined ? val : 0;
if (val <= 25)
level = 'progress-bar-danger';
else if (val <= 50)
... | code_fim | hard | {
"lang": "javascript",
"repo": "suevip/distribute-clawler",
"path": "/distribute-manage/distribute-manage-web/src/main/webapp/assets/js/components/table/column/table.column.progress.js",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: newrelic/node-newrelic-aws-sdk path: /tests/versioned/aws-server-stubs/response-server/sqs/responses/send-message-batch-response.js
/*
* Copyright 2023 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
'use strict'
module.exports = (isJson) => {
if (isJs... | code_fim | hard | {
"lang": "javascript",
"repo": "newrelic/node-newrelic-aws-sdk",
"path": "/tests/versioned/aws-server-stubs/response-server/sqs/responses/send-message-batch-response.js",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> <MessageId>15ee1ed3-87e7-40c1-bdaa-2e49968ea7e9</MessageId>
<MD5OfMessageBody>446e666e0c0a8695b7a9693c082bc5da</MD5OfMessageBody>
</SendMessageBatchResultEntry>
</SendMessageBatchResult>
<ResponseMetadata>
<RequestId>ca1ad5d0-8271-408b-8d0f-1351bf547e74</RequestId>
</ResponseMeta... | code_fim | hard | {
"lang": "javascript",
"repo": "newrelic/node-newrelic-aws-sdk",
"path": "/tests/versioned/aws-server-stubs/response-server/sqs/responses/send-message-batch-response.js",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> removeErrorClass();
removeFieldValues();
});
// $('.edit-book').click(function (e) {
// e.preventDefault();
// showFormGroup();
// $('#modal-title').text('Edit Book');
// action = $(this).data('action');
// bookId = $(this).data('id');
// $('#title').val($(this).da... | code_fim | hard | {
"lang": "javascript",
"repo": "gjvpaet/laravel-project-library",
"path": "/public/js/crud.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>// $('#modal-title').text('Edit Book');
// action = $(this).data('action');
// bookId = $(this).data('id');
// $('#title').val($(this).data('title'));
// $('#author').val($(this).data('author'));
// $('#genre').val($(this).data('genre'));
// $('#library-section').val($(this... | code_fim | hard | {
"lang": "javascript",
"repo": "gjvpaet/laravel-project-library",
"path": "/public/js/crud.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> var w = $(window).width();
var nw = Math.floor(Math.random() * w);
var nh = Math.floor(Math.random() * 28)+'%';
return [nw, nh];
}
//stop required to prevent memory leak
function animateCloud(image){
$(image).stop(true).animate({
... | code_fim | medium | {
"lang": "javascript",
"repo": "matt16749-zz/matt16749.github.io",
"path": "/blog-posts/scripts/blog_template.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: matt16749-zz/matt16749.github.io path: /blog-posts/scripts/blog_template.js
$(document).ready(function(){
//local links are loaded on same window, foreign links are
//loaded in new window/tab
$("a").attr("target", function() {
if (this.host == location.host) return "_self"
else return "_blank"... | code_fim | hard | {
"lang": "javascript",
"repo": "matt16749-zz/matt16749.github.io",
"path": "/blog-posts/scripts/blog_template.js",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> debug( 'add jquery fn tabify' );
$.fn.tabify = function( opts ) {
debug( "calling tabify" );
return this.each( function( index, tabs_el ) {
debug( "before setup_tabs["+ index +"]" );
setup_tabs( tabs_el, opts );
debug( "after setup_tabs["+ index +"]" ... | code_fim | hard | {
"lang": "javascript",
"repo": "JoseAplitic/sos",
"path": "/vistas/js/jquery.tabs.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: StevenLequient/FoxTrotters path: /meanjs/modules/planders/server/controllers/planders.server.controller.js
'use strict';
/**
* Module dependencies.
*/
var path = require('path'),
mongoose = require('mongoose'),
Plander = mongoose.model('Plander'),
errorHandler = require(path.resolve('./... | code_fim | hard | {
"lang": "javascript",
"repo": "StevenLequient/FoxTrotters",
"path": "/meanjs/modules/planders/server/controllers/planders.server.controller.js",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> var upload = multer({
storage: storage
}).single('newProfilePicture');
console.log('hey');
upload(req, res, function (uploadError) {
console.log('ho');
if (uploadError) {
return res.status(400).send({
message: 'Error occurred while uploading plander picture' + uploadErr... | code_fim | hard | {
"lang": "javascript",
"repo": "StevenLequient/FoxTrotters",
"path": "/meanjs/modules/planders/server/controllers/planders.server.controller.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> plander.save(function (err) {
if (err) {
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.jsonp(plander);
}
});
};
/**
* Delete an Plander
*/
exports.delete = function (req, res) {
var plander = req.plander;
plander... | code_fim | hard | {
"lang": "javascript",
"repo": "StevenLequient/FoxTrotters",
"path": "/meanjs/modules/planders/server/controllers/planders.server.controller.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> })
.done(function () {
console.log("second success");
})
.fail(function () {
console.log("error");
})
.always(function () {
console.log("complete");
});
}<|fim_prefix|>// repo: cherattk/cherattk.github.io path: /public/tshirt/js/printer.js
var viewportScaleFactor;
window.o... | code_fim | hard | {
"lang": "javascript",
"repo": "cherattk/cherattk.github.io",
"path": "/public/tshirt/js/printer.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: bellmit/niutal path: /niutal-core-web/src/main/webapp/js/zfxg/comp/xsxxgl/ckXsxx.js
var gndm = "jcsj_xsxxgl_ckxsxx";// 功能代码
var dataJson;
jQuery(function() {
var url=_path+'/zfxg/xsxxgl/ckXsxxAjax.html';
jQuery.ajax( {
type : "post",
async : false,
url : url,
data : {
xh : jQuery("#... | code_fim | hard | {
"lang": "javascript",
"repo": "bellmit/niutal",
"path": "/niutal-core-web/src/main/webapp/js/zfxg/comp/xsxxgl/ckXsxx.js",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>
function showResult(obj) {
var bjdm_id = obj["bjdm_id"];
var bjdm = obj["bjdm"];
var njdm_id = obj["njdm_id"];
var bjmc = obj["bjmc"];
var bmmc = obj["bmmc"];
var zymc = obj["zymc"];
if (njdm_id == null) {
njdm_id = "";
}
if (bmmc == null) {
bmmc = "";
}
if (zymc == null) {
zymc = "";
... | code_fim | medium | {
"lang": "javascript",
"repo": "bellmit/niutal",
"path": "/niutal-core-web/src/main/webapp/js/zfxg/comp/xsxxgl/ckXsxx.js",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> var div = document.getElementById("emToPx");
div.style.height = '1em';
var pxValue = div.offsetHeight;
div.style.height = '0';
return pxValue;
}<|fim_prefix|>// repo: Z00fers/bobblehead path: /public/js/script.js
$(document).ready(function () {
var logo = document.querySelector(".... | code_fim | hard | {
"lang": "javascript",
"repo": "Z00fers/bobblehead",
"path": "/public/js/script.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>function gotoTag(tag) {
toggleSidebar();
jumpTo(tag);
}
function jumpTo(tag){
$("#wrapper").on("transitionend", function (e) {
$(this).off(e);
goto(tag);
});
}
function goto(tag) {
var element = document.querySelector(tag);
if (element == null) return;
var $co... | code_fim | hard | {
"lang": "javascript",
"repo": "Z00fers/bobblehead",
"path": "/public/js/script.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>p;seq)']]],
['prune_5fpreorder',['prune_preorder',['../classpruner_1_1Tree.html#a960ac327488daa6b2de86ea7be5aee7d',1,'pruner::Tree::prune_preorder()'],['../classpruner_1_1Tree.html#afb20a52559dd24b773a694dcbb76ef5c',1,'pruner::Tree::prune_preorder(v_uint &seq)'],['../classTree.html#a960ac327488daa6b... | code_fim | hard | {
"lang": "javascript",
"repo": "USCbiostats/pruner",
"path": "/docs/html/search/functions_6.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: alifeitaoge/GCanvas path: /core/test/benchmarks/line/tc_2d_lineJoin_bevel.js
ctx.beginPath();
ctx.lineWidth = 10*ratio;
ctx.li<|fim_suffix|>o);
ctx.lineTo(50*ratio, 200*ratio);
ctx.stroke();<|fim_middle|>neJoin = 'bevel';
ctx.miterLimit = 5;
ctx.moveTo(10*ratio, 10*ratio);
ctx.lineTo(200*ratio, ... | code_fim | medium | {
"lang": "javascript",
"repo": "alifeitaoge/GCanvas",
"path": "/core/test/benchmarks/line/tc_2d_lineJoin_bevel.js",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>o);
ctx.lineTo(50*ratio, 200*ratio);
ctx.stroke();<|fim_prefix|>// repo: alifeitaoge/GCanvas path: /core/test/benchmarks/line/tc_2d_lineJoin_bevel.js
ctx.beginPath();
ctx.lineWidth = 10*ratio;
ctx.lineJoin = 'bevel';
ctx.miterLimit = 5;
ctx.moveTo(1<|fim_middle|>0*ratio, 10*ratio);
ctx.lineTo(200*ratio, ... | code_fim | easy | {
"lang": "javascript",
"repo": "alifeitaoge/GCanvas",
"path": "/core/test/benchmarks/line/tc_2d_lineJoin_bevel.js",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> //Save changes to Tasks
onSave: function (component, event, helper) {
component.set("v.isRefresh",false);
var draftValues = event.getParam('draftValues');
helper.saveTasks(component, draftValues);
helper.getTasks(component,helper);
},
//Handle c... | code_fim | hard | {
"lang": "javascript",
"repo": "rverga/b2b-commerce-on-lightning-quickstart",
"path": "/force-app/main/default/aura/PMT_TaskTableEditor/PMT_TaskTableEditorController.js",
"mode": "spm",
"license": "CC0-1.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> //Handle multiple task selection
handleTaskSelect : function(component, event, helper) {
var selectedRows = event.getParam('selectedRows');
component.set("v.selectedTasks", selectedRows);
var setRows = [];
for ( var i = 0; i < selectedRows.length; i++ ) {
... | code_fim | hard | {
"lang": "javascript",
"repo": "rverga/b2b-commerce-on-lightning-quickstart",
"path": "/force-app/main/default/aura/PMT_TaskTableEditor/PMT_TaskTableEditorController.js",
"mode": "spm",
"license": "CC0-1.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>app.use(
parser.urlencoded({
extended: true
})
);
app.use(parser.json());
app.use(express.static(__dirname + "/public"));
const serverPort = process.env.PORT || 1488;
app.listen(serverPort, function() {
console.log("Server is on " + serverPort + " port.");
});<|fim_prefix|>// repo: kav137/bea... | code_fim | hard | {
"lang": "javascript",
"repo": "kav137/beautifulKimai",
"path": "/app.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>const serverPort = process.env.PORT || 1488;
app.listen(serverPort, function() {
console.log("Server is on " + serverPort + " port.");
});<|fim_prefix|>// repo: kav137/beautifulKimai path: /app.js
var express = require("express");
var morgan = require("morgan");
var cookie = require("cookie-parser");
v... | code_fim | hard | {
"lang": "javascript",
"repo": "kav137/beautifulKimai",
"path": "/app.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> {
type: 'confirm',
name: 'confirmAddEmployee',
message: 'Would you like to add another employee?',
default: false
}
])
.then(employeeData => {
teamData.employees.push(employeeData);
if (employeeData.confirmAddEmployee) {
return promptEmployee(teamD... | code_fim | hard | {
"lang": "javascript",
"repo": "MikeGShelby/team-generator",
"path": "/Index.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>// Query with parameter word
app.post('/pyramid', (req, res) => {
const input = req.query.word;
if (!input) {
res.status(400).send("Bad Request: No query parameter 'word' found");
} else {
res.status(200).send({ isPyramidWord: pyramid.checkPyramid(input) });
}
});
/**
* Query with text1... | code_fim | hard | {
"lang": "javascript",
"repo": "rtkg12/fetch-rewards-challenge",
"path": "/index.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> if (match.params.username) {
return (
<View>
<UserContainer username={match.params.username} />
</View>
);
} else {
return (
<View>
<Chart height={128} data={userGrowth} />
</View>
);
}
}
}
export default compose(us... | code_fim | hard | {
"lang": "javascript",
"repo": "vanila-io/spectrum",
"path": "/admin/src/views/users/index.js",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>ndow",placement:"left",html:!0,title:"Modal Form Wizard",content:"Completely improved from the ground up, our new Wizard Modals provides an exceptional solution for any ad-hoc form requirement."});t.show(),setTimeout((function(e){t&&t.dispose()}),e)}}(5e3)}),17e3),setTimeout((function(){!function(e){var o... | code_fim | hard | {
"lang": "javascript",
"repo": "pegalogics/vikrammills",
"path": "/public/assets_admin/js/custom/intro.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> onFlightSearch(params) {
this.setState({ isLoading: true })
searchFlights(params)
.then((flights) => {
this.setState({ flights, isLoading: false, searchParams: params })
})
.catch(error => console.warn(error))
}
onFlightsReset() {
this.setState({ flights: null... | code_fim | hard | {
"lang": "javascript",
"repo": "kzadurska/warsawjs-workshop-20-flights-search",
"path": "/src/App.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> searchFlights(params)
.then((flights) => {
this.setState({ flights, isLoading: false, searchParams: params })
})
.catch(error => console.warn(error))
}
onFlightsReset() {
this.setState({ flights: null })
}
displayCity(code) {
const place = this.state.airport... | code_fim | hard | {
"lang": "javascript",
"repo": "kzadurska/warsawjs-workshop-20-flights-search",
"path": "/src/App.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> invalidHandler: function (e, t) {
i.hide(), r.show(), App.scrollTo(r, -200)
},
highlight: function (e) {
// debugger;
$(e).closest('.form-group').addClass('has-error')
},
unhighlight: function (e) ... | code_fim | hard | {
"lang": "javascript",
"repo": "ahmedbhaa22/arabiantanks",
"path": "/public/ropo_app/js/custom/order_validation.js",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: AmbientLighter/waldur-homeport path: /src/billing/billing-records-list.js
const billingRecordsList = {
controller: RecordsListController,
controllerAs: 'ListController',
templateUrl: 'views/partials/filtered-list.html'
};
export default billingRecordsList;
// @ngInject
function RecordsLi... | code_fim | hard | {
"lang": "javascript",
"repo": "AmbientLighter/waldur-homeport",
"path": "/src/billing/billing-records-list.js",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>tooltip>' + gettext('Total'),
className: 'all',
render: row => $filter('defaultCurrency')(row.price)
}
],
rowActions: this.getRowActions()
};
},
getRowActions: function() {
if (this.currentUser.is_staff) {
return BillingUtils.ge... | code_fim | hard | {
"lang": "javascript",
"repo": "AmbientLighter/waldur-homeport",
"path": "/src/billing/billing-records-list.js",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
if( step == 0 )
{
histogramBinCount = std::max( 1, cvRound( ( result.m_maximum - result.m_minimum ) / 50.0 )+1 );//modified here
result.m_minimum-=25;
result.m_maximum += 25;
}
else
{
histogramBinCount = std::max( 1, cvRound( ( result.m_maximum - result.m_minimum ) / static_cast< do... | code_fim | hard | {
"lang": "cpp",
"repo": "liguanqun/Origal_DSKCF",
"path": "/src/cf_libs/common/DepthHistogram.cpp",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: imgreenbird/QUANTAXIS path: /QUANTAXIS_Trade/PYCTP/PyCTP_wrap.h
Field *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
vir... | code_fim | hard | {
"lang": "cpp",
"repo": "imgreenbird/QUANTAXIS",
"path": "/QUANTAXIS_Trade/PYCTP/PyCTP_wrap.h",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast);
virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRs... | code_fim | hard | {
"lang": "cpp",
"repo": "imgreenbird/QUANTAXIS",
"path": "/QUANTAXIS_Trade/PYCTP/PyCTP_wrap.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>oid OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder);
virtual void OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo);
virtual void OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo)... | code_fim | hard | {
"lang": "cpp",
"repo": "imgreenbird/QUANTAXIS",
"path": "/QUANTAXIS_Trade/PYCTP/PyCTP_wrap.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>TlsValidationContextSdsTrust& TlsValidationContextSdsTrust::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("secretName"))
{
m_secretName = jsonValue.GetString("secretName");
m_secretNameHasBeenSet = true;
}
return *this;
}
JsonValue TlsValidationContextSdsTrust::Jsonize() con... | code_fim | hard | {
"lang": "cpp",
"repo": "aws/aws-sdk-cpp",
"path": "/generated/src/aws-cpp-sdk-appmesh/source/model/TlsValidationContextSdsTrust.cpp",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> ReferenceBase<Payload> (const ReferenceBase<Payload>&);
ReferenceBase<Payload>& operator=(const ReferenceBase<Payload>&);
/* Private variables */
std::function<ReferenceUniquePtr(Payload)> m_acquire_reference_func;
std::function<void(ReferenceBase<Payl... | code_fim | hard | {
"lang": "cpp",
"repo": "jafffy/VKGL",
"path": "/include/OpenGL/reference.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>#ifndef elaborator_h
#define elaborator_h
namespace hse
{
// Generated through simulation
void elaborate(graph &g, const ucs::variable_set &variables, bool report_progress = false);
graph to_state_graph(const graph &g, const ucs::variable_set &variables, bool report_progress = false);
graph to_petri_... | code_fim | medium | {
"lang": "cpp",
"repo": "nbingham1/hse",
"path": "/hse/elaborator.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> inline void setSampleRate (float sr)
{
onepole_.setSampleRate (sr);
onepole_.setFreq (10.0f);
}
inline float tick (float input)
{
return onepole_.tickHP (input);
}
private:
OnePoleZDF onepole_... | code_fim | hard | {
"lang": "cpp",
"repo": "JelleBakker/WaveguideLibrary",
"path": "/Source/Filters/jbaudio_DCBlock.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>namespace wawo { namespace net {
template <class _peer_t>
class service_provider_abstract :
virtual public wawo::ref_base
{
public:
typedef _peer_t peer_t;
typedef typename peer_t::message_t message_t;
private:
u32_t m_id;
public:
service_provider_abstract( u32_t const& id ):
m_id(id)... | code_fim | medium | {
"lang": "cpp",
"repo": "legend0702/wawo",
"path": "/include/wawo/net/service_provider_abstract.hpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> cudaFree(d_A);
cudaFree(d_rowptr);
cudaFree(d_colidx);
cudaFree(d_values);
delete[] rowptr;
delete[] colidx;
delete[] values;
delete[] h_rowptr;
delete[] h_colidx;
delete[] h_values;
return errcnt;
}
int main() {
assert(test(1024) == 0);
std::vector<... | code_fim | hard | {
"lang": "cpp",
"repo": "nanaHa1003/NLA_SCML_2018",
"path": "/ex4/ex4.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> str.assign((const char *)(Memory+offset), *(stackPtr+1));
std::cout << "[CS \"" << str << "\"]" << std::endl;
}
break;
case SID_VAR: std::cout << "Var" << std::endl; break;
}
}
}<|fim_prefix|>// repo: hotkeysoft/pfe_8085basic path: /basic/prototypes/expreval/exprstack.cp... | code_fim | hard | {
"lang": "cpp",
"repo": "hotkeysoft/pfe_8085basic",
"path": "/basic/prototypes/expreval/exprstack.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> if (vit == gvalues_.end())
*ofs_ << "0";
else
*ofs_ << vit->second;
}
}
*ofs_ << "\\n\\" << std::endl;
}
else if (str == "ruler")
{
if (chnum_ > 1)
*ofs_ << "CH-" << ch_ << " ";
str = object->getName();
*ofs_ << "ID-" << str << "," << t_;
for (auto it ... | code_fim | hard | {
"lang": "cpp",
"repo": "SCIInstitute/fluorender",
"path": "/FluoRender/FluoRender/Script/ScriptVisitors.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
float y = 70.0f;
tex->Render(-(tex->GetWidth() * 0.4f),
g_pFramework->GetWindow()->GetHeight() - tex->GetHeight() + y);
// �ׂ��������炵�܂��B
auto frame = TextureAsset(TextureKey::PotFrame);
Vector2 framePos(tex->GetWidth() * 0.6f, g_pGraphics->GetTargetHeight() -... | code_fim | hard | {
"lang": "cpp",
"repo": "OiCGame/GameJam01",
"path": "/Project/PotGimmick.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> // ��ֈړ�������
float radius = 60.0f;
Mof::CCircle zone(m_Position, radius);
for (auto& food : m_Foods) {
food.Update();
if (zone.CollisionPoint( food.GetPosition())) {
food.Stop();
} // if
} // for
m_FoodCount = MOF_MIN(m_Foods.size(), FoodCountMax... | code_fim | hard | {
"lang": "cpp",
"repo": "OiCGame/GameJam01",
"path": "/Project/PotGimmick.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
//-------------------------------------------------------------------------------------
// EXAMPLE USAGE
//
// IDXConfigDB* pCDB = IDXConfigDB::Create();
// if (!pCDB->Load("config.txt", d3dAdId, d3dCaps, SysMem, VidMem))
// {
// ... error ...
// }
//
// ... use properties ...
//
// pCDB->Re... | code_fim | hard | {
"lang": "cpp",
"repo": "TomLeeLive/aras-p-dingus",
"path": "/dingus/dingus/dxutils/DXConfigDB.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> SUPPORTED_10EN_11EN_STEAM void ExtinguishPoint(CVector point, float range);
SUPPORTED_10EN_11EN_STEAM CFire *FindFurthestFire_NeverMindFireMen(CVector pos, float minRange, float maxRange);
SUPPORTED_10EN_11EN_STEAM CFire *FindNearestFire(CVector pos, float *pDistance);
SUPPORTED_10EN_11EN_... | code_fim | medium | {
"lang": "cpp",
"repo": "DK22Pac/plugin-sdk",
"path": "/plugin_III/game_III/CFireManager.h",
"mode": "spm",
"license": "Zlib",
"source": "the-stack-v2"
} |
<|fim_suffix|>void testLeapDates()
{
cout << endl << "*** testLeapDates() *** " << endl;
XLDate d1(2017, 7, 1);
XLDate d2(2000, 2, 1);
XLDate d3(1900, 10, 26);
cout << "d1 = " << d1 << " is a leap year? " << (d1.leapYear() ? "True" : "False") << endl;
cout << "d2 = " << d2 << " is a leap year? " << (d2.l... | code_fim | hard | {
"lang": "cpp",
"repo": "QuantDevHacks/XLDate",
"path": "/Main01.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> mat_y.create(rows, cols, CV_8UC1); // release & create
for (unsigned int i = 0; i < rows; ++i)
{
uchar *p = mat_y.ptr<uchar>(i);
for (unsigned int j = 0; j < cols; ++j)
{
p[j] = cv::saturate_cast<uchar>(pred_tensor.At<float>({0, 0, i, j}) * 255.0f);
} // CHW->HWC
}
cv::r... | code_fim | hard | {
"lang": "cpp",
"repo": "xinsuinizhuan/lite.ai",
"path": "/ort/cv/subpixel_cnn.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> // Register all new components.
World->UpdateWorldComponents(false, false);
});
AfterEach(
[this]
{
UxtTestUtils::DisableTestInputSystem();
FrameQueue.Reset();
Pointer->GetOwner()->Destroy();
Pointer = nullptr;
Target->GetOwner()->Destroy();
Target ... | code_fim | hard | {
"lang": "cpp",
"repo": "microsoft/MixedReality-UXTools-Unreal",
"path": "/UXToolsGame/Source/UXToolsTests/Tests/GrabTargetComponentFocusLock.spec.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> const std::string baseDir = "gt/gt" + std::to_string(subdeviceId) + "/";
baseFreqFactor = baseDir + "base_freq_factor";
mediaFreqFactor = baseDir + "media_freq_factor";
baseScale = baseDir + "base_freq_factor.scale";
mediaScale = baseDir + "media_freq_factor.scale";
}
LinuxPerformance... | code_fim | hard | {
"lang": "cpp",
"repo": "intel/compute-runtime",
"path": "/level_zero/tools/source/sysman/performance/linux/os_performance_imp_prelim.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>void LinuxPerformanceImp::init() {
const std::string baseDir = "gt/gt" + std::to_string(subdeviceId) + "/";
baseFreqFactor = baseDir + "base_freq_factor";
mediaFreqFactor = baseDir + "media_freq_factor";
baseScale = baseDir + "base_freq_factor.scale";
mediaScale = baseDir + "media_freq... | code_fim | hard | {
"lang": "cpp",
"repo": "intel/compute-runtime",
"path": "/level_zero/tools/source/sysman/performance/linux/os_performance_imp_prelim.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>/* USER CODE BEGIN PRIVATE_FUNCTIONS_DECLARATION */
/* USER CODE END PRIVATE_FUNCTIONS_DECLARATION */
/**
* @}
*/
USBD_CDC_ItfTypeDef USBD_Interface_fops_FS =
{ CDC_Init_FS, CDC_DeInit_FS, CDC_Control_FS, CDC_Receive_FS };
/* Private functions ---------------------------------------------... | code_fim | hard | {
"lang": "cpp",
"repo": "takeyabuyaketa/usbcan",
"path": "/Src/usbd_cdc_if.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>namespace sd {
namespace memory {
AllocationEntry::AllocationEntry(MemoryType type, sd::LongType ptr, sd::LongType numBytes, std::string &stack) {
_pointer = ptr;
_numBytes = numBytes;
_stack = stack;
_memoryType = type;
}
std::string AllocationEntry::stackTrace() { return _stack; }
sd::LongType... | code_fim | medium | {
"lang": "cpp",
"repo": "deeplearning4j/deeplearning4j",
"path": "/libnd4j/include/memory/impl/AllocationEntry.cpp",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> _systems->addSystem(new fms::ScriptManagerSystem());
_systems->addSystem(new fms::RenderingSystem(fm::Window::kWidth, fm::Window::kHeight));
_systems->init(EntityManager::get(), EventManager::Get());
}
void Engine::Stop()
{
_systems->Stop();
}
void Engine::Resume()
{
fm::Time::scale = ... | code_fim | hard | {
"lang": "cpp",
"repo": "F4r3n/FarenMediaLibrary",
"path": "/lib/src/Engine.cpp",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>void Engine::Update(float dt)
{
// auto start = std::chrono::system_clock::now();
_systems->update(dt * Time::scale, EntityManager::get(), EventManager::Get());
GarbageCollector::Collect();
//_numberFramesTimer++;
//if(_numberFramesTimer == 200) {
// auto end = std::chrono::system_clo... | code_fim | hard | {
"lang": "cpp",
"repo": "F4r3n/FarenMediaLibrary",
"path": "/lib/src/Engine.cpp",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> {
RakNet::OP_DELETE_ARRAY(array, file, line);
if (size>0)
array = RakNet::OP_NEW_ARRAY<queue_type>(size, file, line );
else
array=0;
allocation_size = size;
head = 0;
tail = 0;
}
template <class queue_type>
inline queue_type& Queue<queue_type>::operator[] ( unsigned int position ) ... | code_fim | hard | {
"lang": "cpp",
"repo": "MTASZTAKI/ApertusVR",
"path": "/core/sceneManager/network/3rdParty/raknet/Source/DS_Queue.h",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> head = 0;
tail = allocation_size;
allocation_size *= 2;
// Delete the old array and move the pointer to the new array
RakNet::OP_DELETE_ARRAY(array, file, line);
array = new_array;
}
}
template <class queue_type>
Queue<queue_type>::Queue( Queue& original_copy )
{
// Alloca... | code_fim | hard | {
"lang": "cpp",
"repo": "MTASZTAKI/ApertusVR",
"path": "/core/sceneManager/network/3rdParty/raknet/Source/DS_Queue.h",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> const Ty& at(unsigned index) const
{
const Ty* pData = m_data;
for (unsigned block = index >> BLOCK_SHIFT; 0U != block; --block)
{
pData = *reinterpret_cast<Ty* const*>(pData + BLOCK_LEN);
if (NULL == pData)
{
break;
... | code_fim | hard | {
"lang": "cpp",
"repo": "GPUOpen-Tools/common_src_amdtbasetools",
"path": "/Include/gtFragmentedVector.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> index = 0U;
pData = static_cast<Ty*>(malloc((sizeof(Ty) * BLOCK_LEN) + sizeof(void*)));
*reinterpret_cast<Ty**>(pData + BLOCK_LEN) = NULL;
*reinterpret_cast<Ty**>(pDataPrev + BLOCK_LEN) = pData;
}
... | code_fim | hard | {
"lang": "cpp",
"repo": "GPUOpen-Tools/common_src_amdtbasetools",
"path": "/Include/gtFragmentedVector.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>#include "common.hh"
#include "common/BamReader.hh"
#include "grmpy/AlignSamples.hh"
#include "grmpy/CountAndGenotype.hh"
#include "grmpy/Parameters.hh"
#include "json/json.h"
TEST(Grmpy, GenotypesSingleSwap)
{
std::string graph_path
= g_testenv->getBasePath() + "/../share/test-data/paragraph... | code_fim | medium | {
"lang": "cpp",
"repo": "pkrusche/paragraph",
"path": "/src/c++/test-blackbox/test_grm.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>TC_OBJECT_EXTERN_NON_CREATEABLE_IMPL(CAGCStations)<|fim_prefix|>// repo: FreeAllegiance/Allegiance path: /src/AGC/AGCStations.cpp
/////////////////////////////////////////////////////////////////////////////
// AGCStations.cpp : Implementation of the CAGCStations class.
//
#include "pch.h"
#include "AGC... | code_fim | medium | {
"lang": "cpp",
"repo": "FreeAllegiance/Allegiance",
"path": "/src/AGC/AGCStations.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> // register all types of the module
virtual void registerTypes();
};
}<|fim_prefix|>// repo: MORTAL2000/echo path: /engine/modules/sray/sray_module.h
#pragma once
#include "engine/core/main/module.h"
namespace Echo
{
// 1. used for light map
// 2. real time painter
class SRayModule : public Mod... | code_fim | medium | {
"lang": "cpp",
"repo": "MORTAL2000/echo",
"path": "/engine/modules/sray/sray_module.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> CoordinateTransform input_batch_transform(arg_shape,
input_batch_transform_start,
input_batch_transform_end,
input_batch_transform_source_strides,
... | code_fim | hard | {
"lang": "cpp",
"repo": "openvinotoolkit/openvino",
"path": "/src/core/reference/include/ngraph/runtime/reference/avg_pool.hpp",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> // The below conditions are to provide conformance between the ref and plugins:
// If exclude_padding is disabled (include_padding... enabled), then:
// The size of window doesn't change even if the window was clipped to fit the
// input, number of elements will be equal to... | code_fim | hard | {
"lang": "cpp",
"repo": "openvinotoolkit/openvino",
"path": "/src/core/reference/include/ngraph/runtime/reference/avg_pool.hpp",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> if (targetFrame == "" || sourceFrame == "")
{
ok = false;
return result;
}
// Fixes extrapolation into the future in Rviz if run remotely.
ros::Time now = ros::Time::now();
ok = tfBuffer.canTransform(targetFrame, sourceFrame, now, ros::Duration(10.0));
if (!ok)... | code_fim | medium | {
"lang": "cpp",
"repo": "Tai-Min/Statek-UAV",
"path": "/catkin_ws/src/statek_map/src/common.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> : public sync_preferences::PrefServiceSyncableObserver {
public:
explicit NewUserRestorePrefHanlder(Profile* profile);
~NewUserRestorePrefHanlder() override;
NewUserRestorePrefHanlder(const NewUserRestorePrefHanlder&) = delete;
NewUserRestorePrefHanlder& operator=(const NewUserRestorePrefHan... | code_fim | hard | {
"lang": "cpp",
"repo": "JadeLuo/chromium",
"path": "/chrome/browser/chromeos/full_restore/new_user_restore_pref_handler.h",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> void testCCNSevenIsNotASmell();
void testCCNEightIsASmell();
void testCCNNineIsASmell();
};<|fim_prefix|>// repo: halfhiddencode/oclint-04 path: /test/headers/oclint/rule/CyclomaticComplexityRuleTest.h
#include <cxxtest/TestSuite.h>
#include "oclint/rule/CyclomaticComplexityRule.h"
class Cyclomati... | code_fim | medium | {
"lang": "cpp",
"repo": "halfhiddencode/oclint-04",
"path": "/test/headers/oclint/rule/CyclomaticComplexityRuleTest.h",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> static std::string assist()
{
return " wipe\n\t[-h --help]\n\t[-d --directory <directory name>]\n\t[-m --mode]\n\t[-s --set <new mode>]\n\t[-r --range <first line> <last line>]\n\t[-l --line <line>]\n\t[-k --keyword <keyword>]\n\t[<regular expression>]\n";
}
private:
void wipe(std::string &filenam... | code_fim | hard | {
"lang": "cpp",
"repo": "devmichalek/Skipper",
"path": "/Commands/cmd_wipe.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
std::optional<fbg::RemoteService_ReadByType_Result> fidl_result;
service_proxy()->ReadByType(fuchsia::bluetooth::Uuid{kCharUuid.value()},
[&](auto cb_result) { fidl_result = std::move(cb_result); });
RunLoopUntilIdle();
ASSERT_TRUE(fidl_result.has_value());
ASSERT... | code_fim | hard | {
"lang": "cpp",
"repo": "yueyedeai/fuchsia",
"path": "/src/connectivity/bluetooth/core/bt-host/fidl/gatt2_remote_service_server_unittest.cc",
"mode": "spm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>
// Rotate the model to that angle.
void rotate(float angle, glm::vec3 rotation);
// Scale the model
void scale(glm::vec3 scaling);
private:
// Loads a model with supported ASSIMP extensions from file and stores the resulting meshes in the meshes vector.
void loadMod... | code_fim | hard | {
"lang": "cpp",
"repo": "GChasing/heli-gym",
"path": "/heligym/envs/renderer/src/model.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
LinearTrajectory::LinearTrajectory(Point x1, double t1, Point x2, double t2)
: Trajectory(t1, t2) {
// Constrain only initial and final positions
inner = PolynomialTrajectory::compute({x1}, t1, {x2}, t2);
}
TrajectoryState LinearTrajectory::evaluate(double t) {
return inner->evaluate(t);
}
}<|fi... | code_fim | hard | {
"lang": "cpp",
"repo": "dennisss/tansa",
"path": "/src/trajectory/linear.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> This constructor generates the optimal minimum jerk polynomial
*/
LinearTrajectory::LinearTrajectory(Point x1, double t1, Point x2, double t2)
: Trajectory(t1, t2) {
// Constrain only initial and final positions
inner = PolynomialTrajectory::compute({x1}, t1, {x2}, t2);
}
TrajectoryState Linear... | code_fim | medium | {
"lang": "cpp",
"repo": "dennisss/tansa",
"path": "/src/trajectory/linear.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>Wrapper::Wrapper()
{
}
Wrapper::~Wrapper()
{
}
std::string Wrapper::toString(v8::Local<v8::Value> value)
{
v8::String::Utf8Value utf8(value);
return std::string(*utf8);
}
} } } // namespace Poco::JS::Core<|fim_prefix|>// repo: leisen2009/macchina.io path: /platform/JS/Core/src/Wrapper.cpp
//
// W... | code_fim | medium | {
"lang": "cpp",
"repo": "leisen2009/macchina.io",
"path": "/platform/JS/Core/src/Wrapper.cpp",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>public:
bool isEmpty() const;
QSize size() const;
int number() const;
void setNumber(int newNumber);
QChar item(int line, int column) const;
QString line(int line) const;
public:
QSize readLevel(QTextStream& stream, bool normalize =true, bool skipEmptyLines =true);
b... | code_fim | hard | {
"lang": "cpp",
"repo": "bulmaxvad/QtSokoban",
"path": "/Source/Map/TextMap.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> TextMap& normalize();
TextMap normalized() const;
TextMap& operator = (const TextMap& other);
TextMap& operator = (const TextMap&& other);
QString toString() const;
public:
static bool isLinesLengthConst(const TextMap& txtLevel);
static int getLevelNumberFrom(const QS... | code_fim | hard | {
"lang": "cpp",
"repo": "bulmaxvad/QtSokoban",
"path": "/Source/Map/TextMap.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>static inline const char *
get_module_basename(const module_data_t *mod)
{
const char *mod_name = dr_module_preferred_name(mod);
if (mod_name == nullptr) {
const char *slash = strrchr(mod->full_path, '/');
#ifdef WINDOWS
const char *bslash = strrchr(mod->full_path, '\\');
i... | code_fim | hard | {
"lang": "cpp",
"repo": "fengjixuchui/rdpfuzz",
"path": "/rdpfuzz-dynamorio/clients/drcachesim/tracer/func_trace.cpp",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: fengjixuchui/rdpfuzz path: /rdpfuzz-dynamorio/clients/drcachesim/tracer/func_trace.cpp
SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGEN... | code_fim | hard | {
"lang": "cpp",
"repo": "fengjixuchui/rdpfuzz",
"path": "/rdpfuzz-dynamorio/clients/drcachesim/tracer/func_trace.cpp",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: fengjixuchui/rdpfuzz path: /rdpfuzz-dynamorio/clients/drcachesim/tracer/func_trace.cpp
"
#define NOTIFY(level, ...) \
do { \
if (op_verbose.get_value() >= (level)) \
dr_fprintf(STDERR, __VA_ARGS__); \
} whil... | code_fim | hard | {
"lang": "cpp",
"repo": "fengjixuchui/rdpfuzz",
"path": "/rdpfuzz-dynamorio/clients/drcachesim/tracer/func_trace.cpp",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>public:
QSqlDatabase mydb;
void closeConnection() //function to close connection to database
{
mydb.close();
mydb.removeDatabase(QSqlDatabase::defaultConnection); //close database and remove connection
}
bool openConnection() //... | code_fim | hard | {
"lang": "cpp",
"repo": "justkennyclub/score-system",
"path": "/ScoreSystem/login.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> if (!mydb.open())
{
qDebug()<<("Failed to open database");
return false;
}
else
{
qDebug()<<("Connected to database");
return true;
}
}
private:
Ui::Login *ui;
};
#endif // LOGIN_H... | code_fim | hard | {
"lang": "cpp",
"repo": "justkennyclub/score-system",
"path": "/ScoreSystem/login.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> MincObject* getType(const MincBlockExpr* parentBlock, const std::vector<MincExpr*>& params) const
{
return getErrorType();
}
};
pkgScope->defineExpr(MincBlockExpr::parseCTplt("$E($E, ...)")[0], new NonFunctionCallKernel1());
// Define function call on non-function identifier
struct NonFuncti... | code_fim | hard | {
"lang": "cpp",
"repo": "RcSepp/minc",
"path": "/builtin-packages/paws/src/paws_subroutine.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
/// Adds pawn non-captures to the list. Targets is a bitboard of valid to-squares. Shift is the distance the pawn moved to get to the target square, mod 64. For example, for a white piece moving forward one row this is '8'. For a black piece moving forward one row this is 56 (-8 % 64).
fn add_pawn_pu... | code_fim | medium | {
"lang": "rust",
"repo": "Nereuxofficial/rust_move_gen",
"path": "/src/mv_list/mod.rs",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> let server = TcpServer::bind(url).await.map_err(|e| e.to_string())?;
let (op_reads, op_writes) = TcpServerOp::<RequestLatRepr>::new(server.clone())
// .debug("ingress")
.morphism_closure(|item| item.flatten_keyed::<tag::VEC>())
.morphism(Switch)
// .debug("split")
... | code_fim | hard | {
"lang": "rust",
"repo": "MingweiSamuel/spinach",
"path": "/examples/kvs/src/main.rs",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>/// Run the client portion of the program.
async fn client<R: tokio::io::AsyncRead + std::marker::Unpin>(url: &str, input_read: R) -> Result<!, String> {
let (read, write) = TcpStream::connect(url).await.map_err(|e| e.to_string())?
.into_split();
let read_comp = TcpOp::<ResponseLatRepr>:... | code_fim | hard | {
"lang": "rust",
"repo": "MingweiSamuel/spinach",
"path": "/examples/kvs/src/main.rs",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: sfackler/rust-postgres path: /postgres-types/src/special.rs
use bytes::BytesMut;
use postgres_protocol::types;
use std::error::Error;
use std::{i32, i64};
use crate::{FromSql, IsNull, ToSql, Type};
/// A wrapper that can be used to represent infinity with `Type::Date` types.
#[derive(Debug, Cl... | code_fim | hard | {
"lang": "rust",
"repo": "sfackler/rust-postgres",
"path": "/postgres-types/src/special.rs",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> fn accepts(ty: &Type) -> bool {
matches!(*ty, Type::TIMESTAMP | Type::TIMESTAMPTZ if T::accepts(ty))
}
}
impl<T: ToSql> ToSql for Timestamp<T> {
fn to_sql(
&self,
ty: &Type,
out: &mut BytesMut,
) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
let... | code_fim | hard | {
"lang": "rust",
"repo": "sfackler/rust-postgres",
"path": "/postgres-types/src/special.rs",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> // display the panes
let mut split_pane = gtk::Box::new(gtk::Orientation::Horizontal, 10).unwrap();
split_pane.set_size_request(-1, -1);
split_pane.add(&left_tree);
split_pane.add(&right_tree);
window.add(&split_pane);
window.show_all();
gtk::main();
}<|fim_prefix|>// re... | code_fim | hard | {
"lang": "rust",
"repo": "StephanvanSchaik/gtk",
"path": "/examples/src/treeview.rs",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: calvinaco/cro-nodelib path: /native/src/lib.rs
use neon::register_module;
mod address;
mod common;
mod error;
mod function_types;
mod hd_wallet;
mod key_pair;
mod transfer_transaction;
<|fim_suffix|>register_module!(mut ctx, {
register_address_module(&mut ctx)?;
register_hd_wallet_modu... | code_fim | medium | {
"lang": "rust",
"repo": "calvinaco/cro-nodelib",
"path": "/native/src/lib.rs",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.