query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
bfc039fdd8d88c3597dd025489082ddf | f0861466b8f7609d1e683680b5d513b2 | 获得笔记本里的笔记所有笔记信息 | NotesInfo notesInfo = notesService.getByIdAndUserId(notesId,userId);
if(notesInfo == null){
return ResultData.error("笔记本不存在");
}
NoteInfo noteInfo = new NoteInfo(userId,notesId);
noteInfo.setBaseKyleUseAnd(true);
List<NoteInfo> list = mapper.baseSelectByCondit... | 1 |
1a1c8f90b5a0aeba5bd891a06c520616 | e05016c1cc4cd9d1fdf0a6f496259c53 | Return True if other is a Position representing the same location. | class Position
def eql?(other)
self.class == other.class && (x == other.x && y == other.y)
end | 1 |
19721c8320f6e074213560209c5c99d9 | 434eb2c1f71bf9950c4fe477d6f1e6a2 | Contorno do pão definido | contexto.lineWidth = "2";
contexto.strokeStyle = cor;
contexto.beginPath();
contexto.moveTo(pos_X*60,pos_Y*60);
contexto.lineTo((pos_X*60)+tamanho-5 ,pos_Y*60);
contexto.arcTo((pos_X*60)+tamanho,pos_Y*60, (pos_X*60)+tamanho ,pos_Y*60+5,10);
contexto.lineTo((pos_X*60)+tamanho,pos_Y*60+55);
contexto.arcTo((... | 1 |
f89da95c77a396c2178ac2ddbf11c139 | e8bcbfb643dbb4b8e0eaab35ced21e6c | Returns the result of interpreting the object as an instance of '<em>SMF Type Ref</em>'.
<!-- begin-user-doc -->
This implementation returns null;
returning a non-null result will terminate the switch.
<!-- end-user-doc --> | protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
case ScxmlPackage.DOCUMENT_ROOT: {
DocumentRoot documentRoot = (DocumentRoot)theEObject;
T result = caseDocumentRoot(documentRoot);
if (result == null) result = defaultCase(theEObject);
return result;
}
case... | 0 |
12e89dd54ab8b237862ff906a6a5ac65 | 81e30c7ea74d108b0ee10b8a686d02f9 | Create an exception.
Find the handler for this exception if one exists and set things up to
handle it. If no handler exists, call the default exception handler.
Allow the debug system to intercept the exception handling process
and restart it. | class BaseHandler(webapp2.RequestHandler):
def handle_exception(self, ex, debug_mode):
self.log_exception(ex)
self.render(u'error',
trace=traceback.format_exc(), debug_mode=debug_mode) | 0 |
56f430b909d7de3d4ef5a5eb9f5306db | a9456d9287570382f00dad1342f02f17 | Returns the first expediente in the ordered set where idTipoReclamacion = ?. | OrderByComparator orderByComparator) throws SystemException {
List<Expediente> list = findByperiodo(periodo, 0, 1, orderByComparator);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
} | 0 |
a88dd6fdaed03aeba945eb23b8941b65 | e5fa257e05ad631a4f298a7e84ef89fb | Finds the segment used for evaluation at polycurve_parameter. | {
double l = 0.0, r = 1.0, u;
double segment_dist, ssearch;
int segment_no = 0;
do segment_no ++;
while (seg_length[segment_no] < s);
segment_no --;
segment_dist = total_length * (s - seg_length[segment_no]);
SegCoef(segment_no);
do
{
u = (l + r) /2.0;
ssearch = A... | 1 |
39a4641a4899d62a7000717aeb8228a7 | 1000bdf779bfe1bfb90b59278596f775 | Creates a concern that will cache generated responses in the specified
folder. Persists the cache accross server restarts. | abstract class FormCreateRespondent extends Model
abstract public static function getCachePath(ConfirmationInterface $confirm): string; | 0 |
59a5f930d3b25c892e73960fd9f2c444 | fb927120839b9c4608728b8a56b24402 | Returns a table with information about coordinates, distance and predicted time duration. | query2 = (prefix + """
SELECT ?startlat ?startlon ?Deslat ?Deslong
WHERE {
?product rdfs:label """ + Product + """ .
?product product:has_Transportation ?transportation .
?transportation rdfs:label ?Transportrecord .
?transportation transport:hasStartLocation ?Startloc . ?Startloc geo... | 1 |
b2bd6c3b777178e4ad9da46e164bdb45 | 898c000a4eb763ccc180125dc9eebb89 | Format input data around a single commit and return as a row for a CSV. | class ZephyrMarkdownFormatter(ZephyrTextFormatMixin, ZephyrOutputFormatter):
def upstream_commit_line(self, commit):
full_oid = str(commit.oid)
link = ('https://github.com/zephyrproject-rtos/zephyr/commit/' +
full_oid)
return '- [{}]({}) {}'.format(commit_shortsha(commit),
... | 0 |
fdb7b77c9b54a5768cfe4ed1afa5b520 | 6d009db420922680076cd9612b1553ab | ジャンルを取得します。 | StringBuilder urlStringBuilder =
new StringBuilder("https://webservice.recruit.co.jp/hotpepper/genre/v1/?key=" + API_KEY + "&format=json");
URL url = null;
try {
url = new URL(urlStringBuilder.toString());
new GenreAsync(activity).execute(url).get(3000, Ti... | 1 |
49a3c0099dd60a6e104b9907f7e071af | a24705ced4d24c3257b0bdd1cc8f88da | 更新日志的医院-换成店铺 | @PatchMapping
public Header<HospitalRes> update(@RequestBody HospitalReq request) {
return hospitalService.update(request);
} | 0 |
587fa9cc03a1cc64c3b274f839f2d98a | 86b13acf249b6eaf86189123b56055f8 | Loads and transforms an image as float32.
Resize image to dimensions INPUT_WIDTH x INPUT_HEIGHT.
Rotate image by 0, 90, 180 and 270 degrees. | class ProbeManNet
private fun loadImage(bitmap: Bitmap, sensorOrientation: Int): TensorImage {
inputImageBuffer.load(bitmap)
val cropSize = Math.min(bitmap.width, bitmap.height)
val numRotation = sensorOrientation / 90
val imageProcessor = ImageProcessor.Builder()
.add(Resize... | 1 |
019d28a865a6319b51c8469465068cf8 | 10ff42b7572c91096811de5e3f976853 | 挂载后绑定鼠标滚轮事件 | function regist_mousewheel(){
if(document.addEventListener && !document.attachEvent)
{
document.addEventListener('mousewheel',scrollFunc);
document.addEventListener('DOMMouseScroll',scrollFunc);
}
else if(document.attachEvent && !document.addEventListener){
document.attachEvent('onmousewheel',scr... | 1 |
1d2e2d49f250c1659ca764581495e004 | d5ac71735ed1a248f1c5a43dc761def9 | [=[
Observes the current set of active keys
]=] | function activator()
return 'Shift', Hold
end | 0 |
3e17129bc3df88dfb2bfbd4c1009e373 | 7c5cfd40e85fd2b7bedc42f8659e5d73 | Compute the data pointer for the dimension the variable is located in
(the loop level). This involves generating a strength reduction in
each outer dimension.
Variables referring to the same array may be found on different
loop levels. | NPY_NO_EXPORT npy_intp *
NpyIter_GetInnerLoopSizePtr(NpyIter *iter)
{
npy_uint32 itflags = NIT_ITFLAGS(iter);
int nop = NIT_NOP(iter);
if (itflags&NPY_ITFLAG_BUFFER) {
NpyIter_BufferData *data = NIT_BUFFERDATA(iter);
return &NBF_SIZE(data);
}
else {
NpyIter_AxisData *axisdata... | 0 |
3a506f46d3ba1333052b18f5e1faaa63 | c98728ef7b11e232e443ba6815d81f7a | Build a cache key used by the cache\lib by combining the dao class name, the cache key and the variables found in the $params | {
$cacheKey = 'catalog_page_';
if ($slug) {
$cacheKey .= $slug . '_';
}
$cacheKey .= serialize($params);
$cacheKey .= '_' . $this->configs->getPerPage();
return $cacheKey;
} | 0 |
5efbae20ac2931d63db9d022f4068749 | 812b5772e44fbc84eb955c83eb53eb2f | 6.获取检车报告车辆照片 | namespace YGJZJL.PublicComponent
public partial class BaseInfo : FrmBase
public void QueryGPImage(string strID)
{
DataTable dtTP = new DataTable();
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "ygjzjl.car.WeighMeasureInfo";
ccp.MethodName = "Q... | 1 |
da1fa538b10c628f1b40b92f3d24b1d5 | 6cec7271a672a62add5ce9224cab1ca1 | build full paths for a post with extension suffixes. | media_directory = "%s/%s (%s)/S%s/" % (data["directory"].title(),
data["show"],
data["year"],
data["season_padded"])
media_base = "%s - %s - %s.%s" % (data["show"]... | 1 |
c9c0038c7c1f400923f2de73b07e28db | 480a3e47637b65d13772567c6516d36f | 视频后退5秒 | public class MainFrame extends JFrame
public void actionPerformed(ActionEvent arg0) {
video.skip(5000);
} | 0 |
ab729e1fcc780c60a7c39a55d2ed1dbd | 9ff86def08a38efa7c502c992bf70334 | The scalable target. | @JsonInclude(JsonInclude.Include.NON_NULL)
public class ScaleRequest extends OwnedObject
@DocumentationExample("telegreen_db")
public String getScaleTargetName() {
return scaleTargetName;
} | 1 |
f117c242fab5cd8f7f850e5d689de498 | 81d31af2e53e5f4398f33cf7008a19b6 | Gets the coordinates of the mouse's intersection with the y-plane | {
if (CurrentWorld.IsFirstPersonMode)
throw new Exception("Method GetMouseIntersectionPoint() may not be called from First Person Mode object.");
Vector3 worldRay = Get3DMouseCoords(HelperGL.GetNormalizedMouseCoords(ms.X, ms.Y, CurrentWindow));
Vector3 normal;... | 1 |
ca5a38d19b9de0fffba3c64d9c4a863a | 512e70556a07fdfc506dde4c55810455 | Unlock SPI bus | {
if (nor->flags & SNOR_F_HAS_LOCK)
return spi_nor_unlock(&nor->mtd, 0, nor->params.size);
return 0;
} | 1 |
7a24bc000e1548e73a305c992382d368 | 4a619f6a76d32120ce6928240beca942 | 查出该用户未评价商品的个数 | int getNotOnSellItemNumByUserId(int userId) throws Exception; | 0 |
7aad38ace28ee9d9c08be18d4d65ab3e | c4a861f3dea4b6a2a67c29c33d41c2fe | Called when a purge notification has been received for a node.
Upon receiving this notification all items associated should be
considered retracted. | class IPubSubService(Interface):
def notifyDelete(service, nodeIdentifier, subscriptions): | 1 |
48f5bb6089c6d4bacc5a06ceddbc0e72 | 754f8a88237d711156636f8875635029 | 部门公司分类导航 | class UserController extends AdminBaseController
public function department()
{
$result = Db::name('department')->column('');
$tree = new Tree();
$tree->icon = ['│ ', '├─ ', '└─ '];
$tree->nbsp = ' ';
foreach ($result as $m) {
$newMenus[$... | 1 |
d54db41aabc72aa7d653ec778cb6fc58 | 42bfe663c1f157a76083f038f6bb7fc0 | Возвращает шарики, находящиеся на поле. | public class BBSimulator extends Simulator
public Balls[] getBalls() {
return this.balls;
} | 1 |
59707687fa98827ecb7570e0a53a4be6 | 34becb849e16d1b55524be5ab2a9ba12 | 当异步代码执行成功时,我们才会调用resolve(...), 当异步代码失败时就会调用reject(...)
在本例中,我们使用setTimeout(...)来模拟异步代码,实际编码时可能是XHR请求或是HTML5的一些API方法. | console.log("异步方法2 start");
return new Promise((resolve, reject) => {
if (y > 0) {
return resolve(2 * y + 1);
} else {
return reject('error!');
}
})
} | 0 |
2c316eda1d86a4e0bc43fa3fc657fab4 | 0a4101ac849bf24f6f336aaeb6924c0d | Subtract n from A.
n = A,B,C,D,E,H,L | {
set_n();
check_h_sub8(_A, _A);
check_c_sub8(_A, _A);
_A -= _A;
check_z(_A);
} | 0 |
f456bfce7b7b0c91cf3a9f92499c047d | 5bc342067023a771204da1aaaaafabfd | Copy no more than N bytes of SRC to DEST, stopping when C is found.<br>
Return the position in DEST one byte past where C was copied,<br>
or NULL if C was not found in the first N bytes of SRC.<br>
<i>native declaration : string.h:26</i> | char *dst ,
const char *src ,
unsigned int siz
)
{
char *d = dst;
const char *s = src;
unsigned int n = siz;
if (n != 0) {
while (--n != 0) {
if ((*d++ = *s++) == '\0')
break;
}
}
if (n == 0) {
if (si... | 0 |
629550a88d1fea08028d77ec13bc83ae | b8ba4b501eab6d54f87bbdb55a73a6ec | Lists all Sport entities. | class SportController extends Controller
public function index()
{
$sports = Sport::all();
return view('sports.IndexSports', compact('sports'));
} | 1 |
d2666aa1aa3806f43690bb506be2d0dc | d345b3013635784605da23b4a24160b8 | 地質図Naviロゴの表示 | function loadNaviPage(){
$(document).on('pageinit', '#navi-page', function() {
makeADGTag(10722, "adg");
});
} | 0 |
b93295e36078507d1d814a8c60b3f03a | 6ddd5278cedef990af3f9d586a077ae6 | First verify that the default operator precedence works fine | class OperatorPriorityTestCase(unittest.TestCase):
def test_priority(self):
plus = OpFactory.get_op_by_symbol('+')
minus = OpFactory.get_op_by_symbol('-')
multiplier = OpFactory.get_op_by_symbol('*')
divider = OpFactory.get_op_by_symbol('/')
power = OpFactory.get_op_by_symbol('^'... | 1 |
adc95a42d7a3558dc74632b525db9e19 | fcd5afd977ec9c847bcbefc9c263027c | 将图片转成jpge上传至Fastdfs. | logger.debug('Start to Save the picture')
client = Fdfs_client(get_tracker_conf("config/fdfs_client.conf"))
image_encode = cv2.imencode(".jpg", image)[1]
data_encode = np.array(image_encode)
str_encode = data_encode.tostring()
try:
ret = client.upload_by_buffer(str_encode)
if 'su... | 1 |
e28a2768c535eff24f31f42f2f1c0186 | 02fec3f9111b2c1243394d79aa9beba1 | Free the NCBISub and associated data | if(sub) {
free(sub->key);
free(sub->nt1);
free(sub->nt0);
free(sub->pos);
free(sub->map);
if(sub->q0) { free(sub->q0); }
if(sub->q1) { free(sub->q1); }
free(sub);
}
} | 1 |
2ff9c627f70aa5746dc4a6413f0e89d2 | 0b45087f13dc7824d8ae7785b3711b3d | Returns the meta object for the reference list '{@link smart_nursing_home.Room#getPerson <em>Person</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getDocumentRoot_Person(); | 0 |
da5dff6e314f06df2c9ef9a57f25ea65 | e789cee7f2104ce3af1c2f7db34e76e5 | Writes the documentation related to a report.
documentation | class MainWindow(QtGui.QMainWindow):
def onDocumentation(self):
path = self.settings.path + 'doc\\report.pdf'
os.startfile(path) | 0 |
edff000bcfd6d433fd3a28395af8cbb8 | 42acbf9dd134ae67c17686e81a09848e | Serialize elements of a contiguous array | sz = len(array)
ranges = findContigousRanges(array, isSorted)
nRanges = len(ranges)
if nRanges == 0:
file_handler.write(indent + var + ' = new Uint32Array([' + format_array(array, indent) + ']);\n');
return;
file_handler.write(indent + var + ' = new Uint32Array(' + format_int(sz) +... | 1 |
2b5a2aa78fc432d87969521ab87fe9fb | be4678d20446b57d3ad9859ff37a0c7c | コミュニティをフォローする関数。 | class JCNicoLiveInfoFragment : Fragment()
private fun requestRemoveCommunityFollow(communityId: String) {
(requireParentFragment() as? JCNicoLiveFragment)?.showSnackBar(getString(R.string.nicovideo_account_remove_follow_message), getString(R.string.nicovideo_account_remove_follow)) {
viewModel.reque... | 0 |
252c2840eccd13a451c73d35fb704e69 | 75422cb017e8cbf9794d52edd14d6573 | Kills the bridge instance | namespace JacobGames.SuperInvoke public static class SuperInvoke
public static void KillAll() {
ScheduleBridge.KillAll();
} | 1 |
bab647553e8bbf105a543779d465010a | 03dbc91b90b674403ff73396b263a3b8 | UC 2 : Performs Peek and Pop until stack becomes empty | int main()
{
Push(10);
Push(20);
Pop();
Display();
return 0;
} | 0 |
1f81bc7eee4628be85808fa6fb1a671c | eee856eb751dea2ca3bb78df7811616b | only if not present | void HeaderParser::addMissingFooter(xmlNodePtr meta,xmlNodePtr descrittori,xmlNodePtr formulafinale,
xmlNodePtr conclusione,int tdoc) const
{
if(tdoc==2) {
return;
}
} | 0 |
3e76af5f3e91aeb86649c4894b311d7f | a9d41572fdccc04dcdcef3f7452a2afc | Returns the first focusable element in `container`. | export class FocusTrap
private getFirstTabbableElement( target: HTMLElement ): HTMLElement {
if (this.checker.isFocusable(target) && this.checker.isTabbable(target)) {
return target;
}
const children = target.children || target.childNodes;
for (let i = 0; i < children.length;... | 1 |
3202bc83ca1b08e385eee4915c8b664b | e96589ac83022caf198458249fa6970b | Take the latency tuple and randomly choose a value that falls within
that range. | def _randommedian(highlows):
high = highlows[0]
low = highlows[1]
offset = random.random() * (high - low)
return low + offset | 1 |
a73c4ee70a7a5589206a486374a57b83 | bc4b0393509c0ee075a9636c4aaa8c90 | 新增大图图文模板 | var html = '';
html += ' <div class="Tccm">';
html += ' <div class="con_c_t">';
html += ' <div class="con_bzk" style=" border:none; background:#fff; margin-bottom:0px;">';
html += ' <div style="padding:10px;">';
html += ' <a href="' + newOneNewsUrl
+ '" target="mainFrame" class="button green medium">新... | 0 |
6983d3e0bd8e423cbca9d0280879e17d | 6cb0f18c16def114cbc8a5d0a20a9970 | Handle a window share being added to the system. | @Service
public class SharingServiceImpl implements SharingService
@Override
public void enableSharing(PortalControllerContext portalControllerContext, SharingForm form) throws PortletException {
SharingWindowProperties windowProperties = this.getWindowProperties(portalControllerContext);
String pat... | 1 |
12608551abb496384f7e65185c0b47b8 | 1c81f13a200b8a8348d8e65463358359 | Split group by the last part of name
such as BM_memcpy_naive/BM_memcpy_fast will be the same group
TestCase name rule: BM_testname_tagname, the last part MUST BE category name | def extract_label_from_benchmark(benchmark):
bench_full_name = benchmark['name']
bench_name = bench_full_name.split('/')[0]
if (bench_name.startswith('BM_')):
return bench_name[3:]
else:
return bench_name | 0 |
3b0e1112d778e5b38ff86013b1bb6d51 | 43303ad20fbf5af58958f55f322c79e0 | Date2MMdd_ww(MM月dd日 周ww) | public class UDateUtil
public static String getMdJw(UDate date, HttpServletRequest req) {
GsMessage gsMsg = new GsMessage();
String mmdd = null;
String month =
StringUtil.toDecFormat(String.valueOf(date.getMonth()), "00");
String day =
StringUtil.toDecFormat(Strin... | 1 |
c4043fa7a4e1d2b5fcd21b74cf992194 | a50e9843c2736fe66609bd274c1970d4 | Retrieves <see cref="AssetInfo" /> for all assets in the inventory. | namespace BLL
public static class InventoryLogic
public static List<AssetInventoryModel> GetAllAssetInventories()
{
return InventoryDal.GetAllAssetInventories();
} | 0 |
d02f787ab5e8c724f56e8d940c9902ec | 8bc78bf3eed2d08043ba04b597383769 | determina el directorio donde se van a guardar las imagenes | def carpetaDestino():
global savedir
savedir = filedialog.askdirectory()
print("DEBUG - savedir: " + savedir) | 1 |
b2047b133a76435d7d6b7b973004e1ba | de8d1554c1020e3a1809e61f2238e2df | Lazily creates and returns the scroll pane within which the {@link JGraph}
is displayed. | if (scrollPanel == null) {
scrollPanel = new JScrollPane(messagesView.getViewComponent());
scrollPanel.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPanel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
scrollPanel.setPreferredSize(new Dimension(800,200));
... | 1 |
00d8bb0a69a01e43a9a306ae40043dff | f5bc20d97f84263426837e403531422d | 上线时发送上线提醒 | if(in_array($mid,Config_Game::$paymids)){
$msg = "用户".$mid."上线了,请留意!";
$phoneno = '18127052328';
$limit = Logs::factory()->limitCount($phoneno, 'msg', 1,true,30*60);
if( $limit < 3 ){
$this->sendMessage($msg, $phoneno, 3);
}
}
} | 1 |
97a95d0368794ce84e8e5c5f3dfc8832 | 674c992cc76c5877fdc3ec9a408f27f9 | Abfrage des Bewegungs-Objektes. | const Vector2d& MovableObject::getMovement() const {
return m_movement;
} | 1 |
9a14e769eef9126685ffb98dccd0bea3 | f8eeabc67766353d1b9c055dffc0c5c0 | Gets a no-op callback register, just so that we do not call a null pointer
when we do not have it | {
struct nl_cb *cb;
cb = (struct nl_cb *) malloc(sizeof(struct nl_cb));
if (cb == NULL)
goto fail;
memset(cb, 0, sizeof(*cb));
return nl_cb_get(cb);
fail:
return NULL;
} | 1 |
82a2832673edd58095e5219989ae2045 | 20c88a2645b662fb100f7d3338e48652 | Registers the editor descriptors. | namespace Scissors.ExpressApp
public abstract class ScissorsBaseModule : ModuleBase
protected override void RegisterEditorDescriptors(EditorDescriptorsFactory editorDescriptorsFactory)
{
} | 1 |
2c7ccc06418e6e4c3ba8e0718ecc8220 | 3ac923ef34afd9f01f7d1c865fac2d0c | Pushes a record (Completed or Processing) for the current progress to the shell | class Admin_View_Helper_PushEmailProcess extends Zend_View_Helper_Abstract
public function pushEmailProcess($rowCount)
{
ob_start();
?>
<!-- begin -->
<h3><?php echo $this->view->translate('Sending PushMails.'); ?></h3>
<p>
<?php echo $this->view->translate('Mail sending in-progress'); ?>
</p>
<div cl... | 0 |
07e1ceaf73790079df643f0a6866933d | 10873ca976da95d9fe999b1618419821 | 根据服务id 获取关联物品(针对 不需要 库存,医保什么的 如输血的物品) | {
var serviceGoods = serviceGoodsReps.FindAll().Where(m => m.Product.Id != productId);
var dtoServiceGoods = serviceGoods.Select(s => new DtoServiceGoods()
{
Id = s.Id,
CreatePerson = s.CreatePerson,
CreateTime = s.CreateTime,
... | 0 |
ea994ac474126defe0c58f6658036d94 | 6fa285df6838be57b027ff659a19da20 | Setter for wether or not to autoload classes | void setAutoLoad( boolean autoLoad ); | 1 |
dbd015865926e571377a5eb0af2eadfb | 22a30268cee6733171d1508b3737a24c | Remove a pit as soon as it is surrounded by two lower pits (being the top point of a triangle) | self.is_legal_move(pit_id)
stones = self.pits[pit_id]
while stones > 0:
pit_id += 1
if pit_id > 13:
pit_id = 0
stones -= 1
return pit_id | 0 |
4939b6ed4bbbec1de36c658e91fa1a28 | 7294e6d705328e878735328c7db19538 | Tests that the AWSBidVisor starts threads and stops them correctly. | public void testConcurrentConnectionStopOperation() throws JMSException, InterruptedException {
ConcurrentOperation stopConnectionOperation = new ConcurrentOperation() {
@Override
public void setup() throws JMSException {
session.start();
connection.st... | 0 |
90c83a9b9760fd018b9e557d048b4c62 | 25d8347e327ca58ae21dd97019b5c83e | 两小数的精确求差 | sub(a, b){
let c = 0
let d = 0
try {
c = a.toString().split('.')[1].length
} catch (f) { }
try {
d = b.toString().split('.')[1].length
} catch (f) { }
let e = 10 ** Math.max(c, d)
return (a * e - b * e) / e
} | 1 |
063c8c24e49fc5cd34eecc174d520ecf | 505a8ece6a86d795b4ba34040837b255 | 保留小数点后两位的方法 | double b = Double.valueOf(a);
DecimalFormat df = new DecimalFormat("#.0000");
String temp = df.format(b);
b = Double.valueOf(temp);
return b;
} | 0 |
9e23e0a8c7869aea69c8e114d6c5c0e7 | 6db40977c3fea137ba5797b36c5e61ff | Checks the validity of the bookings dataframe created from the booking.csv file | expected_columns = ['booking_id', 'restaurant_id', 'restaurant_name', 'client_id',
'client_name', 'amount', 'guests', 'date', 'country']
if df is None:
return False
if check_is_empty(df):
print('bookings.csv is empty')
return False
if not check_columns(df,... | 1 |
3953fcfc452f91048212e1b4bc1b3f38 | 29eba3b4baea14744d92f852494628e5 | Gets the new account id. | @ResponseBody
public LoginResponse getNewID(){
LoginResponse res = new LoginResponse();
res.setResponseCode(ResponseCode.SUCCESS);
res.setUserId(service.getNewID());
return res;
} | 1 |
dd8d1dd404e7db88eb8101d4e59540df | 544ac17b659cbb599193072287fc0f3e | List certificates in a specified key vault | public final class KeyVaultClient
public ServiceResponse<PagedList<CertificateItem>> getCertificates(final String vaultBaseUrl)
throws KeyVaultErrorException, IOException, IllegalArgumentException {
return innerKeyVaultClient.getCertificates(vaultBaseUrl);
} | 1 |
775e19e089074ce7723e1e5209121aa3 | d54a53a431c4c9e7261b4c85374e59d1 | Returns the diameter of single bar that can economically apporximate the given area of steel. | def width0diameter(b, d):
bd = b / d
return bd | 0 |
0f1673854e2c4f98e347ad3b8c35f75c | a6a52dc6bfb8fab44e8fa16905568eca | Retorna o nº de saltos do nodo até o sink | int CalcularSaltoInicial(int n)
{
int salto = 1;
while (salto < n / 9)
salto = salto * 3 + 1;
return salto;
} | 0 |
720b6c17ef5d86c5b874724f45a65b98 | 85c5b0d3f9949144be312a88ec1393cd | Checks for username and email absence in DB. | class MyDBCTRL:
def check_login(self, name, email):
conn, cursor = self.aux_connect_sql_server_2008()
find_player_str = \
"SELECT uid FROM " + \
"User WHERE name=? OR email=?;"
cursor.execute(find_player_str, name, email)
result = cursor.fetchone()
conn.cl... | 1 |
f7c86629f5933cfd7c17324a503db2f1 | 6ee961acf8b928e4cf1b687e9f7c5b37 | # Summarize the total votes and percent of votes for each candidate | d %>%
group_by(!!as.name(col)) %>%
tally() %>%
mutate(percentage = 100.0 * n / sum(n))
} | 1 |
4f2f42d51fa5782be0543eeddfbe5fa9 | 0d2562de946f003940adf01dd666908d | DeleteShift Deletes a `Shift`. | {
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(ShiftsTableMap::DATABASE_NAME);
}
return $con->transaction(function () use ($con) {
$affectedRows = 0;
$affectedRows += parent::doDeleteAll($con);
ShiftsTableMap::... | 0 |
a88ad2fa4889a713ba55cd5b9eeece44 | b197fcd9acd2254b0859798a60e76e60 | Set the advance booking offset range | {
$this->setFilterMinMax(
'duration_min',
'duration_max',
(int)$min,
(int)$max
);
$this->setFilterMinMax(
'stopover_duration_min',
'stopover_duration_max',
(int)$stopover_min,
(int)$stopover_max
... | 0 |
faf71455fc6423663c0ba96db7a3fd7c | 541847fc046d39bcefe82f67d86c9a3c | 表示操作是否执行成功
0 表示成功,其他为失败,
错误码代表的文字信息可通过 {@link LSCoreInterface} findErr 方法查询 | @Override
public int getErrorCode() {
return 0;
} | 1 |
bd9a1b3c071544aa523ed572c9b4370a | 56ce4e88a687326179c1ff5b82aea442 | 座標変換:スクリーン -> ワールド | namespace Ninjeditor
class Map
static public void TransformFromScreenToWorld
( int screen_x, int screen_y,
int screen_w, int screen_h,
int scroll_x, int scroll_y,
ref int out_x, ref int out_y)
{
out_x = screen_x + scroll_x;
... | 1 |
199bcdadd9ae25cb83e88a256f7b5586 | c7f72ab4a63b44ebf86c766606b002b5 | Value of path attribute. If path attribute was link then resolved link
value is returned instead and link name can be retrieve via {@link #getLinkName}. | class AttributeLabel extends TemplateLabel
public String getPath() throws Exception {
Expression path = getExpression();
String name = getName();
return path.getAttribute(name);
} | 0 |
16405203bfcaa91a77299f8eb7286022 | 9da53543770b76df1f0d8a995d884055 | 对链表L进行就地排序 | void sort(LinkNode *&L) {
LinkNode *p, *pre, *q;
p = L->next->next;
L->next->next = NULL;
while (p != NULL) {
q = p->next;
pre = L;
while (pre->next != NULL && pre->next->data < p->data) {
pre = pre->next;
}
p->next = pre->next;
pre->next = p;
... | 1 |
65ec31da98a6bb093d190b6af91044d4 | 9acbe6e10e00897145bbaf7ca06879e7 | 获取当前处理的Sheet索引号。 | class Html extends BaseReader
public function getSheetIndex()
{
return $this->sheetIndex;
} | 1 |
90bc92ab84d362d98cff09b73d100b9c | 5ce657d0cd2582503576ff3a636c0846 | Helper to test if we have flashes.
Taken from: http://blog.paulopoiati.com/2013/02/22/testing-flash-messages-in-flask/ | class Request
public static function hasFlash($name)
{
return isset($_SESSION['flashMessages'][$name]);
} | 1 |
cb5202e98c0746396a3d0a8c775443f5 | eeddede7d5d4b93c5f0d9f85dfba4c1e | ############Get the index of the most recent end date after a given start date | $endingDates = explode(',', $termEndingDates);
asort($endingDates);
$currentDate = date('m-d');
$result = "";
foreach ($endingDates as $d) {
if (strcmp($currentDate, $d) < 0) {
$result = $d;
break;
}
}
$year ... | 0 |
984d7236e5ae025191399caa0864ab4f | 96630d344aaad5fcbddac05762efd65c | 安心送订单erp单号回填页面 | class UserController extends CommonController
public function order_tracking_no() {
$this->display('user_order_tracking_no.dwt');
} | 0 |
a073c07b52a388eef743133dab4c964b | e8d7dfb2e18656458a6427f369aec0ad | GET: UserAnime | namespace AnimeOnexWebAPI.Controllers
public class AnimesController : Controller
public ActionResult Index()
{
return View(db.Anime.ToList());
} | 0 |
be7f750b3a6279cc1f9c486330d1206f | 20bf65dc526f6f464d6fddacf40004a9 | 删除不含仓库的节点 | class Company extends Model
private static function deleteTrunk($nodeId,$trunkType,$delete){
ModelUtil::delete('TreeTrunk', $nodeId);
if($trunkType == TreeUtil::TYPE_ORGANIZATION_TRUNK){
User::where('tree_trunk_id',$nodeId)
->where('delete','<',ModelUtil::getDeleteLevel())
->update(['delete'=>$delete]);
... | 0 |
95ddd27d178adfd930aaece4543fa27f | bc97b0b79c03d19a7a1135076bda7e5f | Just after the loop | class FusionSC_Blog extends Fusion_Element
public function after_loop() {
if ( 'grid' === $this->args['layout'] || 'masonry' === $this->args['layout'] || 'timeline' === $this->args['layout'] ) {
echo '</div>' . "\n";
echo '</article>' . "\n";
} else {
echo '</article>' . "\n";
}
} | 1 |
e103a31c3cecf9728de4bffac881396f | 68603c89b0fdcdd77076a0effeaea1e5 | 将某个值从某个任意范围映射到0到1范围 | value: number,
min: number,
max: number
): number {
return (value - min) / (max - min);
} | 1 |
8c9f5ad85aa20a102fac55e19e9a420d | 2243f94a2fdb2ecce666a7fad3a1541c | Devolve uma populacao apos passar todos os filhos pelo processo de mutacao | tamanho_populacao_atual = len(populacao_atual)
quantidade_novos_individuos = self.__tamanho_populacao - tamanho_populacao_atual
filhos = []
for _ in range(quantidade_novos_individuos):
cromossomo_pai = self.__selecao.selecionar_cromossomo(populacao_atual)
cromosso... | 0 |
913dbbb7243ac92c99cf12545a890c69 | 9a667a9b2deef68d18e810560e78ea16 | GET: api/AgahiServices | namespace iGNProject.Controllers
public class AgahiFavoritesController : ApiController
public IHttpActionResult GettblAgahiFavorite()
{
return Json(db.tblAgahiFavorite.Select(p=> new { AgahiID = p.AgahiID , FavoriteAgahiID = p.FavoriteAgahiID, IsDeteled = p.IsDeteled, UserID = p.UserID}).ToList(... | 0 |
16b570c0a5c57cae5c6e7c7ecf0ad4c5 | fc2cadb58cc8d78cd1cc2c0933df7823 | 分页获取月收入排行 | namespace YxLiCai.Server.UserAccumulatedEarnings
public class UserAccumulatedEarningsService
public ResultInfo<List<UserCountMonth_AccumulatedEarnings_Model>> GetListOrderByCreateTimeDesc_month(long Id, int CurrentPage, int PageSize)
{
ResultInfo<List<UserCountMonth_AccumulatedEarnings_Model>> r... | 1 |
1c4ab934218211c2f6308e5172d73338 | 99b221164f8436c801119e4f38b2058f | Start the Apb dma transfer from the current request. This will read the
current configured address from the register and increment them as per
passed parameter and start the dma transfer. | atppc_ecp_read_dma(struct atppc_softc *atppc, unsigned int *length,
unsigned char ecr)
{
*length = uimin(*length, atppc->sc_dma_maxsize);
atppc->sc_dmastat = ATPPC_DMA_INIT;
atppc->sc_dma_start(atppc, atppc->sc_inbstart, *length,
ATPPC_DMA_MODE_READ);
atppc->sc_dmastat = ATPPC_DMA_STARTED;
ecr &= ~ATPPC_SERVICE... | 1 |
e5aa04521663d930b6993e741007faa9 | 7bdb6127a8b0e0091ede6958df5891b4 | vypocita dlzky hran | if len(pot) == 0:
return 0
prejsnja = pot[0]
dolzina=0
for i in pot:
dolzina = dolzina + abs(i[0] - prejsnja[0]) + abs(i[1] - prejsnja[1])
prejsnja = i
return dolzina | 1 |
2b5b78bfe9dd272db7dd9b4809ce21bc | 75b4e2ec283949ede0316d9c72b39df2 | Returns true if the OCSP No Check extension is present
(value is irrelevant to this extension) | public class OcspCertHashExtension implements OCSPExtension
@Override
public void init() {
} | 0 |
f68a5339a2a46d2dd26099d59cb08a61 | 5efd2a5800cf7eeff50bed6852d98881 | Convert from a UTF-16 Java string to a UTF-32 string. | javacall_result jsrop_jstring_to_utf16_string(jstring java_str,
javacall_utf16_string * utf16_str) {
javacall_result res = JAVACALL_FAIL;
if (!KNI_IsNullHandle(java_str)) {
jsize string_length = KNI_GetStringLength(java_str);
javacall_utf16_string str_buffer = JAVAME... | 0 |
8655c3accc0d97b68c25472dd1638746 | f280673794827785260ca82305a01439 | called for callable objects, e.g. from pathlib import Path; Path(".") | class Function(PyobjMixin, nodes.Item):
def _pyfuncitem(self):
return self | 0 |
7f649dcc6eae3baffdeb43c8262451fb | eb8b4ec1a11e4823f28240d7fbf6adfd | testing the staff-provided sampleBoard2-2. Should parse board correctly | @SuppressWarnings("unused")
public class ParserTests
@Test
public void testSampleBoard22() {
try {
File testBoardFile = new File(
getResourcePath("client/resources/sampleBoard2-2.pb"));
Board testBoard = OutputProcessor.parse(testBoardFile);
assertEqua... | 1 |
9e728df52b41eaa146a034cc062c1040 | 43774f35a56201a68e64eb8adfaf5b58 | Parse CMP CertRepMessage in DER format | static int cmp_pkibody_crepmsg_parse_der( cmp_CertRepMessage *crep,
unsigned char *p, unsigned char *end )
{
int ret;
size_t len;
if( ( ret = mbedtls_asn1_get_tag( &p, end, &len,
MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_ASN1_CONSTRUCTED | 1 ) ) == 0 )
{
if( ( r... | 1 |
1c2d72486027115027569664db2a1830 | a716568ba22ceb0a4d09cfc0cf265c1d | カードの役を計算 | value = 0
for i, card in enumerate(self.cards):
if self.board[self.player-1][i] is not None:
evalue = self.board[self.player-1][i].value
if card.value == SpecialValue.SPECIAL:
value += 10
elif card.value > evalue and card.va... | 1 |
079ed9cc1bab3c948a043ba16e9b57aa | 85edaeef01e5eec6c2821ef00bbdc47e | Gets all workshops for given attendee Id. | [Route("api/GetTicketById")]
public IHttpActionResult GetTicketsByAttendee(int attId)
{
var attendees = _attendeeService.GetTicketByAttendee(attId);
return Ok(attendees);
} | 0 |
2d17b6090ece34bd4df9c6cbe0feae78 | 206caf18abec127484d1545c576bf820 | In place adds a column at the given position. | export class Matrix
addColumn(atIdx: number, col: number[] = []) {
if (this.coordFilter || this.sliceParams) {
throw new Error('Not supported for sliced or filtered matrixes.');
}
this.cols = this.cols + 1;
for (let i = 0; i < this.data.length; i++) {
this.data[i]?.splice(atIdx, 0, col[i]);
... | 1 |
6f1c66c0c73c17fb0adce257030d98c9 | a504197d9e9979d86ae6074c1a3d0e0f | Set sharing links | abstract class AbstractSharableEntity extends AbstractLinkableEntity
public function generateLinks() {
parent::generateLinks();
$this->shareLink = md5($this->linkId.$this->linkName);
} | 1 |
5250db1044718b6d74f670c4e3f29faf | 6cf87eaa0b2f2e110becb98a383b82f9 | 指定ユーザの最新のRSSを取得し、DBへ保存する | rss_url = getRssFeedData()
path = './latest_url.txt'
if not os.path.isfile(path):
string = 'new file'
with open(path, mode='w') as file:
file.write(string)
local_url = ''
with open(path, mode='r') as file:
local_url = file.read()
if (local_url == rss_url):
... | 0 |
f980471ac6a8828fe9f5879019d4de4d | 02c0befd29c57330f8606b95defb4a07 | 将信息发送给C#软件 | namespace monitor
public partial class form_main_program : Form
private void send_data(byte[] information)
{
string str = Encoding.ASCII.GetString(information);
if (serialPort.IsOpen == false)
{
serialPort.Open();
}
serialPort.Write... | 1 |
032b01fcc9b65a54c421dc226ad786b2 | a188b88a648585174c00ec669127cef7 | Correctly set the title and the Next and Back buttons based on the current page. | if (this.backUrls.length) {
$("#addressBar-arrow-left")
.attr("href", this.backUrls[this.backUrls.length - 1])
.removeClass("mdc-icon-toggle--disabled");
} else $("#addressBar-arrow-left").addClass("mdc-icon-toggle--disabled");
if (this.forwardUrls.length) {
$("#addressBar-arrow-right")
.attr("h... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.