query_id
string
corpus_id
string
query
string
code
string
label
int64
de81724a8785feb22c09dc5e9d7f3814
86550aa7229c4347fb7074a839a0561e
Adds a new command to the cluster.
public class CommandQueue public void addCommand(final UUID datanodeUuid, final SCMCommand command) { lock.lock(); try { if (commandMap.containsKey(datanodeUuid)) { commandMap.get(datanodeUuid).add(command); } else { commandMap.put(datanodeUuid, new Commands(command)); } ...
1
cab8ef95c6303d1a9dae5c06c1e3501a
f934b5efd8dbefba770309489b2f0276
验证并引发异常
public void testException(){ ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml"); ExceptionService service= (ExceptionService) context.getBean("userProxy"); try { service.checkUser("admin",25); } catch (UserException e) { ...
1
544da21234ac0cecd9243b131fb77f71
2a782a635f885d074e4646ef3d21c804
Iconify the GUI window.
public class MainFrame public void windowIconified(WindowEvent e) { f.dispose(); }
0
e700d5b5db5b253d60fb4ea36278f430
4e391b80d0cd4e9aeaa3e19c31c6493e
Extension method to convert MegaMetre to FemtoMetre
namespace Qkmaxware.Units.Power public static class WattPowerConversions public static Quantity<double, FemtoWatt> ToFemtoWatt<T>(this BaseQuantity<T, GigaWatt> val) where T:IConvertible { return new Quantity<double, FemtoWatt>( Convert.ToDouble(val.Value) * 1E-9 ); }
0
963e8b8493068e226bd3782698ef9233
e550c935f3bee53e97c44739b239ce1a
设置主播信息
$id = request()->param('id'); $name = request()->param('name'); $live_room = request()->param('live_room'); $avatar = request()->file('avatar'); if ($avatar) { $info = $avatar->move(ROOT_PATH . 'public' . DS . 'images'); if ($info) { $sub_p...
1
84fc2a387328d6d5d934ab78e9c906c0
f991b5126e0742f3af3d38dc4fdd79bd
Code executed after recognising a relexp expression (something relop something)
def p_relexpr_1(p): p[0] = p[1]
0
0f375846f8f5855b7a5e5035b5bdece7
f4be914e260ab1055914cef66eb0dbdd
Replaces the Decl child.
public class JExecutableDecl extends JMemberDecl implements WithBlockStmt, WithVarDecls public void setBlock(JStmtBlock aBlock) { replaceChild(_block, _block = aBlock); }
0
92580b68feb5b1d5ab53aad2c8e28318
07e3eef08de6a3849da159fc7ef529c5
Returns the value of the '<em><b>Yeast</b></em>' reference. <!-- begin-user-doc --> <p> If the meaning of the '<em>Yeast</em>' reference isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
function getYeasts() { }
0
10b12edabd46c6af83a5f37851500c1b
51fe12c2fd72ade10b0572ad96a6e6b2
Initializes the revision state.
class RevisionPrinter public function __construct(DateHelper $date_helper, OutputHelper $output_helper) { $this->_dateHelper = $date_helper; $this->_outputHelper = $output_helper; $this->_resetState(); }
1
50da0a17b10021f67b4c18ca511d79ba
839356c8be5208e49f2740bcc76831d9
Called by the UI to request the names of all supported sensors. This allows SensorManager to be extended without needing to change the UI. of a sensor. These names should correspond to the data in the array returned by {@link #getSensorData()}.
if (APIHandle.isInternalServiceBound()) { try { return APIHandle.getGarmentInternalAPIHandle().API_getSensorNames(); } catch (android.os.RemoteException e) { } } throw new RuntimeException("Connection failed"); }
1
3821f24699fe11bbd2e6e9e301cf8a6e
927fe230a3b0b8b3bd11431bc88b2667
method to shuffle the array of rectangle heights
double tempVal; for (int i = 0; i < validCount - 1; i++) { for (int j = i + 1; j < validCount; j++) { if ((validPtr + j)->outputHeight() < (validPtr + i)->outputHeight()) { tempVal = (validPtr + i)->outputHeight(); (validPtr + i)->inputHeight((validPtr + j)->o...
0
139c654a44e99887db24185b95e31642
4eb9e3fef5c387a11229f2008449f59b
Take a coordinate pair on the grid and convert to pygame rectangle parameters
class Polygon(): def to_pygame(self, p): return int(p.x), int(-p.y+600)
0
2b4f6b47c29b0f99286515058646bf8c
ec228a63e33edaec99fbce561c960478
Adds a new Trigger group with the next availble INDEX.
namespace Flow ITrigger NewTrigger();
0
1c062fdba92889fc09ab2d9b356e5320
843cc4fba6c69a8c5242208628d39a93
Parse a text formatted PDB file.
class Journal(BaseRecord): def parse_pdb(self, line): super().parse_pdb(line) self.text.append(line[12:79].strip())
1
a9a487780b17785db44afee7789fb9ec
51b84c4a3380479d5c84dbcb3ec86fa8
The callerID number that can be used instead of <b>callerid_id</b>.
public class RemoteOutgoingEvent extends UserEvent public void setCallerId(String caller_id) { this.caller_id = caller_id; }
1
af8dedd4d8935fd7a375b8696f0bcce2
2c0053556648d6c4f4c3bcc0ec169ab9
this fucntion will select name of those customers that we buy from them. because this function will use in payment_installment.php which only use for user's payments, so we don't need name of customers we sell to them.
$products = Mage::getModel('marketplace/commission')->getCollection(); $products->addFieldToSelect('*'); $products->addFieldToFilter('order_id',$getOrderId); $products->addFieldToFilter('seller_id',$getSellerId); $productIds = array_unique($products->getColumnValues('product_id')); $produc...
0
c1df91a36b15bee2ca97a902918d9a41
c3e8c23612a1c5588d3d484ad180ee8a
对具体月份日期的纠正, 考虑闰年的情况
function cal_adjust_date( $month, $year ) { $a = array(); $a[0] = $month; $a[1] = $year; while ($a[0] > 12) { $a[0] -= 12; $a[1]++; } while ($a[0] <= 0) { $a[0] += 12; $a[1]--; } return $a; }
0
4f71ddbad859958998aa48a6ab3f3f20
876f3074f2203c8e0b6e623a18a9ee5b
set user lastfm account in postgres database or update if we already have an entry based on user input
def set_account():
0
611daa6427bf96c7b8409da00fabd404
db197c98da2b0fb755ec235efce5c0d8
Specifies the methods that are added as part of the basic OM class. This can be overridden by subclasses that wish to add more methods.
export default class ClassyResource _addBasicMethods(basics) { const _this = this; _.each(basics, (method) => { _this[method] = _this.createMethod(basicMethods[method]); }); }
1
749dd08de53fbc273a47fd1cc74089b0
80ce0c33fc1ffff25a9f051e4b86bb1c
对单元格地址进行切片,取得相应的列号
public class DES private static int getCol(String block) { String col = block.substring(1, 5); return Integer.parseInt(col, 2); }
1
a6cd08fc131b304d670b5940defbe1db
1099cf64fada690e89a7c0b20ba5fa42
get sidebar name based on ID
$valid = array( 'default_sidebar_right' => 'Default Sidebar Right', 'default_sidebar_left' => 'Default Sidebar Left', 'default_no_sidebar' => 'Default No Sidebar', 'default_boxed_sidebar_right' => 'Default Boxed Sidebar Right', 'default_boxed_sidebar_left' => 'De...
1
9bb4a0174f3ac8a2a445e90296314104
648dff3e9194fe81d284cf2bf34bf49c
获得出库单据状态
{ StringBuilder strSql = new StringBuilder(); strSql.Append("select C_STATUS "); strSql.Append(" FROM TMD_DISPATCH WHERE 1=1 "); if (fydh.Trim() != "") { strSql.Append(" AND C_ID = '" + fydh + "' "); } object obj...
1
e61caf3f4c1e7870c5644fab53e42967
7e988ab8d5de2989cf445d1ec2454009
Request the venues from the venues microservice
export class AppComponent implements OnInit public ngOnInit(): void { this.venueManager.searchVenuesInLocation({ lat: MUC_CENTER[0], lng: MUC_CENTER[1] }); }
1
0deaaff6e0f3bf4b74655ddf8633eae7
3477ca698fa26902476e1f2373be84ba
打开快速验票窗口
@RequestMapping(value = { "/open_quick_pay" }, method = { RequestMethod.GET, RequestMethod.POST }, produces = "application/json;charset=UTF-8") public HttpRespEnvelope openQuickPay(HttpServletRequest request) { HttpRespEnvelope httpRespEnvelope = super.checkSecureToken(request); if (httpRespEnvelope == null) {...
0
93fadebbc166663ba38344320cb080d0
cb7cfd0792749be5fe45bf304a583b14
Replaces all of the edge weights by their multiplicative inverse.
edge_weight_key): g = g.copy() for v in nx.topological_sort(g): if g.node[v].get('dummy'): parents = g.in_edges(v) assert len(parents) == 1, "{}: {} != 1".format(v, len(parents)) u = parents[0][0] for c in g.neighbors(v): ...
0
5473b46bed2af8e432924a308bef1dd1
691f68655f81311bcaf64cfc981e43e8
快速排序非递归(左右指针法)
void QuickSortNor(int*array,int size) { int left = 0; int right = size; stack<int>s; s.push(right); s.push(left); while(!s.empty()) { left = s.top(); s.pop(); right = s.top(); s.pop(); if(left<right) { int div = Partion(array,left,right); s.push(right); ...
1
da8b896cdf4a63ab910d63190ae6fd25
214171de352147e708874e3bc6c9443f
fancydisplay function that displays the output in a proper tree look
if len(t) >= 3: print(i*' ' + str(t[0])) pprint(t[1], i+1) pprint(t[2], i+1) elif len(t) < 3: print(i*' ' + str(t))
1
456c22410c9a9e613b07ca7ac156566e
51e7bc5246fefc8e08ac6c28ff6b687f
Sets if transport events are to be displayed.
public class Loxone public void setEventsEnabled(final boolean eventsEnabled) { this.eventsEnabled = eventsEnabled; }
1
05828ef165fb5a8623e991a6e50a3bf6
8c60437ba60d0fc06b778a01a1b4e839
技术专区浏览历史记录
@Controller @RequestMapping("/sku") public class SkuDetailController @ResponseBody @RequestMapping("skuBrowseHistories") public Object skuBrowseHistories(@RequestParam(value="sid",defaultValue="") String sid, @RequestParam(value="pageIndex",defaultValue=PageConstant.APP_PAGE_INDEX+"")Integer curPage, @RequestPa...
1
1c88d203d82b9ddd182ee6654134b4a2
f54d260b3d4df41b87b9a306a4582f66
N = #examples M = #models F = #features model_preds = N x M meta_features = N x F returns: N x (M*F) array
for model in self.models: X_meta = np.zeros((1503424, 1)) X_test_meta = [] for fold_i, (train_i, test_i) in enumerate(self.kf.split(self.X_texts)): clf = model clf.fit(self.X_texts.tocsr()[train_i], self.y[train_i]) X_meta[test_...
0
207159adbee3cdda02b7a4d492c674b1
4b1ce9ff3632097e59f1abe8ace19ef8
保存为BMP格式的文件
{ if (file_name.LastIndexOf(".bmp", StringComparison.InvariantCultureIgnoreCase) == -1) { file_name = Path.Combine(file_name, ".bmp"); } FileStream filestream = new FileStream(file_name, FileMode.Create); RenderTargetBitmap render_target = new RenderTargetBitmap((Int32)RenderSize.Width, ...
1
dd171d746da60fbe761fecb659132856
90b5f6e8d41557a252bb5ca0e18d45c6
Test incorrect bracket order
class TestChemTokenizer(unittest.TestCase): def test_bracket_whitespace_error(self): self.assertEqual(['7.95', '(', 's', ',', '4H', ')'], self.t.tokenize('7.95(s, 4H)')) self.assertEqual(['In', 'Fig.', '5', '(', 'a', ',', 'b', ')'], self.t.tokenize('In Fig. 5(a, b)'))
0
8c3dc0c9e24191f441497a2a35477ae6
b00f8665f9508fd3df58d61a99d84321
funcion que envia la confirmacion para que empiece el juego
export class GameStartService confirmGameStart() { this.gameStartConfirmedSource.next(); }
1
088ef37c7c576b57c1dcfab071eb7973
a9924f013b7a3b86bf160dbe1da731f1
When something collides with the ship, check what it is, and act appropriately.
public class BulletCollisionHandler : MonoBehaviour void OnCollisionEnter2D(Collision2D otherObject) { if (otherObject.gameObject.name == "Asteroid(Clone)") { destroyObjects(otherObject); } else if (otherObject.gameObject.name == "EnemyShip(Clone)") { destroyObjects(otherObject);...
1
247dde3c3cef2c14a933ba95fb565fad
0a4100320bcdf24e1b25cc8cb35390a1
Метод, устанавливающий безопасные атрибуты
abstract class CModel extends CComponent implements IteratorAggregate, ArrayAccess public function setAttributes($values,$safeOnly=true) { if(!is_array($values)) return; $attributes=array_flip($safeOnly ? $this->getSafeAttributeNames() : $this->attributeNames()); foreach($values as $name=>$value) { if(is...
1
116293e1aa341ab5a57fa4be203d7cc8
115e98c0a3dafd83e432e3f579d183fd
区域滑动——纵向
class RegionalSliding(object): def Transverse(self): height = self.height / 2 width = self.width / 4 x1 = int(self.x + width) y = int(self.y + height) x2 = int(self.x + width * 3) time.sleep(2) print(x1, y) print(x2, y) self.driver.swipe(x2, y, x1,...
0
68fc3320df7cf7b92636247a062f2618
a3ddd7e1c4607fe3f9d516c42edbdfde
Returns the callback functions in the call site.
class SuggestionEngine: def get_callsites(self, func: FuncDef) -> Tuple[List[Callsite], List[str]]: new_type = self.get_trivial_type(func) collector_plugin = SuggestionPlugin(func.fullname()) self.plugin._plugins.insert(0, collector_plugin) try: errors = self.try_type(func, n...
0
eb21c6159269ed92f21f368b0ce410fc
f6749345a1af3e27275dc721242707bb
Set a new camera name.
public class Device public SDKErrorCode setCameraName(String cameraCode, String cameraNewName) throws SDKException { IDeviceMgrCability deviceMgrCability = DeviceServiceProxy.getInstance().getDeviceServiceProxy(IDeviceMgrCability.class); return deviceMgrCability.setCameraName(cam...
1
53921e6728b7a49cd9abc1222076738b
e0ba79de44d8be2f464f39a18bf0ffd9
Exposes the consumer key to be read by subclasses. This may be useful when overriding {@link #addCustomAuthorizationParameters(MultiValueMap)} and the consumer key is required in the authorization request.
public final class TwitterSettings public static final class OAuth public String getConsumerKey() { return consumerKey; }
1
c400182adf57cc2753489a86537bb818
49ed8dca6ef355eb69064f202c0128d2
获取图标位置配置表(可以用来判断是否显示)
function getIconMap() { return { appId_1: { icon: 'see-icon-m3-coordination-fill', }, appId_4: { icon: 'see-icon-m3-document', }, appId_7: { icon: 'see-icon-m3-notice-fill', }, ...
1
ebd88bbc77fe99b009895ab64e4730bd
89c9fd0a665bc962b1a581c3d4b0a108
Get sheet index from given sheet name.
{ var workbookPart = spreadsheet.WorkbookPart; var sheets = workbookPart.Workbook.GetFirstChild<Sheets>().Elements<Sheet>(); var results = sheets.ToList(); var sheet = results.FirstOrDefault(s => s.Name.ToString().Equals(name, StringComparison.Inva...
0
7aae1e703a3c387d87b44d540cc4c598
99aba0c33375cf3589bacda335adcba6
Returns a 1x1 sized and colored texture.
BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); Graphics g = image.getGraphics(); g.setColor(color); g.drawLine(0, 0, 0, 0); g.dispose(); return new TextureLoader(image).getTexture(); }
1
8566df9adeafd54ac930e32a738d21c7
42966357e6ae4672b8f081bcfc080afe
Редактирование авто.
[AuthorizeRequest("AutoBooks")] [ResponseType(typeof(AutoBookModel))] public IHttpActionResult PutUpdate([FromBody] AutoBookModel command) { if (command == null || !ModelState.IsValid) { return this.Error().InvalidParameters("Invalid AutoBook param...
1
246f157c3c1fc8b2b83edcef06a94087
928959ab2d2d6bb01a5293bf7ba7db6a
Is called every time the active vessel changes (on entering a scene, switching the vessel or on docking).
namespace Snacks public class SnacksRosterResource public virtual void onCrewBoardedVessel(Part evaKerbal, Part boardedPart) { }
0
c0a48d4a014e8275b22c6850a0eeca97
e2b5d2c6ec6daa655c7adebc3c763d31
reload images into gallery
var classname = document.getElementsByClassName("photoAHREF"); var divs = []; for (var i = 0; i < classname.length; ++i) { divs.push(classname[i]); } divs.sort(function (a, b) { return a.dataset.val.localeCompare(b.dataset.val); }); var br = document.getElementsByTagName("br")[0]; let parent = d...
0
9be76c54e39eb0ef9538f1398d2283ee
a10e97fa23c3a5cd98132641aa07b861
Test case for getMediaCacheConfig Retrieves the server MediaCache configuration.
class V3serversserverNamemediacacheApiTest extends \PHPUnit_Framework_TestCase public function testPutMediaCacheConfig3() { }
0
c9740b2a168d031d8b0b7ed8553b436c
1cf6bd5dd5d3c4e753ae4a227dc8eefc
<summary> Se validan los montos digitados. </summary
namespace PantallasDesarrollo public partial class ModificarDispositivo : Form private void monto_KeyPress(object sender, KeyPressEventArgs e) { validaciones numero = new validaciones(); numero.SoloNumeros(e); }
1
02258198cca7a712092a16ce4d2305c4
dc170285bab92fa1b2e22f79a75a7bdb
测速上报接口实现
public class CustomTRTCCloudListener extends TRTCCloudListener @Override public void onSpeedTest(TRTCCloudDef.TRTCSpeedTestResult trtcSpeedTestResult, int i, int i1) { super.onSpeedTest(trtcSpeedTestResult, i, i1); Map<String, Object> params = new HashMap<>(3, 1); params.put("currentResult",...
1
d0bccb029f2f4aec14e183e7e9dea1b9
24945e279eff439e8e1970aa6eacb7a5
Change whether the client has enabled its radio
ret_ad, args = jitter.func_args_stdcall(["hRadio", "fEnabled"]) raise RuntimeError('API not implemented') jitter.func_ret_stdcall(ret_ad, ret_value)
1
cefcba7523163cf7bd29c4a34279c1ec
08b2aa59d6e2ca20c0449890bfb9c41e
Make sure we can properly look up a game.
mock_find.return_value = sample_game result = self.client.get(f'/games/{sample_game_id}') self.assertEqual(result.status, '200 OK') self.assertIn(b'Cat images', result.data)
1
9d9e4a9a0ca0d210dcea33763da686d1
cb48e937f1f181527892eafacd758b67
订单自动分单(一分钟之内没有被人工分单的订单会被自动分单)(在线支付订单在没有收到支付通知前不能操作)
public void autoCancelOrder() throws ClientProtocolException, IllegalStateException, IOException, IllegalArgumentException, IllegalAccessException{ AppGoodsOrderService service = AppContextImpl.getInstance().getBean(AppGoodsOrderService.class); WxGoodsOrderService service2 = AppContextImpl.getInstance().getBean(Wx...
0
8ebbcc03268bbcacfa9859e9cd45eb6b
a08cb2320377b7a3cc1b95871f26eeee
Pad dictionary of tensors.
size = max(v.size(0) for v in values) res = values[0].new(len(values), size).fill_(pad_idx) def copy_tensor(src, dst): assert dst.numel() == src.numel() if move_eos_to_beginning: assert src[-1] == eos_idx dst[0] = eos_idx ds...
1
e1ef654de0694868a5daedb25fc52aa8
9382b73221bde5f79d40f56aa3e322ef
Call Flask's render template method.
class Handler(webapp2.RequestHandler): def render(self, template, **kw): self.write(self.render_str(template, **kw))
0
2db0f31aad92e7faf58db2c3115520b4
eb350cfe3dc93ed4a55bbe1ff04cdf65
@brief get number of quantization tables
{ JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index]; int prec; int i; if (qtbl == NULL) ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index); prec = 0; for (i = 0; i < DCTSIZE2; i++) { if (qtbl->quantval[i] > 255) prec = 1; } if (!qtbl->sent_table) { emit_marker(cinfo, M_DQT); emit_2bytes(cinfo, prec ? DCTSI...
0
b372441e3143d063f6a79ecd456c0136
e5aa35f64e8cb260b3bcd66bae52087b
Update method for visualize_beam_pointing_vectors, runs on each frame of the animation
def animationFrames(i): beam.set_ydata( w[i]*1000.0 ) Q1Loc.set_xdata(velocity*time[i]) Q2Loc.set_xdata(velocity*time[i]+wbase) return(beam, Q1Loc, Q2Loc)
1
415958887ee108ef56885d1566f91bbf
160e96e066d75e60061e875ba74ad818
验证年月日(yyyy-mm-dd)格式
class MY_Form_validation extends CI_Form_validation public function day($str) { $pattern = "/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/"; return preg_match($pattern, $str); }
1
5d81dddeb431456ba3c5931321c13b5f
de0a51de0879bb08a19ea7f51f7da13c
Handles an incoming add friend request
String userId = (String) friendId.get("senderID"); String friendEmail = (String) friendId.get("friendEmail"); String friendID = UserTable.getUserIDWithEmail(friendEmail); FriendsTable.addFriends(userId, friendID); }
1
9ac3bc8659789c78d3b0cd699ef0b962
9085524e7f70579e7c3d388c7dc140e6
Increment the allocated memory count.
static void zebra_alloc_inc (int type) { mstat[type].alloc++; }
1
b63a497ff0fa7ebe4c637b0eeb0c8c14
b47aee86b40e890f2da64205fce85632
prints null terminated string.
void prints(s) char* s; { while(*s != NULL) { putc(*s); s++; } }
1
0e6a3e796c293e867c8de4bf5226003e
dbe22a8fefc8c0a31b6ca4238defdd16
Returns no. of columns in the specified row
namespace Utilities int ColumnsCount(int rowNumber);
1
43c6fe3e81448123cadac666acacfb3c
240bfb78431efe1bf635e290f7cece79
gets the referenceFinancialDocumentNumber attribute value
public class ContractsGrantsLetterOfCreditReviewDetail extends PersistableBusinessObjectBase public String getDocumentNumber() { return documentNumber; }
0
d9f592bbe81e11f5d223ec66705c0ba1
728127f80cb1507fdcbaef456104cd73
ローカル通知を発行する
public class MainActivity extends FragmentActivity public void sendNotification(View v) { NotificationCompat.Builder builder = new NotificationCompat.Builder(this); builder.setSmallIcon(android.R.drawable.star_big_on); builder.setTicker("WWWWWWWWWWWWWWWWWWWWWWWWW"); builder.setContentTitle("WWWWWWWWWWWWWWWWW...
1
21c58fb8e2fe21f41fd9fa27097e6d57
6635e559954415f0cd7cc2815027499e
data available, enables data dependent widgets
class InitialDataSetsPickerF(tk.Frame): def enable(self): self._btn_add_data_set_picker.config(state='normal') self._lbl_title.config(state='normal') self._cb_delete_idsp.enable() for entry in self._idsp_input: entry.enable()
1
f986cbd57c06f9059e0f23335b9ac6fa
5e4680efd32a45c2580f24880520184f
Updates the morphtargets to have no influence on the object. Resets the morphTargetInfluences and morphTargetDictionary properties.
namespace UnrealEngine{public partial class UAnimInstance:UObject public void ClearMorphTargets() { CheckIsValid(); ClearMorphTargets(_this.Get()); }
1
9fcddec6515aa1e01ed9df1fad14dcf9
eda49d64aa90596d293c88224e79c343
Loads resources associated with this game component.
namespace SpaceInvaders.GameObjectSystem.Factories class PlayerFactory public void InitializeResources() { this.LoadSpriteAnimations(); this.SetupCollisionHierarchy(); }
1
f8a5b73bff6451394103db1f80099f87
e42646d18ae263e91bbafa6b4eec9889
将这个Buffer里的数据转换为字节码
public class DataBufferUtils public static byte[] dataBufferToByte(DataBuffer dataBuffer) { if (dataBuffer == null) { return new byte[]{}; } byte[] content = new byte[dataBuffer.readableByteCount()]; dataBuffer.read(content); org.springframework.core.io.buffer.DataBuf...
1
eff7f08e2b7200e4490c03cd268c4508
a75ed4ef7f73fc30997ea0907385980f
<p>The engine sent the "uciok" message indicating that it has finished sending the uci related information</p> <p>This message is received as a response to {@link UCIClient#sendUci()} command.</p>
void acknowledge();
0
32dd99d59b948df48ebec139c9958a80
2a33cb4ce991e009b80c3660dc927232
查询从startdate到enddate之间的课程记录
public List<CourRecord> QueryCourRecord(Date startdate,Date enddate)throws SQLException;
1
d32cd7917bf2293e9253bc13757d2c76
a9dd18219b8e316ffc4ed429016ad7a8
Intentionally empy - has nothing to delete
public class MapXYVespersToPDSConverter extends AbstractMapXYVespersConverter implements DataSource, Metadata, DataSize, PhysicalSize, FileFormat, ScanData, StdConverter @Override protected void deleteDestination() throws ConverterException { }
1
8e060b7ebc9fb14a275e8e866fa0bb42
1f1f68da414d458083ecb88cacbb6b5c
Find the node with minimum value in the tree and return its pointer.
struct node *get_min(struct BST *tree) { if (!tree) { return NULL; } return get_min_subtree_node(tree->root); }
1
22fee20638767dbf5ede6d7ac03d2a1c
55613360ff79cfb44185aa145618b472
Obtiene la primera columna de la primera fila
public class DB_Utility public static String getFirstRowFirstColumn(){ return getCellValue(1,1); }
1
2ef73841603f98f35c9a68f1743e9f63
f24369ea85fddf02c0fb575a2b01878f
Return all escalation paths
paths = [] for n, nbrs in self.SG.adjacency_iter(): for nbr, eattr in nbrs.items(): paths.append([n]+eattr['path']+[nbr]) return paths
1
f43647586d880d2c02b4283ee6746e1b
d745739ad0f5b65690f21438d4a55b91
method that creates a district one step away/flips one precinct
public class Algorithm extends MyAlgorithm private void updatePhase1(District updated, String districtRemoved) { currentDistrictUpdates.remove(districtRemoved); currentDistrictsToRemove.add(districtRemoved); currentDistrictUpdates.put(updated.getDistrictId(), updated.dto(false)); }
0
87120827b4567691fa867a4504dbb6b9
ebfe385c40e2bfb6887678797d922103
Displays the user information page that is shown to new users, sets the option to info
this.setState({ page: "Info", title: "Information", challenge: false }); this.updatePageCount(messageEvent, "Enter Info Page ", this.state.username); }
1
7dbc550a453ba74c6970bc2fdc669e40
505f83ce15922ad3a264f25ddb323b33
加载dst目录下的子目录到$t元素中
class FeatrueExtractmain: def __LoadTreeSubList(self, parentPath, root): if os.path.exists(parentPath) and os.path.isdir(parentPath): filelist = os.listdir(parentPath) for filename in filelist: absPath = os.path.join(parentPath,filename) treey = self.Fil...
1
260495bfbd2a7ac3612aaf6d387e2d50
73f65e6bc1d692bf6387777ae4247227
Grab metadata from evidence url - 5 second limit on request, otherwise save empty title/description
begin timeout(5) do begin doc = Nokogiri::HTML(open(self.url, allow_redirections: :safe)) og_title = doc.css("meta[property='og:title']") og_description = doc.css("meta[property='og:description']") self.title = og_title.first.attributes["content"] if og_title.le...
1
c31f1c612f3aa6e0b36018ba1c7a6c7f
dcafafbd80e754caaaafa234f92c8b47
Gets hash 512 alg name.
class PBKDF2Hashing(HashingBase): def _get_algorithm(self, **options): return 'PBKDF2'
0
5a0c9a01b77f9e33a9b31c5cc208e2e1
bf81b293dca393320ca11dd00cced434
删除纵向列合计
( params string[] columnNames ) { Validate.IsNotNull(columnNames); foreach (var name in columnNames) { var column = GetColumn(name); column.RemoveTotal(); } }
1
d040091bc0190f0f02e82e43ea64b82d
10b7cf7685159011e86b8d6ab071882f
判断是否是在微信里访问
if ((!$from && defined('IN_WEIXIN') && IN_WEIXIN) || isset ($_GET ['is_stree'])) return true; $agent = $_SERVER ['HTTP_USER_AGENT']; if (!strpos($agent, "icroMessenger")) { return false; } return true; }
1
64632398cb06cb4e49b87e9548804cd5
41a01ee8a264e2453687ee1147f2ecb5
Remove created directories during a rollback
public class DirectorySaveDataFileSystem : ISaveDataFileSystem protected override Result DoRollback() { if (_isJournalingSupported) { Result res = Initialize(_isJournalingSupported, _isMultiCommitSupported, _isJournalingEnabled, _timeStampGetter, _randomGenerator); ...
0
47087c496448408a72feb23e68265967
5d3a29d74ec3a58a67286b44badff8cf
==================== CreateArtFile Create the ART file ====================
{ int i, j; int len; int num; char tname[32]; char gname[32]; char title[32]; char msg[128]; char *fname = pu->file_name; sound_end(); len = (int)strlen(pu->file_name); for (i=0, j=0; i<len; i++) { if (fname[i] == '.' || fname[i] == '\n') { tname[j] = 0; break; } else { tname[j++] = fn...
0
0c83b61eb170b09f19bfd961a3f8b53b
b01d441aaa8dbd6b6f625ee59fd6efd3
处理标签后,继续处理JSP后面的内容
public class UserRightTag extends TagSupport{ @Override public int doEndTag() throws JspException { return EVAL_PAGE; }
1
96b94f77398b3e03044b21f54a40bcf8
56cf01930565d879cf1b77971522a19e
Get siecPlacowek value.
public function getPlace();
0
c15ad54f1e3a2761c6bdd955e83ec79b
6328de30466e31621aff451b15210593
method to print console streams to gui
throws ClassNotFoundException, IOException { while (client.isConnected()) { String message = (String) objectInput.readObject(); ConsoleWriter.write(message); clientGUI.setTextInTextField(message); } }
1
84abd1d4a0659b98ebdfb1b93da7fe1e
61f91d7a22321c2cc01fe5d04e27072c
セクタサイズを返す
{ if (size < 16) return false; sectSize = size; return true; }
0
f225c4cb901ab7f8595086b0b13c28db
082d4b2337b84fbf98f3ea7190b3d118
Fails if versions don't overlap.
assert check_version("1.19.2.4", "1.12.1") assert check_version("2.2.3.2", "1.12.1") assert check_version("1.19.2.4", "1.12.1", max_v="2.0") assert not check_version("2.2.3.2", "1.12.1", max_v="2.0")
1
eb77454568fb581964fe7270fd81eeb4
c05afc732d9542188b3d879a91145091
更新辅导员信息
public ResultInfo updateMentor(Mentor mentor) throws Exception;
1
112893f6cec82b22af62a0e9b52fe5f5
40894cc59323a58adadbb1e4a7d486c9
@brief ウィンドウクローズ時の確認処理を行う。 falseの場合、ウィンドウクローズ処理を続行する。
bool MainWindow::ConfirmExit() { Gtk::MessageDialog dialog(*this, "終了してもよろしいですか?", false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_OK_CANCEL, true); dialog.set_title("確認"); return dialog.run() != Gtk::RESPONSE_OK; }
1
9555c2fe25b5b5f07459f966b376e896
67b8676ab66519c44ca6d0c3b1a93646
用于钝化{@link PreparedStatement}或{@link CallableStatement}的{@link KeyedPooledObjectFactory}方法. 调用 {@link PreparedStatement#clearParameters}.
public class PrepStmt extends Stmt @SuppressWarnings("resource") public PrepStmt clearParams() throws JdbxException { Unchecked.run(getJdbcStmt()::clearParameters); return this; }
1
9409f3bc24b4ddea42f6c4ce7d86326f
d642112de9c208db4fabaab6e8c355e5
Exception if worker is disqualified on a job.
player_name = self.uuids_to_name[player] error_msg = f"Player {player_name} is disqualified." self._notify_observers_error_msg(error_msg)
0
38f0a66c2be0159015fc784ae0c697ca
ef3c4fdaefa0d8bd925c94a4f1a4bae0
Initilaize the BME680 Sensor
if (config_.UseSpi) { Bme_ = new BME280(SPI,config_.CsPin); } else { Bme_ = new BME280(Wire1,config_.Addr); } if (Bme_->begin() < 0) { while(1){ Serial.println("ERROR: Failed to initialize BME280"); } } }
0
75baf41d473e5742510464c133207874
44dcbb78cf0e04d0d662d2b53c96e43f
We need to clone all blocks which belong to multiple funclets. Values are remapped throughout the funclet to propogate both the new instructions *and* the new basic blocks themselves.
{ for( Function::iterator i = func->begin(); i != func->end(); ++i ) { data.addBasicBlock( &*i ); for (BasicBlock::iterator j = i->begin(), e = i->end(); j != e; ++j) { if ( isa < Instruction >( *j ) ) ...
0
739f88695c56286dcb377129f2ed4430
834ab682af0d8248b0246a8cc08c96fe
Sets the sessionList of the current Stats object to the given newSessionList.
@SuppressWarnings("serial") public class Speaker implements Serializable public void setSessionIds(List<String> sessionIds) { this.sessionIds = sessionIds; }
0
c7369bccf39b76bf0574154f4082cab3
653f14f8302669f0858b491d535ee558
test for leaking goroutines
for i := 0; i < 1000; i++ { go func(i int) { for { fmt.Println("[", i, "]") } }(i) } time.Sleep(time.Minute) }
1
42a36fc77b2fe456502067cba5606446
04264b8c402230cf873fdf58a6acb1f2
Returns description of a meta data element
public static function getDescription($value);
1
f4ac30c2cb025a7abb5ce1acb0961c07
707a704683482cb8373ef9e5bf70f2db
Inicializa las variables de posicion X y Y
ngOnInit() { this.x_pos = 0; this.y_pos = 0; }
1
7e997f27686121598c37485485dddeea
2790817949b8562478ee25e59efa748c
resolve TSP problem with Dynamic Programming Algorithm
def DynamicTSP(cities): cityIndices = np.arange(len(cities)) pre = {} post = {} subproblemKeys = {} subproblemKeysPre = {} distances = np.zeros((len(cities), len(cities))) for i in range(len(cities)): for j in range(len(cities)): distances[i,j] = DistanceBetween(cities[...
1
4c8211977ec5943a67053d66615c1137
c5049d78587a843e961ae7a964cf5f94
ルームに誰かが入ると呼ばれる
public class RoomManager : Photon.MonoBehaviour void OnJoinedRoom() { Debug.Log(">> ルーム参加"); OwnerPlayer = PhotonNetwork.masterClient; debugField.text = "Owner : " + OwnerPlayer.ID + "\n"; var index = PhotonNetwork.playerList.Length - 1; switch (type) { ca...
1
40791846d9674bcd637195b36c68bd24
1aa983c2d2a2451d5413f377cb1a33bd
Getting binary from decimal
class Gmp public static function gmpD2B($dec) { if (substr(strtolower($dec), 0, 2) == '0x') { $dec = Util::decodeHex(substr($dec, 2)); } $bin = ''; while (gmp_cmp($dec, '0') > 0) { if (gmp_mod($dec, 2) == '1') { $bin .= '1'; } else...
1
50b852314761776071450afce6fc2408
2b95d2237f9b8eeb8a410fefa99166d0
Soap服务查询
function getSoap(query) { return fetch({ url: '/dsb/admin/service/retrieve/soap', method: 'post', params: query }) }
1